-
Notifications
You must be signed in to change notification settings - Fork 5.9k
/
Makefile-env.am
289 lines (235 loc) · 6.16 KB
/
Makefile-env.am
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
AUTOMAKE_OPTIONS = gnu subdir-objects
SUBDIRS =
DIST_SUBDIRS =
BUILT_SOURCES =
EXTRA_DIST =
CLEANFILES =
dist_noinst_DATA =
noinst_HEADERS =
bin_PROGRAMS =
noinst_PROGRAMS =
bin_SCRIPTS =
sbin_PROGRAMS =
sbin_SCRIPTS =
su_sbin_PROGRAMS =
su_sbin_SCRIPTS =
dist_bin_SCRIPTS =
lib_LTLIBRARIES =
noinst_LTLIBRARIES =
noinst_LIBRARIES =
radoslib_LTLIBRARIES =
# like bin_PROGRAMS, but these targets are only built for debug builds
bin_DEBUGPROGRAMS =
# like sbin_SCRIPTS but can be used to install to e.g. /usr/sbin
ceph_sbindir = $(sbindir)
# certain things go straight into /sbin, though!
su_sbindir = /sbin
# C/C++ tests to build and executed will be appended to this
check_TESTPROGRAMS =
check_PROGRAMS = $(check_TESTPROGRAMS)
# tests scripts will be appended to this
check_SCRIPTS =
# display the output of failed check_SCRIPTS after a failed make check
export VERBOSE = true
# python unit tests need to know where the scripts are located
export PYTHONPATH=$(top_srcdir)/src/pybind
# when doing a debug build, make sure to make the targets
if WITH_DEBUG
bin_PROGRAMS += $(bin_DEBUGPROGRAMS)
endif
##################################
## automake environment
HARDENING_CFLAGS = \
-O2 \
-g \
-pipe \
-Wall \
-Wp,-U_FORTIFY_SOURCE \
-Wp,-D_FORTIFY_SOURCE=2 \
-fexceptions \
--param=ssp-buffer-size=4 \
-fPIE
SET_STACK_PROTECTOR_STRONG = $(shell expr `gcc -dumpversion` \>= 4.9)
ifeq ($(SET_STACK_PROTECTOR_STRONG),1)
HARDENING_CFLAGS += -fstack-protector-strong
else
HARDENING_CFLAGS += -fstack-protector
endif
HARDENING_LDFLAGS = \
-pie \
-Wl,-z,relro \
-Wl,-z,now
AM_COMMON_CPPFLAGS = \
-D__CEPH__ \
-D_FILE_OFFSET_BITS=64 \
-D_THREAD_SAFE \
-D__STDC_FORMAT_MACROS \
-D_GNU_SOURCE \
-DCEPH_LIBDIR=\"${libdir}\" \
-DCEPH_PKGLIBDIR=\"${pkglibdir}\" \
-DGTEST_USE_OWN_TR1_TUPLE=0
if LINUX
AM_COMMON_CPPFLAGS += \
-D_REENTRANT
endif
if FREEBSD
AM_COMMON_CPPFLAGS += \
-D_REENTRANT
endif
if DARWIN
AM_COMMON_CPPFLAGS += \
-D_REENTRANT
endif
if SOLARIS
AM_COMMON_CPPFLAGS += \
-D_PTHREADS \
-D_POSIX_C_SOURCE
endif
AM_COMMON_CFLAGS = \
-Wall \
${WARN_TYPE_LIMITS} \
${WARN_IGNORED_QUALIFIERS} \
-Winit-self \
-Wpointer-arith \
${WARN_ERROR_FORMAT_SECURITY} \
-fno-strict-aliasing \
-fsigned-char
if !CLANG
AM_COMMON_CFLAGS += ${RDYNAMIC_FLAG}
endif
if SOLARIS
AM_COMMON_CFLAGS += -Wno-unused-local-typedefs
endif
AM_CFLAGS = $(AM_COMMON_CFLAGS)
if LINUX
AM_CFLAGS += $(HARDENING_CFLAGS)
endif
AM_CPPFLAGS = $(AM_COMMON_CPPFLAGS)
AM_CXXFLAGS = \
@AM_CXXFLAGS@ \
$(AM_COMMON_CFLAGS) \
-ftemplate-depth-1024 \
-Wnon-virtual-dtor \
-Wno-invalid-offsetof
if LINUX
AM_CXXFLAGS += $(HARDENING_CFLAGS)
endif
if !CLANG
AM_CXXFLAGS += -Wstrict-null-sentinel
endif
# note: this is position dependant, it affects the -l options that
# come after it on the command line. when you use ${AM_LDFLAGS} in
# later rules, take care where you place it. for more information, see
# http://blog.flameeyes.eu/2008/11/19/relationship-between-as-needed-and-no-undefined-part-1-what-do-they-do
# http://blog.flameeyes.eu/2008/11/20/misguided-link-and-as-needed
# http://www.gentoo.org/proj/en/qa/asneeded.xml
# http://gcc.gnu.org/ml/gcc-help/2010-12/msg00338.html
# http://sigquit.wordpress.com/2011/02/16/why-asneeded-doesnt-work-as-expected-for-your-libraries-on-your-autotools-project/
AM_LDFLAGS =
if LINUX
AM_LDFLAGS += -Wl,--as-needed $(HARDENING_LDFLAGS)
endif
if AIX
AM_LDFLAGS += -Wl,-brtl
endif
if USE_BOOST_SPIRIT_OLD_HDR
AM_CXXFLAGS += -DUSE_BOOST_SPIRIT_OLD_HDR
endif
if WITH_LIBATOMIC
AM_LDFLAGS += -latomic_ops
endif
if ENABLE_COVERAGE
AM_CFLAGS += -fprofile-arcs -ftest-coverage
AM_CXXFLAGS += -fprofile-arcs -ftest-coverage -O0
endif
CCAS = ${srcdir}/yasm-wrapper
AM_CCASFLAGS = -f elf64
#####################
## library definitions and dependencies
EXTRALIBS = -lm
if FREEBSD
EXTRALIBS += -lexecinfo
endif # FREEBSD
if LINUX
EXTRALIBS += -lrt
endif # LINUX
if WITH_PROFILER
EXTRALIBS += -lprofiler
endif # PROFILER
LIBGLOBAL = libglobal.la
LIBCOMMON = libcommon.la
LIBSECRET = libsecret.la
LIBARCH = libarch.la
LIBPERFGLUE = libperfglue.la
LIBAUTH = libauth.la
LIBMSG = libmsg.la
LIBCRUSH = libcrush.la
LIBCOMPRESSOR = libcompressor.la -lsnappy
LIBJSON_SPIRIT = libjson_spirit.la
LIBKV = libkv.a
LIBLOG = liblog.la
LIBOS = libos.a
LIBOS_TYPES = libos_types.a
LIBOSD = libosd.a
LIBOSD_TYPES = libosd_types.la
LIBOSDC = libosdc.la
LIBMON = libmon.a
LIBMON_TYPES = libmon_types.la
LIBMDS = libmds.la
LIBCLIENT = libclient.la
LIBCLIENT_FUSE = libclient_fuse.la
LIBRADOS = librados.la
LIBRADOSSTRIPER = libradosstriper.la
LIBRGW = librgw.la
LIBCIVETWEB = libcivetweb.la
LIBRBD = librbd.la
LIBRBD_TYPES = librbd_types.la
LIBKRBD = libkrbd.la
LIBCEPHFS = libcephfs.la
LIBERASURE_CODE = liberasure_code.la
if WITH_LIBAIO
LIBOS += -laio
endif # WITH_LIBAIO
if WITH_LIBZFS
LIBOS += libos_zfs.a -lzfs
endif # WITH_LIBZFS
if WITH_TCMALLOC_MINIMAL
LIBPERFGLUE += -ltcmalloc_minimal
endif # WITH_TCMALLOC_MINIMAL
if WITH_TCMALLOC
LIBPERFGLUE += -ltcmalloc
endif # WITH_TCMALLOC
if WITH_JEMALLOC
LIBMON += -ljemalloc
LIBOSD += -ljemalloc
LIBMDS += -ljemalloc
LIBRGW += -ljemalloc
endif # WITH_JEMALLOC
if ENABLE_COVERAGE
EXTRALIBS += -lgcov
endif # ENABLE_COVERAGE
# Libosd always needs osdc and os
LIBOSD += $(LIBOSDC) $(LIBOS)
# These have references to syms like ceph_using_tcmalloc(), glue libperfglue to them
LIBMON += $(LIBPERFGLUE)
LIBOSD += $(LIBPERFGLUE)
LIBMDS += $(LIBPERFGLUE)
# OSD needs types
LIBOSD += $(LIBOSD_TYPES) $(LIBOS_TYPES)
# libkv/libos linking order is ornery
if WITH_SLIBROCKSDB
LIBKV += rocksdb/librocksdb.a
endif
LIBKV += -lbz2 -lz -lleveldb -lsnappy
LIBOS += $(LIBOS_TYPES) $(LIBKV)
LIBMON += $(LIBMON_TYPES)
# Use this for binaries requiring libglobal
CEPH_GLOBAL = $(LIBGLOBAL) $(LIBCOMMON) $(PTHREAD_LIBS) -lm $(CRYPTO_LIBS) $(EXTRALIBS)
# This is set by [lib]/Makefile.am and used for build tests
LIBCOMMON_DEPS =
LIBRADOS_DEPS =
LIBRGW_DEPS =
# This is used by the dencoder test
DENCODER_SOURCES =
DENCODER_DEPS =
radoslibdir = $(libdir)/rados-classes