annotate aclocal.m4 @ 68:0b53ace8b875

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