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
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
|
# **********************************************************************
#
# Copyright (c) 2003-2004 ZeroC, Inc. All rights reserved.
#
# This copy of Ice is licensed to you under the terms described in the
# ICE_LICENSE file included in this distribution.
#
# **********************************************************************
#
# Select an installation base directory. The directory will be created
# if it does not exist.
#
prefix = /opt/Ice-$(VERSION)
#
# Define OPTIMIZE as yes if you want to build with
# optimization. Otherwise Ice is build with debug information.
#
#OPTIMIZE = yes
#
# Define LP64 as yes if you want to build in 64 bit mode on a platform
# that supports both 32 and 64 bit.
#
#LP64 := yes
#
# Define GPL_BUILD as yes if you want to build a copy of Ice licensed
# to you under the GNU Public License v2.
# This adds a "no-warranty" notice and accompanying show commands
# to interactive programs.
#
GPL_BUILD := yes
#
# Define USE_READLINE as yes if you want to build parts of Ice using
# readline on platforms where readline is available
# (see PLATFORM_HAS_READLINE in Make.rules.$(UNAME))
#
# readline is used by a number of Ice admin programs to provide
# command history, an optional feature.
#
# readline is licensed by the Free Software Foundation under the
# GNU Public License v2, and cannot be combined with GPL-incompatible
# software in any program. In particular the OpenSSL license
# is GPL-incompatible.
# On Linux and other free operating systems, readline and OpenSSL
# are usually distributed with the operating system, which may be
# a solution to this incompatibility.
#
# If you combine Ice with more GPL-incompatible software, or have
# licensed Ice under a commercial (non-GPL) license, you should
# ponder the licensing implications of using readline.
#
ifeq ($(GPL_BUILD),yes)
USE_READLINE := yes
endif
#
# The values below can be overridden by defining them as environment
# variables. For example, if you are using a bourne shell or
# compatible, you can override the location of STLport like this:
#
# export STLPORT_HOME=/usr/local/STLport-4.5
#
#
# If you want to use STLport, set STLPORT_HOME to the STLport
# installation directory. If STLPORT_HOME is undefined or empty,
# STLport is not used.
#
#STLPORT_HOME ?= /opt/STLport
#
# If libbzip2 is not installed in a standard location where the compiler
# can find it, set BZIP2_HOME to the bzip2 installation directory.
#
#BZIP2_HOME ?= /opt/bzip2
#
# If Berkeley DB is not installed in a standard location where the
# compiler can find it, set DB_HOME to the Berkeley DB installation
# directory.
#
#DB_HOME ?= /opt/db
#
# If OpenSSL is not installed in a standard location where the
# compiler can find it, set OPENSSL_HOME to the OpenSSL installation
# directory.
#
#OPENSSL_HOME ?= /opt/openssl
#
# Define if your OpenSSL requires Kerberos, and if Kerberos is not
# installed in a standard location.
#
KERBEROS_HOME ?= /usr/kerberos
#
# If expat is not installed in a standard location where the
# compiler can find it, set EXPAT_HOME to the expat
# installation directory.
#
#EXPAT_HOME ?= /opt/expat
#
# If readline is not installed in a standard location where the
# compiler can find it, AND you want to use readline,
# set READLINE_HOME to the readline installation directory.
#
#
#READLINE_HOME ?= /opt/readline
# ----------------------------------------------------------------------
# Don't change anything below this line!
# ----------------------------------------------------------------------
SHELL = /bin/sh
VERSION = 2.1.0
SOVERSION = 21
bindir = $(top_srcdir)/bin
libdir = $(top_srcdir)/lib
includedir = $(top_srcdir)/include
slicedir = $(top_srcdir)/slice
ifeq ($(LP64),yes)
install_bindir = $(prefix)/bin$(lp64suffix)
install_libdir = $(prefix)/lib$(lp64suffix)
else
install_bindir = $(prefix)/bin
install_libdir = $(prefix)/lib
endif
install_includedir = $(prefix)/include
install_slicedir = $(prefix)/slice
install_schemadir = $(prefix)/schema
install_docdir = $(prefix)/doc
INSTALL = cp -fp
INSTALL_PROGRAM = ${INSTALL}
INSTALL_LIBRARY = ${INSTALL}
INSTALL_DATA = ${INSTALL}
UNAME := $(shell uname)
#
# Platform specific definitions
#
include $(top_srcdir)/config/Make.rules.$(UNAME)
ifeq ($(LP64),yes)
libsubdir := lib$(lp64suffix)
else
libsubdir := lib
endif
ifneq ($(STLPORT_HOME),)
STLPORT_FLAGS = -I$(STLPORT_HOME)/include/stlport
ifeq ($(OPTIMIZE),yes)
STLPORT_LIBS = -L$(STLPORT_HOME)/$(libsubdir) -lstlport_gcc
else
STLPORT_LIBS = -L$(STLPORT_HOME)/$(libsubdir) -lstlport_gcc_stldebug
endif
else
STLPORT_FLAGS =
STLPORT_LIBS =
endif
ifneq ($(OPENSSL_HOME),)
OPENSSL_FLAGS = -I$(OPENSSL_HOME)/include
OPENSSL_LIBS = -L$(OPENSSL_HOME)/$(libsubdir) -lssl -lcrypto
else
OPENSSL_FLAGS =
OPENSSL_LIBS = -lssl -lcrypto
endif
ifneq ($(KERBEROS_HOME),)
OPENSSL_FLAGS += -I$(KERBEROS_HOME)/include
endif
ifneq ($(BZIP2_HOME),)
BZIP2_FLAGS = -I$(BZIP2_HOME)/include
BZIP2_LIBS = -L$(BZIP2_HOME)/$(libsubdir) -lbz2
else
BZIP2_FLAGS =
BZIP2_LIBS = -lbz2
endif
ifneq ($(DB_HOME),)
DB_FLAGS = -I$(DB_HOME)/include
DB_LIBS = -L$(DB_HOME)/$(libsubdir) -ldb_cxx
else
DB_FLAGS =
DB_LIBS = -ldb_cxx
endif
ifneq ($(EXPAT_HOME),)
EXPAT_FLAGS = -I$(EXPAT_HOME)/include
EXPAT_LIBS = -L$(EXPAT_HOME)/$(libsubdir) -lexpat
else
EXPAT_FLAGS =
EXPAT_LIBS = -lexpat
endif
#
# The GPL_BUILD flag is used only where readline may be
# used.
#
ifeq ($(GPL_BUILD),yes)
READLINE_FLAGS = -DGPL_BUILD
endif
ifeq ($(PLATFORM_HAS_READLINE),yes)
ifeq ($(USE_READLINE),yes)
ifneq ($(READLINE_HOME),)
READLINE_FLAGS += -DHAVE_READLINE -I$(READLINE_HOME)/include
READLINE_LIBS = -L$(READLINE_HOME)/$(libsubdir) -lreadline -lncurses
else
READLINE_FLAGS += -DHAVE_READLINE
READLINE_LIBS = -lreadline -lncurses
endif
endif
endif
CPPFLAGS = -I$(includedir) $(STLPORT_FLAGS)
ICECPPFLAGS = -I$(slicedir)
SLICE2CPPFLAGS = $(ICECPPFLAGS)
LDFLAGS = $(LDPLATFORMFLAGS) $(CXXFLAGS) -L$(libdir)
ifeq ($(FLEX_NOLINE),yes)
FLEXFLAGS := -L
else
FLEXFLAGS :=
endif
ifeq ($(BISON_NOLINE),yes)
BISONFLAGS := -dvtl
else
BISONFLAGS := -dvt
endif
#
# Default functions for shared library names
#
ifeq ($(mklibfilename),)
mklibfilename = $(if $(2),lib$(1).so.$(2),lib$(1).so)
endif
ifeq ($(mksoname),)
mksoname = $(if $(2),lib$(1).so.$(2),lib$(1).so)
endif
ifeq ($(mklibname),)
mklibname = lib$(1).so
endif
ifndef mklibtargets
mklibtargets = $(1) $(2) $(3)
endif
ifeq ($(mkshlib),)
$(error You need to define mkshlib in Make.rules.$(UNAME))
endif
ifeq ($(installlib),)
installlib = $(INSTALL) $(2)/$(3) $(1); \
rm -f $(1)/$(4); ln -s $(3) $(1)/$(4); \
rm -f $(1)/$(5); ln -s $(4) $(1)/$(5)
endif
SLICEPARSERLIB = $(libdir)/$(call mklibfilename,Slice,$(VERSION))
SLICE2CPP = $(bindir)/slice2cpp
SLICE2XSD = $(bindir)/slice2xsd
SLICE2FREEZE = $(bindir)/slice2freeze
SLICE2DOCBOOK = $(bindir)/slice2docbook
EVERYTHING = all depend clean install
.SUFFIXES:
.SUFFIXES: .cpp .c .o
.cpp.o:
$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $<
.c.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) $<
$(HDIR)/%F.h: $(SDIR)/%F.ice $(SLICE2CPP) $(SLICEPARSERLIB)
rm -f $(HDIR)/$(*F)F.h $(*F)F.cpp
$(SLICE2CPP) $(SLICE2CPPFLAGS) $<
mv $(*F)F.h $(HDIR)
rm -f $(*F)F.cpp
$(HDIR)/%.h %.cpp: $(SDIR)/%.ice $(SLICE2CPP) $(SLICEPARSERLIB)
rm -f $(HDIR)/$(*F).h $(*F).cpp
$(SLICE2CPP) $(SLICE2CPPFLAGS) $<
mv $(*F).h $(HDIR)
%.h %.cpp: %.ice $(SLICE2CPP) $(SLICEPARSERLIB)
rm -f $(*F).h $(*F).cpp
$(SLICE2CPP) $(SLICE2CPPFLAGS) $(*F).ice
%.h %.cpp: %.y
rm -f $(*F).h $(*F).cpp
bison $(BISONFLAGS) $<
mv $(*F).tab.c $(*F).cpp
mv $(*F).tab.h $(*F).h
rm -f $(*F).output
%.cpp: %.l
flex $(FLEXFLAGS) $<
rm -f $@
echo '#include <IceUtil/Config.h>' > $@
cat lex.yy.c >> $@
rm -f lex.yy.c
all:: $(SRCS) $(TARGETS)
depend:: $(SRCS) $(SLICE_SRCS)
-rm -f .depend
if test -n "$(SRCS)" ; then \
$(CXX) -DMAKEDEPEND -M $(CXXFLAGS) $(CPPFLAGS) $(SRCS) | \
$(top_srcdir)/config/makedepend.py >> .depend; \
fi
if test -n "$(SLICE_SRCS)" ; then \
$(SLICE2CPP) --depend $(SLICE2CPPFLAGS) $(SLICE_SRCS) | \
$(top_srcdir)/config/makedepend.py >> .depend; \
fi
clean::
-rm -f $(TARGETS)
-rm -f core *.o *.bak
ifneq ($(SLICE_SRCS),)
clean::
rm -f $(addsuffix .cpp, $(basename $(notdir $(SLICE_SRCS))))
rm -f $(addsuffix .h, $(basename $(notdir $(SLICE_SRCS))))
endif
ifneq ($(HDIR),)
clean::
rm -f $(addprefix $(HDIR), $(addsuffix .h, $(basename $(subst $(SDIR),, \
$(filter $(SDIR)/%.ice, $(SLICE_SRCS))))))
endif
ifneq ($(TEMPLATE_REPOSITORY),)
clean::
rm -fr $(TEMPLATE_REPOSITORY)
endif
install::
|