Mercurial > audlegacy-plugins
annotate m4/libFLAC.m4 @ 2960:fe2ba1a712cd
More code simplification.
author | William Pitcock <nenolod@atheme.org> |
---|---|
date | Wed, 15 Oct 2008 15:30:25 -0500 |
parents | 5c33e8e1a479 |
children |
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]]) |
1322
285d54073f12
Fix CFLAGS detection for 1.1.2 stuff.
William Pitcock <nenolod@atheme-project.org>
parents:
1309
diff
changeset
|
6 dnl Test for libFLAC, and define LIBFLAC_CFLAGS and LIBFLAC_LIBS |
0
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 |
1322
285d54073f12
Fix CFLAGS detection for 1.1.2 stuff.
William Pitcock <nenolod@atheme-project.org>
parents:
1309
diff
changeset
|
18 LIBFLAC_LIBS="-L$libFLAC_libraries" |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
19 elif test "x$libFLAC_prefix" != "x" ; then |
1322
285d54073f12
Fix CFLAGS detection for 1.1.2 stuff.
William Pitcock <nenolod@atheme-project.org>
parents:
1309
diff
changeset
|
20 LIBFLAC_LIBS="-L$libFLAC_prefix/lib" |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
21 elif test "x$prefix" != "xNONE" ; then |
1322
285d54073f12
Fix CFLAGS detection for 1.1.2 stuff.
William Pitcock <nenolod@atheme-project.org>
parents:
1309
diff
changeset
|
22 LIBFLAC_LIBS="-L$libdir" |
0
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 |
1322
285d54073f12
Fix CFLAGS detection for 1.1.2 stuff.
William Pitcock <nenolod@atheme-project.org>
parents:
1309
diff
changeset
|
25 LIBFLAC_LIBS="$LIBFLAC_LIBS -lFLAC -lm" |
286 | 26 |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
27 if test "x$libFLAC_includes" != "x" ; then |
1322
285d54073f12
Fix CFLAGS detection for 1.1.2 stuff.
William Pitcock <nenolod@atheme-project.org>
parents:
1309
diff
changeset
|
28 LIBFLAC_CFLAGS="-I$libFLAC_includes" |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
29 elif test "x$libFLAC_prefix" != "x" ; then |
1322
285d54073f12
Fix CFLAGS detection for 1.1.2 stuff.
William Pitcock <nenolod@atheme-project.org>
parents:
1309
diff
changeset
|
30 LIBFLAC_CFLAGS="-I$libFLAC_prefix/include" |
2125
5c33e8e1a479
- add a m4 macro file to setup MAD_CFLAGS and MAD_LIBS.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1322
diff
changeset
|
31 elif test "x$prefix" != "xNONE"; then |
1322
285d54073f12
Fix CFLAGS detection for 1.1.2 stuff.
William Pitcock <nenolod@atheme-project.org>
parents:
1309
diff
changeset
|
32 LIBFLAC_CFLAGS="-I$prefix/include" |
0
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 | 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" |
1322
285d54073f12
Fix CFLAGS detection for 1.1.2 stuff.
William Pitcock <nenolod@atheme-project.org>
parents:
1309
diff
changeset
|
43 CFLAGS="$CFLAGS $LIBFLAC_CFLAGS" |
285d54073f12
Fix CFLAGS detection for 1.1.2 stuff.
William Pitcock <nenolod@atheme-project.org>
parents:
1309
diff
changeset
|
44 CXXFLAGS="$CXXFLAGS $LIBFLAC_CFLAGS" |
285d54073f12
Fix CFLAGS detection for 1.1.2 stuff.
William Pitcock <nenolod@atheme-project.org>
parents:
1309
diff
changeset
|
45 LIBS="$LIBS $LIBFLAC_LIBS" |
0
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 { |
1322
285d54073f12
Fix CFLAGS detection for 1.1.2 stuff.
William Pitcock <nenolod@atheme-project.org>
parents:
1309
diff
changeset
|
58 FLAC__format_vorbiscomment_entry_name_is_legal("foo"); |
285d54073f12
Fix CFLAGS detection for 1.1.2 stuff.
William Pitcock <nenolod@atheme-project.org>
parents:
1309
diff
changeset
|
59 system("touch conf.libFLACtest"); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
60 return 0; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
61 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
62 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
63 ],, 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
|
64 CFLAGS="$ac_save_CFLAGS" |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
65 LIBS="$ac_save_LIBS" |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
66 fi |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
67 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
68 if test "x$no_libFLAC" = "x" ; then |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
69 AC_MSG_RESULT(yes) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
70 ifelse([$1], , :, [$1]) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
71 else |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
72 AC_MSG_RESULT(no) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
73 if test -f conf.libFLACtest ; then |
106 | 74 : |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
75 else |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
76 echo "*** Could not run libFLAC test program, checking why..." |
1322
285d54073f12
Fix CFLAGS detection for 1.1.2 stuff.
William Pitcock <nenolod@atheme-project.org>
parents:
1309
diff
changeset
|
77 CFLAGS="$CFLAGS $LIBFLAC_CFLAGS" |
285d54073f12
Fix CFLAGS detection for 1.1.2 stuff.
William Pitcock <nenolod@atheme-project.org>
parents:
1309
diff
changeset
|
78 LIBS="$LIBS $LIBFLAC_LIBS" |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
79 AC_TRY_LINK([ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
80 #include <stdio.h> |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
81 #include <FLAC/format.h> |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
82 ], [ return 0; ], |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
83 [ 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
|
84 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
|
85 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
|
86 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
|
87 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
|
88 echo "*** is required on your system" |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
89 echo "***" |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
90 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
|
91 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
|
92 [ 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
|
93 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
|
94 echo "*** or that you have moved libFLAC since it was installed. In the latter case, you" |
1322
285d54073f12
Fix CFLAGS detection for 1.1.2 stuff.
William Pitcock <nenolod@atheme-project.org>
parents:
1309
diff
changeset
|
95 echo "*** may want to edit the libFLAC-config script: $LIBFLAC_CONFIG" ]) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
96 CFLAGS="$ac_save_CFLAGS" |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
97 LIBS="$ac_save_LIBS" |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
98 fi |
1322
285d54073f12
Fix CFLAGS detection for 1.1.2 stuff.
William Pitcock <nenolod@atheme-project.org>
parents:
1309
diff
changeset
|
99 LIBFLAC_CFLAGS="" |
285d54073f12
Fix CFLAGS detection for 1.1.2 stuff.
William Pitcock <nenolod@atheme-project.org>
parents:
1309
diff
changeset
|
100 LIBFLAC_LIBS="" |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
101 ifelse([$2], , :, [$2]) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
102 fi |
1322
285d54073f12
Fix CFLAGS detection for 1.1.2 stuff.
William Pitcock <nenolod@atheme-project.org>
parents:
1309
diff
changeset
|
103 AC_SUBST(LIBFLAC_CFLAGS) |
285d54073f12
Fix CFLAGS detection for 1.1.2 stuff.
William Pitcock <nenolod@atheme-project.org>
parents:
1309
diff
changeset
|
104 AC_SUBST(LIBFLAC_LIBS) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
105 rm -f conf.libFLACtest |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
106 ]) |