diff options
Diffstat (limited to 'databases/ocaml-dbm/files')
-rw-r--r-- | databases/ocaml-dbm/files/3bb91d6-revised-configuration | 127 | ||||
-rw-r--r-- | databases/ocaml-dbm/files/patch-META | 10 | ||||
-rw-r--r-- | databases/ocaml-dbm/files/patch-Makefile | 27 |
3 files changed, 127 insertions, 37 deletions
diff --git a/databases/ocaml-dbm/files/3bb91d6-revised-configuration b/databases/ocaml-dbm/files/3bb91d6-revised-configuration new file mode 100644 index 000000000000..fc1dcc2275d4 --- /dev/null +++ b/databases/ocaml-dbm/files/3bb91d6-revised-configuration @@ -0,0 +1,127 @@ +From 3bb91d6ffd700f9211a84dd2fc80c428bfcf5510 Mon Sep 17 00:00:00 2001 +From: Xavier Leroy <xavierleroy@users.noreply.github.com> +Date: Wed, 20 Jul 2022 11:18:18 +0200 +Subject: [PATCH] Revised autoconfiguration (#16) + +- Let the C compiler find the ndbm.h or gdbm.h files + (instead of looking for them in specific directories). +- Don't use the gdbm-ndbm.h compatibility mode, it no longer exists. +--- + cldbm.c | 4 +--- + configure | 69 ++++++++++++++++++++++--------------------------------- + 2 files changed, 29 insertions(+), 44 deletions(-) + +diff --git a/cldbm.c b/cldbm.c +index 34e2d37..0fa4d13 100644 +--- a/cldbm.c ++++ b/cldbm.c +@@ -21,9 +21,7 @@ + #include <caml/fail.h> + #include <caml/callback.h> + +-#ifdef DBM_USES_GDBM_NDBM +-#include <gdbm-ndbm.h> +-#elif defined DBM_COMPAT ++#ifdef DBM_COMPAT + #include <ndbm.h> + #else + #include <gdbm.h> +diff --git a/configure b/configure +index 9a3d094..e049218 100755 +--- a/configure ++++ b/configure +@@ -36,7 +36,7 @@ hasgot() { + fi + echo ' return 0;' + echo '}') > hasgot.c +- ${CC:-cc} -I$1 -o hasgot.exe hasgot.c $3 $4 ++ ${CC:-cc} $1 -o hasgot.exe hasgot.c $3 2>/dev/null + res=$? + rm -f hasgot.c hasgot.exe + return $res +@@ -46,58 +46,45 @@ dbm_include="not found" + dbm_link="not found" + dbm_defines="" + +-for dir in /usr/include /usr/include/db1 /usr/include/gdbm /usr/local/include; do +- if test -f $dir/ndbm.h; then +- dbm_include=$dir +- dbm_defines="-DDBM_COMPAT" +- if hasgot $dir ndbm.h; then +- dbm_link="" +- elif hasgot $dir ndbm.h -lndbm; then +- dbm_link="-lndbm" +- elif hasgot $dir ndbm.h -ldb1; then +- dbm_link="-ldb1" +- elif hasgot $dir ndbm.h -lgdbm; then +- dbm_link="-lgdbm" +- elif hasgot $dir ndbm.h -lgdbm_compat -lgdbm; then +- dbm_link="-lgdbm_compat -lgdbm" ++for include in \ ++ "" \ ++ "-I/usr/include/db1" \ ++ "-I/usr/include/gdbm" \ ++ "-I/usr/local/include" \ ++ "-I/opt/homebrew/include" ; do ++ if hasgot "$include" ndbm.h ""; then ++ dbm_include="$include" ++ dbm_defines="-DDBM_COMPAT" ++ dbm_link="" ++ break ++ elif hasgot "$include" gdbm.h -lgdbm; then ++ dbm_include="$include" ++ dbm_link="-lgdbm" ++ break ++ elif hasgot "$include" ndbm.h -lndbm; then ++ dbm_include="$include" ++ dbm_defines="-DDBM_COMPAT" ++ dbm_link="-lndbm" ++ break ++ elif hasgot "$include" ndbm.h -ldb1; then ++ dbm_include="$include" ++ dbm_defines="-DDBM_COMPAT" ++ dbm_link="-ldb1" ++ break + fi +- break +- fi +- if test -f $dir/gdbm-ndbm.h; then +- dbm_include=$dir +- dbm_defines="-DDBM_COMPAT -DDBM_USES_GDBM_NDBM" +- if hasgot $dir gdbm-ndbm.h -lgdbm_compat -lgdbm; then +- dbm_link="-lgdbm_compat -lgdbm" +- fi +- break +- fi +- if test -f $dir/gdbm.h; then +- dbm_include=$dir +- if hasgot $dir gdbm.h -lgdbm; then +- dbm_link="-lgdbm" +- fi +- break +- fi + done + if test "$dbm_include" = "not found" || test "$dbm_link" = "not found"; then +- echo "NDBM not found, the \"camldbm\" library cannot be built." ++ echo "NDBM and GDBM not found, the \"camldbm\" library cannot be built." + exit 2 + fi + + echo "Configuration for the \"camldbm\" library:" +-echo " headers found in ......... $dbm_include" +-echo " options for compiling .... $dbm_defines" ++echo " options for compiling .... $dbm_include $dbm_defines" + echo " options for linking ...... $dbm_link" + echo + echo "Configuration successful" + echo + +-if test "$dbm_include" = "/usr/include"; then +- dbm_include="" +-else +- dbm_include="-I$dbm_include" +-fi +- + echo "OCAML_STDLIB=$stdlib" > Makefile.config + echo "DBM_INCLUDES=$dbm_include" >> Makefile.config + echo "DBM_LINK=$dbm_link" >> Makefile.config diff --git a/databases/ocaml-dbm/files/patch-META b/databases/ocaml-dbm/files/patch-META deleted file mode 100644 index 861715dffc1e..000000000000 --- a/databases/ocaml-dbm/files/patch-META +++ /dev/null @@ -1,10 +0,0 @@ -$NetBSD: patch-META,v 1.1 2013/07/21 17:04:29 jaapb Exp $ - -point to correct directory for library files ---- META.orig 2011-11-22 15:56:49.000000000 +0000 -+++ META -@@ -3,3 +3,4 @@ requires = "" - version = "1.0" - archive(byte) = "dbm.cma" - archive(native) = "dbm.cmxa" -+directory = "^" diff --git a/databases/ocaml-dbm/files/patch-Makefile b/databases/ocaml-dbm/files/patch-Makefile deleted file mode 100644 index c1e15f46971f..000000000000 --- a/databases/ocaml-dbm/files/patch-Makefile +++ /dev/null @@ -1,27 +0,0 @@ -$NetBSD: patch-Makefile,v 1.1 2012/12/15 10:25:52 jaapb Exp $ - -Install into DESTDIR ---- Makefile.orig 2011-11-22 15:56:49.000000000 +0000 -+++ Makefile -@@ -57,13 +57,14 @@ depend: - $(OCAMLDEP) *.ml *.mli > .depend - - install:: -- if test -f dllcamldbm.$(SO); then cp dllcamldbm.$(SO) $(STUBLIBDIR)/; fi -- cp libcamldbm.$(A) $(LIBDIR)/ -- cd $(LIBDIR) && ranlib libcamldbm.$(A) -- cp dbm.cma dbm.cmxa dbm.cmi dbm.mli $(LIBDIR)/ -- cp dbm.$(A) $(LIBDIR)/ -- cd $(LIBDIR) && ranlib dbm.$(A) -- if test -f dbm.cmxs; then cp dbm.cmxs $(LIBDIR)/; fi -+ if test -f dllcamldbm.$(SO); then cp dllcamldbm.$(SO) \ -+ $(DESTDIR)/$(STUBLIBDIR)/; fi -+ cp libcamldbm.$(A) $(DESTDIR)/$(LIBDIR)/ -+ cd $(DESTDIR)/$(LIBDIR) && ranlib libcamldbm.$(A) -+ cp dbm.cma dbm.cmxa dbm.cmi dbm.mli $(DESTDIR)/$(LIBDIR)/ -+ cp dbm.$(A) $(DESTDIR)/$(LIBDIR)/ -+ cd $(DESTDIR)/$(LIBDIR) && ranlib dbm.$(A) -+ if test -f dbm.cmxs; then cp dbm.cmxs $(DESTDIR)/$(LIBDIR)/; fi - - clean:: - rm -f *.cm* *.$(O) *.$(A) *.$(SO) |