wok-next view js185/stuff/patches/autoconf.patch @ rev 20762

Add leanify
author Aleksej Bobylev <al.bobylev@gmail.com>
date Tue Jun 05 17:27:09 2018 +0300 (2018-06-05)
parents
children
line source
1 --- a/js/src/configure
2 +++ b/js/src/configure
3 @@ -99,6 +99,8 @@ ac_help="$ac_help
4 --with-nspr-exec-prefix=PFX
5 Exec prefix where NSPR is installed"
6 ac_help="$ac_help
7 + --enable-system-ffi Use system libffi (located with pkgconfig)"
8 +ac_help="$ac_help
9 --with-arm-kuser Use kuser helpers (Linux/ARM only -- requires kernel 2.6.13 or later)"
10 ac_help="$ac_help
11 --enable-ui-locale=ab-CD
12 @@ -13204,19 +13206,128 @@ rm -f conftest*
13 CFLAGS=$_SAVE_CFLAGS
14 fi
16 +# Check whether --enable-system-ffi or --disable-system-ffi was given.
17 +if test "${enable_system_ffi+set}" = set; then
18 + enableval="$enable_system_ffi"
19 + if test "$enableval" = "yes"; then
20 + MOZ_NATIVE_FFI=1
21 + elif test "$enableval" = "no"; then
22 + :
23 + else
24 + { echo "configure: error: Option, system-ffi, does not take an argument ($enableval)." 1>&2; exit 1; }
25 + fi
26 +fi
27 +
28 +
29 +if test -n "$MOZ_NATIVE_FFI"; then
30 + succeeded=no
31 +
32 + if test -z "$PKG_CONFIG"; then
33 + # Extract the first word of "pkg-config", so it can be a program name with args.
34 +set dummy pkg-config; ac_word=$2
35 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
36 +echo "configure:13210: checking for $ac_word" >&5
37 +if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
38 + echo $ac_n "(cached) $ac_c" 1>&6
39 +else
40 + case "$PKG_CONFIG" in
41 + /*)
42 + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
43 + ;;
44 + ?:/*)
45 + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a dos path.
46 + ;;
47 + *)
48 + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
49 + ac_dummy="$PATH"
50 + for ac_dir in $ac_dummy; do
51 + test -z "$ac_dir" && ac_dir=.
52 + if test -f $ac_dir/$ac_word; then
53 + ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
54 + break
55 + fi
56 + done
57 + IFS="$ac_save_ifs"
58 + test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
59 + ;;
60 +esac
61 +fi
62 +PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
63 +if test -n "$PKG_CONFIG"; then
64 + echo "$ac_t""$PKG_CONFIG" 1>&6
65 +else
66 + echo "$ac_t""no" 1>&6
67 +fi
68 +
69 + fi
70 +
71 + if test "$PKG_CONFIG" = "no" ; then
72 + echo "*** The pkg-config script could not be found. Make sure it is"
73 + echo "*** in your path, or set the PKG_CONFIG environment variable"
74 + echo "*** to the full path to pkg-config."
75 + echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
76 + else
77 + PKG_CONFIG_MIN_VERSION=0.9.0
78 + if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
79 + echo $ac_n "checking for libffi""... $ac_c" 1>&6
80 +echo "configure:13254: checking for libffi" >&5
81 +
82 + if $PKG_CONFIG --exists "libffi" ; then
83 + echo "$ac_t""yes" 1>&6
84 + succeeded=yes
85 +
86 + echo $ac_n "checking MOZ_FFI_CFLAGS""... $ac_c" 1>&6
87 +echo "configure:13261: checking MOZ_FFI_CFLAGS" >&5
88 + MOZ_FFI_CFLAGS=`$PKG_CONFIG --cflags "libffi"`
89 + echo "$ac_t""$MOZ_FFI_CFLAGS" 1>&6
90 +
91 + echo $ac_n "checking MOZ_FFI_LIBS""... $ac_c" 1>&6
92 +echo "configure:13266: checking MOZ_FFI_LIBS" >&5
93 + ## Remove evil flags like -Wl,--export-dynamic
94 + MOZ_FFI_LIBS="`$PKG_CONFIG --libs \"libffi\" |sed s/-Wl,--export-dynamic//g`"
95 + echo "$ac_t""$MOZ_FFI_LIBS" 1>&6
96 + else
97 + MOZ_FFI_CFLAGS=""
98 + MOZ_FFI_LIBS=""
99 + ## If we have a custom action on failure, don't print errors, but
100 + ## do set a variable so people can do so.
101 + MOZ_FFI_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libffi"`
102 + echo $MOZ_FFI_PKG_ERRORS
103 + fi
104 +
105 +
106 +
107 + else
108 + echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
109 + echo "*** See http://www.freedesktop.org/software/pkgconfig"
110 + fi
111 + fi
112 +
113 + if test $succeeded = yes; then
114 + :
115 + else
116 + if test "$COMPILE_ENVIRONMENT"; then
117 + { echo "configure: error: Library requirements (libffi) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." 1>&2; exit 1; }
118 + fi
119 + fi
120 +
121 +fi
122 +
123 +
124 +
126 # Application
128 BUILD_STATIC_LIBS=
129 ENABLE_TESTS=1
131 MOZ_THUMB2=
132 USE_ARM_KUSER=
134 case "${target}" in
135 arm-android-eabi)
136 USE_ARM_KUSER=1
137 MOZ_THUMB2=1
138 ;;
139 esac
141 @@ -15741,9 +15851,13 @@ s%@HAVE_GCC3_ABI@%$HAVE_GCC3_ABI%g
142 s%@NSPR_CFLAGS@%$NSPR_CFLAGS%g
143 s%@NSPR_LIBS@%$NSPR_LIBS%g
144 s%@NSPR_CONFIG@%$NSPR_CONFIG%g
145 +s%@PKG_CONFIG@%$PKG_CONFIG%g
146 +s%@MOZ_FFI_CFLAGS@%$MOZ_FFI_CFLAGS%g
147 +s%@MOZ_FFI_LIBS@%$MOZ_FFI_LIBS%g
148 +s%@MOZ_NATIVE_FFI@%$MOZ_NATIVE_FFI%g
149 s%@MOZ_UI_LOCALE@%$MOZ_UI_LOCALE%g
150 s%@MOZ_THUMB2@%$MOZ_THUMB2%g
151 s%@MOZ_ARM_ARCH@%$MOZ_ARM_ARCH%g
152 s%@MOZ_OPTIMIZE@%$MOZ_OPTIMIZE%g
153 s%@MOZ_OPTIMIZE_FLAGS@%$MOZ_OPTIMIZE_FLAGS%g
154 s%@MOZ_OPTIMIZE_LDFLAGS@%$MOZ_OPTIMIZE_LDFLAGS%g
155 @@ -16121,7 +16235,7 @@ echo "$ac_t""invoking make to create js-
156 $GMAKE js-config
158 # Build jsctypes if it's enabled.
159 -if test "$JS_HAS_CTYPES"; then
160 +if test "$JS_HAS_CTYPES" -a -z "$MOZ_NATIVE_FFI"; then
161 # Run the libffi 'configure' script.
162 ac_configure_args="--disable-shared --enable-static --disable-raw-api"
163 if test "$MOZ_DEBUG"; then