diff options
author | jaapb <jaapb@pkgsrc.org> | 2019-08-24 10:54:23 +0000 |
---|---|---|
committer | jaapb <jaapb@pkgsrc.org> | 2019-08-24 10:54:23 +0000 |
commit | 08fcffde2f23766810e23df244a86115244f431c (patch) | |
tree | a48fe16fe9b4a799e2218760221bc1b08a962357 /lang/ocaml/patches | |
parent | a88438c32a7673b31fada9cf818d1c277acea438 (diff) | |
download | pkgsrc-08fcffde2f23766810e23df244a86115244f431c.tar.gz |
Updated lang/ocaml to 4.08.1.
4.08.1 is a bugfix release, fixing compilation failures in presence of the
-pack option, and dynlinking failures.
Highlights in 4.08.0 are:
* Binding operators (let*, let+, and*, etc). They can be used to
streamline monadic code.
* open now applies to arbitrary module expression in structures and to
applicative paths in signatures.
* A new notion of (user-defined) "alerts" generalizes the deprecated
warning.
* New modules in the standard library: Fun, Bool, Int, Option, Result.
* A significant number of new functions in Float, including FMA support,
and a new Float.Array submodule.
* Source highlighting for errors and warnings in batch mode.
* Many error messages were improved.
* Improved AFL instrumentation for objects and lazy values.
Diffstat (limited to 'lang/ocaml/patches')
-rw-r--r-- | lang/ocaml/patches/patch-Makefile | 20 | ||||
-rw-r--r-- | lang/ocaml/patches/patch-Makefile.common.in | 18 | ||||
-rw-r--r-- | lang/ocaml/patches/patch-asmcomp_amd64_emit.mlp | 3 | ||||
-rw-r--r-- | lang/ocaml/patches/patch-asmrun_amd64.S | 7 | ||||
-rw-r--r-- | lang/ocaml/patches/patch-configure | 224 | ||||
-rw-r--r-- | lang/ocaml/patches/patch-driver_compenv.ml | 10 | ||||
-rw-r--r-- | lang/ocaml/patches/patch-lex_Makefile | 23 | ||||
-rw-r--r-- | lang/ocaml/patches/patch-ocamldoc_Makefile | 14 | ||||
-rw-r--r-- | lang/ocaml/patches/patch-otherlibs_Makefile.otherlibs.common | 13 | ||||
-rw-r--r-- | lang/ocaml/patches/patch-otherlibs_systhreads_Makefile | 30 | ||||
-rw-r--r-- | lang/ocaml/patches/patch-otherlibs_threads_Makefile | 13 | ||||
-rw-r--r-- | lang/ocaml/patches/patch-runtime_Makefile | 53 | ||||
-rw-r--r-- | lang/ocaml/patches/patch-tools_Makefile | 14 | ||||
-rw-r--r-- | lang/ocaml/patches/patch-tools_ocamlmklib | 32 | ||||
-rw-r--r-- | lang/ocaml/patches/patch-yacc_Makefile | 16 |
15 files changed, 257 insertions, 233 deletions
diff --git a/lang/ocaml/patches/patch-Makefile b/lang/ocaml/patches/patch-Makefile index b59fdce1616..24bffd01c5d 100644 --- a/lang/ocaml/patches/patch-Makefile +++ b/lang/ocaml/patches/patch-Makefile @@ -1,9 +1,19 @@ -$NetBSD: patch-Makefile,v 1.13 2018/07/19 12:46:04 jaapb Exp $ +$NetBSD: patch-Makefile,v 1.14 2019/08/24 10:54:23 jaapb Exp $ Use BSD_INSTALL_* instead of mkdir ---- Makefile.orig 2018-07-10 14:09:26.000000000 +0000 +Honor LDFLAGS +--- Makefile.orig 2019-04-18 10:10:54.000000000 +0000 +++ Makefile -@@ -597,10 +597,10 @@ endif +@@ -54,7 +54,7 @@ INCLUDES=-I utils -I parsing -I typing - + COMPFLAGS=-strict-sequence -principal -absname -w +a-4-9-40-41-42-44-45-48-66 \ + -warn-error A \ + -bin-annot -safe-string -strict-formats $(INCLUDES) +-LINKFLAGS= ++LINKFLAGS= -cclib "$(LDFLAGS)" + + ifeq "$(strip $(NATDYNLINKOPTS))" "" + OCAML_NATDYNLINKOPTS= +@@ -513,10 +513,10 @@ endif # Installation .PHONY: install install: @@ -18,8 +28,8 @@ Use BSD_INSTALL_* instead of mkdir $(INSTALL_DATA) \ VERSION \ "$(INSTALL_LIBDIR)" -@@ -630,7 +630,7 @@ install: - "$(INSTALL_LIBDIR)" +@@ -564,7 +564,7 @@ ifeq "$(INSTALL_SOURCE_ARTIFACTS)" "true + endif $(MAKE) -C tools install ifeq "$(UNIX_OR_WIN32)" "unix" # Install manual pages only on Unix - $(MKDIR) "$(INSTALL_MANDIR)/man$(PROGRAMS_MAN_SECTION)" diff --git a/lang/ocaml/patches/patch-Makefile.common.in b/lang/ocaml/patches/patch-Makefile.common.in new file mode 100644 index 00000000000..a0a14bf7a0d --- /dev/null +++ b/lang/ocaml/patches/patch-Makefile.common.in @@ -0,0 +1,18 @@ +$NetBSD: patch-Makefile.common.in,v 1.1 2019/08/24 10:54:23 jaapb Exp $ + +Use BSD_INSTALL_* +--- Makefile.common.in.orig 2019-03-01 15:13:45.000000000 +0000 ++++ Makefile.common.in +@@ -16,9 +16,9 @@ + # This makefile contains common definitions shared by other Makefiles + # We assume that Makefile.config has already been included + +-INSTALL ?= @INSTALL@ +-INSTALL_DATA ?= $(INSTALL) -m u=rw,g=rw,o=r +-INSTALL_PROG ?= $(INSTALL) -m u=rwx,g=rwx,o=rx ++INSTALL ?= $(BSD_INSTALL) ++INSTALL_DATA ?= $(BSD_INSTALL_DATA) ++INSTALL_PROG ?= $(BSD_INSTALL_SCRIPT) + + # note: these are defined by lazy expansions + # as some parts of the makefiles change BINDIR, etc. diff --git a/lang/ocaml/patches/patch-asmcomp_amd64_emit.mlp b/lang/ocaml/patches/patch-asmcomp_amd64_emit.mlp index 7bab5615038..e983e7d920a 100644 --- a/lang/ocaml/patches/patch-asmcomp_amd64_emit.mlp +++ b/lang/ocaml/patches/patch-asmcomp_amd64_emit.mlp @@ -1,5 +1,6 @@ -$NetBSD: patch-asmcomp_amd64_emit.mlp,v 1.3 2018/07/18 00:09:12 joerg Exp $ +$NetBSD: patch-asmcomp_amd64_emit.mlp,v 1.4 2019/08/24 10:54:23 jaapb Exp $ +Fix attributes and entry size for the .rodata mergable constant section --- asmcomp/amd64/emit.mlp.orig 2018-07-17 21:17:05.536787953 +0000 +++ asmcomp/amd64/emit.mlp @@ -986,7 +986,7 @@ let begin_assembly() = diff --git a/lang/ocaml/patches/patch-asmrun_amd64.S b/lang/ocaml/patches/patch-asmrun_amd64.S index 0dcadcb19c5..4891e5a1ab8 100644 --- a/lang/ocaml/patches/patch-asmrun_amd64.S +++ b/lang/ocaml/patches/patch-asmrun_amd64.S @@ -1,7 +1,8 @@ -$NetBSD: patch-asmrun_amd64.S,v 1.1 2018/07/18 00:09:12 joerg Exp $ +$NetBSD: patch-asmrun_amd64.S,v 1.2 2019/08/24 10:54:23 jaapb Exp $ ---- asmrun/amd64.S.orig 2018-07-17 21:24:20.027817665 +0000 -+++ asmrun/amd64.S +Fix attributes and entry size for the .rodata mergable constant section +--- runtime/amd64.S.orig 2018-07-17 21:24:20.027817665 +0000 ++++ runtime/amd64.S @@ -724,7 +724,7 @@ G(caml_system__spacetime_shapes): #elif defined(SYS_mingw64) || defined(SYS_cygwin) .section .rdata,"dr" diff --git a/lang/ocaml/patches/patch-configure b/lang/ocaml/patches/patch-configure index 40cb203b8ec..cb667f160c0 100644 --- a/lang/ocaml/patches/patch-configure +++ b/lang/ocaml/patches/patch-configure @@ -1,184 +1,62 @@ -$NetBSD: patch-configure,v 1.36 2019/05/15 09:39:21 jaapb Exp $ +$NetBSD: patch-configure,v 1.37 2019/08/24 10:54:23 jaapb Exp $ All kinds of OS-specific changes to configure Honor LDFLAGS. ---- configure.orig 2018-10-04 14:23:12.000000000 +0000 -+++ configure 2019-04-03 12:40:28.584971437 +0000 -@@ -797,7 +797,7 @@ +--- configure.orig 2019-03-01 15:13:45.000000000 +0000 ++++ configure +@@ -13379,7 +13379,7 @@ sharedlib_cflags='' mksharedlib='shared-libs-not-available' rpath='' mksharedlibrpath='' -natdynlinkopts="" +natdynlinkopts="-L/usr/lib -R/usr/lib -R/usr/pkg/lib" - if $with_sharedlibs; then - case "$target" in -@@ -826,10 +826,13 @@ - esac;; - *-*-solaris2*) - case "$cc" in -- *gcc*) -+ *clang*|*gcc*) - sharedcccompopts="-fPIC" -- if sh ./solaris-ld; then -- mksharedlib="ld -G" -+ if true; then -+ case "$target" in -+ x86_64*) mksharedlib="$cc -shared" ;; -+ *) mksharedlib="$cc -G" ;; -+ esac - rpath="-R" - mksharedlibrpath="-R" - else -@@ -856,7 +859,7 @@ - rpath="-Wl,-rpath," - mksharedlibrpath="-rpath " - shared_libraries_supported=true;; -- i[3456]86-*-darwin[89].*) -+ i[3456]86-*-darwin.*) - mksharedlib="$cc -shared -flat_namespace -undefined suppress \ - -read_only_relocs suppress" - common_cflags="$dl_defs $common_cflags" -@@ -905,11 +908,7 @@ - i[3456]86-*-linux*) natdynlink=true;; - i[3456]86-*-gnu*) natdynlink=true;; - x86_64-*-linux*) natdynlink=true;; -- i[3456]86-*-darwin[89].*) natdynlink=true;; -- i[3456]86-*-darwin*) -- if test $arch64 == true; then -- natdynlink=true -- fi;; -+ i[3456]86-*-darwin*) natdynlink=true;; - x86_64-*-darwin*) natdynlink=true;; - s390x*-*-linux*) natdynlink=true;; - powerpc*-*-linux*) natdynlink=true;; -@@ -922,12 +921,17 @@ - x86_64-*-openbsd*) natdynlink=true;; - i[3456]86-*-netbsd*) natdynlink=true;; - x86_64-*-netbsd*) natdynlink=true;; -+ i[3456]86-*-dragonfly*) natdynlink=true;; -+ x86_64-*-dragonfly*) natdynlink=true;; -+ *-*-solaris*) natdynlink=true;; - i386-*-gnu0.3) natdynlink=true;; - i[3456]86-*-haiku*) natdynlink=true;; - arm*-*-linux*) natdynlink=true;; - arm*-*-freebsd*) natdynlink=true;; -+ arm*-*-netbsd*) natdynlink=true;; - earm*-*-netbsd*) natdynlink=true;; - aarch64-*-linux*) natdynlink=true;; -+ aarch64-*-netbsd*) natdynlink=true;; - esac - fi - -@@ -965,6 +969,7 @@ - i[3456]86-*-haiku*) arch=i386; system=beos;; - i[3456]86-*-beos*) arch=i386; system=beos;; - i[3456]86-*-cygwin*) arch=i386; system=cygwin;; -+ i[3456]86-*-interix3*) arch=i386; system=interix3;; - i[3456]86-*-darwin*) if $arch64; then - arch=amd64; system=macosx - else -@@ -987,6 +992,8 @@ - armv6t2*-*-linux-gnueabi) arch=arm; model=armv6t2; system=linux_eabi;; - armv6*-*-linux-gnueabi) arch=arm; model=armv6; system=linux_eabi;; - armv6*-*-freebsd*) arch=arm; model=armv6; system=freebsd;; -+ armv6-*-netbsdelf*) arch=arm; model=armv6; system=netbsd;; -+ armv7-*-netbsdelf*) arch=arm; model=armv7; system=netbsd;; - earmv6*-*-netbsd*) arch=arm; model=armv6; system=netbsd;; - earmv7*-*-netbsd*) arch=arm; model=armv7; system=netbsd;; - armv5te*-*-linux-gnueabi) arch=arm; model=armv5te; system=linux_eabi;; -@@ -1003,7 +1010,9 @@ - x86_64-*-darwin*) arch=amd64; system=macosx;; - x86_64-*-mingw*) arch=amd64; system=mingw;; - aarch64-*-linux*) arch=arm64; system=linux;; -+ aarch64-*-netbsd*) arch=arm64; system=netbsd;; - x86_64-*-cygwin*) arch=amd64; system=cygwin;; -+ x86_64-*-solaris*) arch=amd64; system=solaris;; - esac - - # Some platforms exist both in 32-bit and 64-bit variants, not distinguished -@@ -1027,7 +1036,6 @@ - case "$arch,$cc,$system,$model" in - *,*,rhapsody,*) if $arch64; then partialld="ld -r -arch ppc64"; fi;; - amd64,gcc*,macosx,*) partialld="ld -r -arch x86_64";; -- amd64,gcc*,solaris,*) partialld="ld -r -m elf_x86_64";; - power,gcc*,elf,ppc) partialld="ld -r -m elf32ppclinux";; - power,gcc*,elf,ppc64) partialld="ld -r -m elf64ppc";; - power,gcc*,elf,ppc64le) partialld="ld -r -m elf64lppc";; -@@ -1045,8 +1053,8 @@ - fi;; - amd64,solaris) as="${TOOLPREF}as --64" - aspp="${TOOLPREF}gcc -m64 -c";; -- i386,solaris) as="${TOOLPREF}as" -- aspp="${TOOLPREF}gcc -c";; -+ i386,solaris) as="${TOOLPREF}as --32" -+ aspp="${TOOLPREF}gcc -m32 -c";; - power,elf) if $arch64; then - as="${TOOLPREF}as -a64 -mppc64" - aspp="${TOOLPREF}gcc -m64 -c" -@@ -1094,6 +1102,8 @@ - power,elf) profiling='true';; - power,bsd*) profiling='true';; - power,netbsd) profiling='true';; -+ amd64,solaris) profiling='true';; -+ *,dragonfly) profiling='true';; - *) profiling='false';; + if test x"$enable_shared" != "xno"; then : + case $host in #( +@@ -13475,6 +13475,8 @@ fi ;; #( + natdynlink=true ;; #( + aarch64-*-linux*) : + natdynlink=true ;; #( ++ aarch64-*-netbsd*) : ++ natdynlink=true ;; #( + *) : + ;; esac +@@ -13526,6 +13528,8 @@ case $host in #( + arch=i386; system=beos ;; #( + i[3456]86-*-cygwin) : + arch=i386; system=cygwin ;; #( ++ i[3456]86-*-interix3) : ++ arch=i386; system=interix3 ;; #( + i[3456]86-*-darwin*) : + if $arch64; then : + arch=amd64 +@@ -13570,6 +13574,10 @@ fi; system=elf ;; #( + arch=arm; model=armv6; system=linux_eabi ;; #( + armv6*-*-freebsd*) : + arch=arm; model=armv6; system=freebsd ;; #( ++ armv6*-*-netbsd*) : ++ arch=arm; model=armv6; system=netbsd ;; #( ++ armv7*-*-netbsd*) : ++ arch=arm; model=armv7; system=netbsd ;; #( + earmv6*-*-netbsd*) : + arch=arm; model=armv6; system=netbsd ;; #( + earmv7*-*-netbsd*) : +@@ -13602,6 +13610,8 @@ fi; system=elf ;; #( + arch=amd64; system=mingw64 ;; #( + aarch64-*-linux*) : + arch=arm64; system=linux ;; #( ++ aarch64-*-netbsd*) : ++ arch=arm64; system=netbsd ;; #( + x86_64-*-cygwin*) : + arch=amd64; system=cygwin + ;; #( +@@ -13932,7 +13942,7 @@ fi + # for the moment, to be backward-compatible -@@ -1672,6 +1682,8 @@ - x11_include="not found" - x11_link="not found" - -+if test "$disable_x11" != "yes"; then -+ - if test -z "$x11_include_dir" -a -z "$x11_lib_dir"; then - if pkg-config --exists x11 2>/dev/null; then - x11_include=`pkg-config --cflags x11` -@@ -1718,6 +1730,7 @@ - /usr/XFree86/include/X11 \ - \ - /usr/include \ -+ /usr/pkg/include \ - /usr/local/include \ - /usr/unsupported/include \ - /usr/athena/include \ -@@ -1775,6 +1788,7 @@ - \ - /usr/lib64 \ - /usr/lib \ -+ /usr/pkg/lib \ - /usr/local/lib \ - /usr/unsupported/lib \ - /usr/athena/lib \ -@@ -1798,18 +1812,16 @@ - if test $dir = /usr/lib; then - x11_link="-lX11" - else -- case "$target" in -- *-*-freebsd*|*-*-dragonfly*) x11_link="-L$dir -lX11";; -- *-kfreebsd*-gnu) x11_link="-L$dir -lX11";; -- *-*-*bsd*) x11_link="-R$dir -L$dir -lX11";; -- *) x11_link="-L$dir -lX11";; -- esac -+ x11_libs="-L$dir ${COMPILER_RPATH_FLAG}$dir" -+ x11_link="-L$dir ${COMPILER_RPATH_FLAG}$dir -lX11" - fi - break - fi - done - fi - -+fi # end of disable_x11 test -+ - if test "$x11_include" != "not found"; then - if test "$x11_include" = "-I/usr/include"; then - x11_include="" -@@ -2060,7 +2072,7 @@ - config CPPFLAGS "$common_cppflags $internal_cppflags" - config OCAMLC_CFLAGS "$common_cflags $sharedcccompopts" - config OCAMLC_CPPFLAGS "$common_cppflags" --config LDFLAGS "$ldflags" -+config LDFLAGS "$ldflags $LDFLAGS" - config BYTECCLIBS "$cclibs $dllib $pthread_link $instrumented_runtime_libs" - config RPATH "$rpath" - config EXE "$exe" + case $host in #( +- *-*-mingw32|*-pc-windows) : ++ *-*-mingw32|*-pc-windows|*-*-netbsd*) : + ;; #( + *) : + has_c99_float_ops=true diff --git a/lang/ocaml/patches/patch-driver_compenv.ml b/lang/ocaml/patches/patch-driver_compenv.ml index 2765a0d74e6..8dea519ac0d 100644 --- a/lang/ocaml/patches/patch-driver_compenv.ml +++ b/lang/ocaml/patches/patch-driver_compenv.ml @@ -1,14 +1,14 @@ -$NetBSD: patch-driver_compenv.ml,v 1.3 2016/05/05 08:12:01 jaapb Exp $ +$NetBSD: patch-driver_compenv.ml,v 1.4 2019/08/24 10:54:23 jaapb Exp $ pkgsrc_runtime flag ---- driver/compenv.ml.orig 2016-04-01 12:53:41.000000000 +0000 +--- driver/compenv.ml.orig 2019-02-08 14:34:09.000000000 +0000 +++ driver/compenv.ml -@@ -217,6 +217,7 @@ let read_one_param ppf position name v = +@@ -235,6 +235,7 @@ let read_one_param ppf position name v = | "pp" -> preprocessor := Some v | "runtime-variant" -> runtime_variant := v + | "pkgsrc-runtime" -> set "pkgsrc-runtime" [ pkgsrc_runtime ] v + | "open" -> + open_modules := List.rev_append (String.split_on_char ',' v) !open_modules | "cc" -> c_compiler := Some v - - | "clambda-checks" -> set "clambda-checks" [ clambda_checks ] v diff --git a/lang/ocaml/patches/patch-lex_Makefile b/lang/ocaml/patches/patch-lex_Makefile new file mode 100644 index 00000000000..4d9c8c79a1a --- /dev/null +++ b/lang/ocaml/patches/patch-lex_Makefile @@ -0,0 +1,23 @@ +$NetBSD: patch-lex_Makefile,v 1.1 2019/08/24 10:54:23 jaapb Exp $ + +Honor LDFLAGS. +--- lex/Makefile.orig 2019-03-01 15:13:45.000000000 +0000 ++++ lex/Makefile +@@ -28,7 +28,7 @@ CAMLC = $(CAMLRUN) $(ROOTDIR)/boot/ocaml + CAMLOPT = $(CAMLRUN) $(ROOTDIR)/ocamlopt -nostdlib -I $(ROOTDIR)/stdlib + COMPFLAGS = $(INCLUDES) -absname -w +a-4-9-41-42-44-45-48 -warn-error A \ + -safe-string -strict-sequence -strict-formats -bin-annot +-LINKFLAGS = ++LINKFLAGS = -cclib "$(LDFLAGS)" + YACCFLAGS = -v + CAMLLEX = $(CAMLRUN) $(ROOTDIR)/boot/ocamllex + CAMLDEP = $(CAMLRUN) $(ROOTDIR)/boot/ocamlc -depend +@@ -47,7 +47,7 @@ ocamllex: $(OBJS) + $(CAMLC) $(LINKFLAGS) -compat-32 -o ocamllex $(OBJS) + + ocamllex.opt: $(OBJS:.cmo=.cmx) +- $(CAMLOPT_CMD) -o ocamllex.opt $(OBJS:.cmo=.cmx) ++ $(CAMLOPT_CMD) $(LINKFLAGS) -o ocamllex.opt $(OBJS:.cmo=.cmx) + + clean:: + rm -f ocamllex ocamllex.opt diff --git a/lang/ocaml/patches/patch-ocamldoc_Makefile b/lang/ocaml/patches/patch-ocamldoc_Makefile new file mode 100644 index 00000000000..37913b4aaa0 --- /dev/null +++ b/lang/ocaml/patches/patch-ocamldoc_Makefile @@ -0,0 +1,14 @@ +$NetBSD: patch-ocamldoc_Makefile,v 1.7 2019/08/24 10:54:23 jaapb Exp $ + +Honor LDFLAGS. +--- ocamldoc/Makefile.orig 2019-03-01 15:13:46.000000000 +0000 ++++ ocamldoc/Makefile +@@ -104,7 +104,7 @@ DEPINCLUDES=$(INCLUDES_DEP) + INCLUDES=$(INCLUDES_DEP) $(INCLUDES_NODEP) + + COMPFLAGS=$(INCLUDES) -absname -w +a-4-9-41-42-44-45-48 -warn-error A -safe-string -strict-sequence -strict-formats -bin-annot +-LINKFLAGS=$(INCLUDES) -nostdlib ++LINKFLAGS=$(INCLUDES) -nostdlib -cclib "$(LDFLAGS)" + + CMOFILES=\ + odoc_config.cmo \ diff --git a/lang/ocaml/patches/patch-otherlibs_Makefile.otherlibs.common b/lang/ocaml/patches/patch-otherlibs_Makefile.otherlibs.common new file mode 100644 index 00000000000..57b3117e18b --- /dev/null +++ b/lang/ocaml/patches/patch-otherlibs_Makefile.otherlibs.common @@ -0,0 +1,13 @@ +$NetBSD: patch-otherlibs_Makefile.otherlibs.common,v 1.1 2019/08/24 10:54:23 jaapb Exp $ + +Honor LDFLAGS. +--- otherlibs/Makefile.otherlibs.common.orig 2019-02-08 14:34:10.000000000 +0000 ++++ otherlibs/Makefile.otherlibs.common +@@ -48,6 +48,7 @@ MKLIB=$(CAMLRUN) $(ROOTDIR)/tools/ocamlm + #LINKOPTS= + #LDOPTS= + #HEADERS= ++LDOPTS= -ldopt "$(LDFLAGS)" + + CMIFILES ?= $(CAMLOBJS:.cmo=.cmi) + CAMLOBJS_NAT ?= $(CAMLOBJS:.cmo=.cmx) diff --git a/lang/ocaml/patches/patch-otherlibs_systhreads_Makefile b/lang/ocaml/patches/patch-otherlibs_systhreads_Makefile index 8c01945792d..b93d0d00cc9 100644 --- a/lang/ocaml/patches/patch-otherlibs_systhreads_Makefile +++ b/lang/ocaml/patches/patch-otherlibs_systhreads_Makefile @@ -1,40 +1,40 @@ -$NetBSD: patch-otherlibs_systhreads_Makefile,v 1.9 2018/07/19 12:16:38 jaapb Exp $ +$NetBSD: patch-otherlibs_systhreads_Makefile,v 1.10 2019/08/24 10:54:23 jaapb Exp $ Honor LDFLAGS. -Use BSD_INSTALL_* instead of mkdir and cp ---- otherlibs/systhreads/Makefile.orig 2018-04-11 13:22:42.000000000 +0000 +--- otherlibs/systhreads/Makefile.orig 2019-03-01 15:13:46.000000000 +0000 +++ otherlibs/systhreads/Makefile -@@ -28,6 +28,7 @@ export OCAML_FLEXLINK:=$(ROOTDIR)/boot/o - endif +@@ -21,6 +21,7 @@ include $(ROOTDIR)/Makefile.common + CAMLRUN ?= $(ROOTDIR)/boot/ocamlrun LIBS = -nostdlib -I $(ROOTDIR)/stdlib -I $(ROOTDIR)/otherlibs/$(UNIXLIB) -+LDOPTS=-ldopt "$(LDFLAGS)" ++LDOPTS= -ldopt "$(LDFLAGS)" CAMLC=$(CAMLRUN) $(ROOTDIR)/ocamlc $(LIBS) CAMLOPT=$(CAMLRUN) $(ROOTDIR)/ocamlopt $(LIBS) -@@ -68,14 +69,14 @@ all: lib$(LIBNAME).$(A) $(LIBNAME).cma $ +@@ -61,7 +62,7 @@ all: lib$(LIBNAME).$(A) $(LIBNAME).cma $ allopt: lib$(LIBNAME)nat.$(A) $(LIBNAME).cmxa $(CMIFILES) lib$(LIBNAME).$(A): $(BYTECODE_C_OBJS) -- $(MKLIB) -o $(LIBNAME) $(BYTECODE_C_OBJS) $(PTHREAD_LINK) -+ $(MKLIB) -o $(LIBNAME) $(BYTECODE_C_OBJS) $(PTHREAD_LINK) $(LDOPTS) +- $(MKLIB_CMD) -o $(LIBNAME) $(BYTECODE_C_OBJS) $(PTHREAD_LINK) ++ $(MKLIB_CMD) -o $(LIBNAME) $(BYTECODE_C_OBJS) $(PTHREAD_LINK) $(LDOPTS) lib$(LIBNAME)nat.$(A): $(NATIVECODE_C_OBJS) - $(MKLIB) -o $(LIBNAME)nat $^ - + $(MKLIB_CMD) -o $(LIBNAME)nat $^ +@@ -69,7 +70,7 @@ lib$(LIBNAME)nat.$(A): $(NATIVECODE_C_OB $(LIBNAME).cma: $(THREADS_BCOBJS) ifeq "$(UNIX_OR_WIN32)" "unix" -- $(MKLIB) -o $(LIBNAME) -ocamlc '$(CAMLC)' -cclib -lunix -linkall $(PTHREAD_CAML_LINK) $^ -+ $(MKLIB) -o $(LIBNAME) -ocamlc '$(CAMLC)' -cclib -lunix -linkall $(PTHREAD_CAML_LINK) $(LDOPTS) $^ + $(MKLIB) -o $(LIBNAME) -ocamlc '$(CAMLC)' -cclib -lunix -linkall \ +- $(PTHREAD_CAML_LINK) $^ ++ $(PTHREAD_CAML_LINK) $(LDOPTS) $^ # TODO: Figure out why -cclib -lunix is used here. # It may be because of the threadsUnix module which is deprecated. # It may hence be good to figure out whether this module shouldn't be -@@ -122,7 +123,7 @@ install: +@@ -117,7 +118,7 @@ install: fi $(INSTALL_DATA) libthreads.$(A) "$(INSTALL_LIBDIR)" cd "$(INSTALL_LIBDIR)"; $(RANLIB) libthreads.$(A) - mkdir -p "$(INSTALL_THREADSLIBDIR)" + $(BSD_INSTALL_LIB_DIR) "$(INSTALL_THREADSLIBDIR)" $(INSTALL_DATA) \ - $(CMIFILES) $(CMIFILES:.cmi=.cmti) threads.cma \ + $(CMIFILES) threads.cma \ "$(INSTALL_THREADSLIBDIR)" diff --git a/lang/ocaml/patches/patch-otherlibs_threads_Makefile b/lang/ocaml/patches/patch-otherlibs_threads_Makefile index 700a2992672..9622dd1ac46 100644 --- a/lang/ocaml/patches/patch-otherlibs_threads_Makefile +++ b/lang/ocaml/patches/patch-otherlibs_threads_Makefile @@ -1,18 +1,17 @@ -$NetBSD: patch-otherlibs_threads_Makefile,v 1.12 2018/07/19 12:16:38 jaapb Exp $ +$NetBSD: patch-otherlibs_threads_Makefile,v 1.13 2019/08/24 10:54:23 jaapb Exp $ Honor LDFLAGS. -Use BSD_INSTALL_* instead of mkdir and cp ---- otherlibs/threads/Makefile.orig 2018-04-11 13:22:42.000000000 +0000 +--- otherlibs/threads/Makefile.orig 2019-02-08 14:34:10.000000000 +0000 +++ otherlibs/threads/Makefile @@ -28,6 +28,7 @@ CAMLC=$(CAMLRUN) $(ROOTDIR)/ocamlc -nost -I $(ROOTDIR)/stdlib -I $(ROOTDIR)/otherlibs/unix - MKLIB=$(CAMLRUN) ../../tools/ocamlmklib + MKLIB=$(CAMLRUN) $(ROOTDIR)/tools/ocamlmklib COMPFLAGS=-w +33..39 -warn-error A -bin-annot -g -safe-string +LDOPTS= -ldopt $(LDFLAGS) C_OBJS=scheduler.o -@@ -64,7 +65,7 @@ all: libvmthreads.a threads.cma stdlib.c +@@ -68,7 +69,7 @@ all: libvmthreads.a threads.cma stdlib.c allopt: libvmthreads.a: $(C_OBJS) @@ -20,8 +19,8 @@ Use BSD_INSTALL_* instead of mkdir and cp + $(MKLIB) -o threads -oc vmthreads $(C_OBJS) $(LDOPTS) threads.cma: $(CAML_OBJS) - $(MKLIB) -ocamlc '$(CAMLC)' -o threads -oc vmthreads $(CAML_OBJS) -@@ -117,7 +118,7 @@ install: + $(MKLIB) -ocamlc '$(CAMLC)' -o threads -oc vmthreads $^ +@@ -121,7 +122,7 @@ install: if test -f dllvmthreads.so; then \ $(INSTALL_PROG) dllvmthreads.so "$(INSTALL_STUBLIBDIR)"; \ fi diff --git a/lang/ocaml/patches/patch-runtime_Makefile b/lang/ocaml/patches/patch-runtime_Makefile new file mode 100644 index 00000000000..78e6b445327 --- /dev/null +++ b/lang/ocaml/patches/patch-runtime_Makefile @@ -0,0 +1,53 @@ +$NetBSD: patch-runtime_Makefile,v 1.1 2019/08/24 10:54:23 jaapb Exp $ + +Honor LDFLAGS. +--- runtime/Makefile.orig 2019-04-18 10:10:54.000000000 +0000 ++++ runtime/Makefile +@@ -182,11 +182,11 @@ LIBS = $(BYTECCLIBS) $(EXTRALIBS) + ifdef BOOTSTRAPPING_FLEXLINK + MAKE_OCAMLRUN=$(MKEXE_BOOT) + else +-MAKE_OCAMLRUN = $(MKEXE) -o $(1) $(2) ++MAKE_OCAMLRUN = $(MKEXE) $(LDFLAGS) -o $(1) $(2) + endif + else + LIBS = $(BYTECCLIBS) +-MAKE_OCAMLRUN = $(MKEXE) -o $(1) $(2) ++MAKE_OCAMLRUN = $(MKEXE) $(LDFLAGS) -o $(1) $(2) + endif + + # Build, install and clean targets +@@ -292,13 +292,13 @@ libcamlrun.$(A): $(libcamlrun_OBJECTS) + $(call MKLIB,$@, $^) + + ocamlrund$(EXE): prims.$(O) libcamlrund.$(A) +- $(MKEXE) $(MKEXEDEBUGFLAG) -o $@ $^ $(LIBS) ++ $(MKEXE) $(LDFLAGS) $(MKEXEDEBUGFLAG) -o $@ $^ $(LIBS) + + libcamlrund.$(A): $(libcamlrund_OBJECTS) + $(call MKLIB,$@, $^) + + ocamlruni$(EXE): prims.$(O) libcamlruni.$(A) +- $(MKEXE) -o $@ $^ $(LIBS) ++ $(MKEXE) $(LDFLAGS) -o $@ $^ $(LIBS) + + libcamlruni.$(A): $(libcamlruni_OBJECTS) + $(call MKLIB,$@, $^) +@@ -307,7 +307,7 @@ libcamlrun_pic.$(A): $(libcamlrunpic_OBJ + $(call MKLIB,$@, $^) + + libcamlrun_shared.$(SO): $(libcamlrunpic_OBJECTS) +- $(MKDLL) -o $@ $^ $(BYTECCLIBS) ++ $(MKDLL) $(LDFLAGS) -o $@ $^ $(BYTECCLIBS) + + libasmrun.$(A): $(libasmrun_OBJECTS) + $(call MKLIB,$@, $^) +@@ -325,7 +325,7 @@ libasmrun_pic.$(A): $(libasmrunpic_OBJEC + $(call MKLIB,$@, $^) + + libasmrun_shared.$(SO): $(libasmrunpic_OBJECTS) +- $(MKDLL) -o $@ $^ $(NATIVECCLIBS) ++ $(MKDLL) $(LDFLAGS) -o $@ $^ $(NATIVECCLIBS) + + # Target-specific preprocessor and compiler flags + diff --git a/lang/ocaml/patches/patch-tools_Makefile b/lang/ocaml/patches/patch-tools_Makefile new file mode 100644 index 00000000000..3c8d5e8b2c2 --- /dev/null +++ b/lang/ocaml/patches/patch-tools_Makefile @@ -0,0 +1,14 @@ +$NetBSD: patch-tools_Makefile,v 1.1 2019/08/24 10:54:23 jaapb Exp $ + +Honor LDFLAGS. +--- tools/Makefile.orig 2019-03-01 15:13:46.000000000 +0000 ++++ tools/Makefile +@@ -81,7 +81,7 @@ INCLUDES = $(addprefix -I $(ROOTDIR)/,ut + middle_end middle_end/base_types driver toplevel) + COMPFLAGS = -absname -w +a-4-9-41-42-44-45-48 -strict-sequence -warn-error A \ + -safe-string -strict-formats -bin-annot $(INCLUDES) +-LINKFLAGS = $(INCLUDES) ++LINKFLAGS = $(INCLUDES) -cclib "$(LDFLAGS)" + VPATH := $(filter-out -I,$(INCLUDES)) + + # scrapelabels addlabels diff --git a/lang/ocaml/patches/patch-tools_ocamlmklib b/lang/ocaml/patches/patch-tools_ocamlmklib index 3b51416e395..ee9abf63435 100644 --- a/lang/ocaml/patches/patch-tools_ocamlmklib +++ b/lang/ocaml/patches/patch-tools_ocamlmklib @@ -1,10 +1,10 @@ -$NetBSD: patch-tools_ocamlmklib,v 1.7 2017/07/18 17:41:04 wiz Exp $ +$NetBSD: patch-tools_ocamlmklib,v 1.8 2019/08/24 10:54:23 jaapb Exp $ Add ELF mode support to ocamlmklib ---- tools/ocamlmklib.ml.orig 2017-06-23 15:13:40.000000000 +0000 +--- tools/ocamlmklib.ml.orig 2019-02-08 14:34:11.000000000 +0000 +++ tools/ocamlmklib.ml -@@ -28,6 +28,7 @@ and c_objs = ref [] (* .o, .a, . +@@ -43,6 +43,7 @@ and c_objs = ref [] (* .o, .a, . and caml_libs = ref [] (* -cclib to pass to ocamlc, ocamlopt *) and caml_opts = ref [] (* -ccopt to pass to ocamlc, ocamlopt *) and dynlink = ref supports_shared_libraries @@ -12,37 +12,37 @@ Add ELF mode support to ocamlmklib and failsafe = ref false (* whether to fall back on static build only *) and c_libs = ref [] (* libs to pass to mksharedlib and ocamlc -cclib *) and c_Lopts = ref [] (* options to pass to mksharedlib and ocamlc -cclib *) -@@ -84,6 +85,8 @@ let parse_arguments argv = +@@ -110,6 +111,8 @@ let parse_arguments argv = c_objs := s :: !c_objs else if s = "-cclib" then - caml_libs := next_arg () :: "-cclib" :: !caml_libs -+ else if starts_with s "-Wl,-z" then -+ c_libs := s :: !c_libs + caml_libs := next_arg s :: "-cclib" :: !caml_libs ++ else if starts_with s "-Wl,-z" then ++ c_libs := s :: !c_libs else if s = "-ccopt" then - caml_opts := next_arg () :: "-ccopt" :: !caml_opts + caml_opts := next_arg s :: "-ccopt" :: !caml_opts else if s = "-custom" then -@@ -104,8 +107,9 @@ let parse_arguments argv = +@@ -136,8 +139,9 @@ let parse_arguments argv = c_libs := s :: !c_libs else if starts_with s "-L" then (c_Lopts := s :: !c_Lopts; - let l = chop_prefix s "-L" in - if not (Filename.is_relative l) then rpath := l :: !rpath) -+ if not !elfmode then ++ if not !elfmode then + (let l = chop_prefix s "-L" in + if not (Filename.is_relative l) then rpath := l :: !rpath)) else if s = "-ocamlcflags" then - ocamlc_opts := next_arg () :: !ocamlc_opts + ocamlc_opts := next_arg s :: !ocamlc_opts else if s = "-ocamlc" then -@@ -120,6 +124,8 @@ let parse_arguments argv = - output_c := next_arg() +@@ -152,6 +156,8 @@ let parse_arguments argv = + output_c := next_arg s else if s = "-dllpath" || s = "-R" || s = "-rpath" then - rpath := next_arg() :: !rpath -+ else if s = "-elfmode" then + rpath := next_arg s :: !rpath ++ else if s = "-elfmode" then + elfmode := true else if starts_with s "-R" then rpath := chop_prefix s "-R" :: !rpath else if s = "-Wl,-rpath" then -@@ -165,6 +171,7 @@ Usage: ocamlmklib [options] <.cmo|.cma|. +@@ -200,6 +206,7 @@ Usage: ocamlmklib [options] <.cmo|.cma|. \n -custom Disable dynamic loading\ \n -g Build with debug information\ \n -dllpath <dir> Add <dir> to the run-time search path for DLLs\ diff --git a/lang/ocaml/patches/patch-yacc_Makefile b/lang/ocaml/patches/patch-yacc_Makefile index 8d6b3bbd2c5..00ae68c15c6 100644 --- a/lang/ocaml/patches/patch-yacc_Makefile +++ b/lang/ocaml/patches/patch-yacc_Makefile @@ -1,14 +1,14 @@ -$NetBSD: patch-yacc_Makefile,v 1.3 2018/01/10 14:30:35 jaapb Exp $ +$NetBSD: patch-yacc_Makefile,v 1.4 2019/08/24 10:54:23 jaapb Exp $ Honor LDFLAGS when building ocamlyacc. ---- yacc/Makefile.orig 2017-11-03 13:52:14.000000000 +0000 +--- yacc/Makefile.orig 2019-03-01 15:13:46.000000000 +0000 +++ yacc/Makefile -@@ -28,7 +28,7 @@ MKEXE_ANSI=$(MKEXE) +@@ -36,7 +36,7 @@ MKEXE_ANSI=$(MKEXE) endif - ocamlyacc$(EXE): $(OBJS) -- $(MKEXE_ANSI) -o ocamlyacc$(EXE) $(OBJS) $(EXTRALIBS) -+ $(MKEXE_ANSI) $(BYTECCLIBS) -o ocamlyacc$(EXE) $(OBJS) $(EXTRALIBS) + ocamlyacc$(EXE): $(ocamlyacc_OBJECTS) +- $(MKEXE_ANSI) -o $@ $^ $(EXTRALIBS) ++ $(MKEXE_ANSI) $(BYTECCLIBS) $(LDFLAGS) -o $@ $^ $(EXTRALIBS) - version.h : ../VERSION - echo "#define OCAML_VERSION \"`sed -e 1q $^ | tr -d '\r'`\"" > $@ + version.h : $(ROOTDIR)/VERSION + echo "#define OCAML_VERSION \"`sed -e 1q $< | tr -d '\r'`\"" > $@ |