[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] [tor/release-0.2.2 063/162] Fix warnings with new versions of autoconf



Author: Sebastian Hahn <sebastian@xxxxxxxxxxxxxx>
Date: Mon, 11 Oct 2010 11:55:30 +0200
Subject: Fix warnings with new versions of autoconf
Commit: 3d6e2830876c53edcb0f32599929bdb8a069b61e

It looks like autoconf 2.68 introduced a bunch of new warnings when it
didn't like the syntax you used or forgot to use
AC_LANG_(SOURCE|PROGRAM).
---
 acinclude.m4 |    8 ++++----
 configure.in |   46 +++++++++++++++++++++++-----------------------
 2 files changed, 27 insertions(+), 27 deletions(-)

diff --git a/acinclude.m4 b/acinclude.m4
index 3db25aa..ccfecff 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -121,13 +121,13 @@ AC_CACHE_CHECK([for $1 directory], tor_cv_library_$1_dir, [
 
     # Can we link against (but not necessarily run, or find the headers for)
     # the binary?
-    AC_LINK_IFELSE(AC_LANG_PROGRAM([$5], [$6]),
+    AC_LINK_IFELSE([AC_LANG_PROGRAM([$5], [$6])],
                    [linkable=yes], [linkable=no])
 
     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]),
+      AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$4], [$6])],
                         [buildable=yes], [buildable=no])
       if test "$buildable" = yes; then
          tor_cv_library_$1_dir=$tor_trydir
@@ -179,7 +179,7 @@ if test "$cross_compiling" != yes; then
      else
        LDFLAGS="$tor_tryextra $orig_LDFLAGS"
      fi
-     AC_RUN_IFELSE(AC_LANG_PROGRAM([$5], [$6]),
+     AC_RUN_IFELSE([AC_LANG_PROGRAM([$5], [$6])],
                    [runnable=yes], [runnable=no])
      if test "$runnable" = yes; then
         tor_cv_library_$1_linker_option=$tor_tryextra
@@ -211,7 +211,7 @@ dnl
 dnl TOR_CHECK_PROTYPE(1:functionname, 2:macroname, 2: includes)
 AC_DEFUN([TOR_CHECK_PROTOTYPE], [
  AC_CACHE_CHECK([for declaration of $1], tor_cv_$1_declared, [
-   AC_COMPILE_IFELSE(AC_LANG_PROGRAM([$3],[void *ptr= $1 ;]),
+   AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$3],[void *ptr= $1 ;])],
                      tor_cv_$1_declared=yes,tor_cv_$1_declared=no)])
 if test x$tor_cv_$1_declared != xno ; then
   AC_DEFINE($2, 1,
diff --git a/configure.in b/configure.in
index 306edc0..5198ab7 100644
--- a/configure.in
+++ b/configure.in
@@ -156,7 +156,7 @@ AC_SUBST(TORGROUP)
 
 dnl If WIN32 is defined and non-zero, we are building for win32
 AC_MSG_CHECKING([for win32])
-AC_RUN_IFELSE([
+AC_RUN_IFELSE([AC_LANG_SOURCE([
 int main(int c, char **v) {
 #ifdef WIN32
 #if WIN32
@@ -167,7 +167,7 @@ int main(int c, char **v) {
 #else
   return 2;
 #endif
-}],
+}])],
 bwin32=true; AC_MSG_RESULT([yes]),
 bwin32=false; AC_MSG_RESULT([no]),
 bwin32=cross; AC_MSG_RESULT([cross])
@@ -175,14 +175,14 @@ bwin32=cross; AC_MSG_RESULT([cross])
 
 if test "$bwin32" = cross; then
 AC_MSG_CHECKING([for win32 (cross)])
-AC_COMPILE_IFELSE([
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([
 #ifdef WIN32
 int main(int c, char **v) {return 0;}
 #else
 #error
 int main(int c, char **v) {return x(y);}
 #endif
-],
+])],
 bwin32=true; AC_MSG_RESULT([yes]),
 bwin32=false; AC_MSG_RESULT([no]))
 fi
@@ -194,14 +194,14 @@ AM_CONDITIONAL(BUILD_NT_SERVICES, test x$bwin32 = xtrue)
 
 dnl Enable C99 when compiling with MIPSpro
 AC_MSG_CHECKING([for MIPSpro compiler])
-AC_COMPILE_IFELSE(AC_LANG_PROGRAM(, [
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM(, [
 #if (defined(__sgi) && defined(_COMPILER_VERSION))
 #error
   return x(y);
 #endif
 ]),
 bmipspro=false; AC_MSG_RESULT(no),
-bmipspro=true; AC_MSG_RESULT(yes))
+bmipspro=true; AC_MSG_RESULT(yes)])
 
 if test "$bmipspro" = true; then
   CFLAGS="$CFLAGS -c99"
@@ -565,7 +565,7 @@ AC_CHECK_TYPES([rlim_t], , ,
 ])
 
 AC_CACHE_CHECK([whether time_t is signed], tor_cv_time_t_signed, [
-AC_RUN_IFELSE(AC_LANG_SOURCE([
+AC_RUN_IFELSE([AC_LANG_SOURCE([
 #ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
 #endif
@@ -576,7 +576,7 @@ AC_RUN_IFELSE(AC_LANG_SOURCE([
 #include <time.h>
 #endif
 int main(int c, char**v) { if (((time_t)-1)<0) return 1; else return 0; }]),
-  tor_cv_time_t_signed=no, tor_cv_time_t_signed=yes, tor_cv_time_t_signed=cross)
+  tor_cv_time_t_signed=no, tor_cv_time_t_signed=yes, tor_cv_time_t_signed=cross])
 ])
 
 if test "$tor_cv_time_t_signed" = cross; then
@@ -724,14 +724,14 @@ AC_CHECK_FUNC(gethostbyname_r, [
   AC_MSG_CHECKING([how many arguments gethostbyname_r() wants])
   OLD_CFLAGS=$CFLAGS
   CFLAGS="$CFLAGS $MY_CPPFLAGS $MY_THREAD_CPPFLAGS $MY_CFLAGS"
-  AC_COMPILE_IFELSE(AC_LANG_PROGRAM([
+  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
 #include <netdb.h>
   ], [[
     char *cp1, *cp2;
     struct hostent *h1, *h2;
     int i1, i2;
     (void)gethostbyname_r(cp1,h1,cp2,i1,&h2,&i2);
-  ]]),[
+  ]])],[
     AC_DEFINE(HAVE_GETHOSTBYNAME_R)
     AC_DEFINE(HAVE_GETHOSTBYNAME_R_6_ARG, 1,
      [Define this if gethostbyname_r takes 6 arguments])
@@ -772,25 +772,25 @@ AC_CHECK_FUNC(gethostbyname_r, [
 
 AC_CACHE_CHECK([whether the C compiler supports __func__],
   tor_cv_have_func_macro,
-  AC_COMPILE_IFELSE([
+  AC_COMPILE_IFELSE([AC_LANG_SOURCE([
 #include <stdio.h>
-int main(int c, char **v) { puts(__func__); }],
+int main(int c, char **v) { puts(__func__); }])],
   tor_cv_have_func_macro=yes,
   tor_cv_have_func_macro=no))
 
 AC_CACHE_CHECK([whether the C compiler supports __FUNC__],
   tor_cv_have_FUNC_macro,
-  AC_COMPILE_IFELSE([
+  AC_COMPILE_IFELSE([AC_LANG_SOURCE([
 #include <stdio.h>
-int main(int c, char **v) { puts(__FUNC__); }],
+int main(int c, char **v) { puts(__FUNC__); }])],
   tor_cv_have_FUNC_macro=yes,
   tor_cv_have_FUNC_macro=no))
 
 AC_CACHE_CHECK([whether the C compiler supports __FUNCTION__],
   tor_cv_have_FUNCTION_macro,
-  AC_COMPILE_IFELSE([
+  AC_COMPILE_IFELSE([AC_LANG_SOURCE([
 #include <stdio.h>
-int main(int c, char **v) { puts(__FUNCTION__); }],
+int main(int c, char **v) { puts(__FUNCTION__); }])],
   tor_cv_have_FUNCTION_macro=yes,
   tor_cv_have_FUNCTION_macro=no))
 
@@ -848,24 +848,24 @@ fi
 # released versions.  (Some relevant gcc versions can't handle these.)
 if test x$enable_gcc_warnings = xyes || test x$enable_gcc_warnings_advisory = xyes; then
 
-  AC_COMPILE_IFELSE(AC_LANG_PROGRAM([], [
+  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [
 #if !defined(__GNUC__) || (__GNUC__ < 4)
 #error
-#endif]), have_gcc4=yes, have_gcc4=no)
+#endif])], have_gcc4=yes, have_gcc4=no)
 
-  AC_COMPILE_IFELSE(AC_LANG_PROGRAM([], [
+  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [
 #if !defined(__GNUC__) || (__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 2)
 #error
-#endif]), have_gcc42=yes, have_gcc42=no)
+#endif])], have_gcc42=yes, have_gcc42=no)
 
-  AC_COMPILE_IFELSE(AC_LANG_PROGRAM([], [
+  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [
 #if !defined(__GNUC__) || (__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 3)
 #error
-#endif]), have_gcc43=yes, have_gcc43=no)
+#endif])], have_gcc43=yes, have_gcc43=no)
 
   save_CFLAGS="$CFLAGS"
   CFLAGS="$CFLAGS -Wshorten-64-to-32"
-  AC_COMPILE_IFELSE(AC_LANG_PROGRAM([], []), have_shorten64_flag=yes,
+  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])], have_shorten64_flag=yes,
                     have_shorten64_flag=no)
   CFLAGS="$save_CFLAGS"
 
-- 
1.7.1