OSSP CVS Repository

ossp - ossp-pkg/ex/ex-config.in 1.1
Not logged in
[Honeypot]  [Browse]  [Directory]  [Home]  [Login
[Reports]  [Search]  [Ticket]  [Timeline
  [Raw

ossp-pkg/ex/ex-config.in 1.1
#!/bin/sh
##
##  OSSP ex - Exception Handling Library
##  Copyright (c) 2002 Ralf S. Engelschall <rse@engelschall.com>
##  Copyright (c) 2002 The OSSP Project <http://www.ossp.org/>
##  Copyright (c) 2002 Cable & Wireless Deutschland <http://www.cw.com/de/>
##
##  This file is part of OSSP ex, an exception handling library
##  which can be found at http://www.ossp.org/pkg/ex/.
##
##  This program is free software; you can redistribute it and/or
##  modify it under the terms of the GNU General Public  License
##  as published by the Free Software Foundation; either version
##  2.0 of the License, or (at your option) any later version.
##
##  This program is distributed in the hope that it will be useful,
##  but WITHOUT ANY WARRANTY; without even the implied warranty of
##  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
##  General Public License for more details.
##
##  You should have received a copy of the GNU General Public License
##  along with this file; if not, write to the Free Software
##  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
##  USA, or contact the OSSP project <ossp@ossp.org>.
##
##  ex-config.in: library build utility
##

DIFS=' 
'

#   tool
tool_name="ex-config"

#   library version
lib_name="OSSP ex"
lib_version="@EX_VERSION_STR@"

#   build paths
prefix="@prefix@"
exec_prefix="@exec_prefix@"
bindir="@bindir@"
libdir="@libdir@"
includedir="@includedir@"
mandir="@mandir@"
datadir="@datadir@"

#   build options
cflags="@CFLAGS@"
ldflags="@LDFLAGS@"
libs="@LIBS@"

#   option defaults
help=no
version=no

usage="$tool_name"
usage="$usage [--help] [--version] [--all]"
usage="$usage [--prefix] [--exec-prefix] [--bindir] [--libdir] [--includedir] [--mandir] [--datadir]"
usage="$usage [--cflags] [--ldflags] [--libs]"
if [ $# -eq 0 ]; then
    echo "$tool_name:Error: Invalid option" 1>&2
    echo "$tool_name:Usage: $usage" 1>&2
    exit 1
fi
output=''
output_extra=''
all=no
prev=''
OIFS="$IFS" IFS="$DIFS"
for option
do
    if [ ".$prev" != . ]; then
        eval "$prev=\$option"
        prev=''
        continue
    fi
    case "$option" in
        -*=*) optarg=`echo "$option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
           *) optarg='' ;;
    esac
    case "$option" in
        --help|-h)
            echo "Usage: $usage"
            exit 0
            ;;
        --version|-v)
            echo "$lib_name $lib_version"
            exit 0
            ;;
        --all)
            all=yes
            ;;
        --prefix)
            output="$output $prefix"
            ;;
        --exec-prefix)
            output="$output $exec_prefix"
            ;;
        --bindir)
            output="$output $bindir"
            ;;
        --libdir)
            output="$output $libdir"
            ;;
        --includedir)
            output="$output $includedir"
            ;;
        --mandir)
            output="$output $mandir"
            ;;
        --datadir)
            output="$output $datadir"
            ;;
        --cflags)
            output="$output -I$includedir"
            output_extra="$output_extra $cflags"
            ;;
        --ldflags)
            output="$output -L$libdir"
            output_extra="$output_extra $ldflags"
            ;;
        --libs)
            output="$output -lxds"
            output_extra="$output_extra $libs"
            ;;
        * )
            echo "$tool_name:Error: Invalid option" 1>&2
            echo "$tool_name:Usage: $usage" 1>&2
            exit 1;
            ;;
    esac
done
IFS="$OIFS"
if [ ".$prev" != . ]; then
    echo "$tool_name:Error: missing argument to --`echo $prev | sed 's/_/-/g'`" 1>&2
    exit 1
fi
if [ ".$output" != . ]; then
    if [ ".$all" = .yes ]; then
        output="$output $output_extra"
    fi
    echo $output
fi


CVSTrac 2.0.1