#!/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 ;; --disable-oop) disable_oop=1 ;; --disable-ipv6) disable_ipv6=1 ;; --disable-trace) disable_trace=1 ;; --disable-tests) disable_tests=1 ;; --enable-pam) enable_pam=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 ;; --disable-cmpi) disable_cmpi=1 ;; --with-ssl=*) with_ssl=$optarg ;; --enable-binary-repository) enable_binary_repository=1 ;; --enable-compressed-repository) enable_compressed_repository=1 ;; *) 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 # --datadir: if [ -z "$datadir" ]; then datadir=$prefix/share 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-slp 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 ##============================================================================== ## ## 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 ##============================================================================== ## ## Create options.mak ## ##============================================================================== options=options.mak rm -f $options echo "# This file was generated by 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_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_pam" = "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_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 [ "$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 echo "created $options" ##============================================================================== ## ## Create GNUmakefile ## ##============================================================================== cat > GNUmakefile << END include options.mak 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