Browse Source

Make GCC compiler flags default to -O

* m4/cc.m4: New file...
* configure.ac: ...used here.
* autoconf/aclocal.m4: Regenerate.
master
Richard Kreckel 20 years ago
parent
commit
95464ffca5
  1. 7
      ChangeLog
  2. 1
      autoconf/aclocal.m4
  3. 4
      configure.ac
  4. 33
      m4/cc.m4

7
ChangeLog

@ -1,3 +1,10 @@
2005-04-24 Richard B. Kreckel <kreckel@ginac.de>
Make GCC compiler flags default to -O
* m4/cc.m4: New file...
* configure.ac: ...used here.
* autoconf/aclocal.m4: Regenerate.
2005-04-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> 2005-04-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* include/cln/string.h: Declare cl_string. * include/cln/string.h: Declare cl_string.

1
autoconf/aclocal.m4

@ -868,5 +868,6 @@ fi
fi fi
]) ])
m4_include([m4/cc.m4])
m4_include([m4/gmp.m4]) m4_include([m4/gmp.m4])
m4_include([m4/libtool.m4]) m4_include([m4/libtool.m4])

4
configure.ac

@ -41,11 +41,11 @@ d
dnl dnl
dnl checks for programs dnl checks for programs
dnl dnl
AC_PROG_CC
CL_PROG_CC
dnl sets variable CC dnl sets variable CC
AC_PROG_CPP AC_PROG_CPP
dnl sets variable CPP dnl sets variable CPP
AC_PROG_CXX
CL_PROG_CXX
dnl sets variable CXX dnl sets variable CXX
AC_PROG_CXXCPP AC_PROG_CXXCPP
dnl sets variable CXXCPP dnl sets variable CXXCPP

33
m4/cc.m4

@ -0,0 +1,33 @@
dnl The CLN manual says that without CFLAGS or CXXFLAGS being set compilation
dnl will happen with -O. However, AC_PROG_CC and AC_PROG_CXX set CFLAGS and
dnl CXXFLAGS to "-g -O2", which produces way too large binaries.
dnl Wrapper around AC_PROG_CC setting CFLAGS to plain "-O" as opposed to
dnl "-g -O2" for the GNU compiler (unless CFLAGS was set before).
AC_DEFUN([CL_PROG_CC],
[cl_test_CFLAGS=${CFLAGS+set}
cl_save_CFLAGS=$CFLAGS
# Make sure this macro does not come after AC_PROG_CC.
# Otherwise CFLAGS would already be set.
AC_BEFORE([$0],[AC_PROG_CC])dnl
AC_PROG_CC([$1])
if test "$cl_test_CFLAGS" != set && test "$ac_compiler_gnu" = yes; then
CFLAGS="-O"
fi
])
dnl Wrapper around AC_PROG_CXX setting CXXFLAGS to plain "-O" as opposed to
dnl "-g -O2" for the GNU compiler (unless CXXFLAGS was set before).
AC_DEFUN([CL_PROG_CXX],
[cl_test_CXXFLAGS=${CXXFLAGS+set}
cl_save_CXXFLAGS=$CXXFLAGS
# Make sure this macro does not come after AC_PROG_CXX.
# Otherwise CXXFLAGS would already be set.
AC_BEFORE([$0],[AC_PROG_CXX])dnl
AC_PROG_CXX([$1])
if test "$cl_test_CXXFLAGS" != set && test "$ac_compiler_gnu" = yes; then
CXXFLAGS="-O"
fi
])
Loading…
Cancel
Save