1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2024-12-04 14:46:30 -05:00
icecast-server/configure.in
brendan f14dcdc023 use _GNU_SOURCE where possible
guard unistd.h with CHROOT rather than HAVE_UNISTD_H, since that's how it's
tested in configure.in

svn path=/trunk/icecast/; revision=5171
2003-07-24 05:32:37 +00:00

119 lines
3.2 KiB
Plaintext

AC_INIT(src/main.c)
AC_PREREQ(2.54)
dnl Process this file with autoconf to produce a configure script.
AM_INIT_AUTOMAKE(icecast,2.0-alpha-2)
AM_CONFIG_HEADER(config.h)
AC_PROG_CC
AC_CANONICAL_HOST
AM_PROG_LIBTOOL
dnl Set some options based on environment
DEBUG="-g"
if test -z "$GCC"; then
XIPH_CPPFLAGS="-D_REENTRANT"
case $host in
*-*-irix*)
XIPH_CPPFLAGS="$XIPH_CPPFLAGS -w -signed"
PROFILE="-p -g3 -O2 -signed -D_REENTRANT"
;;
*-*-solaris*)
XIPH_CFLAGS="-xO4 -xcg92"
XIPH_CPPFLAGS="$XIPH_CPPFLAGS -v -w -fsimple -fast"
PROFILE="-xpg -g -Dsuncc"
;;
*)
XIPH_CFLAGS="-O"
PROFILE="-g -p"
;;
esac
case "$host" in
*openbsd* | *irix*)
;;
*) AC_DEFINE([_XOPEN_SOURCE], 600, [Define if you have POSIX and XPG specifications])
;;
esac
else
XIPH_CPPFLAGS="-Wall -ffast-math -fsigned-char"
PROFILE="-pg -g"
AC_DEFINE([_GNU_SOURCE], 1, [Define to include GNU extensions to POSIX])
fi
dnl Checks for programs.
dnl Checks for libraries.
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([alloca.h])
AC_CHECK_HEADER(pwd.h, AC_DEFINE(CHUID, 1, [Define if you have pwd.h]),,)
AC_CHECK_HEADER(unistd.h, AC_DEFINE(CHROOT, 1, [Define if you have unistd.h]),,)
dnl Checks for typedefs, structures, and compiler characteristics.
dnl Check for types
dnl Checks for library functions.
AC_CHECK_FUNCS(nanosleep poll)
XIPH_NET
dnl -- configure options --
XIPH_PATH_XSLT
XIPH_VAR_APPEND([XIPH_CPPFLAGS],[$XSLT_CFLAGS])
XIPH_VAR_PREPEND([XIPH_LIBS],[$XSLT_LIBS])
XIPH_PATH_VORBIS(, AC_MSG_ERROR([must have Ogg Vorbis v1.0 installed!]))
XIPH_VAR_APPEND([XIPH_CPPFLAGS],[$VORBIS_CFLAGS])
XIPH_VAR_PREPEND([XIPH_LIBS],[$VORBIS_LIBS])
ACX_PTHREAD(, AC_MSG_ERROR([POSIX threads missing]))
XIPH_VAR_APPEND([XIPH_CFLAGS],[$PTHREAD_CFLAGS])
XIPH_VAR_APPEND([XIPH_CPPFLAGS],[$PTHREAD_CPPFLAGS])
XIPH_VAR_PREPEND([XIPH_LIBS],[$PTHREAD_LIBS])
dnl -- YP support --
AC_ARG_ENABLE([yp], AC_HELP_STRING([--disable-yp],[disable YP directory support]),,
[enable_yp="yes"])
if test "x$enable_yp" = "xyes"
then
XIPH_PATH_CURL([
AC_CHECK_DECL([CURLOPT_NOSIGNAL],
[ AC_DEFINE([USE_YP], 1, [Define to compile in YP support code])
ICECAST_OPTIONAL="$ICECAST_OPTIONAL geturl.o yp.o"
XIPH_VAR_APPEND([XIPH_CPPFLAGS],[$CURL_CFLAGS])
XIPH_VAR_PREPEND([XIPH_LIBS],[$CURL_LIBS])
], [ AC_MSG_NOTICE([Your curl dev files are too old (7.10 or above required), YP disabled])
], [#include <curl/curl.h>
])
],[ AC_MSG_NOTICE([libcurl not found, YP disabled])
])
else
AC_MSG_NOTICE([YP support disabled])
fi
dnl Make substitutions
AC_SUBST(XIPH_CPPFLAGS)
AC_SUBST(XIPH_CFLAGS)
AC_SUBST(XIPH_LIBS)
AC_SUBST(PTHREAD_CPPFLAGS)
AC_SUBST(PTHREAD_CFLAGS)
AC_SUBST(PTHREAD_LIBS)
AC_SUBST(LIBTOOL_DEPS)
AC_SUBST(LIBS)
AC_SUBST(DEBUG)
AC_SUBST(CFLAGS)
AC_SUBST(PROFILE)
AC_SUBST(ICECAST_OPTIONAL)
AC_OUTPUT([Makefile conf/Makefile src/Makefile src/avl/Makefile
src/httpp/Makefile src/thread/Makefile src/log/Makefile
src/net/Makefile src/timing/Makefile doc/Makefile web/Makefile
admin/Makefile win32/Makefile win32/res/Makefile])