Date:2010-07-28 02:02:56 (10 years 6 months ago)
Author:David K├╝hling
Commit:23955b4887f6ae2c38cf27c7603d7b1acc048893
Message:fixed various major and minor build problems. Host forth build dependency now fixed? Added comments about what we're actually doing

Files: gforth/Makefile (3 diffs)

Change Details

gforth/Makefile
66
77PKG_NAME:=gforth
88PKG_VERSION:=0.7.0-20100725
9PKG_RELEASE:=3
9PKG_RELEASE:=4
1010
1111PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
1212PKG_SOURCE_URL:=http://mosquito.dyndns.tv/~spock/
1313PKG_MD5SUM:=f030bdfe42a9be32889d5b4c8cb37856
1414
15PKG_BUILD_DEPENDS:= gforth/host libldtl/host
15PKG_BUILD_DEPENDS:= gforth/host libltdl/host
1616PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
1717
18include $(INCLUDE_DIR)/package.mk
1918include $(INCLUDE_DIR)/host-build.mk
19include $(INCLUDE_DIR)/package.mk
2020
2121# for now: override download and use local gforth sources
2222# remove the prepare.stamp if updating tgz
...... 
4444
4545HOST_CONFIGURE_VARS += LTDL_LIBRARY_PATH=$(STAGING_DIR_HOST)/lib
4646
47# found this in the libtool Makefile. does it help us?
48#export GLOBAL_LIBDIR=$(STAGING_DIR)/usr/lib
47## The host-GForth uses -ltdl to link against the staging dir version of
48## libltdl. However, when the host-GForth runs, it won't find that library,
49## as no library path is encoded into the ltdl dependency (why?). So here we
50## override LD_LIBRARY_PATH for all the build steps that might run the
51## host-GForth.
4952
5053define Host/Configure
51    export LD_LIBRARY_PATH=$(STAGING_DIR_HOST)/lib; $(call Host/Configure/Default)
54    export LD_LIBRARY_PATH=$(STAGING_DIR_HOST)/lib; \
55    $(call Host/Configure/Default)
5256endef
5357
54# define Host/Compile
55# $(MAKE) -C $(HOST_BUILD_DIR)
56# endef
58define Host/Compile
59    export LD_LIBRARY_PATH=$(STAGING_DIR_HOST)/lib; \
60    $(call Host/Compile/Default)
61endef
5762
58# define Host/Install
59# $(MAKE) -C $(HOST_BUILD_DIR) \
60# DESTDIR="$(STAGING_DIR_HOST)" \
61# install
62# endef
63define Host/Install
64    export LD_LIBRARY_PATH=$(STAGING_DIR_HOST)/lib; \
65    $(call Host/Install/Default)
66endef
6367
6468# todo: skipcode=
6569# todo: compiler options / tuning (openwrt sets bad defaults?)
70# todo: either gcc 3.4 or -Os makes primitives use doubly-indirect dispatch :(
6671
72CROSS_PREFORTH=$(PKG_BUILD_DIR)/preforth
73
74## here we call configure, then patch the cross-GForth source tree to replace
75## the 'preforth' script with a script that calls our host-compiled GForth
6776define Build/Configure
6877    $(call Build/Configure/Default,)
69    echo "#!/bin/sh" > $(PKG_BUILD_DIR)/preforth
70    echo '$(STAGING_DIR_HOST)/bin/gforth -i $(STAGING_DIR_HOST)/lib/gforth/$(PKG_VERSION)/gforth.fi "$$$$@"' >> $(PKG_BUILD_DIR)/preforth
78    echo "#!/bin/sh" > $(CROSS_PREFORTH)
79    echo "export LD_LIBRARY_PATH=$(STAGING_DIR_HOST)/lib;" >> $(CROSS_PREFORTH)
80    echo '$(STAGING_DIR_HOST)/bin/gforth -i $(STAGING_DIR_HOST)/lib/gforth/$(PKG_VERSION)/gforth.fi "$$$$@"' >> $(CROSS_PREFORTH)
7181    chmod a+x $(PKG_BUILD_DIR)/preforth
7282endef
7383
84## Compilation is pretty manual to only build the parts we need. By default
85## the GForth Makefile attempts to auto-tune by recursively calling itself for
86## compilation, then running the GForth binary through unit-tests. This won't
87## work with a cross-compile environment
7488define Build/Compile
7589    $(MAKE) -C $(PKG_BUILD_DIR) kernel/version.fs gforth-ditc \
7690        engine/prim-fast.i engine/prim_lab-fast.i engine/prim_names-fast.i \
...... 
8498        cp engine/gforth-fast-ll-reg ./gforth-fast
8599endef
86100
101##
102## define lists of GForth's sources to package for loading in the target system
103##
104
87105STARTUP = exboot.fs startup.fs arch/mips/asm.fs arch/mips/disasm.fs
88106
89107GFORTH_FI_SRC = \

Archive Download the corresponding diff file



interactive