You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Joe Orton <jo...@redhat.com> on 2002/09/13 10:40:14 UTC
[PATCH] AC_DEFINE cleanup
This patch changes many AC_DEFINE's to use the 3-argument form, and
removes the corresponding #undef from acconfig.h, since acconfig.h is
deprecated in autoconf 2.5x (and presumably the support for it may
eventually disappear).
Fixing the rest would be easiest using AH_VERBATIM and friends, but I
believe making autoconf 2.5x a requirement was undesirable?
This patch makes only one functional change (verify this by diffing
before-and-after output of "grep ^# apr_private.h.in | sort"): the
#undef HAVE_isascii is removed - AFAICT configure never defines this and
it's never used.
Index: configure.in
===================================================================
RCS file: /home/cvspublic/apr/configure.in,v
retrieving revision 1.481
diff -u -r1.481 configure.in
--- configure.in 10 Sep 2002 09:11:20 -0000 1.481
+++ configure.in 13 Sep 2002 08:23:56 -0000
@@ -363,7 +363,7 @@
APR_ADDTO(CPPFLAGS,-DBEOS)
enable_threads="system_threads"
native_mmap_emul="1"
- APR_CHECK_DEFINE(BONE_VERSION, sys/socket.h)
+ APR_CHECK_DEFINE(BONE_VERSION, sys/socket.h, [Define if BONE_VERSION is defined])
eolstr="\\n"
osver=`uname -r`
proc_mutex_is_global=1
@@ -506,7 +506,7 @@
threads="1"
pthreadh="1"
pthreadser="1"
- AC_DEFINE(USE_THREADS) ], [
+ AC_DEFINE(USE_THREADS, 1, [Define if threads are supported]) ], [
threads="0"
pthreadh="0"
pthreadser="0"
@@ -567,18 +567,21 @@
ac_cv_define_GETHOSTBYADDR_IS_THREAD_SAFE=no
if test "$threads" = "1"; then
echo "APR will use threads"
- AC_CHECK_LIB(c_r, readdir, AC_DEFINE(READDIR_IS_THREAD_SAFE))
+ AC_CHECK_LIB(c_r, readdir,
+ AC_DEFINE([READDIR_IS_THREAD_SAFE], 1, [Define if readdir is thread-safe]))
if test "x$apr_gethostbyname_is_thread_safe" = "x"; then
AC_CHECK_LIB(c_r, gethostbyname, apr_gethostbyname_is_thread_safe=yes)
fi
if test "$apr_gethostbyname_is_thread_safe" = "yes"; then
- AC_DEFINE(GETHOSTBYNAME_IS_THREAD_SAFE)
+ AC_DEFINE([GETHOSTBYNAME_IS_THREAD_SAFE], 1,
+ [Define if gethostbyname is thread-safe])
fi
if test "x$apr_gethostbyaddr_is_thread_safe" = "x"; then
AC_CHECK_LIB(c_r, gethostbyaddr, apr_gethostbyaddr_is_thread_safe=yes)
fi
if test "$apr_gethostbyaddr_is_thread_safe" = "yes"; then
- AC_DEFINE(GETHOSTBYADDR_IS_THREAD_SAFE)
+ AC_DEFINE([GETHOSTBYADDR_IS_THREAD_SAFE], 1,
+ [Define if gethostbyaddr is thread-safe])
fi
AC_CHECK_FUNCS(gethostbyname_r gethostbyaddr_r)
@@ -625,7 +628,7 @@
esac
AC_CHECK_HEADERS(sys/mman.h)
-APR_CHECK_DEFINE(MAP_ANON, sys/mman.h)
+APR_CHECK_DEFINE(MAP_ANON, sys/mman.h, [Define if mmap supports MAP_ANON])
AC_CHECK_FUNCS(mmap munmap shm_open shm_unlink)
APR_CHECK_FILE(/dev/zero)
AC_CHECK_HEADERS(sys/ipc.h sys/shm.h sys/file.h)
@@ -1108,7 +1111,7 @@
],
[ ac_cv_define_INT64_C=no
AC_MSG_RESULT(no)
- APR_CHECK_DEFINE(INT64_C, stdint.h)
+ APR_CHECK_DEFINE(INT64_C, stdint.h, [Define if INT64_C is available])
if test "$ac_cv_define_INT64_C" = "yes"; then
stdint=1
fi
@@ -1290,9 +1293,13 @@
aprdso="0"
else
case "$tempdso" in
- dlfcn) AC_DEFINE(DSO_USE_DLFCN);;
- shl) AC_DEFINE(DSO_USE_SHL);;
- dyld) AC_DEFINE(DSO_USE_DYLD);;
+ dlfcn) AC_DEFINE(DSO_USE_DLFCN, 1,
+ [Define if dlopen should be used for DSO support]);;
+ shl) AC_DEFINE(DSO_USE_SHL, 1,
+ [Define if shl_load should be used for DSO support]);;
+ dyld) AC_DEFINE(DSO_USE_DYLD, 1,
+ [Define if NSLinkModule should be used for DSO support])
+ ;;
esac
aprdso="1"
apr_modules="$apr_modules dso"
@@ -1323,7 +1330,7 @@
], vla_msg=yes, vla_msg=no )
AC_MSG_RESULT([$vla_msg])
if test "$vla_msg" = "yes"; then
- AC_DEFINE(HAVE_VLA)
+ AC_DEFINE(HAVE_VLA, 1, [Define if variable length arrays are supported])
fi
AC_CACHE_CHECK(struct rlimit,ac_cv_struct_rlimit,[
@@ -1391,16 +1398,17 @@
AC_SUBST(have_union_semun)
dnl Checks for libraries.
-APR_CHECK_DEFINE(LOCK_EX, sys/file.h)
-APR_CHECK_DEFINE(F_SETLK, fcntl.h)
-APR_CHECK_DEFINE(SEM_UNDO, sys/sem.h)
+APR_CHECK_DEFINE(LOCK_EX, sys/file.h, [Define if LOCK_EX is supported])
+APR_CHECK_DEFINE(F_SETLK, fcntl.h, [Define if F_SETLK is supported])
+APR_CHECK_DEFINE(SEM_UNDO, sys/sem.h, [Define if SEM_UNDO is supported])
# We are assuming that if the platform doesn't have POLLIN, it doesn't have
# any POLL definitions.
APR_CHECK_DEFINE_FILES(POLLIN, poll.h sys/poll.h)
if test "$threads" = "1"; then
- APR_CHECK_DEFINE(PTHREAD_PROCESS_SHARED, pthread.h)
+ APR_CHECK_DEFINE(PTHREAD_PROCESS_SHARED, pthread.h,
+ [Define if PTHREAD_PROCESS_SHARED is supported])
AC_CHECK_FUNCS(pthread_mutexattr_setpshared)
dnl Some systems have setpshared and define PROCESS_SHARED, but don't
dnl really support PROCESS_SHARED locks. So, we must validate that we
@@ -1547,7 +1555,7 @@
AC_MSG_CHECKING(if Posix sems affect threads in the same process)
if test "x$apr_posixsem_is_global" = "xyes"; then
- AC_DEFINE(POSIXSEM_IS_GLOBAL)
+ AC_DEFINE([POSIXSEM_IS_GLOBAL], 1, [Define if POSIX semaphores are global])
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
@@ -1555,7 +1563,7 @@
AC_MSG_CHECKING(if SysV sems affect threads in the same process)
if test "x$apr_sysvsem_is_global" = "xyes"; then
- AC_DEFINE(SYSVSEM_IS_GLOBAL)
+ AC_DEFINE(SYSVSEM_IS_GLOBAL, 1, [Define if SysV semaphores are global])
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
@@ -1563,7 +1571,7 @@
AC_MSG_CHECKING(if fcntl locks affect threads in the same process)
if test "x$apr_fcntl_is_global" = "xyes"; then
- AC_DEFINE(FCNTL_IS_GLOBAL)
+ AC_DEFINE(FCNTL_IS_GLOBAL, 1, [Define if fcntl locks are global])
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
@@ -1571,7 +1579,7 @@
AC_MSG_CHECKING(if flock locks affect threads in the same process)
if test "x$apr_flock_is_global" = "xyes"; then
- AC_DEFINE(FLOCK_IS_GLOBAL)
+ AC_DEFINE(FLOCK_IS_GLOBAL, 1, [Define if flock locks are global])
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
@@ -1582,9 +1590,11 @@
AC_ARG_WITH(egd,
[ --with-egd[[=<path>]] use egd-compatible socket],
- [ AC_DEFINE(HAVE_EGD)
+ [ AC_DEFINE(HAVE_EGD, 1, [Define if EGD is available])
if test "$withval" = "yes"; then
- AC_DEFINE_UNQUOTED(EGD_DEFAULT_SOCKET, ["/var/run/egd-pool","/dev/egd-pool","/etc/egd-pool","/etc/entropy"])
+ AC_DEFINE_UNQUOTED(EGD_DEFAULT_SOCKET,
+ ["/var/run/egd-pool","/dev/egd-pool","/etc/egd-pool","/etc/entropy"],
+ [Define to be the list of paths to EGD sockets])
else
AC_DEFINE_UNQUOTED(EGD_DEFAULT_SOCKET, ["$withval"])
fi
@@ -1599,7 +1609,7 @@
if test "$apr_devrandom" = "yes"; then
if test -r "/dev/random"; then
- AC_DEFINE(DEV_RANDOM, [/dev/random])
+ AC_DEFINE(DEV_RANDOM, [/dev/random], [Define to path of random device])
AC_MSG_RESULT(/dev/random)
rand="1"
elif test -r "/dev/arandom"; then
@@ -1632,7 +1642,7 @@
*)
if test "$rand" != "1"; then
if test "$ac_cv_lib_truerand_main" = "yes"; then
- AC_DEFINE(HAVE_TRUERAND)
+ AC_DEFINE(HAVE_TRUERAND, 1, [Define if truerand is available])
AC_MSG_RESULT(truerand)
rand="1"
else
@@ -1653,7 +1663,7 @@
ac_cv_struct_tm_gmtoff=yes, ac_cv_struct_tm_gmtoff=no)])
if test "$ac_cv_struct_tm_gmtoff" = "yes"; then
- AC_DEFINE(HAVE_GMTOFF)
+ AC_DEFINE([HAVE_GMTOFF], 1, [Define if struct tm has a tm_gmtoff field])
fi
dnl #----------------------------- Checking for Networking Support
@@ -1692,8 +1702,8 @@
APR_CHECK_O_NONBLOCK_INHERITED
dnl # Look for a way of corking TCP...
-APR_CHECK_DEFINE(TCP_CORK, netinet/tcp.h)
-APR_CHECK_DEFINE(TCP_NOPUSH, netinet/tcp.h)
+APR_CHECK_DEFINE(TCP_CORK, netinet/tcp.h, [Define if TCP_CORK is supported])
+APR_CHECK_DEFINE(TCP_NOPUSH, netinet/tcp.h, [Define if TCP_NOPUSH is supported])
apr_tcp_nopush_flag="0"
have_corkable_tcp="0"
if test "x$ac_cv_define_TCP_CORK" = "xyes"; then
@@ -1721,7 +1731,7 @@
have_corkable_tcp="1"
fi
-APR_CHECK_DEFINE(SO_ACCEPTFILTER, sys/socket.h)
+APR_CHECK_DEFINE(SO_ACCEPTFILTER, sys/socket.h, [Define if SO_ACCEPTFILTER is supported])
if test "x$ac_cv_define_SO_ACCEPTFILTER" = "xyes"; then
acceptfilter="1"
else
Index: acconfig.h
===================================================================
RCS file: /home/cvspublic/apr/acconfig.h,v
retrieving revision 1.57
diff -u -r1.57 acconfig.h
--- acconfig.h 2 Aug 2002 18:12:03 -0000 1.57
+++ acconfig.h 13 Sep 2002 08:23:56 -0000
@@ -4,18 +4,7 @@
@TOP@
/* Various #defines we need to know about */
-#undef HAVE_LOCK_EX
-#undef HAVE_F_SETLK
-#undef HAVE_SEM_UNDO
-#undef HAVE_PTHREAD_PROCESS_SHARED
-#undef DEV_RANDOM
-#undef HAVE_EGD
-#undef EGD_DEFAULT_SOCKET
-#undef HAVE_TRUERAND
#undef HAVE_POLLIN
-#undef HAVE_isascii
-#undef HAVE_SO_ACCEPTFILTER
-#undef HAVE_MAP_ANON
/* Cross process serialization techniques */
#undef USE_FLOCK_SERIALIZE
@@ -23,39 +12,6 @@
#undef USE_FCNTL_SERIALIZE
#undef USE_PROC_PTHREAD_SERIALIZE
#undef USE_PTHREAD_SERIALIZE
-
-#undef POSIXSEM_IS_GLOBAL
-#undef SYSVSEM_IS_GLOBAL
-#undef FCNTL_IS_GLOBAL
-#undef FLOCK_IS_GLOBAL
-
-#undef READDIR_IS_THREAD_SAFE
-#undef GETHOSTBYNAME_IS_THREAD_SAFE
-#undef GETHOSTBYADDR_IS_THREAD_SAFE
-#undef STRERROR_R_RC_INT
-
-#undef HAVE_GMTOFF
-#undef USE_THREADS
-
-#undef DSO_USE_DLFCN
-#undef DSO_USE_SHL
-#undef DSO_USE_DYLD
-
-#undef SIZEOF_SSIZE_T
-#undef SIZEOF_SIZE_T
-#undef SIZEOF_OFF_T
-#undef SIZEOF_PID_T
-
-#undef HAVE_INT64_C
-
-#undef HAVE_VLA
-
-/* BeOS specific flag */
-#undef HAVE_BONE_VERSION
-
-/* Does this system have a corkable TCP? */
-#undef HAVE_TCP_CORK
-#undef HAVE_TCP_NOPUSH
@BOTTOM@