mirror of https://github.com/xiph/flac
Fix building with MSYS and MinGW(-w64); Improve Makefile.lite build system
This is a patch to allow building of the project using MSYS, MinGW, and MinGW-w64 with the following invocation: make -f Makefile.lite libFLAC libFLAC++ flac metaflac test_libs_common test_libFLAC test_libFLAC++ test_grabbag test_seeking test_streams utils examples This patch addresses eight points: 1. `uname -p` in MSYS returns "unknown" so we must use `gcc -dumpmachine` to gain information about the target, 32-bit or 64-bit. 2. MinGW-w64 does not ship with a working iconv.h, so we must disable it under this specific compiler. 3. The code requires <inttypes.h> in a handful of C files, but config.mk did not contain -DHAVE_INTTYPES_H, which under the full build process (I assume) is added by autoconf. 4. The compiler complained when lround() in lpc.c was static, so it is no longer static. 5. Additional scattered linking directives (and reordering) (particularly FLAC, grabbag, and replaygain_analysis) were necessary to build some of the components. 6. The Makefile.lite build system benefited from some cleanup, particularly by rigorously defining all entries, factoring redundancy, and establishing dependencies. (Some typos were fixed too.) 7. Shared objects on Windows use .dll, not .so. (Added *.dll, *.dylib, and *.exe to .gitignore.) 8. To allow more freedom using Makefile.lite without configure, I added the variables USE_OGG and USE_ICONV which can toggle these two components in the build process. ex: make -f Makefile.lite examples USE_OGG=0 USE_ICONV=0 These improvements make use of some use-time Makefile variable expansion. Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
This commit is contained in:
parent
0da96d3cfd
commit
96d081c1c9
|
@ -2,6 +2,9 @@
|
|||
*.la
|
||||
*.lo
|
||||
*.so
|
||||
*.dll
|
||||
*.dylib
|
||||
*.exe
|
||||
.deps
|
||||
.libs
|
||||
Makefile
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
# FLAC - Free Lossless Audio Codec
|
||||
# Copyright (C) 2001,2002,2003,2004,2005,2006,2007,2008,2009 Josh Coalson
|
||||
#
|
||||
# This file is part the FLAC project. FLAC is comprised of several
|
||||
# components distributed under difference licenses. The codec libraries
|
||||
# are distributed under Xiph.Org's BSD-like license (see the file
|
||||
# COPYING.Xiph in this distribution). All other programs, libraries, and
|
||||
# plugins are distributed under the GPL (see COPYING.GPL). The documentation
|
||||
# is distributed under the Gnu FDL (see COPYING.FDL). Each file in the
|
||||
# FLAC distribution contains at the top the terms under which it may be
|
||||
# distributed.
|
||||
#
|
||||
# Since this particular file is relevant to all components of FLAC,
|
||||
# it may be distributed under the Xiph.Org license, which is the least
|
||||
# restrictive of those mentioned above. See the file COPYING.Xiph in this
|
||||
# distribution.
|
||||
|
||||
flac: libFLAC share
|
||||
libFLAC++: libFLAC
|
||||
metaflac: libFLAC share
|
||||
plugin_common: libFLAC
|
||||
plugin_xmms: libFLAC plugin_common
|
||||
share: libFLAC
|
||||
test_grabbag: share
|
||||
test_libs_common: libFLAC
|
||||
test_libFLAC++: libFLAC libFLAC++ test_libs_common
|
||||
test_libFLAC: libFLAC test_libs_common
|
||||
test_seeking: libFLAC
|
||||
test_streams: libFLAC
|
||||
flacdiff: libFLAC libFLAC++
|
||||
flactimer: libFLAC libFLAC++
|
||||
utils: flacdiff flactimer
|
|
@ -30,7 +30,7 @@
|
|||
|
||||
topdir = .
|
||||
|
||||
.PHONY: all doc src examples libFLAC libFLAC++ share plugin_common plugin_xmms flac metaflac test_grabbag test_libFLAC test_libFLAC++ test_seeking test_streams
|
||||
.PHONY: all doc src examples libFLAC libFLAC++ share plugin_common plugin_xmms flac metaflac test_grabbag test_libFLAC test_libFLAC++ test_seeking test_streams utils flacdiff flactimer
|
||||
all: doc src examples
|
||||
|
||||
DEFAULT_CONFIG = release
|
||||
|
@ -48,47 +48,14 @@ release : all
|
|||
doc:
|
||||
(cd $@ && $(MAKE) -f Makefile.lite)
|
||||
|
||||
src:
|
||||
src examples:
|
||||
(cd $@ && $(MAKE) -f Makefile.lite $(CONFIG))
|
||||
|
||||
examples: src
|
||||
(cd $@ && $(MAKE) -f Makefile.lite $(CONFIG))
|
||||
|
||||
libFLAC:
|
||||
libFLAC libFLAC++ share flac metaflac plugin_common plugin_xmms test_libs_common test_seeking test_streams test_grabbag test_libFLAC test_libFLAC++:
|
||||
(cd src/$@ && $(MAKE) -f Makefile.lite $(CONFIG))
|
||||
|
||||
libFLAC++: libFLAC
|
||||
(cd src/$@ && $(MAKE) -f Makefile.lite $(CONFIG))
|
||||
|
||||
share: libFLAC
|
||||
(cd src/$@ && $(MAKE) -f Makefile.lite $(CONFIG))
|
||||
|
||||
flac: libFLAC share
|
||||
(cd src/$@ && $(MAKE) -f Makefile.lite $(CONFIG))
|
||||
|
||||
metaflac: libFLAC share
|
||||
(cd src/$@ && $(MAKE) -f Makefile.lite $(CONFIG))
|
||||
|
||||
plugin_common: libFLAC
|
||||
(cd src/$@ && $(MAKE) -f Makefile.lite $(CONFIG))
|
||||
|
||||
plugin_xmms: libFLAC plugin_common
|
||||
(cd src/$@ && $(MAKE) -f Makefile.lite $(CONFIG))
|
||||
|
||||
test_seeking: libFLAC
|
||||
(cd src/$@ && $(MAKE) -f Makefile.lite $(CONFIG))
|
||||
|
||||
test_streams: libFLAC
|
||||
(cd src/$@ && $(MAKE) -f Makefile.lite $(CONFIG))
|
||||
|
||||
test_grabbag: share
|
||||
(cd src/$@ && $(MAKE) -f Makefile.lite $(CONFIG))
|
||||
|
||||
test_libFLAC: libFLAC
|
||||
(cd src/$@ && $(MAKE) -f Makefile.lite $(CONFIG))
|
||||
|
||||
test_libFLAC++: libFLAC libFLAC++
|
||||
(cd src/$@ && $(MAKE) -f Makefile.lite $(CONFIG))
|
||||
flacdiff flactimer:
|
||||
(cd src/utils/$@ && $(MAKE) -f Makefile.lite $(CONFIG))
|
||||
|
||||
test: debug
|
||||
(cd test && $(MAKE) -f Makefile.lite debug)
|
||||
|
@ -104,3 +71,6 @@ clean:
|
|||
-(cd src && $(MAKE) -f Makefile.lite clean)
|
||||
-(cd examples && $(MAKE) -f Makefile.lite clean)
|
||||
-(cd test && $(MAKE) -f Makefile.lite clean)
|
||||
|
||||
examples: libFLAC libFLAC++ share
|
||||
include $(topdir)/Makefile.deps
|
||||
|
|
|
@ -40,15 +40,15 @@
|
|||
|
||||
%.debug.o %.release.o : %.s
|
||||
ifeq ($(OS),Darwin)
|
||||
#$(CC) -c -arch ppc -Wall -force_cpusubtype_ALL $< -o $@
|
||||
$(AS) -arch ppc -force_cpusubtype_ALL $< -o $@
|
||||
#$(CC) -c -arch $(PROC) -Wall -force_cpusubtype_ALL $< -o $@
|
||||
$(AS) -arch $(PROC) -force_cpusubtype_ALL $< -o $@
|
||||
else
|
||||
$(AS) $< -o $@
|
||||
endif
|
||||
%.debug.pic.o %.release.pic.o : %.s
|
||||
ifeq ($(OS),Darwin)
|
||||
#$(CC) -c -arch ppc -Wall -force_cpusubtype_ALL $< -o $@
|
||||
$(AS) -arch ppc -force_cpusubtype_ALL $< -o $@
|
||||
#$(CC) -c -arch $(PROC) -Wall -force_cpusubtype_ALL $< -o $@
|
||||
$(AS) -arch $(PROC) -force_cpusubtype_ALL $< -o $@
|
||||
else
|
||||
$(AS) $< -o $@
|
||||
endif
|
||||
|
|
|
@ -15,16 +15,45 @@
|
|||
# restrictive of those mentioned above. See the file COPYING.Xiph in this
|
||||
# distribution.
|
||||
|
||||
#
|
||||
# customizable settings from the make invocation
|
||||
#
|
||||
|
||||
USE_OGG ?= 1
|
||||
USE_ICONV ?= 1
|
||||
|
||||
#
|
||||
# debug/release selection
|
||||
#
|
||||
|
||||
DEFAULT_BUILD = release
|
||||
|
||||
# returns i386, x86_64, powerpc, etc.
|
||||
PROC := $(shell uname -p)
|
||||
# returns Linux, Darwin, FreeBSD, etc.
|
||||
OS := $(shell uname -s)
|
||||
ifdef OS_OVERRIDE
|
||||
OS := $(OS_OVERRIDE)
|
||||
else
|
||||
OS := $(shell uname -s)
|
||||
endif
|
||||
# returns i386, x86_64, powerpc, etc.
|
||||
ifdef PROC_OVERRIDE
|
||||
PROC := $(PROC_OVERRIDE)
|
||||
else
|
||||
ifeq ($(findstring MINGW,$(OS)),MINGW)
|
||||
PROC := i386 # failsafe
|
||||
# ifeq (mingw32,$(shell gcc -dumpmachine)) # MinGW (mainline): mingw32
|
||||
ifeq ($(findstring i686,$(shell gcc -dumpmachine)),i686) # MinGW-w64: i686-w64-mingw32
|
||||
USE_ICONV := 0
|
||||
else ifeq ($(findstring x86_64,$(shell gcc -dumpmachine)),x86_64) # MinGW-w64: x86_64-w64-mingw32
|
||||
USE_ICONV := 0
|
||||
PROC := x86_64
|
||||
endif
|
||||
else
|
||||
PROC := $(shell uname -p)
|
||||
endif
|
||||
endif
|
||||
ifeq ($(PROC),powerpc)
|
||||
PROC := ppc
|
||||
endif
|
||||
|
||||
debug : BUILD = debug
|
||||
valgrind : BUILD = debug
|
||||
|
@ -32,7 +61,7 @@ release : BUILD = release
|
|||
|
||||
# override LINKAGE on OS X until we figure out how to get 'cc -static' to work
|
||||
ifeq ($(OS),Darwin)
|
||||
LINKAGE =
|
||||
LINKAGE = -arch $(PROC)
|
||||
else
|
||||
debug : LINKAGE = -static
|
||||
valgrind : LINKAGE = -dynamic
|
||||
|
@ -47,10 +76,39 @@ all default: $(DEFAULT_BUILD)
|
|||
|
||||
VERSION=\"1.2.1\"
|
||||
|
||||
CONFIG_CFLAGS=-DHAVE_STDINT_H -DHAVE_INTTYPES_H -DHAVE_CXX_VARARRAYS -DHAVE_LANGINFO_CODESET -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
|
||||
|
||||
ifeq ($(OS),Darwin)
|
||||
CONFIG_CFLAGS=-DHAVE_STDINT_H -DHAVE_ICONV -DHAVE_CXX_VARARRAYS -DHAVE_LANGINFO_CODESET -DFLAC__HAS_OGG -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DFLAC__SYS_DARWIN -DWORDS_BIGENDIAN
|
||||
CONFIG_CFLAGS += -DFLAC__SYS_DARWIN -arch $(PROC)
|
||||
else
|
||||
CONFIG_CFLAGS=-DHAVE_STDINT_H -DHAVE_ICONV -DHAVE_CXX_VARARRAYS -DHAVE_LANGINFO_CODESET -DHAVE_SOCKLEN_T -DFLAC__HAS_OGG -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
|
||||
CONFIG_CFLAGS += -DHAVE_SOCKLEN_T
|
||||
endif
|
||||
|
||||
ifeq ($(PROC),ppc)
|
||||
CONFIG_CFLAGS += -DWORDS_BIGENDIAN=1
|
||||
else
|
||||
CONFIG_CFLAGS += -DWORDS_BIGENDIAN=0
|
||||
endif
|
||||
|
||||
ifneq (0,$(USE_ICONV))
|
||||
CONFIG_CFLAGS += -DHAVE_ICONV
|
||||
ICONV_LIBS = -liconv
|
||||
else
|
||||
ICONV_LIBS =
|
||||
endif
|
||||
|
||||
ifneq (0,$(USE_OGG))
|
||||
CONFIG_CFLAGS += -DFLAC__HAS_OGG=1
|
||||
OGG_INCLUDES = -I$(OGG_INCLUDE_DIR)
|
||||
OGG_EXPLICIT_LIBS = $(OGG_LIB_DIR)/libogg.a
|
||||
OGG_LIBS = -L$(OGG_LIB_DIR) -logg
|
||||
OGG_SRCS = $(OGG_SRCS_C)
|
||||
else
|
||||
CONFIG_CFLAGS += -DFLAC__HAS_OGG=0
|
||||
OGG_INCLUDES =
|
||||
OGG_EXPLICIT_LIBS =
|
||||
OGG_LIBS =
|
||||
OGG_SRCS =
|
||||
endif
|
||||
|
||||
OGG_INCLUDE_DIR=$(HOME)/local/include
|
||||
|
|
|
@ -22,11 +22,11 @@
|
|||
include $(topdir)/build/config.mk
|
||||
|
||||
ifeq ($(OS),Darwin)
|
||||
CC = cc
|
||||
CCC = c++
|
||||
CC = cc
|
||||
CCC = c++
|
||||
else
|
||||
CC = gcc
|
||||
CCC = g++
|
||||
CC = gcc
|
||||
CCC = g++
|
||||
endif
|
||||
NASM = nasm
|
||||
LINK = $(CC) $(LINKAGE)
|
||||
|
|
23
build/lib.mk
23
build/lib.mk
|
@ -22,11 +22,11 @@
|
|||
include $(topdir)/build/config.mk
|
||||
|
||||
ifeq ($(OS),Darwin)
|
||||
CC = cc
|
||||
CCC = c++
|
||||
CC = cc
|
||||
CCC = c++
|
||||
else
|
||||
CC = gcc
|
||||
CCC = g++
|
||||
CC = gcc
|
||||
CCC = g++
|
||||
endif
|
||||
AS = as
|
||||
NASM = nasm
|
||||
|
@ -36,11 +36,14 @@ LIBPATH = $(OBJPATH)/$(BUILD)/lib
|
|||
DEBUG_LIBPATH = $(OBJPATH)/debug/lib
|
||||
RELEASE_LIBPATH = $(OBJPATH)/release/lib
|
||||
ifeq ($(OS),Darwin)
|
||||
STATIC_LIB_SUFFIX = a
|
||||
DYNAMIC_LIB_SUFFIX = dylib
|
||||
STATIC_LIB_SUFFIX = a
|
||||
DYNAMIC_LIB_SUFFIX = dylib
|
||||
else ifeq ($(findstring MINGW,$(OS)),MINGW)
|
||||
STATIC_LIB_SUFFIX = a
|
||||
DYNAMIC_LIB_SUFFIX = dll
|
||||
else
|
||||
STATIC_LIB_SUFFIX = a
|
||||
DYNAMIC_LIB_SUFFIX = so
|
||||
STATIC_LIB_SUFFIX = a
|
||||
DYNAMIC_LIB_SUFFIX = so
|
||||
endif
|
||||
STATIC_LIB_NAME = $(LIB_NAME).$(STATIC_LIB_SUFFIX)
|
||||
DYNAMIC_LIB_NAME = $(LIB_NAME).$(DYNAMIC_LIB_SUFFIX)
|
||||
|
@ -51,9 +54,9 @@ DEBUG_DYNAMIC_LIB = $(DEBUG_LIBPATH)/$(DYNAMIC_LIB_NAME)
|
|||
RELEASE_STATIC_LIB = $(RELEASE_LIBPATH)/$(STATIC_LIB_NAME)
|
||||
RELEASE_DYNAMIC_LIB = $(RELEASE_LIBPATH)/$(DYNAMIC_LIB_NAME)
|
||||
ifeq ($(OS),Darwin)
|
||||
LINKD = $(CC) -dynamiclib -flat_namespace -undefined suppress -install_name $(DYNAMIC_LIB)
|
||||
LINKD = $(CC) -dynamiclib -flat_namespace -undefined suppress -install_name $(DYNAMIC_LIB)
|
||||
else
|
||||
LINKD = $(CC) -shared
|
||||
LINKD = $(CC) -shared
|
||||
endif
|
||||
|
||||
debug : CFLAGS = -g -O0 -DDEBUG $(CONFIG_CFLAGS) $(DEBUG_CFLAGS) -W -Wall -Wmissing-prototypes -Wstrict-prototypes -DVERSION=$(VERSION) $(DEFINES) $(INCLUDES)
|
||||
|
|
|
@ -27,9 +27,9 @@ PROGRAM_NAME = example_c_decode_file
|
|||
INCLUDES = -I$(topdir)/include
|
||||
|
||||
ifeq ($(OS),Darwin)
|
||||
EXPLICIT_LIBS = $(libdir)/libFLAC.a $(OGG_LIB_DIR)/libogg.a -lm
|
||||
EXPLICIT_LIBS = $(libdir)/libFLAC.a $(OGG_EXPLICIT_LIBS) -lm
|
||||
else
|
||||
LIBS = -lFLAC -L$(OGG_LIB_DIR) -logg -lm
|
||||
LIBS = -lFLAC $(OGG_LIBS) -lm
|
||||
endif
|
||||
|
||||
SRCS_C = main.c
|
||||
|
|
|
@ -27,9 +27,9 @@ PROGRAM_NAME = example_c_encode_file
|
|||
INCLUDES = -I$(topdir)/include
|
||||
|
||||
ifeq ($(OS),Darwin)
|
||||
EXPLICIT_LIBS = $(libdir)/libFLAC.a $(OGG_LIB_DIR)/libogg.a -lm
|
||||
EXPLICIT_LIBS = $(libdir)/libFLAC.a $(OGG_EXPLICIT_LIBS) -lm
|
||||
else
|
||||
LIBS = -lFLAC -L$(OGG_LIB_DIR) -logg -lm
|
||||
LIBS = -lFLAC $(OGG_LIBS) -lm
|
||||
endif
|
||||
|
||||
SRCS_C = main.c
|
||||
|
|
|
@ -27,9 +27,9 @@ PROGRAM_NAME = example_cpp_decode_file
|
|||
INCLUDES = -I$(topdir)/include
|
||||
|
||||
ifeq ($(OS),Darwin)
|
||||
EXPLICIT_LIBS = $(libdir)/libFLAC++.a $(libdir)/libFLAC.a $(OGG_LIB_DIR)/libogg.a -lm
|
||||
EXPLICIT_LIBS = $(libdir)/libFLAC++.a $(libdir)/libFLAC.a $(OGG_EXPLICIT_LIBS) -lm
|
||||
else
|
||||
LIBS = -lFLAC++ -lFLAC -L$(OGG_LIB_DIR) -logg -lm
|
||||
LIBS = -lFLAC++ -lFLAC $(OGG_LIBS) -lm
|
||||
endif
|
||||
|
||||
SRCS_CPP = main.cpp
|
||||
|
|
|
@ -27,9 +27,9 @@ PROGRAM_NAME = example_cpp_encode_file
|
|||
INCLUDES = -I$(topdir)/include
|
||||
|
||||
ifeq ($(OS),Darwin)
|
||||
EXPLICIT_LIBS = $(libdir)/libFLAC++.a $(libdir)/libFLAC.a $(OGG_LIB_DIR)/libogg.a -lm
|
||||
EXPLICIT_LIBS = $(libdir)/libFLAC++.a $(libdir)/libFLAC.a $(OGG_EXPLICIT_LIBS) -lm
|
||||
else
|
||||
LIBS = -lFLAC++ -lFLAC -L$(OGG_LIB_DIR) -logg -lm
|
||||
LIBS = -lFLAC++ -lFLAC $(OGG_LIBS) -lm
|
||||
endif
|
||||
|
||||
SRCS_CPP = main.cpp
|
||||
|
|
|
@ -20,17 +20,17 @@ topdir = ..
|
|||
include $(topdir)/build/config.mk
|
||||
|
||||
ifeq ($(OS),Darwin)
|
||||
EXTRA_TARGETS =
|
||||
EXTRA_TARGETS =
|
||||
else
|
||||
ifeq ($(PROC),x86_64)
|
||||
EXTRA_TARGETS =
|
||||
EXTRA_TARGETS =
|
||||
else
|
||||
EXTRA_TARGETS = plugin_xmms
|
||||
EXTRA_TARGETS = plugin_xmms
|
||||
endif
|
||||
endif
|
||||
|
||||
.PHONY: all flac libFLAC libFLAC++ metaflac plugin_common plugin_xmms share test_grabbag test_libs_common test_libFLAC test_libFLAC++ test_seeking test_streams
|
||||
all: flac libFLAC libFLAC++ metaflac plugin_common $(EXTRA_TARGETS) share test_grabbag test_libs_common test_libFLAC test_libFLAC++ test_seeking test_streams
|
||||
.PHONY: all flac libFLAC libFLAC++ metaflac plugin_common plugin_xmms share test_grabbag test_libs_common test_libFLAC test_libFLAC++ test_seeking test_streams utils flacdiff flactimer
|
||||
all: flac libFLAC libFLAC++ metaflac plugin_common $(EXTRA_TARGETS) share test_grabbag test_libs_common test_libFLAC test_libFLAC++ test_seeking test_streams utils
|
||||
|
||||
DEFAULT_CONFIG = release
|
||||
|
||||
|
@ -44,9 +44,14 @@ debug : all
|
|||
valgrind: all
|
||||
release : all
|
||||
|
||||
all: flac libFLAC libFLAC++ metaflac plugin_common plugin_xmms share test_grabbag test_libs_common test_libFLAC test_libFLAC++ test_seeking test_streams utils
|
||||
|
||||
flac libFLAC libFLAC++ metaflac plugin_common plugin_xmms share test_grabbag test_libs_common test_libFLAC test_libFLAC++ test_seeking test_streams:
|
||||
(cd $@ ; $(MAKE) -f Makefile.lite $(CONFIG))
|
||||
|
||||
flacdiff flactimer:
|
||||
(cd utils/$@ ; $(MAKE) -f Makefile.lite $(CONFIG))
|
||||
|
||||
clean:
|
||||
-(cd flac ; $(MAKE) -f Makefile.lite clean)
|
||||
-(cd libFLAC ; $(MAKE) -f Makefile.lite clean)
|
||||
|
@ -61,15 +66,7 @@ clean:
|
|||
-(cd test_libFLAC++ ; $(MAKE) -f Makefile.lite clean)
|
||||
-(cd test_seeking ; $(MAKE) -f Makefile.lite clean)
|
||||
-(cd test_streams ; $(MAKE) -f Makefile.lite clean)
|
||||
-(cd utils/flacdiff ; $(MAKE) -f Makefile.lite clean)
|
||||
-(cd utils/flactimer ; $(MAKE) -f Makefile.lite clean)
|
||||
|
||||
flac: libFLAC share
|
||||
libFLAC++: libFLAC
|
||||
metaflac: libFLAC share
|
||||
plugin_common: libFLAC
|
||||
plugin_xmms: libFLAC plugin_common
|
||||
share: libFLAC
|
||||
test_grabbag: share
|
||||
test_libFLAC++: libFLAC libFLAC++ test_libs_common
|
||||
test_libFLAC: libFLAC test_libs_common
|
||||
test_seeking: libFLAC
|
||||
test_streams: libFLAC
|
||||
include $(topdir)/Makefile.deps
|
||||
|
|
|
@ -47,9 +47,9 @@ flac_SOURCES = \
|
|||
|
||||
flac_LDADD = \
|
||||
$(top_builddir)/src/share/utf8/libutf8.la \
|
||||
$(top_builddir)/src/share/replaygain_analysis/libreplaygain_analysis.la \
|
||||
$(top_builddir)/src/share/grabbag/libgrabbag.la \
|
||||
$(top_builddir)/src/share/getopt/libgetopt.a \
|
||||
$(top_builddir)/src/share/replaygain_analysis/libreplaygain_analysis.la \
|
||||
$(top_builddir)/src/share/replaygain_synthesis/libreplaygain_synthesis.la \
|
||||
$(top_builddir)/src/libFLAC/libFLAC.la \
|
||||
@OGG_LIBS@ \
|
||||
|
|
|
@ -24,12 +24,12 @@ libdir = $(topdir)/obj/$(BUILD)/lib
|
|||
|
||||
PROGRAM_NAME = flac
|
||||
|
||||
INCLUDES = -I./include -I$(topdir)/include -I$(OGG_INCLUDE_DIR)
|
||||
INCLUDES = -I./include -I$(topdir)/include $(OGG_INCLUDES)
|
||||
|
||||
ifeq ($(OS),Darwin)
|
||||
EXPLICIT_LIBS = $(libdir)/libgrabbag.a $(libdir)/libFLAC.a $(libdir)/libreplaygain_analysis.a $(libdir)/libreplaygain_synthesis.a $(libdir)/libgetopt.a $(libdir)/libutf8.a $(OGG_LIB_DIR)/libogg.a -liconv -lm
|
||||
EXPLICIT_LIBS = $(libdir)/libgrabbag.a $(libdir)/libFLAC.a $(libdir)/libreplaygain_analysis.a $(libdir)/libreplaygain_synthesis.a $(libdir)/libgetopt.a $(libdir)/libutf8.a $(OGG_EXPLICIT_LIBS) $(ICONV_LIBS) -lm
|
||||
else
|
||||
LIBS = -lgrabbag -lFLAC -lreplaygain_analysis -lreplaygain_synthesis -lgetopt -lutf8 -L$(OGG_LIB_DIR) -logg -lm
|
||||
LIBS = -lgrabbag -lFLAC -lreplaygain_analysis -lreplaygain_synthesis -lgetopt -lutf8 -lgrabbag $(OGG_LIBS) -lm
|
||||
endif
|
||||
|
||||
SRCS_C = \
|
||||
|
|
|
@ -24,12 +24,12 @@ libdir = $(topdir)/obj/$(BUILD)/lib
|
|||
|
||||
PROGRAM_NAME = iffscan
|
||||
|
||||
INCLUDES = -I./include -I$(topdir)/include -I$(OGG_INCLUDE_DIR)
|
||||
INCLUDES = -I./include -I$(topdir)/include $(OGG_INCLUDES)
|
||||
|
||||
ifeq ($(DARWIN_BUILD),yes)
|
||||
EXPLICIT_LIBS = $(libdir)/libFLAC.a $(OGG_LIB_DIR)/libogg.a -liconv -lm
|
||||
ifeq ($(OS),Darwin)
|
||||
EXPLICIT_LIBS = $(libdir)/libFLAC.a $(OGG_EXPLICIT_LIBS) $(ICONV_LIBS) -lm
|
||||
else
|
||||
LIBS = -lFLAC -L$(OGG_LIB_DIR) -logg -lm
|
||||
LIBS = -lFLAC $(OGG_LIBS) -lm
|
||||
endif
|
||||
|
||||
SRCS_C = \
|
||||
|
|
|
@ -33,6 +33,13 @@
|
|||
#
|
||||
|
||||
topdir = ../..
|
||||
libdir = $(topdir)/obj/$(BUILD)/lib
|
||||
|
||||
ifeq ($(OS),Darwin)
|
||||
EXPLICIT_LIBS = $(libdir)/libFLAC.a $(OGG_EXPLICIT_LIBS) -lm -lstdc++
|
||||
else
|
||||
LIBS = -lFLAC $(OGG_LIBS) -lm -lsupc++
|
||||
endif
|
||||
|
||||
LIB_NAME = libFLAC++
|
||||
INCLUDES = -I$(topdir)/include
|
||||
|
|
|
@ -34,21 +34,27 @@
|
|||
|
||||
topdir = ../..
|
||||
|
||||
LIB_NAME = libFLAC
|
||||
ifeq ($(OS),Darwin)
|
||||
DEFINES = -DFLAC__CPU_PPC -DFLAC__USE_ALTIVEC -DFLAC__ALIGN_MALLOC_DATA
|
||||
EXPLICIT_LIBS = $(OGG_EXPLICIT_LIBS) -lm
|
||||
else
|
||||
LIBS = $(OGG_LIBS) -lm
|
||||
endif
|
||||
|
||||
LIB_NAME = libFLAC
|
||||
ifeq ($(PROC),ppc)
|
||||
DEFINES = -DFLAC__CPU_PPC -DFLAC__USE_ALTIVEC -DFLAC__ALIGN_MALLOC_DATA
|
||||
else
|
||||
ifeq ($(OS),Solaris)
|
||||
DEFINES = -DFLAC__NO_ASM -DFLAC__ALIGN_MALLOC_DATA
|
||||
DEFINES = -DFLAC__NO_ASM -DFLAC__ALIGN_MALLOC_DATA
|
||||
else
|
||||
ifeq ($(PROC),i386)
|
||||
DEFINES = -DFLAC__CPU_IA32 -DFLAC__USE_3DNOW -DFLAC__HAS_NASM -DFLAC__ALIGN_MALLOC_DATA
|
||||
DEFINES = -DFLAC__CPU_IA32 -DFLAC__USE_3DNOW -DFLAC__HAS_NASM -DFLAC__ALIGN_MALLOC_DATA
|
||||
else
|
||||
DEFINES = -DFLAC__ALIGN_MALLOC_DATA
|
||||
DEFINES = -DFLAC__ALIGN_MALLOC_DATA
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
INCLUDES = -I./include -I$(topdir)/include -I$(OGG_INCLUDE_DIR)
|
||||
INCLUDES = -I./include -I$(topdir)/include $(OGG_INCLUDES)
|
||||
DEBUG_CFLAGS = -DFLAC__OVERFLOW_DETECT
|
||||
|
||||
ifeq ($(OS),Darwin)
|
||||
|
@ -65,6 +71,12 @@ SRCS_NASM = \
|
|||
endif
|
||||
endif
|
||||
|
||||
OGG_SRCS_C = \
|
||||
ogg_decoder_aspect.c \
|
||||
ogg_encoder_aspect.c \
|
||||
ogg_helper.c \
|
||||
ogg_mapping.c
|
||||
|
||||
SRCS_C = \
|
||||
bitmath.c \
|
||||
bitreader.c \
|
||||
|
@ -79,14 +91,11 @@ SRCS_C = \
|
|||
memory.c \
|
||||
metadata_iterators.c \
|
||||
metadata_object.c \
|
||||
ogg_decoder_aspect.c \
|
||||
ogg_encoder_aspect.c \
|
||||
ogg_helper.c \
|
||||
ogg_mapping.c \
|
||||
stream_decoder.c \
|
||||
stream_encoder.c \
|
||||
stream_encoder_framing.c \
|
||||
window.c
|
||||
window.c \
|
||||
$(OGG_SRCS)
|
||||
|
||||
include $(topdir)/build/lib.mk
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@
|
|||
#elif defined(__GNUC__)
|
||||
#define copysign __builtin_copysign
|
||||
#endif
|
||||
static inline long int lround(double x) {
|
||||
inline long int lround(double x) {
|
||||
return (long)(x + copysign (0.5, x));
|
||||
}
|
||||
//If this fails, we are in the precence of a mid 90's compiler..move along...
|
||||
|
|
|
@ -43,8 +43,8 @@ metaflac_SOURCES = \
|
|||
metaflac_LDFLAGS =
|
||||
|
||||
metaflac_LDADD = \
|
||||
$(top_builddir)/src/share/grabbag/libgrabbag.la \
|
||||
$(top_builddir)/src/share/replaygain_analysis/libreplaygain_analysis.la \
|
||||
$(top_builddir)/src/share/grabbag/libgrabbag.la \
|
||||
$(top_builddir)/src/share/getopt/libgetopt.a \
|
||||
$(top_builddir)/src/share/utf8/libutf8.la \
|
||||
$(top_builddir)/src/libFLAC/libFLAC.la \
|
||||
|
|
|
@ -24,12 +24,12 @@ libdir = $(topdir)/obj/$(BUILD)/lib
|
|||
|
||||
PROGRAM_NAME = metaflac
|
||||
|
||||
INCLUDES = -I./include -I$(topdir)/include -I$(OGG_INCLUDE_DIR)
|
||||
INCLUDES = -I./include -I$(topdir)/include $(OGG_INCLUDES)
|
||||
|
||||
ifeq ($(OS),Darwin)
|
||||
EXPLICIT_LIBS = $(libdir)/libgrabbag.a $(libdir)/libFLAC.a $(libdir)/libreplaygain_analysis.a $(libdir)/libgetopt.a $(libdir)/libutf8.a $(OGG_LIB_DIR)/libogg.a -liconv -lm
|
||||
EXPLICIT_LIBS = $(libdir)/libgrabbag.a $(libdir)/libFLAC.a $(libdir)/libreplaygain_analysis.a $(libdir)/libgetopt.a $(libdir)/libutf8.a $(OGG_EXPLICIT_LIBS) $(ICONV_LIBS) -lm
|
||||
else
|
||||
LIBS = -lgrabbag -lFLAC -lreplaygain_analysis -lgetopt -lutf8 -L$(OGG_LIB_DIR) -logg -lm
|
||||
LIBS = -lgrabbag -lFLAC -lreplaygain_analysis -lgetopt -lutf8 -lgrabbag $(OGG_LIBS) -lm
|
||||
endif
|
||||
|
||||
SRCS_C = \
|
||||
|
|
|
@ -20,14 +20,15 @@
|
|||
#
|
||||
|
||||
topdir = ../..
|
||||
libdir = $(topdir)/obj/$(BUILD)/lib
|
||||
|
||||
LIB_NAME = libxmms-flac
|
||||
INCLUDES = -I./include -I$(topdir)/include -I.. $(shell xmms-config --cflags)
|
||||
# refer to the static libs explicitly
|
||||
ifeq ($(OS),Darwin)
|
||||
LIBS = $(topdir)/obj/$(BUILD)/lib/libFLAC.a $(topdir)/obj/$(BUILD)/lib/libplugin_common.a $(topdir)/obj/$(BUILD)/lib/libgrabbag.a $(topdir)/obj/$(BUILD)/lib/libreplaygain_analysis.a $(topdir)/obj/$(BUILD)/lib/libreplaygain_synthesis.a $(OGG_LIB_DIR)/libogg.a -liconv -lstdc++ -lz
|
||||
LIBS = $(libdir)/libFLAC.a $(libdir)/libplugin_common.a $(libdir)/libgrabbag.a $(libdir)/libreplaygain_analysis.a $(libdir)/libreplaygain_synthesis.a $(OGG_EXPLICIT_LIBS) $(ICONV_LIBS) -lm -lstdc++ -lz
|
||||
else
|
||||
LIBS = $(topdir)/obj/$(BUILD)/lib/libFLAC.a $(topdir)/obj/$(BUILD)/lib/libplugin_common.a $(topdir)/obj/$(BUILD)/lib/libgrabbag.a $(topdir)/obj/$(BUILD)/lib/libreplaygain_analysis.a $(topdir)/obj/$(BUILD)/lib/libreplaygain_synthesis.a -L$(OGG_LIB_DIR) -logg -lstdc++ -lz
|
||||
LIBS = $(libdir)/libFLAC.a $(libdir)/libplugin_common.a $(libdir)/libgrabbag.a $(libdir)/libreplaygain_analysis.a $(libdir)/libreplaygain_synthesis.a $(OGG_LIBS) -lm -lsupc++ -lz
|
||||
endif
|
||||
|
||||
SRCS_C = \
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
# distribution.
|
||||
|
||||
.PHONY: all getopt grabbag replaygain_analysis replaygain_synthesis utf8
|
||||
all: getopt grabbag replaygain_analysis replaygain_synthesis utf8
|
||||
all: getopt replaygain_analysis grabbag replaygain_synthesis utf8
|
||||
|
||||
DEFAULT_CONFIG = release
|
||||
|
||||
|
@ -33,10 +33,10 @@ release : all
|
|||
getopt:
|
||||
(cd $@ ; $(MAKE) -f Makefile.lite $(CONFIG))
|
||||
|
||||
grabbag:
|
||||
replaygain_analysis:
|
||||
(cd $@ ; $(MAKE) -f Makefile.lite $(CONFIG))
|
||||
|
||||
replaygain_analysis:
|
||||
grabbag:
|
||||
(cd $@ ; $(MAKE) -f Makefile.lite $(CONFIG))
|
||||
|
||||
replaygain_synthesis:
|
||||
|
|
|
@ -3,11 +3,19 @@
|
|||
#
|
||||
|
||||
topdir = ../../..
|
||||
libdir = $(topdir)/obj/$(BUILD)/lib
|
||||
|
||||
ifeq ($(OS),Darwin)
|
||||
EXPLICIT_LIBS = $(libdir)/libFLAC.a $(libdir)/libreplaygain_analysis.a $(OGG_EXPLICIT_LIBS) -lm
|
||||
else
|
||||
LIBS = -lFLAC -lreplaygain_analysis $(OGG_LIBS) -lm
|
||||
endif
|
||||
|
||||
LIB_NAME = libgrabbag
|
||||
INCLUDES = -I$(topdir)/include
|
||||
|
||||
SRCS_C = \
|
||||
alloc.c \
|
||||
cuesheet.c \
|
||||
file.c \
|
||||
picture.c \
|
||||
|
|
|
@ -3,8 +3,16 @@
|
|||
#
|
||||
|
||||
topdir = ../../..
|
||||
libdir = $(topdir)/obj/$(BUILD)/lib
|
||||
|
||||
LIB_NAME = libutf8
|
||||
|
||||
ifeq ($(OS),Darwin)
|
||||
EXPLICIT_LIBS = $(libdir)/libgrabbag.a $(ICONV_LIBS)
|
||||
else
|
||||
LIBS = -lgrabbag $(ICONV_LIBS)
|
||||
endif
|
||||
|
||||
INCLUDES = -I$(topdir)/include -I$(topdir)/include/share
|
||||
|
||||
SRCS_C = \
|
||||
|
|
|
@ -27,9 +27,9 @@ PROGRAM_NAME = test_cuesheet
|
|||
INCLUDES = -I./include -I$(topdir)/include
|
||||
|
||||
ifeq ($(OS),Darwin)
|
||||
EXPLICIT_LIBS = $(libdir)/libgrabbag.a $(libdir)/libreplaygain_analysis.a $(libdir)/libFLAC.a $(OGG_LIB_DIR)/libogg.a -lm
|
||||
EXPLICIT_LIBS = $(libdir)/libgrabbag.a $(libdir)/libreplaygain_analysis.a $(libdir)/libFLAC.a $(OGG_EXPLICIT_LIBS) -lm
|
||||
else
|
||||
LIBS = -lgrabbag -lreplaygain_analysis -lFLAC -L$(OGG_LIB_DIR) -logg -lm
|
||||
LIBS = -lgrabbag -lreplaygain_analysis -lFLAC $(OGG_LIBS) -lm
|
||||
endif
|
||||
|
||||
SRCS_C = \
|
||||
|
|
|
@ -27,9 +27,9 @@ PROGRAM_NAME = test_picture
|
|||
INCLUDES = -I./include -I$(topdir)/include
|
||||
|
||||
ifeq ($(OS),Darwin)
|
||||
EXPLICIT_LIBS = $(libdir)/libgrabbag.a $(libdir)/libreplaygain_analysis.a $(libdir)/libFLAC.a $(OGG_LIB_DIR)/libogg.a -lm
|
||||
EXPLICIT_LIBS = $(libdir)/libgrabbag.a $(libdir)/libreplaygain_analysis.a $(libdir)/libFLAC.a $(OGG_EXPLICIT_LIBS) -lm
|
||||
else
|
||||
LIBS = -lgrabbag -lreplaygain_analysis -lFLAC -L$(OGG_LIB_DIR) -logg -lm
|
||||
LIBS = -lgrabbag -lreplaygain_analysis -lFLAC $(OGG_LIBS) -lm
|
||||
endif
|
||||
|
||||
SRCS_C = \
|
||||
|
|
|
@ -27,9 +27,9 @@ PROGRAM_NAME = test_libFLAC++
|
|||
INCLUDES = -I$(topdir)/include
|
||||
|
||||
ifeq ($(OS),Darwin)
|
||||
EXPLICIT_LIBS = $(libdir)/libgrabbag.a $(libdir)/libreplaygain_analysis.a $(libdir)/libtest_libs_common.a $(libdir)/libFLAC++.a $(libdir)/libFLAC.a $(OGG_LIB_DIR)/libogg.a -lm
|
||||
EXPLICIT_LIBS = $(libdir)/libgrabbag.a $(libdir)/libreplaygain_analysis.a $(libdir)/libtest_libs_common.a $(libdir)/libFLAC++.a $(libdir)/libFLAC.a $(OGG_EXPLICIT_LIBS) -lm
|
||||
else
|
||||
LIBS = -lgrabbag -lreplaygain_analysis -ltest_libs_common -lFLAC++ -lFLAC -L$(OGG_LIB_DIR) -logg -lm
|
||||
LIBS = -lgrabbag -lreplaygain_analysis -ltest_libs_common -lFLAC++ -lFLAC $(OGG_LIBS) -lm
|
||||
endif
|
||||
|
||||
SRCS_CPP = \
|
||||
|
|
|
@ -27,9 +27,9 @@ PROGRAM_NAME = test_libFLAC
|
|||
INCLUDES = -I../libFLAC/include -I$(topdir)/include
|
||||
|
||||
ifeq ($(OS),Darwin)
|
||||
EXPLICIT_LIBS = $(libdir)/libgrabbag.a $(libdir)/libreplaygain_analysis.a $(libdir)/libtest_libs_common.a $(libdir)/libFLAC.a $(OGG_LIB_DIR)/libogg.a -lm
|
||||
EXPLICIT_LIBS = $(libdir)/libgrabbag.a $(libdir)/libreplaygain_analysis.a $(libdir)/libtest_libs_common.a $(libdir)/libFLAC.a $(OGG_EXPLICIT_LIBS) -lm
|
||||
else
|
||||
LIBS = -lgrabbag -lreplaygain_analysis -ltest_libs_common -lFLAC -L$(OGG_LIB_DIR) -logg -lm
|
||||
LIBS = -lgrabbag -lreplaygain_analysis -ltest_libs_common -lFLAC $(OGG_LIBS) -lm
|
||||
endif
|
||||
|
||||
SRCS_C = \
|
||||
|
|
|
@ -24,6 +24,12 @@ libdir = $(topdir)/obj/$(BUILD)/lib
|
|||
|
||||
LIB_NAME = libtest_libs_common
|
||||
|
||||
ifeq ($(OS),Darwin)
|
||||
EXPLICIT_LIBS = $(libdir)/libFLAC.a $(OGG_EXPLICIT_LIBS) -lm
|
||||
else
|
||||
LIBS = -lFLAC $(OGG_LIBS) -lm
|
||||
endif
|
||||
|
||||
INCLUDES = -I$(topdir)/include
|
||||
|
||||
SRCS_C = \
|
||||
|
|
|
@ -27,9 +27,9 @@ PROGRAM_NAME = test_seeking
|
|||
INCLUDES = -I../libFLAC/include -I$(topdir)/include
|
||||
|
||||
ifeq ($(OS),Darwin)
|
||||
EXPLICIT_LIBS = $(libdir)/libFLAC.a $(OGG_LIB_DIR)/libogg.a -lm
|
||||
EXPLICIT_LIBS = $(libdir)/libFLAC.a $(OGG_EXPLICIT_LIBS) -lm
|
||||
else
|
||||
LIBS = -lFLAC -L$(OGG_LIB_DIR) -logg -lm
|
||||
LIBS = -lFLAC $(OGG_LIBS) -lm
|
||||
endif
|
||||
|
||||
SRCS_C = \
|
||||
|
|
|
@ -27,9 +27,9 @@ PROGRAM_NAME = flacdiff
|
|||
INCLUDES = -I$(topdir)/include
|
||||
|
||||
ifeq ($(OS),Darwin)
|
||||
EXPLICIT_LIBS = $(libdir)/libFLAC++.a $(libdir)/libFLAC.a $(OGG_LIB_DIR)/libogg.a -lm
|
||||
EXPLICIT_LIBS = $(libdir)/libFLAC++.a $(libdir)/libFLAC.a $(OGG_EXPLICIT_LIBS) -lm
|
||||
else
|
||||
LIBS = -lFLAC++ -lFLAC -L$(OGG_LIB_DIR) -logg -lm
|
||||
LIBS = -lFLAC++ -lFLAC $(OGG_LIBS) -lm
|
||||
endif
|
||||
|
||||
SRCS_CPP = \
|
||||
|
|
|
@ -0,0 +1,42 @@
|
|||
# flactimer - Runs a command and prints timing information
|
||||
# Copyright (C) 2007,2008,2009 Josh Coalson
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
#
|
||||
# GNU makefile
|
||||
#
|
||||
|
||||
topdir = ../../..
|
||||
libdir = $(topdir)/obj/$(BUILD)/lib
|
||||
|
||||
PROGRAM_NAME = flactimer
|
||||
|
||||
INCLUDES = -I$(topdir)/include
|
||||
|
||||
ifeq ($(OS),Darwin)
|
||||
EXPLICIT_LIBS = $(libdir)/libFLAC++.a $(libdir)/libFLAC.a $(OGG_EXPLICIT_LIBS) -lm
|
||||
else
|
||||
LIBS = -lFLAC++ -lFLAC $(OGG_LIBS) -lm
|
||||
endif
|
||||
|
||||
SRCS_CPP = \
|
||||
main.cpp
|
||||
|
||||
include $(topdir)/build/exe.mk
|
||||
|
||||
LINK = $(CCC) $(LINKAGE)
|
||||
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
Loading…
Reference in New Issue