summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-08-16 17:09:27 +0000
committerai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-08-16 17:09:27 +0000
commitd277092d10c486f94d159f65a37c7cd492d00652 (patch)
treedc10f75d9e0207d002e855623e32423ff0941ee0
parent94b9c4cc347f4c7a3745d001414e565dbf839b62 (diff)
downloadhercules-d277092d10c486f94d159f65a37c7cd492d00652.tar.gz
hercules-d277092d10c486f94d159f65a37c7cd492d00652.tar.bz2
hercules-d277092d10c486f94d159f65a37c7cd492d00652.tar.xz
hercules-d277092d10c486f94d159f65a37c7cd492d00652.zip
* Added -fno-strict-aliasing detection to configure.in (-fstrict-aliasing is added through -O2), since the code is not aliasing safe and causes warnings with gcc.
- This also fixes a missing line in the pre-built configure script (since r14870). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14935 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog-Trunk.txt3
-rwxr-xr-xconfigure49
-rw-r--r--configure.in16
3 files changed, 68 insertions, 0 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index a8960b164..193e28b0c 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -1,5 +1,8 @@
Date Added
+2011/08/16
+ * Added -fno-strict-aliasing detection to configure.in (-fstrict-aliasing is added through -O2), since the code is not aliasing safe and causes warnings with gcc. [Ai4rei]
+ - This also fixes a missing line in the pre-built configure script (since r14870).
2011/08/11
* Fixed bonuses bAddMonsterDropItem and bAddMonsterDropItemGroup (which broke after bAddClassDropItem was added). [Skotlex]
2011/08/10
diff --git a/configure b/configure
index fbc5e3a11..e26d187e8 100755
--- a/configure
+++ b/configure
@@ -3476,6 +3476,54 @@ rm -f conftest.err conftest.$ac_objext \
#
+# -O2 implies -fstrict-aliasing, but the code is not safe for that
+#
+echo "$as_me:$LINENO: checking whether $CC supports -fno-strict-aliasing" >&5
+echo $ECHO_N "checking whether $CC supports -fno-strict-aliasing... $ECHO_C" >&6
+OLD_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS -fno-strict-aliasing"
+cat >conftest.$ac_ext <<_ACEOF
+int foo;
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+ CFLAGS="$OLD_CFLAGS"
+
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+
+#
# DB_MANUAL_CAST_TO_UNION
#
echo "$as_me:$LINENO: checking whether $CC is able to typecast to union" >&5
@@ -6178,6 +6226,7 @@ do
# Handling of arguments.
"Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
"src/common/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/common/Makefile" ;;
+ "3rdparty/mt19937ar/Makefile" ) CONFIG_FILES="$CONFIG_FILES 3rdparty/mt19937ar/Makefile" ;;
"src/char/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/char/Makefile" ;;
"src/login/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/login/Makefile" ;;
"src/char_sql/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/char_sql/Makefile" ;;
diff --git a/configure.in b/configure.in
index 197a4a4ed..a9e4c289a 100644
--- a/configure.in
+++ b/configure.in
@@ -425,6 +425,22 @@ AC_SUBST([WITH_PLUGINS])
#
+# -O2 implies -fstrict-aliasing, but the code is not safe for that
+#
+AC_MSG_CHECKING([whether $CC supports -fno-strict-aliasing])
+OLD_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS -fno-strict-aliasing"
+AC_COMPILE_IFELSE(
+ [int foo;],
+ [AC_MSG_RESULT([yes])],
+ [
+ AC_MSG_RESULT([no])
+ CFLAGS="$OLD_CFLAGS"
+ ]
+)
+
+
+#
# DB_MANUAL_CAST_TO_UNION
#
AC_MSG_CHECKING([whether $CC is able to typecast to union])