338
323
AC_SUBST(BINRELOC_CFLAGS)
339
324
AC_SUBST(BINRELOC_LIBS)
342
dnl Modified ZThread test follows. This one works, the official one alone does not.
343
dnl Changes: hacked compiler temporarily to use CXX instead of CC
344
dnl added zthread/ to include path
345
dnl added #include "zthread/Task.h" and #include "zthread/Thread.h"
346
dnl added HAVE_LIBZTHREAD define
348
dnl Copyright (c) 2005, Eric Crahen
350
dnl Permission is hereby granted, free of charge, to any person obtaining a copy
351
dnl of this software and associated documentation files (the "Software"), to deal
352
dnl in the Software without restriction, including without limitation the rights
353
dnl to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
354
dnl copies of the Software, and to permit persons to whom the Software is furnished
355
dnl to do so, subject to the following conditions:
357
dnl The above copyright notice and this permission notice shall be included in all
358
dnl copies or substantial portions of the Software.
360
dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
361
dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
362
dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
363
dnl AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
364
dnl WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
365
dnl CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
367
dnl Detect the library and include paths for ZThreads, perform some test
370
dnl Should be used in AC_PROG_CC mode before the swtich to C++ if any is made
371
dnl (eg before AC_LANG_CPLUSPLUS)
373
dnl --with-zthread-prefix : Skip detection, use this general path
374
dnl --with-zthread-exec-prefix : Skip detecting the zthread-config tool
376
dnl Sets the following variables.
381
AC_DEFUN([AM_PATH_ZTHREAD_AA],
385
AC_ARG_WITH(zthread-prefix,[ --with-zthread-prefix=PFX Prefix where ZTHREAD is installed (optional)],
386
zthread_prefix="$withval", zthread_prefix="")
387
AC_ARG_WITH(zthread-exec-prefix,[ --with-zthread-exec-prefix=PFX Exec prefix where ZTHREAD is installed (optional)],
388
zthread_exec_prefix="$withval", zthread_exec_prefix="")
389
AC_ARG_ENABLE(zthreadtest, [ --disable-zthreadtest Do not try to compile and run a test ZTHREAD program],
390
, enable_zthreadtest=yes)
392
if test x$zthread_exec_prefix != x ; then
393
zthread_args="$zthread_args --exec-prefix=$zthread_exec_prefix"
394
if test x${ZTHREAD_CONFIG+set} != xset ; then
395
ZTHREAD_CONFIG=$zthread_exec_prefix/bin/zthread-config
398
if test x$zthread_prefix != x ; then
399
zthread_args="$zthread_args --prefix=$zthread_prefix"
400
if test x${ZTHREAD_CONFIG+set} != xset ; then
401
ZTHREAD_CONFIG=$zthread_prefix/bin/zthread-config
405
AC_PATH_PROG(ZTHREAD_CONFIG, zthread-config, no)
406
min_zthread_version=ifelse([$1], ,0.11.0,$1)
407
AC_MSG_CHECKING(for ZTHREAD - version >= $min_zthread_version)
409
if test "$ZTHREAD_CONFIG" = "no" ; then
412
ZTHREAD_CXXFLAGS=`$ZTHREAD_CONFIG $zthreadconf_args --cflags`
413
ZTHREAD_LIBS=`$ZTHREAD_CONFIG $zthreadconf_args --libs`
415
zthread_major_version=`$ZTHREAD_CONFIG $zthread_args --version | \
416
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
417
zthread_minor_version=`$ZTHREAD_CONFIG $zthread_args --version | \
418
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
419
zthread_micro_version=`$ZTHREAD_CONFIG $zthread_config_args --version | \
420
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
421
if test "x$enable_zthreadtest" = "xyes" ; then
422
ac_save_CXXFLAGS="$CXXFLAGS"
423
ac_save_CFLAGS="$CFLAGS"
425
CXXFLAGS="$CXXFLAGS $ZTHREAD_CXXFLAGS"
426
CFLAGS="$CFLAGS $ZTHREAD_CXXFLAGS"
427
LIBS="$LIBS $ZTHREAD_LIBS"
430
dnl Now check if the installed ZTHREAD is sufficiently new. (Also sanity
431
dnl checks the results of zthread-config to some extent
433
rm -f conf.zthreadtest
436
for extra_flags in "NONE" "-fpermissive"; do
437
if test NONE != ${extra_flags}; then
438
ZTHREAD_CXXFLAGS="$ZTHREAD_CXXFLAGS ${extra_flags}"
439
CXXFLAGS="$CXXFLAGS ${extra_flags}"
440
CFLAGS="$CFLAGS ${extra_flags}"
442
if test "x$no_zthread" = xyes || test NONE = ${extra_flags} ; then
450
#include "zthread/Task.h"
451
#include "zthread/Thread.h"
452
#include "zthread/ZThread.h"
454
int main (int argc, char *argv[]) {
456
int major, minor, micro;
457
char tmp_version[256];
459
{ FILE *fp = fopen("conf.zthreadtest", "a"); if ( fp ) fclose(fp); }
462
/* HP/UX 9 (%@#!) writes to sscanf strings */
463
strcpy(tmp_version, "$min_zthread_version");
465
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
467
printf("%s, bad version string\n", "$min_zthread_version");
472
if (($zthread_major_version > major) ||
473
(($zthread_major_version == major) && ($zthread_minor_version > minor)) ||
474
(($zthread_major_version == major) && ($zthread_minor_version == minor) &&
475
($zthread_micro_version >= micro))) {
479
printf("\n*** 'zthread-config --version' returned %d.%d.%d, but the minimum version\n", $zthread_major_version, $zthread_minor_version, $zthread_micro_version);
480
printf("*** of ZThread required is %d.%d.%d. If zthread-config is correct, then it is\n", major, minor, micro);
481
printf("*** best to upgrade to the required version.\n");
482
printf("*** If zthread-config was wrong, set the environment variable ZTHREAD_CONFIG\n");
483
printf("*** to point to the correct copy of zthread-config, and remove the file\n");
484
printf("*** config.cache before re-running configure\n");
491
],, no_zthread=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
495
CXXFLAGS="$ac_save_CXXFLAGS"
500
if test "x$no_zthread" = x ; then
502
AC_DEFINE(HAVE_LIBZTHREAD,[], [Define if you have the library ZThread.])
504
ifelse([$2], , :, [$2])
510
if test "$ZTHREAD_CONFIG" = "no" ; then
512
echo "*** The zthread-config script installed by ZThread could not be found"
513
echo "*** If ZThread was installed in PREFIX, make sure PREFIX/bin is in"
514
echo "*** your path, or set the ZTHREAD_CONFIG environment variable to the"
515
echo "*** full path to zthread-config."
518
if test -f conf.zthreadtest ; then
522
echo "*** Could not run ZThread test program, checking why..."
525
CXXFLAGS="$CXXFLAGS $ZTHREAD_CXXFLAGS"
526
LIBS="$LIBS $ZTHREAD_LIBS"
530
AC_TRY_LINK([#include "zthread/Task.h"],
532
echo "*** The test program compiled, but did not run. This usually means"
533
echo "*** that the run-time linker is not finding ZThread or finding the wrong"
534
echo "*** version of ZThread. If it is not finding ZThread, you'll need to set your"
535
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
536
echo "*** to the installed location Also, make sure you have run ldconfig if that"
537
echo "*** is required on your system"
539
echo "*** If you have an old version installed, it is best to remove it, although"
540
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
541
[ echo "*** The test program failed to compile or link. See the file config.log for the"
542
echo "*** exact error that occured. This usually means ZThread was incorrectly installed"
543
echo "*** or that you have moved ZThread since it was installed. In the latter case, you"
544
echo "*** may want to edit the zthread-config script: $ZTHREAD_CONFIG" ])
547
CFLAGS="$ac_save_CFLAGS"
548
CXXFLAGS="$ac_save_CXXFLAGS"
555
ifelse([$3], , :, [$3])
559
AC_SUBST(ZTHREAD_CXXFLAGS)
560
AC_SUBST(ZTHREAD_LIBS)
562
rm -f conf.zthreadtest
566
dnl Copyright � 2008 Steven G. Johnson <stevenj@alum.mit.edu>
567
dnl This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
568
dnl This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
569
dnl You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
570
dnl As a special exception, the respective Autoconf Macro's copyright owner gives unlimited permission to copy, distribute and modify the configure scripts that are the output of Autoconf when processing the Macro. You need not follow the terms of the GNU General Public License when using or distributing such scripts, even though portions of the text of the Macro appear in them. The GNU General Public License (GPL) does govern all other use of the material that constitutes the Autoconf Macro.
571
dnl This special exception to the GPL applies to versions of the Autoconf Macro released by the Autoconf Macro Archive. When you make and distribute a modified version of the Autoconf Macro, you may extend this special exception to the GPL to apply to your modified version as well.
573
AC_DEFUN([ACX_PTHREAD], [
574
AC_REQUIRE([AC_CANONICAL_HOST])
579
# We used to check for pthread.h first, but this fails if pthread.h
580
# requires special compiler flags (e.g. on True64 or Sequent).
581
# It gets checked for in the link test anyway.
583
# First of all, check if the user has set any of the PTHREAD_LIBS,
584
# etcetera environment variables, and if threads linking works using
586
if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
587
save_CFLAGS="$CFLAGS"
588
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
590
LIBS="$PTHREAD_LIBS $LIBS"
591
AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS])
592
AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes)
593
AC_MSG_RESULT($acx_pthread_ok)
594
if test x"$acx_pthread_ok" = xno; then
599
CFLAGS="$save_CFLAGS"
602
# We must check for the threads library under a number of different
603
# names; the ordering is very important because some systems
604
# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
605
# libraries is broken (non-POSIX).
607
# Create a list of thread flags to try. Items starting with a "-" are
608
# C compiler flags, and other items are library names, except for "none"
609
# which indicates that we try without any flags at all, and "pthread-config"
610
# which is a program returning the flags for the Pth emulation library.
612
acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
614
# The ordering *is* (sometimes) important. Some notes on the
615
# individual items follow:
617
# pthreads: AIX (must check this before -lpthread)
618
# none: in case threads are in libc; should be tried before -Kthread and
619
# other compiler flags to prevent continual compiler warnings
620
# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
621
# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
622
# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
623
# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
624
# -pthreads: Solaris/gcc
625
# -mthreads: Mingw32/gcc, Lynx/gcc
626
# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
627
# doesn't hurt to check since this sometimes defines pthreads too;
628
# also defines -D_REENTRANT)
629
# ... -mt is also the pthreads flag for HP/aCC
630
# pthread: Linux, etcetera
631
# --thread-safe: KAI C++
632
# pthread-config: use pthread-config program (for GNU Pth library)
634
case "${host_cpu}-${host_os}" in
637
# On Solaris (at least, for some versions), libc contains stubbed
638
# (non-functional) versions of the pthreads routines, so link-based
639
# tests will erroneously succeed. (We need to link with -pthreads/-mt/
640
# -lpthread.) (The stubs are missing pthread_cleanup_push, or rather
641
# a function called by this macro, so we could check for that, but
642
# who knows whether they'll stub that too in a future libc.) So,
643
# we'll just look for -pthreads and -lpthread first:
645
acx_pthread_flags="-pthreads pthread -mt -pthread $acx_pthread_flags"
649
if test x"$acx_pthread_ok" = xno; then
650
for flag in $acx_pthread_flags; do
654
AC_MSG_CHECKING([whether pthreads work without any flags])
658
AC_MSG_CHECKING([whether pthreads work with $flag])
659
PTHREAD_CFLAGS="$flag"
663
AC_CHECK_PROG(acx_pthread_config, pthread-config, yes, no)
664
if test x"$acx_pthread_config" = xno; then continue; fi
665
PTHREAD_CFLAGS="`pthread-config --cflags`"
666
PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
670
AC_MSG_CHECKING([for the pthreads library -l$flag])
671
PTHREAD_LIBS="-l$flag"
676
save_CFLAGS="$CFLAGS"
677
LIBS="$PTHREAD_LIBS $LIBS"
678
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
680
# Check for various functions. We must include pthread.h,
681
# since some functions may be macros. (On the Sequent, we
682
# need a special flag -Kthread to make this header compile.)
683
# We check for pthread_join because it is in -lpthread on IRIX
684
# while pthread_create is in libc. We check for pthread_attr_init
685
# due to DEC craziness with -lpthreads. We check for
686
# pthread_cleanup_push because it is one of the few pthread
687
# functions on Solaris that doesn't have a non-functional libc stub.
688
# We try pthread_create on general principles.
689
AC_TRY_LINK([#include <pthread.h>],
690
[pthread_t th; pthread_join(th, 0);
691
pthread_attr_init(0); pthread_cleanup_push(0, 0);
692
pthread_create(0,0,0,0); pthread_cleanup_pop(0); ],
693
[acx_pthread_ok=yes])
696
CFLAGS="$save_CFLAGS"
698
AC_MSG_RESULT($acx_pthread_ok)
699
if test "x$acx_pthread_ok" = xyes; then
708
# Various other checks:
709
if test "x$acx_pthread_ok" = xyes; then
711
LIBS="$PTHREAD_LIBS $LIBS"
712
save_CFLAGS="$CFLAGS"
713
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
715
# Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
716
AC_MSG_CHECKING([for joinable pthread attribute])
718
for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
719
AC_TRY_LINK([#include <pthread.h>], [int attr=$attr; return attr;],
720
[attr_name=$attr; break])
722
AC_MSG_RESULT($attr_name)
723
if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then
724
AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name,
725
[Define to necessary symbol if this constant
726
uses a non-standard name on your system.])
729
AC_MSG_CHECKING([if more special flags are required for pthreads])
731
case "${host_cpu}-${host_os}" in
732
*-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";;
733
*solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
735
AC_MSG_RESULT(${flag})
736
if test "x$flag" != xno; then
737
PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
741
CFLAGS="$save_CFLAGS"
743
# More AIX lossage: must compile with xlc_r or cc_r
744
if test x"$GCC" != xyes; then
745
AC_CHECK_PROGS(PTHREAD_CC, xlc_r cc_r, ${CC})
753
AC_SUBST(PTHREAD_LIBS)
754
AC_SUBST(PTHREAD_CFLAGS)
757
# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
758
if test x"$acx_pthread_ok" = xyes; then
759
ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1])
769
dnl GPLed checks whether the current version of GCC supports a certain flag
770
dnl source: http://autoconf-archive.cryp.to/ax_cflags_gcc_option.html
771
dnl Copyright � 2008 Guido U. Draheim <guidod@gmx.de>
773
AC_DEFUN([AX_CFLAGS_GCC_OPTION_OLD], [dnl
774
AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl
775
AS_VAR_PUSHDEF([VAR],[ac_cv_cflags_gcc_option_$2])dnl
776
AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for gcc m4_ifval($2,$2,-option)],
777
VAR,[VAR="no, unknown"
780
ac_save_[]FLAGS="$[]FLAGS"
782
in "-pedantic -Werror % m4_ifval($2,$2,-option)" dnl GCC
783
"-pedantic % m4_ifval($2,$2,-option) %% no, obsolete" dnl new GCC
785
do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
786
AC_TRY_COMPILE([],[return 0;],
787
[VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
789
FLAGS="$ac_save_[]FLAGS"
793
.ok|.ok,*) m4_ifvaln($3,$3) ;;
794
.|.no|.no,*) m4_ifvaln($4,$4) ;;
796
if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
797
then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
798
else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
799
m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
802
AS_VAR_POPDEF([VAR])dnl
803
AS_VAR_POPDEF([FLAGS])dnl
807
dnl the only difference - the LANG selection... and the default FLAGS
809
AC_DEFUN([AX_CXXFLAGS_GCC_OPTION_OLD], [dnl
810
AS_VAR_PUSHDEF([FLAGS],[CXXFLAGS])dnl
811
AS_VAR_PUSHDEF([VAR],[ac_cv_cxxflags_gcc_option_$2])dnl
812
AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for gcc m4_ifval($2,$2,-option)],
813
VAR,[VAR="no, unknown"
816
ac_save_[]FLAGS="$[]FLAGS"
818
in "-pedantic -Werror % m4_ifval($2,$2,-option)" dnl GCC
819
"-pedantic % m4_ifval($2,$2,-option) %% no, obsolete" dnl new GCC
821
do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
822
AC_TRY_COMPILE([],[return 0;],
823
[VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
825
FLAGS="$ac_save_[]FLAGS"
829
.ok|.ok,*) m4_ifvaln($3,$3) ;;
830
.|.no|.no,*) m4_ifvaln($4,$4) ;;
832
if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
833
then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
834
else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
835
m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
838
AS_VAR_POPDEF([VAR])dnl
839
AS_VAR_POPDEF([FLAGS])dnl
842
dnl -------------------------------------------------------------------------
844
AC_DEFUN([AX_CFLAGS_GCC_OPTION_NEW], [dnl
845
AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl
846
AS_VAR_PUSHDEF([VAR],[ac_cv_cflags_gcc_option_$1])dnl
847
AC_CACHE_CHECK([m4_ifval($2,$2,FLAGS) for gcc m4_ifval($1,$1,-option)],
848
VAR,[VAR="no, unknown"
851
ac_save_[]FLAGS="$[]FLAGS"
853
in "-pedantic -Werror % m4_ifval($1,$1,-option)" dnl GCC
854
"-pedantic % m4_ifval($1,$1,-option) %% no, obsolete" dnl new GCC
856
do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
857
AC_TRY_COMPILE([],[return 0;],
858
[VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
860
FLAGS="$ac_save_[]FLAGS"
864
.ok|.ok,*) m4_ifvaln($3,$3) ;;
865
.|.no|.no,*) m4_ifvaln($4,$4) ;;
867
if echo " $[]m4_ifval($2,$2,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
868
then AC_RUN_LOG([: m4_ifval($2,$2,FLAGS) does contain $VAR])
869
else AC_RUN_LOG([: m4_ifval($2,$2,FLAGS)="$m4_ifval($2,$2,FLAGS) $VAR"])
870
m4_ifval($2,$2,FLAGS)="$m4_ifval($2,$2,FLAGS) $VAR"
873
AS_VAR_POPDEF([VAR])dnl
874
AS_VAR_POPDEF([FLAGS])dnl
878
dnl the only difference - the LANG selection... and the default FLAGS
880
AC_DEFUN([AX_CXXFLAGS_GCC_OPTION_NEW], [dnl
881
AS_VAR_PUSHDEF([FLAGS],[CXXFLAGS])dnl
882
AS_VAR_PUSHDEF([VAR],[ac_cv_cxxflags_gcc_option_$1])dnl
883
AC_CACHE_CHECK([m4_ifval($2,$2,FLAGS) for gcc m4_ifval($1,$1,-option)],
884
VAR,[VAR="no, unknown"
887
ac_save_[]FLAGS="$[]FLAGS"
889
in "-pedantic -Werror % m4_ifval($1,$1,-option)" dnl GCC
890
"-pedantic % m4_ifval($1,$1,-option) %% no, obsolete" dnl new GCC
892
do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
893
AC_TRY_COMPILE([],[return 0;],
894
[VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
896
FLAGS="$ac_save_[]FLAGS"
900
.ok|.ok,*) m4_ifvaln($3,$3) ;;
901
.|.no|.no,*) m4_ifvaln($4,$4) ;;
903
if echo " $[]m4_ifval($2,$2,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
904
then AC_RUN_LOG([: m4_ifval($2,$2,FLAGS) does contain $VAR])
905
else AC_RUN_LOG([: m4_ifval($2,$2,FLAGS)="$m4_ifval($2,$2,FLAGS) $VAR"])
906
m4_ifval($2,$2,FLAGS)="$m4_ifval($2,$2,FLAGS) $VAR"
909
AS_VAR_POPDEF([VAR])dnl
910
AS_VAR_POPDEF([FLAGS])dnl
913
AC_DEFUN([AX_CFLAGS_GCC_OPTION],[ifelse(m4_bregexp([$2],[-]),-1,
914
[AX_CFLAGS_GCC_OPTION_NEW($@)],[AX_CFLAGS_GCC_OPTION_OLD($@)])])
916
AC_DEFUN([AX_CXXFLAGS_GCC_OPTION],[ifelse(m4_bregexp([$2],[-]),-1,
917
[AX_CXXFLAGS_GCC_OPTION_NEW($@)],[AX_CXXFLAGS_GCC_OPTION_OLD($@)])])