114 lines
4.3 KiB
Plaintext
114 lines
4.3 KiB
Plaintext
# 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
|
|
|
|
|
|
PASSENGER_CONFIG=/usr/bin/passenger-config
|
|
|
|
|
|
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 <math.h>"
|
|
ngx_feature_path=
|
|
ngx_feature_libs="-lm"
|
|
ngx_feature_test="pow(1, 2)"
|
|
. auto/feature
|
|
if [ $ngx_found = yes ]; then
|
|
PASSENGER_MODULE_LIBS="$PASSENGER_MODULE_LIBS -lm"
|
|
fi
|
|
|
|
ngx_feature="POSIX realtime library"
|
|
ngx_feature_name=
|
|
ngx_feature_run=no
|
|
ngx_feature_incs=
|
|
ngx_feature_path=
|
|
ngx_feature_libs="-lrt"
|
|
ngx_feature_test=
|
|
. auto/feature
|
|
if [ $ngx_found = yes ]; then
|
|
PASSENGER_MODULE_LIBS="$PASSENGER_MODULE_LIBS -lrt"
|
|
fi
|
|
|
|
|
|
nginx_version=`grep 'NGINX_VERSION ' src/core/nginx.h | awk '{ print $3 }' | sed 's/"//g' | head -n1`
|
|
|
|
nginx_major_version=`echo "$nginx_version" | cut -d . -f 1`
|
|
have=PASSENGER_NGINX_MAJOR_VERSION value="$nginx_major_version"
|
|
. auto/define
|
|
|
|
nginx_minor_version=`echo "$nginx_version" | cut -d . -f 2`
|
|
have=PASSENGER_NGINX_MINOR_VERSION value="$nginx_minor_version"
|
|
. auto/define
|
|
|
|
nginx_micro_version=`echo "$nginx_version" | cut -d . -f 3`
|
|
have=PASSENGER_NGINX_MICRO_VERSION value="$nginx_micro_version"
|
|
. auto/define
|
|
|
|
have=NGX_HTTP_PASSENGER_TEMP_PATH value="\"passenger_temp\""
|
|
. auto/define
|
|
|
|
ngx_addon_name=ngx_http_passenger_module
|
|
|
|
if test -n "$ngx_module_link"; then
|
|
ngx_module_type=HTTP
|
|
ngx_module_name=ngx_http_passenger_module
|
|
ngx_module_incs="$PASSENGER_MODULE_INCS"
|
|
ngx_module_deps="$PASSENGER_MODULE_DEPS"
|
|
ngx_module_srcs="$PASSENGER_MODULE_SRCS"
|
|
ngx_module_libs="$PASSENGER_MODULE_LIBS"
|
|
|
|
. auto/module
|
|
else
|
|
HTTP_MODULES="$HTTP_MODULES ngx_http_passenger_module"
|
|
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $PASSENGER_MODULE_SRCS"
|
|
NGX_ADDON_DEPS="$NGX_ADDON_DEPS $PASSENGER_MODULE_DEPS"
|
|
CORE_INCS="$CORE_INCS $PASSENGER_MODULE_INCS"
|
|
CORE_LIBS="$CORE_LIBS $PASSENGER_MODULE_LIBS"
|
|
fi
|