(file) Return to configure CVS log (file) (dir) Up to [Pegasus] / pegasus_unsupported / config

File: [Pegasus] / pegasus_unsupported / config / configure (download)
Revision: 1.10, Thu Jul 3 02:08:28 2008 UTC (15 years, 11 months ago) by karl
Branch: MAIN
Changes since 1.9: +43 -34 lines
PEP#: 9999
TITLE: Configure Script

DESCRIPTION: Configure Script

#!/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
      ;;

    --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-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<<END

Usage: ./configure [OPTION]...

Configures Inova OpenPegasus build options.

Configure examples.
    $ ./configure

Options:
    --help
        Print this help message.
    --host=HOST
        Build package for this HOST, where HOST is of the form
        "<cpu>-<manufacturer>-<os>-<kernel>".
    --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-ipv6
        Disable IPV6 support.
    --disable-trace
        Disable tracing facility
    --disable-tests
        Disable build of most of the tests.
    --enable-pam
        Enable PAM authentication (fall back on password-file authentication).
    --with-pam=DIR
        Specify an alternative PAM directory location (defaults to /etc/pam.d).
    --enable-ssl
        Enable SSL feature
    --with-ssl=DIR
        Find SSL under DIR (e.g., --with-ssl=/usr).
    --enable-slp
        Enable SLP feature
    --enable-openslp
        Enable OpenSLP feature
    --with-openslp=DIR
        Find OpenSLP installation under DIR (e.g., --with-openslp=/usr).
    --disable-cmpi
        Disable CMPI provider support
    --enable-binary-repository
        Enable the binary repository feature, resulting in a smaller CIM 
        repository disk footprint.

END
exit
fi

##==============================================================================
##
## Guess the platform.
##
##==============================================================================

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
      ;;

    sun*:SunOS:*:*)
      host=sparc-sun-solaris
      ;;

    *)
        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
        ;;

    sparc-sun-solaris)
        platform=SOLARIS_SPARC_64_CC
        libbase=lib/64
        ;;

    *)
        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_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 $host"
echo

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2