Tuesday, 22 November 2016

XMPPFramework - libidn bitcode enabled compilation



Compiling Libidn


How to compile libidn for the iPhone and OS X.

https://github.com/robbiehanson/XMPPFramework/wiki/CompilingLibidn


However, it doesn't work for bitcode enable compilation.

Special Thanks to Mr. . Please refer the github links.


How to compile libidn with bitcode ?

  1. Download the XMPPFramework form https://github.com/robbiehanson/XMPPFramework
  2. locate  XMPPFramework/Vendor/libidn/
  3. Now, you have to update the build-libidn.sh file for bitcode
  4.  https://github.com/robbiehanson/XMPPFramework/pull/593/files

@@ -22,8 +22,8 @@
###########################################################################
# Choose your libidn version and your currently-installed iOS SDK version:
#
-VERSION="1.25"
-SDKVERSION="6.0"
+VERSION="1.31"
+SDKVERSION=""
#
#
###########################################################################
@@ -34,7 +34,7 @@ SDKVERSION="6.0"
# No need to change this since xcode build will only compile in the
# necessary bits from the libraries we create
-ARCHS="i386 armv7 armv7s"
+ARCHS="i386 x86_64 armv7 armv7s arm64"
DEVELOPER=`xcode-select -print-path`
@@ -68,7 +68,7 @@ if [ ! -e "${SRCDIR}/libidn-${VERSION}.tar.gz" ]; then
echo "Downloading libidn-${VERSION}.tar.gz"
curl -LO http://ftp.gnu.org/gnu/libidn/libidn-${VERSION}.tar.gz
else
-
+
echo "Using libidn-${VERSION}.tar.gz"
fi
@@ -88,30 +88,30 @@ set -e # back to regular "bail out on error" mode
for ARCH in ${ARCHS}
do
- if [ "${ARCH}" == "i386" ];
+ if [[ "${ARCH}" == "i386" || "${ARCH}" == "x86_64" ]];
then
PLATFORM="iPhoneSimulator"
EXTRA_CONFIG=""
- EXTRA_CFLAGS=""
+ EXTRA_CFLAGS="-fembed-bitcode"
else
PLATFORM="iPhoneOS"
EXTRA_CONFIG="--host=arm-apple-darwin10 --disable-asm"
- EXTRA_CFLAGS="-DNO_ASM"
+ EXTRA_CFLAGS="-fembed-bitcode -DNO_ASM"
fi
mkdir -p "${INTERDIR}/${PLATFORM}${SDKVERSION}-${ARCH}.sdk"
./configure --disable-shared --enable-static ${EXTRA_CONFIG} \
--prefix="${INTERDIR}/${PLATFORM}${SDKVERSION}-${ARCH}.sdk" \
- CC="${CCACHE}${DEVELOPER}/Platforms/${PLATFORM}.platform/Developer/usr/bin/gcc -arch ${ARCH}" \
+ CC="${CCACHE}${DEVELOPER}/usr/bin/gcc -arch ${ARCH} -miphoneos-version-min=7.0" \
LDFLAGS="$LDFLAGS -L${OUTPUTDIR}/lib" \
CFLAGS="$CFLAGS ${EXTRA_CFLAGS} -I${OUTPUTDIR}/include -isysroot ${DEVELOPER}/Platforms/${PLATFORM}.platform/Developer/SDKs/${PLATFORM}${SDKVERSION}.sdk" \
CPPFLAGS="$CPPFLAGS -I${OUTPUTDIR}/include -isysroot ${DEVELOPER}/Platforms/${PLATFORM}.platform/Developer/SDKs/${PLATFORM}${SDKVERSION}.sdk"
# Build the application and install it to the fake SDK intermediary dir
# we have set up. Make sure to clean up afterward because we will re-use
# this source tree to cross-compile other targets.
- make -j2
+ make -j8
make install
make clean
done
@@ -125,7 +125,7 @@ OUTPUT_LIBS="libidn.a"
for OUTPUT_LIB in ${OUTPUT_LIBS}; do
INPUT_LIBS=""
for ARCH in ${ARCHS}; do
- if [ "${ARCH}" == "i386" ];
+ if [[ "${ARCH}" == "i386" || "${ARCH}" == "x86_64" ]];
then
PLATFORM="iPhoneSimulator"
else
@@ -146,7 +146,7 @@ for OUTPUT_LIB in ${OUTPUT_LIBS}; do
done
for ARCH in ${ARCHS}; do
- if [ "${ARCH}" == "i386" ];
+ if [[ "${ARCH}" == "i386" || "${ARCH}" == "x86_64" ]];
then
PLATFORM="iPhoneSimulator"
else
@@ -161,7 +161,7 @@ for ARCH in ${ARCHS}; do
done
for ARCH in ${ARCHS}; do
- if [ "${ARCH}" == "i386" ];
+ if [[ "${ARCH}" == "i386" || "${ARCH}" == "x86_64" ]];
then
PLATFORM="iPhoneSimulator"
else
@@ -1,5 +1,5 @@
/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
-/* Copyright (C) 2001-2002, 2004-2012 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2002, 2004-2015 Free Software Foundation, Inc.
Written by Paul Eggert, Bruno Haible, Sam Steingold, Peter Burwood.
This file is part of gnulib.
@@ -39,8 +39,7 @@
other system header files; just include the system's <stdint.h>.
Ideally we should test __BIONIC__ here, but it is only defined after
<sys/cdefs.h> has been included; hence test __ANDROID__ instead. */
-#if defined __ANDROID__ \
- && defined _SYS_TYPES_H_ && !defined _SSIZE_T_DEFINED_
+#if defined __ANDROID__ && defined _GL_INCLUDING_SYS_TYPES_H
# include <stdint.h>
#else
@@ -84,7 +83,7 @@
/* <sys/types.h> defines some of the stdint.h types as well, on glibc,
IRIX 6.5, and OpenBSD 3.8 (via <machine/types.h>).
AIX 5.2 <sys/types.h> isn't needed and causes troubles.
- MacOS X 10.4.6 <sys/types.h> includes <stdint.h> (which is us), but
+ Mac OS X 10.4.6 <sys/types.h> includes <stdint.h> (which is us), but
relies on the system <stdint.h> definitions, so include
<sys/types.h> after <stdint.h>. */
#if 1 && ! defined _AIX
Binary file not shown.


@@ -1,5 +1,5 @@
/* stringprep.h --- Header file for stringprep functions.
- Copyright (C) 2002-2012 Simon Josefsson
+ Copyright (C) 2002-2015 Simon Josefsson
This file is part of GNU Libidn.
@@ -44,14 +44,14 @@
# include <stddef.h> /* size_t */
# include <sys/types.h> /* ssize_t */
-# include "idn-int.h" /* uint32_t */
+# include <idn-int.h> /* uint32_t */
# ifdef __cplusplus
extern "C"
{
# endif
-# define STRINGPREP_VERSION "1.25"
+# define STRINGPREP_VERSION "1.31"
/* Error codes. */
typedef enum
@@ -68,6 +68,7 @@ extern "C"
STRINGPREP_PROFILE_ERROR = 101,
STRINGPREP_FLAG_ERROR = 102,
STRINGPREP_UNKNOWN_PROFILE = 103,
+ STRINGPREP_ICONV_ERROR = 104,
/* Internal errors. */
STRINGPREP_NFKC_FAILED = 200,
STRINGPREP_MALLOC_ERROR = 201