[or-cvs] r12767: Fix some autoconf bugs, and prevent more from occurring. Par (tor/trunk)

nickm at seul.org nickm at seul.org
Tue Dec 11 23:06:48 UTC 2007


Author: nickm
Date: 2007-12-11 18:06:48 -0500 (Tue, 11 Dec 2007)
New Revision: 12767

Modified:
   tor/trunk/
   tor/trunk/ChangeLog
   tor/trunk/acinclude.m4
   tor/trunk/configure.in
Log:
 r17090 at catbus:  nickm | 2007-12-11 18:05:24 -0500
 Fix some autoconf bugs, and prevent more from occurring.  Partial backport candidate.



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /tor/trunk [r17090] on 8246c3cf-6607-4228-993b-4d95d33730f1

Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog	2007-12-11 23:06:45 UTC (rev 12766)
+++ tor/trunk/ChangeLog	2007-12-11 23:06:48 UTC (rev 12767)
@@ -61,6 +61,9 @@
     - Fix handling of hex nicknames when answering controller requests for
       networkstatus by name, or when deciding whether to warn about unknown
       routers in a config option. Bugfix on 0.2.0.x. (Patch from mwenge.)
+    - Fix a couple of hard-to-trigger autoconf problems that could result
+      in really weird results on platforms whose sys/types.h files define
+      nonstandard integer types.
 
   o Minor features:
     - On USR1, when dmalloc is in use, log the top 10 memory

Modified: tor/trunk/acinclude.m4
===================================================================
--- tor/trunk/acinclude.m4	2007-12-11 23:06:45 UTC (rev 12766)
+++ tor/trunk/acinclude.m4	2007-12-11 23:06:48 UTC (rev 12767)
@@ -113,12 +113,12 @@
     AC_LINK_IFELSE(AC_LANG_PROGRAM([$5], [$6]),
                    [linkable=yes], [linkable=no])
 
-    if test $linkable = yes; then
+    if test "$linkable" = yes; then
       tor_$1_any_linkable=yes
       # Okay, we can link against it.  Can we find the headers?
       AC_COMPILE_IFELSE(AC_LANG_PROGRAM([$4], [$6]),
                         [buildable=yes], [buildable=no])
-      if test $buildable = yes; then
+      if test "$buildable" = yes; then
          tor_cv_library_$1_dir=$tor_trydir
          tor_$1_dir_found=yes
          break
@@ -126,8 +126,8 @@
     fi
   done
 
-  if test $tor_$1_dir_found = no; then
-    if test $tor_$1_any_linkable = no ; then
+  if test "$tor_$1_dir_found" = no; then
+    if test "$tor_$1_any_linkable" = no ; then
       AC_MSG_WARN([Could not find a linkable $1.  If you have it installed somewhere unusal, you can specify an explicit path using $7])
       TOR_WARN_MISSING_LIB($1, pkg)
       AC_MSG_ERROR([Missing libraries; unable to proceed.])
@@ -144,7 +144,7 @@
 ]) dnl end cache check
 
 LIBS="$LIBS $3"
-if test $tor_cv_library_$1_dir != "(system)"; then
+if test "$tor_cv_library_$1_dir" != "(system)"; then
    TOR_EXTEND_CODEPATH($tor_cv_library_$1_dir)
 fi
 

Modified: tor/trunk/configure.in
===================================================================
--- tor/trunk/configure.in	2007-12-11 23:06:45 UTC (rev 12766)
+++ tor/trunk/configure.in	2007-12-11 23:06:48 UTC (rev 12767)
@@ -10,7 +10,9 @@
 AC_CANONICAL_HOST
 
 if test -f /etc/redhat-release ; then
+  if test -f /usr/kerberos/include ; then
     CPPFLAGS="$CPPFLAGS -I/usr/kerberos/include"
+  fi
 fi
 
 # Not a no-op; we want to make sure that CPPFLAGS is set before we use
@@ -54,7 +56,7 @@
    esac
 fi
 
-if test $enable_threads = "yes"; then
+if test "$enable_threads" = "yes"; then
   AC_DEFINE(ENABLE_THREADS, 1, [Defined if we will try to use multithreading])
 fi
 
@@ -68,6 +70,7 @@
      AS_HELP_STRING(--enable-gcc-warnings, enable verbose warnings))
 
 AC_PROG_CC
+AC_PROG_CPP
 AC_PROG_MAKE_SET
 AC_PROG_RANLIB
 
@@ -109,7 +112,7 @@
 bwin32=cross; AC_MSG_RESULT([cross])
 )
 
-if test $bwin32 = cross; then
+if test "$bwin32" = cross; then
 AC_MSG_CHECKING([for win32 (cross)])
 AC_COMPILE_IFELSE([
 #ifdef WIN32
@@ -123,7 +126,7 @@
 bwin32=false; AC_MSG_RESULT([no]))
 fi
 
-if test $bwin32 = true; then
+if test "$bwin32" = true; then
 AC_DEFINE(MS_WINDOWS, 1, [Define to 1 if we are building for Windows.])
 fi
 AM_CONDITIONAL(BUILD_NT_SERVICES, test x$bwin32 = xtrue)
@@ -139,7 +142,7 @@
 bmipspro=false; AC_MSG_RESULT(no),
 bmipspro=true; AC_MSG_RESULT(yes))
 
-if test $bmipspro = true; then
+if test "$bmipspro" = true; then
   CFLAGS="$CFLAGS -c99"
 fi
 
@@ -150,7 +153,7 @@
 AC_SEARCH_LIBS(dlopen, [dl])
 AC_SEARCH_LIBS(inet_aton, [resolv])
 
-if test $enable_threads = "yes"; then
+if test "$enable_threads" = "yes"; then
   AC_SEARCH_LIBS(pthread_create, [pthread])
   AC_SEARCH_LIBS(pthread_detach, [pthread])
 fi
@@ -161,7 +164,7 @@
 
 AC_CHECK_FUNCS(gettimeofday ftime socketpair uname inet_aton strptime getrlimit strlcat strlcpy strtoull ftello getaddrinfo localtime_r gmtime_r memmem strtok_r inet_pton inet_ntop mallinfo)
 
-if test $enable_threads = "yes"; then
+if test "$enable_threads" = "yes"; then
   AC_CHECK_HEADERS(pthread.h)
   AC_CHECK_FUNCS(pthread_create)
 fi
@@ -169,7 +172,7 @@
 dnl ------------------------------------------------------
 dnl Where do you live, libevent?  And how do we call you?
 
-if test $bwin32 = true; then
+if test "$bwin32" = true; then
   TOR_LIB_WS32=-lws2_32
   # Some of the cargo-cults recommend -lwsock32 as well, but I don't
   # think it's actually necessary.
@@ -181,7 +184,10 @@
 AC_SUBST(TOR_LIB_WS32)
 AC_SUBST(TOR_LIB_GDI)
 
-dnl This is a disgusting hack so we safely include recent libevent headers.
+dnl We need to do this before we try our disgusting hack below.
+AC_CHECK_HEADERS([sys/types.h])
+
+dnl This is a disgusting hack so we safely include older libevent headers.
 AC_CHECK_TYPE(u_int64_t, unsigned long long)
 AC_CHECK_TYPE(u_int32_t, unsigned long)
 AC_CHECK_TYPE(u_int16_t, unsigned short)
@@ -417,7 +423,7 @@
   tor_cv_time_t_signed=yes
 fi
 
-if test $tor_cv_time_t_signed = yes; then
+if test "$tor_cv_time_t_signed" = yes; then
   AC_DEFINE([TIME_T_IS_SIGNED], 1,
             [Define to 1 iff time_t is signed])
 fi
@@ -454,7 +460,7 @@
   tor_cv_null_is_zero=yes
 fi
 
-if test $tor_cv_null_is_zero = yes; then
+if test "$tor_cv_null_is_zero" = yes; then
   AC_DEFINE([NULL_REP_IS_ZERO_BYTES], 1,
             [Define to 1 iff memset(0) sets pointers to NULL])
 fi
@@ -481,7 +487,7 @@
   tor_cv_malloc_zero_works=no
 fi
 
-if test $tor_cv_malloc_zero_works = yes; then
+if test "$tor_cv_malloc_zero_works" = yes; then
   AC_DEFINE([MALLOC_ZERO_WORKS], 1,
             [Define to 1 iff malloc(0) returns a pointer])
 fi
@@ -502,7 +508,7 @@
   tor_cv_twos_complement=yes
 fi
 
-if test $tor_cv_twos_complement = yes; then
+if test "$tor_cv_twos_complement" = yes; then
   AC_DEFINE([USING_TWOS_COMPLEMENT], 1,
             [Define to 1 iff we represent negative integers with two's complement])
 fi
@@ -614,15 +620,15 @@
   tor_cv_have_FUNCTION_macro=yes,
   tor_cv_have_FUNCTION_macro=no))
 
-if test $tor_cv_have_func_macro = 'yes'; then
+if test "$tor_cv_have_func_macro" = 'yes'; then
   AC_DEFINE(HAVE_MACRO__func__, 1, [Defined if the compiler supports __func__])
 fi
 
-if test $tor_cv_have_FUNC_macro = 'yes'; then
+if test "$tor_cv_have_FUNC_macro" = 'yes'; then
   AC_DEFINE(HAVE_MACRO__FUNC__, 1, [Defined if the compiler supports __FUNC__])
 fi
 
-if test $tor_cv_have_FUNCTION_macro = 'yes'; then
+if test "$tor_cv_have_FUNCTION_macro" = 'yes'; then
   AC_DEFINE(HAVE_MACRO__FUNCTION__, 1,
            [Defined if the compiler supports __FUNCTION__])
 fi
@@ -653,7 +659,7 @@
 
 # Set CFLAGS _after_ all the above checks, since our warnings are stricter
 # than autoconf's macros like.
-if test $ac_cv_c_compiler_gnu = yes; then
+if test "$ac_cv_c_compiler_gnu" = yes; then
   CFLAGS="$CFLAGS -Wall -g -O2"
 else
   CFLAGS="$CFLAGS -g -O"



More information about the tor-commits mailing list