~ubuntu-branches/ubuntu/intrepid/gsmlib/intrepid

« back to all changes in this revision

Viewing changes to acinclude.m4

  • Committer: Bazaar Package Importer
  • Author(s): Mikael Hedin
  • Date: 2002-01-24 12:59:07 UTC
  • Revision ID: james.westby@ubuntu.com-20020124125907-b7qkpokx5283jdpu
Tags: upstream-1.8
ImportĀ upstreamĀ versionĀ 1.8

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
dnl aclocal.m4 generated automatically by aclocal 1.3
 
2
 
 
3
dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
 
4
dnl This Makefile.in 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
dnl aclocal.m4 generated automatically by aclocal 1.3
 
14
 
 
15
dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
 
16
dnl This Makefile.in is free software; the Free Software Foundation
 
17
dnl gives unlimited permission to copy and/or distribute it,
 
18
dnl with or without modifications, as long as this notice is preserved.
 
19
 
 
20
dnl This program is distributed in the hope that it will be useful,
 
21
dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
 
22
dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
 
23
dnl PARTICULAR PURPOSE.
 
24
 
 
25
# Macro to add for using GNU gettext.
 
26
# Ulrich Drepper <drepper@cygnus.com>, 1995.
 
27
#
 
28
# This file can be copied and used freely without restrictions.  It can
 
29
# be used in projects which are not available under the GNU Public License
 
30
# but which still want to provide support for the GNU gettext functionality.
 
31
# Please note that the actual code is *not* freely available.
 
32
 
 
33
# serial 5
 
34
 
 
35
AC_DEFUN(AM_WITH_NLS,
 
36
  [AC_MSG_CHECKING([whether NLS is requested])
 
37
    dnl Default is enabled NLS
 
38
    AC_ARG_ENABLE(nls,
 
39
      [  --disable-nls           do not use Native Language Support],
 
40
      USE_NLS=$enableval, USE_NLS=yes)
 
41
    AC_MSG_RESULT($USE_NLS)
 
42
    AC_SUBST(USE_NLS)
 
43
 
 
44
    USE_INCLUDED_LIBINTL=no
 
45
 
 
46
    dnl If we use NLS figure out what method
 
47
    if test "$USE_NLS" = "yes"; then
 
48
      AC_DEFINE(ENABLE_NLS)
 
49
      AC_MSG_CHECKING([whether included gettext is requested])
 
50
      AC_ARG_WITH(included-gettext,
 
51
        [  --with-included-gettext use the GNU gettext library included here],
 
52
        nls_cv_force_use_gnu_gettext=$withval,
 
53
        nls_cv_force_use_gnu_gettext=no)
 
54
      AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
 
55
 
 
56
      nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
 
57
      if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
 
58
        dnl User does not insist on using GNU NLS library.  Figure out what
 
59
        dnl to use.  If gettext or catgets are available (in this order) we
 
60
        dnl use this.  Else we have to fall back to GNU NLS library.
 
61
        dnl catgets is only used if permitted by option --with-catgets.
 
62
        nls_cv_header_intl=
 
63
        nls_cv_header_libgt=
 
64
        CATOBJEXT=NONE
 
65
 
 
66
        AC_CHECK_HEADER(libintl.h,
 
67
          [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
 
68
            [AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")],
 
69
               gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)])
 
70
 
 
71
           if test "$gt_cv_func_gettext_libc" != "yes"; then
 
72
             AC_CHECK_LIB(intl, bindtextdomain,
 
73
               [AC_CACHE_CHECK([for gettext in libintl],
 
74
                 gt_cv_func_gettext_libintl,
 
75
                 [AC_CHECK_LIB(intl, gettext,
 
76
                  gt_cv_func_gettext_libintl=yes,
 
77
                  gt_cv_func_gettext_libintl=no)],
 
78
                 gt_cv_func_gettext_libintl=no)])
 
79
           fi
 
80
 
 
81
           if test "$gt_cv_func_gettext_libc" = "yes" \
 
82
              || test "$gt_cv_func_gettext_libintl" = "yes"; then
 
83
              AC_DEFINE(HAVE_GETTEXT)
 
84
              AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
 
85
                [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
 
86
              if test "$MSGFMT" != "no"; then
 
87
                AC_CHECK_FUNCS(dcgettext)
 
88
                AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
 
89
                AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
 
90
                  [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
 
91
                AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
 
92
                               return _nl_msg_cat_cntr],
 
93
                  [CATOBJEXT=.gmo
 
94
                   DATADIRNAME=share],
 
95
                  [CATOBJEXT=.mo
 
96
                   DATADIRNAME=lib])
 
97
                INSTOBJEXT=.mo
 
98
              fi
 
99
            fi
 
100
        ])
 
101
 
 
102
        if test "$CATOBJEXT" = "NONE"; then
 
103
          AC_MSG_CHECKING([whether catgets can be used])
 
104
          AC_ARG_WITH(catgets,
 
105
            [  --with-catgets          use catgets functions if available],
 
106
            nls_cv_use_catgets=$withval, nls_cv_use_catgets=no)
 
107
          AC_MSG_RESULT($nls_cv_use_catgets)
 
108
 
 
109
          if test "$nls_cv_use_catgets" = "yes"; then
 
110
            dnl No gettext in C library.  Try catgets next.
 
111
            AC_CHECK_LIB(i, main)
 
112
            AC_CHECK_FUNC(catgets,
 
113
              [AC_DEFINE(HAVE_CATGETS)
 
114
               INTLOBJS="\$(CATOBJS)"
 
115
               AC_PATH_PROG(GENCAT, gencat, no)dnl
 
116
               if test "$GENCAT" != "no"; then
 
117
                 AC_PATH_PROG(GMSGFMT, gmsgfmt, no)
 
118
                 if test "$GMSGFMT" = "no"; then
 
119
                   AM_PATH_PROG_WITH_TEST(GMSGFMT, msgfmt,
 
120
                    [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)
 
121
                 fi
 
122
                 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
 
123
                   [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
 
124
                 USE_INCLUDED_LIBINTL=yes
 
125
                 CATOBJEXT=.cat
 
126
                 INSTOBJEXT=.cat
 
127
                 DATADIRNAME=lib
 
128
                 INTLDEPS='$(top_builddir)/intl/libintl.a'
 
129
                 INTLLIBS=$INTLDEPS
 
130
                 LIBS=`echo $LIBS | sed -e 's/-lintl//'`
 
131
                 nls_cv_header_intl=intl/libintl.h
 
132
                 nls_cv_header_libgt=intl/libgettext.h
 
133
               fi])
 
134
          fi
 
135
        fi
 
136
 
 
137
        if test "$CATOBJEXT" = "NONE"; then
 
138
          dnl Neither gettext nor catgets in included in the C library.
 
139
          dnl Fall back on GNU gettext library.
 
140
          nls_cv_use_gnu_gettext=yes
 
141
        fi
 
142
      fi
 
143
 
 
144
      if test "$nls_cv_use_gnu_gettext" = "yes"; then
 
145
        dnl Mark actions used to generate GNU NLS library.
 
146
        INTLOBJS="\$(GETTOBJS)"
 
147
        AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
 
148
          [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
 
149
        AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
 
150
        AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
 
151
          [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
 
152
        AC_SUBST(MSGFMT)
 
153
        USE_INCLUDED_LIBINTL=yes
 
154
        CATOBJEXT=.gmo
 
155
        INSTOBJEXT=.mo
 
156
        DATADIRNAME=share
 
157
        INTLDEPS='$(top_builddir)/intl/libintl.a'
 
158
        INTLLIBS=$INTLDEPS
 
159
        LIBS=`echo $LIBS | sed -e 's/-lintl//'`
 
160
        nls_cv_header_intl=intl/libintl.h
 
161
        nls_cv_header_libgt=intl/libgettext.h
 
162
      fi
 
163
 
 
164
      dnl Test whether we really found GNU xgettext.
 
165
      if test "$XGETTEXT" != ":"; then
 
166
        dnl If it is no GNU xgettext we define it as : so that the
 
167
        dnl Makefiles still can work.
 
168
        if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
 
169
          : ;
 
170
        else
 
171
          AC_MSG_RESULT(
 
172
            [found xgettext program is not GNU xgettext; ignore it])
 
173
          XGETTEXT=":"
 
174
        fi
 
175
      fi
 
176
 
 
177
      # We need to process the po/ directory.
 
178
      POSUB=po
 
179
    else
 
180
      DATADIRNAME=share
 
181
      nls_cv_header_intl=intl/libintl.h
 
182
      nls_cv_header_libgt=intl/libgettext.h
 
183
    fi
 
184
    AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl)
 
185
    AC_OUTPUT_COMMANDS(
 
186
     [case "$CONFIG_FILES" in *po/Makefile.in*)
 
187
        sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
 
188
      esac])
 
189
 
 
190
 
 
191
    # If this is used in GNU gettext we have to set USE_NLS to `yes'
 
192
    # because some of the sources are only built for this goal.
 
193
    if test "$PACKAGE" = gettext; then
 
194
      USE_NLS=yes
 
195
      USE_INCLUDED_LIBINTL=yes
 
196
    fi
 
197
 
 
198
    dnl These rules are solely for the distribution goal.  While doing this
 
199
    dnl we only have to keep exactly one list of the available catalogs
 
200
    dnl in configure.in.
 
201
    for lang in $ALL_LINGUAS; do
 
202
      GMOFILES="$GMOFILES $lang.gmo"
 
203
      POFILES="$POFILES $lang.po"
 
204
    done
 
205
 
 
206
    dnl Make all variables we use known to autoconf.
 
207
    AC_SUBST(USE_INCLUDED_LIBINTL)
 
208
    AC_SUBST(CATALOGS)
 
209
    AC_SUBST(CATOBJEXT)
 
210
    AC_SUBST(DATADIRNAME)
 
211
    AC_SUBST(GMOFILES)
 
212
    AC_SUBST(INSTOBJEXT)
 
213
    AC_SUBST(INTLDEPS)
 
214
    AC_SUBST(INTLLIBS)
 
215
    AC_SUBST(INTLOBJS)
 
216
    AC_SUBST(POFILES)
 
217
    AC_SUBST(POSUB)
 
218
  ])
 
219
 
 
220
AC_DEFUN(AM_GNU_GETTEXT,
 
221
  [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
 
222
   AC_REQUIRE([AC_PROG_CC])dnl
 
223
   AC_REQUIRE([AC_PROG_RANLIB])dnl
 
224
   AC_REQUIRE([AC_ISC_POSIX])dnl
 
225
   AC_REQUIRE([AC_HEADER_STDC])dnl
 
226
   AC_REQUIRE([AC_C_CONST])dnl
 
227
   AC_REQUIRE([AC_C_INLINE])dnl
 
228
   AC_REQUIRE([AC_TYPE_OFF_T])dnl
 
229
   AC_REQUIRE([AC_TYPE_SIZE_T])dnl
 
230
   AC_REQUIRE([AC_FUNC_ALLOCA])dnl
 
231
   AC_REQUIRE([AC_FUNC_MMAP])dnl
 
232
 
 
233
   AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
 
234
unistd.h sys/param.h])
 
235
   AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
 
236
strdup __argz_count __argz_stringify __argz_next])
 
237
 
 
238
   if test "${ac_cv_func_stpcpy+set}" != "set"; then
 
239
     AC_CHECK_FUNCS(stpcpy)
 
240
   fi
 
241
   if test "${ac_cv_func_stpcpy}" = "yes"; then
 
242
     AC_DEFINE(HAVE_STPCPY)
 
243
   fi
 
244
 
 
245
   AM_LC_MESSAGES
 
246
   AM_WITH_NLS
 
247
 
 
248
   if test "x$CATOBJEXT" != "x"; then
 
249
     if test "x$ALL_LINGUAS" = "x"; then
 
250
       LINGUAS=
 
251
     else
 
252
       AC_MSG_CHECKING(for catalogs to be installed)
 
253
       NEW_LINGUAS=
 
254
       for lang in ${LINGUAS=$ALL_LINGUAS}; do
 
255
         case "$ALL_LINGUAS" in
 
256
          *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
 
257
         esac
 
258
       done
 
259
       LINGUAS=$NEW_LINGUAS
 
260
       AC_MSG_RESULT($LINGUAS)
 
261
     fi
 
262
 
 
263
     dnl Construct list of names of catalog files to be constructed.
 
264
     if test -n "$LINGUAS"; then
 
265
       for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
 
266
     fi
 
267
   fi
 
268
 
 
269
   dnl The reference to <locale.h> in the installed <libintl.h> file
 
270
   dnl must be resolved because we cannot expect the users of this
 
271
   dnl to define HAVE_LOCALE_H.
 
272
   if test $ac_cv_header_locale_h = yes; then
 
273
     INCLUDE_LOCALE_H="#include <locale.h>"
 
274
   else
 
275
     INCLUDE_LOCALE_H="\
 
276
/* The system does not provide the header <locale.h>.  Take care yourself.  */"
 
277
   fi
 
278
   AC_SUBST(INCLUDE_LOCALE_H)
 
279
 
 
280
   dnl Determine which catalog format we have (if any is needed)
 
281
   dnl For now we know about two different formats:
 
282
   dnl   Linux libc-5 and the normal X/Open format
 
283
   test -d intl || mkdir intl
 
284
   if test "$CATOBJEXT" = ".cat"; then
 
285
     AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
 
286
 
 
287
     dnl Transform the SED scripts while copying because some dumb SEDs
 
288
     dnl cannot handle comments.
 
289
     sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed
 
290
   fi
 
291
   dnl po2tbl.sed is always needed.
 
292
   sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
 
293
     $srcdir/intl/po2tbl.sed.in > intl/po2tbl.sed
 
294
 
 
295
   dnl In the intl/Makefile.in we have a special dependency which makes
 
296
   dnl only sense for gettext.  We comment this out for non-gettext
 
297
   dnl packages.
 
298
   if test "$PACKAGE" = "gettext"; then
 
299
     GT_NO="#NO#"
 
300
     GT_YES=
 
301
   else
 
302
     GT_NO=
 
303
     GT_YES="#YES#"
 
304
   fi
 
305
   AC_SUBST(GT_NO)
 
306
   AC_SUBST(GT_YES)
 
307
 
 
308
   dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
 
309
   dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
 
310
   dnl Try to locate is.
 
311
   MKINSTALLDIRS=
 
312
   if test -n "$ac_aux_dir"; then
 
313
     MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
 
314
   fi
 
315
   if test -z "$MKINSTALLDIRS"; then
 
316
     MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
 
317
   fi
 
318
   AC_SUBST(MKINSTALLDIRS)
 
319
 
 
320
   dnl *** For now the libtool support in intl/Makefile is not for real.
 
321
   l=
 
322
   AC_SUBST(l)
 
323
 
 
324
   dnl Generate list of files to be processed by xgettext which will
 
325
   dnl be included in po/Makefile.
 
326
   test -d po || mkdir po
 
327
   if test "x$srcdir" != "x."; then
 
328
     if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
 
329
       posrcprefix="$srcdir/"
 
330
     else
 
331
       posrcprefix="../$srcdir/"
 
332
     fi
 
333
   else
 
334
     posrcprefix="../"
 
335
   fi
 
336
   rm -f po/POTFILES
 
337
   sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
 
338
        < $srcdir/po/POTFILES.in > po/POTFILES
 
339
  ])
 
340
 
 
341
# Search path for a program which passes the given test.
 
342
# Ulrich Drepper <drepper@cygnus.com>, 1996.
 
343
#
 
344
# This file can be copied and used freely without restrictions.  It can
 
345
# be used in projects which are not available under the GNU Public License
 
346
# but which still want to provide support for the GNU gettext functionality.
 
347
# Please note that the actual code is *not* freely available.
 
348
 
 
349
# serial 1
 
350
 
 
351
dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
 
352
dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
 
353
AC_DEFUN(AM_PATH_PROG_WITH_TEST,
 
354
[# Extract the first word of "$2", so it can be a program name with args.
 
355
set dummy $2; ac_word=[$]2
 
356
AC_MSG_CHECKING([for $ac_word])
 
357
AC_CACHE_VAL(ac_cv_path_$1,
 
358
[case "[$]$1" in
 
359
  /*)
 
360
  ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
 
361
  ;;
 
362
  *)
 
363
  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
 
364
  for ac_dir in ifelse([$5], , $PATH, [$5]); do
 
365
    test -z "$ac_dir" && ac_dir=.
 
366
    if test -f $ac_dir/$ac_word; then
 
367
      if [$3]; then
 
368
        ac_cv_path_$1="$ac_dir/$ac_word"
 
369
        break
 
370
      fi
 
371
    fi
 
372
  done
 
373
  IFS="$ac_save_ifs"
 
374
dnl If no 4th arg is given, leave the cache variable unset,
 
375
dnl so AC_PATH_PROGS will keep looking.
 
376
ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
 
377
])dnl
 
378
  ;;
 
379
esac])dnl
 
380
$1="$ac_cv_path_$1"
 
381
if test -n "[$]$1"; then
 
382
  AC_MSG_RESULT([$]$1)
 
383
else
 
384
  AC_MSG_RESULT(no)
 
385
fi
 
386
AC_SUBST($1)dnl
 
387
])
 
388
 
 
389
# Check whether LC_MESSAGES is available in <locale.h>.
 
390
# Ulrich Drepper <drepper@cygnus.com>, 1995.
 
391
#
 
392
# This file can be copied and used freely without restrictions.  It can
 
393
# be used in projects which are not available under the GNU Public License
 
394
# but which still want to provide support for the GNU gettext functionality.
 
395
# Please note that the actual code is *not* freely available.
 
396
 
 
397
# serial 1
 
398
 
 
399
AC_DEFUN(AM_LC_MESSAGES,
 
400
  [if test $ac_cv_header_locale_h = yes; then
 
401
    AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
 
402
      [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
 
403
       am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
 
404
    if test $am_cv_val_LC_MESSAGES = yes; then
 
405
      AC_DEFINE(HAVE_LC_MESSAGES)
 
406
    fi
 
407
  fi])
 
408
 
 
409
# Like AC_CONFIG_HEADER, but automatically create stamp file.
 
410
 
 
411
AC_DEFUN(AM_CONFIG_HEADER,
 
412
[AC_PREREQ([2.12])
 
413
AC_CONFIG_HEADER([$1])
 
414
dnl When config.status generates a header, we must update the stamp-h file.
 
415
dnl This file resides in the same directory as the config header
 
416
dnl that is generated.  We must strip everything past the first ":",
 
417
dnl and everything past the last "/".
 
418
AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
 
419
ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
 
420
<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
 
421
<<am_indx=1
 
422
for am_file in <<$1>>; do
 
423
  case " <<$>>CONFIG_HEADERS " in
 
424
  *" <<$>>am_file "*<<)>>
 
425
    echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
 
426
    ;;
 
427
  esac
 
428
  am_indx=`expr "<<$>>am_indx" + 1`
 
429
done<<>>dnl>>)
 
430
changequote([,]))])
 
431
 
 
432
# Do all the work for Automake.  This macro actually does too much --
 
433
# some checks are only needed if your package does certain things.
 
434
# But this isn't really a big deal.
 
435
 
 
436
# serial 1
 
437
 
 
438
dnl Usage:
 
439
dnl AM_INIT_AUTOMAKE(package,version, [no-define])
 
440
 
 
441
AC_DEFUN(AM_INIT_AUTOMAKE,
 
442
[AC_REQUIRE([AC_PROG_INSTALL])
 
443
PACKAGE=[$1]
 
444
AC_SUBST(PACKAGE)
 
445
VERSION=[$2]
 
446
AC_SUBST(VERSION)
 
447
dnl test to see if srcdir already configured
 
448
if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
 
449
  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
 
450
fi
 
451
ifelse([$3],,
 
452
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
 
453
AC_DEFINE_UNQUOTED(VERSION, "$VERSION"))
 
454
AC_REQUIRE([AM_SANITY_CHECK])
 
455
AC_REQUIRE([AC_ARG_PROGRAM])
 
456
dnl FIXME This is truly gross.
 
457
missing_dir=`cd $ac_aux_dir && pwd`
 
458
AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
 
459
AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
 
460
AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
 
461
AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
 
462
AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
 
463
AC_REQUIRE([AC_PROG_MAKE_SET])])
 
464
 
 
465
 
 
466
# serial 1
 
467
 
 
468
AC_DEFUN(AM_PROG_INSTALL,
 
469
[AC_REQUIRE([AC_PROG_INSTALL])
 
470
test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
 
471
AC_SUBST(INSTALL_SCRIPT)dnl
 
472
])
 
473
 
 
474
#
 
475
# Check to make sure that the build environment is sane.
 
476
#
 
477
 
 
478
AC_DEFUN(AM_SANITY_CHECK,
 
479
[AC_MSG_CHECKING([whether build environment is sane])
 
480
# Just in case
 
481
sleep 1
 
482
echo timestamp > conftestfile
 
483
# Do `set' in a subshell so we don't clobber the current shell's
 
484
# arguments.  Must try -L first in case configure is actually a
 
485
# symlink; some systems play weird games with the mod time of symlinks
 
486
# (eg FreeBSD returns the mod time of the symlink's containing
 
487
# directory).
 
488
if (
 
489
   set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
 
490
   if test "[$]*" = "X"; then
 
491
      # -L didn't work.
 
492
      set X `ls -t $srcdir/configure conftestfile`
 
493
   fi
 
494
   if test "[$]*" != "X $srcdir/configure conftestfile" \
 
495
      && test "[$]*" != "X conftestfile $srcdir/configure"; then
 
496
 
 
497
      # If neither matched, then we have a broken ls.  This can happen
 
498
      # if, for instance, CONFIG_SHELL is bash and it inherits a
 
499
      # broken ls alias from the environment.  This has actually
 
500
      # happened.  Such a system could not be considered "sane".
 
501
      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
 
502
alias in your environment])
 
503
   fi
 
504
 
 
505
   test "[$]2" = conftestfile
 
506
   )
 
507
then
 
508
   # Ok.
 
509
   :
 
510
else
 
511
   AC_MSG_ERROR([newly created file is older than distributed files!
 
512
Check your system clock])
 
513
fi
 
514
rm -f conftest*
 
515
AC_MSG_RESULT(yes)])
 
516
 
 
517
dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
 
518
dnl The program must properly implement --version.
 
519
AC_DEFUN(AM_MISSING_PROG,
 
520
[AC_MSG_CHECKING(for working $2)
 
521
# Run test in a subshell; some versions of sh will print an error if
 
522
# an executable is not found, even if stderr is redirected.
 
523
# Redirect stdin to placate older versions of autoconf.  Sigh.
 
524
if ($2 --version) < /dev/null > /dev/null 2>&1; then
 
525
   $1=$2
 
526
   AC_MSG_RESULT(found)
 
527
else
 
528
   $1="$3/missing $2"
 
529
   AC_MSG_RESULT(missing)
 
530
fi
 
531
AC_SUBST($1)])
 
532
 
 
533
 
 
534
# serial 25 AM_PROG_LIBTOOL
 
535
AC_DEFUN(AM_PROG_LIBTOOL,
 
536
[AC_REQUIRE([AM_ENABLE_SHARED])dnl
 
537
AC_REQUIRE([AM_ENABLE_STATIC])dnl
 
538
AC_REQUIRE([AC_CANONICAL_HOST])dnl
 
539
AC_REQUIRE([AC_PROG_RANLIB])dnl
 
540
AC_REQUIRE([AC_PROG_CC])dnl
 
541
AC_REQUIRE([AM_PROG_LD])dnl
 
542
AC_REQUIRE([AM_PROG_NM])dnl
 
543
AC_REQUIRE([AC_PROG_LN_S])dnl
 
544
dnl
 
545
# Always use our own libtool.
 
546
LIBTOOL='$(SHELL) $(top_builddir)/libtool'
 
547
AC_SUBST(LIBTOOL)dnl
 
548
 
 
549
# Check for any special flags to pass to ltconfig.
 
550
libtool_flags=
 
551
test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
 
552
test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
 
553
test "$silent" = yes && libtool_flags="$libtool_flags --silent"
 
554
test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
 
555
test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
 
556
 
 
557
# Some flags need to be propagated to the compiler or linker for good
 
558
# libtool support.
 
559
case "$host" in
 
560
*-*-irix6*)
 
561
  # Find out which ABI we are using.
 
562
  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
 
563
  if AC_TRY_EVAL(ac_compile); then
 
564
    case "`/usr/bin/file conftest.o`" in
 
565
    *32-bit*)
 
566
      LD="${LD-ld} -32"
 
567
      ;;
 
568
    *N32*)
 
569
      LD="${LD-ld} -n32"
 
570
      ;;
 
571
    *64-bit*)
 
572
      LD="${LD-ld} -64"
 
573
      ;;
 
574
    esac
 
575
  fi
 
576
  rm -rf conftest*
 
577
  ;;
 
578
 
 
579
*-*-sco3.2v5*)
 
580
  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
 
581
  CFLAGS="$CFLAGS -belf"
 
582
  ;;
 
583
esac
 
584
 
 
585
# Actually configure libtool.  ac_aux_dir is where install-sh is found.
 
586
CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
 
587
LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
 
588
${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
 
589
$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
 
590
|| AC_MSG_ERROR([libtool configure failed])
 
591
 
 
592
# Redirect the config.log output again, so that the ltconfig log is not
 
593
# clobbered by the next message.
 
594
exec 5>>./config.log
 
595
])
 
596
 
 
597
# AM_ENABLE_SHARED - implement the --enable-shared flag
 
598
# Usage: AM_ENABLE_SHARED[(DEFAULT)]
 
599
#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
 
600
#   `yes'.
 
601
AC_DEFUN(AM_ENABLE_SHARED,
 
602
[define([AM_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
 
603
AC_ARG_ENABLE(shared,
 
604
changequote(<<, >>)dnl
 
605
<<  --enable-shared[=PKGS]  build shared libraries [default=>>AM_ENABLE_SHARED_DEFAULT],
 
606
changequote([, ])dnl
 
607
[p=${PACKAGE-default}
 
608
case "$enableval" in
 
609
yes) enable_shared=yes ;;
 
610
no) enable_shared=no ;;
 
611
*)
 
612
  enable_shared=no
 
613
  # Look at the argument we got.  We use all the common list separators.
 
614
  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
 
615
  for pkg in $enableval; do
 
616
    if test "X$pkg" = "X$p"; then
 
617
      enable_shared=yes
 
618
    fi
 
619
  done
 
620
  IFS="$ac_save_ifs"
 
621
  ;;
 
622
esac],
 
623
enable_shared=AM_ENABLE_SHARED_DEFAULT)dnl
 
624
])
 
625
 
 
626
# AM_DISABLE_SHARED - set the default shared flag to --disable-shared
 
627
AC_DEFUN(AM_DISABLE_SHARED,
 
628
[AM_ENABLE_SHARED(no)])
 
629
 
 
630
# AM_DISABLE_STATIC - set the default static flag to --disable-static
 
631
AC_DEFUN(AM_DISABLE_STATIC,
 
632
[AM_ENABLE_STATIC(no)])
 
633
 
 
634
# AM_ENABLE_STATIC - implement the --enable-static flag
 
635
# Usage: AM_ENABLE_STATIC[(DEFAULT)]
 
636
#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
 
637
#   `yes'.
 
638
AC_DEFUN(AM_ENABLE_STATIC,
 
639
[define([AM_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
 
640
AC_ARG_ENABLE(static,
 
641
changequote(<<, >>)dnl
 
642
<<  --enable-static[=PKGS]  build static libraries [default=>>AM_ENABLE_STATIC_DEFAULT],
 
643
changequote([, ])dnl
 
644
[p=${PACKAGE-default}
 
645
case "$enableval" in
 
646
yes) enable_static=yes ;;
 
647
no) enable_static=no ;;
 
648
*)
 
649
  enable_static=no
 
650
  # Look at the argument we got.  We use all the common list separators.
 
651
  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
 
652
  for pkg in $enableval; do
 
653
    if test "X$pkg" = "X$p"; then
 
654
      enable_static=yes
 
655
    fi
 
656
  done
 
657
  IFS="$ac_save_ifs"
 
658
  ;;
 
659
esac],
 
660
enable_static=AM_ENABLE_STATIC_DEFAULT)dnl
 
661
])
 
662
 
 
663
 
 
664
# AM_PROG_LD - find the path to the GNU or non-GNU linker
 
665
AC_DEFUN(AM_PROG_LD,
 
666
[AC_ARG_WITH(gnu-ld,
 
667
[  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
 
668
test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
 
669
AC_REQUIRE([AC_PROG_CC])
 
670
ac_prog=ld
 
671
if test "$ac_cv_prog_gcc" = yes; then
 
672
  # Check if gcc -print-prog-name=ld gives a path.
 
673
  AC_MSG_CHECKING([for ld used by GCC])
 
674
  ac_prog=`($CC -print-prog-name=ld) 2>&5`
 
675
  case "$ac_prog" in
 
676
  # Accept absolute paths.
 
677
changequote(,)dnl
 
678
  /* | [A-Za-z]:[\\/]*)
 
679
changequote([,])dnl
 
680
    test -z "$LD" && LD="$ac_prog"
 
681
    ;;
 
682
  "")
 
683
    # If it fails, then pretend we aren't using GCC.
 
684
    ac_prog=ld
 
685
    ;;
 
686
  *)
 
687
    # If it is relative, then search for the first ld in PATH.
 
688
    with_gnu_ld=unknown
 
689
    ;;
 
690
  esac
 
691
elif test "$with_gnu_ld" = yes; then
 
692
  AC_MSG_CHECKING([for GNU ld])
 
693
else
 
694
  AC_MSG_CHECKING([for non-GNU ld])
 
695
fi
 
696
AC_CACHE_VAL(ac_cv_path_LD,
 
697
[if test -z "$LD"; then
 
698
  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
 
699
  for ac_dir in $PATH; do
 
700
    test -z "$ac_dir" && ac_dir=.
 
701
    if test -f "$ac_dir/$ac_prog"; then
 
702
      ac_cv_path_LD="$ac_dir/$ac_prog"
 
703
      # Check to see if the program is GNU ld.  I'd rather use --version,
 
704
      # but apparently some GNU ld's only accept -v.
 
705
      # Break only if it was the GNU/non-GNU ld that we prefer.
 
706
      if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
 
707
        test "$with_gnu_ld" != no && break
 
708
      else
 
709
        test "$with_gnu_ld" != yes && break
 
710
      fi
 
711
    fi
 
712
  done
 
713
  IFS="$ac_save_ifs"
 
714
else
 
715
  ac_cv_path_LD="$LD" # Let the user override the test with a path.
 
716
fi])
 
717
LD="$ac_cv_path_LD"
 
718
if test -n "$LD"; then
 
719
  AC_MSG_RESULT($LD)
 
720
else
 
721
  AC_MSG_RESULT(no)
 
722
fi
 
723
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
 
724
AC_SUBST(LD)
 
725
AM_PROG_LD_GNU
 
726
])
 
727
 
 
728
AC_DEFUN(AM_PROG_LD_GNU,
 
729
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
 
730
[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
 
731
if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
 
732
  ac_cv_prog_gnu_ld=yes
 
733
else
 
734
  ac_cv_prog_gnu_ld=no
 
735
fi])
 
736
])
 
737
 
 
738
# AM_PROG_NM - find the path to a BSD-compatible name lister
 
739
AC_DEFUN(AM_PROG_NM,
 
740
[AC_MSG_CHECKING([for BSD-compatible nm])
 
741
AC_CACHE_VAL(ac_cv_path_NM,
 
742
[if test -n "$NM"; then
 
743
  # Let the user override the test.
 
744
  ac_cv_path_NM="$NM"
 
745
else
 
746
  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
 
747
  for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
 
748
    test -z "$ac_dir" && ac_dir=.
 
749
    if test -f $ac_dir/nm; then
 
750
      # Check to see if the nm accepts a BSD-compat flag.
 
751
      # Adding the `sed 1q' prevents false positives on HP-UX, which says:
 
752
      #   nm: unknown option "B" ignored
 
753
      if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
 
754
        ac_cv_path_NM="$ac_dir/nm -B"
 
755
      elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
 
756
        ac_cv_path_NM="$ac_dir/nm -p"
 
757
      else
 
758
        ac_cv_path_NM="$ac_dir/nm"
 
759
      fi
 
760
      break
 
761
    fi
 
762
  done
 
763
  IFS="$ac_save_ifs"
 
764
  test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
 
765
fi])
 
766
NM="$ac_cv_path_NM"
 
767
AC_MSG_RESULT([$NM])
 
768
AC_SUBST(NM)
 
769
])
 
770
 
 
771
 
 
772
# Define a conditional.
 
773
 
 
774
AC_DEFUN(AM_CONDITIONAL,
 
775
[AC_SUBST($1_TRUE)
 
776
AC_SUBST($1_FALSE)
 
777
if $2; then
 
778
  $1_TRUE=
 
779
  $1_FALSE='#'
 
780
else
 
781
  $1_TRUE='#'
 
782
  $1_FALSE=
 
783
fi])
 
784