annotate acinclude.m4 @ 414:eb7878e07dba

Added borland.zip to EXTRA_DIST.
author Ryan C. Gordon <icculus@icculus.org>
date Thu, 22 Aug 2002 09:48:56 +0000
parents 72b51548aeca
children 6d94441c854e
rev   line source
68
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1 # Configure paths for SDL
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2 # Sam Lantinga 9/21/99
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3 # stolen from Manish Singh
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4 # stolen back from Frank Belew
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
5 # stolen from Manish Singh
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
6 # Shamelessly stolen from Owen Taylor
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
7
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
8 dnl AM_PATH_SDL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
9 dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
10 dnl
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
11 AC_DEFUN(AM_PATH_SDL,
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
12 [dnl
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
13 dnl Get the cflags and libraries from the sdl-config script
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
14 dnl
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
15 AC_ARG_WITH(sdl-prefix,[ --with-sdl-prefix=PFX Prefix where SDL is installed (optional)],
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
16 sdl_prefix="$withval", sdl_prefix="")
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
17 AC_ARG_WITH(sdl-exec-prefix,[ --with-sdl-exec-prefix=PFX Exec prefix where SDL is installed (optional)],
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
18 sdl_exec_prefix="$withval", sdl_exec_prefix="")
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
19 AC_ARG_ENABLE(sdltest, [ --disable-sdltest Do not try to compile and run a test SDL program],
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
20 , enable_sdltest=yes)
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
21
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
22 if test x$sdl_exec_prefix != x ; then
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
23 sdl_args="$sdl_args --exec-prefix=$sdl_exec_prefix"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
24 if test x${SDL_CONFIG+set} != xset ; then
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
25 SDL_CONFIG=$sdl_exec_prefix/bin/sdl-config
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
26 fi
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
27 fi
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
28 if test x$sdl_prefix != x ; then
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
29 sdl_args="$sdl_args --prefix=$sdl_prefix"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
30 if test x${SDL_CONFIG+set} != xset ; then
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
31 SDL_CONFIG=$sdl_prefix/bin/sdl-config
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
32 fi
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
33 fi
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
34
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
35 AC_PATH_PROG(SDL_CONFIG, sdl-config, no)
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
36 min_sdl_version=ifelse([$1], ,0.11.0,$1)
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
37 AC_MSG_CHECKING(for SDL - version >= $min_sdl_version)
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
38 no_sdl=""
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
39 if test "$SDL_CONFIG" = "no" ; then
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
40 no_sdl=yes
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
41 else
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
42 SDL_CFLAGS=`$SDL_CONFIG $sdlconf_args --cflags`
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
43 SDL_LIBS=`$SDL_CONFIG $sdlconf_args --libs`
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
44
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
45 sdl_major_version=`$SDL_CONFIG $sdl_args --version | \
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
46 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
47 sdl_minor_version=`$SDL_CONFIG $sdl_args --version | \
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
48 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
49 sdl_micro_version=`$SDL_CONFIG $sdl_config_args --version | \
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
50 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
51 if test "x$enable_sdltest" = "xyes" ; then
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
52 ac_save_CFLAGS="$CFLAGS"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
53 ac_save_LIBS="$LIBS"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
54 CFLAGS="$CFLAGS $SDL_CFLAGS"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
55 LIBS="$LIBS $SDL_LIBS"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
56 dnl
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
57 dnl Now check if the installed SDL is sufficiently new. (Also sanity
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
58 dnl checks the results of sdl-config to some extent
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
59 dnl
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
60 rm -f conf.sdltest
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
61 AC_TRY_RUN([
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
62 #include <stdio.h>
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
63 #include <stdlib.h>
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
64 #include <string.h>
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
65 #include "SDL.h"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
66
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
67 char*
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
68 my_strdup (char *str)
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
69 {
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
70 char *new_str;
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
71
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
72 if (str)
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
73 {
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
74 new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
75 strcpy (new_str, str);
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
76 }
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
77 else
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
78 new_str = NULL;
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
79
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
80 return new_str;
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
81 }
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
82
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
83 int main (int argc, char *argv[])
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
84 {
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
85 int major, minor, micro;
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
86 char *tmp_version;
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
87
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
88 /* This hangs on some systems (?)
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
89 system ("touch conf.sdltest");
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
90 */
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
91 { FILE *fp = fopen("conf.sdltest", "a"); if ( fp ) fclose(fp); }
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
92
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
93 /* HP/UX 9 (%@#!) writes to sscanf strings */
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
94 tmp_version = my_strdup("$min_sdl_version");
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
95 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
96 printf("%s, bad version string\n", "$min_sdl_version");
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
97 exit(1);
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
98 }
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
99
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
100 if (($sdl_major_version > major) ||
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
101 (($sdl_major_version == major) && ($sdl_minor_version > minor)) ||
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
102 (($sdl_major_version == major) && ($sdl_minor_version == minor) && ($sdl_micro_version >= micro)))
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
103 {
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
104 return 0;
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
105 }
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
106 else
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
107 {
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
108 printf("\n*** 'sdl-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version);
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
109 printf("*** of SDL required is %d.%d.%d. If sdl-config is correct, then it is\n", major, minor, micro);
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
110 printf("*** best to upgrade to the required version.\n");
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
111 printf("*** If sdl-config was wrong, set the environment variable SDL_CONFIG\n");
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
112 printf("*** to point to the correct copy of sdl-config, and remove the file\n");
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
113 printf("*** config.cache before re-running configure\n");
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
114 return 1;
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
115 }
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
116 }
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
117
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
118 ],, no_sdl=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
119 CFLAGS="$ac_save_CFLAGS"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
120 LIBS="$ac_save_LIBS"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
121 fi
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
122 fi
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
123 if test "x$no_sdl" = x ; then
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
124 AC_MSG_RESULT(yes)
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
125 ifelse([$2], , :, [$2])
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
126 else
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
127 AC_MSG_RESULT(no)
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
128 if test "$SDL_CONFIG" = "no" ; then
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
129 echo "*** The sdl-config script installed by SDL could not be found"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
130 echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
131 echo "*** your path, or set the SDL_CONFIG environment variable to the"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
132 echo "*** full path to sdl-config."
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
133 else
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
134 if test -f conf.sdltest ; then
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
135 :
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
136 else
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
137 echo "*** Could not run SDL test program, checking why..."
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
138 CFLAGS="$CFLAGS $SDL_CFLAGS"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
139 LIBS="$LIBS $SDL_LIBS"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
140 AC_TRY_LINK([
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
141 #include <stdio.h>
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
142 #include "SDL.h"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
143
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
144 int main(int argc, char *argv[])
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
145 { return 0; }
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
146 #undef main
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
147 #define main K_and_R_C_main
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
148 ], [ return 0; ],
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
149 [ echo "*** The test program compiled, but did not run. This usually means"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
150 echo "*** that the run-time linker is not finding SDL or finding the wrong"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
151 echo "*** version of SDL. If it is not finding SDL, you'll need to set your"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
152 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
153 echo "*** to the installed location Also, make sure you have run ldconfig if that"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
154 echo "*** is required on your system"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
155 echo "***"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
156 echo "*** If you have an old version installed, it is best to remove it, although"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
157 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
158 [ echo "*** The test program failed to compile or link. See the file config.log for the"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
159 echo "*** exact error that occured. This usually means SDL was incorrectly installed"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
160 echo "*** or that you have moved SDL since it was installed. In the latter case, you"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
161 echo "*** may want to edit the sdl-config script: $SDL_CONFIG" ])
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
162 CFLAGS="$ac_save_CFLAGS"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
163 LIBS="$ac_save_LIBS"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
164 fi
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
165 fi
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
166 SDL_CFLAGS=""
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
167 SDL_LIBS=""
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
168 ifelse([$3], , :, [$3])
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
169 fi
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
170 AC_SUBST(SDL_CFLAGS)
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
171 AC_SUBST(SDL_LIBS)
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
172 rm -f conf.sdltest
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
173 ])
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
174 # Configure paths for libmikmod
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
175 #
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
176 # Derived from glib.m4 (Owen Taylor 97-11-3)
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
177 # Improved by Chris Butler
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
178 #
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
179
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
180 dnl AM_PATH_LIBMIKMOD([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
181 dnl Test for libmikmod, and define LIBMIKMOD_CFLAGS, LIBMIKMOD_LIBS and
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
182 dnl LIBMIKMOD_LDADD
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
183 dnl
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
184 AC_DEFUN(AM_PATH_LIBMIKMOD,
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
185 [dnl
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
186 dnl Get the cflags and libraries from the libmikmod-config script
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
187 dnl
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
188 AC_ARG_WITH(libmikmod-prefix,[ --with-libmikmod-prefix=PFX Prefix where libmikmod is installed (optional)],
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
189 libmikmod_config_prefix="$withval", libmikmod_config_prefix="")
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
190 AC_ARG_WITH(libmikmod-exec-prefix,[ --with-libmikmod-exec-prefix=PFX Exec prefix where libmikmod is installed (optional)],
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
191 libmikmod_config_exec_prefix="$withval", libmikmod_config_exec_prefix="")
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
192 AC_ARG_ENABLE(libmikmodtest, [ --disable-libmikmodtest Do not try to compile and run a test libmikmod program],
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
193 , enable_libmikmodtest=yes)
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
194
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
195 if test x$libmikmod_config_exec_prefix != x ; then
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
196 libmikmod_config_args="$libmikmod_config_args --exec-prefix=$libmikmod_config_exec_prefix"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
197 if test x${LIBMIKMOD_CONFIG+set} != xset ; then
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
198 LIBMIKMOD_CONFIG=$libmikmod_config_exec_prefix/bin/libmikmod-config
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
199 fi
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
200 fi
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
201 if test x$libmikmod_config_prefix != x ; then
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
202 libmikmod_config_args="$libmikmod_config_args --prefix=$libmikmod_config_prefix"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
203 if test x${LIBMIKMOD_CONFIG+set} != xset ; then
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
204 LIBMIKMOD_CONFIG=$libmikmod_config_prefix/bin/libmikmod-config
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
205 fi
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
206 fi
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
207
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
208 AC_PATH_PROG(LIBMIKMOD_CONFIG, libmikmod-config, no)
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
209 min_libmikmod_version=ifelse([$1], ,3.1.5,$1)
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
210 AC_MSG_CHECKING(for libmikmod - version >= $min_libmikmod_version)
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
211 no_libmikmod=""
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
212 if test "$LIBMIKMOD_CONFIG" = "no" ; then
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
213 no_libmikmod=yes
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
214 else
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
215 LIBMIKMOD_CFLAGS=`$LIBMIKMOD_CONFIG $libmikmod_config_args --cflags`
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
216 LIBMIKMOD_LIBS=`$LIBMIKMOD_CONFIG $libmikmod_config_args --libs`
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
217 LIBMIKMOD_LDADD=`$LIBMIKMOD_CONFIG $libmikmod_config_args --ldadd`
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
218 libmikmod_config_major_version=`$LIBMIKMOD_CONFIG $libmikmod_config_args --version | \
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
219 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\).*/\1/'`
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
220 libmikmod_config_minor_version=`$LIBMIKMOD_CONFIG $libmikmod_config_args --version | \
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
221 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\).*/\2/'`
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
222 libmikmod_config_micro_version=`$LIBMIKMOD_CONFIG $libmikmod_config_args --version | \
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
223 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\).*/\3/'`
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
224 if test "x$enable_libmikmodtest" = "xyes" ; then
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
225 ac_save_CFLAGS="$CFLAGS"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
226 ac_save_LIBS="$LIBS"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
227 AC_LANG_SAVE
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
228 AC_LANG_C
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
229 CFLAGS="$CFLAGS $LIBMIKMOD_CFLAGS $LIBMIKMOD_LDADD"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
230 LIBS="$LIBMIKMOD_LIBS $LIBS"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
231 dnl
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
232 dnl Now check if the installed libmikmod is sufficiently new. (Also sanity
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
233 dnl checks the results of libmikmod-config to some extent
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
234 dnl
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
235 rm -f conf.mikmodtest
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
236 AC_TRY_RUN([
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
237 #include <mikmod.h>
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
238 #include <stdio.h>
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
239 #include <stdlib.h>
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
240
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
241 char* my_strdup (char *str)
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
242 {
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
243 char *new_str;
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
244
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
245 if (str) {
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
246 new_str = malloc ((strlen (str) + 1) * sizeof(char));
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
247 strcpy (new_str, str);
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
248 } else
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
249 new_str = NULL;
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
250
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
251 return new_str;
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
252 }
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
253
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
254 int main()
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
255 {
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
256 int major,minor,micro;
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
257 int libmikmod_major_version,libmikmod_minor_version,libmikmod_micro_version;
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
258 char *tmp_version;
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
259
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
260 system("touch conf.mikmodtest");
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
261
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
262 /* HP/UX 9 (%@#!) writes to sscanf strings */
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
263 tmp_version = my_strdup("$min_libmikmod_version");
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
264 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
265 printf("%s, bad version string\n", "$min_libmikmod_version");
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
266 exit(1);
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
267 }
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
268
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
269 libmikmod_major_version=(MikMod_GetVersion() >> 16) & 255;
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
270 libmikmod_minor_version=(MikMod_GetVersion() >> 8) & 255;
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
271 libmikmod_micro_version=(MikMod_GetVersion() ) & 255;
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
272
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
273 if ((libmikmod_major_version != $libmikmod_config_major_version) ||
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
274 (libmikmod_minor_version != $libmikmod_config_minor_version) ||
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
275 (libmikmod_micro_version != $libmikmod_config_micro_version))
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
276 {
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
277 printf("\n*** 'libmikmod-config --version' returned %d.%d.%d, but libmikmod (%d.%d.%d)\n",
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
278 $libmikmod_config_major_version, $libmikmod_config_minor_version, $libmikmod_config_micro_version,
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
279 libmikmod_major_version, libmikmod_minor_version, libmikmod_micro_version);
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
280 printf ("*** was found! If libmikmod-config was correct, then it is best\n");
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
281 printf ("*** to remove the old version of libmikmod. You may also be able to fix the error\n");
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
282 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
283 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
284 printf("*** required on your system.\n");
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
285 printf("*** If libmikmod-config was wrong, set the environment variable LIBMIKMOD_CONFIG\n");
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
286 printf("*** to point to the correct copy of libmikmod-config, and remove the file config.cache\n");
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
287 printf("*** before re-running configure\n");
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
288 }
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
289 else if ((libmikmod_major_version != LIBMIKMOD_VERSION_MAJOR) ||
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
290 (libmikmod_minor_version != LIBMIKMOD_VERSION_MINOR) ||
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
291 (libmikmod_micro_version != LIBMIKMOD_REVISION))
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
292 {
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
293 printf("*** libmikmod header files (version %d.%d.%d) do not match\n",
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
294 LIBMIKMOD_VERSION_MAJOR, LIBMIKMOD_VERSION_MINOR, LIBMIKMOD_REVISION);
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
295 printf("*** library (version %d.%d.%d)\n",
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
296 libmikmod_major_version, libmikmod_minor_version, libmikmod_micro_version);
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
297 }
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
298 else
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
299 {
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
300 if ((libmikmod_major_version > major) ||
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
301 ((libmikmod_major_version == major) && (libmikmod_minor_version > minor)) ||
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
302 ((libmikmod_major_version == major) && (libmikmod_minor_version == minor) && (libmikmod_micro_version >= micro)))
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
303 {
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
304 return 0;
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
305 }
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
306 else
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
307 {
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
308 printf("\n*** An old version of libmikmod (%d.%d.%d) was found.\n",
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
309 libmikmod_major_version, libmikmod_minor_version, libmikmod_micro_version);
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
310 printf("*** You need a version of libmikmod newer than %d.%d.%d.\n",
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
311 major, minor, micro);
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
312 printf("***\n");
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
313 printf("*** If you have already installed a sufficiently new version, this error\n");
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
314 printf("*** probably means that the wrong copy of the libmikmod-config shell script is\n");
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
315 printf("*** being found. The easiest way to fix this is to remove the old version\n");
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
316 printf("*** of libmikmod, but you can also set the LIBMIKMOD_CONFIG environment to point to the\n");
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
317 printf("*** correct copy of libmikmod-config. (In this case, you will have to\n");
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
318 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
319 printf("*** so that the correct libraries are found at run-time))\n");
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
320 }
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
321 }
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
322 return 1;
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
323 }
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
324 ],, no_libmikmod=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
325 CFLAGS="$ac_save_CFLAGS"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
326 LIBS="$ac_save_LIBS"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
327 AC_LANG_RESTORE
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
328 fi
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
329 fi
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
330 if test "x$no_libmikmod" = x ; then
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
331 AC_MSG_RESULT([yes, `$LIBMIKMOD_CONFIG --version`])
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
332 ifelse([$2], , :, [$2])
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
333 else
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
334 AC_MSG_RESULT(no)
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
335 if test "$LIBMIKMOD_CONFIG" = "no" ; then
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
336 echo "*** The libmikmod-config script installed by libmikmod could not be found"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
337 echo "*** If libmikmod was installed in PREFIX, make sure PREFIX/bin is in"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
338 echo "*** your path, or set the LIBMIKMOD_CONFIG environment variable to the"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
339 echo "*** full path to libmikmod-config."
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
340 else
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
341 if test -f conf.mikmodtest ; then
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
342 :
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
343 else
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
344 echo "*** Could not run libmikmod test program, checking why..."
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
345 CFLAGS="$CFLAGS $LIBMIKMOD_CFLAGS"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
346 LIBS="$LIBS $LIBMIKMOD_LIBS"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
347 AC_LANG_SAVE
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
348 AC_LANG_C
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
349 AC_TRY_LINK([
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
350 #include <mikmod.h>
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
351 #include <stdio.h>
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
352 ], [ return (MikMod_GetVersion()!=0); ],
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
353 [ echo "*** The test program compiled, but did not run. This usually means"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
354 echo "*** that the run-time linker is not finding libmikmod or finding the wrong"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
355 echo "*** version of libmikmod. If it is not finding libmikmod, you'll need to set your"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
356 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
357 echo "*** to the installed location. Also, make sure you have run ldconfig if that"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
358 echo "*** is required on your system."
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
359 echo "***"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
360 echo "*** If you have an old version installed, it is best to remove it, although"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
361 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
362 [ echo "*** The test program failed to compile or link. See the file config.log for the"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
363 echo "*** exact error that occured. This usually means libmikmod was incorrectly installed"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
364 echo "*** or that you have moved libmikmod since it was installed. In the latter case, you"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
365 echo "*** may want to edit the libmikmod-config script: $LIBMIKMOD_CONFIG" ])
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
366 CFLAGS="$ac_save_CFLAGS"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
367 LIBS="$ac_save_LIBS"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
368 AC_LANG_RESTORE
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
369 fi
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
370 fi
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
371 LIBMIKMOD_CFLAGS=""
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
372 LIBMIKMOD_LIBS=""
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
373 LIBMIKMOD_LDADD=""
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
374 ifelse([$3], , :, [$3])
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
375 fi
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
376 AC_SUBST(LIBMIKMOD_CFLAGS)
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
377 AC_SUBST(LIBMIKMOD_LIBS)
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
378 AC_SUBST(LIBMIKMOD_LDADD)
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
379 rm -f conf.mikmodtest
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
380 ])
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
381 # Configure paths for libvorbis
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
382 # Jack Moffitt <jack@icecast.org> 10-21-2000
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
383 # Shamelessly stolen from Owen Taylor and Manish Singh
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
384
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
385 dnl AM_PATH_VORBIS([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
386 dnl Test for libvorbis, and define VORBIS_CFLAGS and VORBIS_LIBS
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
387 dnl
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
388 AC_DEFUN(AM_PATH_VORBIS,
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
389 [dnl
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
390 dnl Get the cflags and libraries
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
391 dnl
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
392 AC_ARG_WITH(vorbis-prefix,[ --with-vorbis-prefix=PFX Prefix where libvorbis is installed (optional)], vorbis_prefix="$withval", vorbis_prefix="")
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
393 AC_ARG_ENABLE(vorbistest, [ --disable-vorbistest Do not try to compile and run a test Vorbis program],, enable_vorbistest=yes)
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
394
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
395 if test x$vorbis_prefix != x ; then
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
396 vorbis_args="$vorbis_args --prefix=$vorbis_prefix"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
397 VORBIS_CFLAGS="-I$vorbis_prefix/include"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
398 VORBIS_LIBDIR="-L$vorbis_prefix/lib"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
399 fi
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
400
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
401 VORBIS_LIBS="$VORBIS_LIBDIR -lvorbis -lm"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
402 VORBISFILE_LIBS="-lvorbisfile"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
403 VORBISENC_LIBS="-lvorbisenc"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
404
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
405 AC_MSG_CHECKING(for Vorbis)
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
406 no_vorbis=""
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
407
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
408
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
409 if test "x$enable_vorbistest" = "xyes" ; then
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
410 ac_save_CFLAGS="$CFLAGS"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
411 ac_save_LIBS="$LIBS"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
412 CFLAGS="$CFLAGS $VORBIS_CFLAGS"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
413 LIBS="$LIBS $VORBIS_LIBS $OGG_LIBS"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
414 dnl
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
415 dnl Now check if the installed Vorbis is sufficiently new.
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
416 dnl
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
417 rm -f conf.vorbistest
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
418 AC_TRY_RUN([
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
419 #include <stdio.h>
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
420 #include <stdlib.h>
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
421 #include <string.h>
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
422 #include <vorbis/codec.h>
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
423
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
424 int main ()
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
425 {
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
426 system("touch conf.vorbistest");
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
427 return 0;
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
428 }
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
429
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
430 ],, no_vorbis=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
431 CFLAGS="$ac_save_CFLAGS"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
432 LIBS="$ac_save_LIBS"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
433 fi
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
434
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
435 if test "x$no_vorbis" = x ; then
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
436 AC_MSG_RESULT(yes)
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
437 ifelse([$1], , :, [$1])
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
438 else
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
439 AC_MSG_RESULT(no)
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
440 if test -f conf.vorbistest ; then
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
441 :
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
442 else
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
443 echo "*** Could not run Vorbis test program, checking why..."
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
444 CFLAGS="$CFLAGS $VORBIS_CFLAGS"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
445 LIBS="$LIBS $VORBIS_LIBS $OGG_LIBS"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
446 AC_TRY_LINK([
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
447 #include <stdio.h>
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
448 #include <vorbis/codec.h>
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
449 ], [ return 0; ],
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
450 [ echo "*** The test program compiled, but did not run. This usually means"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
451 echo "*** that the run-time linker is not finding Vorbis or finding the wrong"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
452 echo "*** version of Vorbis. If it is not finding Vorbis, you'll need to set your"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
453 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
454 echo "*** to the installed location Also, make sure you have run ldconfig if that"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
455 echo "*** is required on your system"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
456 echo "***"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
457 echo "*** If you have an old version installed, it is best to remove it, although"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
458 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
459 [ echo "*** The test program failed to compile or link. See the file config.log for the"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
460 echo "*** exact error that occured. This usually means Vorbis was incorrectly installed"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
461 echo "*** or that you have moved Vorbis since it was installed." ])
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
462 CFLAGS="$ac_save_CFLAGS"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
463 LIBS="$ac_save_LIBS"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
464 fi
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
465 VORBIS_CFLAGS=""
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
466 VORBIS_LIBS=""
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
467 VORBISFILE_LIBS=""
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
468 VORBISENC_LIBS=""
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
469 ifelse([$2], , :, [$2])
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
470 fi
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
471 AC_SUBST(VORBIS_CFLAGS)
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
472 AC_SUBST(VORBIS_LIBS)
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
473 AC_SUBST(VORBISFILE_LIBS)
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
474 AC_SUBST(VORBISENC_LIBS)
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
475 rm -f conf.vorbistest
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
476 ])
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
477 # Configure paths for SMPEG
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
478 # Nicolas Vignal 11/19/2000
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
479 # stolen from Sam Lantinga
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
480 # stolen from Manish Singh
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
481 # stolen back from Frank Belew
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
482 # stolen from Manish Singh
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
483 # Shamelessly stolen from Owen Taylor
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
484
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
485 dnl AM_PATH_SMPEG([MINIMUM-VERSION, [ACTION-IF-FOUND [,
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
486 ACTION-IF-NOT-FOUND]]])
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
487 dnl Test for SMPEG, and define SMPEG_CFLAGS and SMPEG_LIBS
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
488 dnl
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
489 AC_DEFUN(AM_PATH_SMPEG,
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
490 [dnl
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
491 dnl Get the cflags and libraries from the smpeg-config script
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
492 dnl
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
493 AC_ARG_WITH(smpeg-prefix,[ --with-smpeg-prefix=PFX Prefix where SMPEG is
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
494 installed (optional)],
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
495 smpeg_prefix="$withval", smpeg_prefix="")
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
496 AC_ARG_WITH(smpeg-exec-prefix,[ --with-smpeg-exec-prefix=PFX Exec prefix
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
497 where SMPEG is installed (optional)],
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
498 smpeg_exec_prefix="$withval", smpeg_exec_prefix="")
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
499 AC_ARG_ENABLE(smpegtest, [ --disable-smpegtest Do not try to compile
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
500 and run a test SMPEG program],
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
501 , enable_smpegtest=yes)
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
502
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
503 if test x$smpeg_exec_prefix != x ; then
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
504 smpeg_args="$smpeg_args --exec-prefix=$smpeg_exec_prefix"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
505 if test x${SMPEG_CONFIG+set} != xset ; then
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
506 SMPEG_CONFIG=$smpeg_exec_prefix/bin/smpeg-config
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
507 fi
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
508 fi
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
509 if test x$smpeg_prefix != x ; then
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
510 smpeg_args="$smpeg_args --prefix=$smpeg_prefix"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
511 if test x${SMPEG_CONFIG+set} != xset ; then
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
512 SMPEG_CONFIG=$smpeg_prefix/bin/smpeg-config
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
513 fi
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
514 fi
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
515
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
516 AC_PATH_PROG(SMPEG_CONFIG, smpeg-config, no)
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
517 min_smpeg_version=ifelse([$1], ,0.2.7,$1)
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
518 AC_MSG_CHECKING(for SMPEG - version >= $min_smpeg_version)
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
519 no_smpeg=""
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
520 if test "$SMPEG_CONFIG" = "no" ; then
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
521 no_smpeg=yes
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
522 else
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
523 SMPEG_CFLAGS=`$SMPEG_CONFIG $smpegconf_args --cflags`
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
524 SMPEG_LIBS=`$SMPEG_CONFIG $smpegconf_args --libs`
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
525
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
526 smpeg_major_version=`$SMPEG_CONFIG $smpeg_args --version | \
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
527 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
528 smpeg_minor_version=`$SMPEG_CONFIG $smpeg_args --version | \
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
529 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
530 smpeg_micro_version=`$SMPEG_CONFIG $smpeg_config_args --version | \
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
531 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
532 if test "x$enable_smpegtest" = "xyes" ; then
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
533 ac_save_CFLAGS="$CFLAGS"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
534 ac_save_LIBS="$LIBS"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
535 CFLAGS="$CFLAGS $SMPEG_CFLAGS $SDL_CFLAGS"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
536 LIBS="$LIBS $SMPEG_LIBS $SDL_LIBS"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
537 dnl
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
538 dnl Now check if the installed SMPEG is sufficiently new. (Also sanity
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
539 dnl checks the results of smpeg-config to some extent
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
540 dnl
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
541 rm -f conf.smpegtest
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
542 AC_TRY_RUN([
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
543 #include <stdio.h>
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
544 #include <stdlib.h>
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
545 #include <string.h>
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
546 #include "smpeg.h"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
547
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
548 char*
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
549 my_strdup (char *str)
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
550 {
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
551 char *new_str;
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
552
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
553 if (str)
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
554 {
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
555 new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
556 strcpy (new_str, str);
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
557 }
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
558 else
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
559 new_str = NULL;
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
560
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
561 return new_str;
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
562 }
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
563
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
564 int main (int argc, char *argv[])
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
565 {
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
566 int major, minor, micro;
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
567 char *tmp_version;
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
568
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
569 /* This hangs on some systems (?)
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
570 system ("touch conf.smpegtest");
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
571 */
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
572 { FILE *fp = fopen("conf.smpegtest", "a"); if ( fp ) fclose(fp); }
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
573
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
574 /* HP/UX 9 (%@#!) writes to sscanf strings */
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
575 tmp_version = my_strdup("$min_smpeg_version");
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
576 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
577 printf("%s, bad version string\n", "$min_smpeg_version");
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
578 exit(1);
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
579 }
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
580
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
581 if (($smpeg_major_version > major) ||
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
582 (($smpeg_major_version == major) && ($smpeg_minor_version > minor)) ||
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
583 (($smpeg_major_version == major) && ($smpeg_minor_version == minor)
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
584 && ($smpeg_micro_version >= micro)))
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
585 {
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
586 return 0;
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
587 }
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
588 else
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
589 {
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
590 printf("\n*** 'smpeg-config --version' returned %d.%d.%d, but the
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
591 minimum version\n", $smpeg_major_version, $smpeg_minor_version,
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
592 $smpeg_micro_version);
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
593 printf("*** of SMPEG required is %d.%d.%d. If smpeg-config is
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
594 correct, then it is\n", major, minor, micro);
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
595 printf("*** best to upgrade to the required version.\n");
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
596 printf("*** If smpeg-config was wrong, set the environment variable
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
597 SMPEG_CONFIG\n");
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
598 printf("*** to point to the correct copy of smpeg-config, and remove
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
599 the file\n");
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
600 printf("*** config.cache before re-running configure\n");
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
601 return 1;
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
602 }
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
603 }
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
604
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
605 ],, no_smpeg=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
606 CFLAGS="$ac_save_CFLAGS"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
607 LIBS="$ac_save_LIBS"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
608 fi
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
609 fi
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
610 if test "x$no_smpeg" = x ; then
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
611 AC_MSG_RESULT(yes)
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
612 ifelse([$2], , :, [$2])
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
613 else
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
614 AC_MSG_RESULT(no)
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
615 if test "$SMPEG_CONFIG" = "no" ; then
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
616 echo "*** The smpeg-config script installed by SMPEG could not be
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
617 found"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
618 echo "*** If SMPEG was installed in PREFIX, make sure PREFIX/bin is
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
619 in"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
620 echo "*** your path, or set the SMPEG_CONFIG environment variable to
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
621 the"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
622 echo "*** full path to smpeg-config."
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
623 else
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
624 if test -f conf.smpegtest ; then
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
625 :
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
626 else
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
627 echo "*** Could not run SMPEG test program, checking why..."
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
628 CFLAGS="$CFLAGS $SMPEG_CFLAGS $SDL_CFLAGS"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
629 LIBS="$LIBS $SMPEG_LIBS $SDL_LIBS"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
630 AC_TRY_LINK([
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
631 #include <stdio.h>
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
632 #include "smpeg.h"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
633 ], [ return 0; ],
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
634 [ echo "*** The test program compiled, but did not run. This
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
635 usually means"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
636 echo "*** that the run-time linker is not finding SMPEG or
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
637 finding the wrong"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
638 echo "*** version of SMPEG. If it is not finding SMPEG, you'll
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
639 need to set your"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
640 echo "*** LD_LIBRARY_PATH environment variable, or edit
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
641 /etc/ld.so.conf to point"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
642 echo "*** to the installed location Also, make sure you have run
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
643 ldconfig if that"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
644 echo "*** is required on your system"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
645 echo "***"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
646 echo "*** If you have an old version installed, it is best to
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
647 remove it, although"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
648 echo "*** you may also be able to get things to work by modifying
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
649 LD_LIBRARY_PATH"],
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
650 [ echo "*** The test program failed to compile or link. See the
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
651 file config.log for the"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
652 echo "*** exact error that occured. This usually means SMPEG was
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
653 incorrectly installed"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
654 echo "*** or that you have moved SMPEG since it was installed. In
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
655 the latter case, you"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
656 echo "*** may want to edit the smpeg-config script:
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
657 $SMPEG_CONFIG" ])
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
658 CFLAGS="$ac_save_CFLAGS"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
659 LIBS="$ac_save_LIBS"
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
660 fi
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
661 fi
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
662 SMPEG_CFLAGS=""
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
663 SMPEG_LIBS=""
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
664 ifelse([$3], , :, [$3])
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
665 fi
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
666 AC_SUBST(SMPEG_CFLAGS)
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
667 AC_SUBST(SMPEG_LIBS)
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
668 rm -f conf.smpegtest
0b53ace8b875 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
669 ])
73
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
670 ## libtool.m4 - Configure libtool for the target system. -*-Shell-script-*-
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
671 ## Copyright (C) 1996-1999, 2000 Free Software Foundation, Inc.
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
672 ## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
673 ##
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
674 ## This program is free software; you can redistribute it and/or modify
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
675 ## it under the terms of the GNU General Public License as published by
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
676 ## the Free Software Foundation; either version 2 of the License, or
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
677 ## (at your option) any later version.
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
678 ##
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
679 ## This program is distributed in the hope that it will be useful, but
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
680 ## WITHOUT ANY WARRANTY; without even the implied warranty of
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
681 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
682 ## General Public License for more details.
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
683 ##
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
684 ## You should have received a copy of the GNU General Public License
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
685 ## along with this program; if not, write to the Free Software
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
686 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
687 ##
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
688 ## As a special exception to the GNU General Public License, if you
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
689 ## distribute this file as part of a program that contains a
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
690 ## configuration script generated by Autoconf, you may include it under
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
691 ## the same distribution terms that you use for the rest of that program.
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
692
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
693 # serial 40 AC_PROG_LIBTOOL
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
694 AC_DEFUN(AC_PROG_LIBTOOL,
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
695 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
696
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
697 # Save cache, so that ltconfig can load it
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
698 AC_CACHE_SAVE
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
699
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
700 # Actually configure libtool. ac_aux_dir is where install-sh is found.
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
701 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
702 LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
703 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
704 DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
705 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
706 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
707 || AC_MSG_ERROR([libtool configure failed])
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
708
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
709 # Reload cache, that may have been modified by ltconfig
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
710 AC_CACHE_LOAD
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
711
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
712 # This can be used to rebuild libtool when needed
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
713 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
714
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
715 # Always use our own libtool.
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
716 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
717 AC_SUBST(LIBTOOL)dnl
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
718
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
719 # Redirect the config.log output again, so that the ltconfig log is not
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
720 # clobbered by the next message.
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
721 exec 5>>./config.log
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
722 ])
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
723
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
724 AC_DEFUN(AC_LIBTOOL_SETUP,
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
725 [AC_PREREQ(2.13)dnl
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
726 AC_REQUIRE([AC_ENABLE_SHARED])dnl
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
727 AC_REQUIRE([AC_ENABLE_STATIC])dnl
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
728 AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
729 AC_REQUIRE([AC_CANONICAL_HOST])dnl
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
730 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
731 AC_REQUIRE([AC_PROG_RANLIB])dnl
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
732 AC_REQUIRE([AC_PROG_CC])dnl
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
733 AC_REQUIRE([AC_PROG_LD])dnl
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
734 AC_REQUIRE([AC_PROG_NM])dnl
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
735 AC_REQUIRE([AC_PROG_LN_S])dnl
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
736 dnl
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
737
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
738 case "$target" in
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
739 NONE) lt_target="$host" ;;
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
740 *) lt_target="$target" ;;
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
741 esac
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
742
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
743 # Check for any special flags to pass to ltconfig.
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
744 libtool_flags="--cache-file=$cache_file"
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
745 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
746 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
747 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
748 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
749 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
750 ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
751 [libtool_flags="$libtool_flags --enable-dlopen"])
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
752 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
753 [libtool_flags="$libtool_flags --enable-win32-dll"])
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
754 AC_ARG_ENABLE(libtool-lock,
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
755 [ --disable-libtool-lock avoid locking (might break parallel builds)])
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
756 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
757 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
758
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
759 # Some flags need to be propagated to the compiler or linker for good
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
760 # libtool support.
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
761 case "$lt_target" in
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
762 *-*-irix6*)
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
763 # Find out which ABI we are using.
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
764 echo '[#]line __oline__ "configure"' > conftest.$ac_ext
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
765 if AC_TRY_EVAL(ac_compile); then
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
766 case "`/usr/bin/file conftest.o`" in
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
767 *32-bit*)
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
768 LD="${LD-ld} -32"
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
769 ;;
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
770 *N32*)
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
771 LD="${LD-ld} -n32"
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
772 ;;
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
773 *64-bit*)
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
774 LD="${LD-ld} -64"
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
775 ;;
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
776 esac
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
777 fi
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
778 rm -rf conftest*
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
779 ;;
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
780
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
781 *-*-sco3.2v5*)
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
782 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
783 SAVE_CFLAGS="$CFLAGS"
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
784 CFLAGS="$CFLAGS -belf"
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
785 AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
786 [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
787 if test x"$lt_cv_cc_needs_belf" != x"yes"; then
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
788 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
789 CFLAGS="$SAVE_CFLAGS"
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
790 fi
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
791 ;;
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
792
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
793 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
794 [*-*-cygwin* | *-*-mingw*)
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
795 AC_CHECK_TOOL(DLLTOOL, dlltool, false)
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
796 AC_CHECK_TOOL(AS, as, false)
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
797 AC_CHECK_TOOL(OBJDUMP, objdump, false)
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
798 ;;
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
799 ])
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
800 esac
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
801 ])
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
802
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
803 # AC_LIBTOOL_DLOPEN - enable checks for dlopen support
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
804 AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
805
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
806 # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
807 AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
808
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
809 # AC_ENABLE_SHARED - implement the --enable-shared flag
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
810 # Usage: AC_ENABLE_SHARED[(DEFAULT)]
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
811 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
812 # `yes'.
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
813 AC_DEFUN(AC_ENABLE_SHARED, [dnl
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
814 define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
815 AC_ARG_ENABLE(shared,
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
816 changequote(<<, >>)dnl
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
817 << --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
818 changequote([, ])dnl
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
819 [p=${PACKAGE-default}
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
820 case "$enableval" in
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
821 yes) enable_shared=yes ;;
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
822 no) enable_shared=no ;;
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
823 *)
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
824 enable_shared=no
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
825 # Look at the argument we got. We use all the common list separators.
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
826 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
827 for pkg in $enableval; do
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
828 if test "X$pkg" = "X$p"; then
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
829 enable_shared=yes
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
830 fi
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
831 done
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
832 IFS="$ac_save_ifs"
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
833 ;;
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
834 esac],
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
835 enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
836 ])
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
837
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
838 # AC_DISABLE_SHARED - set the default shared flag to --disable-shared
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
839 AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
840 AC_ENABLE_SHARED(no)])
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
841
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
842 # AC_ENABLE_STATIC - implement the --enable-static flag
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
843 # Usage: AC_ENABLE_STATIC[(DEFAULT)]
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
844 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
845 # `yes'.
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
846 AC_DEFUN(AC_ENABLE_STATIC, [dnl
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
847 define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
848 AC_ARG_ENABLE(static,
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
849 changequote(<<, >>)dnl
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
850 << --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
851 changequote([, ])dnl
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
852 [p=${PACKAGE-default}
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
853 case "$enableval" in
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
854 yes) enable_static=yes ;;
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
855 no) enable_static=no ;;
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
856 *)
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
857 enable_static=no
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
858 # Look at the argument we got. We use all the common list separators.
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
859 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
860 for pkg in $enableval; do
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
861 if test "X$pkg" = "X$p"; then
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
862 enable_static=yes
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
863 fi
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
864 done
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
865 IFS="$ac_save_ifs"
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
866 ;;
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
867 esac],
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
868 enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
869 ])
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
870
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
871 # AC_DISABLE_STATIC - set the default static flag to --disable-static
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
872 AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
873 AC_ENABLE_STATIC(no)])
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
874
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
875
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
876 # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
877 # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
878 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
879 # `yes'.
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
880 AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
881 define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
882 AC_ARG_ENABLE(fast-install,
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
883 changequote(<<, >>)dnl
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
884 << --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
885 changequote([, ])dnl
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
886 [p=${PACKAGE-default}
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
887 case "$enableval" in
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
888 yes) enable_fast_install=yes ;;
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
889 no) enable_fast_install=no ;;
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
890 *)
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
891 enable_fast_install=no
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
892 # Look at the argument we got. We use all the common list separators.
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
893 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
894 for pkg in $enableval; do
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
895 if test "X$pkg" = "X$p"; then
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
896 enable_fast_install=yes
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
897 fi
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
898 done
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
899 IFS="$ac_save_ifs"
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
900 ;;
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
901 esac],
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
902 enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
903 ])
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
904
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
905 # AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
906 AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
907 AC_ENABLE_FAST_INSTALL(no)])
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
908
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
909 # AC_PROG_LD - find the path to the GNU or non-GNU linker
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
910 AC_DEFUN(AC_PROG_LD,
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
911 [AC_ARG_WITH(gnu-ld,
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
912 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
913 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
914 AC_REQUIRE([AC_PROG_CC])dnl
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
915 AC_REQUIRE([AC_CANONICAL_HOST])dnl
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
916 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
917 ac_prog=ld
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
918 if test "$ac_cv_prog_gcc" = yes; then
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
919 # Check if gcc -print-prog-name=ld gives a path.
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
920 AC_MSG_CHECKING([for ld used by GCC])
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
921 ac_prog=`($CC -print-prog-name=ld) 2>&5`
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
922 case "$ac_prog" in
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
923 # Accept absolute paths.
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
924 changequote(,)dnl
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
925 [\\/]* | [A-Za-z]:[\\/]*)
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
926 re_direlt='/[^/][^/]*/\.\./'
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
927 changequote([,])dnl
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
928 # Canonicalize the path of ld
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
929 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
930 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
931 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
932 done
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
933 test -z "$LD" && LD="$ac_prog"
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
934 ;;
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
935 "")
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
936 # If it fails, then pretend we aren't using GCC.
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
937 ac_prog=ld
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
938 ;;
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
939 *)
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
940 # If it is relative, then search for the first ld in PATH.
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
941 with_gnu_ld=unknown
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
942 ;;
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
943 esac
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
944 elif test "$with_gnu_ld" = yes; then
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
945 AC_MSG_CHECKING([for GNU ld])
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
946 else
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
947 AC_MSG_CHECKING([for non-GNU ld])
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
948 fi
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
949 AC_CACHE_VAL(ac_cv_path_LD,
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
950 [if test -z "$LD"; then
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
951 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
952 for ac_dir in $PATH; do
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
953 test -z "$ac_dir" && ac_dir=.
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
954 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
955 ac_cv_path_LD="$ac_dir/$ac_prog"
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
956 # Check to see if the program is GNU ld. I'd rather use --version,
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
957 # but apparently some GNU ld's only accept -v.
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
958 # Break only if it was the GNU/non-GNU ld that we prefer.
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
959 if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
960 test "$with_gnu_ld" != no && break
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
961 else
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
962 test "$with_gnu_ld" != yes && break
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
963 fi
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
964 fi
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
965 done
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
966 IFS="$ac_save_ifs"
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
967 else
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
968 ac_cv_path_LD="$LD" # Let the user override the test with a path.
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
969 fi])
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
970 LD="$ac_cv_path_LD"
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
971 if test -n "$LD"; then
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
972 AC_MSG_RESULT($LD)
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
973 else
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
974 AC_MSG_RESULT(no)
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
975 fi
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
976 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
977 AC_PROG_LD_GNU
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
978 ])
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
979
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
980 AC_DEFUN(AC_PROG_LD_GNU,
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
981 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
982 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
983 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
984 ac_cv_prog_gnu_ld=yes
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
985 else
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
986 ac_cv_prog_gnu_ld=no
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
987 fi])
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
988 ])
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
989
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
990 # AC_PROG_NM - find the path to a BSD-compatible name lister
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
991 AC_DEFUN(AC_PROG_NM,
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
992 [AC_MSG_CHECKING([for BSD-compatible nm])
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
993 AC_CACHE_VAL(ac_cv_path_NM,
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
994 [if test -n "$NM"; then
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
995 # Let the user override the test.
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
996 ac_cv_path_NM="$NM"
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
997 else
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
998 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
999 for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1000 test -z "$ac_dir" && ac_dir=.
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1001 if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1002 # Check to see if the nm accepts a BSD-compat flag.
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1003 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1004 # nm: unknown option "B" ignored
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1005 if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1006 ac_cv_path_NM="$ac_dir/nm -B"
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1007 break
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1008 elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1009 ac_cv_path_NM="$ac_dir/nm -p"
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1010 break
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1011 else
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1012 ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1013 continue # so that we can try to find one that supports BSD flags
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1014 fi
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1015 fi
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1016 done
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1017 IFS="$ac_save_ifs"
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1018 test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1019 fi])
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1020 NM="$ac_cv_path_NM"
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1021 AC_MSG_RESULT([$NM])
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1022 ])
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1023
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1024 # AC_CHECK_LIBM - check for math library
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1025 AC_DEFUN(AC_CHECK_LIBM,
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1026 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1027 LIBM=
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1028 case "$lt_target" in
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1029 *-*-beos* | *-*-cygwin*)
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1030 # These system don't have libm
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1031 ;;
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1032 *-ncr-sysv4.3*)
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1033 AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1034 AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1035 ;;
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1036 *)
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1037 AC_CHECK_LIB(m, main, LIBM="-lm")
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1038 ;;
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1039 esac
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1040 ])
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1041
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1042 # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1043 # the libltdl convenience library and INCLTDL to the include flags for
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1044 # the libltdl header and adds --enable-ltdl-convenience to the
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1045 # configure arguments. Note that LIBLTDL and INCLTDL are not
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1046 # AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If DIR is not
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1047 # provided, it is assumed to be `libltdl'. LIBLTDL will be prefixed
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1048 # with '${top_builddir}/' and INCLTDL will be prefixed with
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1049 # '${top_srcdir}/' (note the single quotes!). If your package is not
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1050 # flat and you're not using automake, define top_builddir and
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1051 # top_srcdir appropriately in the Makefiles.
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1052 AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1053 case "$enable_ltdl_convenience" in
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1054 no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1055 "") enable_ltdl_convenience=yes
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1056 ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1057 esac
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1058 LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1059 INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1060 ])
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1061
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1062 # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1063 # the libltdl installable library and INCLTDL to the include flags for
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1064 # the libltdl header and adds --enable-ltdl-install to the configure
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1065 # arguments. Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1066 # AC_CONFIG_SUBDIRS called. If DIR is not provided and an installed
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1067 # libltdl is not found, it is assumed to be `libltdl'. LIBLTDL will
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1068 # be prefixed with '${top_builddir}/' and INCLTDL will be prefixed
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1069 # with '${top_srcdir}/' (note the single quotes!). If your package is
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1070 # not flat and you're not using automake, define top_builddir and
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1071 # top_srcdir appropriately in the Makefiles.
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1072 # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1073 AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1074 AC_CHECK_LIB(ltdl, main,
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1075 [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1076 [if test x"$enable_ltdl_install" = xno; then
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1077 AC_MSG_WARN([libltdl not installed, but installation disabled])
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1078 else
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1079 enable_ltdl_install=yes
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1080 fi
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1081 ])
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1082 if test x"$enable_ltdl_install" = x"yes"; then
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1083 ac_configure_args="$ac_configure_args --enable-ltdl-install"
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1084 LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1085 INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1086 else
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1087 ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1088 LIBLTDL="-lltdl"
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1089 INCLTDL=
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1090 fi
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1091 ])
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1092
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1093 dnl old names
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1094 AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1095 AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1096 AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1097 AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1098 AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1099 AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1100 AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1101
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1102 dnl This is just to silence aclocal about the macro not being used
72b51548aeca Added libtool stuff.
Ryan C. Gordon <icculus@icculus.org>
parents: 68
diff changeset
1103 ifelse([AC_DISABLE_FAST_INSTALL])dnl