configure.ac, support external CFLAGS specification
allow to overide CFLAGS like this: CFLAGS=something ./configure ./configure CFLAGS=something empty CFLAGS are allowed too, like this CFLAGS="" ./configure ./configure CFLAGS="" otherwise use our longish builtin default CFLAGS ./configure
This commit is contained in:
parent
6f89395d8a
commit
9a827a68b9
31
configure.ac
31
configure.ac
|
|
@ -32,6 +32,10 @@ AC_CONFIG_HEADER([src/include/ngspice/config.h])
|
||||||
AM_INIT_AUTOMAKE([-Wall -Werror nostdinc])
|
AM_INIT_AUTOMAKE([-Wall -Werror nostdinc])
|
||||||
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
|
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
|
||||||
|
|
||||||
|
ext_CFLAGS="${CFLAGS+yes}"
|
||||||
|
|
||||||
|
AC_PROG_CC
|
||||||
|
|
||||||
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
|
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
|
||||||
|
|
||||||
AC_SUBST([AM_CPPFLAGS], ['-I. -I$(srcdir) -I$(top_builddir)/src/include'])
|
AC_SUBST([AM_CPPFLAGS], ['-I. -I$(srcdir) -I$(top_builddir)/src/include'])
|
||||||
|
|
@ -197,29 +201,32 @@ AM_MAINTAINER_MODE
|
||||||
# Compiler checks
|
# Compiler checks
|
||||||
# ---------------
|
# ---------------
|
||||||
|
|
||||||
ext_CFLAGS="$CFLAGS"
|
|
||||||
|
|
||||||
AC_PROG_CC
|
|
||||||
|
|
||||||
# Work on compiler options according to system:
|
# Work on compiler options according to system:
|
||||||
# Set default CFLAGS - only use -Wall if we have gcc
|
# Set default CFLAGS - only use -Wall if we have gcc
|
||||||
|
|
||||||
# the above AC_PROG_CC may set CFLAGS to "-O2 -g"
|
# the above AC_PROG_CC may set CFLAGS to "-O2 -g"
|
||||||
if test "x$enable_debug" = xno; then
|
if test "x$ext_CFLAGS" != xyes; then
|
||||||
|
|
||||||
|
if test "x$enable_debug" = xno; then
|
||||||
|
AC_MSG_WARN([Removing debugging option!])
|
||||||
if test "x$GCC" = xyes; then
|
if test "x$GCC" = xyes; then
|
||||||
AC_MSG_WARN([Removing debugging option!])
|
CFLAGS="-O2 -s"
|
||||||
CFLAGS="-O2 -Wall -Wextra -Wmissing-prototypes -Wstrict-prototypes -Wnested-externs -Wold-style-definition -Wredundant-decls -Wconversion -s $ext_CFLAGS"
|
|
||||||
else
|
else
|
||||||
AC_MSG_WARN([Removing debugging option!])
|
CFLAGS="-O2"
|
||||||
CFLAGS="-O2 $ext_CFLAGS"
|
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
AC_DEFINE([NGDEBUG], [1], [Compile with debug info])
|
AC_DEFINE([NGDEBUG], [1], [Compile with debug info])
|
||||||
if test "x$GCC" = xyes; then
|
if test "x$GCC" = xyes; then
|
||||||
CFLAGS="-g -O1 -Wall -Wextra -Wmissing-prototypes -Wstrict-prototypes -Wnested-externs -Wold-style-definition -Wredundant-decls -Wconversion $ext_CFLAGS"
|
CFLAGS="-g -O1"
|
||||||
else
|
else
|
||||||
CFLAGS="-g $ext_CFLAGS"
|
CFLAGS="-g"
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test "x$GCC" = xyes; then
|
||||||
|
CFLAGS="$CFLAGS -Wall -Wextra -Wmissing-prototypes -Wstrict-prototypes -Wnested-externs -Wold-style-definition -Wredundant-decls -Wconversion"
|
||||||
|
fi
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# the profiling option
|
# the profiling option
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue