Commit 96d081c1 authored by Hendricks266's avatar Hendricks266 Committed by Erik de Castro Lopo
Browse files

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's avatarErik de Castro Lopo <erikd@mega-nerd.com>
parent 0da96d3c
...@@ -2,6 +2,9 @@ ...@@ -2,6 +2,9 @@
*.la *.la
*.lo *.lo
*.so *.so
*.dll
*.dylib
*.exe
.deps .deps
.libs .libs
Makefile Makefile
......
# 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 @@ ...@@ -30,7 +30,7 @@
topdir = . 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 all: doc src examples
DEFAULT_CONFIG = release DEFAULT_CONFIG = release
...@@ -48,47 +48,14 @@ release : all ...@@ -48,47 +48,14 @@ release : all
doc: doc:
(cd $@ && $(MAKE) -f Makefile.lite) (cd $@ && $(MAKE) -f Makefile.lite)
src: src examples:
(cd $@ && $(MAKE) -f Makefile.lite $(CONFIG)) (cd $@ && $(MAKE) -f Makefile.lite $(CONFIG))
examples: src libFLAC libFLAC++ share flac metaflac plugin_common plugin_xmms test_libs_common test_seeking test_streams test_grabbag test_libFLAC test_libFLAC++:
(cd $@ && $(MAKE) -f Makefile.lite $(CONFIG))
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)) (cd src/$@ && $(MAKE) -f Makefile.lite $(CONFIG))
plugin_xmms: libFLAC plugin_common flacdiff flactimer:
(cd src/$@ && $(MAKE) -f Makefile.lite $(CONFIG)) (cd src/utils/$@ && $(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))
test: debug test: debug
(cd test && $(MAKE) -f Makefile.lite debug) (cd test && $(MAKE) -f Makefile.lite debug)
...@@ -104,3 +71,6 @@ clean: ...@@ -104,3 +71,6 @@ clean:
-(cd src && $(MAKE) -f Makefile.lite clean) -(cd src && $(MAKE) -f Makefile.lite clean)
-(cd examples && $(MAKE) -f Makefile.lite clean) -(cd examples && $(MAKE) -f Makefile.lite clean)
-(cd test && $(MAKE) -f Makefile.lite clean) -(cd test && $(MAKE) -f Makefile.lite clean)
examples: libFLAC libFLAC++ share
include $(topdir)/Makefile.deps
...@@ -40,15 +40,15 @@ ...@@ -40,15 +40,15 @@
%.debug.o %.release.o : %.s %.debug.o %.release.o : %.s
ifeq ($(OS),Darwin) ifeq ($(OS),Darwin)
#$(CC) -c -arch ppc -Wall -force_cpusubtype_ALL $< -o $@ #$(CC) -c -arch $(PROC) -Wall -force_cpusubtype_ALL $< -o $@
$(AS) -arch ppc -force_cpusubtype_ALL $< -o $@ $(AS) -arch $(PROC) -force_cpusubtype_ALL $< -o $@
else else
$(AS) $< -o $@ $(AS) $< -o $@
endif endif
%.debug.pic.o %.release.pic.o : %.s %.debug.pic.o %.release.pic.o : %.s
ifeq ($(OS),Darwin) ifeq ($(OS),Darwin)
#$(CC) -c -arch ppc -Wall -force_cpusubtype_ALL $< -o $@ #$(CC) -c -arch $(PROC) -Wall -force_cpusubtype_ALL $< -o $@
$(AS) -arch ppc -force_cpusubtype_ALL $< -o $@ $(AS) -arch $(PROC) -force_cpusubtype_ALL $< -o $@
else else
$(AS) $< -o $@ $(AS) $< -o $@
endif endif
......
...@@ -15,16 +15,45 @@ ...@@ -15,16 +15,45 @@
# restrictive of those mentioned above. See the file COPYING.Xiph in this # restrictive of those mentioned above. See the file COPYING.Xiph in this
# distribution. # distribution.
#
# customizable settings from the make invocation
#
USE_OGG ?= 1
USE_ICONV ?= 1
# #
# debug/release selection # debug/release selection
# #
DEFAULT_BUILD = release DEFAULT_BUILD = release
# returns i386, x86_64, powerpc, etc.
PROC := $(shell uname -p)
# returns Linux, Darwin, FreeBSD, etc. # 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 debug : BUILD = debug
valgrind : BUILD = debug valgrind : BUILD = debug
...@@ -32,7 +61,7 @@ release : BUILD = release ...@@ -32,7 +61,7 @@ release : BUILD = release
# override LINKAGE on OS X until we figure out how to get 'cc -static' to work # override LINKAGE on OS X until we figure out how to get 'cc -static' to work
ifeq ($(OS),Darwin) ifeq ($(OS),Darwin)
LINKAGE = LINKAGE = -arch $(PROC)
else else
debug : LINKAGE = -static debug : LINKAGE = -static
valgrind : LINKAGE = -dynamic valgrind : LINKAGE = -dynamic
...@@ -47,10 +76,39 @@ all default: $(DEFAULT_BUILD) ...@@ -47,10 +76,39 @@ all default: $(DEFAULT_BUILD)
VERSION=\"1.2.1\" 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) 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_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 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 += -DFLAC__HAS_OGG=0
OGG_INCLUDES =
OGG_EXPLICIT_LIBS =
OGG_LIBS =
OGG_SRCS =
endif endif
OGG_INCLUDE_DIR=$(HOME)/local/include OGG_INCLUDE_DIR=$(HOME)/local/include
......
...@@ -22,11 +22,11 @@ ...@@ -22,11 +22,11 @@
include $(topdir)/build/config.mk include $(topdir)/build/config.mk
ifeq ($(OS),Darwin) ifeq ($(OS),Darwin)
CC = cc CC = cc
CCC = c++ CCC = c++
else else
CC = gcc CC = gcc
CCC = g++ CCC = g++
endif endif
NASM = nasm NASM = nasm
LINK = $(CC) $(LINKAGE) LINK = $(CC) $(LINKAGE)
......
...@@ -22,11 +22,11 @@ ...@@ -22,11 +22,11 @@
include $(topdir)/build/config.mk include $(topdir)/build/config.mk
ifeq ($(OS),Darwin) ifeq ($(OS),Darwin)
CC = cc CC = cc
CCC = c++ CCC = c++
else else
CC = gcc CC = gcc
CCC = g++ CCC = g++
endif endif
AS = as AS = as
NASM = nasm NASM = nasm
...@@ -36,11 +36,14 @@ LIBPATH = $(OBJPATH)/$(BUILD)/lib ...@@ -36,11 +36,14 @@ LIBPATH = $(OBJPATH)/$(BUILD)/lib
DEBUG_LIBPATH = $(OBJPATH)/debug/lib DEBUG_LIBPATH = $(OBJPATH)/debug/lib
RELEASE_LIBPATH = $(OBJPATH)/release/lib RELEASE_LIBPATH = $(OBJPATH)/release/lib
ifeq ($(OS),Darwin) ifeq ($(OS),Darwin)
STATIC_LIB_SUFFIX = a STATIC_LIB_SUFFIX = a
DYNAMIC_LIB_SUFFIX = dylib DYNAMIC_LIB_SUFFIX = dylib
else ifeq ($(findstring MINGW,$(OS)),MINGW)
STATIC_LIB_SUFFIX = a
DYNAMIC_LIB_SUFFIX = dll
else else
STATIC_LIB_SUFFIX = a STATIC_LIB_SUFFIX = a
DYNAMIC_LIB_SUFFIX = so DYNAMIC_LIB_SUFFIX = so
endif endif
STATIC_LIB_NAME = $(LIB_NAME).$(STATIC_LIB_SUFFIX) STATIC_LIB_NAME = $(LIB_NAME).$(STATIC_LIB_SUFFIX)
DYNAMIC_LIB_NAME = $(LIB_NAME).$(DYNAMIC_LIB_SUFFIX) DYNAMIC_LIB_NAME = $(LIB_NAME).$(DYNAMIC_LIB_SUFFIX)
...@@ -51,9 +54,9 @@ DEBUG_DYNAMIC_LIB = $(DEBUG_LIBPATH)/$(DYNAMIC_LIB_NAME) ...@@ -51,9 +54,9 @@ DEBUG_DYNAMIC_LIB = $(DEBUG_LIBPATH)/$(DYNAMIC_LIB_NAME)
RELEASE_STATIC_LIB = $(RELEASE_LIBPATH)/$(STATIC_LIB_NAME) RELEASE_STATIC_LIB = $(RELEASE_LIBPATH)/$(STATIC_LIB_NAME)
RELEASE_DYNAMIC_LIB = $(RELEASE_LIBPATH)/$(DYNAMIC_LIB_NAME) RELEASE_DYNAMIC_LIB = $(RELEASE_LIBPATH)/$(DYNAMIC_LIB_NAME)
ifeq ($(OS),Darwin) 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 else
LINKD = $(CC) -shared LINKD = $(CC) -shared
endif endif
debug : CFLAGS = -g -O0 -DDEBUG $(CONFIG_CFLAGS) $(DEBUG_CFLAGS) -W -Wall -Wmissing-prototypes -Wstrict-prototypes -DVERSION=$(VERSION) $(DEFINES) $(INCLUDES) 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 ...@@ -27,9 +27,9 @@ PROGRAM_NAME = example_c_decode_file
INCLUDES = -I$(topdir)/include INCLUDES = -I$(topdir)/include
ifeq ($(OS),Darwin) ifeq ($(OS),Darwin)
EXPLICIT_LIBS = $(libdir)/libFLAC.a $(OGG_LIB_DIR)/libogg.a -lm EXPLICIT_LIBS = $(libdir)/libFLAC.a $(OGG_EXPLICIT_LIBS) -lm
else else
LIBS = -lFLAC -L$(OGG_LIB_DIR) -logg -lm LIBS = -lFLAC $(OGG_LIBS) -lm
endif endif
SRCS_C = main.c SRCS_C = main.c
......
...@@ -27,9 +27,9 @@ PROGRAM_NAME = example_c_encode_file ...@@ -27,9 +27,9 @@ PROGRAM_NAME = example_c_encode_file
INCLUDES = -I$(topdir)/include INCLUDES = -I$(topdir)/include
ifeq ($(OS),Darwin) ifeq ($(OS),Darwin)
EXPLICIT_LIBS = $(libdir)/libFLAC.a $(OGG_LIB_DIR)/libogg.a -lm EXPLICIT_LIBS = $(libdir)/libFLAC.a $(OGG_EXPLICIT_LIBS) -lm
else else
LIBS = -lFLAC -L$(OGG_LIB_DIR) -logg -lm LIBS = -lFLAC $(OGG_LIBS) -lm
endif endif
SRCS_C = main.c SRCS_C = main.c
......
...@@ -27,9 +27,9 @@ PROGRAM_NAME = example_cpp_decode_file ...@@ -27,9 +27,9 @@ PROGRAM_NAME = example_cpp_decode_file
INCLUDES = -I$(topdir)/include INCLUDES = -I$(topdir)/include
ifeq ($(OS),Darwin) 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 else
LIBS = -lFLAC++ -lFLAC -L$(OGG_LIB_DIR) -logg -lm LIBS = -lFLAC++ -lFLAC $(OGG_LIBS) -lm
endif endif
SRCS_CPP = main.cpp SRCS_CPP = main.cpp
......
...@@ -27,9 +27,9 @@ PROGRAM_NAME = example_cpp_encode_file ...@@ -27,9 +27,9 @@ PROGRAM_NAME = example_cpp_encode_file
INCLUDES = -I$(topdir)/include INCLUDES = -I$(topdir)/include
ifeq ($(OS),Darwin) 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 else
LIBS = -lFLAC++ -lFLAC -L$(OGG_LIB_DIR) -logg -lm LIBS = -lFLAC++ -lFLAC $(OGG_LIBS) -lm
endif endif
SRCS_CPP = main.cpp SRCS_CPP = main.cpp
......
...@@ -20,17 +20,17 @@ topdir = .. ...@@ -20,17 +20,17 @@ topdir = ..
include $(topdir)/build/config.mk include $(topdir)/build/config.mk
ifeq ($(OS),Darwin) ifeq ($(OS),Darwin)
EXTRA_TARGETS = EXTRA_TARGETS =
else else
ifeq ($(PROC),x86_64) ifeq ($(PROC),x86_64)
EXTRA_TARGETS = EXTRA_TARGETS =
else else
EXTRA_TARGETS = plugin_xmms EXTRA_TARGETS = plugin_xmms
endif endif
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 .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 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 DEFAULT_CONFIG = release
...@@ -44,9 +44,14 @@ debug : all ...@@ -44,9 +44,14 @@ debug : all
valgrind: all valgrind: all
release : 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: 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)) (cd $@ ; $(MAKE) -f Makefile.lite $(CONFIG))
flacdiff flactimer:
(cd utils/$@ ; $(MAKE) -f Makefile.lite $(CONFIG))
clean: clean:
-(cd flac ; $(MAKE) -f Makefile.lite clean) -(cd flac ; $(MAKE) -f Makefile.lite clean)
-(cd libFLAC ; $(MAKE) -f Makefile.lite clean) -(cd libFLAC ; $(MAKE) -f Makefile.lite clean)
...@@ -61,15 +66,7 @@ clean: ...@@ -61,15 +66,7 @@ clean:
-(cd test_libFLAC++ ; $(MAKE) -f Makefile.lite clean) -(cd test_libFLAC++ ; $(MAKE) -f Makefile.lite clean)
-(cd test_seeking ; $(MAKE) -f Makefile.lite clean) -(cd test_seeking ; $(MAKE) -f Makefile.lite clean)
-(cd test_streams ; $(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 include $(topdir)/Makefile.deps
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
...@@ -47,9 +47,9 @@ flac_SOURCES = \ ...@@ -47,9 +47,9 @@ flac_SOURCES = \
flac_LDADD = \ flac_LDADD = \
$(top_builddir)/src/share/utf8/libutf8.la \ $(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/grabbag/libgrabbag.la \
$(top_builddir)/src/share/getopt/libgetopt.a \ $(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/share/replaygain_synthesis/libreplaygain_synthesis.la \
$(top_builddir)/src/libFLAC/libFLAC.la \ $(top_builddir)/src/libFLAC/libFLAC.la \
@OGG_LIBS@ \ @OGG_LIBS@ \
......
...@@ -24,12 +24,12 @@ libdir = $(topdir)/obj/$(BUILD)/lib ...@@ -24,12 +24,12 @@ libdir = $(topdir)/obj/$(BUILD)/lib
PROGRAM_NAME = flac PROGRAM_NAME = flac
INCLUDES = -I./include -I$(topdir)/include -I$(OGG_INCLUDE_DIR) INCLUDES = -I./include -I$(topdir)/include $(OGG_INCLUDES)
ifeq ($(OS),Darwin) 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 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 endif
SRCS_C = \ SRCS_C = \
......
...@@ -24,12 +24,12 @@ libdir = $(topdir)/obj/$(BUILD)/lib ...@@ -24,12 +24,12 @@ libdir = $(topdir)/obj/$(BUILD)/lib
PROGRAM_NAME = iffscan 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) ifeq ($(OS),Darwin)
EXPLICIT_LIBS = $(libdir)/libFLAC.a $(OGG_LIB_DIR)/libogg.a -liconv -lm EXPLICIT_LIBS = $(libdir)/libFLAC.a $(OGG_EXPLICIT_LIBS) $(ICONV_LIBS) -lm
else else
LIBS = -lFLAC -L$(OGG_LIB_DIR) -logg -lm LIBS = -lFLAC $(OGG_LIBS) -lm
endif endif
SRCS_C = \ SRCS_C = \
......
...@@ -33,6 +33,13 @@ ...@@ -33,6 +33,13 @@
# #
topdir = ../.. 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++ LIB_NAME = libFLAC++
INCLUDES = -I$(topdir)/include INCLUDES = -I$(topdir)/include
......
...@@ -34,21 +34,27 @@ ...@@ -34,21 +34,27 @@
topdir = ../.. topdir = ../..
LIB_NAME = libFLAC
ifeq ($(OS),Darwin) 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 else
ifeq ($(OS),Solaris) ifeq ($(OS),Solaris)
DEFINES = -DFLAC__NO_ASM -DFLAC__ALIGN_MALLOC_DATA DEFINES = -DFLAC__NO_ASM -DFLAC__ALIGN_MALLOC_DATA
else else
ifeq ($(PROC),i386) 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 else
DEFINES = -DFLAC__ALIGN_MALLOC_DATA DEFINES = -DFLAC__ALIGN_MALLOC_DATA
endif