summaryrefslogtreecommitdiff
path: root/x11-libs/wxGTK/files/wxGTK-2.8.12.1-libdir.patch
blob: db9571438d86df80c99a60df3d2a796a2d6686fe (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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
From e87336e8d583044d62b1a9400db4c29f1474fa50 Mon Sep 17 00:00:00 2001
From: nE0sIghT <ykonotopov@gmail.com>
Date: Wed, 5 Aug 2015 12:37:36 +0300
Subject: [PATCH 1/2] Backported new libraries search code

---
 acinclude.m4 | 75 ++++++++++++++++++++++++++++++++++++++++++++---
 configure.in | 96 +++++++++++++++++++++++-------------------------------------
 2 files changed, 107 insertions(+), 64 deletions(-)

diff --git a/acinclude.m4 b/acinclude.m4
index a44747c..1e307c9 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -43,16 +43,17 @@ for ac_dir in $1 /usr/include;
 ])
 
 dnl ---------------------------------------------------------------------------
-dnl call WX_PATH_FIND_LIBRARIES(search path, lib name), sets ac_find_libraries
-dnl to the full name of the file that was found or leaves it empty if not found
+dnl call WX_PATH_FIND_LIBRARIES(lib name, [optional extra search paths])
+dnl sets ac_find_libraries to the full name of the file that was found
+dnl or leaves it empty if not found
 dnl ---------------------------------------------------------------------------
 AC_DEFUN([WX_PATH_FIND_LIBRARIES],
 [
   ac_find_libraries=
-  for ac_dir in $1;
+  for ac_dir in $2 $SEARCH_LIB
   do
     for ac_extension in a so sl dylib dll.a; do
-      if test -f "$ac_dir/lib$2.$ac_extension"; then
+      if test -f "$ac_dir/lib$1.$ac_extension"; then
         ac_find_libraries=$ac_dir
         break 2
       fi
@@ -115,6 +116,72 @@ AC_DEFUN([WX_LINK_PATH_EXIST],
   fi
 ])
 
+dnl ---------------------------------------------------------------------------
+dnl Usage: WX_FIND_LIB(lib-name, [lib-function to test], [extra search paths])
+dnl
+dnl Tests in a variety of ways for the presence of lib-name
+dnl
+dnl On success, returns any novel path found in ac_find_libraries; else "std"
+dnl             and any cflags in ac_find_cflags
+dnl On failure, ac_find_libraries will be empty
+dnl ---------------------------------------------------------------------------
+AC_DEFUN([WX_FIND_LIB],
+[
+  ac_find_libraries=
+
+  dnl Try with pkg-config first. It requires its lib-name parameter lowercase
+  fl_pkgname=`echo "$1" | tr [[:upper:]] [[:lower:]]`
+  dnl suppress PKG_PROG_PKG_CONFIG output; we don't want to keep seeing it
+  PKG_PROG_PKG_CONFIG() AS_MESSAGE_FD> /dev/null
+  PKG_CHECK_MODULES([$1], [$fl_pkgname],
+    [
+      dnl Start by assuming there are no novel lib paths
+      ac_find_libraries="std"
+
+      dnl A simple copy of the internal vars $1_CFLAGS $1_LIBS doesn't work
+      dnl inside the macro
+      dnl
+      dnl TODO: When we stop being autoconf 2.61 compatible, the next 2 lines
+      dnl should become:
+      dnl AS_VAR_COPY([ac_find_cflags], [$1_CFLAGS])
+      dnl AS_VAR_COPY([fl_libs], [$1_LIBS])
+      eval ac_find_cflags=\$$1_CFLAGS
+      eval fl_libs=\$$1_LIBS
+
+      dnl fl_libs may now contain -Lfoopath -lfoo (only non-standard paths are
+      dnl added) We only want the path bit, not the lib names
+      for fl_path in $fl_libs
+      do
+        if test `echo "$fl_path" | cut -c 1-2` = "-L"; then
+          dnl there shouldn't be >1 novel path
+          dnl return it without the -L, ready for WX_LINK_PATH_EXIST
+          ac_find_libraries=`echo "$fl_path" | cut -c 3-`
+        fi
+      done
+    ],
+    [
+      if test "x$ac_find_libraries" = "x"; then
+        dnl Next with AC_CHECK_LIB, if a test function was provided
+        if test "x$2" != "x"; then
+          AC_CHECK_LIB([$1], [$2], [ac_find_libraries="std"])
+        fi
+      fi
+
+      if test "x$ac_find_libraries" = "x"; then
+        dnl Finally try the search path
+        dnl Output a message again, as AC_CHECK_LIB will just have said "no"
+        AC_MSG_CHECKING([elsewhere])
+        dnl $3 will occasionally hold extra path(s) to search
+        WX_PATH_FIND_LIBRARIES([$1], [$3])
+        if test "x$ac_find_libraries" != "x"; then
+          AC_MSG_RESULT([yes])
+        else
+          AC_MSG_RESULT([no])
+        fi
+      fi
+    ])
+])
+
 dnl ===========================================================================
 dnl C++ features test
 dnl ===========================================================================
diff --git a/configure.in b/configure.in
index 021845d..9c78ba3 100644
--- a/configure.in
+++ b/configure.in
@@ -2767,7 +2767,7 @@ if test "$build" != "$host" -a "$GCC" = yes; then
             x_includes=$ac_find_includes
         fi
         if test -z "$x_libraries" -o "$x_libraries" = NONE; then
-            WX_PATH_FIND_LIBRARIES($SEARCH_LIB, Xt)
+            WX_PATH_FIND_LIBRARIES(Xt)
             x_libraries=$ac_find_libraries
         fi
     fi
@@ -3554,7 +3554,7 @@ libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config
         dnl test for external libxpm if we're configured to use it
         if test "$wxUSE_GPE" = "yes"; then
             AC_MSG_CHECKING(for gpewidget library)
-            WX_PATH_FIND_LIBRARIES($SEARCH_LIB,gpewidget)
+            WX_PATH_FIND_LIBRARIES(gpewidget)
             if test "$ac_find_libraries" != "" ; then
                 WX_LINK_PATH_EXIST($ac_find_libraries,$GUI_TK_LIBRARY)
                 dnl -lgpewidget must be before all GTK libs and
@@ -3567,7 +3567,7 @@ libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config
             fi
 
             dnl AC_MSG_CHECKING(for gpe library)
-            dnl WX_PATH_FIND_LIBRARIES($SEARCH_LIB,gpe)
+            dnl WX_PATH_FIND_LIBRARIES(gpe)
             dnl if test "$ac_find_libraries" != "" ; then
             dnl     WX_LINK_PATH_EXIST($ac_find_libraries,$GUI_TK_LIBRARY)
             dnl     GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lgpe"
@@ -3817,7 +3817,7 @@ libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config
 
 
         AC_MSG_CHECKING(for Motif/Lesstif library)
-        WX_PATH_FIND_LIBRARIES($SEARCH_LIB, Xm)
+        WX_PATH_FIND_LIBRARIES(Xm)
 
         if test "x$ac_find_libraries" != "x" ; then
             AC_MSG_RESULT(found in $ac_find_libraries)
@@ -3956,7 +3956,7 @@ libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config
         dnl test for external libxpm if we're configured to use it
         if test "$wxUSE_LIBXPM" = "sys"; then
             AC_MSG_CHECKING(for Xpm library)
-            WX_PATH_FIND_LIBRARIES($SEARCH_LIB,Xpm)
+            WX_PATH_FIND_LIBRARIES(Xpm)
             if test "$ac_find_libraries" != "" ; then
                 WX_LINK_PATH_EXIST($ac_find_libraries,$GUI_TK_LIBRARY)
                 GUI_TK_LIBRARY="$GUI_TK_LIBRARY$ac_path_to_link"
@@ -4192,41 +4192,23 @@ dnl ---------------------------------------------------------------------------
 dnl wxDisplay Sanity checks
 dnl ---------------------------------------------------------------------------
 
+USE_XINERAMA=0
 if test "$wxUSE_DISPLAY" = "yes"; then
 dnl ---------------------------------------------------------------------------
 dnl Xinerama (for unix ) - Brian Victor
 dnl ---------------------------------------------------------------------------
     if test "$wxUSE_UNIX" = "yes" -a "$wxUSE_MAC" != 1 -a "$wxUSE_COCOA" != 1; then
-        AC_MSG_CHECKING([for Xinerama])
-        WX_PATH_FIND_LIBRARIES([$SEARCH_LIB],Xinerama)
+        WX_FIND_LIB(Xinerama, XineramaQueryScreens)
         if test "$ac_find_libraries" != "" ; then
-            WX_LINK_PATH_EXIST([$ac_find_libraries],[$LDFLAGS])
-            if test "$ac_path_to_link" != " -L/usr/lib" ; then
-                LDFLAGS="$LDFLAGS $ac_path_to_link"
+            if test "$ac_find_libraries" != "std" ; then
+              WX_LINK_PATH_EXIST([$ac_find_libraries],[$LDFLAGS])
+              if test "$ac_path_to_link" != " -L/usr/lib" ; then
+                  LDFLAGS="$LDFLAGS $ac_path_to_link"
+              fi
             fi
+            USE_XINERAMA=1
             GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lXinerama"
-            AC_MSG_RESULT([yes])
-
-            AC_MSG_CHECKING([for Xxf86vm extension])
-            WX_PATH_FIND_LIBRARIES([$SEARCH_LIB],Xxf86vm)
-            if test "$ac_find_libraries" != "" ; then
-                AC_MSG_RESULT([yes])
-                AC_CHECK_HEADERS([X11/extensions/xf86vmode.h],
-                                 [
-                                  GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lXxf86vm"
-                                 ],
-                                 [],
-                                 [
-                                      #if HAVE_X11_XLIB_H
-                                        #include <X11/Xlib.h>
-                                      #endif
-                                 ])
-            else
-                AC_MSG_RESULT([no])
-            fi
-
         else
-            AC_MSG_RESULT([no])
             AC_MSG_WARN([Xinerama not found; disabling wxDisplay])
             wxUSE_DISPLAY="no"
         fi
@@ -4243,17 +4225,16 @@ dnl X11 session management
 dnl ---------------------------------------------------------------------------
 if test "$wxUSE_DETECT_SM" = "yes"; then
     if test "$wxUSE_UNIX" = "yes" -a "$wxUSE_MAC" != 1 -a "$wxUSE_COCOA" != 1; then
-        AC_MSG_CHECKING([for -lSM - X11 session management])
-        WX_PATH_FIND_LIBRARIES([$SEARCH_LIB],SM)
+        WX_FIND_LIB(SM, SmcOpenConnection)
         if test "$ac_find_libraries" != "" ; then
-            WX_LINK_PATH_EXIST([$ac_find_libraries],[$LDFLAGS])
-            if test "$ac_path_to_link" != " -L/usr/lib" ; then
+            if test "$ac_find_libraries" != "std" ; then
+              WX_LINK_PATH_EXIST([$ac_find_libraries],[$LDFLAGS])
+              if test "$ac_path_to_link" != " -L/usr/lib" ; then
                 LDFLAGS="$LDFLAGS $ac_path_to_link"
+              fi
             fi
             GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lSM"
-            AC_MSG_RESULT([yes])
         else
-            AC_MSG_RESULT([no])
             AC_MSG_WARN([libSM not found; disabling session management detection])
             wxUSE_DETECT_SM="no"
         fi
@@ -4295,51 +4276,46 @@ if test "$wxUSE_OPENGL" = "yes"; then
             AC_CHECK_HEADER(GL/glu.h, [
                 found_gl=0
 
-                AC_MSG_CHECKING([for -lGL])
-                WX_PATH_FIND_LIBRARIES([$SEARCH_LIB /opt/graphics/OpenGL/lib],GL)
+                WX_FIND_LIB(GL, glBegin, [/opt/graphics/OpenGL/lib])
                 if test "$ac_find_libraries" != "" ; then
-                    AC_MSG_RESULT([found in $ac_find_libraries])
-
-                    WX_LINK_PATH_EXIST([$ac_find_libraries],[$LDFLAGS])
-                    if test "$ac_path_to_link" != " -L/usr/lib" ; then
+                    if test "$ac_find_libraries" != "std" ; then
+                      WX_LINK_PATH_EXIST([$ac_find_libraries],[$LDFLAGS])
+                      if test "$ac_path_to_link" != " -L/usr/lib" ; then
                         LDFLAGS_GL="$ac_path_to_link"
+                      fi
                     fi
 
                     dnl don't suppose that libGL and libGLU are always in the
                     dnl same directory -- this is not true for some common
                     dnl distributions
-                    AC_MSG_CHECKING([for -lGLU])
-                    WX_PATH_FIND_LIBRARIES([$SEARCH_LIB],GLU)
+                    WX_FIND_LIB(GLU, gluBeginCurve, [/opt/graphics/OpenGL/lib])
                     if test "$ac_find_libraries" != "" ; then
+                      if test "$ac_find_libraries" != "std" ; then
                         WX_LINK_PATH_EXIST([$ac_find_libraries],[$LDFLAGS])
                         if test "$ac_path_to_link" != " -L/usr/lib" -a \
-                                    "$ac_path_to_link" != "$LDFLAGS_GL"; then
-                            LDFLAGS_GL="$LDFLAGS_GL$ac_path_to_link"
+                                "$ac_path_to_link" != "$LDFLAGS_GL" ; then
+                          LDFLAGS_GL="$LDFLAGS_GL$ac_path_to_link"
                         fi
+                      fi
 
                         found_gl=1
                         OPENGL_LIBS="-lGL -lGLU"
-                        AC_MSG_RESULT([yes])
-                    else
-                        AC_MSG_RESULT([no])
                     fi
-                else
-                    AC_MSG_RESULT([no])
                 fi
 
                 if test "$found_gl" != 1; then
-                    AC_MSG_CHECKING([for -lMesaGL])
-                    WX_PATH_FIND_LIBRARIES([$SEARCH_LIB],MesaGL)
+                    WX_FIND_LIB(MesaGL, glEnable, [/opt/graphics/OpenGL/lib])
                     if test "$ac_find_libraries" != "" ; then
+                      if test "$ac_find_libraries" != "std" ; then
                         WX_LINK_PATH_EXIST([$ac_find_libraries],[$LDFLAGS])
-                        LDFLAGS_GL="$LDFLAGS$ac_path_to_link"
-                        OPENGL_LIBS="-lMesaGL -lMesaGLU"
-                        AC_MSG_RESULT([yes])
-                    else
-                        AC_MSG_RESULT([no])
+                        if test "$ac_path_to_link" != " -L/usr/lib" ; then
+                          LDFLAGS_GL="$LDFLAGS_GL$ac_path_to_link"
+                        fi
+                      fi
+                      OPENGL_LIBS="-lMesaGL -lMesaGLU"
                     fi
                 fi
-            ])
+            ],, [ ])
         ],
         [],
         [ ])
-- 
2.4.6