1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2024-12-04 14:46:30 -05:00

remove duplication for compiler flags, and fixup curl detection

svn path=/trunk/icecast/; revision=5169
This commit is contained in:
Karl Heyes 2003-07-24 02:31:36 +00:00
parent 8654a18f72
commit d2ee7bbfca
2 changed files with 40 additions and 63 deletions

View File

@ -1,5 +1,5 @@
AC_INIT(src/main.c) AC_INIT(src/main.c)
AC_PREREQ(2.50) AC_PREREQ(2.54)
dnl Process this file with autoconf to produce a configure script. dnl Process this file with autoconf to produce a configure script.
AM_INIT_AUTOMAKE(icecast,2.0-alpha-2) AM_INIT_AUTOMAKE(icecast,2.0-alpha-2)
@ -12,56 +12,35 @@ AM_PROG_LIBTOOL
dnl Set some options based on environment dnl Set some options based on environment
case "$host" in case "$host" in
*openbsd*) *openbsd* | *irix*)
;; ;;
*) AC_DEFINE(_XOPEN_SOURCE, 600, [Define if you have POSIX and XPG specifications]) *) AC_DEFINE(_XOPEN_SOURCE, 600, [Define if you have POSIX and XPG specifications])
;; ;;
esac esac
DEBUG="-g"
if test -z "$GCC"; then if test -z "$GCC"; then
XIPH_CPPFLAGS="-D_REENTRANT"
case $host in case $host in
*-*-irix*) *-*-irix*)
DEBUG="-g -signed -D_REENTRANT" XIPH_CPPFLAGS="$XIPH_CPPFLAGS -w -signed"
XIPH_CFLAGS="-O2 -w -signed -D_REENTRANT"
PROFILE="-p -g3 -O2 -signed -D_REENTRANT" PROFILE="-p -g3 -O2 -signed -D_REENTRANT"
;; ;;
*-*-solaris*) *-*-solaris*)
DEBUG="-v -g -D_REENTRANT" XIPH_CFLAGS="-xO4 -xcg92"
XIPH_CFLAGS="-xO4 -fast -w -fsimple -native -xcg92 -D_REENTRANT" XIPH_CPPFLAGS="$XIPH_CPPFLAGS -v -w -fsimple -fast"
PROFILE="-v -xpg -g -xO4 -fast -native -fsimple -xcg92 -Dsuncc -D_REENTRANT" PROFILE="-xpg -g -Dsuncc"
;; ;;
*) *)
DEBUG="-g -D_REENTRANT" XIPH_CFLAGS="-O"
XIPH_CFLAGS="-O -D_REENTRANT" PROFILE="-g -p"
PROFILE="-g -p -D_REENTRANT"
;; ;;
esac esac
else else
XIPH_CPPFLAGS="-Wall -ffast-math -fsigned-char"
PROFILE="-pg -g"
case $host in case $host in
*-*-linux*) *-solaris*)
DEBUG="-g -Wall -fsigned-char -D_GNU_SOURCE"
XIPH_CPPFLAGS="-ffast-math -fsigned-char -D_GNU_SOURCE"
PROFILE="-Wall -W -pg -g -ffast-math -fsigned-char -D_GNU_SOURCE"
;;
sparc-sun-solaris*)
AC_DEFINE(__EXTENSIONS__, 1, [define to 1 to get resolve header problem on solaris]) AC_DEFINE(__EXTENSIONS__, 1, [define to 1 to get resolve header problem on solaris])
DEBUG="-g -Wall -fsigned-char -mv8"
XIPH_CPPFLAGS="-ffast-math -fsigned-char -mv8"
PROFILE="-pg -g -fsigned-char -mv8"
;;
*-pc-solaris*)
DEBUG="-g -Wall -fsigned-char"
XIPH_CPPFLAGS="-ffast-math -fsigned-char"
PROFILE="-pg -g -fsigned-char"
;;
*freebsd*)
DEBUG="-g -Wall -fsigned-char"
XIPH_CPPFLAGS="-fsigned-char"
PROFILE="-g -pg -fsigned-char"
;;
*)
DEBUG="-g -Wall -fsigned-char"
XIPH_CPPFLAGS="-Wall -fsigned-char"
PROFILE="-g -pg -Wall -fsigned-char"
;; ;;
esac esac
fi fi
@ -100,33 +79,24 @@ XIPH_VAR_APPEND([XIPH_CPPFLAGS],[$PTHREAD_CPPFLAGS])
XIPH_VAR_PREPEND([XIPH_LIBS],[$PTHREAD_LIBS]) XIPH_VAR_PREPEND([XIPH_LIBS],[$PTHREAD_LIBS])
dnl -- YP support -- dnl -- YP support --
AC_ARG_ENABLE([yp], AC_ARG_ENABLE([yp], AC_HELP_STRING([--disable-yp],[disable YP directory support]),,
AC_HELP_STRING([--disable-yp],[disable YP directory support])) [enable_yp="yes"])
if test "x$enable_yp" != "xno" if test "x$enable_yp" = "xyes"
then then
XIPH_PATH_CURL([ XIPH_PATH_CURL([
AC_CHECK_DECL([CURLOPT_NOSIGNAL], [ AC_CHECK_DECL([CURLOPT_NOSIGNAL],
AC_DEFINE([USE_YP], 1, [Define to compile in YP support code]) [ AC_DEFINE([USE_YP], 1, [Define to compile in YP support code])
ICECAST_OPTIONAL="$ICECAST_OPTIONAL geturl.o yp.o" ICECAST_OPTIONAL="$ICECAST_OPTIONAL geturl.o yp.o"
], [ XIPH_VAR_APPEND([XIPH_CPPFLAGS],[$CURL_CFLAGS])
if test "x$enable_yp" != "xyes"
then
AC_MSG_NOTICE([Your curl dev files are too old (7.10 or above required), YP disabled])
else
AC_MSG_ERROR([Your curl dev files are too old (7.10 or above required)])
fi
], [#include <curl/curl.h>])
], [
if test "x$enable_yp" != "xyes"
then
AC_MSG_NOTICE([libcurl not found, YP disabled])
else
AC_MSG_ERROR([libcurl not found])
fi
])
fi
XIPH_VAR_APPEND([XIPH_CFLAGS],[$CURL_CFLAGS])
XIPH_VAR_PREPEND([XIPH_LIBS],[$CURL_LIBS]) 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 dnl Make substitutions
@ -143,4 +113,7 @@ AC_SUBST(CFLAGS)
AC_SUBST(PROFILE) AC_SUBST(PROFILE)
AC_SUBST(ICECAST_OPTIONAL) 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) 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])

View File

@ -22,11 +22,13 @@ elif test "x$CURL_CONFIG" != "x"; then
CURL_LIBS="$($CURL_CONFIG --libs)" CURL_LIBS="$($CURL_CONFIG --libs)"
CURL_CFLAGS="$($CURL_CONFIG --cflags)" CURL_CFLAGS="$($CURL_CONFIG --cflags)"
else else
if test "x$prefix" != "xNONE"; then if test "x$prefix" = "xNONE"; then
CURL_LIBS="-L$prefix/lib" curl_prefix="/usr/local"
CURL_CFLAGS="-I$prefix/include" else
curl_prefix="$prefix"
fi fi
CURL_LIBS="$CURL_LIBS -lcurl" CURL_LIBS="-L$curl_prefix/lib -lcurl"
CURL_CFLAGS="-I$curl_prefix/include"
fi fi
curl_ok="yes" curl_ok="yes"
@ -58,6 +60,8 @@ if test "$curl_ok" = "yes"; then
ifelse([$1], , :, [$1]) ifelse([$1], , :, [$1])
else else
AC_MSG_RESULT(no) AC_MSG_RESULT(no)
CURL_LIBS=""
CURL_CFLAGS=""
ifelse([$2], , :, [$2]) ifelse([$2], , :, [$2])
fi fi
]) ])