]>
Commit | Line | Data |
---|---|---|
9519cd56 RB |
1 | # from http://autoconf-archive.cryp.to/ax_tls.html |
2 | # | |
3 | # This was licensed under the GPL with the following exception: | |
4 | # | |
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. | |
13 | # | |
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 | |
18 | # version as well. | |
19 | # | |
20 | AC_DEFUN([AX_TLS], [ | |
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 ;; | |
27 | *) | |
28 | AC_TRY_COMPILE( | |
29 | [#include <stdlib.h> | |
30 | static void | |
31 | foo(void) { | |
32 | static ] $ax_tls_keyword [ int bar; | |
33 | exit(1); | |
34 | }], | |
35 | [], | |
36 | [ac_cv_tls=$ax_tls_keyword ; break], | |
37 | ac_cv_tls=none | |
38 | ) | |
39 | esac | |
40 | done | |
41 | ]) | |
42 | ||
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]) | |
46 | fi | |
47 | AC_MSG_RESULT($ac_cv_tls) | |
48 | ]) | |
49 | ||
50 | # =========================================================================== | |
51 | # http://www.nongnu.org/autoconf-archive/check_gnu_make.html | |
52 | # =========================================================================== | |
53 | # | |
54 | # SYNOPSIS | |
55 | # | |
56 | # CHECK_GNU_MAKE() | |
57 | # | |
58 | # DESCRIPTION | |
59 | # | |
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. | |
66 | # | |
67 | # Here is an example of its use: | |
68 | # | |
69 | # Makefile.in might contain: | |
70 | # | |
71 | # # A failsafe way of putting a dependency rule into a makefile | |
72 | # $(DEPEND): | |
73 | # $(CC) -MM $(srcdir)/*.c > $(DEPEND) | |
74 | # | |
75 | # @ifGNUmake@ ifeq ($(DEPEND),$(wildcard $(DEPEND))) | |
76 | # @ifGNUmake@ include $(DEPEND) | |
77 | # @ifGNUmake@ endif | |
78 | # | |
79 | # Then configure.in would normally contain: | |
80 | # | |
81 | # CHECK_GNU_MAKE() | |
82 | # AC_OUTPUT(Makefile) | |
83 | # | |
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 | |
86 | # first): | |
87 | # | |
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; | |
92 | # fi | |
93 | # | |
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. | |
96 | # | |
97 | # LICENSE | |
98 | # | |
99 | # Copyright (c) 2008 John Darrington <j.darrington@elvis.murdoch.edu.au> | |
100 | # | |
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. | |
104 | # | |
105 | # Note: Modified by Ted Ts'o to add @ifNotGNUMake@ | |
106 | ||
107 | AC_DEFUN( | |
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 | |
e703ba4b | 111 | if test -n "$FORCE_NATIVE_MAKE" ; then |
f3bc1561 TT |
112 | MAKES="make" |
113 | else | |
114 | MAKES="make gmake gnumake" | |
115 | fi | |
116 | for a in "$MAKE" $MAKES ; do | |
9519cd56 RB |
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 ; | |
120 | break; | |
121 | fi | |
122 | done ; | |
123 | ) ; | |
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 | |
126 | ifGNUmake='' ; | |
127 | ifNotGNUmake='#' ; | |
128 | else | |
129 | ifGNUmake='#' ; | |
130 | ifNotGNUmake='' ; | |
131 | AC_MSG_RESULT("Not found"); | |
132 | fi | |
133 | AC_SUBST(ifGNUmake) | |
134 | AC_SUBST(ifNotGNUmake) | |
135 | ] ) | |
ea1a3fa2 NC |
136 | |
137 | # AX_CHECK_MOUNT_OPT: an autoconf macro to check for generic filesystem- | |
138 | # agnostic 'mount' options. Written by Nicholas Clark. Looks for constants in | |
139 | # sys/mount.h to predict whether the 'mount' utility will support a specific | |
140 | # mounting option. | |
141 | # | |
142 | # This macro can be used to check for the presence of 'nodev' (or other mount | |
143 | # options), which isn't uniformly implemented in the BSD family at the time of | |
144 | # this writing. Tested on FreeBSD, NetBSD, OpenBSD, and Linux. | |
145 | # | |
146 | # Usage: | |
147 | # | |
148 | # AX_CHECK_MOUNT_OPT(option) | |
149 | # | |
150 | # Defines HAVE_MOUNT_$OPTION (in uppercase) if the option exists, and sets | |
151 | # ac_cv_mount_$option (in original case) otherwise. | |
152 | # | |
153 | # Copyright (c) 2018 Nicholas Clark <nicholas.clark@gmail.com> | |
154 | # | |
155 | # Copying and distribution of this file, with or without modification, are | |
156 | # permitted in any medium without royalty or attribution requirement. | |
157 | ||
158 | AC_DEFUN([AX_CHECK_MOUNT_OPT], [__AX_CHECK_MOUNT_OPT(m4_tolower([$1]),m4_toupper([$1]))]) | |
159 | AC_DEFUN([__AX_CHECK_MOUNT_OPT], | |
160 | [ | |
161 | AS_IF([test "x$ac_cv_header_sys_mount_h" = x], | |
162 | [AC_CHECK_HEADERS([sys/mount.h])]) | |
163 | AS_IF([test "x$ac_cv_header_sys_mount_h" = xno], | |
164 | [AC_MSG_FAILURE([error: sys/mount.h not present on your system!])]) | |
165 | AS_ECHO_N("checking for mount '$1' option... ") | |
166 | AC_TRY_COMPILE( | |
167 | [#include <sys/mount.h>], | |
168 | [void *temp = (void *)(MS_$2); (void) temp;], | |
169 | [AC_DEFINE(HAVE_MOUNT_$2, 1, [Define to 1 if mount supports $1.]) | |
170 | AS_VAR_SET(ac_cv_mount_$1, yes) | |
171 | AS_ECHO("yes")], | |
172 | [AC_TRY_COMPILE( | |
173 | [#include <sys/mount.h>], | |
174 | [void *temp = (void *)(MNT_$2); (void) temp;], | |
175 | [AC_DEFINE(HAVE_MOUNT_$2, 1, [Define to 1 if mount supports $1.]) | |
176 | AS_VAR_SET(ac_cv_mount_$1, yes) | |
177 | AS_ECHO("yes")], | |
178 | [AS_VAR_SET(ac_cv_mount_$1, no) | |
179 | AS_ECHO("no")] | |
180 | )] | |
181 | ) | |
182 | ]) |