diff options
author | blacksirius <blacksirius@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-06-01 10:09:16 +0000 |
---|---|---|
committer | blacksirius <blacksirius@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-06-01 10:09:16 +0000 |
commit | 5ea0945201d1fe30d0aba2b050afa15c59f5e74c (patch) | |
tree | a9f3b7af61a0aaf9aea13864d7c7788ac69024ae /configure.in | |
parent | b87430245ee4dad7dbeb0e2ee54ae0ff2f782fd2 (diff) | |
download | hercules-5ea0945201d1fe30d0aba2b050afa15c59f5e74c.tar.gz hercules-5ea0945201d1fe30d0aba2b050afa15c59f5e74c.tar.bz2 hercules-5ea0945201d1fe30d0aba2b050afa15c59f5e74c.tar.xz hercules-5ea0945201d1fe30d0aba2b050afa15c59f5e74c.zip |
feature merge bs-coreoptimize->trunk: LTO support
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16196 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/configure.in b/configure.in index 815da2009..bee9b7030 100644 --- a/configure.in +++ b/configure.in @@ -166,6 +166,29 @@ AC_ARG_ENABLE( # +# LTO +# +AC_ARG_ENABLE( + [lto], + AC_HELP_STRING( + [--enable-lto], + [ + Enables or Disables Linktime Code Optimization (LTO is enabled by default) + ] + ), + [ + enable_lto="$enableval" + case $enableval in + "no");; + "yes");; + *) AC_MSG_ERROR([[invalid argument --enable-lto=$disableval... stopping]]);; + esac + ], + [enable_lto="yes"] +) + + +# # Optionally specify the path to mysql_config # AC_ARG_WITH( @@ -327,6 +350,40 @@ AC_COMPILE_IFELSE( ) +# +# LTO Support test +# +if test "$enable_lto" != "no" ; then + + OLD_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -flto" + + OLD_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -flto" + + AC_MSG_CHECKING([whether $CC supports -flto]) + AC_RUN_IFELSE( + [ + int main(int argc, char **argv){ + return 0; + } + ], + [ + AC_MSG_RESULT([yes]) + ], + [ + AC_MSG_RESULT([no]) + CFLAGS="$OLD_CFLAGS" + LDFLAGS="$OLD_LDFLAGS" + ], + [ + AC_MSG_RESULT([guessing no]) + ] + ) +fi + + + AC_MSG_CHECKING([whether $CC supports -Wno-pointer-sign]) OLD_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Wno-pointer-sign" |