# passenger-config is run with the 'ruby' command in $PATH, even when natively packaged,
# so we check whether 'ruby' is correctly in $PATH.
if ! ruby -v >/dev/null 2>/dev/null; then
echo '*** ERROR: Cannot find the "ruby" command in $PATH. Please fix your $PATH. You can learn more about $PATH at: https://www.phusionpassenger.com/library/indepth/environment_variables.html#the-path-environment-variable'
echo '*** Do you think that you set $PATH correctly, and you happen to be using sudo or rvmsudo? Read this: https://www.phusionpassenger.com/library/indepth/environment_variables.html#environment-variables-and-sudo'
exit 1
fi
## Magic comment: begin bootstrap ##
# Warning: this magic section will be replaced during packaging by the script in dev/install_scripts_bootstrap_code.rb,
# so keep its purpose purely for finding the passenger-config that belongs to this Phusion Passenger installation.
PATH="$ngx_addon_dir/../../bin:$PATH"
export PATH
PASSENGER_CONFIG=${PASSENGER_CONFIG:-passenger-config}
BUILD_DIRECTIVE="nginx"
COMPILE_CHECK_DIRECTIVE="--compiled"
if [ "$ngx_module_link" = DYNAMIC ]; then
BUILD_DIRECTIVE="nginx:as_dynamic_module"
COMPILE_CHECK_DIRECTIVE="--nginx-dynamic-compiled"
fi
# N.B. the compile check only looks at whether the common library objects are compiled and it assumes that
# their presence indicates a good build was performed. If other essential files were manually deleted the
# rake $BUILD_DIRECTIVE task (or rake clean) can be run manually to repair/reset the build.
if test "x$PASSENGER_LIBS" = "x" && ! $PASSENGER_CONFIG $COMPILE_CHECK_DIRECTIVE; then
echo "*** The Phusion Passenger support files are not yet compiled. Compiling them for you... ***"
old_dir=`pwd`
if ! cd $ngx_addon_dir; then
exit 1
fi
TRACE_DIRECTIVE=""
if test "x$TRACE" = "x1"; then
TRACE_DIRECTIVE="--trace"
fi
echo "*** Running 'rake $TRACE_DIRECTIVE $BUILD_DIRECTIVE CACHING=false' in $ngx_addon_dir... ***"
if ! rake $TRACE_DIRECTIVE $BUILD_DIRECTIVE CACHING=false; then
exit 1
fi
cd "$old_dir"
echo "*** Phusion Passenger support files have been successfully compiled. ***"
fi
## Magic comment: end bootstrap ##
if test "x$PASSENGER_INCLUDEDIR" = "x"; then
PASSENGER_INCLUDEDIR=`$PASSENGER_CONFIG --includedir`
fi
LINK_DIRECTIVE="--nginx-libs"
if [ "$ngx_module_link" = DYNAMIC ]; then
LINK_DIRECTIVE="--nginx-dynamic-libs"
fi
if test "x$PASSENGER_LIBS" = "x"; then
PASSENGER_LIBS=`$PASSENGER_CONFIG $LINK_DIRECTIVE`
fi
PASSENGER_MODULE_INCS="$PASSENGER_INCLUDEDIR"
PASSENGER_MODULE_DEPS="${ngx_addon_dir}/Configuration.h \
${ngx_addon_dir}/ConfigGeneral/AutoGeneratedDefinitions.c \
${ngx_addon_dir}/ConfigGeneral/AutoGeneratedSetterFuncs.c \
${ngx_addon_dir}/ConfigGeneral/AutoGeneratedManifestDefaultsInitialization.c \
${ngx_addon_dir}/ConfigGeneral/ManifestGeneration.c \
${ngx_addon_dir}/ConfigGeneral/ManifestGeneration.h \
${ngx_addon_dir}/MainConfig/AutoGeneratedStruct.h \
${ngx_addon_dir}/MainConfig/AutoGeneratedCreateFunction.c \
${ngx_addon_dir}/MainConfig/AutoGeneratedManifestGeneration.c \
${ngx_addon_dir}/LocationConfig/AutoGeneratedStruct.h \
${ngx_addon_dir}/LocationConfig/AutoGeneratedCreateFunction.c \
${ngx_addon_dir}/LocationConfig/AutoGeneratedMergeFunction.c \
${ngx_addon_dir}/LocationConfig/AutoGeneratedManifestGeneration.c \
${ngx_addon_dir}/LocationConfig/AutoGeneratedHeaderSerialization.c \
${ngx_addon_dir}/ContentHandler.h \
${ngx_addon_dir}/StaticContentHandler.h \
${ngx_addon_dir}/ngx_http_passenger_module.h \
${PASSENGER_INCLUDEDIR}/cxx_supportlib/Constants.h \
${PASSENGER_INCLUDEDIR}/cxx_supportlib/WatchdogLauncher.h \
${PASSENGER_INCLUDEDIR}/cxx_supportlib/AppTypeDetector/CBindings.h \
${PASSENGER_INCLUDEDIR}/cxx_supportlib/WrapperRegistry/CBindings.h"
PASSENGER_MODULE_SRCS="${ngx_addon_dir}/ngx_http_passenger_module.c \
${ngx_addon_dir}/Configuration.c \
${ngx_addon_dir}/ContentHandler.c \
${ngx_addon_dir}/StaticContentHandler.c"
PASSENGER_MODULE_LIBS="$PASSENGER_LIBS -lstdc++ -lpthread"
ngx_feature="Math library"
ngx_feature_name=
ngx_feature_run=no
ngx_feature_incs="#include