# -*- 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)
[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)
{
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, ...)
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])
],[])
########################################################################### 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)
########################################################################### 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)
########################################################################### 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"
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