diff options
author | Hans Ulrich Niedermann <gp@n-dimensional.de> | 2006-12-28 10:14:43 +0000 |
---|---|---|
committer | Hans Ulrich Niedermann <gp@n-dimensional.de> | 2006-12-28 10:14:43 +0000 |
commit | 32a0e080b6bcd59b2af02b5d779d21b538263120 (patch) | |
tree | 3969eaca90912e6bdac722ed79c2ae7428b1533d /configure.ac | |
parent | c0566daaeb33f89964fdfd2cd6fe2c725ebbde76 (diff) | |
download | libgphoto2-32a0e080b6bcd59b2af02b5d779d21b538263120.tar.gz |
Define AC_C{PP,}FLAGS before doing compile tests, and use them for the compile tests
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@9752 67ed7778-7388-44ab-90cf-0a291f65f57c
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 58 |
1 files changed, 33 insertions, 25 deletions
diff --git a/configure.ac b/configure.ac index ecefdfab9..b94bc91df 100644 --- a/configure.ac +++ b/configure.ac @@ -87,6 +87,39 @@ dnl sequence seems to get mixed up. SED=${SED-sed} +dnl --------------------------------------------------------------------------- +dnl Turn on (almost) all warnings when using gcc +dnl --------------------------------------------------------------------------- +if test "x$GCC" = "xyes"; then + AM_CPPFLAGS="$AM_CPPFLAGS -Wall" + AM_CFLAGS="$AM_CFLAGS --std=c99 -Wall -Wextra -Werror -Wno-pointer-sign -Wno-unused -Wno-sign-compare" # -pedantic" + AM_CFLAGS="$AM_CFLAGS -Wmissing-declarations -Wmissing-prototypes -Wno-pointer-sign" + AM_LDFLAGS="$AM_LDFLAGS -Wall" + # FIXME: Check for --enable-debug here + AM_CPPFLAGS="$AM_CPPFLAGS -g" + AM_LDFLAGS="$AM_LDFLAGS -g" + AC_SUBST([NO_UNUSED_CFLAGS], [-Wno-unused]) +fi +AM_CONDITIONAL([HAVE_GCC], [test "x$GCC" = "xyes"]) + +AM_CPPFLAGS="$AM_CPPFLAGS -D_GPHOTO2_INTERNAL_CODE" + +# CPPFLAGS: C PreProcessor flags +AC_SUBST([AM_CPPFLAGS]) +# CFLAGS: C compiler flags +AC_SUBST([AM_CFLAGS]) +# CXXFLAGS: C++ compiler flags +AC_SUBST([AM_CXXFLAGS]) +# LDFLAGS: Linker flags +AC_SUBST([AM_LDFLAGS]) + +# Define compiler flags for later compile tests +# Note: Do NOT add specific libraries and stuff to the generic _FLAGS. +# Put these into LIBFOO_CFLAGS and LIBFOO_LIBS instead. +CFLAGS="$AM_CFLAGS" +CPPFLAGS="$AM_CPPFLAGS" + + try_gp2ddb=false msg_gp2ddb="" gp_msg_dp2ddb="no" @@ -496,34 +529,9 @@ AC_PATH_PROG(LIBUSB_CONFIG,libusb-config) AM_CONDITIONAL(HAVE_LIBUSB,test -n "${LIBUSB_CONFIG}") -dnl --------------------------------------------------------------------------- -dnl Turn on (almost) all warnings when using gcc -dnl --------------------------------------------------------------------------- -if test "x$GCC" = "xyes"; then - AM_CPPFLAGS="$AM_CPPFLAGS -Wall" - AM_CFLAGS="$AM_CFLAGS -Wmissing-declarations -Wmissing-prototypes -Wno-pointer-sign" - AM_LDFLAGS="$AM_LDFLAGS -Wall" - # FIXME: Check for --enable-debug here - AM_CPPFLAGS="$AM_CPPFLAGS -g" - AM_LDFLAGS="$AM_LDFLAGS -g" - AC_SUBST([NO_UNUSED_CFLAGS], [-Wno-unused]) -fi -AM_CONDITIONAL([HAVE_GCC], [test "x$GCC" = "xyes"]) - -AM_CPPFLAGS="$AM_CPPFLAGS -D_GPHOTO2_INTERNAL_CODE" - dnl FIXME: Is this accurate? AM_CONDITIONAL([HAVE_CXX], [test -n "$CXX" && test "X$CXX" != "Xno"]) -# CPPFLAGS: C PreProcessor flags -AC_SUBST([AM_CPPFLAGS]) -# CFLAGS: C compiler flags -AC_SUBST([AM_CFLAGS]) -# CXXFLAGS: C++ compiler flags -AC_SUBST([AM_CXXFLAGS]) -# LDFLAGS: Linker flags -AC_SUBST([AM_LDFLAGS]) - dnl --------------------------------------------------------------------------- dnl Configure subprojects |