added loads of pointless rpcsvc/ and rpc/ include files, all because
[samba.git] / source / configure.in
index 5cdc3425d60b17c3fffeb12ccf9e85e91d9c7566..e4e02d5af9434ee5cefbbf91a3141bf65e5e4ef1 100644 (file)
@@ -1,6 +1,6 @@
 dnl Process this file with autoconf to produce a configure script.
-AC_INIT(byteorder.h)
-AC_CONFIG_HEADER(config.h)
+AC_INIT(include/includes.h)
+AC_CONFIG_HEADER(include/config.h)
 
 dnl Checks for programs.
 AC_PROG_CC
@@ -28,9 +28,10 @@ AC_HEADER_DIRENT
 AC_HEADER_TIME
 AC_HEADER_SYS_WAIT
 AC_CHECK_HEADERS(sys/fcntl.h sys/select.h fcntl.h sys/time.h sys/unistd.h)
-AC_CHECK_HEADERS(unistd.h utime.h grp.h sys/id.h limits.h net/if.h)
-AC_CHECK_HEADERS(compat.h sys/param.h ctype.h sys/wait.h sys/ioctl.h)
-AC_CHECK_HEADERS(sys/filio.h string.h stdlib.h sys/socket.h sys/mode.h)
+AC_CHECK_HEADERS(unistd.h utime.h grp.h sys/id.h limits.h memory.h net/if.h)
+AC_CHECK_HEADERS(compat.h rpcsvc/yp_prot.h rpcsvc/ypclnt.h sys/param.h ctype.h )
+AC_CHECK_HEADERS(sys/wait.hsys/resource.h sys/ioctl.h sys/mode.h)
+AC_CHECK_HEADERS(sys/filio.h string.h strings.h stdlib.h sys/socket.h)
 AC_CHECK_HEADERS(sys/mount.h sys/vfs.h sys/fs/s5param.h sys/filsys.h termios.h)
 AC_CHECK_HEADERS(sys/statfs.h sys/dustat.h sys/statvfs.h stdarg.h sys/sockio.h)
 AC_CHECK_HEADERS(shadow.h netinet/tcp.h sys/security.h security/pam_appl.h)
@@ -58,6 +59,21 @@ AC_TRY_COMPILE([#include <errno.h>],[int i = errno],
 echo yes; AC_DEFINE(HAVE_ERRNO_DECL),
 echo no)
 
+# stupid glibc has the functions but no declaration. grrrr.
+echo $ac_n "checking for setresuid declaration $ac_c"
+AC_TRY_COMPILE([#include <unistd.h>],[int i = setresuid],
+echo yes; AC_DEFINE(HAVE_SETRESUID_DECL),
+echo no)
+
+# and glibc has setresuid under linux but the function does
+# nothing until kernel 2.1.44! very dumb.
+echo $ac_n "checking for real setresuid $ac_c"
+AC_TRY_RUN([#include <errno.h>
+main() { setresuid(1,1,1); setresuid(2,2,2); exit(errno==EPERM?0:1);}],
+echo yes;AC_DEFINE(HAVE_SETRESUID), 
+echo no)
+
+
 AC_FUNC_MEMCMP
 
 ###############################################
@@ -105,15 +121,46 @@ if test "$ac_cv_lib_pam_pam_authenticate" = "yes"; then
 fi])
 fi
 
+# The following test taken from the cvs sources
+# If we can't find connect, try looking in -lsocket, -lnsl, and -linet.
+# The Irix 5 libc.so has connect and gethostbyname, but Irix 5 also has
+# libsocket.so which has a bad implementation of gethostbyname (it
+# only looks in /etc/hosts), so we only look for -lsocket if we need
+# it.
+AC_CHECK_FUNC(connect, :, 
+[case "$LIBS" in
+*-lnsl*) ;;
+*) AC_CHECK_LIB(nsl_s, printf) ;;
+esac
+case "$LIBS" in
+*-lnsl*) ;;
+*) AC_CHECK_LIB(nsl, printf) ;;
+esac
+case "$LIBS" in
+*-lsocket*) ;;
+*) AC_CHECK_LIB(socket, connect) ;;
+esac
+case "$LIBS" in
+*-linet*) ;;
+*) AC_CHECK_LIB(inet, connect) ;;
+esac
+dnl We can't just call AC_CHECK_FUNCS(connect) here, because the value
+dnl has been cached.
+if test "$ac_cv_lib_socket_connect" = "yes" || 
+   test "$ac_cv_lib_inet_connect" = "yes"; then
+  ac_cv_func_connect=yes
+  AC_DEFINE(HAVE_CONNECT)
+fi])
+
 
 AC_CHECK_FUNCS(waitpid getcwd strdup strerror chown chmod chroot)
-AC_CHECK_FUNCS(fstat strchr utime utimes getrlimit fsync execl)
+AC_CHECK_FUNCS(fstat strchr utime utimes getrlimit fsync execl bzero memset)
 AC_CHECK_FUNCS(memmove vsnprintf setsid glob strpbrk pipe crypt16 getauthuid)
 AC_CHECK_FUNCS(strftime sigprocmask sigblock sigaction innetgr)
 AC_CHECK_FUNCS(initgroups select rdchk getgrnam pathconf putprpwnam)
-AC_CHECK_FUNCS(setresuid setuidx setgroups mktime rename ftruncate)
+AC_CHECK_FUNCS(setuidx setgroups mktime rename ftruncate)
 AC_CHECK_FUNCS(set_auth_parameters atexit grantpt getspnam dup2)
-AC_CHECK_FUNCS(bigcrypt getprpwnam setluid yp_get_default_domain)
+AC_CHECK_FUNCS(bigcrypt getprpwnam setluid yp_get_default_domain getpwanam)
 
 echo $ac_n "checking for long long ... $ac_c"
 AC_TRY_RUN([#include <stdio.h>
@@ -145,11 +192,22 @@ echo no)
 
 echo $ac_n "checking for sin_len in sock ... $ac_c"
 AC_TRY_COMPILE([#include <sys/types.h>
-#include <sys/socket.h>],
+#include <sys/socket.h>
+#include <netinet/in.h>],
 [struct sockaddr_in sock; sock.sin_len = sizeof(sock);],
 echo yes;AC_DEFINE(HAVE_SOCK_SIN_LEN), 
 echo no)
 
+echo $ac_n "checking for __FILE__ macro ... $ac_c"
+AC_TRY_COMPILE([#include <stdio.h>], [printf("%s\n", __FILE__);],
+echo yes;AC_DEFINE(HAVE_FILE_MACRO), 
+echo no)
+
+echo $ac_n "checking for __FUNCTION__ macro ... $ac_c"
+AC_TRY_COMPILE([#include <stdio.h>], [printf("%s\n", __FUNCTION__);],
+echo yes;AC_DEFINE(HAVE_FUNCTION_MACRO), 
+echo no)
+
 echo $ac_n "checking if gettimeofday takes tz argument ... $ac_c"
 AC_TRY_RUN([
 #include <sys/time.h>
@@ -180,43 +238,25 @@ AC_TRY_RUN([#include "tests/ftruncate.c"],
            echo yes;AC_DEFINE(HAVE_FTRUNCATE_EXTEND), 
           echo no)
 
-# The following test taken from the cvs sources
-# If we can't find connect, try looking in -lsocket, -lnsl, and -linet.
-# The Irix 5 libc.so has connect and gethostbyname, but Irix 5 also has
-# libsocket.so which has a bad implementation of gethostbyname (it
-# only looks in /etc/hosts), so we only look for -lsocket if we need
-# it.
-AC_CHECK_FUNC(connect, :, 
-[case "$LIBS" in
-*-lnsl*) ;;
-*) AC_CHECK_LIB(nsl_s, printf) ;;
-esac
-case "$LIBS" in
-*-lnsl*) ;;
-*) AC_CHECK_LIB(nsl, printf) ;;
-esac
-case "$LIBS" in
-*-lsocket*) ;;
-*) AC_CHECK_LIB(socket, connect) ;;
-esac
-case "$LIBS" in
-*-linet*) ;;
-*) AC_CHECK_LIB(inet, connect) ;;
-esac
-dnl We can't just call AC_CHECK_FUNCS(connect) here, because the value
-dnl has been cached.
-if test "$ac_cv_lib_socket_connect" = "yes" || 
-   test "$ac_cv_lib_inet_connect" = "yes"; then
-  ac_cv_func_connect=yes
-  AC_DEFINE(HAVE_CONNECT)
-fi])
-
 echo $ac_n "checking for broken getgroups ... $ac_c"
 AC_TRY_RUN([#include "tests/getgroups.c"],
            echo yes;AC_DEFINE(HAVE_BROKEN_GETGROUPS), 
           echo no)
 
 
+echo $ac_n "checking for broken inet_ntoa ... $ac_c"
+AC_TRY_RUN([
+#include <stdio.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+main() { struct in_addr ip; ip.s_addr = 0x12345678;
+if (strcmp(inet_ntoa(ip),"18.52.86.120") &&
+    strcmp(inet_ntoa(ip),"120.86.52.18")) { exit(0); } 
+exit(1);}],
+           echo yes;AC_DEFINE(REPLACE_INET_NTOA), 
+          echo no)
+
 echo $ac_n "checking for root ... $ac_c"
 AC_TRY_RUN([main() { exit(getuid() != 0); }],
            echo yes;AC_DEFINE(HAVE_ROOT), 
@@ -227,7 +267,7 @@ echo $ac_n "checking for netmask ifconf ... $ac_c"
 AC_TRY_RUN([
 #define HAVE_NETMASK_IFCONF 1
 #define AUTOCONF 1
-#include "netmask.c"],
+#include "lib/netmask.c"],
            echo yes;netmask=yes;AC_DEFINE(HAVE_NETMASK_IFCONF),
           echo no)
 
@@ -236,7 +276,7 @@ echo $ac_n "checking for netmask ifreq ... $ac_c"
 AC_TRY_RUN([
 #define HAVE_NETMASK_IFREQ 1
 #define AUTOCONF 1
-#include "netmask.c"],
+#include "lib/netmask.c"],
            echo yes;netmask=yes;AC_DEFINE(HAVE_NETMASK_IFREQ),
           echo no)
 fi
@@ -246,7 +286,7 @@ echo $ac_n "checking for netmask AIX ... $ac_c"
 AC_TRY_RUN([
 #define HAVE_NETMASK_AIX 1
 #define AUTOCONF 1
-#include "netmask.c"],
+#include "lib/netmask.c"],
            echo yes;netmask=yes;AC_DEFINE(HAVE_NETMASK_AIX),
           echo no)
 fi
@@ -362,6 +402,24 @@ AC_ARG_WITH(nisplus,
   AC_MSG_RESULT(no)
 )
 
+#################################################
+# check for a NISPLUS_HOME support 
+AC_MSG_CHECKING(whether to use NISPLUS_HOME)
+AC_ARG_WITH(nisplus-home,
+[  --with-nisplus-home     Include NISPLUS_HOME support
+  --without-nisplus-home  Don't include NISPLUS_HOME support (default)],
+[ case "$withval" in
+  yes)
+    AC_MSG_RESULT(yes)
+    AC_DEFINE(WITH_NISPLUS_HOME)
+    ;;
+  *)
+    AC_MSG_RESULT(no)
+    ;;
+  esac ],
+  AC_MSG_RESULT(no)
+)
+
 #################################################
 # check for the secure socket layer
 AC_MSG_CHECKING(whether to use SSL)
@@ -416,6 +474,24 @@ AC_ARG_WITH(syslog,
   AC_MSG_RESULT(no)
 )
 
+#################################################
+# check for experimental netatalk resource fork support
+AC_MSG_CHECKING(whether to support netatalk)
+AC_ARG_WITH(netatalk,
+[  --with-netatalk     Include experimental Netatalk support
+  --without-netatalk  Don't include experimental Netatalk support (default)],
+[ case "$withval" in
+  yes)
+    AC_MSG_RESULT(yes)
+    AC_DEFINE(WITH_NETATALK)
+    ;;
+  *)
+    AC_MSG_RESULT(no)
+    ;;
+  esac ],
+  AC_MSG_RESULT(no)
+)
+
 
 #################################################
 # these tests are taken from the GNU fileutils package
@@ -578,6 +654,7 @@ if test $space = no; then
 fi
 
 
-AC_OUTPUT(Makefile tests/dummy client/dummy lib/dummy lib/rpc/dummy
-lib/rpc/client/dummy lib/rpc/include/dummy lib/rpc/parse/dummy
-lib/rpc/server/dummy lib/smb/dummy ubiqx/dummy web/dummy)
+AC_OUTPUT(Makefile tests/dummy client/dummy lib/dummy ubiqx/dummy
+web/dummy param/dummy nmbd/dummy smbd/dummy rpc_server/dummy
+rpc_parse/dummy script/dummy include/dummy codepages/dummy
+libsmb/dummy bin/dummy printing/dummy)