~ubuntu-branches/ubuntu/precise/flac/precise-updates

« back to all changes in this revision

Viewing changes to src/libOggFLAC++/libOggFLAC++.m4

  • Committer: Bazaar Package Importer
  • Author(s): Joshua Kwan
  • Date: 2007-05-29 22:56:36 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070529225636-ljeff8xxip09qaap
Tags: 1.1.4-1
* New upstream release. closes: #405167, #411311
  - libOggFLAC and libOggFLAC++ have been merged into libFLAC, so
    remove their corresponding packages.
  - Because of the API changes required to effect the above, there has
    been yet another soname bump. libflac7 -> libflac8 and
    libflac++5 -> libflac++6. Emails have been dispatched to the
    maintainers of dependent packages.
* Some notes on patches that were removed:
  - 02_stdin_stdout, 06_manpage_mention_utf8_convert: merged upstream
  - 08_manpage_warnings: Upstream has changed the manpage so it defintely
    can't fit in in 80 cols, so just forget about it. We'll live.
  - 05_eof_warnings_are_errors: Upstream decided to add a -w option to
    flac to treat all warnings as errors. I am going to defer to that
    for now, but if people think it's stupid let me know and I'll port
    the patch forward.
  - 04_stack_smasher: was a backport from 1.1.3, so it's obsolete.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Configure paths for libOggFLAC++
2
 
# "Inspired" by ogg.m4
3
 
# Caller must first run AM_PATH_LIBOGGFLAC
4
 
 
5
 
dnl AM_PATH_LIBOGGFLACPP([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
6
 
dnl Test for libOggFLAC++, and define LIBOGGFLACPP_CFLAGS and LIBOGGFLACPP_LIBS
7
 
dnl
8
 
AC_DEFUN([AM_PATH_LIBOGGFLACPP],
9
 
[dnl 
10
 
dnl Get the cflags and libraries
11
 
dnl
12
 
AC_ARG_WITH(libOggFLACPP,[  --with-libOggFLACPP=PFX   Prefix where libOggFLAC++ is installed (optional)], libOggFLACPP_prefix="$withval", libOggFLACPP_prefix="")
13
 
AC_ARG_WITH(libOggFLACPP-libraries,[  --with-libOggFLACPP-libraries=DIR   Directory where libOggFLAC++ library is installed (optional)], libOggFLACPP_libraries="$withval", libOggFLACPP_libraries="")
14
 
AC_ARG_WITH(libOggFLACPP-includes,[  --with-libOggFLACPP-includes=DIR   Directory where libOggFLAC++ header files are installed (optional)], libOggFLACPP_includes="$withval", libOggFLACPP_includes="")
15
 
AC_ARG_ENABLE(libOggFLACPPtest, [  --disable-libOggFLACPPtest       Do not try to compile and run a test libOggFLAC++ program],, enable_libOggFLACPPtest=yes)
16
 
 
17
 
  if test "x$libOggFLACPP_libraries" != "x" ; then
18
 
    LIBOGGFLACPP_LIBS="-L$libOggFLACPP_libraries"
19
 
  elif test "x$libOggFLACPP_prefix" != "x" ; then
20
 
    LIBOGGFLACPP_LIBS="-L$libOggFLACPP_prefix/lib"
21
 
  elif test "x$prefix" != "xNONE" ; then
22
 
    LIBOGGFLACPP_LIBS="-L$libdir"
23
 
  fi
24
 
 
25
 
  LIBOGGFLACPP_LIBS="$LIBOGGFLACPP_LIBS -lOggFLAC++ $LIBOGGFLAC_LIBS"
26
 
 
27
 
  if test "x$libOggFLACPP_includes" != "x" ; then
28
 
    LIBOGGFLACPP_CFLAGS="-I$libOggFLACPP_includes"
29
 
  elif test "x$libOggFLACPP_prefix" != "x" ; then
30
 
    LIBOGGFLACPP_CFLAGS="-I$libOggFLACPP_prefix/include"
31
 
  elif test "$prefix" != "xNONE"; then
32
 
    LIBOGGFLACPP_CFLAGS="-I$prefix/include"
33
 
  fi
34
 
 
35
 
  LIBOGGFLACPP_CFLAGS="$LIBOGGFLACPP_CFLAGS $LIBOGGFLAC_CFLAGS"
36
 
 
37
 
  AC_MSG_CHECKING(for libOggFLAC++)
38
 
  no_libOggFLACPP=""
39
 
 
40
 
 
41
 
  if test "x$enable_libOggFLACPPtest" = "xyes" ; then
42
 
    ac_save_CFLAGS="$CFLAGS"
43
 
    ac_save_CXXFLAGS="$CXXFLAGS"
44
 
    ac_save_LIBS="$LIBS"
45
 
    CFLAGS="$CFLAGS $LIBOGGFLACPP_CFLAGS"
46
 
    CXXFLAGS="$CXXFLAGS $LIBOGGFLACPP_CFLAGS"
47
 
    LIBS="$LIBS $LIBOGGFLACPP_LIBS"
48
 
dnl
49
 
dnl Now check if the installed libOggFLAC++ is sufficiently new.
50
 
dnl
51
 
      rm -f conf.libOggFLAC++test
52
 
      AC_TRY_RUN([
53
 
#include <stdio.h>
54
 
#include <stdlib.h>
55
 
#include <string.h>
56
 
#include <OggFLAC++/decoder.h>
57
 
 
58
 
int main ()
59
 
{
60
 
  system("touch conf.libOggFLAC++test");
61
 
  return 0;
62
 
}
63
 
 
64
 
],, no_libOggFLACPP=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
65
 
       CFLAGS="$ac_save_CFLAGS"
66
 
       LIBS="$ac_save_LIBS"
67
 
  fi
68
 
 
69
 
  if test "x$no_libOggFLACPP" = "x" ; then
70
 
     AC_MSG_RESULT(yes)
71
 
     ifelse([$1], , :, [$1])     
72
 
  else
73
 
     AC_MSG_RESULT(no)
74
 
     if test -f conf.libOggFLAC++test ; then
75
 
       :
76
 
     else
77
 
       echo "*** Could not run libOggFLAC++ test program, checking why..."
78
 
       CFLAGS="$CFLAGS $LIBOGGFLACPP_CFLAGS"
79
 
       LIBS="$LIBS $LIBOGGFLACPP_LIBS"
80
 
       AC_TRY_LINK([
81
 
#include <stdio.h>
82
 
#include <OggFLAC++/decoder.h>
83
 
],     [ return 0; ],
84
 
       [ echo "*** The test program compiled, but did not run. This usually means"
85
 
       echo "*** that the run-time linker is not finding libOggFLAC++ or finding the wrong"
86
 
       echo "*** version of libOggFLAC++. If it is not finding libOggFLAC++, you'll need to set your"
87
 
       echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
88
 
       echo "*** to the installed location  Also, make sure you have run ldconfig if that"
89
 
       echo "*** is required on your system"
90
 
       echo "***"
91
 
       echo "*** If you have an old version installed, it is best to remove it, although"
92
 
       echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
93
 
       [ echo "*** The test program failed to compile or link. See the file config.log for the"
94
 
       echo "*** exact error that occured. This usually means libOggFLAC++ was incorrectly installed"
95
 
       echo "*** or that you have moved libOggFLAC++ since it was installed. In the latter case, you"
96
 
       echo "*** may want to edit the libOggFLAC++-config script: $LIBFLACPP_CONFIG" ])
97
 
       CFLAGS="$ac_save_CFLAGS"
98
 
       LIBS="$ac_save_LIBS"
99
 
     fi
100
 
     LIBOGGFLACPP_CFLAGS=""
101
 
     LIBOGGFLACPP_LIBS=""
102
 
     ifelse([$2], , :, [$2])
103
 
  fi
104
 
  AC_SUBST(LIBOGGFLACPP_CFLAGS)
105
 
  AC_SUBST(LIBOGGFLACPP_LIBS)
106
 
  rm -f conf.libOggFLAC++test
107
 
])