#!/bin/sh

# The contents of this file are subject to the MonetDB Public License
# Version 1.1 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License at
# http://monetdb.cwi.nl/Legal/MonetDBLicense-1.1.html
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
# License for the specific language governing rights and limitations
# under the License.
#
# The Original Code is the MonetDB Database System.
#
# The Initial Developer of the Original Code is CWI.
# Portions created by CWI are Copyright (C) 1997-July 2008 CWI.
# Copyright August 2008-2010 MonetDB B.V.
# All Rights Reserved.

# minimal inital version as required by Mtest.py

pkg="MonetDB-SQL"
source="/usr/src/RPM/BUILD/monetdb-sql-2.38.5"
build="/usr/src/RPM/BUILD/monetdb-sql-2.38.5"
prefix="/usr"
exec_prefix="/usr"

libdir="/usr/lib"
incdir="/usr/include"
M5libdir="${libdir}/MonetDB5"
M5incdir="${incdir}/MonetDB5"
pythonlibdir="${prefix}/lib/python2.6/site-packages"

prog=`basename $0`
usage="Usage: $prog [OPTION]

Known values for OPTION are:

  --build		print ${pkg} build directory
  --source		print ${pkg} source directory
  --modpath5		print default ${pkg} module path (for M5)
  --conds		conditionals as set by configure
  --help		display this help and exit
  --version		output version information

Install directories ${pkg} was configured to
  --prefix --pythonlibdir
"

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

while test $# -gt 0; do
    case "$1" in
    -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
    *) optarg= ;;
    esac

    case "$1" in

    --prefix)
	echo $prefix
	;;

    --build)
	echo $build
	;;

    --source)
	echo $source
	;;

    --modpath5|--modpath)
        echo 	$M5libdir:$M5libdir/lib:$M5libdir/bin
        ;;

    --*dir)
        dirname=\$`echo $1 | sed -e 's,^--,,'`
        dirname=`eval echo $dirname`
        test -z "$dirname" && exit 1
        echo $dirname
        exit 0
        ;;

    --version)
	echo 2.38.5
	exit 0
	;;

    --help)
	echo "$usage"
	exit 0
	;;

    --cflags5|--cflags)
	echo -I$M5incdir/sql
	;;

    --libs5|--libs)
	echo -L$M5libdir/lib
	;;

    --conds)
	echo BITS32=#
	echo BITS64=
	echo DOCTOOLS=#
	echo HAVE_BUILDTOOLS=
	echo HAVE_CLIENTS=#
	echo HAVE_EXTRA_MK=
	echo HAVE_MONETDB5=#
	echo HAVE_MONETDB5_RDF=#
	echo HAVE_MONETDB5_XML=#
	echo HAVE_MONETDB=#
	echo HAVE_PCRE=#
	echo HAVE_PERL_DEVEL=#
	echo HAVE_PERL=#
	echo HAVE_PERL_SWIG=#
	echo HAVE_PYTHON=#
	echo HAVE_RUBYGEM=
	echo HAVE_SWIG=
	echo LINK_STATIC=
	echo NATIVE_WIN32=
	echo NEED_MX=
	echo NOT_WIN32=#
	echo PROFILING=
	;;

    *)
	echo "$usage" >&2
	exit 1
	;;
    esac
    shift
done

exit 0
