#!/bin/sh #//%2006/////////////////////////////////////////////////////////////////////// #// #// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development #// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems. #// Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.; #// IBM Corp.; EMC Corporation, The Open Group. #// Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.; #// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group. #// Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.; #// EMC Corporation; VERITAS Software Corporation; The Open Group. #// Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.; #// EMC Corporation; Symantec Corporation; The Open Group. #// #// Permission is hereby granted, free of charge, to any person obtaining a copy #// of this software and associated documentation files (the "Software"), to #// deal in the Software without restriction, including without limitation the #// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or #// sell copies of the Software, and to permit persons to whom the Software is #// furnished to do so, subject to the following conditions: #// #// THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN #// ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED #// "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT #// LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR #// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT #// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN #// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION #// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #// #//============================================================================= ##============================================================================== ## ## Check for existence of pegasus config.mak. If this does not exist, it means ## that the distribution is incomplete or that the configure file has been run ## from the wrong directory. ## ##============================================================================== config=mak/config.mak if [ ! -f "$config" ]; then echo "$0: Error: ./configure must be run from root of Pegasus distribution." echo exit 1 fi ##============================================================================== ## ## Collection command line options. ## ##============================================================================== help= for opt do optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'` case $opt in -h | --help) help=1 ;; --platform=*) platform=$optarg ;; --prefix=*) prefix=$optarg ;; --bindir=*) bindir=$optarg ;; --sbindir=*) sbindir=$optarg ;; -libdir=*) libdir=$optarg ;; --includedir=*) incdir=$optarg ;; --datadir=*) datadir=$optarg ;; --enable-debug) enable_debug=1 ;; --enable-mrr-generation) enable_mrr_generation=1 ;; --enable-mrr) enable_mrr=1 ;; --disable-oop) disable_oop=1 ;; --disable-trace) disable_trace=1 ;; --disable-ipv6) disable_ipv6=1 ;; --disable-trace) disable_trace=1 ;; --disable-tests) disable_tests=1 ;; --enable-pam) enable_pam=1 ;; --enable-pam-standalone) enable_pam_standalone=1 ;; --with-pam=*) with_pam=$optarg ;; --with-pam-mod=*) with_pam_mod=$optarg ;; --enable-ssl) enable_ssl=1 ;; --enable-slp) enable_slp=1 ;; --enable-openslp) enable_openslp=1 ;; --with-openslp=*) with_openslp=$optarg ;; --with-external-slp=*) with_external_slp=$optarg ;; --with-external-slp-dir=*) with_external_slp-dir=$optarg ;; --disable-cmpi) disable_cmpi=1 ;; --with-ssl=*) with_ssl=$optarg ;; --enable-binary-repository) enable_binary_repository=1 ;; --enable-compressed-repository) enable_compressed_repository=1 ;; --with-solaris-defaults) with_solaris_defaults=1 ;; --with-solaris-nevada-defaults) with_solaris_nevada_defaults=1 ;; --solaris) with_solaris_defaults=1 ;; --with-vxworks-xscale-defaults) with_vxworks_xscale_defaults=1 ;; --vxworks-xscale) with_vxworks_xscale_defaults=1 ;; --with-test-user=*) with_test_user=$optarg ;; --with-test-user-pass=*) with_test_user-pass=$optarg ;; --with-temp-build-dir=*) with_temp_build_dir=$optarg ;; *) echo "$0: unknown option: $opt" exit 1 ;; esac done ##============================================================================== ## ## Print help message if --help given on command line. ## ##============================================================================== if [ "$help" = "1" ]; then cat</dev/null` || machine=unknown system=`(uname -s) 2>/dev/null` || system=unknown release=`(uname -r) 2>/dev/null` || release=unknown version=`(uname -v) 2>/dev/null` || version=unknown token="$machine:$system:$release:$version" case "$token" in i686:Linux:*:*) platform=LINUX_IX86_GNU libbase=lib ;; x86_64:Linux:*:*) platform=LINUX_X86_64_GNU libbase=lib64 ;; sun*:SunOS:*:*) platform=SOLARIS_SPARC_64_CC libbase=lib/64 ;; i86pc:SunOS:*:*) platform=SOLARIS_X86_64_CC libbase=lib/64 ;; *) echo "$0: Failed to guess platform" echo " machine=$machine" echo " system=$system" echo " release=$release" echo " version=$version" exit 1 ;; esac fi ##============================================================================== ## ## Resolve default directory names. ## ##============================================================================== # --prefix: if [ -z "$prefix" ]; then prefix=/usr/local fi # --bindir: if [ -z "$bindir" ]; then bindir=$prefix/bin fi # --sbindir: if [ -z "$sbindir" ]; then sbindir=$prefix/sbin fi # --libdir: if [ -z "$libdir" ]; then libdir=$prefix/$libbase fi # --includedir: if [ -z "$includedir" ]; then includedir=$prefix/include fi if [ -z "$with_pam" ]; then with_pam=/etc/pam.d fi ##============================================================================== ## ## Verify --with-ssl directory. ## ##============================================================================== if [ ! -z "$with_ssl" ]; then if [ ! -d "$with_ssl" ]; then echo "$0: Error: No such directory: --with-ssl=$with_ssl" exit 1; fi if [ ! -f "$with_ssl/include/openssl/ssl.h" ]; then echo "$0: missing dependency: \$with_ssl/include/openssl/ssl.h" missing=1 fi if [ ! -f "$with_ssl/bin/openssl" ]; then echo "$0: missing dependency: \$with_ssl/bin/openssl" missing=1 fi if [ ! -f "$with_ssl/$libbase/libssl.so" ]; then echo "$0: missing dependency: \$with_ssl/$libbase/libss.so" missing=1 fi if [ "$missing" = "1" ]; then echo "$0: where --with-ssl=$with_ssl" exit 1; fi fi ##============================================================================== ## ## Verify --with-openslp directory. ## ##============================================================================== if [ ! -z "$with_openslp" ]; then if [ ! -d "$with_openslp" ]; then echo "$0: Error: No such directory: --with-openslp=$with_openslp" exit 1; fi if [ ! -f "$with_openslp/include/slp.h" ]; then echo "$0: missing dependency: \$with_openslp/include/slp.h" missing=1 fi if [ ! -f "$with_openslp/$libbase/libslp.so" ]; then echo "$0: missing dependency: \$with_openslp/$libbase/libslp.so" missing=1 fi if [ "$missing" = "1" ]; then echo "$0: where --with-openslp=$with_openslp" exit 1; fi fi ##============================================================================== ## ## Verify --with-external-slp - Test for valid keyword and no openslp option ## ##============================================================================== if [ ! -z "$with_external_slp" ]; then external_slp_types="openslp,solarisslp,none" if [ ! -z "with_open_slp" ]; then echo Error: trying to use both --with-open-slp and --with-external-slp" exit 1 fi pos=`expr index ${external_slp_types} ${with_external_slp}` if (( $pos = 0 )); then echo "$0: Error: $with_external_slp value is not valid external type" exit 1; fi fi if ##============================================================================== ## ## Verify --with-external-slp-dir directory. ## ##============================================================================== if [ ! -z "$with_external_slp_dir" ]; then if [ ! -d "$with_external_slp_dir" ]; then echo "$0: Error: No such directory: --with-openslp=$with_external_slp_dir" exit 1; fi if [ ! -f "$with_external_slp_dir/include/slp.h" ]; then echo "$0: missing dependency: \$with_external_slp_dir/include/slp.h" missing=1 fi if [ ! -f "$with_external_slp_dir/$libbase/libslp.so" ]; then echo "$0: missing dependency: \$with_external_slp_dir/$libbase/libslp.so" missing=1 fi if [ "$missing" = "1" ]; then echo "$0: where --with-external-slp-dir=$with_external_slp_dir" exit 1; fi fi ##============================================================================== ## ## These options (if non-empty) must denote absolute directory names. ## ##============================================================================== for i in \ prefix \ bindir \ sbindir \ libdir \ includedir \ datadir \ with_ssl \ with_pam do eval v=$`echo $i` case $v in /* | "") ;; *) echo "$0: Error: Must be an absolute directory name: --$i=$v" exit 1; ;; esac done ##============================================================================== ## ## Check whether the test user will be able to access pegasus home. ## ##============================================================================== uid=`id -u` cwd=`/bin/pwd` if [ "$uid" = "0" -a "$disable_tests" != "1" ]; then if [ "$enable_pam" = "1" -o "$enable_pam_standalone" = "1" ]; then su $with_test_user -c "/bin/true" if [ "$?" != "0" ]; then echo "$0: The test user account ($with_test_user) does not exist on this system. Please create a test user with this name or designate an existing one with the --with-test-user option." exit 1 fi su $with_test_user -c "cd $cwd 2> /dev/null" if [ "$?" != "0" ]; then echo "$0: The test user account ($with_test_user) has insufficient privileges to access the pegasus root directory ($cwd), which will cause the user-context tests to fail. Please configure from a different directory." exit 1 fi fi fi ##============================================================================== ## ## Verify if --enable_pam that pam headers exist ## ##============================================================================== if [ ! -z "$enable_pam" ] then if [ ! -f "/usr/include/security/pam_appl.h" -a \ ! -f "/usr/local/include/security/pam_appl.h" ] then echo "$0: is missing (required by --enable_pam)" exit 1 fi fi ##============================================================================== ## ## Create options.mak ## ##============================================================================== options=options.mak rm -f $options echo "# This file was generated by configure." >> $options echo "# ./configure $*" >> $options cwd=`/bin/pwd` root=$cwd echo "export ROOT=$root" >> $options #echo "export PATH=$PATH:$cwd/$platform/bin" >> $options #echo "export LD_LIBRARY_PATH=$cwd/$platform/lib:$libdir" >> $options echo "export PEGASUS_PLATFORM=$platform" >> $options echo "export PEGASUS_ROOT=$root" >> $options echo "export PEGASUS_HOME=$cwd/$platform" >> $options if [ "$disable_oop" = "1" ] then echo "export PEGASUS_DEFAULT_ENABLE_OOP=false" >> $options echo "export PEGASUS_DISABLE_PROV_USERCTXT=1" >> $options echo "export PEGASUS_DISABLE_PRIVILEGED_TESTS=true" >> $options fi if [ "$disable_trace" = "1" ] then echo "export PEGASUS_REMOVE_TRACE=1" >> $options fi if [ "$disable_ipv6" = "1" ] then echo "export PEGASUS_ENABLE_IPV6=false" >> $options else echo "export PEGASUS_ENABLE_IPV6=true" >> $options fi if [ "$disable_trace" = "1" ] then echo "export PEGASUS_REMOVE_TRACE=1" >> $options fi if [ "$disable_tests" = "1" ] then echo "export PEGASUS_SKIP_MOST_TEST_DIRS=true" >> $options fi if [ "$enable_debug" = 1 ] then echo "export PEGASUS_DEBUG=1" >> $options fi if [ "$enable_mrr_generation" = 1 ] then echo "export PEGASUS_ENABLE_MRR_GENERATION=1" >> $options fi if [ "$enable_mrr" = 1 ] then echo "export PEGASUS_ENABLE_MRR=1" >> $options fi if [ "$enable_pam" = "1" ]; then echo "export PEGASUS_PAM_AUTHENTICATION=true" >> $options fi if [ "$enable_pam_standalone" = "1" ]; then echo "export PEGASUS_PAM_AUTHENTICATION=true" >> $options echo "export PEGASUS_USE_PAM_STANDALONE_PROC=true" >> $options fi if [ "$enable_binary_repository" = "1" ]; then echo "export PEGASUS_REPOSITORY_MODE=BIN" >> $options fi if [ "$enable_compressed_repository" = "1" ]; then echo "export PEGASUS_ENABLE_COMPRESSED_REPOSITORY=1" >> $options fi if [ "$enable_ssl" = "1" ]; then echo "export PEGASUS_HAS_SSL=true" >> $options fi if [ ! -z "$with_ssl" ]; then echo "export OPENSSL_HOME=$with_ssl" >> $options fi if [ "$enable_slp" = "1" ]; then echo "export PEGASUS_ENABLE_SLP=true" >> $options fi if [ "$enable_openslp" = "1" ]; then echo "export PEGASUS_ENABLE_SLP=true" >> $options echo "export PEGASUS_USE_OPENSLP=true" >> $options fi if [ ! -z "$with_external_slp" ]; then echo "export PEGASUS_ENABLE_SLP=true" >> $options echo "export PEGASUS_USE_EXTERNAL_SLP=$with_external_slp" >> $options fi if [ ! -z "$with_external_slp_dir" ]; then echo "export PEGASUS_EXTERNAL_SLP_HOME=$with_external_slp_dir" >> $options fi if [ ! -z "$with_openslp" ]; then echo "export PEGASUS_OPENSLP_HOME=$with_openslp" >> $options fi if [ "$disable_cmpi" != "1" ]; then echo "export PEGASUS_ENABLE_CMPI_PROVIDER_MANAGER=true" >> $options fi if [ "$with-test-user" != "1" ]; then echo "export PEGASUS_TEST_USER_ID=$with_test_user" >> $options fi if [ "$with-test-user-pass" != "1" ]; then echo "export PEGASUS_TEST_USER_PASS=$with_test_user_pass" >> $options fi echo "created $options" ##============================================================================== ## ## Create GNUmakefile ## ##============================================================================== cat > GNUmakefile << END include options.mak export PATH := \$(PATH):\$(PEGASUS_HOME)/bin export LD_LIBRARY_PATH := \$(LD_LIBRARY_PATH):\$(PEGASUS_HOME)/bin include Makefile distclean: rm -rf \$(PEGASUS_PLATFORM) rm -f GNUmakefile rm -f options.mak END echo "created GNUmakefile" ##============================================================================== ## ## Print final message: ## ##============================================================================== echo "configured for $platform" echo