[xiph-cvs] cvs commit: icecast/src Makefile.am config.h config.c

Karl Heyes karl at xiph.org
Sun Jul 20 19:23:41 PDT 2003



karl        03/07/20 22:23:41

  Modified:    .        autogen.sh configure.in Makefile.am
               src      Makefile.am
  Removed:     .        acconfig.h acinclude.m4
               src      config.h config.c
  Log:
  Make icecast use the shared M4 macros. Cleanup the other files.

Revision  Changes    Path
1.3       +65 -18    icecast/autogen.sh

Index: autogen.sh
===================================================================
RCS file: /usr/local/cvsroot/icecast/autogen.sh,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- autogen.sh	11 Jul 2002 03:54:11 -0000	1.2
+++ autogen.sh	21 Jul 2003 02:23:41 -0000	1.3
@@ -18,20 +18,59 @@
         echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
         DIE=1
 }
-
-(automake --version) < /dev/null > /dev/null 2>&1 || {
+VERSIONGREP="sed -e s/.*[^0-9\.]\([0-9]\.[0-9]\).*/\1/"
+                                                                                
+# do we need automake?
+if test -r Makefile.am; then
+  options=`fgrep AUTOMAKE_OPTIONS Makefile.am`
+  AM_NEEDED=`echo "$options" | $VERSIONGREP`
+  if test -z "$AM_NEEDED" || test "x$AM_NEEDED" = "x$options"; then
+    echo -n "checking for automake..."
+    AUTOMAKE=automake
+    ACLOCAL=aclocal
+    if ($AUTOMAKE --version < /dev/null > /dev/null 2>&1); then
+      echo "yes"
+    else
+      echo "no"
+      AUTOMAKE=""
+    fi
+  else
+    echo -n "checking for automake $AM_NEEDED or later..."
+    for am in automake-$AM_NEEDED automake$AM_NEEDED automake; do
+      ($am --version < /dev/null > /dev/null 2>&1) || continue
+      ver=`$am --version < /dev/null | head -1 | $VERSIONGREP`
+      if test $ver = $AM_NEEDED; then
+        AUTOMAKE=$am
+        echo $AUTOMAKE
+        break
+      fi
+    done
+    test -z $AUTOMAKE &&  echo "no"
+    echo -n "checking for aclocal $AM_NEEDED or later..."
+    for ac in aclocal-$AM_NEEDED aclocal$AM_NEEDED aclocal; do
+      ($ac --version < /dev/null > /dev/null 2>&1) || continue
+      ver=`$ac --version < /dev/null | head -1 | $VERSIONGREP`
+      if test $ver = $AM_NEEDED; then
+        ACLOCAL=$ac
+        echo $ACLOCAL
+        break
+      fi
+    done
+    test -z $ACLOCAL && echo "no"
+  fi
+  test -z $AUTOMAKE || test -z $ACLOCAL && {
         echo
         echo "You must have automake installed to compile $package."
-	echo "Download the appropriate package for your system,
-	echo "or get the source from one of the GNU ftp sites"
-	echo "listed in http://www.gnu.org/order/ftp.html"
+        echo "Download the appropriate package for your distribution,"
+        echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
         DIE=1
-}
+  }
+fi
 
-(libtool --version) < /dev/null > /dev/null 2>&1 || {
+(libtoolize --version) < /dev/null > /dev/null 2>&1 || {
         echo
         echo "You must have libtool installed to compile $package."
-	echo "Download the appropriate package for your system,
+	echo "Download the appropriate package for your system,"
         echo "or get the source from one of the GNU ftp sites"
         echo "listed in http://www.gnu.org/order/ftp.html"
         DIE=1
@@ -41,23 +80,31 @@
         exit 1
 fi
 
-if test -z "$*"; then
-        echo "I am going to run ./configure with no arguments - if you wish "
-        echo "to pass any to it, please specify them on the $0 command line."
+echo "Generating configuration files for $package, please wait...."
+
+ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I m4"
+if ! test -z $ACLOCAL; then
+  echo "  $ACLOCAL $ACLOCAL_FLAGS"
+  $ACLOCAL $ACLOCAL_FLAGS
 fi
 
-echo "Generating configuration files for $package, please wait...."
+echo "  autoheader"
+autoheader
 
-echo "  aclocal $ACLOCAL_FLAGS"
-aclocal $ACLOCAL_FLAGS
-#echo "  autoheader"
-#autoheader
 echo "  libtoolize --automake"
 libtoolize --automake
-echo "  automake --add-missing"
-automake --add-missing 
+
+if ! test -z $AUTOMAKE; then
+  echo "  $AUTOMAKE --add-missing"
+  $AUTOMAKE --add-missing 
+fi
+
 echo "  autoconf"
 autoconf
 
+if test -z "$*"; then
+        echo "I am going to run ./configure with no arguments - if you wish "
+        echo "to pass any to it, please specify them on the $0 command line."
+fi
 cd $olddir
 $srcdir/configure "$@" && echo

<p><p>1.35      +58 -139   icecast/configure.in

Index: configure.in
===================================================================
RCS file: /usr/local/cvsroot/icecast/configure.in,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- configure.in	6 Jun 2003 00:05:18 -0000	1.34
+++ configure.in	21 Jul 2003 02:23:41 -0000	1.35
@@ -1,8 +1,9 @@
-dnl Process this file with autoconf to produce a configure script.
 AC_INIT(src/main.c)
 AC_PREREQ(2.50)
+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
@@ -10,182 +11,103 @@
 
 dnl Set some options based on environment
 
-SOCKET_LIBS=
-
-case "$ac_cv_host" in
+case "$host" in
     *openbsd*)
     ;;
-    *) AC_DEFINE(_XOPEN_SOURCE, 500, [Define if you have POSIX and XPG specifications])
+    *) AC_DEFINE(_XOPEN_SOURCE, 600, [Define if you have POSIX and XPG specifications])
     ;;
 esac
 if test -z "$GCC"; then
-        case $host in 
+    case $host in 
         *-*-irix*)
                 DEBUG="-g -signed -D_REENTRANT" 
-                CFLAGS="-O2 -w -signed -D_REENTRANT"
+                XIPH_CFLAGS="-O2 -w -signed -D_REENTRANT"
                 PROFILE="-p -g3 -O2 -signed -D_REENTRANT"
-		;;
+                ;;
         *-*-solaris*)
                 DEBUG="-v -g -D_REENTRANT"
-                CFLAGS="-xO4 -fast -w -fsimple -native -xcg92 -D_REENTRANT"
+                XIPH_CFLAGS="-xO4 -fast -w -fsimple -native -xcg92 -D_REENTRANT"
                 PROFILE="-v -xpg -g -xO4 -fast -native -fsimple -xcg92 -Dsuncc -D_REENTRANT"
-                SOCKET_LIBS="-lnsl -lsocket -lresolv"
-		;;
+                ;;
         *)
                 DEBUG="-g -D_REENTRANT"
-                CFLAGS="-O -D_REENTRANT"
+                XIPH_CFLAGS="-O -D_REENTRANT"
                 PROFILE="-g -p -D_REENTRANT"
-		;;
-        esac
+                ;;
+    esac
 else
-        case $host in 
+    case $host in 
         *-*-linux*)
-                DEBUG="-g -Wall -fsigned-char -D_REENTRANT -D_GNU_SOURCE"
-                CFLAGS="-O20 -ffast-math -fsigned-char -D_REENTRANT -D_GNU_SOURCE"
-                PROFILE="-Wall -W -pg -g -O20 -ffast-math -fsigned-char -D_REENTRANT -D_GNU_SOURCE"
-		;;
+                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*)
-                DEBUG="-g -Wall -fsigned-char -mv8 -D_REENTRANT"
-                CFLAGS="-O20 -ffast-math -fsigned-char -mv8 -D_REENTRANT"
-                PROFILE="-pg -g -O20 -fsigned-char -mv8 -D_REENTRANT" 
-                SOCKET_LIBS="-lnsl -lsocket -lresolv"
-		;;
-	    *-pc-solaris*)
-                DEBUG="-g -Wall -fsigned-char -D_REENTRANT"
-                CFLAGS="-O20 -ffast-math -fsigned-char -D_REENTRANT"
-                PROFILE="-pg -g -O20 -fsigned-char -D_REENTRANT" 
-                SOCKET_LIBS="-lnsl -lsocket -lresolv"
-		;;
+                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"
-                CFLAGS="-O20 -fsigned-char"
-                PROFILE="-O20 -g -pg -fsigned-char" 
-                ogg_prefix="/usr/local"
-                vorbis_prefix="/usr/local"
-		;;
+                XIPH_CPPFLAGS="-fsigned-char"
+                PROFILE="-g -pg -fsigned-char" 
+                ;;
         *)
                 DEBUG="-g -Wall -fsigned-char"
-                CFLAGS="-O20 -Wall -fsigned-char"
-                PROFILE="-O20 -g -pg -Wall -fsigned-char" 
-		;;
-        esac
+                XIPH_CPPFLAGS="-Wall -fsigned-char"
+                PROFILE="-g -pg -Wall -fsigned-char" 
+                ;;
+    esac
 fi
 
 dnl Checks for programs.
 
 dnl Checks for libraries.
 
-dnl IPV6
-AC_SEARCH_LIBS(inet_pton, socket, 
-  [AC_DEFINE([HAVE_INET_PTON], 1, [Define if you have the `inet_pton' function])])
-AC_SEARCH_LIBS(getipnodebyname, nsl,
-  [AC_DEFINE([HAVE_GETIPNODEBYNAME], 1,
-    [Define if you have the `getipnodebyname' function])])
-
 dnl Checks for header files.
 AC_HEADER_STDC
 
-AC_CHECK_HEADER(stdint.h, AC_DEFINE(HAVE_STDINT_H, 1, [Define if you have stdint.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]),,)
-AC_CHECK_HEADER(sys/uio.h, AC_DEFINE(HAVE_SYS_UIO_H, 1, [Define if you have sys/uio.h]),,)
 
 dnl Checks for typedefs, structures, and compiler characteristics.
-AC_C_CONST
-AC_MSG_CHECKING([how to copy va_list])
-    AC_TRY_LINK([#include <stdarg.h>], [va_list ap1, ap2; va_copy(ap1, ap2);],
-            AC_MSG_RESULT([va_copy]),
-            [ 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);],
-                [ AC_DEFINE([va_copy], [__va_copy])
-                AC_MSG_RESULT([__va_copy])],
-                [ AC_DEFINE([va_copy(dest,src)], [memcpy(&dest,&src,sizeof(va_list))])
-                AC_MSG_RESULT([memcpy])]
-                )
-            ])
 
 dnl Check for types
-AC_CHECK_TYPE([socklen_t], int)
 
 dnl Checks for library functions.
-AC_CHECK_FUNCS(nanosleep)
-AC_CHECK_FUNCS(poll)
-AC_CHECK_FUNCS(sethostent endhostent)
-AC_CHECK_FUNCS(getnameinfo getaddrinfo inet_aton)
+AC_CHECK_FUNCS(nanosleep poll)
+XIPH_NET
 
 dnl -- configure options --
 
-AC_ARG_WITH(xslt-config,
-  [  --with-xslt-config=PATH  use xslt-config in PATH to find libxslt ],
-  [if ! test -x "$with_xslt_config"
-   then
-     AC_MSG_ERROR([$with_xslt_config cannot be executed])
-   fi
-   XSLTCONFIG="$with_xslt_config"]
-)
-if test -z "$XSLTCONFIG"
-then
-  AC_CHECK_PROGS(XSLTCONFIG, [xslt-config])
-fi
-if test -n "$XSLTCONFIG"
-then
-  XSLT_LIBS="`$XSLTCONFIG --libs`"
-  XSLT_CFLAGS="`$XSLTCONFIG --cflags`"
-  save_LIBS="$LIBS"
-  save_CFLAGS="$CFLAGS"
-  LIBS="$LIBS $XSLT_LIBS"
-  CFLAGS="$CFLAGS $XSLT_CFLAGS"
-  AC_CHECK_FUNC(xsltParseStylesheetFile,, [AC_MSG_ERROR([There was a problem linking with libxslt])])
-  LIBS="$save_LIBS"
-  CFLAGS="$save_CFLAGS"
-  save_LIBS=
-  save_CFLAGS=
-else
-  AC_MSG_ERROR([xslt-config could not be found])
-fi
-
-AC_ARG_WITH(xml-config,
-  [  --with-xml-config=PATH  use xml-config in PATH to find libxml ],
-  [if ! test -x "$with_xml_config"
-   then
-     AC_MSG_ERROR([$with_xml_config cannot be executed])
-   fi
-   XMLCONFIG="$with_xml_config"]
-)
-if test -z "$XMLCONFIG"
-then
-  AC_CHECK_PROGS(XMLCONFIG, [xml2-config xml-config])
-fi
-if test -n "$XMLCONFIG"
-then
-  XML_LIBS="`$XMLCONFIG --libs`"
-  XML_CFLAGS="`$XMLCONFIG --cflags`"
-  save_LIBS="$LIBS"
-  save_CFLAGS="$CFLAGS"
-  LIBS="$LIBS $XML_LIBS"
-  CFLAGS="$CFLAGS $XML_CFLAGS"
-  AC_CHECK_FUNC(xmlParseFile,, [AC_MSG_ERROR([There was a problem linking with libxml])])
-  LIBS="$save_LIBS"
-  CFLAGS="$save_CFLAGS"
-  save_LIBS=
-  save_CFLAGS=
-else
-  AC_MSG_ERROR([xml-config could not be found])
-fi
+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])
 
-AM_PATH_OGG(, AC_MSG_ERROR(must have Ogg installed!(Perhaps you need --with-ogg-prefix=/usr/local)))
-AM_PATH_VORBIS(, AC_MSG_ERROR(must have Vorbis installed!(Perhaps you need --with-vorbis-prefix=/usr/local)))
 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],
-  [  --disable-yp          disable YP directory support])
+        AC_HELP_STRING([--disable-yp],[disable YP directory support]))
 if test "x$enable_yp" != "xno"
 then
-AM_PATH_CURL([
+XIPH_PATH_CURL([
   AC_CHECK_DECL([CURLOPT_NOSIGNAL], [
     AC_DEFINE([USE_YP], 1, [Define to compile in YP support code])
-    ICECAST_OBJECTS="$ICECAST_OBJECTS geturl.o yp.o"
+    ICECAST_OPTIONAL="$ICECAST_OPTIONAL geturl.o yp.o"
     ], [
     if test "x$enable_yp" != "xyes"
     then
@@ -203,25 +125,22 @@
   fi
   ])
 fi
+XIPH_VAR_APPEND([XIPH_CFLAGS],[$CURL_CFLAGS])
+XIPH_VAR_PREPEND([XIPH_LIBS],[$CURL_LIBS])
 
 dnl Make substitutions
 
-AC_SUBST(XSLT_CFLAGS)
-AC_SUBST(XML_CFLAGS)
-AC_SUBST(OGG_CFLAGS)
-AC_SUBST(VORBIS_CFLAGS)
-AC_SUBST(XSLT_LIBS)
-AC_SUBST(XML_LIBS)
-AC_SUBST(OGG_LIBS)
-AC_SUBST(VORBIS_LIBS)
-AC_SUBST(SOCKET_LIBS)
+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(OPT)
 AC_SUBST(LIBS)
 AC_SUBST(DEBUG)
 AC_SUBST(CFLAGS)
 AC_SUBST(PROFILE)
-AC_SUBST(XIPH_CFLAGS)
-AC_SUBST(ICECAST_OBJECTS)
+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)

<p><p>1.7       +6 -4      icecast/Makefile.am

Index: Makefile.am
===================================================================
RCS file: /usr/local/cvsroot/icecast/Makefile.am,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- Makefile.am	17 Jun 2003 21:10:55 -0000	1.6
+++ Makefile.am	21 Jul 2003 02:23:41 -0000	1.7
@@ -1,16 +1,18 @@
 ## Process this file with automake to produce Makefile.in
 
-AUTOMAKE_OPTIONS = foreign dist-zip
+AUTOMAKE_OPTIONS = 1.6 foreign dist-zip
 
 SUBDIRS = src conf doc web admin win32
 
-EXTRA_DIST = HACKING
+EXTRA_DIST = HACKING m4/acx_pthread.m4 m4/ogg.m4 m4/vorbis.m4 \
+    m4/xiph_compiler.m4 m4/xiph_curl.m4 m4/xiph_net.m4 \
+    m4/xiph_types.m4 m4/xiph_xml2.m4
 
 docdir = $(datadir)/doc/$(PACKAGE)
 doc_DATA = README AUTHORS COPYING NEWS TODO
 
 debug:
-	$(MAKE) all CFLAGS="@DEBUG@ @XML_CFLAGS@ @OGG_CFLAGS@ @VORBIS_CFLAGS@"
+	$(MAKE) all CFLAGS="@DEBUG@"
 
 profile:
-	$(MAKE) all CFLAGS="@PROFILE@ @XML_CFLAGS@ @OGG_CFLAGS@ @VORBIS_CFLAGS@"
+	$(MAKE) all CFLAGS="@PROFILE@"

<p><p>1.18      +12 -9     icecast/src/Makefile.am

Index: Makefile.am
===================================================================
RCS file: /usr/local/cvsroot/icecast/src/Makefile.am,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- Makefile.am	16 Jul 2003 19:41:59 -0000	1.17
+++ Makefile.am	21 Jul 2003 02:23:41 -0000	1.18
@@ -6,24 +6,27 @@
 
 bin_PROGRAMS = icecast
 
-noinst_HEADERS = admin.h config.h os.h logging.h sighandler.h connection.h global.h\
+noinst_HEADERS = admin.h cfgfile.h os.h logging.h sighandler.h connection.h global.h\
          util.h slave.h source.h stats.h refbuf.h client.h format.h format_vorbis.h\
          compat.h format_mp3.h fserve.h xslt.h geturl.h yp.h event.h
-icecast_SOURCES = config.c main.c logging.c sighandler.c connection.c global.c\
+icecast_SOURCES = cfgfile.c main.c logging.c sighandler.c connection.c global.c\
          util.c slave.c source.c stats.c refbuf.c client.c format.c format_vorbis.c\
          format_mp3.c xslt.c fserve.c event.c admin.c
 EXTRA_icecast_SOURCES = geturl.c yp.c
     
-icecast_LDADD = $(ICECAST_OBJECTS) net/libicenet.la thread/libicethread.la httpp/libicehttpp.la\
-		log/libicelog.la avl/libiceavl.la timing/libicetiming.la
-icecast_DEPENDENCIES = $(icecast_LDADD)
+icecast_LDADD = @ICECAST_OPTIONAL@ net/libicenet.la thread/libicethread.la \
+    httpp/libicehttpp.la log/libicelog.la avl/libiceavl.la \
+    timing/libicetiming.la @XIPH_LIBS@
+
+icecast_DEPENDENCIES = @ICECAST_OPTIONAL@
+
+AM_CFLAGS = @XIPH_CFLAGS@
+AM_CPPFLAGS = @XIPH_CPPFLAGS@
 
-LIBS = @LIBS@ @XSLT_LIBS@ @SOCKET_LIBS@ @XML_LIBS@ @OGG_LIBS@ @VORBIS_LIBS@ @CURL_LIBS@ @PTHREAD_LIBS@
-CFLAGS = -g @CFLAGS@ @XML_CFLAGS@ @XSLT_CFLAGS@ @OGG_CFLAGS@ @VORBIS_CFLAGS@ @CURL_CFLAGS@ @PTHREAD_CFLAGS@
 
 debug:
-	$(MAKE) all CFLAGS="@DEBUG@ @XML_CFLAGS@ @OGG_CFLAGS@ @VORBIS_CFLAGS@"
+	$(MAKE) all CFLAGS="@DEBUG@"
 
 profile:
-	$(MAKE) all CFLAGS="@PROFILE@ @XML_CFLAGS@ @OGG_CFLAGS@ @VORBIS_CFLAGS@"
+	$(MAKE) all CFLAGS="@PROFILE@"
 

<p><p>--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list