]> git.ipfire.org Git - ipfire-3.x.git/commitdiff
Binutils...
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 11 Jun 2008 08:48:50 +0000 (10:48 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 11 Jun 2008 08:48:50 +0000 (10:48 +0200)
lfs/binutils

index 00f0bc871d5e3149ed88936edebbe6856bda4213..8ad8f753cdf48c41968967cc71411dd3fce92fb7 100644 (file)
@@ -45,7 +45,9 @@ endif
 # Top-level Rules
 ###############################################################################
 
-objects = $(DL_FILE) $(THISAPP)-configure-1.patch
+objects = $(DL_FILE) $(THISAPP)-configure-1.patch \
+       $(THISAPP)-pt_pax-1.patch \
+       $(THISAPP)-lazy-1.patch
 
 install : $(TARGET)
 
@@ -64,84 +66,57 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        -mkdir -v $(DIR_SRC)/binutils-build
        cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/$(THISAPP)-configure-1.patch
 
-ifeq "$(firstword $(MAKEFILE_LIST))" "$(PKG_NAME)"
-       #
-       #       Normal build
-       #
-
+ifeq "$(STAGE)" "toolchain"
 ifeq "$(PASS)" "1"
-ifeq "$(MACHINE)" "$(MACHINE_REAL)"
-       cd $(DIR_SRC)/binutils-build && CC="gcc -B/usr/bin/" ../$(THISAPP)/configure \
-                                                                                                                                               --prefix=$(TOOLS_DIR) \
-                                                                                                                                               --disable-nls \
-                                                                                                                                               --disable-werror
-                                                                                                                                               
-       cd $(DIR_SRC)/binutils-build && make -j $(PARALLELISM)
-       cd $(DIR_SRC)/binutils-build && make install
-       cd $(DIR_SRC)/binutils-build && make -C ld clean
-       cd $(DIR_SRC)/binutils-build && make -C ld LIB_PATH=$(TOOLS_DIR)/lib
-       cd $(DIR_SRC)/binutils-build && cp -v ld/ld-new $(TOOLS_DIR)/bin
-else
-       #
-       # Cross build
-       #
-       cd $(DIR_SRC)/binutils-build && ../$(THISAPP)/configure \
-                                                                                                                                               --prefix=$(TOOLS_DIR) \
-                                                                                                                                               --build=${IFS_HOST} \
-                                                                                                                                               --host=${IFS_TARGET} \
-                                                                                                                                               --target=${IFS_TARGET} \
-                                                                                                                                               --disable-nls \
-                                                                                                                                               --enable-shared \
-                                                                                                                                               --disable-multilib
-       
-       cd $(DIR_SRC)/binutils-build && make configure-host                                                                                                                                     
+       cd $(DIR_SRC)/binutils-build && \
+               ../$(THISAPP)/configure \
+                       --target=$(IFS_TARGET) \
+                       --prefix=$(TOOLS_DIR) \
+                       --disable-nls \
+                       --disable-werror
        cd $(DIR_SRC)/binutils-build && make -j $(PARALLELISM)
        cd $(DIR_SRC)/binutils-build && make install
-endif
+
+       cd $(TOOLS_DIR)/$(IFS_TARGET)/bin; \
+               if [ "$(IFS_TARGET)" == "$$($(DIR_APP)/config.guess)" ]; then \
+                       for t in $$(ls -1); do \
+                               ln -sfv $${t} $(TOOLS_DIR)/bin/$(IFS_TARGET)-$${t}; \
+                       done; \
+               fi
 endif
 
 ifeq "$(PASS)" "2"
-       cd $(DIR_SRC)/binutils-build && ../$(THISAPP)/configure \
-                                                                                                                                               --prefix=$(TOOLS_DIR) \
-                                                                                                                                               --disable-nls \
-                                                                                                                                               --with-lib-path=$(TOOLS_DIR)/lib
-                                                                                                                                               
+       cd $(DIR_SRC)/binutils-build && \
+               CC="$(IFS_TARGET)-gcc -B$(TOOLS_DIR)/lib/" \
+               AR=$(IFS_TARGET)-ar \
+               RANLIB=$(IFS_TARGET)-ranlib \
+               ../$(THISAPP)/configure \
+                       --prefix=$(TOOLS_DIR) \
+                       --disable-nls \
+                       --with-lib-path=$(TOOLS_DIR)/lib
        cd $(DIR_SRC)/binutils-build && make -j $(PARALLELISM)
        cd $(DIR_SRC)/binutils-build && make install
-       
+
        cd $(DIR_SRC)/binutils-build && make -C ld clean
        cd $(DIR_SRC)/binutils-build && make -C ld LIB_PATH=/usr/lib:/lib
        cd $(DIR_SRC)/binutils-build && cp -v ld/ld-new $(TOOLS_DIR)/bin
 endif
+endif
 
 ifeq "$(STAGE)" "base"
-       cd $(DIR_SRC)/binutils-build && ../$(THISAPP)/configure --prefix=/usr \
-               --enable-shared
+ifeq "$(PAX)" "1"
+       cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/$(THISAPP)-pt_pax-1.patch
+endif
+       cd $(DIR_SRC)/binutils-build && \
+               CC="gcc -specs=$$(dirname $$(gcc --print-libgcc-file-name))/myspecs -B/usr/lib/ -B/usr/bin/" \
+               ../$(THISAPP)/configure \
+                       --prefix=/usr \
+                       --enable-shared \
+                       --disable-werror
        cd $(DIR_SRC)/binutils-build && make tooldir=/usr -j $(PARALLELISM)
        cd $(DIR_SRC)/binutils-build && make tooldir=/usr install
-       
-       cp -fv ../$(THISAPP)/include/libiberty.h /usr/include
-endif
 
-else
-       #
-       # Cross build
-       #
-
-       cd $(DIR_SRC)/binutils-build && AR=ar AS=as ../$(THISAPP)/configure \
-                                                                                                                                                                                               --prefix=$(CTOOLS_DIR) \
-                                                                                                                                                                                               --host=${IFS_HOST} \
-                                                                                                                                                                                               --target=${IFS_TARGET} \
-                                                                                                                                                                                               --with-lib-path=$(TOOLS_DIR)/lib \
-                                                                                                                                                                                               --disable-nls \
-                                                                                                                                                                                               --enable-shared \
-                                                                                                                                                                                               --disable-multilib
-       cd $(DIR_SRC)/binutils-build && make configure-host
-       cd $(DIR_SRC)/binutils-build && make -j $(PARALLELISM)
-       cd $(DIR_SRC)/binutils-build && make install
-       
-       -mkdir -p $(TOOLS_DIR)/include
-       cp -fv $(DIR_APP)/include/libiberty.h $(TOOLS_DIR)/include
+       cp -fv ../$(THISAPP)/include/libiberty.h /usr/include
 endif
 
        @rm -rf $(DIR_APP) $(DIR_SRC)/binutils-build