]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - configure.ac
Implement the flac audio format handler.
[paraslash.git] / configure.ac
index e2fba306dcf5e453d82890e1683e8ea0691e8b9f..a2e5fed14569deb9c059172d76b83dce0f10daa1 100644 (file)
@@ -23,6 +23,14 @@ fi
 
 AC_C_BIGENDIAN()
 
+AC_PATH_PROG([gengetopt], [gengetopt])
+test -z "$gengetopt" && AC_MSG_ERROR(
+       [gengetopt is required to build this package])
+
+AC_PATH_PROG([help2man], [help2man])
+test -z "$help2man" && AC_MSG_ERROR(
+       [help2man is required to build this package])
+
 AC_PROG_CC
 AC_PROG_CPP
 AC_PROG_INSTALL
@@ -377,7 +385,7 @@ if test "$check_gcrypt" = "yes"; then
                client_errlist_objs="$client_errlist_objs gcrypt"
                audiod_errlist_objs="$audiod_errlist_objs gcrypt"
        else
-               AC_MSG_WARN([grypt library not found])
+               AC_MSG_WARN([gcrypt library not found])
        fi
        CPPFLAGS="$OLD_CPPFLAGS"
        LDFLAGS="$OLD_LDFLAGS"
@@ -493,11 +501,11 @@ if test ${have_core_audio} = yes; then
        f="$f1 $f2 $f3 $f4"
 
        all_errlist_objs="$all_errlist_objs osx_write"
-       audiod_errlist_objs="$audiod_errlist_objs osx_write"
+       audiod_errlist_objs="$audiod_errlist_objs osx_write ipc"
        audiod_cmdline_objs="$audiod_cmdline_objs osx_write.cmdline"
        audiod_ldflags="$audiod_ldflags $f"
 
-       write_errlist_objs="$write_errlist_objs osx_write"
+       write_errlist_objs="$write_errlist_objs osx_write ipc"
        write_cmdline_objs="$write_cmdline_objs osx_write.cmdline"
        write_ldflags="$write_ldflags $f"
        writers="$writers osx"
@@ -721,6 +729,47 @@ if test ${have_libid3tag} = yes; then
 else
        AC_MSG_WARN([no support for id3v2 tags])
 fi
+########################################################################### flac
+OLD_CPPFLAGS="$CPPFLAGS"
+OLD_LD_FLAGS="$LDFLAGS"
+OLD_LIBS="$LIBS"
+
+have_flac="yes"
+AC_ARG_WITH(flac_headers, [AC_HELP_STRING(--with-flac-headers=dir,
+       [look for flac headers also in dir])])
+if test -n "$with_flac_headers"; then
+       flac_cppflags="-I$with_flac_headers"
+       CPPFLAGS="$CPPFLAGS $flac_cppflags"
+fi
+AC_ARG_WITH(flac_libs, [AC_HELP_STRING(--with-flac-libs=dir,
+       [look for flac libs also in dir])])
+if test -n "$with_flac_libs"; then
+       flac_libs="-L$with_flac_libs"
+       LDFLAGS="$LDFLAGS $flac_libs"
+fi
+AC_CHECK_HEADER(FLAC/stream_decoder.h, [], have_flac=no)
+AC_CHECK_LIB([FLAC], [FLAC__stream_decoder_init_file], [], have_flac=no)
+if test "$have_flac" = "yes"; then
+       AC_DEFINE(HAVE_FLAC, 1, define to 1 if you want to build the flacdec filter)
+       all_errlist_objs="$all_errlist_objs flacdec_filter flac_afh"
+       filter_errlist_objs="$filter_errlist_objs flacdec_filter"
+       audiod_errlist_objs="$audiod_errlist_objs flacdec_filter"
+       afh_errlist_objs="$afh_errlist_objs flac_afh"
+       server_errlist_objs="$server_errlist_objs flac_afh"
+       filter_ldflags="$filter_ldflags $flac_libs -lFLAC"
+       audiod_ldflags="$audiod_ldflags $flac_libs -lFLAC"
+       server_ldflags="$server_ldflags $flac_libs -lFLAC"
+       afh_ldflags="$afh_ldflags $flac_libs -lFLAC"
+       filters="$filters flacdec"
+       server_audio_formats="$server_audio_formats flac"
+       audiod_audio_formats="$audiod_audio_formats flac"
+       AC_SUBST(flac_cppflags)
+else
+       AC_MSG_WARN([no flac support in para_audiod/para_filter])
+fi
+CPPFLAGS="$OLD_CPPFLAGS"
+LDFLAGS="$OLD_LDFLAGS"
+LIBS="$OLD_LIBS"
 ########################################################################### oss
 OLD_CPPFLAGS="$CPPFLAGS"
 OLD_LD_FLAGS="$LDFLAGS"