/boa-0.94.14rc21/aclocal.m4
m4 | 203 lines | 176 code | 17 blank | 10 comment | 0 complexity | e9c6e6017740fe9dd9d5bbb36f8c4b97 MD5 | raw file
Possible License(s): GPL-2.0
1# aclocal.m4 generated automatically by aclocal 1.6.2 -*- Autoconf -*-
2
3# Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
4# Free Software Foundation, Inc.
5# This file is free software; the Free Software Foundation
6# gives unlimited permission to copy and/or distribute it,
7# with or without modifications, as long as this notice is preserved.
8
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12# PARTICULAR PURPOSE.
13
14dnl Many of the following macros courtesy of:
15dnl http://www.gnu.org/software/ac-archive/
16dnl
17dnl The Following macros courtesy of:
18dnl Installed_Packages/check_gnu_make.html
19dnl
20dnl Copyrights are by the individual authors, as listed.
21dnl License: GPL
22dnl
23
24
25dnl CHECK_GNU_MAKE()
26dnl
27dnl This macro searches for a GNU version of make. If a match is found, the
28dnl makefile variable `ifGNUmake' is set to the empty string, otherwise it is
29dnl set to "#". This is useful for including a special features in a Makefile,
30dnl which cannot be handled by other versions of make. The variable
31dnl _cv_gnu_make_command is set to the command to invoke GNU make if it exists,
32dnl the empty string otherwise.
33dnl
34dnl Here is an example of its use:
35dnl
36dnl Makefile.in might contain:
37dnl
38dnl # A failsafe way of putting a dependency rule into a makefile
39dnl $(DEPEND):
40dnl $(CC) -MM $(srcdir)/*.c > $(DEPEND)
41dnl
42dnl @ifGNUmake@ ifeq ($(DEPEND),$(wildcard $(DEPEND)))
43dnl @ifGNUmake@ include $(DEPEND)
44dnl @ifGNUmake@ endif
45dnl
46dnl Then configure.in would normally contain:
47dnl
48dnl CHECK_GNU_MAKE()
49dnl AC_OUTPUT(Makefile)
50dnl
51dnl Then perhaps to cause gnu make to override any other make, we could do
52dnl something like this (note that GNU make always looks for GNUmakefile first):
53dnl
54dnl if ! test x$_cv_gnu_make_command = x ; then
55dnl mv Makefile GNUmakefile
56dnl echo .DEFAULT: > Makefile ;
57dnl echo \ $_cv_gnu_make_command \$@ >> Makefile;
58dnl fi
59dnl
60dnl Then, if any (well almost any) other make is called, and GNU make also exists,
61dnl then the other make wraps the GNU make.
62dnl
63dnl John Darrington <j.darrington@elvis.murdoch.edu.au>
64dnl 1.3 (2002/01/04)
65dnl
66dnl Modified 18 Sep 2002 by Jon Nelson <jnelson@boa.org>
67
68AC_DEFUN([CHECK_GNU_MAKE],
69 [ AC_CACHE_CHECK( for GNU make, _cv_gnu_make_command,
70 [_cv_gnu_make_command=''
71 dnl Search all the common names for GNU make
72 for a in "$MAKE" make gmake gnumake ; do
73 if test -z "$a" ; then continue ; fi
74 if ( sh -c "$a --version" 2> /dev/null | grep GNU 2>&1 > /dev/null ); then
75 _cv_gnu_make_command=$a
76 break;
77 fi
78 done
79 if test "x$_cv_gnu_make_command" = "x"; then
80 _cv_gnu_make_command="Not found"
81 fi
82 ])
83dnl If there was a GNU version, then set @ifGNUmake@ to the empty string, '#' otherwise
84 if test "$_cv_gnu_make_command" != "Not found"; then
85 ifGNUmake='';
86 else
87 ifGNUmake='#';
88 _cv_gnu_make_command='';
89 fi
90 AC_SUBST(ifGNUmake)
91 ])
92
93dnl AC_CHECK_STRUCT_FOR(INCLUDES,STRUCT,MEMBER,DEFINE,[no])
94dnl 1.1 (2000/09/19)
95dnl Wes Hardaker <wjhardaker@ucdavis.edu>
96
97dnl ----------------------------------------------------------
98
99AC_DEFUN([AC_CHECK_STRUCT_FOR],[
100ac_safe_struct=`echo "$2" | sed 'y%./+-%__p_%'`
101ac_safe_member=`echo "$3" | sed 'y%./+-%__p_%'`
102ac_safe_all="ac_cv_struct_${ac_safe_struct}_has_${ac_safe_member}"
103changequote(, )dnl
104 ac_uc_define=STRUCT_`echo "${ac_safe_struct}_HAS_${ac_safe_member}" | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
105changequote([, ])dnl
106
107AC_MSG_CHECKING([for $2.$3])
108AC_CACHE_VAL($ac_safe_all,
109[
110if test "x$4" = "x"; then
111 defineit="= 0"
112elif test "x$4" = "xno"; then
113 defineit=""
114else
115 defineit="$4"
116fi
117AC_TRY_COMPILE([
118$1
119],[
120struct $2 testit;
121testit.$3 $defineit;
122], eval "${ac_safe_all}=yes", eval "${ac_safe_all}=no" )
123])
124
125if eval "test \"x$`echo ${ac_safe_all}`\" = \"xyes\""; then
126 AC_MSG_RESULT(yes)
127 AC_DEFINE_UNQUOTED($ac_uc_define)
128else
129 AC_MSG_RESULT(no)
130fi
131])
132
133dnl @synopsis AC_C_VAR_FUNC
134dnl
135dnl This macro tests if the C complier supports the C9X standard
136dnl __func__ indentifier.
137dnl
138dnl The new C9X standard for the C language stipulates that the
139dnl identifier __func__ shall be implictly declared by the compiler
140dnl as if, immediately following the opening brace of each function
141dnl definition, the declaration
142dnl
143dnl static const char __func__[] = "function-name";
144dnl
145dnl appeared, where function-name is the name of the function where
146dnl the __func__ identifier is used.
147dnl
148dnl @version $Id: aclocal.m4,v 1.1.2.5 2003/01/20 20:53:52 jnelson Exp $
149dnl @author Christopher Currie <christopher@currie.com>
150
151AC_DEFUN([AC_C_VAR_FUNC],
152[AC_REQUIRE([AC_PROG_CC])
153AC_CACHE_CHECK(whether $CC recognizes __func__, ac_cv_c_var_func,
154AC_TRY_COMPILE(,
155[int main() {
156char *s = __func__;
157}],
158AC_DEFINE(HAVE_FUNC,,
159[Define if the C complier supports __func__]) ac_cv_c_var_func=yes,
160ac_cv_c_var_func=no) )
161])dnl
162
163dnl Exports one of ac_cv_func_poll or ac_cv_func_select
164dnl Author - Jon Nelson <jnelson@boa.org>
165dnl Copyright 2002
166AC_DEFUN([POLL_OR_SELECT],
167 [
168 AC_MSG_CHECKING(whether to use poll or select)
169 AC_ARG_WITH(poll,
170 [ --with-poll Use poll],
171 [
172 if test "$withval" = "yes" ; then
173 AC_MSG_RESULT(trying poll)
174 ac_x=1
175 else
176 AC_MSG_RESULT(trying select)
177 ac_x=0
178 fi
179 ],
180 [
181 AC_MSG_RESULT(trying select)
182 ac_x=0
183 ])
184
185 if test $ac_x = 1; then
186 AC_CHECK_HEADERS(sys/poll.h)
187 AC_CHECK_FUNCS(poll)
188 if test "x$ac_cv_func_poll" = "x"; then
189 AC_MSG_ERROR(We attempted to find poll but could not. Please try again with --without-poll)
190 fi
191 BOA_ASYNC_IO="poll"
192 else
193 AC_CHECK_HEADERS(sys/select.h)
194 AC_CHECK_FUNCS(select)
195 if test "x$ac_cv_func_select" = "x"; then
196 AC_MSG_ERROR(We attempted to find select but could not. Please try again with --with-poll)
197 fi
198 BOA_ASYNC_IO="select"
199 fi
200 ]
201)
202
203