1 dnl sxe-aux.m4 -- just some auxiliary macros
3 dnl -------------------------------------------------------------------------
5 dnl -------------------------------------------------------------------------
7 AC_DEFUN([SXE_USAGE_ERROR], [dnl
8 (echo "$progbasename: Usage error:"
10 echo " Use \`$progname --help' to show usage.") >&2 && exit 1])
12 dnl SXE_PRINT_VAR(var var ...) prints values of shell variables
13 AC_DEFUN([SXE_PRINT_VAR],[for var in patsubst([$1],[[
14 ]+],[ ]); do eval "echo \"$var = '\$$var'\""; done])
16 dnl SXE_ADD_RUNPATH_DIR(directory)
17 AC_DEFUN([SXE_ADD_RUNPATH_DIR], [dnl
20 if test "$xe_runpath_dir" != "/lib" -a \
21 "$xe_runpath_dir" != "/usr/lib" -a \
22 -n "`ls ${xe_runpath_dir}/*.s[[ol]] 2>/dev/null`"; then
23 eval "$xe_add_unique_runpath_dir"
26 ])dnl SXE_ADD_RUNPATH_DIR
29 AC_DEFUN([SXE_CHECK_USER_SPECIFIED_P], [dnl
30 ## arg1 var-name to check for
31 ## generates a variable `arg1'_uspecified_p
32 pushdef([VARNAME], [$1])
33 pushdef([VARNAME_USPECIFIED_P], [$1_uspecified_p])
34 pushdef([USER_VARNAME], [USER_$1])
36 AC_MSG_CHECKING([for user specified ]VARNAME)
37 if test "${[]VARNAME[]-unset}" != "unset"; then
38 VARNAME_USPECIFIED_P[]=yes;
39 USER_VARNAME=${[]VARNAME[]}
41 VARNAME_USPECIFIED_P[]=no;
44 AC_MSG_RESULT([$]VARNAME_USPECIFIED_P)
46 popdef([VARNAME_USPECIFIED_P])
47 popdef([USER_VARNAME])
48 ])dnl SXE_CHECK_USER_SPECIFIED_P
50 AC_DEFUN([SXE_CHECK_USER_VARS], [dnl
51 ## If we don't set CFLAGS here, AC_PROG_CC will set it.
52 ## But we know better what's good for us, so we do our own
53 ## computation of real CFLAGS later.
54 SXE_CHECK_USER_SPECIFIED_P([CFLAGS])
55 SXE_CHECK_USER_SPECIFIED_P([CPPFLAGS])
56 SXE_CHECK_USER_SPECIFIED_P([LDFLAGS])
57 SXE_CHECK_USER_SPECIFIED_P([XFLAGS])
58 SXE_CHECK_USER_SPECIFIED_P([LIBS])
59 SXE_CHECK_USER_SPECIFIED_P([CC])
60 SXE_CHECK_USER_SPECIFIED_P([CPP])
61 SXE_CHECK_USER_SPECIFIED_P([AR])
62 SXE_CHECK_USER_SPECIFIED_P([YACC])
63 SXE_CHECK_USER_SPECIFIED_P([YFLAGS])
64 SXE_CHECK_USER_SPECIFIED_P([XMKMF])
65 ])dnl SXE_CHECK_USER_VARS
68 dnl A meta defun that can create those nifty SXE_ADD_*_OBJ macros
69 m4_define([__SXE_MAKE_ADDER], [
70 ## arg1 is the name to be used throughout m4
71 ## arg2 is the library sans _la or _a to be used in the Makefiles
72 ## arg3 are comma-separated additional vars to substitute
73 ## defines SXE_ADD_<arg1>_OBJ
74 ## defines SXE_ADD_<arg1>_OBJS
75 ## defines SXE_SUBST_<arg1>_OBJS
77 m4_define([SXE_ADD_]$1[_OBJ], [
78 $2_objs="$$2_objs $2_a-]$[1]["
79 if test "$extra_verbose" = "yes"; then
80 echo " sxemacs (cat. $1) will be linked with \"]$[1][\""
84 m4_define([SXE_ADD_]$1[_OBJS], [
86 ]SXE_ADD_[]$1[]_OBJ([$i])[
90 m4_define([SXE_SUBST_]$1[_OBJS], [
92 ## subst additional vars
93 m4_foreach_w([var], $3, [AC_SUBST(var)])
94 ## also define a conditional
95 AM_CONDITIONAL([NEED_]translit([$2], [-.a-z], [__A-Z]),
99 ])dnl __SXE_MAKE_ADDER
102 dnl creates SXE_ADD_CORE_{OBJ,OBJS}
103 __SXE_MAKE_ADDER([CORE], [libsxecore])
105 dnl creates SXE_ADD_CRUFT_{OBJ,OBJS}
106 __SXE_MAKE_ADDER([CRUFT], [libcruft])
108 dnl creates SXE_ADD_DB_{OBJ,OBJS}
109 __SXE_MAKE_ADDER([DB], [libsxedb], [DB_CPPFLAGS DB_LDFLAGS DB_LIBS])
111 dnl creates SXE_ADD_ENT_{OBJ,OBJS}
112 __SXE_MAKE_ADDER([ENT], [libent])
114 dnl creates SXE_ADD_EVENTS_{OBJ,OBJS}
115 __SXE_MAKE_ADDER([EVENTS], [libsxeevents])
117 dnl creates SXE_ADD_MEMALLOC_{OBJ,OBJS}
118 __SXE_MAKE_ADDER([MEMALLOC], [libmemalloc])
120 dnl creates SXE_ADD_MM_{OBJ,OBJS}
121 __SXE_MAKE_ADDER([MM], [libmm])
123 dnl creates SXE_ADD_MULE_{OBJ,OBJS}
124 __SXE_MAKE_ADDER([MULE], [libmule])
126 dnl creates SXE_ADD_SXEUI_{OBJ,OBJS}
127 __SXE_MAKE_ADDER([SXEUI], [libsxeui])
129 dnl creates SXE_ADD_SXEUI_{OBJ,OBJS}
130 __SXE_MAKE_ADDER([SXEUITTY], [libsxeuiTTY])
132 dnl creates SXE_ADD_SXEUI_{OBJ,OBJS}
133 __SXE_MAKE_ADDER([SXEUIX11], [libsxeuiX11])
135 dnl creates SXE_ADD_SXEUI_{OBJ,OBJS}
136 __SXE_MAKE_ADDER([SXEUIGTK], [libsxeuiGtk])
138 dnl SXE_ADD_STATMOD_A(foo.o ...)
139 AC_DEFUN([SXE_ADD_STATMOD_A], [
140 statmod_archives="$statmod_archives [$1]" && \
141 if test "$extra_verbose" = "yes"; then
142 echo " sxemacs (cat. static module) will be linked with \"[$1]\""
144 ])dnl SXE_ADD_STATMOD_A
145 AC_DEFUN([SXE_SUBST_STATMOD_A], [AC_SUBST(statmod_archives)])
147 dnl SXE_APPEND(value, varname)
148 AC_DEFUN([SXE_APPEND],
149 [[$2]="$[$2] [$1]" && dnl
150 if test "$extra_verbose" = "yes"; then echo " Appending \"[$1]\" to \$[$2]"; fi])
152 dnl SXE_PREPEND(value, varname)
153 AC_DEFUN([SXE_PREPEND],
154 [[$2]="[$1] $[$2]" && dnl
155 if test "$extra_verbose" = "yes"; then echo " Prepending \"[$1]\" to \$[$2]"; fi])
158 AC_DEFUN([SXE_DIE], [{ echo "Error:" $1 >&2; exit 1; }])
162 AC_DEFUN([SXE_INIT_MSG_LEVEL], [
164 ])dnl SXE_INIT_MSG_LEVEL
166 AC_DEFUN([SXE_MSG_CHECKING], [
167 ## like AC_MSG_CHECKING but nestable
168 if test "$sxe_msg_level" -le 0; then
169 AC_MSG_CHECKING([$1])
171 sxe_msg_level=$(($sxe_msg_level + 1))
172 ])dnl SXE_MSG_CHECKING
174 AC_DEFUN([SXE_MSG_RESULT], [
175 ## like AC_MSG_RESULT but nestable
176 sxe_msg_level=$(($sxe_msg_level - 1))
177 if test "$sxe_msg_level" -le 0; then
182 dnl SXE_CHECK_FEATURE_DEPENDENCY(feature1, feature2)
183 AC_DEFUN([SXE_CHECK_FEATURE_DEPENDENCY],
184 [if test "$with_$1 $with_$2" = "yes no"; then
185 SXE_USAGE_ERROR("--with-$1 requires --with-$2")
186 elif test "$with_$2" = "no" ; then with_$1=no
187 elif test "$with_$1" = "yes"; then with_$2=yes
191 dnl SXE_STRIP_4TH_COMPONENT(var)
192 dnl Changes i986-pc-linux-gnu to i986-pc-linux, as God (not RMS) intended.
193 AC_DEFUN([SXE_STRIP_4TH_COMPONENT],
194 [$1=`echo "$$1" | sed '[s/^\([^-][^-]*-[^-][^-]*-[^-][^-]*\)-.*$/\1/]'`])
196 dnl AC_DEFUN([SXE_DEBUG_AC], [AS_MESSAGE($@)])
197 AC_DEFUN([SXE_DEBUG_AC], [])
199 dnl Do our best to deal with automounter brokenness
200 dnl SXE_CANONICALISE_PATH(varname)
201 AC_DEFUN([SXE_CANONICALISE_PATH], [dnl
202 ## arg #1 is the file/path to canonicalise
203 pushdef([tmpp], [$1])
205 SXE_DEBUG_AC([canonicalising \$]tmpp[: "]$[]tmpp["])
207 if test -d "/net"; then
208 if test -d "/tmp_mnt/net"; then
213 tmpp[]=$(echo "[$]tmpp[]" | \
214 sed -e "s|^${tdir}/|/net/|" \
216 -e "s|^/amd/|/net/|")
219 dnl if test -d "[$]tmpp"; then
220 dnl ## the easy way ...
221 dnl ## just let the filesystem implementation do the hard work
222 dnl tmpp[]=$(cd [$]tmpp[] && echo $(pwd))
223 dnl elif test -f "[$]tmpp"; then
224 dnl ## the easy way ...
225 dnl ## just let the filesystem implementation do the hard work
226 dnl tmpp[]=$(cd $(dirname [$]tmpp[]) && \
227 dnl echo $(pwd)/$(basename [$]tmpp[]))
231 while test "$canonicalised" = "no"; do
232 _SXE_CANONICALISE_STEP(tmpp,
233 [canonicalised="yes"], [canonicalised="no"])
237 SXE_DEBUG_AC([canonicalised \$]tmpp[: "]$[]tmpp["])
239 ])dnl SXE_CANONICALISE_PATH
241 AC_DEFUN([_SXE_CANONICALISE_STEP], [
242 ## _SXE_CANONICALISE_STEP( VAR, DO-ON-SUCCESS, DO-ON-FAILURE)
243 ## arg #1 is the varname to canonicalise
244 ## arg #2 is the code to execute on success
245 ## arg #3 is the code to execute on failure
246 pushdef([tmpvar], [$1])
247 pushdef([dosucc], [$2])
248 pushdef([dofail], [$3])
252 tmp4=$(basename "$tmp2")
253 ## assume we had success
255 while test "$tmp4" != "/" -a "$tmp4" != "."; do
256 if test "$tmp4" = ".." -a \
257 $(basename $(dirname "$tmp2")) = "."; then
258 ## we prepend and we know the path
259 ## is still dirty but wont do anything
260 ## alternative would be to prepend $(pwd) now
262 tmp3="$(basename $tmp2)/$tmp3"
263 elif test "$tmp4" = ".." -a \
264 $(basename $(dirname "$tmp2")) != ".."; then
265 tmp2=$(dirname "$tmp2")
266 elif test "$tmp4" = ".."; then
267 ## we prepend, but now we know the path
270 tmp3="$(basename $tmp2)/$tmp3"
271 elif test -n "$tmp3"; then
272 ## ordinary component, just prepend
273 tmp3="$(basename $tmp2)/$tmp3"
276 tmp3="$(basename $tmp2)"
278 tmp2=$(dirname "$tmp2")
279 tmp4=$(basename "$tmp2")
283 tmpvar[]=$(echo "$tmp3" | sed -e "s@//@/@g")
288 ])dnl _SXE_CANONICALISE_STEP
291 dnl SXE_PROTECT_LINKER_FLAGS(shell_var)
292 AC_DEFUN([SXE_PROTECT_LINKER_FLAGS], [
293 if test "$GCC" = "yes"; then
294 set x $[$1]; shift; [$1]=""
295 while test -n "[$]1"; do
297 -L | -l | -u ) [$1]="$[$1] [$]1 [$]2"; shift ;;
298 -L* | -l* | -u* | -Wl* | -pg ) [$1]="$[$1] [$]1" ;;
300 * ) [$1]="$[$1] -Xlinker [$]1" ;;
307 dnl Allow use of either ":" or spaces for lists of directories
308 AC_DEFUN([SXE_COLON_TO_SPACE],
309 [case "$[$1]" in *:* [)] [$1]="`echo '' $[$1] | sed -e 's/^ //' -e 's/:/ /g'`";; esac])dnl
312 dnl The construct foo=`echo $w1 $w2 $w3` fails on some systems if $w1 = -e or -n
313 dnl So we use the following instead.
314 dnl SXE_SPACE(var, words)
315 AC_DEFUN([SXE_SPACE],[
317 for W in $2; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
323 AC_DEFUN([SXE_LANG_WERROR], [dnl
324 dnl like AC_LANG_WERROR but working
325 dnl call goes: SXE_LANG_WERROR([on|off|push|pop|push+off|push+on])
328 if test -n "$ac_c_werror_flag"; then
329 sxe_cv_aux_werror_stack="on $sxe_cv_aux_werror_stack"
331 sxe_cv_aux_werror_stack="off $sxe_cv_aux_werror_stack"
334 pushdef([tmpon], [ac_c_werror_flag="-Werror"])
335 pushdef([tmpoff], [ac_c_werror_flag=""])
337 m4_if([$1], [on], [tmpon])
339 m4_if([$1], [off], [tmpoff])
341 m4_if([$1], [push], [tmppush])
342 m4_if([$1], [push+off], [
346 m4_if([$1], [push+on], [
352 ## thanks for the tip, Aidan
353 $(echo $sxe_cv_aux_werror_stack | \
354 read sxe_cv_tmp_stackcar sxe_cv_aux_werror_stack)
355 if test "$sxe_cv_tmp_stackcar" = "on"; then
357 elif test "$sxe_cv_tmp_stackcar" = "off"; then
360 ## rather turn it off than on, dont ya think?
365 ])dnl SXE_LANG_WERROR
368 AC_DEFUN([SXE_DUMP_LIBS], [
369 save_c_switch_site="$c_switch_site"
371 save_ld_switch_site="$ld_switch_site"
372 save_ld_switch_machine="$ld_switch_machine"
374 save_CFLAGS="$CFLAGS"
375 save_CPPFLAGS="$CPPFLAGS"
376 save_LDFLAGS="$LDFLAGS"
378 SXE_LANG_WERROR([push])
381 AC_DEFUN([SXE_RESTORE_LIBS], [
383 c_switch_site="$save_c_switch_site"
384 ld_switch_site="$save_ld_switch_site"
385 ld_switch_machine="$save_ld_switch_machine"
387 CFLAGS="$save_CFLAGS"
388 CPPFLAGS="$save_CPPFLAGS"
389 LDFLAGS="$save_LDFLAGS"
391 SXE_LANG_WERROR([pop])
392 ])dnl SXE_RESTORE_LIBS
394 AC_DEFUN([SXE_SEARCH_CONFIG_PROG], [
395 ## arg #1 program to search
396 pushdef([config_prog], [$1])
397 pushdef([have_config_prog], [have_]translit([$1], [-.], [__]))
398 pushdef([CONFIG_PROG], translit([$1], [-.a-z], [__A-Z]))
399 AC_CHECK_PROG(have_config_prog, config_prog, [yes], [no])
400 AC_PATH_PROG(CONFIG_PROG, config_prog, [echo])
401 popdef([config_prog])
402 popdef([have_config_prog])
403 popdef([CONFIG_PROG])
404 ])dnl SXE_SEARCH_CONFIG_PROG
407 AC_DEFUN([_SXE_CHECK_pkgconfig_based], [
408 ## assumes $PKG_CONFIG is defined
409 ## arg #1: MM param name
410 ## arg #2: lib to check
411 ## arg #3: version of that lib
413 pushdef([IO_LIB], [$1])
415 AC_REQUIRE([SXE_CHECK_PKGCONFIG])
417 AC_MSG_CHECKING([for ]IO_LIB[ support])
420 if test "$have_pkg_config" = "no" -o -z "$PKG_CONFIG"; then
421 AS_MESSAGE([*** pkg-config not found. See http://pkgconfig.sourceforge.net])
422 AS_MESSAGE([*** Cannot check for ]IO_LIB[.])
427 pushdef([IO_MOD], [$2])
428 pushdef([IO_MOD_REQUIRED_VERSION], [$3])
429 AC_MSG_CHECKING([whether ]IO_MOD[ is at least ]IO_MOD_REQUIRED_VERSION)
430 if test -n "$PKG_CONFIG" && \
431 $PKG_CONFIG --atleast-version IO_MOD_REQUIRED_VERSION IO_MOD; then
432 IO_LIB[]_version=`$PKG_CONFIG --modversion []IO_MOD[]`
433 AC_MSG_RESULT([yes ($]IO_LIB[_version)])
434 have_[]IO_LIB[]_pkg="yes"
435 ## define some useful variables
436 IO_LIB[]_libs=`$PKG_CONFIG --libs []IO_MOD[]`
437 IO_LIB[]_libs_L=`$PKG_CONFIG --libs-only-L []IO_MOD[]`
438 IO_LIB[]_libs_l=`$PKG_CONFIG --libs-only-l []IO_MOD[]`
439 IO_LIB[]_libs_other=`$PKG_CONFIG --libs-only-other []IO_MOD[]`
440 IO_LIB[]_cflags=`$PKG_CONFIG --cflags []IO_MOD[]`
441 IO_LIB[]_cflags_I=`$PKG_CONFIG --cflags-only-I []IO_MOD[]`
442 IO_LIB[]_cflags_other=`$PKG_CONFIG --cflags-only-other []IO_MOD[]`
443 elif test -n "$PKG_CONFIG"; then
444 IO_LIB[]_version=`$PKG_CONFIG --modversion []IO_MOD[]`
445 AC_MSG_RESULT([no ($]IO_LIB[_version)])
446 have_[]IO_LIB[]_pkg="no"
448 have_[]IO_LIB[]_pkg="uncertain"
449 AC_MSG_RESULT([$have_]IO_LIB[])
452 popdef([IO_MOD_REQUIRED_VERSION])
454 ])dnl _SXE_CHECK_pkgconfig_based
456 AC_DEFUN([_SXE_MM_CHECK_pkgconfig_based], [
457 ## assumes $PKG_CONFIG is defined
458 ## arg #1: MM param name
459 ## arg #2: lib to check
460 ## arg #3: version of that lib
461 ## arg #4: funs to check
462 ## arg #5: headers to check
463 ## arg #6: success action
464 ## arg #7: failure action
466 pushdef([MM_LIB], [$1])
467 pushdef([MM_SUCC], [$6])
468 pushdef([MM_FAIL], [$7])
470 AC_REQUIRE([SXE_CHECK_PKGCONFIG])
472 AC_MSG_CHECKING([for ]MM_LIB[ support])
475 if test "$have_pkg_config" = "no" -o -z "$PKG_CONFIG"; then
476 AS_MESSAGE([*** pkg-config not found. See http://pkgconfig.sourceforge.net])
477 AS_MESSAGE([*** Cannot check for ]MM_LIB[.])
483 pushdef([MM_MOD], [$2])
484 pushdef([MM_MOD_REQUIRED_VERSION], [$3])
485 pushdef([MM_MOD_FUNS], [$4])
486 pushdef([MM_MOD_HDRS], [$5])
487 AC_MSG_CHECKING([whether ]MM_MOD[ is at least ]MM_MOD_REQUIRED_VERSION)
488 if test -n "$PKG_CONFIG" && \
489 $PKG_CONFIG --atleast-version MM_MOD_REQUIRED_VERSION MM_MOD; then
490 actual_version=`$PKG_CONFIG --modversion []MM_MOD[]`
491 AC_MSG_RESULT([yes ($actual_version)])
492 AC_MSG_CHECKING([for ]mm_lib[ libraries])
493 MM_MOD_LIBS_L=`$PKG_CONFIG --libs-only-l []MM_MOD[]`
494 MM_MOD_LIBS=`echo $MM_MOD_LIBS_L | sed -e "s/-l//g"`
495 MM_MOD_LIB=`echo $MM_MOD_LIBS | sed -e "s/ .*$//"`
496 MM_MOD_OTHER_LIBS=`echo $MM_MOD_LIBS_L | sed -e "s/^[^ ]*//"`
497 AC_MSG_RESULT([$MM_MOD_LIBS])
499 ## backup our site flags
501 MM_MOD_LIBS_SITE=`$PKG_CONFIG --libs-only-L []MM_MOD[]`
502 MM_MOD_HDRS_SITE=`$PKG_CONFIG --cflags-only-I []MM_MOD[]`
503 SXE_PREPEND([$MM_MOD_HDRS_SITE], [CPPFLAGS])
504 SXE_PREPEND([$MM_MOD_LIBS_SITE], [LDFLAGS])
507 SXE_CHECK_HEADERS([]MM_MOD_HDRS[], [:], [MM_FAIL])
508 for i in MM_MOD_FUNS; do
509 AC_CHECK_LIB([$MM_MOD_LIB], [$i], [:], [MM_FAIL],
513 ## restore old values
515 elif test -n "$PKG_CONFIG"; then
516 actual_version=`$PKG_CONFIG --modversion []MM_MOD[]`
517 AC_MSG_RESULT([no ($actual_version)])
519 AC_MSG_RESULT([uncertain])
522 popdef([MM_MOD_FUNS])
523 popdef([MM_MOD_HDRS])
524 popdef([MM_MOD_REQUIRED_VERSION])
528 ])dnl _SXE_MM_CHECK_pkgconfig_based
531 AC_DEFUN([SXE_CHECK_SUFFICIENCY], [dnl
532 ## arg #1 is the option to check sufficiency on
533 ## arg #2 is a description
534 ## arg #3 are additional actions to perform when support is sufficient
535 ## arg #4 are additional actions to perform when support is insufficient
536 pushdef([og_group], translit([$1], [-], [_]))
537 pushdef([og_descr], [$2])
538 pushdef([OG_GROUP], translit([$1], [-a-z], [_A-Z]))
539 pushdef([IF_YES_DO], [$3])
540 pushdef([IF_NO_DO], [$4])
542 tmp=${[have_]og_group[]-uncertain}
543 if test "$with_[]og_group" != "no"; then
544 AC_MSG_CHECKING([for sufficient ]og_descr[ support])
545 AC_MSG_RESULT([$tmp])
546 if test "$tmp" = "yes"; then
547 AC_DEFINE([HAVE_]OG_GROUP, [1],
548 [Whether ]og_descr[ is doable])
559 AM_CONDITIONAL([HAVE_]OG_GROUP,
560 [test "$have_[]og_group" = "yes" -a "$with_[]og_group" != "no"])
566 ])dnl SXE_CHECK_SUFFICIENCY
569 AC_DEFUN([SXE_CHECK_HEADERS], [dnl
570 dnl One day, this macro will only check for headers if
571 dnl their presence is yet unknown
572 AC_CHECK_HEADERS($1,$2,$3,$4)
573 ])dnl SXE_CHECK_HEADERS
575 AC_DEFUN([SXE_CHECK_LIB_FUNCS], [dnl
576 pushdef([SXE_LIB], [$1])
577 pushdef([SXE_FUNCS], [$2])
580 for j in SXE_FUNCS; do
581 AC_CHECK_LIB([$i], [$j], [:], [:])
587 ])dnl SXE_CHECK_LIB_FUNCS
590 AC_DEFUN([_SXE_CHECK_PURE_OPT], [dnl
591 unq_opt=$(echo $1 | tr -d "'\"")
594 ## first autoconf's options
595 --enable-largefile | --disable-largefile | \
596 --enable-dependency-tracking | --disable-dependency-tracking | \
597 --enable-option-checking | --disable-option-checking | \
598 --with-x | --x-includes | --x-libraries | \
600 --program-prefix | --program-suffix | --program-transform-name | \
601 --prefix | --exec-prefix | --bindir | --sbindir | \
602 --libexecdir | --sysconfdir | \
603 --sharedstatedir | --localstatedir | \
604 --libdir | --includedir | --oldincludedir | \
605 --datarootdir | --datadir | --infodir | --localedir | \
606 --mandir | --docdir | --htmldir | --dvidir | --pdfdir | --psdir | \
607 -n | --no-create | -C | --config-cache | --cache-file | \
608 -q | --quiet | --silent | --version )
609 AC_MSG_CHECKING([if option $1 is known])
613 ## now the hard-coded libtool ones
614 --enable-ltdl-install | --disable-ltdl-install | \
615 --enable-ltdl-convenience | --disable-ltdl-convenience | \
616 --enable-libtool-lock | --disable-libtool-lock | \
617 --enable-fast-install | --disable-fast-install | \
618 --enable-shared | --disable-shared | \
619 --enable-static | --disable-static | \
620 --with-gcc-arch | --with-pic | --with-included-ltdl )
621 AC_MSG_CHECKING([if option $1 is known])
626 --enable-* | --disable-* )
627 AC_MSG_CHECKING([if option $1 is known])
628 strp_opt=$(echo $unq_opt | \
629 sed -e "s/^--enable-//g" -e "s/^--disable-//g")
630 OG_CHECK_OPTION([enable], [$strp_opt],
631 AC_MSG_RESULT([yes]),
633 [bogus_cmd_opts="$bogus_cmd_opts $unq_opt"])
636 --with-* | --without-* )
637 AC_MSG_CHECKING([if option $1 is known])
638 strp_opt=$(echo $unq_opt | \
639 sed -e "s/^--with-//g" -e "s/^--without-//g")
640 OG_CHECK_OPTION([with], [$strp_opt],
641 AC_MSG_RESULT([yes]),
643 [bogus_cmd_opts="$bogus_cmd_opts $unq_opt"])
646 ## strange constructions
650 AC_MSG_CHECKING([if option $1 is known])
652 bogus_cmd_opts="$bogus_cmd_opts $unq_opt"
661 ])dnl _SXE_CHECK_PURE_OPT
663 AC_DEFUN([SXE_CHECK_COMMAND_LINE], [dnl
664 dnl Check for bogus options
665 sxe_with_options="$sxe_with_options x"
666 cmd_line_args="$ac_configure_args"
668 ## make sure our bogus stuff is empty once we get into here
669 ## this allows us to call this stuff more than once
670 ## (which never happens of course)
673 for opt in $cmd_line_args; do
674 pure_opt=$(echo $opt | sed -e "s/=.*$//g")
675 _SXE_CHECK_PURE_OPT([$pure_opt])
678 dnl Final command line argument checks.
679 dnl --with-quantify or --with-purify imply --with-system-malloc
680 if test "$with_purify" = "yes" -o "$with_quantify" = "yes"; then
681 if test "$with_system_malloc" = "default"; then
682 with_system_malloc="yes"
685 ])dnl SXE_CHECK_COMMAND_LINE
688 AC_DEFUN([SXE_EXPAND_VAR], [dnl
689 ## arg #1 the variable to expand
690 ## arg #2 (optional) the variable to put the result in
692 pushdef([RES], ifelse($2,[],[sxe_cv_tmp_expand_var],$2))
696 while test "${RES}" != "${__tmp}"; do
698 RES=$(eval echo ${__tmp})
705 dnl sxe-aux.m4 ends here