Skip to content

Commit c98405e

Browse files
committed
Package the sources as flexdll
The flexdll package is intended for use when building OCaml in "bootstrapped" flexdll mode and installs the required source files to the share folder in an opam switch. flexdll.opam is now the primary source for the version number for the package, and both version.ml and version.rc are compiled using the number taken from there.
1 parent 65be12d commit c98405e

4 files changed

Lines changed: 32 additions & 6 deletions

File tree

Makefile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
##
66

77

8-
VERSION = 0.43
8+
VERSION = \
9+
$(eval VERSION := $$(shell sed -ne 's/^version: *"\(.*\)"/\1/p' flexdll.opam))$(VERSION)
910

1011
all: flexlink.exe support
1112

@@ -33,7 +34,7 @@ MIN64CC = $(MINGW64_PREFIX)gcc
3334
CYGWIN64_PREFIX = x86_64-pc-cygwin-
3435
CYG64CC = $(CYGWIN64_PREFIX)gcc
3536

36-
version.ml: Makefile
37+
version.ml: Makefile flexdll.opam
3738
echo "let version = \"$(VERSION)\"" > version.ml
3839
echo "let mingw_prefix = \"$(MINGW_PREFIX)\"" >> version.ml
3940
echo "let mingw64_prefix = \"$(MINGW64_PREFIX)\"" >> version.ml
@@ -183,10 +184,10 @@ WINDRES_FLAGS = \
183184
-D FLEXDLL_VS_VERSION_INFO=$(FLEXDLL_VS_VERSION_INFO) \
184185
-D FLEXDLL_FULL_VERSION=\\\"$(FLEXDLL_FULL_VERSION)\\\"
185186

186-
version.res: version.rc Makefile
187+
version.res: version.rc flexdll.opam
187188
$(RES_PREFIX) rc /nologo $(RC_FLAGS) $<
188189

189-
version_res.o: version.rc Makefile
190+
version_res.o: version.rc flexdll.opam
190191
$(TOOLPREF)windres $(WINDRES_FLAGS) -i $< -o $@
191192

192193
flexdll_msvc.obj: flexdll.c flexdll.h
@@ -262,7 +263,7 @@ package_src:
262263
rm -Rf flexdll-$(VERSION)
263264
mkdir flexdll-$(VERSION)
264265
mkdir flexdll-$(VERSION)/test
265-
cp -a $(filter-out version.ml,$(OBJS:Compat.ml=Compat.ml.in)) Makefile msvs-detect $(COMMON_FILES) version.rc flexdll-$(VERSION)/
266+
cp -a $(filter-out version.ml,$(OBJS:Compat.ml=Compat.ml.in)) Makefile msvs-detect $(COMMON_FILES) version.rc flexdll.install flexdll.opam flexdll-$(VERSION)/
266267
cp -aR test/Makefile test/*.c flexdll-$(VERSION)/test/
267268
tar czf $(PACKAGE) flexdll-$(VERSION)
268269
rm -Rf flexdll-$(VERSION)

appveyor_build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ if [ "$ARTEFACTS" = 'yes' ] ; then
211211

212212
make package_bin installer
213213
SUFFIX="$(git describe)"
214-
VERSION="$(sed -ne 's/^VERSION *= *//p' Makefile)"
214+
VERSION="$(sed -ne 's/^version: *"\(.*\)"/\1/p' Makefile)"
215215
if [ "$SUFFIX" != "$VERSION" ] ; then
216216
mv "flexdll-bin-$VERSION.zip" "flexdll-bin-$SUFFIX.zip"
217217
mv "flexdll-$VERSION-setup.exe" "flexdll-$SUFFIX-setup.exe"

flexdll.install

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
share: [
2+
"Makefile"
3+
"cmdline.ml"
4+
"coff.ml"
5+
"Compat.ml.in"
6+
"create_dll.ml"
7+
"default.manifest"
8+
"default_amd64.manifest"
9+
"flexdll.c"
10+
"flexdll.h"
11+
"flexdll_initer.c"
12+
"reloc.ml"
13+
"version.rc"
14+
]

flexdll.opam

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
opam-version: "2.0"
2+
version: "0.43"
3+
authors: "Alain Frisch"
4+
maintainer: "David Allsopp <david@tarides.com>"
5+
bug-reports: "https://github.com/ocaml/flexdll/issues"
6+
dev-repo: "git+https://github.com/ocaml/flexdll.git"
7+
homepage: "https://github.com/ocaml/flexdll#readme"
8+
license: "Zlib"
9+
synopsis: "FlexDLL Sources"
10+
description: "Source package for FlexDLL. Installs the required files for
11+
bootstrapping FlexDLL as part of an OCaml build."

0 commit comments

Comments
 (0)