diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | acconfig.h | 16 | ||||
-rwxr-xr-x | autogen.sh | 77 | ||||
-rw-r--r-- | configure.in | 18 | ||||
-rw-r--r-- | libast.m4 | 52 |
5 files changed, 96 insertions, 72 deletions
@@ -628,3 +628,8 @@ Mon Mar 1 21:22:21 2004 Michael Jennings (mej) New SRPM ---------------------------------------------------------------------- +Wed Mar 3 12:25:22 2004 Michael Jennings (mej) + +New and improved autogen stuff. Prefers autoconf 2.13 and automake +1.4, but it's also been tested with autoconf 2.57 and automake 1.6.3. +---------------------------------------------------------------------- diff --git a/acconfig.h b/acconfig.h deleted file mode 100644 index 93ddd8f..0000000 --- a/acconfig.h +++ /dev/null @@ -1,16 +0,0 @@ -#undef LIBAST_VERSION -#undef DEBUG -#undef AUTHORS -#undef LIBAST_X11_SUPPORT -#undef LIBAST_IMLIB2_SUPPORT -#undef LIBAST_MMX_SUPPORT -#undef LIBAST_REGEXP_SUPPORT_PCRE -#undef LIBAST_REGEXP_SUPPORT_POSIX -#undef LIBAST_REGEXP_SUPPORT_BSD -#undef ALLOW_BACKQUOTE_EXEC -#undef HAVE_RLIMIT_MEMLOCK -#undef HAVE_RLIMIT_NPROC -#undef HAVE_SYMLINK_OPEN_ERRNO_BUG -#undef HAVE_SYMLINK_OPEN_SECURITY_HOLE -#undef HAVE_SNPRINTF_BUG -#undef HAVE_VSNPRINTF_BUG @@ -2,46 +2,63 @@ # Run this to generate all the initial makefiles, etc. # $Id$ +broken() { + echo + echo "You need libtool, autoconf, and automake. Install them" + echo "and try again. Get source at ftp://ftp.gnu.org/pub/gnu/" + echo "ERROR: $1 not found." + exit -1 +} + DIE=0 echo "Generating configuration files for libast, please wait...." -(autoconf --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "You must have autoconf installed to compile libast." - echo "Download the appropriate package for your distribution," - echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" - DIE=1 -} +LIBTOOLIZE_CHOICES="$LIBTOOLIZE libtoolize" +AUTOHEADER_CHOICES="$AUTOHEADER autoheader213 autoheader-2.13 autoheader" +ACLOCAL_CHOICES="$ACLOCAL aclocal14 aclocal-1.4 aclocal" +AUTOMAKE_CHOICES="$AUTOMAKE automake14 automake-1.4 automake" +AUTOCONF_CHOICES="$AUTOCONF autoconf213 autoconf-2.13 autoconf" -(libtoolize --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "You must have libtool installed to compile libast." - echo "Download the appropriate package for your distribution," - echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" - DIE=1 -} +for i in $LIBTOOLIZE_CHOICES ; do + $i --version </dev/null >/dev/null 2>&1 && LIBTOOLIZE=$i && break +done +[ "x$LIBTOOLIZE" = "x" ] && broken libtool -(automake --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "You must have automake installed to compile libast." - echo "Download the appropriate package for your distribution," - echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" - DIE=1 -} +for i in $AUTOHEADER_CHOICES ; do + $i --version </dev/null >/dev/null 2>&1 && AUTOHEADER=$i && break +done +[ "x$AUTOHEADER" = "x" ] && broken autoconf -if test "$DIE" -eq 1; then - exit 1 -fi +for i in $ACLOCAL_CHOICES ; do + $i --version </dev/null >/dev/null 2>&1 && ACLOCAL=$i && break +done +[ "x$ACLOCAL" = "x" ] && broken automake + +for i in $AUTOMAKE_CHOICES ; do + $i --version </dev/null >/dev/null 2>&1 && AUTOMAKE=$i && break +done +[ "x$AUTOMAKE" = "x" ] && broken automake + +for i in $AUTOCONF_CHOICES ; do + $i --version </dev/null >/dev/null 2>&1 && AUTOCONF=$i && break +done +[ "x$AUTOCONF" = "x" ] && broken autoconf + +# Export them so configure can AC_SUBST() them. +export LIBTOOLIZE AUTOHEADER ACLOCAL AUTOMAKE AUTOCONF -if test ! -f "`aclocal --print-ac-dir`/libast.m4"; then +# Check for existing libast.m4 we can use. Use the local one if not. +if test ! -f "`$ACLOCAL --print-ac-dir`/libast.m4"; then ACLOCAL_FLAGS="-I . $ACLOCAL_FLAGS" fi -(set -x && libtoolize -c -f) -(set -x && autoheader) -(set -x && aclocal $ACLOCAL_FLAGS) -(set -x && automake -a -c) -(set -x && autoconf) +# Run the stuff. +(set -x && $LIBTOOLIZE -c -f) +(set -x && $AUTOHEADER) +(set -x && $ACLOCAL $ACLOCAL_FLAGS) +(set -x && $AUTOMAKE -a -c) +(set -x && $AUTOCONF) +# Run configure. ./configure "$@" diff --git a/configure.in b/configure.in index b1cf77f..7c36ea1 100644 --- a/configure.in +++ b/configure.in @@ -1,10 +1,28 @@ dnl# $Id$ +AC_SUBST(LIBTOOLIZE) +AC_SUBST(AUTOHEADER) +AC_SUBST(ACLOCAL) +AC_SUBST(AUTOMAKE) +AC_SUBST(AUTOCONF) + +SAVE_LIBTOOLIZE="$LIBTOOLIZE" +SAVE_AUTOHEADER="$AUTOHEADER" +SAVE_ACLOCAL="$ACLOCAL" +SAVE_AUTOMAKE="$AUTOMAKE" +SAVE_AUTOCONF="$AUTOCONF" + AC_INIT(configure.in) AM_INIT_AUTOMAKE(libast, 0.6) AC_DEFINE_UNQUOTED(LIBAST_VERSION, "$VERSION", [Version]) AM_CONFIG_HEADER(config.h include/libast/sysdefs.h) +LIBTOOLIZE="$SAVE_LIBTOOLIZE" +AUTOHEADER="$SAVE_AUTOHEADER" +ACLOCAL="$SAVE_ACLOCAL" +AUTOMAKE="$SAVE_AUTOMAKE" +AUTOCONF="$SAVE_AUTOCONF" + dnl# Set some basic variables AUTHORS="Michael Jennings (mej@eterm.org)" AC_SUBST(AUTHORS) @@ -46,19 +46,19 @@ AC_DEFUN(AST_CHECK_LIBAST, [ if test "${$1}" -eq "1"; then if test ! -z "$LIBAST_CONFIG"; then $2="-last ${$2}" - AC_DEFINE(HAVE_LIBAST, 1, [HAVE_LIBAST]) + AC_DEFINE(HAVE_LIBAST, 1, [Define if the LibAST library is present.]) test "$prefix" = "NONE" && prefix="`$LIBAST_CONFIG --prefix`" SUPPORT_FLAGS="`$LIBAST_CONFIG --support`" for i in $SUPPORT_FLAGS ; do case $i in MMX) - AC_DEFINE(LIBAST_MMX_SUPPORT, 1, [LIBAST_MMX_SUPPORT]) + AC_DEFINE(LIBAST_MMX_SUPPORT, 1, [Defined if LibAST has MMX support.]) ;; X11) - AC_DEFINE(LIBAST_X11_SUPPORT, 1, [LIBAST_X11_SUPPORT]) + AC_DEFINE(LIBAST_X11_SUPPORT, 1, [Defined if LibAST has X11 support.]) ;; Imlib2) - AC_DEFINE(LIBAST_IMLIB2_SUPPORT, 1, [LIBAST_IMLIB2_SUPPORT]) + AC_DEFINE(LIBAST_IMLIB2_SUPPORT, 1, [Defined if LibAST has Imlib2 support.]) ;; esac done @@ -97,7 +97,7 @@ AC_DEFUN(AST_REGEXP_SUPPORT, [ ]) AC_SEARCH_LIBS(pcre_compile, pcre, [GOT_PCRE_LIB=1]) if test $GOT_PCRE_HEADER -eq 1 -a $GOT_PCRE_LIB -eq 1 ; then - AC_DEFINE(LIBAST_REGEXP_SUPPORT_PCRE, 1, [LIBAST_REGEXP_SUPPORT_PCRE]) + AC_DEFINE(LIBAST_REGEXP_SUPPORT_PCRE, 1, [Build LibAST with PCRE support.]) LIBAST_REGEXP_SUPPORT="regexp-pcre" $1="pcre" else @@ -113,7 +113,7 @@ AC_DEFUN(AST_REGEXP_SUPPORT, [ ]) AC_SEARCH_LIBS(regcomp, posix regexp regex re, [GOT_POSIXREGEXP_LIB=1]) if test $GOT_POSIXREGEXP_HEADER -eq 1 -a $GOT_POSIXREGEXP_LIB -eq 1 ; then - AC_DEFINE(LIBAST_REGEXP_SUPPORT_POSIX, 1, [LIBAST_REGEXP_SUPPORT_POSIX]) + AC_DEFINE(LIBAST_REGEXP_SUPPORT_POSIX, 1, [Build LibAST with POSIX-style regexp support.]) LIBAST_REGEXP_SUPPORT="regexp-posix" $1="posix" else @@ -129,7 +129,7 @@ AC_DEFUN(AST_REGEXP_SUPPORT, [ ]) AC_SEARCH_LIBS(re_comp, bsd ucb regexp regex re, [GOT_BSD_LIB=1]) if test $GOT_BSD_HEADER -eq 1 -a $GOT_BSD_LIB -eq 1 ; then - AC_DEFINE(LIBAST_REGEXP_SUPPORT_BSD, 1, [LIBAST_REGEXP_SUPPORT_BSD]) + AC_DEFINE(LIBAST_REGEXP_SUPPORT_BSD, 1, [Build LibAST with BSD-style regexp support.]) LIBAST_REGEXP_SUPPORT="regexp-bsd" $1="bsd" else @@ -171,7 +171,7 @@ AC_DEFUN(AST_X11_SUPPORT, [ AC_CHECK_LIB(X11, XOpenDisplay, [ LIBAST_X11_SUPPORT="X11" GRLIBS="-lX11" - AC_DEFINE(LIBAST_X11_SUPPORT, 1, [LIBAST_X11_SUPPORT]) + AC_DEFINE(LIBAST_X11_SUPPORT, 1, [Define for X11 support.]) ]) fi AC_SUBST(LIBAST_X11_SUPPORT) @@ -208,7 +208,7 @@ AC_DEFUN(AST_IMLIB2_SUPPORT, [ AC_CHECK_LIB(freetype, FT_Init_FreeType, GRLIBS="-lfreetype $GRLIBS", , $GRLIBS) AC_CHECK_LIB(Imlib2, imlib_create_image, [ GRLIBS="-lImlib2 $GRLIBS" - AC_DEFINE(LIBAST_IMLIB2_SUPPORT, 1, [LIBAST_IMLIB2_SUPPORT]) + AC_DEFINE(LIBAST_IMLIB2_SUPPORT, 1, [Define for Imlib2 support.]) LIBAST_IMLIB2_SUPPORT="Imlib2" ], [ AC_WARN(*** Imlib2 support has been disabled because Imlib2 ***) @@ -235,7 +235,7 @@ AC_DEFUN(AST_MMX_SUPPORT, [ LIBAST_MMX_SUPPORT="" if test -n "$HAVE_MMX"; then AC_MSG_RESULT(yes) - AC_DEFINE(LIBAST_MMX_SUPPORT, 1, [LIBAST_MMX_SUPPORT]) + AC_DEFINE(LIBAST_MMX_SUPPORT, 1, [Define for MMX support.]) LIBAST_MMX_SUPPORT="MMX" else AC_MSG_RESULT(no) @@ -351,16 +351,16 @@ AC_DEFUN(AST_ARG_DEBUG, [ fi if test "$withval" != "no"; then AC_MSG_RESULT($withval) - AC_DEFINE_UNQUOTED($1, $withval, [Blah]) + AC_DEFINE_UNQUOTED($1, $withval, [Specify level of debugging to compile in.]) $1=$withval else AC_MSG_RESULT(no, disabling all debugging support) - AC_DEFINE_UNQUOTED($1, 0, [BlahBlah]) + AC_DEFINE_UNQUOTED($1, 0, [Specify level of debugging to compile in.]) $1=0 fi ], [ AC_MSG_RESULT(4) - AC_DEFINE_UNQUOTED($1, 4, [BlahBlahBlah]) + AC_DEFINE_UNQUOTED($1, 4, [Specify level of debugging to compile in.]) $1=4 ]) ]) @@ -382,12 +382,12 @@ AC_DEFUN(AST_ARG_BACKQUOTE_EXEC, [ $1=no else AC_MSG_RESULT(yes) - AC_DEFINE($1, 1, [Foo]) + AC_DEFINE($1, 1, [Define for backquote execution.]) $1=yes fi ], [ AC_MSG_RESULT(yes) - AC_DEFINE($1, 1, [Bar]) + AC_DEFINE($1, 1, [Define for backquote execution.]) $1=yes ]) ]) @@ -462,10 +462,10 @@ exit(0); AC_MSG_RESULT([no, snprintf is ok]) elif test $dps_cv_snprint_bug -eq 1; then AC_MSG_RESULT([yes, snprintf is broken]) - AC_DEFINE(HAVE_SNPRINTF_BUG, 1, [HAVE_SNPRINTF_BUG]) + AC_DEFINE(HAVE_SNPRINTF_BUG, 1, [Defined if libc snprintf is buggy.]) else AC_MSG_RESULT([unknown, assuming yes]) - AC_DEFINE(HAVE_SNPRINTF_BUG, 1, [HAVE_SNPRINTF_BUG]) + AC_DEFINE(HAVE_SNPRINTF_BUG, 1, [Defined if libc snprintf is buggy.]) fi ]) @@ -508,10 +508,10 @@ int main(void) AC_MSG_RESULT([no, vsnprintf is ok]) elif test $dps_cv_vsnprintf_bug -eq 1; then AC_MSG_RESULT([yes, vsnprintf is broken]) - AC_DEFINE(HAVE_VSNPRINTF_BUG,1, [HAVE_VSNPRINTF_BUG]) + AC_DEFINE(HAVE_VSNPRINTF_BUG,1, [Defined if libc vsnprintf is buggy.]) else AC_MSG_RESULT([unknown, assuming yes]) - AC_DEFINE(HAVE_VSNPRINTF_BUG,1, [HAVE_VSNPRINTF_BUG]) + AC_DEFINE(HAVE_VSNPRINTF_BUG,1, [Defined if libc vsnprintf is buggy.]) fi ]) @@ -577,13 +577,13 @@ int main(void) case "$dps_cv_symlink_open_bug" in 0) AC_MSG_RESULT(secure) ;; 1) AC_MSG_RESULT(errno wrong but ok) - AC_DEFINE(HAVE_SYMLINK_OPEN_ERRNO_BUG, 1, [HAVE_SYMLINK_OPEN_ERRNO_BUG]) ;; + AC_DEFINE(HAVE_SYMLINK_OPEN_ERRNO_BUG, 1, [Defined if symlink open() errno is wrong but safe.]) ;; 2) AC_MSG_RESULT(insecure) - AC_DEFINE(HAVE_SYMLINK_OPEN_SECURITY_HOLE, 1, [HAVE_SYMLINK_OPEN_SECURITY_HOLE]) - AC_DEFINE(HAVE_SYMLINK_OPEN_ERRNO_BUG, 1, [HAVE_SYMLINK_OPEN_ERRNO_BUG]) ;; + AC_DEFINE(HAVE_SYMLINK_OPEN_SECURITY_HOLE, 1, [Defined if symlink open() is a security risk.]) + AC_DEFINE(HAVE_SYMLINK_OPEN_ERRNO_BUG, 1, [Defined if symlink open() is buggy.]) ;; 3) AC_MSG_RESULT(assuming insecure) - AC_DEFINE(HAVE_SYMLINK_OPEN_SECURITY_HOLE, 1, [HAVE_SYMLINK_OPEN_SECURITY_HOLE]) - AC_DEFINE(HAVE_SYMLINK_OPEN_ERRNO_BUG, 1, [HAVE_SYMLINK_OPEN_ERRNO_BUG]) ;; + AC_DEFINE(HAVE_SYMLINK_OPEN_SECURITY_HOLE, 1, [Defined if symlink open() is a security risk.]) + AC_DEFINE(HAVE_SYMLINK_OPEN_ERRNO_BUG, 1, [Defined if symlink open() is buggy.]) ;; *) AC_MSG_RESULT($dps_cv_symlink_open_bug) AC_MSG_ERROR(Impossible value of dps_cv_symlink_open_bug) ;; esac @@ -629,7 +629,7 @@ int main(void) ]) if test $dps_cv_rlimit_nproc -eq 0; then AC_MSG_RESULT([yes]) - AC_DEFINE(HAVE_RLIMIT_NPROC,1, [HAVE_RLIMIT_NPROC]) + AC_DEFINE(HAVE_RLIMIT_NPROC, 1, [Defined if the RLIMIT_NPROC resource limit works.]) elif test $dps_cv_rlimit_nproc -eq 1; then AC_MSG_RESULT([no]) else @@ -679,7 +679,7 @@ exit(1); ]) if test $dps_cv_rlimit_memlock -eq 0; then AC_MSG_RESULT([yes]) - AC_DEFINE(HAVE_RLIMIT_MEMLOCK,1, [HAVE_RLIMIT_MEMLOCK]) + AC_DEFINE(HAVE_RLIMIT_MEMLOCK,1, [Defined if the RLIMIT_MEMLOCK resource limit works.]) elif test $dps_cv_rlimit_memlock -eq 1; then AC_MSG_RESULT([no]) else |