replace the compile time ordinals.h.in->ordinals.h conversion with a static ordinals.h

This commit is contained in:
Josh Coalson 2003-09-15 21:14:26 +00:00
parent e51f362918
commit 5b782b4da6
9 changed files with 46 additions and 144 deletions

View File

@ -37,14 +37,4 @@ all default: $(DEFAULT_BUILD)
VERSION=\"1.1.0\"
ORDINALS_H = $(topdir)/include/FLAC/ordinals.h
$(ORDINALS_H): $(ORDINALS_H).in
sed \
-e "s/@FLaC__SIZE16@/short/g" \
-e "s/@FLaC__SIZE32@/int/g" \
-e "s/@FLaC__SIZE64@/long long/g" \
-e "s/@FLaC__USIZE16@/unsigned short/g" \
-e "s/@FLaC__USIZE32@/unsigned int/g" \
-e "s/@FLaC__USIZE64@/unsigned long long/g" \
$< > $@
CONFIG_CFLAGS=-DHAVE_INTTYPES_H

View File

@ -45,9 +45,9 @@ PROGRAM = $(BINPATH)/$(PROGRAM_NAME)
DEBUG_PROGRAM = $(DEBUG_BINPATH)/$(PROGRAM_NAME)
RELEASE_PROGRAM = $(RELEASE_BINPATH)/$(PROGRAM_NAME)
debug : CFLAGS = -g -O0 -DDEBUG $(DEBUG_CFLAGS) -Wall -W -DVERSION=$(VERSION) $(DEFINES) $(INCLUDES)
valgrind: CFLAGS = -g -O0 -DDEBUG $(DEBUG_CFLAGS) -DFLAC__VALGRIND_TESTING -Wall -W -DVERSION=$(VERSION) $(DEFINES) $(INCLUDES)
release : CFLAGS = -O3 -fomit-frame-pointer -funroll-loops -finline-functions -DNDEBUG $(RELEASE_CFLAGS) -Wall -W -Winline -DFLaC__INLINE=__inline__ -DVERSION=$(VERSION) $(DEFINES) $(INCLUDES)
debug : CFLAGS = -g -O0 -DDEBUG $(CONFIG_CFLAGS) $(DEBUG_CFLAGS) -Wall -W -DVERSION=$(VERSION) $(DEFINES) $(INCLUDES)
valgrind: CFLAGS = -g -O0 -DDEBUG $(CONFIG_CFLAGS) $(DEBUG_CFLAGS) -DFLAC__VALGRIND_TESTING -Wall -W -DVERSION=$(VERSION) $(DEFINES) $(INCLUDES)
release : CFLAGS = -O3 -fomit-frame-pointer -funroll-loops -finline-functions -DNDEBUG $(CONFIG_CFLAGS) $(RELEASE_CFLAGS) -Wall -W -Winline -DFLaC__INLINE=__inline__ -DVERSION=$(VERSION) $(DEFINES) $(INCLUDES)
LFLAGS = -L$(LIBPATH)

View File

@ -55,9 +55,9 @@ else
LINKD = $(CC) -shared
endif
debug : CFLAGS = -g -O0 -DDEBUG $(DEBUG_CFLAGS) -Wall -W -DVERSION=$(VERSION) $(DEFINES) $(INCLUDES)
valgrind: CFLAGS = -g -O0 -DDEBUG $(DEBUG_CFLAGS) -DFLAC__VALGRIND_TESTING -Wall -W -DVERSION=$(VERSION) $(DEFINES) $(INCLUDES)
release : CFLAGS = -O3 -fomit-frame-pointer -funroll-loops -finline-functions -DNDEBUG $(RELEASE_CFLAGS) -Wall -W -Winline -DFLaC__INLINE=__inline__ -DVERSION=$(VERSION) $(DEFINES) $(INCLUDES)
debug : CFLAGS = -g -O0 -DDEBUG $(CONFIG_CFLAGS) $(DEBUG_CFLAGS) -Wall -W -DVERSION=$(VERSION) $(DEFINES) $(INCLUDES)
valgrind: CFLAGS = -g -O0 -DDEBUG $(CONFIG_CFLAGS) -DFLAC__VALGRIND_TESTING -Wall -W -DVERSION=$(VERSION) $(DEFINES) $(INCLUDES)
release : CFLAGS = -O3 -fomit-frame-pointer -funroll-loops -finline-functions -DNDEBUG $(CONFIG_CFLAGS) $(RELEASE_CFLAGS) -Wall -W -Winline -DFLaC__INLINE=__inline__ -DVERSION=$(VERSION) $(DEFINES) $(INCLUDES)
LFLAGS = -L$(LIBPATH)

View File

@ -1,2 +1 @@
cd include/FLAC
sed -e 's/@FLaC__SIZE16@/short/g' -e 's/@FLaC__SIZE32@/int/g' -e 's/@FLaC__SIZE64@/long long/g' -e 's/@FLaC__USIZE16@/unsigned short/g' -e 's/@FLaC__USIZE32@/unsigned int/g' -e 's/@FLaC__USIZE64@/unsigned long long/g' ordinals.h.in > ordinals.h
true

View File

@ -304,56 +304,6 @@ if test -n "$NASM" ; then
AC_DEFINE(FLAC__HAS_NASM)
fi
dnl Check for type sizes
AC_CHECK_SIZEOF(short)
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(long long)
case 2 in
$ac_cv_sizeof_short) FLaC__SIZE16="short" ; FLaC__USIZE16="unsigned short";;
$ac_cv_sizeof_int) FLaC__SIZE16="int" ; FLaC__USIZE16="unsigned int";;
esac
case 4 in
$ac_cv_sizeof_short) FLaC__SIZE32="short" ; FLaC__USIZE32="unsigned short";;
$ac_cv_sizeof_int) FLaC__SIZE32="int" ; FLaC__USIZE32="unsigned int";;
$ac_cv_sizeof_long) FLaC__SIZE32="long" ; FLaC__USIZE32="unsigned long";;
esac
case 8 in
$ac_cv_sizeof_int) FLaC__SIZE64="int" ; FLaC__USIZE64="unsigned int";;
$ac_cv_sizeof_long) FLaC__SIZE64="long" ; FLaC__USIZE64="unsigned long";;
$ac_cv_sizeof_long_long) FLaC__SIZE64="long long" ; FLaC__USIZE64="unsigned long long";;
esac
if test -z "$FLaC__SIZE16"; then
AC_MSG_ERROR(No 16 bit type found on this platform!)
fi
if test -z "$FLaC__USIZE16"; then
AC_MSG_ERROR(No unsigned 16 bit type found on this platform!)
fi
if test -z "$FLaC__SIZE32"; then
AC_MSG_ERROR(No 32 bit type found on this platform!)
fi
if test -z "$FLaC__USIZE32"; then
AC_MSG_ERROR(No unsigned 32 bit type found on this platform!)
fi
if test -z "$FLaC__SIZE64"; then
AC_MSG_WARN(No 64 bit type found on this platform!)
fi
if test -z "$FLaC__USIZE64"; then
AC_MSG_ERROR(No unsigned 64 bit type found on this platform!)
fi
AC_SUBST(FLaC__SIZE16)
AC_SUBST(FLaC__USIZE16)
AC_SUBST(FLaC__SIZE32)
AC_SUBST(FLaC__USIZE32)
AC_SUBST(FLaC__SIZE64)
AC_SUBST(FLaC__USIZE64)
OUR_CFLAGS_HEAD='-I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include'
if test x$debug = xtrue; then
OUR_CFLAGS_HEAD="$OUR_CFLAGS_HEAD -g -O0 -DDEBUG"
@ -424,7 +374,6 @@ AC_OUTPUT( \
src/test_streams/Makefile \
include/Makefile \
include/FLAC/Makefile \
include/FLAC/ordinals.h \
include/FLAC++/Makefile \
include/OggFLAC/Makefile \
include/OggFLAC++/Makefile \

View File

@ -844,7 +844,7 @@
buildSettings = {
HEADER_SEARCH_PATHS = include;
OPTIMIZATION_CFLAGS = "-O3";
OTHER_CFLAGS = "-DVERSION=\\\\\\\"1.1.0\\\\\\\"";
OTHER_CFLAGS = "-DVERSION=\\\\\\\"1.1.0\\\\\\\" -DHAVE_INTTYPES_H";
OTHER_LDFLAGS = "";
OTHER_REZFLAGS = "";
PRODUCT_NAME = flac;
@ -1721,7 +1721,7 @@
buildSettings = {
HEADER_SEARCH_PATHS = include;
OPTIMIZATION_CFLAGS = "-O3";
OTHER_CFLAGS = "-DVERSION=\\\\\\\"1.1.0\\\\\\\"";
OTHER_CFLAGS = "-DVERSION=\\\\\\\"1.1.0\\\\\\\" -DHAVE_INTTYPES_H";
OTHER_LDFLAGS = "";
OTHER_REZFLAGS = "";
PRODUCT_NAME = metaflac;

View File

@ -32,18 +32,23 @@
#ifndef FLAC__ORDINALS_H
#define FLAC__ORDINALS_H
#ifdef true
#undef true
#endif
#ifdef false
#undef false
#endif
#ifndef __cplusplus
#define true 1
#define false 0
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
typedef int FLAC__bool;
#ifdef HAVE_INTTYPES_H
#include <inttypes.h>
#elif defined(HAVE_U_INT)
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#define uint8_t u_int8_t
#define uint16_t u_int16_t
#define uint32_t u_int32_t
#define uint64_t u_int64_t
#elif !defined(_MSC_VER)
#error Unable to find fixed-size data types
#endif
typedef signed char FLAC__int8;
typedef unsigned char FLAC__uint8;
@ -56,15 +61,28 @@ typedef unsigned __int16 FLAC__uint16;
typedef unsigned __int32 FLAC__uint32;
typedef unsigned __int64 FLAC__uint64;
#else
typedef @FLaC__SIZE16@ FLAC__int16;
typedef @FLaC__SIZE32@ FLAC__int32;
typedef @FLaC__SIZE64@ FLAC__int64;
typedef @FLaC__USIZE16@ FLAC__uint16;
typedef @FLaC__USIZE32@ FLAC__uint32;
typedef @FLaC__USIZE64@ FLAC__uint64;
typedef int16_t FLAC__int16;
typedef int32_t FLAC__int32;
typedef int64_t FLAC__int64;
typedef uint16_t FLAC__uint16;
typedef uint32_t FLAC__uint32;
typedef uint64_t FLAC__uint64;
#endif
typedef int FLAC__bool;
typedef FLAC__uint8 FLAC__byte;
typedef float FLAC__real;
#ifdef true
#undef true
#endif
#ifdef false
#undef false
#endif
#ifndef __cplusplus
#define true 1
#define false 0
#endif
#endif

View File

@ -375,34 +375,7 @@ SOURCE=..\..\include\FLAC\metadata.h
# End Source File
# Begin Source File
SOURCE=..\..\include\FLAC\ordinals.h.in
!IF "$(CFG)" == "libFLAC_dynamic - Win32 Release"
USERDEP__ORDIN="..\..\include\FLAC\ordinals.h.in"
# Begin Custom Build
InputDir=..\..\include\FLAC
InputPath=..\..\include\FLAC\ordinals.h.in
"$(InputDir)\ordinals.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
copy "$(InputDir)\ordinals.h.in" "$(InputDir)\ordinals.h"
# End Custom Build
!ELSEIF "$(CFG)" == "libFLAC_dynamic - Win32 Debug"
USERDEP__ORDIN="..\..\include\FLAC\ordinals.h.in"
# Begin Custom Build
InputDir=..\..\include\FLAC
InputPath=..\..\include\FLAC\ordinals.h.in
"$(InputDir)\ordinals.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
copy "$(InputDir)\ordinals.h.in" "$(InputDir)\ordinals.h"
# End Custom Build
!ENDIF
SOURCE=..\..\include\FLAC\ordinals.h
# End Source File
# Begin Source File

View File

@ -368,34 +368,7 @@ SOURCE=..\..\include\FLAC\metadata.h
# End Source File
# Begin Source File
SOURCE=..\..\include\FLAC\ordinals.h.in
!IF "$(CFG)" == "libFLAC_static - Win32 Release"
USERDEP__ORDIN="..\..\include\FLAC\ordinals.h.in"
# Begin Custom Build
InputDir=..\..\include\FLAC
InputPath=..\..\include\FLAC\ordinals.h.in
"$(InputDir)\ordinals.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
copy "$(InputDir)\ordinals.h.in" "$(InputDir)\ordinals.h"
# End Custom Build
!ELSEIF "$(CFG)" == "libFLAC_static - Win32 Debug"
USERDEP__ORDIN="..\..\include\FLAC\ordinals.h.in"
# Begin Custom Build
InputDir=..\..\include\FLAC
InputPath=..\..\include\FLAC\ordinals.h.in
"$(InputDir)\ordinals.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
copy "$(InputDir)\ordinals.h.in" "$(InputDir)\ordinals.h"
# End Custom Build
!ENDIF
SOURCE=..\..\include\FLAC\ordinals.h
# End Source File
# Begin Source File