dnl Process this file with autoconf to produce a configure script. AC_INIT(src/mail.c) AM_CONFIG_HEADER(config.h) AM_INIT_AUTOMAKE(jpilot-Mail, 0.0.5) AC_PREFIX_DEFAULT(/usr) dnl Checks for programs. dnl Checks for libraries. AC_ISC_POSIX AC_PROG_CC AC_STDC_HEADERS AC_ARG_PROGRAM AC_PROG_RANLIB AM_PROG_LIBTOOL dnl checks necessary for libc5: dnl if there is res_search in libc, it is probably libc5 dnl if not, it is probably libc6 and we need libresolv AC_CHECK_LIB(c, res_search, need_resolv=no, need_resolv=yes) if test "$need_resolv" = yes; then AC_CHECK_LIB(resolv, res_search,has_resolv=yes,AC_MSG_ERROR("no libresolv")) RESOLV_LIBS='-lresolv' else RESOLV_LIBS='' fi AC_SUBST(RESOLV_LIBS) dnl if there is no getline, we define it using getdelim in src/masqmail.h AC_CHECK_FUNCS(getline) dnl if there is no getdelim, we define replace it AC_CHECK_FUNCS(getdelim) dnl Check for pilot-link libs pilot_prefix="" AC_ARG_WITH(pilot_prefix, [ --with-pilot-prefix= Prefix to top level of pilot-link files (e.g., = /usr/local if the pilot-link includes are in /usr/local/include and libs are in /usr/local/lib)]) if test "x$with_pilot_prefix" != "x"; then pilot_prefix=$with_pilot_prefix fi dnl Make sure that the pilot-link stuff actually exists AC_MSG_CHECKING(for pilot-link header files) pilotinclude=no for pilot_incl in $pilot_prefix/include /usr/include /usr/local/include \ /usr/extra/pilot/include /usr/include/libpisock; do if test -r "$pilot_incl/pi-config.h" ; then pilotinclude=yes PILOT_FLAGS="$PILOT_FLAGS -I$pilot_incl" break fi done if test $pilotinclude = no ; then AC_MSG_RESULT(no) AC_MSG_ERROR(Could not find the pilot-link header files) else AC_MSG_RESULT(found at $pilot_incl) fi dnl Maybe installed AC_MSG_CHECKING(for pilot library files) pilotlibs=no PILOT_LIBS="-lpisock" for pilot_libs in $pilot_prefix/lib /usr/lib /usr/local/lib/ \ /usr/extra/pilot/lib ; do if test -r "$pilot_libs/libpisock.so" ; then pilotlibs=yes PILOT_LIBS="-L$pilot_libs $PILOT_LIBS" break fi if test -r "$pilot_libs/libpisock.a" ; then pilotlibs=yes PILOT_LIBS="-L$pilot_libs $PILOT_LIBS" break fi if test -r "$pilot_libs/libpisock.sl" ; then pilotlibs=yes PILOT_LIBS="-L$pilot_libs $PILOT_LIBS" break fi done if test $pilotlibs = no ; then AC_MSG_RESULT(no) AC_MSG_ERROR(Could not find the pilot-link libraries) else AC_MSG_RESULT(found at $pilot_libs) fi dnl Solaris needs the socket library AC_CHECK_LIB(socket, main, PILOT_LIBS=$PILOT_LIBS" -lsocket", , ) AC_ARG_ENABLE(pl-test, [ --disable-pl-test Do not try to compile \ a test pilot-link program], enable_pl_test=no, enable_pl_test=yes) if test "x$enable_pl_test" = "xyes"; then dnl Link a tiny program to make sure we have the environment right AC_MSG_CHECKING(to see if I can compile a pilot link program) ac_save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $PILOT_FLAGS" ac_save_LIBS="$LIBS" LIBS="$LIBS $PILOT_LIBS" pilotcompile=no AC_TRY_LINK([#include "pi-config.h" #include "pi-socket.h"], [pi_close (0);] , pilotcompile=yes, , ) if test $pilotcompile = no ; then AC_MSG_RESULT(no) AC_MSG_ERROR(Could not compile a test pilot-link program) else AC_MSG_RESULT(ok) AC_SUBST(PILOT_FLAGS) AC_SUBST(PILOT_LIBS) fi CFLAGS="$save_CFLAGS" LIBS="$save_LIBS" fi dnl Checking for GTK version AM_PATH_GTK(1.2.0,, AC_MSG_ERROR([*** GTK >= 1.2.0 not installed - please install first ***])) dnl Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS(fcntl.h sys/time.h syslog.h unistd.h) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_PID_T AC_TYPE_SIZE_T AC_HEADER_TIME AC_STRUCT_TM dnl Checks for library functions. AC_FUNC_FNMATCH AC_TYPE_SIGNAL AC_FUNC_STRFTIME AC_FUNC_VPRINTF AC_CHECK_FUNCS(select socket strerror strstr) AC_OUTPUT(Makefile src/Makefile)