Created
January 16, 2013 13:22
-
-
Save suma/4547103 to your computer and use it in GitHub Desktop.
mpio m4 patch for clang
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/configure.in b/configure.in | |
| index 7993816..434b575 100644 | |
| --- a/configure.in | |
| +++ b/configure.in | |
| @@ -1,19 +1,23 @@ | |
| # Copyright (C) 2013 Preferred Infrastructure and Nippon Telegraph and Telephone Corporation. | |
| AC_INIT(mpsrc/wavy_kernel.h) | |
| +m4_include(m4/ax_check_link_flag.m4) | |
| AC_CONFIG_AUX_DIR(ac) | |
| AC_CANONICAL_TARGET | |
| AM_INIT_AUTOMAKE(jubatus_mpio, 0.4.0) | |
| AC_CONFIG_HEADER(config.h) | |
| -AC_SUBST(CFLAGS) | |
| -CFLAGS="-O4 -Wall $CFLAGS" | |
| - | |
| -AC_SUBST(CXXFLAGS) | |
| -CXXFLAGS="-O4 -Wall $CXXFLAGS" | |
| - | |
| -#AC_CHECK_PROG(RUBY, ruby, ruby) | |
| +# Default enabled -O4 | |
| +AC_ARG_ENABLE(optimized, AS_HELP_STRING([--disable-optimized], [Compile with optimizations -O4 (default is YES)])) | |
| +# Check -O4 opition for clang | |
| +AS_IF([test "x$enable_optimized" != "xno"], [ | |
| + save_c_flags="-O3 $CFLAGS" # We use O3 or default -O2? | |
| + save_cxx_flags="-O3 $CXXFLAGS" | |
| + CFLAGS="-Wall" | |
| + CXXFLAGS="-Wall" | |
| + AX_CHECK_LINK_FLAG(-O4, [AM_CXXFLAGS="-O4 -Wall $CXXFLAGS" AM_CFLAGS="-O4 -Wall $CFLAGS"], [CFLAGS="$save_c_flags" CXXFLAGS="$save_cxx_flags"]) | |
| +]) | |
| AC_PROG_CC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment