From cc9664b3049ebdbcbbf8e9337b9f0cdabbdc4e16 Mon Sep 17 00:00:00 2001 From: Steve Checkoway Date: Tue, 13 Mar 2007 10:04:59 +0000 Subject: [PATCH] Add option -fsigned-char when gcc requires it. Note that AC_TRY_* are obsolete macros and should probably be replaced at some point. --- stepmania/configure.ac | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/stepmania/configure.ac b/stepmania/configure.ac index 12b8320c8a..711bc4fdeb 100644 --- a/stepmania/configure.ac +++ b/stepmania/configure.ac @@ -47,6 +47,17 @@ case $compile in ;; esac + +# Some (broken?) versions of gcc treat char as unsigned, check for that. +AC_LANG_PUSH([C]) +AC_MSG_CHECKING([for gcc option to use signed chars]) +AC_RUN_IFELSE([AC_LANG_SOURCE([[int main(){return (char)-1==-1?0:1;}]])], + [sc_option=],[sc_option=-fsigned-char]) +AC_MSG_RESULT([${sc_option-none}]) +CFLAGS="$CFLAGS $sc_option" +CXXFLAGS="$CXXFLAGS $sc_option" +AC_LANG_POP([C]) + # Define UNIX for all Unix-like systems. Don't define it for cross-compiling to # non-Unix-like systems. (-DUNIX selects the archutils and ArchHooks to use; if # your platform doesn't use the Unix ones, you probably don't want to define UNIX.)