#! /bin/bash

LDFLAGS=""

DEBUG_FLAG=no

if [ "x$1" == "x" ]; then
	DEBUG_FLAG=no
	CXXFLAGS=" -fomit-frame-pointer $CXXFLAGS"
	CFLAGS=" -fomit-frame-pointer $CXXFLAGS"
	LDFLAGS="$LDFLAGS"
fi

if [ "x$1" == "xdebug" ]; then
	DEBUG_FLAG=yes
fi

if [ "x$1" == "xfulldebug" ]; then
	DEBUG_FLAG=full
	CXXFLAGS=" -pg $CXXFLAGS -DKJS_DEBUG_MEM=1"
	CFLAGS=" -pg $CFLAGS"
	LDFLAGS=" -pg $LDFLAGS"
fi
	

export CXX
export CC
export CFLAGS
export CPPFLAGS
export CXXFLAGS
export LD_LIBRARY_PATH
export LDFLAGS

CXXFLAGS="$CXXFLAGS -DQT_NO_TRANSLATE -DQT_NO_CLIPBOARD -DQT_NO_DRAGNDROP"

./configure \
	--prefix=/usr/local/kde3 \
	--with-ipv6-lookup=no \
	--without-xinerama \
	--with-qt-dir=/usr/lib/qt-3.1.1 \
	--with-qt-includes=/usr/lib/qt-3.1.1/include \
	--disable-selection \
	--disable-bookmarks \
	--with-pic \
	--with-gui=x11 \
	--with-javascript=dynamic \
	--enable-debug=$DEBUG_FLAG \
	--enable-add-ons=kflashpart \
	--enable-fast-malloc=full \
	--disable-printing \
	--disable-pcre

#	--with-ssl-dir=$HOME/src/OpenSSL \
# --disable-javascript \
# --disable-threading \
#--disable-scrollbars \
# --enable-jshostext \
#
