dnl Process this file with autoconf to produce a configure script. AC_INIT AC_PREREQ(2.54) AC_CONFIG_SRCDIR([src/acl.c]) AC_CONFIG_HEADER(config.h) dnl Checks for programs. AC_PROG_CC dnl Damn this, I hate writing tests like this! AC_DEFUN(AC_PROG_CC_SWITCH, [ dnl just run gcc program with -dynamic switch ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -$1""... $ac_c" 1>&6 echo "configure: checking whether ${CC-cc} accepts -$1" >&5 echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -$1 -c conftest.c 2>&1`"; then ac_cv_prog_cc_switch=yes else ac_cv_prog_cc_switch=no fi rm -f conftest* echo "$ac_t""$ac_cv_prog_cc_switch" 1>&6 if test "$ac_cv_prog_cc_switch" = yes; then CFLAGS="$ac_save_CFLAGS -$1" else CFLAGS=$ac_save_CFLAGS fi ]) dnl Replace `main' with a function in -lcrypt: AC_CHECK_LIB(crypt, main) AC_SEARCH_LIBS(connect, socket) AC_SEARCH_LIBS(gethostbyname, nsl) AC_SEARCH_LIBS(dlopen, dl) AC_CHECK_LIB(pam, main) AC_CHECK_LIB(cap, cap_init) dnl Checks for header files. AC_HEADER_DIRENT AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_CHECK_HEADERS(fcntl.h sys/time.h syslog.h unistd.h sys/uio.h) AC_CHECK_HEADERS(crypt.h dlfcn.h sys/capability.h netinet/in_systm.h stdarg.h) dnl Checks for typedefs, structures, and compiler characteristics. AC_HEADER_TIME AC_STRUCT_TM AC_TYPE_UID_T dnl Checks for library functions. AC_TYPE_SIGNAL AC_FUNC_STRFTIME AC_CHECK_FUNCS(mkdir rmdir select socket strstr) dnl dnl check to see if snprintf returns what we expect. dnl AC_MSG_CHECKING([to see if snprintf work correctly]) AC_TRY_RUN([ #include #include int main() { FILE *outfile = fopen("snprintf-ok", "w"); char buffer[20]; int result; int ok; buffer[10] = 32; if (outfile == NULL) exit(1); result = snprintf(buffer, 10, "hellohellohello"); ok = 0; if ((result == 15) && (buffer[10] == 32)) ok = 1; if (ok) result = snprintf(NULL, 0, "hellohellohello"); if ((result == 15) && ok) fprintf(outfile, "yes"); else fprintf(outfile, "no"); fclose(outfile); exit(0); }],[ SNPCOMPAT=`cat snprintf-ok` rm -f snprintf-ok AC_MSG_RESULT([$SNPCOMPAT])], [AC_MSG_RESULT([error, assuming no])], [AC_MSG_RESULT([cross-compiling, assuming no])]) if test "$SNPCOMPAT" = "yes"; then AC_CHECK_FUNCS(snprintf vsnprintf) fi AC_CHECK_TYPE(off_t) dnl dnl check to see if we have LFS under linux dnl AC_SYS_LARGEFILE() dnl AC_MSG_CHECKING([for Linux LFS]) dnl AC_TRY_RUN([ dnl #define _GNU_SOURCE dnl #define _LARGEFILE64_SOURCE dnl #define _FILE_OFFSET_BITS 64 dnl #include dnl #include dnl int main() dnl { dnl FILE *outfile = fopen("lfs-ok", "w"); dnl dnl if (outfile == NULL) exit(1); dnl dnl if ((sizeof(off_t) == 8) && (sizeof(long int) == 4)) dnl fprintf(outfile, "yes"); dnl else dnl fprintf(outfile, "no"); dnl fclose(outfile); dnl exit(0); dnl }],[ dnl LINUXLFS=`cat lfs-ok` dnl rm -f lfs-ok dnl AC_MSG_RESULT([$LINUXLFS])], dnl [AC_MSG_RESULT([error, assuming no])], dnl [AC_MSG_RESULT([cross-compiling, assuming no])]) dnl if test "$LINUXLFS" = "yes"; then dnl AC_DEFINE(HAVE_LINUX_LFS,,[linux like large file support for 32 bit systems]) dnl fi AC_CHECK_FUNCS(memmove dlopen) AC_CHECK_FUNCS(strerror getspnam) AC_CHECK_FUNCS(usleep pam_start fgetpwent fgetgrent sendfile) AC_CHECK_FUNCS(cap_init seteuid setegid) AC_PROG_CC_SWITCH(rdynamic) dnl check for additional features dnl Checks for libraries. # MUD module AC_ARG_WITH(authmud, AC_HELP_STRING([--with-authmud], [create MUD authentication module. (no)]), authmud=$withval, authmud=no ) if test "$authmud" != no; then AC_CONFIG_SUBDIRS(modules/auth/authlibmud) modules="$modules authmud" fi # SMB module AC_ARG_WITH(authsmb, AC_HELP_STRING([--with-authsmb], [create SMB authentication module. (yes)]), authsmb=$withval, authsmb=yes ) if test "$authsmb" != no; then AC_CONFIG_SUBDIRS(modules/auth/authlibsmb) modules="$modules authsmb" fi # MSQL module AC_ARG_WITH(authmsql, AC_HELP_STRING([--with-authmsql], [create mSQL authentication module. (no)]), authmsql=$withval, authmsql=no ) AC_ARG_WITH(msqlpath, AC_HELP_STRING([--with-msqlpath], [specify the top level of the msql installation tree. (default is /usr/local/Hughes)]), msqltop=$withval, msqltop=/usr/local/Hughes ) if test "$authmsql" != no; then AC_CONFIG_SUBDIRS(modules/auth/authlibmsql) modules="$modules authmsql" fi # MYSQL module AC_ARG_WITH(authmysql, AC_HELP_STRING([--with-authmysql=DIR], [creates MySQL authentication module, optionally specifies the DIR of mysql files]), [authmysql="$withval"], [authmysql=no]) if test "$authmysql" != no; then AC_CONFIG_SUBDIRS(modules/auth/authlibmysql) modules="$modules authmysql" fi # work out zerobind default (false on linux, true on other systems) case `uname -s` in Linux) zero_bind=FALSE ;; *) zero_bind=TRUE ;; esac AC_SUBST(zerobind, "$zero_bind") AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile defaults.h]) AC_OUTPUT echo echo Muddleftpd is now ready to be compiled! echo echo Modules selected for compile: $modules echo