Alexander Leidinger wrote:
> Can you please test the CVS version of LAME with the attached patch
> (I've no gcc 3.1 at the moment)?
Some more details.
There is a bug in your GCC_version sed script. Instead of:
GCC_version=`${CC} --version | sed -n '1s/^[^ ]* (.*) //;s/ .*$//;1p`
a correct one is:
GCC_version=`${CC} --version | sed -n '1s/^[[^ ]]* (.*) //;s/ .*$//;1p'`
The case for the unsupported GCC version is in error.
Also, the macro target_cpu is only defined if the AC_CANONICAL_TARGET
macro is used in configure.in. As this has just been replaced with
AC_CANONICAL_HOST, target_cpu is undefined. I suggest replacing
target_cpu in configure.in with host_cpu (which is defined when
AC_CANONICAL_HOST is).
As for the ugly executable name generated for install: the configure
script will create a variable named transform, which is repsonsiable for
renaming the executable file name. This is only generated if
AC_CANONICAL_TARGET is used in configure.in, and if there is a target
specified. For example:
$ ./configure --target=i386-redhat-linux
...
$ grep transform Makefile
transform = s,^,i386-redhat-linux-,
As for patching the individual files for stdint.h: a range of include
files use types like uint8_t, which are defined in stdint.h. It's
insufficient to include stdint.h in .c files.
Please find my diff against the current CVS attached, include the above
stuff.
Akos
PS: Is it beneficial to include generated files in the CVS? I mean files
like configure, Makefile.in, ltmain.sh, etc., which change from host to
host. I had a great deal of trouble today since ltmain.sh from the CVS
was not in sync with libtool on my system.
Index: configure.in
===================================================================
RCS file: /cvsroot/lame/lame/configure.in,v
retrieving revision 1.84
diff -u -r1.84 configure.in
--- configure.in 28 May 2002 08:07:00 -0000 1.84
+++ configure.in 30 May 2002 10:46:37 -0000
@@ -22,7 +22,7 @@
AC_CONFIG_SRCDIR([libmp3lame/lame.c])
dnl check system
-AC_CANONICAL_TARGET([])
+AC_CANONICAL_HOST
dnl automake
@@ -81,6 +81,7 @@
errno.h \
fcntl.h \
limits.h \
+ stdint.h \
string.h \
sys/soundcard.h \
sys/time.h \
@@ -96,7 +97,7 @@
if test "${GCC}" = "yes"; then
AC_MSG_CHECKING(version of GCC)
- GCC_version=`${CC} --version`
+ GCC_version=`${CC} --version | sed -n '1s/^[[^ ]]* (.*) //;s/ .*$//;1p'`
AC_MSG_RESULT(${GCC_version})
fi
@@ -517,7 +518,7 @@
dnl ### processor specific options ###
-case $target_cpu in
+case $host_cpu in
*86)
CPUTYPE="i386"
@@ -632,7 +633,7 @@
# generic target CPU specific options
- case ${target_cpu} in
+ case ${host_cpu} in
sparc)
case "${GCC_version}" in
3.1*)
@@ -663,7 +664,7 @@
case "${GCC_version}" in
2.9*|3.*)
# "new" GCC, use some "new" CPU specific optimizations
- case ${target_cpu} in
+ case ${host_cpu} in
*486)
OPTIMIZATION="${OPTIMIZATION} -m486 \
-mfancy-math-387"
@@ -691,11 +692,16 @@
;;
esac
;;
+ *)
+ # no special optimization for other versions
+ AC_MSG_WARN(LAME doesn't know about your version of gcc,
+please report it to [EMAIL PROTECTED] Please make sure you try the
+latest LAME version first!)
+ ;;
+ esac
+ ;;
*)
AC_MSG_ERROR(bad value �${CONFIG_EXPOPT}� for expopt option)
;;
esac
-esac
AC_MSG_RESULT(${CONFIG_EXPOPT})
else
Index: libmp3lame/VbrTag.h
===================================================================
RCS file: /cvsroot/lame/lame/libmp3lame/VbrTag.h,v
retrieving revision 1.10
diff -u -r1.10 VbrTag.h
--- libmp3lame/VbrTag.h 29 Oct 2001 22:00:16 -0000 1.10
+++ libmp3lame/VbrTag.h 30 May 2002 10:46:37 -0000
@@ -22,6 +22,9 @@
#ifndef LAME_VRBTAG_H
#define LAME_VRBTAG_H
#include "lame.h"
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
/* -----------------------------------------------------------
* A Vbr header may be present in the ancillary
* data field of the first frame of an mp3 bitstream
Index: libmp3lame/pcm.c
===================================================================
RCS file: /cvsroot/lame/lame/libmp3lame/pcm.c,v
retrieving revision 1.7
diff -u -r1.7 pcm.c
--- libmp3lame/pcm.c 17 Feb 2001 14:30:56 -0000 1.7
+++ libmp3lame/pcm.c 30 May 2002 10:46:42 -0000
@@ -27,6 +27,9 @@
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
#include <limits.h>
#include <math.h>
#include <memory.h>
Index: libmp3lame/pcm.h
===================================================================
RCS file: /cvsroot/lame/lame/libmp3lame/pcm.h,v
retrieving revision 1.6
diff -u -r1.6 pcm.h
--- libmp3lame/pcm.h 17 Feb 2001 14:30:56 -0000 1.6
+++ libmp3lame/pcm.h 30 May 2002 10:46:43 -0000
@@ -1,6 +1,9 @@
/*{{{ #defines */
#include <limits.h>
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
#include "lame.h"
#include "util.h"
Index: libmp3lame/util.h
===================================================================
RCS file: /cvsroot/lame/lame/libmp3lame/util.h,v
retrieving revision 1.98
diff -u -r1.98 util.h
--- libmp3lame/util.h 20 May 2002 22:21:25 -0000 1.98
+++ libmp3lame/util.h 30 May 2002 10:46:44 -0000
@@ -33,6 +33,9 @@
#include "lame_global_flags.h"
#include "lame-analysis.h"
#include "id3tag.h"
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
#ifdef __cplusplus
extern "C" {