annotate m4/libFLAC.m4 @ 164:0393aae79318 trunk

[svn] - clean up about box - add on-beat branch-change evaluation
author nenolod
date Tue, 31 Oct 2006 21:28:30 -0800
parents a22d1b51712e
children 1983383db0f5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1 # For audacious by MSameer
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2 # Configure paths for libFLAC
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
3 # "Inspired" by ogg.m4
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
4
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
5 dnl AM_PATH_LIBFLAC([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
6 dnl Test for libFLAC, and define LIBFLAC_CFLAGS and LIBFLAC_LIBS
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
7 dnl
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
8 AC_DEFUN([AM_PATH_LIBFLAC],
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
9 [dnl
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
10 dnl Get the cflags and libraries
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
11 dnl
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
12 AC_ARG_WITH(libFLAC,[ --with-libFLAC=PFX Prefix where libFLAC is installed (optional)], libFLAC_prefix="$withval", libFLAC_prefix="")
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
13 AC_ARG_WITH(libFLAC-libraries,[ --with-libFLAC-libraries=DIR Directory where libFLAC library is installed (optional)], libFLAC_libraries="$withval", libFLAC_libraries="")
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
14 AC_ARG_WITH(libFLAC-includes,[ --with-libFLAC-includes=DIR Directory where libFLAC header files are installed (optional)], libFLAC_includes="$withval", libFLAC_includes="")
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
15 AC_ARG_ENABLE(libFLACtest, [ --disable-libFLACtest do not try to compile and run a test libFLAC program],, enable_libFLACtest=yes)
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
16
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
17 if test "x$libFLAC_libraries" != "x" ; then
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
18 LIBFLAC_LIBS="-L$libFLAC_libraries"
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
19 elif test "x$libFLAC_prefix" != "x" ; then
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
20 LIBFLAC_LIBS="-L$libFLAC_prefix/lib"
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
21 elif test "x$prefix" != "xNONE" ; then
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
22 LIBFLAC_LIBS="-L$libdir"
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
23 fi
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
24
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
25 LIBFLAC_LIBS="$LIBFLAC_LIBS -lFLAC -lm"
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
26
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
27 if test "x$libFLAC_includes" != "x" ; then
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
28 LIBFLAC_CFLAGS="-I$libFLAC_includes"
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
29 elif test "x$libFLAC_prefix" != "x" ; then
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
30 LIBFLAC_CFLAGS="-I$libFLAC_prefix/include"
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
31 elif test "$prefix" != "xNONE"; then
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
32 LIBFLAC_CFLAGS="-I$prefix/include"
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
33 fi
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
34
106
a22d1b51712e [svn] - bleah fix FLAC check
nenolod
parents: 100
diff changeset
35 AC_MSG_CHECKING(for libFLAC >= 1.1.2)
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
36 no_libFLAC=""
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
37
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
38
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
39 if test "x$enable_libFLACtest" = "xyes" ; then
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
40 ac_save_CFLAGS="$CFLAGS"
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
41 ac_save_CXXFLAGS="$CXXFLAGS"
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
42 ac_save_LIBS="$LIBS"
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
43 CFLAGS="$CFLAGS $LIBFLAC_CFLAGS"
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
44 CXXFLAGS="$CXXFLAGS $LIBFLAC_CFLAGS"
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
45 LIBS="$LIBS $LIBFLAC_LIBS"
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
46 dnl
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
47 dnl Now check if the installed libFLAC is sufficiently new.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
48 dnl
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
49 rm -f conf.libFLACtest
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
50 AC_TRY_RUN([
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
51 #include <stdio.h>
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
52 #include <stdlib.h>
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
53 #include <string.h>
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
54 #include <FLAC/all.h>
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
55
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
56 int main ()
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
57 {
100
7be4c601acfa [svn] - the FLAC developers suck
nenolod
parents: 0
diff changeset
58 char cmdbuf[16384];
7be4c601acfa [svn] - the FLAC developers suck
nenolod
parents: 0
diff changeset
59
7be4c601acfa [svn] - the FLAC developers suck
nenolod
parents: 0
diff changeset
60 /* this will just bail if < 1.1.2 -nenolod */
7be4c601acfa [svn] - the FLAC developers suck
nenolod
parents: 0
diff changeset
61 FLAC__format_vorbiscomment_entry_name_is_legal("foo");
7be4c601acfa [svn] - the FLAC developers suck
nenolod
parents: 0
diff changeset
62
7be4c601acfa [svn] - the FLAC developers suck
nenolod
parents: 0
diff changeset
63 /* we need the version of FLAC available, so dump it here. */
7be4c601acfa [svn] - the FLAC developers suck
nenolod
parents: 0
diff changeset
64 sprintf(cmdbuf, "echo '%c%c%c' > conf.libFLACtest",
7be4c601acfa [svn] - the FLAC developers suck
nenolod
parents: 0
diff changeset
65 FLAC__VERSION_STRING[0], FLAC__VERSION_STRING[2],
7be4c601acfa [svn] - the FLAC developers suck
nenolod
parents: 0
diff changeset
66 FLAC__VERSION_STRING[4]);
7be4c601acfa [svn] - the FLAC developers suck
nenolod
parents: 0
diff changeset
67
7be4c601acfa [svn] - the FLAC developers suck
nenolod
parents: 0
diff changeset
68 system(cmdbuf);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
69 return 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
70 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
71
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
72 ],, no_libFLAC=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
73 CFLAGS="$ac_save_CFLAGS"
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
74 LIBS="$ac_save_LIBS"
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
75 fi
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
76
106
a22d1b51712e [svn] - bleah fix FLAC check
nenolod
parents: 100
diff changeset
77 if test -f conf.libFLACtest ; then
a22d1b51712e [svn] - bleah fix FLAC check
nenolod
parents: 100
diff changeset
78 FLAC_VERSION=`cat conf.libFLACtest`
a22d1b51712e [svn] - bleah fix FLAC check
nenolod
parents: 100
diff changeset
79 AC_DEFINE_UNQUOTED(AUD_FLAC_VERSION, $FLAC_VERSION,
a22d1b51712e [svn] - bleah fix FLAC check
nenolod
parents: 100
diff changeset
80 [Available version of FLAC on your system.])
a22d1b51712e [svn] - bleah fix FLAC check
nenolod
parents: 100
diff changeset
81 fi
a22d1b51712e [svn] - bleah fix FLAC check
nenolod
parents: 100
diff changeset
82
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
83 if test "x$no_libFLAC" = "x" ; then
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
84 AC_MSG_RESULT(yes)
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
85 ifelse([$1], , :, [$1])
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
86 else
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
87 AC_MSG_RESULT(no)
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
88 if test -f conf.libFLACtest ; then
106
a22d1b51712e [svn] - bleah fix FLAC check
nenolod
parents: 100
diff changeset
89 :
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
90 else
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
91 echo "*** Could not run libFLAC test program, checking why..."
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
92 CFLAGS="$CFLAGS $LIBFLAC_CFLAGS"
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
93 LIBS="$LIBS $LIBFLAC_LIBS"
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
94 AC_TRY_LINK([
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
95 #include <stdio.h>
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
96 #include <FLAC/format.h>
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
97 ], [ return 0; ],
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
98 [ echo "*** The test program compiled, but did not run. This usually means"
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
99 echo "*** that the run-time linker is not finding libFLAC or finding the wrong"
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
100 echo "*** version of libFLAC. If it is not finding libFLAC, you'll need to set your"
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
101 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
102 echo "*** to the installed location Also, make sure you have run ldconfig if that"
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
103 echo "*** is required on your system"
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
104 echo "***"
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
105 echo "*** If you have an old version installed, it is best to remove it, although"
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
106 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
107 [ echo "*** The test program failed to compile or link. See the file config.log for the"
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
108 echo "*** exact error that occured. This usually means libFLAC was incorrectly installed"
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
109 echo "*** or that you have moved libFLAC since it was installed. In the latter case, you"
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
110 echo "*** may want to edit the libFLAC-config script: $LIBFLAC_CONFIG" ])
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
111 CFLAGS="$ac_save_CFLAGS"
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
112 LIBS="$ac_save_LIBS"
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
113 fi
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
114 LIBFLAC_CFLAGS=""
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
115 LIBFLAC_LIBS=""
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
116 ifelse([$2], , :, [$2])
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
117 fi
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
118 AC_SUBST(LIBFLAC_CFLAGS)
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
119 AC_SUBST(LIBFLAC_LIBS)
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
120 rm -f conf.libFLACtest
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
121 ])