[cc43bd]: post_configure  Maximize  Restore  History

Download this file

102 lines (85 with data), 2.6 kB

#!/bin/sh
#Fix config.pro to be suitable for QMake
sed <config.pro.in 's/${prefix}/$$PREFIX/g' | sed 's/${datarootdir}/$$DATAROOTDIR/g' | sed 's/${exec_prefix}/$$EPREFIX/g' >config.pro

#Write expanded data path into config.h
prefix=`grep '^PREFIX *=' <config.pro.in |sed 's/^[^=]*= *//'`
exec_prefix=`grep '^EPREFIX *=' <config.pro.in |sed 's/^[^=]*= *//' |sed "s^\\\${prefix}^$prefix^"`
data_root_dir=`grep '^DATAROOTDIR *=' <config.pro.in |sed 's/^[^=]*= *//' |sed "s^\\\${prefix}^$prefix^"`
data_path=`grep '^DATA_PATH *=' <config.pro.in |sed 's/^[^=]*= *//' |sed "s^\\\${prefix}^$prefix^" |sed "s^\\\${exec_prefix}^$exec_prefix^" |sed "s^\\\${datarootdir}^$data_root_dir^"`
sed <src/gui/config.h.in "s^@DATAPATH@^$data_path^" >src/gui/config.h

#check for freetype include parameters for xpdf
CONFIG_FLAGS=src/Makefile.flags
if [ -d /usr/include/freetype2/freetype ]
then
 #Need extra parameter to find freetype
 echo >$CONFIG_FLAGS xpdf_configure_flags=--with-freetype2-includes=/usr/include/freetype2
else
 #the same can be in /usr/local ...
 if [ -d /usr/local/include/freetype2/freetype ]
 then
  #Need extra parameter to find freetype
  echo >$CONFIG_FLAGS xpdf_configure_flags=--with-freetype2-includes=/usr/local/include/freetype2
 else
  #No extra parameter needed (probably)
  echo >$CONFIG_FLAGS xpdf_configure_flags=
 fi
fi

#debug/release
RELEASE_MODE=`grep '^E_RELEASE *=' <config.pro.in |sed 's/^[^=]*= *//'`
echo E_RELEASE=$RELEASE_MODE >>$CONFIG_FLAGS

#debug/release for utils
if [ "$RELEASE_MODE" = "yes" ]; then
   UTIL_CXXFLAGS="-DNDEBUG -O2"
else
   UTIL_CXXFLAGS="-DDEBUG -g -O0"
fi
echo UTIL_CXXFLAGS=$UTIL_CXXFLAGS >>$CONFIG_FLAGS

#Try to pick a good qmake (from qt3)

GOOD_QMAKE3=""

#function to check if given qmake is valid
try_qmake() {
 if [ -n "$GOOD_QMAKE3" ]
 then
  return 0
 fi
 echo -n "Trying qmake: $1"
 is_qmake_3=`$1 --version 2>&1 | grep 3\.[0-9][0-9]*\.[0-9][0-9]*`
 #Is it from Qt 3?
 if [ -z "$is_qmake_3" ]
 then
  echo " ... not valid"
  return 1
 else
  echo " ... ok"
  echo "Using qmake: $1"
  export GOOD_QMAKE3="$1"
  return 0
 fi
 echo " ... not found"
 return 1
}

#Qmake passed as argument
if [ -n "$1" ]
then
 try_qmake "$1"
fi

#Qmake in QMAKE environment variable (if set)
if [ -n "$QMAKE" ]
then
 try_qmake "$QMAKE"
fi

#Qmake in QTDIR
try_qmake "$QTDIR/bin/qmake"

#Plain qmake
try_qmake 'qmake'

#debian-like qmake-qt3
try_qmake "qmake-qt3"

#Sometime it is there...
try_qmake '/usr/bin/qmake'

#This one is mainly because of cygwin
try_qmake '/usr/lib/qt3/bin/qmake'

if [ -z "$GOOD_QMAKE3" ]
then
 echo "Failed to find qmake from QT3!"
fi

echo >>$CONFIG_FLAGS "QMAKE=$GOOD_QMAKE3"

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks