1 # from http://autoconf-archive.cryp.to/ax_tls.html
3 # This was licensed under the GPL with the following exception:
5 # As a special exception, the respective Autoconf Macro's copyright
6 # owner gives unlimited permission to copy, distribute and modify the
7 # configure scripts that are the output of Autoconf when processing
8 # the Macro. You need not follow the terms of the GNU General Public
9 # License when using or distributing such scripts, even though
10 # portions of the text of the Macro appear in them. The GNU General
11 # Public License (GPL) does govern all other use of the material that
12 # constitutes the Autoconf Macro.
14 # This special exception to the GPL applies to versions of the
15 # Autoconf Macro released by the Autoconf Macro Archive. When you make
16 # and distribute a modified version of the Autoconf Macro, you may
17 # extend this special exception to the GPL to apply to your modified
21 AC_MSG_CHECKING(for thread local storage (TLS) class)
22 AC_CACHE_VAL(ac_cv_tls, [
23 ax_tls_keywords="__thread __declspec(thread) none"
24 for ax_tls_keyword in $ax_tls_keywords; do
25 case $ax_tls_keyword in
26 none) ac_cv_tls=none ; break ;;
32 static ] $ax_tls_keyword [ int bar;
36 [ac_cv_tls=$ax_tls_keyword ; break],
43 if test "$ac_cv_tls" != "none"; then
44 dnl AC_DEFINE([TLS], [], [If the compiler supports a TLS storage class define it to that here])
45 AC_DEFINE_UNQUOTED([TLS], $ac_cv_tls, [If the compiler supports a TLS storage class define it to that here])
47 AC_MSG_RESULT($ac_cv_tls)
50 # ===========================================================================
51 # http://www.nongnu.org/autoconf-archive/check_gnu_make.html
52 # ===========================================================================
60 # This macro searches for a GNU version of make. If a match is found, the
61 # makefile variable `ifGNUmake' is set to the empty string, otherwise it
62 # is set to "#". This is useful for including a special features in a
63 # Makefile, which cannot be handled by other versions of make. The
64 # variable _cv_gnu_make_command is set to the command to invoke GNU make
65 # if it exists, the empty string otherwise.
67 # Here is an example of its use:
69 # Makefile.in might contain:
71 # # A failsafe way of putting a dependency rule into a makefile
73 # $(CC) -MM $(srcdir)/*.c > $(DEPEND)
75 # @ifGNUmake@ ifeq ($(DEPEND),$(wildcard $(DEPEND)))
76 # @ifGNUmake@ include $(DEPEND)
79 # Then configure.in would normally contain:
84 # Then perhaps to cause gnu make to override any other make, we could do
85 # something like this (note that GNU make always looks for GNUmakefile
88 # if ! test x$_cv_gnu_make_command = x ; then
89 # mv Makefile GNUmakefile
90 # echo .DEFAULT: > Makefile ;
91 # echo \ $_cv_gnu_make_command \$@ >> Makefile;
94 # Then, if any (well almost any) other make is called, and GNU make also
95 # exists, then the other make wraps the GNU make.
99 # Copyright (c) 2008 John Darrington <j.darrington@elvis.murdoch.edu.au>
101 # Copying and distribution of this file, with or without modification, are
102 # permitted in any medium without royalty provided the copyright notice
103 # and this notice are preserved.
105 # Note: Modified by Ted Ts'o to add @ifNotGNUMake@
108 [CHECK_GNU_MAKE], [ AC_CACHE_CHECK( for GNU make,_cv_gnu_make_command,
109 _cv_gnu_make_command='' ;
110 dnl Search all the common names for GNU make
111 for a in "$MAKE" make gmake gnumake ; do
112 if test -z "$a" ; then continue ; fi ;
113 if ( sh -c "$a --version" 2> /dev/null | grep GNU 2>&1 > /dev/null ) ; then
114 _cv_gnu_make_command=$a ;
119 dnl If there was a GNU version, then set @ifGNUmake@ to the empty string, '#' otherwise
120 if test "x$_cv_gnu_make_command" != "x" ; then
126 AC_MSG_RESULT("Not found");
129 AC_SUBST(ifNotGNUmake)
131 # was originally from nls.m4 serial 1 (gettext-0.12)
132 AC_DEFUN([AM_MKINSTALLDIRS],
134 dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
135 dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
136 dnl Try to locate it.
138 if test -n "$ac_aux_dir"; then
139 case "$ac_aux_dir" in
140 /*) MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" ;;
141 *) MKINSTALLDIRS="\$(top_builddir)/$ac_aux_dir/mkinstalldirs" ;;
144 if test -z "$MKINSTALLDIRS"; then
145 MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
147 AC_SUBST(MKINSTALLDIRS)