Skip to content
This repository was archived by the owner on Apr 10, 2025. It is now read-only.

Commit 80c4b7e

Browse files
authored
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
1 parent 0c7d642 commit 80c4b7e

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

config

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ fi
7777

7878
if [ "$NGX_DEBUG" = "YES" ]; then
7979
buildtype=Debug
80+
# If we're using a psol tarball that doesn't contain Debug/ (which is the case
81+
# from 1.12 onward) then this will be overriden to buildtype=Release below.
8082
else
8183
buildtype=Release
8284
fi
@@ -144,6 +146,22 @@ if [ "$psol_binary" = "unset" ] ; then
144146
psol_binary="\
145147
$mod_pagespeed_dir/pagespeed/automatic/pagespeed_automatic.a"
146148
else
149+
if ! [ -d "$ngx_addon_dir/psol/lib/$buildtype" ]; then
150+
echo "
151+
You have set --with-debug for building nginx, but precompiled Debug binaries for
152+
PSOL, which ngx_pagespeed depends on, aren't available. If you're trying to
153+
debug PSOL you need to build it from source. If you just want to run nginx with
154+
debug-level logging you can use the Release binaries."
155+
echo -n "
156+
Use the available Release binaries?"
157+
read -p " [Y/n] " yn
158+
if [[ "$yn" == N* || "$yn" == n* ]]; then
159+
echo "Cancelled."
160+
exit 1
161+
fi
162+
163+
buildtype=Release
164+
fi
147165
psol_library_dir="$ngx_addon_dir/psol/lib/$buildtype/$os_name/$arch_name"
148166
psol_binary="$psol_library_dir/pagespeed_automatic.a"
149167
fi

0 commit comments

Comments
 (0)