]> git.ipfire.org Git - ipfire-3.x.git/blobdiff - lfs/test-toolchain
Renamed some fields...
[ipfire-3.x.git] / lfs / test-toolchain
index 1b03bd7b8d1c74428e6da4f0b8f210e5693632f0..57657d69dd339ca4cb336f0cdbf395d93407aa9e 100644 (file)
@@ -1,7 +1,7 @@
 ###############################################################################
 #                                                                             #
 # IPFire.org - A linux based firewall                                         #
-# Copyright (C) 2007  Michael Tremer & Christian Schmidt                      #
+# Copyright (C) 2007, 2008, 2009 Michael Tremer & Christian Schmidt           #
 #                                                                             #
 # This program is free software: you can redistribute it and/or modify        #
 # it under the terms of the GNU General Public License as published by        #
 include Config
 
 PKG_NAME   = test-toolchain
-VER        = LFS
+PKG_VER    =
+PKG_REL    = -1
 
-THISAPP    = $(PKG_NAME)-$(VER)
+THISAPP    = $(PKG_NAME)
 
-TARGET     = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP)-pass$(PASS)
+ifeq "$(STAGE)" "toolchain"
+       OBJECT = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP)-pass$(PASS)
+else
+       OBJECT = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP)
+endif
+
+MAINTAINER =
+GROUP      =
+EXTRA      = no
+DEBUG      = no
+DEPS       =
+
+URL        =
+LICENSE    =
+SHORT_DESC = This script does some sanity checks on the toolchain.
+
+define LONG_DESC
+       This script does some sanity checks on the toolchain.
+endef
 
 ###############################################################################
 # Top-level Rules
@@ -37,18 +56,27 @@ TARGET     = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP)-pass$(PASS)
 
 objects = 
 
-install : $(TARGET)
+download: $(objects)
 
-download : 
+info:
+       $(DO_PKG_INFO)
 
+install: $(OBJECT)
+
+package:
+       @$(DO_PACKAGE)
+
+$(objects):
+       @$(LOAD)
 
 ###############################################################################
 # Installation Details
 ###############################################################################
 
-$(TARGET) : 
+$(OBJECT): $(objects)
        @$(PREBUILD)
-       
+
+ifeq "$(STAGE)" "toolchain"
 ifeq "$(PASS)" "1"
        cd $(DIR_TMP) && \
                echo 'main(){}' | $(IFS_TARGET)-gcc -B $(TOOLS_DIR)/lib/ -x c - -lrt
@@ -63,5 +91,24 @@ ifeq "$(PASS)" "2"
                echo Oops; exit 1; \
        fi
 endif
+endif
+
+ifeq "$(STAGE)" "base"
+       # Sanity checks.
+       cd $(DIR_TMP) && \
+               echo 'main(){}' | cc -x c -specs=$$(dirname $$(gcc --print-libgcc-file-name))/myspecs \
+                       -B/usr/lib/ -B/usr/bin/ -Wl,--verbose - -lrt &> foo
+       # 1. dynamic linker
+       cd $(DIR_TMP) && readelf -l a.out | grep ": /lib"
+
+       # 2. start files
+       cd $(DIR_TMP) && grep " /usr/lib/Scrt1.o succ" foo
+
+       # 3. libc
+       cd $(DIR_TMP) && grep " /lib.*libc.so.6 succ" foo
+
+       # 4. deps found from DT_NEEDED
+       cd $(DIR_TMP) && grep "^found.*at /lib.*/libpth" foo
+endif
 
        @$(POSTBUILD)