#!/bin/sh

#
#   A script for retrieving the latest KVIrc IRC Client build configuration
#   Mainly used for building plugins out of the source tree
#   The idea is "stolen" from the gtk-config and xmms-config scripts :)
#
#   09-04-2000 Szymon Stefanek (Initial release)
#   31-01-2002 Szymon Stefanek (Revised for KVIrc 3.0.0)
#   27-07-2002 Szymon Stefanek (Revised again for KVIrc 3.0.0)
#
#   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 opinion) 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.
#

set -e

srcdir="."
top_srcdir="../.."
prefix="/usr"
exec_prefix="${prefix}"

bindir="${exec_prefix}/bin"
sbindir="${exec_prefix}/sbin"
libexecdir="${exec_prefix}/libexec"
datadir="${prefix}/share"
sysconfdir="${prefix}/etc"
sharedstatedir="${prefix}/com"
localstatedir="${prefix}/var"
libdir="${exec_prefix}/lib"
infodir="${prefix}/share/info"
mandir="/usr/man"
includedir="${prefix}/include"
oldincludedir="/usr/include"
headersdir="${exec_prefix}/include/kvirc/3.4.0"
applnkdir="/usr/./share/applnk/Internet"
configdir="${globalkvircdir}/config"
configmodulesdir="${globalkvircdir}/config/modules"
defscriptdir="${globalkvircdir}/defscript"
globalkvircdir="${datadir}/kvirc/3.4"
helpdir="${globalkvircdir}/help/en"
iconapps32datadir="/usr/./share/icons/hicolor/32x32/apps"
iconapps48datadir="/usr/./share/icons/hicolor/48x48/apps"
iconmime32datadir="/usr/./share/icons/hicolor/32x32/mimetypes"
iconmime48datadir="/usr/./share/icons/hicolor/48x48/mimetypes"
install_sh="/tmp/tgz/kvirc/admin/install-sh"
kdeservicesdir="/usr/share/services"
licensedir="${globalkvircdir}/license"
localedir="${globalkvircdir}/locale"
mimelnkdir="/usr/./share/mimelnk/text"
picsdir="${datadir}/kvirc/3.4/pics"
pluglibdir="${globalkvircdir}/modules"
topdir="/tmp/tgz/kvirc"


build_alias="i486-slackware-linux"
build_triplet="i486-slackware-linux-gnu"
host_alias=""
host_triplet="i486-slackware-linux-gnu"
target_alias=""
target_triplet="i486-slackware-linux-gnu"

SS_CPPFLAGS="-D_REENTRANT -DREENTRANT"
SS_INCDIRS="-I/usr/lib/qt/include -I/usr/include -I/usr/include -I/usr/include"
SS_LDFLAGS=" -lSM -lICE "
SS_LIBDIRS="-L/tmp/tgz/kvirc/src/kvilib/build/ -L/usr/lib/qt/lib -L/usr/lib -L/usr/lib"
SS_LIBLINK="-lkdecore -lkdeui -lkparts -lqt-mt -lX11 -lXext -lpthread -lssl -lcrypto -lesd -lsoundserver_idl -laudiofile -lm -ldl -lz -lXss"
SS_MSGFMT="/usr/bin/msgfmt"
SS_QT_MOC="/usr/lib/qt/bin/moc"
SS_RPATH="-rpath /usr/lib/qt/lib -rpath ${exec_prefix}/lib -rpath /usr/lib -rpath /usr/lib"
SS_TOPSRCDIR="/tmp/tgz/kvirc"
VERSION="3.4.0"

print_syntax()
{
	echo "kvirc-config (KVIrc 3.4.0)"
	echo "	A script for retrieving the latest KVIrc build configuration"
	echo ""
	echo "Syntax : kvirc-config [OPTIONS]"
	echo "  options:"
	echo "    --version         : KVIrc version"
	echo "    --prefix          : Intallation prefix"
	echo "    --include_dir     : KVIrc include directory (where headers are stored)"
	echo "    --exec_prefix     : Binaries installation prefix"
	echo "    --rpath_flags     : Rpath flags used in the KVIrc compilation"
	echo "    --cpp_flags       : CPP flags used in the KVIrc compilation"
	echo "    --include_dirs    : Include directories used in the KVIrc compilation"
	echo "    --ld_flags        : Linker flags used in the KVirc compilation"
	echo "    --lib_dirs        : Library directories used in the KVIrc compilation"
	echo "    --libraries       : External libraries that KVIrc has been linked to"
	echo "    --qt_moc_path     : Qt meta object compiler path"
	echo "    --modules_dir     : KVIrc modules dir"
	echo "    --plugin_dir      : Compat alias for modules_dir"
	echo "    --bin_dir         : KVIrc binaries installation directory"
	echo "    --lib_dir         : KVIrc libraries installation directory"
	echo "    --help_dir        : KVIrc help files installation directory"
	echo "    --locale_dir      : KVIrc translation files directory"
	echo "    --pics_dir        : KVIrc shared pictures directory"
    exit 0
}

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

SS_STUFF_TO_ECHO=""

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

    case $1 in
	--prefix)
	    SS_STUFF_TO_ECHO="$SS_STUFF_TO_ECHO $prefix"
	    ;;
	--exec_prefix)
	    SS_STUFF_TO_ECHO="$SS_STUFF_TO_ECHO $exec_prefix"
	    ;;
	--include_dir)
		SS_STUFF_TO_ECHO="$SS_STUFF_TO_ECHO $headersdir"
		;;
	--version)
		SS_STUFF_TO_ECHO="$SS_STUFF_TO_ECHO $VERSION"
		;;
	--rpath_flags)
		SS_STUFF_TO_ECHO="$SS_STUFF_TO_ECHO $SS_RPATH"
		;;
	--qt_moc_path)
		SS_STUFF_TO_ECHO="$SS_STUFF_TO_ECHO $SS_QT_MOC"
		;;
	--cpp_flags)
		SS_STUFF_TO_ECHO="$SS_STUFF_TO_ECHO $SS_CPPFLAGS"
		;;
	--include_dirs)
		SS_STUFF_TO_ECHO="$SS_STUFF_TO_ECHO $SS_INCDIRS"
		;;
	--ld_flags)
		SS_STUFF_TO_ECHO="$SS_STUFF_TO_ECHO $SS_LDFLAGS"
		;;
	--lib_dirs)
		SS_STUFF_TO_ECHO="$SS_STUFF_TO_ECHO $SS_LIBDIRS"
		;;
	--libraries)
		SS_STUFF_TO_ECHO="$SS_STUFF_TO_ECHO $SS_LIBLINK"
		;;
	--plugin_dir)
		SS_STUFF_TO_ECHO="$SS_STUFF_TO_ECHO $pluglibdir"
		;;
	--modules_dir)
		SS_STUFF_TO_ECHO="$SS_STUFF_TO_ECHO $pluglibdir"
		;;
	--bin_dir)
		SS_STUFF_TO_ECHO="$SS_STUFF_TO_ECHO $bindir"
		;;
	--lib_dir)
		SS_STUFF_TO_ECHO="$SS_STUFF_TO_ECHO $libdir"
		;;
	--help_dir)
		SS_STUFF_TO_ECHO="$SS_STUFF_TO_ECHO $helpdir"
		;;
	--locale_dir)
		SS_STUFF_TO_ECHO="$SS_STUFF_TO_ECHO $localedir"
		;;
	--pics_dir)
		SS_STUFF_TO_ECHO="$SS_STUFF_TO_ECHO $picsdir"
		;;
	*)
	    print_syntax 1 1>&2
	    ;;
    esac
  shift
done

if test -n "$SS_STUFF_TO_ECHO"; then
	echo $SS_STUFF_TO_ECHO
fi
