[xiph-cvs] cvs commit: ices/m4 ogg.m4 vorbis.m4 shout.m4

Karl Heyes karl at xiph.org
Mon Mar 31 12:58:09 PST 2003



karl        03/03/31 15:58:09

  Modified:    .        Makefile.am configure.in
               m4       ogg.m4 vorbis.m4 shout.m4
  Log:
  hopefully last lot of autotool changes for a while (yipee!), this cleans
  up the macros a bit more, the --with-* are shorter and in line with
  libshout, variables can be passed via commandline or environment and
  shout-config is used by default.

Revision  Changes    Path
1.7       +1 -1      ices/Makefile.am

Index: Makefile.am
===================================================================
RCS file: /usr/local/cvsroot/ices/Makefile.am,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- Makefile.am	29 Mar 2003 14:31:13 -0000	1.6
+++ Makefile.am	31 Mar 2003 20:58:08 -0000	1.7
@@ -1,6 +1,6 @@
 ## Process this file with automake to produce Makefile.in
 
-AUTOMAKE_OPTIONS = foreign dist-zip
+AUTOMAKE_OPTIONS = foreign dist-zip dist-bzip2
 ACLOCAL_AMFLAGS = -I m4
 
 SUBDIRS = src conf

<p><p>1.22      +24 -31    ices/configure.in

Index: configure.in
===================================================================
RCS file: /usr/local/cvsroot/ices/configure.in,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- configure.in	26 Mar 2003 22:40:10 -0000	1.21
+++ configure.in	31 Mar 2003 20:58:08 -0000	1.22
@@ -3,8 +3,9 @@
 AC_PREREQ(2.52)
 AC_CONFIG_SRCDIR(src/ices.c)
 
-AM_INIT_AUTOMAKE(dist-bzip2)
+AM_INIT_AUTOMAKE
 AM_CONFIG_HEADER(config.h)
+AM_MAINTAINER_MODE
 
 AC_PROG_CC
 AM_PROG_LIBTOOL
@@ -63,8 +64,8 @@
 dnl Check for Sun audio
 
 AC_ARG_ENABLE(sun-audio,
-    AC_HELP_STRING([--enable-sun-audio],
-                   [Enable sun audio input (default autodetect)]),
+    AC_HELP_STRING([--disable-sun-audio],
+                   [Disable sun audio input (default autodetect)]),
     enable_sun="$enableval",
     enable_sun=yes
 )
@@ -119,57 +120,49 @@
 
 dnl -- configure options --
 
+dnl deal with xml-config
+AC_MSG_RESULT([checking for XML configuration])
+AC_ARG_VAR([XMLCONFIG],[XML configuration program])
 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"]
+    [AC_HELP_STRING([--with-xml-config=PATH],
+                    [use xml-config in PATH to find libxml])],
+    [XMLCONFIG="$withval"],
+    [AC_PATH_PROGS(XMLCONFIG, [xml2-config 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`"
-  LIBS="$XML_LIBS $LIBS"
-  XIPH_CFLAGS="$XIPH_CFLAGS $XML_CFLAGS"
-  AC_CHECK_FUNC(xmlParseFile,, [AC_MSG_ERROR([There was a problem linking with libxml])])
-else
-  AC_MSG_ERROR([xml-config could not be found])
+if test "x$XMLCONFIG" = "x"; then
+    AC_MSG_ERROR([XML configuration could not be found])
+fi
+if ! test -x "$XMLCONFIG"; then
+    AC_MSG_ERROR([$XMLCONFIG cannot be executed])
 fi
+XML_LIBS="$($XMLCONFIG --libs)"
+XML_CFLAGS="$($XMLCONFIG --cflags)"
+LIBS="$XML_LIBS $LIBS"
+XIPH_CFLAGS="$XIPH_CFLAGS $XML_CFLAGS"
+AC_CHECK_FUNC(xmlParseFile,, [AC_MSG_ERROR([There was a problem linking with libxml])])
 
-AM_PATH_OGG(, AC_MSG_ERROR(must have Ogg installed!))
+AM_PATH_OGG(, AC_MSG_ERROR([must have Ogg v1.0 installed!]))
 LIBS="$OGG_LIBS $LIBS"
 XIPH_CFLAGS="$XIPH_CFLAGS $OGG_CFLAGS"
 
-AM_PATH_VORBIS(, AC_MSG_ERROR(must have Vorbis installed!))
+AM_PATH_VORBIS(, AC_MSG_ERROR([must have Vorbis v1.0 installed!]))
 LIBS="$VORBIS_LIBS $VORBISENC_LIBS $LIBS"
 XIPH_CFLAGS="$XIPH_CFLAGS $VORBIS_CFLAGS $VORBISENC_CFLAGS"
 
 dnl we expect thread support in libshout
 save_CFLAGS=$CFLAGS
 CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
-AM_PATH_SHOUT(, AC_MSG_ERROR(must have libshout installed!))
+AM_PATH_SHOUT(, AC_MSG_ERROR([must have libshout installed!]))
 LIBS="$SHOUT_LIBS $LIBS"
 XIPH_CFLAGS="$XIPH_CFLAGS $SHOUT_CFLAGS"
 CFLAGS=$save_CFLAGS
 
 dnl Make substitutions
 
-AC_SUBST(ICES_EXTRA_OBJS)
 AC_SUBST(ALSA_LIBS)
 AC_SUBST(XML_LIBS)
-AC_SUBST(SHOUT_LIBS)
-AC_SUBST(OGG_CFLAGS)
-AC_SUBST(VORBIS_CFLAGS)
-AC_SUBST(SHOUT_CLFAGS)
 AC_SUBST(XML_CFLAGS)
 AC_SUBST(LIBTOOL_DEPS)
-AC_SUBST(OPT)
 AC_SUBST(LIBS)
 AC_SUBST(DEBUG)
 AC_SUBST(PROFILE)

<p><p>1.2       +37 -72    ices/m4/ogg.m4

Index: ogg.m4
===================================================================
RCS file: /usr/local/cvsroot/ices/m4/ogg.m4,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ogg.m4	13 Mar 2003 03:18:27 -0000	1.1
+++ ogg.m4	31 Mar 2003 20:58:09 -0000	1.2
@@ -1,5 +1,6 @@
 # Configure paths for libogg
 # 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 AM_PATH_OGG([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
@@ -7,28 +8,31 @@
 dnl
 AC_DEFUN(AM_PATH_OGG,
 [dnl 
-dnl Get the cflags and libraries
-dnl
-AC_ARG_WITH(ogg-prefix,[  --with-ogg-prefix=PFX   Prefix where libogg is installed (optional)], ogg_prefix="$withval", ogg_prefix="")
-AC_ARG_ENABLE(oggtest, [  --disable-oggtest       Do not try to compile and run a test Ogg program],, enable_oggtest=yes)
-
-  if test "x$ogg_prefix" != "x" ; then
-    dnl ogg_args="$ogg_args --prefix=$ogg_prefix"
+AC_ARG_ENABLE(oggtest,
+    AC_HELP_STRING([--disable-oggtest],
+                   [Do not try to compile and run a test Ogg program]),
+   enable_oggtest="$enableval",
+   enable_oggtest=yes
+)
+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
     OGG_CFLAGS="-I$ogg_prefix/include"
     OGG_LIBS="-L$ogg_prefix/lib"
-  elif test "x$prefix" != "xNONE"; then
-    dnl ogg_args="$ogg_args --prefix=$prefix"
+elif test "x$prefix" != "xNONE"; then
     OGG_CFLAGS="-I$prefix/include"
     OGG_LIBS="-L$prefix/lib"
-  fi
-
-  OGG_LIBS="$OGG_LIBS -logg"
-
-  AC_MSG_CHECKING(for Ogg)
-  no_ogg=""
+fi
 
+OGG_LIBS="$OGG_LIBS -logg"
 
-  if test "x$enable_oggtest" = "xyes" ; then
+if test "x$enable_oggtest" = "xyes" ; then
+    AC_MSG_RESULT([checking for Ogg])
     ac_save_CFLAGS="$CFLAGS"
     ac_save_LIBS="$LIBS"
     CFLAGS="$CFLAGS $OGG_CFLAGS"
@@ -36,60 +40,21 @@
 dnl
 dnl Now check if the installed Ogg is sufficiently new.
 dnl
-      rm -f conf.oggtest
-      AC_TRY_RUN([
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ogg/ogg.h>
-
-int main ()
-{
-  system("touch conf.oggtest");
-  return 0;
-}
-
-],, no_ogg=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
-       CFLAGS="$ac_save_CFLAGS"
-       LIBS="$ac_save_LIBS"
-  fi
-
-  if test "x$no_ogg" = "x" ; then
-     AC_MSG_RESULT(yes)
-     ifelse([$1], , :, [$1])     
-  else
-     AC_MSG_RESULT(no)
-     if test -f conf.oggtest ; then
-       :
-     else
-       echo "*** Could not run Ogg test program, checking why..."
-       CFLAGS="$CFLAGS $OGG_CFLAGS"
-       LIBS="$LIBS $OGG_LIBS"
-       AC_TRY_LINK([
-#include <stdio.h>
-#include <ogg/ogg.h>
-],     [ return 0; ],
-       [ echo "*** The test program compiled, but did not run. This usually means"
-       echo "*** that the run-time linker is not finding Ogg or finding the wrong"
-       echo "*** version of Ogg. If it is not finding Ogg, you'll need to set your"
-       echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
-       echo "*** to the installed location  Also, make sure you have run ldconfig if that"
-       echo "*** is required on your system"
-       echo "***"
-       echo "*** If you have an old version installed, it is best to remove it, although"
-       echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
-       [ echo "*** The test program failed to compile or link. See the file config.log for the"
-       echo "*** exact error that occured. This usually means Ogg was incorrectly installed"
-       echo "*** or that you have moved Ogg since it was installed. In the latter case, you"
-       echo "*** may want to edit the ogg-config script: $OGG_CONFIG" ])
-       CFLAGS="$ac_save_CFLAGS"
-       LIBS="$ac_save_LIBS"
-     fi
-     OGG_CFLAGS=""
-     OGG_LIBS=""
-     ifelse([$2], , :, [$2])
-  fi
-  AC_SUBST(OGG_CFLAGS)
-  AC_SUBST(OGG_LIBS)
-  rm -f conf.oggtest
+    AC_CHECK_LIB(ogg, ogg_sync_init,,
+        [AC_MSG_RESULT(no)
+         AC_TRY_LINK([#include <ogg/ogg.h>],
+                     [return 0;], 
+            [AC_MSG_ERROR([The test program compiled, but did not run. check config.log])],
+            [AC_MSG_ERROR([The test program failed to compile or link. check config.log])]
+         )
+         OGG_CFLAGS=""
+         OGG_LIBS=""
+         ifelse([$2], , :, [$2])
+        ]
+    )
+    CFLAGS="$ac_save_CFLAGS"
+    LIBS="$ac_save_LIBS"
+fi
+AC_SUBST(OGG_CFLAGS)
+AC_SUBST(OGG_LIBS)
 ])

<p><p>1.2       +45 -74    ices/m4/vorbis.m4

Index: vorbis.m4
===================================================================
RCS file: /usr/local/cvsroot/ices/m4/vorbis.m4,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- vorbis.m4	13 Mar 2003 03:18:27 -0000	1.1
+++ vorbis.m4	31 Mar 2003 20:58:09 -0000	1.2
@@ -1,5 +1,6 @@
 # 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 AM_PATH_VORBIS([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
@@ -9,90 +10,60 @@
 [dnl 
 dnl Get the cflags and libraries
 dnl
-AC_ARG_WITH(vorbis-prefix,[  --with-vorbis-prefix=PFX   Prefix where libvorbis is installed (optional)], vorbis_prefix="$withval", vorbis_prefix="")
-AC_ARG_ENABLE(vorbistest, [  --disable-vorbistest       Do not try to compile and run a test Vorbis program],, enable_vorbistest=yes)
+AC_ARG_ENABLE(vorbistest,
+    AC_HELP_STRING([--disable-vorbistest],
+                   [Do not try to compile and run a test Vorbis program]),
+   enable_vorbistest="$enableval",
+   enable_vorbistest="yes"
+)
+
+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$vorbis_prefix" != "x" ; then
     VORBIS_CFLAGS="-I$vorbis_prefix/include"
     VORBIS_LIBDIR="-L$vorbis_prefix/lib"
-  elif test "x$prefix" != "xNONE"; then
+elif test "x$prefix" != "xNONE"; then
     VORBIS_CFLAGS="-I$prefix/include"
     VORBIS_LIBDIR="-L$prefix/lib"
-  fi
+fi
 
-  VORBIS_LIBS="$VORBIS_LIBDIR -lvorbis -lm"
-  VORBISFILE_LIBS="-lvorbisfile"
-  VORBISENC_LIBS="-lvorbisenc"
-
-  AC_MSG_CHECKING(for Vorbis)
-  no_vorbis=""
-
-
-  if test "x$enable_vorbistest" = "xyes" ; then
+VORBIS_LIBS="$VORBIS_LIBDIR -lvorbis -lm"
+VORBISFILE_LIBS="-lvorbisfile"
+VORBISENC_LIBS="-lvorbisenc"
+
+if test "x$enable_vorbistest" = "xyes" ; then
+    AC_MSG_RESULT(checking for Vorbis)
+
+    dnl
+    dnl Now check if the installed Vorbis is sufficiently new.
+    dnl
     ac_save_CFLAGS="$CFLAGS"
     ac_save_LIBS="$LIBS"
     CFLAGS="$CFLAGS $VORBIS_CFLAGS"
     LIBS="$LIBS $VORBIS_LIBS $OGG_LIBS"
-dnl
-dnl Now check if the installed Vorbis is sufficiently new.
-dnl
-      rm -f conf.vorbistest
-      AC_TRY_RUN([
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
+    AC_CHECK_TYPES([struct ovectl_ratemanage_arg],
+        vorbis_ok=yes,
+        vorbis_ok=no,[
 #include <vorbis/codec.h>
+#include <vorbis/vorbisenc.h>
+])
 
-int main ()
-{
-  system("touch conf.vorbistest");
-  return 0;
-}
-
-],, no_vorbis=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
-       CFLAGS="$ac_save_CFLAGS"
-       LIBS="$ac_save_LIBS"
-  fi
-
-  if test "x$no_vorbis" = "x" ; then
-     AC_MSG_RESULT(yes)
-     ifelse([$1], , :, [$1])     
-  else
-     AC_MSG_RESULT(no)
-     if test -f conf.vorbistest ; then
-       :
-     else
-       echo "*** Could not run Vorbis test program, checking why..."
-       CFLAGS="$CFLAGS $VORBIS_CFLAGS"
-       LIBS="$LIBS $VORBIS_LIBS $OGG_LIBS"
-       AC_TRY_LINK([
-#include <stdio.h>
-#include <vorbis/codec.h>
-],     [ return 0; ],
-       [ echo "*** The test program compiled, but did not run. This usually means"
-       echo "*** that the run-time linker is not finding Vorbis or finding the wrong"
-       echo "*** version of Vorbis. If it is not finding Vorbis, you'll need to set your"
-       echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
-       echo "*** to the installed location  Also, make sure you have run ldconfig if that"
-       echo "*** is required on your system"
-       echo "***"
-       echo "*** If you have an old version installed, it is best to remove it, although"
-       echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
-       [ echo "*** The test program failed to compile or link. See the file config.log for the"
-       echo "*** exact error that occured. This usually means Vorbis was incorrectly installed"
-       echo "*** or that you have moved Vorbis since it was installed." ])
-       CFLAGS="$ac_save_CFLAGS"
-       LIBS="$ac_save_LIBS"
-     fi
-     VORBIS_CFLAGS=""
-     VORBIS_LIBS=""
-     VORBISFILE_LIBS=""
-     VORBISENC_LIBS=""
-     ifelse([$2], , :, [$2])
-  fi
-  AC_SUBST(VORBIS_CFLAGS)
-  AC_SUBST(VORBIS_LIBS)
-  AC_SUBST(VORBISFILE_LIBS)
-  AC_SUBST(VORBISENC_LIBS)
-  rm -f conf.vorbistest
+    if test "x$vorbis_ok" = "xyes" ; then
+        ifelse([$1], , :, [$1])     
+    else
+        ifelse([$2], , :, [$2])     
+    fi
+    CFLAGS="$ac_save_CFLAGS"
+    LIBS="$ac_save_LIBS"
+    AC_SUBST(VORBIS_CFLAGS)
+    AC_SUBST(VORBIS_LIBS)
+    AC_SUBST(VORBISFILE_LIBS)
+    AC_SUBST(VORBISENC_LIBS)
+fi
 ])

<p><p>1.2       +92 -78    ices/m4/shout.m4

Index: shout.m4
===================================================================
RCS file: /usr/local/cvsroot/ices/m4/shout.m4,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- shout.m4	13 Mar 2003 03:18:27 -0000	1.1
+++ shout.m4	31 Mar 2003 20:58:09 -0000	1.2
@@ -1,7 +1,25 @@
 # Configure paths for libshout
 # Jack Moffitt <jack at icecast.org> 08-06-2001
+# updated by Karl Heyes 31-Mar-2003
 # Shamelessly stolen from Owen Taylor and Manish Singh
 
+dnl simple hack for removing warnings from gcc
+dnl gcc -I/usr/local/include re-arranges the search order of directories
+dnl this is typically passed either by the user or generated from
+dnl shout-config
+AC_DEFUN([AC_PROG_GCC_WARN_LOCAL_INCLUDE],
+[if test $ac_cv_c_compiler_gnu = yes; then
+    AC_CACHE_CHECK([whether $CC warns on -I/usr/local/include],
+         [ac_cv_prog_gcc_warn_local_include], [
+         ac_save_CFLAGS=$CFLAGS
+         CFLAGS="-Werror -I/usr/local/include"
+         AC_TRY_COMPILE(,[return 0;], ac_cv_prog_gcc_warn_local_include=no,
+             ac_cv_prog_gcc_warn_local_include=yes)
+         CFLAGS=ac_save_CFLAGS]
+    )
+fi
+])# AC_PROG_GCC_WARN_LOCAL_INCLUDE
+
 dnl AM_PATH_SHOUT([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
 dnl Test for libshout, and define SHOUT_CFLAGS and SHOUT_LIBS
 dnl
@@ -9,89 +27,85 @@
 [dnl 
 dnl Get the cflags and libraries
 dnl
-AC_ARG_WITH(shout-prefix,[  --with-shout-prefix=PFX   Prefix where libshout is installed (optional)], shout_prefix="$withval", shout_prefix="")
-AC_ARG_ENABLE(shouttest, [  --disable-shouttest       Do not try to compile and run a test Shout program],, enable_shouttest=yes)
-
-  if test "x$shout_prefix" != "x" ; then
+AC_REQUIRE([AC_PROG_GCC_WARN_LOCAL_INCLUDE])
+AC_ARG_WITH(shout,
+    AC_HELP_STRING([--with-shout=PREFIX],
+                   [Prefix where libshout is installed (optional)]),
+    shout_prefix="$withval",
+    shout_prefix=""
+)
+AC_ARG_ENABLE(shouttest,
+    AC_HELP_STRING([--disable-shouttest],
+                   [Do not try to compile and run a test Shout program]),
+    enable_shouttest="$enableval",
+    enable_shouttest=yes
+)
+AC_ARG_VAR([SHOUTCONFIG],[libshout config utility])
+AC_ARG_WITH(shout-config,
+    [AC_HELP_STRING([--with-shout-config=PATH],
+                    [use shout-config in PATH to find libshout])],
+    [SHOUTCONFIG="$withval"],
+    [AC_PATH_PROGS(SHOUTCONFIG, [$SHOUTCONFIG shout-config],"")]
+)
+
+SHOUT_LIBS="-lshout"
+
+AC_MSG_RESULT([checking libshout settings])
+if test "x$shout_prefix" != "x" ; then
+    AC_MSG_RESULT([Using libshout prefix $shout_prefix])
     SHOUT_CFLAGS="-I$shout_prefix/include"
-    SHOUT_LIBS="-L$shout_prefix/lib"
-  elif test "x$prefix" != "xNONE"; then
-    SHOUT_CFLAGS="-I$prefix/include"
-    SHOUT_LIBS="-L$prefix/lib"
-  fi
-
-  SHOUT_LIBS="$SHOUT_LIBS -lshout"
-
-dnl   case $host in
-dnl   *-*-solaris*)
-dnl   	SHOUT_LIBS="$SHOUT_LIBS -lnsl -lsocket -lresolv"
-dnl   esac
-
-  AC_MSG_CHECKING(for Shout)
-  no_shout=""
-
-  if test "x$enable_shouttest" = "xyes" ; then
+    SHOUT_LIBS="-L$shout_prefix/lib $SHOUT_LIBS"
+else
+    if test "x$SHOUTCONFIG" != "x" && test -f "$SHOUTCONFIG" &&
+            test -x "$SHOUTCONFIG"; then
+        AC_MSG_RESULT([Using libshout config in $SHOUTCONFIG])
+        LIBSHOUT_PREFIX="$($SHOUTCONFIG --prefix)"
+        dnl avoid including common system directory.
+        if test $ac_cv_prog_gcc_warn_local_include = yes &&
+               test "x$LIBSHOUT_PREFIX" = "x/usr/local"; then
+            :
+        else
+            SHOUT_CFLAGS="-I$LIBSHOUT_PREFIX/include"
+            SHOUT_LIBS="-L$LIBSHOUT_PREFIX/lib $SHOUT_LIBS"
+        fi
+    else
+        AC_MSG_RESULT([Unable to determine libshout path, assuming default])
+    fi
+fi
+if test "x$enable_shouttest" = "xyes"; then
     ac_save_CFLAGS="$CFLAGS"
     ac_save_LIBS="$LIBS"
-    CFLAGS="$CFLAGS $SHOUT_CFLAGS $OGG_CFLAGS $VORBIS_CFLAGS"
-    LIBS="$LIBS $SHOUT_LIBS $OGG_LIBS $VORBIS_LIBS"
+    CFLAGS="$SHOUT_CFLAGS $OGG_CFLAGS $VORBIS_CFLAGS $PTHREAD_CFLAGS"
+    LIBS="$SHOUT_LIBS $OGG_LIBS $VORBIS_LIBS $LIBS"
 dnl
 dnl Now check if the installed Shout is sufficiently new.
 dnl
-      rm -f conf.shouttest
-      AC_TRY_RUN([
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <shout/shout.h>
-
-int main ()
-{
-  system("touch conf.shouttest");
-  return 0;
-}
-
-],, no_shout=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
-       CFLAGS="$ac_save_CFLAGS"
-       LIBS="$ac_save_LIBS"
-  fi
-
-  if test "x$no_shout" = "x" ; then
-     AC_MSG_RESULT(yes)
-     ifelse([$1], , :, [$1])     
-  else
-     AC_MSG_RESULT(no)
-     if test -f conf.shouttest ; then
-       :
-     else
-       echo "*** Could not run Shout test program, checking why..."
-       CFLAGS="$CFLAGS $SHOUT_CFLAGS $OGG_CFLAGS $VORBIS_CFLAGS"
-       LIBS="$LIBS $SHOUT_LIBS $OGG_LIBS $VORBIS_LIBS"
-       AC_TRY_LINK([
-#include <stdio.h>
+    AC_TRY_RUN([
 #include <shout/shout.h>
-],     [ return 0; ],
-       [ echo "*** The test program compiled, but did not run. This usually means"
-       echo "*** that the run-time linker is not finding Shout or finding the wrong"
-       echo "*** version of Shout. If it is not finding Shout, you'll need to set your"
-       echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
-       echo "*** to the installed location  Also, make sure you have run ldconfig if that"
-       echo "*** is required on your system"
-       echo "***"
-       echo "*** If you have an old version installed, it is best to remove it, although"
-       echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
-       [ echo "*** The test program failed to compile or link. See the file config.log for the"
-       echo "*** exact error that occured. This usually means Shout was incorrectly installed"
-       echo "*** or that you have moved Shout since it was installed. In the latter case, you"
-       echo "*** may want to edit the shout-config script: $SHOUT_CONFIG" ])
-       CFLAGS="$ac_save_CFLAGS"
-       LIBS="$ac_save_LIBS"
-     fi
-     SHOUT_CFLAGS=""
-     SHOUT_LIBS=""
-     ifelse([$2], , :, [$2])
-  fi
-  AC_SUBST(SHOUT_CFLAGS)
-  AC_SUBST(SHOUT_LIBS)
-  rm -f conf.shouttest
+int main()
+{ void *p = shout_version; return 0;}],
+        shouttest_ran=yes,
+        shouttest_ran=no
+    )
+    AC_MSG_CHECKING([libshout])
+    if test "$shouttest_ran" = yes; then
+        AC_MSG_RESULT([yes])
+        ifelse([$1], , :, [$1])
+        CFLAGS="$ac_save_CFLAGS"
+        LIBS="$ac_save_LIBS"
+    else
+        AC_MSG_RESULT([no, checking why])
+        AC_CHECK_LIB([shout], [shout_version],
+            [AC_MSG_NOTICE([Unable to run the test program. check config.log])],
+            [AC_MSG_NOTICE([The test program failed to compile or link. check config.log])]
+        )
+        CFLAGS="$ac_save_CFLAGS"
+        LIBS="$ac_save_LIBS"
+        SHOUT_CFLAGS=""
+        SHOUT_LIBS=""
+        ifelse([$2], , :, [$2])
+    fi
+fi
+AC_SUBST(SHOUT_CFLAGS)
+AC_SUBST(SHOUT_LIBS)
 ])

<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