summaryrefslogtreecommitdiffstats
path: root/import-layers/meta-openembedded/meta-oe/recipes-connectivity/zeroc-ice/zeroc-ice-3.5.1/0002-Modify-Makefile-for-cross-compile.patch
blob: 43096d2bce1c6faf1338739b53268b805b76a181 (plain)
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
Upstream-Status: Inappropriate

This patch lets you build Ice with OpenEmbedded. I doubt you could do
a regular build after applying this patch.

From bc622ce74fa03a935278d21736a5a251466e1798 Mon Sep 17 00:00:00 2001
From: Tom Rondeau <tom@trondeau.com>
Date: Wed, 16 Apr 2014 14:34:51 -0400
Subject: [PATCH] Modify Makefiles for cross compile

---
 config/Make.common.rules           |   20 +++++++------
 cpp/Makefile                       |    9 +++---
 cpp/config/Make.rules              |   32 ++++++++++++--------
 cpp/config/Make.rules.Linux        |   18 ++---------
 cpp/src/IceStorm/FreezeDB/Makefile |    2 +-
 py/config/Make.rules               |   58 +++++++++++++++++++-----------------
 6 files changed, 70 insertions(+), 69 deletions(-)

diff --git a/config/Make.common.rules b/config/Make.common.rules
index d7b1d59..a3fb17e 100644
--- a/config/Make.common.rules
+++ b/config/Make.common.rules
@@ -65,9 +65,9 @@ ifeq ($(UNAME),Linux)
       #
       # Some Linux distributions like Debian/Ubuntu don't use /usr/lib64.
       #
-      ifeq ($(shell test -d /usr/lib64 && echo 0),0)
-          lp64suffix	= 64
-      endif
+      #ifeq ($(shell test -d /usr/lib64 && echo 0),0)
+      #    lp64suffix	= 64
+      #endif
       ifeq ($(LP64),)
           LP64      	= yes
       endif
@@ -244,12 +244,13 @@ else
     slicedir = $(ice_dir)/slice
 endif
 
-ifeq ($(prefix), /usr)
-    install_slicedir = /usr/share/Ice-$(VERSION)/slice
-else
-    install_slicedir = $(prefix)/slice
-endif
+#ifeq ($(prefix), /usr)
+#    install_slicedir = /usr/share/Ice-$(VERSION)/slice
+#else
+#    install_slicedir = $(prefix)/slice
+#endif
 
+install_slicedir = $(prefix)/slice
 #
 # Set environment variables for the Slice translator.
 #
@@ -265,7 +266,8 @@ ifneq ($(ice_dir), /usr)
     endif
 
     ifeq ($(UNAME),Linux)
-        export LD_LIBRARY_PATH := $(ice_lib_dir):$(LD_LIBRARY_PATH)
+        #export LD_LIBRARY_PATH := $(ice_lib_dir):$(LD_LIBRARY_PATH)
+        export LD_LIBRARY_PATH := $(ICE_HOME)/lib:$(LD_LIBRARY_PATH)
     endif
 
     ifeq ($(UNAME),SunOS)
diff --git a/cpp/Makefile b/cpp/Makefile
index a68f113..1f44f57 100644
--- a/cpp/Makefile
+++ b/cpp/Makefile
@@ -11,11 +11,12 @@ top_srcdir	= .
 
 include $(top_srcdir)/config/Make.rules
 
-SUBDIRS		= config src include test
+#SUBDIRS		= config src include test
+SUBDIRS		= config src include
 
-ifeq ($(shell uname | grep MINGW),)
-SUBDIRS		:= $(SUBDIRS) demo
-endif
+#ifeq ($(shell uname | grep MINGW),)
+#SUBDIRS		:= $(SUBDIRS) demo
+#endif
 
 INSTALL_SUBDIRS	= $(install_bindir) $(install_libdir) $(install_includedir) \
 	$(install_configdir) $(install_mandir)
diff --git a/cpp/config/Make.rules b/cpp/config/Make.rules
index 37461ae..197c5e8 100644
--- a/cpp/config/Make.rules
+++ b/cpp/config/Make.rules
@@ -175,11 +175,12 @@ headerdir		= $(top_srcdir)/include
 # includedir is not handled the same as bindir and libdir
 # because it is used in the .depend files
 #
-ifdef ice_src_dist
-    includedir		= $(top_srcdir)/include
-else
-    includedir		= $(ice_dir)/include
-endif
+#ifdef ice_src_dist
+#    includedir		= $(top_srcdir)/include
+#else
+#    includedir		= $(ice_dir)/include
+#endif
+includedir		= $(top_srcdir)/include
 
 #
 # Platform specific definitions
@@ -277,14 +278,17 @@ ICECPPFLAGS		= -I$(slicedir)
 SLICE2CPPFLAGS		= $(ICECPPFLAGS)
 
 ifeq ($(ice_dir), /usr) 
-    LDFLAGS		= $(LDPLATFORMFLAGS) $(CXXFLAGS)
+    LDFLAGS		+= $(LDPLATFORMFLAGS) $(CXXFLAGS)
 else
     CPPFLAGS	+= -I$(includedir)
-    ifdef ice_src_dist
-	LDFLAGS	= $(LDPLATFORMFLAGS) $(CXXFLAGS) -L$(libdir)
-    else
-	LDFLAGS	= $(LDPLATFORMFLAGS) $(CXXFLAGS) -L$(ice_dir)/$(libsubdir)$(cpp11suffix)
-    endif
+# We must always build using the libraries in the source tree, the host's are obviously
+# not what we want for the target
+    LDFLAGS	+= $(LDPLATFORMFLAGS) $(CXXFLAGS) -L$(libdir) $(call rpathlink,$(libdir))
+#    ifdef ice_src_dist
+#        LDFLAGS	= $(LDPLATFORMFLAGS) $(CXXFLAGS) -L$(libdir)
+#    else
+#	LDFLAGS	= $(LDPLATFORMFLAGS) $(CXXFLAGS) -L$(ice_dir)/$(libsubdir)$(cpp11suffix)
+#    endif
 endif
 
 ifeq ($(FLEX_NOLINE),yes)
@@ -313,8 +317,10 @@ endif
 
 ifdef ice_src_dist
     SLICEPARSERLIB	= $(libdir)/$(call mklibfilename,Slice,$(VERSION))
-    SLICE2CPP		= $(bindir)/slice2cpp
-    SLICE2FREEZE	= $(bindir)/slice2freeze
+#    SLICE2CPP		= $(bindir)/slice2cpp
+#    SLICE2FREEZE	= $(bindir)/slice2freeze
+    SLICE2CPP		= $(ICE_HOME)/bin/slice2cpp
+    SLICE2FREEZE	= $(ICE_HOME)/bin/slice2freeze
 else
     SLICEPARSERLIB	= $(ice_dir)/$(libsubdir)$(cpp11suffix)/$(call mklibfilename,Slice,$(VERSION))
     SLICE2CPP		= $(ice_dir)/$(binsubdir)$(cpp11suffix)/slice2cpp
diff --git a/cpp/config/Make.rules.Linux b/cpp/config/Make.rules.Linux
index 5d5717c..8363c6e 100644
--- a/cpp/config/Make.rules.Linux
+++ b/cpp/config/Make.rules.Linux
@@ -31,7 +31,7 @@ ifeq ($(CXX),c++)
    CXX			= g++
 endif
 
-ifeq ($(CXX),g++)
+#ifeq ($(CXX),g++)
 
     ifneq ($(SUSE_i586),)
         CXXARCHFLAGS	+= -march=i586
@@ -71,14 +71,6 @@ ifeq ($(CXX),g++)
       CXXARCHFLAGS	+= -mtune=v8 -pipe -Wno-deprecated -DICE_USE_MUTEX_SHARED
    endif
 
-   ifeq ($(MACHINE),x86_64)
-      ifeq ($(LP64),yes)
-         CXXARCHFLAGS	+= -m64
-      else
-         CXXARCHFLAGS	+= -m32
-      endif
-   endif
-
    CXXFLAGS		= $(CXXARCHFLAGS) -Wall -Werror -pthread
 
    ifneq ($(GENPIC),no)
@@ -102,15 +94,11 @@ ifeq ($(CXX),g++)
 
    rpathlink            = -Wl,-rpath-link,$(1) 
 
-   ifneq ($(embedded_runpath_prefix),)
-      LDPLATFORMFLAGS      = -Wl,--enable-new-dtags -Wl,-rpath,$(runpath_libdir)
-   else
-      LDPLATFORMFLAGS      = -Wl,--enable-new-dtags
-   endif
+   LDPLATFORMFLAGS      = -Wl,--enable-new-dtags -Wl,-rpath,../../../lib
 
    LDPLATFORMFLAGS	+= -rdynamic
 
-endif
+#endif
 
 ifeq ($(CXX),icpc)
    $(warning ===================================================================) 
diff --git a/cpp/src/IceStorm/FreezeDB/Makefile b/cpp/src/IceStorm/FreezeDB/Makefile
index 7c844b7..cf15cb1 100644
--- a/cpp/src/IceStorm/FreezeDB/Makefile
+++ b/cpp/src/IceStorm/FreezeDB/Makefile
@@ -66,7 +66,7 @@ $(libdir)/$(LIBNAME): $(libdir)/$(SONAME)
 
 $(MIGRATE): $(MOBJS)
 	rm -f $@
-	$(CXX) $(LDFLAGS) -o $@ $(MOBJS) $(DB_RPATH_LINK) -lIceStormService -lIceStorm -lFreeze $(LIBS)
+	$(CXX) $(LDFLAGS) -o $@ $(MOBJS) $(DB_RPATH_LINK) -lIceStormService -lIceStorm -lFreeze $(LIBS) -ldb_cxx
 
 # The slice2freeze rules are structured like this to avoid issues with
 # parallel make.
diff --git a/py/config/Make.rules b/py/config/Make.rules
index 43ce01b..1349342 100644
--- a/py/config/Make.rules
+++ b/py/config/Make.rules
@@ -92,21 +92,23 @@ ifeq ($(shell test -f $(top_srcdir)/config/Make.rules.$(UNAME) && echo 0),0)
     include $(top_srcdir)/config/Make.rules.$(UNAME)
 else
     include $(top_srcdir)/../cpp/config/Make.rules.$(UNAME)
-endif 
+endif
 
 libdir                  = $(top_srcdir)/python
-ifneq ($(prefix), /usr)
-install_pythondir       = $(prefix)/python
-install_libdir          = $(prefix)/python
-else
-    ifeq ($(shell test -d $(prefix)/$(libsubdir)/$(PYTHON_VERSION)/dist-packages && echo 0),0)
-        install_pythondir       = $(prefix)/$(libsubdir)/$(PYTHON_VERSION)/dist-packages
-        install_libdir          = $(prefix)/$(libsubdir)/$(PYTHON_VERSION)/dist-packages
-    else
-        install_pythondir       = $(prefix)/$(libsubdir)/$(PYTHON_VERSION)/site-packages
-        install_libdir          = $(prefix)/$(libsubdir)/$(PYTHON_VERSION)/site-packages
-    endif
-endif
+#ifneq ($(prefix), /usr)
+#install_pythondir       = $(prefix)/python
+#install_libdir          = $(prefix)/python
+#else
+#    ifeq ($(shell test -d $(prefix)/$(libsubdir)/$(PYTHON_VERSION)/dist-packages && echo 0),0)
+#        install_pythondir       = $(prefix)/$(libsubdir)/$(PYTHON_VERSION)/dist-packages
+#        install_libdir          = $(prefix)/$(libsubdir)/$(PYTHON_VERSION)/dist-packages
+#    else
+#        install_pythondir       = $(prefix)/$(libsubdir)/$(PYTHON_VERSION)/site-packages
+#        install_libdir          = $(prefix)/$(libsubdir)/$(PYTHON_VERSION)/site-packages
+#    endif
+#endif
+install_pythondir       = $(prefix)/$(libsubdir)/$(PYTHON_VERSION)/site-packages
+install_libdir          = $(prefix)/$(libsubdir)/$(PYTHON_VERSION)/site-packages
 
 ifeq ($(UNAME),SunOS)
    ifeq ($(LP64),yes)
@@ -115,19 +117,21 @@ ifeq ($(UNAME),SunOS)
    endif
 endif
 
-ifdef ice_src_dist
-    ifeq ($(ice_cpp_dir), $(ice_dir)/cpp)
-        ICE_LIB_DIR = -L$(ice_cpp_dir)/lib
-    else
-        ICE_LIB_DIR = -L$(ice_cpp_dir)/$(libsubdir)
-    endif
-    ICE_LIB_DIR = -L$(ice_cpp_dir)/lib
-    ICE_FLAGS 	= -I$(ice_cpp_dir)/include
-endif
-ifdef ice_bin_dist
-    ICE_LIB_DIR = -L$(ice_dir)/$(libsubdir)
-    ICE_FLAGS	= -I$(ice_dir)/include
-endif
+#ifdef ice_src_dist
+#    ifeq ($(ice_cpp_dir), $(ice_dir)/cpp)
+#        ICE_LIB_DIR = -L$(ice_cpp_dir)/lib
+#    else
+#        ICE_LIB_DIR = -L$(ice_cpp_dir)/$(libsubdir)
+#    endif
+#    ICE_LIB_DIR = -L$(ice_cpp_dir)/lib
+#    ICE_FLAGS 	= -I$(ice_cpp_dir)/include
+#endif
+#ifdef ice_bin_dist
+#    ICE_LIB_DIR = -L$(ice_dir)/$(libsubdir)
+#    ICE_FLAGS	= -I$(ice_dir)/include
+#endif
+ICE_LIB_DIR = -L$(top_srcdir)/../cpp/lib
+ICE_FLAGS = -I$(ice_cpp_dir)/include
 ICE_LIBS = $(ICE_LIB_DIR) -lIce -lSlice -lIceUtil
 
 ifneq ($(embedded_runpath_prefix),)
@@ -137,7 +141,7 @@ endif
 CPPFLAGS		=
 ICECPPFLAGS		= -I$(slicedir)
 SLICE2PYFLAGS		= $(ICECPPFLAGS)
-LDFLAGS			= $(LDPLATFORMFLAGS) $(CXXFLAGS) -L$(libdir)
+LDFLAGS			+= $(LDPLATFORMFLAGS) $(CXXFLAGS) -L$(libdir)
 
 ifdef ice_src_dist
     ifeq ($(ice_cpp_dir), $(ice_dir)/cpp)
-- 
1.7.9.5

OpenPOWER on IntegriCloud