[xiph-commits] r6842 - in icecast/branches: . m4-shout-kh
j at dactyl.lonelymoon.com
j
Fri Jun 25 13:47:03 PDT 2004
m4-shout-kh/CVS
Message-ID: <20040625204703.E70339AAAB at dactyl.lonelymoon.com>
Author: j
Date: Fri Jun 25 13:47:03 2004
New Revision: 6842
Added:
icecast/branches/m4-shout-kh/
icecast/branches/m4-shout-kh/CVS/
icecast/branches/m4-shout-kh/CVS/Entries
icecast/branches/m4-shout-kh/CVS/Repository
icecast/branches/m4-shout-kh/CVS/Root
icecast/branches/m4-shout-kh/ac_config_libconfig_in.m4
icecast/branches/m4-shout-kh/acx_pthread.m4
icecast/branches/m4-shout-kh/ogg.m4
icecast/branches/m4-shout-kh/shout.m4
icecast/branches/m4-shout-kh/speex.m4
icecast/branches/m4-shout-kh/theora.m4
icecast/branches/m4-shout-kh/vorbis.m4
icecast/branches/m4-shout-kh/xiph_compiler.m4
icecast/branches/m4-shout-kh/xiph_net.m4
icecast/branches/m4-shout-kh/xiph_path_python.m4
icecast/branches/m4-shout-kh/xiph_types.m4
Log:
import of m4-shout-kh
Added: icecast/branches/m4-shout-kh/CVS/Entries
===================================================================
--- icecast/branches/m4-shout-kh/CVS/Entries 2004-06-24 18:20:39 UTC (rev 6841)
+++ icecast/branches/m4-shout-kh/CVS/Entries 2004-06-24 18:21:16 UTC (rev 6842)
@@ -0,0 +1,10 @@
+/ac_config_libconfig_in.m4/1.4/Sat Jun 28 02:16:47 2003//
+/acx_pthread.m4/1.5/Tue Jun 24 00:58:10 2003//
+/shout.m4/1.11/Tue Jul 1 18:02:19 2003//
+/vorbis.m4/1.5/Tue Jul 1 18:21:46 2003//
+/xiph_compiler.m4/1.4/Thu Jun 26 16:03:37 2003//
+/xiph_path_python.m4/1.1/Fri Jun 13 19:22:16 2003//
+/xiph_types.m4/1.1/Tue Jun 24 21:35:44 2003//
+/ogg.m4/1.7/Thu Jul 10 14:04:40 2003//
+/xiph_net.m4/1.2/Thu Jul 10 14:04:40 2003//
+D
Added: icecast/branches/m4-shout-kh/CVS/Repository
===================================================================
--- icecast/branches/m4-shout-kh/CVS/Repository 2004-06-24 18:20:39 UTC (rev 6841)
+++ icecast/branches/m4-shout-kh/CVS/Repository 2004-06-24 18:21:16 UTC (rev 6842)
@@ -0,0 +1 @@
+m4
Added: icecast/branches/m4-shout-kh/CVS/Root
===================================================================
--- icecast/branches/m4-shout-kh/CVS/Root 2004-06-24 18:20:39 UTC (rev 6841)
+++ icecast/branches/m4-shout-kh/CVS/Root 2004-06-24 18:21:16 UTC (rev 6842)
@@ -0,0 +1 @@
+:ext:karl at xiph.org:/usr/local/cvsroot
Added: icecast/branches/m4-shout-kh/ac_config_libconfig_in.m4
===================================================================
--- icecast/branches/m4-shout-kh/ac_config_libconfig_in.m4 2004-06-24 18:20:39 UTC (rev 6841)
+++ icecast/branches/m4-shout-kh/ac_config_libconfig_in.m4 2004-06-24 18:21:16 UTC (rev 6842)
@@ -0,0 +1,270 @@
+dnl Available from the GNU Autoconf Macro Archive at:
+dnl http://www.gnu.org/software/ac-archive/htmldoc/ac_config_libconfig_in.html
+dnl
+# AC_CONFIG_LIBCONFIG_IN(LIBRARY, DESTINATION, MODULES)
+# -----------------------------------------------------
+# Generate a custom LIBRARY-config script. Create the script in the
+# DESTINATION directory, including support for MODULES.
+AC_DEFUN([AC_CONFIG_LIBCONFIG_IN],
+[# create a custom library-config file ($1-config)
+m4_if(AC_CONFIG_LIBCONFIG_IN_USEPKGCONFIG, [true],
+ [AC_PATH_PROG(PKG_CONFIG, pkg-config)])
+pushdef([LIBCONFIG_DIR], [m4_if([$2], , , [$2/])])
+LIBCONFIG_FILE="LIBCONFIG_DIR[]$1-config.in"
+AC_SUBST(target)dnl
+AC_SUBST(host)dnl
+AC_SUBST(build)dnl
+dnl create directory if it does not preexist
+m4_if([$2], , , [AS_MKDIR_P([$2])])
+AC_MSG_NOTICE([creating $LIBCONFIG_FILE])
+echo '#! /bin/sh' >$LIBCONFIG_FILE
+echo "# $1-config library configuration script" >>$LIBCONFIG_FILE
+echo '# generated by ac_config_libconfig_in.m4' >>$LIBCONFIG_FILE
+echo ' ' >>$LIBCONFIG_FILE
+echo 'template_version="1.0.0"' >>$LIBCONFIG_FILE
+echo ' ' >>$LIBCONFIG_FILE
+echo 'package="@PACKAGE@"' >>$LIBCONFIG_FILE
+echo ' ' >>$LIBCONFIG_FILE
+echo '# usage instructions if no options given' >>$LIBCONFIG_FILE
+echo 'if test "'"\$""#"'" -eq 0; then' >>$LIBCONFIG_FILE
+echo ' cat <<EOF' >>$LIBCONFIG_FILE
+m4_if($3, ,
+ [echo 'Usage: $1-config [[OPTIONS]]' >>$LIBCONFIG_FILE],
+ [echo 'Usage: $1-config [[OPTIONS]] [[LIBRARIES]]' >>$LIBCONFIG_FILE])
+echo 'Options:' >>$LIBCONFIG_FILE
+echo ' [[--prefix[=DIR]]]' >>$LIBCONFIG_FILE
+echo ' [[--exec-prefix[=DIR]]]' >>$LIBCONFIG_FILE
+echo ' [[--package]]' >>$LIBCONFIG_FILE
+echo ' [[--version]]' >>$LIBCONFIG_FILE
+echo ' [[--cppflags]]' >>$LIBCONFIG_FILE
+echo ' [[--cflags-only]]' >>$LIBCONFIG_FILE
+echo ' [[--cflags]]' >>$LIBCONFIG_FILE
+echo ' [[--libs]]' >>$LIBCONFIG_FILE
+echo ' [[--help]]' >>$LIBCONFIG_FILE
+m4_if($3, , ,
+ [echo 'Libraries:' >>$LIBCONFIG_FILE
+ for module in $1 $3 ; do
+ echo " $module" >>$LIBCONFIG_FILE ;
+ done])
+echo 'EOF' >>$LIBCONFIG_FILE
+echo 'fi' >>$LIBCONFIG_FILE
+echo ' ' >>$LIBCONFIG_FILE
+echo '# parse options' >>$LIBCONFIG_FILE
+echo 'o=""' >>$LIBCONFIG_FILE
+echo 'h=""' >>$LIBCONFIG_FILE
+echo 'for i' >>$LIBCONFIG_FILE
+echo 'do' >>$LIBCONFIG_FILE
+echo ' case $i in' >>$LIBCONFIG_FILE
+options="prefix exec-prefix eprefix package version cppflags cflags-only cflags libs bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir infodir mandir target host build pkgdatadir pkglibdir pkgincludedir template-version help"
+echo ' --prefix=*) prefix=`echo $i | sed -e "s/--prefix=//"` ;;' >>$LIBCONFIG_FILE
+echo ' --exec-prefix=*) exec_prefix=`echo $i | sed -e "s/--exec-prefix=//"` ;;' >>$LIBCONFIG_FILE
+echo ' --eprefix=*) exec_prefix=`echo $i | sed -e "s/--eprefix=//"` ;;' >>$LIBCONFIG_FILE
+for option in $options ; do
+ case $option in
+ exec-prefix) echo " --$option) echo_exec_prefix=\"yes\" ;;" >>$LIBCONFIG_FILE ;;
+ template-version) echo " --$option) echo_template_version=\"yes\" ;;" >>$LIBCONFIG_FILE ;;
+ cflags-only) echo " --$option) echo_cflags_only=\"yes\" ;;" >>$LIBCONFIG_FILE ;;
+ *) echo " --$option) echo_$option=\"yes\" ;;" >>$LIBCONFIG_FILE ;;
+ esac
+done
+m4_if($3, , ,
+ [for module in $1 $3 ; do
+ echo " $module) echo_module_$module=\"yes\" ;" >>$LIBCONFIG_FILE ;
+ echo ' echo_module="yes" ;;' >>$LIBCONFIG_FILE ;
+ done])
+echo ' //*|/*//*|./*//*) echo_extra="yes" ;;' >>$LIBCONFIG_FILE
+echo ' *) eval "echo Unknown option: $i" ; exit 1 ;;' >>$LIBCONFIG_FILE
+echo ' esac' >>$LIBCONFIG_FILE
+echo 'done' >>$LIBCONFIG_FILE
+echo ' ' >>$LIBCONFIG_FILE
+# in the order of occurence a standard automake Makefile
+echo '# defaults from configure; set only if not set previously' >>$LIBCONFIG_FILE
+vars="prefix exec_prefix bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir infodir mandir includedir target host build"
+for var in $vars ; do
+ echo "if test -z \"\$$var\" ; then" >>$LIBCONFIG_FILE
+ echo " $var=\"@$var@\"" >>$LIBCONFIG_FILE
+ echo 'fi' >>$LIBCONFIG_FILE
+done
+echo ' ' >>$LIBCONFIG_FILE
+echo '# generate output' >>$LIBCONFIG_FILE
+echo 'if test x$echo_module != xyes ; then' >>$LIBCONFIG_FILE
+echo ' echo_module_$1="yes"' >>$LIBCONFIG_FILE
+echo 'fi' >>$LIBCONFIG_FILE
+AC_CONFIG_LIBCONFIG_IN_MODULES(m4_if([$3], , [$1], [m4_translit([$1 $3], [ ], [,])]))dnl
+for option in $options extra; do
+ case $option in
+ exec-prefix) echo "if test x\$echo_exec_prefix = xyes ; then" >>$LIBCONFIG_FILE ;;
+ template-version) echo "if test x\$echo_template_version = xyes ; then" >>$LIBCONFIG_FILE ;;
+ cflags-only) echo "if test x\$echo_cflags_only = xyes ; then" >>$LIBCONFIG_FILE ;;
+ *) echo "if test x\$echo_$option = xyes ; then" >>$LIBCONFIG_FILE ;;
+ esac
+ case $option in
+ exec-prefix | eprefix) echo ' o="$o $exec_prefix"' >>$LIBCONFIG_FILE ;;
+ template-version) echo ' o="$o $template_version"' >>$LIBCONFIG_FILE ;;
+ cflags-only) echo ' o="$o $cflags"' >>$LIBCONFIG_FILE ;;
+ cppflags) echo ' o="$o $cppflags"' >>$LIBCONFIG_FILE ;;
+ cflags)
+# echo ' i=`eval echo "$includedir"`' >>$LIBCONFIG_FILE ;
+# echo ' i=`eval echo "$i"`' >>$LIBCONFIG_FILE ;
+# echo ' if test "_$i" != "_/usr/include" ; then' >>$LIBCONFIG_FILE ;
+# echo ' o="$o -I$includedir"' >>$LIBCONFIG_FILE ;
+# echo ' fi' >>$LIBCONFIG_FILE ;
+ echo ' o="$o $cppflags $cflags"' >>$LIBCONFIG_FILE ;;
+ libs) echo ' o="$o -L$libdir $libs"' >>$LIBCONFIG_FILE ;;
+ help) echo ' h="1"' >>$LIBCONFIG_FILE ;;
+ pkgdatadir) echo " o=\"$o \${datadir}/\${package}\"" >>$LIBCONFIG_FILE ;;
+ pkglibdir) echo " o=\"$o \${libdir}/\${package}\"" >>$LIBCONFIG_FILE ;;
+ pkgincludedir) echo " o=\"$o \${includedir}/\${package}\"" >>$LIBCONFIG_FILE ;;
+ extra)
+ echo ' v=`echo $i | sed -e s://:\$:g`' >>$LIBCONFIG_FILE ;
+ echo ' v=`eval "echo $v"`' >>$LIBCONFIG_FILE ;
+ echo ' o="$o $v"' >>$LIBCONFIG_FILE ;;
+ *) echo " o=\"$o \$$option\"" >>$LIBCONFIG_FILE
+ esac
+ echo 'fi' >>$LIBCONFIG_FILE
+done
+echo ' ' >>$LIBCONFIG_FILE
+echo '# output data' >>$LIBCONFIG_FILE
+echo 'o=`eval "echo $o"`' >>$LIBCONFIG_FILE
+echo 'o=`eval "echo $o"`' >>$LIBCONFIG_FILE
+echo 'if test -n "$o" ; then ' >>$LIBCONFIG_FILE
+echo ' eval "echo $o"' >>$LIBCONFIG_FILE
+echo 'fi' >>$LIBCONFIG_FILE
+echo ' ' >>$LIBCONFIG_FILE
+echo '# help text' >>$LIBCONFIG_FILE
+echo 'if test ! -z "$h" ; then ' >>$LIBCONFIG_FILE
+echo ' cat <<EOF' >>$LIBCONFIG_FILE
+echo 'All available options:' >>$LIBCONFIG_FILE
+echo ' --prefix=DIR and change \$prefix and \$exec-prefix' >>$LIBCONFIG_FILE
+echo ' --exec-prefix=DIR (affects all other options)' >>$LIBCONFIG_FILE
+echo ' --prefix \$prefix $prefix' >>$LIBCONFIG_FILE
+echo ' --exec_prefix or... ' >>$LIBCONFIG_FILE
+echo ' --eprefix \$exec_prefix $exec_prefix' >>$LIBCONFIG_FILE
+echo ' --version \$version $version' >>$LIBCONFIG_FILE
+echo ' --cppflags C preprocessor flags' >>$LIBCONFIG_FILE
+echo ' --cflags-only C compiler flags' >>$LIBCONFIG_FILE
+echo ' --cflags C preprocessor and compiler flags' >>$LIBCONFIG_FILE
+echo ' --libs -L\$libdir \$LIBS $libs' >>$LIBCONFIG_FILE
+echo ' --package \$package $package' >>$LIBCONFIG_FILE
+echo ' --bindir \$bindir $bindir' >>$LIBCONFIG_FILE
+echo ' --sbindir \$sbindir $sbindir' >>$LIBCONFIG_FILE
+echo ' --libexecdir \$libexecdir $libexecdir' >>$LIBCONFIG_FILE
+echo ' --datadir \$datadir $datadir' >>$LIBCONFIG_FILE
+echo ' --sysconfdir \$sysconfdir $sysconfdir' >>$LIBCONFIG_FILE
+echo ' --sharedstatedir \$sharedstatedir$sharedstatedir' >>$LIBCONFIG_FILE
+echo ' --localstatedir \$localstatedir $localstatedir' >>$LIBCONFIG_FILE
+echo ' --libdir \$libdir $libdir' >>$LIBCONFIG_FILE
+echo ' --infodir \$infodir $infodir' >>$LIBCONFIG_FILE
+echo ' --mandir \$mandir $mandir' >>$LIBCONFIG_FILE
+echo ' --target \$target $target' >>$LIBCONFIG_FILE
+echo ' --host \$host $host' >>$LIBCONFIG_FILE
+echo ' --build \$build $build' >>$LIBCONFIG_FILE
+echo ' --pkgdatadir \$datadir/\$package ${datadir}/${package}' >>$LIBCONFIG_FILE
+echo ' --pkglibdir \$libdir/\$package ${libdir}/${package}' >>$LIBCONFIG_FILE
+echo ' --pkgincludedir \$includedir/\$package ${includedir}/${package}' >>$LIBCONFIG_FILE
+echo ' --template-version \$template_version $template_version' >>$LIBCONFIG_FILE
+echo ' --help' >>$LIBCONFIG_FILE
+echo 'EOF' >>$LIBCONFIG_FILE
+echo 'fi' >>$LIBCONFIG_FILE
+m4_pushdef([LIBCONFIG_UP], [m4_translit([$1], [a-z], [A-Z])])dnl
+LIBCONFIG_UP[]_CONFIG="LIBCONFIG_DIR[]$1-config"
+AC_SUBST(LIBCONFIG_UP[]_CONFIG)
+dnl AC_CONFIG_FILES(LIBCONFIG_DIR[]$1[-config], [chmod +x ]LIBCONFIG_DIR[]$1[-config])
+m4_popdef([LIBCONFIG_DIR])
+m4_popdef([LIBCONFIG_UP])
+])
+
+
+# AC_CONFIG_LIBCONFIG_IN_MODULES [(MODULE1 [, MODULE2 [, ...]])]
+# --------------------------------------------------------------
+#Output shell script using custom module variables.
+AC_DEFUN([AC_CONFIG_LIBCONFIG_IN_MODULES],
+[m4_if([$1], , ,
+ [# create module definition for $1
+dnl we're going to need uppercase, lowercase and user-friendly versions of the
+dnl string `MODULE'
+m4_pushdef([MODULE_UP], m4_translit([$1], [a-z], [A-Z]))dnl
+m4_pushdef([MODULE_DOWN], m4_translit([$1], [A-Z], [a-z]))dnl
+if test -z "$MODULE_DOWN[]_cppflags" ; then
+ if test -n "$MODULE_UP[]_CPPFLAGS" ; then
+ MODULE_DOWN[]_cppflags="$MODULE_UP[]_CPPFLAGS"
+ else
+dnl AC_MSG_WARN([variable `MODULE_DOWN[]_cppflags' undefined])
+ MODULE_DOWN[]_cppflags=''
+ fi
+fi
+AC_SUBST(MODULE_DOWN[]_cppflags)
+if test -z "$MODULE_DOWN[]_cflags" ; then
+ if test -n "$MODULE_UP[]_CFLAGS" ; then
+ MODULE_DOWN[]_cflags="$MODULE_UP[]_CFLAGS"
+ else
+dnl AC_MSG_WARN([variable `MODULE_DOWN[]_cflags' undefined])
+ MODULE_DOWN[]_cflags=''
+ fi
+fi
+AC_SUBST(MODULE_DOWN[]_cflags)dnl
+if test -z "$MODULE_DOWN[]_libs" ; then
+ if test -n "$MODULE_UP[]_LIBS" ; then
+ MODULE_DOWN[]_libs="$MODULE_UP[]_LIBS"
+ else
+ AC_MSG_WARN([variable `MODULE_DOWN[]_libs' and `MODULE_UP[]_LIBS' undefined])
+ MODULE_DOWN[]_libs='-l$1'
+ fi
+ if test -n "$MODULE_UP[]_LIBDEPS" ; then
+ MODULE_DOWN[]_libs="$MODULE_DOWN[]_libs $MODULE_UP[]_LIBDEPS"
+ fi
+fi
+AC_SUBST(MODULE_DOWN[]_libs)dnl
+if test -z "$MODULE_UP[]_VERSION" ; then
+ AC_MSG_WARN([variable `MODULE_UP[]_VERSION' undefined])
+ MODULE_UP[]_VERSION="$VERSION"
+fi
+AC_SUBST(MODULE_UP[]_VERSION)dnl
+echo 'if test x$echo_module_$1 = xyes ; then' >>$LIBCONFIG_FILE
+AC_CONFIG_LIBCONFIG_IN_MODULES_VARS([cppflags], [MODULE_DOWN[]_cppflags], [cppflags])
+AC_CONFIG_LIBCONFIG_IN_MODULES_VARS([cflags], [MODULE_DOWN[]_cflags], [cflags])
+AC_CONFIG_LIBCONFIG_IN_MODULES_VARS([libs], [MODULE_DOWN[]_libs], [libs])
+AC_CONFIG_LIBCONFIG_IN_MODULES_VARS([version], [MODULE_UP[]_VERSION], [modversion])
+echo 'fi' >>$LIBCONFIG_FILE
+m4_popdef([MODULE_UP])dnl
+m4_popdef([MODULE_DOWN])dnl
+AC_CONFIG_LIBCONFIG_IN_MODULES(m4_shift($@))])dnl
+])
+
+
+# AC_CONFIG_LIBCONFIG_IN_MODULES_VARS [(VAR, SUBSTITUTION,
+# PKGCONFIG_ARGS)]
+# --------------------------------------------------------
+# Output AC_CONFIG_LIBCONFIG_IN_MODULES variables.
+# VAR = variable to set
+# SUBSTITUTION = set if pkg-config is not available
+# PKGCONFIG_ARGS = args for pkg-config
+AC_DEFUN([AC_CONFIG_LIBCONFIG_IN_MODULES_VARS],
+[m4_if(AC_CONFIG_LIBCONFIG_IN_USEPKGCONFIG, [true],
+[
+echo 'if test -x "`which pkg-config`" ; then' >>$LIBCONFIG_FILE
+echo ' if pkg-config --atleast-pkgconfig-version=0.7 --exists "MODULE_DOWN"; then' >>$LIBCONFIG_FILE
+echo ' $1="@S|@$1 `pkg-config --$3 MODULE_DOWN`"' >>$LIBCONFIG_FILE
+echo ' fi' >>$LIBCONFIG_FILE
+echo 'else' >>$LIBCONFIG_FILE
+echo ' $1="@S|@$1 @$2@"' >>$LIBCONFIG_FILE
+echo 'fi' >>$LIBCONFIG_FILE
+],
+[echo ' $1="@S|@$1 @$2@"' >>$LIBCONFIG_FILE
+])])
+
+
+# AC_CONFIG_LIBCONFIG_IN_PKGCONFIG
+# --------------------------------
+# Enable pkgconfig support in libconfig script (default)
+AC_DEFUN([AC_CONFIG_LIBCONFIG_IN_PKGCONFIG],
+[m4_define([AC_CONFIG_LIBCONFIG_IN_USEPKGCONFIG], [true])
+])dnl
+
+
+# AC_CONFIG_LIBCONFIG_IN_STATIC
+# -----------------------------
+# Disable pkgconfig support in libconfig script
+AC_DEFUN([AC_CONFIG_LIBCONFIG_IN_STATIC],
+[m4_define([AC_CONFIG_LIBCONFIG_IN_USEPKGCONFIG], [false])
+])dnl
Added: icecast/branches/m4-shout-kh/acx_pthread.m4
===================================================================
--- icecast/branches/m4-shout-kh/acx_pthread.m4 2004-06-24 18:20:39 UTC (rev 6841)
+++ icecast/branches/m4-shout-kh/acx_pthread.m4 2004-06-24 18:21:16 UTC (rev 6842)
@@ -0,0 +1,192 @@
+dnl Available from the GNU Autoconf Macro Archive at:
+dnl http://www.gnu.org/software/ac-archive/htmldoc/acx_pthread.html
+dnl
+AC_DEFUN([ACX_PTHREAD], [
+AC_REQUIRE([AC_CANONICAL_HOST])
+AC_LANG_SAVE
+AC_LANG_C
+acx_pthread_ok=no
+
+# We used to check for pthread.h first, but this fails if pthread.h
+# requires special compiler flags (e.g. on True64 or Sequent).
+# It gets checked for in the link test anyway.
+
+# First of all, check if the user has set any of the PTHREAD_LIBS,
+# etcetera environment variables, and if threads linking works using
+# them:
+if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+ save_LIBS="$LIBS"
+ LIBS="$PTHREAD_LIBS $LIBS"
+ AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS])
+ AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes)
+ AC_MSG_RESULT($acx_pthread_ok)
+ if test x"$acx_pthread_ok" = xno; then
+ PTHREAD_LIBS=""
+ PTHREAD_CFLAGS=""
+ fi
+ LIBS="$save_LIBS"
+ CFLAGS="$save_CFLAGS"
+fi
+
+# We must check for the threads library under a number of different
+# names; the ordering is very important because some systems
+# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
+# libraries is broken (non-POSIX).
+
+# Create a list of thread flags to try. Items starting with a "-" are
+# C compiler flags, and other items are library names, except for "none"
+# which indicates that we try without any flags at all.
+
+acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt"
+
+# The ordering *is* (sometimes) important. Some notes on the
+# individual items follow:
+
+# pthreads: AIX (must check this before -lpthread)
+# none: in case threads are in libc; should be tried before -Kthread and
+# other compiler flags to prevent continual compiler warnings
+# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
+# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
+# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
+# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
+# -pthreads: Solaris/gcc
+# -mthreads: Mingw32/gcc, Lynx/gcc
+# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
+# doesn't hurt to check since this sometimes defines pthreads too;
+# also defines -D_REENTRANT)
+# pthread: Linux, etcetera
+# --thread-safe: KAI C++
+
+case "${host_cpu}-${host_os}" in
+ *solaris*)
+
+ # On Solaris (at least, for some versions), libc contains stubbed
+ # (non-functional) versions of the pthreads routines, so link-based
+ # tests will erroneously succeed. (We need to link with -pthread or
+ # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather
+ # a function called by this macro, so we could check for that, but
+ # who knows whether they'll stub that too in a future libc.) So,
+ # we'll just look for -pthreads and -lpthread first:
+
+ acx_pthread_flags="-pthread -pthreads pthread -mt $acx_pthread_flags"
+ ;;
+esac
+
+if test x"$acx_pthread_ok" = xno; then
+for flag in $acx_pthread_flags; do
+
+ case $flag in
+ none)
+ AC_MSG_CHECKING([whether pthreads work without any flags])
+ ;;
+
+ -*)
+ AC_MSG_CHECKING([whether pthreads work with $flag])
+ PTHREAD_CFLAGS="$flag"
+ ;;
+
+ *)
+ AC_MSG_CHECKING([for the pthreads library -l$flag])
+ PTHREAD_LIBS="-l$flag"
+ ;;
+ esac
+
+ save_LIBS="$LIBS"
+ save_CFLAGS="$CFLAGS"
+ LIBS="$PTHREAD_LIBS $LIBS"
+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+
+ # Check for various functions. We must include pthread.h,
+ # since some functions may be macros. (On the Sequent, we
+ # need a special flag -Kthread to make this header compile.)
+ # We check for pthread_join because it is in -lpthread on IRIX
+ # while pthread_create is in libc. We check for pthread_attr_init
+ # due to DEC craziness with -lpthreads. We check for
+ # pthread_cleanup_push because it is one of the few pthread
+ # functions on Solaris that doesn't have a non-functional libc stub.
+ # We try pthread_create on general principles.
+ AC_TRY_LINK([#include <pthread.h>],
+ [pthread_t th; pthread_join(th, 0);
+ pthread_attr_init(0); pthread_cleanup_push(0, 0);
+ pthread_create(0,0,0,0); pthread_cleanup_pop(0); ],
+ [acx_pthread_ok=yes])
+
+ LIBS="$save_LIBS"
+ CFLAGS="$save_CFLAGS"
+
+ AC_MSG_RESULT($acx_pthread_ok)
+ if test "x$acx_pthread_ok" = xyes; then
+ break;
+ fi
+
+ PTHREAD_LIBS=""
+ PTHREAD_CFLAGS=""
+done
+fi
+
+# Various other checks:
+if test "x$acx_pthread_ok" = xyes; then
+ save_LIBS="$LIBS"
+ LIBS="$PTHREAD_LIBS $LIBS"
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+
+ # Detect AIX lossage: threads are created detached by default
+ # and the JOINABLE attribute has a nonstandard name (UNDETACHED).
+ AC_MSG_CHECKING([for joinable pthread attribute])
+ AC_TRY_LINK([#include <pthread.h>],
+ [int attr=PTHREAD_CREATE_JOINABLE;],
+ ok=PTHREAD_CREATE_JOINABLE, ok=unknown)
+ if test x"$ok" = xunknown; then
+ AC_TRY_LINK([#include <pthread.h>],
+ [int attr=PTHREAD_CREATE_UNDETACHED;],
+ ok=PTHREAD_CREATE_UNDETACHED, ok=unknown)
+ fi
+ if test x"$ok" != xPTHREAD_CREATE_JOINABLE; then
+ AC_DEFINE(PTHREAD_CREATE_JOINABLE, $ok,
+ [Define to the necessary symbol if this constant
+ uses a non-standard name on your system.])
+ fi
+ AC_MSG_RESULT(${ok})
+ if test x"$ok" = xunknown; then
+ AC_MSG_WARN([we do not know how to create joinable pthreads])
+ fi
+
+ AC_MSG_CHECKING([if more special flags are required for pthreads])
+ flag=no
+ case "${host_cpu}-${host_os}" in
+ *-aix* | *-freebsd*) flag="-D_THREAD_SAFE";;
+ *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
+ esac
+ AC_MSG_RESULT(${flag})
+ if test "x$flag" != xno; then
+ PTHREAD_CPPFLAGS="$flag $PTHREAD_CPPFLAGS"
+ fi
+ AC_CHECK_TYPES(pthread_rwlock_t,,,[#include <pthread.h>])
+
+ LIBS="$save_LIBS"
+ CFLAGS="$save_CFLAGS"
+
+ # More AIX lossage: must compile with cc_r
+ AC_CHECK_PROG(PTHREAD_CC, cc_r, cc_r, ${CC})
+else
+ PTHREAD_CC="$CC"
+fi
+
+AC_SUBST(PTHREAD_LIBS)
+AC_SUBST(PTHREAD_CFLAGS)
+AC_SUBST(PTHREAD_CPPFLAGS)
+AC_SUBST(PTHREAD_CC)
+
+# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+if test x"$acx_pthread_ok" = xyes; then
+ ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1])
+ :
+else
+ acx_pthread_ok=no
+ $2
+fi
+AC_LANG_RESTORE
+])dnl ACX_PTHREAD
Added: icecast/branches/m4-shout-kh/ogg.m4
===================================================================
--- icecast/branches/m4-shout-kh/ogg.m4 2004-06-24 18:20:39 UTC (rev 6841)
+++ icecast/branches/m4-shout-kh/ogg.m4 2004-06-24 18:21:16 UTC (rev 6842)
@@ -0,0 +1,55 @@
+# Configure paths for libogg
+# updated by Karl Heyes 10-Jun-2003
+# Jack Moffitt <jack at icecast.org> 10-21-2000
+# Shamelessly stolen from Owen Taylor and Manish Singh
+
+dnl XIPH_PATH_OGG([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
+dnl Test for libogg, and define OGG_CFLAGS OGG_LDFLAGS and OGG_LIBS
+dnl
+AC_DEFUN(XIPH_PATH_OGG,
+[dnl
+AC_ARG_VAR([OGG_PREFIX],[path to ogg installation])
+AC_ARG_WITH(ogg,
+ [AC_HELP_STRING([--with-ogg=PREFIX],
+ [Prefix where libogg is installed (optional)])],
+ ogg_prefix="$withval",
+ ogg_prefix="$OGG_PREFIX"
+)
+if test "x$ogg_prefix" = "x"; then
+ if test "x$prefix" = "xNONE"; then
+ ogg_prefix=/usr/local
+ else
+ ogg_prefix="$prefix"
+ fi
+fi
+
+XIPH_GCC_WARNING([-I$ogg_prefix/include],,
+ [OGG_CFLAGS="-I$ogg_prefix/include"
+ OGG_LDFLAGS="-L$ogg_prefix/lib"
+ ])
+OGG_LIBS="-logg"
+
+#
+# check if the installed Ogg is sufficiently new.
+#
+AC_MSG_CHECKING([for ogg_sync_init in libogg])
+ac_save_CFLAGS="$CFLAGS"
+ac_save_LIBS="$LIBS"
+ac_save_LDFLAGS="$LDFLAGS"
+CFLAGS="$CFLAGS $OGG_CFLAGS"
+LIBS="$LIBS $OGG_LIBS"
+LDFLAGS="$LDFLAGS $OGG_LDFLAGS"
+AC_TRY_LINK_FUNC(ogg_sync_init,
+ [ifelse([$1],, [AC_MSG_RESULT([ok])], [$1])],
+ [AC_TRY_LINK([#include <ogg/ogg.h>],,
+ [ ifelse([$2], ,[AC_MSG_ERROR([found, but needs updating])], [$2])],
+ [ ifelse([$2], ,[AC_MSG_ERROR([not found, maybe you need to set LD_LIBRARY_PATH or /etc/ld.so.conf])], [$2])])
+ ])
+CFLAGS="$ac_save_CFLAGS"
+LDFLAGS="$ac_save_LDFLAGS"
+LIBS="$ac_save_LIBS"
+
+AC_SUBST(OGG_CFLAGS)
+AC_SUBST(OGG_LDFLAGS)
+AC_SUBST(OGG_LIBS)
+])
Added: icecast/branches/m4-shout-kh/shout.m4
===================================================================
--- icecast/branches/m4-shout-kh/shout.m4 2004-06-24 18:20:39 UTC (rev 6841)
+++ icecast/branches/m4-shout-kh/shout.m4 2004-06-24 18:21:16 UTC (rev 6842)
@@ -0,0 +1,75 @@
+dnl XIPH_PATH_SHOUT
+dnl Jack Moffitt <jack at icecast.org> 08-06-2001
+dnl Rewritten for libshout 2
+dnl Brendan Cully <brendan at xiph.org> 20030612
+dnl
+dnl $Id: shout.m4,v 1.11 2003/07/01 18:02:19 brendan Exp $
+
+# XIPH_PATH_SHOUT([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
+# Test for libshout, and define SHOUT_CPPFLAGS SHOUT_CFLAGS SHOUT_LIBS, and
+# SHOUT_THREADED
+AC_DEFUN([XIPH_PATH_SHOUT],
+[dnl
+xt_have_shout="no"
+SHOUT_THREADED="no"
+SHOUT_CPPFLAGS=""
+SHOUT_CFLAGS=""
+SHOUT_LIBS=""
+
+# NB: PKG_CHECK_MODULES exits if pkg-config is unavailable on the targe
+# system, so we can't use it.
+
+# seed pkg-config with the default libshout location
+PKG_CONFIG_PATH=${PKG_CONFIG_PATH:-/usr/local/lib/pkgconfig}
+export PKG_CONFIG_PATH
+
+# Step 1: Use pkg-config if available
+AC_PATH_PROG([PKGCONFIG], [pkg-config], [no])
+if test "$PKGCONFIG" != "no" && `$PKGCONFIG --exists shout`
+then
+ SHOUT_CFLAGS=`$PKGCONFIG --variable=cflags_only shout`
+ SHOUT_CPPFLAGS=`$PKGCONFIG --variable=cppflags shout`
+ SHOUT_LIBS=`$PKGCONFIG --libs shout`
+ xt_have_shout="maybe"
+else
+ if test "$PKGCONFIG" != "no"
+ then
+ AC_MSG_NOTICE([$PKGCONFIG couldn't find libshout. Try adjusting PKG_CONFIG_PATH.])
+ fi
+ # pkg-config unavailable, try shout-config
+ AC_PATH_PROG([SHOUTCONFIG], [shout-config], [no])
+ if test "$SHOUTCONFIG" != "no" && test `$SHOUTCONFIG --package` = "libshout"
+ then
+ SHOUT_CPPFLAGS=`$SHOUTCONFIG --cppflags`
+ SHOUT_CFLAGS=`$SHOUTCONFIG --cflags-only`
+ SHOUT_LIBS=`$SHOUTCONFIG --libs`
+ xt_have_shout="maybe"
+ fi
+fi
+
+# Now try actually using libshout
+if test "$xt_have_shout" != "no"
+then
+ ac_save_CPPFLAGS="$CPPFLAGS"
+ ac_save_CFLAGS="$CFLAGS"
+ ac_save_LIBS="$LIBS"
+ CPPFLAGS="$CPPFLAGS $SHOUT_CPPFLAGS"
+ CFLAGS="$CFLAGS $SHOUT_CFLAGS"
+ LIBS="$SHOUT_LIBS $LIBS"
+ AC_CHECK_HEADERS([shout/shout.h], [
+ AC_CHECK_FUNC([shout_new], [
+ ifelse([$1], , :, [$1])
+ xt_have_shout="yes"
+ ])
+ AC_CHECK_FUNC([thread_initialize], [SHOUT_THREADED="yes"])
+ ])
+ CPPFLAGS="$ac_save_CPPFLAGS"
+ CFLAGS="$ac_save_CFLAGS"
+ LIBS="$ac_save_LIBS"
+fi
+
+if test "$xt_have_shout" != "yes"
+then
+ ifelse([$2], , :, [$2])
+fi
+])dnl XIPH_PATH_SHOUT
Added: icecast/branches/m4-shout-kh/speex.m4
===================================================================
--- icecast/branches/m4-shout-kh/speex.m4 2004-06-24 18:20:39 UTC (rev 6841)
+++ icecast/branches/m4-shout-kh/speex.m4 2004-06-24 18:21:16 UTC (rev 6842)
@@ -0,0 +1,70 @@
+# Configure paths for libspeex
+# updated by Karl Heyes 02-Feb-2004
+
+dnl XIPH_PATH_SPEEX([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
+dnl Test for libspeex, and define SPEEX_CFLAGS SPEEX_LIBS
+dnl SPEEX_SPEEXENC_LIBS SPEEX_SPEEXFILE_LIBS SPEEX_LDFLAGS
+dnl
+
+AC_DEFUN([XIPH_PATH_SPEEX],
+[
+XIPH_PATH_OGG([$1],[$2])
+
+dnl Get the cflags and libraries for speex
+dnl
+AC_ARG_VAR([SPEEX],[path to speex installation])
+AC_ARG_WITH(speex,
+ AC_HELP_STRING([--with-speex=PREFIX],
+ [Prefix where libspeex is installed (optional)]),
+ speex_prefix="$withval",
+ speex_prefix="$SPEEX_PREFIX"
+ )
+if test "x$speex_prefix" = "x"; then
+ if test "x$prefix" = "xNONE"; then
+ speex_prefix="/usr/local"
+ else
+ speex_prefix="$prefix"
+ fi
+fi
+
+SPEEX_CFLAGS="$OGG_CFLAGS"
+SPEEX_LDFLAGS="$OGG_LDFLAGS"
+if test "x$speex_prefix" != "x$ogg_prefix"; then
+ XIPH_GCC_WARNING(-I"$speex_prefix/include",,
+ [SPEEX_CFLAGS="$SPEEX_CFLAGS -I$speex_prefix/include"
+ SPEEX_LDFLAGS="-L$speex_prefix/lib $SPEEX_LDFLAGS"
+ ])
+fi
+
+SPEEX_LIBS="-lspeex"
+
+ac_save_LIBS="$LIBS"
+ac_save_LDFLAGS="$LDFLAGS"
+LDFLAGS="$LDFLAGS $SPEEX_LDFLAGS"
+LIBS="$LIBS $SPEEX_LIBS"
+xt_have_speex="yes"
+AC_MSG_CHECKING([for libspeex])
+AC_TRY_LINK_FUNC(ogg_stream_init, [AC_MSG_RESULT([ok])],
+ [LIBS="$LIBS $OGG_LIBS"
+ AC_TRY_LINK_FUNC(ogg_stream_init,
+ [SPEEX_LIBS="$SPEEX_LIBS $OGG_LIBS"],
+ [xt_have_speex="no"])
+ ])
+
+LIBS="$ac_save_LIBS"
+LDFLAGS="$ac_save_LDFLAGS"
+
+if test "x$xt_have_speex" = "xyes"
+then
+ AC_MSG_RESULT([ok])
+ AC_DEFINE([HAVE_SPEEX],[1],[Define if Speex support is available])
+else
+ ifelse([$2], , AC_MSG_ERROR([Unable to link to libspeex]), [$2])
+ SPEEX_CFLAGS=""
+ SPEEX_LDFLAGS=""
+ SPEEX_LIBS=""
+fi
+AC_SUBST(SPEEX_CFLAGS)
+AC_SUBST(SPEEX_LDFLAGS)
+AC_SUBST(SPEEX_LIBS)
+])
Added: icecast/branches/m4-shout-kh/theora.m4
===================================================================
--- icecast/branches/m4-shout-kh/theora.m4 2004-06-24 18:20:39 UTC (rev 6841)
+++ icecast/branches/m4-shout-kh/theora.m4 2004-06-24 18:21:16 UTC (rev 6842)
@@ -0,0 +1,71 @@
+# Configure paths for libtheora
+# Jack Moffitt <jack at icecast.org> 10-21-2000
+# updated by Karl Heyes 02-Feb-2004
+
+dnl XIPH_PATH_THEORA([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
+dnl Test for libtheora, and define THEORA_CFLAGS THEORA_LIBS
+dnl THEORA_THEORAENC_LIBS THEORA_THEORAFILE_LIBS THEORA_LDFLAGS
+dnl
+
+AC_DEFUN([XIPH_PATH_THEORA],
+[
+XIPH_PATH_OGG([$1],[$2])
+
+dnl Get the cflags and libraries for theora
+dnl
+AC_ARG_VAR([THEORA],[path to theora installation])
+AC_ARG_WITH(theora,
+ AC_HELP_STRING([--with-theora=PREFIX],
+ [Prefix where libtheora is installed (optional)]),
+ theora_prefix="$withval",
+ theora_prefix="$THEORA_PREFIX"
+ )
+if test "x$theora_prefix" = "x"; then
+ if test "x$prefix" = "xNONE"; then
+ theora_prefix="/usr/local"
+ else
+ theora_prefix="$prefix"
+ fi
+fi
+
+THEORA_CFLAGS="$OGG_CFLAGS"
+THEORA_LDFLAGS="$OGG_LDFLAGS"
+if test "x$theora_prefix" != "x$ogg_prefix"; then
+ XIPH_GCC_WARNING(-I"$theora_prefix/include",,
+ [THEORA_CFLAGS="$THEORA_CFLAGS -I$theora_prefix/include"
+ THEORA_LDFLAGS="-L$theora_prefix/lib $THEORA_LDFLAGS"
+ ])
+fi
+
+THEORA_LIBS="-ltheora"
+
+ac_save_LIBS="$LIBS"
+ac_save_LDFLAGS="$LDFLAGS"
+LDFLAGS="$LDFLAGS $THEORA_LDFLAGS"
+LIBS="$LIBS $THEORA_LIBS"
+xt_have_theora="yes"
+AC_MSG_CHECKING([for libtheora])
+AC_TRY_LINK_FUNC(ogg_stream_init, [AC_MSG_RESULT([ok])],
+ [LIBS="$LIBS $OGG_LIBS"
+ AC_TRY_LINK_FUNC(ogg_stream_init,
+ [THEORA_LIBS="$THEORA_LIBS $OGG_LIBS"],
+ [xt_have_theora="no"])
+ ])
+
+LIBS="$ac_save_LIBS"
+LDFLAGS="$ac_save_LDFLAGS"
+
+if test "x$xt_have_theora" = "xyes"
+then
+ AC_MSG_RESULT([ok])
+ AC_DEFINE([HAVE_THEORA],[1],[Define if Theora support is available])
+else
+ ifelse([$2], , AC_MSG_ERROR([Unable to link to libtheora]), [$2])
+ THEORA_CFLAGS=""
+ THEORA_LDFLAGS=""
+ THEORA_LIBS=""
+fi
+AC_SUBST(THEORA_CFLAGS)
+AC_SUBST(THEORA_LDFLAGS)
+AC_SUBST(THEORA_LIBS)
+])
Added: icecast/branches/m4-shout-kh/vorbis.m4
===================================================================
--- icecast/branches/m4-shout-kh/vorbis.m4 2004-06-24 18:20:39 UTC (rev 6841)
+++ icecast/branches/m4-shout-kh/vorbis.m4 2004-06-24 18:21:16 UTC (rev 6842)
@@ -0,0 +1,82 @@
+# Configure paths for libvorbis
+# Jack Moffitt <jack at icecast.org> 10-21-2000
+# updated by Karl Heyes 31-Mar-2003
+# Shamelessly stolen from Owen Taylor and Manish Singh
+
+dnl XIPH_PATH_VORBIS([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
+dnl Test for libvorbis, and define VORBIS_CFLAGS VORBIS_LIBS
+dnl VORBIS_VORBISENC_LIBS VORBIS_VORBISFILE_LIBS VORBIS_LDFLAGS
+dnl
+
+AC_DEFUN([XIPH_PATH_VORBIS],
+[
+XIPH_PATH_OGG([$1],[$2])
+
+dnl Get the cflags and libraries for vorbis
+dnl
+AC_ARG_VAR([VORBIS_PREFIX],[path to vorbis installation])
+AC_ARG_WITH(vorbis,
+ AC_HELP_STRING([--with-vorbis=PREFIX],
+ [Prefix where libvorbis is installed (optional)]),
+ vorbis_prefix="$withval",
+ vorbis_prefix="$VORBIS_PREFIX"
+ )
+if test "x$vorbis_prefix" = "x"; then
+ if test "x$prefix" = "xNONE"; then
+ vorbis_prefix="/usr/local"
+ else
+ vorbis_prefix="$prefix"
+ fi
+fi
+
+VORBIS_CFLAGS="$OGG_CFLAGS"
+VORBIS_LDFLAGS="$OGG_LDFLAGS"
+if test "x$vorbis_prefix" != "x$ogg_prefix"; then
+ XIPH_GCC_WARNING(-I"$vorbis_prefix/include",,
+ [VORBIS_CFLAGS="$VORBIS_CFLAGS -I$vorbis_prefix/include"
+ VORBIS_LDFLAGS="-L$vorbis_prefix/lib $VORBIS_LDFLAGS"
+ ])
+fi
+
+VORBIS_LIBS="-lvorbis"
+VORBISFILE_LIBS="-lvorbisfile"
+VORBISENC_LIBS="-lvorbisenc"
+
+ac_save_LIBS="$LIBS"
+ac_save_LDFLAGS="$LDFLAGS"
+LDFLAGS="$LDFLAGS $VORBIS_LDFLAGS"
+LIBS="$LIBS $VORBIS_LIBS"
+AC_MSG_CHECKING([for libvorbis])
+AC_TRY_LINK_FUNC(ogg_stream_init, [AC_MSG_RESULT([ok])],
+ [LIBS="$LIBS $OGG_LIBS -lm"
+ AC_TRY_LINK_FUNC(ogg_stream_init,
+ [AC_MSG_RESULT([found, adding extra libs])
+ VORBIS_LIBS="$VORBIS_LIBS $OGG_LIBS -lm"],
+ [ifelse([$2], , AC_MSG_ERROR([Unable to link to libvorbis]), [$2])
+ ])
+ ])
+
+LIBS="$ac_save_LIBS"
+LDFLAGS="$ac_save_LDFLAGS"
+
+#
+# Now check if the installed Vorbis is sufficiently new.
+#
+ac_save_CFLAGS="$CFLAGS"
+ac_save_LIBS="$LIBS"
+CFLAGS="$CFLAGS $VORBIS_CFLAGS"
+LIBS="$LIBS $VORBIS_LDFLAGS $VORBIS_LIBS"
+
+AC_CHECK_TYPES([struct ovectl_ratemanage_arg],[vorbis_ok=yes],
+ [ifelse([$2], ,[AC_MSG_ERROR([libvorbis needs updating])], [$2])], [
+#include <vorbis/codec.h>
+#include <vorbis/vorbisenc.h>
+ ])
+CFLAGS="$ac_save_CFLAGS"
+LIBS="$ac_save_LIBS"
+AC_SUBST(VORBIS_CFLAGS)
+AC_SUBST(VORBIS_LDFLAGS)
+AC_SUBST(VORBIS_LIBS)
+AC_SUBST(VORBISFILE_LIBS)
+AC_SUBST(VORBISENC_LIBS)
+])
Added: icecast/branches/m4-shout-kh/xiph_compiler.m4
===================================================================
--- icecast/branches/m4-shout-kh/xiph_compiler.m4 2004-06-24 18:20:39 UTC (rev 6841)
+++ icecast/branches/m4-shout-kh/xiph_compiler.m4 2004-06-24 18:21:16 UTC (rev 6842)
@@ -0,0 +1,171 @@
+dnl xiph_compiler.m4
+dnl $Id: xiph_compiler.m4,v 1.4 2003/06/26 16:03:37 brendan Exp $
+
+dnl XIPH_FUNC_VA_COPY
+dnl Karl Heyes
+dnl
+# XIPH_FUNC_VA_COPY
+# Test for implementation of va_copy, or define appropriately if missing
+AC_DEFUN([XIPH_FUNC_VA_COPY],
+[dnl
+AC_MSG_CHECKING([for va_copy])
+AC_TRY_LINK([#include <stdarg.h>], [va_list ap1, ap2; va_copy(ap1, ap2);],
+ AC_MSG_RESULT([va_copy]),
+ [dnl
+ AH_TEMPLATE([va_copy], [define if va_copy is not available])
+ AC_TRY_LINK([#include <stdarg.h>], [va_list ap1, ap2; __va_copy(ap1, ap2);],
+ [dnl
+ AC_DEFINE([va_copy], [__va_copy])
+ AC_MSG_RESULT([__va_copy])],
+ [dnl
+ AC_DEFINE([va_copy(dest,src)], [memcpy(&dest,&src,sizeof(va_list))])
+ AC_MSG_RESULT([memcpy])
+ ])
+ ])
+])
+])dnl XIPH_FUNC_VA_COPY
+
+dnl XIPH_C_ATTRIBUTE
+dnl Karl Heyes
+dnl
+# XIPH_C_ATTRIBUTE
+# Define __attribute__ to be empty if the compiler does not support it
+AC_DEFUN([XIPH_C_ATTRIBUTE],
+[dnl
+# check for __attribute__
+AC_TRY_COMPILE([int func(void) __attribute__((unused));],[int x __attribute__ ((unused));],,
+??? [ AH_TEMPLATE([__attribute__], [Compile away if __attribute__ keyword is not supported])
+??? AC_DEFINE([__attribute__(x)],[/**/])
+??? ])
+])
+])dnl XIPH_C_ATTRIBUTE
+
+
+dnl XIPH_GCC_WARNING
+dnl Karl Heyes
+dnl
+# XIPH_GCC_WARNING(flag, action-if-warning, action-if-not)
+# Tests whether GCC emits a warning if explicitly asked to use flag.
+# Useful for eg system default include paths
+AC_DEFUN([XIPH_GCC_WARNING],
+[AC_REQUIRE([AC_PROG_CC])
+xt_warning=no
+if test x"$GCC" = "xyes"
+then
+ save_cflags="$CFLAGS"
+ CFLAGS="-Werror $1"
+ AC_TRY_COMPILE(,,,xt_warning=yes)
+ CFLAGS="$save_cflags"
+fi
+if test "$xt_warning" = "yes"
+then
+ ifelse([$2],,:,[$2])
+else
+ ifelse([$3],,:,[$3])
+fi
+])dnl XIPH_GCC_WARNING
+
+dnl XIPH_CLEAN_CCFLAGS
+dnl Brendan Cully <brendan at xiph.org> 20030612
+dnl
+# XIPH_CLEAN_CCFLAGS(flag-list, dest-shell-var-name)
+# Filters out duplicate compiler flags, and -I flags if XIPH_GCC_WARNING
+# complains about them
+# Operates right-to-left on -l flags, left-to-right on everything else
+# eg XIPH_CLEAN_CCFLAGS([-L/opt/lib -lfoo -lm -L/opt/lib -lbar -lm], [MY_LDFLAGS])
+# => MY_LDFLAGS="-L/opt/lib -lfoo -lbar -lm"
+# the cat<<EOF construct makes sure echo doesn't pick, say, -n
+AC_DEFUN([XIPH_CLEAN_CCFLAGS],
+[AC_REQUIRE([AC_PROG_FGREP])
+xt_FLAGS=''
+
+for flag in $1
+do
+ case "$flag" in
+ -l*)
+ xt_FLAGS="$flag $xt_FLAGS"
+ ;;
+ *)
+ if { cat <<EOF
+ $xt_FLAGS x
+EOF
+} | $FGREP -v -e " $flag " > /dev/null
+ then
+ xt_FLAGS="$flag $xt_FLAGS"
+ fi
+ ;;
+ esac
+done
+
+$2=''
+for flag in $xt_FLAGS
+do
+ if { cat <<EOF
+ $$2 x
+EOF
+} | $FGREP -v -e " $flag " > /dev/null
+ then
+ $2="$flag $$2"
+ fi
+done
+
+# Prune -I flags if $CC warns about them
+xt_FLAGS=''
+for flag in $$2
+do
+ case "$flag" in
+ -I*)
+ XIPH_GCC_WARNING([$flag], [], [xt_FLAGS="$xt_FLAGS $flag"])
+ ;;
+ *)
+ xt_FLAGS="$xt_FLAGS $flag"
+ ;;
+ esac
+done
+$2="$xt_FLAGS"
+])dnl XIPH_CLEAN_CCFLAGS
+
+dnl XIPH_VAR_APPEND
+dnl Karl Heyes
+dnl
+# XIPH_VAR_APPEND(shell-var, list)
+# Append each item in list to shell-var iff shell-var doesn't already have it
+# eg XIPH_VAR_APPEND([CFLAGS], [-O2 -I/opt/packages/include])
+AC_DEFUN([XIPH_VAR_APPEND],
+[dnl
+AC_REQUIRE([AC_PROG_FGREP])
+for arg in $2
+do
+ if { cat <<EOF
+ $$1 x
+EOF
+} | $FGREP -v -e " $arg " > /dev/null
+ then
+ $1="$$1 $arg"
+ fi
+done
+])dnl XIPH_VAR_APPEND
+
+dnl XIPH_VAR_PREPEND
+dnl Karl Heyes
+dnl
+# XIPH_VAR_PREPEND(shell-var, list)
+# see XIPH_VAR_APPEND
+AC_DEFUN([XIPH_VAR_PREPEND],
+[dnl
+AC_REQUIRE([AC_PROG_FGREP])
+xt_compare="$$1"
+xt_filtered=""
+for arg in $2
+do
+ if { cat <<EOF
+ $xt_compare x
+EOF
+} | $FGREP -v -e " $arg " > /dev/null
+ then
+ xt_compare="$arg $xt_compare"
+ xt_filtered="$xt_filtered $arg"
+ fi
+done
+$1="$xt_filtered $$1"
+])dnl XIPH_VAR_PREPEND
Added: icecast/branches/m4-shout-kh/xiph_net.m4
===================================================================
--- icecast/branches/m4-shout-kh/xiph_net.m4 2004-06-24 18:20:39 UTC (rev 6841)
+++ icecast/branches/m4-shout-kh/xiph_net.m4 2004-06-24 18:21:16 UTC (rev 6842)
@@ -0,0 +1,26 @@
+# XIPH_NET
+# Perform tests required by the net module
+AC_DEFUN([XIPH_NET],
+[dnl
+AC_REQUIRE([XIPH_TYPE_SOCKLEN_T])
+AC_REQUIRE([XIPH_FUNC_VA_COPY])
+AC_CHECK_HEADERS([sys/select.h sys/uio.h])
+AC_CHECK_HEADER([winsock2.h],
+ [AC_DEFINE([HAVE_WINSOCK2_H], [1], [Define if you have winsock2.h on MINGW])
+ LIBS="$LIBS -lwsock32"])
+
+# These tests are ordered based on solaris 8 tests
+AC_SEARCH_LIBS([sethostent], [nsl],
+ [AC_DEFINE([HAVE_SETHOSTENT], [1],
+ [Define if you have the sethostent function])])
+AC_SEARCH_LIBS([getnameinfo], [socket],
+ [AC_DEFINE([HAVE_GETNAMEINFO], [1],
+ [Define if you have the getnameinfo function])])
+AC_CHECK_FUNCS([endhostent getaddrinfo inet_aton writev])
+
+# Irix defines INET_PTON but not sockaddr_storage!
+AC_CHECK_MEMBERS([struct sockaddr_storage.ss_family],
+ [AC_CHECK_FUNCS([inet_pton])],,
+ [#include <sys/types.h>
+#include <sys/socket.h>])
+])
Added: icecast/branches/m4-shout-kh/xiph_path_python.m4
===================================================================
--- icecast/branches/m4-shout-kh/xiph_path_python.m4 2004-06-24 18:20:39 UTC (rev 6841)
+++ icecast/branches/m4-shout-kh/xiph_path_python.m4 2004-06-24 18:21:16 UTC (rev 6842)
@@ -0,0 +1,73 @@
+dnl local M4 configure macros
+dnl Brendan Cully <brendan at xiph.org>
+dnl $Id: xiph_path_python.m4,v 1.1 2003/06/13 19:22:16 brendan Exp $
+
+# XIPH_PATH_PYTHON(PATH)
+# Search for python in PATH, or in the path if none is given.
+# Defines PYTHON_CPPFLAGS and PYTHON_LIBS if found
+AC_DEFUN([XIPH_PATH_PYTHON],
+ [
+m4_pushdef([xpp_path], [$1])
+
+PYTHON="no"
+
+if test "xpp_path" != "yes"
+then
+ AC_MSG_CHECKING([python])
+ if test -x "xpp_path"
+ then
+ PYTHON="xpp_path"
+ fi
+ AC_MSG_RESULT([$PYTHON])
+else
+ AC_PATH_PROGS([PYTHON], [python python2 python2.3 python2.2])
+fi
+
+m4_popdef([xpp_path])
+
+if test "$PYTHON" != "no"
+then
+ # The library we're linking against
+ PYTHON_LIB="_XIPH_PYTHON_CFG([$PYTHON], [LIBRARY])"
+
+ # if LIBRARY is nonsensical, bail out
+ if test $? -ne 0 -o -z "$PYTHON_LIB"
+ then
+ AC_MSG_WARN([Could not find library for $PYTHON])
+ break
+ fi
+ # make library linker friendly. This is a hack, but I don't know what's better
+ PYTHON_LIB=`echo "$PYTHON_LIB" | sed 's/lib//;s/\.a.*//;s/\.so.*//;s/\.dylib.*//'`
+
+ # LDFLAGS
+ PYTHON_LDFLAGS="-L[]_XIPH_PYTHON_CFG([$PYTHON], [LIBPL])"
+
+ # Extra libraries required by python
+ PYTHON_EXTRA_LIBS="_XIPH_PYTHON_CFG([$PYTHON], [LIBS])"
+ PYTHON_EXTRA_LIBS="$PYTHON_EXTRA_LIBS _XIPH_PYTHON_CFG([$PYTHON], [SYSLIBS])"
+ PYTHON_EXTRA_LIBS="$PYTHON_EXTRA_LIBS _XIPH_PYTHON_CFG([$PYTHON], [SHLIBS])"
+
+ PYTHON_CPPFLAGS="-I[]_XIPH_PYTHON_CFG([$PYTHON], [INCLUDEPY])"
+
+ # test header and library functionality
+ saved_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $PYTHON_CPPFLAGS"
+ AC_CHECK_HEADER([Python.h],
+ [
+ saved_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $PYTHON_LDFLAGS"
+ AC_CHECK_LIB([$PYTHON_LIB], [Py_Initialize],
+ [PYTHON_LIBS="-l$PYTHON_LIB $PYTHON_EXTRA_LIBS"],
+ [AC_MSG_WARN([Could not link to the python library])],
+ [$PYTHON_EXTRA_LIBS])
+ LDFLAGS="$saved_LDFLAGS"
+ ],
+ [AC_MSG_WARN([Python.h doesn't appear to be usable])])
+ CPPFLAGS="$saved_CPPFLAGS"
+fi
+ ])dnl
+
+# _XIPH_PYTHON_CFG(PYTHONPATH, CFGVAR)
+# Ask python in PYTHONPATH for the definition of CFGVAR
+m4_define([_XIPH_PYTHON_CFG],
+ [`$1 -c 'from distutils.sysconfig import get_config_var; print get_config_var("$2")' | sed 's/None//'`])
Added: icecast/branches/m4-shout-kh/xiph_types.m4
===================================================================
--- icecast/branches/m4-shout-kh/xiph_types.m4 2004-06-24 18:20:39 UTC (rev 6841)
+++ icecast/branches/m4-shout-kh/xiph_types.m4 2004-06-24 18:21:16 UTC (rev 6842)
@@ -0,0 +1,61 @@
+dnl xiph_types.m4
+dnl macros for type checks not covered by autoconf
+
+dnl XIPH_C99_INTTYPES
+dnl Brendan Cully
+dnl
+# XIPH_C99_INTTYPES
+# Check for C99 integer type definitions, or define if missing
+AC_DEFUN([XIPH_C99_INTTYPES],
+[dnl
+AC_CHECK_HEADERS([inttypes.h])
+AC_CHECK_TYPE([uint32_t],
+ [AC_DEFINE(HAVE_C99_INTTYPES, 1, [Define if you have the C99 integer types])],
+ [AC_CHECK_SIZEOF(short)
+ AC_CHECK_SIZEOF(int)
+ AC_CHECK_SIZEOF(long)
+ AC_CHECK_SIZEOF(long long)])
+AH_VERBATIM([X_HAVE_C99_INTTYPES],
+ [#ifndef HAVE_C99_INTTYPES
+# if SIZEOF_SHORT == 4
+typedef unsigned short uint32_t;
+# elif SIZEOF_INT == 4
+typedef unsigned int uint32_t;
+# elif SIZEOF_LONG == 4
+typedef unsigned long uint32_t;
+# endif
+# if SIZEOF_INT == 8
+typedef unsigned int uint64_t;
+# elif SIZEOF_LONG == 8
+typedef unsigned long uint64_t;
+# elif SIZEOF_LONG_LONG == 8
+typedef unsigned long long uint64_t;
+# endif
+#endif
+ ])
+])
+
+dnl XIPH_TYPE_SOCKLEN_T
+dnl Karl Heyes
+dnl
+# XIPH_TYPE_SOCKLEN_T
+# Check for socklen_t, or define as int if missing
+AC_DEFUN([XIPH_TYPE_SOCKLEN_T],
+[dnl
+AC_CHECK_HEADERS([sys/socket.h])
+AH_VERBATIM([HAVE_SOCKLEN_T],
+[/* define if you have the socklen_t type */
+#undef HAVE_SOCKLEN_T
+
+#ifndef HAVE_SOCKLEN_T
+ typedef int socklen_t;
+ #define HAVE_SOCKLEN_T
+#endif])
+AC_TRY_COMPILE([
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+# include <sys/socket.h>
+#endif], [socklen_t s = 0;], [AC_DEFINE([HAVE_SOCKLEN_T])])
+])
More information about the commits
mailing list