Hide symbols with gcc.
[platform/upstream/flac.git] / src / libFLAC / Makefile.am
1 #  libFLAC - Free Lossless Audio Codec library
2 #  Copyright (C) 2001,2002,2003,2004,2005,2006,2007,2008,2009  Josh Coalson
3 #
4 #  Redistribution and use in source and binary forms, with or without
5 #  modification, are permitted provided that the following conditions
6 #  are met:
7 #
8 #  - Redistributions of source code must retain the above copyright
9 #  notice, this list of conditions and the following disclaimer.
10 #
11 #  - Redistributions in binary form must reproduce the above copyright
12 #  notice, this list of conditions and the following disclaimer in the
13 #  documentation and/or other materials provided with the distribution.
14 #
15 #  - Neither the name of the Xiph.org Foundation nor the names of its
16 #  contributors may be used to endorse or promote products derived from
17 #  this software without specific prior written permission.
18 #
19 #  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 #  ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 #  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 #  A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR
23 #  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
24 #  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25 #  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
26 #  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
27 #  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 #  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29 #  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
31 AM_CPPFLAGS = -I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include
32 lib_LTLIBRARIES = libFLAC.la
33 noinst_LTLIBRARIES = libFLAC-static.la
34 if DEBUG
35 DEBUGCFLAGS = -DFLAC__OVERFLOW_DETECT
36 endif
37 if FLaC__CPU_PPC
38 # The -force_cpusubtype_ALL is needed to insert a ppc64 instruction
39 # into cpu.c with an asm().
40 if FLaC__SYS_DARWIN
41 #@@@ PPC optimizations temporarily disabled
42 CPUCFLAGS = -faltivec -force_cpusubtype_ALL -DFLAC__NO_ASM
43 else
44 # Linux-gcc for PPC does not have -force_cpusubtype_ALL, it is Darwin-specific
45 CPUCFLAGS =
46 if FLaC__CPU_PPC_SPE
47 else
48 CPUCFLAGS += -maltivec -mabi=altivec
49 endif
50 #@@@ PPC optimizations temporarily disabled
51 CPUCFLAGS += -DFLAC__NO_ASM
52 endif
53 endif
54
55 AM_CFLAGS = $(DEBUGCFLAGS) $(CPUCFLAGS) @OGG_CFLAGS@
56
57 if FLaC__NO_ASM
58 else
59 if FLaC__CPU_IA32
60 if FLaC__HAS_NASM
61 ARCH_SUBDIRS = ia32
62 LOCAL_EXTRA_LIBADD = ia32/libFLAC-asm.la
63 endif
64 endif
65 if FLaC__CPU_PPC
66 ARCH_SUBDIRS = ppc
67 if FLaC__HAS_AS__TEMPORARILY_DISABLED
68 if FLaC__CPU_PPC_SPE
69 else
70 LOCAL_EXTRA_LIBADD = ppc/as/libFLAC-asm.la
71 LOCAL_EXTRA_LDFLAGS = "-Wl,-read_only_relocs,warning"
72 else
73 if FLaC__HAS_GAS__TEMPORARILY_DISABLED
74 LOCAL_EXTRA_LIBADD = ppc/gas/libFLAC-asm.la
75 LOCAL_EXTRA_LDFLAGS = ""
76 endif
77 endif
78 endif
79 endif
80 endif
81
82 libFLAC_la_LIBADD = $(LOCAL_EXTRA_LIBADD) @OGG_LIBS@ -lm
83
84 SUBDIRS = $(ARCH_SUBDIRS) include .
85
86 m4datadir = $(datadir)/aclocal
87 m4data_DATA = libFLAC.m4
88
89 pkgconfigdir = $(libdir)/pkgconfig
90 pkgconfig_DATA = flac.pc
91
92 EXTRA_DIST = \
93         Makefile.lite \
94         flac.pc.in \
95         libFLAC_dynamic.dsp \
96         libFLAC_dynamic.vcproj \
97         libFLAC_static.dsp \
98         libFLAC_static.vcproj \
99         libFLAC.m4
100
101 if FLaC__HAS_OGG
102 extra_ogg_sources = \
103         ogg_decoder_aspect.c \
104         ogg_encoder_aspect.c \
105         ogg_helper.c \
106         ogg_mapping.c
107 endif
108 # see 'http://www.gnu.org/software/libtool/manual/libtool.html#Libtool-versioning' for numbering convention
109 libFLAC_la_LDFLAGS = -version-info 10:0:2 $(LOCAL_EXTRA_LDFLAGS) @LT_NO_UNDEFINED@
110
111 libFLAC_sources = \
112         bitmath.c \
113         bitreader.c \
114         bitwriter.c \
115         cpu.c \
116         crc.c \
117         fixed.c \
118         float.c \
119         format.c \
120         lpc.c \
121         md5.c \
122         memory.c \
123         metadata_iterators.c \
124         metadata_object.c \
125         stream_decoder.c \
126         stream_encoder.c \
127         stream_encoder_framing.c \
128         window.c \
129         $(extra_ogg_sources)
130
131 libFLAC_la_SOURCES = $(libFLAC_sources)
132
133 # needed for test_libFLAC
134 libFLAC_static_la_LIBADD = $(LOCAL_EXTRA_LIBADD)
135 libFLAC_static_la_SOURCES = $(libFLAC_sources)