зеркало из https://github.com/microsoft/SCXcore.git
242 строки
7.1 KiB
Bash
Executable File
242 строки
7.1 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
scxpal_dir="../../pal"
|
|
scxomi_dir=`(cd ../../omi/Unix; pwd -P)`
|
|
build_type="Release"
|
|
disable_listener=0
|
|
enable_debug=""
|
|
enable_purify_agent=""
|
|
enable_purify_server=""
|
|
enable_bullseye=""
|
|
combined_packages=0
|
|
enable_scx_security_hardening=0
|
|
enable_ulinux_qual=""
|
|
omi_configure_quals="--enable-microsoft"
|
|
|
|
if [ ! -d "$scxpal_dir" ]; then
|
|
echo "PAL directory ($scxpal_dir) does not exist"
|
|
exit 1
|
|
fi
|
|
|
|
if [ ! -d "$scxomi_dir" ]; then
|
|
echo "OMI directory ($scxomi_dir) does not exist"
|
|
exit 1
|
|
fi
|
|
|
|
perform_ulinux_build()
|
|
{
|
|
if [ ! -d "/usr/local_ssl_0.9.8" -o ! -d "/usr/local_ssl_1.0.0" -o \( `uname -m` = "x86_64" -a ! -d "/usr/local_ssl_1.1.0" \) -o \( `uname -m` = "x86_64" -a ! -d "/usr/local_ssl_3.0.0" \) ]; then
|
|
echo "Cannot build ULINUX without Universal SSL libraries"
|
|
exit 1
|
|
fi
|
|
|
|
enable_ulinux_qual="--enable-ulinux"
|
|
omi_configure_quals="$omi_configure_quals $enable_ulinux_qual $enable_security_hardening"
|
|
combined_packages=1
|
|
}
|
|
|
|
for opt
|
|
do
|
|
|
|
arg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
|
|
|
|
case $opt in
|
|
|
|
-h | --help)
|
|
help=1
|
|
;;
|
|
|
|
--disable-listener)
|
|
disable_listener=1
|
|
;;
|
|
|
|
--enable-bullseye)
|
|
if [ "$build_type" = "Debug" ]; then
|
|
echo "Cannot build Bullseye if debug is enabled"
|
|
exit 1
|
|
fi
|
|
build_type="Bullseye"
|
|
enable_bullseye="--enable-bullseye"
|
|
;;
|
|
|
|
--enable-debug)
|
|
if [ "$build_type" = "Bullseye" ]; then
|
|
echo "Cannot build debug if Bullseye is enabled"
|
|
exit 1
|
|
fi
|
|
build_type="Debug"
|
|
enable_debug="--enable-debug"
|
|
;;
|
|
|
|
--enable-local-omi)
|
|
omi_configure_quals="--prefix=. --disable-libpath"
|
|
local_omi="1"
|
|
;;
|
|
|
|
--enable-purify-agent)
|
|
enable_purify_agent="--enable-purify-agent"
|
|
;;
|
|
|
|
--enable-purify-server)
|
|
enable_purify_server="--enable-purify-server"
|
|
;;
|
|
|
|
--enable-security-hardening)
|
|
enable_security_hardening="--enable-security-hardening"
|
|
enable_scx_security_hardening=1
|
|
;;
|
|
|
|
--enable-system-build)
|
|
if [ `uname -s` = "Linux" -a `uname -m` != "ppc64le" ]; then
|
|
perform_ulinux_build
|
|
fi
|
|
;;
|
|
|
|
--enable-ulinux)
|
|
perform_ulinux_build
|
|
;;
|
|
|
|
*)
|
|
echo "configure: invalid option '$opt'"
|
|
echo "Try configure --help' for more information."
|
|
exit 1
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
if [ "$help" = "1" ]; then
|
|
|
|
cat<<EOF
|
|
|
|
Usage: ./configure [OPTIONS]
|
|
|
|
OVERVIEW:
|
|
|
|
This script configures SCXOM for building. Type the following commands.
|
|
|
|
$ ./configure
|
|
$ make
|
|
|
|
OPTIONS:
|
|
-h, --help Print this help message.
|
|
--disable-listener Disable listening on port 1270 (normally enabled by default)
|
|
--enable-bullseye Enables the use of code coverage tools (Bullseye).
|
|
--enable-debug Perform a debug build.
|
|
--enable-local-omi Allow local OMI commands to be issued (not for use when building a kit)
|
|
--enable-purify-agent Allow agent to be run with purify (memory leak detection)
|
|
--enable-purify-server Allow server to be run with purify (memory leak detection)
|
|
--enable-security-hardening Enable security flags for compiling.
|
|
--enable-system-build Enable qualifiers necessary for a system build
|
|
--enable-ulinux Build universal RPM/DEB kits
|
|
|
|
EOF
|
|
exit 0
|
|
fi
|
|
|
|
(cd $scxpal_dir/build/ && chmod ug+x ./configure; ./configure $enable_debug $enable_bullseye $enable_ulinux_qual $enable_security_hardening)
|
|
|
|
omi_configure_quals="${enable_debug} ${enable_purify_agent} ${enable_purify_server} ${omi_configure_quals} ${enable_security_hardening}"
|
|
|
|
##==============================================================================
|
|
##
|
|
## openssl variables
|
|
##
|
|
##==============================================================================
|
|
|
|
pkgconfig=`which pkg-config`
|
|
|
|
openssl_cflags=`$pkgconfig --cflags openssl`
|
|
openssl_libs=`$pkgconfig --libs openssl`
|
|
openssl_libdir=`$pkgconfig --variable=libdir openssl`
|
|
|
|
if [ $combined_packages -ne 0 ]; then
|
|
case "`uname -m`" in
|
|
x86_64 )
|
|
openssl098_libdir=/usr/local_ssl_0.9.8/lib
|
|
openssl100_libdir=/usr/local_ssl_1.0.0/lib64
|
|
openssl110_libdir=/usr/local_ssl_1.1.0/lib
|
|
openssl300_libdir=/usr/local_ssl_3.0.0/lib64
|
|
;;
|
|
|
|
* )
|
|
openssl098_libdir=/usr/local_ssl_0.9.8/lib
|
|
openssl100_libdir=/usr/local_ssl_1.0.0/lib
|
|
;;
|
|
esac
|
|
openssl098_cflags=`PKG_CONFIG_PATH=$openssl098_libdir/pkgconfig $pkgconfig --cflags openssl`
|
|
openssl098_libs=`PKG_CONFIG_PATH=$openssl098_libdir/pkgconfig $pkgconfig --libs openssl`
|
|
openssl100_cflags=`PKG_CONFIG_PATH=$openssl100_libdir/pkgconfig $pkgconfig --cflags openssl`
|
|
openssl100_libs=`PKG_CONFIG_PATH=$openssl100_libdir/pkgconfig $pkgconfig --libs openssl`
|
|
if [ `uname -m` = "x86_64" ]; then
|
|
openssl110_cflags=`PKG_CONFIG_PATH=$openssl110_libdir/pkgconfig $pkgconfig --cflags openssl`
|
|
openssl110_libs=`PKG_CONFIG_PATH=$openssl110_libdir/pkgconfig $pkgconfig --libs openssl`
|
|
openssl300_cflags=`PKG_CONFIG_PATH=$openssl300_libdir/pkgconfig $pkgconfig --cflags openssl`
|
|
openssl300_libs=`PKG_CONFIG_PATH=$openssl300_libdir/pkgconfig $pkgconfig --libs openssl`
|
|
fi
|
|
fi
|
|
|
|
##==============================================================================
|
|
##
|
|
## running on Travis?
|
|
##
|
|
##==============================================================================
|
|
|
|
travis_ci=0
|
|
if [ "$TRAVIS" = "true" ]; then
|
|
echo "Currently running on Travis for Continuous Integration ..."
|
|
travis_ci=1
|
|
fi
|
|
|
|
##==============================================================================
|
|
##
|
|
## handle versions and write configuration
|
|
##
|
|
##==============================================================================
|
|
|
|
# Do we have a version file from the super project? If not, make one
|
|
|
|
if [ -f ../../scxcore.version ]; then
|
|
rm -f Makefile.version
|
|
ln -s ../../scxcore.version Makefile.version
|
|
else
|
|
cat <<EOF > Makefile.version
|
|
SCX_BUILDVERSION_MAJOR=0
|
|
SCX_BUILDVERSION_MINOR=0
|
|
SCX_BUILDVERSION_PATCH=0
|
|
SCX_BUILDVERSION_BUILDNR=0
|
|
SCX_BUILDVERSION_DATE=20150101
|
|
SCX_BUILDVERSION_STATUS=Developer_Build
|
|
EOF
|
|
fi
|
|
|
|
cat <<EOF > config.mak
|
|
BUILD_TYPE=$build_type
|
|
COMBINED_PACKAGES=$combined_packages
|
|
DISABLE_LISTENER=$disable_listener
|
|
LOCAL_OMI=$local_omi
|
|
OMI_CONFIGURE_QUALS=$omi_configure_quals
|
|
OPENSSL_CFLAGS=$openssl_cflags
|
|
OPENSSL_LIBS=$openssl_libs
|
|
OPENSSL_LIBDIR=$openssl_libdir
|
|
OPENSSL098_CFLAGS=$openssl098_cflags
|
|
OPENSSL098_LIBS=$openssl098_libs
|
|
OPENSSL098_LIBDIR=$openssl098_libdir
|
|
OPENSSL100_CFLAGS=$openssl100_cflags
|
|
OPENSSL100_LIBS=$openssl100_libs
|
|
OPENSSL100_LIBDIR=$openssl100_libdir
|
|
OPENSSL110_CFLAGS=$openssl110_cflags
|
|
OPENSSL110_LIBS=$openssl110_libs
|
|
OPENSSL110_LIBDIR=$openssl110_libdir
|
|
OPENSSL300_CFLAGS=$openssl300_cflags
|
|
OPENSSL300_LIBS=$openssl300_libs
|
|
OPENSSL300_LIBDIR=$openssl300_libdir
|
|
ENABLE_SCX_SECURITY_HARDENING=$enable_scx_security_hardening
|
|
TRAVIS_CI=$travis_ci
|
|
EOF
|
|
|
|
# Fix permissions in case they aren't executable - and then configure OMI
|
|
chmod ug+x ${scxomi_dir}/configure ${scxomi_dir}/buildtool
|
|
(cd ${scxomi_dir} && ./configure ${omi_configure_quals})
|