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.

llvm-svn: 117755
This commit is contained in:
Tobias Grosser 2010-10-30 00:54:26 +00:00
parent 996d1280bd
commit 45db9e63fb
5 changed files with 74 additions and 9 deletions

View File

@ -341,6 +341,8 @@ NO_MISSING_FIELD_INITIALIZERS = @NO_MISSING_FIELD_INITIALIZERS@
# -Wno-variadic-macros
NO_VARIADIC_MACROS = @NO_VARIADIC_MACROS@
# Was polly found in tools/polly?
LLVM_HAS_POLLY = @LLVM_HAS_POLLY@
# Flags supported by the linker.
# bfd ld / gold --version-script=file
HAVE_LINK_VERSION_SCRIPT = @HAVE_LINK_VERSION_SCRIPT@

View File

@ -121,6 +121,26 @@ do
fi
done
dnl Disable the build of polly, even if it is checked out into tools/polly.
AC_ARG_ENABLE(polly,
AS_HELP_STRING([--enable-polly],
[Use polly if available (default is YES)]),,
enableval=default)
case "$enableval" in
yes) AC_SUBST(ENABLE_POLLY,[1]) ;;
no) AC_SUBST(ENABLE_POLLY,[0]) ;;
default) AC_SUBST(ENABLE_POLLY,[1]) ;;
*) AC_MSG_ERROR([Invalid setting for --enable-polly. Use "yes" or "no"]) ;;
esac
dnl Check if polly is checked out into tools/polly and configure it if
dnl available.
if (test -d ${srcdir}/tools/polly) && (test $ENABLE_POLLY -eq 1) ; then
AC_SUBST(LLVM_HAS_POLLY,1)
AC_CONFIG_SUBDIRS([tools/polly])
fi
dnl===-----------------------------------------------------------------------===
dnl===
dnl=== SECTION 2: Architecture, target, and host checks

49
configure vendored
View File

@ -641,6 +641,8 @@ host_alias
target_alias
LLVM_COPYRIGHT
subdirs
ENABLE_POLLY
LLVM_HAS_POLLY
build
build_cpu
build_vendor
@ -817,7 +819,8 @@ projects/llvm-reopt
projects/llvm-java
projects/llvm-tv
projects/safecode
projects/llvm-kernel'
projects/llvm-kernel
tools/polly'
# Initialize some variables set by options.
ac_init_help=
@ -1392,6 +1395,7 @@ if test -n "$ac_init_help"; then
Optional Features:
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--enable-polly Use polly if available (default is YES)
--enable-optimized Compile with optimizations enabled (default is NO)
--enable-profiling Compile with profiling enabled (default is NO)
--enable-assertions Compile with assertion checks enabled (default is
@ -2015,6 +2019,33 @@ echo "$as_me: WARNING: Unknown project (${i}) won't be configured automatically"
fi
done
# Check whether --enable-polly was given.
if test "${enable_polly+set}" = set; then
enableval=$enable_polly;
else
enableval=default
fi
case "$enableval" in
yes) ENABLE_POLLY=1
;;
no) ENABLE_POLLY=0
;;
default) ENABLE_POLLY=1
;;
*) { { echo "$as_me:$LINENO: error: Invalid setting for --enable-polly. Use \"yes\" or \"no\"" >&5
echo "$as_me: error: Invalid setting for --enable-polly. Use \"yes\" or \"no\"" >&2;}
{ (exit 1); exit 1; }; } ;;
esac
if (test -d ${srcdir}/tools/polly) && (test $ENABLE_POLLY -eq 1) ; then
LLVM_HAS_POLLY=1
subdirs="$subdirs tools/polly"
fi
# Make sure we can run config.sub.
$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
@ -11467,7 +11498,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
#line 11470 "configure"
#line 11501 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -21584,6 +21615,8 @@ host_alias!$host_alias$ac_delim
target_alias!$target_alias$ac_delim
LLVM_COPYRIGHT!$LLVM_COPYRIGHT$ac_delim
subdirs!$subdirs$ac_delim
ENABLE_POLLY!$ENABLE_POLLY$ac_delim
LLVM_HAS_POLLY!$LLVM_HAS_POLLY$ac_delim
build!$build$ac_delim
build_cpu!$build_cpu$ac_delim
build_vendor!$build_vendor$ac_delim
@ -21640,8 +21673,6 @@ LLVM_ENUM_ASM_PRINTERS!$LLVM_ENUM_ASM_PRINTERS$ac_delim
LLVM_ENUM_ASM_PARSERS!$LLVM_ENUM_ASM_PARSERS$ac_delim
LLVM_ENUM_DISASSEMBLERS!$LLVM_ENUM_DISASSEMBLERS$ac_delim
ENABLE_CBE_PRINTF_A!$ENABLE_CBE_PRINTF_A$ac_delim
CLANGPATH!$CLANGPATH$ac_delim
CLANGXXPATH!$CLANGXXPATH$ac_delim
_ACEOF
if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
@ -21683,6 +21714,8 @@ _ACEOF
ac_delim='%!_!# '
for ac_last_try in false false false false false :; do
cat >conf$$subs.sed <<_ACEOF
CLANGPATH!$CLANGPATH$ac_delim
CLANGXXPATH!$CLANGXXPATH$ac_delim
ENABLE_BUILT_CLANG!$ENABLE_BUILT_CLANG$ac_delim
OPTIMIZE_OPTION!$OPTIMIZE_OPTION$ac_delim
EXTRA_OPTIONS!$EXTRA_OPTIONS$ac_delim
@ -21779,7 +21812,7 @@ LIBOBJS!$LIBOBJS$ac_delim
LTLIBOBJS!$LTLIBOBJS$ac_delim
_ACEOF
if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 94; then
if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 96; then
break
elif $ac_last_try; then
{ { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
@ -21798,7 +21831,7 @@ fi
cat >>$CONFIG_STATUS <<_ACEOF
cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof
/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end
/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
_ACEOF
sed '
s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
@ -21811,8 +21844,6 @@ N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
' >>$CONFIG_STATUS <conf$$subs.sed
rm -f conf$$subs.sed
cat >>$CONFIG_STATUS <<_ACEOF
:end
s/|#_!!_#|//g
CEOF$ac_eof
_ACEOF
@ -22060,7 +22091,7 @@ s&@abs_builddir@&$ac_abs_builddir&;t t
s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
s&@INSTALL@&$ac_INSTALL&;t t
$ac_datarootdir_hack
" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out
" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" | sed 's/|#_!!_#|//g' >$tmp/out
test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
{ ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&

View File

@ -2,6 +2,14 @@
# large and three small executables. This is done to minimize memory load
# in parallel builds. Please retain this ordering.
# If polly exists and is not disabled compile it and add it to the LLVM tools.
option(LLVM_BUILD_POLLY "Compile polly" ON)
if( EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/polly/CMakeLists.txt )
if (LLVM_BUILD_POLLY)
add_subdirectory( ${CMAKE_CURRENT_SOURCE_DIR}/polly)
endif (LLVM_BUILD_POLLY)
endif( EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/polly/CMakeLists.txt )
if( NOT WIN32 OR MSYS OR CYGWIN )
# It is useful to build llvm-config before the other tools, so we
# have a fresh LibDeps.txt for regenerating the hard-coded library

View File

@ -57,4 +57,8 @@ ifeq ($(ENABLE_PIC),1)
endif
endif
ifdef LLVM_HAS_POLLY
PARALLEL_DIRS += polly
endif
include $(LEVEL)/Makefile.common