diff options
Diffstat (limited to '')
-rw-r--r-- | src/others/mimesh/g3dviewer-0.2.99.4/m4/gtkglext.m4 | 230 |
1 files changed, 230 insertions, 0 deletions
diff --git a/src/others/mimesh/g3dviewer-0.2.99.4/m4/gtkglext.m4 b/src/others/mimesh/g3dviewer-0.2.99.4/m4/gtkglext.m4 new file mode 100644 index 0000000..cfc49fd --- /dev/null +++ b/src/others/mimesh/g3dviewer-0.2.99.4/m4/gtkglext.m4 | |||
@@ -0,0 +1,230 @@ | |||
1 | # Configure paths for GtkGLExt | ||
2 | # Naofumi Yasufuku | ||
3 | # | ||
4 | # Shamelessly stolen from gtk-2.0.m4 | ||
5 | # Configure paths for GTK+ | ||
6 | # Owen Taylor 1997-2001 | ||
7 | |||
8 | dnl AM_PATH_GTKGLEXT_1_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) | ||
9 | dnl Test for GtkGLExt, and define GTKGLEXT_CFLAGS and GTKGLEXT_LIBS. | ||
10 | dnl | ||
11 | AC_DEFUN([AM_PATH_GTKGLEXT_1_0], | ||
12 | [ no_gtkglext="" | ||
13 | GTKGLEXT_CFLAGS="" | ||
14 | GTKGLEXT_LIBS="" | ||
15 | |||
16 | # GtkGLExt pkg-config module | ||
17 | gtkglext_module=gtkglext-1.0 | ||
18 | |||
19 | # minimum GtkGLExt version | ||
20 | gtkglext_min_version=ifelse([$1], ,1.0.0,$1) | ||
21 | |||
22 | # minimum pkg-config version | ||
23 | pkgconfig_min_version=0.7 | ||
24 | |||
25 | AC_ARG_ENABLE(gtkglext-test, | ||
26 | [ --disable-gtkglext-test do not try to compile and run a test GtkGLExt program], | ||
27 | , enable_gtkglext_test=yes) | ||
28 | |||
29 | dnl | ||
30 | dnl Get the cflags and libraries from pkg-config | ||
31 | dnl | ||
32 | pkg_config_modules=$gtkglext_module | ||
33 | |||
34 | AC_PATH_PROG(PKG_CONFIG, pkg-config, no) | ||
35 | |||
36 | if test x$PKG_CONFIG != xno ; then | ||
37 | if pkg-config --atleast-pkgconfig-version $pkgconfig_min_version ; then | ||
38 | : | ||
39 | else | ||
40 | echo "" | ||
41 | echo "*** pkg-config too old; version $pkgconfig_min_version or better required." | ||
42 | no_gtkglext=yes | ||
43 | PKG_CONFIG=no | ||
44 | fi | ||
45 | else | ||
46 | no_gtkglext=yes | ||
47 | fi | ||
48 | |||
49 | AC_MSG_CHECKING(for GtkGLExt - version >= $gtkglext_min_version) | ||
50 | |||
51 | if test x$PKG_CONFIG != xno ; then | ||
52 | ## don't try to run the test against uninstalled libtool libs | ||
53 | if $PKG_CONFIG --uninstalled $pkg_config_modules; then | ||
54 | echo "" | ||
55 | echo "Will use uninstalled version of GtkGLExt found in PKG_CONFIG_PATH" | ||
56 | enable_gtkglext_test=no | ||
57 | fi | ||
58 | |||
59 | if $PKG_CONFIG --atleast-version $gtkglext_min_version $pkg_config_modules; then | ||
60 | : | ||
61 | else | ||
62 | echo "" | ||
63 | echo "*** pkg-config cannot find $gtkglext_module >= $gtkglext_min_version" | ||
64 | echo "*** Set the environment variable PKG_CONFIG_PATH to point to the correct" | ||
65 | echo "*** configuration files." | ||
66 | no_gtkglext=yes | ||
67 | enable_gtkglext_test=no | ||
68 | fi | ||
69 | fi | ||
70 | |||
71 | if test x"$no_gtkglext" = x ; then | ||
72 | GTKGLEXT_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_modules` | ||
73 | GTKGLEXT_LIBS=`$PKG_CONFIG --libs $pkg_config_modules` | ||
74 | gtkglext_config_major_version=`$PKG_CONFIG --modversion $gtkglext_module | \ | ||
75 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` | ||
76 | gtkglext_config_minor_version=`$PKG_CONFIG --modversion $gtkglext_module | \ | ||
77 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` | ||
78 | gtkglext_config_micro_version=`$PKG_CONFIG --modversion $gtkglext_module | \ | ||
79 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` | ||
80 | if test "x$enable_gtkglext_test" = "xyes" ; then | ||
81 | ac_save_CFLAGS="$CFLAGS" | ||
82 | ac_save_LIBS="$LIBS" | ||
83 | CFLAGS="$CFLAGS $GTKGLEXT_CFLAGS" | ||
84 | LIBS="$GTKGLEXT_LIBS $LIBS" | ||
85 | dnl | ||
86 | dnl Now check if the installed GtkGLExt is sufficiently new. (Also sanity | ||
87 | dnl checks the results of pkg-config to some extent) | ||
88 | dnl | ||
89 | rm -f conf.gtkgltest | ||
90 | AC_TRY_RUN([ | ||
91 | #include <gtk/gtk.h> | ||
92 | #include <gtk/gtkgl.h> | ||
93 | #include <stdio.h> | ||
94 | #include <stdlib.h> | ||
95 | |||
96 | int | ||
97 | main () | ||
98 | { | ||
99 | int major, minor, micro; | ||
100 | char *tmp_version; | ||
101 | |||
102 | system ("touch conf.gtkgltest"); | ||
103 | |||
104 | /* HP/UX 9 (%@#!) writes to sscanf strings */ | ||
105 | tmp_version = g_strdup ("$gtkglext_min_version"); | ||
106 | if (sscanf (tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) | ||
107 | { | ||
108 | printf ("%s, bad version string\n", "$gtkglext_min_version"); | ||
109 | exit (1); | ||
110 | } | ||
111 | |||
112 | if ((gtkglext_major_version != $gtkglext_config_major_version) || | ||
113 | (gtkglext_minor_version != $gtkglext_config_minor_version) || | ||
114 | (gtkglext_micro_version != $gtkglext_config_micro_version)) | ||
115 | { | ||
116 | printf ("\n*** 'pkg-config --modversion $gtkglext_module' returned %d.%d.%d, but GtkGLExt\n", | ||
117 | $gtkglext_config_major_version, $gtkglext_config_minor_version, $gtkglext_config_micro_version); | ||
118 | printf ("*** library %d.%d.%d was found!\n", | ||
119 | gtkglext_major_version, gtkglext_minor_version, gtkglext_micro_version); | ||
120 | printf ("***\n"); | ||
121 | printf ("*** If pkg-config was correct, then it is best to remove the old version\n"); | ||
122 | printf ("*** of GtkGLExt. You may also be able to fix the error by modifying your\n"); | ||
123 | printf ("*** LD_LIBRARY_PATH enviroment variable, or by editing /etc/ld.so.conf.\n"); | ||
124 | printf ("*** Make sure you have run ldconfig if that is required on your system.\n"); | ||
125 | printf ("***\n"); | ||
126 | printf ("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n"); | ||
127 | printf ("*** to point to the correct configuration files.\n"); | ||
128 | } | ||
129 | else if ((gtkglext_major_version != GTKGLEXT_MAJOR_VERSION) || | ||
130 | (gtkglext_minor_version != GTKGLEXT_MINOR_VERSION) || | ||
131 | (gtkglext_micro_version != GTKGLEXT_MICRO_VERSION)) | ||
132 | { | ||
133 | printf ("\n*** GtkGLExt header files (version %d.%d.%d) do not match library (version %d.%d.%d).\n", | ||
134 | GTKGLEXT_MAJOR_VERSION, GTKGLEXT_MINOR_VERSION, GTKGLEXT_MICRO_VERSION, | ||
135 | gtkglext_major_version, gtkglext_minor_version, gtkglext_micro_version); | ||
136 | } | ||
137 | else | ||
138 | { | ||
139 | if ((gtkglext_major_version > major) || | ||
140 | ((gtkglext_major_version == major) && (gtkglext_minor_version > minor)) || | ||
141 | ((gtkglext_major_version == major) && (gtkglext_minor_version == minor) && (gtkglext_micro_version >= micro))) | ||
142 | { | ||
143 | return 0; | ||
144 | } | ||
145 | else | ||
146 | { | ||
147 | printf ("\n*** An old version of GtkGLExt library (%d.%d.%d) was found.\n", | ||
148 | gtkglext_major_version, gtkglext_minor_version, gtkglext_micro_version); | ||
149 | printf ("*** You need a version of GtkGLExt newer than %d.%d.%d. The latest version of\n", | ||
150 | major, minor, micro); | ||
151 | printf ("*** GtkGLExt is always available from http://gtkglext.sourceforge.net/.\n"); | ||
152 | printf ("***\n"); | ||
153 | printf ("*** If you have already installed a sufficiently new version, this error\n"); | ||
154 | printf ("*** probably means that the wrong copy of the pkg-config shell script is\n"); | ||
155 | printf ("*** being found. The easiest way to fix this is to remove the old version\n"); | ||
156 | printf ("*** of GtkGLExt, but you can also set the PKG_CONFIG environment to point\n"); | ||
157 | printf ("*** to the correct copy of pkg-config. (In this case, you will have to\n"); | ||
158 | printf ("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); | ||
159 | printf ("*** so that the correct libraries are found at run-time)\n"); | ||
160 | } | ||
161 | } | ||
162 | return 1; | ||
163 | } | ||
164 | ],, no_gtkglext=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) | ||
165 | CFLAGS="$ac_save_CFLAGS" | ||
166 | LIBS="$ac_save_LIBS" | ||
167 | fi | ||
168 | fi | ||
169 | if test "x$no_gtkglext" = x ; then | ||
170 | AC_MSG_RESULT(yes (version $gtkglext_config_major_version.$gtkglext_config_minor_version.$gtkglext_config_micro_version)) | ||
171 | ifelse([$2], , :, [$2]) | ||
172 | else | ||
173 | AC_MSG_RESULT(no) | ||
174 | if test "$PKG_CONFIG" = "no" ; then | ||
175 | echo "*** A new enough version of pkg-config was not found." | ||
176 | echo "*** See http://www.freedesktop.org/software/pkgconfig/." | ||
177 | elif test "x$enable_gtkglext_test" = "xyes" ; then | ||
178 | if test -f conf.gtkgltest ; then | ||
179 | : | ||
180 | else | ||
181 | echo "*** Could not run GtkGLExt test program, checking why..." | ||
182 | ac_save_CFLAGS="$CFLAGS" | ||
183 | ac_save_LIBS="$LIBS" | ||
184 | CFLAGS="$CFLAGS $GTKGLEXT_CFLAGS" | ||
185 | LIBS="$LIBS $GTKGLEXT_LIBS" | ||
186 | AC_TRY_LINK([ | ||
187 | #include <gtk/gtk.h> | ||
188 | #include <gtk/gtkgl.h> | ||
189 | #include <stdio.h> | ||
190 | ], [ return ((gtkglext_major_version) || (gtkglext_minor_version) || (gtkglext_micro_version)); ], | ||
191 | [ echo "*** The test program compiled, but did not run. This usually means" | ||
192 | echo "*** that the run-time linker is not finding GtkGLExt or finding the wrong" | ||
193 | echo "*** version of GtkGLExt. If it is not finding GtkGLExt, you'll need to set your" | ||
194 | echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" | ||
195 | echo "*** to the installed location Also, make sure you have run ldconfig if that" | ||
196 | echo "*** is required on your system" | ||
197 | echo "***" | ||
198 | echo "*** If you have an old version installed, it is best to remove it, although" | ||
199 | echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ], | ||
200 | [ echo "*** The test program failed to compile or link. See the file config.log for the" | ||
201 | echo "*** exact error that occured. This usually means GtkGLExt is incorrectly installed."]) | ||
202 | CFLAGS="$ac_save_CFLAGS" | ||
203 | LIBS="$ac_save_LIBS" | ||
204 | fi | ||
205 | fi | ||
206 | GTKGLEXT_CFLAGS="" | ||
207 | GTKGLEXT_LIBS="" | ||
208 | ifelse([$3], , :, [$3]) | ||
209 | fi | ||
210 | AC_SUBST(GTKGLEXT_CFLAGS) | ||
211 | AC_SUBST(GTKGLEXT_LIBS) | ||
212 | rm -f conf.gtkgltest | ||
213 | ]) | ||
214 | |||
215 | dnl AC_GTKGLEXT_SUPPORTS_MULTIHEAD([ACTION-IF-SUPPORTED [, ACTION-IF-NOT-SUPPORTED]]) | ||
216 | dnl Checks whether GtkGLExt supports multihead. | ||
217 | dnl | ||
218 | AC_DEFUN([AC_GTKGLEXT_SUPPORTS_MULTIHEAD], | ||
219 | [ AC_CACHE_CHECK([whether GtkGLExt supports multihead], | ||
220 | [ac_cv_gtkglext_supports_multihead], | ||
221 | [AC_TRY_LINK([#include <gdk/gdkglquery.h>], | ||
222 | [gdk_gl_query_extension_for_display(gdk_display_get_default());], | ||
223 | [ac_cv_gtkglext_supports_multihead=yes], | ||
224 | [ac_cv_gtkglext_supports_multihead=no])]) | ||
225 | if test "x$ac_cv_gtkglext_supports_multihead" = "xyes" ; then | ||
226 | ifelse([$1], , :, [$1]) | ||
227 | else | ||
228 | ifelse([$2], , :, [$2]) | ||
229 | fi | ||
230 | ]) | ||