1 # Extracted from the package's shipped aclocal.m4. Custom macros should be in
2 # acinclude.m4 so running aclocal doesn't blow them away.
4 # Signed-off-by: Ross Burton <ross.burton@intel.com>
6 # from http://autoconf-archive.cryp.to/ax_tls.html
8 # This was licensed under the GPL with the following exception:
10 # As a special exception, the respective Autoconf Macro's copyright
11 # owner gives unlimited permission to copy, distribute and modify the
12 # configure scripts that are the output of Autoconf when processing
13 # the Macro. You need not follow the terms of the GNU General Public
14 # License when using or distributing such scripts, even though
15 # portions of the text of the Macro appear in them. The GNU General
16 # Public License (GPL) does govern all other use of the material that
17 # constitutes the Autoconf Macro.
19 # This special exception to the GPL applies to versions of the
20 # Autoconf Macro released by the Autoconf Macro Archive. When you make
21 # and distribute a modified version of the Autoconf Macro, you may
22 # extend this special exception to the GPL to apply to your modified
26 AC_MSG_CHECKING(for thread local storage (TLS) class)
27 AC_CACHE_VAL(ac_cv_tls, [
28 ax_tls_keywords="__thread __declspec(thread) none"
29 for ax_tls_keyword in $ax_tls_keywords; do
30 case $ax_tls_keyword in
31 none) ac_cv_tls=none ; break ;;
37 static ] $ax_tls_keyword [ int bar;
41 [ac_cv_tls=$ax_tls_keyword ; break],
48 if test "$ac_cv_tls" != "none"; then
49 dnl AC_DEFINE([TLS], [], [If the compiler supports a TLS storage class define it to that here])
50 AC_DEFINE_UNQUOTED([TLS], $ac_cv_tls, [If the compiler supports a TLS storage class define it to that here])
52 AC_MSG_RESULT($ac_cv_tls)
55 # ===========================================================================
56 # http://www.nongnu.org/autoconf-archive/check_gnu_make.html
57 # ===========================================================================
65 # This macro searches for a GNU version of make. If a match is found, the
66 # makefile variable `ifGNUmake' is set to the empty string, otherwise it
67 # is set to "#". This is useful for including a special features in a
68 # Makefile, which cannot be handled by other versions of make. The
69 # variable _cv_gnu_make_command is set to the command to invoke GNU make
70 # if it exists, the empty string otherwise.
72 # Here is an example of its use:
74 # Makefile.in might contain:
76 # # A failsafe way of putting a dependency rule into a makefile
78 # $(CC) -MM $(srcdir)/*.c > $(DEPEND)
80 # @ifGNUmake@ ifeq ($(DEPEND),$(wildcard $(DEPEND)))
81 # @ifGNUmake@ include $(DEPEND)
84 # Then configure.in would normally contain:
89 # Then perhaps to cause gnu make to override any other make, we could do
90 # something like this (note that GNU make always looks for GNUmakefile
93 # if ! test x$_cv_gnu_make_command = x ; then
94 # mv Makefile GNUmakefile
95 # echo .DEFAULT: > Makefile ;
96 # echo \ $_cv_gnu_make_command \$@ >> Makefile;
99 # Then, if any (well almost any) other make is called, and GNU make also
100 # exists, then the other make wraps the GNU make.
104 # Copyright (c) 2008 John Darrington <j.darrington@elvis.murdoch.edu.au>
106 # Copying and distribution of this file, with or without modification, are
107 # permitted in any medium without royalty provided the copyright notice
108 # and this notice are preserved.
110 # Note: Modified by Ted Ts'o to add @ifNotGNUMake@
113 [CHECK_GNU_MAKE], [ AC_CACHE_CHECK( for GNU make,_cv_gnu_make_command,
114 _cv_gnu_make_command='' ;
115 dnl Search all the common names for GNU make
116 for a in "$MAKE" make gmake gnumake ; do
117 if test -z "$a" ; then continue ; fi ;
118 if ( sh -c "$a --version" 2> /dev/null | grep GNU 2>&1 > /dev/null ) ; then
119 _cv_gnu_make_command=$a ;
124 dnl If there was a GNU version, then set @ifGNUmake@ to the empty string, '#' otherwise
125 if test "x$_cv_gnu_make_command" != "x" ; then
131 AC_MSG_RESULT("Not found");
134 AC_SUBST(ifNotGNUmake)