#!/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: Corrupt source distribution. Cannot find $config." echo exit 1 fi ##============================================================================== ## ## Collection command line options. ## ##============================================================================== help= for opt do optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'` case $opt in -h | --help) help=1 ;; --host=*) host=$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-provider-user-context) disable_provider_user_context=1 ;; --disable-pam) disable_pam=1 ;; --with-pam=*) with_pam=$optarg ;; --with-pam-mod=*) with_pam_mod=$optarg ;; --enable-ssl) enable_ssl=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<---". --prefix=DIR Install under DIR --bindir=DIR Install programs here. --sbindir=DIR Install super-user programs here. --libdir=DIR Install libraries here. --incluedir=DIR Install include files here. --datadir=DIR Install data files here. --enable-debug Build for debug. --disable-oop Disable out-of-process providers. --disable-provider-user-context Disable provider user context feature. --disable-pam Disable PAM authentication (fall back on password-file authentication). --with-pam=DIR Specify an alternative PAM directory location (defaults to /etc/pam.d). --with-pam-mod=FILE Specify an alternative name for the PAM module file (defaults to inova-pegasus). --enable-ssl Enable SSL feature --with-ssl=DIR Find SSL under DIR (e.g., --with-ssl=/usr). --enable-binary-repository Enable the binary repository feature, resulting in a smaller CIM repository disk footprint. END exit fi ##============================================================================== ## ## Guess the platform using the ./config.guess script. ## ##============================================================================== if [ -z "$host" ]; then machine=`(uname -m) 2>/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:*:*) host=i686-unknown-linux-gnu ;; x86_64:Linux:*:*) host=x86_64-unknown-linux-gnu ;; ia64:Linux:*:*) host=ia64-unknown-linux-gnu ;; s390:Linux:*:*) host=s390-unknown-linux-gnu ;; s390x:Linux:*:*) host=s390x-unknown-linux-gnu ;; ppc64:Linux:*:*) host=ppc64-unknown-linux-gnu ;; ppc:Linux:*:*) host=ppc-unknown-linux-gnu ;; *) echo "$0: Failed to guess host" echo " machine=$machine" echo " system=$system" echo " release=$release" echo " version=$version" exit 1 ;; esac fi ##============================================================================== ## ## Set the platform library basename ("lib" or "lib64" depending on vendor ## convention and architecture). ## ##============================================================================== case "$host" in i686-unknown-linux-gnu) platform=LINUX_IX86_GNU libbase=lib ;; x86_64-unknown-linux-gnu) platform=LINUX_X86_64_GNU libbase=lib64 ;; ia64-unknown-linux-gnu) platform=LINUX_IA64_GNU libbase=lib ;; ppc-unknown-linux-gnu) platform=LINUX_PPC_GNU libbase=lib ;; ppc64-unknown-linux-gnu) platform=LINUX_PPC64_GNU libbase=lib64 ;; arm-wrs-vxworks-gnu) platform=VXWORKS_XSCALE_GNU libbase=lib enable_static=1 ;; *) echo "$0: unknown host: $host" exit 1 ;; esac ##============================================================================== ## ## 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_ssl" ]; then with_ssl=/usr fi if [ -z "$with_pam" ]; then with_pam=/etc/pam.d fi if [ -z "$with_pam_mod" ]; then with_pam_mod=wsman fi ##============================================================================== ## ## Verify existence of SSL files and directories. ## ##============================================================================== if [ "$enable_ssl" = "1" ]; then # Verify that SSL base directory exists (e.g., /usr). if [ ! -d "$with_ssl" ]; then echo "$0: Error: No such directory: --with-ssl=$with_ssl" echo exit 1; fi # Verify that "ssl.h" exists. missing= if [ ! -f "$with_ssl/include/openssl/ssl.h" ]; then missing=include/openssl/ssl.h fi # Verify that "openssl" program exists. if [ ! -f "$with_ssl/bin/openssl" ]; then missing=bin/openssl fi # Verify that "libssl.a" or "libssl.so" exist. if [ ! -f "$with_ssl/$libbase/libssl.a" -a ! -f "$with_ssl/$libbase/libssl.so" ]; then missing="$libbase/libssl.so" fi # Print error if any of the above components are missing. if [ ! -z $missing ]; then echo -n "$0: Error: SSL component not found: $with_ssl/$missing. " echo -n "Specify location of SSL with the --with-ssl=DIR option." echo 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 else echo "export PEGASUS_DEFAULT_ENABLE_OOP=true" >> $options fi if [ "$disable_provider_user_context" = "1" ] then echo "export PEGASUS_DISABLE_PROV_USERCTXT=1" >> $options fi if [ "$enable_debug" = 1 ] then echo "export PEGASUS_DEBUG=1" >> $options fi if [ "$disable_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 echo "export OPENSSL_HOME=$with_ssl" >> $options echo "export PEGASUS_USE_SSL_RANDOMFILE=false" >> $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 $host" echo