Skip to content

Commit

Permalink
deps: upgrade c-ares to piscisaureus/cares@805d153
Browse files Browse the repository at this point in the history
This should fix the Android build.
  • Loading branch information
bnoordhuis committed Jul 6, 2013
1 parent 82ff891 commit 58e4eda
Show file tree
Hide file tree
Showing 7 changed files with 646 additions and 2 deletions.
1 change: 1 addition & 0 deletions deps/cares/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/Debug/
/build/gyp
/out/
/Release/

Expand Down
21 changes: 21 additions & 0 deletions deps/cares/android-configure
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

export TOOLCHAIN=$PWD/android-toolchain
mkdir -p $TOOLCHAIN
$1/build/tools/make-standalone-toolchain.sh \
--toolchain=arm-linux-androideabi-4.7 \
--arch=arm \
--install-dir=$TOOLCHAIN \
--platform=android-9
export PATH=$TOOLCHAIN/bin:$PATH
export AR=arm-linux-androideabi-ar
export CC=arm-linux-androideabi-gcc
export CXX=arm-linux-androideabi-g++
export LINK=arm-linux-androideabi-g++
export PLATFORM=android
export OS=android

if [ $2 -a $2 == 'gyp' ]
then
./gyp_cares -DOS=android -Dtarget_arch=arm
fi
4 changes: 4 additions & 0 deletions deps/cares/build.mk
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ ifeq (linux,$(OS))
CFLAGS += -D_GNU_SOURCE
endif

ifeq (android,$(OS))
CFLAGS += -D_GNU_SOURCE
endif

ifeq (sunos,$(OS))
LDFLAGS += -lsocket -lnsl
CFLAGS += -D__EXTENSIONS__ -D_XOPEN_SOURCE=500
Expand Down
10 changes: 9 additions & 1 deletion deps/cares/cares.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,17 @@
# Not Windows i.e. POSIX
'cflags': [
'-g',
'--std=gnu89',
'-pedantic',
'-Wall',
'-Wextra',
'-Wno-unused-parameter'
],
}],
[ 'OS not in "win android"', {
'cflags': [
'--std=gnu89'
],
}],
[ 'OS=="linux"', {
'include_dirs': [ 'config/linux' ],
'sources': [ 'config/linux/ares_config.h' ]
Expand All @@ -144,6 +148,10 @@
'include_dirs': [ 'config/openbsd' ],
'sources': [ 'config/openbsd/ares_config.h' ]
}],
[ 'OS=="android"', {
'include_dirs': [ 'config/android' ],
'sources': [ 'config/android/ares_config.h' ],
}],
[ 'OS=="solaris"', {
'include_dirs': [ 'config/sunos' ],
'sources': [ 'config/sunos/ares_config.h' ],
Expand Down
2 changes: 1 addition & 1 deletion deps/cares/common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
],
}],

[ 'OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris"', {
[ 'OS in "linux freebsd openbsd solaris android"', {
'variables': {
'gcc_version%': '<!(python build/gcc_version.py)>)'
},
Expand Down
Loading

0 comments on commit 58e4eda

Please sign in to comment.