Commit a42b5cdb authored by Adam Mercer's avatar Adam Mercer
Browse files

clang: pass -Qunused-arguments to the linker

this silences errors/warnings from clang when it doesn't recognise
compiler flags, such as -lpthread
Original: 8c398b9e468c70ea3de5c78be1475467cb9abf45
parent 313f53a9
# lalsuite_gccflags.m4 - macros to set strict gcc flags
#
# serial 8
# serial 9
AC_DEFUN([LALSUITE_ENABLE_GCC_FLAGS],
[AC_ARG_ENABLE([gcc_flags],
......@@ -43,3 +43,24 @@ AC_DEFUN([DO_ENABLE_LALSUITE_GCC_FLAGS],
# *) lal_gcc_flags="${lal_gcc_flags} -pedantic-errors" ;;
# esac
])
AC_DEFUN([LALSUITE_ADD_GCC_FLAGS],
[
if test "x${GCC}" = "xyes"; then
# don't use gcc flags when cuda is enabled
if test "x${cuda}" = "xtrue"; then
AC_MSG_NOTICE([CUDA support is enabled, disabling GCC flags])
else
CFLAGS="${CFLAGS} ${lal_gcc_flags}"
fi
# add mac os x specific flags
if test "x${MACOSX_VERSION}" != "x"; then
CFLAGS="${CFLAGS} -mmacosx-version-min=10.4"
fi
# ignore unused flags with clang/clang++
AS_IF([test -n "${CLANG_CC}"], [CFLAGS="${CFLAGS} -Xcompiler -Qunused-arguments"])
AS_IF([test -n "${CLANG_CXX}"], [CXXFLAGS="${CXXFLAGS} -Xcompiler -Qunused-arguments"])
fi
])
......@@ -368,19 +368,7 @@ AM_CONDITIONAL([INTELFFT],[test x$intelfft = xtrue])
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
# 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
CFLAGS="$CFLAGS -mmacosx-version-min=10.4"
fi
fi
LALSUITE_ADD_GCC_FLAGS
# force all python modules into the exec dir to prevent mixed C and
# pure-python library code from being split across lib and lib64 on
......
......@@ -421,19 +421,7 @@ AC_CHECK_FUNCS([setenv])
AC_DEFINE_UNQUOTED([PREFIX],["$prefix"],[Install prefix])
# add gcc specific flags
if test "$GCC" = yes; then
# 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
CFLAGS="$CFLAGS -mmacosx-version-min=10.4"
fi
fi
LALSUITE_ADD_GCC_FLAGS
# define if CUDA is enabled
if test "${cuda}" = "true"; then
......
......@@ -128,14 +128,7 @@ LALSUITE_CHECK_LIB([LALMetaIO],[1.0.4],[XLALCreateMetaTableDir],[lal/LIGOLwXMLRe
LALSUITE_CHECK_LIB([LALSimulation],[0.3.0],[XLALSimDetectorStrainREAL8TimeSeries],[lal/LALSimulation.h])
# add gcc specific flags
if test "$GCC" = yes; then
CFLAGS="$CFLAGS $lal_gcc_flags"
# add mac os x specific flags
if test "x$MACOSX_VERSION" != "x"; then
CFLAGS="$CFLAGS -mmacosx-version-min=10.4"
fi
fi
LALSUITE_ADD_GCC_FLAGS
# force all python modules into the exec dir to prevent mixed C and
# pure-python library code from being split across lib and lib64 on
......
......@@ -95,9 +95,6 @@ LALSUITE_PROG_CC_CXX
AX_PTHREAD([lalframe_pthread=true],[lalframe_pthread=false])
AM_CONDITIONAL([PTHREAD],[test x$lalframe_pthread = xtrue])
# ignore unused flags with clang/clang++
AS_IF([test -n "$CLANG_CC"],[CFLAGS="-Qunused-arguments ${CFLAGS}"])
# checks for programs
AC_PROG_INSTALL
AC_PROG_LN_S
......@@ -151,14 +148,7 @@ LALSUITE_USE_SWIG([XLAL LAL])
LALSUITE_SWIG_DEPENDS([lal],[true])
# add gcc specific flags
if test "$GCC" = yes; then
CFLAGS="$CFLAGS $lal_gcc_flags"
# add mac os x specific flags
if test "x$MACOSX_VERSION" != "x"; then
CFLAGS="$CFLAGS -mmacosx-version-min=10.4"
fi
fi
LALSUITE_ADD_GCC_FLAGS
# force all python modules into the exec dir to prevent mixed C and
# pure-python library code from being split across lib and lib64 on
......
......@@ -148,14 +148,7 @@ LALSUITE_CHECK_LIB([LALPulsar],[1.4.0],[XLALComputeFaFb],[lal/ComputeFstat.h])
LALSUITE_CHECK_OPT_LIB([LALXML],[1.1.3],[XLALXMLFilePrintElements],[lal/LALXML.h])
# add gcc specific flags
if test "$GCC" = yes; then
CFLAGS="$CFLAGS $lal_gcc_flags"
# add mac os x specific flags
if test "x$MACOSX_VERSION" != "x"; then
CFLAGS="$CFLAGS -mmacosx-version-min=10.4"
fi
fi
LALSUITE_ADD_GCC_FLAGS
# output
LAL_HEADER_LINK=${ac_aux_dir}/header-link.mk
......
......@@ -154,19 +154,7 @@ LALSUITE_USE_SWIG([XLAL LAL])
LALSUITE_SWIG_DEPENDS([lal],[true])
# add gcc specific flags
if test "$GCC" = yes; then
# 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
CFLAGS="$CFLAGS -mmacosx-version-min=10.4"
fi
fi
LALSUITE_ADD_GCC_FLAGS
# define if CUDA is enabled
if test "${cuda}" = "true"; then
......
......@@ -114,14 +114,7 @@ LALSUITE_CHECK_LIB([LAL],[6.7.0],[LALVersion],[lal/LALStdio.h])
LALSUITE_CHECK_LIB([LALSupport],[6.7.0],[LALOpenDataFile],[lal/FileIO.h])
# add gcc specific flags
if test "$GCC" = yes; then
CFLAGS="$CFLAGS $lal_gcc_flags"
# add mac os x specific flags
if test "x$MACOSX_VERSION" != "x"; then
CFLAGS="$CFLAGS -mmacosx-version-min=10.4"
fi
fi
LALSUITE_ADD_GCC_FLAGS
# output
LAL_HEADER_LINK=${ac_aux_dir}/header-link.mk
......
......@@ -162,14 +162,7 @@ LALSUITE_SWIG_DEPENDS([lal],[true])
LALSUITE_SWIG_DEPENDS([lalxml],[$lalxml])
# add gcc specific flags
if test "$GCC" = yes; then
CFLAGS="$CFLAGS $lal_gcc_flags"
# add mac os x specific flags
if test "x$MACOSX_VERSION" != "x"; then
CFLAGS="$CFLAGS -mmacosx-version-min=10.4"
fi
fi
LALSUITE_ADD_GCC_FLAGS
# force all python modules into the exec dir to prevent mixed C and
# pure-python library code from being split across lib and lib64 on
......
......@@ -134,14 +134,7 @@ LALSUITE_USE_SWIG([XLAL LAL])
LALSUITE_SWIG_DEPENDS([lal],[true])
# add gcc specific flags
if test "$GCC" = yes; then
CFLAGS="$CFLAGS $lal_gcc_flags"
# add mac os x specific flags
if test "x$MACOSX_VERSION" != "x"; then
CFLAGS="$CFLAGS -mmacosx-version-min=10.4"
fi
fi
LALSUITE_ADD_GCC_FLAGS
# force all python modules into the exec dir to prevent mixed C and
# pure-python library code from being split across lib and lib64 on
......
......@@ -115,14 +115,7 @@ LALSUITE_CHECK_LIB([LALSupport],[6.7.0],[LALOpenDataFile],[lal/FileIO.h])
LALSUITE_CHECK_LIB([LALMetaIO],[1.0.4],[XLALCreateMetaTableDir],[lal/LIGOLwXMLRead.h])
# add gcc specific flags
if test "$GCC" = yes; then
CFLAGS="$CFLAGS $lal_gcc_flags"
# add mac os x specific flags
if test "x$MACOSX_VERSION" != "x"; then
CFLAGS="$CFLAGS -mmacosx-version-min=10.4"
fi
fi
LALSUITE_ADD_GCC_FLAGS
# output
LAL_HEADER_LINK=${ac_aux_dir}/header-link.mk
......
......@@ -135,14 +135,7 @@ LALSUITE_USE_SWIG([XLAL LAL])
LALSUITE_SWIG_DEPENDS([lal],[true])
# add gcc specific flags
if test "$GCC" = yes; then
CFLAGS="$CFLAGS $lal_gcc_flags"
# add mac os x specific flags
if test "x$MACOSX_VERSION" != "x"; then
CFLAGS="$CFLAGS -mmacosx-version-min=10.4"
fi
fi
LALSUITE_ADD_GCC_FLAGS
# output
LAL_HEADER_LINK=${ac_aux_dir}/header-link.mk
......
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