Skip to content

Commit 2ba53a0

Browse files
Fold some patches (and avoid duplicate) and be less restrictive when we
modify the domain_state.h Co-authored-by: Kate <kit.ty.kate@disroot.org>
1 parent 03e6822 commit 2ba53a0

7 files changed

+5
-143
lines changed

caml/GNUmakefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ OCAMLRUN=$(shell which ocamlrun)
4040
OCAMLRUND=$(shell which ocamlrund)
4141
OCAMLRUNI=$(shell which ocamlruni)
4242
OCAMLYACC=$(shell which ocamlyacc)
43+
OCAML_VERSION_MAJOR=$(shell echo $(MAKECONF_OCAML_VERSION) | cut -d. -f1)
44+
OCAML_VERSION_MINOR=$(shell echo $(MAKECONF_OCAML_VERSION) | cut -d. -f2)
4345
ocaml/Makefile.config: ocaml/Makefile esperanto_sys.c
4446
# configure: Use /usr/bin/cpp instead of /lib/cpp
4547
sed -e 's/\/lib\/cpp/\/usr\/bin\/cpp/g' ocaml/configure > ocaml/configure.sed
@@ -88,7 +90,7 @@ ocaml/Makefile.config: ocaml/Makefile esperanto_sys.c
8890
cat esperanto_systhreads_signals.c >> ocaml/otherlibs/systhreads/st_posix.h
8991
cat esperanto_termios.c >> ocaml/otherlibs/unix/termios.c
9092
patch ocaml/otherlibs/unix/gethost.c esperanto_gethost.patch
91-
patch ocaml/otherlibs/unix/socketaddr.c esperanto_socketaddr.$(MAKECONF_OCAML_VERSION).patch
93+
patch ocaml/otherlibs/unix/socketaddr.c esperanto_socketaddr.$(OCAML_VERSION_MAJOR).$(OCAML_VERSION_MINOR).patch
9294
# We must comment [alloc], [callback] and [flush] which are `#define` by Cosmopolitan
9395
sed -e '/ alloc /s/^/\/\//' ocaml/runtime/caml/compatibility.h > ocaml/runtime/caml/compatibility.h.sed
9496
mv ocaml/runtime/caml/compatibility.h.sed ocaml/runtime/caml/compatibility.h
@@ -103,7 +105,8 @@ ocaml/Makefile.config: ocaml/Makefile esperanto_sys.c
103105
printf "ocamlruni:\n\tcp $(OCAMLRUNI) .\n" >> ocaml/runtime/Makefile
104106
touch ocaml/runtime/libcamlrun.a ocaml/runtime/libcamlrund.a ocaml/runtime/libcamlruni.a
105107
# Comment a CAML_STATIC_ASSERT which emits warnings ("variably modified 'static_assertion_failure_line_XX'")
106-
@if [ "$(MAKECONF_OCAML_VERSION)" = "4.14.0" -o "$(MAKECONF_OCAML_VERSION)" = "4.14.1" ] ; then \
108+
# for >= OCaml 4.14 & then < OCaml 4.14
109+
@if [ "$(OCAML_VERSION_MAJOR)" -ge "4" -a "$(OCAML_VERSION_MINOR)" -ge "14" ] ; then \
107110
sed -e "56,58 s/^/\/\//" ocaml/runtime/caml/domain_state.h > ocaml/runtime/caml/domain_state.h.sed; \
108111
mv ocaml/runtime/caml/domain_state.h.sed ocaml/runtime/caml/domain_state.h; \
109112
else \

caml/esperanto_socketaddr.4.13.0.patch

Lines changed: 0 additions & 48 deletions
This file was deleted.

caml/esperanto_socketaddr.4.13.1.patch

Lines changed: 0 additions & 48 deletions
This file was deleted.

caml/esperanto_socketaddr.4.14.1.patch

Lines changed: 0 additions & 45 deletions
This file was deleted.

0 commit comments

Comments
 (0)