summaryrefslogtreecommitdiff
path: root/lang/ocaml/patches/patch-configure
blob: 088f1b825c5b8abec638bfe13fd4d318d1dd59e6 (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
$NetBSD: patch-configure,v 1.18 2016/07/15 12:44:21 jperkin Exp $

Several configure changes to work on and detect NetBSD (and some other OSes)
See also: <http://caml.inria.fr/mantis/view.php?id=6900>

--- configure.orig	2016-04-25 13:36:01.000000000 +0000
+++ configure
@@ -671,7 +671,7 @@ if test $with_sharedlibs = "yes"; then
       mkmaindll="$flexlink -maindll"
       shared_libraries_supported=true;;
     *-*-linux-gnu|*-*-linux|*-*-freebsd[3-9]*|*-*-freebsd[1-9][0-9]*\
-    |*-*-openbsd*|*-*-netbsd*|*-*-gnu*|*-*-haiku*)
+    |*-*-openbsd*|*-*-netbsd*|*-*-dragonfly|*-*-gnu*|*-*-haiku*)
       sharedcccompopts="-fPIC"
       mksharedlib="$bytecc -shared"
       bytecclinkopts="$bytecclinkopts -Wl,-E"
@@ -699,7 +699,10 @@ if test $with_sharedlibs = "yes"; then
         *gcc*)
           sharedcccompopts="-fPIC"
           if sh ./solaris-ld; then
-            mksharedlib="ld -G"
+            case "$target" in
+            x86_64*) mksharedlib="$bytecc -shared" ;;
+            *)       mksharedlib="$bytecc -G" ;;
+            esac
             byteccrpath="-R"
             mksharedlibrpath="-R"
           else
@@ -726,7 +729,7 @@ if test $with_sharedlibs = "yes"; then
       byteccrpath="-Wl,-rpath,"
       mksharedlibrpath="-rpath "
       shared_libraries_supported=true;;
-    i[3456]86-*-darwin[89].*)
+    i[3456]86-*-darwin*)
       mksharedlib="$bytecc -bundle -flat_namespace -undefined suppress \
                    -read_only_relocs suppress"
       bytecccompopts="$dl_defs $bytecccompopts"
@@ -768,11 +771,7 @@ if test $with_sharedlibs = "yes"; 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;;
@@ -785,6 +784,9 @@ if test $with_sharedlibs = "yes"; 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;;
@@ -814,6 +816,7 @@ case "$target" in
   sparc*-*-gnu*)                arch=sparc; system=gnu;;
   i[3456]86-*-linux*)           arch=i386; system=linux_`sh ./runtest elf.c`;;
   i[3456]86-*-*bsd*)            arch=i386; system=bsd_`sh ./runtest elf.c`;;
+  i[3456]86-*-dragonfly*)       arch=i386; system=bsd_`sh ./runtest elf.c`;;
   i[3456]86-*-nextstep*)        arch=i386; system=nextstep;;
   i[3456]86-*-solaris*)         if $arch64; then
                                   arch=amd64; system=solaris
@@ -823,6 +826,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
@@ -848,12 +852,15 @@ case "$target" in
   armv5te*-*-linux-gnueabi)     arch=arm; model=armv5te; system=linux_eabi;;
   armv5*-*-linux-gnueabi)       arch=arm; model=armv5; system=linux_eabi;;
   arm*-*-linux-gnueabi)         arch=arm; system=linux_eabi;;
+  arm*-*-netbsd*)               arch=arm; system=netbsd;;
   arm*-*-openbsd*)              arch=arm; system=bsd;;
   zaurus*-*-openbsd*)           arch=arm; system=bsd;;
   x86_64-*-linux*)              arch=amd64; system=linux;;
   x86_64-*-gnu*)                arch=amd64; system=gnu;;
   x86_64-*-freebsd*)            arch=amd64; system=freebsd;;
   x86_64-*-netbsd*)             arch=amd64; system=netbsd;;
+  x86_64-*-dragonfly*)          arch=amd64; system=dragonfly;;
+  x86_64-*-solaris*)            arch=amd64; system=solaris;;
   x86_64-*-openbsd*)            arch=amd64; system=openbsd;;
   x86_64-*-darwin*)             arch=amd64; system=macosx;;
   x86_64-*-mingw*)              arch=amd64; system=mingw;;
@@ -894,7 +901,6 @@ case "$arch,$nativecc,$system,$model" in
   *,*,nextstep,*)      nativecclinkopts="-posix";;
   *,*,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";;
@@ -912,8 +918,8 @@ case "$arch,$system" in
                     fi;;
   amd64,solaris)  as="${TOOLPREF}as --64"
                   aspp="${TOOLPREF}gcc -m64 -c";;
-  i386,solaris)   as="${TOOLPREF}as"
-                  aspp="/usr/ccs/bin/${TOOLPREF}as -P";;
+  i386,solaris)   as="${TOOLPREF}as --32"
+                  aspp="gcc -m32 -c";;
   power,elf)      if $arch64; then
                     as="${TOOLPREF}as -a64 -mppc64"
                     aspp="${TOOLPREF}gcc -m64 -c"
@@ -960,6 +966,7 @@ case "$arch,$system" in
   arm,linux*) profiling='prof';;
   power,elf) profiling='prof';;
   power,bsd*) profiling='prof';;
+	*,*,dragonfly) profiling='prof';;
   *) profiling='noprof';;
 esac
 
@@ -1505,6 +1512,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`
@@ -1551,6 +1560,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       \
@@ -1608,6 +1618,7 @@ if test "$x11_include" = "not found"; th
                           \
     /usr/lib64            \
     /usr/lib              \
+    /usr/pkg/lib          \
     /usr/local/lib        \
     /usr/unsupported/lib  \
     /usr/athena/lib       \
@@ -1629,18 +1640,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
-          *-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=""