-
Notifications
You must be signed in to change notification settings - Fork 32
opam package for flexdll sources #135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,14 +5,18 @@ | |
## | ||
|
||
|
||
VERSION = 0.43 | ||
# Fetch the version number from its source, in flexdll.opam | ||
VERSION = \ | ||
$(eval VERSION := $$(shell sed -ne 's/^version: *"\(.*\)"/\1/p' flexdll.opam))$(VERSION) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For my education, what does the extra There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's a GNU make pattern for lazy variables. The problem with The first time There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you for all the details! |
||
|
||
all: flexlink.exe support | ||
|
||
OCAML_CONFIG_FILE=$(shell cygpath -ad "$(shell ocamlopt -where 2>/dev/null)/Makefile.config" 2>/dev/null) | ||
include $(OCAML_CONFIG_FILE) | ||
OCAMLOPT=ocamlopt | ||
EMPTY= | ||
SPACE=$(EMPTY) $(EMPTY) | ||
COMMA=, | ||
OCAML_VERSION:=$(firstword $(subst ~, ,$(subst +, ,$(shell $(OCAMLOPT) -version 2>/dev/null)))) | ||
ifeq ($(OCAML_VERSION),) | ||
OCAML_VERSION:=0 | ||
|
@@ -31,7 +35,7 @@ MIN64CC = $(MINGW64_PREFIX)gcc | |
CYGWIN64_PREFIX = x86_64-pc-cygwin- | ||
CYG64CC = $(CYGWIN64_PREFIX)gcc | ||
|
||
version.ml: Makefile | ||
version.ml: Makefile flexdll.opam | ||
echo "let version = \"$(VERSION)\"" > version.ml | ||
echo "let mingw_prefix = \"$(MINGW_PREFIX)\"" >> version.ml | ||
echo "let mingw64_prefix = \"$(MINGW64_PREFIX)\"" >> version.ml | ||
|
@@ -160,11 +164,32 @@ flexlink.exe: $(OBJS) $(RES) | |
rm -f $@ | ||
$(RES_PREFIX) $(OCAMLOPT) -o $@ $(LINKFLAGS) $(OBJS) | ||
|
||
version.res: version.rc | ||
$(RES_PREFIX) rc $< | ||
|
||
version_res.o: version.rc | ||
$(TOOLPREF)windres -i $< -o $@ | ||
# VERSION at present is x.y, but there would be no reason not to have x.y.z in | ||
# future. Windows versions have four components. $(FLEXDLL_FULL_VERSION) adds | ||
# additional .0s to the right of $(VERSION) such that $(FLEXDLL_FULL_VERSION) | ||
# has four version components. | ||
# Thus if VERSION=0.43, then FLEXDLL_FULL_VERSION=0.43.0.0 | ||
dra27 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
# $(FLEXDLL_VS_VERSION_INFO) is the same value, but using a ',' to separate the | ||
# items rather than a '.', as this is the format used in a VS_VERSION_INFO block | ||
# in Resource Compiler format. | ||
FLEXDLL_FULL_VERSION = \ | ||
$(subst $(SPACE),.,$(wordlist 1, 4, $(subst .,$(SPACE),$(VERSION)) 0 0 0)) | ||
FLEXDLL_VS_VERSION_INFO = $(subst .,$(COMMA),$(FLEXDLL_FULL_VERSION)) | ||
|
||
RC_FLAGS = \ | ||
/d FLEXDLL_VS_VERSION_INFO=$(FLEXDLL_VS_VERSION_INFO) \ | ||
/d FLEXDLL_FULL_VERSION="$(FLEXDLL_FULL_VERSION)" | ||
|
||
# cf. https://sourceware.org/bugzilla/show_bug.cgi?id=27843 | ||
WINDRES_FLAGS = \ | ||
-D FLEXDLL_VS_VERSION_INFO=$(FLEXDLL_VS_VERSION_INFO) \ | ||
-D FLEXDLL_FULL_VERSION=\\\"$(FLEXDLL_FULL_VERSION)\\\" | ||
|
||
version.res: version.rc flexdll.opam | ||
$(RES_PREFIX) rc /nologo $(RC_FLAGS) $< | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not due to this PR but I find it a bit confusing to have There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree, that would look much clearer (or perhaps "less unclear"!) |
||
|
||
version_res.o: version.rc flexdll.opam | ||
$(TOOLPREF)windres $(WINDRES_FLAGS) -i $< -o $@ | ||
|
||
flexdll_msvc.obj: flexdll.c flexdll.h | ||
$(MSVC_PREFIX) $(MSVCC) /DMSVC -c /Fo"$@" $< | ||
|
@@ -239,7 +264,7 @@ package_src: | |
rm -Rf flexdll-$(VERSION) | ||
mkdir flexdll-$(VERSION) | ||
mkdir flexdll-$(VERSION)/test | ||
cp -a $(filter-out version.ml,$(OBJS:Compat.ml=Compat.ml.in)) Makefile msvs-detect $(COMMON_FILES) version.rc flexdll-$(VERSION)/ | ||
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)/ | ||
cp -aR test/Makefile test/*.c flexdll-$(VERSION)/test/ | ||
tar czf $(PACKAGE) flexdll-$(VERSION) | ||
rm -Rf flexdll-$(VERSION) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
share: [ | ||
"Makefile" | ||
"cmdline.ml" | ||
"coff.ml" | ||
"Compat.ml.in" | ||
"create_dll.ml" | ||
"default.manifest" | ||
"default_amd64.manifest" | ||
"flexdll.c" | ||
"flexdll.h" | ||
"flexdll.opam" | ||
"flexdll_initer.c" | ||
"reloc.ml" | ||
"version.rc" | ||
] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh! late notice: shouldn’t there be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (Confession: I didn’t try to build an OCaml compiler with these sources :-) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 😱 Eek - I hadn't either, I'm very glad you spotted this!
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
opam-version: "2.0" | ||
version: "0.43" | ||
authors: "Alain Frisch" | ||
maintainer: "David Allsopp <[email protected]>" | ||
bug-reports: "https://github.com/ocaml/flexdll/issues" | ||
dev-repo: "git+https://github.com/ocaml/flexdll.git" | ||
homepage: "https://github.com/ocaml/flexdll#readme" | ||
license: "Zlib" | ||
synopsis: "FlexDLL Sources" | ||
description: "Source package for FlexDLL. Installs the required files for | ||
bootstrapping FlexDLL as part of an OCaml build." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!