Commit ca8c017d authored by Ramiro Estrugo's avatar Ramiro Estrugo

Simplify the freetype2 detection insanity by using autoconf macro

	* autogen.sh:
	* configure.in:
	Simplify the freetype2 detection insanity by using autoconf macro
	technology.  The new test should work with both FreeType2 RPMS as
	well as freetype built from source in any prefix.
parent 324478bb
2001-05-01 Ramiro Estrugo <ramiro@eazel.com>
* autogen.sh:
* configure.in:
Simplify the freetype2 detection insanity by using autoconf macro
technology. The new test should work with both FreeType2 RPMS as
well as freetype built from source in any prefix.
2001-05-01 Darin Adler <darin@eazel.com>
* configure.in:
......
#!/bin/sh
# Run this to generate all the initial makefiles, etc.
# This was lifted from the Gimp, and adapted slightly by
# Raph Levien <raph@acm.org>.
DIE=0
srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.
ORIGDIR=`pwd`
cd $srcdir
PROJECT=librsvg
TEST_TYPE=-f
FILE=rsvg.c
DIE=0
(autoconf --version) < /dev/null > /dev/null 2>&1 || {
echo
......@@ -17,11 +21,10 @@ PROJECT=librsvg
DIE=1
}
# Do we really need libtool?
(libtool --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "You must have libtool installed to compile $PROJECT."
echo "Get ftp://ftp.gnu.org/pub/gnu/libtool-1.2.tar.gz"
echo "Get ftp://alpha.gnu.org/gnu/libtool-1.0h.tar.gz"
echo "(or a newer version if it is available)"
DIE=1
}
......@@ -29,35 +32,76 @@ PROJECT=librsvg
(automake --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "You must have automake installed to compile $PROJECT."
echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
echo "Get ftp://ftp.cygnus.com/pub/home/tromey/automake-1.2d.tar.gz"
echo "(or a newer version if it is available)"
DIE=1
}
(xml-i18n-toolize --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "You must have xml-i18n-tools installed to compile $PROJECT."
}
if test "$DIE" -eq 1; then
exit 1
fi
test $TEST_TYPE $FILE || {
echo "You must run this script in the top-level $PROJECT directory"
exit 1
}
if test -z "$*"; then
echo "I am going to run ./configure with no arguments - if you wish "
echo "to pass any to it, please specify them on the $0 command line."
fi
case $CC in
xlc )
am_opt=--include-deps;;
*lcc | *lcc\ *) am_opt=--include-deps;;
esac
for dir in $srcdir
do
echo processing $dir
(cd $dir; \
aclocalinclude="$ACLOCAL_FLAGS"; \
aclocal $aclocalinclude; \
autoheader; automake --add-missing --gnu $am_opt; autoconf)
done
echo "Running gettextize... Ignore non-fatal messages."
# Hmm, we specify --force here, since otherwise things don't
# get added reliably, but we don't want to overwrite intl
# while making dist.
echo "no" | gettextize --copy --force
echo "Running xml-i18n-toolize"
xml-i18n-toolize --copy --force --automake
echo "Running libtoolize"
libtoolize --copy --force
$srcdir/configure "$@"
if test -z "$GNOME_INTERFACE_VERSION"; then
ACLOCAL_FLAGS="-I hack-macros $ACLOCAL_FLAGS"
fi
aclocal $ACLOCAL_FLAGS
# optionally feature autoheader
(autoheader --version) < /dev/null > /dev/null 2>&1 && autoheader
automake -a $am_opt
autoconf
cd $ORIGDIR
if [ "`whoami`" = "sopwith" ]; then
SOPWITH_FLAGS_HACK="--enable-fatal-warnings=no --enable-more-warnings=no"
fi
$srcdir/configure --enable-maintainer-mode "$@" $SOPWITH_FLAGS_HACK
rv=$?
if [ $rv -eq 0 ]
then
echo
echo "Now type 'make' to compile $PROJECT."
exit 0
fi
echo
echo "Now type 'make' to compile $PROJECT."
echo
echo "There was a problem running $srcdir/configure for $PROJECT."
exit 1
......@@ -5,9 +5,12 @@ LIBART_REQUIRED=2.2.0
GLIB_REQUIRED=1.2.9
GTK_REQUIRED=1.2.9
FREETYPE_REQUIRED=2.0.1
FREETYPE_LIBRARY_REQUIRED=6.1.0
GDK_PIXBUF_REQUIRED=0.10.0
POPT_REQUIRED=1.5
dnl ====================================
AM_CONFIG_HEADER(config.h)
LIBRSVG_MAJOR_VERSION=0
......@@ -41,67 +44,6 @@ AC_SUBST(GTK_REQUIRED)
AC_SUBST(FREETYPE_REQUIRED)
AC_SUBST(POPT_REQUIRED)
dnl ===========================================================================
dnl EAZEL_VERSION_CANON(version)
dnl 1
AC_DEFUN(EAZEL_VERSION_CANON, [`
dnl Assumes that there are no more than 999 revisions at a level,
dnl no more than three levels of revision.
dnl
dnl Any more than that, and test starts messing up the numeric
dnl comparisons because its integers overflow, and there's no
dnl way to do string comparisons in the shell. Grr.
dnl
dnl Must come up with some way to fix this.
echo "$1" |
tr . '\012' |
sed -e 's/^/000/' -e 's/^.*\(...\)/\1/' |
tr -d '\012' |
sed 's/$/000000000/
s/^\(.........\).*/\1/'
`])
dnl EAZEL_VERSION_INSIST(package, get-version-cmd, operator, want-version-var)
dnl 1 2 3 4
AC_DEFUN(EAZEL_VERSION_INSIST, [
ez_want_version=[$]$4
case "$3" in
">") ez_operator=-gt ;;
">=") ez_operator=-ge ;;
"<") ez_operator=-lt ;;
"<=") ez_operator=-le ;;
"=") ez_operator=-eq ;;
"!=") ez_operator=-ne ;;
*) AC_ERROR(Unknown operator $3 in configure script) ;;
esac
AC_MSG_CHECKING(for $1 $3 [$ez_want_version])
if ez_installed_version="`$2`"
then
AC_MSG_RESULT([$ez_installed_version])
else
AC_ERROR($2 failed)
fi
if test "EAZEL_VERSION_CANON([$ez_installed_version])" "$ez_operator" \
"EAZEL_VERSION_CANON([$ez_want_version])"
then
:
AC_SUBST($4)
else
AC_ERROR($1 version [$ez_want_version] is required.)
fi
])
dnl ===========================================================================
dnl ====================================
dnl = Begin tests for popt
dnl ====================================
......@@ -207,69 +149,15 @@ dnl ====================================
dnl = end gdk-pixbuf checks
dnl ====================================
dnl ====================================
dnl = Begin tests for FreeType2
dnl ====================================
FREETYPE2_CFLAGS=
FREETYPE2_LIBS=
_found_freetype2_lib="no"
_found_freetype2_header="no"
_found_freetype2="no"
AC_ARG_WITH(freetype2-libraries,
[ --with-freetype2-libraries=PATH freetype2 library path],
freetype2_lib_prefix=$withval)
AC_ARG_WITH(freetype2-includes,
[ --with-freetype2-includes=PATH freetype2 include path],
freetype2_include_prefix=$withval)
AC_ARG_WITH(freetype2-prefix,
[ --with-freetype2-prefix=PATH freetype2 installation prefix],
freetype2_prefix=$withval, freetype2_prefix="/usr")
if test -z "$freetype2_include_prefix"; then
freetype2_include_prefix="${freetype2_prefix}/include/freetype2"
fi
if test -z "$freetype2_lib_prefix"; then
freetype2_lib_prefix="${freetype2_prefix}/lib"
fi
_save_cpp="$CPP"
_save_ldflags="$LDFLAGS"
CPP="$_save_cpp -I$freetype2_include_prefix"
LDFLAGS="$_save_ldflags -L$freetype2_lib_prefix"
AC_CHECK_HEADER(freetype/freetype.h, _found_freetype2_header="yes")
AC_CHECK_LIB(freetype, FT_Init_FreeType, [_found_freetype2_lib="yes"])
CPP="$_save_cpp"
LDFLAGS="$_save_ldflags"
if test "x$_found_freetype2_lib" = "xyes" -a \
"x$_found_freetype2_header" = "xyes"
then
_found_freetype2="yes"
fi
if test "x$_found_freetype2" != "xyes"
then
dnl =======================
dnl = begin tests for FreeType2
dnl =======================
NAUTILUS_PATH_FREETYPE2($FREETYPE_LIBRARY_REQUIRED,,
AC_MSG_ERROR([
*** FreeType2 is required. You can obtain a packaged version of FreeType2
*** over here: http://developer.eazel.com/eazel-hacking/updates/freetype2
*** source versions are available from ftp://ftp.freetype.org])
fi
if test -n "$freetype2_prefix"; then
FREETYPE_CONFIG="$freetype2_prefix/bin/freetype-config"
else
FREETYPE_CONFIG="freetype-config"
fi
dnl check for the necessary library version
EAZEL_VERSION_INSIST(freetype library, $FREETYPE_CONFIG --version | tr : ., >=, FREETYPE_LIBRARY_REQUIRED)
FREETYPE2_CFLAGS="-I$freetype2_include_prefix"
FREETYPE2_LIBS="-L$freetype2_lib_prefix -lfreetype"
*** FreeType2 $FREETYPE_REQUIRED or better is required. You can obtain a
*** packaged version of FreeType2 over here:
*** http://developer.eazel.com/eazel-hacking/updates/freetype2
*** source versions are available from ftp://ftp.freetype.org]))
AC_SUBST(FREETYPE2_CFLAGS)
AC_SUBST(FREETYPE2_LIBS)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment