###############################################################################
# #
# 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
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
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)