dnl Process this file with autoconf to produce a configure script. AC_INIT(src/main.c) dnl check for --with options FIGURINE_EXTRA_PATHS dnl Checks for programs. AC_PROG_CC AC_MINIX AC_ISC_POSIX AC_MSG_CHECKING("whether $CC accepts -Wall") SAVE_CFLAGS=$CFLAGS CFLAGS="-Wall $CFLAGS" AC_TRY_COMPILE(,,AC_MSG_RESULT("yes"),AC_MSG_RESULT("no");CFLAGS=$SAVE_CFLAGS) AC_ARG_PROGRAM AC_PROG_INSTALL AM_INIT_AUTOMAKE(figurine, 1.0.5) dnl Checks for libraries. dnl we need the following line to allow out of place libXpm CPPFLAGS="$CPPFLAGS $extra_libraries" # maintainer's glibc20 compat rpm AC_ARG_WITH(glibc20, [ --with-glibc20 Maintainer only], CC=i386-glibc20-linux-gcc RPMRELEASE=glibc20 GLIBC2_0_OPTION=--with-glibc20 echo "Using compatibility gcc $CC" , RPMRELEASE=glibc21 GLIBC2_0_OPTION= ) AC_SUBST(RPMRELEASE) AC_SUBST(GLIBC2_0_OPTION) dnl Checks for header files. AC_PATH_XTRA AC_HEADER_DIRENT AC_HEADER_STDC AC_CHECK_HEADERS(limits.h sys/time.h unistd.h) dnl Attempt to determine a suitable xpm.h SAVE_CPPFLAGS=$CPPFLAGS if test -z "$x_includes" then CPPFLAGS="-Isrc/ $CPPFLAGS" else CPPFLAGS="-Isrc/ -I$x_includes $CPPFLAGS" fi AC_CHECK_HEADERS(X11/xpm.h xpm.h) CPPFLAGS=$SAVE_CPPFLAGS if test "$ac_cv_header_X11_xpm_h" = "no" -a "$ac_cv_header_xpm_h" = "no" then echo "Error: could not find xpm.h header." echo echo "Please see the file INSTALL which describes" echo "how to use --with-extra-includes" exit 1 fi dnl Checks for typedefs, structures, and compiler characteristics. AM_C_PROTOTYPES AC_C_CONST AC_C_INLINE AC_HEADER_TIME AC_TYPE_UID_T LIBS="$X_LIBS -lX11 $X_EXTRA_LIBS $LIBS -lm" CFLAGS="$X_CFLAGS $CFLAGS" AC_CHECK_LIB(X11,XSetWMNormalHints, true, echo "Error: figurine requires at least X11 Release 4." echo exit 1) dnl Checks for library functions. AC_CHECK_FUNCS(getcwd gethostname usleep) dnl The user can specify XPMLIB as the library file to use dnl when libXpm is not available on the library path AC_CHECK_LIB(Xpm,XpmCreatePixmapFromData, LIBS="-lXpm $LIBS" , echo "Error: could not find Xpm library." echo echo "Please see the file INSTALL" exit 1 ) dnl for the man page DATE="`date '+%a %d %B %Y'`" AC_SUBST(DATE) dnl this is just a hack to give us a usable dnl $prefix earlier in the script than usual, for the dnl case when datadir has not been specified separately, dnl and neither has prefix if test "$prefix" = "NONE" then prefix=$ac_default_prefix fi DOCDIR=`eval echo $datadir` DOCDIR=`echo $DOCDIR | sed 's+/$++g'` AC_SUBST(DOCDIR) AC_OUTPUT(Doc/Makefile Makefile examples/Makefile src/Makefile figurine.spec figurine.1)