]> git.sur5r.net Git - glabels/blob - glabels1/aclocal.m4
2009-09-08 Jim Evins <evins@snaught.com>
[glabels] / glabels1 / aclocal.m4
1 dnl aclocal.m4 generated automatically by aclocal 1.4-p5
2
3 dnl Copyright (C) 1994, 1995-8, 1999, 2001 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 # Do all the work for Automake.  This macro actually does too much --
14 # some checks are only needed if your package does certain things.
15 # But this isn't really a big deal.
16
17 # serial 1
18
19 dnl Usage:
20 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
21
22 AC_DEFUN([AM_INIT_AUTOMAKE],
23 [AC_REQUIRE([AC_PROG_INSTALL])
24 PACKAGE=[$1]
25 AC_SUBST(PACKAGE)
26 VERSION=[$2]
27 AC_SUBST(VERSION)
28 dnl test to see if srcdir already configured
29 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
30   AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
31 fi
32 ifelse([$3],,
33 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
34 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
35 AC_REQUIRE([AM_SANITY_CHECK])
36 AC_REQUIRE([AC_ARG_PROGRAM])
37 dnl FIXME This is truly gross.
38 missing_dir=`cd $ac_aux_dir && pwd`
39 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
40 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
41 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
42 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
43 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
44 AC_REQUIRE([AC_PROG_MAKE_SET])])
45
46 #
47 # Check to make sure that the build environment is sane.
48 #
49
50 AC_DEFUN([AM_SANITY_CHECK],
51 [AC_MSG_CHECKING([whether build environment is sane])
52 # Just in case
53 sleep 1
54 echo timestamp > conftestfile
55 # Do `set' in a subshell so we don't clobber the current shell's
56 # arguments.  Must try -L first in case configure is actually a
57 # symlink; some systems play weird games with the mod time of symlinks
58 # (eg FreeBSD returns the mod time of the symlink's containing
59 # directory).
60 if (
61    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
62    if test "[$]*" = "X"; then
63       # -L didn't work.
64       set X `ls -t $srcdir/configure conftestfile`
65    fi
66    if test "[$]*" != "X $srcdir/configure conftestfile" \
67       && test "[$]*" != "X conftestfile $srcdir/configure"; then
68
69       # If neither matched, then we have a broken ls.  This can happen
70       # if, for instance, CONFIG_SHELL is bash and it inherits a
71       # broken ls alias from the environment.  This has actually
72       # happened.  Such a system could not be considered "sane".
73       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
74 alias in your environment])
75    fi
76
77    test "[$]2" = conftestfile
78    )
79 then
80    # Ok.
81    :
82 else
83    AC_MSG_ERROR([newly created file is older than distributed files!
84 Check your system clock])
85 fi
86 rm -f conftest*
87 AC_MSG_RESULT(yes)])
88
89 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
90 dnl The program must properly implement --version.
91 AC_DEFUN([AM_MISSING_PROG],
92 [AC_MSG_CHECKING(for working $2)
93 # Run test in a subshell; some versions of sh will print an error if
94 # an executable is not found, even if stderr is redirected.
95 # Redirect stdin to placate older versions of autoconf.  Sigh.
96 if ($2 --version) < /dev/null > /dev/null 2>&1; then
97    $1=$2
98    AC_MSG_RESULT(found)
99 else
100    $1="$3/missing $2"
101    AC_MSG_RESULT(missing)
102 fi
103 AC_SUBST($1)])
104
105 # Like AC_CONFIG_HEADER, but automatically create stamp file.
106
107 AC_DEFUN([AM_CONFIG_HEADER],
108 [AC_PREREQ([2.12])
109 AC_CONFIG_HEADER([$1])
110 dnl When config.status generates a header, we must update the stamp-h file.
111 dnl This file resides in the same directory as the config header
112 dnl that is generated.  We must strip everything past the first ":",
113 dnl and everything past the last "/".
114 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
115 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
116 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
117 <<am_indx=1
118 for am_file in <<$1>>; do
119   case " <<$>>CONFIG_HEADERS " in
120   *" <<$>>am_file "*<<)>>
121     echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
122     ;;
123   esac
124   am_indx=`expr "<<$>>am_indx" + 1`
125 done<<>>dnl>>)
126 changequote([,]))])
127
128 # Add --enable-maintainer-mode option to configure.
129 # From Jim Meyering
130
131 # serial 1
132
133 AC_DEFUN([AM_MAINTAINER_MODE],
134 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
135   dnl maintainer-mode is disabled by default
136   AC_ARG_ENABLE(maintainer-mode,
137 [  --enable-maintainer-mode enable make rules and dependencies not useful
138                           (and sometimes confusing) to the casual installer],
139       USE_MAINTAINER_MODE=$enableval,
140       USE_MAINTAINER_MODE=no)
141   AC_MSG_RESULT($USE_MAINTAINER_MODE)
142   AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
143   MAINT=$MAINTAINER_MODE_TRUE
144   AC_SUBST(MAINT)dnl
145 ]
146 )
147
148 # Define a conditional.
149
150 AC_DEFUN([AM_CONDITIONAL],
151 [AC_SUBST($1_TRUE)
152 AC_SUBST($1_FALSE)
153 if $2; then
154   $1_TRUE=
155   $1_FALSE='#'
156 else
157   $1_TRUE='#'
158   $1_FALSE=
159 fi])
160
161 # aclocal-include.m4
162
163 # This macro adds the name macrodir to the set of directories
164 # that `aclocal' searches for macros.  
165
166 # serial 1
167
168 dnl AM_ACLOCAL_INCLUDE(macrodir)
169 AC_DEFUN([AM_ACLOCAL_INCLUDE],
170 [
171         AM_CONDITIONAL(INSIDE_GNOME_COMMON, test x = y)
172
173         test -n "$ACLOCAL_FLAGS" && ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
174
175         for k in $1 ; do ACLOCAL="$ACLOCAL -I $k" ; done
176 ])
177
178 dnl
179 dnl GNOME_INIT_HOOK (script-if-gnome-enabled, [failflag], [additional-inits])
180 dnl
181 dnl if failflag is "fail" then GNOME_INIT_HOOK will abort if gnomeConf.sh
182 dnl is not found. 
183 dnl
184
185 AC_DEFUN([GNOME_INIT_HOOK],[
186         AC_SUBST(GNOME_LIBS)
187         AC_SUBST(GNOMEUI_LIBS)
188         AC_SUBST(GNOMEGNORBA_LIBS)
189         AC_SUBST(GTKXMHTML_LIBS)
190         AC_SUBST(ZVT_LIBS)
191         AC_SUBST(GNOME_LIBDIR)
192         AC_SUBST(GNOME_INCLUDEDIR)
193
194         AC_ARG_WITH(gnome-includes,
195         [  --with-gnome-includes   Specify location of GNOME headers],[
196         CFLAGS="$CFLAGS -I$withval"
197         ])
198         
199         AC_ARG_WITH(gnome-libs,
200         [  --with-gnome-libs       Specify location of GNOME libs],[
201         LDFLAGS="$LDFLAGS -L$withval"
202         gnome_prefix=$withval
203         ])
204
205         AC_ARG_WITH(gnome,
206         [  --with-gnome            Specify prefix for GNOME files],
207                 if test x$withval = xyes; then
208                         want_gnome=yes
209                         dnl Note that an empty true branch is not
210                         dnl valid sh syntax.
211                         ifelse([$1], [], :, [$1])
212                 else
213                         if test "x$withval" = xno; then
214                                 want_gnome=no
215                         else
216                                 want_gnome=yes
217                                 LDFLAGS="$LDFLAGS -L$withval/lib"
218                                 CFLAGS="$CFLAGS -I$withval/include"
219                                 gnome_prefix=$withval/lib
220                         fi
221                 fi,
222                 want_gnome=yes)
223
224         if test "x$want_gnome" = xyes; then
225
226             AC_PATH_PROG(GNOME_CONFIG,gnome-config,no)
227             if test "$GNOME_CONFIG" = "no"; then
228               no_gnome_config="yes"
229             else
230               AC_MSG_CHECKING(if $GNOME_CONFIG works)
231               if $GNOME_CONFIG --libs-only-l gnome >/dev/null 2>&1; then
232                 AC_MSG_RESULT(yes)
233                 GNOME_GNORBA_HOOK([],$2)
234                 GNOME_LIBS="`$GNOME_CONFIG --libs-only-l gnome`"
235                 GNOMEUI_LIBS="`$GNOME_CONFIG --libs-only-l gnomeui`"
236                 GNOMEGNORBA_LIBS="`$GNOME_CONFIG --libs-only-l gnorba gnomeui`"
237                 GTKXMHTML_LIBS="`$GNOME_CONFIG --libs-only-l gtkxmhtml`"
238                 ZVT_LIBS="`$GNOME_CONFIG --libs-only-l zvt`"
239                 GNOME_LIBDIR="`$GNOME_CONFIG --libs-only-L gnorba gnomeui`"
240                 GNOME_INCLUDEDIR="`$GNOME_CONFIG --cflags gnorba gnomeui`"
241                 $1
242               else
243                 AC_MSG_RESULT(no)
244                 no_gnome_config="yes"
245               fi
246             fi
247
248             if test x$exec_prefix = xNONE; then
249                 if test x$prefix = xNONE; then
250                     gnome_prefix=$ac_default_prefix/lib
251                 else
252                     gnome_prefix=$prefix/lib
253                 fi
254             else
255                 gnome_prefix=`eval echo \`echo $libdir\``
256             fi
257         
258             if test "$no_gnome_config" = "yes"; then
259               AC_MSG_CHECKING(for gnomeConf.sh file in $gnome_prefix)
260               if test -f $gnome_prefix/gnomeConf.sh; then
261                 AC_MSG_RESULT(found)
262                 echo "loading gnome configuration from" \
263                      "$gnome_prefix/gnomeConf.sh"
264                 . $gnome_prefix/gnomeConf.sh
265                 $1
266               else
267                 AC_MSG_RESULT(not found)
268                 if test x$2 = xfail; then
269                   AC_MSG_ERROR(Could not find the gnomeConf.sh file that is generated by gnome-libs install)
270                 fi
271               fi
272             fi
273         fi
274
275         if test -n "$3"; then
276           n="$3"
277           for i in $n; do
278             AC_MSG_CHECKING(extra library \"$i\")
279             case $i in 
280               applets)
281                 AC_SUBST(GNOME_APPLETS_LIBS)
282                 GNOME_APPLETS_LIBS=`$GNOME_CONFIG --libs-only-l applets`
283                 AC_MSG_RESULT($GNOME_APPLETS_LIBS);;
284               capplet)
285                 AC_SUBST(GNOME_CAPPLET_LIBS)
286                 GNOME_CAPPLET_LIBS=`$GNOME_CONFIG --libs-only-l capplet`
287                 AC_MSG_RESULT($GNOME_CAPPLET_LIBS);;
288               *)
289                 AC_MSG_RESULT(unknown library)
290             esac
291           done
292         fi
293 ])
294
295 dnl
296 dnl GNOME_INIT ([additional-inits])
297 dnl
298
299 AC_DEFUN([GNOME_INIT],[
300         GNOME_INIT_HOOK([],fail,$1)
301 ])
302
303 dnl
304 dnl GNOME_GNORBA_HOOK (script-if-gnorba-found, failflag)
305 dnl
306 dnl if failflag is "failure" it aborts if gnorba is not found.
307 dnl
308
309 AC_DEFUN([GNOME_GNORBA_HOOK],[
310         GNOME_ORBIT_HOOK([],$2)
311         AC_CACHE_CHECK([for gnorba libraries],gnome_cv_gnorba_found,[
312                 gnome_cv_gnorba_found=no
313                 if test x$gnome_cv_orbit_found = xyes; then
314                         GNORBA_CFLAGS="`gnome-config --cflags gnorba gnomeui`"
315                         GNORBA_LIBS="`gnome-config --libs gnorba gnomeui`"
316                         if test -n "$GNORBA_LIBS"; then
317                                 gnome_cv_gnorba_found=yes
318                         fi
319                 fi
320         ])
321         AM_CONDITIONAL(HAVE_GNORBA, test x$gnome_cv_gnorba_found = xyes)
322         if test x$gnome_cv_orbit_found = xyes; then
323                 $1
324                 GNORBA_CFLAGS="`gnome-config --cflags gnorba gnomeui`"
325                 GNORBA_LIBS="`gnome-config --libs gnorba gnomeui`"
326                 AC_SUBST(GNORBA_CFLAGS)
327                 AC_SUBST(GNORBA_LIBS)
328         else
329                 if test x$2 = xfailure; then
330                         AC_MSG_ERROR(gnorba library not installed or installation problem)
331                 fi
332         fi
333 ])
334
335 AC_DEFUN([GNOME_GNORBA_CHECK], [
336         GNOME_GNORBA_HOOK([],failure)
337 ])
338
339 dnl
340 dnl GNOME_ORBIT_HOOK (script-if-orbit-found, failflag)
341 dnl
342 dnl if failflag is "failure" it aborts if orbit is not found.
343 dnl
344
345 AC_DEFUN([GNOME_ORBIT_HOOK],[
346         AC_PATH_PROG(ORBIT_CONFIG,orbit-config,no)
347         AC_PATH_PROG(ORBIT_IDL,orbit-idl,no)
348         AC_CACHE_CHECK([for working ORBit environment],gnome_cv_orbit_found,[
349                 if test x$ORBIT_CONFIG = xno -o x$ORBIT_IDL = xno; then
350                         gnome_cv_orbit_found=no
351                 else
352                         gnome_cv_orbit_found=yes
353                 fi
354         ])
355         AM_CONDITIONAL(HAVE_ORBIT, test x$gnome_cv_orbit_found = xyes)
356         if test x$gnome_cv_orbit_found = xyes; then
357                 $1
358                 ORBIT_CFLAGS=`orbit-config --cflags client server`
359                 ORBIT_LIBS=`orbit-config --use-service=name --libs client server`
360                 AC_SUBST(ORBIT_CFLAGS)
361                 AC_SUBST(ORBIT_LIBS)
362         else
363                 if test x$2 = xfailure; then
364                         AC_MSG_ERROR(ORBit not installed or installation problem)
365                 fi
366         fi
367 ])
368
369 AC_DEFUN([GNOME_ORBIT_CHECK], [
370         GNOME_ORBIT_HOOK([],failure)
371 ])
372
373 # isc-posix.m4 serial 1 (gettext-0.10.40)
374 dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
375 dnl This file is free software, distributed under the terms of the GNU
376 dnl General Public License.  As a special exception to the GNU General
377 dnl Public License, this file may be distributed as part of a program
378 dnl that contains a configuration script generated by Autoconf, under
379 dnl the same distribution terms as the rest of that program.
380
381 # This test replaces the one in autoconf.
382 # Currently this macro should have the same name as the autoconf macro
383 # because gettext's gettext.m4 (distributed in the automake package)
384 # still uses it.  Otherwise, the use in gettext.m4 makes autoheader
385 # give these diagnostics:
386 #   configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
387 #   configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
388
389 undefine([AC_ISC_POSIX])
390
391 AC_DEFUN([AC_ISC_POSIX],
392   [
393     dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
394     AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
395   ]
396 )
397
398
399 # serial 1
400
401 # @defmac AC_PROG_CC_STDC
402 # @maindex PROG_CC_STDC
403 # @ovindex CC
404 # If the C compiler in not in ANSI C mode by default, try to add an option
405 # to output variable @code{CC} to make it so.  This macro tries various
406 # options that select ANSI C on some system or another.  It considers the
407 # compiler to be in ANSI C mode if it handles function prototypes correctly.
408 #
409 # If you use this macro, you should check after calling it whether the C
410 # compiler has been set to accept ANSI C; if not, the shell variable
411 # @code{am_cv_prog_cc_stdc} is set to @samp{no}.  If you wrote your source
412 # code in ANSI C, you can make an un-ANSIfied copy of it by using the
413 # program @code{ansi2knr}, which comes with Ghostscript.
414 # @end defmac
415
416 AC_DEFUN([AM_PROG_CC_STDC],
417 [AC_REQUIRE([AC_PROG_CC])
418 AC_BEFORE([$0], [AC_C_INLINE])
419 AC_BEFORE([$0], [AC_C_CONST])
420 dnl Force this before AC_PROG_CPP.  Some cpp's, eg on HPUX, require
421 dnl a magic option to avoid problems with ANSI preprocessor commands
422 dnl like #elif.
423 dnl FIXME: can't do this because then AC_AIX won't work due to a
424 dnl circular dependency.
425 dnl AC_BEFORE([$0], [AC_PROG_CPP])
426 AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
427 AC_CACHE_VAL(am_cv_prog_cc_stdc,
428 [am_cv_prog_cc_stdc=no
429 ac_save_CC="$CC"
430 # Don't try gcc -ansi; that turns off useful extensions and
431 # breaks some systems' header files.
432 # AIX                   -qlanglvl=ansi
433 # Ultrix and OSF/1      -std1
434 # HP-UX                 -Aa -D_HPUX_SOURCE
435 # SVR4                  -Xc -D__EXTENSIONS__
436 for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
437 do
438   CC="$ac_save_CC $ac_arg"
439   AC_TRY_COMPILE(
440 [#include <stdarg.h>
441 #include <stdio.h>
442 #include <sys/types.h>
443 #include <sys/stat.h>
444 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
445 struct buf { int x; };
446 FILE * (*rcsopen) (struct buf *, struct stat *, int);
447 static char *e (p, i)
448      char **p;
449      int i;
450 {
451   return p[i];
452 }
453 static char *f (char * (*g) (char **, int), char **p, ...)
454 {
455   char *s;
456   va_list v;
457   va_start (v,p);
458   s = g (p, va_arg (v,int));
459   va_end (v);
460   return s;
461 }
462 int test (int i, double x);
463 struct s1 {int (*f) (int a);};
464 struct s2 {int (*f) (double a);};
465 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
466 int argc;
467 char **argv;
468 ], [
469 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
470 ],
471 [am_cv_prog_cc_stdc="$ac_arg"; break])
472 done
473 CC="$ac_save_CC"
474 ])
475 if test -z "$am_cv_prog_cc_stdc"; then
476   AC_MSG_RESULT([none needed])
477 else
478   AC_MSG_RESULT($am_cv_prog_cc_stdc)
479 fi
480 case "x$am_cv_prog_cc_stdc" in
481   x|xno) ;;
482   *) CC="$CC $am_cv_prog_cc_stdc" ;;
483 esac
484 ])
485
486 dnl GNOME_COMPILE_WARNINGS
487 dnl Turn on many useful compiler warnings
488 dnl For now, only works on GCC
489 AC_DEFUN([GNOME_COMPILE_WARNINGS],[
490   AC_ARG_ENABLE(compile-warnings, 
491     [  --enable-compile-warnings=[no/minimum/yes]       Turn on compiler warnings.],,enable_compile_warnings=minimum)
492
493   AC_MSG_CHECKING(what warning flags to pass to the C compiler)
494   warnCFLAGS=
495   if test "x$GCC" != xyes; then
496     enable_compile_warnings=no
497   fi
498
499   if test "x$enable_compile_warnings" != "xno"; then
500     if test "x$GCC" = "xyes"; then
501       case " $CFLAGS " in
502       *[\ \     ]-Wall[\ \      ]*) ;;
503       *) warnCFLAGS="-Wall -Wunused" ;;
504       esac
505
506       ## -W is not all that useful.  And it cannot be controlled
507       ## with individual -Wno-xxx flags, unlike -Wall
508       if test "x$enable_compile_warnings" = "xyes"; then
509         warnCFLAGS="$warnCFLAGS -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith"
510       fi
511     fi
512   fi
513   AC_MSG_RESULT($warnCFLAGS)
514
515   AC_ARG_ENABLE(iso-c,
516     [  --enable-iso-c          Try to warn if code is not ISO C ],,
517     enable_iso_c=no)
518
519   AC_MSG_CHECKING(what language compliance flags to pass to the C compiler)
520   complCFLAGS=
521   if test "x$enable_iso_c" != "xno"; then
522     if test "x$GCC" = "xyes"; then
523       case " $CFLAGS " in
524       *[\ \     ]-ansi[\ \      ]*) ;;
525       *) complCFLAGS="$complCFLAGS -ansi" ;;
526       esac
527
528       case " $CFLAGS " in
529       *[\ \     ]-pedantic[\ \  ]*) ;;
530       *) complCFLAGS="$complCFLAGS -pedantic" ;;
531       esac
532     fi
533   fi
534   AC_MSG_RESULT($complCFLAGS)
535   if test "x$cflags_set" != "xyes"; then
536     CFLAGS="$CFLAGS $warnCFLAGS $complCFLAGS"
537     cflags_set=yes
538     AC_SUBST(cflags_set)
539   fi
540 ])
541
542 dnl For C++, do basically the same thing.
543
544 AC_DEFUN([GNOME_CXX_WARNINGS],[
545   AC_ARG_ENABLE(cxx-warnings, 
546     [  --enable-cxx-warnings=[no/minimum/yes]   Turn on compiler warnings.],,enable_cxx_warnings=minimum)
547
548   AC_MSG_CHECKING(what warning flags to pass to the C++ compiler)
549   warnCXXFLAGS=
550   if test "x$GCC" != xyes; then
551     enable_compile_warnings=no
552   fi
553   if test "x$enable_cxx_warnings" != "xno"; then
554     if test "x$GCC" = "xyes"; then
555       case " $CXXFLAGS " in
556       *[\ \     ]-Wall[\ \      ]*) ;;
557       *) warnCXXFLAGS="-Wall -Wno-unused" ;;
558       esac
559
560       ## -W is not all that useful.  And it cannot be controlled
561       ## with individual -Wno-xxx flags, unlike -Wall
562       if test "x$enable_cxx_warnings" = "xyes"; then
563         warnCXXFLAGS="$warnCXXFLAGS -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wshadow -Woverloaded-virtual"
564       fi
565     fi
566   fi
567   AC_MSG_RESULT($warnCXXFLAGS)
568
569    AC_ARG_ENABLE(iso-cxx,
570      [  --enable-iso-cxx          Try to warn if code is not ISO C++ ],,
571      enable_iso_cxx=no)
572
573    AC_MSG_CHECKING(what language compliance flags to pass to the C++ compiler)
574    complCXXFLAGS=
575    if test "x$enable_iso_cxx" != "xno"; then
576      if test "x$GCC" = "xyes"; then
577       case " $CXXFLAGS " in
578       *[\ \     ]-ansi[\ \      ]*) ;;
579       *) complCXXFLAGS="$complCXXFLAGS -ansi" ;;
580       esac
581
582       case " $CXXFLAGS " in
583       *[\ \     ]-pedantic[\ \  ]*) ;;
584       *) complCXXFLAGS="$complCXXFLAGS -pedantic" ;;
585       esac
586      fi
587    fi
588   AC_MSG_RESULT($complCXXFLAGS)
589   if test "x$cxxflags_set" != "xyes"; then
590     CXXFLAGS="$CXXFLAGS $warnCXXFLAGS $complCXXFLAGS"
591     cxxflags_set=yes
592     AC_SUBST(cxxflags_set)
593   fi
594 ])
595
596 dnl GNOME_X_CHECKS
597 dnl
598 dnl Basic X11 related checks for X11.  At the end, the following will be
599 dnl defined/changed:
600 dnl   GTK_{CFLAGS,LIBS}      From AM_PATH_GTK
601 dnl   CPPFLAGS               Will include $X_CFLAGS
602 dnl   GNOME_HAVE_SM          `true' or `false' depending on whether session
603 dnl                          management is available.  It is available if
604 dnl                          both -lSM and X11/SM/SMlib.h exist.  (Some
605 dnl                          Solaris boxes have the library but not the header)
606 dnl   XPM_LIBS               -lXpm if Xpm library is present, otherwise ""
607 dnl
608 dnl The following configure cache variables are defined (but not used):
609 dnl   gnome_cv_passdown_{x_libs,X_LIBS,X_CFLAGS}
610 dnl
611 AC_DEFUN([GNOME_X_CHECKS],
612 [
613         AM_PATH_GTK(1.2.0,,AC_MSG_ERROR(GTK not installed, or gtk-config not in path))
614         dnl Hope that GTK_CFLAGS have only -I and -D.  Otherwise, we could
615         dnl   test -z "$x_includes" || CPPFLAGS="$CPPFLAGS -I$x_includes"
616         dnl
617         dnl Use CPPFLAGS instead of CFLAGS because AC_CHECK_HEADERS uses
618         dnl CPPFLAGS, not CFLAGS
619         CPPFLAGS="$CPPFLAGS $GTK_CFLAGS"
620
621         saved_ldflags="$LDFLAGS"
622         LDFLAGS="$LDFLAGS $GTK_LIBS"
623
624         gnome_cv_passdown_x_libs="$GTK_LIBS"
625         gnome_cv_passdown_X_LIBS="$GTK_LIBS"
626         gnome_cv_passdown_X_CFLAGS="$GTK_CFLAGS"
627         gnome_cv_passdown_GTK_LIBS="$GTK_LIBS"
628
629         LDFLAGS="$saved_ldflags $GTK_LIBS"
630
631 dnl We are requiring GTK >= 1.1.1, which means this will be fine anyhow.
632         USE_DEVGTK=true
633
634 dnl     AC_MSG_CHECKING([whether to use features from (unstable) GTK+ 1.1.x])
635 dnl     AC_EGREP_CPP(answer_affirmatively,
636 dnl     [#include <gtk/gtkfeatures.h>
637 dnl     #ifdef GTK_HAVE_FEATURES_1_1_0
638 dnl        answer_affirmatively
639 dnl     #endif
640 dnl     ], dev_gtk=yes, dev_gtk=no)
641 dnl     if test "$dev_gtk" = "yes"; then
642 dnl        USE_DEVGTK=true
643 dnl     fi
644 dnl     AC_MSG_RESULT("$dev_gtk")
645
646         GNOME_HAVE_SM=true
647         case "$GTK_LIBS" in
648          *-lSM*)
649             dnl Already found it.
650             ;;
651          *)
652             dnl Assume that if we have -lSM then we also have -lICE.
653             AC_CHECK_LIB(SM, SmcSaveYourselfDone,
654                 [GTK_LIBS="-lSM -lICE $GTK_LIBS"],GNOME_HAVE_SM=false,
655                 $x_libs -lICE)
656             ;;
657         esac
658
659         if test "$GNOME_HAVE_SM" = true; then
660            AC_CHECK_HEADERS(X11/SM/SMlib.h,,GNOME_HAVE_SM=false)
661         fi
662
663         if test "$GNOME_HAVE_SM" = true; then
664            AC_DEFINE(HAVE_LIBSM)
665         fi
666
667         XPM_LIBS=""
668         AC_CHECK_LIB(Xpm, XpmFreeXpmImage, [XPM_LIBS="-lXpm"], , $x_libs)
669         AC_SUBST(XPM_LIBS)
670
671         AC_REQUIRE([GNOME_PTHREAD_CHECK])
672         LDFLAGS="$saved_ldflags"
673
674         AC_PROVIDE([GNOME_X_CHECKS])
675 ])
676
677 # Configure paths for GTK+
678 # Owen Taylor     97-11-3
679
680 dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
681 dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
682 dnl
683 AC_DEFUN(AM_PATH_GTK,
684 [dnl 
685 dnl Get the cflags and libraries from the gtk-config script
686 dnl
687 AC_ARG_WITH(gtk-prefix,[  --with-gtk-prefix=PFX   Prefix where GTK is installed (optional)],
688             gtk_config_prefix="$withval", gtk_config_prefix="")
689 AC_ARG_WITH(gtk-exec-prefix,[  --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)],
690             gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="")
691 AC_ARG_ENABLE(gtktest, [  --disable-gtktest       Do not try to compile and run a test GTK program],
692                     , enable_gtktest=yes)
693
694   for module in . $4
695   do
696       case "$module" in
697          gthread) 
698              gtk_config_args="$gtk_config_args gthread"
699          ;;
700       esac
701   done
702
703   if test x$gtk_config_exec_prefix != x ; then
704      gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix"
705      if test x${GTK_CONFIG+set} != xset ; then
706         GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config
707      fi
708   fi
709   if test x$gtk_config_prefix != x ; then
710      gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix"
711      if test x${GTK_CONFIG+set} != xset ; then
712         GTK_CONFIG=$gtk_config_prefix/bin/gtk-config
713      fi
714   fi
715
716   AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
717   min_gtk_version=ifelse([$1], ,0.99.7,$1)
718   AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
719   no_gtk=""
720   if test "$GTK_CONFIG" = "no" ; then
721     no_gtk=yes
722   else
723     GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags`
724     GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs`
725     gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \
726            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
727     gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \
728            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
729     gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \
730            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
731     if test "x$enable_gtktest" = "xyes" ; then
732       ac_save_CFLAGS="$CFLAGS"
733       ac_save_LIBS="$LIBS"
734       CFLAGS="$CFLAGS $GTK_CFLAGS"
735       LIBS="$GTK_LIBS $LIBS"
736 dnl
737 dnl Now check if the installed GTK is sufficiently new. (Also sanity
738 dnl checks the results of gtk-config to some extent
739 dnl
740       rm -f conf.gtktest
741       AC_TRY_RUN([
742 #include <gtk/gtk.h>
743 #include <stdio.h>
744 #include <stdlib.h>
745
746 int 
747 main ()
748 {
749   int major, minor, micro;
750   char *tmp_version;
751
752   system ("touch conf.gtktest");
753
754   /* HP/UX 9 (%@#!) writes to sscanf strings */
755   tmp_version = g_strdup("$min_gtk_version");
756   if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
757      printf("%s, bad version string\n", "$min_gtk_version");
758      exit(1);
759    }
760
761   if ((gtk_major_version != $gtk_config_major_version) ||
762       (gtk_minor_version != $gtk_config_minor_version) ||
763       (gtk_micro_version != $gtk_config_micro_version))
764     {
765       printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", 
766              $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
767              gtk_major_version, gtk_minor_version, gtk_micro_version);
768       printf ("*** was found! If gtk-config was correct, then it is best\n");
769       printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
770       printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
771       printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
772       printf("*** required on your system.\n");
773       printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n");
774       printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n");
775       printf("*** before re-running configure\n");
776     } 
777 #if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION)
778   else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
779            (gtk_minor_version != GTK_MINOR_VERSION) ||
780            (gtk_micro_version != GTK_MICRO_VERSION))
781     {
782       printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
783              GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
784       printf("*** library (version %d.%d.%d)\n",
785              gtk_major_version, gtk_minor_version, gtk_micro_version);
786     }
787 #endif /* defined (GTK_MAJOR_VERSION) ... */
788   else
789     {
790       if ((gtk_major_version > major) ||
791         ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
792         ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
793       {
794         return 0;
795        }
796      else
797       {
798         printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
799                gtk_major_version, gtk_minor_version, gtk_micro_version);
800         printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
801                major, minor, micro);
802         printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
803         printf("***\n");
804         printf("*** If you have already installed a sufficiently new version, this error\n");
805         printf("*** probably means that the wrong copy of the gtk-config shell script is\n");
806         printf("*** being found. The easiest way to fix this is to remove the old version\n");
807         printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n");
808         printf("*** correct copy of gtk-config. (In this case, you will have to\n");
809         printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
810         printf("*** so that the correct libraries are found at run-time))\n");
811       }
812     }
813   return 1;
814 }
815 ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
816        CFLAGS="$ac_save_CFLAGS"
817        LIBS="$ac_save_LIBS"
818      fi
819   fi
820   if test "x$no_gtk" = x ; then
821      AC_MSG_RESULT(yes)
822      ifelse([$2], , :, [$2])     
823   else
824      AC_MSG_RESULT(no)
825      if test "$GTK_CONFIG" = "no" ; then
826        echo "*** The gtk-config script installed by GTK could not be found"
827        echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in"
828        echo "*** your path, or set the GTK_CONFIG environment variable to the"
829        echo "*** full path to gtk-config."
830      else
831        if test -f conf.gtktest ; then
832         :
833        else
834           echo "*** Could not run GTK test program, checking why..."
835           CFLAGS="$CFLAGS $GTK_CFLAGS"
836           LIBS="$LIBS $GTK_LIBS"
837           AC_TRY_LINK([
838 #include <gtk/gtk.h>
839 #include <stdio.h>
840 ],      [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
841         [ echo "*** The test program compiled, but did not run. This usually means"
842           echo "*** that the run-time linker is not finding GTK or finding the wrong"
843           echo "*** version of GTK. If it is not finding GTK, you'll need to set your"
844           echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
845           echo "*** to the installed location  Also, make sure you have run ldconfig if that"
846           echo "*** is required on your system"
847           echo "***"
848           echo "*** If you have an old version installed, it is best to remove it, although"
849           echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
850           echo "***"
851           echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
852           echo "*** came with the system with the command"
853           echo "***"
854           echo "***    rpm --erase --nodeps gtk gtk-devel" ],
855         [ echo "*** The test program failed to compile or link. See the file config.log for the"
856           echo "*** exact error that occured. This usually means GTK was incorrectly installed"
857           echo "*** or that you have moved GTK since it was installed. In the latter case, you"
858           echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ])
859           CFLAGS="$ac_save_CFLAGS"
860           LIBS="$ac_save_LIBS"
861        fi
862      fi
863      GTK_CFLAGS=""
864      GTK_LIBS=""
865      ifelse([$3], , :, [$3])
866   fi
867   AC_SUBST(GTK_CFLAGS)
868   AC_SUBST(GTK_LIBS)
869   rm -f conf.gtktest
870 ])
871
872 dnl
873 dnl And better, use gthreads instead...
874 dnl
875
876 AC_DEFUN([GNOME_PTHREAD_CHECK],[
877         PTHREAD_LIB=""
878         AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIB="-lpthread",
879                 [AC_CHECK_LIB(pthreads, pthread_create, PTHREAD_LIB="-lpthreads",
880                     [AC_CHECK_LIB(c_r, pthread_create, PTHREAD_LIB="-lc_r",
881                         [AC_CHECK_FUNC(pthread_create)]
882                     )]
883                 )]
884         )
885         AC_SUBST(PTHREAD_LIB)
886         AC_PROVIDE([GNOME_PTHREAD_CHECK])
887 ])
888
889 # Macro to add for using GNU gettext.
890 # Ulrich Drepper <drepper@cygnus.com>, 1995.
891 #
892 # Modified to never use included libintl. 
893 # Owen Taylor <otaylor@redhat.com>, 12/15/1998
894 #
895 #
896 # This file can be copied and used freely without restrictions.  It can
897 # be used in projects which are not available under the GNU Public License
898 # but which still want to provide support for the GNU gettext functionality.
899 # Please note that the actual code is *not* freely available.
900
901 # serial 5
902
903 AC_DEFUN(AM_GNOME_WITH_NLS,
904   [AC_MSG_CHECKING([whether NLS is requested])
905     dnl Default is enabled NLS
906     AC_ARG_ENABLE(nls,
907       [  --disable-nls           do not use Native Language Support],
908       USE_NLS=$enableval, USE_NLS=yes)
909     AC_MSG_RESULT($USE_NLS)
910     AC_SUBST(USE_NLS)
911
912     USE_INCLUDED_LIBINTL=no
913
914     dnl If we use NLS figure out what method
915     if test "$USE_NLS" = "yes"; then
916       AC_DEFINE(ENABLE_NLS)
917 #      AC_MSG_CHECKING([whether included gettext is requested])
918 #      AC_ARG_WITH(included-gettext,
919 #        [  --with-included-gettext use the GNU gettext library included here],
920 #        nls_cv_force_use_gnu_gettext=$withval,
921 #        nls_cv_force_use_gnu_gettext=no)
922 #      AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
923       nls_cv_force_use_gnu_gettext="no"
924
925       nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
926       if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
927         dnl User does not insist on using GNU NLS library.  Figure out what
928         dnl to use.  If gettext or catgets are available (in this order) we
929         dnl use this.  Else we have to fall back to GNU NLS library.
930         dnl catgets is only used if permitted by option --with-catgets.
931         nls_cv_header_intl=
932         nls_cv_header_libgt=
933         CATOBJEXT=NONE
934
935         AC_CHECK_HEADER(libintl.h,
936           [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
937             [AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")],
938                gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)])
939
940            if test "$gt_cv_func_gettext_libc" != "yes"; then
941              AC_CHECK_LIB(intl, bindtextdomain,
942                [AC_CACHE_CHECK([for gettext in libintl],
943                  gt_cv_func_gettext_libintl,
944                  [AC_CHECK_LIB(intl, gettext,
945                   gt_cv_func_gettext_libintl=yes,
946                   gt_cv_func_gettext_libintl=no)],
947                  gt_cv_func_gettext_libintl=no)])
948            fi
949
950            if test "$gt_cv_func_gettext_libc" = "yes" \
951               || test "$gt_cv_func_gettext_libintl" = "yes"; then
952               AC_DEFINE(HAVE_GETTEXT)
953               AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
954                 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
955               if test "$MSGFMT" != "no"; then
956                 AC_CHECK_FUNCS(dcgettext)
957                 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
958                 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
959                   [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
960                 AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
961                                return _nl_msg_cat_cntr],
962                   [CATOBJEXT=.gmo
963                    DATADIRNAME=share],
964                   [CATOBJEXT=.mo
965                    DATADIRNAME=lib])
966                 INSTOBJEXT=.mo
967               fi
968             fi
969
970             # Added by Martin Baulig 12/15/98 for libc5 systems
971             if test "$gt_cv_func_gettext_libc" != "yes" \
972                && test "$gt_cv_func_gettext_libintl" = "yes"; then
973                INTLLIBS=-lintl
974                LIBS=`echo $LIBS | sed -e 's/-lintl//'`
975             fi
976         ])
977
978         if test "$CATOBJEXT" = "NONE"; then
979           AC_MSG_CHECKING([whether catgets can be used])
980           AC_ARG_WITH(catgets,
981             [  --with-catgets          use catgets functions if available],
982             nls_cv_use_catgets=$withval, nls_cv_use_catgets=no)
983           AC_MSG_RESULT($nls_cv_use_catgets)
984
985           if test "$nls_cv_use_catgets" = "yes"; then
986             dnl No gettext in C library.  Try catgets next.
987             AC_CHECK_LIB(i, main)
988             AC_CHECK_FUNC(catgets,
989               [AC_DEFINE(HAVE_CATGETS)
990                INTLOBJS="\$(CATOBJS)"
991                AC_PATH_PROG(GENCAT, gencat, no)dnl
992 #              if test "$GENCAT" != "no"; then
993 #                AC_PATH_PROG(GMSGFMT, gmsgfmt, no)
994 #                if test "$GMSGFMT" = "no"; then
995 #                  AM_PATH_PROG_WITH_TEST(GMSGFMT, msgfmt,
996 #                   [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)
997 #                fi
998 #                AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
999 #                  [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
1000 #                USE_INCLUDED_LIBINTL=yes
1001 #                CATOBJEXT=.cat
1002 #                INSTOBJEXT=.cat
1003 #                DATADIRNAME=lib
1004 #                INTLDEPS='$(top_builddir)/intl/libintl.a'
1005 #                INTLLIBS=$INTLDEPS
1006 #                LIBS=`echo $LIBS | sed -e 's/-lintl//'`
1007 #                nls_cv_header_intl=intl/libintl.h
1008 #                nls_cv_header_libgt=intl/libgettext.h
1009 #              fi
1010             ])
1011           fi
1012         fi
1013
1014         if test "$CATOBJEXT" = "NONE"; then
1015           dnl Neither gettext nor catgets in included in the C library.
1016           dnl Fall back on GNU gettext library.
1017           nls_cv_use_gnu_gettext=yes
1018         fi
1019       fi
1020
1021       if test "$nls_cv_use_gnu_gettext" != "yes"; then
1022         AC_DEFINE(ENABLE_NLS)
1023       else
1024          # Unset this variable since we use the non-zero value as a flag.
1025          CATOBJEXT=
1026 #        dnl Mark actions used to generate GNU NLS library.
1027 #        INTLOBJS="\$(GETTOBJS)"
1028 #        AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
1029 #         [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
1030 #        AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
1031 #        AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
1032 #         [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
1033 #        AC_SUBST(MSGFMT)
1034 #       USE_INCLUDED_LIBINTL=yes
1035 #        CATOBJEXT=.gmo
1036 #        INSTOBJEXT=.mo
1037 #        DATADIRNAME=share
1038 #       INTLDEPS='$(top_builddir)/intl/libintl.a'
1039 #       INTLLIBS=$INTLDEPS
1040 #       LIBS=`echo $LIBS | sed -e 's/-lintl//'`
1041 #        nls_cv_header_intl=intl/libintl.h
1042 #        nls_cv_header_libgt=intl/libgettext.h
1043       fi
1044
1045       dnl Test whether we really found GNU xgettext.
1046       if test "$XGETTEXT" != ":"; then
1047         dnl If it is no GNU xgettext we define it as : so that the
1048         dnl Makefiles still can work.
1049         if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
1050           : ;
1051         else
1052           AC_MSG_RESULT(
1053             [found xgettext program is not GNU xgettext; ignore it])
1054           XGETTEXT=":"
1055         fi
1056       fi
1057
1058       # We need to process the po/ directory.
1059       POSUB=po
1060     else
1061       DATADIRNAME=share
1062       nls_cv_header_intl=intl/libintl.h
1063       nls_cv_header_libgt=intl/libgettext.h
1064     fi
1065     AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl)
1066     AC_OUTPUT_COMMANDS(
1067      [case "$CONFIG_FILES" in *po/Makefile.in*)
1068         sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
1069       esac])
1070
1071
1072 #    # If this is used in GNU gettext we have to set USE_NLS to `yes'
1073 #    # because some of the sources are only built for this goal.
1074 #    if test "$PACKAGE" = gettext; then
1075 #      USE_NLS=yes
1076 #      USE_INCLUDED_LIBINTL=yes
1077 #    fi
1078
1079     dnl These rules are solely for the distribution goal.  While doing this
1080     dnl we only have to keep exactly one list of the available catalogs
1081     dnl in configure.in.
1082     for lang in $ALL_LINGUAS; do
1083       GMOFILES="$GMOFILES $lang.gmo"
1084       POFILES="$POFILES $lang.po"
1085     done
1086
1087     dnl Make all variables we use known to autoconf.
1088     AC_SUBST(USE_INCLUDED_LIBINTL)
1089     AC_SUBST(CATALOGS)
1090     AC_SUBST(CATOBJEXT)
1091     AC_SUBST(DATADIRNAME)
1092     AC_SUBST(GMOFILES)
1093     AC_SUBST(INSTOBJEXT)
1094     AC_SUBST(INTLDEPS)
1095     AC_SUBST(INTLLIBS)
1096     AC_SUBST(INTLOBJS)
1097     AC_SUBST(POFILES)
1098     AC_SUBST(POSUB)
1099   ])
1100
1101 AC_DEFUN(AM_GNOME_GETTEXT,
1102   [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1103    AC_REQUIRE([AC_PROG_CC])dnl
1104    AC_REQUIRE([AC_PROG_RANLIB])dnl
1105    AC_REQUIRE([AC_ISC_POSIX])dnl
1106    AC_REQUIRE([AC_HEADER_STDC])dnl
1107    AC_REQUIRE([AC_C_CONST])dnl
1108    AC_REQUIRE([AC_C_INLINE])dnl
1109    AC_REQUIRE([AC_TYPE_OFF_T])dnl
1110    AC_REQUIRE([AC_TYPE_SIZE_T])dnl
1111    AC_REQUIRE([AC_FUNC_ALLOCA])dnl
1112    AC_REQUIRE([AC_FUNC_MMAP])dnl
1113
1114    AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
1115 unistd.h sys/param.h])
1116    AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
1117 strdup __argz_count __argz_stringify __argz_next])
1118
1119    if test "${ac_cv_func_stpcpy+set}" != "set"; then
1120      AC_CHECK_FUNCS(stpcpy)
1121    fi
1122    if test "${ac_cv_func_stpcpy}" = "yes"; then
1123      AC_DEFINE(HAVE_STPCPY)
1124    fi
1125
1126    AM_LC_MESSAGES
1127    AM_GNOME_WITH_NLS
1128
1129    if test "x$CATOBJEXT" != "x"; then
1130      if test "x$ALL_LINGUAS" = "x"; then
1131        LINGUAS=
1132      else
1133        AC_MSG_CHECKING(for catalogs to be installed)
1134        NEW_LINGUAS=
1135        if test "x$LINGUAS" = "x"; then
1136            LINGUAS=$ALL_LINGUAS
1137        fi
1138        for lang in $LINGUAS; do
1139          case "$ALL_LINGUAS" in
1140           *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
1141          esac
1142        done
1143        LINGUAS=$NEW_LINGUAS
1144        AC_MSG_RESULT($LINGUAS)
1145      fi
1146
1147      dnl Construct list of names of catalog files to be constructed.
1148      if test -n "$LINGUAS"; then
1149        for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
1150      fi
1151    fi
1152
1153    dnl The reference to <locale.h> in the installed <libintl.h> file
1154    dnl must be resolved because we cannot expect the users of this
1155    dnl to define HAVE_LOCALE_H.
1156    if test $ac_cv_header_locale_h = yes; then
1157      INCLUDE_LOCALE_H="#include <locale.h>"
1158    else
1159      INCLUDE_LOCALE_H="\
1160 /* The system does not provide the header <locale.h>.  Take care yourself.  */"
1161    fi
1162    AC_SUBST(INCLUDE_LOCALE_H)
1163
1164    dnl Determine which catalog format we have (if any is needed)
1165    dnl For now we know about two different formats:
1166    dnl   Linux libc-5 and the normal X/Open format
1167    test -d intl || mkdir intl
1168    if test "$CATOBJEXT" = ".cat"; then
1169      AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
1170
1171      dnl Transform the SED scripts while copying because some dumb SEDs
1172      dnl cannot handle comments.
1173      sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed
1174    fi
1175    dnl po2tbl.sed is always needed.
1176    sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
1177      $srcdir/intl/po2tbl.sed.in > intl/po2tbl.sed
1178
1179    dnl In the intl/Makefile.in we have a special dependency which makes
1180    dnl only sense for gettext.  We comment this out for non-gettext
1181    dnl packages.
1182    if test "$PACKAGE" = "gettext"; then
1183      GT_NO="#NO#"
1184      GT_YES=
1185    else
1186      GT_NO=
1187      GT_YES="#YES#"
1188    fi
1189    AC_SUBST(GT_NO)
1190    AC_SUBST(GT_YES)
1191
1192    dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
1193    dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
1194    dnl Try to locate is.
1195    MKINSTALLDIRS=
1196    if test -n "$ac_aux_dir"; then
1197      MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
1198    fi
1199    if test -z "$MKINSTALLDIRS"; then
1200      MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
1201    fi
1202    AC_SUBST(MKINSTALLDIRS)
1203
1204    dnl *** For now the libtool support in intl/Makefile is not for real.
1205    l=
1206    AC_SUBST(l)
1207
1208    dnl Generate list of files to be processed by xgettext which will
1209    dnl be included in po/Makefile.
1210    test -d po || mkdir po
1211    if test "x$srcdir" != "x."; then
1212      if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
1213        posrcprefix="$srcdir/"
1214      else
1215        posrcprefix="../$srcdir/"
1216      fi
1217    else
1218      posrcprefix="../"
1219    fi
1220    rm -f po/POTFILES
1221    sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
1222         < $srcdir/po/POTFILES.in > po/POTFILES
1223   ])
1224
1225
1226 # progtest.m4 serial 2 (gettext-0.10.40)
1227 dnl Copyright (C) 1996-2002 Free Software Foundation, Inc.
1228 dnl This file is free software, distributed under the terms of the GNU
1229 dnl General Public License.  As a special exception to the GNU General
1230 dnl Public License, this file may be distributed as part of a program
1231 dnl that contains a configuration script generated by Autoconf, under
1232 dnl the same distribution terms as the rest of that program.
1233 dnl
1234 dnl This file can can be used in projects which are not available under
1235 dnl the GNU General Public License or the GNU Library General Public
1236 dnl License but which still want to provide support for the GNU gettext
1237 dnl functionality.
1238 dnl Please note that the actual code of the GNU gettext library is covered
1239 dnl by the GNU Library General Public License, and the rest of the GNU
1240 dnl gettext package package is covered by the GNU General Public License.
1241 dnl They are *not* in the public domain.
1242
1243 dnl Authors:
1244 dnl   Ulrich Drepper <drepper@cygnus.com>, 1996.
1245
1246 # Search path for a program which passes the given test.
1247
1248 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
1249 dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
1250 AC_DEFUN([AM_PATH_PROG_WITH_TEST],
1251 [# Extract the first word of "$2", so it can be a program name with args.
1252 set dummy $2; ac_word=[$]2
1253 AC_MSG_CHECKING([for $ac_word])
1254 AC_CACHE_VAL(ac_cv_path_$1,
1255 [case "[$]$1" in
1256   /*)
1257   ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
1258   ;;
1259   *)
1260   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1261   for ac_dir in ifelse([$5], , $PATH, [$5]); do
1262     test -z "$ac_dir" && ac_dir=.
1263     if test -f $ac_dir/$ac_word; then
1264       if [$3]; then
1265         ac_cv_path_$1="$ac_dir/$ac_word"
1266         break
1267       fi
1268     fi
1269   done
1270   IFS="$ac_save_ifs"
1271 dnl If no 4th arg is given, leave the cache variable unset,
1272 dnl so AC_PATH_PROGS will keep looking.
1273 ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
1274 ])dnl
1275   ;;
1276 esac])dnl
1277 $1="$ac_cv_path_$1"
1278 if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
1279   AC_MSG_RESULT([$]$1)
1280 else
1281   AC_MSG_RESULT(no)
1282 fi
1283 AC_SUBST($1)dnl
1284 ])
1285
1286 # lcmessage.m4 serial 2 (gettext-0.10.40)
1287 dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
1288 dnl This file is free software, distributed under the terms of the GNU
1289 dnl General Public License.  As a special exception to the GNU General
1290 dnl Public License, this file may be distributed as part of a program
1291 dnl that contains a configuration script generated by Autoconf, under
1292 dnl the same distribution terms as the rest of that program.
1293 dnl
1294 dnl This file can can be used in projects which are not available under
1295 dnl the GNU General Public License or the GNU Library General Public
1296 dnl License but which still want to provide support for the GNU gettext
1297 dnl functionality.
1298 dnl Please note that the actual code of the GNU gettext library is covered
1299 dnl by the GNU Library General Public License, and the rest of the GNU
1300 dnl gettext package package is covered by the GNU General Public License.
1301 dnl They are *not* in the public domain.
1302
1303 dnl Authors:
1304 dnl   Ulrich Drepper <drepper@cygnus.com>, 1995.
1305
1306 # Check whether LC_MESSAGES is available in <locale.h>.
1307
1308 AC_DEFUN([AM_LC_MESSAGES],
1309   [if test $ac_cv_header_locale_h = yes; then
1310     AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
1311       [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
1312        am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
1313     if test $am_cv_val_LC_MESSAGES = yes; then
1314       AC_DEFINE(HAVE_LC_MESSAGES, 1,
1315         [Define if your <locale.h> file defines LC_MESSAGES.])
1316     fi
1317   fi])
1318