autoconf
[Top][All Lists]
Advanced

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

--with-arg by default


From: Adam Mercer
Subject: --with-arg by default
Date: Tue, 28 Jul 2009 17:03:40 +0100

Hi

At the moment I have a --with argument that is off by default and I
would like to change this so that is on by default and users will need
to configure using --without-arg or --with-arg=no to disable the
feature, essentially adding a lot of strict warning flags. I currently
define the option using:

AC_DEFUN([LAL_WITH_GCC_FLAGS],
[AC_ARG_WITH(
  [gcc_flags],
  AC_HELP_STRING([--with-gcc-flags],[turn on strict gcc warning flags]),
  [ if test -n "${with_gcc_flags}"
    then
      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
    else
      lal_gcc_flags=""
    fi
  ], [ lal_gcc_flags="" ] )
])

and then call it in configure.ac with:

LAL_WITH_GCC_FLAGS

then just before AC_OUTPUT, so that the flags don't interfere with
compiler tests, I have the following:

if test "$GCC" = yes; then
  CFLAGS="$CFLAGS $lal_gcc_flags"
fi

So to modify this to be on by default I am planning to just add the
flags in the "action-if-not-given" section of AC_ARG_WITH? Is this the
best way to accomplish this or is there a better way to use default
with args?

Cheers

Adam




reply via email to

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