autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Custom source configuration


From: Yvan Barthélemy
Subject: Re: Custom source configuration
Date: Tue, 13 Nov 2007 14:03:00 +0100

Looks like mailman does not like attachments, Trying as raw text...

---
--- FILENAME: custom-qt-checks.m4
--- AUTHOR: Yvan BARTHÉLEMY
--- DATE: 2007-11-13
---
#####
#
# SYNOPSIS
#
#       AX_QT_CHECK_ALL
#       AX_QT_CHECK_INST
#       AX_QT_CHECK_BIN
#       AX_QT_CHECK_LIB
#       AX_QT_CHECK_INC
#       AX_QT_CHECK_QMAKE
#       AX_QT_CHECK_MOC
#       AX_QT_CHECK_UIC
#       AX_QT_EXPORT_VARS
#       AX_QT_SAMPLE_COMPILE
#
# configure [--with-qt] [--with-qt-bin] [--with-qt-lib] [--with-qt- include]
#               [--with-qt-qmake] [--with-qt-moc] [--with-qt-uic]
#
# DESCRIPTION
#
#       Checks parts of the Qt installation and exports variables accordingly.
#
# When some option is set. The macro will automatically fails if the provided # location is invalid. If set to yes or force, it will only fails if the tool
#       or the location was not found.
#
#       When we need to seek for some path we use the following strategy :
# * We check whether the user specifically set a variable for that purpose.
#               If this can be used we are done, otherwise we stop and fail. It 
might
# also be just yes, In this case, we search as usual, with the difference
#               that we will stop if we cannot find the tool corresponding to 
the
#               user-provided option.
# * After that, we look inside any user provided directory. If one set, it
#               should work because we have check the validity of this 
directory.
#               Otherwise, should it fail we continue as if the user did not 
provided
#               anything.
# * Then we simply look in the environment variables for PATH, LIBPATH, etc.
#               * After, we try some standard locations
# * If none of this work, we stop here and tell that we were not able to
#               find the tool.
#
# TODO
#
#       * Support for multi-threading configuration
# * Support for automatic customization of compiling options depending on the sources # * Support for X11 dependencies (conditionnal require of AC_PATH_X and AC_PATH_XTRA)
#       * Searches the mkspecs for user preferences
#
# LEGAL
#
#       Copyright (c) 2007 Yvan BARTHELEMY <address@hidden>
#
#       Parts from http://autoconf-archive.cryp.to/bnv_have_qt.html
#       Copyright (c) 2006 Bastiaan Veelo <address@hidden>
#
#   Copying and distribution of this file, with or without
#   modification, are permitted in any medium without royalty provided
#   the copyright notice and this notice are preserved.

AC_DEFUN([AX_QT_CHECK_INST], [
        AC_REQUIRE([_AX_QT_ARGS])
AC_CACHE_CHECK([for Qt global installation directory], [ax_cv_qt_global], [_QT_SEEK_INST(ax_cv_qt_global)])
])

AC_DEFUN([AX_QT_CHECK_BIN], [
        AC_REQUIRE([_AX_QT_ARGS])
        AC_REQUIRE([AX_QT_CHECK_INST])
AC_CACHE_CHECK([for Qt binary directory], [ax_cv_qt_bin], [_QT_SEEK_BIN(ax_cv_qt_bin)])
])

AC_DEFUN([AX_QT_CHECK_LIB], [
        AC_REQUIRE([_AX_QT_ARGS])
        AC_REQUIRE([AX_QT_CHECK_INST])
AC_CACHE_CHECK([for Qt libraries], [ax_cv_qt_lib], [_QT_SEEK_LIB(ax_cv_qt_lib)])
])

AC_DEFUN([AX_QT_CHECK_INCLUDE], [
        AC_REQUIRE([_AX_QT_ARGS])
        AC_REQUIRE([AX_QT_CHECK_INST])
AC_CACHE_CHECK([for Qt includes], [ax_cv_qt_include], [_QT_SEEK_INCLUDE(ax_cv_qt_include)])
])

AC_DEFUN([AX_QT_CHECK_QMAKE], [
        AC_REQUIRE([AX_QT_CHECK_BIN])
AC_CACHE_CHECK([for Qt qmake], [ax_cv_qt_qmake], [_QT_SEEK_QMAKE(ax_cv_qt_qmake)])
])

AC_DEFUN([AX_QT_CHECK_MOC], [
        AC_REQUIRE([AX_QT_CHECK_BIN])
AC_CACHE_CHECK([for Qt moc], [ax_cv_qt_moc], [_QT_SEEK_MOC(ax_cv_qt_moc)])
])

AC_DEFUN([AX_QT_CHECK_UIC], [
        AC_REQUIRE([AX_QT_CHECK_BIN])
AC_CACHE_CHECK([for Qt uic], [ax_cv_qt_uic], [_QT_SEEK_UIC(ax_cv_qt_uic)])
])

AC_DEFUN([AX_QT_CHECK_ALL], [
        AC_REQUIRE([AX_QT_CHECK_INCLUDE])
        AC_REQUIRE([AX_QT_CHECK_LIB])
        AC_REQUIRE([AX_QT_CHECK_QMAKE])
        AC_REQUIRE([AX_QT_CHECK_MOC])
        AC_REQUIRE([AX_QT_CHECK_UIC])

        AC_REQUIRE([AX_QT_CHECK_COMPILE])

        AX_QT_EXPORT_VARS

# Also checks whether we should build a .app, a .exe or a standard UNIX executable.
        # (This depends upon environment but also user preference)
# Sources scan for required libraries detection in order to completely get rid of qmake
        # Checks for GUI apps install directory.
])

AC_DEFUN([AX_QT_EXPORT_VARS], [
# Version checking variables (not cached). TODO: cache version information
        
        QT_VERSION=$qt_version
        QT_QMAKE_VERSION=$qt_qmake_version
        QT_UIC_VERSION=$qt_uic_version
        QT_MOC_VERSION=$qt_moc_version
        QT_HAS_GLOBAL_INSTALL=$qt_global_inst

        # Other useful variables
        if test x"$ax_cv_qt_global" != x"not found"; then
                QT_INSTALL_DIR=$ax_cv_qt_global
        fi
        if test x"$ax_cv_qt_global" == x"not found"; then
                QT_INSTALL_DIR=
        fi
        
        QT_INCLUDE_DIR=$ax_cv_qt_include
        QT_BIN_DIR=$ax_cv_qt_bin
        QT_LIB_DIR=$ax_cv_qt_lib
        QT_QMAKE=$ax_cv_qt_qmake

        # Compiler variables (Needed if you do not want to rely on qmake for
        # Makefile generation. Not recommanded as it is broken for now)
        QT_UIC=$ax_cv_qt_uic
        QT_MOC=$ax_cv_qt_moc

        # Don't be silly and set the same variables as in bnv_have_qt.m4
        QT_DIR=$QT_INSTALL_DIR

        QT_CXXFLAGS="'-I$QT_INCLUDE_DIR' "
        
        echo QT_VERSION=$QT_VERSION
        echo QT_QMAKE_VERSION=$QT_QMAKE_VERSION
        echo QT_UIC_VERSION=$QT_UIC_VERSION
        echo QT_MOC_VERSION=$QT_MOC_VERSION
        echo QT_HAS_GLOBAL_INSTALL=$QT_HAS_GLOBAL_INSTALL
        echo QT_INSTALL_DIR=$QT_INSTALL_DIR
        echo QT_INCLUDE_DIR=$QT_INCLUDE_DIR
        echo QT_BIN_DIR=$QT_BIN_DIR
        echo QT_LIB_DIR=$QT_LIB_DIR
        echo QT_QMAKE=$QT_QMAKE
        echo QT_UIC=$QT_UIC
        echo QT_MOC=$QT_MOC
        echo QT_DIR=$QT_DIR
        echo QT_CXXFLAGS=$QT_CXXFLAGS
        
        # TODO: Detect thread support
        # TODO: Detect need for X11 support
        # TODO: Detect need for Carbon, AppKit, AppServices support
        # TODO: Detect need for Win32 support (gdi32, user32...)
        # Leave it to qmake for now
        
        # I won't set this until I really know what to put here.
        # The two only ways to do this are :
        #       * Ask qmake (Meh...)
        #       * Scan the sources (TODO: Fill AC_SCAN_SOURCES with fresh code)
        QT_LIBS=
        echo QT_LIBS=$QT_LIBS
])

AC_DEFUN([AX_QT_CHECK_COMPILE], [
        
])

AC_DEFUN([AC_SCAN_SOURCES], [

])

AC_DEFUN([_AX_QT_ARGS], [
        AC_ARG_WITH([qt],
[AS_HELP_STRING([--with-qt], [When set, the configuration process will fail if Qt cannot be used. If set to no, force to build without using Qt. When not set, try to use Qt.
                                You can set it to your Qt installation path if 
applicable.])],
        )

        AC_ARG_WITH([qt-bin],
[AS_HELP_STRING([--with-qt-bin], [The path to your Qt programs installation directory.])],
        )

        AC_ARG_WITH([qt-lib],
[AS_HELP_STRING([--with-qt-lib], [The path to your Qt libraries directory.])],
        )

        AC_ARG_WITH([qt-include],
                        [AS_HELP_STRING([--with-qt-include], [Path to Qt 
headers.])],
        )

        AC_ARG_WITH([qt-qmake],
                        [AS_HELP_STRING([--with-qt-qmake], [Path to Qt qmake 
executable.])],
        )

        AC_ARG_WITH([qt-moc],
                        [AS_HELP_STRING([--with-qt-moc], [Path to Qt moc 
executable.])],
        )

        AC_ARG_WITH([qt-uic],
                        [AS_HELP_STRING([--with-qt-uic], [Path to Qt uic 
executable.])],
        )
])

AC_DEFUN([_QT_SEEK_INST], [
        $1='not found'
        qt_global_inst=no
        qt_check_type='try'
        
        dnl Only global path that clearly contains Qt
        dnl This should not override local search
        m4_define([qt_candidates],[
        [`ls -dr1 ${QTDIR} 2>/dev/null | sed q`],
        [`ls -dr1 /usr/lib/qt*/ 2>/dev/null | sed q`],
        [`ls -dr1 /usr/local/qt*/ 2>/dev/null | sed q`],
        [`ls -dr1 /opt/qt*/ 2>/dev/null | sed q`],
        [`ls -dr1 /opt/local/qt*/ 2>/dev/null | sed q`],
        [`ls -dr1 /Developer/qt*/ 2>/dev/null | sed q`],
[`ls -dr1 /c/Qt*/ 2>/dev/null | sed q`], dnl Windows MynGW MSYS path [`ls -dr1 /cygwin/c/Qt*/ 2>/dev/null | sed q`] dnl Windows Cygwin path
        ])
        
        if test x"$with_qt" == x"yes"; then
                qt_check_type='force'
        else if test x"$with_qt" == x"no"; then
                qt_check_type='ignore'
                qt_ignore=yes
                $1='ignored'
        else if test x"$with_qt" != x; then
                qt_check_type='user'
                m4_define([qt_candidates], [[$with_qt]])
        fi
        fi
        fi
        
        stop=false;
        if test x"$qt_check_type" != x"ignore"; then
                m4_foreach([qt_item], [qt_candidates], [
                        item="qt_item"
if test x"$stop" == x"false" -a -d "$item"'/lib' -a -d "$item"'/ include' -a -d "$item"'/bin'; then

                                _QT_ISVALID_INCLUDE([qt_valid_include], 
["$item"/include])
                                _QT_ISVALID_LIB([qt_valid_lib], ["$item"/lib])
                                _QT_ISVALID_BIN([qt_valid_bin], ["$item"/bin])
                                
if test x"$qt_valid_include" == xyes -a x"$qt_valid_lib" == xyes - a x"$qt_valid_bin" == xyes ;then
                                        $1="$item"
                                        stop='true'
                                        qt_global_inst=yes
                                        qt_include_dir=["$item"/include];
                                        qt_lib_dir=["$item"/lib];
                                        qt_bin_dir=["$item"/bin];
                                fi
                        fi
                ])
        fi
        
# TODO: We might want to extend the search by dissecting the user path. I'll promise I'll do it someday.
        
if test x"$qt_global_inst" == x"no" -a x"$qt_check_type" == x"force"; then
                echo
AC_MSG_ERROR([Unable to find a valid Qt installation despite the -- with-qt flag was set. If you assigned a value to the flag, make that is a valid Qt installation directory. See ./configure --help for more information.])
        fi
])

AC_DEFUN([_QT_SEEK_INCLUDE], [
        $1='not found'
        qt_check_type='try'
        qt_valid_include=no

        dnl Only global path that clearly contains Qt
        dnl This should not override local search
        m4_define([qt_candidates],[
                [`ls -dr1 /usr/include/qt* 2>/dev/null | sed q`],
                [`ls -dr1 /usr/local/include/qt* 2>/dev/null | sed q`],
                [`ls -dr1 /opt/include/qt* 2>/dev/null | sed q`],
                [`ls -dr1 /opt/local/include/qt* 2>/dev/null | sed q`],
                [`ls -dr1 /sw/include/qt* 2>/dev/null | sed q`],
        [`ls -dr1 ${QTDIR}/include 2>/dev/null | sed q`],
        [`ls -dr1 /usr/lib/qt*/include 2>/dev/null | sed q`],
        [`ls -dr1 /usr/local/qt*/include 2>/dev/null | sed q`],
        [`ls -dr1 /opt/qt*/include 2>/dev/null | sed q`],
        [`ls -dr1 /opt/local/qt*/include 2>/dev/null | sed q`],
        [`ls -dr1 /Developer/qt*/include 2>/dev/null | sed q`],
[`ls -dr1 /c/Qt*/include 2>/dev/null | sed q`], dnl Windows MynGW MSYS path [`ls -dr1 /cygwin/c/Qt*/include 2>/dev/null | sed q`] dnl Windows Cygwin path
        ])

        if test x"$with_qt_include" == x"yes"; then
                qt_check_type='force'
        else if test x"$with_qt_include" == x"no"; then
                qt_check_type='ignore'
                qt_include_ignore=yes
                $1='ignored'
        else if test x"$with_qt_include" != x; then
                qt_check_type='user'
        fi
        fi
        fi
        
        if test x"$qt_check_type" == x"user"; then
                qt_include_dir="$with_qt_include"
        else if test x"$qt_check_type" != x"ignore"; then
                # TODO: dissect the user env path variables

                stop=false
                m4_foreach([qt_item], [qt_candidates], [
                        item="qt_item"
                        if test x"$stop" == x"false"; then
                                _QT_ISVALID_INCLUDE([qt_valid_include], [$item])
                        fi
                        
                        if test x"$stop" == x"false" -a x"$qt_valid_include" == 
x"yes"; then
                                qt_include_dir="$item"
                                stop=true
                        fi
                ])
        fi
        fi
        
        _QT_ISVALID_INCLUDE([qt_valid_include], [$qt_include_dir])
        
        if test x"$qt_valid_include" == x"yes"; then
                $1="$qt_include_dir"
        fi

if test x"$qt_valid_include" == x"no" -a x"$qt_check_type" == x"force"; then
                echo
AC_MSG_ERROR([Unable to find a valid Qt include directory despite the --with-qt-include flag was set. If you assigned a value to the flag, make that is a valid Qt include directory. See ./configure -- help for more information.])
        fi
])

AC_DEFUN([_QT_SEEK_LIB], [
        $1='not found'
        qt_check_type='try'
        qt_valid_lib=no

        dnl Only global path that clearly contains Qt
        dnl This should not override local search
        m4_define([qt_candidates],[
                [`ls -dr1 /usr/lib 2>/dev/null | sed q`],
                [`ls -dr1 /usr/lib/qt* 2>/dev/null | sed q`],
                [`ls -dr1 /usr/local/lib 2>/dev/null | sed q`],
                [`ls -dr1 /usr/local/lib/qt* 2>/dev/null | sed q`],
                [`ls -dr1 /opt/lib 2>/dev/null | sed q`],
                [`ls -dr1 /opt/lib/qt* 2>/dev/null | sed q`],
                [`ls -dr1 /opt/local/lib 2>/dev/null | sed q`],
                [`ls -dr1 /opt/local/lib/qt* 2>/dev/null | sed q`],
                [`ls -dr1 /sw/lib 2>/dev/null | sed q`],
                [`ls -dr1 /sw/lib/qt* 2>/dev/null | sed q`],
        [`ls -dr1 ${QTDIR}/lib 2>/dev/null | sed q`],
        [`ls -dr1 /usr/local/qt*/lib 2>/dev/null | sed q`],
        [`ls -dr1 /opt/qt*/lib 2>/dev/null | sed q`],
        [`ls -dr1 /opt/local/qt*/lib 2>/dev/null | sed q`],
        [`ls -dr1 /Developer/qt*/lib 2>/dev/null | sed q`],
[`ls -dr1 /c/Qt*/lib 2>/dev/null | sed q`], dnl Windows MynGW MSYS path [`ls -dr1 /cygwin/c/Qt*/lib 2>/dev/null | sed q`] dnl Windows Cygwin path
        ])

        if test x"$with_qt_lib" == x"yes"; then
                qt_check_type='force'
        else if test x"$with_qt_lib" == x"no"; then
                qt_check_type='ignore'
                qt_lib_ignore=yes
                $1='ignored'
        else if test x"$with_qt_lib" != x; then
                qt_check_type='user'
        fi
        fi
        fi
        
        if test x"$qt_check_type" == x"user"; then
                qt_lib_dir="$with_qt_lib"
        else if test x"$qt_check_type" != x"ignore"; then
                # TODO: dissect the user env path variables

                stop=false
                m4_foreach([qt_item], [qt_candidates], [
                        item="qt_item"
                        if test x"$stop" == x"false"; then
                                _QT_ISVALID_LIB([qt_valid_lib], [$item])
                        fi
                        
                        if test x"$stop" == x"false" -a x"$qt_valid_lib" == 
x"yes"; then
                                qt_lib_dir="$item"
                                stop=true
                        fi
                ])
        fi
        fi
        
        _QT_ISVALID_LIB([qt_valid_lib], [$qt_lib_dir])
        
        if test x"$qt_valid_lib" == x"yes"; then
                $1="$qt_lib_dir"
        fi

if test x"$qt_valid_lib" == x"no" -a x"$qt_check_type" == x"force"; then
                echo
AC_MSG_ERROR([Unable to find a valid Qt library directory despite the --with-qt-lib flag was set. If you assigned a value to the flag, make that is a valid Qt library directory. See ./configure --help for more information.])
        fi
])

AC_DEFUN([_QT_SEEK_BIN], [
        $1='not found'
        qt_check_type='try'
        qt_valid_bin=no

        dnl Only global path that clearly contains Qt
        dnl This should not override local search
        m4_define([qt_candidates],[
                [`ls -dr1 /usr/bin 2>/dev/null | sed q`],
                [`ls -dr1 /usr/local/bin 2>/dev/null | sed q`],
                [`ls -dr1 /opt/bin 2>/dev/null | sed q`],
                [`ls -dr1 /opt/local/bin 2>/dev/null | sed q`],
                [`ls -dr1 /sw/bin 2>/dev/null | sed q`],
                [`ls -dr1 ${QTDIR}/bin 2>/dev/null | sed q`],
                [`ls -dr1 /usr/local/qt*/bin 2>/dev/null | sed q`],
                [`ls -dr1 /opt/qt*/bin 2>/dev/null | sed q`],
                [`ls -dr1 /opt/local/qt*/bin 2>/dev/null | sed q`],
                [`ls -dr1 /Developer/qt*/bin 2>/dev/null | sed q`],
[`ls -dr1 /c/Qt*/bin 2>/dev/null | sed q`], dnl Windows MynGW MSYS path [`ls -dr1 /cygwin/c/Qt*/bin 2>/dev/null | sed q`] dnl Windows Cygwin path
        ])

        if test x"$with_qt_bin" == x"yes"; then
                qt_check_type='force'
        else if test x"$with_qt_bin" == x"no"; then
                qt_check_type='ignore'
                qt_bin_ignore=yes
                $1='ignored'
        else if test x"$with_qt_bin" != x; then
                qt_check_type='user'
        fi
        fi
        fi

        if test x"$qt_check_type" == x"user"; then
                qt_bin_dir="$with_qt_bin"
        else if test x"$qt_check_type" != x"ignore"; then
                # TODO: dissect the user env path variables

                stop=false
                m4_foreach([qt_item], [qt_candidates], [
                        item="qt_item"
                        if test x"$stop" == x"false"; then
                                _QT_ISVALID_BIN([qt_valid_bin], [$item])
                        fi
                
                        if test x"$stop" == x"false" -a x"$qt_valid_bin" == 
x"yes"; then
                                qt_bin_dir="$item"
                                stop=true
                        fi
                ])
        fi
        fi

        _QT_ISVALID_BIN([qt_valid_bin], [$qt_bin_dir])

        if test x"$qt_valid_bin" == x"yes"; then
                # Try to populate common Qt utilities for later
# It is important because at this point, it is still possible to detect
                # some variants for the filenames (such as qmake-qt4 instead of 
qmake)
                qt_qmake_bin=`ls -dr1 "$qt_bin_dir"/qmake* 2>/dev/null | sed q`;
                qt_moc_bin=`ls -dr1 "$qt_bin_dir"/moc* 2>/dev/null | sed q`;
                qt_uic_bin=`ls -dr1 "$qt_bin_dir"/uic* 2>/dev/null | sed q`;
                $1="$qt_bin_dir"
        fi
        
if test x"$qt_valid_bin" == x"no" -a x"$qt_check_type" == x"force"; then
                echo
AC_MSG_ERROR([Unable to find a valid Qt binary directory despite the --with-qt-bin flag was set. If you assigned a value to the flag, make that is a valid Qt binary directory. See ./configure --help for more information.])
        fi
])

AC_DEFUN([_QT_SEEK_QMAKE], [
        $1='not found'
        qt_check_type='try'
        qt_valid_qmake=no
                
        if test x"$with_qt_qmake" == x"yes"; then
                qt_check_type='force'
        else if test x"$with_qt_qmake" == x"no"; then
                qt_check_type='ignore'
                qt_qmake_ignore=yes
                $1='ignored'
        else if test x"$with_qt_qmake" != x; then
                qt_check_type='user'
        fi
        fi
        fi

        if test x"$qt_check_type" == x"user"; then
                qt_qmake_file="$with_qt_qmake"
        else if test x"$qt_check_type" != x"ignore"; then
                qt_qmake_file=`which qmake 2>/dev/null`
                
                if test x"$qt_qmake_file" == x; then
                        qt_qmake_file=`which qmake-qt4 2>/dev/null`
                fi

                if test x"$qt_qmake_file" == x; then
                        qt_qmake_file=`which qmake-qt3 2>/dev/null`
                fi
        fi
        fi

        # Checking in standard locations would be a bit overkill.
        # We assume either the user to provide the complete path
        # or the tool would be found in path. But do not check
        # every possible bin directories again
        
        _QT_ISVALID_QMAKE([qt_valid_qmake], [$qt_qmake_file])
        
        if test x"$qt_valid_qmake" == x"yes"; then
                $1="$qt_qmake_file"
        fi
])

AC_DEFUN([_QT_SEEK_MOC], [
        $1='not found'

        qt_check_type='try'
        qt_valid_moc=no
        
        if test x"$with_qt_moc" == x"yes"; then
                qt_check_type='force'
        else if test x"$with_qt_moc" == x"no"; then
                qt_check_type='ignore'
                qt_moc_ignore=yes
                $1='ignored'
        else if test x"$with_qt_moc" != x; then
                qt_check_type='user'
        fi
        fi
        fi

        if test x"$qt_check_type" == x"user"; then
                qt_moc_file="$with_qt_moc"
        else if test x"$qt_check_type" != x"ignore"; then
                qt_moc_file=`which moc 2>/dev/null`
        
                if test x"$qt_moc_file" == x; then
                        qt_moc_file=`which moc-qt4 2>/dev/null`
                fi

                if test x"$qt_moc_file" == x; then
                        qt_moc_file=`which moc-qt3 2>/dev/null`
                fi
        fi
        fi

        # Checking in standard locations would be a bit overkill.
        # We assume either the user to provide the complete path
        # or the tool would be found in path. But do not check
        # every possible bin directories again

        _QT_ISVALID_MOC([qt_valid_moc], [$qt_moc_file])

        if test x"$qt_valid_moc" == x"yes"; then
                $1="$qt_moc_file"
        fi
])

AC_DEFUN([_QT_SEEK_UIC], [
        $1='not found'

        qt_check_type='try'
        qt_valid_uic=no
        
        if test x"$with_qt_uic" == x"yes"; then
                qt_check_type='force'
        else if test x"$with_qt_uic" == x"no"; then
                qt_check_type='ignore'
                qt_uic_ignore=yes
                $1='ignored'
        else if test x"$with_qt_uic" != x; then
                qt_check_type='user'
        fi
        fi
        fi

        if test x"$qt_check_type" == x"user"; then
                qt_uic_file="$with_qt_uic"
        else if test x"$qt_check_type" != x"ignore"; then
                qt_uic_file=`which uic 2>/dev/null`
        
                if test x"$qt_uic_file" == x; then
                        qt_uic_file=`which uic-qt4 2>/dev/null`
                fi

                if test x"$qt_uic_file" == x; then
                        qt_uic_file=`which uic-qt3 2>/dev/null`
                fi
        fi
        fi

        # Checking in standard locations would be a bit overkill.
        # We assume either the user to provide the complete path
        # or the tool would be found in path. But do not check
        # every possible bin directories again

        #echo Trying: "$qt_uic_file"
        _QT_ISVALID_UIC([qt_valid_uic], [$qt_uic_file])
        #echo Result: "$qt_valid_uic"
        
        if test x"$qt_valid_uic" == x"yes"; then
                $1="$qt_uic_file"
        fi
])

AC_DEFUN([_QT_ISVALID_INCLUDE], [
        $1=no
        
        # echo Trying: "$2"/QtGui/qapplication.h
        if test -r "$2"/QtGui/qapplication.h; then
                # echo "Debug: Found something that looks like a valid Qt include 
dir"
                $1=yes
        fi
])

AC_DEFUN([_QT_ISVALID_LIB], [
        $1=no

        #echo Trying: "`ls -dr1 "$2"/libQtCore* 2>/dev/null | sed q`"
        if test -r "`ls -dr1 "$2"/libQtCore* 2>/dev/null | sed q`"; then
                #echo "Debug: Found something that looks like a valid Qt include 
dir"
                $1=yes
        fi
])

AC_DEFUN([_QT_ISVALID_BIN], [
        $1=no

        #echo Trying: "`ls -dr1 "$2"/qmake* 2>/dev/null | sed q`"
        if test -x "`ls -dr1 "$2"/qmake* 2>/dev/null | sed q`"; then
                #echo "Debug: Found something that looks like a valid Qt app 
dir"
                $1=yes
        fi
])

AC_DEFUN([_QT_ISVALID_QMAKE], [
        $1=no
        
        test_bin="$2"
        #echo Trying: "$test_bin"
if test x`"$test_bin" -v | sed -n '/QMake/p' | sed -n '$=' ` == x"1"; then
                #echo "Debug: Found something that looks like a valid Qt qmake 
exe"
                $1=yes
                qt_qmake_version=`"$test_bin" -v | sed q | sed 'address@hidden 
@@'`
qt_version=`"$test_bin" -v | sed '$!d' | sed 'address@hidden @@' | sed 's@ in.*@@'`
                #echo "$qt_qmake_version ($qt_version)"
        fi
        
])

AC_DEFUN([_QT_ISVALID_MOC], [
        $1=no

        test_bin="$2"
        #echo Trying: "$test_bin"
if test x`"$test_bin" -v 2>&1 | sed -n '/Qt Meta Object Compiler/p' | sed -n '$=' ` == x"1"; then
                #echo "Debug: Found something that looks like a valid Qt moc 
exe"
                $1=yes
                qt_moc_version=`"$test_bin" -v 2>&1 | sed q | sed 
'address@hidden @@'`
                #echo "$qt_moc_version ($qt_version)"
        fi
        
])

AC_DEFUN([_QT_ISVALID_UIC], [
        $1=no

        test_bin="$2"
        #echo Trying: "$test_bin"
if test x`"$test_bin" -v 2>&1 | sed -n '/Qt User Interface Compiler/ p' | sed -n '$=' ` == x"1"; then
                #echo "Debug: Found something that looks like a valid Qt uic 
exe"
                $1=yes
                qt_uic_version=`"$test_bin" -v 2>&1 | sed q | sed 
'address@hidden @@'`
                #echo "$qt_uic_version ($qt_version)"
        fi
        
])
--- EOF

Regards,
Yvan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]