1 dnl acinclude.m4 generated automatically by ac-archive's acinclude 0.5.53
3 dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
8 dnl This program is distributed in the hope that it will be useful,
9 dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10 dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11 dnl PARTICULAR PURPOSE.
13 dnl ______ /usr/share/aclocal/guidod/ax_cflags_gcc_option.m4 ______
14 dnl @synopsis AX_CFLAGS_GCC_OPTION ([shellvar], optionflag [,A/NA])
16 dnl AX_CFLAGS_GCC_OPTION(-fvomit-frame) would show a message as like
17 dnl "checking CFLAGS for gcc -fvomit-frame ... yes" and adds
18 dnl the optionflag to CFLAGS if it is understood. You can override
19 dnl the shellvar-default of CFLAGS of course. The order of arguments
20 dnl stems from the explicit macros like AX_CFLAGS_WARN_ALL.
22 dnl The cousin AX_CXXFLAGS_GCC_OPTION would check for an option to add
23 dnl to CXXFLAGS - and it uses the autoconf setup for C++ instead of C
24 dnl (since it is possible to use different compilers for C and C++).
26 dnl The macro is a lot simpler than any special AX_CFLAGS_* macro (or
27 dnl ac_cxx_rtti.m4 macro) but allows to check for arbitrary options.
28 dnl However, if you use this macro in a few places, it would be great
29 dnl if you would make up a new function-macro and submit it to the
32 dnl - $1 shell-variable-to-add-to : CFLAGS
33 dnl - $2 option-to-check-for : required ("-option" as non-value)
34 dnl - $3 action-if-found : add value to shellvariable
35 dnl - $4 action-if-not-found : nothing
37 dnl @, untested, experimental
38 dnl @version %Id: ax_cflags_gcc_option.m4,v 1.2 2003/06/04 23:54:23 guidod Exp %
39 dnl @author Guido Draheim <guidod@gmx.de>
41 AC_DEFUN([AX_CFLAGS_GCC_OPTION], [dnl
42 AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl
43 AS_VAR_PUSHDEF([VAR],[ac_cv_cflags_gcc_option_$2])dnl
44 AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for gcc m4_ifval($2,$2,-option)],
45 VAR,[VAR="no, unknown"
48 ac_save_[]FLAGS="$[]FLAGS"
50 in "-pedantic % m4_ifval($2,$2,-option)" dnl GCC
52 do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
53 AC_TRY_COMPILE([],[return 0;],
54 [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
56 FLAGS="$ac_save_[]FLAGS"
60 .ok|.ok,*) m4_ifvaln($3,$3) ;;
61 .|.no|.no,*) m4_ifvaln($4,$4) ;;
63 if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
64 then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
65 else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
66 m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
69 AS_VAR_POPDEF([VAR])dnl
70 AS_VAR_POPDEF([FLAGS])dnl
74 dnl the only difference - the LANG selection... and the default FLAGS
76 AC_DEFUN([AX_CXXFLAGS_GCC_OPTION], [dnl
77 AS_VAR_PUSHDEF([FLAGS],[CXXFLAGS])dnl
78 AS_VAR_PUSHDEF([VAR],[ac_cv_cxxflags_gcc_option_$2])dnl
79 AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for gcc m4_ifval($2,$2,-option)],
80 VAR,[VAR="no, unknown"
83 ac_save_[]FLAGS="$[]FLAGS"
85 in "-pedantic % m4_ifval($2,$2,-option)" dnl GCC
87 do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
88 AC_TRY_COMPILE([],[return 0;],
89 [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
91 FLAGS="$ac_save_[]FLAGS"
95 .ok|.ok,*) m4_ifvaln($3,$3) ;;
96 .|.no|.no,*) m4_ifvaln($4,$4) ;;
98 if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
99 then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
100 else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
101 m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
104 AS_VAR_POPDEF([VAR])dnl
105 AS_VAR_POPDEF([FLAGS])dnl
110 dnl ______ /usr/share/aclocal/guidod/patch_libtool_sys_lib_search_path_spec.m4 ______
111 dnl @* PATCH_LIBTOOL_SYS_LIB_SEARCH_PATH_SPEC
113 dnl Cross-compiling to win32 from a unix system reveals a bug - the
114 dnl path-separator has been set to ";" depending on the target system.
115 dnl However, the crossgcc search_path_spec works in a unix-environment
116 dnl with unix-style directories and unix-stylish path_separator. The
117 dnl result: the search_path_spec is a single word still containing the
120 dnl This macro fixes the situation: when we see the libtool PATH_SEP
121 dnl to be ":" and search_path_spec to contain ":" characters, then
122 dnl these are replaced with spaces to let the resulting string work
123 dnl as a for-loop argument in libtool scripts that resolve -no-undefined
126 dnl Later libtool generations have fixed the situation with using
127 dnl $PATH_SEPARATOR in the first place as the original path delimiter
128 dnl that will be scanned for and replaced into spaces.
131 dnl @%Id: patch_libtool_sys_lib_search_path_spec.m4,v 1.3 2003/03/23 13:20:27 guidod Exp %
133 AC_DEFUN([PATCH_LIBTOOL_SYS_LIB_SEARCH_PATH_SPEC],
134 [# patch libtool to fix sys_lib_search_path (e.g. crosscompiling a win32 dll)
135 if test "_$PATH_SEPARATOR" = "_:" ; then
136 if grep "^sys_lib_search_path_spec.*:" libtool >/dev/null ; then
137 AC_MSG_RESULT(patching libtool to fix sys_lib_search_path_spec)
138 test -f libtool.old || (mv libtool libtool.old && cp libtool.old libtool)
139 sed -e "/^sys_lib_search_path_spec/s/:/ /g" libtool >libtool.new
140 (test -s libtool.new || rm libtool.new) 2>/dev/null
141 test -f libtool.new && mv libtool.new libtool # not 2>/dev/null !!
142 test -f libtool || mv libtool.old libtool
146 dnl ______ /usr/share/aclocal/guidod/ax_warning_default_aclocaldir.m4 ______
147 dnl @* AX_WARNING_DEFAULT_ACLOCALDIR [(dirvariable [,defsetting])]
149 dnl print a warning message if the $(datadir)/aclocal directory
150 dnl is not in the dirlist searched by the aclocal tool. This macro
151 dnl is useful if some `make install` would target $(datadir)/aclocal
152 dnl to install an autoconf m4 file of your project to be picked up
153 dnl by other projects.
155 dnl default $1 dirvariable = aclocaldir
156 dnl default $2 defsetting = ${datadir}/aclocal
157 dnl (the defsetting is not placed in dirvariable nor is it ac_subst'ed)
162 AC_DEFUN([AX_WARNING_DEFAULT_ACLOCALDIR],[dnl
163 AC_REQUIRE([AX_EXPAND_PREFIX])dnl
164 AS_VAR_PUSHDEF([DIR],[ax_warning_default_aclocal_dir])dnl
165 AS_VAR_PUSHDEF([BIN],[ax_warning_default_aclocal_bin])dnl
166 AS_VAR_PUSHDEF([LOC],[ax_warning_default_aclocal_loc])dnl
167 if test ".$ACLOCAL" = "." ; then
168 AC_PATH_PROG([ACLOCAL],[aclocal],[:])
170 LOC='m4_if([$2],,[${datadir}/aclocal],[$2])'
171 m4_ifval([$1],[test ".$[]$1" != "." && LOC="$[]$1"])
173 test ".$BIN" = "." && BIN="aclocal"
174 DIR=`test ".$SHELL" = "." && SHELL="'sh'" ; eval "$BIN --print-ac-dir"`
175 test ".$DIR" = "." && test -d "/usr/share/aclocal" && DIR="/usr/share/aclocal"
176 test ".$DIR" = "." && DIR="/"
177 DIR=`eval "echo $DIR"` # we need to expand
178 DIR=`eval "echo $DIR"`
179 LOC=`eval "echo $LOC"`
180 LOC=`eval "echo $LOC"`
181 AC_RUN_LOG([: test "$LOC" = "$DIR"])
182 if test "$LOC" != "$DIR" ; then
183 if test -f "$DIR/dirlist" ; then
184 for DIR in `cat $DIR/dirlist` $DIR ; do
185 AC_RUN_LOG([: test "$LOC" = "$DIR"])
186 test "$LOC" = "$DIR" && break
189 if test "$LOC" != "$DIR" ; then
190 AC_MSG_NOTICE([warning: m4_if([$1],,[aclocaldir],[$1])=$LOC dnl
192 AC_MSG_NOTICE([perhaps: make install m4_if([$1],,[aclocaldir],[$1])=$DIR])
193 cat m4_ifset([AS_MESSAGE_LOG_FD],[>&AS_MESSAGE_LOG_FD],[>>config.log]) <<EOF
194 aclocaldir: the m4_if([$1],,[default aclocaldir],[$1 value]) of $LOC
195 aclocaldir: is not listed in the dirlist where aclocal will look
196 aclocaldir: for macros - you can override the install-path using
197 aclocaldir: make install aclocaldir=$DIR
198 aclocaldir: or append the directory to aclocal reconfigures later as
199 aclocaldir: aclocal -I $LOC
200 aclocaldir: when an autoconf macro is needed from that directory
204 AS_VAR_POPDEF([LOC])dnl
205 AS_VAR_POPDEF([BIN])dnl
206 AS_VAR_POPDEF([DIR])dnl
209 dnl ______ /usr/share/aclocal/guidod/ax_cflags_warn_all.m4 ______
210 dnl @synopsis AX_CFLAGS_WARN_ALL [(shellvar [,default, [A/NA]])]
212 dnl Try to find a compiler option that enables most reasonable warnings.
213 dnl This macro is directly derived from VL_PROG_CC_WARNINGS which is
214 dnl split up into two AX_CFLAGS_WARN_ALL and AX_CFLAGS_WARN_ALL_ANSI
216 dnl For the GNU CC compiler it will be -Wall (and -ansi -pedantic)
217 dnl The result is added to the shellvar being CFLAGS by default.
219 dnl Currently this macro knows about GCC, Solaris C compiler,
220 dnl Digital Unix C compiler, C for AIX Compiler, HP-UX C compiler,
221 dnl IRIX C compiler, NEC SX-5 (Super-UX 10) C compiler, and Cray J90
222 dnl (Unicos 10.0.0.8) C compiler.
224 dnl - $1 shell-variable-to-add-to : CFLAGS
225 dnl - $2 add-value-if-not-found : nothing
226 dnl - $3 action-if-found : add value to shellvariable
227 dnl - $4 action-if-not-found : nothing
229 dnl @version %Id: ax_cflags_warn_all.m4,v 1.1 2003/01/06 00:51:33 guidod Exp %
230 dnl @author Guido Draheim <guidod@gmx.de>
232 AC_DEFUN([AX_CFLAGS_WARN_ALL],[dnl
233 AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl
234 AS_VAR_PUSHDEF([VAR],[ac_cv_cflags_warn_all])dnl
235 AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for maximum warnings],
236 VAR,[VAR="no, unknown"
239 ac_save_[]FLAGS="$[]FLAGS"
241 in "-pedantic % -Wall" dnl GCC
242 "-xstrconst % -v" dnl Solaris C
243 "-std1 % -verbose -w0 -warnprotos" dnl Digital Unix
244 "-qlanglvl=ansi % -qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd" dnl AIX
245 "-ansi -ansiE % -fullwarn" dnl IRIX
246 "+ESlit % +w1" dnl HP-UX C
247 "-Xc % -pvctl[,]fullmsg" dnl NEC SX-5 (Super-UX 10)
248 "-h conform % -h msglevel 2" dnl Cray C (Unicos)
250 do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
251 AC_TRY_COMPILE([],[return 0;],
252 [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
254 FLAGS="$ac_save_[]FLAGS"
258 .ok|.ok,*) m4_ifvaln($3,$3) ;;
259 .|.no|.no,*) m4_ifvaln($4,$4,[m4_ifval($2,[
260 AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])
261 m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])]) ;;
263 if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
264 then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
265 else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
266 m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
269 AS_VAR_POPDEF([VAR])dnl
270 AS_VAR_POPDEF([FLAGS])dnl
273 dnl the only difference - the LANG selection... and the default FLAGS
275 AC_DEFUN([AX_CXXFLAGS_WARN_ALL],[dnl
276 AS_VAR_PUSHDEF([FLAGS],[CXXFLAGS])dnl
277 AS_VAR_PUSHDEF([VAR],[ac_cv_cxxflags_warn_all])dnl
278 AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for maximum warnings],
279 VAR,[VAR="no, unknown"
282 ac_save_[]FLAGS="$[]FLAGS"
284 in "-pedantic % -Wall" dnl GCC
285 "-xstrconst % -v" dnl Solaris C
286 "-std1 % -verbose -w0 -warnprotos" dnl Digital Unix
287 "-qlanglvl=ansi % -qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd" dnl AIX
288 "-ansi -ansiE % -fullwarn" dnl IRIX
289 "+ESlit % +w1" dnl HP-UX C
290 "-Xc % -pvctl[,]fullmsg" dnl NEC SX-5 (Super-UX 10)
291 "-h conform % -h msglevel 2" dnl Cray C (Unicos)
293 do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
294 AC_TRY_COMPILE([],[return 0;],
295 [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
297 FLAGS="$ac_save_[]FLAGS"
301 .ok|.ok,*) m4_ifvaln($3,$3) ;;
302 .|.no|.no,*) m4_ifvaln($4,$4,[m4_ifval($2,[
303 AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])
304 m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])]) ;;
306 if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
307 then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
308 else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
309 m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
312 AS_VAR_POPDEF([VAR])dnl
313 AS_VAR_POPDEF([FLAGS])dnl
316 dnl implementation tactics:
317 dnl the for-argument contains a list of options. The first part of
318 dnl these does only exist to detect the compiler - usually it is
319 dnl a global option to enable -ansi or -extrawarnings. All other
320 dnl compilers will fail about it. That was needed since a lot of
321 dnl compilers will give false positives for some option-syntax
322 dnl like -Woption or -Xoption as they think of it is a pass-through
323 dnl to later compile stages or something. The "%" is used as a
324 dnl delimimiter. A non-option comment can be given after "%%" marks.
327 dnl ______ /usr/share/aclocal/guidod/ax_cflags_strict_prototypes.m4 ______
328 dnl @synopsis AX_CFLAGS_STRICT_PROTOTYPES [(shellvar [,default, [A/NA]]
330 dnl Try to find a compiler option that requires strict prototypes.
332 dnl The sanity check is done by looking at sys/signal.h which has a set
333 dnl of macro-definitions SIG_DFL and SIG_IGN that are cast to the local
334 dnl signal-handler type. If that signal-handler type is not fully
335 dnl qualified then the system headers are not seen as strictly prototype clean.
337 dnl For the GNU CC compiler it will be -fstrict-prototypes -Wstrict-prototypes
338 dnl The result is added to the shellvar being CFLAGS by default.
342 dnl - $1 shell-variable-to-add-to : CFLAGS
343 dnl - $2 add-value-if-not-found : nothing
344 dnl - $3 action-if-found : add value to shellvariable
345 dnl - $4 action-if-not-found : nothing
347 dnl @version %Id: ax_cflags_strict_prototypes.m4,v 1.7 2003/06/05 00:52:22 guidod Exp %
348 dnl @author Guido Draheim <guidod@gmx.de>
350 AC_DEFUN([AX_CFLAGS_STRICT_PROTOTYPES],[dnl
351 AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl
352 AS_VAR_PUSHDEF([VAR],[ac_cv_cflags_strict_prototypes])dnl
353 AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for strict prototypes],
354 VAR,[VAR="no, unknown"
357 ac_save_[]FLAGS="$[]FLAGS"
359 in "-Wall % -fstrict-prototypes -Wstrict-prototypes" dnl GCC
360 "-Wall % -Wstrict-prototypes" dnl try to warn atleast
362 do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
363 AC_TRY_COMPILE([],[return 0;],
364 [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
368 *) # sanity check with signal() from sys/signal.h
369 cp config.log config.tmp
370 AC_TRY_COMPILE([#include <signal.h>],[
371 if (signal (SIGINT, SIG_IGN) == SIG_DFL) return 1;
372 if (signal (SIGINT, SIG_IGN) != SIG_DFL) return 2;],
373 dnl the original did use test -n `$CC testprogram.c`
374 [if test `diff config.log config.tmp | grep -i warning | wc -l` != 0
375 then if test `diff config.log config.tmp | grep -i warning | wc -l` != 1
376 then VAR="no, suppressed, signal.h," ; fi ; fi],
377 [VAR="no, suppressed, signal.h"])
381 FLAGS="$ac_save_[]FLAGS"
385 .ok|.ok,*) m4_ifvaln($3,$3) ;;
386 .|.no|.no,*) m4_ifvaln($4,$4,[m4_ifval($2,[
387 AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])
388 m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])]) ;;
390 if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
391 then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
392 else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
393 m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
396 AS_VAR_POPDEF([VAR])dnl
397 AS_VAR_POPDEF([FLAGS])dnl
400 dnl the only difference - the LANG selection... and the default FLAGS
402 AC_DEFUN([AX_CXXFLAGS_STRICT_PROTOTYPES],[dnl
403 AS_VAR_PUSHDEF([FLAGS],[CXXFLAGS])dnl
404 AS_VAR_PUSHDEF([VAR],[ac_cv_cxxflags_strict_prototypes])dnl
405 AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for strict prototypes],
406 VAR,[VAR="no, unknown"
409 ac_save_[]FLAGS="$[]FLAGS"
411 in "-Wall % -fstrict-prototypes -Wstrict-prototypes" dnl GCC
412 "-Wall % -Wstrict-prototypes" dnl try to warn atleast
414 do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
415 AC_TRY_COMPILE([],[return 0;],
416 [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
420 *) # sanity check with signal() from sys/signal.h
421 cp config.log config.tmp
422 AC_TRY_COMPILE([#include <signal.h>],[
423 if (signal (SIGINT, SIG_IGN) == SIG_DFL) return 1;
424 if (signal (SIGINT, SIG_IGN) != SIG_DFL) return 2;],
425 dnl the original did use test -n `$CC testprogram.c`
426 [if test `diff config.log config.tmp | grep -i warning | wc -l` != 0
427 then if test `diff config.log config.tmp | grep -i warning | wc -l` != 1
428 then VAR="no, suppressed, signal.h," ; fi ; fi],
429 [VAR="no, suppressed, signal.h"])
433 FLAGS="$ac_save_[]FLAGS"
437 .ok|.ok,*) m4_ifvaln($3,$3) ;;
438 .|.no|.no,*) m4_ifvaln($4,$4,[m4_ifval($2,[
439 AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])
440 m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])]) ;;
442 if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
443 then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
444 else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
445 m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
448 AS_VAR_POPDEF([VAR])dnl
449 AS_VAR_POPDEF([FLAGS])dnl
452 dnl ______ /usr/share/aclocal/guidod/ax_spec_package_version.m4 ______
453 dnl @* AX_SPEC_PACKAGE_AND_VERSION ([specfile])
454 dnl @* AX_SPEC_PACKAGE_NAME ([shellvar],[defaultvalue])
455 dnl @* AX_SPEC_PACKAGE_VERSION ([shellvar],[defaultvalue])
456 dnl @* AX_SPEC_PACKAGE_SUMMARY ([shellvar],[defaultvalue])
457 dnl @* AX_SPEC_PACKAGE_LICENSE ([shellvar],[defaultvalue])
458 dnl @* AX_SPEC_PACKAGE_CATEGORY ([shellvar],[defaultvalue])
459 dnl @* AX_SPEC_PACKAGE_ICON ([shellvar],[defaultvalue])
460 dnl @* AX_SPEC_DEFAULTS([specfile])
462 dnl set PACKAGE from the given specfile - default to basename of
463 dnl the rpmspecfile if no "name:" could be found in the spec file.
465 dnl set VERSION from the given specfile - default to a date-derived
466 dnl value if no "version:" could be found in the spec file.
468 dnl this macro builds on top of AX_SPEC_FILE / AX_SPEC_EXTRACT
470 dnl more specific: if not "name:" or "%define name" was found in
471 dnl the myproject.spec file then the PACKAGE var is set to the
472 dnl basename "myproject". When no spec file was present then it
473 dnl will usually default to "TODO".
475 dnl The version spec looks for "version:" or "%define version" in
476 dnl the spec file. When no such value was seen or no spec file
477 dnl had been present then the value is set to `date +0.%y.%W%w`.
479 dnl the version value itself is sanitized somewhat with making
480 dnl it to always carry atleast three digits (1.2.3) and clensing
481 dnl superflous "0" chars around from generating numbers elsewhere.
483 dnl additional macros are provided that extract a specific value
484 dnl from the spec file, among these:
486 dnl set PACKAGE_SUMMARY from the given specfile - default to package and
487 dnl try to detect a type suffix if "summary:" was not in the spec file
489 dnl set PACKAGE_LICENSE from the given specfile - if no "license:" tag was
490 dnl given in the spec file then various COPYING files are grepped to
491 dnl have a guess and the final fallback will be GNU GPL (or GNU LGPL).
493 dnl set PACKAGE_ICON from the given specfile - if no "icon:" tag was
494 dnl given in the spec file then we default to $PACKAGE-icon.png
496 dnl the final AX_SPEC_INIT(specfile) will initialize all variables to
497 dnl its defaults according to the spec file given.
500 dnl @author Guido Draheim <guidod@gmx.de>
502 AC_DEFUN([AX_SPEC_PACKAGE_LICENSE],[AC_REQUIRE([AX_SPEC_FILE])dnl
503 AS_VAR_PUSHDEF([VAR],[PACKAGE_LICENSE])dnl
504 AC_MSG_CHECKING([for spec license type])
505 if test ".$VAR" = "." ; then if test ! -f $ax_spec_file
508 AX_SPEC_EXTRACT(VAR,[license],m4_ifval($1,$1))
509 VAR=`echo $VAR | sed -e 's/ *License//g'`
511 test ".$VAR" = "." && k="(fallback)"
512 ifelse($2,,[dnl here the defaults for LICENSE / COPYRIGHT
513 if test ".$VAR" = "." ; then
514 for ac_file in "$srcdir/COPYING" "$srcdir/COPYING" "$srcdir/LICENSE" ; do
515 test -f "$ac_file" || continue
516 dnl http://www.ibiblio.org/osrt/omf/omf_elements "16. Rights"
517 if grep "GNU LESSER GENERAL PUBLIC LICENSE" "$ac_file" >/dev/null
518 then VAR="GNU LGPL" ; break
519 elif grep "GNU GENERAL PUBLIC LICENSE" "$ac_file" >/dev/null
520 then VAR="GNU GPL" ; break
521 elif grep "MOZILLA PUBLIC LICENSE" "$ac_file" >/dev/null
522 then VAR="MPL" ; break
523 elif grep "Mozilla Public License" "$ac_file" >/dev/null
524 then VAR="MPL" ; break
525 elif grep -i "artistic license" "$ac_file" >/dev/null
526 then VAR="Artistic" ; break
527 elif grep -i "artistic control" "$ac_file" >/dev/null
528 then VAR="Artistic" ; break
529 elif grep -i "semblance of artistic" "$ac_file" >/dev/null
530 then VAR="Artistic" ; break
531 elif grep -i "above copyright notice" "$ac_file" >/dev/null
532 then VAR="BSD" ; break
535 if test ".$VAR" = "." ; then
536 if test "$srcdir/COPYING.LIB" ; then VAR="GNU LGPL"
537 elif test ".$ltmain" != "." ; then VAR="GNU LGPL"
542 ],[test ".$VAR" = "." && VAR="$2"])
543 test "$VAR" = "GPL" && VAR="GNU GPL"
544 test "$VAR" = "LGPL" && VAR="GNU LGPL"
545 AC_MSG_RESULT([m4_ifval([$1],[$1 = ])$VAR $k])
546 AS_VAR_POPDEF([VAR])dnl
549 AC_DEFUN([AX_SPEC_PACKAGE_SUMMARY],[AC_REQUIRE([AX_SPEC_FILE])dnl
550 AS_VAR_PUSHDEF([VAR],[PACKAGE_SUMMARY])dnl
551 AC_MSG_CHECKING([for spec summary])
552 if test ".$VAR" = "." ; then if test ! -f $ax_spec_file
555 AX_SPEC_EXTRACT(VAR,[summary],m4_ifval($1,$1))
557 test ".$VAR" = "." && k="(fallback)"
558 ifelse($2,,[dnl here the defaults for SUMMARY
559 if test ".$VAR" = "." ; then VAR="$PACKAGE"
560 test ".$VAR" = "." && VAR="foo"
561 test ".$ltmain" != "." && VAR="$VAR library"
563 ],[test ".$VAR" = "." && VAR="$2"])
564 AC_MSG_RESULT([m4_ifval([$1],[$1 = ])$VAR $k])
565 AS_VAR_POPDEF([VAR])dnl
568 AC_DEFUN([AX_SPEC_PACKAGE_ICON],[AC_REQUIRE([AX_SPEC_FILE])dnl
569 AS_VAR_PUSHDEF([VAR],[PACKAGE_ICON])dnl
570 AC_MSG_CHECKING([for spec icon])
571 if test ".$VAR" = "." ; then if test ! -f $ax_spec_file
574 AX_SPEC_EXTRACT(VAR,[icon],m4_ifval($1,$1))
576 test ".$VAR" = "." && k="(fallback)"
577 ifelse($2,,[dnl here the defaults for ICON
578 if test ".$VAR" = "." ; then VAR="$PACKAGE-icon.png" ; fi
579 ],[test ".$VAR" = "." && VAR="$2"])
580 AC_MSG_RESULT([m4_ifval([$1],[$1 = ])$VAR $k])
581 AS_VAR_POPDEF([VAR])dnl
584 AC_DEFUN([AX_SPEC_PACKAGE_CATEGORY],[AC_REQUIRE([AX_SPEC_FILE])dnl
585 AS_VAR_PUSHDEF([VAR],[PACKAGE_CATEGORY])dnl
586 AC_MSG_CHECKING([for spec category])
587 if test ".$VAR" = "." ; then if test ! -f $ax_spec_file
590 AX_SPEC_EXTRACT(VAR,[group],m4_ifval($1,$1))
591 VAR=`echo $VAR | sed -e 's/ /-/g'`
593 test ".$VAR" = "." && k="(fallback)"
594 ifelse($2,,[dnl here the defaults for CATEGORY
595 if test ".$VAR" = "." ; then if test ".$ltmain" != "."
596 then VAR="Development/Library"
597 else VAR="Development/Other"
599 ],[test ".$VAR" = "." && VAR="$2"])
600 AC_MSG_RESULT([m4_ifval([$1],[$1 = ])$VAR $k])
601 AS_VAR_POPDEF([VAR])dnl
604 AC_DEFUN([AX_SPEC_PACKAGE_NAME],[AC_REQUIRE([AX_SPEC_FILE])dnl
605 AS_VAR_PUSHDEF([VAR],[PACKAGE_NAME])dnl
606 AC_MSG_CHECKING([for spec package])
607 if test ".$VAR" = "." ; then if test ! -f $ax_spec_file
610 AX_SPEC_EXTRACT(VAR,[name],m4_ifval($1,$1))
611 VAR=`echo $VAR | sed -e 's/ /-/g'`
613 test ".$VAR" = "." && k="(fallback)"
614 ifelse($2,,[dnl here the defaults for PACKAGE
615 test ".$VAR" = "." && VAR=`basename $ax_spec_file .spec`
616 test ".$VAR" = ".README" && VAR="TODO"
617 test ".$VAR" = ".TODO" && VAR="foo"
618 ],[test ".$VAR" = "." && VAR="$2"])
619 test "VAR" = "PACKAGE_NAME" && test ".$PACKAGE" = "." && PACKAGE="$VAR"
620 AC_MSG_RESULT([m4_ifval([$1],[$1 = ])$VAR $k])
621 AS_VAR_POPDEF([VAR])dnl
624 AC_DEFUN([AX_SPEC_PACKAGE_VERSION_],[AC_REQUIRE([AX_SPEC_FILE])dnl
625 AS_VAR_PUSHDEF([VAR],[PACKAGE_VERSION])dnl
626 AC_MSG_CHECKING([for spec version])
627 if test ".$VAR" = "." ; then if test ! -f $ax_spec_file
630 AX_SPEC_EXTRACT(VAR,[version],m4_ifval($1,$1))
631 VAR=`echo $VAR | sed -e 's/ /-/g'`
633 test ".$VAR" = "." && k="(fallback)"
634 ifelse($2,,[dnl here the defaults for VERSION
635 test ".$VAR" = "." && VAR=`date +0.%y.%W%w`
636 ],[test ".$VAR" = "." && VAR="$2"])
637 test "VAR" = "PACKAGE_VERSION" && test ".$VERSION" = "." && VERSION="$VAR"
638 case "$VAR" in # note we set traditional VERSION before cleaning things up
639 *.*.) VAR="$VAR"`date +%W%w` ;;
641 *.) VAR="$VAR"`date +%y.%W%w` ;;
643 *) VAR=AS_TR_SH([$VAR]) ; VAR="$VAR.`date +%y.%W%w`" ;;
645 VAR=`echo $VAR | sed -e "s/[[.]][0]\\([0-9]\\)/.\\1/g"`
646 AC_MSG_RESULT([m4_ifval([$1],[$1 = ])$VAR $k])
647 AS_VAR_POPDEF([VAR])dnl
650 dnl for compatibility, we define ax_spec_package_version
651 dnl to do all of ax_spec_package_name as well.
652 AC_DEFUN([AX_SPEC_PACKAGE_VERSION],[AC_REQUIRE([AX_SPEC_FILE])dnl
654 AC_MSG_WARN([please use ax_spec_package_AND_version now!]),
655 AC_MSG_ERROR([please use ax_spec_package_AND_version now!]))
657 AX_SPEC_PACKAGE_VERSION_
661 AC_DEFUN([AX_SPEC_PACKAGE_AND_VERSION],[
662 m4_ifset([m4_ax_spec_file],,[AX_SPEC_FILE($1)])
664 AX_SPEC_PACKAGE_VERSION_
667 AC_DEFUN([AX_SPEC_DEFAULTS],[
668 m4_ifset([m4_ax_spec_file],,[AX_SPEC_FILE($1)])
670 AX_SPEC_PACKAGE_VERSION_
671 AX_SPEC_PACKAGE_LICENSE
672 AX_SPEC_PACKAGE_SUMMARY
673 AX_SPEC_PACKAGE_CATEGORY
677 dnl ______ /usr/share/aclocal/guidod/ax_set_version_info.m4 ______
678 dnl AX_SET_VERSION_INFO [(VERSION [,PREFIX])] -*- m4 -*-
679 dnl default $1 = $PACKAGE_VERSION
680 dnl default $2 = <none>
682 dnl This macro is the successor of AC_SET_RELEASEINFO_VERSIONINFO but
683 dnl it can be used in parallel because it uses all different variables.
685 dnl check the $VERSION number and cut the two last digit-sequences off
686 dnl which will form a -version-info in a @VERSION_INFO@ ac_subst while
687 dnl the rest is going to the -release name in a @RELEASE_INFO@ ac_subst.
689 dnl you should keep these two seperate - the release-name may contain
690 dnl alpha-characters and can be modified later with extra release-hints
691 dnl e.g. RELEASE_INFO="$RELEASE_INFO-debug" for a debug version
692 dnl of your lib. The $VERSION_INFO however should not be touched.
694 dnl example: a VERSION="2.4.18" will be transformed into
695 dnl RELEASE_INFO = -release 2
696 dnl VERSION_INFO = -versioninfo 4:18
697 dnl then use these two variables and push them to your libtool linker
698 dnl libtest_la_LIBADD = @RELEASE_INFO@ @VERSION_INFO@
699 dnl and for a linux-target this will tell libtool to install the lib as
700 dnl libmy.so libmy.la libmy.a libmy-2.so.4 libmy-2.so.4.0.18
701 dnl and executables will get link-resolve-infos for libmy-2.so.4 - therefore
702 dnl the patch-level is ignored during ldso linking, and ldso will use the
703 dnl one with the highest patchlevel. Using just "-release $(VERSION)"
704 dnl during libtool-linking would not do that - omitting the -version-info
705 dnl will libtool install libmy.so libmy.la libmy.a libmy-2.4.18.so and
706 dnl executables would get hardlinked with the 2.4.18 version of your lib.
708 dnl This background does also explain the default dll name for a win32
709 dnl target : libtool will choose to make up libmy-2-4.dll for this
712 dnl this macro does also set the usual three parts of a version spec
713 dnl $MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION but does not ac_subst
714 dnl for the plain AX_SET_VERSION_INFO macro. Use instead one of the numbered
715 dnl macros AX_SET_VERSION_INFO1 (use first number for release part) or
716 dnl that AX_SET_VERSION_INFO2 (use the first two numbers for release part).
718 dnl You may add sublevel parts like "1.4.2-ac5" where the sublevel is
719 dnl just killed from these version/release substvars. That allows to grab
720 dnl the version off a .spec file like with AX_SPEC_PACKAGE_VERSION where
721 dnl the $VERSION is used to name a tarball or distpack like mylib-2.2.9pre4
723 dnl Unlike earlier macros, you can use this one to break up different
724 dnl VERSIONs and put them into different variables, just hint with
725 dnl PREFIX-setting - i.e. _VERSION(2.4.5,TEST) will set variables named
726 dnl TEST_MAJOR_VERSION=2... and of course $TEST_RELEASE_INFO etc.
727 dnl (for the moment, it needs to be a literal prefix *sigh*)
729 dnl @version %Id: ax_set_version_info.m4,v 1.1 2003/07/02 23:41:42 guidod Exp %
730 dnl @author Guido Draheim <guidod@gmx.de>
732 AC_DEFUN([AX_SET_VERSION_INFO1],[dnl
733 AS_VAR_PUSHDEF([MAJOR],ifelse($2,,[MAJOR_VERSION],[$2_MAJOR_VERSION]))dnl
734 AS_VAR_PUSHDEF([MINOR],ifelse($2,,[MINOR_VERSION],[$2_MINOR_VERSION]))dnl
735 AS_VAR_PUSHDEF([MICRO],ifelse($2,,[MICRO_VERSION],[$2_MICRO_VERSION]))dnl
736 AS_VAR_PUSHDEF([PATCH],ifelse($2,,[PATCH_VERSION],[$2_PATCH_VERSION]))dnl
737 AS_VAR_PUSHDEF([LTREL],ifelse($2,,[RELEASE_INFO],[$2_RELEASE_INFO]))dnl
738 AS_VAR_PUSHDEF([LTVER],ifelse($2,,[VERSION_INFO],[$2_VERSION_INFO]))dnl
739 test ".$PACKAGE_VERSION" = "." && PACKAGE_VERSION="$VERSION"
740 AC_MSG_CHECKING(ifelse($2,,,[$2 ])out linker version info dnl
741 ifelse($1,,$PACKAGE_VERSION,$1) )
742 MINOR=`echo ifelse( $1, , $PACKAGE_VERSION, $1 )`
743 MAJOR=`echo "$MINOR" | sed -e 's/[[.]].*//'`
744 MINOR=`echo "$MINOR" | sed -e "s/^$MAJOR//" -e 's/^.//'`
746 MINOR=`echo "$MICRO" | sed -e 's/[[.]].*//'`
747 MICRO=`echo "$MICRO" | sed -e "s/^$MINOR//" -e 's/^.//'`
749 MICRO=`echo "$PATCH" | sed -e 's/[[^0-9]].*//'`
750 PATCH=`echo "$PATCH" | sed -e "s/^$MICRO//" -e 's/^[[-.]]//'`
751 if test "_$MICRO" = "_" ; then MICRO="0" ; fi
752 if test "_$MINOR" = "_" ; then MINOR="$MAJOR" ; MAJOR="0" ; fi
753 MINOR=`echo "$MINOR" | sed -e 's/[[^0-9]].*//'`
754 LTREL="-release $MAJOR"
755 LTVER="-version-info $MINOR:$MICRO"
756 AC_MSG_RESULT([/$MAJOR/$MINOR:$MICRO (-$MAJOR.so.$MINOR.0.$MICRO)])
763 AS_VAR_POPDEF([LTVER])dnl
764 AS_VAR_POPDEF([LTREL])dnl
765 AS_VAR_POPDEF([PATCH])dnl
766 AS_VAR_POPDEF([MICRO])dnl
767 AS_VAR_POPDEF([MINOR])dnl
768 AS_VAR_POPDEF([MAJOR])dnl
771 AC_DEFUN([AX_SET_VERSION_INFO2],[dnl
772 AS_VAR_PUSHDEF([MAJOR],ifelse($2,,[MAJOR_VERSION],[$2_MAJOR_VERSION]))dnl
773 AS_VAR_PUSHDEF([MINOR],ifelse($2,,[MINOR_VERSION],[$2_MINOR_VERSION]))dnl
774 AS_VAR_PUSHDEF([MICRO],ifelse($2,,[MICRO_VERSION],[$2_MICRO_VERSION]))dnl
775 AS_VAR_PUSHDEF([PATCH],ifelse($2,,[PATCH_VERSION],[$2_PATCH_VERSION]))dnl
776 AS_VAR_PUSHDEF([LTREL],ifelse($2,,[RELEASE_INFO],[$2_RELEASE_INFO]))dnl
777 AS_VAR_PUSHDEF([LTVER],ifelse($2,,[VERSION_INFO],[$2_VERSION_INFO]))dnl
778 test ".$PACKAGE_VERSION" = "." && PACKAGE_VERSION="$VERSION"
779 AC_MSG_CHECKING(ifelse($2,,,[$2 ])out linker version info dnl
780 ifelse($1,,$PACKAGE_VERSION,$1) )
781 MINOR=`echo ifelse( $1, , $PACKAGE_VERSION, $1 )`
782 MAJOR=`echo "$MINOR" | sed -e 's/[[.]].*//'`
783 MINOR=`echo "$MINOR" | sed -e "s/^$MAJOR//" -e 's/^.//'`
785 MINOR=`echo "$MICRO" | sed -e 's/[[.]].*//'`
786 MICRO=`echo "$MICRO" | sed -e "s/^$MINOR//" -e 's/^.//'`
788 MICRO=`echo "$PATCH" | sed -e 's/[[^0-9]].*//'`
789 PATCH=`echo "$PATCH" | sed -e "s/^$MICRO//" -e 's/^[[-.]]//'`
790 test "_$MICRO" != "_" || MICRO="0"
791 if test "_$MINOR" != "_" ; then MINOR="$MAJOR" ; MAJOR="0" ; fi
792 MINOR=`echo "$MINOR" | sed -e 's/[[^0-9]].*//'`
793 LTREL="-release $MAJOR.$MINOR"
794 LTVER="-version-info 0:$MICRO"
795 AC_MSG_RESULT([/$MAJOR/$MINOR:$MICRO (-$MAJOR.so.$MINOR.0.$MICRO)])
802 AS_VAR_POPDEF([LTVER])dnl
803 AS_VAR_POPDEF([LTREL])dnl
804 AS_VAR_POPDEF([PATCH])dnl
805 AS_VAR_POPDEF([MICRO])dnl
806 AS_VAR_POPDEF([MINOR])dnl
807 AS_VAR_POPDEF([MAJOR])dnl
810 AC_DEFUN([AX_SET_VERSION_INFO],[dnl
811 AS_VAR_PUSHDEF([MAJOR],ifelse($2,,[MAJOR_VERSION],[$2_MAJOR_VERSION]))dnl
812 AS_VAR_PUSHDEF([MINOR],ifelse($2,,[MINOR_VERSION],[$2_MINOR_VERSION]))dnl
813 AS_VAR_PUSHDEF([MICRO],ifelse($2,,[MICRO_VERSION],[$2_MICRO_VERSION]))dnl
814 AS_VAR_PUSHDEF([PATCH],ifelse($2,,[PATCH_VERSION],[$2_PATCH_VERSION]))dnl
815 AS_VAR_PUSHDEF([LTREL],ifelse($2,,[RELEASE_INFO],[$2_RELEASE_INFO]))dnl
816 AS_VAR_PUSHDEF([LTVER],ifelse($2,,[VERSION_INFO],[$2_VERSION_INFO]))dnl
817 test ".$PACKAGE_VERSION" = "." && PACKAGE_VERSION="$VERSION"
818 AC_MSG_CHECKING(ifelse($2,,,[$2 ])out linker version info dnl
819 ifelse($1,,$PACKAGE_VERSION,$1) )
820 MINOR=`echo ifelse( $1, , $PACKAGE_VERSION, $1 )`
821 MAJOR=`echo "$MINOR" | sed -e 's/[[.]].*//'`
822 MINOR=`echo "$MINOR" | sed -e "s/^$MAJOR//" -e 's/^.//'`
824 MINOR=`echo "$MICRO" | sed -e 's/[[.]].*//'`
825 MICRO=`echo "$MICRO" | sed -e "s/^$MINOR//" -e 's/^.//'`
827 MICRO=`echo "$PATCH" | sed -e 's/[[^0-9]].*//'`
828 PATCH=`echo "$PATCH" | sed -e "s/^$MICRO//" -e 's/[[-.]]//'`
829 if test "_$MICRO" = "_" ; then MICRO="0" ; fi
830 if test "_$MINOR" = "_" ; then MINOR="$MAJOR" ; MAJOR="0" ; fi
831 MINOR=`echo "$MINOR" | sed -e 's/[[^0-9]].*//'`
832 LTREL="-release $MAJOR"
833 LTVER="-version-info $MINOR:$MICRO"
834 AC_MSG_RESULT([/$MAJOR/$MINOR:$MICRO (-$MAJOR.so.$MINOR.0.$MICRO)])
837 AS_VAR_POPDEF([LTVER])dnl
838 AS_VAR_POPDEF([LTREL])dnl
839 AS_VAR_POPDEF([PATCH])dnl
840 AS_VAR_POPDEF([MICRO])dnl
841 AS_VAR_POPDEF([MINOR])dnl
842 AS_VAR_POPDEF([MAJOR])dnl
845 dnl ______ /usr/share/aclocal/guidod/ax_enable_builddir.m4 ______
846 dnl @synopsis AX_ENABLE_BUILDDIR [(dirstring-or-command [,Makefile.mk [,-all]])]
848 dnl if the current configure was run within the srcdir then
849 dnl we move all configure-files into a subdir and let the configure
850 dnl steps continue there. We provide an option --disable-builddir
851 dnl to suppress the move into a separate builddir.
855 dnl $1 = $host (overridden with $HOST)
859 dnl This macro must be called before AM_INIT_AUTOMAKE.
861 dnl it creates a default toplevel srcdir Makefile from the information found
862 dnl in the created toplevel builddir Makefile. It just copies the variables
863 dnl and rule-targets, each extended with a default rule-execution that
864 dnl recurses into the build directory of the current "HOST". You can override
865 dnl the auto-dection through `config.guess` and build-time of course, as in
867 dnl make HOST=i386-mingw-cross
869 dnl which can of course set at configure time as well using
871 dnl configure --host=i386-mingw-cross
873 dnl After the default has been created, additional rules can be
874 dnl appended that will not just recurse into the subdirectories and
875 dnl only ever exist in the srcdir toplevel makefile - these parts
876 dnl are read from the $2 = Makefile.mk file
878 dnl The automatic rules are usually scanning the toplevel Makefile for
879 dnl lines like '#### $host |$builddir' to recognize the place where to
880 dnl recurse into. Usually, the last one is the only one used. However,
881 dnl almost all targets have an additional "*-all" rule which makes the
882 dnl script to recurse into _all_ variants of the current HOST (!!)
883 dnl setting. The "-all" suffix can be overriden for the macro as well.
885 dnl a special rule is only given for things like "dist" that will
886 dnl copy the tarball from the builddir to the sourcedir (or $(PUB))
887 dnl for reason of convenience.
889 dnl @author Guido Draheim
890 dnl @version %Id: ax_enable_builddir.m4,v 1.12 2003/06/05 00:52:29 guidod Exp %
892 AC_DEFUN([AX_ENABLE_BUILDDIR],[AC_REQUIRE([AC_CANONICAL_HOST])[]dnl
893 AC_BEFORE([$0],[AM_INIT_AUTOMAKE])dnl
894 AS_VAR_PUSHDEF([SUB],[ax_enable_builddir])dnl
895 AS_VAR_PUSHDEF([AUX],[ax_enable_builddir_auxdir])dnl
896 AS_VAR_PUSHDEF([SED],[ax_enable_builddir_sed])dnl
898 if test ".$ac_srcdir_defaulted" != ".no" ; then
899 if test ".$srcdir" = ".." ; then
900 AC_PATH_PROG(SED,gsed sed, sed)
901 AC_ARG_ENABLE([builddir], AC_HELP_STRING(
902 [--disable-builddir],[disable automatic build in subdir of sources])
903 ,[SUB="$withval"], [SUB="."])
904 test ".$SUB" = ".." && SUB=`$SED -V 2>&1 |$SED -e '/GNU/!d' -e 's/.*/yes/'`
905 test ".$SUB" = "." && SUB="."
906 test ".$SUB" = ".no" && SUB="."
907 if test ".$SUB" != ".." ; then # we know where to go and
908 if test ! -f config.status ; then # srcdir not yet configured
909 test ".$HOST" = "." && HOST="$host"
910 test ".$SUB" = ".yes" && SUB="m4_ifval([$1], [$1],[$HOST])"
912 echo __.$SUB.__ > $SUB/conftest.tmp
914 if grep __.$SUB.__ conftest.tmp >/dev/null 2>/dev/null ; then
916 AC_MSG_RESULT([continue configure in default builddir ./$SUB])
918 AC_MSG_ERROR([could not change to default builddir ./$SUB])
920 srcdir=`echo "$SUB" |
921 $SED -e 's,^\./,,;s,[[^/]]$,&/,;s,[[^/]]*/,../,g;s,[[/]]$,,;'`
923 test ".$ac_aux_dir" != "." && ac_aux_dir="$srcdir/$ac_aux_dir"
924 test ".$ac_install_sh" != "." && ac_install_sh="$srcdir/$ac_install_sh"
925 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
926 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
927 ac_configure="$SHELL $ac_aux_dir/configure" # Cygnus configure
929 test -f $srcdir/config.log && mv $srcdir/config.log .
930 test -f $srcdir/confdefs.h && mv $srcdir/confdefs.h .
931 test -f $srcdir/conftest.log && mv $srcdir/conftest.log .
932 test -f $srcdir/$cache_file && mv $srcdir/$cache_file .
936 AS_VAR_POPDEF([SED])dnl
937 AS_VAR_POPDEF([AUX])dnl
938 AS_VAR_POPDEF([SUB])dnl
939 AC_CONFIG_COMMANDS([buildir],[dnl .............. config.status ..............
940 AS_VAR_PUSHDEF([SUB],[ax_enable_builddir])dnl
941 AS_VAR_PUSHDEF([TOP],[top_srcdir])dnl
942 AS_VAR_PUSHDEF([SRC],[ac_top_srcdir])dnl
943 AS_VAR_PUSHDEF([AUX],[ax_enable_builddir_auxdir])dnl
944 AS_VAR_PUSHDEF([SED],[ax_enable_builddir_sed])dnl
945 pushdef([END],[Makefile.mk])dnl
946 pushdef([_ALL],[ifelse([$3],,[-all],[$3])])dnl
947 SUB=`grep "continue configure in default builddir " config.log |
948 $SED -e "s/.*continue configure in default builddir //"`
949 SRC="$ax_enable_builddir_srcdir"
950 if test ".$SUB" = "." ; then
951 if test -f "$TOP/Makefile" ; then
952 AC_MSG_NOTICE([skipping TOP/Makefile - left untouched])
954 AC_MSG_NOTICE([skipping TOP/Makefile - not created])
957 if test -f "$SRC/Makefile" ; then
958 a=`grep "^VERSION " "$SRC/Makefile"` ; b=`grep "^VERSION " Makefile`
959 test "$a" != "$b" && rm "$SRC/Makefile"
961 if test -f "$SRC/Makefile" ; then
962 echo "$SRC/Makefile : $SRC/Makefile.in" > $tmp/conftemp.mk
963 echo " []@ echo 'REMOVED,,,' >\$[]@" >> $tmp/conftemp.mk
964 eval "${MAKE-make} -f $tmp/conftemp.mk 2>/dev/null >/dev/null"
965 if grep '^REMOVED,,,' "$SRC/Makefile" >/dev/null
966 then rm $SRC/Makefile ; fi
967 cp $tmp/conftemp.mk $SRC/makefiles.mk~ ## DEBUGGING
969 if test ! -f "$SRC/Makefile" ; then
970 AC_MSG_NOTICE([create TOP/Makefile guessed from local Makefile])
971 x='`' ; cat >$tmp/conftemp.sed <<_EOF
988 s/^srcdir *=.*/srcdir = ./
989 s/^top_srcdir *=.*/top_srcdir = ./
994 /:\$/s/ \\([[a-z]][[a-z-]]*[[a-z]]\\) / \\1 \\1[]_ALL /g
995 /:\$/s/^\\([[a-z]][[a-z-]]*[[a-z]]\\)\\([[ :]]\\)/\\1 \\1[]_ALL\\2/
997 /^all all[]_ALL[[ :]]/i\\
998 all-configured : all[]_ALL
999 dnl dist-all exists... and would make for dist-all-all
1002 @ HOST="\$(HOST)\" \\\\\\
1003 ; test ".\$\$HOST" = "." && HOST=$x sh $AUX/config.guess $x \\\\\\
1004 ; BUILD=$x grep "^#### \$\$HOST " Makefile | sed -e 's/.*|//' $x \\\\\\
1005 ; use=$x basename "\$\@" _ALL $x; n=$x echo \$\$BUILD | wc -w $x \\\\\\
1006 ; echo "MAKE \$\$HOST : \$\$n * \$\@"; if test "\$\$n" = "0" ; then : \\\\\\
1007 ; BUILD=$x grep "^####.*|" Makefile |tail -1| sed -e 's/.*|//' $x ; fi \\\\\\
1008 ; test ".\$\$BUILD" = "." && BUILD="." \\\\\\
1009 ; test "\$\$use" = "\$\@" && BUILD=$x echo "\$\$BUILD" | tail -1 $x \\\\\\
1010 ; for i in \$\$BUILD ; do test ".\$\$i" = "." && continue \\\\\\
1011 ; (cd "\$\$i" && test ! -f configure && \$(MAKE) \$\$use) ; done
1012 dnl special rule add-on: "dist" copies the tarball to $(PUB). (source tree)
1014 @ HOST="\$(HOST)\" \\\\\\
1015 ; test ".\$\$HOST" = "." && HOST=$x sh $AUX/config.guess $x \\\\\\
1016 ; BUILD=$x grep "^#### \$\$HOST " Makefile | sed -e 's/.*|//' $x \\\\\\
1017 ; found=$x echo \$\$BUILD | wc -w $x \\\\\\
1018 ; echo "MAKE \$\$HOST : \$\$found \$(PACKAGE)-\$(VERSION).tar.*" \\\\\\
1019 ; if test "\$\$found" = "0" ; then : \\\\\\
1020 ; BUILD=$x grep "^#### .*|" Makefile |tail -1| sed -e 's/.*|//' $x \\\\\\
1021 ; fi ; for i in \$\$BUILD ; do test ".\$\$i" = "." && continue \\\\\\
1022 ; test -f "\$\$i/\$(PACKAGE)-\$(VERSION).tar.gz" \\\\\\
1023 && mv "\$\$i/\$(PACKAGE)-\$(VERSION).tar.gz" \$(PUB). ; break ; done
1024 dnl special rule add-on: "distclean" removes all local builddirs completely
1025 /distclean[]_ALL *:/a\\
1026 @ HOST="\$(HOST)\" \\\\\\
1027 ; test ".\$\$HOST" = "." && HOST=$x sh $AUX/config.guess $x \\\\\\
1028 ; BUILD=$x grep "^#### .*| *\\./" Makefile | sed -e 's/.*|//' $x \\\\\\
1029 ; use=$x basename "\$\@" _ALL $x; n=$x echo \$\$BUILD | wc -w $x \\\\\\
1030 ; echo "MAKE \$\$HOST : \$\$n * \$\@ (all local builds)" \\\\\\
1031 ; test ".\$\$BUILD" = "." && BUILD="." \\\\\\
1032 ; for i in \$\$BUILD ; do test ".\$\$i" = "." && continue \\\\\\
1033 ; echo "# rm -r \$\$i"; done ; echo "# (sleep 3)" ; sleep 3 \\\\\\
1034 ; for i in \$\$BUILD ; do test ".\$\$i" = "." && continue \\\\\\
1035 ; echo "rm -r \$\$i"; (rm -r "\$\$i") ; done ; rm Makefile
1037 cp "$tmp/conftemp.sed" "$SRC/makefile.sed~" ## DEBUGGING
1038 $SED -f $tmp/conftemp.sed Makefile >$SRC/Makefile
1039 if test -f "$SRC/m4_ifval([$2],[$2],[END])" ; then
1040 AC_MSG_NOTICE([extend TOP/Makefile with TOP/m4_ifval([$2],[$2],[END])])
1041 cat $SRC/END >>$SRC/Makefile
1043 echo "$xxxx CONFIGURATIONS FOR TOPLEVEL MAKEFILE: " >>$SRC/Makefile
1045 if grep '^; echo "MAKE ' $SRC/Makefile >/dev/null ; then
1046 AC_MSG_NOTICE([buggy sed found - it deletes tab in "a" text parts])
1047 $SED -e '/^@ HOST=/s/^/ /' -e '/^; /s/^/ /' $SRC/Makefile \
1049 (test -s $SRC/Makefile~ && mv $SRC/Makefile~ $SRC/Makefile) 2>/dev/null
1053 # echo "/^$xxxx *$ax_enable_builddir_host /d" >$tmp/conftemp.sed
1054 echo "s!^$xxxx [[^|]]* | *$SUB *\$!$xxxx ...... $SUB!" >$tmp/conftemp.sed
1055 $SED -f "$tmp/conftemp.sed" "$SRC/Makefile" >$tmp/mkfile.tmp
1056 cp "$tmp/conftemp.sed" "$SRC/makefiles.sed~" ## DEBUGGING
1057 cp "$tmp/mkfile.tmp" "$SRC/makefiles.out~" ## DEBUGGING
1058 if cmp -s "$SRC/Makefile" "$tmp/mkfile.tmp" 2>/dev/null ; then
1059 AC_MSG_NOTICE([keeping TOP/Makefile from earlier configure])
1060 rm "$tmp/mkfile.tmp"
1062 AC_MSG_NOTICE([reusing TOP/Makefile from earlier configure])
1063 mv "$tmp/mkfile.tmp" "$SRC/Makefile"
1066 AC_MSG_NOTICE([build in $SUB (HOST=$ax_enable_builddir_host)])
1068 echo "$xxxx" "$ax_enable_builddir_host" "|$SUB" >>$SRC/Makefile
1071 AS_VAR_POPDEF([SED])dnl
1072 AS_VAR_POPDEF([AUX])dnl
1073 AS_VAR_POPDEF([SRC])dnl
1074 AS_VAR_POPDEF([TOP])dnl
1075 AS_VAR_POPDEF([SUB])dnl
1077 ax_enable_builddir_srcdir="$srcdir" # $srcdir
1078 ax_enable_builddir_host="$HOST" # $HOST / $host
1079 ax_enable_builddir_version="$VERSION" # $VERSION
1080 ax_enable_builddir_package="$PACKAGE" # $PACKAGE
1081 ax_enable_builddir_auxdir="$ax_enable_builddir_auxdir" # $AUX
1082 ax_enable_builddir_sed="$ax_enable_builddir_sed" # $SED
1083 ax_enable_builddir="$ax_enable_builddir" # $SUB
1087 dnl ______ /usr/share/aclocal/guidod/ax_warning_default_pkgconfig.m4 ______
1088 dnl @* AX_WARNING_DEFAULT_PKGCONFIGDIR [(dirvariable [,defsetting])]
1090 dnl print a warning message if the $(datadir)/aclocal directory
1091 dnl is not in the dirlist searched by the aclocal tool. This macro
1092 dnl is useful if some `make install` would target $(datadir)/aclocal
1093 dnl to install an autoconf m4 file of your project to be picked up
1094 dnl by other projects.
1096 dnl default $1 dirvariable = pkgconfigdir
1097 dnl default $2 defsetting = ${libdir}/pkgconfig
1098 dnl (the defsetting is not placed in dirvariable nor is it ac_subst'ed)
1100 dnl @: guidod@gmx.de
1103 AC_DEFUN([AX_WARNING_DEFAULT_PKGCONFIGDIR],[dnl
1104 AC_REQUIRE([AX_EXPAND_PREFIX])dnl
1105 AS_VAR_PUSHDEF([DIR],[ax_warning_default_pkgconfig_dir])dnl
1106 AS_VAR_PUSHDEF([BIN],[ax_warning_default_pkgconfig_bin])dnl
1107 AS_VAR_PUSHDEF([LOC],[ax_warning_default_pkgconfig_loc])dnl
1108 if test ".$PKG_CONFIG" = "." ; then # we use the same default as in pkg.m4
1109 AC_PATH_PROG([PKG_CONFIG],[pkg-config],[no])
1111 LOC='m4_if([$2],,[${libdir}/pkgconfig],[$2])'
1112 m4_ifval([$1],[test ".$[]$1" != "." && LOC="$[]$1"])
1113 if test "$PKG_CONFIG" = "no"
1114 then DIR="/" ; test -d "/usr/lib/pkgconfig" && DIR="/usr/lib/pkgconfig"
1115 else BIN=`AS_DIRNAME(["$DIR"])` ;
1116 if test -d "$BIN/lib/pkgconfig" ; then
1117 DIR="$BIN/lib/pkgconfig"
1118 else BIN=`AS_DIRNAME(["$DIR"])`
1119 if test -d "$BIN/lib/pkgconfig" ; then
1120 DIR="$BIN/lib/pkgconfig"
1122 if test -d "/usr/lib/pkgconfig" ; then
1123 DIR="/usr/lib/pkgconfig"
1128 AC_RUN_LOG([: last pkgconfig dir is assumed as "$DIR"])
1129 DIR=`eval "echo $DIR"`
1130 DIR=`eval "echo $DIR"`
1131 LOC=`eval "echo $LOC"`
1132 LOC=`eval "echo $LOC"`
1133 LOC=`eval "echo $LOC"`
1134 for DIR in `echo "$PKG_CONFIG_PATH:$DIR" | sed -e 's,:, ,g'` ; do
1135 AC_RUN_LOG([: test ".$LOC" = ".$DIR"])
1136 test ".$LOC" = ".$DIR" && break
1138 if test "$LOC" != "$DIR" ; then
1139 AC_MSG_NOTICE([warning: m4_if([$1],,[pkgconfigdir],[$1])=$LOC dnl
1141 AC_MSG_NOTICE([perhaps: make install m4_if([$1],,[pkgconfigdir],[$1])=$DIR])
1142 cat m4_ifset([AS_MESSAGE_LOG_FD],[>&AS_MESSAGE_LOG_FD],[>>config.log]) <<EOF
1143 pkgconfigdir: the m4_if([$1],,[default pkgconfigdir],[$1 value]) of $LOC
1144 pkgconfigdir: is not listed in the dirlist where pkg-config will look for
1145 pkgconfigdir: package-configs - you can override the install-path using
1146 pkgconfigdir: make install m4_if([$1],,[pkgconfigdir],[$1])=$DIR
1147 pkgconfigdir: or set/append the directory to the environment variable
1148 pkgconfigdir: PKG_CONFIG_PATH="$LOC"
1151 AS_VAR_POPDEF([LOC])dnl
1152 AS_VAR_POPDEF([BIN])dnl
1153 AS_VAR_POPDEF([DIR])dnl
1156 dnl ______ /usr/share/aclocal/Miscellaneous/ac_compile_check_sizeof.m4 ______
1157 dnl @synopsis AC_COMPILE_CHECK_SIZEOF(TYPE [, HEADERS [, EXTRA_SIZES...]])
1159 dnl This macro checks for the size of TYPE using compile checks, not
1160 dnl run checks. You can supply extra HEADERS to look into. the check
1161 dnl will cycle through 1 2 4 8 16 and any EXTRA_SIZES the user
1162 dnl supplies. If a match is found, it will #define SIZEOF_`TYPE' to
1163 dnl that value. Otherwise it will emit a configure time error
1164 dnl indicating the size of the type could not be determined.
1166 dnl The trick is that C will not allow duplicate case labels. While
1167 dnl this is valid C code:
1169 dnl switch (0) case 0: case 1:;
1171 dnl The following is not:
1173 dnl switch (0) case 0: case 0:;
1175 dnl Thus, the AC_TRY_COMPILE will fail if the currently tried size
1178 dnl Here is an example skeleton configure.in script, demonstrating the
1182 dnl AC_CHECK_HEADERS(stddef.h unistd.h)
1184 dnl AC_CHECK_TYPE(ssize_t, int)
1186 dnl headers='#ifdef HAVE_STDDEF_H
1187 dnl #include <stddef.h>
1189 dnl #ifdef HAVE_UNISTD_H
1190 dnl #include <unistd.h>
1194 dnl AC_COMPILE_CHECK_SIZEOF(char)
1195 dnl AC_COMPILE_CHECK_SIZEOF(short)
1196 dnl AC_COMPILE_CHECK_SIZEOF(int)
1197 dnl AC_COMPILE_CHECK_SIZEOF(long)
1198 dnl AC_COMPILE_CHECK_SIZEOF(unsigned char *)
1199 dnl AC_COMPILE_CHECK_SIZEOF(void *)
1200 dnl AC_COMPILE_CHECK_SIZEOF(size_t, $headers)
1201 dnl AC_COMPILE_CHECK_SIZEOF(ssize_t, $headers)
1202 dnl AC_COMPILE_CHECK_SIZEOF(ptrdiff_t, $headers)
1203 dnl AC_COMPILE_CHECK_SIZEOF(off_t, $headers)
1205 dnl @author Kaveh Ghazi <ghazi@caip.rutgers.edu>
1206 dnl @version %Id: ac_compile_check_sizeof.m4,v 1.1.1.1 2001/07/26 00:46:24 guidod Exp %
1208 AC_DEFUN([AC_COMPILE_CHECK_SIZEOF],
1209 [changequote(<<, >>)dnl
1210 dnl The name to #define.
1211 define(<<AC_TYPE_NAME>>, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl
1212 dnl The cache variable name.
1213 define(<<AC_CV_NAME>>, translit(ac_cv_sizeof_$1, [ *], [_p]))dnl
1214 changequote([, ])dnl
1215 AC_MSG_CHECKING(size of $1)
1216 AC_CACHE_VAL(AC_CV_NAME,
1217 [for ac_size in 4 8 1 2 16 $2 ; do # List sizes in rough order of prevalence.
1218 AC_TRY_COMPILE([#include "confdefs.h"
1219 #include <sys/types.h>
1221 ], [switch (0) case 0: case (sizeof ($1) == $ac_size):;], AC_CV_NAME=$ac_size)
1222 if test x$AC_CV_NAME != x ; then break; fi
1225 if test x$AC_CV_NAME = x ; then
1226 AC_MSG_ERROR([cannot determine a size for $1])
1228 AC_MSG_RESULT($AC_CV_NAME)
1229 AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME, [The number of bytes in type $1])
1230 undefine([AC_TYPE_NAME])dnl
1231 undefine([AC_CV_NAME])dnl
1234 dnl ______ /usr/share/aclocal/guidod/patch_libtool_to_add_host_cc.m4 ______
1235 dnl @* PATCH_LIBTOOL_TO_ADD_HOST_CC
1237 dnl The libtool 1.4.x processing (and patched 1.3.5) uses a little
1238 dnl "impgen" tool to turn a "*.dll" into an import "*.lib" as it is
1239 dnl needed for win32 targets. However, this little tool is not shipped
1240 dnl by binutils, it is not even a command option of dlltool or dllwrap.
1241 dnl It happens to be a C source snippet implanted into the libtool
1242 dnl sources - it gets written to ".libs", compiled into a binary
1243 dnl on-the-fly, and executed right away on the "dll" file to create
1244 dnl the import-lib (dll.a files in gcc-speak).
1246 dnl This mode works fine for a native build within mingw or cygwin,
1247 dnl but it does not work in cross-compile mode since CC is a
1248 dnl crosscompiler - it will create an .exe file on a non-win32
1249 dnl system, and as a result an impgen.exe is created on-the-fly
1250 dnl that can not be executed on-the-fly. Luckily, the actual
1251 dnl libtool snippet uses HOST_CC to compile the sources which
1252 dnl has a fallback to CC when the HOST_CC variable was not set.
1254 dnl this ac-macro is trying to detect a valid HOST_CC which is not
1255 dnl a cross-compiler. This is done by looking into the $PATH for
1256 dnl a "cc" and the result is patched into libtool a HOST_CC, iow
1257 dnl it adds another configured variable at the top of the libtool
1260 dnl In discussions on the libtool mailinglist it occurred that
1261 dnl later gcc/binutils generations are able to link with dlls
1262 dnl directly, i.e. there is no import-lib needed anymore. The
1263 dnl import-table is created within the linker itself (in-memory)
1264 dnl and bound to the .exe/.dll currently in the making. The
1265 dnl whole stuff of impgen exe and compiling it on-the-fly, well,
1266 dnl it is superflouos then.
1268 dnl Since mingw crosscompilers tend to be quite a fresh development
1269 dnl it was agreed to remove the impgen stuff completly from
1270 dnl libtool sources. Still however, this macro does not hurt
1271 dnl since it does not patch impgen cmds but it just adds HOST_CC
1272 dnl which might be useful in other cross-compiling cases as well.
1273 dnl Therefore, you can leave it in for maximum compatibility and
1276 dnl @= guidod@gmx.de
1277 dnl @%Id: patch_libtool_to_add_host_cc.m4,v 1.3 2003/03/23 13:20:27 guidod Exp %
1279 AC_DEFUN([PATCH_LIBTOOL_TO_ADD_HOST_CC],
1280 [# patch libtool to add HOST_CC sometimes needed in crosscompiling a win32 dll
1281 if grep "HOST_CC" libtool >/dev/null; then
1282 if test "$build" != "$host" ; then
1283 if test "_$HOST_CC" = "_" ; then
1285 for i in `echo $PATH | sed 's,:, ,g'` ; do
1286 test -x $i/cc && HOST_CC=$i/cc
1289 AC_MSG_RESULT(patching libtool to add HOST_CC=$HOST_CC)
1290 test -f libtool.old || (mv libtool libtool.old && cp libtool.old libtool)
1291 sed -e "/BEGIN.*LIBTOOL.*CONFIG/a\\
1292 HOST_CC=$HOST_CC" libtool >libtool.new
1293 (test -s libtool.new || rm libtool.new) 2>/dev/null
1294 test -f libtool.new && mv libtool.new libtool # not 2>/dev/null !!
1295 test -f libtool || mv libtool.old libtool
1299 dnl ______ /usr/share/aclocal/guidod/patch_libtool_on_darwin_zsh_overquoting.m4 ______
1300 dnl @* PATCH_LIBTOOL_ON_DARWIN_ZSH_OVERQUOTING
1302 dnl libtool 1.4.x has a bug on darwin where the "zsh" is installed
1303 dnl as the bourne shell replacement. Of course, the zsh is called in
1304 dnl a compatibility mode but there is a common problem with it,
1305 dnl probably a bug of zsh. Newer darwin systems have a "bash"
1306 dnl installed now, but the configure-default will be "zsh" in most
1309 dnl The bug revelas itself as an overquoted statement in the
1310 dnl libtool cmds-spec for sharedlib creation on testing for
1311 dnl "module" builds. Later libtool has gone rid of it by simply
1312 dnl removing the quotes at that point . Here we maintain the
1313 dnl original style and simply remove the extra escape character,
1314 dnl i.e. we look for "archive_cmds" and replace a sequence of
1315 dnl triple-backslash-and-doublequote with single-backslash-and-doublequote.
1317 dnl @= guidod@gmx.de
1318 dnl %Id: patch_libtool_on_darwin_zsh_overquoting.m4,v 1.4 2003/03/24 16:58:21 guidod Exp %
1320 AC_DEFUN([PATCH_LIBTOOL_ON_DARWIN_ZSH_OVERQUOTING],
1321 [# libtool-1.4 specific, on zsh target the final requoting does one too much
1324 if grep "1.92" libtool >/dev/null ; then
1325 AC_MSG_RESULT(patching libtool on .so-sharedlib creation (zsh overquoting))
1326 test -f libtool.old || (mv libtool libtool.old && cp libtool.old libtool)
1327 sed -e '/archive_cmds=/s:[[\\]][[\\]][[\\]]*":\\":g' libtool >libtool.new
1328 (test -s libtool.new || rm libtool.new) 2>/dev/null
1329 test -f libtool.new && mv libtool.new libtool # not 2>/dev/null !!
1330 test -f libtool || mv libtool.old libtool
1335 dnl ______ /usr/share/aclocal/guidod/ac_sys_largefile_sensitive.m4 ______
1336 dnl @synopsis AC_SYS_LARGEFILE_SENSITIVE
1338 dnl checker whether the current system is sensitive to -Ddefines
1339 dnl making off_t having different types/sizes. Automatically define
1340 dnl a config.h symbol LARGEFILE_SENSITIVE if that is the case,
1341 dnl otherwise leave everything as is.
1343 dnl This macro builds on top of AC_SYS_LARGEFILE to detect whether
1344 dnl special options are neede to make the code use 64bit off_t - in
1345 dnl many setups this will also make the code use 64bit off_t immediatly.
1347 dnl The common use of a LARGEFILE_SENSITIVE config.h-define is to rename
1348 dnl exported functions, usually adding a 64 to the original function name.
1349 dnl Such renamings are only needed on systems being both (a) 32bit off_t
1350 dnl by default and (b) implementing large.file extensions (as for unix98).
1352 dnl a renaming section could look like this:
1353 dnl #if defined LARGEFILE_SENSITIVE && _FILE_OFFSET_BITS+0 == 64
1354 dnl #define zzip_open zzip_open64
1355 dnl #define zzip_seek zzip_seek64
1358 dnl for libraries, it is best to take advantage of the prefix-config.h
1359 dnl macro, otherwise you want to export a renamed LARGEFILE_SENSITIVE
1360 dnl in an installed header file. -> see AX_PREFIX_CONFIG_H
1362 dnl @, System Headers
1363 dnl @Author Guido Draheim <guidod@gmx.de>
1364 dnl @Version %Id: ac_sys_largefile_sensitive.m4,v 1.2 2003/05/13 18:46:22 guidod Exp %
1366 AC_DEFUN([AC_SYS_LARGEFILE_SENSITIVE],[dnl
1367 AC_REQUIRE([AC_SYS_LARGEFILE])dnl
1368 # we know about some internals of ac_sys_largefile here...
1369 AC_MSG_CHECKING(whether system differentiates 64bit off_t by defines)
1370 ac_cv_sys_largefile_sensitive="no"
1371 if test ".$ac_cv_sys_file_offset_bits$ac_cv_sys_large_files" != ".nono"
1372 then ac_cv_sys_largefile_sensitive="yes"
1373 AC_DEFINE(LARGEFILE_SENSITIVE, 1,
1374 [whether the system defaults to 32bit off_t but can do 64bit when requested])
1376 AC_MSG_RESULT([$ac_cv_sys_largefile_sensitive])
1379 dnl ______ /usr/share/aclocal/guidod/ax_maintainer_mode_auto_silent.m4 ______
1380 dnl @* AX_MAINTAINER_MODE_AUTO_SILENT
1382 dnl Set autotools to error/sleep settings so that they are not run when
1383 dnl being errornously triggered. Likewise make libtool-silent when
1384 dnl libtool has been used.
1386 dnl @: guidod@gmx.de
1389 AC_DEFUN([AX_MAINTAINER_MODE_AUTO_SILENT],[dnl
1390 dnl ac_REQUIRE([am_MAINTAINER_MODE])dn
1391 AC_MSG_CHECKING(auto silent in maintainer mode)
1392 if test "$USE_MAINTAINER_MODE" = "no" ; then
1393 test ".$TIMEOUT" = "." && TIMEOUT="9"
1394 AUTOHEADER="sleep $TIMEOUT ; true || autoheader || skipped"
1395 AUTOMAKE="sleep $TIMEOUT ; true || automake || skipped"
1396 AUTOCONF="sleep $TIMEOUT ; true || autoconf || skipped"
1397 if test ".$LIBTOOL" != "." ; then
1398 LIBTOOL="$LIBTOOL --silent"
1399 AC_MSG_RESULT([libtool-silent, auto-sleep-9])
1401 AC_MSG_RESULT([auto-sleep-9])
1408 dnl ______ /usr/share/aclocal/guidod/ax_expand_prefix.m4 ______
1409 dnl @* AX_EXPAND_PREFIX
1411 dnl when $prefix and $exec_prefix are still set to NONE then set them
1412 dnl to the usual default values - being based on $ac_default_prefix.
1413 dnl - this macro can be AC_REQUIREd by other macros that need to
1414 dnl compute values for installation directories. It has been observed
1415 dnl that it was done wrong over and over again, so this is a bit
1416 dnl more safe to do.
1418 dnl remember - setting exec_prefix='${prefix}' needs you interpolate
1419 dnl directories multiple times, it is not sufficient to just say
1420 dnl MYVAR="${datadir}/putter" but you do have to run `eval` a few
1421 dnl times, sth. like MYVAR=`eval "echo \"$MYVAR\""` done atleast
1424 dnl The implementation of this macro simply picks up the lines that
1425 dnl would be run at the start of AC_OUTPUT anyway to set the
1426 dnl prefix/exec_prefix defaults. Between AC_INIT and the first
1427 dnl command to AC_REQUIRE this macro you can set the two variables
1428 dnl to something explicit instead. Probably, any command to compute
1429 dnl installation directories should be run _after_ AM_INIT_AUTOMAKE
1431 dnl @: guidod@gmx.de
1434 AC_DEFUN([AX_EXPAND_PREFIX],[dnl
1435 # The prefix default can be set in configure.ac (otherwise it is /usr/local)
1436 test "x$prefix" = xNONE && prefix=$ac_default_prefix
1437 # Let make expand exec_prefix. Allows to override the makevar 'prefix' later
1438 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
1441 dnl ______ /usr/share/aclocal/guidod/ax_create_pkgconfig_info.m4 ______
1442 dnl @* AX_CREATE_PKGCONFIG_INFO [(outputfile, [requires [,libs [,summary]]])]
1444 dnl $1 = $PACKAGE_NAME.pc
1446 dnl $3 = $PACKAGE_LIBS $LIBS (as set at that point in configure.ac)
1447 dnl $4 = $PACKAGE_SUMMARY (or $1 Library)
1448 dnl $5 = $CPPFLAGS $PACKAGE_CFLAGS (as set at the point in configure.ac)
1450 dnl PACKAGE_NAME defaults to $PACKAGE if not set.
1451 dnl PACKAGE_LIBS defaults to -l$PACKAGE_NAME if not set.
1453 dnl the resulting file is called $PACKAGE.pc.in / $PACKAGE.pc
1457 AC_DEFUN([AX_CREATE_PKGCONFIG_INFO],[dnl
1458 AS_VAR_PUSHDEF([PKGCONFIG_libdir],[ax_create_pkgconfig_libdir])dnl
1459 AS_VAR_PUSHDEF([PKGCONFIG_libfile],[ax_create_pkgconfig_libfile])dnl
1460 AS_VAR_PUSHDEF([PKGCONFIG_libname],[ax_create_pkgconfig_libname])dnl
1461 AS_VAR_PUSHDEF([PKGCONFIG_version],[ax_create_pkgconfig_version])dnl
1462 AS_VAR_PUSHDEF([PKGCONFIG_description],[ax_create_pkgconfig_description])dnl
1463 AS_VAR_PUSHDEF([PKGCONFIG_requires],[ax_create_pkgconfig_requires])dnl
1464 AS_VAR_PUSHDEF([PKGCONFIG_pkglibs],[ax_create_pkgconfig_pkglibs])dnl
1465 AS_VAR_PUSHDEF([PKGCONFIG_libs],[ax_create_pkgconfig_libs])dnl
1466 AS_VAR_PUSHDEF([PKGCONFIG_cppflags],[ax_create_pkgconfig_cppflags])dnl
1467 AS_VAR_PUSHDEF([PKGCONFIG_generate],[ax_create_pkgconfig_generate])dnl
1468 AS_VAR_PUSHDEF([PKGCONFIG_src_libdir],[ax_create_pkgconfig_src_libdir])dnl
1469 AS_VAR_PUSHDEF([PKGCONFIG_src_headers],[ax_create_pkgconfig_src_headers])dnl
1471 # we need the expanded forms...
1472 test "x$prefix" = xNONE && prefix=$ac_default_prefix
1473 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
1475 AC_MSG_CHECKING(our pkgconfig libname)
1476 test ".$PKGCONFIG_libname" != "." || \
1477 PKGCONFIG_libname="ifelse($1,,${PACKAGE_NAME},`basename $1 .pc`)"
1478 test ".$PKGCONFIG_libname" != "." || \
1479 PKGCONFIG_libname="$PACKAGE"
1480 PKGCONFIG_libname=`eval echo "$PKGCONFIG_libname"`
1481 PKGCONFIG_libname=`eval echo "$PKGCONFIG_libname"`
1482 AC_MSG_RESULT($PKGCONFIG_libname)
1484 AC_MSG_CHECKING(our pkgconfig version)
1485 test ".$PKGCONFIG_version" != "." || \
1486 PKGCONFIG_version="${PACKAGE_VERSION}"
1487 test ".$PKGCONFIG_version" != "." || \
1488 PKGCONFIG_version="$VERSION"
1489 PKGCONFIG_version=`eval echo "$PKGCONFIG_version"`
1490 PKGCONFIG_version=`eval echo "$PKGCONFIG_version"`
1491 AC_MSG_RESULT($PKGCONFIG_version)
1493 AC_MSG_CHECKING(our pkgconfig_libdir)
1494 test ".$pkgconfig_libdir" = "." && \
1495 pkgconfig_libdir='${libdir}/pkgconfig'
1496 PKGCONFIG_libdir=`eval echo "$pkgconfig_libdir"`
1497 PKGCONFIG_libdir=`eval echo "$PKGCONFIG_libdir"`
1498 PKGCONFIG_libdir=`eval echo "$PKGCONFIG_libdir"`
1499 AC_MSG_RESULT($pkgconfig_libdir)
1500 test "$pkgconfig_libdir" != "$PKGCONFIG_libdir" && (
1501 AC_MSG_RESULT(expanded our pkgconfig_libdir... $PKGCONFIG_libdir))
1502 AC_SUBST([pkgconfig_libdir])
1504 AC_MSG_CHECKING(our pkgconfig_libfile)
1505 test ".$pkgconfig_libfile" != "." || \
1506 pkgconfig_libfile="ifelse($1,,$PKGCONFIG_libname.pc,`basename $1`)"
1507 PKGCONFIG_libfile=`eval echo "$pkgconfig_libfile"`
1508 PKGCONFIG_libfile=`eval echo "$PKGCONFIG_libfile"`
1509 AC_MSG_RESULT($pkgconfig_libfile)
1510 test "$pkgconfig_libfile" != "$PKGCONFIG_libfile" && (
1511 AC_MSG_RESULT(expanded our pkgconfig_libfile... $PKGCONFIG_libfile))
1512 AC_SUBST([pkgconfig_libfile])
1514 AC_MSG_CHECKING(our pkgconfig description)
1515 PKGCONFIG_description="ifelse($4,,$PACKAGE_SUMMARY,$4)"
1516 test ".$PKGCONFIG_description" != "." || \
1517 PKGCONFIG_description="$PKGCONFIG_libname Library"
1518 PKGCONFIG_description=`eval echo "$PKGCONFIG_description"`
1519 PKGCONFIG_description=`eval echo "$PKGCONFIG_description"`
1520 AC_MSG_RESULT($PKGCONFIG_description)
1522 AC_MSG_CHECKING(our pkgconfig requires)
1523 PKGCONFIG_requires="ifelse($2,,$PACKAGE_REQUIRES,$2)"
1524 PKGCONFIG_requires=`eval echo "$PKGCONFIG_requires"`
1525 PKGCONFIG_requires=`eval echo "$PKGCONFIG_requires"`
1526 AC_MSG_RESULT($PKGCONFIG_requires)
1528 AC_MSG_CHECKING(our pkgconfig ext libs)
1529 PKGCONFIG_pkglibs="$PACKAGE_LIBS"
1530 test ".$PKGCONFIG_pkglibs" != "." || PKGCONFIG_pkglibs="-l$PKGCONFIG_libname"
1531 PKGCONFIG_libs="ifelse($3,,$PKGCONFIG_pkglibs $LIBS,$3)"
1532 PKGCONFIG_libs=`eval echo "$PKGCONFIG_libs"`
1533 PKGCONFIG_libs=`eval echo "$PKGCONFIG_libs"`
1534 AC_MSG_RESULT($PKGCONFIG_libs)
1536 AC_MSG_CHECKING(our pkgconfig cppflags)
1537 PKGCONFIG_cppflags="ifelse($5,,$CPPFLAGS $PACKAGE_CFLAGS,$5)"
1538 PKGCONFIG_cppflags=`eval echo "$PKGCONFIG_cppflags"`
1539 PKGCONFIG_cppflags=`eval echo "$PKGCONFIG_cppflags"`
1540 AC_MSG_RESULT($PKGCONFIG_cppflags)
1542 test ".$PKGCONFIG_generate" != "." || \
1543 PKGCONFIG_generate="ifelse($1,,$PKGCONFIG_libname.pc,$1)"
1544 PKGCONFIG_generate=`eval echo "$PKGCONFIG_generate"`
1545 PKGCONFIG_generate=`eval echo "$PKGCONFIG_generate"`
1546 test "$pkgconfig_libfile" != "$PKGCONFIG_generate" && (
1547 AC_MSG_RESULT(generate the pkgconfig later... $PKGCONFIG_generate))
1549 if test ".$PKGCONFIG_src_libdir" = "." ; then
1550 PKGCONFIG_src_libdir=`pwd`
1551 PKGCONFIG_src_libdir=`AX_DIRNAME("$PKGCONFIG_src_libdir/$PKGCONFIG_generate")`
1552 test ! -d $PKGCONFIG_src_libdir/src || \
1553 PKGCONFIG_src_libdir="$PKGCONFIG_src_libdir/src"
1555 *libs) PKGCONFIG_src_libdir="$PKGCONFIG_src_libdir/$objdir" ;; esac
1556 AC_MSG_RESULT(noninstalled pkgconfig -L $PKGCONFIG_src_libdir)
1559 if test ".$PKGCONFIG_src_headers" = "." ; then
1560 PKGCONFIG_src_headers=`pwd`
1561 v="$ac_top_srcdir" ;
1562 test ".$v" != "." || v="$ax_spec_dir"
1563 test ".$v" != "." || v="$srcdir"
1564 case "$v" in /*) PKG_CONFIG_src_headers="" ;; esac
1565 PKGCONFIG_src_headers=`AX_DIRNAME("$PKGCONFIG_src_headers/$v/x")`
1566 test ! -d $PKGCONFIG_src_headers/incl[]ude || \
1567 PKGCONFIG_src_headers="$PKGCONFIG_src_headers/incl[]ude"
1568 AC_MSG_RESULT(noninstalled pkgconfig -I $PKGCONFIG_src_headers)
1571 dnl AC_CONFIG_COMMANDS crap disallows to use $PKGCONFIG_libfile here...
1572 AC_CONFIG_COMMANDS([$ax_create_pkgconfig_generate],[
1573 pkgconfig_generate="$ax_create_pkgconfig_generate"
1574 if test ! -f "$pkgconfig_generate.in"
1575 then generate="true"
1576 elif grep ' generated by configure ' $pkgconfig_generate.in >/dev/null
1577 then generate="true"
1578 else generate="false";
1581 AC_MSG_NOTICE(creating $pkgconfig_generate.in)
1582 cat > $pkgconfig_generate.in <<_EOF
1583 # generated by configure / remove this line to disable regeneration
1585 exec_prefix=@exec_prefix@
1587 includedir=@includedir@
1589 Name: @PACKAGE_NAME@
1590 Description: @PACKAGE_DESCRIPTION@
1591 Version: @PACKAGE_VERSION@
1592 Requires: @PACKAGE_REQUIRES@
1593 Libs: -L\${libdir} @LIBS@
1594 Cflags: -I\${includedir} @CPPFLAGS@
1596 fi # DONE generate $pkgconfig_generate.in
1597 AC_MSG_NOTICE(creating $pkgconfig_generate)
1598 sed -e "s|@prefix@|${pkgconfig_prefix}|" \
1599 -e "s|@exec_prefix@|${pkgconfig_execprefix}|" \
1600 -e "s|@libdir@|${pkgconfig_libdir}|" \
1601 -e "s|@includedir@|${pkgconfig_includedir}|" \
1602 -e "s|@PACKAGE_NAME@|${pkgconfig_libname}|" \
1603 -e "s|@PACKAGE_DESCRIPTION@|${pkgconfig_description}|" \
1604 -e "s|@PACKAGE_VERSION@|${pkgconfig_version}|" \
1605 -e "s|@PACKAGE_REQUIRES@|${pkgconfig_requires}|" \
1606 -e "s|@LIBS@|${pkgconfig_libs}|" \
1607 -e "s|@CPPFLAGS@|${pkgconfig_cppflags}|" \
1608 $pkgconfig_generate.in > $pkgconfig_generate
1609 if test ! -s $pkgconfig_generate ; then
1610 AC_MSG_ERROR([$pkgconfig_generate is empty])
1611 fi # DONE generate $pkgconfig_generate
1612 pkgconfig_uninstalled=`echo $pkgconfig_generate |sed 's/.pc$/-uninstalled.pc/'`
1613 AC_MSG_NOTICE(creating $pkgconfig_uninstalled)
1614 sed -e "s|@prefix@|${pkgconfig_prefix}|" \
1615 -e "s|@exec_prefix@|${pkgconfig_execprefix}|" \
1616 -e "s|@libdir@|${pkgconfig_src_libdir}|" \
1617 -e "s|@includedir@|${pkgconfig_src_headers}|" \
1618 -e "s|@PACKAGE_NAME@|${pkgconfig_libname}|" \
1619 -e "s|@PACKAGE_DESCRIPTION@|${pkgconfig_description}|" \
1620 -e "s|@PACKAGE_VERSION@|${pkgconfig_version}|" \
1621 -e "s|@PACKAGE_REQUIRES@|${pkgconfig_requires}|" \
1622 -e "s|@LIBS@|${pkgconfig_libs}|" \
1623 -e "s|@CPPFLAGS@|${pkgconfig_cppflags}|" \
1624 $pkgconfig_generate.in > $pkgconfig_uninstalled
1625 if test ! -s $pkgconfig_uninstalled ; then
1626 AC_MSG_ERROR([$pkgconfig_uninstalled is empty])
1627 fi # DONE generate $pkgconfig_uninstalled
1629 dnl AC_CONFIG_COMMANDS crap, the AS_PUSHVAR defines are invalid here...
1630 ax_create_pkgconfig_generate="$ax_create_pkgconfig_generate"
1631 pkgconfig_prefix='$prefix'
1632 pkgconfig_execprefix='$exec_prefix'
1633 pkgconfig_libdir='$libdir'
1634 pkgconfig_includedir='$includedir'
1635 pkgconfig_libname='$ax_create_pkgconfig_libname'
1636 pkgconfig_description='$ax_create_pkgconfig_description'
1637 pkgconfig_version='$ax_create_pkgconfig_version'
1638 pkgconfig_requires='$ax_create_pkgconfig_requires'
1639 pkgconfig_libs='$ax_create_pkgconfig_libs'
1640 pkgconfig_cppflags='$ax_create_pkgconfig_cppflags'
1641 pkgconfig_src_libdir='$ax_create_pkgconfig_src_libdir'
1642 pkgconfig_src_headers='$ax_create_pkgconfig_src_headers'
1644 AS_VAR_POPDEF([PKGCONFIG_libdir])dnl
1645 AS_VAR_POPDEF([PKGCONFIG_libfile])dnl
1646 AS_VAR_POPDEF([PKGCONFIG_libname])dnl
1647 AS_VAR_POPDEF([PKGCONFIG_version])dnl
1648 AS_VAR_POPDEF([PKGCONFIG_description])dnl
1649 AS_VAR_POPDEF([PKGCONFIG_requires])dnl
1650 AS_VAR_POPDEF([PKGCONFIG_pkglibs])dnl
1651 AS_VAR_POPDEF([PKGCONFIG_libs])dnl
1652 AS_VAR_POPDEF([PKGCONFIG_cppflags])dnl
1653 AS_VAR_POPDEF([PKGCONFIG_generate])dnl
1654 AS_VAR_POPDEF([PKGCONFIG_src_libdir])dnl
1655 AS_VAR_POPDEF([PKGCONFIG_src_headers])dnl
1658 dnl ______ /usr/share/aclocal/guidod/ax_dirname.m4 ______
1659 dnl @* AX_DIRNAME(PATHNAME)
1661 dnl Parts of the implementation have been taken from AS_DIRNAME from the
1662 dnl main autoconf package in generation 2.5x. However, we do only use
1663 dnl "sed" to cut out the dirname, and we do additionally clean up some
1664 dnl dir/.. parts in the resulting pattern.
1666 dnl this macro may be used in autoconf 2.13 scripts as well.
1668 dnl @%Id: ax_dirname.m4,v 1.1 2003/07/02 23:42:59 guidod Exp %
1670 AC_DEFUN([AX_DIRNAME],
1672 sed ['s/\/[^\/:][^\/:]*\/..\//\//g
1673 s/\/[^\/:][^\/:]*\/..\//\//g
1674 s/\/[^\/:][^\/:]*\/..\//\//g
1675 s/\/[^\/:][^\/:]*\/..\//\//g
1676 /^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
1677 /^X\(\/\/\)[^/].*/{ s//\1/; q; }
1678 /^X\(\/\/\)$/{ s//\1/; q; }
1679 /^X\(\/\).*/{ s//\1/; q; }
1682 dnl ______ /usr/share/aclocal/guidod/ax_prefix_config_h.m4 ______
1683 dnl @synopsis AX_PREFIX_CONFIG_H [(OUTPUT-HEADER [,PREFIX [,ORIG-HEADER]])]
1685 dnl This is a new variant from ac_prefix_config_ this one will use a
1686 dnl lowercase-prefix if the config-define was starting with a
1687 dnl lowercase-char, e.g. "#define const", "#define restrict", or
1688 dnl "#define off_t", (and this one can live in another directory, e.g.
1689 dnl testpkg/config.h therefore I decided to move the output-header to
1690 dnl be the first arg)
1692 dnl takes the usual config.h generated header file; looks for each of
1693 dnl the generated "#define SOMEDEF" lines, and prefixes the defined name
1694 dnl (ie. makes it "#define PREFIX_SOMEDEF". The result is written to
1695 dnl the output config.header file. The PREFIX is converted to uppercase
1696 dnl for the conversions.
1700 dnl OUTPUT-HEADER = $PACKAGE-config.h
1701 dnl PREFIX = $PACKAGE
1702 dnl ORIG-HEADER, from AM_CONFIG_HEADER(config.h)
1704 dnl Your configure.ac script should contain both macros in this order,
1705 dnl and unlike the earlier variations of this prefix-macro it is okay to
1706 dnl place the AX_PREFIX_CONFIG_H call before the AC_OUTPUT invokation.
1710 dnl AC_INIT(config.h.in) # config.h.in as created by "autoheader"
1711 dnl AM_INIT_AUTOMAKE(testpkg, 0.1.1) # makes #undef VERSION and PACKAGE
1712 dnl AM_CONFIG_HEADER(config.h) # prep config.h from config.h.in
1713 dnl AX_PREFIX_CONFIG_H(mylib/_config.h) # prep mylib/_config.h from it..
1714 dnl AC_MEMORY_H # makes "#undef NEED_MEMORY_H"
1715 dnl AC_C_CONST_H # makes "#undef const"
1716 dnl AC_OUTPUT(Makefile) # creates the "config.h" now
1717 dnl # and also mylib/_config.h
1719 dnl if the argument to AX_PREFIX_CONFIG_H would have been omitted then the
1720 dnl default outputfile would have been called simply "testpkg-config.h", but
1721 dnl even under the name "mylib/_config.h" it contains prefix-defines like
1723 dnl #ifndef TESTPKG_VERSION
1724 dnl #define TESTPKG_VERSION "0.1.1"
1726 dnl #ifndef TESTPKG_NEED_MEMORY_H
1727 dnl #define TESTPKG_NEED_MEMORY_H 1
1729 dnl #ifndef _testpkg_const
1730 dnl #define _testpkg_const _const
1733 dnl and this "mylib/_config.h" can be installed along with other
1734 dnl header-files, which is most convenient when creating a shared
1735 dnl library (that has some headers) where some functionality is
1736 dnl dependent on the OS-features detected at compile-time. No
1737 dnl need to invent some "mylib-confdefs.h.in" manually. :-)
1739 dnl Note that some AC_DEFINEs that end up in the config.h file are
1740 dnl actually self-referential - e.g. AC_C_INLINE, AC_C_CONST, and the
1741 dnl AC_TYPE_OFF_T say that they "will define inline|const|off_t if the
1742 dnl system does not do it by itself". You might want to clean up about
1743 dnl these - consider an extra mylib/conf.h that reads something like:
1745 dnl #include <mylib/_config.h>
1746 dnl #ifndef _testpkg_const
1747 dnl #define _testpkg_const const
1750 dnl and then start using _testpkg_const in the header files. That is
1751 dnl also a good thing to differentiate whether some library-user has
1752 dnl starting to take up with a different compiler, so perhaps it could
1753 dnl read something like this:
1756 dnl #include <mylib/_msvc.h>
1758 dnl #include <mylib/_config.h>
1760 dnl #ifndef _testpkg_const
1761 dnl #define _testpkg_const const
1764 dnl @version %Id: ax_prefix_config_h.m4,v 1.5 2003/07/02 23:29:23 guidod Exp %
1765 dnl @author Guiodo Draheim <guidod@gmx.de>
1767 AC_DEFUN([AX_PREFIX_CONFIG_H],[AC_REQUIRE([AC_CONFIG_HEADER])
1768 AC_CONFIG_COMMANDS([ifelse($1,,$PACKAGE-config.h,$1)],[dnl
1769 AS_VAR_PUSHDEF([_OUT],[ac_prefix_conf_OUT])dnl
1770 AS_VAR_PUSHDEF([_DEF],[ac_prefix_conf_DEF])dnl
1771 AS_VAR_PUSHDEF([_PKG],[ac_prefix_conf_PKG])dnl
1772 AS_VAR_PUSHDEF([_LOW],[ac_prefix_conf_LOW])dnl
1773 AS_VAR_PUSHDEF([_UPP],[ac_prefix_conf_UPP])dnl
1774 AS_VAR_PUSHDEF([_INP],[ac_prefix_conf_INP])dnl
1775 m4_pushdef([_script],[conftest.prefix])dnl
1776 m4_pushdef([_symbol],[m4_cr_Letters[]m4_cr_digits[]_])dnl
1777 _OUT=`echo ifelse($1, , $PACKAGE-config.h, $1)`
1778 _DEF=`echo _$_OUT | sed -e "y:m4_cr_letters:m4_cr_LETTERS[]:" -e "s/@<:@^m4_cr_Letters@:>@/_/g"`
1779 _PKG=`echo ifelse($2, , $PACKAGE, $2)`
1780 _LOW=`echo _$_PKG | sed -e "y:m4_cr_LETTERS-:m4_cr_letters[]_:"`
1781 _UPP=`echo $_PKG | sed -e "y:m4_cr_letters-:m4_cr_LETTERS[]_:" -e "/^@<:@m4_cr_digits@:>@/s/^/_/"`
1782 _INP=`echo "ifelse($3,,,$3)" | sed -e 's/ *//'`
1783 if test ".$_INP" = "."; then
1784 for ac_file in : $CONFIG_HEADERS; do test "_$ac_file" = _: && continue
1786 *.h) _INP=$ac_file ;;
1789 test ".$_INP" != "." && break
1792 if test ".$_INP" = "."; then
1794 */*) _INP=`basename "$_OUT"`
1796 *-*) _INP=`echo "$_OUT" | sed -e "s/@<:@_symbol@:>@*-//"`
1802 if test -z "$_PKG" ; then
1803 AC_MSG_ERROR([no prefix for _PREFIX_PKG_CONFIG_H])
1805 if test ! -f "$_INP" ; then if test -f "$srcdir/$_INP" ; then
1806 _INP="$srcdir/$_INP"
1808 AC_MSG_NOTICE(creating $_OUT - prefix $_UPP for $_INP defines)
1809 if test -f $_INP ; then
1810 echo "s/@%:@undef *\\(@<:@m4_cr_LETTERS[]_@:>@\\)/@%:@undef $_UPP""_\\1/" > _script
1811 echo "s/@%:@undef *\\(@<:@m4_cr_letters@:>@\\)/@%:@undef $_LOW""_\\1/" >> _script
1812 echo "s/@%:@def[]ine *\\(@<:@m4_cr_LETTERS[]_@:>@@<:@_symbol@:>@*\\)\\(.*\\)/@%:@ifndef $_UPP""_\\1 \\" >> _script
1813 echo "@%:@def[]ine $_UPP""_\\1 \\2 \\" >> _script
1814 echo "@%:@endif/" >>_script
1815 echo "s/@%:@def[]ine *\\(@<:@m4_cr_letters@:>@@<:@_symbol@:>@*\\)\\(.*\\)/@%:@ifndef $_LOW""_\\1 \\" >> _script
1816 echo "@%:@define $_LOW""_\\1 \\2 \\" >> _script
1817 echo "@%:@endif/" >> _script
1818 # now executing _script on _DEF input to create _OUT output file
1819 echo "@%:@ifndef $_DEF" >$tmp/pconfig.h
1820 echo "@%:@def[]ine $_DEF 1" >>$tmp/pconfig.h
1821 echo ' ' >>$tmp/pconfig.h
1822 echo /'*' $_OUT. Generated automatically at end of configure. '*'/ >>$tmp/pconfig.h
1824 sed -f _script $_INP >>$tmp/pconfig.h
1825 echo ' ' >>$tmp/pconfig.h
1826 echo '/* once:' $_DEF '*/' >>$tmp/pconfig.h
1827 echo "@%:@endif" >>$tmp/pconfig.h
1828 if cmp -s $_OUT $tmp/pconfig.h 2>/dev/null; then
1829 AC_MSG_NOTICE([$_OUT is unchanged])
1831 ac_dir=`AS_DIRNAME(["$_OUT"])`
1832 AS_MKDIR_P(["$ac_dir"])
1834 mv $tmp/pconfig.h "$_OUT"
1836 cp _script _configs.sed
1838 AC_MSG_ERROR([input file $_INP does not exist - skip generating $_OUT])
1842 m4_popdef([_symbol])dnl
1843 m4_popdef([_script])dnl
1844 AS_VAR_POPDEF([_INP])dnl
1845 AS_VAR_POPDEF([_UPP])dnl
1846 AS_VAR_POPDEF([_LOW])dnl
1847 AS_VAR_POPDEF([_PKG])dnl
1848 AS_VAR_POPDEF([_DEF])dnl
1849 AS_VAR_POPDEF([_OUT])dnl
1850 ],[PACKAGE="$PACKAGE"])])
1852 dnl ______ /usr/share/aclocal/guidod/ax_not_enable_frame_pointer.m4 ______
1853 dnl @* AX_NOT_ENABLE_FRAME_POINTER ([shellvar])
1855 dnl add --enable-frame-pointer option, the default will add the gcc
1856 dnl --fomit-frame-pointer option to the shellvar (per default CFLAGS)
1857 dnl and remove the " -g " debuginfo option from it. In other words,
1858 dnl the default is "--disable-frame-pointer"
1860 dnl @: guidod@gmx.de
1863 AC_DEFUN([AX_NOT_ENABLE_FRAME_POINTER],[dnl
1864 AS_VAR_PUSHDEF([VAR],[enable_frame_pointer])dnl
1865 AC_MSG_CHECKING([m4_ifval($1,$1,CFLAGS) frame-pointer])
1866 AC_ARG_ENABLE([frame-pointer], AC_HELP_STRING(
1867 [--enable-frame-pointer],[enable callframe generation for debugging]))
1869 .|.no|.no,*) test ".$VAR" = "." && VAR="no"
1870 m4_ifval($1,$1,CFLAGS)=`echo dnl
1871 " $m4_ifval($1,$1,CFLAGS) " | sed -e 's/ -g / /'`
1872 if test ".$GCC" = ".yes" ; then
1873 m4_ifval($1,$1,CFLAGS)="$m4_ifval($1,$1,CFLAGS) -fomit-frame-pointer"
1874 AC_MSG_RESULT([$VAR, -fomit-frame-pointer added])
1876 AC_MSG_RESULT([$VAR, -g removed])
1878 *) AC_MSG_RESULT([$VAR, kept]) ;;
1880 AS_VAR_POPDEF([VAR])dnl
1883 dnl ______ /usr/share/aclocal/guidod/ac_set_default_paths_system.m4 ______
1884 dnl @synopsis AC_SET_DEFAULT_PATHS_SYSTEM
1886 dnl the most interesting changes go about windows-targets - where the
1887 dnl default_prefix is set to /programs, and quite some directories
1888 dnl are aliased: sbindir := libdir := bindir and the docprefix-defaults
1889 dnl are also a bit different, even on FHS2-compliant systems where the
1890 dnl mandir is going to $prefix/man only if prefix=/usr, otherwise they
1891 dnl shall go to $datadir/man. We use an extra docprefix to express it
1892 dnl which is either defined as being prefix or datadir. not SUBSTed here.
1894 dnl @, (very useful)
1895 dnl @version %Id: ac_set_default_paths_system.m4,v 1.5 2003/02/02 19:32:30 guidod Exp %
1896 dnl @author Guido Draheim <guidod@gmx.de>
1897 AC_DEFUN([AC_SET_DEFAULT_PATHS_SYSTEM],
1898 [AC_REQUIRE([AC_CANONICAL_HOST]) # --------------------------------------------
1899 case "$prefix:$ac_default_prefix" in
1902 AC_MSG_CHECKING(default prefix path)
1903 case "${target_os}" in
1904 *cygwin* | *mingw* | *uwin* | *djgpp | *emx* )
1905 if test "${host_os}" = "${target_os}" ; then
1906 ac_default_prefix="/programs"
1907 result="(win/dos target)"
1910 *:/usr/local/cross-tools/$target_alias/bin:*)
1911 ac_default_prefix="/usr/local/cross-tools/$target_alias" ;;
1912 *:/usr/local/$target_alias/bin:*)
1913 ac_default_prefix="/usr/local/$target_alias" ;;
1914 *:/usr/local/$target_cpu-$target_os/bin:*)
1915 ac_default_prefix="/usr/local/$target_cpu-$target_os" ;;
1917 ac_default_prefix="/programs" ;;
1919 result="(win/dos cross-compiler)"
1923 AC_MSG_RESULT($ac_default_prefix $result)
1926 AC_MSG_CHECKING(default prefix system)
1927 result="$prefix" ; test "$result" = "NONE" && result="$ac_default_prefix"
1929 /programs | /programs/*) result="is win-/programs"
1930 # on win/dos, .exe .dll and .cfg live in the same directory
1931 libdir=`echo $libdir |sed -e 's:^..exec_prefix./lib$:${bindir}:'`
1932 sbindir=`echo $sbindir |sed -e 's:^..exec_prefix./sbin$:${libdir}:'`
1933 sysconfdir=`echo $sysconfdir |sed -e 's:^..prefix./etc$:${sbindir}:'`
1934 libexecdir=`echo $libexecdir |sed -e 's:/libexec$:/system:'`
1935 # help-files shall be set with --infodir, docprefix is datadir
1936 docprefix="${datadir}"
1937 mandir=`echo $mandir \
1938 |sed -e 's:^..prefix./man$:${datadir}/info:'`
1939 includedir=`echo $includedir \
1940 |sed -e 's:^..prefix./include$:${datadir}/include:'`
1941 # other state files (but /etc) are moved to datadir
1942 sharedstatedir=`echo $sharedstatedir \
1943 |sed -e 's:^..prefix./com$:${datadir}/default:'`
1944 localstatedir=`echo $localstatedir \
1945 |sed -e 's:^..prefix./var$:${datadir}/current:'`
1947 /usr) result="is /usr-shipped"
1948 # doc files are left at prefix
1949 docprefix="${prefix}"
1950 # state files go under /top
1951 sysconfdir=`echo $sysconfdir |sed -e 's:^..prefix./etc$:/etc:'`
1952 sharedstatedir=`echo $sharedstatedir \
1953 |sed -e 's:^..prefix./com$:/etc/default:'`
1954 # $prefix/var is going to end up in /var/lib
1955 localstatedir=`echo $localstatedir \
1956 |sed -e 's:^..prefix./var$:/var/lib:'`
1958 /opt | /opt/*) result="is /opt-package"
1959 # state files go under /top/prefix
1960 sysconfdir=`echo $sysconfdir \
1961 |sed -e 's:^..prefix./etc$:/etc${prefix}:'`
1962 sharedstatedir=`echo $sharedstatedir \
1963 |sed -e 's:^..prefix./com$:/etc/default${prefix}:'`
1964 # $prefix/var is going to to be /var$prefix... once again
1965 localstatedir=`echo $localstatedir \
1966 |sed -e 's:^..prefix./var$:/var${prefix}:'`
1967 # doc files are left at prefix
1968 docprefix="${prefix}"
1970 *) result="is /local-package"
1971 # doc files are moved from prefix down to datadir
1972 docprefix="${datadir}"
1973 mandir=`echo $mandir \
1974 |sed -e 's:^..prefix./man$:${datadir}/man:'`
1975 infodir=`echo $infodir \
1976 |sed -e 's:^..prefix./infodir$:${datadir}/info:'`
1977 # never use $prefix/com - that is no good idea
1978 sharedstatedir=`echo $sharedstatedir \
1979 |sed -e 's:^..prefix./com$:${sysconfdir}/default:'`
1982 AC_MSG_RESULT($result)
1983 # --------------------------------------------------------
1986 dnl ______ /usr/share/aclocal/guidod/ax_cflags_no_writable_strings.m4 ______
1987 dnl @synopsis AX_CFLAGS_NO_WRITABLE_STRINGS [(shellvar [,default, [A/NA]])]
1989 dnl Try to find a compiler option that makes all stringliteral readonly.
1991 dnl The sanity check is done by looking at string.h which has a set
1992 dnl of strcpy definitions that should be defined with const-modifiers
1993 dnl to not emit a warning in all so many places.
1995 dnl For the GNU CC compiler it will be -fno-writable-strings -Wwrite-strings
1996 dnl The result is added to the shellvar being CFLAGS by default.
2000 dnl - $1 shell-variable-to-add-to : CFLAGS
2001 dnl - $2 add-value-if-not-found : nothing
2002 dnl - $3 action-if-found : add value to shellvariable
2003 dnl - $4 action-if-not-found : nothing
2005 dnl @version %Id: ax_cflags_no_writable_strings.m4,v 1.6 2003/06/05 00:52:15 guidod Exp %
2006 dnl @author Guido Draheim <guidod@gmx.de>
2008 AC_DEFUN([AX_CFLAGS_NO_WRITABLE_STRINGS],[dnl
2009 AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl
2010 AS_VAR_PUSHDEF([VAR],[ac_cv_cflags_no_writable_strings])dnl
2011 AC_CACHE_CHECK([m4_ifval([$1],[$1],FLAGS) making strings readonly],
2012 VAR,[VAR="no, unknown"
2015 ac_save_[]FLAGS="$[]FLAGS"
2017 # -use_readonly_const is the default for IRIX C,
2018 # puts them into .rodata, but they are copied later.
2019 # need to be "-G0 -rdatashared" for strictmode but
2020 # I am not sure what effect that has really. - guidod
2022 in "-Wall % -fno-writable-strings -Wwrite-strings" dnl GCC
2023 "-v -Xc % -xstrconst" dnl Solaris C - strings go into readonly segment
2024 "+w1 -Aa % +ESlit" dnl HP-UX C - strings go into readonly segment
2025 "-w0 -std1 % -readonly_strings" dnl Digital Unix - again readonly segment
2026 "-fullwarn -use_readonly_const %% ok, its the default" dnl IRIX C
2028 do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
2029 AC_TRY_COMPILE([],[return 0;],
2030 [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
2034 *) # sanity check - testing strcpy() from string.h
2035 cp config.log config.tmp
2036 AC_TRY_COMPILE([#include <string.h>],[
2038 if (strcpy (test, "test")) return 1;],
2039 dnl the original did use test -n `$CC testprogram.c`
2040 [if test `diff config.log config.tmp | grep -i warning | wc -l` != 0
2041 then VAR="no, suppressed, string.h," ; fi],
2042 [VAR="no, suppressed, string.h"])
2046 FLAGS="$ac_save_[]FLAGS"
2050 .ok|.ok,*) m4_ifvaln($3,$3) ;;
2051 .|.no|.no,*) m4_ifvaln($4,$4,[m4_ifval($2,[
2052 AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])
2053 m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])]) ;;
2054 *) m4_ifvaln($3,$3,[
2055 if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
2056 then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
2057 else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
2058 m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
2061 AS_VAR_POPDEF([VAR])dnl
2062 AS_VAR_POPDEF([FLAGS])dnl
2065 dnl the only difference - the LANG selection... and the default FLAGS
2067 AC_DEFUN([AX_CXXFLAGS_NO_WRITABLE_STRINGS],[dnl
2068 AS_VAR_PUSHDEF([FLAGS],[CXXFLAGS])dnl
2069 AS_VAR_PUSHDEF([VAR],[ac_cv_cxxflags_no_writable_strings])dnl
2070 AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) making strings readonly],
2071 VAR,[VAR="no, unknown"
2074 ac_save_[]FLAGS="$[]FLAGS"
2076 # -use_readonly_const is the default for IRIX C,
2077 # puts them into .rodata, but they are copied later.
2078 # need to be "-G0 -rdatashared" for strictmode but
2079 # I am not sure what effect that has really. - guidod
2081 in "-Wall % -fno-writable-strings -Wwrite-strings" dnl GCC
2082 "-v -Xc % -xstrconst" dnl Solaris C - strings go into readonly segment
2083 "+w1 -Aa % +ESlit" dnl HP-UX C - strings go into readonly segment
2084 "-w0 -std1 % -readonly_strings" dnl Digital Unix - again readonly segment
2085 "-fullwarn -use_readonly_const %% ok, its the default" dnl IRIX C
2087 do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
2088 AC_TRY_COMPILE([],[return 0;],
2089 [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
2093 *) # sanity check - testing strcpy() from string.h
2094 cp config.log config.tmp
2095 AC_TRY_COMPILE([#include <string.h>],[[
2097 if (strcpy (test, "test")) return 1;]],
2098 dnl the original did use test -n `$CC testprogram.c`
2099 [if test `diff config.log config.tmp | grep -i warning | wc -l` != 0
2100 then VAR="no, suppressed, string.h," ; fi],
2101 [VAR="no, suppressed, string.h"])
2105 FLAGS="$ac_save_[]FLAGS"
2109 .ok|.ok,*) m4_ifvaln($3,$3) ;;
2110 .|.no|.no,*) m4_ifvaln($4,$4,[m4_ifval($2,[
2111 AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
2112 m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])]) ;;
2113 *) m4_ifvaln($3,$3,[
2114 if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
2115 then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
2116 else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
2117 m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
2120 AS_VAR_POPDEF([VAR])dnl
2121 AS_VAR_POPDEF([FLAGS])dnl
2124 dnl ______ /usr/share/aclocal/guidod/ax_spec_file.m4 ______
2125 dnl @* AX_SPEC_FILE [(rpmspecfile [,subdirpath])]
2127 dnl set the specfile - if no argument has been given then check whether
2128 dnl the ac_unique_file looks like a .spec file and use it. This macro
2129 dnl is ac_REQUIRED by many AX_SPEC_ routines.
2131 dnl the AX_SPEC_EXTRACT macro is a helper used by many AX_SPEC_
2132 dnl routines and therefore placed here to be automatically included
2133 dnl in the macro set of (older) aclocal/acinclude.
2135 dnl AX_SPEC_EXTRACT(shellvar [,specvar [,defaultvalue]])
2138 dnl @author Guido Draheim <guidod@gmx.de>
2140 AC_DEFUN([AX_SPEC_FILE],
2141 [ AC_MSG_CHECKING([rpm spec file])
2142 if test ".$1" != "." ; then
2144 ax_spec_file=`basename $1`
2146 case ".$ac_unique_file" in
2147 *.spec) ax_spec_file="$ac_unique_file"
2148 ax_spec_file_="$ac_unique_file" ;;
2149 *) ax_spec_file="TODO"
2150 if test ".$PACKAGE" != "."
2151 then ax_spec_file_="$PACKAGE.spec"
2152 else ax_spec_file_="README"
2154 cat m4_ifset([AS_MESSAGE_LOG_FD],[>&AS_MESSAGE_LOG_FD],[>>config.log]) <<EOF
2155 no ax_spec_file argument has been given, using defaults of
2163 for i in ifelse($2,,,$2) . $srcdir $srcdir/.. .. ; do
2164 if test -f "$i/$ax_spec_file_" ; then
2166 ax_spec_file="$ax_spec_dir/$ax_spec_file_"
2169 if test -f "$i/$ax_spec_file" ; then
2171 ax_spec_file="$ax_spec_dir/$ax_spec_file"
2175 case "$ax_spec_file" in
2176 ./*) if test "$ax_spec_file" = "./$ax_spec_file_" ; then
2177 ax_spec_file="$ax_spec_file_"
2179 AC_MSG_RESULT([$ax_spec_file]) ;;
2180 */*) AC_MSG_RESULT([$ax_spec_file]) ;;
2181 *) AC_MSG_ERROR([no rpm spec file found]) ;;
2183 m4_define([m4_ax_spec_file],[ax_spec_file])
2186 dnl AX_SPEC_EXTRACT(shellvar [,specvar [,defaultvalue]])
2188 AC_DEFUN([AX_SPEC_EXTRACT],
2190 if test ".$[]$1" = "." ; then
2191 $1=`grep -i '^[[ ]]*m4_ifval([$2],[$2],[$1])[[ ]]*:' dnl
2192 "$ax_spec_file" | sed -e 's/.*:[[ ]]*//' dnl
2193 -e 's/[[ ]][[ ]]*/ /g' -e 's/^ //' -e 's/ $[]//' -e 'q'`
2194 if test ".$[]$1" = "." ; then
2195 for $1 in $2 $1 m4_tolower([$1]) ; do
2196 $1=`echo "$[]$1" | sed -e 's/^%//g'`
2198 -e "/^%[[ ]]*def[]ine[[ ]][[ ]]*$[]$1[[ ]]/!d" dnl
2199 -e "s/^%[[ ]]*def[]ine[[ ]][[ ]]*$[]$1[[ ]]*//" dnl
2200 -e 's/[[ ]][[ ]]*/ /' -e 's/ $[]//' -e 'q' $ax_spec_file`
2201 test ".$1" != "." && break
2206 $1=`echo "$[]$1" | sed -e 's/%{//' -e 's/}$[]//'`
2208 -e "/^%[[ ]]*def[]ine[[ ]][[ ]]*$[]$1[[ ]]/!d" dnl
2209 -e "s/^%[[ ]]*def[]ine[[ ]][[ ]]*$[]$1[[ ]]*//" dnl
2210 -e 's/[[ ]][[ ]]*/ /' -e 's/ $[]//' -e 'q' $ax_spec_file` ;;
2212 $1=`echo "$[]$1" | sed -e 's/%//'`
2214 -e "/^%[[ ]]*def[]ine[[ ]][[ ]]*$[]$1[[ ]]/!d" dnl
2215 -e "s/^%[[ ]]*def[]ine[[ ]][[ ]]*$[]$1[[ ]]*//" dnl
2216 -e 's/[[ ]][[ ]]*/ /' -e 's/ $[]//' -e 'q' $ax_spec_file` ;;
2218 m4_ifval([$3],[test ".$[]$1" = "." && $1="$3"])
2219 fi # test ".$[]$1" = "."