1. Ivan Vučica
  2. GNUstep-Android

Commits

Ivan Vučica  committed cc5254b

Fixed building of libobjc2.

  • Participants
  • Parent commits 123f0cf
  • Branches default

Comments (0)

Files changed (3)

File env.sh

View file
 export ANDROID_GNUSTEP_SCRIPT=`realpath "${BASH_SOURCE}"`
 export ANDROID_GNUSTEP_SCRIPT_ROOT=`dirname "${ANDROID_GNUSTEP_SCRIPT}"`
 
+if which gnustep-config ; then
+	if [ -e "$(gnustep-config --variable=GNUSTEP_MAKEFILES)/GNUstep-reset.sh" ] ; then
+		echo "Resetting GNUstep environment variables..."
+		. "$(gnustep-config --variable=GNUSTEP_MAKEFILES)/GNUstep-reset.sh"
+	fi
+fi
+

File phases/25-fetch-android-cmake-toolchain-file.sh

View file
 if true ; then
 	if [ ! -e android.toolchain.cmake ] ; then
 		wget https://github.com/taka-no-me/android-cmake/raw/master/android.toolchain.cmake
+		cat >> android.toolchain.cmake << _EOF
+		
+		if( ANDROID_COMPILER_IS_CLANG )
+		 set ( CMAKE_C_FLAGS "-integrated-as \${CMAKE_C_FLAGS}" )
+		 set ( CMAKE_CXX_FLAGS "-integrated-as \${CMAKE_CXX_FLAGS}" )
+		endif()
+_EOF
+
 	fi
 else
 	# source: http://root.cern.ch/svn/root/trunk/interpreter/llvm/src/cmake/platforms/Android.cmake

File phases/30-build-libobjc2.sh

View file
 # ANDROID_NDK must be empty in order for the 'longer' toolchain file to use ANDROID_STANDALONE_TOOLCHAIN.
 # CMAKE_C_COMPILER_VERSION is not defined by the 'longer' toolchain file, so we'll do it manually.
 # ANDROID_ABI defaults to armeabi-v7a which clang doesn't like.
+# ANDROID_NO_UNDEFINED because libobjcxx explicitly has undefined symbols existing in libobjc.
+# ANDROID_SO_UNDEFINED because libobjcxx explicitly has undefined symbols existing in libobjc.
+# GNUSTEP_INSTALL_TYPE needed otherwise gnustep-config might possibly get used.
 if
 ANDROID_NDK= \
 cmake -DCMAKE_TOOLCHAIN_FILE="${ANDROID_GNUSTEP_INSTALL_ROOT}/android.toolchain.cmake" \
 	-DANDROID_STANDALONE_TOOLCHAIN="/tmp/my-android-toolchain/" \
 	-DANDROID_TOOLCHAIN_NAME="standalone-clang" \
 	-DTESTS=FALSE \
-	-DCMAKE_INSTALL_PREFIX:PATH=${ANDROID_GNUSTEP_INSTALL_ROOT}/gs-install \
 	-DCMAKE_C_COMPILER_VERSION=3.4 \
+	-DANDROID_NO_UNDEFINED=OFF \
+	-DANDROID_SO_UNDEFINED=ON \
 	-DANDROID_ABI=armeabi \
+	-DCMAKE_INSTALL_PREFIX=${ANDROID_GNUSTEP_INSTALL_ROOT}/gs-install \
+	-DGNUSTEP_INSTALL_TYPE=NONE \
 	.. ; then
 	echo "Generated libobjc2 makefile with cmake"
 else
 	exit 1
 fi
 
-if make -j8 objc objcxx ; then
+if make -j8 objc objcxx VERBOSE=y; then
 	echo "libobjc2 built"
 else
 	echo "Failed to make libobjc2"