Hi, Just got this weird warning while creating a testdir:
$ ./gnulib-tool --create-testdir --dir=/tmp/testdir --with-tests unistr/u32-strcoll ... configure.ac:164: warning: AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS glm4/fcntl_h.m4:20: gl_FCNTL_O_FLAGS is expanded from... glm4/localcharset.m4:7: gl_LOCALCHARSET is expanded from... configure.ac:29: gl_INIT is expanded from... configure.ac:164: the top level configure.ac:164: warning: AC_RUN_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS The reason is that the first expansion of AC_USE_SYSTEM_EXTENSIONS occurs inside the gnulib-generated gl_INIT macro. This is too late: it needs to occur inside the gnulib-generated gl_EARLY macro. The only way to enforce this is a dependency towards the 'extensions' module. This rule was apparently forgotten over the last months. Let me add a comment about it. There were a couple of missing invocations. The particular one that hit me was that module 'localcharset' requires an expansion of gl_FCNTL_O_FLAGS (but not the complete fcntl-h module), but I forgot to make 'localcharset' depend on 'extensions'. This fixes the problem. 2009-12-24 Bruno Haible <br...@clisp.org> Add missing dependencies to 'extensions' module. * m4/extensions.m4: Add comment. * modules/accept4 (Depends-on): Add extensions. * modules/dup3 (Depends-on): Likewise. * modules/fcntl (Depends-on): Likewise. * modules/futimens (Depends-on): Likewise. * modules/mknod (Depends-on): Likewise. * modules/pipe2 (Depends-on): Likewise. * modules/stat-time (Depends-on): Likewise. * modules/strcasestr-simple (Depends-on): Likewise. * modules/strsignal (Depends-on): Likewise. * modules/utimensat (Depends-on): Likewise. * modules/localcharset (Depends-on): Likewise. Needed because of gl_FCNTL_O_FLAGS. * modules/wcrtomb (Depends-on): Likewise. Needed because of AC_TYPE_MBSTATE_T. * modules/wcsnrtombs (Depends-on): Likewise. * modules/wcsrtombs (Depends-on): Likewise. --- m4/extensions.m4.orig Fri Dec 25 01:31:44 2009 +++ m4/extensions.m4 Fri Dec 25 01:15:29 2009 @@ -1,4 +1,4 @@ -# serial 8 -*- Autoconf -*- +# serial 9 -*- Autoconf -*- # Enable extensions on systems that normally disable them. # Copyright (C) 2003, 2006-2009 Free Software Foundation, Inc. @@ -12,6 +12,20 @@ # enough in this area it's likely we'll need to redefine # AC_USE_SYSTEM_EXTENSIONS for quite some time. +# If autoconf reports a warning +# warning: AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS +# or warning: AC_RUN_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS +# the fix is +# 1) to ensure that AC_USE_SYSTEM_EXTENSIONS is never directly invoked +# but always AC_REQUIREd, +# 2) to ensure that for each occurrence of +# AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) +# or +# AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) +# the corresponding gnulib module description has 'extensions' among +# its dependencies. This will ensure that the gl_USE_SYSTEM_EXTENSIONS +# invocation occurs in gl_EARLY, not in gl_INIT. + # AC_USE_SYSTEM_EXTENSIONS # ------------------------ # Enable extensions on systems that normally disable them, --- modules/accept4.orig Fri Dec 25 01:31:44 2009 +++ modules/accept4 Fri Dec 25 01:20:46 2009 @@ -11,6 +11,7 @@ accept fcntl-h binary-io +extensions configure.ac: gl_FUNC_ACCEPT4 --- modules/dup3.orig Fri Dec 25 01:31:44 2009 +++ modules/dup3 Fri Dec 25 01:21:14 2009 @@ -10,6 +10,7 @@ fcntl binary-io getdtablesize +extensions configure.ac: gl_FUNC_DUP3 --- modules/fcntl.orig Fri Dec 25 01:31:45 2009 +++ modules/fcntl Fri Dec 25 01:12:47 2009 @@ -8,6 +8,7 @@ Depends-on: dup2 fcntl-h +extensions configure.ac: gl_FUNC_FCNTL --- modules/futimens.orig Fri Dec 25 01:31:45 2009 +++ modules/futimens Fri Dec 25 01:09:35 2009 @@ -8,6 +8,7 @@ Depends-on: sys_stat utimens +extensions configure.ac: gl_FUNC_FUTIMENS --- modules/localcharset.orig Fri Dec 25 01:31:45 2009 +++ modules/localcharset Fri Dec 25 01:28:52 2009 @@ -20,6 +20,7 @@ Depends-on: configmake +extensions configure.ac: gl_LOCALCHARSET --- modules/mknod.orig Fri Dec 25 01:31:45 2009 +++ modules/mknod Fri Dec 25 01:11:48 2009 @@ -9,6 +9,7 @@ mkfifo stat sys_stat +extensions configure.ac: gl_FUNC_MKNOD --- modules/pipe2.orig Fri Dec 25 01:31:45 2009 +++ modules/pipe2 Fri Dec 25 01:25:16 2009 @@ -9,6 +9,7 @@ unistd fcntl-h binary-io +extensions configure.ac: gl_FUNC_PIPE2 --- modules/stat-time.orig Fri Dec 25 01:31:45 2009 +++ modules/stat-time Fri Dec 25 01:10:09 2009 @@ -7,6 +7,7 @@ Depends-on: time +extensions configure.ac: gl_STAT_TIME --- modules/strcasestr-simple.orig Fri Dec 25 01:31:45 2009 +++ modules/strcasestr-simple Fri Dec 25 01:25:45 2009 @@ -12,6 +12,7 @@ strcase memchr memcmp +extensions configure.ac: gl_FUNC_STRCASESTR_SIMPLE --- modules/strsignal.orig Fri Dec 25 01:31:45 2009 +++ modules/strsignal Fri Dec 25 01:26:12 2009 @@ -13,6 +13,7 @@ tls snprintf memset +extensions configure.ac: gl_FUNC_STRSIGNAL --- modules/utimensat.orig Fri Dec 25 01:31:45 2009 +++ modules/utimensat Fri Dec 25 01:09:03 2009 @@ -9,6 +9,7 @@ openat sys_stat utimens +extensions configure.ac: gl_FUNC_UTIMENSAT --- modules/wcrtomb.orig Fri Dec 25 01:31:45 2009 +++ modules/wcrtomb Fri Dec 25 01:24:12 2009 @@ -12,6 +12,7 @@ m4/codeset.m4 Depends-on: +extensions wchar mbsinit --- modules/wcsnrtombs.orig Fri Dec 25 01:31:45 2009 +++ modules/wcsnrtombs Fri Dec 25 01:23:12 2009 @@ -12,6 +12,7 @@ m4/codeset.m4 Depends-on: +extensions wchar wcrtomb --- modules/wcsrtombs.orig Fri Dec 25 01:31:45 2009 +++ modules/wcsrtombs Fri Dec 25 01:23:49 2009 @@ -13,6 +13,7 @@ m4/codeset.m4 Depends-on: +extensions wchar wcrtomb