Commit 0dc0912e authored by Adam Mercer's avatar Adam Mercer
Browse files

use top-level gcc flag macros

use the macros defined in lalsuite_gccflags.m4 for setting the strict
gcc flags, this was there is only a single place to modify the flags and
each sub package uses consistent flags
Original: 51dd0dee31ca35055acf61d683dc5645cec6a78c
parent cdf50761
......@@ -124,7 +124,7 @@ LAL_WITH_EXTRA_LIBS
LAL_ENABLE_INTELFFT
LAL_WITH_CUDA
LALSUITE_ENABLE_BOINC
LAL_ENABLE_GCC_FLAGS
LALSUITE_ENABLE_GCC_FLAGS
LAL_ENABLE_DEBUG
LAL_ENABLE_MACROS
......@@ -381,7 +381,14 @@ AM_CONDITIONAL([QTHREAD],[test x$qthread = xtrue])
# add gcc specific flags --- must be done at end or tests will break!
if test "$GCC" = yes; then
CFLAGS="$CFLAGS $lal_gcc_flags -fno-strict-aliasing"
CFLAGS="$CFLAGS -fno-strict-aliasing"
# don't use gcc flags when cuda is enabled
if test "${cuda}" != "true"; then
CFLAGS="$CFLAGS $lal_gcc_flags"
else
AC_MSG_NOTICE([CUDA support is enabled, disabling GCC flags])
fi
# add mac os x specific flags
if test "x$MACOSX_VERSION" != "x"; then
......
......@@ -10,6 +10,7 @@ EXTRA_DIST = \
lal.m4 \
lalsuite_build.m4 \
lalsuite_c99.m4 \
lalsuite_gccflags.m4 \
libtool.m4 \
ltmain.sh \
ltoptions.m4 \
......
# lal.m4 - lal specific macros
#
# serial 3
AC_DEFUN([LAL_ENABLE_GCC_FLAGS],
[AC_ARG_ENABLE([gcc_flags],
AC_HELP_STRING([--enable-gcc-flags],[turn on strict gcc warning flags (default=yes)]),
[case "${enableval}" in
yes) DO_ENABLE_LAL_GCC_FLAGS;;
no) ;;
*) DO_ENABLE_LAL_GCC_FLAGS;;
esac ],
[ DO_ENABLE_LAL_GCC_FLAGS ] )
])
AC_DEFUN([DO_ENABLE_LAL_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"
if test "${cuda}" != "true"; then
case $host_cpu-$host_os in
*i386-darwin*) lal_gcc_flags="${lal_gcc_flags} -pedantic" ;;
*x86_64-darwin*) lal_gcc_flags="${lal_gcc_flags} -pedantic" ;;
*) lal_gcc_flags="${lal_gcc_flags} -pedantic-errors" ;;
esac
fi
])
# serial 4
AC_DEFUN([LAL_WITH_EXTRA_CPPFLAGS],
[AC_ARG_WITH(
......
../../gnuscripts/lalsuite_gccflags.m4
\ No newline at end of file
......@@ -52,7 +52,7 @@ AC_DEFINE_UNQUOTED([LALBURST_CONFIGURE_DATE],["$lalburst_configure_date"],
[LALBurst Configure Date])
# enable strict gcc flags
LAL_ENABLE_GCC_FLAGS
LALSUITE_ENABLE_GCC_FLAGS
# check for c compiler
m4_pattern_allow([AC_PROG_CC_C99])
......
......@@ -4,9 +4,9 @@ EXTRA_DIST = \
depcomp \
header-link.mk \
install-sh \
lalburst.m4 \
lalsuite_build.m4 \
lalsuite_c99.m4 \
lalsuite_gccflags.m4 \
libtool.m4 \
ltmain.sh \
ltoptions.m4 \
......
# lalburst.m4 - lalburst specific autoconf macros
#
# serial 1
AC_DEFUN([LAL_ENABLE_GCC_FLAGS],
[AC_ARG_ENABLE([gcc_flags],
AC_HELP_STRING([--enable-gcc-flags],[turn on strict gcc warning flags (default=yes)]),
[case "${enableval}" in
yes) DO_ENABLE_LAL_GCC_FLAGS;;
no) ;;
*) DO_ENABLE_LAL_GCC_FLAGS;;
esac ],
[ DO_ENABLE_LAL_GCC_FLAGS ] )
])
AC_DEFUN([DO_ENABLE_LAL_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" ;;
*x86_64-darwin*) lal_gcc_flags="${lal_gcc_flags} -pedantic" ;;
*) lal_gcc_flags="${lal_gcc_flags} -pedantic-errors" ;;
esac
])
../../gnuscripts/lalsuite_gccflags.m4
\ No newline at end of file
......@@ -52,7 +52,7 @@ AC_DEFINE_UNQUOTED([LALFRAME_CONFIGURE_DATE],["$lalframe_configure_date"],
[LALFrame Configure Date])
# enable strict gcc flags
LAL_ENABLE_GCC_FLAGS
LALSUITE_ENABLE_GCC_FLAGS
# check for c compiler
m4_pattern_allow([AC_PROG_CC_C99])
......
......@@ -4,9 +4,9 @@ EXTRA_DIST = \
depcomp \
header-link.mk \
install-sh \
lalframe.m4 \
lalsuite_build.m4 \
lalsuite_c99.m4 \
lalsuite_gccflags.m4 \
libtool.m4 \
ltmain.sh \
ltoptions.m4 \
......
# lalframe.m4 - lalframe specific macros
#
# serial 1
AC_DEFUN([LAL_ENABLE_GCC_FLAGS],
[AC_ARG_ENABLE([gcc_flags],
AC_HELP_STRING([--enable-gcc-flags],[turn on strict gcc warning flags (default=yes)]),
[case "${enableval}" in
yes) DO_ENABLE_LAL_GCC_FLAGS;;
no) ;;
*) DO_ENABLE_LAL_GCC_FLAGS;;
esac ],
[ DO_ENABLE_LAL_GCC_FLAGS ] )
])
AC_DEFUN([DO_ENABLE_LAL_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" ;;
*x86_64-darwin*) lal_gcc_flags="${lal_gcc_flags} -pedantic" ;;
*) lal_gcc_flags="${lal_gcc_flags} -pedantic-errors" ;;
esac
])
../../gnuscripts/lalsuite_gccflags.m4
\ No newline at end of file
......@@ -52,7 +52,7 @@ AC_DEFINE_UNQUOTED([LALINSPIRAL_CONFIGURE_DATE],["$lalinspiral_configure_date"],
[LALInspiral Configure Date])
# enable strict gcc flags
LAL_ENABLE_GCC_FLAGS
LALSUITE_ENABLE_GCC_FLAGS
# optional lal libraries
LALSUITE_ENABLE_LALFRAME
......
......@@ -4,9 +4,9 @@ EXTRA_DIST = \
depcomp \
header-link.mk \
install-sh \
lalinspiral.m4 \
lalsuite_build.m4 \
lalsuite_c99.m4 \
lalsuite_gccflags.m4 \
libtool.m4 \
ltmain.sh \
ltoptions.m4 \
......
# lalinspiral.m4 - lalinspiral autoconf macros
#
# serial 1
AC_DEFUN([LAL_ENABLE_GCC_FLAGS],
[AC_ARG_ENABLE([gcc_flags],
AC_HELP_STRING([--enable-gcc-flags],[turn on strict gcc warning flags (default=yes)]),
[case "${enableval}" in
yes) DO_ENABLE_LAL_GCC_FLAGS;;
no) ;;
*) DO_ENABLE_LAL_GCC_FLAGS;;
esac ],
[ DO_ENABLE_LAL_GCC_FLAGS ] )
])
AC_DEFUN([DO_ENABLE_LAL_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" ;;
*x86_64-darwin*) lal_gcc_flags="${lal_gcc_flags} -pedantic" ;;
*) lal_gcc_flags="${lal_gcc_flags} -pedantic-errors" ;;
esac
])
../../gnuscripts/lalsuite_gccflags.m4
\ No newline at end of file
......@@ -51,7 +51,7 @@ AC_DEFINE_UNQUOTED([LALMETAIO_CONFIGURE_DATE],["$lalmetaio_configure_date"],
[LALMetaIO Configure Date])
# enable strict gcc flags
LAL_ENABLE_GCC_FLAGS
LALSUITE_ENABLE_GCC_FLAGS
# check for c compiler
m4_pattern_allow([AC_PROG_CC_C99])
......
......@@ -4,9 +4,9 @@ EXTRA_DIST = \
depcomp \
header-link.mk \
install-sh \
lalmetaio.m4 \
lalsuite_build.m4 \
lalsuite_c99.m4 \
lalsuite_gccflags.m4 \
libtool.m4 \
ltmain.sh \
ltoptions.m4 \
......
# lalmetaio.m4 - lalmetaio specific macros
#
# serial 1
AC_DEFUN([LAL_ENABLE_GCC_FLAGS],
[AC_ARG_ENABLE([gcc_flags],
AC_HELP_STRING([--enable-gcc-flags],[turn on strict gcc warning flags (default=yes)]),
[case "${enableval}" in
yes) DO_ENABLE_LAL_GCC_FLAGS;;
no) ;;
*) DO_ENABLE_LAL_GCC_FLAGS;;
esac ],
[ DO_ENABLE_LAL_GCC_FLAGS ] )
])
AC_DEFUN([DO_ENABLE_LAL_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" ;;
*x86_64-darwin*) lal_gcc_flags="${lal_gcc_flags} -pedantic" ;;
*) lal_gcc_flags="${lal_gcc_flags} -pedantic-errors" ;;
esac
])
../../gnuscripts/lalsuite_gccflags.m4
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment