1 --- libmikmod-3.2.0-beta2/libmikmod.m4.orig 2004-01-21 02:36:34 +0100
2 +++ libmikmod-3.2.0-beta2/libmikmod.m4 2004-08-12 11:28:30 +0200
4 dnl Test for libmikmod, and define LIBMIKMOD_CFLAGS, LIBMIKMOD_LIBS and
7 -AC_DEFUN(AM_PATH_LIBMIKMOD,
8 +AC_DEFUN([AM_PATH_LIBMIKMOD],
10 dnl Get the cflags and libraries from the libmikmod-config script
14 # Patch managed by http://www.holgerschurig.de/patcher.html
18 +++ libmikmod-3.2.0-beta2/m4/esd.m4
20 +# Configure paths for ESD
21 +# Manish Singh 98-9-30
22 +# stolen back from Frank Belew
23 +# stolen from Manish Singh
24 +# Shamelessly stolen from Owen Taylor
26 +dnl AM_PATH_ESD([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
27 +dnl Test for ESD, and define ESD_CFLAGS and ESD_LIBS
29 +AC_DEFUN(AM_PATH_ESD,
31 +dnl Get the cflags and libraries from the esd-config script
33 +AC_ARG_WITH(esd-prefix,[ --with-esd-prefix=PFX Prefix where ESD is installed (optional)],
34 + esd_prefix="$withval", esd_prefix="")
35 +AC_ARG_WITH(esd-exec-prefix,[ --with-esd-exec-prefix=PFX Exec prefix where ESD is installed (optional)],
36 + esd_exec_prefix="$withval", esd_exec_prefix="")
37 +AC_ARG_ENABLE(esdtest, [ --disable-esdtest Do not try to compile and run a test ESD program],
38 + , enable_esdtest=yes)
40 + if test x$esd_exec_prefix != x ; then
41 + esd_args="$esd_args --exec-prefix=$esd_exec_prefix"
42 + if test x${ESD_CONFIG+set} != xset ; then
43 + ESD_CONFIG=$esd_exec_prefix/bin/esd-config
46 + if test x$esd_prefix != x ; then
47 + esd_args="$esd_args --prefix=$esd_prefix"
48 + if test x${ESD_CONFIG+set} != xset ; then
49 + ESD_CONFIG=$esd_prefix/bin/esd-config
53 + AC_PATH_PROG(ESD_CONFIG, esd-config, no)
54 + min_esd_version=ifelse([$1], ,0.2.7,$1)
55 + AC_MSG_CHECKING(for ESD - version >= $min_esd_version)
57 + if test "$ESD_CONFIG" = "no" ; then
62 + ESD_CFLAGS=`$ESD_CONFIG $esdconf_args --cflags`
63 + ESD_LIBS=`$ESD_CONFIG $esdconf_args --libs`
65 + esd_major_version=`$ESD_CONFIG $esd_args --version | \
66 + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
67 + esd_minor_version=`$ESD_CONFIG $esd_args --version | \
68 + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
69 + esd_micro_version=`$ESD_CONFIG $esd_config_args --version | \
70 + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
71 + if test "x$enable_esdtest" = "xyes" ; then
72 + ac_save_CFLAGS="$CFLAGS"
73 + ac_save_LIBS="$LIBS"
74 + CFLAGS="$CFLAGS $ESD_CFLAGS"
75 + LIBS="$LIBS $ESD_LIBS"
77 +dnl Now check if the installed ESD is sufficiently new. (Also sanity
78 +dnl checks the results of esd-config to some extent
88 +my_strdup (char *str)
94 + new_str = malloc ((strlen (str) + 1) * sizeof(char));
95 + strcpy (new_str, str);
105 + int major, minor, micro;
108 + system ("touch conf.esdtest");
110 + /* HP/UX 9 (%@#!) writes to sscanf strings */
111 + tmp_version = my_strdup("$min_esd_version");
112 + if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
113 + printf("%s, bad version string\n", "$min_esd_version");
117 + if (($esd_major_version > major) ||
118 + (($esd_major_version == major) && ($esd_minor_version > minor)) ||
119 + (($esd_major_version == major) && ($esd_minor_version == minor) && ($esd_micro_version >= micro)))
125 + printf("\n*** 'esd-config --version' returned %d.%d.%d, but the minimum version\n", $esd_major_version, $esd_minor_version, $esd_micro_version);
126 + printf("*** of ESD required is %d.%d.%d. If esd-config is correct, then it is\n", major, minor, micro);
127 + printf("*** best to upgrade to the required version.\n");
128 + printf("*** If esd-config was wrong, set the environment variable ESD_CONFIG\n");
129 + printf("*** to point to the correct copy of esd-config, and remove the file\n");
130 + printf("*** config.cache before re-running configure\n");
135 +],, no_esd=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
136 + CFLAGS="$ac_save_CFLAGS"
137 + LIBS="$ac_save_LIBS"
141 + if test "x$no_esd" = x ; then
143 + ifelse([$2], , :, [$2])
146 + if test "$ESD_CONFIG" = "no" ; then
147 + echo "*** The esd-config script installed by ESD could not be found"
148 + echo "*** If ESD was installed in PREFIX, make sure PREFIX/bin is in"
149 + echo "*** your path, or set the ESD_CONFIG environment variable to the"
150 + echo "*** full path to esd-config."
152 + if test -f conf.esdtest ; then
155 + echo "*** Could not run ESD test program, checking why..."
156 + CFLAGS="$CFLAGS $ESD_CFLAGS"
157 + LIBS="$LIBS $ESD_LIBS"
164 + [ echo "*** The test program compiled, but did not run. This usually means"
165 + echo "*** that the run-time linker is not finding ESD or finding the wrong"
166 + echo "*** version of ESD. If it is not finding ESD, you'll need to set your"
167 + echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
168 + echo "*** to the installed location Also, make sure you have run ldconfig if that"
169 + echo "*** is required on your system"
171 + echo "*** If you have an old version installed, it is best to remove it, although"
172 + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
173 + [ echo "*** The test program failed to compile or link. See the file config.log for the"
174 + echo "*** exact error that occured. This usually means ESD was incorrectly installed"
175 + echo "*** or that you have moved ESD since it was installed. In the latter case, you"
176 + echo "*** may want to edit the esd-config script: $ESD_CONFIG" ])
177 + CFLAGS="$ac_save_CFLAGS"
178 + LIBS="$ac_save_LIBS"
184 + ifelse([$3], , :, [$3])
186 + AC_SUBST(ESD_CFLAGS)
191 +dnl AM_ESD_SUPPORTS_MULTIPLE_RECORD([ACTION-IF-SUPPORTS [, ACTION-IF-NOT-SUPPORTS]])
192 +dnl Test, whether esd supports multiple recording clients (version >=0.2.21)
194 +AC_DEFUN(AM_ESD_SUPPORTS_MULTIPLE_RECORD,
196 + AC_MSG_NOTICE([whether installed esd version supports multiple recording clients])
197 + ac_save_ESD_CFLAGS="$ESD_CFLAGS"
198 + ac_save_ESD_LIBS="$ESD_LIBS"
199 + AM_PATH_ESD(0.2.21,
201 + AM_CONDITIONAL(ESD_SUPPORTS_MULTIPLE_RECORD, true)
202 + AC_DEFINE(ESD_SUPPORTS_MULTIPLE_RECORD, 1,
203 + [Define if you have esound with support of multiple recording clients.])],
205 + ifelse([$2], , [AM_CONDITIONAL(ESD_SUPPORTS_MULTIPLE_RECORD, false)], [$2])
206 + if test "x$ac_save_ESD_CFLAGS" != x ; then
207 + ESD_CFLAGS="$ac_save_ESD_CFLAGS"
209 + if test "x$ac_save_ESD_LIBS" != x ; then
210 + ESD_LIBS="$ac_save_ESD_LIBS"