summaryrefslogtreecommitdiff
path: root/gnu/packages/patches/reduce-unbundle-libffi.patch
blob: 2dd17c6ec4d9ce53875b9247be51bcc799fb64d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
Copyright (C) 2025-2026 Nigko Yerden <nigko.yerden@gmail.com>

Index: autogen.sh
===================================================================
diff --git a/autogen.sh b/autogen.sh
--- a/autogen.sh	(revision 7333)
+++ b/autogen.sh	(working copy)
@@ -143,18 +143,6 @@
   ;;
 *--with-csl* | *--with-both*)
   L="$L ./csl ./csl/cslbase ./csl/cslbase-nothrow ./libraries/SoftFloat-3a/source"
-# On Apple m1 (ie arm64) I will want to build a universal version of the
-# libffi library and that is done in a way that differs from standrad builds.
-  case "`uname -s` `uname -m`" in
-  *Darwin*arm64*)
-    L="$L ./libraries/libffi-for-mac/libffi-3.3-arm64"
-    L="$L ./libraries/libffi-for-mac/libffi-3.3-x86_64"
-    L="$L ./libraries/libffi"
-    ;;
-  *)
-    L="$L ./libraries/libffi"
-    ;;
-  esac
   case $a in
   *--without-fox* | *with-fox=no* | \
   *--without-gui* | *with-gui=no*)
Index: configure.ac
===================================================================
diff --git a/configure.ac b/configure.ac
--- a/configure.ac	(revision 7333)
+++ b/configure.ac	(working copy)
@@ -1542,33 +1542,6 @@
   cd "$builddir"
 fi
 
-# On the Macintosh I will use a version of libffi provided either by
-# macports or by homebrew, so I do not want to configure to build a
-# private copy.
-if test `uname` != "Darwin" 
-then
-  AC_MSG_NOTICE([About to configure libffi])
-  mkdir -p libffi
-  cd libffi
-  setpasscc
-  doconfig="$SHELL $abssrcdir/libraries/libffi/configure -C $filtered \
-          $pass_host \
-          CPPFLAGS=\"$CPPFLAGS\" \
-          CFLAGS=\"$CFLAGS\" \
-          CXXFLAGS=\"$CXXFLAGS\" \
-          LDFLAGS=\"$LDFLAGS\" \
-          $passcc \
-          --disable-multi-os-directory \
-          --disable-docs \
-          --prefix=\"$builddir\" \
-          --libdir=\"$builddir/lib\" \
-          --includedir=\"$builddir/include\""
-  AC_MSG_NOTICE([doconfig = $doconfig])
-  printf "\n\n+++ About to configure libffi +++\n\n"
-  eval "$doconfig"
-  cd "$builddir"
-fi
-
 AC_MSG_NOTICE([About to configure libsoftfloat])
 mkdir -p softfloat
 cd softfloat
Index: csl/cslbase/Makefile.am
===================================================================
diff --git a/csl/cslbase/Makefile.am b/csl/cslbase/Makefile.am
--- a/csl/cslbase/Makefile.am	(revision 7333)
+++ b/csl/cslbase/Makefile.am	(working copy)
@@ -897,38 +897,6 @@
 
 else !mac_framework
 
-LIBFFIDEPS=../lib/libffi.a ../include/ffi.h
-
-FFIDEP = ../include/ffi.h
-FFIINC = -I../include
-AM_CPPFLAGS     += $(FFINC)
-reduce_CPPFLAGS += $(FFINC)
-reduce_web_CPPFLAGS += $(FFINC)
-bootstrapreduce_CPPFLAGS += $(FFINC)
-csl_CPPFLAGS    += $(FFINC)
-flatcsl_CPPFLAGS    += $(FFINC)
-
-# The following ugly dependencies are here so that one can go, for
-# instance, "make csl.o" in a clean tree and libffi building will get
-# triggered.
-
-csl_LDADD += ../lib/libffi.a
-flatcsl_LDADD += ../lib/libffi.a
-bootstrapreduce_LDADD += ../lib/libffi.a
-reduce_LDADD += ../lib/libffi.a
-reduce_web_LDADD += ../lib/libffi.a
-
-csl_DEPENDENCIES += $(LIBFFIDEPS)
-flatcsl_DEPENDENCIES += $(LIBFFIDEPS)
-bootstrapreduce_DEPENDENCIES += $(LIBFFIDEPS)
-reduce_DEPENDENCIES += $(LIBFFIDEPS)
-reduce_web_DEPENDENCIES += $(LIBFFIDEPS)
-
-$(LIBFFIDEPS):
-	@printf "About to build libffi for %s ($@)\n" `pwd`
-	printf "\n\n=== About to build libffi library\n\n";
-	-$(TRACE)@$(MAKE) -C ../libffi install
-
 endif !mac_framework
 
 SOFTFLOATDEPS=../lib/libsoftfloat.a ../include/softfloat.h
Index: csl/cslbase/configure.ac
===================================================================
diff --git a/csl/cslbase/configure.ac b/csl/cslbase/configure.ac
--- a/csl/cslbase/configure.ac	(revision 7333)
+++ b/csl/cslbase/configure.ac	(working copy)
@@ -146,6 +146,8 @@
   AC_DEFINE(WITHOUT_FFI, [1], [remove the foreign function support])
 fi
 
+AC_SEARCH_LIBS([ffi_call], [ffi])
+
 # What host am I on?
 AC_CANONICAL_HOST()