From: Rocky B. <ro...@us...> - 2003-04-10 04:27:42
|
Update of /cvsroot/xine/xine-vcdnav In directory sc8-pr-cvs1:/tmp/cvs-serv29739 Modified Files: Tag: cdio-branch configure.ac Log Message: Use better C warning flags. Index: configure.ac =================================================================== RCS file: /cvsroot/xine/xine-vcdnav/configure.ac,v retrieving revision 1.9.2.3 retrieving revision 1.9.2.4 diff -u -r1.9.2.3 -r1.9.2.4 --- configure.ac 4 Apr 2003 00:36:27 -0000 1.9.2.3 +++ configure.ac 10 Apr 2003 04:27:39 -0000 1.9.2.4 @@ -77,6 +77,49 @@ dnl --------------------------------------------- AC_ISC_POSIX AC_PROG_CC + +if test "x$GCC" != "xyes" +then + echo "*** non GNU CC compiler detected." + echo "*** This package has not been tested very well with non GNU compilers" + echo "*** you should try to use 'gcc' for compiling this package." + dnl Flags not supported by all *cc* variants + AC_TRY_CFLAGS("-Wall", wall="-Wall", wall="") +else + WARN_CFLAGS="-Wall -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -Wunused -Wpointer-arith -Wwrite-strings -Wnested-externs -Wsign-promo -Wno-sign-compare" + + warning_flags="" + + if test "x$enable_maintainer_mode" = "xyes"; then + WOPT="-std=c99 -pedantic" + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $WOPT" + AC_MSG_CHECKING([whether $CC accepts $WOPT]) + AC_TRY_COMPILE([], [], + [has_option=yes; warning_flags="$warning_flags $WOPT"], + has_option=no) + CFLAGS="$SAVE_CFLAGS" + AC_MSG_RESULT($has_option) + fi + + for WOPT in $WARN_CFLAGS; do + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $WOPT" + AC_MSG_CHECKING([whether $CC accepts $WOPT]) + AC_TRY_COMPILE([], [], has_option=yes, has_option=no) + CFLAGS="$SAVE_CFLAGS" + AC_MSG_RESULT($has_option) + if test "x$has_option" = "xyes"; then + warning_flags="$warning_flags $WOPT" + fi + unset has_option + unset SAVE_CFLAGS + done + unset WOPT + WARN_CFLAGS="$warning_flags" + unset warning_flags +fi + AC_STDC_HEADERS AC_PROG_MAKE_SET AC_PROG_INSTALL @@ -204,13 +247,10 @@ [AC_MSG_RESULT([*** (S)VCD support will be disabled ***])]) AM_CONDITIONAL(HAVE_CDROM_IOCTLS, [test x"$have_cdrom_ioctls" = "xyes"]) -dnl Flags not supported by all *cc* variants -AC_TRY_CFLAGS("-Wall", wall="-Wall", wall="") - dnl Common cflags for all platforms dnl NOTE: some options like -D_FILE_OFFSET_BITS and -D_LARGEFILE64_SOURCE dnl have to match those in xine-lib -COMMON_CFLAGS="$wall -g -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -DINPUT_DEBUG" +COMMON_CFLAGS="$WARN_CFLAGS -g -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -DINPUT_DEBUG" dnl The notion that configure should customize compiler optimization dnl options is utter crap. |