(gl_USE_SYSTEM_EXTENSIONS): Call AC_BEFORE first,
[gnulib.git] / m4 / extensions.m4
1 # Enable extensions on systems that normally disable them.
2
3 # Copyright (C) 2003 Free Software Foundation, Inc.
4
5 # This file is free software, distributed under the terms of the GNU
6 # General Public License.  As a special exception to the GNU General
7 # Public License, this file may be distributed as part of a program
8 # that contains a configuration script generated by Autoconf, under
9 # the same distribution terms as the rest of that program.
10
11 # gl_USE_SYSTEM_EXTENSIONS
12 # ------------------------
13 # Enable extensions on systems that normally disable them,
14 # typically due to standards-conformance issues.
15 AC_DEFUN([gl_USE_SYSTEM_EXTENSIONS], [
16   AC_BEFORE([$0], [AC_COMPILE_IFELSE])
17   AC_BEFORE([$0], [AC_RUN_IFELSE])
18
19   AC_REQUIRE([AC_GNU_SOURCE])
20   AC_REQUIRE([AC_AIX])
21   AC_REQUIRE([AC_MINIX])
22
23   AH_VERBATIM([__EXTENSIONS__],
24 [/* Enable extensions on Solaris.  */
25 #ifndef __EXTENSIONS__
26 # undef __EXTENSIONS__
27 #endif])
28   AC_DEFINE([__EXTENSIONS__])
29 ])