view src/ocaml-flexdll.mk @ 5531:eae508c12529

Add build rule for build-octave (bug #49503). * src/build-octave.mk: Add new build rule for build-octave which can be used for cross-building binary packages that depend on Octave as a build tool. * dist-files.mk: Add new file to list. * index.html: Add new package to list. * src/of-communications.mk, src/of-image.mk, src/of-mapping.mk, src/of-optiminterp.mk, src/of-sparsersb.mk, src/of-statistics.mk, src/of-windows.mk: Add optional dependency on build-octave. * configure.ac: Add new configure switch "--disable-system-octave" that is needed to build the build-octave package. * Makefile.in: Add variable "USE_SYSTEM_OCTAVE". Exclude build-octave from the default build tools and build it only if a package explicitly depends on it. Display warning about missing native Octave version only if necessary.
author Markus Mützel <markus.muetzel@gmx.de>
date Tue, 08 Sep 2020 23:04:38 +0200
parents 13be64f9f16d
children
line wrap: on
line source

# This file is part of mingw-cross-env.
# See doc/index.html for further information.

# zlib
PKG				:= ocaml-flexdll
$(PKG)_IGNORE	:=
$(PKG)_VERSION  := 0.30
$(PKG)_CHECKSUM := 585f066f890c7dca95be7541b4647128335f7df9
$(PKG)_SUBDIR	:= flexdll
$(PKG)_FILE		:= flexdll-$($(PKG)_VERSION).tar.gz
$(PKG)_URL		:= http://alain.frisch.fr/flexdll/$($(PKG)_FILE)
$(PKG)_DEPS		:= ocaml-native

define $(PKG)_UPDATE
	wget -q -O- 'http://alain.frisch.fr/flexdll/' | \
	$(SED) -n 's,.*flexdll-\([0-9][^>]*\)\.tar.gz.*,\1,ip' | \
	head -1
endef

define $(PKG)_BUILD
	$(MAKE) -C '$(1)' -j '$(JOBS)' \
		CHAINS=mingw \
		MINGW_PREFIX=$(TARGET) \
		OCAMLOPT=$(HOST_BINDIR)/ocaml-native/ocamlopt \
		all
	mkdir -p '$(HOST_LIBDIR)/ocaml/flexdll'
	cd '$(1)' && mv flexlink.exe flexlink
	cd '$(1)' && strip --remove-section=.comment --remove-section=.note flexlink
	cd '$(1)' && $(INSTALL) -m 0755 flexdll.h '$(HOST_INCDIR)'
	cd '$(1)' && $(INSTALL) -m 0755 flexlink flexdll_mingw.o \
		flexdll_initer_mingw.o \
		'$(HOST_LIBDIR)/ocaml/flexdll'
	# create flexdll scripts
	cd '$(BUILD_TOOLS_PREFIX)/bin' && $(LN_SF) '$(HOST_LIBDIR)/ocaml/flexdll/flexlink'
	(echo '#!/bin/sh'; \
	 echo 'exec flexlink -I $(HOST_LIBDIR) -chain mingw -nocygpath "$$@"') \
			> '$(BUILD_TOOLS_PREFIX)/bin/$(MXE_TOOL_PREFIX)flexlink'
	chmod 0755 '$(BUILD_TOOLS_PREFIX)/bin/$(MXE_TOOL_PREFIX)flexlink'

	echo "testing flexlink..."
	$(MAKE) -C '$(1)/test' -j '$(JOBS)' dump.exe plug1.dll plug2.dll CC=$(MXE_CC) O=o FLEXLINK=$(MXE_TOOL_PREFIX)flexlink
	#works if wine is installed :
	#cd '$(1)/test' && ./dump.exe plug1.dll plug2.dll
endef