Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Upgrade to libidn-1.25, remove support for armv6 and add support for …

…armv7s
commit 33554eb475f6fffdb7883ca96a9c085476810bd3 1 parent f533eb8
@chrisballinger chrisballinger authored
View
184 Vendor/libidn/build-libidn.sh
@@ -0,0 +1,184 @@
+#!/bin/bash
+# Builds libidn for all three current iPhone targets: iPhoneSimulator-i386,
+# iPhoneOS-armv7, iPhoneOS-armv7s.
+#
+# Copyright 2012 Mike Tigas <mike@tig.as>
+#
+# Based on work by Felix Schulze on 16.12.10.
+# Copyright 2010 Felix Schulze. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+###########################################################################
+# Choose your libidn version and your currently-installed iOS SDK version:
+#
+VERSION="1.25"
+SDKVERSION="6.0"
+#
+#
+###########################################################################
+#
+# Don't change anything under this line!
+#
+###########################################################################
+
+# No need to change this since xcode build will only compile in the
+# necessary bits from the libraries we create
+ARCHS="i386 armv7 armv7s"
+
+DEVELOPER=`xcode-select -print-path`
+
+cd "`dirname \"$0\"`"
+REPOROOT=$(pwd)
+
+# Where we'll end up storing things in the end
+OUTPUTDIR="${REPOROOT}/dependencies"
+mkdir -p ${OUTPUTDIR}/include
+mkdir -p ${OUTPUTDIR}/lib
+mkdir -p ${OUTPUTDIR}/bin
+
+
+BUILDDIR="${REPOROOT}/build"
+
+# where we will keep our sources and build from.
+SRCDIR="${BUILDDIR}/src"
+mkdir -p $SRCDIR
+# where we will store intermediary builds
+INTERDIR="${BUILDDIR}/built"
+mkdir -p $INTERDIR
+
+########################################
+
+cd $SRCDIR
+
+# Exit the script if an error happens
+set -e
+
+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
+
+tar zxf libidn-${VERSION}.tar.gz -C $SRCDIR
+cd "${SRCDIR}/libidn-${VERSION}"
+
+set +e # don't bail out of bash script if ccache doesn't exist
+CCACHE=`which ccache`
+if [ $? == "0" ]; then
+ echo "Building with ccache: $CCACHE"
+ CCACHE="${CCACHE} "
+else
+ echo "Building without ccache"
+ CCACHE=""
+fi
+set -e # back to regular "bail out on error" mode
+
+for ARCH in ${ARCHS}
+do
+ if [ "${ARCH}" == "i386" ];
+ then
+ PLATFORM="iPhoneSimulator"
+ EXTRA_CONFIG=""
+ EXTRA_CFLAGS=""
+ else
+ PLATFORM="iPhoneOS"
+ EXTRA_CONFIG="--host=arm-apple-darwin10 --disable-asm"
+ EXTRA_CFLAGS="-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}" \
+ 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 install
+ make clean
+done
+
+########################################
+
+echo "Build library..."
+
+# These are the libs that comprise libidn.
+OUTPUT_LIBS="libidn.a"
+for OUTPUT_LIB in ${OUTPUT_LIBS}; do
+ INPUT_LIBS=""
+ for ARCH in ${ARCHS}; do
+ if [ "${ARCH}" == "i386" ];
+ then
+ PLATFORM="iPhoneSimulator"
+ else
+ PLATFORM="iPhoneOS"
+ fi
+ INPUT_ARCH_LIB="${INTERDIR}/${PLATFORM}${SDKVERSION}-${ARCH}.sdk/lib/${OUTPUT_LIB}"
+ if [ -e $INPUT_ARCH_LIB ]; then
+ INPUT_LIBS="${INPUT_LIBS} ${INPUT_ARCH_LIB}"
+ fi
+ done
+ # Combine the three architectures into a universal library.
+ if [ -n "$INPUT_LIBS" ]; then
+ lipo -create $INPUT_LIBS \
+ -output "${OUTPUTDIR}/lib/${OUTPUT_LIB}"
+ else
+ echo "$OUTPUT_LIB does not exist, skipping (are the dependencies installed?)"
+ fi
+done
+
+for ARCH in ${ARCHS}; do
+ if [ "${ARCH}" == "i386" ];
+ then
+ PLATFORM="iPhoneSimulator"
+ else
+ PLATFORM="iPhoneOS"
+ fi
+ cp -R ${INTERDIR}/${PLATFORM}${SDKVERSION}-${ARCH}.sdk/include/* ${OUTPUTDIR}/include/
+ if [ $? == "0" ]; then
+ # We only need to copy the headers over once. (So break out of forloop
+ # once we get first success.)
+ break
+ fi
+done
+
+for ARCH in ${ARCHS}; do
+ if [ "${ARCH}" == "i386" ];
+ then
+ PLATFORM="iPhoneSimulator"
+ else
+ PLATFORM="iPhoneOS"
+ fi
+ cp -R ${INTERDIR}/${PLATFORM}${SDKVERSION}-${ARCH}.sdk/bin/* ${OUTPUTDIR}/bin/
+ if [ $? == "0" ]; then
+ # We only need to copy the binaries over once. (So break out of forloop
+ # once we get first success.)
+ break
+ fi
+done
+
+####################
+
+echo "Building done."
+echo "Cleaning up..."
+rm -fr ${INTERDIR}
+rm -fr "${SRCDIR}/libidn-${VERSION}"
+echo "Done."
View
63 Vendor/libidn/idn-int.h
@@ -14,8 +14,7 @@
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
/*
* ISO C 99 <stdint.h> for platforms that lack it.
@@ -35,6 +34,16 @@
<inttypes.h>. */
#define _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
+/* On Android (Bionic libc), <sys/types.h> includes this file before
+ having defined 'time_t'. Therefore in this case avoid including
+ 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_
+# include <stdint.h>
+#else
+
/* Get those types that are already defined in other system include
files, so that we can "#define int8_t signed char" below without
worrying about a later system include file containing a "typedef
@@ -82,7 +91,8 @@
# include <sys/types.h>
#endif
-/* Get LONG_MIN, LONG_MAX, ULONG_MAX. */
+/* Get SCHAR_MIN, SCHAR_MAX, UCHAR_MAX, INT_MIN, INT_MAX,
+ LONG_MIN, LONG_MAX, ULONG_MAX. */
#include <limits.h>
#if 1
@@ -238,8 +248,9 @@ typedef unsigned long long int gl_uint64_t;
/* Here we assume a standard architecture where the hardware integer
types have 8, 16, 32, optionally 64 bits. Therefore the fastN_t types
- are taken from the same list of types. Assume that 'long int'
- is fast enough for all narrower integers. */
+ are taken from the same list of types. The following code normally
+ uses types consistent with glibc, as that lessens the chance of
+ incompatibility with older GNU hosts. */
#undef int_fast8_t
#undef uint_fast8_t
@@ -249,12 +260,21 @@ typedef unsigned long long int gl_uint64_t;
#undef uint_fast32_t
#undef int_fast64_t
#undef uint_fast64_t
-typedef long int gl_int_fast8_t;
-typedef unsigned long int gl_uint_fast8_t;
-typedef long int gl_int_fast16_t;
-typedef unsigned long int gl_uint_fast16_t;
+typedef signed char gl_int_fast8_t;
+typedef unsigned char gl_uint_fast8_t;
+
+#ifdef __sun
+/* Define types compatible with SunOS 5.10, so that code compiled under
+ earlier SunOS versions works with code compiled under SunOS 5.10. */
+typedef int gl_int_fast32_t;
+typedef unsigned int gl_uint_fast32_t;
+#else
typedef long int gl_int_fast32_t;
typedef unsigned long int gl_uint_fast32_t;
+#endif
+typedef gl_int_fast32_t gl_int_fast16_t;
+typedef gl_uint_fast32_t gl_uint_fast16_t;
+
#define int_fast8_t gl_int_fast8_t
#define uint_fast8_t gl_uint_fast8_t
#define int_fast16_t gl_int_fast16_t
@@ -410,23 +430,29 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t)
#undef INT_FAST8_MIN
#undef INT_FAST8_MAX
#undef UINT_FAST8_MAX
-#define INT_FAST8_MIN LONG_MIN
-#define INT_FAST8_MAX LONG_MAX
-#define UINT_FAST8_MAX ULONG_MAX
+#define INT_FAST8_MIN SCHAR_MIN
+#define INT_FAST8_MAX SCHAR_MAX
+#define UINT_FAST8_MAX UCHAR_MAX
#undef INT_FAST16_MIN
#undef INT_FAST16_MAX
#undef UINT_FAST16_MAX
-#define INT_FAST16_MIN LONG_MIN
-#define INT_FAST16_MAX LONG_MAX
-#define UINT_FAST16_MAX ULONG_MAX
+#define INT_FAST16_MIN INT_FAST32_MIN
+#define INT_FAST16_MAX INT_FAST32_MAX
+#define UINT_FAST16_MAX UINT_FAST32_MAX
#undef INT_FAST32_MIN
#undef INT_FAST32_MAX
#undef UINT_FAST32_MAX
-#define INT_FAST32_MIN LONG_MIN
-#define INT_FAST32_MAX LONG_MAX
-#define UINT_FAST32_MAX ULONG_MAX
+#ifdef __sun
+# define INT_FAST32_MIN INT_MIN
+# define INT_FAST32_MAX INT_MAX
+# define UINT_FAST32_MAX UINT_MAX
+#else
+# define INT_FAST32_MIN LONG_MIN
+# define INT_FAST32_MAX LONG_MAX
+# define UINT_FAST32_MAX ULONG_MAX
+#endif
#undef INT_FAST64_MIN
#undef INT_FAST64_MAX
@@ -608,4 +634,5 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t)
#endif
#endif /* _GL_LGL_STDINT_H */
+#endif /* !(defined __ANDROID__ && ...) */
#endif /* !defined _GL_LGL_STDINT_H && !defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H */
View
BIN  Vendor/libidn/libidn-1.24.tar.gz
Binary file not shown
View
BIN  Vendor/libidn/libidn.a
Binary file not shown
View
2  Vendor/libidn/stringprep.h
@@ -51,7 +51,7 @@ extern "C"
{
# endif
-# define STRINGPREP_VERSION "1.24"
+# define STRINGPREP_VERSION "1.25"
/* Error codes. */
typedef enum
Please sign in to comment.
Something went wrong with that request. Please try again.