]> git.draconx.ca Git - gob-dx.git/blob - aclocal.m4
Release 1.99.1
[gob-dx.git] / aclocal.m4
1 dnl aclocal.m4 generated automatically by aclocal 1.4-p4
2
3 dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
7
8 dnl This program is distributed in the hope that it will be useful,
9 dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10 dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11 dnl PARTICULAR PURPOSE.
12
13 # Like AC_CONFIG_HEADER, but automatically create stamp file.
14
15 AC_DEFUN(AM_CONFIG_HEADER,
16 [AC_PREREQ([2.12])
17 AC_CONFIG_HEADER([$1])
18 dnl When config.status generates a header, we must update the stamp-h file.
19 dnl This file resides in the same directory as the config header
20 dnl that is generated.  We must strip everything past the first ":",
21 dnl and everything past the last "/".
22 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
23 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
24 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
25 <<am_indx=1
26 for am_file in <<$1>>; do
27   case " <<$>>CONFIG_HEADERS " in
28   *" <<$>>am_file "*<<)>>
29     echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
30     ;;
31   esac
32   am_indx=`expr "<<$>>am_indx" + 1`
33 done<<>>dnl>>)
34 changequote([,]))])
35
36 # Do all the work for Automake.  This macro actually does too much --
37 # some checks are only needed if your package does certain things.
38 # But this isn't really a big deal.
39
40 # serial 1
41
42 dnl Usage:
43 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
44
45 AC_DEFUN(AM_INIT_AUTOMAKE,
46 [AC_REQUIRE([AC_PROG_INSTALL])
47 PACKAGE=[$1]
48 AC_SUBST(PACKAGE)
49 VERSION=[$2]
50 AC_SUBST(VERSION)
51 dnl test to see if srcdir already configured
52 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
53   AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
54 fi
55 ifelse([$3],,
56 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
57 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
58 AC_REQUIRE([AM_SANITY_CHECK])
59 AC_REQUIRE([AC_ARG_PROGRAM])
60 dnl FIXME This is truly gross.
61 missing_dir=`cd $ac_aux_dir && pwd`
62 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
63 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
64 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
65 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
66 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
67 AC_REQUIRE([AC_PROG_MAKE_SET])])
68
69 #
70 # Check to make sure that the build environment is sane.
71 #
72
73 AC_DEFUN(AM_SANITY_CHECK,
74 [AC_MSG_CHECKING([whether build environment is sane])
75 # Just in case
76 sleep 1
77 echo timestamp > conftestfile
78 # Do `set' in a subshell so we don't clobber the current shell's
79 # arguments.  Must try -L first in case configure is actually a
80 # symlink; some systems play weird games with the mod time of symlinks
81 # (eg FreeBSD returns the mod time of the symlink's containing
82 # directory).
83 if (
84    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
85    if test "[$]*" = "X"; then
86       # -L didn't work.
87       set X `ls -t $srcdir/configure conftestfile`
88    fi
89    if test "[$]*" != "X $srcdir/configure conftestfile" \
90       && test "[$]*" != "X conftestfile $srcdir/configure"; then
91
92       # If neither matched, then we have a broken ls.  This can happen
93       # if, for instance, CONFIG_SHELL is bash and it inherits a
94       # broken ls alias from the environment.  This has actually
95       # happened.  Such a system could not be considered "sane".
96       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
97 alias in your environment])
98    fi
99
100    test "[$]2" = conftestfile
101    )
102 then
103    # Ok.
104    :
105 else
106    AC_MSG_ERROR([newly created file is older than distributed files!
107 Check your system clock])
108 fi
109 rm -f conftest*
110 AC_MSG_RESULT(yes)])
111
112 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
113 dnl The program must properly implement --version.
114 AC_DEFUN(AM_MISSING_PROG,
115 [AC_MSG_CHECKING(for working $2)
116 # Run test in a subshell; some versions of sh will print an error if
117 # an executable is not found, even if stderr is redirected.
118 # Redirect stdin to placate older versions of autoconf.  Sigh.
119 if ($2 --version) < /dev/null > /dev/null 2>&1; then
120    $1=$2
121    AC_MSG_RESULT(found)
122 else
123    $1="$3/missing $2"
124    AC_MSG_RESULT(missing)
125 fi
126 AC_SUBST($1)])
127
128
129 dnl AM_PROG_LEX
130 dnl Look for flex, lex or missing, then run AC_PROG_LEX and AC_DECL_YYTEXT
131 AC_DEFUN(AM_PROG_LEX,
132 [missing_dir=ifelse([$1],,`cd $ac_aux_dir && pwd`,$1)
133 AC_CHECK_PROGS(LEX, flex lex, "$missing_dir/missing flex")
134 AC_PROG_LEX
135 AC_DECL_YYTEXT])
136
137 # Configure paths for GLIB
138 # Owen Taylor     1997-2001
139
140 dnl AM_PATH_GLIB_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
141 dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if gmodule, gobject or 
142 dnl gthread is specified in MODULES, pass to pkg-config
143 dnl
144 AC_DEFUN(AM_PATH_GLIB_2_0,
145 [dnl 
146 dnl Get the cflags and libraries from pkg-config
147 dnl
148 AC_ARG_ENABLE(glibtest, [  --disable-glibtest       Do not try to compile and run a test GLIB program],
149                     , enable_glibtest=yes)
150
151   pkg_config_args=glib-2.0
152   for module in . $4
153   do
154       case "$module" in
155          gmodule) 
156              pkg_config_args="$pkg_config_args gmodule-2.0"
157          ;;
158          gobject) 
159              pkg_config_args="$pkg_config_args gobject-2.0"
160          ;;
161          gthread) 
162              pkg_config_args="$pkg_config_args gthread-2.0"
163          ;;
164       esac
165   done
166
167   AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
168
169   no_glib=""
170
171   if test x$PKG_CONFIG != xno ; then
172     if $PKG_CONFIG --atleast-pkgconfig-version 0.7 ; then
173       :
174     else
175       echo *** pkg-config too old; version 0.7 or better required.
176       no_glib=yes
177       PKG_CONFIG=no
178     fi
179   fi
180
181   ## don't try to run the test against uninstalled libtool libs
182   if $PKG_CONFIG --uninstalled $pkg_config_args; then
183         echo "Will use uninstalled version of GLib found in PKG_CONFIG_PATH"
184         enable_glibtest=no
185   fi
186
187   min_glib_version=ifelse([$1], ,1.3.3,$1)
188   AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
189
190   if $PKG_CONFIG --atleast-version $min_glib_version $pkg_config_args; then
191         :
192   else
193         no_glib = yes
194   fi
195
196   if test x"$no_glib" = x ; then
197     GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
198     GOBJECT_QUERY=`$PKG_CONFIG --variable=gobject_query glib-2.0`
199     GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
200
201     GLIB_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args`
202     GLIB_LIBS=`$PKG_CONFIG --libs $pkg_config_args`
203     glib_config_major_version=`$PKG_CONFIG --modversion glib-2.0 | \
204            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
205     glib_config_minor_version=`$PKG_CONFIG --modversion glib-2.0 | \
206            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
207     glib_config_micro_version=`$PKG_CONFIG --modversion glib-2.0 | \
208            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
209     if test "x$enable_glibtest" = "xyes" ; then
210       ac_save_CFLAGS="$CFLAGS"
211       ac_save_LIBS="$LIBS"
212       CFLAGS="$CFLAGS $GLIB_CFLAGS"
213       LIBS="$GLIB_LIBS $LIBS"
214 dnl
215 dnl Now check if the installed GLIB is sufficiently new. (Also sanity
216 dnl checks the results of pkg-config to some extent)
217 dnl
218       rm -f conf.glibtest
219       AC_TRY_RUN([
220 #include <glib.h>
221 #include <stdio.h>
222 #include <stdlib.h>
223
224 int 
225 main ()
226 {
227   int major, minor, micro;
228   char *tmp_version;
229
230   system ("touch conf.glibtest");
231
232   /* HP/UX 9 (%@#!) writes to sscanf strings */
233   tmp_version = g_strdup("$min_glib_version");
234   if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
235      printf("%s, bad version string\n", "$min_glib_version");
236      exit(1);
237    }
238
239   if ((glib_major_version != $glib_config_major_version) ||
240       (glib_minor_version != $glib_config_minor_version) ||
241       (glib_micro_version != $glib_config_micro_version))
242     {
243       printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n", 
244              $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
245              glib_major_version, glib_minor_version, glib_micro_version);
246       printf ("*** was found! If pkg-config was correct, then it is best\n");
247       printf ("*** to remove the old version of GLib. You may also be able to fix the error\n");
248       printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
249       printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
250       printf("*** required on your system.\n");
251       printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
252       printf("*** to point to the correct configuration files\n");
253     } 
254   else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
255            (glib_minor_version != GLIB_MINOR_VERSION) ||
256            (glib_micro_version != GLIB_MICRO_VERSION))
257     {
258       printf("*** GLIB header files (version %d.%d.%d) do not match\n",
259              GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
260       printf("*** library (version %d.%d.%d)\n",
261              glib_major_version, glib_minor_version, glib_micro_version);
262     }
263   else
264     {
265       if ((glib_major_version > major) ||
266         ((glib_major_version == major) && (glib_minor_version > minor)) ||
267         ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
268       {
269         return 0;
270        }
271      else
272       {
273         printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n",
274                glib_major_version, glib_minor_version, glib_micro_version);
275         printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n",
276                major, minor, micro);
277         printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
278         printf("***\n");
279         printf("*** If you have already installed a sufficiently new version, this error\n");
280         printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
281         printf("*** being found. The easiest way to fix this is to remove the old version\n");
282         printf("*** of GLIB, but you can also set the PKG_CONFIG environment to point to the\n");
283         printf("*** correct copy of pkg-config. (In this case, you will have to\n");
284         printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
285         printf("*** so that the correct libraries are found at run-time))\n");
286       }
287     }
288   return 1;
289 }
290 ],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
291        CFLAGS="$ac_save_CFLAGS"
292        LIBS="$ac_save_LIBS"
293      fi
294   fi
295   if test "x$no_glib" = x ; then
296      AC_MSG_RESULT(yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version))
297      ifelse([$2], , :, [$2])     
298   else
299      AC_MSG_RESULT(no)
300      if test "$PKG_CONFIG" = "no" ; then
301        echo "*** A new enough version of pkg-config was not found."
302        echo "*** See http://www.freedesktop.org/software/pkgconfig/"
303      else
304        if test -f conf.glibtest ; then
305         :
306        else
307           echo "*** Could not run GLIB test program, checking why..."
308           CFLAGS="$CFLAGS $GLIB_CFLAGS"
309           LIBS="$LIBS $GLIB_LIBS"
310           AC_TRY_LINK([
311 #include <glib.h>
312 #include <stdio.h>
313 ],      [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ],
314         [ echo "*** The test program compiled, but did not run. This usually means"
315           echo "*** that the run-time linker is not finding GLIB or finding the wrong"
316           echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
317           echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
318           echo "*** to the installed location  Also, make sure you have run ldconfig if that"
319           echo "*** is required on your system"
320           echo "***"
321           echo "*** If you have an old version installed, it is best to remove it, although"
322           echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
323         [ echo "*** The test program failed to compile or link. See the file config.log for the"
324           echo "*** exact error that occured. This usually means GLIB was incorrectly installed"
325           echo "*** or that you have moved GLIB since it was installed. In the latter case, you"
326           echo "*** may want to edit the pkg-config script: $PKG_CONFIG" ])
327           CFLAGS="$ac_save_CFLAGS"
328           LIBS="$ac_save_LIBS"
329        fi
330      fi
331      GLIB_CFLAGS=""
332      GLIB_LIBS=""
333      GLIB_GENMARSHAL=""
334      GOBJECT_QUERY=""
335      GLIB_MKENUMS=""
336      ifelse([$3], , :, [$3])
337   fi
338   AC_SUBST(GLIB_CFLAGS)
339   AC_SUBST(GLIB_LIBS)
340   AC_SUBST(GLIB_GENMARSHAL)
341   AC_SUBST(GOBJECT_QUERY)
342   AC_SUBST(GLIB_MKENUMS)
343   rm -f conf.glibtest
344 ])
345
346 # Add --enable-maintainer-mode option to configure.
347 # From Jim Meyering
348
349 # serial 1
350
351 AC_DEFUN(AM_MAINTAINER_MODE,
352 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
353   dnl maintainer-mode is disabled by default
354   AC_ARG_ENABLE(maintainer-mode,
355 [  --enable-maintainer-mode enable make rules and dependencies not useful
356                           (and sometimes confusing) to the casual installer],
357       USE_MAINTAINER_MODE=$enableval,
358       USE_MAINTAINER_MODE=no)
359   AC_MSG_RESULT($USE_MAINTAINER_MODE)
360   AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
361   MAINT=$MAINTAINER_MODE_TRUE
362   AC_SUBST(MAINT)dnl
363 ]
364 )
365
366 # Define a conditional.
367
368 AC_DEFUN(AM_CONDITIONAL,
369 [AC_SUBST($1_TRUE)
370 AC_SUBST($1_FALSE)
371 if $2; then
372   $1_TRUE=
373   $1_FALSE='#'
374 else
375   $1_TRUE='#'
376   $1_FALSE=
377 fi])
378