annotate aclocal.m4 @ 8:55b577e5f5b5

Some memory leaks fixed
author thib
date Tue, 05 Aug 2008 12:56:51 +0000
parents 223b71206888
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
223b71206888 Initial import
thib
parents:
diff changeset
1 # generated automatically by aclocal 1.9.5 -*- Autoconf -*-
223b71206888 Initial import
thib
parents:
diff changeset
2
223b71206888 Initial import
thib
parents:
diff changeset
3 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
223b71206888 Initial import
thib
parents:
diff changeset
4 # 2005 Free Software Foundation, Inc.
223b71206888 Initial import
thib
parents:
diff changeset
5 # This file is free software; the Free Software Foundation
223b71206888 Initial import
thib
parents:
diff changeset
6 # gives unlimited permission to copy and/or distribute it,
223b71206888 Initial import
thib
parents:
diff changeset
7 # with or without modifications, as long as this notice is preserved.
223b71206888 Initial import
thib
parents:
diff changeset
8
223b71206888 Initial import
thib
parents:
diff changeset
9 # This program is distributed in the hope that it will be useful,
223b71206888 Initial import
thib
parents:
diff changeset
10 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
223b71206888 Initial import
thib
parents:
diff changeset
11 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
223b71206888 Initial import
thib
parents:
diff changeset
12 # PARTICULAR PURPOSE.
223b71206888 Initial import
thib
parents:
diff changeset
13
223b71206888 Initial import
thib
parents:
diff changeset
14 # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
223b71206888 Initial import
thib
parents:
diff changeset
15 # Free Software Foundation, Inc.
223b71206888 Initial import
thib
parents:
diff changeset
16 #
223b71206888 Initial import
thib
parents:
diff changeset
17 # This file is free software; the Free Software Foundation
223b71206888 Initial import
thib
parents:
diff changeset
18 # gives unlimited permission to copy and/or distribute it,
223b71206888 Initial import
thib
parents:
diff changeset
19 # with or without modifications, as long as this notice is preserved.
223b71206888 Initial import
thib
parents:
diff changeset
20
223b71206888 Initial import
thib
parents:
diff changeset
21 # serial 8
223b71206888 Initial import
thib
parents:
diff changeset
22
223b71206888 Initial import
thib
parents:
diff changeset
23 # AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS.
223b71206888 Initial import
thib
parents:
diff changeset
24 AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
223b71206888 Initial import
thib
parents:
diff changeset
25
223b71206888 Initial import
thib
parents:
diff changeset
26 # Configure paths for FreeType2
223b71206888 Initial import
thib
parents:
diff changeset
27 # Marcelo Magallon 2001-10-26, based on gtk.m4 by Owen Taylor
223b71206888 Initial import
thib
parents:
diff changeset
28 #
223b71206888 Initial import
thib
parents:
diff changeset
29 # Copyright 2001, 2003 by
223b71206888 Initial import
thib
parents:
diff changeset
30 # David Turner, Robert Wilhelm, and Werner Lemberg.
223b71206888 Initial import
thib
parents:
diff changeset
31 #
223b71206888 Initial import
thib
parents:
diff changeset
32 # This file is part of the FreeType project, and may only be used, modified,
223b71206888 Initial import
thib
parents:
diff changeset
33 # and distributed under the terms of the FreeType project license,
223b71206888 Initial import
thib
parents:
diff changeset
34 # LICENSE.TXT. By continuing to use, modify, or distribute this file you
223b71206888 Initial import
thib
parents:
diff changeset
35 # indicate that you have read the license and understand and accept it
223b71206888 Initial import
thib
parents:
diff changeset
36 # fully.
223b71206888 Initial import
thib
parents:
diff changeset
37 #
223b71206888 Initial import
thib
parents:
diff changeset
38 # serial 2
223b71206888 Initial import
thib
parents:
diff changeset
39
223b71206888 Initial import
thib
parents:
diff changeset
40 # AC_CHECK_FT2([MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
223b71206888 Initial import
thib
parents:
diff changeset
41 # Test for FreeType 2, and define FT2_CFLAGS and FT2_LIBS.
223b71206888 Initial import
thib
parents:
diff changeset
42 # MINIMUM-VERSION is what libtool reports; the default is `7.0.1' (this is
223b71206888 Initial import
thib
parents:
diff changeset
43 # FreeType 2.0.4).
223b71206888 Initial import
thib
parents:
diff changeset
44 #
223b71206888 Initial import
thib
parents:
diff changeset
45 AC_DEFUN([AC_CHECK_FT2],
223b71206888 Initial import
thib
parents:
diff changeset
46 [# Get the cflags and libraries from the freetype-config script
223b71206888 Initial import
thib
parents:
diff changeset
47 #
223b71206888 Initial import
thib
parents:
diff changeset
48 AC_ARG_WITH([ft-prefix],
223b71206888 Initial import
thib
parents:
diff changeset
49 dnl don't quote AS_HELP_STRING!
223b71206888 Initial import
thib
parents:
diff changeset
50 AS_HELP_STRING([--with-ft-prefix=PREFIX],
223b71206888 Initial import
thib
parents:
diff changeset
51 [Prefix where FreeType is installed (optional)]),
223b71206888 Initial import
thib
parents:
diff changeset
52 [ft_config_prefix="$withval"],
223b71206888 Initial import
thib
parents:
diff changeset
53 [ft_config_prefix=""])
223b71206888 Initial import
thib
parents:
diff changeset
54
223b71206888 Initial import
thib
parents:
diff changeset
55 AC_ARG_WITH([ft-exec-prefix],
223b71206888 Initial import
thib
parents:
diff changeset
56 dnl don't quote AS_HELP_STRING!
223b71206888 Initial import
thib
parents:
diff changeset
57 AS_HELP_STRING([--with-ft-exec-prefix=PREFIX],
223b71206888 Initial import
thib
parents:
diff changeset
58 [Exec prefix where FreeType is installed (optional)]),
223b71206888 Initial import
thib
parents:
diff changeset
59 [ft_config_exec_prefix="$withval"],
223b71206888 Initial import
thib
parents:
diff changeset
60 [ft_config_exec_prefix=""])
223b71206888 Initial import
thib
parents:
diff changeset
61
223b71206888 Initial import
thib
parents:
diff changeset
62 AC_ARG_ENABLE([freetypetest],
223b71206888 Initial import
thib
parents:
diff changeset
63 dnl don't quote AS_HELP_STRING!
223b71206888 Initial import
thib
parents:
diff changeset
64 AS_HELP_STRING([--disable-freetypetest],
223b71206888 Initial import
thib
parents:
diff changeset
65 [Do not try to compile and run a test FreeType program]),
223b71206888 Initial import
thib
parents:
diff changeset
66 [],
223b71206888 Initial import
thib
parents:
diff changeset
67 [enable_fttest=yes])
223b71206888 Initial import
thib
parents:
diff changeset
68
223b71206888 Initial import
thib
parents:
diff changeset
69 if test x$ft_config_exec_prefix != x ; then
223b71206888 Initial import
thib
parents:
diff changeset
70 ft_config_args="$ft_config_args --exec-prefix=$ft_config_exec_prefix"
223b71206888 Initial import
thib
parents:
diff changeset
71 if test x${FT2_CONFIG+set} != xset ; then
223b71206888 Initial import
thib
parents:
diff changeset
72 FT2_CONFIG=$ft_config_exec_prefix/bin/freetype-config
223b71206888 Initial import
thib
parents:
diff changeset
73 fi
223b71206888 Initial import
thib
parents:
diff changeset
74 fi
223b71206888 Initial import
thib
parents:
diff changeset
75
223b71206888 Initial import
thib
parents:
diff changeset
76 if test x$ft_config_prefix != x ; then
223b71206888 Initial import
thib
parents:
diff changeset
77 ft_config_args="$ft_config_args --prefix=$ft_config_prefix"
223b71206888 Initial import
thib
parents:
diff changeset
78 if test x${FT2_CONFIG+set} != xset ; then
223b71206888 Initial import
thib
parents:
diff changeset
79 FT2_CONFIG=$ft_config_prefix/bin/freetype-config
223b71206888 Initial import
thib
parents:
diff changeset
80 fi
223b71206888 Initial import
thib
parents:
diff changeset
81 fi
223b71206888 Initial import
thib
parents:
diff changeset
82
223b71206888 Initial import
thib
parents:
diff changeset
83 AC_PATH_PROG([FT2_CONFIG], [freetype-config], [no])
223b71206888 Initial import
thib
parents:
diff changeset
84
223b71206888 Initial import
thib
parents:
diff changeset
85 min_ft_version=m4_if([$1], [], [7.0.1], [$1])
223b71206888 Initial import
thib
parents:
diff changeset
86 AC_MSG_CHECKING([for FreeType -- version >= $min_ft_version])
223b71206888 Initial import
thib
parents:
diff changeset
87 no_ft=""
223b71206888 Initial import
thib
parents:
diff changeset
88 if test "$FT2_CONFIG" = "no" ; then
223b71206888 Initial import
thib
parents:
diff changeset
89 no_ft=yes
223b71206888 Initial import
thib
parents:
diff changeset
90 else
223b71206888 Initial import
thib
parents:
diff changeset
91 FT2_CFLAGS=`$FT2_CONFIG $ft_config_args --cflags`
223b71206888 Initial import
thib
parents:
diff changeset
92 FT2_LIBS=`$FT2_CONFIG $ft_config_args --libs`
223b71206888 Initial import
thib
parents:
diff changeset
93 ft_config_major_version=`$FT2_CONFIG $ft_config_args --version | \
223b71206888 Initial import
thib
parents:
diff changeset
94 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
223b71206888 Initial import
thib
parents:
diff changeset
95 ft_config_minor_version=`$FT2_CONFIG $ft_config_args --version | \
223b71206888 Initial import
thib
parents:
diff changeset
96 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
223b71206888 Initial import
thib
parents:
diff changeset
97 ft_config_micro_version=`$FT2_CONFIG $ft_config_args --version | \
223b71206888 Initial import
thib
parents:
diff changeset
98 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
223b71206888 Initial import
thib
parents:
diff changeset
99 ft_min_major_version=`echo $min_ft_version | \
223b71206888 Initial import
thib
parents:
diff changeset
100 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
223b71206888 Initial import
thib
parents:
diff changeset
101 ft_min_minor_version=`echo $min_ft_version | \
223b71206888 Initial import
thib
parents:
diff changeset
102 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
223b71206888 Initial import
thib
parents:
diff changeset
103 ft_min_micro_version=`echo $min_ft_version | \
223b71206888 Initial import
thib
parents:
diff changeset
104 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
223b71206888 Initial import
thib
parents:
diff changeset
105 if test x$enable_fttest = xyes ; then
223b71206888 Initial import
thib
parents:
diff changeset
106 ft_config_is_lt=""
223b71206888 Initial import
thib
parents:
diff changeset
107 if test $ft_config_major_version -lt $ft_min_major_version ; then
223b71206888 Initial import
thib
parents:
diff changeset
108 ft_config_is_lt=yes
223b71206888 Initial import
thib
parents:
diff changeset
109 else
223b71206888 Initial import
thib
parents:
diff changeset
110 if test $ft_config_major_version -eq $ft_min_major_version ; then
223b71206888 Initial import
thib
parents:
diff changeset
111 if test $ft_config_minor_version -lt $ft_min_minor_version ; then
223b71206888 Initial import
thib
parents:
diff changeset
112 ft_config_is_lt=yes
223b71206888 Initial import
thib
parents:
diff changeset
113 else
223b71206888 Initial import
thib
parents:
diff changeset
114 if test $ft_config_minor_version -eq $ft_min_minor_version ; then
223b71206888 Initial import
thib
parents:
diff changeset
115 if test $ft_config_micro_version -lt $ft_min_micro_version ; then
223b71206888 Initial import
thib
parents:
diff changeset
116 ft_config_is_lt=yes
223b71206888 Initial import
thib
parents:
diff changeset
117 fi
223b71206888 Initial import
thib
parents:
diff changeset
118 fi
223b71206888 Initial import
thib
parents:
diff changeset
119 fi
223b71206888 Initial import
thib
parents:
diff changeset
120 fi
223b71206888 Initial import
thib
parents:
diff changeset
121 fi
223b71206888 Initial import
thib
parents:
diff changeset
122 if test x$ft_config_is_lt = xyes ; then
223b71206888 Initial import
thib
parents:
diff changeset
123 no_ft=yes
223b71206888 Initial import
thib
parents:
diff changeset
124 else
223b71206888 Initial import
thib
parents:
diff changeset
125 ac_save_CFLAGS="$CFLAGS"
223b71206888 Initial import
thib
parents:
diff changeset
126 ac_save_LIBS="$LIBS"
223b71206888 Initial import
thib
parents:
diff changeset
127 CFLAGS="$CFLAGS $FT2_CFLAGS"
223b71206888 Initial import
thib
parents:
diff changeset
128 LIBS="$FT2_LIBS $LIBS"
223b71206888 Initial import
thib
parents:
diff changeset
129
223b71206888 Initial import
thib
parents:
diff changeset
130 #
223b71206888 Initial import
thib
parents:
diff changeset
131 # Sanity checks for the results of freetype-config to some extent.
223b71206888 Initial import
thib
parents:
diff changeset
132 #
223b71206888 Initial import
thib
parents:
diff changeset
133 AC_RUN_IFELSE([
223b71206888 Initial import
thib
parents:
diff changeset
134 AC_LANG_SOURCE([[
223b71206888 Initial import
thib
parents:
diff changeset
135
223b71206888 Initial import
thib
parents:
diff changeset
136 #include <ft2build.h>
223b71206888 Initial import
thib
parents:
diff changeset
137 #include FT_FREETYPE_H
223b71206888 Initial import
thib
parents:
diff changeset
138 #include <stdio.h>
223b71206888 Initial import
thib
parents:
diff changeset
139 #include <stdlib.h>
223b71206888 Initial import
thib
parents:
diff changeset
140
223b71206888 Initial import
thib
parents:
diff changeset
141 int
223b71206888 Initial import
thib
parents:
diff changeset
142 main()
223b71206888 Initial import
thib
parents:
diff changeset
143 {
223b71206888 Initial import
thib
parents:
diff changeset
144 FT_Library library;
223b71206888 Initial import
thib
parents:
diff changeset
145 FT_Error error;
223b71206888 Initial import
thib
parents:
diff changeset
146
223b71206888 Initial import
thib
parents:
diff changeset
147 error = FT_Init_FreeType(&library);
223b71206888 Initial import
thib
parents:
diff changeset
148
223b71206888 Initial import
thib
parents:
diff changeset
149 if (error)
223b71206888 Initial import
thib
parents:
diff changeset
150 return 1;
223b71206888 Initial import
thib
parents:
diff changeset
151 else
223b71206888 Initial import
thib
parents:
diff changeset
152 {
223b71206888 Initial import
thib
parents:
diff changeset
153 FT_Done_FreeType(library);
223b71206888 Initial import
thib
parents:
diff changeset
154 return 0;
223b71206888 Initial import
thib
parents:
diff changeset
155 }
223b71206888 Initial import
thib
parents:
diff changeset
156 }
223b71206888 Initial import
thib
parents:
diff changeset
157
223b71206888 Initial import
thib
parents:
diff changeset
158 ]])
223b71206888 Initial import
thib
parents:
diff changeset
159 ],
223b71206888 Initial import
thib
parents:
diff changeset
160 [],
223b71206888 Initial import
thib
parents:
diff changeset
161 [no_ft=yes],
223b71206888 Initial import
thib
parents:
diff changeset
162 [echo $ECHO_N "cross compiling; assuming OK... $ECHO_C"])
223b71206888 Initial import
thib
parents:
diff changeset
163
223b71206888 Initial import
thib
parents:
diff changeset
164 CFLAGS="$ac_save_CFLAGS"
223b71206888 Initial import
thib
parents:
diff changeset
165 LIBS="$ac_save_LIBS"
223b71206888 Initial import
thib
parents:
diff changeset
166 fi # test $ft_config_version -lt $ft_min_version
223b71206888 Initial import
thib
parents:
diff changeset
167 fi # test x$enable_fttest = xyes
223b71206888 Initial import
thib
parents:
diff changeset
168 fi # test "$FT2_CONFIG" = "no"
223b71206888 Initial import
thib
parents:
diff changeset
169
223b71206888 Initial import
thib
parents:
diff changeset
170 if test x$no_ft = x ; then
223b71206888 Initial import
thib
parents:
diff changeset
171 AC_MSG_RESULT([yes])
223b71206888 Initial import
thib
parents:
diff changeset
172 m4_if([$2], [], [:], [$2])
223b71206888 Initial import
thib
parents:
diff changeset
173 else
223b71206888 Initial import
thib
parents:
diff changeset
174 AC_MSG_RESULT([no])
223b71206888 Initial import
thib
parents:
diff changeset
175 if test "$FT2_CONFIG" = "no" ; then
223b71206888 Initial import
thib
parents:
diff changeset
176 AC_MSG_WARN([
223b71206888 Initial import
thib
parents:
diff changeset
177
223b71206888 Initial import
thib
parents:
diff changeset
178 The freetype-config script installed by FreeType 2 could not be found.
223b71206888 Initial import
thib
parents:
diff changeset
179 If FreeType 2 was installed in PREFIX, make sure PREFIX/bin is in
223b71206888 Initial import
thib
parents:
diff changeset
180 your path, or set the FT2_CONFIG environment variable to the
223b71206888 Initial import
thib
parents:
diff changeset
181 full path to freetype-config.
223b71206888 Initial import
thib
parents:
diff changeset
182 ])
223b71206888 Initial import
thib
parents:
diff changeset
183 else
223b71206888 Initial import
thib
parents:
diff changeset
184 if test x$ft_config_is_lt = xyes ; then
223b71206888 Initial import
thib
parents:
diff changeset
185 AC_MSG_WARN([
223b71206888 Initial import
thib
parents:
diff changeset
186
223b71206888 Initial import
thib
parents:
diff changeset
187 Your installed version of the FreeType 2 library is too old.
223b71206888 Initial import
thib
parents:
diff changeset
188 If you have different versions of FreeType 2, make sure that
223b71206888 Initial import
thib
parents:
diff changeset
189 correct values for --with-ft-prefix or --with-ft-exec-prefix
223b71206888 Initial import
thib
parents:
diff changeset
190 are used, or set the FT2_CONFIG environment variable to the
223b71206888 Initial import
thib
parents:
diff changeset
191 full path to freetype-config.
223b71206888 Initial import
thib
parents:
diff changeset
192 ])
223b71206888 Initial import
thib
parents:
diff changeset
193 else
223b71206888 Initial import
thib
parents:
diff changeset
194 AC_MSG_WARN([
223b71206888 Initial import
thib
parents:
diff changeset
195
223b71206888 Initial import
thib
parents:
diff changeset
196 The FreeType test program failed to run. If your system uses
223b71206888 Initial import
thib
parents:
diff changeset
197 shared libraries and they are installed outside the normal
223b71206888 Initial import
thib
parents:
diff changeset
198 system library path, make sure the variable LD_LIBRARY_PATH
223b71206888 Initial import
thib
parents:
diff changeset
199 (or whatever is appropiate for your system) is correctly set.
223b71206888 Initial import
thib
parents:
diff changeset
200 ])
223b71206888 Initial import
thib
parents:
diff changeset
201 fi
223b71206888 Initial import
thib
parents:
diff changeset
202 fi
223b71206888 Initial import
thib
parents:
diff changeset
203
223b71206888 Initial import
thib
parents:
diff changeset
204 FT2_CFLAGS=""
223b71206888 Initial import
thib
parents:
diff changeset
205 FT2_LIBS=""
223b71206888 Initial import
thib
parents:
diff changeset
206 m4_if([$3], [], [:], [$3])
223b71206888 Initial import
thib
parents:
diff changeset
207 fi
223b71206888 Initial import
thib
parents:
diff changeset
208
223b71206888 Initial import
thib
parents:
diff changeset
209 AC_SUBST([FT2_CFLAGS])
223b71206888 Initial import
thib
parents:
diff changeset
210 AC_SUBST([FT2_LIBS])])
223b71206888 Initial import
thib
parents:
diff changeset
211
223b71206888 Initial import
thib
parents:
diff changeset
212 # end of freetype2.m4
223b71206888 Initial import
thib
parents:
diff changeset
213
223b71206888 Initial import
thib
parents:
diff changeset
214 # Configure paths for SDL
223b71206888 Initial import
thib
parents:
diff changeset
215 # Sam Lantinga 9/21/99
223b71206888 Initial import
thib
parents:
diff changeset
216 # stolen from Manish Singh
223b71206888 Initial import
thib
parents:
diff changeset
217 # stolen back from Frank Belew
223b71206888 Initial import
thib
parents:
diff changeset
218 # stolen from Manish Singh
223b71206888 Initial import
thib
parents:
diff changeset
219 # Shamelessly stolen from Owen Taylor
223b71206888 Initial import
thib
parents:
diff changeset
220
223b71206888 Initial import
thib
parents:
diff changeset
221 dnl AM_PATH_SDL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
223b71206888 Initial import
thib
parents:
diff changeset
222 dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS
223b71206888 Initial import
thib
parents:
diff changeset
223 dnl
223b71206888 Initial import
thib
parents:
diff changeset
224 AC_DEFUN([AM_PATH_SDL],
223b71206888 Initial import
thib
parents:
diff changeset
225 [dnl
223b71206888 Initial import
thib
parents:
diff changeset
226 dnl Get the cflags and libraries from the sdl-config script
223b71206888 Initial import
thib
parents:
diff changeset
227 dnl
223b71206888 Initial import
thib
parents:
diff changeset
228 AC_ARG_WITH(sdl-prefix,[ --with-sdl-prefix=PFX Prefix where SDL is installed (optional)],
223b71206888 Initial import
thib
parents:
diff changeset
229 sdl_prefix="$withval", sdl_prefix="")
223b71206888 Initial import
thib
parents:
diff changeset
230 AC_ARG_WITH(sdl-exec-prefix,[ --with-sdl-exec-prefix=PFX Exec prefix where SDL is installed (optional)],
223b71206888 Initial import
thib
parents:
diff changeset
231 sdl_exec_prefix="$withval", sdl_exec_prefix="")
223b71206888 Initial import
thib
parents:
diff changeset
232 AC_ARG_ENABLE(sdltest, [ --disable-sdltest Do not try to compile and run a test SDL program],
223b71206888 Initial import
thib
parents:
diff changeset
233 , enable_sdltest=yes)
223b71206888 Initial import
thib
parents:
diff changeset
234
223b71206888 Initial import
thib
parents:
diff changeset
235 if test x$sdl_exec_prefix != x ; then
223b71206888 Initial import
thib
parents:
diff changeset
236 sdl_args="$sdl_args --exec-prefix=$sdl_exec_prefix"
223b71206888 Initial import
thib
parents:
diff changeset
237 if test x${SDL_CONFIG+set} != xset ; then
223b71206888 Initial import
thib
parents:
diff changeset
238 SDL_CONFIG=$sdl_exec_prefix/bin/sdl-config
223b71206888 Initial import
thib
parents:
diff changeset
239 fi
223b71206888 Initial import
thib
parents:
diff changeset
240 fi
223b71206888 Initial import
thib
parents:
diff changeset
241 if test x$sdl_prefix != x ; then
223b71206888 Initial import
thib
parents:
diff changeset
242 sdl_args="$sdl_args --prefix=$sdl_prefix"
223b71206888 Initial import
thib
parents:
diff changeset
243 if test x${SDL_CONFIG+set} != xset ; then
223b71206888 Initial import
thib
parents:
diff changeset
244 SDL_CONFIG=$sdl_prefix/bin/sdl-config
223b71206888 Initial import
thib
parents:
diff changeset
245 fi
223b71206888 Initial import
thib
parents:
diff changeset
246 fi
223b71206888 Initial import
thib
parents:
diff changeset
247
223b71206888 Initial import
thib
parents:
diff changeset
248 AC_REQUIRE([AC_CANONICAL_TARGET])
223b71206888 Initial import
thib
parents:
diff changeset
249 PATH="$prefix/bin:$prefix/usr/bin:$PATH"
223b71206888 Initial import
thib
parents:
diff changeset
250 AC_PATH_PROG(SDL_CONFIG, sdl-config, no, [$PATH])
223b71206888 Initial import
thib
parents:
diff changeset
251 min_sdl_version=ifelse([$1], ,0.11.0,$1)
223b71206888 Initial import
thib
parents:
diff changeset
252 AC_MSG_CHECKING(for SDL - version >= $min_sdl_version)
223b71206888 Initial import
thib
parents:
diff changeset
253 no_sdl=""
223b71206888 Initial import
thib
parents:
diff changeset
254 if test "$SDL_CONFIG" = "no" ; then
223b71206888 Initial import
thib
parents:
diff changeset
255 no_sdl=yes
223b71206888 Initial import
thib
parents:
diff changeset
256 else
223b71206888 Initial import
thib
parents:
diff changeset
257 SDL_CFLAGS=`$SDL_CONFIG $sdlconf_args --cflags`
223b71206888 Initial import
thib
parents:
diff changeset
258 SDL_LIBS=`$SDL_CONFIG $sdlconf_args --libs`
223b71206888 Initial import
thib
parents:
diff changeset
259
223b71206888 Initial import
thib
parents:
diff changeset
260 sdl_major_version=`$SDL_CONFIG $sdl_args --version | \
223b71206888 Initial import
thib
parents:
diff changeset
261 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
223b71206888 Initial import
thib
parents:
diff changeset
262 sdl_minor_version=`$SDL_CONFIG $sdl_args --version | \
223b71206888 Initial import
thib
parents:
diff changeset
263 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
223b71206888 Initial import
thib
parents:
diff changeset
264 sdl_micro_version=`$SDL_CONFIG $sdl_config_args --version | \
223b71206888 Initial import
thib
parents:
diff changeset
265 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
223b71206888 Initial import
thib
parents:
diff changeset
266 if test "x$enable_sdltest" = "xyes" ; then
223b71206888 Initial import
thib
parents:
diff changeset
267 ac_save_CFLAGS="$CFLAGS"
223b71206888 Initial import
thib
parents:
diff changeset
268 ac_save_LIBS="$LIBS"
223b71206888 Initial import
thib
parents:
diff changeset
269 CFLAGS="$CFLAGS $SDL_CFLAGS"
223b71206888 Initial import
thib
parents:
diff changeset
270 LIBS="$LIBS $SDL_LIBS"
223b71206888 Initial import
thib
parents:
diff changeset
271 dnl
223b71206888 Initial import
thib
parents:
diff changeset
272 dnl Now check if the installed SDL is sufficiently new. (Also sanity
223b71206888 Initial import
thib
parents:
diff changeset
273 dnl checks the results of sdl-config to some extent
223b71206888 Initial import
thib
parents:
diff changeset
274 dnl
223b71206888 Initial import
thib
parents:
diff changeset
275 rm -f conf.sdltest
223b71206888 Initial import
thib
parents:
diff changeset
276 AC_TRY_RUN([
223b71206888 Initial import
thib
parents:
diff changeset
277 #include <stdio.h>
223b71206888 Initial import
thib
parents:
diff changeset
278 #include <stdlib.h>
223b71206888 Initial import
thib
parents:
diff changeset
279 #include <string.h>
223b71206888 Initial import
thib
parents:
diff changeset
280 #include "SDL.h"
223b71206888 Initial import
thib
parents:
diff changeset
281
223b71206888 Initial import
thib
parents:
diff changeset
282 char*
223b71206888 Initial import
thib
parents:
diff changeset
283 my_strdup (char *str)
223b71206888 Initial import
thib
parents:
diff changeset
284 {
223b71206888 Initial import
thib
parents:
diff changeset
285 char *new_str;
223b71206888 Initial import
thib
parents:
diff changeset
286
223b71206888 Initial import
thib
parents:
diff changeset
287 if (str)
223b71206888 Initial import
thib
parents:
diff changeset
288 {
223b71206888 Initial import
thib
parents:
diff changeset
289 new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
223b71206888 Initial import
thib
parents:
diff changeset
290 strcpy (new_str, str);
223b71206888 Initial import
thib
parents:
diff changeset
291 }
223b71206888 Initial import
thib
parents:
diff changeset
292 else
223b71206888 Initial import
thib
parents:
diff changeset
293 new_str = NULL;
223b71206888 Initial import
thib
parents:
diff changeset
294
223b71206888 Initial import
thib
parents:
diff changeset
295 return new_str;
223b71206888 Initial import
thib
parents:
diff changeset
296 }
223b71206888 Initial import
thib
parents:
diff changeset
297
223b71206888 Initial import
thib
parents:
diff changeset
298 int main (int argc, char *argv[])
223b71206888 Initial import
thib
parents:
diff changeset
299 {
223b71206888 Initial import
thib
parents:
diff changeset
300 int major, minor, micro;
223b71206888 Initial import
thib
parents:
diff changeset
301 char *tmp_version;
223b71206888 Initial import
thib
parents:
diff changeset
302
223b71206888 Initial import
thib
parents:
diff changeset
303 /* This hangs on some systems (?)
223b71206888 Initial import
thib
parents:
diff changeset
304 system ("touch conf.sdltest");
223b71206888 Initial import
thib
parents:
diff changeset
305 */
223b71206888 Initial import
thib
parents:
diff changeset
306 { FILE *fp = fopen("conf.sdltest", "a"); if ( fp ) fclose(fp); }
223b71206888 Initial import
thib
parents:
diff changeset
307
223b71206888 Initial import
thib
parents:
diff changeset
308 /* HP/UX 9 (%@#!) writes to sscanf strings */
223b71206888 Initial import
thib
parents:
diff changeset
309 tmp_version = my_strdup("$min_sdl_version");
223b71206888 Initial import
thib
parents:
diff changeset
310 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
223b71206888 Initial import
thib
parents:
diff changeset
311 printf("%s, bad version string\n", "$min_sdl_version");
223b71206888 Initial import
thib
parents:
diff changeset
312 exit(1);
223b71206888 Initial import
thib
parents:
diff changeset
313 }
223b71206888 Initial import
thib
parents:
diff changeset
314
223b71206888 Initial import
thib
parents:
diff changeset
315 if (($sdl_major_version > major) ||
223b71206888 Initial import
thib
parents:
diff changeset
316 (($sdl_major_version == major) && ($sdl_minor_version > minor)) ||
223b71206888 Initial import
thib
parents:
diff changeset
317 (($sdl_major_version == major) && ($sdl_minor_version == minor) && ($sdl_micro_version >= micro)))
223b71206888 Initial import
thib
parents:
diff changeset
318 {
223b71206888 Initial import
thib
parents:
diff changeset
319 return 0;
223b71206888 Initial import
thib
parents:
diff changeset
320 }
223b71206888 Initial import
thib
parents:
diff changeset
321 else
223b71206888 Initial import
thib
parents:
diff changeset
322 {
223b71206888 Initial import
thib
parents:
diff changeset
323 printf("\n*** 'sdl-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version);
223b71206888 Initial import
thib
parents:
diff changeset
324 printf("*** of SDL required is %d.%d.%d. If sdl-config is correct, then it is\n", major, minor, micro);
223b71206888 Initial import
thib
parents:
diff changeset
325 printf("*** best to upgrade to the required version.\n");
223b71206888 Initial import
thib
parents:
diff changeset
326 printf("*** If sdl-config was wrong, set the environment variable SDL_CONFIG\n");
223b71206888 Initial import
thib
parents:
diff changeset
327 printf("*** to point to the correct copy of sdl-config, and remove the file\n");
223b71206888 Initial import
thib
parents:
diff changeset
328 printf("*** config.cache before re-running configure\n");
223b71206888 Initial import
thib
parents:
diff changeset
329 return 1;
223b71206888 Initial import
thib
parents:
diff changeset
330 }
223b71206888 Initial import
thib
parents:
diff changeset
331 }
223b71206888 Initial import
thib
parents:
diff changeset
332
223b71206888 Initial import
thib
parents:
diff changeset
333 ],, no_sdl=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
223b71206888 Initial import
thib
parents:
diff changeset
334 CFLAGS="$ac_save_CFLAGS"
223b71206888 Initial import
thib
parents:
diff changeset
335 LIBS="$ac_save_LIBS"
223b71206888 Initial import
thib
parents:
diff changeset
336 fi
223b71206888 Initial import
thib
parents:
diff changeset
337 fi
223b71206888 Initial import
thib
parents:
diff changeset
338 if test "x$no_sdl" = x ; then
223b71206888 Initial import
thib
parents:
diff changeset
339 AC_MSG_RESULT(yes)
223b71206888 Initial import
thib
parents:
diff changeset
340 ifelse([$2], , :, [$2])
223b71206888 Initial import
thib
parents:
diff changeset
341 else
223b71206888 Initial import
thib
parents:
diff changeset
342 AC_MSG_RESULT(no)
223b71206888 Initial import
thib
parents:
diff changeset
343 if test "$SDL_CONFIG" = "no" ; then
223b71206888 Initial import
thib
parents:
diff changeset
344 echo "*** The sdl-config script installed by SDL could not be found"
223b71206888 Initial import
thib
parents:
diff changeset
345 echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in"
223b71206888 Initial import
thib
parents:
diff changeset
346 echo "*** your path, or set the SDL_CONFIG environment variable to the"
223b71206888 Initial import
thib
parents:
diff changeset
347 echo "*** full path to sdl-config."
223b71206888 Initial import
thib
parents:
diff changeset
348 else
223b71206888 Initial import
thib
parents:
diff changeset
349 if test -f conf.sdltest ; then
223b71206888 Initial import
thib
parents:
diff changeset
350 :
223b71206888 Initial import
thib
parents:
diff changeset
351 else
223b71206888 Initial import
thib
parents:
diff changeset
352 echo "*** Could not run SDL test program, checking why..."
223b71206888 Initial import
thib
parents:
diff changeset
353 CFLAGS="$CFLAGS $SDL_CFLAGS"
223b71206888 Initial import
thib
parents:
diff changeset
354 LIBS="$LIBS $SDL_LIBS"
223b71206888 Initial import
thib
parents:
diff changeset
355 AC_TRY_LINK([
223b71206888 Initial import
thib
parents:
diff changeset
356 #include <stdio.h>
223b71206888 Initial import
thib
parents:
diff changeset
357 #include "SDL.h"
223b71206888 Initial import
thib
parents:
diff changeset
358
223b71206888 Initial import
thib
parents:
diff changeset
359 int main(int argc, char *argv[])
223b71206888 Initial import
thib
parents:
diff changeset
360 { return 0; }
223b71206888 Initial import
thib
parents:
diff changeset
361 #undef main
223b71206888 Initial import
thib
parents:
diff changeset
362 #define main K_and_R_C_main
223b71206888 Initial import
thib
parents:
diff changeset
363 ], [ return 0; ],
223b71206888 Initial import
thib
parents:
diff changeset
364 [ echo "*** The test program compiled, but did not run. This usually means"
223b71206888 Initial import
thib
parents:
diff changeset
365 echo "*** that the run-time linker is not finding SDL or finding the wrong"
223b71206888 Initial import
thib
parents:
diff changeset
366 echo "*** version of SDL. If it is not finding SDL, you'll need to set your"
223b71206888 Initial import
thib
parents:
diff changeset
367 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
223b71206888 Initial import
thib
parents:
diff changeset
368 echo "*** to the installed location Also, make sure you have run ldconfig if that"
223b71206888 Initial import
thib
parents:
diff changeset
369 echo "*** is required on your system"
223b71206888 Initial import
thib
parents:
diff changeset
370 echo "***"
223b71206888 Initial import
thib
parents:
diff changeset
371 echo "*** If you have an old version installed, it is best to remove it, although"
223b71206888 Initial import
thib
parents:
diff changeset
372 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
223b71206888 Initial import
thib
parents:
diff changeset
373 [ echo "*** The test program failed to compile or link. See the file config.log for the"
223b71206888 Initial import
thib
parents:
diff changeset
374 echo "*** exact error that occured. This usually means SDL was incorrectly installed"
223b71206888 Initial import
thib
parents:
diff changeset
375 echo "*** or that you have moved SDL since it was installed. In the latter case, you"
223b71206888 Initial import
thib
parents:
diff changeset
376 echo "*** may want to edit the sdl-config script: $SDL_CONFIG" ])
223b71206888 Initial import
thib
parents:
diff changeset
377 CFLAGS="$ac_save_CFLAGS"
223b71206888 Initial import
thib
parents:
diff changeset
378 LIBS="$ac_save_LIBS"
223b71206888 Initial import
thib
parents:
diff changeset
379 fi
223b71206888 Initial import
thib
parents:
diff changeset
380 fi
223b71206888 Initial import
thib
parents:
diff changeset
381 SDL_CFLAGS=""
223b71206888 Initial import
thib
parents:
diff changeset
382 SDL_LIBS=""
223b71206888 Initial import
thib
parents:
diff changeset
383 ifelse([$3], , :, [$3])
223b71206888 Initial import
thib
parents:
diff changeset
384 fi
223b71206888 Initial import
thib
parents:
diff changeset
385 AC_SUBST(SDL_CFLAGS)
223b71206888 Initial import
thib
parents:
diff changeset
386 AC_SUBST(SDL_LIBS)
223b71206888 Initial import
thib
parents:
diff changeset
387 rm -f conf.sdltest
223b71206888 Initial import
thib
parents:
diff changeset
388 ])
223b71206888 Initial import
thib
parents:
diff changeset
389
223b71206888 Initial import
thib
parents:
diff changeset
390 # Configure paths for SMPEG
223b71206888 Initial import
thib
parents:
diff changeset
391 # Nicolas Vignal 11/19/2000
223b71206888 Initial import
thib
parents:
diff changeset
392 # stolen from Sam Lantinga
223b71206888 Initial import
thib
parents:
diff changeset
393 # stolen from Manish Singh
223b71206888 Initial import
thib
parents:
diff changeset
394 # stolen back from Frank Belew
223b71206888 Initial import
thib
parents:
diff changeset
395 # stolen from Manish Singh
223b71206888 Initial import
thib
parents:
diff changeset
396 # Shamelessly stolen from Owen Taylor
223b71206888 Initial import
thib
parents:
diff changeset
397
223b71206888 Initial import
thib
parents:
diff changeset
398 dnl AM_PATH_SMPEG([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
223b71206888 Initial import
thib
parents:
diff changeset
399 dnl Test for SMPEG, and define SMPEG_CFLAGS and SMPEG_LIBS
223b71206888 Initial import
thib
parents:
diff changeset
400 dnl
223b71206888 Initial import
thib
parents:
diff changeset
401 AC_DEFUN(AM_PATH_SMPEG,
223b71206888 Initial import
thib
parents:
diff changeset
402 [dnl
223b71206888 Initial import
thib
parents:
diff changeset
403 dnl Get the cflags and libraries from the smpeg-config script
223b71206888 Initial import
thib
parents:
diff changeset
404 dnl
223b71206888 Initial import
thib
parents:
diff changeset
405 AC_ARG_WITH(smpeg-prefix,[ --with-smpeg-prefix=PFX Prefix where SMPEG is installed (optional)],
223b71206888 Initial import
thib
parents:
diff changeset
406 smpeg_prefix="$withval", smpeg_prefix="")
223b71206888 Initial import
thib
parents:
diff changeset
407 AC_ARG_WITH(smpeg-exec-prefix,[ --with-smpeg-exec-prefix=PFX Exec prefix where SMPEG is installed (optional)],
223b71206888 Initial import
thib
parents:
diff changeset
408 smpeg_exec_prefix="$withval", smpeg_exec_prefix="")
223b71206888 Initial import
thib
parents:
diff changeset
409 AC_ARG_ENABLE(smpegtest, [ --disable-smpegtest Do not try to compile and run a test SMPEG program],
223b71206888 Initial import
thib
parents:
diff changeset
410 , enable_smpegtest=yes)
223b71206888 Initial import
thib
parents:
diff changeset
411
223b71206888 Initial import
thib
parents:
diff changeset
412 if test x$smpeg_exec_prefix != x ; then
223b71206888 Initial import
thib
parents:
diff changeset
413 smpeg_args="$smpeg_args --exec-prefix=$smpeg_exec_prefix"
223b71206888 Initial import
thib
parents:
diff changeset
414 if test x${SMPEG_CONFIG+set} != xset ; then
223b71206888 Initial import
thib
parents:
diff changeset
415 SMPEG_CONFIG=$smpeg_exec_prefix/bin/smpeg-config
223b71206888 Initial import
thib
parents:
diff changeset
416 fi
223b71206888 Initial import
thib
parents:
diff changeset
417 fi
223b71206888 Initial import
thib
parents:
diff changeset
418 if test x$smpeg_prefix != x ; then
223b71206888 Initial import
thib
parents:
diff changeset
419 smpeg_args="$smpeg_args --prefix=$smpeg_prefix"
223b71206888 Initial import
thib
parents:
diff changeset
420 if test x${SMPEG_CONFIG+set} != xset ; then
223b71206888 Initial import
thib
parents:
diff changeset
421 SMPEG_CONFIG=$smpeg_prefix/bin/smpeg-config
223b71206888 Initial import
thib
parents:
diff changeset
422 fi
223b71206888 Initial import
thib
parents:
diff changeset
423 fi
223b71206888 Initial import
thib
parents:
diff changeset
424
223b71206888 Initial import
thib
parents:
diff changeset
425 AC_PATH_PROG(SMPEG_CONFIG, smpeg-config, no)
223b71206888 Initial import
thib
parents:
diff changeset
426 min_smpeg_version=ifelse([$1], ,0.2.7,$1)
223b71206888 Initial import
thib
parents:
diff changeset
427 AC_MSG_CHECKING(for SMPEG - version >= $min_smpeg_version)
223b71206888 Initial import
thib
parents:
diff changeset
428 no_smpeg=""
223b71206888 Initial import
thib
parents:
diff changeset
429 if test "$SMPEG_CONFIG" = "no" ; then
223b71206888 Initial import
thib
parents:
diff changeset
430 no_smpeg=yes
223b71206888 Initial import
thib
parents:
diff changeset
431 else
223b71206888 Initial import
thib
parents:
diff changeset
432 SMPEG_CFLAGS=`$SMPEG_CONFIG $smpegconf_args --cflags`
223b71206888 Initial import
thib
parents:
diff changeset
433 SMPEG_LIBS=`$SMPEG_CONFIG $smpegconf_args --libs`
223b71206888 Initial import
thib
parents:
diff changeset
434
223b71206888 Initial import
thib
parents:
diff changeset
435 smpeg_major_version=`$SMPEG_CONFIG $smpeg_args --version | \
223b71206888 Initial import
thib
parents:
diff changeset
436 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
223b71206888 Initial import
thib
parents:
diff changeset
437 smpeg_minor_version=`$SMPEG_CONFIG $smpeg_args --version | \
223b71206888 Initial import
thib
parents:
diff changeset
438 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
223b71206888 Initial import
thib
parents:
diff changeset
439 smpeg_micro_version=`$SMPEG_CONFIG $smpeg_config_args --version | \
223b71206888 Initial import
thib
parents:
diff changeset
440 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
223b71206888 Initial import
thib
parents:
diff changeset
441 if test "x$enable_smpegtest" = "xyes" ; then
223b71206888 Initial import
thib
parents:
diff changeset
442 ac_save_CFLAGS="$CFLAGS"
223b71206888 Initial import
thib
parents:
diff changeset
443 ac_save_LIBS="$LIBS"
223b71206888 Initial import
thib
parents:
diff changeset
444 CFLAGS="$CFLAGS $SMPEG_CFLAGS $SDL_CFLAGS"
223b71206888 Initial import
thib
parents:
diff changeset
445 LIBS="$LIBS $SMPEG_LIBS $SDL_LIBS"
223b71206888 Initial import
thib
parents:
diff changeset
446 dnl
223b71206888 Initial import
thib
parents:
diff changeset
447 dnl Now check if the installed SMPEG is sufficiently new. (Also sanity
223b71206888 Initial import
thib
parents:
diff changeset
448 dnl checks the results of smpeg-config to some extent
223b71206888 Initial import
thib
parents:
diff changeset
449 dnl
223b71206888 Initial import
thib
parents:
diff changeset
450 rm -f conf.smpegtest
223b71206888 Initial import
thib
parents:
diff changeset
451 AC_TRY_RUN([
223b71206888 Initial import
thib
parents:
diff changeset
452 #include <stdio.h>
223b71206888 Initial import
thib
parents:
diff changeset
453 #include <stdlib.h>
223b71206888 Initial import
thib
parents:
diff changeset
454 #include <string.h>
223b71206888 Initial import
thib
parents:
diff changeset
455 #include "smpeg.h"
223b71206888 Initial import
thib
parents:
diff changeset
456
223b71206888 Initial import
thib
parents:
diff changeset
457 char*
223b71206888 Initial import
thib
parents:
diff changeset
458 my_strdup (char *str)
223b71206888 Initial import
thib
parents:
diff changeset
459 {
223b71206888 Initial import
thib
parents:
diff changeset
460 char *new_str;
223b71206888 Initial import
thib
parents:
diff changeset
461
223b71206888 Initial import
thib
parents:
diff changeset
462 if (str)
223b71206888 Initial import
thib
parents:
diff changeset
463 {
223b71206888 Initial import
thib
parents:
diff changeset
464 new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
223b71206888 Initial import
thib
parents:
diff changeset
465 strcpy (new_str, str);
223b71206888 Initial import
thib
parents:
diff changeset
466 }
223b71206888 Initial import
thib
parents:
diff changeset
467 else
223b71206888 Initial import
thib
parents:
diff changeset
468 new_str = NULL;
223b71206888 Initial import
thib
parents:
diff changeset
469
223b71206888 Initial import
thib
parents:
diff changeset
470 return new_str;
223b71206888 Initial import
thib
parents:
diff changeset
471 }
223b71206888 Initial import
thib
parents:
diff changeset
472
223b71206888 Initial import
thib
parents:
diff changeset
473 int main (int argc, char *argv[])
223b71206888 Initial import
thib
parents:
diff changeset
474 {
223b71206888 Initial import
thib
parents:
diff changeset
475 int major, minor, micro;
223b71206888 Initial import
thib
parents:
diff changeset
476 char *tmp_version;
223b71206888 Initial import
thib
parents:
diff changeset
477
223b71206888 Initial import
thib
parents:
diff changeset
478 /* This hangs on some systems (?)
223b71206888 Initial import
thib
parents:
diff changeset
479 system ("touch conf.smpegtest");
223b71206888 Initial import
thib
parents:
diff changeset
480 */
223b71206888 Initial import
thib
parents:
diff changeset
481 { FILE *fp = fopen("conf.smpegtest", "a"); if ( fp ) fclose(fp); }
223b71206888 Initial import
thib
parents:
diff changeset
482
223b71206888 Initial import
thib
parents:
diff changeset
483 /* HP/UX 9 (%@#!) writes to sscanf strings */
223b71206888 Initial import
thib
parents:
diff changeset
484 tmp_version = my_strdup("$min_smpeg_version");
223b71206888 Initial import
thib
parents:
diff changeset
485 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
223b71206888 Initial import
thib
parents:
diff changeset
486 printf("%s, bad version string\n", "$min_smpeg_version");
223b71206888 Initial import
thib
parents:
diff changeset
487 exit(1);
223b71206888 Initial import
thib
parents:
diff changeset
488 }
223b71206888 Initial import
thib
parents:
diff changeset
489
223b71206888 Initial import
thib
parents:
diff changeset
490 if (($smpeg_major_version > major) ||
223b71206888 Initial import
thib
parents:
diff changeset
491 (($smpeg_major_version == major) && ($smpeg_minor_version > minor)) ||
223b71206888 Initial import
thib
parents:
diff changeset
492 (($smpeg_major_version == major) && ($smpeg_minor_version == minor)
223b71206888 Initial import
thib
parents:
diff changeset
493 && ($smpeg_micro_version >= micro)))
223b71206888 Initial import
thib
parents:
diff changeset
494 {
223b71206888 Initial import
thib
parents:
diff changeset
495 return 0;
223b71206888 Initial import
thib
parents:
diff changeset
496 }
223b71206888 Initial import
thib
parents:
diff changeset
497 else
223b71206888 Initial import
thib
parents:
diff changeset
498 {
223b71206888 Initial import
thib
parents:
diff changeset
499 printf("\n*** 'smpeg-config --version' returned %d.%d.%d, but the minimum version\n", $smpeg_major_version, $smpeg_minor_version,
223b71206888 Initial import
thib
parents:
diff changeset
500 $smpeg_micro_version);
223b71206888 Initial import
thib
parents:
diff changeset
501 printf("*** of SMPEG required is %d.%d.%d. If smpeg-config is correct, then it is\n", major, minor, micro);
223b71206888 Initial import
thib
parents:
diff changeset
502 printf("*** best to upgrade to the required version.\n");
223b71206888 Initial import
thib
parents:
diff changeset
503 printf("*** If smpeg-config was wrong, set the environment variable SMPEG_CONFIG\n");
223b71206888 Initial import
thib
parents:
diff changeset
504 printf("*** to point to the correct copy of smpeg-config, and remove the file\n");
223b71206888 Initial import
thib
parents:
diff changeset
505 printf("*** config.cache before re-running configure\n");
223b71206888 Initial import
thib
parents:
diff changeset
506 return 1;
223b71206888 Initial import
thib
parents:
diff changeset
507 }
223b71206888 Initial import
thib
parents:
diff changeset
508 }
223b71206888 Initial import
thib
parents:
diff changeset
509
223b71206888 Initial import
thib
parents:
diff changeset
510 ],, no_smpeg=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
223b71206888 Initial import
thib
parents:
diff changeset
511 CFLAGS="$ac_save_CFLAGS"
223b71206888 Initial import
thib
parents:
diff changeset
512 LIBS="$ac_save_LIBS"
223b71206888 Initial import
thib
parents:
diff changeset
513 fi
223b71206888 Initial import
thib
parents:
diff changeset
514 fi
223b71206888 Initial import
thib
parents:
diff changeset
515 if test "x$no_smpeg" = x ; then
223b71206888 Initial import
thib
parents:
diff changeset
516 AC_MSG_RESULT(yes)
223b71206888 Initial import
thib
parents:
diff changeset
517 ifelse([$2], , :, [$2])
223b71206888 Initial import
thib
parents:
diff changeset
518 else
223b71206888 Initial import
thib
parents:
diff changeset
519 AC_MSG_RESULT(no)
223b71206888 Initial import
thib
parents:
diff changeset
520 if test "$SMPEG_CONFIG" = "no" ; then
223b71206888 Initial import
thib
parents:
diff changeset
521 echo "*** The smpeg-config script installed by SMPEG could not be found"
223b71206888 Initial import
thib
parents:
diff changeset
522 echo "*** If SMPEG was installed in PREFIX, make sure PREFIX/bin is in"
223b71206888 Initial import
thib
parents:
diff changeset
523 echo "*** your path, or set the SMPEG_CONFIG environment variable to the"
223b71206888 Initial import
thib
parents:
diff changeset
524 echo "*** full path to smpeg-config."
223b71206888 Initial import
thib
parents:
diff changeset
525 else
223b71206888 Initial import
thib
parents:
diff changeset
526 if test -f conf.smpegtest ; then
223b71206888 Initial import
thib
parents:
diff changeset
527 :
223b71206888 Initial import
thib
parents:
diff changeset
528 else
223b71206888 Initial import
thib
parents:
diff changeset
529 echo "*** Could not run SMPEG test program, checking why..."
223b71206888 Initial import
thib
parents:
diff changeset
530 CFLAGS="$CFLAGS $SMPEG_CFLAGS $SDL_CFLAGS"
223b71206888 Initial import
thib
parents:
diff changeset
531 LIBS="$LIBS $SMPEG_LIBS $SDL_LIBS"
223b71206888 Initial import
thib
parents:
diff changeset
532 AC_TRY_LINK([
223b71206888 Initial import
thib
parents:
diff changeset
533 #include <stdio.h>
223b71206888 Initial import
thib
parents:
diff changeset
534 #include "smpeg.h"
223b71206888 Initial import
thib
parents:
diff changeset
535 ], [ return 0; ],
223b71206888 Initial import
thib
parents:
diff changeset
536 [ echo "*** The test program compiled, but did not run. This usually means"
223b71206888 Initial import
thib
parents:
diff changeset
537 echo "*** that the run-time linker is not finding SMPEG or finding the wrong"
223b71206888 Initial import
thib
parents:
diff changeset
538 echo "*** version of SMPEG. If it is not finding SMPEG, you'll need to set your"
223b71206888 Initial import
thib
parents:
diff changeset
539 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
223b71206888 Initial import
thib
parents:
diff changeset
540 echo "*** to the installed location Also, make sure you have run ldconfig if that"
223b71206888 Initial import
thib
parents:
diff changeset
541 echo "*** is required on your system"
223b71206888 Initial import
thib
parents:
diff changeset
542 echo "***"
223b71206888 Initial import
thib
parents:
diff changeset
543 echo "*** If you have an old version installed, it is best to remove it, although"
223b71206888 Initial import
thib
parents:
diff changeset
544 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
223b71206888 Initial import
thib
parents:
diff changeset
545 [ echo "*** The test program failed to compile or link. See the file config.log for the"
223b71206888 Initial import
thib
parents:
diff changeset
546 echo "*** exact error that occured. This usually means SMPEG was incorrectly installed"
223b71206888 Initial import
thib
parents:
diff changeset
547 echo "*** or that you have moved SMPEG since it was installed. In the latter case, you"
223b71206888 Initial import
thib
parents:
diff changeset
548 echo "*** may want to edit the smpeg-config script: $SMPEG_CONFIG" ])
223b71206888 Initial import
thib
parents:
diff changeset
549 CFLAGS="$ac_save_CFLAGS"
223b71206888 Initial import
thib
parents:
diff changeset
550 LIBS="$ac_save_LIBS"
223b71206888 Initial import
thib
parents:
diff changeset
551 fi
223b71206888 Initial import
thib
parents:
diff changeset
552 fi
223b71206888 Initial import
thib
parents:
diff changeset
553 SMPEG_CFLAGS=""
223b71206888 Initial import
thib
parents:
diff changeset
554 SMPEG_LIBS=""
223b71206888 Initial import
thib
parents:
diff changeset
555 ifelse([$3], , :, [$3])
223b71206888 Initial import
thib
parents:
diff changeset
556 fi
223b71206888 Initial import
thib
parents:
diff changeset
557 AC_SUBST(SMPEG_CFLAGS)
223b71206888 Initial import
thib
parents:
diff changeset
558 AC_SUBST(SMPEG_LIBS)
223b71206888 Initial import
thib
parents:
diff changeset
559 rm -f conf.smpegtest
223b71206888 Initial import
thib
parents:
diff changeset
560 ])
223b71206888 Initial import
thib
parents:
diff changeset
561