]>
Commit | Line | Data |
---|---|---|
6eaa7fd5 JB |
1 | --- nautils-1.0.6.orig/acinclude.m4 Thu Jan 1 01:00:00 1970 |
2 | +++ nautilus-1.0.6/acinclude.m4 Tue Nov 13 11:22:16 2001 | |
3 | @@ -0,0 +1,390 @@ | |
4 | +AC_DEFUN(AM_PATH_GNOME, | |
5 | +[dnl | |
6 | +dnl Get the cflags and libraries from the gnome-config script | |
7 | +dnl | |
8 | +AC_ARG_WITH(gnome-prefix,[ --with-gnome-prefix=PFX Prefix where GNOME is installed (optional)], | |
9 | + gnome_config_prefix="$withval", gnome_config_prefix="") | |
10 | +AC_ARG_WITH(gnome-exec-prefix,[ --with-gnome-exec-prefix=PFX Exec prefix where GNOME is installed (optional)], | |
11 | + gnome_config_exec_prefix="$withval", gnome_config_exec_prefix="") | |
12 | + | |
13 | + if test x$gnome_config_exec_prefix != x ; then | |
14 | + gnome_config_args="$gnome_config_args --exec-prefix=$gnome_config_exec_prefix" | |
15 | + if test x${GNOME_CONFIG+set} != xset ; then | |
16 | + GNOME_CONFIG=$gnome_config_exec_prefix/bin/gnome-config | |
17 | + fi | |
18 | + fi | |
19 | + if test x$gnome_config_prefix != x ; then | |
20 | + gnome_config_args="$gnome_config_args --prefix=$gnome_config_prefix" | |
21 | + if test x${GNOME_CONFIG+set} != xset ; then | |
22 | + GNOME_CONFIG=$gnome_config_prefix/bin/gnome-config | |
23 | + fi | |
24 | + fi | |
25 | + | |
26 | + AC_PATH_PROG(GNOME_CONFIG, gnome-config, no) | |
27 | + min_gnome_version=ifelse([$1], , 1.1.0, $1) | |
28 | + | |
29 | + AC_MSG_CHECKING(for GNOME - version >= $min_gnome_version) | |
30 | + no_gnome="" | |
31 | + if test "$GNOME_CONFIG" = "no" ; then | |
32 | + no_gnome=yes | |
33 | + else | |
34 | + GNOME_CFLAGS="`$GNOME_CONFIG $gnome_config_args --cflags gnome`" | |
35 | + GNOME_LIBS="`$GNOME_CONFIG $gnome_config_args --libs gnome`" | |
36 | + GNOMEUI_CFLAGS="`$GNOME_CONFIG $gnome_config_args --cflags gnomeui`" | |
37 | + GNOMEUI_LIBS="`$GNOME_CONFIG $gnome_config_args --libs gnomeui`" | |
38 | + | |
39 | + gnome_config_major_version=`$GNOME_CONFIG $gnome_config_args --version | \ | |
40 | + sed 's/[[^0-9]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'` | |
41 | + gnome_config_minor_version=`$GNOME_CONFIG $gnome_config_args --version | \ | |
42 | + sed 's/[[^0-9]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'` | |
43 | + gnome_config_micro_version=`$GNOME_CONFIG $gnome_config_args --version | \ | |
44 | + sed 's/[[^0-9]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'` | |
45 | + needed_major_version=`echo $min_gnome_version | \ | |
46 | + sed 's/[[^0-9]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'` | |
47 | + needed_minor_version=`echo $min_gnome_version | \ | |
48 | + sed 's/[[^0-9]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'` | |
49 | + needed_micro_version=`echo $min_gnome_version | \ | |
50 | + sed 's/[[^0-9]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'` | |
51 | + | |
52 | + if test $gnome_config_major_version -lt $needed_major_version; then | |
53 | + ifelse([$3], , :, [$3]) | |
54 | + no_gnome=yes | |
55 | + elif test $gnome_config_major_version = $needed_major_version; then | |
56 | + if test -n "$needed_minor_version" -a $gnome_config_minor_version -lt $needed_minor_version; then | |
57 | + ifelse([$3], , :, [$3]) | |
58 | + no_gnome=yes | |
59 | + elif test -n "$needed_minor_version" -a $gnome_config_minor_version = $needed_minor_version; then | |
60 | + if test -n "$needed_micro_version" -a $gnome_config_micro_version -lt $needed_micro_version; then | |
61 | + ifelse([$3], , :, [$3]) | |
62 | + no_gnome=yes | |
63 | + fi | |
64 | + fi | |
65 | + fi | |
66 | + fi | |
67 | + AC_SUBST(GNOME_CFLAGS) | |
68 | + AC_SUBST(GNOME_LIBS) | |
69 | + AC_SUBST(GNOMEUI_CFLAGS) | |
70 | + AC_SUBST(GNOMEUI_LIBS) | |
71 | + | |
72 | + if test "x$no_gnome" = x ; then | |
73 | + AC_MSG_RESULT(yes) | |
74 | + ifelse([$2], , :, [$2]) | |
75 | + else | |
76 | + AC_MSG_RESULT(no) | |
77 | + if test "$GNOME_CONFIG" = "no" ; then | |
78 | + echo "*** The gnome-config script installed by GNOME could not be found" | |
79 | + echo "*** If GNOME was installed in PREFIX, make sure PREFIX/bin is in" | |
80 | + echo "*** your path, or set the GNOME_CONFIG environment variable to the" | |
81 | + echo "*** full path to gnome-config." | |
82 | + else | |
83 | + : | |
84 | + fi | |
85 | + GNOME_CFLAGS="" | |
86 | + GNOME_LIBS="" | |
87 | + ifelse([$3], , :, [$3]) | |
88 | + fi | |
89 | + | |
90 | + tmp_gnome_libdir=`$GNOME_CONFIG $gnome_config_args --libdir` | |
91 | + if test -n "$4"; then | |
92 | + AC_MSG_CHECKING([for additional GNOME modules]) | |
93 | + fi | |
94 | + for module in $4 ""; do | |
95 | + gnome_m4_notfound=no | |
96 | + if test "$module" = zvt; then | |
97 | + ZVT_LIBS="`$GNOME_CONFIG $gnome_config_args --libs zvt`" | |
98 | + AC_SUBST(ZVT_LIBS) | |
99 | + elif test "$module" = gtk; then | |
100 | + GTK_CFLAGS="`$GNOME_CONFIG $gnome_config_args --cflags gtk`" | |
101 | + GTK_LIBS="`$GNOME_CONFIG $gnome_config_args --libs gtk`" | |
102 | + AC_SUBST(GTK_CFLAGS) | |
103 | + AC_SUBST(GTK_LIBS) | |
104 | + elif test "$module" = "glib"; then | |
105 | + GLIB_CFLAGS="`$GNOME_CONFIG $gnome_config_args --cflags glib`" | |
106 | + GLIB_LIBS="`$GNOME_CONFIG $gnome_config_args --libs glib`" | |
107 | + AC_SUBST(GLIB_CFLAGS) | |
108 | + AC_SUBST(GLIB_LIBS) | |
109 | + elif test "$module" = "oaf"; then | |
110 | + OAF_CFLAGS="`$GNOME_CONFIG $gnome_config_args --cflags oaf`" | |
111 | + OAF_LIBS="`$GNOME_CONFIG $gnome_config_args --libs oaf`" | |
112 | + AC_SUBST(OAF_CFLAGS) | |
113 | + AC_SUBST(OAF_LIBS) | |
114 | + elif test "$module" = "gnorba"; then | |
115 | + GNORBA_CFLAGS="`$GNOME_CONFIG $gnome_config_args --cflags gnorba`" | |
116 | + GNORBA_LIBS="`$GNOME_CONFIG $gnome_config_args --libs gnorba`" | |
117 | + AC_SUBST(GNORBA_CFLAGS) | |
118 | + AC_SUBST(GNORBA_LIBS) | |
119 | + elif test -n "$module"; then | |
120 | + if $GNOME_CONFIG $gnome_config_args --cflags $module >/dev/null 2>&1; then | |
121 | + tmp_bsnom=`echo $module | tr a-z A-Z` | |
122 | + eval $tmp_bsnom'_CFLAGS'=\"`$GNOME_CONFIG $gnome_config_args --cflags $module`\" | |
123 | + eval $tmp_bsnom'_LIBS'=\"`$GNOME_CONFIG $gnome_config_args --libs $module`\" | |
124 | + else | |
125 | + AC_MSG_RESULT([*** $module library is not installed]) | |
126 | + ifelse([$3], , :, [$3]) | |
127 | + gnome_m4_notfound=yes | |
128 | + fi | |
129 | + fi | |
130 | + if test "$gnome_m4_notfound" = no; then | |
131 | + echo $ac_n " $module" 1>&6 | |
132 | + fi | |
133 | + done | |
134 | + if test -n "$4"; then | |
135 | + AC_MSG_RESULT([]) | |
136 | + fi | |
137 | +]) | |
138 | + | |
139 | +dnl =========================================================================== | |
140 | + | |
141 | +dnl NAUTILUS_VERSION_CANON(version) | |
142 | +dnl 1 | |
143 | + | |
144 | +AC_DEFUN(NAUTILUS_VERSION_CANON, [` | |
145 | + | |
146 | + dnl Assumes that there are no more than 999 revisions at a level, | |
147 | + dnl no more than three levels of revision. | |
148 | + dnl | |
149 | + dnl Any more than that, and test starts messing up the numeric | |
150 | + dnl comparisons because its integers overflow, and there's no | |
151 | + dnl way to do string comparisons in the shell. Grr. | |
152 | + dnl | |
153 | + dnl Must come up with some way to fix this. | |
154 | + | |
155 | + echo "$1" | | |
156 | + tr . '\012' | | |
157 | + sed -e 's/^/000/' -e 's/^.*\(...\)/\1/' | | |
158 | + tr -d '\012' | | |
159 | + sed 's/$/000000000/ | |
160 | + s/^\(.........\).*/\1/' | |
161 | +`]) | |
162 | + | |
163 | +dnl NAUTILUS_VERSION_INSIST(package, get-version-cmd, operator, want-version-var) | |
164 | +dnl 1 2 3 4 | |
165 | + | |
166 | +AC_DEFUN(NAUTILUS_VERSION_INSIST, [ | |
167 | + ez_want_version=[$]$4 | |
168 | + | |
169 | + case "$3" in | |
170 | + ">") ez_operator=-gt ;; | |
171 | + ">=") ez_operator=-ge ;; | |
172 | + "<") ez_operator=-lt ;; | |
173 | + "<=") ez_operator=-le ;; | |
174 | + "=") ez_operator=-eq ;; | |
175 | + "!=") ez_operator=-ne ;; | |
176 | + *) AC_ERROR(Unknown operator $3 in configure script) ;; | |
177 | + esac | |
178 | + | |
179 | + AC_MSG_CHECKING(for $1 $3 [$ez_want_version]) | |
180 | + | |
181 | + if ez_installed_version="`$2`" | |
182 | + then | |
183 | + AC_MSG_RESULT([$ez_installed_version]) | |
184 | + else | |
185 | + AC_ERROR($2 failed) | |
186 | + fi | |
187 | + | |
188 | + if test "NAUTILUS_VERSION_CANON([$ez_installed_version])" "$ez_operator" \ | |
189 | + "NAUTILUS_VERSION_CANON([$ez_want_version])" | |
190 | + then | |
191 | + : | |
192 | + AC_SUBST($4) | |
193 | + else | |
194 | + AC_ERROR($1 version [$ez_want_version] is required.) | |
195 | + fi | |
196 | +]) | |
197 | + | |
198 | +dnl NAUTILUS_PATH_FREETYPE2([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) | |
199 | +dnl Test for FreeType2, and define FREETYPE2_CFLAGS and FREETYPE2_LIBS | |
200 | +dnl | |
201 | +dnl Shamelessly cut-n-pasted from AM_PATH_LIBART | |
202 | +dnl | |
203 | +AC_DEFUN(NAUTILUS_PATH_FREETYPE2, | |
204 | +[dnl | |
205 | +dnl Get the cflags and libraries from the freetype-config script | |
206 | +dnl | |
207 | +AC_ARG_WITH(freetype2-prefix,[ --with-freetype2-prefix=PFX Prefix where FREETYPE2 is installed (optional)], | |
208 | + freetype2_prefix="$withval", freetype2_prefix="") | |
209 | +AC_ARG_WITH(freetype2-exec-prefix,[ --with-freetype2-exec-prefix=PFX Exec prefix where FREETYPE2 is installed (optional)], | |
210 | + freetype2_exec_prefix="$withval", freetype2_exec_prefix="") | |
211 | +AC_ARG_ENABLE(freetype2test, [ --disable-freetype2test Do not try to compile and run a test FREETYPE2 program], | |
212 | + , enable_freetype2test=yes) | |
213 | + | |
214 | + if test x$freetype2_exec_prefix != x ; then | |
215 | + freetype2_args="$freetype2_args --exec-prefix=$freetype2_exec_prefix" | |
216 | + if test x${FREETYPE2_CONFIG+set} != xset ; then | |
217 | + FREETYPE2_CONFIG=$freetype2_exec_prefix/bin/freetype-config | |
218 | + fi | |
219 | + fi | |
220 | + if test x$freetype2_prefix != x ; then | |
221 | + freetype2_args="$freetype2_args --prefix=$freetype2_prefix" | |
222 | + if test x${FREETYPE2_CONFIG+set} != xset ; then | |
223 | + FREETYPE2_CONFIG=$freetype2_prefix/bin/freetype-config | |
224 | + fi | |
225 | + fi | |
226 | + | |
227 | + AC_PATH_PROG(FREETYPE2_CONFIG, freetype-config, no) | |
228 | + min_freetype2_version=ifelse([$1], ,0.2.5,$1) | |
229 | + AC_MSG_CHECKING(for FREETYPE2 - version >= $min_freetype2_version) | |
230 | + no_freetype2="" | |
231 | + if test "$FREETYPE2_CONFIG" = "no" ; then | |
232 | + no_freetype2=yes | |
233 | + else | |
234 | + FREETYPE2_CFLAGS=`$FREETYPE2_CONFIG $freetype2conf_args --cflags` | |
235 | + FREETYPE2_LIBS=`$FREETYPE2_CONFIG $freetype2conf_args --libs` | |
236 | + | |
237 | + freetype2_major_version=`$FREETYPE2_CONFIG $freetype2_args --version | \ | |
238 | + sed 's/\([[0-9]]*\)[[:.]]\([[0-9]]*\)[[:.]]\([[0-9]]*\)/\1/'` | |
239 | + freetype2_minor_version=`$FREETYPE2_CONFIG $freetype2_args --version | \ | |
240 | + sed 's/\([[0-9]]*\)[[:.]]\([[0-9]]*\)[[:.]]\([[0-9]]*\)/\2/'` | |
241 | + freetype2_micro_version=`$FREETYPE2_CONFIG $freetype2_args --version | \ | |
242 | + sed 's/\([[0-9]]*\)[[:.]]\([[0-9]]*\)[[:.]]\([[0-9]]*\)/\3/'` | |
243 | + | |
244 | + if test "x$enable_freetype2test" = "xyes" ; then | |
245 | + ac_save_CFLAGS="$CFLAGS" | |
246 | + ac_save_LIBS="$LIBS" | |
247 | + CFLAGS="$CFLAGS $FREETYPE2_CFLAGS" | |
248 | + LIBS="$LIBS $FREETYPE2_LIBS" | |
249 | +dnl | |
250 | +dnl Now check if the installed FREETYPE2 is sufficiently new. (Also sanity | |
251 | +dnl checks the results of freetype-config to some extent | |
252 | +dnl | |
253 | + rm -f conf.freetype2test | |
254 | + AC_TRY_RUN([ | |
255 | +#include <stdio.h> | |
256 | +#include <stdlib.h> | |
257 | +#include <string.h> | |
258 | +#include <freetype/freetype.h> | |
259 | + | |
260 | +char* | |
261 | +my_strdup (char *str) | |
262 | +{ | |
263 | + char *new_str; | |
264 | + | |
265 | + if (str) | |
266 | + { | |
267 | + new_str = malloc ((strlen (str) + 1) * sizeof(char)); | |
268 | + strcpy (new_str, str); | |
269 | + } | |
270 | + else | |
271 | + new_str = NULL; | |
272 | + | |
273 | + return new_str; | |
274 | +} | |
275 | + | |
276 | +int main () | |
277 | +{ | |
278 | + int major, minor, micro; | |
279 | + char *tmp_version; | |
280 | + | |
281 | + system ("touch conf.freetype2test"); | |
282 | + | |
283 | + /* HP/UX 9 (%@#!) writes to sscanf strings */ | |
284 | + tmp_version = my_strdup("$min_freetype2_version"); | |
285 | + if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { | |
286 | + printf("%s, bad version string\n", "$min_freetype2_version"); | |
287 | + exit(1); | |
288 | + } | |
289 | + | |
290 | + if (($freetype2_major_version > major) || | |
291 | + (($freetype2_major_version == major) && ($freetype2_minor_version > minor)) || | |
292 | + (($freetype2_major_version == major) && ($freetype2_minor_version == minor) && ($freetype2_micro_version >= micro))) | |
293 | + { | |
294 | + return 0; | |
295 | + } | |
296 | + else | |
297 | + { | |
298 | + printf("\n"); | |
299 | + printf("*** \n"); | |
300 | + printf("*** 'freetype-config --version' returned %d.%d.%d, but the minimum version\n", $freetype2_major_version, $freetype2_minor_version, $freetype2_micro_version); | |
301 | + printf("*** of FREETYPE2 required is %d.%d.%d. If freetype-config is correct, then it is\n", major, minor, micro); | |
302 | + printf("*** best to upgrade to the required version.\n"); | |
303 | + printf("*** If freetype-config was wrong, set the environment variable FREETYPE2_CONFIG\n"); | |
304 | + printf("*** to point to the correct copy of freetype-config, and remove the file\n"); | |
305 | + printf("*** config.cache before re-running configure\n"); | |
306 | + printf("*** \n"); | |
307 | + | |
308 | + return 1; | |
309 | + } | |
310 | +} | |
311 | + | |
312 | +],, no_freetype2=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) | |
313 | + CFLAGS="$ac_save_CFLAGS" | |
314 | + LIBS="$ac_save_LIBS" | |
315 | + fi | |
316 | + fi | |
317 | + if test "x$no_freetype2" = x ; then | |
318 | + AC_MSG_RESULT(yes) | |
319 | + ifelse([$2], , :, [$2]) | |
320 | + else | |
321 | + AC_MSG_RESULT(no) | |
322 | + if test "$FREETYPE2_CONFIG" = "no" ; then | |
323 | + echo "*** The freetype-config script installed by FREETYPE2 could not be found" | |
324 | + echo "*** If FREETYPE2 was installed in PREFIX, make sure PREFIX/bin is in" | |
325 | + echo "*** your path, or set the FREETYPE2_CONFIG environment variable to the" | |
326 | + echo "*** full path to freetype-config." | |
327 | + else | |
328 | + if test -f conf.freetype2test ; then | |
329 | + : | |
330 | + else | |
331 | + echo "*** Could not run FREETYPE2 test program, checking why..." | |
332 | + CFLAGS="$CFLAGS $FREETYPE2_CFLAGS" | |
333 | + LIBS="$LIBS $FREETYPE2_LIBS" | |
334 | + AC_TRY_LINK([ | |
335 | +#include <stdio.h> | |
336 | +#include <freetype/freetype.h> | |
337 | +], [ return 0; ], | |
338 | + [ echo "*** The test program compiled, but did not run. This usually means" | |
339 | + echo "*** that the run-time linker is not finding FREETYPE2 or finding the wrong" | |
340 | + echo "*** version of FREETYPE2. If it is not finding FREETYPE2, you'll need to set your" | |
341 | + echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" | |
342 | + echo "*** to the installed location Also, make sure you have run ldconfig if that" | |
343 | + echo "*** is required on your system" | |
344 | + echo "***" | |
345 | + echo "*** If you have an old version installed, it is best to remove it, although" | |
346 | + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"], | |
347 | + [ echo "*** The test program failed to compile or link. See the file config.log for the" | |
348 | + echo "*** exact error that occured. This usually means FREETYPE2 was incorrectly installed" | |
349 | + echo "*** or that you have moved FREETYPE2 since it was installed. In the latter case, you" | |
350 | + echo "*** may want to edit the freetype-config script: $FREETYPE2_CONFIG" ]) | |
351 | + CFLAGS="$ac_save_CFLAGS" | |
352 | + LIBS="$ac_save_LIBS" | |
353 | + fi | |
354 | + fi | |
355 | + FREETYPE2_CFLAGS="" | |
356 | + FREETYPE2_LIBS="" | |
357 | + ifelse([$3], , :, [$3]) | |
358 | + fi | |
359 | + AC_SUBST(FREETYPE2_CFLAGS) | |
360 | + AC_SUBST(FREETYPE2_LIBS) | |
361 | + rm -f conf.freetype2test | |
362 | +]) | |
363 | + | |
364 | +dnl AM_GCONF_SOURCE | |
365 | +dnl Define GCONF_SCHEMA_CONFIG_SOURCE | |
366 | +dnl | |
367 | +AC_DEFUN(AM_GCONF_SOURCE, | |
368 | +[ | |
369 | + if test "x$GCONF_SCHEMA_INSTALL_SOURCE" = "x"; then | |
370 | + GCONF_SCHEMA_CONFIG_SOURCE=`gconftool --get-default-source` | |
371 | + else | |
372 | + GCONF_SCHEMA_CONFIG_SOURCE=$GCONF_SCHEMA_INSTALL_SOURCE | |
373 | + fi | |
374 | + | |
375 | + AC_ARG_WITH(gconf-source, | |
376 | + [ --with-gconf-source=sourceaddress Config database for installing schema files.],GCONF_SCHEMA_CONFIG_SOURCE="$withval",) | |
377 | + | |
378 | + AC_SUBST(GCONF_SCHEMA_CONFIG_SOURCE) | |
379 | + AC_MSG_RESULT("Using config source $GCONF_SCHEMA_CONFIG_SOURCE for schema installation") | |
380 | + | |
381 | + if test "x$GCONF_SCHEMA_FILE_DIR" = "x"; then | |
382 | + GCONF_SCHEMA_FILE_DIR=$sysconfdir/gconf/schemas/ | |
383 | + else | |
384 | + GCONF_SCHEMA_FILE_DIR=$GCONF_SCHEMA_FILE_DIR | |
385 | + fi | |
386 | + | |
387 | + AC_ARG_WITH(gconf-schema-file-dir, | |
388 | + [ --with-gconf-schema-file-dir=dir Directory for installing schema files.],GCONF_SCHEMA_FILE_DIR="$withval",) | |
389 | + | |
390 | + AC_SUBST(GCONF_SCHEMA_FILE_DIR) | |
391 | + AC_MSG_RESULT("Using $GCONF_SCHEMA_FILE_DIR as install directory for schema files") | |
392 | +]) | |
393 | + |