config: use Release binaries when building with --with-debug if that's all that's available (#1332)
* config: use Release binaries when building with --with-debug if that's all that's available * prompt the user before going ahead and using release binaries * exit 1, reword message
This commit is contained in:
@@ -77,6 +77,8 @@ fi
|
|||||||
|
|
||||||
if [ "$NGX_DEBUG" = "YES" ]; then
|
if [ "$NGX_DEBUG" = "YES" ]; then
|
||||||
buildtype=Debug
|
buildtype=Debug
|
||||||
|
# If we're using a psol tarball that doesn't contain Debug/ (which is the case
|
||||||
|
# from 1.12 onward) then this will be overriden to buildtype=Release below.
|
||||||
else
|
else
|
||||||
buildtype=Release
|
buildtype=Release
|
||||||
fi
|
fi
|
||||||
@@ -144,6 +146,22 @@ if [ "$psol_binary" = "unset" ] ; then
|
|||||||
psol_binary="\
|
psol_binary="\
|
||||||
$mod_pagespeed_dir/pagespeed/automatic/pagespeed_automatic.a"
|
$mod_pagespeed_dir/pagespeed/automatic/pagespeed_automatic.a"
|
||||||
else
|
else
|
||||||
|
if ! [ -d "$ngx_addon_dir/psol/lib/$buildtype" ]; then
|
||||||
|
echo "
|
||||||
|
You have set --with-debug for building nginx, but precompiled Debug binaries for
|
||||||
|
PSOL, which ngx_pagespeed depends on, aren't available. If you're trying to
|
||||||
|
debug PSOL you need to build it from source. If you just want to run nginx with
|
||||||
|
debug-level logging you can use the Release binaries."
|
||||||
|
echo -n "
|
||||||
|
Use the available Release binaries?"
|
||||||
|
read -p " [Y/n] " yn
|
||||||
|
if [[ "$yn" == N* || "$yn" == n* ]]; then
|
||||||
|
echo "Cancelled."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
buildtype=Release
|
||||||
|
fi
|
||||||
psol_library_dir="$ngx_addon_dir/psol/lib/$buildtype/$os_name/$arch_name"
|
psol_library_dir="$ngx_addon_dir/psol/lib/$buildtype/$os_name/$arch_name"
|
||||||
psol_binary="$psol_library_dir/pagespeed_automatic.a"
|
psol_binary="$psol_library_dir/pagespeed_automatic.a"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user