]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Fix autoconf warnings in libopts.m4
authorDmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Fri, 21 Oct 2016 01:17:36 +0000 (04:17 +0300)
committerDmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Thu, 27 Oct 2016 16:22:01 +0000 (19:22 +0300)
Without this patch Autoconf will spam console with the following kind of
messages:

configure.ac:650: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body
../../lib/autoconf/lang.m4:193: AC_LANG_CONFTEST is expanded from...
../../lib/autoconf/general.m4:2740: _AC_RUN_IFELSE is expanded from...
../../lib/m4sugar/m4sh.m4:639: AS_IF is expanded from...
../../lib/autoconf/general.m4:2759: AC_RUN_IFELSE is expanded from...
../../lib/m4sugar/m4sh.m4:639: AS_IF is expanded from...
../../lib/autoconf/general.m4:2042: AC_CACHE_VAL is expanded from...
src/libopts/m4/libopts.m4:386: LIBOPTS_RUN_FOPEN_TEXT is expanded from...
src/libopts/m4/libopts.m4:425: INVOKE_LIBOPTS_MACROS is expanded from...
src/libopts/m4/libopts.m4:560: AM_COND_IF is expanded from...
src/libopts/m4/libopts.m4:581: LIBOPTS_CHECK is expanded from...
configure.ac:650: the top level

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
src/libopts/m4/libopts.m4

index 1a896d9759a5b5b863aa57b73b652097e9afb7a1..f8b2c38e16d8241c97392c2443feb899d316edb1 100644 (file)
@@ -216,7 +216,7 @@ AC_DEFUN([LIBOPTS_WITHLIB_REGEX],[
   LIBREGEX_LIBS=""
   AC_MSG_CHECKING([whether libregex functions properly])
   AC_CACHE_VAL([libopts_cv_with_libregex],[
-  AC_RUN_IFELSE([@%:@include <stdio.h>
+  AC_RUN_IFELSE([AC_LANG_SOURCE([@%:@include <stdio.h>
 @%:@include <stdlib.h>
 @%:@include <sys/types.h>
 @%:@include REGEX_HEADER
@@ -235,7 +235,7 @@ int main() {
     fputs( "error: regex -->.<-- did not match\n", stderr );
     return 1;
   }
-  return 0; }],
+  return 0; }])],
     [libopts_cv_with_libregex=yes], [libopts_cv_with_libregex=no],
     [libopts_cv_with_libregex=no]) # end of AC_RUN_IFELSE 
   ]) # end of AC_CACHE_VAL for libopts_cv_with_libregex
@@ -260,12 +260,12 @@ libopts_cv_with_libregex=no
 AC_DEFUN([LIBOPTS_RUN_PATHFIND],[
   AC_MSG_CHECKING([whether pathfind(3) works])
   AC_CACHE_VAL([libopts_cv_run_pathfind],[
-  AC_RUN_IFELSE([@%:@include <string.h>
+  AC_RUN_IFELSE([AC_LANG_SOURCE([@%:@include <string.h>
 @%:@include <stdlib.h>
 int main (int argc, char ** argv) {
    char * pz = pathfind( getenv( "PATH" ), "sh", "x" );
    return (pz == 0) ? 1 : 0;
-}],
+}])],
     [libopts_cv_run_pathfind=yes],[libopts_cv_run_pathfind=no],[libopts_cv_run_pathfind=no]
   ) # end of RUN_IFELSE
   ]) # end of AC_CACHE_VAL for libopts_cv_run_pathfind
@@ -303,7 +303,7 @@ echo ${dzero}`
 AC_DEFUN([LIBOPTS_RUN_REALPATH],[
   AC_MSG_CHECKING([whether we have a functional realpath(3C)])
   AC_CACHE_VAL([libopts_cv_run_realpath],[
-  AC_RUN_IFELSE([@%:@include <limits.h>
+  AC_RUN_IFELSE([AC_LANG_SOURCE([@%:@include <limits.h>
 @%:@include <stdlib.h>
 int main (int argc, char ** argv) {
 @%:@ifndef PATH_MAX
@@ -313,7 +313,7 @@ choke me!!
 @%:@endif
    char *pz = realpath(argv@<:@0@:>@, zPath);
    return (pz == zPath) ? 0 : 1;
-}],
+}])],
     [libopts_cv_run_realpath=yes],[libopts_cv_run_realpath=no],[libopts_cv_run_realpath=no]
   ) # end of RUN_IFELSE
   ]) # end of AC_CACHE_VAL for libopts_cv_run_realpath
@@ -330,7 +330,7 @@ choke me!!
 AC_DEFUN([LIBOPTS_RUN_STRFTIME],[
   AC_MSG_CHECKING([whether strftime() works])
   AC_CACHE_VAL([libopts_cv_run_strftime],[
-  AC_RUN_IFELSE([@%:@include <time.h>
+  AC_RUN_IFELSE([AC_LANG_SOURCE([@%:@include <time.h>
 @%:@include <string.h>
 char t_buf@<:@ 64 @:>@;
 int main() {
@@ -346,7 +346,7 @@ int main() {
   tm.tm_yday  = 239; /* days since January 1 @<:@0, 365@:>@ */
   tm.tm_isdst =  1;  /* flag for daylight savings time */
   strftime( t_buf, sizeof( t_buf ), "%A %b %d %j", &tm );
-  return (strcmp( t_buf, z ) != 0); }],
+  return (strcmp( t_buf, z ) != 0); }])],
     [libopts_cv_run_strftime=yes],[libopts_cv_run_strftime=no],[libopts_cv_run_strftime=no]
   ) # end of RUN_IFELSE
   ]) # end of AC_CACHE_VAL for libopts_cv_run_strftime
@@ -363,10 +363,10 @@ int main() {
 AC_DEFUN([LIBOPTS_RUN_FOPEN_BINARY],[
   AC_MSG_CHECKING([whether fopen accepts "b" mode])
   AC_CACHE_VAL([libopts_cv_run_fopen_binary],[
-  AC_RUN_IFELSE([@%:@include <stdio.h>
+  AC_RUN_IFELSE([AC_LANG_SOURCE([@%:@include <stdio.h>
 int main (int argc, char ** argv) {
 FILE * fp = fopen("conftest.@S|@ac_ext", "rb");
-return (fp == NULL) ? 1 : fclose(fp); }],
+return (fp == NULL) ? 1 : fclose(fp); }])],
     [libopts_cv_run_fopen_binary=yes],[libopts_cv_run_fopen_binary=no],[libopts_cv_run_fopen_binary=no]
   ) # end of RUN_IFELSE
   ]) # end of AC_CACHE_VAL for libopts_cv_run_fopen_binary
@@ -386,10 +386,10 @@ return (fp == NULL) ? 1 : fclose(fp); }],
 AC_DEFUN([LIBOPTS_RUN_FOPEN_TEXT],[
   AC_MSG_CHECKING([whether fopen accepts "t" mode])
   AC_CACHE_VAL([libopts_cv_run_fopen_text],[
-  AC_RUN_IFELSE([@%:@include <stdio.h>
+  AC_RUN_IFELSE([AC_LANG_SOURCE([@%:@include <stdio.h>
 int main (int argc, char ** argv) {
 FILE * fp = fopen("conftest.@S|@ac_ext", "rt");
-return (fp == NULL) ? 1 : fclose(fp); }],
+return (fp == NULL) ? 1 : fclose(fp); }])],
     [libopts_cv_run_fopen_text=yes],[libopts_cv_run_fopen_text=no],[libopts_cv_run_fopen_text=no]
   ) # end of RUN_IFELSE
   ]) # end of AC_CACHE_VAL for libopts_cv_run_fopen_text