From 129b6954a6f491c6f3c3e417055bdc68d4726408 Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Mon, 15 Mar 2010 12:41:11 -0500 Subject: [PATCH 1/1] Use AC_USE_SYSTEM_EXTENSIONS Instead of defining various symbols like _XOPEN_SOURCE, _BSD_SOURCE, and the like, just use autoconf's AC_USE_SYSTEM_EXTENSIONS to define all of the appropriate symbols for us. Deal with some fallout by removing some of the existing defines. Change-Id: I1c1968c89cc2dfda1293fd2566dac8e266325a72 Reviewed-on: http://gerrit.openafs.org/1582 Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- acinclude.m4 | 4 ++-- configure.in | 1 + src/cf/osconf.m4 | 12 ------------ src/lwp/iomgr.c | 9 +++++---- src/util/softsig.c | 1 - 5 files changed, 8 insertions(+), 19 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index 2b37105..e450150 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -5,8 +5,8 @@ dnl NB: Because this code is a macro, references to positional shell dnl parameters must be done like $[]1 instead of $1 AC_DEFUN([OPENAFS_CONFIGURE_COMMON],[ -AH_VERBATIM([OPENAFS_HEADER], -[#undef HAVE_RES_SEARCH +AH_BOTTOM([ +#undef HAVE_RES_SEARCH #undef STRUCT_SOCKADDR_HAS_SA_LEN #if !defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__) # if ENDIANESS_IN_SYS_PARAM_H diff --git a/configure.in b/configure.in index 7ecc364..92f0d98 100644 --- a/configure.in +++ b/configure.in @@ -10,6 +10,7 @@ AC_SUBST(MACOS_VERSION) AC_SUBST(LINUX_PKGVER) AC_SUBST(LINUX_PKGREL) +AC_USE_SYSTEM_EXTENSIONS AC_PROG_CC AC_PATH_PROGS([PATH_CPP], [cpp], [${CC-cc} -E], [$PATH:/lib:/usr/ccs/lib]) AC_SUBST([PATH_CPP]) diff --git a/src/cf/osconf.m4 b/src/cf/osconf.m4 index 7b79844..2622cf7 100644 --- a/src/cf/osconf.m4 +++ b/src/cf/osconf.m4 @@ -1084,18 +1084,6 @@ case $AFS_SYSNAME in ;; esac - - -dnl pthreads fixes -case $AFS_SYSNAME in -dnl we'll go ahead and turn on XOPEN2K and ISO_C99 -dnl if this causes problems, we should scale back to _XOPEN_SOURCE=500 - *linux*) - MT_CFLAGS="${MT_CFLAGS} -D_XOPEN_SOURCE=600 -D_BSD_SOURCE" - ;; -esac - - dnl Disable the default for debugging/optimization if not enabled if test "x$enable_debug_kernel" = "xno"; then KERN_DBG= diff --git a/src/lwp/iomgr.c b/src/lwp/iomgr.c index 7579813..fcdba04 100644 --- a/src/lwp/iomgr.c +++ b/src/lwp/iomgr.c @@ -236,11 +236,12 @@ static struct IoRequest *NewRequest(void) #define FD_N_ZERO(nfds, x) memset((char*)(x), 0, (INTS_PER_FDS(nfds))*sizeof(int)) #endif -#if defined(AFS_LINUX22_ENV) && (__GLIBC_MINOR__ > 0) -/* Build for both glibc 2.0.x and 2.1.x */ -#define FDS_BITS __fds_bits +/* On Linux without __USE_XOPEN, we have __fds_bits. With __USE_XOPEN, or + * non-Linux, we have fds_bits. */ +#if defined(AFS_LINUX22_ENV) && (__GLIBC_MINOR__ > 0) && !defined(__USE_XOPEN) +# define FDS_BITS __fds_bits #else -#define FDS_BITS fds_bits +# define FDS_BITS fds_bits #endif /* FDSetCmp - returns 1 if any bits in fd_set1 are also set in fd_set2. diff --git a/src/util/softsig.c b/src/util/softsig.c index b318368..dd3db45 100644 --- a/src/util/softsig.c +++ b/src/util/softsig.c @@ -12,7 +12,6 @@ #include #include -#define _POSIX_PTHREAD_SEMANTICS #include #include #include -- 1.9.4