]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - configure.ac
configure: Add fade.o to object list only if oss was detected.
[paraslash.git] / configure.ac
index e07f9e07cdde1fd8c163816103baf6289af72e94..d11c3ad7355537f6b343718618875aad3acd2944 100644 (file)
@@ -1,10 +1,10 @@
 #                                               -*- Autoconf -*-
 # Process this file with autoconf to produce a configure script.
 
-AC_PREREQ(2.60)
+AC_PREREQ([2.61])
 
 
-AC_INIT(paraslash, [git], maan@systemlinux.org)
+AC_INIT([paraslash],[git],[maan@systemlinux.org])
 AC_CONFIG_HEADER([config.h])
 
 AC_PATH_PROG(UNAMEPATH, uname, no)
@@ -90,7 +90,7 @@ AC_DEFUN([add_cmdline],[$(for i in $@; do printf "${i}.cmdline "; done)])
 
 
 all_errlist_objs="mp3_afh afh_common net string signal time daemon
-       stat afh fade amp_filter fd ringbuffer sched audiod
+       stat afh amp_filter fd ringbuffer sched audiod
        grab_client filter_common wav_filter compress_filter http_recv
        dccp_recv recv_common write_common file_write audiod_command
        client_common recv stdout filter stdin audioc write client
@@ -180,8 +180,8 @@ AC_DEFUN([AX_FUNC_SNPRINTF],
 [AC_CHECK_FUNCS(snprintf vsnprintf)
 AC_MSG_CHECKING(for working snprintf)
 AC_CACHE_VAL(ac_cv_have_working_snprintf,
-[AC_TRY_RUN(
-[#include <stdio.h>
+[AC_RUN_IFELSE([AC_LANG_SOURCE([[
+#include <stdio.h>
 
 int main(void)
 {
@@ -195,12 +195,12 @@ int main(void)
     if (strcmp (bufd, "1")) exit (1);
     if (i != 3) exit (1);
     exit(0);
-}], ac_cv_have_working_snprintf=yes, ac_cv_have_working_snprintf=no, ac_cv_have_working_snprintf=cross)])
+}]])],[ac_cv_have_working_snprintf=yes],
+[ac_cv_have_working_snprintf=no],[ac_cv_have_working_snprintf=cross])])
 AC_MSG_RESULT([$ac_cv_have_working_snprintf])
 AC_MSG_CHECKING(for working vsnprintf)
 AC_CACHE_VAL(ac_cv_have_working_vsnprintf,
-[AC_TRY_RUN(
-[#include <stdio.h>
+[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h>
 #include <stdarg.h>
 
 int my_vsnprintf (char *buf, const char *tmpl, ...)
@@ -225,7 +225,8 @@ int main(void)
     if (strcmp (bufd, "1")) exit (1);
     if (i != 3) exit (1);
     exit(0);
-}], ac_cv_have_working_vsnprintf=yes, ac_cv_have_working_vsnprintf=no, ac_cv_have_working_vsnprintf=cross)])
+}]])],[ac_cv_have_working_vsnprintf=yes],
+[ac_cv_have_working_vsnprintf=no],[ac_cv_have_working_vsnprintf=cross])])
 AC_MSG_RESULT([$ac_cv_have_working_vsnprintf])
 if test x$ac_cv_have_working_snprintf$ac_cv_have_working_vsnprintf != "xyesyes"; then
 AC_MSG_ERROR([fatal: buggy snprintf() detected])
@@ -423,13 +424,13 @@ AC_SEARCH_LIBS([inet_ntoa],[nsl],[],[
 ],[])
 ########################################################################### ucred
 AC_MSG_CHECKING(for struct ucred)
-AC_TRY_LINK([
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[
        #define _GNU_SOURCE
        #include <sys/types.h>
        #include <sys/socket.h>
-],[
+]], [[
        struct ucred sucred; sucred.pid=0;
-],[have_ucred=yes],[have_ucred=no])
+]])],[have_ucred=yes],[have_ucred=no])
 AC_MSG_RESULT($have_ucred)
 if test ${have_ucred} = yes; then
        AC_DEFINE(HAVE_UCRED, 1, define to 1 you have struct ucred)
@@ -472,13 +473,13 @@ LIBS="$OLD_LIBS"
 
 ########################################################################### ip_mreqn
 AC_MSG_CHECKING(for struct ip_mreqn (UDPv4 multicast))
-AC_TRY_LINK([
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[
        #include <netdb.h>
        #include <net/if.h>
-],[
+]], [[
        struct ip_mreqn mn;
        mn.imr_ifindex = 0;
-],[have_ip_mreqn=yes],[have_ip_mreqn=no])
+]])],[have_ip_mreqn=yes],[have_ip_mreqn=no])
 AC_MSG_RESULT($have_ip_mreqn)
 if test ${have_ip_mreqn} = yes; then
        AC_DEFINE(HAVE_IP_MREQN, 1, define to 1 you have struct ip_mreqn)
@@ -486,11 +487,11 @@ fi
 ########################################################################### osx
 
 AC_MSG_CHECKING(for CoreAudio (MacOs))
-AC_TRY_LINK([
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[
        #include <CoreAudio/CoreAudio.h>
-],[
+]], [[
        AudioDeviceID id;
-],[have_core_audio=yes],[have_core_audio=no])
+]])],[have_core_audio=yes],[have_core_audio=no])
 AC_MSG_RESULT($have_core_audio)
 if test ${have_core_audio} = yes; then
        f1="-framework CoreAudio"
@@ -738,11 +739,11 @@ if test -n "$with_id3tag_libs"; then
 fi
 
 AC_MSG_CHECKING(for libid3tag)
-AC_TRY_LINK([
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[
        #include <id3tag.h>
-],[
+]], [[
        struct id3_tag t = {.flags = 0};
-],[], [have_libid3tag=no])
+]])],[],[have_libid3tag=no])
 AC_MSG_RESULT($have_libid3tag)
 
 if test ${have_libid3tag} = yes; then
@@ -808,7 +809,7 @@ msg="=> will not build para_fade/oss writer"
 AC_CHECK_HEADER(sys/soundcard.h, [
        extras="$extras fade"
        executables="$executables fade"
-       all_errlist_objs="$all_errlist_objs oss_write"
+       all_errlist_objs="$all_errlist_objs oss_write fade"
        audiod_errlist_objs="$audiod_errlist_objs oss_write"
        audiod_cmdline_objs="$audiod_cmdline_objs add_cmdline(oss_write)"