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

Brendan brendan at xiph.org
Fri Jun 13 12:22:16 PDT 2003



brendan     03/06/13 15:22:16

  Modified:    .        Makefile.am configure.ac
  Added:       m4       shout.m4 xiph_path_python.m4
  Removed:     .        acinclude.m4
  Log:
  Move m4 macros from acinclude into m4 directory
  Use new shout.m4 macro

Revision  Changes    Path
1.18      +2 -0      ices/Makefile.am

Index: Makefile.am
===================================================================
RCS file: /cvs/ice/ices/Makefile.am,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -p -u -r1.17 -r1.18
--- Makefile.am	19 Mar 2003 19:35:54 -0000	1.17
+++ Makefile.am	13 Jun 2003 19:22:15 -0000	1.18
@@ -1,5 +1,7 @@
 ## Process this with automake to create Makefile.in
 
+ACLOCAL_AMFLAGS = -I m4
+
 SUBDIRS = src conf doc
 
 EXTRA_DIST = README BUGS AUTHORS TODO INSTALL COPYING NEWS FAQ README.playlist

<p><p>1.8       +4 -39     ices/configure.ac

Index: configure.ac
===================================================================
RCS file: /cvs/ice/ices/configure.ac,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -p -u -r1.7 -r1.8
--- configure.ac	14 Mar 2003 22:42:25 -0000	1.7
+++ configure.ac	13 Jun 2003 19:22:15 -0000	1.8
@@ -1,5 +1,5 @@
 # configure script for ices
-# $Id: configure.ac,v 1.7 2003/03/14 22:42:25 brendan Exp $
+# $Id: configure.ac,v 1.8 2003/06/13 19:22:15 brendan Exp $
 
 m4_define(ICES_MAJOR, 0)
 m4_define(ICES_MINOR, 2)
@@ -94,44 +94,9 @@ AC_SUBST(moddir)
 
 dnl -- Required extra libraries --
 
-AC_ARG_WITH([shout-config],
-  [[  --with-shout-config[=DIR]   use shout-config in PATH to find libshout]])
-
-have_libshout="no"
-if test "$with_shout_config" != "no"
-then
-  if test -n "$with_shout_config" -a "$with_shout_config" != "yes"
-  then
-    SHOUTCONFIG="$with_shout_config"
-  fi
-  AC_PATH_PROG(SHOUTCONFIG, [shout-config])
-
-  if test -x "$SHOUTCONFIG"
-  then
-    LIBS="$LIBS `$SHOUTCONFIG --libs`"
-    CFLAGS="$CFLAGS `$SHOUTCONFIG --cflags`"
-  elif test -n "$with_shout_config"
-  then
-    AC_MSG_ERROR([Could not run shout-config])
-  fi
-fi
-
-AC_CHECK_HEADER([shout/shout.h], [
-  AC_DEFINE(HAVE_SHOUT_SHOUT_H, 1, [Define if you have <shout/shout.h>])
-  have_libshout="maybe"
-  ])
-if test "$have_libshout" != "no"
-then
-  dnl shout_new was introduced in libshout2 so it serves as a version check.
-  AC_CHECK_LIB([shout], [shout_new], [
-    have_libshout="yes"
-    if test -z "$SHOUTCONFIG"
-    then
-      LIBS="$LIBS -lshout"
-    fi
-  ],
-  [AC_MSG_ERROR([Could not find a usable installed libshout])])
-fi
+XIPH_PATH_SHOUT(, [AC_MSG_ERROR([Could not find a usable libshout])])
+CFLAGS="$CFLAGS $SHOUT_CFLAGS"
+LIBS="$LIBS $SHOUT_LIBS"
 
 dnl -- Optional features --
 AC_CACHE_SAVE

<p><p>1.1                  ices/m4/shout.m4

Index: shout.m4
===================================================================
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
# XIPH_PATH_SHOUT([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
# Test for libshout, and define SHOUT_CFLAGS and SHOUT_LIBS
AC_DEFUN([XIPH_PATH_SHOUT],
[dnl
have_shout="no"
SHOUT_CFLAGS=""
SHOUT_LIBS=""

# Step 1: Use pkg-config if available
m4_ifdef([PKG_CHECK_MODULES],
  [# PKG_CHECK_MODULES available
  PKG_CHECK_MODULES([SHOUT], [shout >= 2.0])
  have_shout="maybe"],
  [# PKG_CHECK_MODULES is unavailable, search for pkg-config program
  AC_PATH_PROG([PKGCONFIG], [pkg-config], [none])
  if test "$PKGCONFIG" != "none" && `$PKGCONFIG --exists 'shout >= 2.0'`
  then
    SHOUT_CFLAGS=`$PKGCONFIG --cflags`
    SHOUT_LIBS=`$PKGCONFIG --libs`
    have_shout="maybe"
  else
    # Step 2: try shout-config
    AC_PATH_PROG([SHOUTCONFIG], [shout-config], [none])
    if test "$SHOUTCONFIG" != "none" -a `$SHOUTCONFIG --package` = "libshout"
    then
      SHOUT_CFLAGS=`$SHOUTCONFIG --cflags`
      SHOUT_LIBS=`$SHOUTCONFIG --libs`
      have_shout="maybe"
    fi
  fi

  if test "$have_shout" != "no"
  then
    ac_save_CFLAGS="$CFLAGS"
    ac_save_LIBS="$LIBS"
    CFLAGS="$CFLAGS $SHOUT_CFLAGS"
    LIBS="$LIBS $SHOUT_LIBS"
    AC_CHECK_HEADER([shout/shout.h], [
      AC_DEFINE([HAVE_SHOUT_SHOUT_H], 1, [Define if you have <shout/shout.h>])
      AC_CHECK_FUNC([shout_new], [
        ifelse([$1], , :, [$1])
        have_shout="yes"
      ])
    ])
    CFLAGS="$ac_save_CFLAGS"
    LIBS="$ac_save_LIBS"
  fi

  if test "$have_shout" != "yes"
  then
    ifelse([$2], , :, [$2])
  fi
  ])
])dnl XIPH_PATH_SHOUT

<p><p>1.1                  ices/m4/xiph_path_python.m4

Index: xiph_path_python.m4
===================================================================
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//'`])

<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