mirror of
git://projects.qi-hardware.com/openwrt-packages.git
synced 2024-11-17 21:33:43 +02:00
fixed various major and minor build problems. Host forth build dependency now
fixed? Added comments about what we're actually doing
This commit is contained in:
parent
c3604e02b2
commit
23955b4887
@ -6,17 +6,17 @@ include $(TOPDIR)/rules.mk
|
|||||||
|
|
||||||
PKG_NAME:=gforth
|
PKG_NAME:=gforth
|
||||||
PKG_VERSION:=0.7.0-20100725
|
PKG_VERSION:=0.7.0-20100725
|
||||||
PKG_RELEASE:=3
|
PKG_RELEASE:=4
|
||||||
|
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||||
PKG_SOURCE_URL:=http://mosquito.dyndns.tv/~spock/
|
PKG_SOURCE_URL:=http://mosquito.dyndns.tv/~spock/
|
||||||
PKG_MD5SUM:=f030bdfe42a9be32889d5b4c8cb37856
|
PKG_MD5SUM:=f030bdfe42a9be32889d5b4c8cb37856
|
||||||
|
|
||||||
PKG_BUILD_DEPENDS:= gforth/host libldtl/host
|
PKG_BUILD_DEPENDS:= gforth/host libltdl/host
|
||||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||||
|
|
||||||
include $(INCLUDE_DIR)/package.mk
|
|
||||||
include $(INCLUDE_DIR)/host-build.mk
|
include $(INCLUDE_DIR)/host-build.mk
|
||||||
|
include $(INCLUDE_DIR)/package.mk
|
||||||
|
|
||||||
# for now: override download and use local gforth sources
|
# for now: override download and use local gforth sources
|
||||||
# remove the prepare.stamp if updating tgz
|
# remove the prepare.stamp if updating tgz
|
||||||
@ -44,33 +44,47 @@ endef
|
|||||||
|
|
||||||
HOST_CONFIGURE_VARS += LTDL_LIBRARY_PATH=$(STAGING_DIR_HOST)/lib
|
HOST_CONFIGURE_VARS += LTDL_LIBRARY_PATH=$(STAGING_DIR_HOST)/lib
|
||||||
|
|
||||||
# found this in the libtool Makefile. does it help us?
|
## The host-GForth uses -ltdl to link against the staging dir version of
|
||||||
#export GLOBAL_LIBDIR=$(STAGING_DIR)/usr/lib
|
## libltdl. However, when the host-GForth runs, it won't find that library,
|
||||||
|
## as no library path is encoded into the ltdl dependency (why?). So here we
|
||||||
|
## override LD_LIBRARY_PATH for all the build steps that might run the
|
||||||
|
## host-GForth.
|
||||||
|
|
||||||
define Host/Configure
|
define Host/Configure
|
||||||
export LD_LIBRARY_PATH=$(STAGING_DIR_HOST)/lib; $(call Host/Configure/Default)
|
export LD_LIBRARY_PATH=$(STAGING_DIR_HOST)/lib; \
|
||||||
|
$(call Host/Configure/Default)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
# define Host/Compile
|
define Host/Compile
|
||||||
# $(MAKE) -C $(HOST_BUILD_DIR)
|
export LD_LIBRARY_PATH=$(STAGING_DIR_HOST)/lib; \
|
||||||
# endef
|
$(call Host/Compile/Default)
|
||||||
|
endef
|
||||||
|
|
||||||
# define Host/Install
|
define Host/Install
|
||||||
# $(MAKE) -C $(HOST_BUILD_DIR) \
|
export LD_LIBRARY_PATH=$(STAGING_DIR_HOST)/lib; \
|
||||||
# DESTDIR="$(STAGING_DIR_HOST)" \
|
$(call Host/Install/Default)
|
||||||
# install
|
endef
|
||||||
# endef
|
|
||||||
|
|
||||||
# todo: skipcode=
|
# todo: skipcode=
|
||||||
# todo: compiler options / tuning (openwrt sets bad defaults?)
|
# todo: compiler options / tuning (openwrt sets bad defaults?)
|
||||||
|
# todo: either gcc 3.4 or -Os makes primitives use doubly-indirect dispatch :(
|
||||||
|
|
||||||
|
CROSS_PREFORTH=$(PKG_BUILD_DIR)/preforth
|
||||||
|
|
||||||
|
## here we call configure, then patch the cross-GForth source tree to replace
|
||||||
|
## the 'preforth' script with a script that calls our host-compiled GForth
|
||||||
define Build/Configure
|
define Build/Configure
|
||||||
$(call Build/Configure/Default,)
|
$(call Build/Configure/Default,)
|
||||||
echo "#!/bin/sh" > $(PKG_BUILD_DIR)/preforth
|
echo "#!/bin/sh" > $(CROSS_PREFORTH)
|
||||||
echo '$(STAGING_DIR_HOST)/bin/gforth -i $(STAGING_DIR_HOST)/lib/gforth/$(PKG_VERSION)/gforth.fi "$$$$@"' >> $(PKG_BUILD_DIR)/preforth
|
echo "export LD_LIBRARY_PATH=$(STAGING_DIR_HOST)/lib;" >> $(CROSS_PREFORTH)
|
||||||
|
echo '$(STAGING_DIR_HOST)/bin/gforth -i $(STAGING_DIR_HOST)/lib/gforth/$(PKG_VERSION)/gforth.fi "$$$$@"' >> $(CROSS_PREFORTH)
|
||||||
chmod a+x $(PKG_BUILD_DIR)/preforth
|
chmod a+x $(PKG_BUILD_DIR)/preforth
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
## Compilation is pretty manual to only build the parts we need. By default
|
||||||
|
## the GForth Makefile attempts to auto-tune by recursively calling itself for
|
||||||
|
## compilation, then running the GForth binary through unit-tests. This won't
|
||||||
|
## work with a cross-compile environment
|
||||||
define Build/Compile
|
define Build/Compile
|
||||||
$(MAKE) -C $(PKG_BUILD_DIR) kernel/version.fs gforth-ditc \
|
$(MAKE) -C $(PKG_BUILD_DIR) kernel/version.fs gforth-ditc \
|
||||||
engine/prim-fast.i engine/prim_lab-fast.i engine/prim_names-fast.i \
|
engine/prim-fast.i engine/prim_lab-fast.i engine/prim_names-fast.i \
|
||||||
@ -84,6 +98,10 @@ define Build/Compile
|
|||||||
cp engine/gforth-fast-ll-reg ./gforth-fast
|
cp engine/gforth-fast-ll-reg ./gforth-fast
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
##
|
||||||
|
## define lists of GForth's sources to package for loading in the target system
|
||||||
|
##
|
||||||
|
|
||||||
STARTUP = exboot.fs startup.fs arch/mips/asm.fs arch/mips/disasm.fs
|
STARTUP = exboot.fs startup.fs arch/mips/asm.fs arch/mips/disasm.fs
|
||||||
|
|
||||||
GFORTH_FI_SRC = \
|
GFORTH_FI_SRC = \
|
||||||
|
Loading…
Reference in New Issue
Block a user