1
dnl aclocal.m4 generated automatically by aclocal 1.4-p4
3
dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
4
dnl This file is free software; the Free Software Foundation
5
dnl gives unlimited permission to copy and/or distribute it,
6
dnl with or without modifications, as long as this notice is preserved.
8
dnl This program is distributed in the hope that it will be useful,
9
dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10
dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11
dnl PARTICULAR PURPOSE.
13
# Do all the work for Automake. This macro actually does too much --
14
# some checks are only needed if your package does certain things.
15
# But this isn't really a big deal.
20
dnl AM_INIT_AUTOMAKE(package,version, [no-define])
22
AC_DEFUN(AM_INIT_AUTOMAKE,
23
[AC_REQUIRE([AC_PROG_INSTALL])
28
dnl test to see if srcdir already configured
29
if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
30
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
33
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
34
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
35
AC_REQUIRE([AM_SANITY_CHECK])
36
AC_REQUIRE([AC_ARG_PROGRAM])
37
dnl FIXME This is truly gross.
38
missing_dir=`cd $ac_aux_dir && pwd`
39
AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
40
AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
41
AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
42
AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
43
AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
44
AC_REQUIRE([AC_PROG_MAKE_SET])])
47
# Check to make sure that the build environment is sane.
50
AC_DEFUN(AM_SANITY_CHECK,
51
[AC_MSG_CHECKING([whether build environment is sane])
54
echo timestamp > conftestfile
55
# Do `set' in a subshell so we don't clobber the current shell's
56
# arguments. Must try -L first in case configure is actually a
57
# symlink; some systems play weird games with the mod time of symlinks
58
# (eg FreeBSD returns the mod time of the symlink's containing
61
set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
62
if test "[$]*" = "X"; then
64
set X `ls -t $srcdir/configure conftestfile`
66
if test "[$]*" != "X $srcdir/configure conftestfile" \
67
&& test "[$]*" != "X conftestfile $srcdir/configure"; then
69
# If neither matched, then we have a broken ls. This can happen
70
# if, for instance, CONFIG_SHELL is bash and it inherits a
71
# broken ls alias from the environment. This has actually
72
# happened. Such a system could not be considered "sane".
73
AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
74
alias in your environment])
77
test "[$]2" = conftestfile
83
AC_MSG_ERROR([newly created file is older than distributed files!
84
Check your system clock])
89
dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
90
dnl The program must properly implement --version.
91
AC_DEFUN(AM_MISSING_PROG,
92
[AC_MSG_CHECKING(for working $2)
93
# Run test in a subshell; some versions of sh will print an error if
94
# an executable is not found, even if stderr is redirected.
95
# Redirect stdin to placate older versions of autoconf. Sigh.
96
if ($2 --version) < /dev/null > /dev/null 2>&1; then
101
AC_MSG_RESULT(missing)
105
# Like AC_CONFIG_HEADER, but automatically create stamp file.
107
AC_DEFUN(AM_CONFIG_HEADER,
109
AC_CONFIG_HEADER([$1])
110
dnl When config.status generates a header, we must update the stamp-h file.
111
dnl This file resides in the same directory as the config header
112
dnl that is generated. We must strip everything past the first ":",
113
dnl and everything past the last "/".
114
AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
115
ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
116
<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
118
for am_file in <<$1>>; do
119
case " <<$>>CONFIG_HEADERS " in
120
*" <<$>>am_file "*<<)>>
121
echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
124
am_indx=`expr "<<$>>am_indx" + 1`
128
# Configure paths for SDL
129
# Sam Lantinga 9/21/99
130
# stolen from Manish Singh
131
# stolen back from Frank Belew
132
# stolen from Manish Singh
133
# Shamelessly stolen from Owen Taylor
135
# hacked on by Branden Robinson and Eric Gillespie, Jr. to add
136
# SDL_LIBS_FOR_LIBS variable, because it is not legal to link static
137
# objects into shared ones on several architectures, including PowerPC,
138
# PA-RISC, IA64, MIPS, ...
140
dnl AM_PATH_SDL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
141
dnl Test for SDL, and define SDL_CFLAGS, SDL_LIBS, and SDL_LIBS_FOR_LIBS
143
AC_DEFUN(AM_PATH_SDL,
145
dnl Get the cflags and libraries from the sdl-config script
147
AC_ARG_WITH(sdl-prefix,[ --with-sdl-prefix=PFX Prefix where SDL is installed (optional)],
148
sdl_prefix="$withval", sdl_prefix="")
149
AC_ARG_WITH(sdl-exec-prefix,[ --with-sdl-exec-prefix=PFX Exec prefix where SDL is installed (optional)],
150
sdl_exec_prefix="$withval", sdl_exec_prefix="")
151
AC_ARG_ENABLE(sdltest, [ --disable-sdltest Do not try to compile and run a test SDL program],
152
, enable_sdltest=yes)
154
if test x$sdl_exec_prefix != x ; then
155
sdl_args="$sdl_args --exec-prefix=$sdl_exec_prefix"
156
if test x${SDL_CONFIG+set} != xset ; then
157
SDL_CONFIG=$sdl_exec_prefix/bin/sdl-config
160
if test x$sdl_prefix != x ; then
161
sdl_args="$sdl_args --prefix=$sdl_prefix"
162
if test x${SDL_CONFIG+set} != xset ; then
163
SDL_CONFIG=$sdl_prefix/bin/sdl-config
167
AC_PATH_PROG(SDL_CONFIG, sdl-config, no)
168
min_sdl_version=ifelse([$1], ,0.11.0,$1)
169
AC_MSG_CHECKING(for SDL - version >= $min_sdl_version)
171
if test "$SDL_CONFIG" = "no" ; then
174
SDL_CFLAGS=`$SDL_CONFIG $sdlconf_args --cflags`
175
SDL_LIBS=`$SDL_CONFIG $sdlconf_args --libs`
176
SDL_LIBS_FOR_LIBS=`$SDL_CONFIG $sdlconf_args --library-libs`
177
SDL_LIBS_FOR_PLUGINS=`$SDL_CONFIG $sdlconf_args --plugin-libs`
179
sdl_major_version=`$SDL_CONFIG $sdl_args --version | \
180
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
181
sdl_minor_version=`$SDL_CONFIG $sdl_args --version | \
182
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
183
sdl_micro_version=`$SDL_CONFIG $sdl_config_args --version | \
184
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
185
if test "x$enable_sdltest" = "xyes" ; then
186
ac_save_CFLAGS="$CFLAGS"
188
CFLAGS="$CFLAGS $SDL_CFLAGS"
189
LIBS="$LIBS $SDL_LIBS"
191
dnl Now check if the installed SDL is sufficiently new. (Also sanity
192
dnl checks the results of sdl-config to some extent
202
my_strdup (char *str)
208
new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
209
strcpy (new_str, str);
217
int main (int argc, char *argv[])
219
int major, minor, micro;
222
/* This hangs on some systems (?)
223
system ("touch conf.sdltest");
225
{ FILE *fp = fopen("conf.sdltest", "a"); if ( fp ) fclose(fp); }
227
/* HP/UX 9 (%@#!) writes to sscanf strings */
228
tmp_version = my_strdup("$min_sdl_version");
229
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
230
printf("%s, bad version string\n", "$min_sdl_version");
234
if (($sdl_major_version > major) ||
235
(($sdl_major_version == major) && ($sdl_minor_version > minor)) ||
236
(($sdl_major_version == major) && ($sdl_minor_version == minor) && ($sdl_micro_version >= micro)))
242
printf("\n*** 'sdl-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version);
243
printf("*** of SDL required is %d.%d.%d. If sdl-config is correct, then it is\n", major, minor, micro);
244
printf("*** best to upgrade to the required version.\n");
245
printf("*** If sdl-config was wrong, set the environment variable SDL_CONFIG\n");
246
printf("*** to point to the correct copy of sdl-config, and remove the file\n");
247
printf("*** config.cache before re-running configure\n");
252
],, no_sdl=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
253
CFLAGS="$ac_save_CFLAGS"
257
if test "x$no_sdl" = x ; then
259
ifelse([$2], , :, [$2])
262
if test "$SDL_CONFIG" = "no" ; then
263
echo "*** The sdl-config script installed by SDL could not be found"
264
echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in"
265
echo "*** your path, or set the SDL_CONFIG environment variable to the"
266
echo "*** full path to sdl-config."
268
if test -f conf.sdltest ; then
271
echo "*** Could not run SDL test program, checking why..."
272
CFLAGS="$CFLAGS $SDL_CFLAGS"
273
LIBS="$LIBS $SDL_LIBS"
278
int main(int argc, char *argv[])
281
#define main K_and_R_C_main
283
[ echo "*** The test program compiled, but did not run. This usually means"
284
echo "*** that the run-time linker is not finding SDL or finding the wrong"
285
echo "*** version of SDL. If it is not finding SDL, you'll need to set your"
286
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
287
echo "*** to the installed location Also, make sure you have run ldconfig if that"
288
echo "*** is required on your system"
290
echo "*** If you have an old version installed, it is best to remove it, although"
291
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
292
[ echo "*** The test program failed to compile or link. See the file config.log for the"
293
echo "*** exact error that occured. This usually means SDL was incorrectly installed"
294
echo "*** or that you have moved SDL since it was installed. In the latter case, you"
295
echo "*** may want to edit the sdl-config script: $SDL_CONFIG" ])
296
CFLAGS="$ac_save_CFLAGS"
302
ifelse([$3], , :, [$3])
306
AC_SUBST(SDL_LIBS_FOR_LIBS)
307
AC_SUBST(SDL_LIBS_FOR_PLUGINS)