llvm.org GIT mirror llvm / 1fce948
configure: Add --with-optimize-option, for setting the default value of OPTIMIZE_OPTION. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86005 91177308-0d34-0410-b5e6-96231b3b80d8 Daniel Dunbar 9 years ago
4 changed file(s) with 73 addition(s) and 36 deletion(s). Raw diff Collapse all Expand all
249249 #DEBUG_SYMBOLS = 1
250250 @DEBUG_SYMBOLS@
251251
252 # The compiler flags to use for optimized builds.
253 OPTIMIZE_OPTION := @OPTIMIZE_OPTION@
254
252255 # When ENABLE_PROFILING is enabled, the llvm source base is built with profile
253256 # information to allow gprof to be used to get execution frequencies.
254257 #ENABLE_PROFILING = 1
311311 #--------------------------------------------------------------------
312312
313313 CPP.Defines :=
314 # OPTIMIZE_OPTION - The optimization level option we want to build LLVM with
315 # this can be overridden on the make command line.
316 ifndef OPTIMIZE_OPTION
317 ifneq ($(HOST_OS),MingW)
318 OPTIMIZE_OPTION := -O3
319 else
320 OPTIMIZE_OPTION := -O2
321 endif
322 endif
323
324314 ifeq ($(ENABLE_OPTIMIZED),1)
325315 BuildMode := Release
326316 # Don't use -fomit-frame-pointer on Darwin or FreeBSD.
606606 AC_MSG_ERROR([Invalid llvm-gcc. Use --with-llvmgcc when --with-llvmgxx is used]);
607607 fi
608608
609 dnl Override the option to use for optimized builds.
610 AC_ARG_WITH(optimize-option,
611 AS_HELP_STRING([--with-optimize-option],
612 [Select the compiler options to use for optimized builds]),,
613 withval=default)
614 AC_MSG_CHECKING([optimization flags])
615 case "$withval" in
616 default)
617 case "$llvm_cv_os_type" in
618 MingW) optimize_option=-O3 ;;
619 *) optimize_option=-O2 ;;
620 esac ;;
621 *) optimize_option="$withval" ;;
622 esac
623 AC_SUBST(OPTIMIZE_OPTION,$optimize_option)
624 AC_MSG_RESULT([$optimize_option])
625
609626 dnl Specify extra build options
610627 AC_ARG_WITH(extra-options,
611628 AS_HELP_STRING([--with-extra-options],
847847 LLVM_ENUM_ASM_PRINTERS
848848 LLVM_ENUM_ASM_PARSERS
849849 ENABLE_CBE_PRINTF_A
850 OPTIMIZE_OPTION
850851 EXTRA_OPTIONS
851852 BINUTILS_INCDIR
852853 ENABLE_LLVMC_DYNAMIC
15961597 searches PATH)
15971598 --with-llvmgxx Specify location of llvm-g++ driver (default
15981599 searches PATH)
1600 --with-optimize-option Select the compiler options to use for optimized
1601 builds
15991602 --with-extra-options Specify additional options to compile LLVM with
16001603 --with-ocaml-libdir Specify install location for ocaml bindings (default
16011604 is stdlib)
51915194 fi
51925195
51935196
5197 # Check whether --with-optimize-option was given.
5198 if test "${with_optimize_option+set}" = set; then
5199 withval=$with_optimize_option;
5200 else
5201 withval=default
5202 fi
5203
5204 { echo "$as_me:$LINENO: checking optimization flags" >&5
5205 echo $ECHO_N "checking optimization flags... $ECHO_C" >&6; }
5206 case "$withval" in
5207 default)
5208 case "$llvm_cv_os_type" in
5209 MingW) optimize_option=-O3 ;;
5210 *) optimize_option=-O2 ;;
5211 esac ;;
5212 *) optimize_option="$withval" ;;
5213 esac
5214 OPTIMIZE_OPTION=$optimize_option
5215
5216 { echo "$as_me:$LINENO: result: $optimize_option" >&5
5217 echo "${ECHO_T}$optimize_option" >&6; }
5218
5219
51945220 # Check whether --with-extra-options was given.
51955221 if test "${with_extra_options+set}" = set; then
51965222 withval=$with_extra_options;
1100911035 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1101011036 lt_status=$lt_dlunknown
1101111037 cat > conftest.$ac_ext <
11012 #line 11013 "configure"
11038 #line 11039 "configure"
1101311039 #include "confdefs.h"
1101411040
1101511041 #if HAVE_DLFCN_H
1315313179 ;;
1315413180 *-*-irix6*)
1315513181 # Find out which ABI we are using.
13156 echo '#line 13157 "configure"' > conftest.$ac_ext
13182 echo '#line 13183 "configure"' > conftest.$ac_ext
1315713183 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
1315813184 (eval $ac_compile) 2>&5
1315913185 ac_status=$?
1487114897 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1487214898 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
1487314899 -e 's:$: $lt_compiler_flag:'`
14874 (eval echo "\"\$as_me:14875: $lt_compile\"" >&5)
14900 (eval echo "\"\$as_me:14901: $lt_compile\"" >&5)
1487514901 (eval "$lt_compile" 2>conftest.err)
1487614902 ac_status=$?
1487714903 cat conftest.err >&5
14878 echo "$as_me:14879: \$? = $ac_status" >&5
14904 echo "$as_me:14905: \$? = $ac_status" >&5
1487914905 if (exit $ac_status) && test -s "$ac_outfile"; then
1488014906 # The compiler can only warn and ignore the option if not recognized
1488114907 # So say no if there are warnings other than the usual output.
1513915165 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1514015166 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
1514115167 -e 's:$: $lt_compiler_flag:'`
15142 (eval echo "\"\$as_me:15143: $lt_compile\"" >&5)
15168 (eval echo "\"\$as_me:15169: $lt_compile\"" >&5)
1514315169 (eval "$lt_compile" 2>conftest.err)
1514415170 ac_status=$?
1514515171 cat conftest.err >&5
15146 echo "$as_me:15147: \$? = $ac_status" >&5
15172 echo "$as_me:15173: \$? = $ac_status" >&5
1514715173 if (exit $ac_status) && test -s "$ac_outfile"; then
1514815174 # The compiler can only warn and ignore the option if not recognized
1514915175 # So say no if there are warnings other than the usual output.
1524315269 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1524415270 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
1524515271 -e 's:$: $lt_compiler_flag:'`
15246 (eval echo "\"\$as_me:15247: $lt_compile\"" >&5)
15272 (eval echo "\"\$as_me:15273: $lt_compile\"" >&5)
1524715273 (eval "$lt_compile" 2>out/conftest.err)
1524815274 ac_status=$?
1524915275 cat out/conftest.err >&5
15250 echo "$as_me:15251: \$? = $ac_status" >&5
15276 echo "$as_me:15277: \$? = $ac_status" >&5
1525115277 if (exit $ac_status) && test -s out/conftest2.$ac_objext
1525215278 then
1525315279 # The compiler can only warn and ignore the option if not recognized
1769517721 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1769617722 lt_status=$lt_dlunknown
1769717723 cat > conftest.$ac_ext <
17698 #line 17699 "configure"
17724 #line 17725 "configure"
1769917725 #include "confdefs.h"
1770017726
1770117727 #if HAVE_DLFCN_H
1779517821 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1779617822 lt_status=$lt_dlunknown
1779717823 cat > conftest.$ac_ext <
17798 #line 17799 "configure"
17824 #line 17825 "configure"
1779917825 #include "confdefs.h"
1780017826
1780117827 #if HAVE_DLFCN_H
2016320189 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
2016420190 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
2016520191 -e 's:$: $lt_compiler_flag:'`
20166 (eval echo "\"\$as_me:20167: $lt_compile\"" >&5)
20192 (eval echo "\"\$as_me:20193: $lt_compile\"" >&5)
2016720193 (eval "$lt_compile" 2>conftest.err)
2016820194 ac_status=$?
2016920195 cat conftest.err >&5
20170 echo "$as_me:20171: \$? = $ac_status" >&5
20196 echo "$as_me:20197: \$? = $ac_status" >&5
2017120197 if (exit $ac_status) && test -s "$ac_outfile"; then
2017220198 # The compiler can only warn and ignore the option if not recognized
2017320199 # So say no if there are warnings other than the usual output.
2026720293 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
2026820294 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
2026920295 -e 's:$: $lt_compiler_flag:'`
20270 (eval echo "\"\$as_me:20271: $lt_compile\"" >&5)
20296 (eval echo "\"\$as_me:20297: $lt_compile\"" >&5)
2027120297 (eval "$lt_compile" 2>out/conftest.err)
2027220298 ac_status=$?
2027320299 cat out/conftest.err >&5
20274 echo "$as_me:20275: \$? = $ac_status" >&5
20300 echo "$as_me:20301: \$? = $ac_status" >&5
2027520301 if (exit $ac_status) && test -s out/conftest2.$ac_objext
2027620302 then
2027720303 # The compiler can only warn and ignore the option if not recognized
2183721863 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
2183821864 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
2183921865 -e 's:$: $lt_compiler_flag:'`
21840 (eval echo "\"\$as_me:21841: $lt_compile\"" >&5)
21866 (eval echo "\"\$as_me:21867: $lt_compile\"" >&5)
2184121867 (eval "$lt_compile" 2>conftest.err)
2184221868 ac_status=$?
2184321869 cat conftest.err >&5
21844 echo "$as_me:21845: \$? = $ac_status" >&5
21870 echo "$as_me:21871: \$? = $ac_status" >&5
2184521871 if (exit $ac_status) && test -s "$ac_outfile"; then
2184621872 # The compiler can only warn and ignore the option if not recognized
2184721873 # So say no if there are warnings other than the usual output.
2194121967 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
2194221968 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
2194321969 -e 's:$: $lt_compiler_flag:'`
21944 (eval echo "\"\$as_me:21945: $lt_compile\"" >&5)
21970 (eval echo "\"\$as_me:21971: $lt_compile\"" >&5)
2194521971 (eval "$lt_compile" 2>out/conftest.err)
2194621972 ac_status=$?
2194721973 cat out/conftest.err >&5
21948 echo "$as_me:21949: \$? = $ac_status" >&5
21974 echo "$as_me:21975: \$? = $ac_status" >&5
2194921975 if (exit $ac_status) && test -s out/conftest2.$ac_objext
2195021976 then
2195121977 # The compiler can only warn and ignore the option if not recognized
2417624202 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
2417724203 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
2417824204 -e 's:$: $lt_compiler_flag:'`
24179 (eval echo "\"\$as_me:24180: $lt_compile\"" >&5)
24205 (eval echo "\"\$as_me:24206: $lt_compile\"" >&5)
2418024206 (eval "$lt_compile" 2>conftest.err)
2418124207 ac_status=$?
2418224208 cat conftest.err >&5
24183 echo "$as_me:24184: \$? = $ac_status" >&5
24209 echo "$as_me:24210: \$? = $ac_status" >&5
2418424210 if (exit $ac_status) && test -s "$ac_outfile"; then
2418524211 # The compiler can only warn and ignore the option if not recognized
2418624212 # So say no if there are warnings other than the usual output.
2444424470 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
2444524471 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
2444624472 -e 's:$: $lt_compiler_flag:'`
24447 (eval echo "\"\$as_me:24448: $lt_compile\"" >&5)
24473 (eval echo "\"\$as_me:24474: $lt_compile\"" >&5)
2444824474 (eval "$lt_compile" 2>conftest.err)
2444924475 ac_status=$?
2445024476 cat conftest.err >&5
24451 echo "$as_me:24452: \$? = $ac_status" >&5
24477 echo "$as_me:24478: \$? = $ac_status" >&5
2445224478 if (exit $ac_status) && test -s "$ac_outfile"; then
2445324479 # The compiler can only warn and ignore the option if not recognized
2445424480 # So say no if there are warnings other than the usual output.
2454824574 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
2454924575 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
2455024576 -e 's:$: $lt_compiler_flag:'`
24551 (eval echo "\"\$as_me:24552: $lt_compile\"" >&5)
24577 (eval echo "\"\$as_me:24578: $lt_compile\"" >&5)
2455224578 (eval "$lt_compile" 2>out/conftest.err)
2455324579 ac_status=$?
2455424580 cat out/conftest.err >&5
24555 echo "$as_me:24556: \$? = $ac_status" >&5
24581 echo "$as_me:24582: \$? = $ac_status" >&5
2455624582 if (exit $ac_status) && test -s out/conftest2.$ac_objext
2455724583 then
2455824584 # The compiler can only warn and ignore the option if not recognized
3607136097 LLVM_ENUM_ASM_PRINTERS!$LLVM_ENUM_ASM_PRINTERS$ac_delim
3607236098 LLVM_ENUM_ASM_PARSERS!$LLVM_ENUM_ASM_PARSERS$ac_delim
3607336099 ENABLE_CBE_PRINTF_A!$ENABLE_CBE_PRINTF_A$ac_delim
36100 OPTIMIZE_OPTION!$OPTIMIZE_OPTION$ac_delim
3607436101 EXTRA_OPTIONS!$EXTRA_OPTIONS$ac_delim
3607536102 BINUTILS_INCDIR!$BINUTILS_INCDIR$ac_delim
3607636103 ENABLE_LLVMC_DYNAMIC!$ENABLE_LLVMC_DYNAMIC$ac_delim
3607736104 ENABLE_LLVMC_DYNAMIC_PLUGINS!$ENABLE_LLVMC_DYNAMIC_PLUGINS$ac_delim
36078 CXX!$CXX$ac_delim
3607936105 _ACEOF
3608036106
3608136107 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
3611736143 ac_delim='%!_!# '
3611836144 for ac_last_try in false false false false false :; do
3611936145 cat >conf$$subs.sed <<_ACEOF
36146 CXX!$CXX$ac_delim
3612036147 CXXFLAGS!$CXXFLAGS$ac_delim
3612136148 ac_ct_CXX!$ac_ct_CXX$ac_delim
3612236149 NM!$NM$ac_delim
3621336240 LTLIBOBJS!$LTLIBOBJS$ac_delim
3621436241 _ACEOF
3621536242
36216 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 94; then
36243 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 95; then
3621736244 break
3621836245 elif $ac_last_try; then
3621936246 { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5