[xiph-cvs] cvs commit: libshout/m4 ac_config_libconfig_in.m4 ogg.m4 vorbis.m4 xiph_compiler.m4

Brendan brendan at xiph.org
Thu Jun 26 09:03:38 PDT 2003



brendan     03/06/26 12:03:38

  Modified:    .        configure.in shout.pc.in
               m4       ac_config_libconfig_in.m4 ogg.m4 vorbis.m4
                        xiph_compiler.m4
  Log:
  Prune shout_prefix from *-config include flags if it would generate a warning.
  Make all xiph_compiler macros comply with our coding guidelines
  XIPH_GCC_INCLUDE_WARNING renamed XIPH_GCC_WARNING

Revision  Changes    Path
1.53      +14 -3     libshout/configure.in

Index: configure.in
===================================================================
RCS file: /usr/local/cvsroot/libshout/configure.in,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -p -u -r1.52 -r1.53
--- configure.in	24 Jun 2003 21:35:44 -0000	1.52
+++ configure.in	26 Jun 2003 16:03:37 -0000	1.53
@@ -1,5 +1,5 @@
 # Process this file with autoconf to produce a configure script.
-# $Id: configure.in,v 1.52 2003/06/24 21:35:44 brendan Exp $
+# $Id: configure.in,v 1.53 2003/06/26 16:03:37 brendan Exp $
 
 m4_define(libshout_major, 2)
 m4_define(libshout_minor, 0)
@@ -126,11 +126,22 @@ fi
 AM_CONDITIONAL([HAVE_PKGCONFIG], [test "$PKGCONFIG" != "no"])
 
 # Build shout-config, shout.pc
+
+# I hate myself for doing this.
+save_prefix="$prefix"
+if test "$prefix" = "NONE"
+then
+  prefix="$ac_default_prefix"
+fi
+eval shout_includedir="$includedir"
+prefix="$save_prefix"
+
 SHOUT_VERSION="$VERSION"
+SHOUT_CFLAGS="-I$shout_includedir $VORBIS_CFLAGS $PTHREAD_CFLAGS $PTHREAD_CPPFLAGS"
 SHOUT_LIBS="-lshout"
+
+XIPH_CLEAN_CCFLAGS([$SHOUT_CFLAGS], [SHOUT_CFLAGS])
 XIPH_CLEAN_CCFLAGS([$VORBIS_LIBS $PTHREAD_LIBS $LIBS], [SHOUT_LIBDEPS])
-XIPH_CLEAN_CCFLAGS([$VORBIS_CFLAGS $PTHREAD_CFLAGS $PTHREAD_CPPFLAGS],
-  [SHOUT_CFLAGS])
 AC_SUBST(SHOUT_LIBDEPS)
 AC_SUBST(SHOUT_CFLAGS)
 AC_CONFIG_LIBCONFIG_IN_STATIC

<p><p>1.2       +2 -2      libshout/shout.pc.in

Index: shout.pc.in
===================================================================
RCS file: /usr/local/cvsroot/libshout/shout.pc.in,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -u -r1.1 -r1.2
--- shout.pc.in	3 Jun 2003 20:16:21 -0000	1.1
+++ shout.pc.in	26 Jun 2003 16:03:37 -0000	1.2
@@ -6,7 +6,7 @@ libdir=@libdir@
 includedir=@includedir@
 
 Name: Shout
-Description: Audio streaming library for icecast sources
+Description: Audio streaming library for icecast encoders
 Version: @VERSION@
 Libs: -L${libdir} -lshout @SHOUT_LIBDEPS@
-Cflags: -I${includedir} @SHOUT_CFLAGS@
\ No newline at end of file
+Cflags: @SHOUT_CFLAGS@

<p><p>1.3       +5 -5      libshout/m4/ac_config_libconfig_in.m4

Index: ac_config_libconfig_in.m4
===================================================================
RCS file: /usr/local/cvsroot/libshout/m4/ac_config_libconfig_in.m4,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -p -u -r1.2 -r1.3
--- ac_config_libconfig_in.m4	10 Jun 2003 01:42:08 -0000	1.2
+++ ac_config_libconfig_in.m4	26 Jun 2003 16:03:37 -0000	1.3
@@ -98,11 +98,11 @@ for option in $options extra; do
     exec-prefix | eprefix)  echo '  o="$o $exec_prefix"' >>$LIBCONFIG_FILE ;;
     template-version)  echo '  o="$o $template_version"' >>$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 '  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 $cflags"' >>$LIBCONFIG_FILE ;;
     libs)  echo '  o="$o -L$libdir $libs"' >>$LIBCONFIG_FILE ;;
     help)  echo '  h="1"' >>$LIBCONFIG_FILE ;;

<p><p>1.5       +1 -1      libshout/m4/ogg.m4

Index: ogg.m4
===================================================================
RCS file: /usr/local/cvsroot/libshout/m4/ogg.m4,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -p -u -r1.4 -r1.5
--- ogg.m4	18 Jun 2003 03:55:41 -0000	1.4
+++ ogg.m4	26 Jun 2003 16:03:37 -0000	1.5
@@ -23,7 +23,7 @@ if test "x$ogg_prefix" = "x"; then
     fi
 fi
 
-XIPH_GCC_INCLUDE_WARNING([$ogg_prefix/include],,
+XIPH_GCC_WARNING([-I$ogg_prefix/include],,
         [OGG_CFLAGS="-I$ogg_prefix/include"
         OGG_LDFLAGS="-L$ogg_prefix/lib"
         ])

<p><p>1.4       +1 -1      libshout/m4/vorbis.m4

Index: vorbis.m4
===================================================================
RCS file: /usr/local/cvsroot/libshout/m4/vorbis.m4,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -p -u -r1.3 -r1.4
--- vorbis.m4	18 Jun 2003 03:55:41 -0000	1.3
+++ vorbis.m4	26 Jun 2003 16:03:37 -0000	1.4
@@ -32,7 +32,7 @@ fi
 VORBIS_CFLAGS="$OGG_CFLAGS"
 VORBIS_LDFLAGS="$OGG_LDFLAGS"
 if test "x$vorbis_prefix" != "x$ogg_prefix"; then
-    XIPH_GCC_INCLUDE_WARNING("$vorbis_prefix/include",,
+    XIPH_GCC_WARNING(-I"$vorbis_prefix/include",,
             [VORBIS_CFLAGS="$VORBIS_CFLAGS -I$vorbis_prefix/include"
             VORBIS_LDFLAGS="-L$vorbis_prefix/lib $VORBIS_LDFLAGS"
             ])

<p><p>1.4       +76 -57    libshout/m4/xiph_compiler.m4

Index: xiph_compiler.m4
===================================================================
RCS file: /usr/local/cvsroot/libshout/m4/xiph_compiler.m4,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -p -u -r1.3 -r1.4
--- xiph_compiler.m4	24 Jun 2003 05:04:54 -0000	1.3
+++ xiph_compiler.m4	26 Jun 2003 16:03:37 -0000	1.4
@@ -1,46 +1,5 @@
 dnl xiph_compiler.m4
-dnl $Id: xiph_compiler.m4,v 1.3 2003/06/24 05:04:54 brendan Exp $
-
-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
-# 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])
-xcc_REV_FLAGS=''
-for flag in $1
-do
-  case "$flag" in
-  -l*)
-    xcc_REV_FLAGS="$flag $xcc_REV_FLAGS"
-    ;;
-  *)
-    if { cat <<EOF
- $xcc_REV_FLAGS x
-EOF
-} | $FGREP -v -e " $flag " > /dev/null
-    then
-      xcc_REV_FLAGS="$flag $xcc_REV_FLAGS"
-    fi
-  esac
-done
-
-for flag in $xcc_REV_FLAGS
-do
-  if { cat <<EOF
- $$2 x
-EOF
-} | $FGREP -v -e " $flag " > /dev/null
-  then
-    $2="$flag $$2"
-  fi
-done
-])dnl XIPH_CLEAN_CCFLAGS
+dnl $Id: xiph_compiler.m4,v 1.4 2003/06/26 16:03:37 brendan Exp $
 
 dnl XIPH_FUNC_VA_COPY
 dnl Karl Heyes
@@ -79,29 +38,89 @@ AC_TRY_COMPILE([int func(void) __attribu
 ])
 ])dnl XIPH_C_ATTRIBUTE
 
-dnl XIPH_GCC_INCLUDE_WARNING
+dnl XIPH_GCC_WARNING
 dnl Karl Heyes
 dnl
-# XIPH_GCC_INCLUDE_WARNING(include-dir, action-if-warning, action-if-not)
-# Tests whether GCC emits a warning if explicitly asked to put include-dir
-# in its include path, because GCC is already including that path by default
-AC_DEFUN([XIPH_GCC_INCLUDE_WARNING],
+# 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])
-xgiw_warning=no
+xt_warning=no
 if test x"$GCC" = "xyes"
 then
   save_cflags="$CFLAGS"
-  CFLAGS="-Werror -I$1"
-  AC_TRY_COMPILE(,,,xgiw_warning=yes)
+  CFLAGS="-Werror $1"
+  AC_TRY_COMPILE(,,,xt_warning=yes)
   CFLAGS="$save_cflags"
 fi
-if test "$xgiw_warning" = "yes"
+if test "$xt_warning" = "yes"
 then
   ifelse([$2],,:,[$2])
 else
   ifelse([$3],,:,[$3])
 fi
-])dnl XIPH_GCC_INCLUDE_WARNING
+])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
@@ -132,8 +151,8 @@ dnl
 AC_DEFUN([XIPH_VAR_PREPEND],
 [dnl
 AC_REQUIRE([AC_PROG_FGREP])
-xvp_compare="$1"
-filtered=""   
+xt_compare="$1"
+xt_filtered=""   
 for arg in $2
 do
   if { cat <<EOF
@@ -141,9 +160,9 @@ do
 EOF
 } | $FGREP -v -e " $arg " > /dev/null
   then
-    compare="$arg $compare"
-    filtered="$filtered $arg"
+    xt_compare="$arg $xt_compare"
+    xt_filtered="$xt_filtered $arg"
   fi
 done
-$1="$filtered $$1"
+$1="$xt_filtered $$1"
 ])dnl XIPH_VAR_PREPEND

<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