c0bd7dbdee936e894a5ef798080025a26de6882f
[AGL/meta-agl.git] / meta-security / recipes-devtools / e2fsprogs / e2fsprogs / acinclude.m4
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.
3 #
4 # Signed-off-by: Ross Burton <ross.burton@intel.com>
5
6 # from http://autoconf-archive.cryp.to/ax_tls.html
7 #
8 # This was licensed under the GPL with the following exception:
9 #
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.
18 #
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
23 # version as well.
24 #
25 AC_DEFUN([AX_TLS], [
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 ;;
32           *)
33              AC_TRY_COMPILE(
34                 [#include <stdlib.h>
35                  static void
36                  foo(void) {
37                  static ] $ax_tls_keyword [ int bar;
38                  exit(1);
39                  }],
40                  [],
41                  [ac_cv_tls=$ax_tls_keyword ; break],
42                  ac_cv_tls=none
43              )
44           esac
45     done
46 ])
47
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])
51   fi
52   AC_MSG_RESULT($ac_cv_tls)
53 ])
54
55 # ===========================================================================
56 #         http://www.nongnu.org/autoconf-archive/check_gnu_make.html
57 # ===========================================================================
58 #
59 # SYNOPSIS
60 #
61 #   CHECK_GNU_MAKE()
62 #
63 # DESCRIPTION
64 #
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.
71 #
72 #   Here is an example of its use:
73 #
74 #   Makefile.in might contain:
75 #
76 #       # A failsafe way of putting a dependency rule into a makefile
77 #       $(DEPEND):
78 #               $(CC) -MM $(srcdir)/*.c > $(DEPEND)
79 #
80 #       @ifGNUmake@ ifeq ($(DEPEND),$(wildcard $(DEPEND)))
81 #       @ifGNUmake@ include $(DEPEND)
82 #       @ifGNUmake@ endif
83 #
84 #   Then configure.in would normally contain:
85 #
86 #       CHECK_GNU_MAKE()
87 #       AC_OUTPUT(Makefile)
88 #
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
91 #   first):
92 #
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;
97 #       fi
98 #
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.
101 #
102 # LICENSE
103 #
104 #   Copyright (c) 2008 John Darrington <j.darrington@elvis.murdoch.edu.au>
105 #
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.
109 #
110 # Note: Modified by Ted Ts'o to add @ifNotGNUMake@
111
112 AC_DEFUN(
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 ;
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 ] )