Search
lxdream.org :: lxdream :: r987:3bd03f1ce0a7
lxdream 0.9.1
released Jun 29
Download Now
changeset987:3bd03f1ce0a7
parent986:5090104b0963
child988:23c648e10db3
authornkeynes
dateWed Feb 25 08:50:22 2009 +0000 (11 years ago)
Add explicit c99-compliance check for linux/cdrom.h - some kernel versions/arches have
broken headers and need to be compiled with -std=gnu99 rather than -std=c99
configure
configure.in
src/Makefile.am
src/Makefile.in
1.1 --- a/configure Tue Feb 24 11:50:17 2009 +0000
1.2 +++ b/configure Wed Feb 25 08:50:22 2009 +0000
1.3 @@ -7764,6 +7764,7 @@
1.4 _ACEOF
1.5
1.6
1.7 +STDCFLAG="-std=c99"
1.8
1.9 _GCC_VERSION=`$CC --version | $SED -ne '/gcc/p'`
1.10 _ICC_VERSION=`$CC --version | $SED -ne '/(ICC)/p'`
1.11 @@ -7773,12 +7774,12 @@
1.12 { $as_echo "$as_me:$LINENO: result: ICC" >&5
1.13 $as_echo "ICC" >&6; }
1.14 CCOPT="$CFLAGS -fast"
1.15 - CFLAGS="$CFLAGS -fno-strict-aliasing -std=c99"
1.16 + CFLAGS="$CFLAGS -fno-strict-aliasing"
1.17 elif test -n "$_GCC_VERSION"; then
1.18 { $as_echo "$as_me:$LINENO: result: GCC" >&5
1.19 $as_echo "GCC" >&6; }
1.20 CCOPT="-O2 -msse2 -mfpmath=sse"
1.21 - CFLAGS="$CFLAGS -fno-strict-aliasing -std=c99"
1.22 + CFLAGS="$CFLAGS -fno-strict-aliasing"
1.23 else
1.24 { $as_echo "$as_me:$LINENO: result: Unknown" >&5
1.25 $as_echo "Unknown" >&6; }
1.26 @@ -10374,7 +10375,60 @@
1.27
1.28 fi
1.29 if test $ac_cv_header_linux_cdrom_h = yes; then
1.30 - CDROM_DRIVER=linux
1.31 +
1.32 + CDROM_DRIVER=linux
1.33 + { $as_echo "$as_me:$LINENO: checking C99 compliant kernel headers" >&5
1.34 +$as_echo_n "checking C99 compliant kernel headers... " >&6; }
1.35 + old_CFLAGS="$CFLAGS"
1.36 + CFLAGS="$CFLAGS $STDCFLAG"
1.37 + cat >conftest.$ac_ext <<_ACEOF
1.38 +/* confdefs.h. */
1.39 +_ACEOF
1.40 +cat confdefs.h >>conftest.$ac_ext
1.41 +cat >>conftest.$ac_ext <<_ACEOF
1.42 +/* end confdefs.h. */
1.43 +#include <linux/cdrom.h>
1.44 +int
1.45 +main ()
1.46 +{
1.47 +
1.48 + ;
1.49 + return 0;
1.50 +}
1.51 +_ACEOF
1.52 +rm -f conftest.$ac_objext
1.53 +if { (ac_try="$ac_compile"
1.54 +case "(($ac_try" in
1.55 + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1.56 + *) ac_try_echo=$ac_try;;
1.57 +esac
1.58 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
1.59 +$as_echo "$ac_try_echo") >&5
1.60 + (eval "$ac_compile") 2>conftest.er1
1.61 + ac_status=$?
1.62 + grep -v '^ *+' conftest.er1 >conftest.err
1.63 + rm -f conftest.er1
1.64 + cat conftest.err >&5
1.65 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
1.66 + (exit $ac_status); } && {
1.67 + test -z "$ac_c_werror_flag" ||
1.68 + test ! -s conftest.err
1.69 + } && test -s conftest.$ac_objext; then
1.70 + { $as_echo "$as_me:$LINENO: result: Yes" >&5
1.71 +$as_echo "Yes" >&6; }
1.72 +else
1.73 + $as_echo "$as_me: failed program was:" >&5
1.74 +sed 's/^/| /' conftest.$ac_ext >&5
1.75 +
1.76 +
1.77 + { $as_echo "$as_me:$LINENO: result: No" >&5
1.78 +$as_echo "No" >&6; }
1.79 + STDCFLAG="-std=gnu99"
1.80 +fi
1.81 +
1.82 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
1.83 + CFLAGS="$old_CFLAGS"
1.84 +
1.85 else
1.86 true
1.87 fi
1.88 @@ -10972,6 +11026,7 @@
1.89 fi
1.90
1.91
1.92 +CFLAGS="$CFLAGS $STDCFLAG"
1.93
1.94 GETTEXT_PACKAGE=lxdream
1.95
2.1 --- a/configure.in Tue Feb 24 11:50:17 2009 +0000
2.2 +++ b/configure.in Wed Feb 25 08:50:22 2009 +0000
2.3 @@ -97,10 +97,11 @@
2.4 OBJCFLAGS="-g -fexceptions"
2.5 AC_DEFINE(HAVE_EXCEPTIONS, [1], [Have exception stack-frame information])
2.6
2.7 +STDCFLAG="-std=c99"
2.8 AC_CC_VERSION([ CCOPT="-O2 -msse2 -mfpmath=sse"
2.9 - CFLAGS="$CFLAGS -fno-strict-aliasing -std=c99" ],
2.10 + CFLAGS="$CFLAGS -fno-strict-aliasing" ],
2.11 [ CCOPT="$CFLAGS -fast"
2.12 - CFLAGS="$CFLAGS -fno-strict-aliasing -std=c99" ],
2.13 + CFLAGS="$CFLAGS -fno-strict-aliasing" ],
2.14 [ CCOPT="$CFLAGS -O2" ])
2.15
2.16 if test "x$enable_optimized" = "xyes"; then
2.17 @@ -276,7 +277,17 @@
2.18
2.19
2.20 dnl Check for native cdrom support. There can be only one.
2.21 -AC_CHECK_HEADER([linux/cdrom.h], [CDROM_DRIVER=linux], [true])
2.22 +AC_CHECK_HEADER([linux/cdrom.h], [
2.23 + CDROM_DRIVER=linux
2.24 + dnl Some kernel versions have non-c99 compliant headers - check here
2.25 + AC_MSG_CHECKING([C99 compliant kernel headers])
2.26 + old_CFLAGS="$CFLAGS"
2.27 + CFLAGS="$CFLAGS $STDCFLAG"
2.28 + AC_TRY_COMPILE([#include <linux/cdrom.h>], [], [AC_MSG_RESULT([Yes])], [
2.29 + AC_MSG_RESULT([No])
2.30 + STDCFLAG="-std=gnu99"])
2.31 + CFLAGS="$old_CFLAGS"
2.32 +], [true])
2.33 AC_CHECK_HEADER([IOKit/IOKitLib.h], [
2.34 CDROM_DRIVER=osx
2.35 LIBS="$LIBS -framework IOKit"],[true])
2.36 @@ -313,6 +324,7 @@
2.37 AM_CONDITIONAL(BUILD_SYSTEST, [test "$BUILD_SH" = "yes"])
2.38 AM_CONDITIONAL(BUILD_ARMTEST, [test "$BUILD_ARM" = "yes"])
2.39
2.40 +CFLAGS="$CFLAGS $STDCFLAG"
2.41
2.42 dnl ----------------------- All done, finish up -----------------------
2.43 GETTEXT_PACKAGE=lxdream
3.1 --- a/src/Makefile.am Tue Feb 24 11:50:17 2009 +0000
3.2 +++ b/src/Makefile.am Wed Feb 25 08:50:22 2009 +0000
3.3 @@ -13,7 +13,7 @@
3.4
3.5
3.6 EXTRA_DIST=drivers/genkeymap.pl checkver.pl
3.7 -AM_CFLAGS = -D__EXTENSIONS__ -U__STRICT_ANSI__
3.8 +AM_CFLAGS = -D__EXTENSIONS__
3.9
3.10 .PHONY: checkversion
3.11 checkversion:
4.1 --- a/src/Makefile.in Tue Feb 24 11:50:17 2009 +0000
4.2 +++ b/src/Makefile.in Wed Feb 25 08:50:22 2009 +0000
4.3 @@ -405,7 +405,7 @@
4.4 @GLIB_CFLAGS@ @GTK_CFLAGS@ @LIBPNG_CFLAGS@ @PULSE_CFLAGS@ @ESOUND_CFLAGS@ @ALSA_CFLAGS@
4.5
4.6 EXTRA_DIST = drivers/genkeymap.pl checkver.pl
4.7 -AM_CFLAGS = -D__EXTENSIONS__ -U__STRICT_ANSI__
4.8 +AM_CFLAGS = -D__EXTENSIONS__
4.9 TESTS = test/testxlt
4.10 BUILT_SOURCES = sh4/sh4core.c sh4/sh4dasm.c sh4/sh4x86.c sh4/sh4stat.c \
4.11 pvr2/gl_slsrc.c drivers/mac_keymap.h version.c
.