You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by jo...@apache.org on 2005/10/19 18:31:07 UTC

svn commit: r326601 - in /apr/apr/branches/1.2.x: build/apr_common.m4 configure.in

Author: jorton
Date: Wed Oct 19 09:31:01 2005
New Revision: 326601

URL: http://svn.apache.org/viewcvs?rev=326601&view=rev
Log:
Merge r230416, r239640 from trunk:

* build/apr_common.m4 (APR_TRY_COMPILE_NO_WARNING): Rewrite to use
AC_COMPILE_IFELSE; fix quoting to avoid always triggering a warning in
the main() definition.

* configure.in: Check for libefence after threads in case libefence
depends on libpthread.

PR: 36032, 34806

Modified:
    apr/apr/branches/1.2.x/build/apr_common.m4
    apr/apr/branches/1.2.x/configure.in

Modified: apr/apr/branches/1.2.x/build/apr_common.m4
URL: http://svn.apache.org/viewcvs/apr/apr/branches/1.2.x/build/apr_common.m4?rev=326601&r1=326600&r2=326601&view=diff
==============================================================================
--- apr/apr/branches/1.2.x/build/apr_common.m4 (original)
+++ apr/apr/branches/1.2.x/build/apr_common.m4 Wed Oct 19 09:31:01 2005
@@ -471,40 +471,29 @@
 
 dnl
 dnl APR_TRY_COMPILE_NO_WARNING(INCLUDES, FUNCTION-BODY,
-dnl             [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
+dnl             [ACTIONS-IF-NO-WARNINGS], [ACTIONS-IF-WARNINGS])
 dnl
 dnl Tries a compile test with warnings activated so that the result
-dnl is false if the code doesn't compile cleanly.
+dnl is false if the code doesn't compile cleanly.  For compilers
+dnl where it is not known how to activate a "fail-on-error" mode,
+dnl it is undefined which of the sets of actions will be run.
 dnl
-AC_DEFUN(APR_TRY_COMPILE_NO_WARNING,
-[if test "x$CFLAGS_WARN" = "x"; then
-  apr_tcnw_flags=""
-else
-  apr_tcnw_flags=$CFLAGS_WARN
-fi
-if test "$ac_cv_prog_gcc" = "yes"; then 
-  apr_tcnw_flags="$apr_tcnw_flags -Werror"
-fi
-changequote(', ')
-cat > conftest.$ac_ext <<EOTEST
-#include "confdefs.h"
-'$1'
-int main(int argc, const char * const argv[]) {
-'$2'
-; return 0; }
-EOTEST
-changequote([, ])
-if ${CC-cc} -c $CFLAGS $CPPFLAGS $apr_tcnw_flags conftest.$ac_ext 2>&AC_FD_CC ; then
-  ifelse([$3], , :, [rm -rf conftest*
-  $3])
-else
-  echo "configure: failed or warning program:" >&AC_FD_CC
-  cat conftest.$ac_ext >&AC_FD_CC
-  ifelse([$4], , , [rm -rf conftest*
-  $4])
-fi
-rm -f conftest*
-])dnl
+AC_DEFUN([APR_TRY_COMPILE_NO_WARNING],
+[apr_save_CFLAGS=$CFLAGS
+ CFLAGS="$CFLAGS $CFLAGS_WARN"
+ if test "$ac_cv_prog_gcc" = "yes"; then 
+   CFLAGS="$CFLAGS -Werror"
+ fi
+ AC_COMPILE_IFELSE(
+  [#include "confdefs.h"
+  ]
+  [[$1]]
+  [int main(int argc, const char *const *argv) {]
+  [[$2]]
+  [   return 0; }],
+  [$3], [$4])
+ CFLAGS=$apr_save_CFLAGS
+])
 
 dnl
 dnl APR_CHECK_STRERROR_R_RC

Modified: apr/apr/branches/1.2.x/configure.in
URL: http://svn.apache.org/viewcvs/apr/apr/branches/1.2.x/configure.in?rev=326601&r1=326600&r2=326601&view=diff
==============================================================================
--- apr/apr/branches/1.2.x/configure.in (original)
+++ apr/apr/branches/1.2.x/configure.in Wed Oct 19 09:31:01 2005
@@ -319,23 +319,6 @@
     fi
   ])
 
-dnl Electric Fence malloc checker.
-dnl --with-efence specifies the path to Electric Fence
-AC_ARG_WITH(efence, 
-  [  --with-efence[[=DIR]]     path to Electric Fence installation], 
-  [ apr_efence_dir="$withval"
-    if test "$apr_efence_dir" != "yes"; then
-      APR_ADDTO(LDFLAGS,[-L$apr_efence_dir/lib])
-      if test "x$apr_platform_runtime_link_flag" != "x"; then
-          APR_ADDTO(LDFLAGS, 
-                    [$apr_platform_runtime_link_flag$apr_efence_dir/lib])
-      fi
-    fi
-    AC_CHECK_LIB(efence, malloc, 
-                 [ APR_ADDTO(LIBS,-lefence) ],
-                 [ AC_MSG_ERROR(Electric Fence requested but not detected) ])
-  ])
-
 if test "$host" = "i586-pc-beos"; then
   AC_ARG_ENABLE(malloc-debug,[  --enable-malloc-debug   Switch on malloc_debug for BeOS],
     APR_REMOVEFROM(CFLAGS, -O2)
@@ -642,6 +625,25 @@
 else
     echo "APR will be non-threaded"
 fi
+
+dnl Electric Fence malloc checker.
+dnl --with-efence specifies the path to Electric Fence.
+dnl This test should remain after the threads checks since libefence
+dnl may depend on libpthread.
+AC_ARG_WITH(efence, 
+  [  --with-efence[[=DIR]]     path to Electric Fence installation], 
+  [ apr_efence_dir="$withval"
+    if test "$apr_efence_dir" != "yes"; then
+      APR_ADDTO(LDFLAGS,[-L$apr_efence_dir/lib])
+      if test "x$apr_platform_runtime_link_flag" != "x"; then
+          APR_ADDTO(LDFLAGS, 
+                    [$apr_platform_runtime_link_flag$apr_efence_dir/lib])
+      fi
+    fi
+    AC_CHECK_LIB(efence, malloc, 
+                 [ APR_ADDTO(LIBS,-lefence) ],
+                 [ AC_MSG_ERROR(Electric Fence requested but not detected) ])
+  ])
 
 AC_CHECK_FUNCS(sigsuspend, [ have_sigsuspend="1" ], [ have_sigsuspend="0" ])
 AC_CHECK_FUNCS(sigwait, [ have_sigwait="1" ], [ have_sigwait="0" ])