diff options
author | Andrew Hsieh <andrewhsieh@google.com> | 2012-12-14 20:45:28 +0800 |
---|---|---|
committer | Andrew Hsieh <andrewhsieh@google.com> | 2012-12-15 10:44:17 +0800 |
commit | dc45268b598c3ba3dc12ceee516ea83b37b929c7 (patch) | |
tree | f2ec517525de6958720ba7a2290d4c8b9031ddcd | |
parent | e9ba2efe4c3ce6cf16ce15fecce3afd7869038ef (diff) | |
download | build-dc45268b598c3ba3dc12ceee516ea83b37b929c7.tar.gz |
Allow enabling graphite in GCC 4.6/4.7
To enable, configure with additional flags:
--enable-graphite=yes \
--with-cloog-version=$CLOOG_VERSION \
--with-ppl-version=$PPL_VERSION
Change-Id: I1400aecbf762c7ad5d72609ec87cc7a555061c8f
-rw-r--r-- | Makefile.in | 52 | ||||
-rwxr-xr-x | configure | 7 | ||||
-rw-r--r-- | configure.ac | 7 |
3 files changed, 51 insertions, 15 deletions
diff --git a/Makefile.in b/Makefile.in index c676d8e..d96f042 100644 --- a/Makefile.in +++ b/Makefile.in @@ -60,6 +60,7 @@ GCC_MIN_VERSION_4_5_0:=@GCC_MIN_VERSION_4_5_0@ GDB_MIN_VERSION_7_2:=@GDB_MIN_VERSION_7_2@ BINUTILS_MIN_VERSION_2_21:=@BINUTILS_MIN_VERSION_2_21@ GOLD_MIN_VERSION_2_21:=@GOLD_MIN_VERSION_2_21@ +CLOOG_BACKEND:=@CLOOG_BACKEND@ ENABLE_GRAPHITE:=@ENABLE_GRAPHITE@ PACKAGE_TO_SRCDIR:=@package_to_srcdir@ BUILD_ANDROID_GCC:=@BUILD_ANDROID_GCC@ @@ -286,11 +287,18 @@ BINUTILS_CONFIG_ARGS=--prefix=$(prefix) \ $(baseargs) --disable-shared --disable-nls ifeq ($(ENABLE_GRAPHITE),yes) BINUTILS_CONFIG_ARGS+= --with-cloog=${CLOOG_DIR} --with-gmp=${GMP_DIR} \ - --disable-ppl-version-check --disable-cloog-version-check + --disable-ppl-version-check --disable-cloog-version-check $(CLOOG_BACKEND) # links to the static C++ runtime to avoid depending on the host version +ifneq ($(host_os),darwin) BINUTILS_CONFIG_ARGS+= \ '--with-host-libstdcxx=-static-libgcc \ -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' +else +# In darwin ld doesn't allow both -static and -dynamic. Instead, we rely on explicit +# "-isysroot $(mac_sdk_root) -mmacosx-version-min=$(mac_sdk_version)" to establish +# minimal sdk version toolchain will run +GCC_CONFIG_ARGS += '--with-host-libstdcxx=-static-libgcc -lstdc++ -lm' +endif endif # Enable dual linker support and make gold as default linker when gold is # enabled. Notice that our binutils take different --enable-gold=xxx options. @@ -307,7 +315,7 @@ BINUTILS_CONFIG_ARGS += --enable-gold=both/ld endif endif endif -stmp-config-target-binutils: config.status $(canadian_stmp) +stmp-config-target-binutils: config.status stmp-install-host-ppl $(canadian_stmp) ([ -d ${BINUTILS_VERSION} ] || \ mkdir ${BINUTILS_VERSION}) && \ ($(canadian_env) \ @@ -420,12 +428,19 @@ endif # For gcc 4.5+ with graphite optimization, cloog and ppl are required. ifeq ($(ENABLE_GRAPHITE),yes) GCC_CONFIG_ARGS += --with-cloog=${CLOOG_DIR} --with-ppl=${PPL_DIR} \ - --disable-ppl-version-check --disable-cloog-version-check + --disable-ppl-version-check --disable-cloog-version-check $(CLOOG_BACKEND) # links to the static C++ runtime to avoid depending on the host version +ifneq ($(host_os),darwin) GCC_CONFIG_ARGS += \ '--with-host-libstdcxx=-static-libgcc \ -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' else +# In darwin ld doesn't allow both -static and -dynamic. Instead, we rely on explicit +# "-isysroot $(mac_sdk_root) -mmacosx-version-min=$(mac_sdk_version)" to establish +# minimal sdk version toolchain will run +GCC_CONFIG_ARGS += '--with-host-libstdcxx=-static-libgcc -lstdc++ -lm' +endif +else # Disable ppl and cloog just in case the host have them install. GCC_CONFIG_ARGS += --without-ppl --without-cloog endif @@ -492,7 +507,7 @@ GCC_CONFIG_ARGS += $(ENABLE_GOLD) endif # We have to add -mandroid in target CFLAGS and CXXFLAGS -stmp-config-target-gcc: config.status stmp-build-target-binutils +stmp-config-target-gcc: config.status stmp-install-host-ppl stmp-build-target-binutils ([ -d ${GCC_VERSION} ] || \ mkdir ${GCC_VERSION}) && \ ($(canadian_env) \ @@ -652,23 +667,31 @@ config-host-ppl: stmp-config-host-ppl PPL_CONFIG_ARGS=$(host_baseargs) --prefix=$(TEMP_INSTALLDIR) --disable-shared \ --target=${target_alias} \ --host=${host} --build=${build} \ - --disable-nls --with-gmp-prefix=$(GMP_DIR) \ - --disable-watchdog \ + --disable-nls --with-libgmp-prefix=$(GMP_DIR) \ + --disable-watchdog --without-java \ --disable-ppl_lcdd --disable-ppl_lpsol --disable-ppl_pips stmp-config-host-ppl: config.status stmp-install-host-gmp ([ -d ${PPL_VERSION} ] || \ mkdir ${PPL_VERSION}) && \ ($(canadian_env) \ cd ${PPL_VERSION} ; \ + export CFLAGS="${CFLAGS} -m32 -I$(GMP_DIR)/include" ; \ + export CXXFLAGS="${CFLAGS} -m32 -I$(GMP_DIR)/include" ; \ $(call find-package-srcdir, ${PPL_VERSION})/configure \ $(PPL_CONFIG_ARGS)) && \ $(STAMP) $@ stmp-build-host-ppl: stmp-config-host-ppl $(MAKE) -C ${PPL_VERSION} && $(STAMP) $@ build-host-ppl: stmp-build-host-ppl + +ifeq ($(ENABLE_GRAPHITE),yes) stmp-install-host-ppl: stmp-build-host-ppl $(MAKE) -C ${PPL_VERSION} install && \ $(STAMP) $@ +else +stmp-install-host-ppl: + $(STAMP) $@ +endif install-host-ppl: stmp-install-host-ppl # host cloog rules @@ -677,10 +700,10 @@ config-host-cloog: stmp-config-host-cloog CLOOG_CONFIG_ARGS=$(host_baseargs) --prefix=$(TEMP_INSTALLDIR) --disable-shared \ --target=${target_alias} \ --host=${host} --build=${build} \ - --disable-nls \ - --with-gmp=$(GMP_DIR) + --disable-nls # for cloog-ppl version 0.15.x, ppl is required. ifneq ($(findstring ppl-,$(CLOOG_VERSION)),) +CLOOG_TARGET = libcloog.la stmp-config-host-cloog: config.status stmp-install-host-ppl \ stmp-install-host-ppl-workaround stmp-install-host-ppl-workaround: @@ -689,7 +712,10 @@ stmp-install-host-ppl-workaround: sed -i -e 's/PPL_VERSION_MINOR 11/PPL_VERSION_MINOR 10/' \ $(PPL_DIR)/include/ppl_c.h $(STAMP) $@ -CLOOG_CONFIG_ARGS+= --with-ppl=$(PPL_DIR) +CLOOG_CONFIG_ARGS+= --with-gmp=$(GMP_DIR) --with-ppl=$(PPL_DIR) +else +CLOOG_TARGET = libcloog-isl.la +CLOOG_CONFIG_ARGS+= --with-gmp-prefix=$(GMP_DIR) endif stmp-config-host-cloog: config.status stmp-install-host-gmp ([ -d ${CLOOG_VERSION} ] || \ @@ -701,12 +727,16 @@ stmp-config-host-cloog: config.status stmp-install-host-gmp $(STAMP) $@ stmp-build-host-cloog: stmp-config-host-cloog # Ignore the generation of cloog utilities - $(MAKE) -C ${CLOOG_VERSION} libcloog.la && \ + $(MAKE) -C ${CLOOG_VERSION} $(CLOOG_TARGET) && \ $(STAMP) $@ build-host-cloog: stmp-build-host-cloog stmp-install-host-cloog: stmp-build-host-cloog $(MAKE) -C ${CLOOG_VERSION} install-libLTLIBRARIES \ - install-pkgincludeHEADERS && \ + install-pkgincludeHEADERS +ifeq ($(findstring ppl-,$(CLOOG_VERSION)),) + $(MAKE) -C ${CLOOG_VERSION}/isl install-libLTLIBRARIES \ + install-pkgincludeHEADERS +endif $(STAMP) $@ install-host-cloog: stmp-install-host-cloog @@ -563,6 +563,7 @@ EXPAT_VERSION GDB_MIN_VERSION_7_2 GDB_VERSION CLOOG_VERSION +CLOOG_BACKEND PPL_VERSION MPC_VERSION MPFR_VERSION @@ -2206,6 +2207,7 @@ if test "${enable_graphite+set}" = set; then : enableval=$enable_graphite; fi +graphite=yes if test x${enableval} != xyes; then graphite=no fi @@ -2656,8 +2658,9 @@ case $CLOOG_VERSION in # CLooG/PPL relies on the PPL for version 0.15.x CLOOG_VERSION="ppl-$CLOOG_VERSION" ;; - 0.16*) - # CLooG 0.16.x has its own embedded polyhedral library + 0.16*|0.17*) + # CLooG 0.16+ has its own embedded polyhedral library + CLOOG_BACKEND="--enable-cloog-backend=isl" ;; *) as_fn_error "Unsupported cloog version" "$LINENO" 5; diff --git a/configure.ac b/configure.ac index e8a8fd1..03c5128 100644 --- a/configure.ac +++ b/configure.ac @@ -230,6 +230,7 @@ ENABLE_GRAPHITE=no AC_ARG_ENABLE([graphite], AC_HELP_STRING([--enable-graphite], [Enable Graphite optimization @<:@default=no@:>@])) +graphite=yes if test x${enableval} != xyes; then graphite=no fi @@ -475,12 +476,14 @@ case $CLOOG_VERSION in # CLooG/PPL relies on the PPL for version 0.15.x CLOOG_VERSION="ppl-$CLOOG_VERSION" ;; - 0.16*) - # CLooG 0.16.x has its own embedded polyhedral library + 0.16*|0.17*) + # CLooG 0.16+ has its own embedded polyhedral library + CLOOG_BACKEND="--enable-cloog-backend=isl" ;; *) AC_MSG_ERROR(Unsupported cloog version); esac +AC_SUBST(CLOOG_BACKEND) ANDROID_CHECK_PACKAGE(cloog-${CLOOG_VERSION}) fi AC_SUBST(CLOOG_VERSION) |