summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorGeorge Joseph <george.joseph@fairview5.com>2014-10-19 17:07:50 +0000
committerGeorge Joseph <george.joseph@fairview5.com>2014-10-19 17:07:50 +0000
commitcb31a8aa7af931ceffc0ccb507fa9d52b6a27cde (patch)
treedc3c40d92c1b14ced44124f78a395b063d5f9472 /configure.ac
parent70b21c4617ed429f597cefc0b88684f207a0b580 (diff)
build: Force -fsigned-char on platforms where the default for char is unsigned
gcc on the ARM platform defaults 'char' to 'unsigned char' whereas Intel and SPARC default to 'signed char'. This is only an issue in the rare cases where negative values are assigned to a 'char' but this this patch insures compatibility by detecting platforms that default to 'unsigned' and adding an '-fsigned-char' flag to _ASTCFLAGS. If compiling for ARM (native or cross-compile) be sure to run ./bootstrap.sh and ./configure to regenerate the build files. You shouldn't have to do this for Intel or SPARC. Tested-by: George Joseph Review: https://reviewboard.asterisk.org/r/4091/ ........ Merged revisions 425964 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@425965 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac19
1 files changed, 19 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index aa3cfd4d3..8b18790fc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -192,6 +192,25 @@ esac
AC_SUBST(OSARCH)
AC_SUBST(PBX_WINARCH)
+AC_MSG_CHECKING(whether char is unsigned)
+AC_COMPILE_IFELSE(
+ [
+ AC_LANG_SOURCE(
+#include <limits.h>
+#if CHAR_MIN == 0
+#error
+#endif
+ )
+ ],[
+ AC_MSG_RESULT(no)
+ CONFIG_SIGNED_CHAR=""
+ ],[
+ AC_MSG_RESULT(yes)
+ CONFIG_SIGNED_CHAR="-fsigned-char"
+ ]
+)
+AC_SUBST(CONFIG_SIGNED_CHAR)
+
# check for uname
AC_PATH_TOOL([UNAME], [uname], No)
if test ! x"${UNAME}" = xNo; then