~ubuntu-branches/ubuntu/natty/ntop/natty

« back to all changes in this revision

Viewing changes to acinclude.m4

  • Committer: Bazaar Package Importer
  • Author(s): Ola Lundqvist
  • Date: 2005-01-30 21:59:13 UTC
  • mfrom: (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20050130215913-xc3ke963bw49b3k4
Tags: 2:3.0-5
* Updated README.Debian file so users will understand what to do at
  install, closes: #291794, #287802.
* Updated ntop init script to give better output.
* Also changed log directory from /var/lib/ntop to /var/log/ntop,
  closes: #252352.
* Quoted the interface list to allow whitespace, closes: #267248.
* Added a couple of logcheck ignores, closes: #269321, #269319.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#
 
2
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 
3
# local automake definitions for ntop
 
4
## (this file is processed with 'automake' to produce Makefile.in)
 
5
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 
6
#
 
7
# Copyright (c) 1998-2003 Luca Deri <deri@ntop.org>
 
8
# Updated 1Q 2000 Rocco Carbone <rocco@ntop.org>
 
9
# Rewrite 1Q 2003 Burton M. Strauss III <burton@ntopsupport.com>
 
10
#
 
11
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 
12
#
 
13
# This program is free software; you can redistribute it and/or modify
 
14
# it under the terms of the GNU General Public License as published by
 
15
# the Free Software Foundation; either version 2 of the License, or
 
16
# (at your option) any later version.
 
17
#
 
18
# This program is distributed in the hope that it will be useful,
 
19
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
20
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
21
# GNU General Public License for more details.
 
22
#
 
23
# You should have received a copy of the GNU General Public License
 
24
# along with this program; if not, write to the Free Software
 
25
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
26
#
 
27
 
 
28
dnl>
 
29
dnl>  Check for an ANSI C typedef in a header
 
30
dnl>
 
31
dnl>  configure.in:
 
32
dnl>    AC_CHECK_TYPEDEF(<typedef>, <header>)
 
33
dnl>  acconfig.h:
 
34
dnl>    #undef HAVE_<typedef>
 
35
dnl>
 
36
 
 
37
AC_DEFUN([AC_CHECK_TYPEDEF],[dnl
 
38
AC_REQUIRE([AC_HEADER_STDC])dnl
 
39
AC_MSG_CHECKING(for typedef $1)
 
40
AC_CACHE_VAL(ac_cv_typedef_$1,
 
41
[AC_EGREP_CPP(dnl
 
42
changequote(<<,>>)dnl
 
43
<<(^|[^a-zA-Z_0-9])$1[^a-zA-Z_0-9]>>dnl
 
44
changequote([,]), [
 
45
#include <$2>
 
46
], ac_cv_typedef_$1=yes, ac_cv_typedef_$1=no)])dnl
 
47
AC_MSG_RESULT($ac_cv_typedef_$1)
 
48
if test $ac_cv_typedef_$1 = yes; then
 
49
    AC_DEFINE(HAVE_[]translit($1, [a-z], [A-Z]))
 
50
fi
 
51
])
 
52
 
 
53
dnl>
 
54
dnl>  Appends values to $CPPFLAGS, $LDFLAGS and $LIBS
 
55
dnl>         Also: Allows us to automate for those OSes which DO NOT check subdirectories.
 
56
dnl>               Allows us to strip dups.
 
57
dnl>
 
58
 
 
59
# NTOP_APPENDS(Ivalue, Lvalue, lvalue)
 
60
# ----------------------------------------------
 
61
AC_DEFUN([NTOP_APPENDS],
 
62
[dnl
 
63
# Expansion of NTOP_APPENDS($1, $2, $3)
 
64
    if test ".$1" != "."; then
 
65
        rc=`(echo $CPPFLAGS | grep '$1 ' > /dev/null 2> /dev/null; echo $?)`
 
66
        if [[ $rc -eq 1 ]]; then
 
67
           CPPFLAGS="$CPPFLAGS -I$1"
 
68
        fi
 
69
        rc=`(echo $INCS | grep '$1' > /dev/null 2> /dev/null; echo $?)`
 
70
        if [[ $rc -eq 1 ]]; then
 
71
            INCS="$INCS -I$1"
 
72
        fi
 
73
    fi
 
74
    if test ".$2" != "."; then
 
75
        rc=`(echo $LDFLAGS | grep '$2 ' > /dev/null 2> /dev/null; echo $?)`
 
76
        if [[ $rc -eq 1 ]]; then
 
77
            case "${DEFINEOS}" in
 
78
              DARWIN )
 
79
                LDFLAGS="$LDFLAGS -L$2 -L$2/lib"
 
80
                ;;
 
81
              * )
 
82
                LDFLAGS="$LDFLAGS -L$2"
 
83
                ;;
 
84
            esac
 
85
        fi
 
86
    fi
 
87
    if test ".$3" != "."; then
 
88
        rc=`(echo $LIBS | grep '\-l$3 ' > /dev/null 2> /dev/null; echo $?)`
 
89
        if [[ $rc -eq 1 ]]; then
 
90
            LIBS="$LIBS -l$3"
 
91
        fi
 
92
    fi
 
93
# Finished expansion of NTOP_APPENDS()
 
94
])
 
95
 
 
96
dnl>
 
97
dnl>  Report location
 
98
dnl>
 
99
 
 
100
# NTOP_RPT_LOC(item, lib, include)
 
101
# ----------------------------------------------
 
102
AC_DEFUN([NTOP_RPT_LOC],
 
103
[dnl
 
104
# Expansion of NTOP_RPT_LOC($1 $2 $3)
 
105
if test ".$3" = "."; then
 
106
    echo "$1 .h             : standard system headers"
 
107
else
 
108
    echo "$1 .h             : $3"
 
109
fi
 
110
if test ".$2" = "."; then
 
111
    echo "$1 library        : standard system libraries"
 
112
else
 
113
    echo "$1 library        : $2"
 
114
fi
 
115
# Finished expansion of NTOP_RPT_LOC()
 
116
])
 
117
 
 
118
# NTOP_SET_LIBINC(item)
 
119
# ----------------------------------------------
 
120
AC_DEFUN([NTOP_SET_LIBINC],
 
121
[dnl
 
122
# Expansion of NTOP_SET_LIBINC($1)
 
123
if test ".${$1_DIRECTORY}" != "."; then
 
124
    if test ".${$1_LIB}" = "."; then
 
125
        if test -d ${$1_DIRECTORY}/lib; then
 
126
            $1_LIB="${$1_DIRECTORY}/lib"
 
127
        else
 
128
            $1_LIB="${$1_DIRECTORY}"
 
129
        fi
 
130
    fi
 
131
    if test ".${$1_INCLUDE}" = "."; then
 
132
        if test -d ${$1_DIRECTORY}/include; then
 
133
            $1_INCLUDE="${$1_DIRECTORY}/include"
 
134
        else
 
135
            $1_INCLUDE="${$1_DIRECTORY}"
 
136
        fi
 
137
    fi
 
138
fi
 
139
# Finished expansion of NTOP_SET_LIBINC()
 
140
])
 
141
 
 
142
# NTOP_SUGGESTION(item, version)
 
143
# ----------------------------------------------
 
144
AC_DEFUN([NTOP_SUGGESTION],
 
145
[dnl
 
146
# Expansion of NTOP_SUGGESTION($1, $2, $3)
 
147
    echo "*???    Suggestion - Install a private copy of $1 $2."
 
148
    echo "*???                 It's quite easy and does NOT require root:"
 
149
    echo "*"
 
150
    echo "*   Download $1 $2 from gnu"
 
151
    echo "*     \$ wget http://ftp.gnu.org/gnu/$1/$1-$2.tar.gz"
 
152
    echo "*"
 
153
    echo "*   Untar it"
 
154
    echo "*     \$ tar xfvz $1-$2.tar.gz"
 
155
    echo "*"
 
156
    echo "*   Make it"
 
157
    echo "*     \$ cd $1-$2"
 
158
    echo "*     \$ ./configure --prefix=/home/<whatever>/$1$3"
 
159
    echo "*     \$ make"
 
160
    echo "*     \$ make install"
 
161
    echo "*"
 
162
    echo "*   Add it to your path.  Under bash do this:"
 
163
    echo "*     \$ PATH=/home/<whatever>/$1$3/bin:\$PATH"
 
164
    echo "*     \$ export PATH"
 
165
    echo "*"
 
166
# Finished expansion of NTOP_SUGGESTION()
 
167
])
 
168
 
 
169
# NTOPCONFIGDEBUG_SETTINGS(where)
 
170
# ----------------------------------------------
 
171
AC_DEFUN([NTOPCONFIGDEBUG_SETTINGS],
 
172
[dnl
 
173
# Expansion of NTOPCONFIGDEBUG_SETTINGS()
 
174
if test ".${NTOPCONFIGDEBUG}" = ".yes"; then
 
175
    echo "DEBUG: $1"
 
176
    echo "       AWK.................'${AWK}'"
 
177
    echo "       AS..................'${AS}'"
 
178
    echo "       ACLOCAL.............'${ACLOCAL}'"
 
179
    echo "       AUTOCONF............'${AUTOCONF}'"
 
180
    echo "       AUTOHEADER..........'${AUTOHEADER}'"
 
181
    echo "       AUTOMAKE............'${AUTOMAKE}'"
 
182
    echo "       CC..................'${CC}'"
 
183
    echo "          gcc?.............'${GCC}'"
 
184
    echo "       CCLD................'${CCLD}'"
 
185
    echo "       CFLAGS..............'${CFLAGS}'"
 
186
    echo "       CPP.................'${CPP}'"
 
187
    echo "       CPPFLAGS............'${CPPFLAGS}'"
 
188
    echo "       DEFS................'${DEFS}'"
 
189
    echo "       DEPDIR..............'${DEPDIR}'"
 
190
    echo "       DLLTOOL.............'${DLLTOOL}'"
 
191
    echo "       DYN_FLAGS...........'${DYNFLAGS}'"
 
192
    echo "       EXEEXT..............'${EXEEXT}'"
 
193
    echo "       INCS................'${INCS}'"
 
194
    echo "       LDFLAGS.............'${LDFLAGS}'"
 
195
    echo "       LIBS................'${LIBS}'"
 
196
    echo "       LN_S................'${LN_S}'"
 
197
    echo "       MYRRD...............'${MYRRD}'"
 
198
    echo "       OBJDUMP.............'${OBJDUMP}'"
 
199
    echo "       OBJEXT..............'${OBJEXT}'"
 
200
    echo "       RANLIB..............'${RANLIB}'"
 
201
    echo "       SO_VERSION_PATCH....'${SO_VERSION_PATCH}'"
 
202
    echo "       build...............'${build}'"
 
203
    echo "       host................'${host}'"
 
204
    echo "       target..............'${target}'"
 
205
fi
 
206
# Finished expansion of NTOPCONFIGDEBUG_SETTINGS()
 
207
])
 
208
## libtool.m4 - Configure libtool for the target system. -*-Shell-script-*-
 
209
## Copyright (C) 1996-1999 Free Software Foundation, Inc.
 
210
## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
 
211
##
 
212
## This program is free software; you can redistribute it and/or modify
 
213
## it under the terms of the GNU General Public License as published by
 
214
## the Free Software Foundation; either version 2 of the License, or
 
215
## (at your option) any later version.
 
216
##
 
217
## This program is distributed in the hope that it will be useful, but
 
218
## WITHOUT ANY WARRANTY; without even the implied warranty of
 
219
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
220
## General Public License for more details.
 
221
##
 
222
## You should have received a copy of the GNU General Public License
 
223
## along with this program; if not, write to the Free Software
 
224
## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
225
##
 
226
## As a special exception to the GNU General Public License, if you
 
227
## distribute this file as part of a program that contains a
 
228
## configuration script generated by Autoconf, you may include it under
 
229
## the same distribution terms that you use for the rest of that program.
 
230
 
 
231
## 1.4.2 modified by BMSIII - Mar2004 - to eliminate 1.5.2 whines about
 
232
## underquoted AC _ DEFUN 's 
 
233
 
 
234
# serial 40 AC_PROG_LIBTOOL
 
235
AC_DEFUN([AC_PROG_LIBTOOL],
 
236
[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
 
237
 
 
238
# Save cache, so that ltconfig can load it
 
239
AC_CACHE_SAVE
 
240
 
 
241
# Actually configure libtool.  ac_aux_dir is where install-sh is found.
 
242
CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
 
243
LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
 
244
LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
 
245
DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
 
246
${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
 
247
$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
 
248
|| AC_MSG_ERROR([libtool configure failed])
 
249
 
 
250
# Reload cache, that may have been modified by ltconfig
 
251
AC_CACHE_LOAD
 
252
 
 
253
# This can be used to rebuild libtool when needed
 
254
LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
 
255
 
 
256
# Always use our own libtool.
 
257
LIBTOOL='$(SHELL) $(top_builddir)/libtool'
 
258
AC_SUBST(LIBTOOL)dnl
 
259
 
 
260
# Redirect the config.log output again, so that the ltconfig log is not
 
261
# clobbered by the next message.
 
262
exec 5>>./config.log
 
263
])
 
264
 
 
265
AC_DEFUN([AC_LIBTOOL_SETUP],
 
266
[AC_PREREQ(2.13)dnl
 
267
AC_REQUIRE([AC_ENABLE_SHARED])dnl
 
268
AC_REQUIRE([AC_ENABLE_STATIC])dnl
 
269
AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
 
270
AC_REQUIRE([AC_CANONICAL_HOST])dnl
 
271
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
 
272
AC_REQUIRE([AC_PROG_RANLIB])dnl
 
273
AC_REQUIRE([AC_PROG_CC])dnl
 
274
AC_REQUIRE([AC_PROG_LD])dnl
 
275
AC_REQUIRE([AC_PROG_NM])dnl
 
276
AC_REQUIRE([AC_PROG_LN_S])dnl
 
277
dnl
 
278
 
 
279
# Check for any special flags to pass to ltconfig.
 
280
libtool_flags="--cache-file=$cache_file"
 
281
test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
 
282
test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
 
283
test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
 
284
test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
 
285
test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
 
286
ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
 
287
[libtool_flags="$libtool_flags --enable-dlopen"])
 
288
ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
 
289
[libtool_flags="$libtool_flags --enable-win32-dll"])
 
290
AC_ARG_ENABLE(libtool-lock,
 
291
  [  --disable-libtool-lock  avoid locking (might break parallel builds)])
 
292
test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
 
293
test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
 
294
 
 
295
# Some flags need to be propagated to the compiler or linker for good
 
296
# libtool support.
 
297
case "$host" in
 
298
*-*-irix6*)
 
299
  # Find out which ABI we are using.
 
300
  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
 
301
  if AC_TRY_EVAL(ac_compile); then
 
302
    case "`/usr/bin/file conftest.o`" in
 
303
    *32-bit*)
 
304
      LD="${LD-ld} -32"
 
305
      ;;
 
306
    *N32*)
 
307
      LD="${LD-ld} -n32"
 
308
      ;;
 
309
    *64-bit*)
 
310
      LD="${LD-ld} -64"
 
311
      ;;
 
312
    esac
 
313
  fi
 
314
  rm -rf conftest*
 
315
  ;;
 
316
 
 
317
*-*-sco3.2v5*)
 
318
  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
 
319
  SAVE_CFLAGS="$CFLAGS"
 
320
  CFLAGS="$CFLAGS -belf"
 
321
  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
 
322
    [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
 
323
  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
 
324
    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
 
325
    CFLAGS="$SAVE_CFLAGS"
 
326
  fi
 
327
  ;;
 
328
 
 
329
ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
 
330
[*-*-cygwin* | *-*-mingw*)
 
331
  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
 
332
  AC_CHECK_TOOL(AS, as, false)
 
333
  AC_CHECK_TOOL(OBJDUMP, objdump, false)
 
334
  ;;
 
335
])
 
336
esac
 
337
])
 
338
 
 
339
# AC_LIBTOOL_DLOPEN - enable checks for dlopen support
 
340
AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
 
341
 
 
342
# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
 
343
AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
 
344
 
 
345
# AC_ENABLE_SHARED - implement the --enable-shared flag
 
346
# Usage: AC_ENABLE_SHARED[(DEFAULT)]
 
347
#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
 
348
#   `yes'.
 
349
AC_DEFUN([AC_ENABLE_SHARED], [dnl
 
350
define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
 
351
AC_ARG_ENABLE(shared,
 
352
changequote(<<, >>)dnl
 
353
<<  --enable-shared[=PKGS]  build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
 
354
changequote([, ])dnl
 
355
[p=${PACKAGE-default}
 
356
case "$enableval" in
 
357
yes) enable_shared=yes ;;
 
358
no) enable_shared=no ;;
 
359
*)
 
360
  enable_shared=no
 
361
  # Look at the argument we got.  We use all the common list separators.
 
362
  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
 
363
  for pkg in $enableval; do
 
364
    if test "X$pkg" = "X$p"; then
 
365
      enable_shared=yes
 
366
    fi
 
367
  done
 
368
  IFS="$ac_save_ifs"
 
369
  ;;
 
370
esac],
 
371
enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
 
372
])
 
373
 
 
374
# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
 
375
AC_DEFUN([AC_DISABLE_SHARED], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
 
376
AC_ENABLE_SHARED(no)])
 
377
 
 
378
# AC_ENABLE_STATIC - implement the --enable-static flag
 
379
# Usage: AC_ENABLE_STATIC[(DEFAULT)]
 
380
#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
 
381
#   `yes'.
 
382
AC_DEFUN([AC_ENABLE_STATIC], [dnl
 
383
define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
 
384
AC_ARG_ENABLE(static,
 
385
changequote(<<, >>)dnl
 
386
<<  --enable-static[=PKGS]  build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
 
387
changequote([, ])dnl
 
388
[p=${PACKAGE-default}
 
389
case "$enableval" in
 
390
yes) enable_static=yes ;;
 
391
no) enable_static=no ;;
 
392
*)
 
393
  enable_static=no
 
394
  # Look at the argument we got.  We use all the common list separators.
 
395
  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
 
396
  for pkg in $enableval; do
 
397
    if test "X$pkg" = "X$p"; then
 
398
      enable_static=yes
 
399
    fi
 
400
  done
 
401
  IFS="$ac_save_ifs"
 
402
  ;;
 
403
esac],
 
404
enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
 
405
])
 
406
 
 
407
# AC_DISABLE_STATIC - set the default static flag to --disable-static
 
408
AC_DEFUN([AC_DISABLE_STATIC], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
 
409
AC_ENABLE_STATIC(no)])
 
410
 
 
411
 
 
412
# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
 
413
# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
 
414
#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
 
415
#   `yes'.
 
416
AC_DEFUN([AC_ENABLE_FAST_INSTALL], [dnl
 
417
define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
 
418
AC_ARG_ENABLE(fast-install,
 
419
changequote(<<, >>)dnl
 
420
<<  --enable-fast-install[=PKGS]  optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
 
421
changequote([, ])dnl
 
422
[p=${PACKAGE-default}
 
423
case "$enableval" in
 
424
yes) enable_fast_install=yes ;;
 
425
no) enable_fast_install=no ;;
 
426
*)
 
427
  enable_fast_install=no
 
428
  # Look at the argument we got.  We use all the common list separators.
 
429
  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
 
430
  for pkg in $enableval; do
 
431
    if test "X$pkg" = "X$p"; then
 
432
      enable_fast_install=yes
 
433
    fi
 
434
  done
 
435
  IFS="$ac_save_ifs"
 
436
  ;;
 
437
esac],
 
438
enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
 
439
])
 
440
 
 
441
# AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
 
442
AC_DEFUN([AC_DISABLE_FAST_INSTALL], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
 
443
AC_ENABLE_FAST_INSTALL(no)])
 
444
 
 
445
# AC_PROG_LD - find the path to the GNU or non-GNU linker
 
446
AC_DEFUN([AC_PROG_LD],
 
447
[AC_ARG_WITH(gnu-ld,
 
448
[  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
 
449
test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
 
450
AC_REQUIRE([AC_PROG_CC])dnl
 
451
AC_REQUIRE([AC_CANONICAL_HOST])dnl
 
452
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
 
453
ac_prog=ld
 
454
if test "$ac_cv_prog_gcc" = yes; then
 
455
  # Check if gcc -print-prog-name=ld gives a path.
 
456
  AC_MSG_CHECKING([for ld used by GCC])
 
457
  ac_prog=`($CC -print-prog-name=ld) 2>&5`
 
458
  case "$ac_prog" in
 
459
    # Accept absolute paths.
 
460
changequote(,)dnl
 
461
    [\\/]* | [A-Za-z]:[\\/]*)
 
462
      re_direlt='/[^/][^/]*/\.\./'
 
463
changequote([,])dnl
 
464
      # Canonicalize the path of ld
 
465
      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
 
466
      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
 
467
        ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
 
468
      done
 
469
      test -z "$LD" && LD="$ac_prog"
 
470
      ;;
 
471
  "")
 
472
    # If it fails, then pretend we aren't using GCC.
 
473
    ac_prog=ld
 
474
    ;;
 
475
  *)
 
476
    # If it is relative, then search for the first ld in PATH.
 
477
    with_gnu_ld=unknown
 
478
    ;;
 
479
  esac
 
480
elif test "$with_gnu_ld" = yes; then
 
481
  AC_MSG_CHECKING([for GNU ld])
 
482
else
 
483
  AC_MSG_CHECKING([for non-GNU ld])
 
484
fi
 
485
AC_CACHE_VAL(ac_cv_path_LD,
 
486
[if test -z "$LD"; then
 
487
  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
 
488
  for ac_dir in $PATH; do
 
489
    test -z "$ac_dir" && ac_dir=.
 
490
    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
 
491
      ac_cv_path_LD="$ac_dir/$ac_prog"
 
492
      # Check to see if the program is GNU ld.  I'd rather use --version,
 
493
      # but apparently some GNU ld's only accept -v.
 
494
      # Break only if it was the GNU/non-GNU ld that we prefer.
 
495
      if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
 
496
        test "$with_gnu_ld" != no && break
 
497
      else
 
498
        test "$with_gnu_ld" != yes && break
 
499
      fi
 
500
    fi
 
501
  done
 
502
  IFS="$ac_save_ifs"
 
503
else
 
504
  ac_cv_path_LD="$LD" # Let the user override the test with a path.
 
505
fi])
 
506
LD="$ac_cv_path_LD"
 
507
if test -n "$LD"; then
 
508
  AC_MSG_RESULT($LD)
 
509
else
 
510
  AC_MSG_RESULT(no)
 
511
fi
 
512
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
 
513
AC_SUBST(LD)
 
514
AC_PROG_LD_GNU
 
515
])
 
516
 
 
517
AC_DEFUN([AC_PROG_LD_GNU],
 
518
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
 
519
[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
 
520
if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
 
521
  ac_cv_prog_gnu_ld=yes
 
522
else
 
523
  ac_cv_prog_gnu_ld=no
 
524
fi])
 
525
])
 
526
 
 
527
# AC_PROG_NM - find the path to a BSD-compatible name lister
 
528
AC_DEFUN([AC_PROG_NM],
 
529
[AC_MSG_CHECKING([for BSD-compatible nm])
 
530
AC_CACHE_VAL(ac_cv_path_NM,
 
531
[if test -n "$NM"; then
 
532
  # Let the user override the test.
 
533
  ac_cv_path_NM="$NM"
 
534
else
 
535
  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
 
536
  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
 
537
    test -z "$ac_dir" && ac_dir=.
 
538
    if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
 
539
      # Check to see if the nm accepts a BSD-compat flag.
 
540
      # Adding the `sed 1q' prevents false positives on HP-UX, which says:
 
541
      #   nm: unknown option "B" ignored
 
542
      if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
 
543
        ac_cv_path_NM="$ac_dir/nm -B"
 
544
        break
 
545
      elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
 
546
        ac_cv_path_NM="$ac_dir/nm -p"
 
547
        break
 
548
      else
 
549
        ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
 
550
        continue # so that we can try to find one that supports BSD flags
 
551
      fi
 
552
    fi
 
553
  done
 
554
  IFS="$ac_save_ifs"
 
555
  test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
 
556
fi])
 
557
NM="$ac_cv_path_NM"
 
558
AC_MSG_RESULT([$NM])
 
559
AC_SUBST(NM)
 
560
])
 
561
 
 
562
# AC_CHECK_LIBM - check for math library
 
563
AC_DEFUN([AC_CHECK_LIBM],
 
564
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
 
565
LIBM=
 
566
case "$host" in
 
567
*-*-beos* | *-*-cygwin*)
 
568
  # These system don't have libm
 
569
  ;;
 
570
*-ncr-sysv4.3*)
 
571
  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
 
572
  AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
 
573
  ;;
 
574
*)
 
575
  AC_CHECK_LIB(m, main, LIBM="-lm")
 
576
  ;;
 
577
esac
 
578
])
 
579
 
 
580
# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
 
581
# the libltdl convenience library, adds --enable-ltdl-convenience to
 
582
# the configure arguments.  Note that LIBLTDL is not AC_SUBSTed, nor
 
583
# is AC_CONFIG_SUBDIRS called.  If DIR is not provided, it is assumed
 
584
# to be `${top_builddir}/libltdl'.  Make sure you start DIR with
 
585
# '${top_builddir}/' (note the single quotes!) if your package is not
 
586
# flat, and, if you're not using automake, define top_builddir as
 
587
# appropriate in the Makefiles.
 
588
AC_DEFUN([AC_LIBLTDL_CONVENIENCE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
 
589
  case "$enable_ltdl_convenience" in
 
590
  no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
 
591
  "") enable_ltdl_convenience=yes
 
592
      ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
 
593
  esac
 
594
  LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
 
595
  INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
 
596
])
 
597
 
 
598
# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
 
599
# the libltdl installable library, and adds --enable-ltdl-install to
 
600
# the configure arguments.  Note that LIBLTDL is not AC_SUBSTed, nor
 
601
# is AC_CONFIG_SUBDIRS called.  If DIR is not provided, it is assumed
 
602
# to be `${top_builddir}/libltdl'.  Make sure you start DIR with
 
603
# '${top_builddir}/' (note the single quotes!) if your package is not
 
604
# flat, and, if you're not using automake, define top_builddir as
 
605
# appropriate in the Makefiles.
 
606
# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
 
607
AC_DEFUN([AC_LIBLTDL_INSTALLABLE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
 
608
  AC_CHECK_LIB(ltdl, main,
 
609
  [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
 
610
  [if test x"$enable_ltdl_install" = xno; then
 
611
     AC_MSG_WARN([libltdl not installed, but installation disabled])
 
612
   else
 
613
     enable_ltdl_install=yes
 
614
   fi
 
615
  ])
 
616
  if test x"$enable_ltdl_install" = x"yes"; then
 
617
    ac_configure_args="$ac_configure_args --enable-ltdl-install"
 
618
    LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
 
619
    INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
 
620
  else
 
621
    ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
 
622
    LIBLTDL="-lltdl"
 
623
    INCLTDL=
 
624
  fi
 
625
])
 
626
 
 
627
dnl old names
 
628
AC_DEFUN([AM_PROG_LIBTOOL], [indir([AC_PROG_LIBTOOL])])dnl
 
629
AC_DEFUN([AM_ENABLE_SHARED], [indir([AC_ENABLE_SHARED], $@)])dnl
 
630
AC_DEFUN([AM_ENABLE_STATIC], [indir([AC_ENABLE_STATIC], $@)])dnl
 
631
AC_DEFUN([AM_DISABLE_SHARED], [indir([AC_DISABLE_SHARED], $@)])dnl
 
632
AC_DEFUN([AM_DISABLE_STATIC], [indir([AC_DISABLE_STATIC], $@)])dnl
 
633
AC_DEFUN([AM_PROG_LD], [indir([AC_PROG_LD])])dnl
 
634
AC_DEFUN([AM_PROG_NM], [indir([AC_PROG_NM])])dnl
 
635
 
 
636
dnl This is just to silence aclocal about the macro not being used
 
637
ifelse([AC_DISABLE_FAST_INSTALL])dnl