65
|
1 # aclocal.m4 generated automatically by aclocal 1.5
|
|
2
|
|
3 # Copyright 1996, 1997, 1998, 1999, 2000, 2001
|
|
4 # Free Software Foundation, Inc.
|
|
5 # This file is free software; the Free Software Foundation
|
|
6 # gives unlimited permission to copy and/or distribute it,
|
|
7 # with or without modifications, as long as this notice is preserved.
|
|
8
|
|
9 # This program is distributed in the hope that it will be useful,
|
|
10 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
|
11 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
12 # PARTICULAR PURPOSE.
|
|
13
|
|
14 # Do all the work for Automake. This macro actually does too much --
|
|
15 # some checks are only needed if your package does certain things.
|
|
16 # But this isn't really a big deal.
|
|
17
|
|
18 # serial 5
|
|
19
|
|
20 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
|
|
21 # written in clear, in which case automake, when reading aclocal.m4,
|
|
22 # will think it sees a *use*, and therefore will trigger all it's
|
|
23 # C support machinery. Also note that it means that autoscan, seeing
|
|
24 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
|
|
25
|
|
26
|
|
27 # We require 2.13 because we rely on SHELL being computed by configure.
|
|
28 AC_PREREQ([2.13])
|
|
29
|
|
30 # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
|
|
31 # -----------------------------------------------------------
|
|
32 # If MACRO-NAME is provided do IF-PROVIDED, else IF-NOT-PROVIDED.
|
|
33 # The purpose of this macro is to provide the user with a means to
|
|
34 # check macros which are provided without letting her know how the
|
|
35 # information is coded.
|
|
36 # If this macro is not defined by Autoconf, define it here.
|
|
37 ifdef([AC_PROVIDE_IFELSE],
|
|
38 [],
|
|
39 [define([AC_PROVIDE_IFELSE],
|
|
40 [ifdef([AC_PROVIDE_$1],
|
|
41 [$2], [$3])])])
|
|
42
|
|
43
|
|
44 # AM_INIT_AUTOMAKE(PACKAGE,VERSION, [NO-DEFINE])
|
|
45 # ----------------------------------------------
|
|
46 AC_DEFUN([AM_INIT_AUTOMAKE],
|
|
47 [AC_REQUIRE([AC_PROG_INSTALL])dnl
|
|
48 # test to see if srcdir already configured
|
|
49 if test "`cd $srcdir && pwd`" != "`pwd`" &&
|
|
50 test -f $srcdir/config.status; then
|
|
51 AC_MSG_ERROR([source directory already configured; run \"make distclean\" there first])
|
|
52 fi
|
|
53
|
|
54 # Define the identity of the package.
|
|
55 PACKAGE=$1
|
|
56 AC_SUBST(PACKAGE)dnl
|
|
57 VERSION=$2
|
|
58 AC_SUBST(VERSION)dnl
|
|
59 ifelse([$3],,
|
|
60 [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
|
|
61 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])
|
|
62
|
|
63 # Autoconf 2.50 wants to disallow AM_ names. We explicitly allow
|
|
64 # the ones we care about.
|
|
65 ifdef([m4_pattern_allow],
|
|
66 [m4_pattern_allow([^AM_[A-Z]+FLAGS])])dnl
|
|
67
|
|
68 # Autoconf 2.50 always computes EXEEXT. However we need to be
|
|
69 # compatible with 2.13, for now. So we always define EXEEXT, but we
|
|
70 # don't compute it.
|
|
71 AC_SUBST(EXEEXT)
|
|
72 # Similar for OBJEXT -- only we only use OBJEXT if the user actually
|
|
73 # requests that it be used. This is a bit dumb.
|
|
74 : ${OBJEXT=o}
|
|
75 AC_SUBST(OBJEXT)
|
|
76
|
|
77 # Some tools Automake needs.
|
|
78 AC_REQUIRE([AM_SANITY_CHECK])dnl
|
|
79 AC_REQUIRE([AC_ARG_PROGRAM])dnl
|
|
80 AM_MISSING_PROG(ACLOCAL, aclocal)
|
|
81 AM_MISSING_PROG(AUTOCONF, autoconf)
|
|
82 AM_MISSING_PROG(AUTOMAKE, automake)
|
|
83 AM_MISSING_PROG(AUTOHEADER, autoheader)
|
|
84 AM_MISSING_PROG(MAKEINFO, makeinfo)
|
|
85 AM_MISSING_PROG(AMTAR, tar)
|
|
86 AM_PROG_INSTALL_SH
|
|
87 AM_PROG_INSTALL_STRIP
|
|
88 # We need awk for the "check" target. The system "awk" is bad on
|
|
89 # some platforms.
|
|
90 AC_REQUIRE([AC_PROG_AWK])dnl
|
|
91 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
|
|
92 AC_REQUIRE([AM_DEP_TRACK])dnl
|
|
93 AC_REQUIRE([AM_SET_DEPDIR])dnl
|
|
94 AC_PROVIDE_IFELSE([AC_PROG_][CC],
|
|
95 [_AM_DEPENDENCIES(CC)],
|
|
96 [define([AC_PROG_][CC],
|
|
97 defn([AC_PROG_][CC])[_AM_DEPENDENCIES(CC)])])dnl
|
|
98 AC_PROVIDE_IFELSE([AC_PROG_][CXX],
|
|
99 [_AM_DEPENDENCIES(CXX)],
|
|
100 [define([AC_PROG_][CXX],
|
|
101 defn([AC_PROG_][CXX])[_AM_DEPENDENCIES(CXX)])])dnl
|
|
102 ])
|
|
103
|
|
104 #
|
|
105 # Check to make sure that the build environment is sane.
|
|
106 #
|
|
107
|
|
108 # serial 3
|
|
109
|
|
110 # AM_SANITY_CHECK
|
|
111 # ---------------
|
|
112 AC_DEFUN([AM_SANITY_CHECK],
|
|
113 [AC_MSG_CHECKING([whether build environment is sane])
|
|
114 # Just in case
|
|
115 sleep 1
|
|
116 echo timestamp > conftest.file
|
|
117 # Do `set' in a subshell so we don't clobber the current shell's
|
|
118 # arguments. Must try -L first in case configure is actually a
|
|
119 # symlink; some systems play weird games with the mod time of symlinks
|
|
120 # (eg FreeBSD returns the mod time of the symlink's containing
|
|
121 # directory).
|
|
122 if (
|
|
123 set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
|
|
124 if test "$[*]" = "X"; then
|
|
125 # -L didn't work.
|
|
126 set X `ls -t $srcdir/configure conftest.file`
|
|
127 fi
|
|
128 rm -f conftest.file
|
|
129 if test "$[*]" != "X $srcdir/configure conftest.file" \
|
|
130 && test "$[*]" != "X conftest.file $srcdir/configure"; then
|
|
131
|
|
132 # If neither matched, then we have a broken ls. This can happen
|
|
133 # if, for instance, CONFIG_SHELL is bash and it inherits a
|
|
134 # broken ls alias from the environment. This has actually
|
|
135 # happened. Such a system could not be considered "sane".
|
|
136 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
|
|
137 alias in your environment])
|
|
138 fi
|
|
139
|
|
140 test "$[2]" = conftest.file
|
|
141 )
|
|
142 then
|
|
143 # Ok.
|
|
144 :
|
|
145 else
|
|
146 AC_MSG_ERROR([newly created file is older than distributed files!
|
|
147 Check your system clock])
|
|
148 fi
|
|
149 AC_MSG_RESULT(yes)])
|
|
150
|
|
151
|
|
152 # serial 2
|
|
153
|
|
154 # AM_MISSING_PROG(NAME, PROGRAM)
|
|
155 # ------------------------------
|
|
156 AC_DEFUN([AM_MISSING_PROG],
|
|
157 [AC_REQUIRE([AM_MISSING_HAS_RUN])
|
|
158 $1=${$1-"${am_missing_run}$2"}
|
|
159 AC_SUBST($1)])
|
|
160
|
|
161
|
|
162 # AM_MISSING_HAS_RUN
|
|
163 # ------------------
|
|
164 # Define MISSING if not defined so far and test if it supports --run.
|
|
165 # If it does, set am_missing_run to use it, otherwise, to nothing.
|
|
166 AC_DEFUN([AM_MISSING_HAS_RUN],
|
|
167 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
|
|
168 test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
|
|
169 # Use eval to expand $SHELL
|
|
170 if eval "$MISSING --run true"; then
|
|
171 am_missing_run="$MISSING --run "
|
|
172 else
|
|
173 am_missing_run=
|
|
174 am_backtick='`'
|
|
175 AC_MSG_WARN([${am_backtick}missing' script is too old or missing])
|
|
176 fi
|
|
177 ])
|
|
178
|
|
179 # AM_AUX_DIR_EXPAND
|
|
180
|
|
181 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
|
|
182 # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
|
|
183 # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
|
|
184 #
|
|
185 # Of course, Automake must honor this variable whenever it calls a
|
|
186 # tool from the auxiliary directory. The problem is that $srcdir (and
|
|
187 # therefore $ac_aux_dir as well) can be either absolute or relative,
|
|
188 # depending on how configure is run. This is pretty annoying, since
|
|
189 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
|
|
190 # source directory, any form will work fine, but in subdirectories a
|
|
191 # relative path needs to be adjusted first.
|
|
192 #
|
|
193 # $ac_aux_dir/missing
|
|
194 # fails when called from a subdirectory if $ac_aux_dir is relative
|
|
195 # $top_srcdir/$ac_aux_dir/missing
|
|
196 # fails if $ac_aux_dir is absolute,
|
|
197 # fails when called from a subdirectory in a VPATH build with
|
|
198 # a relative $ac_aux_dir
|
|
199 #
|
|
200 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
|
|
201 # are both prefixed by $srcdir. In an in-source build this is usually
|
|
202 # harmless because $srcdir is `.', but things will broke when you
|
|
203 # start a VPATH build or use an absolute $srcdir.
|
|
204 #
|
|
205 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
|
|
206 # iff we strip the leading $srcdir from $ac_aux_dir. That would be:
|
|
207 # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
|
|
208 # and then we would define $MISSING as
|
|
209 # MISSING="\${SHELL} $am_aux_dir/missing"
|
|
210 # This will work as long as MISSING is not called from configure, because
|
|
211 # unfortunately $(top_srcdir) has no meaning in configure.
|
|
212 # However there are other variables, like CC, which are often used in
|
|
213 # configure, and could therefore not use this "fixed" $ac_aux_dir.
|
|
214 #
|
|
215 # Another solution, used here, is to always expand $ac_aux_dir to an
|
|
216 # absolute PATH. The drawback is that using absolute paths prevent a
|
|
217 # configured tree to be moved without reconfiguration.
|
|
218
|
|
219 AC_DEFUN([AM_AUX_DIR_EXPAND], [
|
|
220 # expand $ac_aux_dir to an absolute path
|
|
221 am_aux_dir=`cd $ac_aux_dir && pwd`
|
|
222 ])
|
|
223
|
|
224 # AM_PROG_INSTALL_SH
|
|
225 # ------------------
|
|
226 # Define $install_sh.
|
|
227 AC_DEFUN([AM_PROG_INSTALL_SH],
|
|
228 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
|
|
229 install_sh=${install_sh-"$am_aux_dir/install-sh"}
|
|
230 AC_SUBST(install_sh)])
|
|
231
|
|
232 # One issue with vendor `install' (even GNU) is that you can't
|
|
233 # specify the program used to strip binaries. This is especially
|
|
234 # annoying in cross-compiling environments, where the build's strip
|
|
235 # is unlikely to handle the host's binaries.
|
|
236 # Fortunately install-sh will honor a STRIPPROG variable, so we
|
|
237 # always use install-sh in `make install-strip', and initialize
|
|
238 # STRIPPROG with the value of the STRIP variable (set by the user).
|
|
239 AC_DEFUN([AM_PROG_INSTALL_STRIP],
|
|
240 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
|
|
241 INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
|
|
242 AC_SUBST([INSTALL_STRIP_PROGRAM])])
|
|
243
|
|
244 # serial 4 -*- Autoconf -*-
|
|
245
|
|
246
|
|
247
|
|
248 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
|
|
249 # written in clear, in which case automake, when reading aclocal.m4,
|
|
250 # will think it sees a *use*, and therefore will trigger all it's
|
|
251 # C support machinery. Also note that it means that autoscan, seeing
|
|
252 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
|
|
253
|
|
254
|
|
255
|
|
256 # _AM_DEPENDENCIES(NAME)
|
|
257 # ---------------------
|
|
258 # See how the compiler implements dependency checking.
|
|
259 # NAME is "CC", "CXX" or "OBJC".
|
|
260 # We try a few techniques and use that to set a single cache variable.
|
|
261 #
|
|
262 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
|
|
263 # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
|
|
264 # dependency, and given that the user is not expected to run this macro,
|
|
265 # just rely on AC_PROG_CC.
|
|
266 AC_DEFUN([_AM_DEPENDENCIES],
|
|
267 [AC_REQUIRE([AM_SET_DEPDIR])dnl
|
|
268 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
|
|
269 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
|
|
270 AC_REQUIRE([AM_DEP_TRACK])dnl
|
|
271
|
|
272 ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
|
|
273 [$1], CXX, [depcc="$CXX" am_compiler_list=],
|
|
274 [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc']
|
|
275 [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
|
|
276 [depcc="$$1" am_compiler_list=])
|
|
277
|
|
278 AC_CACHE_CHECK([dependency style of $depcc],
|
|
279 [am_cv_$1_dependencies_compiler_type],
|
|
280 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
|
|
281 # We make a subdir and do the tests there. Otherwise we can end up
|
|
282 # making bogus files that we don't know about and never remove. For
|
|
283 # instance it was reported that on HP-UX the gcc test will end up
|
|
284 # making a dummy file named `D' -- because `-MD' means `put the output
|
|
285 # in D'.
|
|
286 mkdir conftest.dir
|
|
287 # Copy depcomp to subdir because otherwise we won't find it if we're
|
|
288 # using a relative directory.
|
|
289 cp "$am_depcomp" conftest.dir
|
|
290 cd conftest.dir
|
|
291
|
|
292 am_cv_$1_dependencies_compiler_type=none
|
|
293 if test "$am_compiler_list" = ""; then
|
|
294 am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
|
|
295 fi
|
|
296 for depmode in $am_compiler_list; do
|
|
297 # We need to recreate these files for each test, as the compiler may
|
|
298 # overwrite some of them when testing with obscure command lines.
|
|
299 # This happens at least with the AIX C compiler.
|
|
300 echo '#include "conftest.h"' > conftest.c
|
|
301 echo 'int i;' > conftest.h
|
|
302 echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf
|
|
303
|
|
304 case $depmode in
|
|
305 nosideeffect)
|
|
306 # after this tag, mechanisms are not by side-effect, so they'll
|
|
307 # only be used when explicitly requested
|
|
308 if test "x$enable_dependency_tracking" = xyes; then
|
|
309 continue
|
|
310 else
|
|
311 break
|
|
312 fi
|
|
313 ;;
|
|
314 none) break ;;
|
|
315 esac
|
|
316 # We check with `-c' and `-o' for the sake of the "dashmstdout"
|
|
317 # mode. It turns out that the SunPro C++ compiler does not properly
|
|
318 # handle `-M -o', and we need to detect this.
|
|
319 if depmode=$depmode \
|
|
320 source=conftest.c object=conftest.o \
|
|
321 depfile=conftest.Po tmpdepfile=conftest.TPo \
|
|
322 $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 &&
|
|
323 grep conftest.h conftest.Po > /dev/null 2>&1 &&
|
|
324 ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
|
|
325 am_cv_$1_dependencies_compiler_type=$depmode
|
|
326 break
|
|
327 fi
|
|
328 done
|
|
329
|
|
330 cd ..
|
|
331 rm -rf conftest.dir
|
|
332 else
|
|
333 am_cv_$1_dependencies_compiler_type=none
|
|
334 fi
|
|
335 ])
|
|
336 $1DEPMODE="depmode=$am_cv_$1_dependencies_compiler_type"
|
|
337 AC_SUBST([$1DEPMODE])
|
|
338 ])
|
|
339
|
|
340
|
|
341 # AM_SET_DEPDIR
|
|
342 # -------------
|
|
343 # Choose a directory name for dependency files.
|
|
344 # This macro is AC_REQUIREd in _AM_DEPENDENCIES
|
|
345 AC_DEFUN([AM_SET_DEPDIR],
|
|
346 [rm -f .deps 2>/dev/null
|
|
347 mkdir .deps 2>/dev/null
|
|
348 if test -d .deps; then
|
|
349 DEPDIR=.deps
|
|
350 else
|
|
351 # MS-DOS does not allow filenames that begin with a dot.
|
|
352 DEPDIR=_deps
|
|
353 fi
|
|
354 rmdir .deps 2>/dev/null
|
|
355 AC_SUBST(DEPDIR)
|
|
356 ])
|
|
357
|
|
358
|
|
359 # AM_DEP_TRACK
|
|
360 # ------------
|
|
361 AC_DEFUN([AM_DEP_TRACK],
|
|
362 [AC_ARG_ENABLE(dependency-tracking,
|
|
363 [ --disable-dependency-tracking Speeds up one-time builds
|
|
364 --enable-dependency-tracking Do not reject slow dependency extractors])
|
|
365 if test "x$enable_dependency_tracking" != xno; then
|
|
366 am_depcomp="$ac_aux_dir/depcomp"
|
|
367 AMDEPBACKSLASH='\'
|
|
368 fi
|
|
369 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
|
|
370 pushdef([subst], defn([AC_SUBST]))
|
|
371 subst(AMDEPBACKSLASH)
|
|
372 popdef([subst])
|
|
373 ])
|
|
374
|
|
375 # Generate code to set up dependency tracking.
|
|
376 # This macro should only be invoked once -- use via AC_REQUIRE.
|
|
377 # Usage:
|
|
378 # AM_OUTPUT_DEPENDENCY_COMMANDS
|
|
379
|
|
380 #
|
|
381 # This code is only required when automatic dependency tracking
|
|
382 # is enabled. FIXME. This creates each `.P' file that we will
|
|
383 # need in order to bootstrap the dependency handling code.
|
|
384 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],[
|
|
385 AC_OUTPUT_COMMANDS([
|
|
386 test x"$AMDEP_TRUE" != x"" ||
|
|
387 for mf in $CONFIG_FILES; do
|
|
388 case "$mf" in
|
|
389 Makefile) dirpart=.;;
|
|
390 */Makefile) dirpart=`echo "$mf" | sed -e 's|/[^/]*$||'`;;
|
|
391 *) continue;;
|
|
392 esac
|
|
393 grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue
|
|
394 # Extract the definition of DEP_FILES from the Makefile without
|
|
395 # running `make'.
|
|
396 DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
|
|
397 test -z "$DEPDIR" && continue
|
|
398 # When using ansi2knr, U may be empty or an underscore; expand it
|
|
399 U=`sed -n -e '/^U = / s///p' < "$mf"`
|
|
400 test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
|
|
401 # We invoke sed twice because it is the simplest approach to
|
|
402 # changing $(DEPDIR) to its actual value in the expansion.
|
|
403 for file in `sed -n -e '
|
|
404 /^DEP_FILES = .*\\\\$/ {
|
|
405 s/^DEP_FILES = //
|
|
406 :loop
|
|
407 s/\\\\$//
|
|
408 p
|
|
409 n
|
|
410 /\\\\$/ b loop
|
|
411 p
|
|
412 }
|
|
413 /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
|
|
414 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
|
|
415 # Make sure the directory exists.
|
|
416 test -f "$dirpart/$file" && continue
|
|
417 fdir=`echo "$file" | sed -e 's|/[^/]*$||'`
|
|
418 $ac_aux_dir/mkinstalldirs "$dirpart/$fdir" > /dev/null 2>&1
|
|
419 # echo "creating $dirpart/$file"
|
|
420 echo '# dummy' > "$dirpart/$file"
|
|
421 done
|
|
422 done
|
|
423 ], [AMDEP_TRUE="$AMDEP_TRUE"
|
|
424 ac_aux_dir="$ac_aux_dir"])])
|
|
425
|
|
426 # AM_MAKE_INCLUDE()
|
|
427 # -----------------
|
|
428 # Check to see how make treats includes.
|
|
429 AC_DEFUN([AM_MAKE_INCLUDE],
|
|
430 [am_make=${MAKE-make}
|
|
431 cat > confinc << 'END'
|
|
432 doit:
|
|
433 @echo done
|
|
434 END
|
|
435 # If we don't find an include directive, just comment out the code.
|
|
436 AC_MSG_CHECKING([for style of include used by $am_make])
|
|
437 am__include='#'
|
|
438 am__quote=
|
|
439 _am_result=none
|
|
440 # First try GNU make style include.
|
|
441 echo "include confinc" > confmf
|
|
442 # We grep out `Entering directory' and `Leaving directory'
|
|
443 # messages which can occur if `w' ends up in MAKEFLAGS.
|
|
444 # In particular we don't look at `^make:' because GNU make might
|
|
445 # be invoked under some other name (usually "gmake"), in which
|
|
446 # case it prints its new name instead of `make'.
|
|
447 if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then
|
|
448 am__include=include
|
|
449 am__quote=
|
|
450 _am_result=GNU
|
|
451 fi
|
|
452 # Now try BSD make style include.
|
|
453 if test "$am__include" = "#"; then
|
|
454 echo '.include "confinc"' > confmf
|
|
455 if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
|
|
456 am__include=.include
|
|
457 am__quote='"'
|
|
458 _am_result=BSD
|
|
459 fi
|
|
460 fi
|
|
461 AC_SUBST(am__include)
|
|
462 AC_SUBST(am__quote)
|
|
463 AC_MSG_RESULT($_am_result)
|
|
464 rm -f confinc confmf
|
|
465 ])
|
|
466
|
|
467 # serial 3
|
|
468
|
|
469 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
|
|
470 # -------------------------------------
|
|
471 # Define a conditional.
|
|
472 #
|
|
473 # FIXME: Once using 2.50, use this:
|
|
474 # m4_match([$1], [^TRUE\|FALSE$], [AC_FATAL([$0: invalid condition: $1])])dnl
|
|
475 AC_DEFUN([AM_CONDITIONAL],
|
|
476 [ifelse([$1], [TRUE],
|
|
477 [errprint(__file__:__line__: [$0: invalid condition: $1
|
|
478 ])dnl
|
|
479 m4exit(1)])dnl
|
|
480 ifelse([$1], [FALSE],
|
|
481 [errprint(__file__:__line__: [$0: invalid condition: $1
|
|
482 ])dnl
|
|
483 m4exit(1)])dnl
|
|
484 AC_SUBST([$1_TRUE])
|
|
485 AC_SUBST([$1_FALSE])
|
|
486 if $2; then
|
|
487 $1_TRUE=
|
|
488 $1_FALSE='#'
|
|
489 else
|
|
490 $1_TRUE='#'
|
|
491 $1_FALSE=
|
|
492 fi])
|
|
493
|
|
494
|
|
495 # serial 40 AC_PROG_LIBTOOL
|
|
496 AC_DEFUN(AC_PROG_LIBTOOL,
|
|
497 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
|
|
498
|
|
499 # Save cache, so that ltconfig can load it
|
|
500 AC_CACHE_SAVE
|
|
501
|
|
502 # Actually configure libtool. ac_aux_dir is where install-sh is found.
|
|
503 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
|
|
504 LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
|
|
505 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
|
|
506 DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
|
|
507 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
|
|
508 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
|
|
509 || AC_MSG_ERROR([libtool configure failed])
|
|
510
|
|
511 # Reload cache, that may have been modified by ltconfig
|
|
512 AC_CACHE_LOAD
|
|
513
|
|
514 # This can be used to rebuild libtool when needed
|
|
515 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
|
|
516
|
|
517 # Always use our own libtool.
|
|
518 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
|
|
519 AC_SUBST(LIBTOOL)dnl
|
|
520
|
|
521 # Redirect the config.log output again, so that the ltconfig log is not
|
|
522 # clobbered by the next message.
|
|
523 exec 5>>./config.log
|
|
524 ])
|
|
525
|
|
526 AC_DEFUN(AC_LIBTOOL_SETUP,
|
|
527 [AC_PREREQ(2.13)dnl
|
|
528 AC_REQUIRE([AC_ENABLE_SHARED])dnl
|
|
529 AC_REQUIRE([AC_ENABLE_STATIC])dnl
|
|
530 AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
|
|
531 AC_REQUIRE([AC_CANONICAL_HOST])dnl
|
|
532 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
|
|
533 AC_REQUIRE([AC_PROG_RANLIB])dnl
|
|
534 AC_REQUIRE([AC_PROG_CC])dnl
|
|
535 AC_REQUIRE([AC_PROG_LD])dnl
|
|
536 AC_REQUIRE([AC_PROG_NM])dnl
|
|
537 AC_REQUIRE([AC_PROG_LN_S])dnl
|
|
538 dnl
|
|
539
|
|
540 case "$target" in
|
|
541 NONE) lt_target="$host" ;;
|
|
542 *) lt_target="$target" ;;
|
|
543 esac
|
|
544
|
|
545 # Check for any special flags to pass to ltconfig.
|
|
546 libtool_flags="--cache-file=$cache_file"
|
|
547 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
|
|
548 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
|
|
549 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
|
|
550 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
|
|
551 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
|
|
552 ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
|
|
553 [libtool_flags="$libtool_flags --enable-dlopen"])
|
|
554 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
|
|
555 [libtool_flags="$libtool_flags --enable-win32-dll"])
|
|
556 AC_ARG_ENABLE(libtool-lock,
|
|
557 [ --disable-libtool-lock avoid locking (might break parallel builds)])
|
|
558 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
|
|
559 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
|
|
560
|
|
561 # Some flags need to be propagated to the compiler or linker for good
|
|
562 # libtool support.
|
|
563 case "$lt_target" in
|
|
564 *-*-irix6*)
|
|
565 # Find out which ABI we are using.
|
|
566 echo '[#]line __oline__ "configure"' > conftest.$ac_ext
|
|
567 if AC_TRY_EVAL(ac_compile); then
|
|
568 case "`/usr/bin/file conftest.o`" in
|
|
569 *32-bit*)
|
|
570 LD="${LD-ld} -32"
|
|
571 ;;
|
|
572 *N32*)
|
|
573 LD="${LD-ld} -n32"
|
|
574 ;;
|
|
575 *64-bit*)
|
|
576 LD="${LD-ld} -64"
|
|
577 ;;
|
|
578 esac
|
|
579 fi
|
|
580 rm -rf conftest*
|
|
581 ;;
|
|
582
|
|
583 *-*-sco3.2v5*)
|
|
584 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
|
|
585 SAVE_CFLAGS="$CFLAGS"
|
|
586 CFLAGS="$CFLAGS -belf"
|
|
587 AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
|
|
588 [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
|
|
589 if test x"$lt_cv_cc_needs_belf" != x"yes"; then
|
|
590 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
|
|
591 CFLAGS="$SAVE_CFLAGS"
|
|
592 fi
|
|
593 ;;
|
|
594
|
|
595 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
|
|
596 [*-*-cygwin* | *-*-mingw*)
|
|
597 AC_CHECK_TOOL(DLLTOOL, dlltool, false)
|
|
598 AC_CHECK_TOOL(AS, as, false)
|
|
599 AC_CHECK_TOOL(OBJDUMP, objdump, false)
|
|
600 ;;
|
|
601 ])
|
|
602 esac
|
|
603 ])
|
|
604
|
|
605 # AC_LIBTOOL_DLOPEN - enable checks for dlopen support
|
|
606 AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
|
|
607
|
|
608 # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
|
|
609 AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
|
|
610
|
|
611 # AC_ENABLE_SHARED - implement the --enable-shared flag
|
|
612 # Usage: AC_ENABLE_SHARED[(DEFAULT)]
|
|
613 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
|
|
614 # `yes'.
|
|
615 AC_DEFUN(AC_ENABLE_SHARED, [dnl
|
|
616 define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
|
|
617 AC_ARG_ENABLE(shared,
|
|
618 changequote(<<, >>)dnl
|
|
619 << --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
|
|
620 changequote([, ])dnl
|
|
621 [p=${PACKAGE-default}
|
|
622 case "$enableval" in
|
|
623 yes) enable_shared=yes ;;
|
|
624 no) enable_shared=no ;;
|
|
625 *)
|
|
626 enable_shared=no
|
|
627 # Look at the argument we got. We use all the common list separators.
|
|
628 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
|
|
629 for pkg in $enableval; do
|
|
630 if test "X$pkg" = "X$p"; then
|
|
631 enable_shared=yes
|
|
632 fi
|
|
633 done
|
|
634 IFS="$ac_save_ifs"
|
|
635 ;;
|
|
636 esac],
|
|
637 enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
|
|
638 ])
|
|
639
|
|
640 # AC_DISABLE_SHARED - set the default shared flag to --disable-shared
|
|
641 AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
|
|
642 AC_ENABLE_SHARED(no)])
|
|
643
|
|
644 # AC_ENABLE_STATIC - implement the --enable-static flag
|
|
645 # Usage: AC_ENABLE_STATIC[(DEFAULT)]
|
|
646 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
|
|
647 # `yes'.
|
|
648 AC_DEFUN(AC_ENABLE_STATIC, [dnl
|
|
649 define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
|
|
650 AC_ARG_ENABLE(static,
|
|
651 changequote(<<, >>)dnl
|
|
652 << --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
|
|
653 changequote([, ])dnl
|
|
654 [p=${PACKAGE-default}
|
|
655 case "$enableval" in
|
|
656 yes) enable_static=yes ;;
|
|
657 no) enable_static=no ;;
|
|
658 *)
|
|
659 enable_static=no
|
|
660 # Look at the argument we got. We use all the common list separators.
|
|
661 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
|
|
662 for pkg in $enableval; do
|
|
663 if test "X$pkg" = "X$p"; then
|
|
664 enable_static=yes
|
|
665 fi
|
|
666 done
|
|
667 IFS="$ac_save_ifs"
|
|
668 ;;
|
|
669 esac],
|
|
670 enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
|
|
671 ])
|
|
672
|
|
673 # AC_DISABLE_STATIC - set the default static flag to --disable-static
|
|
674 AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
|
|
675 AC_ENABLE_STATIC(no)])
|
|
676
|
|
677
|
|
678 # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
|
|
679 # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
|
|
680 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
|
|
681 # `yes'.
|
|
682 AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
|
|
683 define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
|
|
684 AC_ARG_ENABLE(fast-install,
|
|
685 changequote(<<, >>)dnl
|
|
686 << --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
|
|
687 changequote([, ])dnl
|
|
688 [p=${PACKAGE-default}
|
|
689 case "$enableval" in
|
|
690 yes) enable_fast_install=yes ;;
|
|
691 no) enable_fast_install=no ;;
|
|
692 *)
|
|
693 enable_fast_install=no
|
|
694 # Look at the argument we got. We use all the common list separators.
|
|
695 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
|
|
696 for pkg in $enableval; do
|
|
697 if test "X$pkg" = "X$p"; then
|
|
698 enable_fast_install=yes
|
|
699 fi
|
|
700 done
|
|
701 IFS="$ac_save_ifs"
|
|
702 ;;
|
|
703 esac],
|
|
704 enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
|
|
705 ])
|
|
706
|
|
707 # AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
|
|
708 AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
|
|
709 AC_ENABLE_FAST_INSTALL(no)])
|
|
710
|
|
711 # AC_PROG_LD - find the path to the GNU or non-GNU linker
|
|
712 AC_DEFUN(AC_PROG_LD,
|
|
713 [AC_ARG_WITH(gnu-ld,
|
|
714 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
|
|
715 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
|
|
716 AC_REQUIRE([AC_PROG_CC])dnl
|
|
717 AC_REQUIRE([AC_CANONICAL_HOST])dnl
|
|
718 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
|
|
719 ac_prog=ld
|
|
720 if test "$ac_cv_prog_gcc" = yes; then
|
|
721 # Check if gcc -print-prog-name=ld gives a path.
|
|
722 AC_MSG_CHECKING([for ld used by GCC])
|
|
723 ac_prog=`($CC -print-prog-name=ld) 2>&5`
|
|
724 case "$ac_prog" in
|
|
725 # Accept absolute paths.
|
|
726 changequote(,)dnl
|
|
727 [\\/]* | [A-Za-z]:[\\/]*)
|
|
728 re_direlt='/[^/][^/]*/\.\./'
|
|
729 changequote([,])dnl
|
|
730 # Canonicalize the path of ld
|
|
731 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
|
|
732 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
|
|
733 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
|
|
734 done
|
|
735 test -z "$LD" && LD="$ac_prog"
|
|
736 ;;
|
|
737 "")
|
|
738 # If it fails, then pretend we aren't using GCC.
|
|
739 ac_prog=ld
|
|
740 ;;
|
|
741 *)
|
|
742 # If it is relative, then search for the first ld in PATH.
|
|
743 with_gnu_ld=unknown
|
|
744 ;;
|
|
745 esac
|
|
746 elif test "$with_gnu_ld" = yes; then
|
|
747 AC_MSG_CHECKING([for GNU ld])
|
|
748 else
|
|
749 AC_MSG_CHECKING([for non-GNU ld])
|
|
750 fi
|
|
751 AC_CACHE_VAL(ac_cv_path_LD,
|
|
752 [if test -z "$LD"; then
|
|
753 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
|
|
754 for ac_dir in $PATH; do
|
|
755 test -z "$ac_dir" && ac_dir=.
|
|
756 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
|
|
757 ac_cv_path_LD="$ac_dir/$ac_prog"
|
|
758 # Check to see if the program is GNU ld. I'd rather use --version,
|
|
759 # but apparently some GNU ld's only accept -v.
|
|
760 # Break only if it was the GNU/non-GNU ld that we prefer.
|
|
761 if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
|
|
762 test "$with_gnu_ld" != no && break
|
|
763 else
|
|
764 test "$with_gnu_ld" != yes && break
|
|
765 fi
|
|
766 fi
|
|
767 done
|
|
768 IFS="$ac_save_ifs"
|
|
769 else
|
|
770 ac_cv_path_LD="$LD" # Let the user override the test with a path.
|
|
771 fi])
|
|
772 LD="$ac_cv_path_LD"
|
|
773 if test -n "$LD"; then
|
|
774 AC_MSG_RESULT($LD)
|
|
775 else
|
|
776 AC_MSG_RESULT(no)
|
|
777 fi
|
|
778 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
|
|
779 AC_PROG_LD_GNU
|
|
780 ])
|
|
781
|
|
782 AC_DEFUN(AC_PROG_LD_GNU,
|
|
783 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
|
|
784 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
|
|
785 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
|
|
786 ac_cv_prog_gnu_ld=yes
|
|
787 else
|
|
788 ac_cv_prog_gnu_ld=no
|
|
789 fi])
|
|
790 ])
|
|
791
|
|
792 # AC_PROG_NM - find the path to a BSD-compatible name lister
|
|
793 AC_DEFUN(AC_PROG_NM,
|
|
794 [AC_MSG_CHECKING([for BSD-compatible nm])
|
|
795 AC_CACHE_VAL(ac_cv_path_NM,
|
|
796 [if test -n "$NM"; then
|
|
797 # Let the user override the test.
|
|
798 ac_cv_path_NM="$NM"
|
|
799 else
|
|
800 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
|
|
801 for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
|
|
802 test -z "$ac_dir" && ac_dir=.
|
|
803 if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
|
|
804 # Check to see if the nm accepts a BSD-compat flag.
|
|
805 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
|
|
806 # nm: unknown option "B" ignored
|
|
807 if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
|
|
808 ac_cv_path_NM="$ac_dir/nm -B"
|
|
809 break
|
|
810 elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
|
|
811 ac_cv_path_NM="$ac_dir/nm -p"
|
|
812 break
|
|
813 else
|
|
814 ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
|
|
815 continue # so that we can try to find one that supports BSD flags
|
|
816 fi
|
|
817 fi
|
|
818 done
|
|
819 IFS="$ac_save_ifs"
|
|
820 test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
|
|
821 fi])
|
|
822 NM="$ac_cv_path_NM"
|
|
823 AC_MSG_RESULT([$NM])
|
|
824 ])
|
|
825
|
|
826 # AC_CHECK_LIBM - check for math library
|
|
827 AC_DEFUN(AC_CHECK_LIBM,
|
|
828 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
|
|
829 LIBM=
|
|
830 case "$lt_target" in
|
|
831 *-*-beos* | *-*-cygwin*)
|
|
832 # These system don't have libm
|
|
833 ;;
|
|
834 *-ncr-sysv4.3*)
|
|
835 AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
|
|
836 AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
|
|
837 ;;
|
|
838 *)
|
|
839 AC_CHECK_LIB(m, main, LIBM="-lm")
|
|
840 ;;
|
|
841 esac
|
|
842 ])
|
|
843
|
|
844 # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
|
|
845 # the libltdl convenience library and INCLTDL to the include flags for
|
|
846 # the libltdl header and adds --enable-ltdl-convenience to the
|
|
847 # configure arguments. Note that LIBLTDL and INCLTDL are not
|
|
848 # AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If DIR is not
|
|
849 # provided, it is assumed to be `libltdl'. LIBLTDL will be prefixed
|
|
850 # with '${top_builddir}/' and INCLTDL will be prefixed with
|
|
851 # '${top_srcdir}/' (note the single quotes!). If your package is not
|
|
852 # flat and you're not using automake, define top_builddir and
|
|
853 # top_srcdir appropriately in the Makefiles.
|
|
854 AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
|
|
855 case "$enable_ltdl_convenience" in
|
|
856 no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
|
|
857 "") enable_ltdl_convenience=yes
|
|
858 ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
|
|
859 esac
|
|
860 LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
|
|
861 INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
|
|
862 ])
|
|
863
|
|
864 # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
|
|
865 # the libltdl installable library and INCLTDL to the include flags for
|
|
866 # the libltdl header and adds --enable-ltdl-install to the configure
|
|
867 # arguments. Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is
|
|
868 # AC_CONFIG_SUBDIRS called. If DIR is not provided and an installed
|
|
869 # libltdl is not found, it is assumed to be `libltdl'. LIBLTDL will
|
|
870 # be prefixed with '${top_builddir}/' and INCLTDL will be prefixed
|
|
871 # with '${top_srcdir}/' (note the single quotes!). If your package is
|
|
872 # not flat and you're not using automake, define top_builddir and
|
|
873 # top_srcdir appropriately in the Makefiles.
|
|
874 # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
|
|
875 AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
|
|
876 AC_CHECK_LIB(ltdl, main,
|
|
877 [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
|
|
878 [if test x"$enable_ltdl_install" = xno; then
|
|
879 AC_MSG_WARN([libltdl not installed, but installation disabled])
|
|
880 else
|
|
881 enable_ltdl_install=yes
|
|
882 fi
|
|
883 ])
|
|
884 if test x"$enable_ltdl_install" = x"yes"; then
|
|
885 ac_configure_args="$ac_configure_args --enable-ltdl-install"
|
|
886 LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
|
|
887 INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
|
|
888 else
|
|
889 ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
|
|
890 LIBLTDL="-lltdl"
|
|
891 INCLTDL=
|
|
892 fi
|
|
893 ])
|
|
894
|
|
895 dnl old names
|
|
896 AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
|
|
897 AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
|
|
898 AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
|
|
899 AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
|
|
900 AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
|
|
901 AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
|
|
902 AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
|
|
903
|
|
904 dnl This is just to silence aclocal about the macro not being used
|
|
905 ifelse([AC_DISABLE_FAST_INSTALL])dnl
|
|
906
|
|
907 # Configure paths for SDL
|
|
908 # Sam Lantinga 9/21/99
|
|
909 # stolen from Manish Singh
|
|
910 # stolen back from Frank Belew
|
|
911 # stolen from Manish Singh
|
|
912 # Shamelessly stolen from Owen Taylor
|
|
913
|
|
914 dnl AM_PATH_SDL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
|
|
915 dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS
|
|
916 dnl
|
|
917 AC_DEFUN(AM_PATH_SDL,
|
|
918 [dnl
|
|
919 dnl Get the cflags and libraries from the sdl-config script
|
|
920 dnl
|
|
921 AC_ARG_WITH(sdl-prefix,[ --with-sdl-prefix=PFX Prefix where SDL is installed (optional)],
|
|
922 sdl_prefix="$withval", sdl_prefix="")
|
|
923 AC_ARG_WITH(sdl-exec-prefix,[ --with-sdl-exec-prefix=PFX Exec prefix where SDL is installed (optional)],
|
|
924 sdl_exec_prefix="$withval", sdl_exec_prefix="")
|
|
925 AC_ARG_ENABLE(sdltest, [ --disable-sdltest Do not try to compile and run a test SDL program],
|
|
926 , enable_sdltest=yes)
|
|
927
|
|
928 if test x$sdl_exec_prefix != x ; then
|
|
929 sdl_args="$sdl_args --exec-prefix=$sdl_exec_prefix"
|
|
930 if test x${SDL_CONFIG+set} != xset ; then
|
|
931 SDL_CONFIG=$sdl_exec_prefix/bin/sdl-config
|
|
932 fi
|
|
933 fi
|
|
934 if test x$sdl_prefix != x ; then
|
|
935 sdl_args="$sdl_args --prefix=$sdl_prefix"
|
|
936 if test x${SDL_CONFIG+set} != xset ; then
|
|
937 SDL_CONFIG=$sdl_prefix/bin/sdl-config
|
|
938 fi
|
|
939 fi
|
|
940
|
|
941 AC_REQUIRE([AC_CANONICAL_TARGET])
|
|
942 AC_PATH_PROG(SDL_CONFIG, sdl-config, no)
|
|
943 min_sdl_version=ifelse([$1], ,0.11.0,$1)
|
|
944 AC_MSG_CHECKING(for SDL - version >= $min_sdl_version)
|
|
945 no_sdl=""
|
|
946 if test "$SDL_CONFIG" = "no" ; then
|
|
947 no_sdl=yes
|
|
948 else
|
|
949 SDL_CFLAGS=`$SDL_CONFIG $sdlconf_args --cflags`
|
|
950 SDL_LIBS=`$SDL_CONFIG $sdlconf_args --libs`
|
|
951
|
|
952 sdl_major_version=`$SDL_CONFIG $sdl_args --version | \
|
|
953 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
|
|
954 sdl_minor_version=`$SDL_CONFIG $sdl_args --version | \
|
|
955 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
|
|
956 sdl_micro_version=`$SDL_CONFIG $sdl_config_args --version | \
|
|
957 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
|
|
958 if test "x$enable_sdltest" = "xyes" ; then
|
|
959 ac_save_CFLAGS="$CFLAGS"
|
|
960 ac_save_LIBS="$LIBS"
|
|
961 CFLAGS="$CFLAGS $SDL_CFLAGS"
|
|
962 LIBS="$LIBS $SDL_LIBS"
|
|
963 dnl
|
|
964 dnl Now check if the installed SDL is sufficiently new. (Also sanity
|
|
965 dnl checks the results of sdl-config to some extent
|
|
966 dnl
|
|
967 rm -f conf.sdltest
|
|
968 case "$target" in
|
|
969 *-*-darwin*)
|
|
970 cp -r `$SDL_CONFIG --nib` .
|
|
971 dnl create an Info.plist file, unless one exists
|
|
972 if test -f Info.plist ; then
|
|
973 :
|
|
974 else
|
|
975 cp `$SDL_CONFIG --plist` .
|
|
976 fi
|
|
977 ;;
|
|
978 esac
|
|
979 AC_TRY_RUN([
|
|
980 #include <stdio.h>
|
|
981 #include <stdlib.h>
|
|
982 #include <string.h>
|
|
983 #include "SDL.h"
|
|
984
|
|
985 char*
|
|
986 my_strdup (char *str)
|
|
987 {
|
|
988 char *new_str;
|
|
989
|
|
990 if (str)
|
|
991 {
|
|
992 new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
|
|
993 strcpy (new_str, str);
|
|
994 }
|
|
995 else
|
|
996 new_str = NULL;
|
|
997
|
|
998 return new_str;
|
|
999 }
|
|
1000
|
|
1001 int main (int argc, char *argv[])
|
|
1002 {
|
|
1003 int major, minor, micro;
|
|
1004 char *tmp_version;
|
|
1005
|
|
1006 /* This hangs on some systems (?)
|
|
1007 system ("touch conf.sdltest");
|
|
1008 */
|
|
1009 { FILE *fp = fopen("conf.sdltest", "a"); if ( fp ) fclose(fp); }
|
|
1010
|
|
1011 /* HP/UX 9 (%@#!) writes to sscanf strings */
|
|
1012 tmp_version = my_strdup("$min_sdl_version");
|
|
1013 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
|
|
1014 printf("%s, bad version string\n", "$min_sdl_version");
|
|
1015 exit(1);
|
|
1016 }
|
|
1017
|
|
1018 if (($sdl_major_version > major) ||
|
|
1019 (($sdl_major_version == major) && ($sdl_minor_version > minor)) ||
|
|
1020 (($sdl_major_version == major) && ($sdl_minor_version == minor) && ($sdl_micro_version >= micro)))
|
|
1021 {
|
|
1022 return 0;
|
|
1023 }
|
|
1024 else
|
|
1025 {
|
|
1026 printf("\n*** 'sdl-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version);
|
|
1027 printf("*** of SDL required is %d.%d.%d. If sdl-config is correct, then it is\n", major, minor, micro);
|
|
1028 printf("*** best to upgrade to the required version.\n");
|
|
1029 printf("*** If sdl-config was wrong, set the environment variable SDL_CONFIG\n");
|
|
1030 printf("*** to point to the correct copy of sdl-config, and remove the file\n");
|
|
1031 printf("*** config.cache before re-running configure\n");
|
|
1032 return 1;
|
|
1033 }
|
|
1034 }
|
|
1035
|
|
1036 ],, no_sdl=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
|
|
1037 CFLAGS="$ac_save_CFLAGS"
|
|
1038 LIBS="$ac_save_LIBS"
|
|
1039 fi
|
|
1040 fi
|
|
1041 if test "x$no_sdl" = x ; then
|
|
1042 AC_MSG_RESULT(yes)
|
|
1043 ifelse([$2], , :, [$2])
|
|
1044 else
|
|
1045 AC_MSG_RESULT(no)
|
|
1046 if test "$SDL_CONFIG" = "no" ; then
|
|
1047 echo "*** The sdl-config script installed by SDL could not be found"
|
|
1048 echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in"
|
|
1049 echo "*** your path, or set the SDL_CONFIG environment variable to the"
|
|
1050 echo "*** full path to sdl-config."
|
|
1051 else
|
|
1052 if test -f conf.sdltest ; then
|
|
1053 :
|
|
1054 else
|
|
1055 echo "*** Could not run SDL test program, checking why..."
|
|
1056 CFLAGS="$CFLAGS $SDL_CFLAGS"
|
|
1057 LIBS="$LIBS $SDL_LIBS"
|
|
1058 AC_TRY_LINK([
|
|
1059 #include <stdio.h>
|
|
1060 #include "SDL.h"
|
|
1061
|
|
1062 int main(int argc, char *argv[])
|
|
1063 { return 0; }
|
|
1064 #undef main
|
|
1065 #define main K_and_R_C_main
|
|
1066 ], [ return 0; ],
|
|
1067 [ echo "*** The test program compiled, but did not run. This usually means"
|
|
1068 echo "*** that the run-time linker is not finding SDL or finding the wrong"
|
|
1069 echo "*** version of SDL. If it is not finding SDL, you'll need to set your"
|
|
1070 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
|
|
1071 echo "*** to the installed location Also, make sure you have run ldconfig if that"
|
|
1072 echo "*** is required on your system"
|
|
1073 echo "***"
|
|
1074 echo "*** If you have an old version installed, it is best to remove it, although"
|
|
1075 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
|
|
1076 [ echo "*** The test program failed to compile or link. See the file config.log for the"
|
|
1077 echo "*** exact error that occured. This usually means SDL was incorrectly installed"
|
|
1078 echo "*** or that you have moved SDL since it was installed. In the latter case, you"
|
|
1079 echo "*** may want to edit the sdl-config script: $SDL_CONFIG" ])
|
|
1080 CFLAGS="$ac_save_CFLAGS"
|
|
1081 LIBS="$ac_save_LIBS"
|
|
1082 fi
|
|
1083 fi
|
|
1084 SDL_CFLAGS=""
|
|
1085 SDL_LIBS=""
|
|
1086 ifelse([$3], , :, [$3])
|
|
1087 fi
|
|
1088 AC_SUBST(SDL_CFLAGS)
|
|
1089 AC_SUBST(SDL_LIBS)
|
|
1090 case "$target" in
|
|
1091 *-*-darwin*)
|
|
1092 SDL_APPLE_CREATOR="????"
|
|
1093 AC_SUBST(SDL_APPLE_CREATOR)
|
|
1094 ;;
|
|
1095 esac
|
|
1096 rm -f conf.sdltest
|
|
1097 ])
|
|
1098
|
|
1099 # Configure paths for libmikmod
|
|
1100 #
|
|
1101 # Derived from glib.m4 (Owen Taylor 97-11-3)
|
|
1102 # Improved by Chris Butler
|
|
1103 #
|
|
1104
|
|
1105 dnl AM_PATH_LIBMIKMOD([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
|
|
1106 dnl Test for libmikmod, and define LIBMIKMOD_CFLAGS, LIBMIKMOD_LIBS and
|
|
1107 dnl LIBMIKMOD_LDADD
|
|
1108 dnl
|
|
1109 AC_DEFUN(AM_PATH_LIBMIKMOD,
|
|
1110 [dnl
|
|
1111 dnl Get the cflags and libraries from the libmikmod-config script
|
|
1112 dnl
|
|
1113 AC_ARG_WITH(libmikmod-prefix,[ --with-libmikmod-prefix=PFX Prefix where libmikmod is installed (optional)],
|
|
1114 libmikmod_config_prefix="$withval", libmikmod_config_prefix="")
|
|
1115 AC_ARG_WITH(libmikmod-exec-prefix,[ --with-libmikmod-exec-prefix=PFX Exec prefix where libmikmod is installed (optional)],
|
|
1116 libmikmod_config_exec_prefix="$withval", libmikmod_config_exec_prefix="")
|
|
1117 AC_ARG_ENABLE(libmikmodtest, [ --disable-libmikmodtest Do not try to compile and run a test libmikmod program],
|
|
1118 , enable_libmikmodtest=yes)
|
|
1119
|
|
1120 if test x$libmikmod_config_exec_prefix != x ; then
|
|
1121 libmikmod_config_args="$libmikmod_config_args --exec-prefix=$libmikmod_config_exec_prefix"
|
|
1122 if test x${LIBMIKMOD_CONFIG+set} != xset ; then
|
|
1123 LIBMIKMOD_CONFIG=$libmikmod_config_exec_prefix/bin/libmikmod-config
|
|
1124 fi
|
|
1125 fi
|
|
1126 if test x$libmikmod_config_prefix != x ; then
|
|
1127 libmikmod_config_args="$libmikmod_config_args --prefix=$libmikmod_config_prefix"
|
|
1128 if test x${LIBMIKMOD_CONFIG+set} != xset ; then
|
|
1129 LIBMIKMOD_CONFIG=$libmikmod_config_prefix/bin/libmikmod-config
|
|
1130 fi
|
|
1131 fi
|
|
1132
|
|
1133 AC_PATH_PROG(LIBMIKMOD_CONFIG, libmikmod-config, no)
|
|
1134 min_libmikmod_version=ifelse([$1], ,3.1.5,$1)
|
|
1135 AC_MSG_CHECKING(for libmikmod - version >= $min_libmikmod_version)
|
|
1136 no_libmikmod=""
|
|
1137 if test "$LIBMIKMOD_CONFIG" = "no" ; then
|
|
1138 no_libmikmod=yes
|
|
1139 else
|
|
1140 LIBMIKMOD_CFLAGS=`$LIBMIKMOD_CONFIG $libmikmod_config_args --cflags`
|
|
1141 LIBMIKMOD_LIBS=`$LIBMIKMOD_CONFIG $libmikmod_config_args --libs`
|
|
1142 LIBMIKMOD_LDADD=`$LIBMIKMOD_CONFIG $libmikmod_config_args --ldadd`
|
|
1143 libmikmod_config_major_version=`$LIBMIKMOD_CONFIG $libmikmod_config_args --version | \
|
|
1144 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\).*/\1/'`
|
|
1145 libmikmod_config_minor_version=`$LIBMIKMOD_CONFIG $libmikmod_config_args --version | \
|
|
1146 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\).*/\2/'`
|
|
1147 libmikmod_config_micro_version=`$LIBMIKMOD_CONFIG $libmikmod_config_args --version | \
|
|
1148 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\).*/\3/'`
|
|
1149 if test "x$enable_libmikmodtest" = "xyes" ; then
|
|
1150 ac_save_CFLAGS="$CFLAGS"
|
|
1151 ac_save_LIBS="$LIBS"
|
|
1152 AC_LANG_SAVE
|
|
1153 AC_LANG_C
|
|
1154 CFLAGS="$CFLAGS $LIBMIKMOD_CFLAGS $LIBMIKMOD_LDADD"
|
|
1155 LIBS="$LIBMIKMOD_LIBS $LIBS"
|
|
1156 dnl
|
|
1157 dnl Now check if the installed libmikmod is sufficiently new. (Also sanity
|
|
1158 dnl checks the results of libmikmod-config to some extent
|
|
1159 dnl
|
|
1160 rm -f conf.mikmodtest
|
|
1161 AC_TRY_RUN([
|
|
1162 #include <mikmod.h>
|
|
1163 #include <stdio.h>
|
|
1164 #include <stdlib.h>
|
|
1165
|
|
1166 char* my_strdup (char *str)
|
|
1167 {
|
|
1168 char *new_str;
|
|
1169
|
|
1170 if (str) {
|
|
1171 new_str = malloc ((strlen (str) + 1) * sizeof(char));
|
|
1172 strcpy (new_str, str);
|
|
1173 } else
|
|
1174 new_str = NULL;
|
|
1175
|
|
1176 return new_str;
|
|
1177 }
|
|
1178
|
|
1179 int main()
|
|
1180 {
|
|
1181 int major,minor,micro;
|
|
1182 int libmikmod_major_version,libmikmod_minor_version,libmikmod_micro_version;
|
|
1183 char *tmp_version;
|
|
1184
|
|
1185 system("touch conf.mikmodtest");
|
|
1186
|
|
1187 /* HP/UX 9 (%@#!) writes to sscanf strings */
|
|
1188 tmp_version = my_strdup("$min_libmikmod_version");
|
|
1189 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
|
|
1190 printf("%s, bad version string\n", "$min_libmikmod_version");
|
|
1191 exit(1);
|
|
1192 }
|
|
1193
|
|
1194 libmikmod_major_version=(MikMod_GetVersion() >> 16) & 255;
|
|
1195 libmikmod_minor_version=(MikMod_GetVersion() >> 8) & 255;
|
|
1196 libmikmod_micro_version=(MikMod_GetVersion() ) & 255;
|
|
1197
|
|
1198 if ((libmikmod_major_version != $libmikmod_config_major_version) ||
|
|
1199 (libmikmod_minor_version != $libmikmod_config_minor_version) ||
|
|
1200 (libmikmod_micro_version != $libmikmod_config_micro_version))
|
|
1201 {
|
|
1202 printf("\n*** 'libmikmod-config --version' returned %d.%d.%d, but libmikmod (%d.%d.%d)\n",
|
|
1203 $libmikmod_config_major_version, $libmikmod_config_minor_version, $libmikmod_config_micro_version,
|
|
1204 libmikmod_major_version, libmikmod_minor_version, libmikmod_micro_version);
|
|
1205 printf ("*** was found! If libmikmod-config was correct, then it is best\n");
|
|
1206 printf ("*** to remove the old version of libmikmod. You may also be able to fix the error\n");
|
|
1207 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
|
|
1208 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
|
|
1209 printf("*** required on your system.\n");
|
|
1210 printf("*** If libmikmod-config was wrong, set the environment variable LIBMIKMOD_CONFIG\n");
|
|
1211 printf("*** to point to the correct copy of libmikmod-config, and remove the file config.cache\n");
|
|
1212 printf("*** before re-running configure\n");
|
|
1213 }
|
|
1214 else if ((libmikmod_major_version != LIBMIKMOD_VERSION_MAJOR) ||
|
|
1215 (libmikmod_minor_version != LIBMIKMOD_VERSION_MINOR) ||
|
|
1216 (libmikmod_micro_version != LIBMIKMOD_REVISION))
|
|
1217 {
|
|
1218 printf("*** libmikmod header files (version %d.%d.%d) do not match\n",
|
|
1219 LIBMIKMOD_VERSION_MAJOR, LIBMIKMOD_VERSION_MINOR, LIBMIKMOD_REVISION);
|
|
1220 printf("*** library (version %d.%d.%d)\n",
|
|
1221 libmikmod_major_version, libmikmod_minor_version, libmikmod_micro_version);
|
|
1222 }
|
|
1223 else
|
|
1224 {
|
|
1225 if ((libmikmod_major_version > major) ||
|
|
1226 ((libmikmod_major_version == major) && (libmikmod_minor_version > minor)) ||
|
|
1227 ((libmikmod_major_version == major) && (libmikmod_minor_version == minor) && (libmikmod_micro_version >= micro)))
|
|
1228 {
|
|
1229 return 0;
|
|
1230 }
|
|
1231 else
|
|
1232 {
|
|
1233 printf("\n*** An old version of libmikmod (%d.%d.%d) was found.\n",
|
|
1234 libmikmod_major_version, libmikmod_minor_version, libmikmod_micro_version);
|
|
1235 printf("*** You need a version of libmikmod newer than %d.%d.%d.\n",
|
|
1236 major, minor, micro);
|
|
1237 printf("***\n");
|
|
1238 printf("*** If you have already installed a sufficiently new version, this error\n");
|
|
1239 printf("*** probably means that the wrong copy of the libmikmod-config shell script is\n");
|
|
1240 printf("*** being found. The easiest way to fix this is to remove the old version\n");
|
|
1241 printf("*** of libmikmod, but you can also set the LIBMIKMOD_CONFIG environment to point to the\n");
|
|
1242 printf("*** correct copy of libmikmod-config. (In this case, you will have to\n");
|
|
1243 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
|
|
1244 printf("*** so that the correct libraries are found at run-time))\n");
|
|
1245 }
|
|
1246 }
|
|
1247 return 1;
|
|
1248 }
|
|
1249 ],, no_libmikmod=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
|
|
1250 CFLAGS="$ac_save_CFLAGS"
|
|
1251 LIBS="$ac_save_LIBS"
|
|
1252 AC_LANG_RESTORE
|
|
1253 fi
|
|
1254 fi
|
|
1255 if test "x$no_libmikmod" = x ; then
|
|
1256 AC_MSG_RESULT([yes, `$LIBMIKMOD_CONFIG --version`])
|
|
1257 ifelse([$2], , :, [$2])
|
|
1258 else
|
|
1259 AC_MSG_RESULT(no)
|
|
1260 if test "$LIBMIKMOD_CONFIG" = "no" ; then
|
|
1261 echo "*** The libmikmod-config script installed by libmikmod could not be found"
|
|
1262 echo "*** If libmikmod was installed in PREFIX, make sure PREFIX/bin is in"
|
|
1263 echo "*** your path, or set the LIBMIKMOD_CONFIG environment variable to the"
|
|
1264 echo "*** full path to libmikmod-config."
|
|
1265 else
|
|
1266 if test -f conf.mikmodtest ; then
|
|
1267 :
|
|
1268 else
|
|
1269 echo "*** Could not run libmikmod test program, checking why..."
|
|
1270 CFLAGS="$CFLAGS $LIBMIKMOD_CFLAGS"
|
|
1271 LIBS="$LIBS $LIBMIKMOD_LIBS"
|
|
1272 AC_LANG_SAVE
|
|
1273 AC_LANG_C
|
|
1274 AC_TRY_LINK([
|
|
1275 #include <mikmod.h>
|
|
1276 #include <stdio.h>
|
|
1277 ], [ return (MikMod_GetVersion()!=0); ],
|
|
1278 [ echo "*** The test program compiled, but did not run. This usually means"
|
|
1279 echo "*** that the run-time linker is not finding libmikmod or finding the wrong"
|
|
1280 echo "*** version of libmikmod. If it is not finding libmikmod, you'll need to set your"
|
|
1281 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
|
|
1282 echo "*** to the installed location. Also, make sure you have run ldconfig if that"
|
|
1283 echo "*** is required on your system."
|
|
1284 echo "***"
|
|
1285 echo "*** If you have an old version installed, it is best to remove it, although"
|
|
1286 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
|
|
1287 [ echo "*** The test program failed to compile or link. See the file config.log for the"
|
|
1288 echo "*** exact error that occured. This usually means libmikmod was incorrectly installed"
|
|
1289 echo "*** or that you have moved libmikmod since it was installed. In the latter case, you"
|
|
1290 echo "*** may want to edit the libmikmod-config script: $LIBMIKMOD_CONFIG" ])
|
|
1291 CFLAGS="$ac_save_CFLAGS"
|
|
1292 LIBS="$ac_save_LIBS"
|
|
1293 AC_LANG_RESTORE
|
|
1294 fi
|
|
1295 fi
|
|
1296 LIBMIKMOD_CFLAGS=""
|
|
1297 LIBMIKMOD_LIBS=""
|
|
1298 LIBMIKMOD_LDADD=""
|
|
1299 ifelse([$3], , :, [$3])
|
|
1300 fi
|
|
1301 AC_SUBST(LIBMIKMOD_CFLAGS)
|
|
1302 AC_SUBST(LIBMIKMOD_LIBS)
|
|
1303 AC_SUBST(LIBMIKMOD_LDADD)
|
|
1304 rm -f conf.mikmodtest
|
|
1305 ])
|
|
1306
|
|
1307 # Configure paths for libvorbis
|
|
1308 # Jack Moffitt <jack@icecast.org> 10-21-2000
|
|
1309 # Shamelessly stolen from Owen Taylor and Manish Singh
|
|
1310
|
|
1311 dnl AM_PATH_VORBIS([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
|
|
1312 dnl Test for libvorbis, and define VORBIS_CFLAGS and VORBIS_LIBS
|
|
1313 dnl
|
|
1314 AC_DEFUN(AM_PATH_VORBIS,
|
|
1315 [dnl
|
|
1316 dnl Get the cflags and libraries
|
|
1317 dnl
|
|
1318 AC_ARG_WITH(vorbis-prefix,[ --with-vorbis-prefix=PFX Prefix where libvorbis is installed (optional)], vorbis_prefix="$withval", vorbis_prefix="")
|
|
1319 AC_ARG_ENABLE(vorbistest, [ --disable-vorbistest Do not try to compile and run a test Vorbis program],, enable_vorbistest=yes)
|
|
1320
|
|
1321 if test "x$vorbis_prefix" != "xNONE" ; then
|
|
1322 vorbis_args="$vorbis_args --prefix=$vorbis_prefix"
|
|
1323 VORBIS_CFLAGS="-I$vorbis_prefix/include"
|
|
1324 VORBIS_LIBDIR="-L$vorbis_prefix/lib"
|
|
1325 elif test "$prefix" != ""; then
|
|
1326 vorbis_args="$vorbis_args --prefix=$prefix"
|
|
1327 VORBIS_CFLAGS="-I$prefix/include"
|
|
1328 VORBIS_LIBDIR="-L$prefix/lib"
|
|
1329 fi
|
|
1330
|
|
1331 VORBIS_LIBS="$VORBIS_LIBDIR -lvorbis -lm"
|
|
1332 VORBISFILE_LIBS="-lvorbisfile"
|
|
1333 VORBISENC_LIBS="-lvorbisenc"
|
|
1334
|
|
1335 AC_MSG_CHECKING(for Vorbis)
|
|
1336 no_vorbis=""
|
|
1337
|
|
1338
|
|
1339 if test "x$enable_vorbistest" = "xyes" ; then
|
|
1340 ac_save_CFLAGS="$CFLAGS"
|
|
1341 ac_save_LIBS="$LIBS"
|
|
1342 CFLAGS="$CFLAGS $VORBIS_CFLAGS"
|
|
1343 LIBS="$LIBS $VORBIS_LIBS $OGG_LIBS"
|
|
1344 dnl
|
|
1345 dnl Now check if the installed Vorbis is sufficiently new.
|
|
1346 dnl
|
|
1347 rm -f conf.vorbistest
|
|
1348 AC_TRY_RUN([
|
|
1349 #include <stdio.h>
|
|
1350 #include <stdlib.h>
|
|
1351 #include <string.h>
|
|
1352 #include <vorbis/codec.h>
|
|
1353
|
|
1354 int main ()
|
|
1355 {
|
|
1356 system("touch conf.vorbistest");
|
|
1357 return 0;
|
|
1358 }
|
|
1359
|
|
1360 ],, no_vorbis=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
|
|
1361 CFLAGS="$ac_save_CFLAGS"
|
|
1362 LIBS="$ac_save_LIBS"
|
|
1363 fi
|
|
1364
|
|
1365 if test "x$no_vorbis" = "x" ; then
|
|
1366 AC_MSG_RESULT(yes)
|
|
1367 ifelse([$1], , :, [$1])
|
|
1368 else
|
|
1369 AC_MSG_RESULT(no)
|
|
1370 if test -f conf.vorbistest ; then
|
|
1371 :
|
|
1372 else
|
|
1373 echo "*** Could not run Vorbis test program, checking why..."
|
|
1374 CFLAGS="$CFLAGS $VORBIS_CFLAGS"
|
|
1375 LIBS="$LIBS $VORBIS_LIBS $OGG_LIBS"
|
|
1376 AC_TRY_LINK([
|
|
1377 #include <stdio.h>
|
|
1378 #include <vorbis/codec.h>
|
|
1379 ], [ return 0; ],
|
|
1380 [ echo "*** The test program compiled, but did not run. This usually means"
|
|
1381 echo "*** that the run-time linker is not finding Vorbis or finding the wrong"
|
|
1382 echo "*** version of Vorbis. If it is not finding Vorbis, you'll need to set your"
|
|
1383 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
|
|
1384 echo "*** to the installed location Also, make sure you have run ldconfig if that"
|
|
1385 echo "*** is required on your system"
|
|
1386 echo "***"
|
|
1387 echo "*** If you have an old version installed, it is best to remove it, although"
|
|
1388 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
|
|
1389 [ echo "*** The test program failed to compile or link. See the file config.log for the"
|
|
1390 echo "*** exact error that occured. This usually means Vorbis was incorrectly installed"
|
|
1391 echo "*** or that you have moved Vorbis since it was installed." ])
|
|
1392 CFLAGS="$ac_save_CFLAGS"
|
|
1393 LIBS="$ac_save_LIBS"
|
|
1394 fi
|
|
1395 VORBIS_CFLAGS=""
|
|
1396 VORBIS_LIBS=""
|
|
1397 VORBISFILE_LIBS=""
|
|
1398 VORBISENC_LIBS=""
|
|
1399 ifelse([$2], , :, [$2])
|
|
1400 fi
|
|
1401 AC_SUBST(VORBIS_CFLAGS)
|
|
1402 AC_SUBST(VORBIS_LIBS)
|
|
1403 AC_SUBST(VORBISFILE_LIBS)
|
|
1404 AC_SUBST(VORBISENC_LIBS)
|
|
1405 rm -f conf.vorbistest
|
|
1406 ])
|
|
1407
|
|
1408 # Configure paths for SMPEG
|
|
1409 # Nicolas Vignal 11/19/2000
|
|
1410 # stolen from Sam Lantinga
|
|
1411 # stolen from Manish Singh
|
|
1412 # stolen back from Frank Belew
|
|
1413 # stolen from Manish Singh
|
|
1414 # Shamelessly stolen from Owen Taylor
|
|
1415
|
|
1416 dnl AM_PATH_SMPEG([MINIMUM-VERSION, [ACTION-IF-FOUND [,
|
|
1417 ACTION-IF-NOT-FOUND]]])
|
|
1418 dnl Test for SMPEG, and define SMPEG_CFLAGS and SMPEG_LIBS
|
|
1419 dnl
|
|
1420 AC_DEFUN(AM_PATH_SMPEG,
|
|
1421 [dnl
|
|
1422 dnl Get the cflags and libraries from the smpeg-config script
|
|
1423 dnl
|
|
1424 AC_ARG_WITH(smpeg-prefix,[ --with-smpeg-prefix=PFX Prefix where SMPEG is
|
|
1425 installed (optional)],
|
|
1426 smpeg_prefix="$withval", smpeg_prefix="")
|
|
1427 AC_ARG_WITH(smpeg-exec-prefix,[ --with-smpeg-exec-prefix=PFX Exec prefix
|
|
1428 where SMPEG is installed (optional)],
|
|
1429 smpeg_exec_prefix="$withval", smpeg_exec_prefix="")
|
|
1430 AC_ARG_ENABLE(smpegtest, [ --disable-smpegtest Do not try to compile
|
|
1431 and run a test SMPEG program],
|
|
1432 , enable_smpegtest=yes)
|
|
1433
|
|
1434 if test x$smpeg_exec_prefix != x ; then
|
|
1435 smpeg_args="$smpeg_args --exec-prefix=$smpeg_exec_prefix"
|
|
1436 if test x${SMPEG_CONFIG+set} != xset ; then
|
|
1437 SMPEG_CONFIG=$smpeg_exec_prefix/bin/smpeg-config
|
|
1438 fi
|
|
1439 fi
|
|
1440 if test x$smpeg_prefix != x ; then
|
|
1441 smpeg_args="$smpeg_args --prefix=$smpeg_prefix"
|
|
1442 if test x${SMPEG_CONFIG+set} != xset ; then
|
|
1443 SMPEG_CONFIG=$smpeg_prefix/bin/smpeg-config
|
|
1444 fi
|
|
1445 fi
|
|
1446
|
|
1447 AC_PATH_PROG(SMPEG_CONFIG, smpeg-config, no)
|
|
1448 min_smpeg_version=ifelse([$1], ,0.2.7,$1)
|
|
1449 AC_MSG_CHECKING(for SMPEG - version >= $min_smpeg_version)
|
|
1450 no_smpeg=""
|
|
1451 if test "$SMPEG_CONFIG" = "no" ; then
|
|
1452 no_smpeg=yes
|
|
1453 else
|
|
1454 SMPEG_CFLAGS=`$SMPEG_CONFIG $smpegconf_args --cflags`
|
|
1455 SMPEG_LIBS=`$SMPEG_CONFIG $smpegconf_args --libs`
|
|
1456
|
|
1457 smpeg_major_version=`$SMPEG_CONFIG $smpeg_args --version | \
|
|
1458 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
|
|
1459 smpeg_minor_version=`$SMPEG_CONFIG $smpeg_args --version | \
|
|
1460 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
|
|
1461 smpeg_micro_version=`$SMPEG_CONFIG $smpeg_config_args --version | \
|
|
1462 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
|
|
1463 if test "x$enable_smpegtest" = "xyes" ; then
|
|
1464 ac_save_CFLAGS="$CFLAGS"
|
|
1465 ac_save_LIBS="$LIBS"
|
|
1466 CFLAGS="$CFLAGS $SMPEG_CFLAGS $SDL_CFLAGS"
|
|
1467 LIBS="$LIBS $SMPEG_LIBS $SDL_LIBS"
|
|
1468 dnl
|
|
1469 dnl Now check if the installed SMPEG is sufficiently new. (Also sanity
|
|
1470 dnl checks the results of smpeg-config to some extent
|
|
1471 dnl
|
|
1472 rm -f conf.smpegtest
|
|
1473 AC_TRY_RUN([
|
|
1474 #include <stdio.h>
|
|
1475 #include <stdlib.h>
|
|
1476 #include <string.h>
|
|
1477 #include "smpeg.h"
|
|
1478
|
|
1479 char*
|
|
1480 my_strdup (char *str)
|
|
1481 {
|
|
1482 char *new_str;
|
|
1483
|
|
1484 if (str)
|
|
1485 {
|
|
1486 new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
|
|
1487 strcpy (new_str, str);
|
|
1488 }
|
|
1489 else
|
|
1490 new_str = NULL;
|
|
1491
|
|
1492 return new_str;
|
|
1493 }
|
|
1494
|
|
1495 int main (int argc, char *argv[])
|
|
1496 {
|
|
1497 int major, minor, micro;
|
|
1498 char *tmp_version;
|
|
1499
|
|
1500 /* This hangs on some systems (?)
|
|
1501 system ("touch conf.smpegtest");
|
|
1502 */
|
|
1503 { FILE *fp = fopen("conf.smpegtest", "a"); if ( fp ) fclose(fp); }
|
|
1504
|
|
1505 /* HP/UX 9 (%@#!) writes to sscanf strings */
|
|
1506 tmp_version = my_strdup("$min_smpeg_version");
|
|
1507 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
|
|
1508 printf("%s, bad version string\n", "$min_smpeg_version");
|
|
1509 exit(1);
|
|
1510 }
|
|
1511
|
|
1512 if (($smpeg_major_version > major) ||
|
|
1513 (($smpeg_major_version == major) && ($smpeg_minor_version > minor)) ||
|
|
1514 (($smpeg_major_version == major) && ($smpeg_minor_version == minor)
|
|
1515 && ($smpeg_micro_version >= micro)))
|
|
1516 {
|
|
1517 return 0;
|
|
1518 }
|
|
1519 else
|
|
1520 {
|
|
1521 printf("\n*** 'smpeg-config --version' returned %d.%d.%d, but the
|
|
1522 minimum version\n", $smpeg_major_version, $smpeg_minor_version,
|
|
1523 $smpeg_micro_version);
|
|
1524 printf("*** of SMPEG required is %d.%d.%d. If smpeg-config is
|
|
1525 correct, then it is\n", major, minor, micro);
|
|
1526 printf("*** best to upgrade to the required version.\n");
|
|
1527 printf("*** If smpeg-config was wrong, set the environment variable
|
|
1528 SMPEG_CONFIG\n");
|
|
1529 printf("*** to point to the correct copy of smpeg-config, and remove
|
|
1530 the file\n");
|
|
1531 printf("*** config.cache before re-running configure\n");
|
|
1532 return 1;
|
|
1533 }
|
|
1534 }
|
|
1535
|
|
1536 ],, no_smpeg=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
|
|
1537 CFLAGS="$ac_save_CFLAGS"
|
|
1538 LIBS="$ac_save_LIBS"
|
|
1539 fi
|
|
1540 fi
|
|
1541 if test "x$no_smpeg" = x ; then
|
|
1542 AC_MSG_RESULT(yes)
|
|
1543 ifelse([$2], , :, [$2])
|
|
1544 else
|
|
1545 AC_MSG_RESULT(no)
|
|
1546 if test "$SMPEG_CONFIG" = "no" ; then
|
|
1547 echo "*** The smpeg-config script installed by SMPEG could not be
|
|
1548 found"
|
|
1549 echo "*** If SMPEG was installed in PREFIX, make sure PREFIX/bin is
|
|
1550 in"
|
|
1551 echo "*** your path, or set the SMPEG_CONFIG environment variable to
|
|
1552 the"
|
|
1553 echo "*** full path to smpeg-config."
|
|
1554 else
|
|
1555 if test -f conf.smpegtest ; then
|
|
1556 :
|
|
1557 else
|
|
1558 echo "*** Could not run SMPEG test program, checking why..."
|
|
1559 CFLAGS="$CFLAGS $SMPEG_CFLAGS $SDL_CFLAGS"
|
|
1560 LIBS="$LIBS $SMPEG_LIBS $SDL_LIBS"
|
|
1561 AC_TRY_LINK([
|
|
1562 #include <stdio.h>
|
|
1563 #include "smpeg.h"
|
|
1564 ], [ return 0; ],
|
|
1565 [ echo "*** The test program compiled, but did not run. This
|
|
1566 usually means"
|
|
1567 echo "*** that the run-time linker is not finding SMPEG or
|
|
1568 finding the wrong"
|
|
1569 echo "*** version of SMPEG. If it is not finding SMPEG, you'll
|
|
1570 need to set your"
|
|
1571 echo "*** LD_LIBRARY_PATH environment variable, or edit
|
|
1572 /etc/ld.so.conf to point"
|
|
1573 echo "*** to the installed location Also, make sure you have run
|
|
1574 ldconfig if that"
|
|
1575 echo "*** is required on your system"
|
|
1576 echo "***"
|
|
1577 echo "*** If you have an old version installed, it is best to
|
|
1578 remove it, although"
|
|
1579 echo "*** you may also be able to get things to work by modifying
|
|
1580 LD_LIBRARY_PATH"],
|
|
1581 [ echo "*** The test program failed to compile or link. See the
|
|
1582 file config.log for the"
|
|
1583 echo "*** exact error that occured. This usually means SMPEG was
|
|
1584 incorrectly installed"
|
|
1585 echo "*** or that you have moved SMPEG since it was installed. In
|
|
1586 the latter case, you"
|
|
1587 echo "*** may want to edit the smpeg-config script:
|
|
1588 $SMPEG_CONFIG" ])
|
|
1589 CFLAGS="$ac_save_CFLAGS"
|
|
1590 LIBS="$ac_save_LIBS"
|
|
1591 fi
|
|
1592 fi
|
|
1593 SMPEG_CFLAGS=""
|
|
1594 SMPEG_LIBS=""
|
|
1595 ifelse([$3], , :, [$3])
|
|
1596 fi
|
|
1597 AC_SUBST(SMPEG_CFLAGS)
|
|
1598 AC_SUBST(SMPEG_LIBS)
|
|
1599 rm -f conf.smpegtest
|
|
1600 ])
|
|
1601
|