configure.in problems in Samba 3.0.20rc1

Luke Mewburn lukem at NetBSD.org
Mon Aug 1 12:49:13 GMT 2005


Hi all:

I have discovered the following issues in the configure.in
that ships with samba 3.0.20rc1:

   1)	Misuses AC_CHECK_HEADERS when testing for
	<rpcsvc/yp_prot.h> and <sys/mode.h>;
	the invocation has a comma in the wrong place.

   2)	Even when 1) is fixed, the macro is not being
	used correctly when checking for <rpcsvc/yp_prot.h>
	(at least on NetBSD, and I suspect that IRIX has a
	similar limitation).
	I've fixed this in the attached patch.

   3)	Because of 1), the check for <sys/mode.h> wasn't
	working.
	AFAICT, this header was added for AIX to obtain S_ISLNK(),
	but according to an AIX user I asked, <sys/stat.h> includes
	<sys/mode.h> so it's possible that this header doesn't
	need checking for or including.
	My attached patch retains a (fixed) check for this header
	even though I don't think it's necessary.

   4)	AC_CHECK_HEADERS is misused when checking for
	<security/pam_modules.h>, <net/if.h> and <netinet/ip.h>.
	The reason that Solaris can't detect <security/pam_modules.h>
	is because that header needs <sys/pam_appl.h>
	I've fixed the autoconf check appropriately.
	The reason that Solaris & NetBSD can't detect
	<net/if.h> & <netinet/ip.h> is that various headers
	need to be included first.
	The attached patch fixes these.

   5)	The check for struct timespec assumes that <aio.h> is
	always available, instead of checking HAVE_AIO_H first.
	Fixed in patch.


I'm sure there's other misuses; these are just the ones that I've
found so far.

Cheers,
Luke.


Index: configure.in
===================================================================
--- configure.in	28 Jul 2005 13:19:50 -0000	1.1.1.9
+++ configure.in	1 Aug 2005 12:31:38 -0000
@@ -731,8 +731,6 @@ AC_HEADER_SYS_WAIT
 AC_CHECK_HEADERS(aio.h arpa/inet.h sys/fcntl.h sys/select.h fcntl.h sys/time.h sys/unistd.h rpc/nettype.h)
 AC_CHECK_HEADERS(unistd.h utime.h grp.h sys/id.h limits.h memory.h)
 AC_CHECK_HEADERS(rpc/rpc.h rpcsvc/nis.h rpcsvc/ypclnt.h)
-## These fail to compile on IRIX so just check for their presence
-AC_CHECK_HEADERS(rpcsvc/yp_prot.h, sys/mode.h, [], [] -)
 AC_CHECK_HEADERS(sys/param.h ctype.h sys/wait.h sys/resource.h sys/ioctl.h sys/ipc.h)
 AC_CHECK_HEADERS(sys/mman.h sys/filio.h sys/priv.h sys/shm.h string.h strings.h stdlib.h sys/socket.h)
 AC_CHECK_HEADERS(sys/un.h)
@@ -742,6 +740,15 @@ AC_CHECK_HEADERS(sys/sysmacros.h securit
 AC_CHECK_HEADERS(sys/syslog.h syslog.h execinfo.h)
 AC_CHECK_HEADERS(langinfo.h locale.h)
 
+AC_CHECK_HEADERS(rpcsvc/yp_prot.h,,,[[
+#if HAVE_RPC_RPC_H
+#include <rpc/rpc.h>
+#endif
+]])
+
+## These fail to compile on IRIX so just check for their presence
+AC_CHECK_HEADERS(sys/mode.h,,,)
+
 # Look for Darwin headers
 old_CPPFLAGS="$CPPFLAGS"
 CPPFLAGS="-Iinclude $CPPFLAGS"
@@ -784,8 +791,29 @@ AC_CHECK_HEADERS(sys/capability.h syscal
 AC_CHECK_HEADERS(sys/acl.h sys/attributes.h attr/xattr.h sys/xattr.h sys/extattr.h sys/uio.h)
 AC_CHECK_HEADERS(sys/cdefs.h glob.h)
 
-## These faile to compile on Solaris so just check for their presence
-AC_CHECK_HEADERS(security/pam_modules.h net/if.h netinet/ip.h, [], [], -)
+AC_CHECK_HEADERS(netinet/ip.h,,,[[
+#include <sys/types.h>
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#include <netinet/in.h>
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
+]])
+
+AC_CHECK_HEADERS(net/if.h,,,[[
+#include <sys/types.h>
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+]])
+
+AC_CHECK_HEADERS(security/pam_modules.h,,,[[
+#if HAVE_SECURITY_PAM_APPL_H
+#include <security/pam_appl.h>
+#endif
+]])
 
 # For experimental utmp support (lastlog on some BSD-like systems)
 AC_CHECK_HEADERS(utmp.h utmpx.h lastlog.h)
@@ -929,7 +957,10 @@ AC_CACHE_CHECK([for struct timespec type
 #include <stddef.h>
 #endif
 #include <time.h>
-#include <aio.h>],[struct timespec ts;],
+#if HAVE_AIO_H
+#include <aio.h>
+#endif
+],[struct timespec ts;],
 	samba_cv_struct_timespec=yes,samba_cv_struct_timespec=no)])
 if test x"$samba_cv_struct_timespec" = x"yes"; then
    AC_DEFINE(HAVE_STRUCT_TIMESPEC,1,[Whether we have struct timespec])
Index: include/config.h.in
===================================================================
--- include/config.h.in	28 Jul 2005 17:46:14 -0000	1.1.1.8
+++ include/config.h.in	1 Aug 2005 12:31:38 -0000
@@ -1276,6 +1276,9 @@
 /* Define to 1 if you have the <sys/mman.h> header file. */
 #undef HAVE_SYS_MMAN_H
 
+/* Define to 1 if you have the <sys/mode.h> header file. */
+#undef HAVE_SYS_MODE_H
+
 /* Define to 1 if you have the <sys/mount.h> header file. */
 #undef HAVE_SYS_MOUNT_H
 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 186 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20050801/0e6b1b75/attachment.bin


More information about the samba-technical mailing list