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
4 +AC_DEFUN([AM_PATH_GNOME],
6 +dnl Get the cflags and libraries from the gnome-config script
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="")
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
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
26 + AC_PATH_PROG(GNOME_CONFIG, gnome-config, no)
27 + min_gnome_version=ifelse([$1], , 1.1.0, $1)
29 + AC_MSG_CHECKING(for GNOME - version >= $min_gnome_version)
31 + if test "$GNOME_CONFIG" = "no" ; then
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`"
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/'`
52 + if test $gnome_config_major_version -lt $needed_major_version; then
53 + ifelse([$3], , :, [$3])
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])
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])
67 + AC_SUBST(GNOME_CFLAGS)
68 + AC_SUBST(GNOME_LIBS)
69 + AC_SUBST(GNOMEUI_CFLAGS)
70 + AC_SUBST(GNOMEUI_LIBS)
72 + if test "x$no_gnome" = x ; then
74 + ifelse([$2], , :, [$2])
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."
87 + ifelse([$3], , :, [$3])
90 + tmp_gnome_libdir=`$GNOME_CONFIG $gnome_config_args --libdir`
91 + if test -n "$4"; then
92 + AC_MSG_CHECKING([for additional GNOME modules])
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`"
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)
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)
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`\"
125 + AC_MSG_RESULT([*** $module library is not installed])
126 + ifelse([$3], , :, [$3])
127 + gnome_m4_notfound=yes
130 + if test "$gnome_m4_notfound" = no; then
131 + echo $ac_n " $module" 1>&6
134 + if test -n "$4"; then
139 +dnl ===========================================================================
141 +dnl NAUTILUS_VERSION_CANON(version)
144 +AC_DEFUN([NAUTILUS_VERSION_CANON], [`
146 + dnl Assumes that there are no more than 999 revisions at a level,
147 + dnl no more than three levels of revision.
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.
153 + dnl Must come up with some way to fix this.
157 + sed -e 's/^/000/' -e 's/^.*\(...\)/\1/' |
159 + sed 's/$/000000000/
160 + s/^\(.........\).*/\1/'
163 +dnl NAUTILUS_VERSION_INSIST(package, get-version-cmd, operator, want-version-var)
166 +AC_DEFUN([NAUTILUS_VERSION_INSIST], [
167 + ez_want_version=[$]$4
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) ;;
179 + AC_MSG_CHECKING(for $1 $3 [$ez_want_version])
181 + if ez_installed_version="`$2`"
183 + AC_MSG_RESULT([$ez_installed_version])
185 + AC_ERROR($2 failed)
188 + if test "NAUTILUS_VERSION_CANON([$ez_installed_version])" "$ez_operator" \
189 + "NAUTILUS_VERSION_CANON([$ez_want_version])"
194 + AC_ERROR($1 version [$ez_want_version] is required.)
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
201 +dnl Shamelessly cut-n-pasted from AM_PATH_LIBART
203 +AC_DEFUN([NAUTILUS_PATH_FREETYPE2],
205 +dnl Get the cflags and libraries from the freetype-config script
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)
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
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
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)
231 + if test "$FREETYPE2_CONFIG" = "no" ; then
234 + FREETYPE2_CFLAGS=`$FREETYPE2_CONFIG $freetype2conf_args --cflags`
235 + FREETYPE2_LIBS=`$FREETYPE2_CONFIG $freetype2conf_args --libs`
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/'`
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"
250 +dnl Now check if the installed FREETYPE2 is sufficiently new. (Also sanity
251 +dnl checks the results of freetype-config to some extent
253 + rm -f conf.freetype2test
258 +#include <freetype/freetype.h>
261 +my_strdup (char *str)
267 + new_str = malloc ((strlen (str) + 1) * sizeof(char));
268 + strcpy (new_str, str);
278 + int major, minor, micro;
281 + system ("touch conf.freetype2test");
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");
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)))
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");
312 +],, no_freetype2=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
313 + CFLAGS="$ac_save_CFLAGS"
314 + LIBS="$ac_save_LIBS"
317 + if test "x$no_freetype2" = x ; then
319 + ifelse([$2], , :, [$2])
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."
328 + if test -f conf.freetype2test ; then
331 + echo "*** Could not run FREETYPE2 test program, checking why..."
332 + CFLAGS="$CFLAGS $FREETYPE2_CFLAGS"
333 + LIBS="$LIBS $FREETYPE2_LIBS"
336 +#include <freetype/freetype.h>
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"
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"
355 + FREETYPE2_CFLAGS=""
357 + ifelse([$3], , :, [$3])
359 + AC_SUBST(FREETYPE2_CFLAGS)
360 + AC_SUBST(FREETYPE2_LIBS)
361 + rm -f conf.freetype2test