s3:build(autoconf): fix "no AC_LANG_SOURCE call detected" warnings
authorMartin Schwenke <martin@meltin.net>
Fri, 16 Dec 2011 01:43:34 +0000 (12:43 +1100)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 5 Jun 2012 02:27:36 +0000 (04:27 +0200)
Autoconf 2.68 NEWS says:

** The macros AC_PREPROC_IFELSE, AC_COMPILE_IFELSE, AC_LINK_IFELSE, and
   AC_RUN_IFELSE now warn if the first argument failed to use
   AC_LANG_SOURCE or AC_LANG_PROGRAM to generate the conftest file
   contents.  A new macro AC_LANG_DEFINES_PROVIDED exists if you have
   a compelling reason why you cannot use AC_LANG_SOURCE but must
   avoid the warning.

Signed-off-by: Martin Schwenke <martin@meltin.net>
lib/ccan/libccan.m4
source3/configure.in

index 93dc99e10ec2725f7909a7cf31d89387f4555b66..3b71d7b02343e28f99007ec65fb360ba1155b220 100644 (file)
@@ -24,11 +24,11 @@ AC_SUBST(CCAN_CFLAGS)
 AC_CACHE_CHECK([whether we can compile with __attribute__((cold))],
               samba_cv_attribute_cold,
               [
-                AC_COMPILE_IFELSE(
+                AC_COMPILE_IFELSE([AC_LANG_SOURCE(
                        [
                                static void __attribute__((cold))
                                cleanup(void) { }
-                       ],
+                       ])],
                        samba_cv_attribute_cold=yes)
                ])
 
@@ -40,11 +40,11 @@ fi
 AC_CACHE_CHECK([whether we can compile with __attribute__((const))],
               samba_cv_attribute_const,
               [
-                AC_COMPILE_IFELSE(
+                AC_COMPILE_IFELSE([AC_LANG_SOURCE(
                        [
                                static void __attribute__((const))
                                cleanup(void) { }
-                       ],
+                       ])],
                        samba_cv_attribute_const=yes)
                ])
 
@@ -56,11 +56,11 @@ fi
 AC_CACHE_CHECK([whether we can compile with __attribute__((noreturn))],
               samba_cv_attribute_noreturn,
               [
-                AC_COMPILE_IFELSE(
+                AC_COMPILE_IFELSE([AC_LANG_SOURCE(
                        [
                                static void __attribute__((noreturn))
                                cleanup(void) { exit(1); }
-                       ],
+                       ])],
                        samba_cv_attribute_noreturn=yes)
                ])
 
@@ -72,11 +72,11 @@ fi
 AC_CACHE_CHECK([whether we can compile with __attribute__((printf))],
               samba_cv_attribute_printf,
               [
-                AC_COMPILE_IFELSE(
+                AC_COMPILE_IFELSE([AC_LANG_SOURCE(
                        [
                                static void __attribute__((format(__printf__, 1, 2)))
                                cleanup(const char *fmt, ...) { }
-                       ],
+                       ])],
                        samba_cv_attribute_printf=yes)
                ])
 
@@ -88,11 +88,11 @@ fi
 AC_CACHE_CHECK([whether we can compile with __attribute__((unused))],
               samba_cv_attribute_unused,
               [
-                AC_COMPILE_IFELSE(
+                AC_COMPILE_IFELSE([AC_LANG_SOURCE(
                        [
                                static void __attribute__((unused))
                                cleanup(void) { }
-                       ],
+                       ])],
                        samba_cv_attribute_unused=yes)
                ])
 
@@ -104,11 +104,11 @@ fi
 AC_CACHE_CHECK([whether we can compile with __attribute__((used))],
               samba_cv_attribute_used,
               [
-                AC_COMPILE_IFELSE(
+                AC_COMPILE_IFELSE([AC_LANG_SOURCE(
                        [
                                static void __attribute__((used))
                                cleanup(void) { }
-                       ],
+                       ])],
                        samba_cv_attribute_used=yes)
                ])
 
@@ -135,10 +135,10 @@ fi
 AC_CACHE_CHECK([whether we have __builtin_clz],
               samba_cv_builtin_clz,
               [
-                AC_LINK_IFELSE(
+                AC_LINK_IFELSE([AC_LANG_SOURCE(
                        [int main(void) {
                                return __builtin_clz(1) == (sizeof(int)*8 - 1) ? 0 : 1;
-                       }],
+                       }])],
                        samba_cv_builtin_clz=yes)
                ])
 
@@ -150,10 +150,10 @@ fi
 AC_CACHE_CHECK([whether we have __builtin_clzl],
               samba_cv_builtin_clzl,
               [
-                AC_LINK_IFELSE(
+                AC_LINK_IFELSE([AC_LANG_SOURCE(
                        [int main(void) {
                                return __builtin_clzl(1) == (sizeof(int)*8 - 1) ? 0 : 1;
-                       }],
+                       }])],
                        samba_cv_builtin_clzl=yes)
                ])
 
@@ -164,10 +164,10 @@ fi
 AC_CACHE_CHECK([whether we have __builtin_clzll],
               samba_cv_builtin_clzll,
               [
-                AC_LINK_IFELSE(
+                AC_LINK_IFELSE([AC_LANG_SOURCE(
                        [int main(void) {
                                return __builtin_clzll(1) == (sizeof(int)*8 - 1) ? 0 : 1;
-                       }],
+                       }])],
                        samba_cv_builtin_clzll=yes)
                ])
 
@@ -179,10 +179,10 @@ fi
 AC_CACHE_CHECK([whether we have __builtin_constant_p],
               samba_cv_builtin_constant_p,
               [
-                AC_LINK_IFELSE(
+                AC_LINK_IFELSE([AC_LANG_SOURCE(
                        [int main(void) {
                                return __builtin_constant_p(1) ? 0 : 1;
-                       }],
+                       }])],
                        samba_cv_builtin_constant_p=yes)
                ])
 
@@ -194,10 +194,10 @@ fi
 AC_CACHE_CHECK([whether we have __builtin_expect],
               samba_cv_builtin_expect,
               [
-                AC_LINK_IFELSE(
+                AC_LINK_IFELSE([AC_LANG_SOURCE(
                        [int main(void) {
                                return __builtin_expect(main != 0, 1) ? 0 : 1;
-                       }],
+                       }])],
                        samba_cv_builtin_expect=yes)
                ])
 
@@ -209,10 +209,10 @@ fi
 AC_CACHE_CHECK([whether we have __builtin_popcountl],
               samba_cv_builtin_popcountl,
               [
-                AC_LINK_IFELSE(
+                AC_LINK_IFELSE([AC_LANG_SOURCE(
                        [int main(void) {
                                return __builtin_popcountl(255L) == 8 ? 0 : 1;
-                       }],
+                       }])],
                        samba_cv_builtin_popcountl=yes)
                ])
 
@@ -224,10 +224,10 @@ fi
 AC_CACHE_CHECK([whether we have __builtin_types_compatible_p],
               samba_cv_builtin_types_compatible_p,
               [
-                AC_LINK_IFELSE(
+                AC_LINK_IFELSE([AC_LANG_SOURCE(
                        [int main(void) {
                                return __builtin_types_compatible_p(char *, int) ? 1 : 0;
-                       }],
+                       }])],
                        samba_cv_builtin_types_compatible_p=yes)
                ])
 
@@ -239,10 +239,10 @@ fi
 AC_CACHE_CHECK([whether we have __builtin_choose_expr],
               samba_cv_builtin_choose_expr,
               [
-                AC_LINK_IFELSE(
+                AC_LINK_IFELSE([AC_LANG_SOURCE(
                        [int main(void) {
                                return __builtin_choose_expr(1, 0, "garbage");
-                       }],
+                       }])],
                        samba_cv_builtin_choose_expr=yes)
                ])
 
@@ -255,11 +255,11 @@ fi
 AC_CACHE_CHECK([whether we have compound literals],
               samba_cv_compound_literals,
               [
-                AC_COMPILE_IFELSE(
+                AC_COMPILE_IFELSE([AC_LANG_SOURCE(
                        [int main(void) {
                                int *foo = (int@<:@@:>@) { 1, 2, 3, 4 };
                                return foo@<:@0@:>@ == 1 ? 0 : 1;
-                       }],
+                       }])],
                        samba_cv_compound_literals=yes)
                ])
 
@@ -271,10 +271,10 @@ fi
 AC_CACHE_CHECK([whether we have isblank],
               samba_cv_have_isblank,
               [
-                AC_LINK_IFELSE(
+                AC_LINK_IFELSE([AC_LANG_SOURCE(
                        [#include <ctype.h>
                         int main(void) { return isblank(' ') ? 0 : 1; }
-                       ],
+                       ])],
                        samba_cv_have_isblank=yes)
                ])
 
@@ -301,13 +301,13 @@ fi
 AC_CACHE_CHECK([whether we have __typeof__],
               samba_cv_typeof,
               [
-                AC_COMPILE_IFELSE(
+                AC_COMPILE_IFELSE([AC_LANG_SOURCE(
                        [int main(void) {
                                int x = 1;
                                __typeof__(x) i;
                                i = x;
                                return i == x ? 0 : 1;
-                       }],
+                       }])],
                        samba_cv_typeof=yes)
                ])
 
@@ -319,9 +319,9 @@ fi
 AC_CACHE_CHECK([whether we have __attribute__((warn_unused_result))],
               samba_cv_warn_unused_result,
               [
-                AC_COMPILE_IFELSE(
+                AC_COMPILE_IFELSE([AC_LANG_SOURCE(
                        [int __attribute__((warn_unused_result)) func(int x)
-                           { return x; }],
+                           { return x; }])],
                        samba_cv_warn_unused_result=yes)
                ])
 
index 153c8874d20c3d5c3c3714e14f528e415bcbef6a..671fdf1a63a624f752dd3c1f0cb31138d607cd41 100644 (file)
@@ -1203,11 +1203,11 @@ fi
 AC_CACHE_CHECK([whether we can compile with __attribute__((destructor))],
               samba_cv_function_attribute_destructor,
               [
-                AC_COMPILE_IFELSE(
+                AC_COMPILE_IFELSE([AC_LANG_SOURCE(
                        [
                                __attribute__((destructor))
                                static void cleanup(void) { }
-                       ],
+                       ])],
                        samba_cv_function_attribute_destructor=yes)
                ])
 
@@ -5373,44 +5373,44 @@ samba_cv_HAVE_AIO=yes,samba_cv_HAVE_AIO=no)
                        AC_DEFINE(WITH_AIO, 1, [Using asynchronous io])
                        LIBS=$AIO_LIBS
                        AC_MSG_CHECKING(for aio_read)
-                       AC_LINK_IFELSE([#include <aio.h>
-int main() { struct aiocb a; return aio_read(&a); }],
+                       AC_LINK_IFELSE([AC_LANG_SOURCE([#include <aio.h>
+int main() { struct aiocb a; return aio_read(&a); }])],
 [AC_DEFINE(HAVE_AIO_READ, 1, [Have aio_read]) AC_MSG_RESULT(yes)],
 [AC_MSG_RESULT(no)])
 
                        AC_MSG_CHECKING(for aio_write)
-                       AC_LINK_IFELSE([#include <aio.h>
-int main() { struct aiocb a; return aio_write(&a); }],
+                       AC_LINK_IFELSE([AC_LANG_SOURCE([#include <aio.h>
+int main() { struct aiocb a; return aio_write(&a); }])],
 [AC_DEFINE(HAVE_AIO_WRITE, 1, [Have aio_write]) AC_MSG_RESULT(yes)],
 [AC_MSG_RESULT(no)])
 
                        AC_MSG_CHECKING(for aio_fsync)
-                       AC_LINK_IFELSE([#include <aio.h>
-int main() { struct aiocb a; return aio_fsync(1, &a); }],
+                       AC_LINK_IFELSE([AC_LANG_SOURCE([#include <aio.h>
+int main() { struct aiocb a; return aio_fsync(1, &a); }])],
 [AC_DEFINE(HAVE_AIO_FSYNC, 1, [Have aio_fsync]) AC_MSG_RESULT(yes)],
 [AC_MSG_RESULT(no)])
 
                        AC_MSG_CHECKING(for aio_return)
-                       AC_LINK_IFELSE([#include <aio.h>
-int main() { struct aiocb a; return aio_return(&a); }],
+                       AC_LINK_IFELSE([AC_LANG_SOURCE([#include <aio.h>
+int main() { struct aiocb a; return aio_return(&a); }])],
 [AC_DEFINE(HAVE_AIO_RETURN, 1, [Have aio_return]) AC_MSG_RESULT(yes)],
 [AC_MSG_RESULT(no)])
 
                        AC_MSG_CHECKING(for aio_error)
-                       AC_LINK_IFELSE([#include <aio.h>
-int main() { struct aiocb a; return aio_error(&a); }],
+                       AC_LINK_IFELSE([AC_LANG_SOURCE([#include <aio.h>
+int main() { struct aiocb a; return aio_error(&a); }])],
 [AC_DEFINE(HAVE_AIO_ERROR, 1, [Have aio_error]) AC_MSG_RESULT(yes)],
 [AC_MSG_RESULT(no)])
 
                        AC_MSG_CHECKING(for aio_cancel)
-                       AC_LINK_IFELSE([#include <aio.h>
-int main() { struct aiocb a; return aio_cancel(1, &a); }],
+                       AC_LINK_IFELSE([AC_LANG_SOURCE([#include <aio.h>
+int main() { struct aiocb a; return aio_cancel(1, &a); }])],
 [AC_DEFINE(HAVE_AIO_CANCEL, 1, [Have aio_cancel]) AC_MSG_RESULT(yes)],
 [AC_MSG_RESULT(no)])
 
                        AC_MSG_CHECKING(for aio_suspend)
-                       AC_LINK_IFELSE([#include <aio.h>
-int main() { struct aiocb a; return aio_suspend(&a, 1, NULL); }],
+                       AC_LINK_IFELSE([AC_LANG_SOURCE([#include <aio.h>
+int main() { struct aiocb a; return aio_suspend(&a, 1, NULL); }])],
 [AC_DEFINE(HAVE_AIO_SUSPEND, 1, [Have aio_suspend]) AC_MSG_RESULT(yes)],
 [AC_MSG_RESULT(no)])
                fi