#!/bin/sh
#                                                       -*- shell-script -*-
#
# s t k l o s - c o n f i g
#
#
# 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 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 program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
# USA.
#
#           Author: Erick Gallesio [eg@unice.fr]
#    Creation date: 27-Jul-2000 23:58 (eg)


prefix=@prefix@

usage()
{
    cat <<EOF
Usage: stklos-config [OPTIONS]
Options:
        [--prefix | -p]         Prefix that was given during the build
        [--version | -v]        Version of STklos that is installed
        [--compile | -c]        Command that should be run to compile
                                shared libraries
        [--link | -l]           Command that should be used to link shared
                                libraries
        [--cc]                  CC used for building STklos
        [--cflags]              CFLAGS used for building STklos
        [--ldflags]             LDFLAGS used for building STklos
        [--cppflags]            CPPFLAGS used for building STklos
        [--shared-suffix | -s]  Suffix for shared libraries on current
                                platform
        [--threads | -t ]       Display the name of the available thread
                                system
        [--libraries |-L ]      Display a summary of used libraries
        [--compiled-libraries]  Display a summary of compiled libraries
        [--help | -h | -?]      Show a list of options
EOF
    exit $1
}


if test $# -eq 0; then
    usage 1 1>&2
fi

while test $# -gt 0; do
    case $1 in
        --prefix|-p)
            echo ${prefix}
            ;;
        --version|-v)
            echo @VERSION@
            ;;
        --compile|-c)
            inc=-I${prefix}/include/
            echo @CC@ @CFLAGS@ @CPPFLAGS@ @STKCFLAGS@ @SH_COMP_FLAGS@ @GCINC@ $inc
            ;;
        --link|-l)
            echo @SH_LOADER@ @SH_LOAD_FLAGS@
            ;;
        --cc)
            echo @CC@
            ;;
        --cflags)
            echo @CFLAGS@
            ;;
        --ldflags)
            echo @LDFLAGS@
            ;;
        --cppflags)
            echo @LDFLAGS@
            ;;
        --shared-suffix|-s)
            echo @SH_SUFFIX@
            ;;
        --threads|-t)
            echo @THREADS@
            ;;
        --libraries|-L)
            echo @SYST_LIBS@
            ;;
        --compiled-libraries)
            echo @COMP_LIBS@
            ;;
        --help|-h|-\?)
            usage 0 1>&2
            ;;
        *)
            echo "bad option $1" 1>&2
            usage 1 1>&2
            ;;
    esac
    shift
done
exit 0
