~ubuntu-branches/ubuntu/wily/ntop/wily-proposed

« back to all changes in this revision

Viewing changes to ntop/acinclude.m4

  • Committer: Bazaar Package Importer
  • Author(s): Dennis Schoen
  • Date: 2002-04-12 11:38:47 UTC
  • Revision ID: james.westby@ubuntu.com-20020412113847-4k4yydw0pzybc6g8
Tags: upstream-2.0.0
ImportĀ upstreamĀ versionĀ 2.0.0

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