llvm.org GIT mirror llvm / 89b0d99
Allow an --enable-pic option to turn on -fPIC compiler option when building. The default is disabled until we know this doesn't break anyone. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32635 91177308-0d34-0410-b5e6-96231b3b80d8 Reid Spencer 12 years ago
4 changed file(s) with 82 addition(s) and 28 deletion(s). Raw diff Collapse all Expand all
223223 # Do we want to enable threads?
224224 ENABLE_THREADS := @ENABLE_THREADS@
225225
226 # Do we want to build with position independent code?
227 ENABLE_PIC := @ENABLE_PIC@
228
226229 # This option tells the Makefiles to produce verbose output.
227230 # It essentially prints the commands that make is executing
228231 #VERBOSE = 1
254254 C.Flags += -D_DEBUG
255255 endif
256256
257 ifeq ($(ENABLE_PIC),1)
258 CXX.Flags += -fPIC
259 C.Flags += -fPIC
260 endif
261
257262 CXX.Flags += $(CXXFLAGS) -Woverloaded-virtual
258263 C.Flags += $(CFLAGS)
259264 CPP.BaseFlags += $(CPPFLAGS)
263268
264269 # Make Floating point IEEE compliant on Alpha.
265270 ifeq ($(ARCH),Alpha)
266 CXX.Flags += -mieee -fPIC
267 CPP.BaseFlags += -mieee -fPIC
271 CXX.Flags += -mieee
272 CPP.BaseFlags += -mieee
273 ifeq ($(ENABLE_PIC),0)
274 CXX.Flags += -fPIC
275 CPP.BaseFlags += -fPIC
276 endif
268277 endif
269278
270279 #--------------------------------------------------------------------
320320 *) AC_MSG_ERROR([Invalid setting for --enable-threads. Use "yes" or "no"]) ;;
321321 esac
322322 AC_DEFINE_UNQUOTED([ENABLE_THREADS],$ENABLE_THREADS,[Define if threads enabled])
323
324 dnl Allow building with position independent code
325 AC_ARG_ENABLE(pic,
326 AS_HELP_STRING([--enable-pic],
327 [Build LLVM with Position Independent Code (default is NO)]),,
328 enableval=default)
329 case "$enableval" in
330 yes) AC_SUBST(ENABLE_PIC,[1]) ;;
331 no) AC_SUBST(ENABLE_PIC,[0]) ;;
332 default) AC_SUBST(ENABLE_PIC,[0]) ;;
333 *) AC_MSG_ERROR([Invalid setting for --enable-pic. Use "yes" or "no"]) ;;
334 esac
335 AC_DEFINE_UNQUOTED([ENABLE_PIC],$ENABLE_PIC,
336 [Define if position independent code is enabled])
323337
324338 dnl Allow specific targets to be specified for building (or not)
325339 TARGETS_TO_BUILD=""
834834 TARGET_HAS_JIT
835835 ENABLE_DOXYGEN
836836 ENABLE_THREADS
837 ENABLE_PIC
837838 TARGETS_TO_BUILD
838839 ENABLE_CBE_PRINTF_A
839840 EXTRA_OPTIONS
15241525 --enable-jit Enable Just In Time Compiling (default is YES)
15251526 --enable-doxygen Build doxygen documentation (default is NO)
15261527 --enable-threads Use threads if available (default is YES)
1528 --enable-pic Build LLVM with Position Independent Code (default
1529 is NO)
15271530 --enable-targets Build specific host targets:
15281531 all,host-only,{target-name} (default=all)
15291532 --enable-cbe-printf-a Enable C Backend output with hex floating point via
46514654 _ACEOF
46524655
46534656
4657 # Check whether --enable-pic was given.
4658 if test "${enable_pic+set}" = set; then
4659 enableval=$enable_pic;
4660 else
4661 enableval=default
4662 fi
4663
4664 case "$enableval" in
4665 yes) ENABLE_PIC=1
4666 ;;
4667 no) ENABLE_PIC=0
4668 ;;
4669 default) ENABLE_PIC=0
4670 ;;
4671 *) { { echo "$as_me:$LINENO: error: Invalid setting for --enable-pic. Use \"yes\" or \"no\"" >&5
4672 echo "$as_me: error: Invalid setting for --enable-pic. Use \"yes\" or \"no\"" >&2;}
4673 { (exit 1); exit 1; }; } ;;
4674 esac
4675
4676 cat >>confdefs.h <<_ACEOF
4677 #define ENABLE_PIC $ENABLE_PIC
4678 _ACEOF
4679
4680
46544681 TARGETS_TO_BUILD=""
46554682 # Check whether --enable-targets was given.
46564683 if test "${enable_targets+set}" = set; then
1029810325 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1029910326 lt_status=$lt_dlunknown
1030010327 cat > conftest.$ac_ext <
10301 #line 10302 "configure"
10328 #line 10329 "configure"
1030210329 #include "confdefs.h"
1030310330
1030410331 #if HAVE_DLFCN_H
1244212469 ;;
1244312470 *-*-irix6*)
1244412471 # Find out which ABI we are using.
12445 echo '#line 12446 "configure"' > conftest.$ac_ext
12472 echo '#line 12473 "configure"' > conftest.$ac_ext
1244612473 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
1244712474 (eval $ac_compile) 2>&5
1244812475 ac_status=$?
1416014187 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1416114188 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
1416214189 -e 's:$: $lt_compiler_flag:'`
14163 (eval echo "\"\$as_me:14164: $lt_compile\"" >&5)
14190 (eval echo "\"\$as_me:14191: $lt_compile\"" >&5)
1416414191 (eval "$lt_compile" 2>conftest.err)
1416514192 ac_status=$?
1416614193 cat conftest.err >&5
14167 echo "$as_me:14168: \$? = $ac_status" >&5
14194 echo "$as_me:14195: \$? = $ac_status" >&5
1416814195 if (exit $ac_status) && test -s "$ac_outfile"; then
1416914196 # The compiler can only warn and ignore the option if not recognized
1417014197 # So say no if there are warnings other than the usual output.
1442814455 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1442914456 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
1443014457 -e 's:$: $lt_compiler_flag:'`
14431 (eval echo "\"\$as_me:14432: $lt_compile\"" >&5)
14458 (eval echo "\"\$as_me:14459: $lt_compile\"" >&5)
1443214459 (eval "$lt_compile" 2>conftest.err)
1443314460 ac_status=$?
1443414461 cat conftest.err >&5
14435 echo "$as_me:14436: \$? = $ac_status" >&5
14462 echo "$as_me:14463: \$? = $ac_status" >&5
1443614463 if (exit $ac_status) && test -s "$ac_outfile"; then
1443714464 # The compiler can only warn and ignore the option if not recognized
1443814465 # So say no if there are warnings other than the usual output.
1453214559 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1453314560 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
1453414561 -e 's:$: $lt_compiler_flag:'`
14535 (eval echo "\"\$as_me:14536: $lt_compile\"" >&5)
14562 (eval echo "\"\$as_me:14563: $lt_compile\"" >&5)
1453614563 (eval "$lt_compile" 2>out/conftest.err)
1453714564 ac_status=$?
1453814565 cat out/conftest.err >&5
14539 echo "$as_me:14540: \$? = $ac_status" >&5
14566 echo "$as_me:14567: \$? = $ac_status" >&5
1454014567 if (exit $ac_status) && test -s out/conftest2.$ac_objext
1454114568 then
1454214569 # The compiler can only warn and ignore the option if not recognized
1698417011 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1698517012 lt_status=$lt_dlunknown
1698617013 cat > conftest.$ac_ext <
16987 #line 16988 "configure"
17014 #line 17015 "configure"
1698817015 #include "confdefs.h"
1698917016
1699017017 #if HAVE_DLFCN_H
1708417111 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1708517112 lt_status=$lt_dlunknown
1708617113 cat > conftest.$ac_ext <
17087 #line 17088 "configure"
17114 #line 17115 "configure"
1708817115 #include "confdefs.h"
1708917116
1709017117 #if HAVE_DLFCN_H
1945219479 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1945319480 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
1945419481 -e 's:$: $lt_compiler_flag:'`
19455 (eval echo "\"\$as_me:19456: $lt_compile\"" >&5)
19482 (eval echo "\"\$as_me:19483: $lt_compile\"" >&5)
1945619483 (eval "$lt_compile" 2>conftest.err)
1945719484 ac_status=$?
1945819485 cat conftest.err >&5
19459 echo "$as_me:19460: \$? = $ac_status" >&5
19486 echo "$as_me:19487: \$? = $ac_status" >&5
1946019487 if (exit $ac_status) && test -s "$ac_outfile"; then
1946119488 # The compiler can only warn and ignore the option if not recognized
1946219489 # So say no if there are warnings other than the usual output.
1955619583 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1955719584 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
1955819585 -e 's:$: $lt_compiler_flag:'`
19559 (eval echo "\"\$as_me:19560: $lt_compile\"" >&5)
19586 (eval echo "\"\$as_me:19587: $lt_compile\"" >&5)
1956019587 (eval "$lt_compile" 2>out/conftest.err)
1956119588 ac_status=$?
1956219589 cat out/conftest.err >&5
19563 echo "$as_me:19564: \$? = $ac_status" >&5
19590 echo "$as_me:19591: \$? = $ac_status" >&5
1956419591 if (exit $ac_status) && test -s out/conftest2.$ac_objext
1956519592 then
1956619593 # The compiler can only warn and ignore the option if not recognized
2112621153 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
2112721154 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
2112821155 -e 's:$: $lt_compiler_flag:'`
21129 (eval echo "\"\$as_me:21130: $lt_compile\"" >&5)
21156 (eval echo "\"\$as_me:21157: $lt_compile\"" >&5)
2113021157 (eval "$lt_compile" 2>conftest.err)
2113121158 ac_status=$?
2113221159 cat conftest.err >&5
21133 echo "$as_me:21134: \$? = $ac_status" >&5
21160 echo "$as_me:21161: \$? = $ac_status" >&5
2113421161 if (exit $ac_status) && test -s "$ac_outfile"; then
2113521162 # The compiler can only warn and ignore the option if not recognized
2113621163 # So say no if there are warnings other than the usual output.
2123021257 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
2123121258 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
2123221259 -e 's:$: $lt_compiler_flag:'`
21233 (eval echo "\"\$as_me:21234: $lt_compile\"" >&5)
21260 (eval echo "\"\$as_me:21261: $lt_compile\"" >&5)
2123421261 (eval "$lt_compile" 2>out/conftest.err)
2123521262 ac_status=$?
2123621263 cat out/conftest.err >&5
21237 echo "$as_me:21238: \$? = $ac_status" >&5
21264 echo "$as_me:21265: \$? = $ac_status" >&5
2123821265 if (exit $ac_status) && test -s out/conftest2.$ac_objext
2123921266 then
2124021267 # The compiler can only warn and ignore the option if not recognized
2346523492 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
2346623493 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
2346723494 -e 's:$: $lt_compiler_flag:'`
23468 (eval echo "\"\$as_me:23469: $lt_compile\"" >&5)
23495 (eval echo "\"\$as_me:23496: $lt_compile\"" >&5)
2346923496 (eval "$lt_compile" 2>conftest.err)
2347023497 ac_status=$?
2347123498 cat conftest.err >&5
23472 echo "$as_me:23473: \$? = $ac_status" >&5
23499 echo "$as_me:23500: \$? = $ac_status" >&5
2347323500 if (exit $ac_status) && test -s "$ac_outfile"; then
2347423501 # The compiler can only warn and ignore the option if not recognized
2347523502 # So say no if there are warnings other than the usual output.
2373323760 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
2373423761 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
2373523762 -e 's:$: $lt_compiler_flag:'`
23736 (eval echo "\"\$as_me:23737: $lt_compile\"" >&5)
23763 (eval echo "\"\$as_me:23764: $lt_compile\"" >&5)
2373723764 (eval "$lt_compile" 2>conftest.err)
2373823765 ac_status=$?
2373923766 cat conftest.err >&5
23740 echo "$as_me:23741: \$? = $ac_status" >&5
23767 echo "$as_me:23768: \$? = $ac_status" >&5
2374123768 if (exit $ac_status) && test -s "$ac_outfile"; then
2374223769 # The compiler can only warn and ignore the option if not recognized
2374323770 # So say no if there are warnings other than the usual output.
2383723864 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
2383823865 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
2383923866 -e 's:$: $lt_compiler_flag:'`
23840 (eval echo "\"\$as_me:23841: $lt_compile\"" >&5)
23867 (eval echo "\"\$as_me:23868: $lt_compile\"" >&5)
2384123868 (eval "$lt_compile" 2>out/conftest.err)
2384223869 ac_status=$?
2384323870 cat out/conftest.err >&5
23844 echo "$as_me:23845: \$? = $ac_status" >&5
23871 echo "$as_me:23872: \$? = $ac_status" >&5
2384523872 if (exit $ac_status) && test -s out/conftest2.$ac_objext
2384623873 then
2384723874 # The compiler can only warn and ignore the option if not recognized
3416934196 TARGET_HAS_JIT!$TARGET_HAS_JIT$ac_delim
3417034197 ENABLE_DOXYGEN!$ENABLE_DOXYGEN$ac_delim
3417134198 ENABLE_THREADS!$ENABLE_THREADS$ac_delim
34199 ENABLE_PIC!$ENABLE_PIC$ac_delim
3417234200 TARGETS_TO_BUILD!$TARGETS_TO_BUILD$ac_delim
3417334201 ENABLE_CBE_PRINTF_A!$ENABLE_CBE_PRINTF_A$ac_delim
3417434202 EXTRA_OPTIONS!$EXTRA_OPTIONS$ac_delim
3418634214 ifGNUmake!$ifGNUmake$ac_delim
3418734215 LN_S!$LN_S$ac_delim
3418834216 CMP!$CMP$ac_delim
34189 CP!$CP$ac_delim
3419034217 _ACEOF
3419134218
3419234219 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
3422834255 ac_delim='%!_!# '
3422934256 for ac_last_try in false false false false false :; do
3423034257 cat >conf$$subs.sed <<_ACEOF
34258 CP!$CP$ac_delim
3423134259 DATE!$DATE$ac_delim
3423234260 FIND!$FIND$ac_delim
3423334261 MKDIR!$MKDIR$ac_delim
3429534323 LTLIBOBJS!$LTLIBOBJS$ac_delim
3429634324 _ACEOF
3429734325
34298 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 65; then
34326 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 66; then
3429934327 break
3430034328 elif $ac_last_try; then
3430134329 { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5