Add option -fsigned-char when gcc requires it. Note that AC_TRY_* are obsolete macros <http://www.gnu.org/software/autoconf/manual/autoconf.html#Obsolete-Macros> and should probably be replaced at some point.

This commit is contained in:
Steve Checkoway
2007-03-13 10:04:59 +00:00
parent 575ab5b616
commit cc9664b304
+11
View File
@@ -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.)