autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: --with-arg by default


From: Steffen Dettmer
Subject: Re: --with-arg by default
Date: Wed, 29 Jul 2009 11:29:04 +0200

you would have flag list redundant and it could happen someone will
forget to change one place when adding next flag...
so maybe just call a function?

the withval isn't used? Wouldn't it be --enable-FEATURE then?

oki,

Steffen




dnl surely my example is wrong (quoting, ...) and not portable, I
dnl don't know the details.
dnl
dnl --with-gcc_flags? maybe better configure CFLAGS=xyz?
AC_DEFUN([LAL_WITH_GCC_FLAGS],
  [AC_ARG_WITH([gcc_flags],AC_HELP_STRING([--x],[y]),
  [case $withval in
    yes)
      DO_ENABLE_LAL_WITH_GCC_FLAGS;;
    no)
      ;;
    *)
      DO_ENABLE_LAL_WITH_GCC_FLAGS($withval);;
  esac ],
  [ DO_ENABLE_LAL_WITH_GCC_FLAGS; ] )
])
dnl Sets several specific flags to variable lal_gcc_flags
AC_DEFUN([DO_ENABLE_LAL_WITH_GCC_FLAGS],
[
   lal_gcc_flags="-g3 -O4 -Wall -W -Wmissing-prototypes
-Wstrict-prototypes -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align
-Wwrite-strings -fno-common -Wnested-externs -Wno-format-zero-length"
     case $host_cpu-$host_os in
       *i386-darwin*) lal_gcc_flags="${lal_gcc_flags} -pedantic" ;;
       *) lal_gcc_flags="${lal_gcc_flags} -pedantic-errors" ;;
     esac
  dnl setting CFLAGS is not indended by autoconf. Users should
  dnl   set it if they want this (however, then they must set them all
  dnl   and know compiler details etc).
  dnl In "else" at least an "compiler not supported" or "option
  dnl   not supported" should be added when lal_gcc_flags is set.
  if test "$GCC" = yes; then
    CFLAGS="$CFLAGS $lal_gcc_flags"
  fi
])




reply via email to

[Prev in Thread] Current Thread [Next in Thread]