annotate acinclude.m4 @ 52:fc4dbbeae814 trunk

[svn] Removing all Makefile.in's
author msameer
date Thu, 27 Oct 2005 12:50:36 -0700
parents 8aee6a5bcc70
children 817f9357b81a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1 dnl ADD_PKG_REQUIRES([requirement])
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3 AC_DEFUN([ADD_PC_REQUIRES],
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4 [
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5 test -z "$PC_REQUIRES" && PC_REQUIRES="$1" || PC_REQUIRES="$PC_REQUIRES, $1"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6 AC_SUBST(PC_REQUIRES)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
7 ]
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
8 )
32
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
9
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
10 ##--## libmikmod.m4
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
11
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
12 # Configure paths for libmikmod
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
13 #
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
14 # Derived from libmikmod.m4 (Owen Taylor 97-11-3)
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
15 #
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
16
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
17 dnl AM_PATH_LIBMIKMOD([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
18 dnl Test for libmikmod, and define LIBMIKMOD_CFLAGS, LIBMIKMOD_LIBS and
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
19 dnl LIBMIKMOD_LDADD
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
20 dnl
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
21 AC_DEFUN(AM_PATH_LIBMIKMOD,
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
22 [dnl
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
23 dnl Get the cflags and libraries from the libmikmod-config script
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
24 dnl
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
25 AC_ARG_WITH(libmikmod-prefix,[ --with-libmikmod-prefix=PFX Prefix where libmikmod is installed (optional)],
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
26 libmikmod_config_prefix="$withval", libmikmod_config_prefix="")
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
27 AC_ARG_WITH(libmikmod-exec-prefix,[ --with-libmikmod-exec-prefix=PFX Exec prefix where libmikmod is installed (optional)],
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
28 libmikmod_config_exec_prefix="$withval", libmikmod_config_exec_prefix="")
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
29 AC_ARG_ENABLE(libmikmodtest, [ --disable-libmikmodtest Do not try to compile and run a test libmikmod program],
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
30 , enable_libmikmodtest=yes)
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
31
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
32 if test x$libmikmod_config_exec_prefix != x ; then
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
33 libmikmod_config_args="$libmikmod_config_args --exec-prefix=$libmikmod_config_exec_prefix"
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
34 if test x${LIBMIKMOD_CONFIG+set} != xset ; then
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
35 LIBMIKMOD_CONFIG=$libmikmod_config_exec_prefix/bin/libmikmod-config
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
36 fi
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
37 fi
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
38 if test x$libmikmod_config_prefix != x ; then
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
39 libmikmod_config_args="$libmikmod_config_args --prefix=$libmikmod_config_prefix"
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
40 if test x${LIBMIKMOD_CONFIG+set} != xset ; then
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
41 LIBMIKMOD_CONFIG=$libmikmod_config_prefix/bin/libmikmod-config
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
42 fi
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
43 fi
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
44
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
45 AC_PATH_PROG(LIBMIKMOD_CONFIG, libmikmod-config, no)
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
46 min_libmikmod_version=ifelse([$1], ,3.1.5,$1)
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
47 AC_MSG_CHECKING(for libmikmod - version >= $min_libmikmod_version)
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
48 no_libmikmod=""
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
49 if test "$LIBMIKMOD_CONFIG" = "no" ; then
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
50 no_libmikmod=yes
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
51 else
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
52 LIBMIKMOD_CFLAGS=`$LIBMIKMOD_CONFIG $libmikmod_config_args --cflags`
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
53 LIBMIKMOD_LIBS=`$LIBMIKMOD_CONFIG $libmikmod_config_args --libs`
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
54 LIBMIKMOD_LDADD=`$LIBMIKMOD_CONFIG $libmikmod_config_args --ldadd`
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
55 libmikmod_config_major_version=`$LIBMIKMOD_CONFIG $libmikmod_config_args --version | \
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
56 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\).*/\1/'`
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
57 libmikmod_config_minor_version=`$LIBMIKMOD_CONFIG $libmikmod_config_args --version | \
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
58 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\).*/\2/'`
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
59 libmikmod_config_micro_version=`$LIBMIKMOD_CONFIG $libmikmod_config_args --version | \
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
60 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\).*/\3/'`
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
61 if test "x$enable_libmikmodtest" = "xyes" ; then
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
62 ac_save_CFLAGS="$CFLAGS"
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
63 ac_save_LIBS="$LIBS"
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
64 CFLAGS="$CFLAGS $LIBMIKMOD_CFLAGS $LIBMIKMOD_LDADD"
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
65 LIBS="$LIBMIKMOD_LIBS $LIBS"
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
66 dnl
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
67 dnl Now check if the installed libmikmod is sufficiently new. (Also sanity
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
68 dnl checks the results of libmikmod-config to some extent
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
69 dnl
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
70 rm -f conf.mikmodtest
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
71 AC_TRY_RUN([
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
72 #include <mikmod.h>
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
73 #include <stdio.h>
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
74 #include <stdlib.h>
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
75
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
76 char* my_strdup (char *str)
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
77 {
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
78 char *new_str;
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
79
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
80 if (str) {
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
81 new_str = malloc ((strlen (str) + 1) * sizeof(char));
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
82 strcpy (new_str, str);
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
83 } else
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
84 new_str = NULL;
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
85
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
86 return new_str;
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
87 }
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
88
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
89 int main()
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
90 {
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
91 int major,minor,micro;
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
92 int libmikmod_major_version,libmikmod_minor_version,libmikmod_micro_version;
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
93 char *tmp_version;
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
94
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
95 system ("touch conf.mikmodtest");
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
96
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
97 /* HP/UX 9 (%@#!) writes to sscanf strings */
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
98 tmp_version = my_strdup("$min_libmikmod_version");
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
99 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
100 printf("%s, bad version string\n", "$min_libmikmod_version");
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
101 exit(1);
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
102 }
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
103
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
104 libmikmod_major_version=(MikMod_GetVersion()>>16)&255;
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
105 libmikmod_minor_version=(MikMod_GetVersion()>> 8)&255;
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
106 libmikmod_micro_version=(MikMod_GetVersion() )&255;
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
107
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
108 if ((libmikmod_major_version != $libmikmod_config_major_version) ||
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
109 (libmikmod_minor_version != $libmikmod_config_minor_version) ||
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
110 (libmikmod_micro_version != $libmikmod_config_micro_version))
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
111 {
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
112 printf("\n*** 'libmikmod-config --version' returned %d.%d.%d, but libmikmod (%d.%d.%d)\n",
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
113 $libmikmod_config_major_version, $libmikmod_config_minor_version, $libmikmod_config_micro_version,
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
114 libmikmod_major_version, libmikmod_minor_version, libmikmod_micro_version);
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
115 printf ("*** was found! If libmikmod-config was correct, then it is best\n");
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
116 printf ("*** to remove the old version of libmikmod. You may also be able to fix the error\n");
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
117 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
118 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
119 printf("*** required on your system.\n");
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
120 printf("*** If libmikmod-config was wrong, set the environment variable LIBMIKMOD_CONFIG\n");
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
121 printf("*** to point to the correct copy of libmikmod-config, and remove the file config.cache\n");
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
122 printf("*** before re-running configure\n");
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
123 }
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
124 else if ((libmikmod_major_version != LIBMIKMOD_VERSION_MAJOR) ||
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
125 (libmikmod_minor_version != LIBMIKMOD_VERSION_MINOR) ||
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
126 (libmikmod_micro_version != LIBMIKMOD_REVISION))
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
127 {
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
128 printf("*** libmikmod header files (version %d.%d.%d) do not match\n",
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
129 LIBMIKMOD_VERSION_MAJOR, LIBMIKMOD_VERSION_MINOR, LIBMIKMOD_REVISION);
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
130 printf("*** library (version %d.%d.%d)\n",
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
131 libmikmod_major_version, libmikmod_minor_version, libmikmod_micro_version);
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
132 }
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
133 else
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
134 {
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
135 if ((libmikmod_major_version > major) ||
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
136 ((libmikmod_major_version == major) && (libmikmod_minor_version > minor)) ||
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
137 ((libmikmod_major_version == major) && (libmikmod_minor_version == minor) && (libmikmod_micro_version >= micro)))
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
138 {
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
139 return 0;
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
140 }
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
141 else
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
142 {
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
143 printf("\n*** An old version of libmikmod (%d.%d.%d) was found.\n",
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
144 libmikmod_major_version, libmikmod_minor_version, libmikmod_micro_version);
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
145 printf("*** You need a version of libmikmod newer than %d.%d.%d.\n",
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
146 major, minor, micro);
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
147 printf("***\n");
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
148 printf("*** If you have already installed a sufficiently new version, this error\n");
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
149 printf("*** probably means that the wrong copy of the libmikmod-config shell script is\n");
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
150 printf("*** being found. The easiest way to fix this is to remove the old version\n");
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
151 printf("*** of libmikmod, but you can also set the LIBMIKMOD_CONFIG environment to point to the\n");
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
152 printf("*** correct copy of libmikmod-config. (In this case, you will have to\n");
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
153 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
154 printf("*** so that the correct libraries are found at run-time))\n");
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
155 }
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
156 }
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
157 return 1;
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
158 }
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
159 ],, no_libmikmod=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
160 CFLAGS="$ac_save_CFLAGS"
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
161 LIBS="$ac_save_LIBS"
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
162 fi
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
163 fi
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
164 if test "x$no_libmikmod" = x ; then
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
165 AC_MSG_RESULT(yes)
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
166 ifelse([$2], , :, [$2])
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
167 else
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
168 AC_MSG_RESULT(no)
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
169 if test "$LIBMIKMOD_CONFIG" = "no" ; then
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
170 echo "*** The libmikmod-config script installed by libmikmod could not be found"
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
171 echo "*** If libmikmod was installed in PREFIX, make sure PREFIX/bin is in"
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
172 echo "*** your path, or set the LIBMIKMOD_CONFIG environment variable to the"
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
173 echo "*** full path to libmikmod-config."
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
174 else
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
175 if test -f conf.mikmodtest ; then
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
176 :
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
177 else
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
178 echo "*** Could not run libmikmod test program, checking why..."
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
179 CFLAGS="$CFLAGS $LIBMIKMOD_CFLAGS"
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
180 LIBS="$LIBS $LIBMIKMOD_LIBS"
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
181 AC_TRY_LINK([
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
182 #include <mikmod.h>
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
183 #include <stdio.h>
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
184 ], [ return (MikMod_GetVersion()!=0); ],
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
185 [ echo "*** The test program compiled, but did not run. This usually means"
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
186 echo "*** that the run-time linker is not finding libmikmod or finding the wrong"
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
187 echo "*** version of libmikmod. If it is not finding libmikmod, you'll need to set your"
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
188 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
189 echo "*** to the installed location. Also, make sure you have run ldconfig if that"
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
190 echo "*** is required on your system"
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
191 echo "***"
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
192 echo "*** If you have an old version installed, it is best to remove it, although"
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
193 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
194 [ echo "*** The test program failed to compile or link. See the file config.log for the"
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
195 echo "*** exact error that occured. This usually means libmikmod was incorrectly installed"
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
196 echo "*** or that you have moved libmikmod since it was installed. In the latter case, you"
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
197 echo "*** may want to edit the libmikmod-config script: $LIBMIKMOD_CONFIG" ])
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
198 CFLAGS="$ac_save_CFLAGS"
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
199 LIBS="$ac_save_LIBS"
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
200 fi
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
201 fi
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
202 LIBMIKMOD_CFLAGS=""
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
203 LIBMIKMOD_LIBS=""
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
204 LIBMIKMOD_LDADD=""
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
205 ifelse([$3], , :, [$3])
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
206 fi
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
207 AC_SUBST(LIBMIKMOD_CFLAGS)
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
208 AC_SUBST(LIBMIKMOD_LIBS)
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
209 AC_SUBST(LIBMIKMOD_LDADD)
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
210 rm -f conf.mikmodtest
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
211 ])
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
212
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
213 AC_DEFUN(AC_FIND_FILE,
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
214 [
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
215 $3=NO
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
216 for i in $2;
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
217 do
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
218 for j in $1;
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
219 do
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
220 if test -r "$i/$j"; then
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
221 $3=$i
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
222 break 2
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
223 fi
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
224 done
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
225 done
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
226 ]
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
227 )
8aee6a5bcc70 [svn] Libmikmod.
nenolod
parents: 0
diff changeset
228