libdlna: version bump to 0.2.4
[openwrt/svn-archive/archive.git] / libs / libdlna / patches / 010-configure-crosscompile.patch
1 --- a/configure
2 +++ b/configure
3 @@ -184,6 +184,19 @@ check_ld(){
4 check_cmd $cc $LDFLAGS "$@" -o $TMPE $TMPO $extralibs
5 }
6
7 +check_host_cc(){
8 + log check_host_cc "$@"
9 + cat >$TMPC
10 + log_file $TMPC
11 + check_cmd $host_cc $host_cflags "$@" -c -o $TMPO $TMPC
12 +}
13 +
14 +check_host_ld(){
15 + log check_host_ld "$@"
16 + check_host_cc || return
17 + check_cmd $host_cc $host_cflags $host_ldflags "$@" -o $TMPE $TMPO
18 +}
19 +
20 check_exec(){
21 check_ld "$@" && { enabled cross_compile || $TMPE >>$logfile 2>&1; }
22 }
23 @@ -318,6 +331,7 @@ includedir='$(PREFIX)/include'
24 static="yes"
25 shared="yes"
26 cc="gcc"
27 +host_cc="gcc"
28 ar="ar"
29 ranlib="ranlib"
30 make="make"
31 @@ -465,6 +479,10 @@ else
32 [ -n "$STRIP" ] && strip="$STRIP"
33 fi
34 [ -n "$MAKE" ] && make="$MAKE"
35 +[ -n "$HOST_CC" ] && host_cc="$HOST_CC"
36 +[ -n "$HOST_CFLAGS" ] && host_cflags="$HOST_CFLAGS"
37 +[ -n "$HOST_LDFLAGS" ] && host_ldflags="$HOST_LDFLAGS"
38 +host_cflags="-Isrc $host_cflags"
39
40 #################################################
41 # create logging file
42 @@ -649,8 +667,7 @@ check_lib libavcodec/avcodec.h avcodec_r
43 #################################################
44 # version
45 #################################################
46 -temp_cflags "-Isrc"
47 -check_ld <<EOF
48 +check_host_ld <<EOF
49 #include <stdio.h>
50 #include <dlna.h>
51 int main(){
52 @@ -660,7 +677,6 @@ int main(){
53 }
54 EOF
55 VERSION=`$TMPE`
56 -restore_flags
57
58
59 #################################################