Skip to content

Commit 45c96bf

Browse files
committed
add -fPIC to tizen
1 parent ecbdece commit 45c96bf

File tree

5 files changed

+25
-9
lines changed

5 files changed

+25
-9
lines changed

build/tizen/build.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,10 @@ mkdir -p "tizen-armv7-a" && cd "tizen-armv7-a"
100100
#
101101
# make
102102
#
103-
core_count=`sysctl -n machdep.cpu.core_count`
104-
let jobs=$core_count+1
105-
info "Running make -j$jobs"
103+
## FIXME: some 3rd party libraries doesn't support parallel build, like openssl. so we just disable the feature here
104+
# core_count=`sysctl -n machdep.cpu.core_count`
105+
# let jobs=$core_count+1
106+
# info "Running make -j$jobs"
106107
make fetch
107108
make list
108-
make -j$jobs
109+
make

contrib/src/main.mak

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,9 @@ ifdef HAVE_ANDROID
411411
echo "set(CMAKE_CXX_SYSROOT_FLAG \"\")" >> $@
412412
echo "set(CMAKE_C_SYSROOT_FLAG \"\")" >> $@
413413
endif
414+
ifdef HAVE_TIZEN
415+
echo "set(CMAKE_SYSTEM_NAME Linux)" >> $@
416+
endif
414417
endif
415418
echo "set(CMAKE_C_COMPILER $(CC))" >> $@
416419
echo "set(CMAKE_CXX_COMPILER $(CXX))" >> $@

contrib/src/openssl/rules.mak

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@ ifeq ($(shell uname),Darwin)
1414
OPENSSL_CONFIG_VARS=darwin64-x86_64-cc
1515
endif
1616

17+
ifdef HAVE_TIZEN
18+
OPENSSL_COMPILER=os/compiler:arm-linux-gnueabi-
19+
OPENSSL_ECFLAGS = -fPIC
20+
endif
21+
22+
ifdef HAVE_ANDROID
23+
OPENSSL_COMPILER=os/compiler:$(HOST)
24+
endif
1725

1826
$(TARBALLS)/openssl-$(OPENSSL_VERSION).tar.gz:
1927
$(call download,$(OPENSSL_URL))
@@ -25,6 +33,6 @@ openssl: openssl-$(OPENSSL_VERSION).tar.gz .sum-openssl
2533
$(MOVE)
2634

2735
.openssl: openssl
28-
cd $< && $(HOSTVARS) ./Configure $(OPENSSL_CONFIG_VARS) --prefix=$(PREFIX) --openssldir=$(PREFIX)
36+
cd $< && $(HOSTVARS) CFLAGS="$(CFLAGS) $(OPENSSL_ECFLAGS)" ./Configure $(OPENSSL_CONFIG_VARS) --prefix=$(PREFIX) --openssldir=$(PREFIX) $(OPENSSL_COMPILER)
2937
cd $< && $(MAKE) install
3038
touch $@

contrib/src/websockets/rules.mak

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,15 @@ websockets: libwebsockets-1.3-chrome37-firefox30.zip .sum-websockets
1212
$(UNPACK)
1313
$(MOVE)
1414

15+
ifdef HAVE_TIZEN
16+
EX_ECFLAGS = -fPIC
17+
endif
18+
1519
DEPS_websockets = zlib $(DEPS_zlib)
1620

1721
DEPS_websockets = openssl $(DEPS_openssl)
1822

1923
.websockets: websockets .zlib .openssl toolchain.cmake
20-
cd $< && $(HOSTVARS) $(CMAKE) -DCMAKE_BUILD_TYPE=Release
24+
cd $< && $(HOSTVARS) CFLAGS="$(CFLAGS) $(EX_ECFLAGS)" $(CMAKE) -DCMAKE_BUILD_TYPE=Release -DLIBWEBSOCKETS_LIBRARIES=websocket
2125
cd $< && $(MAKE) install
2226
touch $@

contrib/src/zlib/rules.mak

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ ZLIB_CONFIG_VARS=CHOST=$(HOST)
1616
endif
1717
endif
1818

19-
ifdef HAVE_SOLARIS
20-
ZLIB_ECFLAGS = -fPIC -DPIC
19+
ifdef HAVE_TIZEN
20+
EX_ECFLAGS = -fPIC
2121
endif
2222

2323
$(TARBALLS)/zlib-$(ZLIB_VERSION).tar.gz:
@@ -30,6 +30,6 @@ zlib: zlib-$(ZLIB_VERSION).tar.gz .sum-zlib
3030
$(MOVE)
3131

3232
.zlib: zlib
33-
cd $< && $(HOSTVARS) $(ZLIB_CONFIG_VARS) CFLAGS="$(CFLAGS) $(ZLIB_ECFLAGS)" ./configure --prefix=$(PREFIX) --static
33+
cd $< && $(HOSTVARS) $(ZLIB_CONFIG_VARS) CFLAGS="$(CFLAGS) $(EX_ECFLAGS)" ./configure --prefix=$(PREFIX) --static
3434
cd $< && $(MAKE) install
3535
touch $@

0 commit comments

Comments
 (0)