Skip to content

Commit 778b10e

Browse files
Merge pull request livecode#2710 from livecodefraser/gyp-android_on_osx_fixes
Fix various issues with building the Android engine on OSX
2 parents d5ac8c8 + af9304a commit 778b10e

10 files changed

Lines changed: 74 additions & 45 deletions

File tree

common.gypi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
'config/configurations.gypi',
77
'config/crosscompile.gypi',
88
'config/exclusions.gypi',
9-
'config/paths.gypi',
109
'config/perl.gypi',
1110
'config/target_os.gypi',
1211
'config/thirdparty.gypi',

config.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,8 +318,8 @@ if test "${OS}" = "android" ; then
318318

319319
ANDROID_AR=${AR:-${ANDROID_TOOLCHAIN}ar}
320320
ANDROID_CC=${CC:-${ANDROID_TOOLCHAIN}clang -target arm-linux-androideabi -march=armv6 -integrated-as}
321-
ANDROID_CXX=${CXX:-${ANDROID_TOOLCHAIN}clang -target arm-linux-androideabi -march=armv6 -integrated-as}
322-
ANDROID_LINK=${LINK:-${ANDROID_TOOLCHAIN}clang -target arm-linux-androideabi -march=armv6 -integrated-as -fuse-ld=bfd}
321+
ANDROID_CXX=${CXX:-${ANDROID_TOOLCHAIN}clang++ -target arm-linux-androideabi -march=armv6 -integrated-as}
322+
ANDROID_LINK=${LINK:-${ANDROID_TOOLCHAIN}clang++ -target arm-linux-androideabi -march=armv6 -integrated-as -fuse-ld=bfd}
323323
ANDROID_OBJCOPY=${OBJCOPY:-${ANDROID_TOOLCHAIN}objcopy}
324324
ANDROID_OBJDUMP=${OBJDUMP:-${ANDROID_TOOLCHAIN}objdump}
325325
ANDROID_STRIP=${STRIP:-${ANDROID_TOOLCHAIN}strip}

config/paths.gypi

Lines changed: 0 additions & 14 deletions
This file was deleted.

config/target_os.gypi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
'variables':
33
{
44
'mobile': 0,
5-
'src_top_dir_abs': '', # Only needed for Linux and Android
65
},
76

87
'conditions':

engine/engine.gyp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@
268268
{
269269
'ldflags':
270270
[
271-
'-T', '<(src_top_dir_abs)/engine/linux.link',
271+
'-T', '$(abs_srcdir)/engine/linux.link',
272272
],
273273
},
274274
],
@@ -282,12 +282,17 @@
282282
'product_dir': '<(PRODUCT_DIR)', # Shared libraries are not placed in PRODUCT_DIR by default
283283
'type': 'shared_library',
284284

285+
'sources':
286+
[
287+
'engine/linux.link',
288+
],
289+
285290
'ldflags':
286291
[
287292
# Helpful for catching build problems
288293
'-Wl,-no-undefined',
289294

290-
'-Wl,-T,<(src_top_dir_abs)/engine/linux.link',
295+
'-Wl,-T,$(abs_srcdir)/engine/linux.link',
291296
],
292297

293298
'actions':
@@ -520,7 +525,7 @@
520525
{
521526
'ldflags':
522527
[
523-
'-T', '<(src_top_dir_abs)/engine/linux.link',
528+
'-T', '$(abs_srcdir)/engine/linux.link',
524529
],
525530
},
526531
],

gyp/pylib/gyp/generator/make.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ def CalculateGeneratorInputInfo(params):
287287
CXXFLAGS.target ?= $(CXXFLAGS)
288288
LINK.target ?= %(LINK.target)s
289289
LDFLAGS.target ?= $(LDFLAGS)
290-
AR.target ?= $(AR)
290+
AR.target ?= %(AR.target)s
291291
292292
# C++ apps need to be linked with g++.
293293
LINK ?= $(CXX.target)
@@ -1483,6 +1483,7 @@ def WriteTarget(self, spec, configs, deps, link_deps, bundle_deps,
14831483
ldflags.append(r'-Wl,-rpath-link=\$(builddir)/lib.%s/' %
14841484
self.toolset)
14851485
library_dirs = config.get('library_dirs', [])
1486+
library_dirs = map(Sourceify, map(self.Absolutify, library_dirs))
14861487
ldflags += [('-L%s' % library_dir) for library_dir in library_dirs]
14871488
self.WriteList(ldflags, 'LDFLAGS_%s' % configname)
14881489
if self.flavor == 'mac':

libfoundation/libfoundation.gyp

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,15 +142,30 @@
142142

143143
'link_settings':
144144
{
145-
'conditions':
145+
'target_conditions':
146146
[
147147
[
148-
'OS == "mac" or OS == "ios"',
148+
'toolset_os == "mac" or toolset_os == "ios"',
149149
{
150-
'libraries':
150+
'conditions':
151151
[
152-
'$(SDKROOT)/System/Library/Frameworks/CoreFoundation.framework',
153-
'$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
152+
[
153+
'GENERATOR == "xcode"',
154+
{
155+
'libraries':
156+
[
157+
'$(SDKROOT)/System/Library/Frameworks/CoreFoundation.framework',
158+
'$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
159+
],
160+
},
161+
{
162+
'ldflags':
163+
[
164+
'-framework', 'CoreFoundation',
165+
'-framework', 'Foundation',
166+
],
167+
},
168+
],
154169
],
155170
},
156171
],

prebuilt/libcurl.gyp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,9 @@
4040
[
4141
'OS == "linux"',
4242
{
43-
# Gyp doesn't seem to handle non-absolute paths here properly...
4443
'library_dirs':
4544
[
46-
'<(src_top_dir_abs)/prebuilt/lib/linux/<(target_arch)',
45+
'lib/linux/<(target_arch)',
4746
],
4847

4948
'libraries':

prebuilt/libicu.gyp

Lines changed: 39 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,45 @@
3333
[
3434
'toolset_os == "mac"',
3535
{
36-
'libraries':
36+
'conditions':
3737
[
38-
'lib/mac/libicui18n.a',
39-
'lib/mac/libicuio.a',
40-
'lib/mac/libicule.a',
41-
'lib/mac/libiculx.a',
42-
'lib/mac/libicutu.a',
43-
'lib/mac/libicuuc.a',
44-
'lib/mac/libicudata.a',
38+
[
39+
'GENERATOR == "xcode"',
40+
{
41+
'libraries':
42+
[
43+
'lib/mac/libicui18n.a',
44+
'lib/mac/libicuio.a',
45+
'lib/mac/libicule.a',
46+
'lib/mac/libiculx.a',
47+
'lib/mac/libicutu.a',
48+
'lib/mac/libicuuc.a',
49+
'lib/mac/libicudata.a',
50+
],
51+
},
52+
{
53+
'library_dirs':
54+
[
55+
'lib/mac',
56+
],
57+
58+
'libraries':
59+
[
60+
'-licui18n',
61+
'-licuio',
62+
'-licule',
63+
'-liculx',
64+
'-licutu',
65+
'-licuuc',
66+
'-licudata',
67+
],
68+
},
69+
],
4570
],
4671
},
4772
],
4873
[
49-
'OS == "ios"',
74+
'toolset_os == "ios"',
5075
{
5176
'libraries':
5277
[
@@ -65,7 +90,7 @@
6590
# Gyp doesn't seem to handle non-absolute paths here properly...
6691
'library_dirs':
6792
[
68-
'<(src_top_dir_abs)/prebuilt/lib/linux/>(toolset_arch)',
93+
'lib/linux/>(toolset_arch)',
6994
],
7095

7196
'libraries':
@@ -82,12 +107,12 @@
82107
},
83108
],
84109
[
85-
'OS == "android"',
110+
'toolset_os == "android"',
86111
{
87112
# Gyp doesn't seem to handle non-absolute paths here properly...
88113
'library_dirs':
89114
[
90-
'<(src_top_dir_abs)/prebuilt/lib/android/<(target_arch)',
115+
'lib/android/<(target_arch)',
91116
],
92117

93118
'libraries':
@@ -104,7 +129,7 @@
104129
},
105130
],
106131
[
107-
'OS == "win"',
132+
'toolset_os == "win"',
108133
{
109134
'library_dirs':
110135
[
@@ -131,7 +156,7 @@
131156
{
132157
'library_dirs':
133158
[
134-
'<(src_top_dir_abs)/prebuilt/lib/emscripten/js',
159+
'lib/emscripten/js',
135160
],
136161

137162
'libraries':

prebuilt/libopenssl.gyp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
# Gyp doesn't seem to handle non-absolute paths here properly...
5454
'library_dirs':
5555
[
56-
'<(src_top_dir_abs)/prebuilt/lib/linux/<(target_arch)',
56+
'lib/linux/<(target_arch)',
5757
],
5858

5959
'libraries':
@@ -70,7 +70,7 @@
7070
{
7171
'library_dirs':
7272
[
73-
'<(src_top_dir_abs)/prebuilt/lib/android/<(target_arch)',
73+
'lib/android/<(target_arch)',
7474
],
7575

7676
'libraries':

0 commit comments

Comments
 (0)