# Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) AC_INIT(fsplib,0.9,hsn@sendmail.cz) AM_INIT_AUTOMAKE() AM_MAINTAINER_MODE AC_CONFIG_SRCDIR([fsplib.c]) AC_ARG_WITH(lockprefix,AS_HELP_STRING([--with-lockprefix=path],[Set lock prefix path to (default /tmp/.FSPL)])) AC_ARG_WITH([locking],AS_HELP_STRING([--with-locking=none/semop/lockf],[Set client locking type (default autodetected)])) # Checks for programs. AC_PROG_CC AC_DISABLE_SHARED AC_PROG_LIBTOOL AC_SUBST(LIBTOOL_DEPS) AC_CACHE_CHECK(for additional compiler options, ac_cv_prog_gcc_flags, [ ac_cv_prog_gcc_flags="" if test "$GCC" = yes then echo "void dummy(void);" >configure-dummy.c echo "void dummy(void) {}" >>configure-dummy.c addopts= case `$CC --version` in *2.7*) ;; *) addopts="$addopts -Wpointer-arith" ;; esac for i in -Wall -W -Wstrict-prototypes -Wmissing-prototypes -Wshadow \ -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings \ -Waggregate-return -Wmissing-declarations \ -Wmissing-format-attribute -Wnested-externs \ -ggdb -fno-common -Wchar-subscripts -Wcomment \ -Wimplicit -Wsequence-point -Wreturn-type \ -Wfloat-equal $addopts \ -Wno-system-headers -Wredundant-decls \ -Wmissing-noreturn -pedantic \ -Wlong-long -Wundef -Winline \ -Wno-unused-parameter \ -Wunreachable-code # -Wconversion do if $CC $i $ac_cv_prog_gcc_flags -c configure-dummy.c >/dev/null 2>&1 then ac_cv_prog_gcc_flags="$ac_cv_prog_gcc_flags $i" else echo "ignoring $i" fi done fi]) rm -f configure-dummy.c configure-dummy.o CFLAGS="$CFLAGS $ac_cv_prog_gcc_flags" if test "${enable_maintainer_mode+set}" = set; then CFLAGS="-g3 -O0 -DMAINTAINER_MODE $ac_cv_prog_gcc_flags" AC_CHECK_LIB(efence,EF_Abort) fi # Checks for libraries. # Checks for header files. AC_CHECK_HEADERS(stdint.h) # Checks for typedefs, structures, and compiler characteristics. AC_CHECK_MEMBER(struct dirent.d_namlen,AC_DEFINE(HAVE_DIRENT_NAMLEN,1,[Define if struct dirent has member d_namlen]),,[#include #include ]) AC_CHECK_MEMBER(struct dirent.d_fileno,AC_DEFINE(HAVE_DIRENT_FILENO,1,[Define if struct dirent has member d_fileno]),,[#include #include ]) AC_CHECK_MEMBER(struct dirent.d_type,AC_DEFINE(HAVE_DIRENT_TYPE,1,[Define if struct dirent has member d_type]),,[#include #include ]) AC_CHECK_TYPE(union semun, ,AC_DEFINE(_SEM_SEMUN_UNDEFINED,1,[Define if you do not have semun in sys/sem.h]), [#include #include #include ]) # Checks for library functions. AC_CHECK_FUNCS(lockf semop shmget) #Parse user locking choice if test "x$with_locking" = "xno" -o "x$with_locking" = "xnone" ; then AC_DEFINE(FSP_NOLOCKING,1) AC_MSG_NOTICE(locking disabled by user) elif test "x$with_locking" = "xlockf" -a "x$ac_cv_func_lockf" = "xyes"; then AC_DEFINE(FSP_USE_LOCKF,1) elif test "x$with_locking" = "xsemop" -a "x$ac_cv_func_semop" = "xyes" -a "x$ac_cv_func_shmget" = "xyes";then AC_DEFINE(FSP_USE_SHAREMEM_AND_SEMOP,1) #Autodetect locking elif test "x$ac_cv_func_semop" = "xyes" -a "x$ac_cv_func_shmget" = "xyes"; then AC_DEFINE(FSP_USE_SHAREMEM_AND_SEMOP,1) elif test "x$ac_cv_func_lockf" = "xyes"; then AC_DEFINE(FSP_USE_LOCKF,1) else AC_DEFINE(FSP_NOLOCKING,1) AC_MSG_NOTICE([no suitable locking method detected]) fi #locking prefix if test "x$with_lockprefix" != "xno" -a "x$with_lockprefix" != "xyes" -a "x$with_lockprefix" != "x" ; then AC_DEFINE_UNQUOTED(FSP_KEY_PREFIX,"$with_lockprefix") fi # Output work AC_SUBST(CPPFLAGS) AC_SUBST(CFLAGS) AC_CONFIG_FILES(Makefile) AC_OUTPUT