Declare UTF-8 encoding for changelog
[platform/upstream/flac.git] / build / config.mk
1 #  FLAC - Free Lossless Audio Codec
2 #  Copyright (C) 2001-2009  Josh Coalson
3 #  Copyright (C) 2011-2013  Xiph.Org Foundation
4 #
5 #  This file is part the FLAC project.  FLAC is comprised of several
6 #  components distributed under difference licenses.  The codec libraries
7 #  are distributed under Xiph.Org's BSD-like license (see the file
8 #  COPYING.Xiph in this distribution).  All other programs, libraries, and
9 #  plugins are distributed under the GPL (see COPYING.GPL).  The documentation
10 #  is distributed under the Gnu FDL (see COPYING.FDL).  Each file in the
11 #  FLAC distribution contains at the top the terms under which it may be
12 #  distributed.
13 #
14 #  Since this particular file is relevant to all components of FLAC,
15 #  it may be distributed under the Xiph.Org license, which is the least
16 #  restrictive of those mentioned above.  See the file COPYING.Xiph in this
17 #  distribution.
18
19 #
20 # customizable settings from the make invocation
21 #
22
23 USE_OGG     ?= 1
24 USE_ICONV   ?= 1
25
26 #
27 # debug/release selection
28 #
29
30 DEFAULT_BUILD = release
31
32 # returns Linux, Darwin, FreeBSD, etc.
33 ifdef OS_OVERRIDE
34     OS := $(OS_OVERRIDE)
35 else
36     OS := $(shell uname -s)
37 endif
38 # returns i386, x86_64, powerpc, etc.
39 ifdef PROC_OVERRIDE
40     PROC := $(PROC_OVERRIDE)
41 else
42     ifeq ($(findstring MINGW,$(OS)),MINGW)
43         PROC := i386 # failsafe
44         # ifeq (mingw32,$(shell gcc -dumpmachine)) # MinGW (mainline): mingw32
45         ifeq ($(findstring i686,$(shell gcc -dumpmachine)),i686) # MinGW-w64: i686-w64-mingw32
46             USE_ICONV := 0
47         else ifeq ($(findstring x86_64,$(shell gcc -dumpmachine)),x86_64) # MinGW-w64: x86_64-w64-mingw32
48             USE_ICONV := 0
49             PROC := x86_64
50         endif
51     else
52         PROC := $(shell uname -p)
53     endif
54 endif
55 ifeq ($(PROC),powerpc)
56     PROC := ppc
57 endif
58
59 ifeq ($(OS),Linux)
60     PROC := $(shell uname -m)
61     USE_ICONV := 0
62 endif
63
64 debug    : BUILD = debug
65 valgrind : BUILD = debug
66 release  : BUILD = release
67
68 # override LINKAGE on OS X until we figure out how to get 'cc -static' to work
69 ifeq ($(OS),Darwin)
70 LINKAGE = -arch $(PROC)
71 else
72 debug    : LINKAGE = -static
73 valgrind : LINKAGE = -dynamic
74 release  : LINKAGE = -static
75 endif
76
77 all default: $(DEFAULT_BUILD)
78
79 #
80 # GNU makefile fragment for emulating stuff normally done by configure
81 #
82
83 VERSION=\"1.3.0\"
84
85 CONFIG_CFLAGS=-DHAVE_STDINT_H -DHAVE_INTTYPES_H -DHAVE_CXX_VARARRAYS -DHAVE_LANGINFO_CODESET -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
86
87 ifeq ($(OS),Darwin)
88     CONFIG_CFLAGS += -DFLAC__SYS_DARWIN -arch $(PROC)
89 else
90     CONFIG_CFLAGS += -DHAVE_SOCKLEN_T
91 endif
92
93 ifeq ($(PROC),ppc)
94     CONFIG_CFLAGS += -DWORDS_BIGENDIAN=1
95 else
96     CONFIG_CFLAGS += -DWORDS_BIGENDIAN=0
97 endif
98
99 ifeq ($(OS),Linux)
100         ifeq ($(PROC),x86_64)
101         CONFIG_CFLAGS += -fPIC
102         endif
103 endif
104
105 ifneq (0,$(USE_ICONV))
106     CONFIG_CFLAGS += -DHAVE_ICONV
107     ICONV_LIBS = -liconv
108 else
109     ICONV_LIBS =
110 endif
111
112 ifneq (0,$(USE_OGG))
113     CONFIG_CFLAGS += -DFLAC__HAS_OGG=1
114     OGG_INCLUDES = -I$(OGG_INCLUDE_DIR)
115     OGG_EXPLICIT_LIBS = $(OGG_LIB_DIR)/libogg.a
116     OGG_LIBS = -L$(OGG_LIB_DIR) -logg
117     OGG_SRCS = $(OGG_SRCS_C)
118 else
119     CONFIG_CFLAGS += -DFLAC__HAS_OGG=0
120     OGG_INCLUDES =
121     OGG_EXPLICIT_LIBS =
122     OGG_LIBS =
123     OGG_SRCS =
124 endif
125
126 OGG_INCLUDE_DIR=$(HOME)/local/include
127 OGG_LIB_DIR=$(HOME)/local/lib