# ------------------------------------
# This file is generated from setup.in
# ------------------------------------

BUILDDIR=@BUILDDIR@
BUILD_WIN32='@BUILD_WIN32@'
DISTRO='@DISTRO@'
VENDORNAME='@VENDORNAME@'
SRCDIR=@SRCDIR@
VERSION='@OOO_VERSION@'
BINSUFFIX='@OOO_BINSUFFIX@'
OOO_LANGS='@OOO_LANGS@'
OOO_POOR_HELP_LOCALIZATIONS='@OOO_POOR_HELP_LOCALIZATIONS@'
CVSTAG='@CVSTAG@'
APPLY_DIR='@APPLY_DIR@'
BUILD_NCPUS='@BUILD_NCPUS@'
ENABLE_CCACHE='@ENABLE_CCACHE@'
ENABLE_ICECREAM='@ENABLE_ICECREAM@'
ICECREAM_JOBS='@ICECREAM_JOBS@'
ICECREAM_BINDIR='@ICECREAM_BINDIR@'
OOO_WIDGET_FLAGS='@OOO_WIDGET_FLAGS@'
OOO_CUSTOM_IMAGES='@OOO_CUSTOM_IMAGES@'
OOO_CRYSTAL_IMAGES='@OOO_CRYSTAL_IMAGES@'
OOO_BUILDVERSION='@OOO_BUILDVERSION@'
OOO_STRIP='@OOO_STRIP@'
RUN_POST_INSTALL_SCRIPTS='@RUN_POST_INSTALL_SCRIPTS@'
TOOLSDIR='@TOOLSDIR@'
ENABLE_ODK='@ENABLE_ODK@'
USE_PREBUILD_UNOWINREG_DLL='@USE_PREBUILD_UNOWINREG_DLL@'
ENABLE_MONO='@ENABLE_MONO@'
ENABLE_QUICKSTART='@ENABLE_QUICKSTART@'
ENABLE_GRAPHITE='@ENABLE_GRAPHITE@'
GRAPHITE_SRC='@GRAPHITE_SRC@'
PROPAGATED_ARGS="@PROPAGATED_ARGS@"
CAIRO_VER=@CAIRO_VER@
CAIRO_ENABLED=@CAIRO_ENABLED@
SYSTEM_CAIRO=@SYSTEM_CAIRO@
GLITZ_VER=@GLITZ_VER@
HUNSPELL_UNO_SRC=@HUNSPELL_UNO_SRC@
HUNSPELL_LIB_SRC=@HUNSPELL_LIB_SRC@
AGFA_MONOTYPE_FONTS_SOURCE=@AGFA_MONOTYPE_FONTS_SOURCE@

if test -f "$TOOLSDIR/distro-configs/Common.conf" ; then
    COMMON_OPTIONS="`cat $TOOLSDIR/distro-configs/Common.conf | xargs`";
else
    echo "Warning: $TOOLSDIR/distro-configs/Common.conf not found."
fi

if test "z$BUILD_WIN32" != "z"; then
    if test -f "$TOOLSDIR/distro-configs/CommonWin32.conf" ; then
        PLATFORM_OPTIONS="`cat $TOOLSDIR/distro-configs/CommonWin32.conf | xargs`";
    else
        echo "Warning: $TOOLSDIR/distro-configs/CommonWin32.conf not found."
    fi
else
    if test -f "$TOOLSDIR/distro-configs/CommonLinux.conf" ; then
        PLATFORM_OPTIONS="`cat $TOOLSDIR/distro-configs/CommonLinux.conf | xargs`";
    else
        echo "Warning: $TOOLSDIR/distro-configs/CommonLinux.conf not found."
    fi
fi

if test "z$DISTRO" != "z" -a -f "$TOOLSDIR/distro-configs/$DISTRO.conf"; then
    CONFIGURE_OPTIONS="$COMMON_OPTIONS $PLATFORM_OPTIONS `cat $TOOLSDIR/distro-configs/$DISTRO.conf | xargs`";
else
    echo "ERROR: Could not find the distribution specific configure options"
    echo "    file in $TOOLSDIR/distro-configs/."
    echo "    $TOOLSDIR/distro-configs/$DISTRO.conf is probably missing."
fi

# build the right native widgets
CONFIGURE_OPTIONS="$CONFIGURE_OPTIONS $OOO_WIDGET_FLAGS"

# Misc. internal
TOOLSDIR='@TOOLSDIR@'
OOBUILDDIR='@OOBUILDDIR@'
SYSTEM_GCC='@SYSTEM_GCC@'
FORCE_GCC33='@FORCE_GCC33@'
# the variable DESTDIR will be unset to do not break build, etc.
# the test allows to source setup twice
test "z$DESTDIR" = "z" || OODESTDIR=$DESTDIR

if test "z$SYSTEM_GCC" = "ztrue"; then
    CONFIGURE_OPTIONS="$CONFIGURE_OPTIONS --with-system-stdlibs"
fi

# clobber bogus env vars. they badly screw things up
unset DESTDIR;
unset CC;
unset CXX;
unset ERROR_FLAGS;
unset MAKE
unset WARN_CFLAGS

# Where to install to
prefix=@prefix@
exec_prefix=@exec_prefix@
PREFIXBASE=@prefix@
LIBDIRBASE=@libdir@
MANDIRBASE=@mandir@
DOCDIRBASE=@docdir@
PREFIX=$OODESTDIR$PREFIXBASE
MANDIR=$OODESTDIR$MANDIRBASE
DOCDIR=$OODESTDIR$DOCDIRBASE
DATADIRBASE=@datadir@
DATADIR=$OODESTDIR$DATADIRBASE
SYSCONFBASE=@sysconfdir@
SYSCONFDIR=$OODESTDIR$SYSCONFBASE
OOINSTBASE=@libdir@/@OOOINSTALLDIRNAME@
OOINSTDIR=$OODESTDIR$OOINSTBASE
OOOINSTALLDIRNAME=@OOOINSTALLDIRNAME@
TCSH=/bin/tcsh

# it can be lib or lib64
LIB=${LIBDIRBASE##*/}

# substitute ALL to the list of languages if possible
if test -f $OOBUILDDIR/solenv/inc/postset.mk ; then
    ALL_LANGS=`sed -n -e "s|^[[:space:]]*completelangiso=\(.*\)\(en-US \)\(.*\)$|\2\1\3|p" $OOBUILDDIR/solenv/inc/postset.mk`
    OOO_LANGS_LIST=`echo $OOO_LANGS | sed -e "s|ALL|$ALL_LANGS|g"`
fi

# setup paths
PATH="$BUILDDIR/bin:$PATH:$TOOLSDIR/bin"

CONFIGURE_OPTIONS="$CONFIGURE_OPTIONS $CONFIGURE_EXTRA_OPTIONS"

LD_LIBRARY_PATH="$BUILDDIR/$LIB:/opt/mozilla/$LIB:$LD_LIBRARY_PATH"

# gcc speedup
case "$ENABLE_CCACHE/$ENABLE_ICECREAM" in
    "yes/")
        export CC="ccache gcc"
        export CXX="ccache g++"
        ;;

    "/yes")
        export CC="$ICECREAM_BINDIR/gcc"
        export CXX="$ICECREAM_BINDIR/g++"
        ;;

    "yes/yes")
        export CC="ccache $ICECREAM_BINDIR/gcc"
        export CXX="ccache $ICECREAM_BINDIR/g++"
        ;;
esac

# Icecream should use the internal gcc, if we want it
if test "z$ENABLE_ICECREAM" != "z" -a "z$SYSTEM_GCC" = "z" ; then
    if test -x "$BUILDDIR/bin/gcc"; then
        pushd "$BUILDDIR" > /dev/null
        ICE_TAR_NAME=`create-env --respect-path | grep '^creating ' | sed 's/^creating //'`
        popd > /dev/null
        export ICECC_VERSION="$BUILDDIR/$ICE_TAR_NAME"
    fi
fi

if test "z$CCACHE_DIR" = "z" ; then
    CCACHE_DIR=$BUILDDIR/.ccache
fi

# how to mark config files in file lists
if test "z$VENDORNAME" = "zNovell" -o "z$VENDORNAME" = "zRedHat"; then
    RPM_CONFIG_FILE_TAGS="%config"
elif test "z$DISTRO" = "zPLD" ; then
    RPM_CONFIG_FILE_TAGS="%config(noreplace) %verify(not md5 size mtime)"
fi

# Tag file lists with language (for RPM)
if test "z$VENDORNAME" = "zRedHat"; then
    RPM_TAG_LANGPACKS=TRUE
fi


# ---------------------------
#   Source / Version setup:
# ---------------------------
GCC_VER=gcc-3.4.1
GCC_TARBALL=gcc-3.4.1.tar.bz2
GCC_UNTAR_OPTIONS=jxf
GCC_PATCHES="gcc-3.4.1-Enums.diff gcc-3.4.1-VisibilityPatch2.diff"

BINUTILS_VER=
BINUTILS_TARBALL=
BINUTILS_UNTAR_OPTIONS=
BINUTILS_PATCH=

OOO_SCALED_ICONS_VER=ooo-scaled-icons
OOO_SCALED_ICONS_TARBALL=$OOO_SCALED_ICONS_VER.tar.gz
OOO_SCALED_ICONS_UNTAR_OPTIONS=xzf

OOO_TARBALL="$CVSTAG-core.tar.bz2"
OOO_SYSTEM_TARBALL="$CVSTAG-system.tar.bz2"
OOO_BINFILTER_TARBALL="$CVSTAG-binfilter.tar.bz2"
OOO_LANG_TARBALL="$CVSTAG-lang.tar.bz2"
OOO_SDK_OO_TARBALL="$CVSTAG-sdk_oo.tar.bz2"
OOO_EXTRA_ARTWORK="@OOO_EXTRA_ARTWORK@"
OOO_UNTAR_OPTIONS=jxf

UNICOWS_SRC=$SRCDIR/unicows.exe;
DBGINST_SRC=$SRCDIR/dbghinst.EXE;
ODMA_SRC=$SRCDIR/5_11_98Odma20.zip;

BUILD_MOZILLA_SOURCE='@BUILD_MOZILLA_SOURCE@'

OPENCLIPART_VER=@OPENCLIPART_VER@
OPENCLIPART_DIR=@OPENCLIPART_DIR@

MDBTOOLS_SRC=@MDBTOOLS_SRC@
SYSTEM_MDBTOOLS=@SYSTEM_MDBTOOLS@

export LD_LIBRARY_PATH PATH CVSTAG APPLY_DIR
export CCACHE_DIR SRCDIR BUILDDIR OOBUILDDIR
export BUILD_FLAGS VERSION TOOLSDIR VENDORNAME
export PREFIX PREFIXBASE SYSCONFDIR SYSCONFBASE
export MANDIR MANDIRBASE DOCDIR DOCDIRBASE
export OOINSTDIR OOINSTBASE OOOINSTALLDIRNAME
export OODESTDIR OOO_LANGS OOO_LANGS_LIST
export OOO_POOR_HELP_LOCALIZATIONS
export CONFIGURE_OPTIONS
export DISTRO BINSUFFIX ARCHITECTURE BUILD_MAGIC
export BUILD_WIN32 
export FORCE_GCC33
export OPENCLIPART_VER OPENCLIPART_DIR

if test "z$RPM_TAG_LANGPACKS" != "z"; then
export RPM_TAG_LANGPACKS
fi

echo "Setup:"
echo " Tag:        '$CVSTAG'"
echo " Apply:      '$APPLY_DIR/apply'"
echo " Flags:      '$BUILD_FLAGS'"
echo " Suffix:     '$BINSUFFIX'"
echo " Dir:        '$BUILDDIR'"
echo " DestDir:    '$DESTDIR'"
echo " Path:       '$PATH'"
echo " Prefix:     '$PREFIX'"
echo " Mandir:     '$MANDIR'"
echo " Docdir:     '$DOCDIR'"
echo " Sysconf:    '$SYSCONFDIR'"
echo " OOInBase:   '$OOINSTBASE'"
echo " OOInstall:  '$OOINSTDIR'"
echo " OODestDir:  '$OODESTDIR'"
echo " Config:     $CONFIGURE_OPTIONS $PROPAGATED_ARGS"
echo " Use gcc33:  '$FORCE_GCC33'"
if test "$ENABLE_CCACHE" = "yes"; then
    echo " ccache:     yes, ccache directory is '$CCACHE_DIR'"
else
    echo " ccache:     no"
fi
if test "$ENABLE_ICECREAM" = "yes"; then
    echo " icecream:   yes, in '$ICECREAM_BINDIR'. Max number of jobs is '$ICECREAM_JOBS'"
    if test "z$ICECC_VERSION" != "z"; then
        echo " icecream:   using '$ICECC_VERSION' compiler tarball."
    fi
else
    echo " icecream:   no"
fi
