Skip to content
This repository has been archived by the owner on Jun 13, 2019. It is now read-only.

Build: Some words about building on OSX #8

Closed
gabrielschulhof opened this issue Jun 5, 2015 · 4 comments
Closed

Build: Some words about building on OSX #8

gabrielschulhof opened this issue Jun 5, 2015 · 4 comments
Assignees

Comments

@gabrielschulhof
Copy link

@poussa could you maybe mention a few things about the particulares of building/installing on OSX in the README.md?

@poussa
Copy link

poussa commented Jun 11, 2015

I will do it but we need some preparation to make it clean. Can you merge the below to the install.sh.

After build on mac the iotivity out directory structure is the following. Note, the out/darwin has .framework directory so the ARCH gets incorrect value. Also the liboctbstack is not a combo.

out/darwin
out/darwin/iotivity-csdk.framework
out/darwin/iotivity-csdk.framework/Versions
out/darwin/iotivity-csdk.framework/Versions/A
out/darwin/iotivity-csdk.framework/Versions/A/Documentation
out/darwin/iotivity-csdk.framework/Versions/A/Headers
out/darwin/iotivity-csdk.framework/Versions/A/Resources
out/darwin/objs
out/darwin/objs/x86_64
out/darwin/x86_64
out/darwin/x86_64/out
out/darwin/x86_64/out/darwin
out/darwin/x86_64/release
out/darwin/x86_64/release/extlibs
out/darwin/x86_64/release/extlibs/cjson
out/darwin/x86_64/release/extlibs/timer
out/darwin/x86_64/release/resource
out/darwin/x86_64/release/resource/c_common
out/darwin/x86_64/release/resource/c_common/oic_malloc
out/darwin/x86_64/release/resource/c_common/oic_malloc/src
out/darwin/x86_64/release/resource/c_common/oic_string
out/darwin/x86_64/release/resource/c_common/oic_string/src
out/darwin/x86_64/release/resource/csdk
out/darwin/x86_64/release/resource/csdk/connectivity
out/darwin/x86_64/release/resource/csdk/connectivity/common
out/darwin/x86_64/release/resource/csdk/connectivity/common/src
out/darwin/x86_64/release/resource/csdk/connectivity/lib
out/darwin/x86_64/release/resource/csdk/connectivity/lib/libcoap-4.1.1
out/darwin/x86_64/release/resource/csdk/connectivity/src
out/darwin/x86_64/release/resource/csdk/connectivity/src/adapter_util
out/darwin/x86_64/release/resource/csdk/connectivity/src/bt_edr_adapter
out/darwin/x86_64/release/resource/csdk/connectivity/src/bt_le_adapter
out/darwin/x86_64/release/resource/csdk/connectivity/src/ip_adapter
out/darwin/x86_64/release/resource/csdk/connectivity/src/ip_adapter/linux
out/darwin/x86_64/release/resource/csdk/connectivity/test
out/darwin/x86_64/release/resource/csdk/logger
out/darwin/x86_64/release/resource/csdk/logger/src
out/darwin/x86_64/release/resource/csdk/ocrandom
out/darwin/x86_64/release/resource/csdk/ocrandom/src
out/darwin/x86_64/release/resource/csdk/security
out/darwin/x86_64/release/resource/csdk/security/src
out/darwin/x86_64/release/resource/csdk/stack
out/darwin/x86_64/release/resource/csdk/stack/samples
out/darwin/x86_64/release/resource/csdk/stack/samples/linux
out/darwin/x86_64/release/resource/csdk/stack/samples/linux/SimpleClientServer
out/darwin/x86_64/release/resource/csdk/stack/src
out/darwin/x86_64/release/resource/csdk/stack/test
--- install.sh.orig 2015-06-11 10:44:01.000000000 +0300
+++ install.sh  2015-06-11 10:42:19.000000000 +0300
@@ -7,7 +7,13 @@

 # Install the first platform/arch/configuration we find
 PLATFORM="$(ls out | head -n 1)"
-ARCH="$(ls out/${PLATFORM} | head -n 1)"
+
+if test "${PLATFORM}" = "darwin"; then
+  ARCH=x86_64
+else
+  ARCH="$(ls out/${PLATFORM} | head -n 1)"
+fi
+
 CONFIGURATION="$(ls out/${PLATFORM}/${ARCH} | head -n 1)"

 LIBDIR="$( echo "${DESTDIR}/${PREFIX}/lib" | sed 's@//*@/@g' )"
@@ -18,7 +24,11 @@
 set -x

 mkdir -p "${LIBDIR}" || exit 1
-cp out/${PLATFORM}/${ARCH}/${CONFIGURATION}/liboctbstack.so ${LIBDIR} || exit 1
+if test "${PLATFORM}" = "darwin"; then
+  cp out/${PLATFORM}/${ARCH}/${CONFIGURATION}/*.a ${LIBDIR} || exit 1
+else
+  cp out/${PLATFORM}/${ARCH}/${CONFIGURATION}/liboctbstack.a ${LIBDIR} || exit 1
+fi

 mkdir -p "${INCLUDEDIR}/iotivity/resource/csdk/stack" || exit 1
 cp -a resource/csdk/stack/include "${INCLUDEDIR}/${OCTBSTACK_INCLUDEDIR}" || exit 1

@poussa
Copy link

poussa commented Jun 11, 2015

One more thing, out/darwin/x86_64 has extra out directory so the CONFIGURATION is still wrong. I cook new patch.

@poussa
Copy link

poussa commented Jun 11, 2015

Here is a proper patch for install.sh which works also on Mac.

--- install.sh.orig 2015-06-11 12:12:29.000000000 +0300
+++ install.sh  2015-06-11 12:12:41.000000000 +0300
@@ -7,8 +7,14 @@

 # Install the first platform/arch/configuration we find
 PLATFORM="$(ls out | head -n 1)"
-ARCH="$(ls out/${PLATFORM} | head -n 1)"
-CONFIGURATION="$(ls out/${PLATFORM}/${ARCH} | head -n 1)"
+
+if test "${PLATFORM}" = "darwin"; then
+  ARCH=x86_64
+else
+  ARCH="$(ls out/${PLATFORM} | head -n 1)"
+fi
+
+CONFIGURATION="$(ls out/${PLATFORM}/${ARCH} | grep -E "release|debug" | head -n 1)"

 LIBDIR="$( echo "${DESTDIR}/${PREFIX}/lib" | sed 's@//*@/@g' )"
 INCLUDEDIR="$( echo "${DESTDIR}/${PREFIX}/include" | sed 's@//*@/@g' )"
@@ -18,7 +24,11 @@
 set -x

 mkdir -p "${LIBDIR}" || exit 1
-cp out/${PLATFORM}/${ARCH}/${CONFIGURATION}/liboctbstack.so ${LIBDIR} || exit 1
+if test "${PLATFORM}" = "darwin"; then
+  cp out/${PLATFORM}/${ARCH}/${CONFIGURATION}/*.a ${LIBDIR} || exit 1
+else
+  cp out/${PLATFORM}/${ARCH}/${CONFIGURATION}/liboctbstack.a ${LIBDIR} || exit 1
+fi

 mkdir -p "${INCLUDEDIR}/iotivity/resource/csdk/stack" || exit 1
 cp -a resource/csdk/stack/include "${INCLUDEDIR}/${OCTBSTACK_INCLUDEDIR}" || exit 1

@gabrielschulhof
Copy link
Author

OK. I've added this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants