~gunchleoc/widelands/bug-1818494-ingame-zoom-freezes

« back to all changes in this revision

Viewing changes to aclocal.m4

  • Committer: sirver
  • Date: 2002-02-05 20:54:08 UTC
  • Revision ID: git-v1:df384fd3a5e53be1f37803d1c0381fa993844bf5
Initial revision


git-svn-id: https://widelands.svn.sourceforge.net/svnroot/widelands/trunk@2 37b2a8de-5219-0410-9f54-a31bc463ab9c

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
dnl aclocal.m4 generated automatically by aclocal 1.4-p4
 
2
 
 
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.
 
7
 
 
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.
 
12
 
 
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.
 
16
 
 
17
# serial 1
 
18
 
 
19
dnl Usage:
 
20
dnl AM_INIT_AUTOMAKE(package,version, [no-define])
 
21
 
 
22
AC_DEFUN(AM_INIT_AUTOMAKE,
 
23
[AC_REQUIRE([AC_PROG_INSTALL])
 
24
PACKAGE=[$1]
 
25
AC_SUBST(PACKAGE)
 
26
VERSION=[$2]
 
27
AC_SUBST(VERSION)
 
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])
 
31
fi
 
32
ifelse([$3],,
 
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])])
 
45
 
 
46
#
 
47
# Check to make sure that the build environment is sane.
 
48
#
 
49
 
 
50
AC_DEFUN(AM_SANITY_CHECK,
 
51
[AC_MSG_CHECKING([whether build environment is sane])
 
52
# Just in case
 
53
sleep 1
 
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
 
59
# directory).
 
60
if (
 
61
   set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
 
62
   if test "[$]*" = "X"; then
 
63
      # -L didn't work.
 
64
      set X `ls -t $srcdir/configure conftestfile`
 
65
   fi
 
66
   if test "[$]*" != "X $srcdir/configure conftestfile" \
 
67
      && test "[$]*" != "X conftestfile $srcdir/configure"; then
 
68
 
 
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])
 
75
   fi
 
76
 
 
77
   test "[$]2" = conftestfile
 
78
   )
 
79
then
 
80
   # Ok.
 
81
   :
 
82
else
 
83
   AC_MSG_ERROR([newly created file is older than distributed files!
 
84
Check your system clock])
 
85
fi
 
86
rm -f conftest*
 
87
AC_MSG_RESULT(yes)])
 
88
 
 
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
 
97
   $1=$2
 
98
   AC_MSG_RESULT(found)
 
99
else
 
100
   $1="$3/missing $2"
 
101
   AC_MSG_RESULT(missing)
 
102
fi
 
103
AC_SUBST($1)])
 
104
 
 
105
# Like AC_CONFIG_HEADER, but automatically create stamp file.
 
106
 
 
107
AC_DEFUN(AM_CONFIG_HEADER,
 
108
[AC_PREREQ([2.12])
 
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>>,
 
117
<<am_indx=1
 
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
 
122
    ;;
 
123
  esac
 
124
  am_indx=`expr "<<$>>am_indx" + 1`
 
125
done<<>>dnl>>)
 
126
changequote([,]))])
 
127
 
 
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
 
134
 
 
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, ...
 
139
 
 
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
 
142
dnl
 
143
AC_DEFUN(AM_PATH_SDL,
 
144
[dnl 
 
145
dnl Get the cflags and libraries from the sdl-config script
 
146
dnl
 
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)
 
153
 
 
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
 
158
     fi
 
159
  fi
 
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
 
164
     fi
 
165
  fi
 
166
 
 
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)
 
170
  no_sdl=""
 
171
  if test "$SDL_CONFIG" = "no" ; then
 
172
    no_sdl=yes
 
173
  else
 
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`
 
178
 
 
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"
 
187
      ac_save_LIBS="$LIBS"
 
188
      CFLAGS="$CFLAGS $SDL_CFLAGS"
 
189
      LIBS="$LIBS $SDL_LIBS"
 
190
dnl
 
191
dnl Now check if the installed SDL is sufficiently new. (Also sanity
 
192
dnl checks the results of sdl-config to some extent
 
193
dnl
 
194
      rm -f conf.sdltest
 
195
      AC_TRY_RUN([
 
196
#include <stdio.h>
 
197
#include <stdlib.h>
 
198
#include <string.h>
 
199
#include "SDL.h"
 
200
 
 
201
char*
 
202
my_strdup (char *str)
 
203
{
 
204
  char *new_str;
 
205
  
 
206
  if (str)
 
207
    {
 
208
      new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
 
209
      strcpy (new_str, str);
 
210
    }
 
211
  else
 
212
    new_str = NULL;
 
213
  
 
214
  return new_str;
 
215
}
 
216
 
 
217
int main (int argc, char *argv[])
 
218
{
 
219
  int major, minor, micro;
 
220
  char *tmp_version;
 
221
 
 
222
  /* This hangs on some systems (?)
 
223
  system ("touch conf.sdltest");
 
224
  */
 
225
  { FILE *fp = fopen("conf.sdltest", "a"); if ( fp ) fclose(fp); }
 
226
 
 
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, &micro) != 3) {
 
230
     printf("%s, bad version string\n", "$min_sdl_version");
 
231
     exit(1);
 
232
   }
 
233
 
 
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)))
 
237
    {
 
238
      return 0;
 
239
    }
 
240
  else
 
241
    {
 
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");
 
248
      return 1;
 
249
    }
 
250
}
 
251
 
 
252
],, no_sdl=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
 
253
       CFLAGS="$ac_save_CFLAGS"
 
254
       LIBS="$ac_save_LIBS"
 
255
     fi
 
256
  fi
 
257
  if test "x$no_sdl" = x ; then
 
258
     AC_MSG_RESULT(yes)
 
259
     ifelse([$2], , :, [$2])     
 
260
  else
 
261
     AC_MSG_RESULT(no)
 
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."
 
267
     else
 
268
       if test -f conf.sdltest ; then
 
269
        :
 
270
       else
 
271
          echo "*** Could not run SDL test program, checking why..."
 
272
          CFLAGS="$CFLAGS $SDL_CFLAGS"
 
273
          LIBS="$LIBS $SDL_LIBS"
 
274
          AC_TRY_LINK([
 
275
#include <stdio.h>
 
276
#include "SDL.h"
 
277
 
 
278
int main(int argc, char *argv[])
 
279
{ return 0; }
 
280
#undef  main
 
281
#define main K_and_R_C_main
 
282
],      [ return 0; ],
 
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"
 
289
          echo "***"
 
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"
 
297
          LIBS="$ac_save_LIBS"
 
298
       fi
 
299
     fi
 
300
     SDL_CFLAGS=""
 
301
     SDL_LIBS=""
 
302
     ifelse([$3], , :, [$3])
 
303
  fi
 
304
  AC_SUBST(SDL_CFLAGS)
 
305
  AC_SUBST(SDL_LIBS)
 
306
  AC_SUBST(SDL_LIBS_FOR_LIBS)
 
307
  AC_SUBST(SDL_LIBS_FOR_PLUGINS)
 
308
  rm -f conf.sdltest
 
309
])
 
310