]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/libmikmod/libmikmod/m4.patch
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / libmikmod / libmikmod / m4.patch
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
3 @@ -8,7 +8,7 @@
4  dnl Test for libmikmod, and define LIBMIKMOD_CFLAGS, LIBMIKMOD_LIBS and
5  dnl LIBMIKMOD_LDADD
6  dnl
7 -AC_DEFUN(AM_PATH_LIBMIKMOD,
8 +AC_DEFUN([AM_PATH_LIBMIKMOD],
9  [dnl 
10  dnl Get the cflags and libraries from the libmikmod-config script
11  dnl
12
13 #
14 # Patch managed by http://www.holgerschurig.de/patcher.html
15 #
16
17 --- /dev/null
18 +++ libmikmod-3.2.0-beta2/m4/esd.m4
19 @@ -0,0 +1,194 @@
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
25 +
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
28 +dnl
29 +AC_DEFUN(AM_PATH_ESD,
30 +[dnl 
31 +dnl Get the cflags and libraries from the esd-config script
32 +dnl
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)
39 +
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
44 +     fi
45 +  fi
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
50 +     fi
51 +  fi
52 +
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)
56 +  no_esd=""
57 +  if test "$ESD_CONFIG" = "no" ; then
58 +    no_esd=yes
59 +  else
60 +    AC_LANG_SAVE
61 +    AC_LANG_C
62 +    ESD_CFLAGS=`$ESD_CONFIG $esdconf_args --cflags`
63 +    ESD_LIBS=`$ESD_CONFIG $esdconf_args --libs`
64 +
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"
76 +dnl
77 +dnl Now check if the installed ESD is sufficiently new. (Also sanity
78 +dnl checks the results of esd-config to some extent
79 +dnl
80 +      rm -f conf.esdtest
81 +      AC_TRY_RUN([
82 +#include <stdio.h>
83 +#include <stdlib.h>
84 +#include <string.h>
85 +#include <esd.h>
86 +
87 +char*
88 +my_strdup (char *str)
89 +{
90 +  char *new_str;
91 +  
92 +  if (str)
93 +    {
94 +      new_str = malloc ((strlen (str) + 1) * sizeof(char));
95 +      strcpy (new_str, str);
96 +    }
97 +  else
98 +    new_str = NULL;
99 +  
100 +  return new_str;
101 +}
102 +
103 +int main ()
104 +{
105 +  int major, minor, micro;
106 +  char *tmp_version;
107 +
108 +  system ("touch conf.esdtest");
109 +
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, &micro) != 3) {
113 +     printf("%s, bad version string\n", "$min_esd_version");
114 +     exit(1);
115 +   }
116 +
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)))
120 +    {
121 +      return 0;
122 +    }
123 +  else
124 +    {
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");
131 +      return 1;
132 +    }
133 +}
134 +
135 +],, no_esd=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
136 +       CFLAGS="$ac_save_CFLAGS"
137 +       LIBS="$ac_save_LIBS"
138 +       AC_LANG_RESTORE
139 +     fi
140 +  fi
141 +  if test "x$no_esd" = x ; then
142 +     AC_MSG_RESULT(yes)
143 +     ifelse([$2], , :, [$2])     
144 +  else
145 +     AC_MSG_RESULT(no)
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."
151 +     else
152 +       if test -f conf.esdtest ; then
153 +        :
154 +       else
155 +          echo "*** Could not run ESD test program, checking why..."
156 +          CFLAGS="$CFLAGS $ESD_CFLAGS"
157 +          LIBS="$LIBS $ESD_LIBS"
158 +          AC_LANG_SAVE
159 +          AC_LANG_C
160 +          AC_TRY_LINK([
161 +#include <stdio.h>
162 +#include <esd.h>
163 +],      [ return 0; ],
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"
170 +         echo "***"
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"
179 +          AC_LANG_RESTORE
180 +       fi
181 +     fi
182 +     ESD_CFLAGS=""
183 +     ESD_LIBS=""
184 +     ifelse([$3], , :, [$3])
185 +  fi
186 +  AC_SUBST(ESD_CFLAGS)
187 +  AC_SUBST(ESD_LIBS)
188 +  rm -f conf.esdtest
189 +])
190 +
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)
193 +dnl
194 +AC_DEFUN(AM_ESD_SUPPORTS_MULTIPLE_RECORD,
195 +[dnl
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,
200 +    ifelse([$1], , [
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.])],
204 +    [$1]),
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"
208 +    fi
209 +    if test "x$ac_save_ESD_LIBS" != x ; then
210 +       ESD_LIBS="$ac_save_ESD_LIBS"
211 +    fi
212 +  )
213 +])