llvm.org GIT mirror llvm / baaadb2
Add polly support to the build system. Update the cmake and autoconf build system to compile polly as a shared library if it is checked out into tools/polly. In case polly is not checked out, nothing changes. This models the way clang can be added to llvm if checked out to tools/clang. Also rebuild configure. Patch contributed by ether. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117755 91177308-0d34-0410-b5e6-96231b3b80d8 Tobias Grosser 8 years ago
5 changed file(s) with 74 addition(s) and 9 deletion(s). Raw diff Collapse all Expand all
340340 # -Wno-variadic-macros
341341 NO_VARIADIC_MACROS = @NO_VARIADIC_MACROS@
342342
343 # Was polly found in tools/polly?
344 LLVM_HAS_POLLY = @LLVM_HAS_POLLY@
343345 # Flags supported by the linker.
344346 # bfd ld / gold --version-script=file
345347 HAVE_LINK_VERSION_SCRIPT = @HAVE_LINK_VERSION_SCRIPT@
119119 esac
120120 fi
121121 done
122
123 dnl Disable the build of polly, even if it is checked out into tools/polly.
124 AC_ARG_ENABLE(polly,
125 AS_HELP_STRING([--enable-polly],
126 [Use polly if available (default is YES)]),,
127 enableval=default)
128 case "$enableval" in
129 yes) AC_SUBST(ENABLE_POLLY,[1]) ;;
130 no) AC_SUBST(ENABLE_POLLY,[0]) ;;
131 default) AC_SUBST(ENABLE_POLLY,[1]) ;;
132 *) AC_MSG_ERROR([Invalid setting for --enable-polly. Use "yes" or "no"]) ;;
133 esac
134
135
136 dnl Check if polly is checked out into tools/polly and configure it if
137 dnl available.
138 if (test -d ${srcdir}/tools/polly) && (test $ENABLE_POLLY -eq 1) ; then
139 AC_SUBST(LLVM_HAS_POLLY,1)
140 AC_CONFIG_SUBDIRS([tools/polly])
141 fi
122142
123143 dnl===-----------------------------------------------------------------------===
124144 dnl===
640640 target_alias
641641 LLVM_COPYRIGHT
642642 subdirs
643 ENABLE_POLLY
644 LLVM_HAS_POLLY
643645 build
644646 build_cpu
645647 build_vendor
816818 projects/llvm-java
817819 projects/llvm-tv
818820 projects/safecode
819 projects/llvm-kernel'
821 projects/llvm-kernel
822 tools/polly'
820823
821824 # Initialize some variables set by options.
822825 ac_init_help=
13911394 Optional Features:
13921395 --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
13931396 --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
1397 --enable-polly Use polly if available (default is YES)
13941398 --enable-optimized Compile with optimizations enabled (default is NO)
13951399 --enable-profiling Compile with profiling enabled (default is NO)
13961400 --enable-assertions Compile with assertion checks enabled (default is
20132017 esac
20142018 fi
20152019 done
2020
2021 # Check whether --enable-polly was given.
2022 if test "${enable_polly+set}" = set; then
2023 enableval=$enable_polly;
2024 else
2025 enableval=default
2026 fi
2027
2028 case "$enableval" in
2029 yes) ENABLE_POLLY=1
2030 ;;
2031 no) ENABLE_POLLY=0
2032 ;;
2033 default) ENABLE_POLLY=1
2034 ;;
2035 *) { { echo "$as_me:$LINENO: error: Invalid setting for --enable-polly. Use \"yes\" or \"no\"" >&5
2036 echo "$as_me: error: Invalid setting for --enable-polly. Use \"yes\" or \"no\"" >&2;}
2037 { (exit 1); exit 1; }; } ;;
2038 esac
2039
2040
2041 if (test -d ${srcdir}/tools/polly) && (test $ENABLE_POLLY -eq 1) ; then
2042 LLVM_HAS_POLLY=1
2043
2044 subdirs="$subdirs tools/polly"
2045
2046 fi
20162047
20172048
20182049 # Make sure we can run config.sub.
1146611497 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1146711498 lt_status=$lt_dlunknown
1146811499 cat > conftest.$ac_ext <
11469 #line 11470 "configure"
11500 #line 11501 "configure"
1147011501 #include "confdefs.h"
1147111502
1147211503 #if HAVE_DLFCN_H
2158321614 target_alias!$target_alias$ac_delim
2158421615 LLVM_COPYRIGHT!$LLVM_COPYRIGHT$ac_delim
2158521616 subdirs!$subdirs$ac_delim
21617 ENABLE_POLLY!$ENABLE_POLLY$ac_delim
21618 LLVM_HAS_POLLY!$LLVM_HAS_POLLY$ac_delim
2158621619 build!$build$ac_delim
2158721620 build_cpu!$build_cpu$ac_delim
2158821621 build_vendor!$build_vendor$ac_delim
2163921672 LLVM_ENUM_ASM_PARSERS!$LLVM_ENUM_ASM_PARSERS$ac_delim
2164021673 LLVM_ENUM_DISASSEMBLERS!$LLVM_ENUM_DISASSEMBLERS$ac_delim
2164121674 ENABLE_CBE_PRINTF_A!$ENABLE_CBE_PRINTF_A$ac_delim
21642 CLANGPATH!$CLANGPATH$ac_delim
21643 CLANGXXPATH!$CLANGXXPATH$ac_delim
2164421675 _ACEOF
2164521676
2164621677 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
2168221713 ac_delim='%!_!# '
2168321714 for ac_last_try in false false false false false :; do
2168421715 cat >conf$$subs.sed <<_ACEOF
21716 CLANGPATH!$CLANGPATH$ac_delim
21717 CLANGXXPATH!$CLANGXXPATH$ac_delim
2168521718 ENABLE_BUILT_CLANG!$ENABLE_BUILT_CLANG$ac_delim
2168621719 OPTIMIZE_OPTION!$OPTIMIZE_OPTION$ac_delim
2168721720 EXTRA_OPTIONS!$EXTRA_OPTIONS$ac_delim
2177821811 LTLIBOBJS!$LTLIBOBJS$ac_delim
2177921812 _ACEOF
2178021813
21781 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 94; then
21814 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 96; then
2178221815 break
2178321816 elif $ac_last_try; then
2178421817 { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
2179721830
2179821831 cat >>$CONFIG_STATUS <<_ACEOF
2179921832 cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof
21800 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end
21833 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
2180121834 _ACEOF
2180221835 sed '
2180321836 s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
2181021843 ' >>$CONFIG_STATUS
2181121844 rm -f conf$$subs.sed
2181221845 cat >>$CONFIG_STATUS <<_ACEOF
21813 :end
21814 s/|#_!!_#|//g
2181521846 CEOF$ac_eof
2181621847 _ACEOF
2181721848
2205922090 s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
2206022091 s&@INSTALL@&$ac_INSTALL&;t t
2206122092 $ac_datarootdir_hack
22062 " $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out
22093 " $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" | sed 's/|#_!!_#|//g' >$tmp/out
2206322094
2206422095 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
2206522096 { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
0 # NOTE: The tools are organized into five groups of four consisting of one
11 # large and three small executables. This is done to minimize memory load
22 # in parallel builds. Please retain this ordering.
3
4 # If polly exists and is not disabled compile it and add it to the LLVM tools.
5 option(LLVM_BUILD_POLLY "Compile polly" ON)
6 if( EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/polly/CMakeLists.txt )
7 if (LLVM_BUILD_POLLY)
8 add_subdirectory( ${CMAKE_CURRENT_SOURCE_DIR}/polly)
9 endif (LLVM_BUILD_POLLY)
10 endif( EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/polly/CMakeLists.txt )
311
412 if( NOT WIN32 OR MSYS OR CYGWIN )
513 # It is useful to build llvm-config before the other tools, so we
5656 endif
5757 endif
5858
59 ifdef LLVM_HAS_POLLY
60 PARALLEL_DIRS += polly
61 endif
62
5963 include $(LEVEL)/Makefile.common