GMP = $(shell grep ^PKG_VER $(DIR_LFS)/gmp | awk '{ print $$3 }')
MPFR = $(shell grep ^PKG_VER $(DIR_LFS)/mpfr | awk '{ print $$3 }')
+ifneq "$(STAGE)" "base"
ifeq "$(MACHINE)" "i586"
CONFIGURE_ARGS = --disable-decimal-float
endif
+endif
+
+ifeq "$(MACHINE)" "x86_64"
+ CONFIGURE_ARGS = --without-cloog --without-ppl --disable-multilib
+endif
+
+ifneq "$(MACHINE)" "x86_64"
+ CONFIG_CPU = --with-cpu=$(MACHINE) --with-arch=$(MACHINE)
+endif
###############################################################################
# Top-level Rules
## Enable -fPIC by default
cd $(DIR_APP) && sed 's/^\(#define CC1_SPEC.*\)\("\)$$/\1 %{fno-pic|fpic|fPIC:;:-fPIC}\2/' \
-i gcc/config/i386/linux.h
+ cd $(DIR_APP) && sed 's/^\(#define CC1_SPEC.*\)\("\)$$/\1 %{fno-pic|fpic|fPIC:;:-fPIC}\2/' \
+ -i gcc/config/i386/x86-64.h
# libssp has no use with new versions of Glibc. Glibc completely replaces all
# functions in libssp, linking to libssp will cause conflicts with libc, so
../$(THISAPP)/configure \
$(CONFIGURE_ARCH) \
--target=$(IFS_TARGET) \
- --with-cpu=$(MACHINE) \
- --with-arch=$(MACHINE) \
+ $(CONFIG_CPU) \
--prefix=$(TOOLS_DIR) \
--with-local-prefix=$(TOOLS_DIR) \
--libexecdir=$(TOOLS_DIR)/lib \
touch $$file.orig; \
done
+ifeq "$(MACHINE)" "x86_64"
+ # Remove multilib options and searchpath (/lib... /usr/lib...)
+ cd $(DIR_APP) && echo "" > gcc/config/i386/t-linux64
+ ## Enable -fPIC by default (why i have to do this again ???)
+ cd $(DIR_APP) && sed 's/^\(#define CC1_SPEC.*\)\("\)$$/\1 %{fno-pic|fpic|fPIC:;:-fPIC}\2/' \
+ -i gcc/config/i386/x86-64.h
+endif
+
# Libgomp uses -Werror regardless of --disable-werror, and this will cause a
# build failure when -D_FORTIFY_SOURCE=2 causes build time warnings:
cd $(DIR_APP) && sed -e "s/-Werror//" -i libgomp/configure
../$(THISAPP)/configure \
$(CONFIGURE_ARCH) \
--target=$(IFS_TARGET) \
- --with-cpu=$(MACHINE) \
- --with-arch=$(MACHINE) \
+ $(CONFIG_CPU) \
--prefix=$(TOOLS_DIR) \
--with-local-prefix=$(TOOLS_DIR) \
--libexecdir=$(TOOLS_DIR)/lib \
../$(THISAPP)/configure \
$(CONFIGURE_ARCH) \
--target=$(IFS_TARGET) \
- --with-cpu=$(MACHINE) \
- --with-arch=$(MACHINE) \
+ $(CONFIG_CPU) \
--prefix=/usr \
--libexecdir=/usr/lib \
--enable-espf \
--disable-bootstrap \
--disable-werror \
--disable-libssp \
- --disable-static
+ --disable-static \
+ $(CONFIGURE_ARGS)
cd $(DIR_SRC)/gcc-build && make $(PARALLELISMFLAGS)
cd $(DIR_SRC)/gcc-build && make install
emphasizes speed over simplicity/elegance in its operations.
endef
+ifeq "$(MACHINE)" "x86_64"
+ ABI = 64
+else
+ ABI = 32
+endif
###############################################################################
# Top-level Rules
###############################################################################
$(OBJECT): $(objects)
@$(PREBUILD)
@rm -rf $(DIR_APP) && cd $(DIR_SRC) && $(EXTRACTOR) $(DIR_DL)/$(DL_FILE)
- cd $(DIR_APP) && ABI=32 \
+ cd $(DIR_APP) && ABI=$(ABI) \
./configure \
$(CONFIGURE_ARCH) \
--prefix=/usr \
# Default target
TARGET=${TARGET-i686}
-POSSIBLE_TARGETS="i686 i586 i486 via-c7 via-c3 geodelx atom core2duo"
+POSSIBLE_TARGETS="i686 i586 i486 via-c7 via-c3 geodelx atom core2duo x86_64"
# Configuration rootdir
CONFIG_ROOT=/etc/$SNAME
CFLAGS="-Os -march=geode $GLOBAL_CFLAGS"
CXXFLAGS="${CFLAGS}"
ICECC=off
+elif [ 'x86_64' = $TARGET ]; then
+ MACHINE=x86_64
+ IFS_TARGET="${MACHINE}-pc-linux-gnu"
+ CFLAGS="-Os $GLOBAL_CFLAGS"
+ CXXFLAGS="${CFLAGS}"
+ LINKER=/lib64/ld-linux-x86-64.so.2
else
beautify message FAIL
echo "Not a valid target arch ($POSSIBLE_TARGETS) - $TARGET"