summaryrefslogtreecommitdiff
path: root/lang/ocaml/patches/patch-configure
blob: ad5c3b71ec422797eceae468f09888e9d4724e33 (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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
$NetBSD: patch-configure,v 1.33 2018/04/30 10:38:04 wiz Exp $

All kinds of OS-specific changes to configure
Honor LDFLAGS.

--- configure.orig	2017-11-03 13:52:13.000000000 +0000
+++ configure
@@ -791,7 +791,7 @@ sharedcccompopts=''
 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
@@ -820,10 +820,13 @@ if $with_sharedlibs; then
       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
@@ -850,7 +853,7 @@ if $with_sharedlibs; then
       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"
@@ -899,11 +902,7 @@ if $with_sharedlibs; then
     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;;
@@ -916,6 +915,9 @@ if $with_sharedlibs; then
     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;;
@@ -959,6 +962,7 @@ case "$target" in
   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
@@ -979,6 +983,8 @@ case "$target" in
   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;;
@@ -996,6 +1002,7 @@ case "$target" in
   x86_64-*-mingw*)              arch=amd64; system=mingw;;
   aarch64-*-linux*)             arch=arm64; system=linux;;
   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
@@ -1019,7 +1026,6 @@ nativeccprofopts=''
 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";;
@@ -1037,8 +1043,8 @@ case "$arch,$system" in
                     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"
@@ -1086,6 +1092,8 @@ case "$arch,$system" in
   power,elf) profiling='true';;
   power,bsd*) profiling='true';;
   power,netbsd) profiling='true';;
+  amd64,solaris) profiling='true';;
+  *,dragonfly) profiling='true';;
   *) profiling='false';;
 esac
 
@@ -1669,6 +1677,8 @@ fi
 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`
@@ -1715,6 +1725,7 @@ if test "$x11_include" = "not found"; th
     /usr/XFree86/include/X11  \
                               \
     /usr/include              \
+    /usr/pkg/include          \
     /usr/local/include        \
     /usr/unsupported/include  \
     /usr/athena/include       \
@@ -1772,6 +1783,7 @@ if test "$x11_include" = "not found"; th
                           \
     /usr/lib64            \
     /usr/lib              \
+    /usr/pkg/lib          \
     /usr/local/lib        \
     /usr/unsupported/lib  \
     /usr/athena/lib       \
@@ -1793,19 +1805,16 @@ if test "$x11_include" = "not found"; th
       if test $dir = /usr/lib; then
         x11_link="-lX11"
       else
-        x11_libs="-L$dir"
-        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=""
@@ -2056,7 +2065,7 @@ config CFLAGS "$common_cflags $internal_
 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 $curseslibs $pthread_link \
                  $instrumented_runtime_libs"
 config RPATH "$rpath"