trinity-devel@lists.pearsoncomputing.net

Message: previous - next
Month: December 2011

Re: [trinity-devel] How to tell automake where to find TQt/Qt3

From: Darrell Anderson <humanreadable@...>
Date: Fri, 16 Dec 2011 11:43:57 -0800 (PST)
> I already asked but no-one replied to
> me.
> Is there any way in which I could tell automake
> (./configure) for
> which version of TQt or Qt should it look, or where to find
> them?
> In my system it keeps detecting TQt4 and thus is searching
> for Qt4.
> Both of them aren't present on my system, since I have
> clean install,
> only with Qt3 and other trinity deps.
> 
> It is crucial to me, since without solving this problem I
> cannot
> continue on building trinity components, nor I can continue
> on
> creating PKGBUILDs for Arch.
> 
> My distro is Archlinux and I'm building from 3.5.13
> tarballs.

I use the hammer approach. :)

I use a master build script and options. Here is how I ensure all of my TDE build scripts know where to find files. This function could be trimmed if I no longer built KDE3 packages.

set_config_options () {
VERSION_FILE="/etc/slackware-version"
if [ -r $VERSION_FILE ]; then
  RELEASE_VERSION="`cat $VERSION_FILE | awk '{print $2}' | cut -d '.' -f1`"
  if [ -z $RELEASE_VERSION ]; then
    echo "Unable to determine the major release number from $VERSION_FILE. Please correct this problem."
    echo
    exit 1
  fi
else
  echo "$VERSION_FILE does not exist or is not readable. Please correct this problem."
  echo
  exit 1
fi
export RELEASE_VERSION
if [ $RELEASE_VERSION -ge 13 ] && [ "$KDE_RELEASE_VERSION" = "3.5.10" ]; then
  if [ "$CONFIG_ASK" = "false" ]; then
    PREFIX=${PREFIX:-/opt/kde3}
    SYSCONFDIR=${SYSCONFDIR:-/etc/kde3}
    LIBDIR=${LIBDIR:-/opt/kde3/lib${LIBDIRSUFFIX}}
    MANDIR=${MANDIR:-/opt/kde3/man}
  else
    PREFIX=${PREFIX:-/usr}
    SYSCONFDIR=${SYSCONFDIR:-/etc/kde3}
    LIBDIR=${LIBDIR:-/usr/lib${LIBDIRSUFFIX}}
    MANDIR=${MANDIR:-/usr/man}
  fi
elif [ $RELEASE_VERSION -le 12 ] && [ "$KDE_RELEASE_VERSION" = "3.5.10" ]; then
  PREFIX=${PREFIX:-/usr}
  SYSCONFDIR=${SYSCONFDIR:-/etc/kde}
  LIBDIR=${LIBDIR:-/usr/lib${LIBDIRSUFFIX}}
  MANDIR=${MANDIR:-/usr/man}
else
  if [ "$CONFIG_ASK" = "false" ]; then
    PREFIX=${PREFIX:-/opt/trinity}
    SYSCONFDIR=${SYSCONFDIR:-/etc/trinity}
    LIBDIR=${LIBDIR:-/opt/trinity/lib${LIBDIRSUFFIX}}
    MANDIR=${MANDIR:-/opt/trinity/man}
  else
    PREFIX=${PREFIX:-/usr}
    SYSCONFDIR=${SYSCONFDIR:-/etc/trinity}
    LIBDIR=${LIBDIR:-/usr/lib}
    MANDIR=${MANDIR:-/usr/man}
  fi
fi
export PREFIX SYSCONFDIR LIBDIR MANDIR

# Ensure the correct path for QTDIR.
if [ -d /opt/kde3/lib${LIBDIRSUFFIX}/qt-3.3.8c ]; then
  QTDIR=/opt/kde3/lib${LIBDIRSUFFIX}/qt-3.3.8c
elif [ -d /opt/trinity/lib${LIBDIRSUFFIX}/qt3-3.3.8.d ]; then
  QTDIR=/opt/trinity/lib${LIBDIRSUFFIX}/qt3-3.3.8.d
elif [ -d /opt/trinity/lib${LIBDIRSUFFIX}/qt-3.3.8c ]; then
  QTDIR=/opt/trinity/lib${LIBDIRSUFFIX}/qt-3.3.8c
elif [ -d /usr/lib${LIBDIRSUFFIX}/qt-3.3.8c ]; then
  QTDIR=/usr/lib${LIBDIRSUFFIX}/qt-3.3.8c
elif [ -d /opt/kde3/lib${LIBDIRSUFFIX}/qt-3.3.8b ]; then
  QTDIR=/opt/kde3/lib${LIBDIRSUFFIX}/qt-3.3.8b
elif [ -d /opt/trinity/lib${LIBDIRSUFFIX}/qt-3.3.8b ]; then
  QTDIR=/opt/trinity/lib${LIBDIRSUFFIX}/qt-3.3.8b
elif [ -d /usr/lib${LIBDIRSUFFIX}/qt-3.3.8b ]; then
  QTDIR=/usr/lib${LIBDIRSUFFIX}/qt-3.3.8b
elif [ -d /opt/kde3/lib${LIBDIRSUFFIX}/qt3 ]; then
  QTDIR=/opt/kde3/lib${LIBDIRSUFFIX}/qt3
elif [ -d /opt/trinity/lib${LIBDIRSUFFIX}/qt3 ]; then
  QTDIR=/opt/trinity/lib${LIBDIRSUFFIX}/qt3
elif [ -d /usr/lib${LIBDIRSUFFIX}/qt3 ]; then
  QTDIR=/usr/lib${LIBDIRSUFFIX}/qt3
# This last entry is dangerous: could be a QT4 location!
# If qt3 is not yet installed this will be the default, but the qt3 build script
# does not need this variable. Only subsequent builds need this variable.
elif [ -d /usr/lib/qt ]; then
  if [ "$QT4DIR" = "/usr/lib/qt" ] || [ -e /usr/lib/qt/q3porting.xml ] || [ -e /usr/lib/qt/bin/generator ]; then
    QTDIR_WARN="The directory /usr/lib/qt is a QT4 directory."
  else
    QTDIR=/usr/lib/qt
  fi
else
  echo "Can't determine the location of the QT3 lib files."
  wait_for_response
fi
export QTDIR

if [ -z "`echo $PATH | grep \"${PREFIX}/bin\"`" ]; then
  PATH="$PREFIX/bin:$PATH"
fi
if [ -n "$QTDIR" ] && [ -z $QTDIR_WARN ] && [ -z "`echo $PATH | grep \"$QTDIR\"`" ]; then
  PATH="$QTDIR/bin:$PATH"
fi
export PATH

if [ -n "$CPLUS_INCLUDE_PATH" ]; then
  # Does the variable already include the QT3 location?
  if  [ -z "`echo $CPLUS_INCLUDE_PATH | grep \"$QTDIR\"`" ]; then
    CPLUS_INCLUDE_PATH=$QTDIR/include:$CPLUS_INCLUDE_PATH
  fi
else
  if [ -n "$QTDIR_WARN" ] && [ "$QTDIR" != "$QTDIR_WARN" ]; then
    CPLUS_INCLUDE_PATH=$QTDIR/include
  fi
fi

if [ -z $CPLUS_INCLUDE_PATH ] && [ -n "$QTDIR" ]; then
  CPLUS_INCLUDE_PATH=$QTDIR/include
fi

if [ "`echo $CPLUS_INCLUDE_PATH | grep \"$PREFIX\"`" != "" ]; then
  CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:$PREFIX/include
fi
if [ -z "`echo $CPLUS_INCLUDE_PATH | grep \"/usr/include\"`" ]; then
  if [ -n "$CPLUS_INCLUDE_PATH" ]; then
    CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:/usr/include
  else
    CPLUS_INCLUDE_PATH=/usr/include
  fi
fi
export CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH
# tqtinterface include files:
if [ -d /usr/include/tqt ]; then
  TQTDIR=/usr/include/tqt
elif [ -d /opt/trinity/include/tqt ]; then
  TQTDIR=/opt/trinity/include/tqt
else
  if [ "$KDE_RELEASE_VERSION" != "3.5.10" ]; then
    echo "Can't determine the location of the tqt include files."
    wait_for_response
  fi
fi
if [ -n "$TQTDIR" ]; then
  export TQTDIR
  export CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:$TQTDIR
fi

# $LIBDIR already contains ${LIBDIRSUFFIX}.
if [ -n "$PKG_CONFIG_PATH" ]; then
  # Does the variable already include the QT3 location?
  if [ -z "$QTDIR_WARN" ] && [ "`echo $PKG_CONFIG_PATH | grep \"$LIBDIR\"`" = "" ]; then
    if [ "`echo $PKG_CONFIG_PATH | grep \"$LIBDIR\"`" = "" ]; then
      PKG_CONFIG_PATH=$LIBDIR/pkgconfig:$PKG_CONFIG_PATH
    fi
  fi
else
  if [ -n "$LIBDIR" ]; then
    PKG_CONFIG_PATH=$LIBDIR/pkgconfig
  fi
fi
export PKG_CONFIG_PATH

if [ -n "$LD_LIBRARY_PATH" ]; then
  if [ -d $LIBDIR/kde3 ]; then
    export LD_LIBRARY_PATH=$LIBDIR:$LIBDIR/kde3:$LD_LIBRARY_PATH
  else
    export LD_LIBRARY_PATH=$LIBDIR:$LD_LIBRARY_PATH
  fi
else
  if [ -d $LIBDIR/kde3 ]; then
    export LD_LIBRARY_PATH=$LIBDIR:$LIBDIR/kde3
  else
    export LD_LIBRARY_PATH=$LIBDIR
  fi
fi

# Set the debugging support options. A less verbose cmake option is -g.
if [ "$DEBUG" = "true" ]; then
  DEBUG_AUTOTOOL_OPT="--enable-debug=full"
  DEBUG_CMAKE_OPT="-ggdb"
else
  DEBUG_AUTOTOOL_OPT="--disable-debug"
  DEBUG_CMAKE_OPT=""
fi
export DEBUG_CMAKE_OPT
export DEBUG_AUTOTOOL_OPT

echo "Slackware major release number from $VERSION_FILE: $RELEASE_VERSION"
if [ "$TRINITY" = "true" ]; then
  echo "The following locations will be used to build and install Trinity:"
else
  echo "The following locations will be used to build and install KDE3:"
fi
echo
variable_list
# Check the cmake version
if [ "$KDE_RELEASE_VERSION" != "3.5.10" ] && [ "$KDE_RELEASE_VERSION" != "3.5.12" ] && [ "$KDE_RELEASE_VERSION" != "3.5.13" ]; then
  CMAKE_VER="`/bin/ls -1 /var/log/packages/cmake* | sed -e 's:/var/log/packages/cmake-::' -e 's/\.//g' | awk -F '-' '{print $1}'`"
  if [ "`echo \"$CMAKE_VER < 283\" | bc`" = "1" ] ; then
    echo "Oops! CMake version 2.8.4 or newer is required."
    echo "Currently installed: `/bin/ls -1 /var/log/packages/cmake* | sed -e 's:/var/log/packages/::'`"
    wait_for_response
  fi
fi
if [ "$CONFIG_ASK" != "false" ]; then
  echo "========================================================================"
  echo "You chose to override the default installation locations. For that to"
  echo "succeed please ensure various packages such as QT4, all KDE4 packages,"
  echo "etc., are removed or there will be significant conflicts."
  if [ -n "$QT4DIR" ]; then
    echo "For example, the \$QT4DIR environment variable exists on this system."
    echo "\$QT4DIR is set to $QT4DIR."
    echo "You might want to stop now and investigate."
  fi
  echo "========================================================================"
  echo
fi
if [ "$QTDIR" = "The directory /usr/lib/qt is a QT4 directory." ]; then
  echo "QT3 probably is not installed!"
  echo
fi
if [ -n "`echo $QTDIR | grep 'qt-3.3.8c'`" ]; then
  # Verify no 3.3.8b remnants exist.
  if [ -d /opt/kde3/lib${LIBDIRSUFFIX}/qt-3.3.8b ] || [ -d /opt/trinity/lib${LIBDIRSUFFIX}/qt-3.3.8b ] || [ -d /usr/lib${LIBDIRSUFFIX}/qt-3.3.8b ]; then
    echo "========================================================================"
    echo "                              WARNING"
    echo "The QTDIR environment variable is defined as $QTDIR."
    echo "Some 3.3.8b remnants exists. The two paths likely will cause problems."
    if [ "$KDE_RELEASE_VERSION" = "3.5.10" ] || [ "$KDE_RELEASE_VERSION" = "3.5.12" ]; then
      echo "qt-3.3.8c should be installed only for Trinity builds subsequent"
      echo "to version 3.5.12."
    fi
    echo
    echo "========================================================================"
    echo
  fi
elif [ -n "`echo $QTDIR | grep 'qt-3.3.8b'`" ]; then
  # Verify no 3.3.8c remnants exist.
  if [ -d /opt/kde3/lib${LIBDIRSUFFIX}/qt-3.3.8c ] || [ -d /opt/trinity/lib${LIBDIRSUFFIX}/qt-3.3.8c ] || [ -d /usr/lib${LIBDIRSUFFIX}/qt-3.3.8c ]; then
    echo "========================================================================"
    echo "                              WARNING"
    echo "The QTDIR environment variable is defined as $QTDIR."
    echo "Some 3.3.8c remnants exists. The two paths likely will cause problems."
    echo
    echo "========================================================================"
    echo
  fi
fi
get_package_type
echo
sleep 0.1
wait_for_response
echo "========================================================================"
}

Darrell