aclocal.m4

changeset 1
d64aaa7d146f
child 3
c1941114ca88
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/aclocal.m4	Fri Nov 28 11:21:08 2008 +0100
     1.3 @@ -0,0 +1,657 @@
     1.4 +##
     1.5 +##  OSSP asgui - Accounting system graphical user interface
     1.6 +##  Copyright (c) 2002-2004 The OSSP Project (http://www.ossp.org/)
     1.7 +##  Copyright (c) 2002-2004 Ralf S. Engelschall <rse@engelschall.com>
     1.8 +##  Copyright (c) 2002-2004 Michael Schloh von Bennewitz <michael@schloh.com>
     1.9 +##  Copyright (c) 2002-2004 Cable & Wireless Telecommunications Services GmbH
    1.10 +##
    1.11 +##  This file is part of OSSP GUI, a graphical user interface
    1.12 +##  for OSSP which can be found at http://www.ossp.org/
    1.13 +##
    1.14 +##  Permission to use, copy, modify, and distribute this software for
    1.15 +##  any purpose with or without fee is hereby granted, provided that
    1.16 +##  the above copyright notice and this permission notice appear in all
    1.17 +##  copies.
    1.18 +##
    1.19 +##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    1.20 +##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
    1.21 +##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
    1.22 +##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
    1.23 +##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    1.24 +##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    1.25 +##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    1.26 +##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    1.27 +##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    1.28 +##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    1.29 +##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    1.30 +##  SUCH DAMAGE.
    1.31 +##
    1.32 +##  aclocal.m4: Autoconf M4 macros
    1.33 +##
    1.34 +
    1.35 +
    1.36 +dnl ##
    1.37 +dnl ##  Look for SIOCGIFHWADDR
    1.38 +dnl ##
    1.39 +
    1.40 +AC_DEFUN(AC_CHECK_SIOCGIFHWADDR,[
    1.41 +AC_MSG_CHECKING(whether <sys/ioctl.h> has SIOCGIFHWADDR)
    1.42 +AC_TRY_COMPILE([#include <sys/sockio.h>
    1.43 +#include <sys/ioctl.h>
    1.44 +], [
    1.45 +  int i = SIOCGIFHWADDR;
    1.46 +  return 0;],
    1.47 +    AC_DEFINE(HAVE_SIOCGIFHWADDR, 1, [Define to 1 if <sys/ioctl.h> defines or includes SIOCGIFHWADDR.]),
    1.48 +    AC_MSG_RESULT([no]),
    1.49 +    AC_MSG_RESULT([yes]))
    1.50 +])dnl
    1.51 +
    1.52 +
    1.53 +dnl ##
    1.54 +dnl ##  Look for SIOCGIFCONF
    1.55 +dnl ##
    1.56 +
    1.57 +AC_DEFUN(AC_CHECK_SIOCGIFCONF,[
    1.58 +AC_MSG_CHECKING(whether <sys/ioctl.h> has SIOCGIFCONF)
    1.59 +AC_TRY_COMPILE([#include <sys/sockio.h>
    1.60 +#include <sys/ioctl.h>
    1.61 +], [
    1.62 +  int i = SIOCGIFCONF;
    1.63 +  return 0;],
    1.64 +    AC_DEFINE(HAVE_SIOCGIFCONF, 1, [Define to 1 if <sys/ioctl.h> defines or includes SIOCGIFCONF.]),
    1.65 +    AC_MSG_RESULT([no]),
    1.66 +    AC_MSG_RESULT([yes]))
    1.67 +])dnl
    1.68 +
    1.69 +
    1.70 +dnl ##
    1.71 +dnl ##  Look for SIOGHWADDR
    1.72 +dnl ##
    1.73 +
    1.74 +AC_DEFUN(AC_CHECK_SIOGHWADDR,[
    1.75 +AC_MSG_CHECKING(whether <sys/ioctl.h> has SIOGHWADDR)
    1.76 +AC_TRY_COMPILE([#include <sys/sockio.h>
    1.77 +#include <sys/ioctl.h>
    1.78 +], [
    1.79 +  int i = SIOGHWADDR;
    1.80 +  return 0;],
    1.81 +    AC_DEFINE(HAVE_SIOGHWADDR, 1, [Define to 1 if <sys/ioctl.h> defines or includes SIOGHWADDR.]),
    1.82 +    AC_MSG_RESULT([no]),
    1.83 +    AC_MSG_RESULT([yes]))
    1.84 +])dnl
    1.85 +
    1.86 +
    1.87 +dnl ##
    1.88 +dnl ##  Look for SIOCGENADDR
    1.89 +dnl ##
    1.90 +
    1.91 +AC_DEFUN(AC_CHECK_SIOCGENADDR,[
    1.92 +AC_MSG_CHECKING(whether <sys/ioctl.h> has SIOCGENADDR)
    1.93 +AC_TRY_COMPILE([#include <sys/sockio.h>
    1.94 +#include <sys/ioctl.h>
    1.95 +], [
    1.96 +  int i = SIOCGENADDR;
    1.97 +  return 0;],
    1.98 +    AC_DEFINE(HAVE_SIOCGENADDR, 1, [Define to 1 if <sys/ioctl.h> defines or includes SIOCGENADDR.]),
    1.99 +    AC_MSG_RESULT([no]),
   1.100 +    AC_MSG_RESULT([yes]))
   1.101 +])dnl
   1.102 +
   1.103 +
   1.104 +dnl ##
   1.105 +dnl ##  Check for sa_len member of the sockaddr
   1.106 +dnl ##  structure found in BSD systems
   1.107 +dnl ##
   1.108 +dnl ##  configure.in:
   1.109 +dnl ##    AC_STRUCT_SA_LEN
   1.110 +dnl ##
   1.111 +
   1.112 +AC_DEFUN(AC_STRUCT_SA_LEN,
   1.113 +[AC_CACHE_CHECK([for sa_len in struct sockaddr], ac_cv_struct_sa_len,
   1.114 +[AC_TRY_COMPILE([
   1.115 +    #include <sys/types.h>
   1.116 +    #include <sys/socket.h>
   1.117 +],
   1.118 +[
   1.119 +    struct sockaddr s;
   1.120 +    s.sa_len;
   1.121 +],
   1.122 +ac_cv_struct_sa_len=yes, ac_cv_struct_sa_len=no)])
   1.123 +if test $ac_cv_struct_sa_len = yes; then
   1.124 +AC_DEFINE(HAVE_SA_LEN, 1, [Define to 1 if your sockaddr has a sa_len member.])
   1.125 +fi
   1.126 +])
   1.127 +
   1.128 +
   1.129 +dnl ##
   1.130 +dnl ##  Support for Platform IDs
   1.131 +dnl ##
   1.132 +dnl ##  configure.in:
   1.133 +dnl ##    AC_PLATFORM(<variable>)
   1.134 +dnl ##
   1.135 +
   1.136 +AC_DEFUN(AC_PLATFORM,[
   1.137 +if test ".$host" != .NONE && test ".$host" != .; then
   1.138 +    $1="$host"
   1.139 +else
   1.140 +    $1=`${CONFIG_SHELL-/bin/sh} $srcdir/config.guess`
   1.141 +fi
   1.142 +$1=`${CONFIG_SHELL-/bin/sh} $srcdir/config.sub $$1` || exit 1
   1.143 +AC_SUBST($1)
   1.144 +if test ".$enable_subdir" != .yes; then
   1.145 +    echo "Platform: ${TB}${$1}${TN}"
   1.146 +fi
   1.147 +])dnl
   1.148 +
   1.149 +
   1.150 +dnl ##
   1.151 +dnl ##  Support for Configuration Headers
   1.152 +dnl ##
   1.153 +dnl ##  configure.in:
   1.154 +dnl ##    AC_HEADLINE(<short-name>, <long-name>,
   1.155 +dnl ##                <vers-var>, <vers-file>,
   1.156 +dnl ##                <copyright>)
   1.157 +dnl ##
   1.158 +
   1.159 +AC_DEFUN(AC_HEADLINE,[dnl
   1.160 +#   configuration header
   1.161 +if test ".`echo dummy [$]@ | grep help`" = .; then
   1.162 +    #   bootstrapping shtool
   1.163 +    ac_prog=[$]0
   1.164 +changequote(, )dnl
   1.165 +    ac_srcdir=`echo $ac_prog | sed -e 's%/[^/][^/]*$%%' -e 's%\([^/]\)/*$%\1%'`
   1.166 +changequote([, ])dnl
   1.167 +    test ".$ac_srcdir" = ".$ac_prog" && ac_srcdir=.
   1.168 +    ac_shtool="$ac_srcdir/shtool"
   1.169 +
   1.170 +    #   find out terminal sequences
   1.171 +    TB=`$ac_shtool echo -n -e %B 2>/dev/null`
   1.172 +    TN=`$ac_shtool echo -n -e %b 2>/dev/null`
   1.173 +
   1.174 +    #   find out package version
   1.175 +    $3_STR="`$ac_shtool version -l c -d long $ac_srcdir/$4`"
   1.176 +    AC_SUBST($3_STR)
   1.177 +
   1.178 +    #   friendly header ;)
   1.179 +    if test ".$enable_headline" != .no; then
   1.180 +        echo "Configuring ${TB}$1${TN} ($2), Version ${TB}${$3_STR}${TN}"
   1.181 +        echo "$5"
   1.182 +    fi
   1.183 +
   1.184 +    #   additionally find out hex version
   1.185 +    $3_HEX="`$ac_shtool version -l c -d hex $ac_srcdir/$4`"
   1.186 +    AC_SUBST($3_HEX)
   1.187 +fi
   1.188 +])dnl
   1.189 +
   1.190 +
   1.191 +dnl ##
   1.192 +dnl ##  Check whether compiler option works
   1.193 +dnl ##
   1.194 +dnl ##  configure.in:
   1.195 +dnl ##    AC_COMPILER_OPTION(<name>, <display>, <option>,
   1.196 +dnl ##                       <action-success>, <action-failure>)
   1.197 +dnl ##
   1.198 +
   1.199 +AC_DEFUN(AC_COMPILER_OPTION,[dnl
   1.200 +AC_MSG_CHECKING(whether compiler option(s) $2 work)
   1.201 +AC_CACHE_VAL(ac_cv_compiler_option_$1,[
   1.202 +SAVE_CXXFLAGS="$CXXFLAGS"
   1.203 +CXXFLAGS="$CXXFLAGS $3"
   1.204 +AC_LANG(C++)
   1.205 +AC_TRY_COMPILE([],[], ac_cv_compiler_option_$1=yes, ac_cv_compiler_option_$1=no)
   1.206 +CXXFLAGS="$SAVE_CXXFLAGS"
   1.207 +])dnl
   1.208 +if test ".$ac_cv_compiler_option_$1" = .yes; then
   1.209 +    ifelse([$4], , :, [$4])
   1.210 +else
   1.211 +    ifelse([$5], , :, [$5])
   1.212 +fi
   1.213 +AC_MSG_RESULT([$ac_cv_compiler_option_$1])
   1.214 +])dnl
   1.215 +
   1.216 +
   1.217 +dnl ##
   1.218 +dnl ##  Test for the presence of the MICO ORB
   1.219 +dnl ##
   1.220 +dnl ##  configure.in:
   1.221 +dnl ##    AC_TEST_MICO
   1.222 +dnl ##
   1.223 +
   1.224 +AC_DEFUN(AC_TEST_MICO,[dnl
   1.225 +AC_ARG_WITH(mico,dnl
   1.226 +[  --with-mico=[DIR]    prefix where MICO is installed], micodir=$withval,)
   1.227 +if test $micodir; then
   1.228 +AC_MSG_CHECKING(the MICO installation path)
   1.229 +
   1.230 +dnl ## Ensure that we have a basic path to start searching
   1.231 +if test -x "$micodir";
   1.232 +then
   1.233 +    CORBABASE=$micodir
   1.234 +    AC_MSG_RESULT(${CORBABASE})
   1.235 +elif test -x "${MICODIR}";
   1.236 +then
   1.237 +    CORBABASE="${MICODIR}"
   1.238 +    AC_MSG_RESULT(${CORBABASE})
   1.239 +else
   1.240 +    AC_MSG_RESULT(not found)
   1.241 +    AC_MSG_ERROR([Neither \$MICODIR nor --with-mico=[DIR] paths exist])
   1.242 +fi
   1.243 +
   1.244 +dnl ## Append paths of libs and headers
   1.245 +LIBS="$LIBS -lmico -lmicocoss -lssl -lcrypto"
   1.246 +LDFLAGS="$LDFLAGS -L${CORBABASE}/lib"
   1.247 +CPPFLAGS="$CPPFLAGS -I${CORBABASE}/include"
   1.248 +CXXCPP="$CXXCPP -I${CORBABASE}/include"
   1.249 +CXXFLAGS="$CXXFLAGS"
   1.250 +AC_DEFINE(HAVE_MICO, 1, [Define to 1 if building with the MICO ORB.])
   1.251 +fi
   1.252 +])
   1.253 +
   1.254 +
   1.255 +dnl ##
   1.256 +dnl ##  Test for the presence of EasySOAP
   1.257 +dnl ##
   1.258 +dnl ##  configure.in:
   1.259 +dnl ##    AC_TEST_ESOAP
   1.260 +dnl ##
   1.261 +
   1.262 +AC_DEFUN(AC_TEST_ESOAP,[dnl
   1.263 +AC_ARG_WITH(esoap,dnl
   1.264 +[  --with-easysoap=[DIR]    prefix where EasySOAP is installed], esoapdir=$withval,)
   1.265 +if test $esoapdir; then
   1.266 +AC_MSG_CHECKING(the EasySOAP installation path)
   1.267 +
   1.268 +dnl ## Ensure that we have a basic path to start searching
   1.269 +if test -x "$esoapdir";
   1.270 +then
   1.271 +    SOAPBASE=$esoapdir
   1.272 +    AC_MSG_RESULT(${SOAPBASE})
   1.273 +elif test -x "${ESOAPDIR}";
   1.274 +then
   1.275 +    SOAPBASE="${ESOAPDIR}"
   1.276 +    AC_MSG_RESULT(${SOAPBASE})
   1.277 +else
   1.278 +    AC_MSG_RESULT(not found)
   1.279 +    AC_MSG_ERROR([Neither \$ESOAPDIR nor --with-easysoap=[DIR] paths exist])
   1.280 +fi
   1.281 +
   1.282 +dnl ## Append paths of libs and headers
   1.283 +LIBS="$LIBS -leasysoap -lexpat -lssl -lcrypto"
   1.284 +LDFLAGS="$LDFLAGS -L${SOAPBASE}/lib"
   1.285 +CPPFLAGS="$CPPFLAGS -I${SOAPBASE}/include"
   1.286 +CXXCPP="$CXXCPP -I${SOAPBASE}/include"
   1.287 +CXXFLAGS="$CXXFLAGS"
   1.288 +AC_DEFINE(HAVE_ESOAP, 1, [Define to 1 if building with EasySOAP.])
   1.289 +fi
   1.290 +])
   1.291 +
   1.292 +
   1.293 +dnl ##
   1.294 +dnl ##  Check the Qt implementation path
   1.295 +dnl ##
   1.296 +dnl ##  configure.in:
   1.297 +dnl ##    AC_CHECK_QT
   1.298 +dnl ##
   1.299 +
   1.300 +AC_DEFUN(AC_CHECK_QT,[dnl
   1.301 +AC_ARG_WITH(qt,dnl
   1.302 +[  --with-qt=[DIR]    prefix where Qt is installed], qtdir=$withval,)
   1.303 +AC_MSG_CHECKING(the Qt installation path)
   1.304 +
   1.305 +dnl ## Ensure that we have a basic path to start searching
   1.306 +if test -x "$qtdir";
   1.307 +then
   1.308 +    QTBASE=$qtdir
   1.309 +    AC_MSG_RESULT(${QTBASE})
   1.310 +elif test -x "${QTDIR}";
   1.311 +then
   1.312 +    QTBASE="${QTDIR}"
   1.313 +    AC_MSG_RESULT(${QTBASE})
   1.314 +else
   1.315 +    AC_MSG_RESULT(not found)
   1.316 +    AC_MSG_ERROR([Neither \$QTDIR nor --with-qt=[DIR] paths exist])
   1.317 +fi
   1.318 +
   1.319 +dnl ## Now search for libs and headers
   1.320 +changequote(, )dnl
   1.321 +for file in x `find $QTBASE/include -name "qapplication.h" -print`; do
   1.322 +    test .$file = .x && continue
   1.323 +    c_dir=`echo $file | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'`
   1.324 +done
   1.325 +
   1.326 +dnl ## Scan to find out which Qt library to link against
   1.327 +dnl ## FIXME Merge static and dynamic library search blocks
   1.328 +dnl ## FIXME Remove this qt-mt check and do --enable-threads instead
   1.329 +for file in x `find $QTBASE/lib -name "libqt.so" -print`; do
   1.330 +    test .$file = .x && continue
   1.331 +    l_dir=`echo $file | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'`
   1.332 +    lib=`echo $file | sed -e 's;^.*/\(.*\)$;\1;' -e 's;lib\(.*\)\.so;\1;'`
   1.333 +done
   1.334 +
   1.335 +dnl ## If we have a multithreaded shared library, then it's better
   1.336 +for file in x `find $QTBASE/lib -name "libqt-mt.so" -print`; do
   1.337 +    test .$file = .x && continue
   1.338 +    l_dir=`echo $file | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'`
   1.339 +    lib=`echo $file | sed -e 's;^.*/\(.*\)$;\1;' -e 's;lib\(.*\)\.so;\1;'`
   1.340 +done
   1.341 +
   1.342 +dnl ## If we have static libraries, then prefer to use those
   1.343 +for file in x `find $QTBASE/lib -name "libqt.a" -print`; do
   1.344 +    test .$file = .x && continue
   1.345 +    l_dir=`echo $file | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'`
   1.346 +    lib=`echo $file | sed -e 's;^.*/\(.*\)$;\1;' -e 's;lib\(.*\)\.a;\1;'`
   1.347 +done
   1.348 +
   1.349 +dnl ## But the static multithreaded library is preferred above all
   1.350 +for file in x `find $QTBASE/lib -name "libqt-mt.a" -print`; do
   1.351 +    test .$file = .x && continue
   1.352 +    l_dir=`echo $file | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'`
   1.353 +    lib=`echo $file | sed -e 's;^.*/\(.*\)$;\1;' -e 's;lib\(.*\)\.a;\1;'`
   1.354 +done
   1.355 +changequote([, ])dnl
   1.356 +
   1.357 +dnl ## Append paths of libs and headers
   1.358 +if test ".$lib" != .; then
   1.359 +    LIBS="$LIBS -l$lib"
   1.360 +fi
   1.361 +LDFLAGS="$LDFLAGS -L$l_dir"
   1.362 +CPPFLAGS="$CPPFLAGS -DQT_THREAD_SUPPORT"
   1.363 +CXXCPP="$CXXCPP -DQT_THREAD_SUPPORT"
   1.364 +CXXFLAGS="$CXXFLAGS -I$c_dir"
   1.365 +])
   1.366 +
   1.367 +
   1.368 +dnl ##
   1.369 +dnl ##  UIC check, should come after the Qt check
   1.370 +dnl ##
   1.371 +dnl ##  configure.in:
   1.372 +dnl ##    AC_CHECK_UIC
   1.373 +dnl ##
   1.374 +
   1.375 +AC_DEFUN(AC_CHECK_UIC,[dnl
   1.376 +AC_MSG_CHECKING(UIC location)
   1.377 +if test -x ${QTBASE}/bin/uic
   1.378 +then
   1.379 +    UIC=${QTBASE}/bin/uic
   1.380 +    AC_MSG_RESULT(${QTBASE}/bin/uic)
   1.381 +else
   1.382 +    UIC=uic
   1.383 +    AC_MSG_RESULT(assumed present)
   1.384 +fi
   1.385 +])
   1.386 +
   1.387 +
   1.388 +dnl ##
   1.389 +dnl ##  MOC check, should come after the Qt check
   1.390 +dnl ##
   1.391 +dnl ##  configure.in:
   1.392 +dnl ##    AC_CHECK_MOC
   1.393 +dnl ##
   1.394 +
   1.395 +AC_DEFUN(AC_CHECK_MOC,[dnl
   1.396 +AC_MSG_CHECKING(MOC location)
   1.397 +if test -x ${QTBASE}/bin/moc
   1.398 +then
   1.399 +    MOC=${QTBASE}/bin/moc
   1.400 +    AC_MSG_RESULT(${QTBASE}/bin/moc)
   1.401 +else
   1.402 +    MOC=moc
   1.403 +    AC_MSG_RESULT(assumed present)
   1.404 +fi
   1.405 +])
   1.406 +
   1.407 +
   1.408 +dnl ##  PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not)
   1.409 +dnl ##  defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page
   1.410 +dnl ##  also defines GSTUFF_PKG_ERRORS on error
   1.411 +AC_DEFUN(PKG_CHECK_MODULES, [
   1.412 +  succeeded=no
   1.413 +
   1.414 +  if test -z "$PKG_CONFIG"; then
   1.415 +    AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
   1.416 +  fi
   1.417 +
   1.418 +  if test "$PKG_CONFIG" = "no" ; then
   1.419 +     echo "*** The pkg-config script could not be found. Make sure it is"
   1.420 +     echo "*** in your path, or set the PKG_CONFIG environment variable"
   1.421 +     echo "*** to the full path to pkg-config."
   1.422 +     echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
   1.423 +  else
   1.424 +     PKG_CONFIG_MIN_VERSION=0.9.0
   1.425 +     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
   1.426 +        AC_MSG_CHECKING(for $2)
   1.427 +
   1.428 +        if $PKG_CONFIG --exists "$2" ; then
   1.429 +            AC_MSG_RESULT(yes)
   1.430 +            succeeded=yes
   1.431 +
   1.432 +            AC_MSG_CHECKING($1_CFLAGS)
   1.433 +            $1_CFLAGS=`$PKG_CONFIG --cflags "$2"`
   1.434 +            AC_MSG_RESULT($$1_CFLAGS)
   1.435 +
   1.436 +            AC_MSG_CHECKING($1_LIBS)
   1.437 +            $1_LIBS=`$PKG_CONFIG --libs "$2"`
   1.438 +            AC_MSG_RESULT($$1_LIBS)
   1.439 +        else
   1.440 +            $1_CFLAGS=""
   1.441 +            $1_LIBS=""
   1.442 +            ## If we have a custom action on failure, don't print errors, but 
   1.443 +            ## do set a variable so people can do so.
   1.444 +            $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
   1.445 +            ifelse([$4], ,echo $$1_PKG_ERRORS,)
   1.446 +        fi
   1.447 +
   1.448 +        AC_SUBST($1_CFLAGS)
   1.449 +        AC_SUBST($1_LIBS)
   1.450 +     else
   1.451 +        echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
   1.452 +        echo "*** See http://www.freedesktop.org/software/pkgconfig"
   1.453 +     fi
   1.454 +  fi
   1.455 +
   1.456 +  if test $succeeded = yes; then
   1.457 +     ifelse([$3], , :, [$3])
   1.458 +  else
   1.459 +     ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4])
   1.460 +  fi
   1.461 +])
   1.462 +
   1.463 +
   1.464 +dnl ##
   1.465 +dnl ##  Debugging Support
   1.466 +dnl ##
   1.467 +dnl ##  configure.in:
   1.468 +dnl ##    AC_CHECK_DEBUGGING
   1.469 +dnl ##
   1.470 +
   1.471 +AC_DEFUN(AC_CHECK_DEBUGGING,[dnl
   1.472 +AC_ARG_ENABLE(debug,dnl
   1.473 +[  --enable-debug          build for debugging (default=no)],
   1.474 +[dnl
   1.475 +if test ".$ac_cv_prog_gcc" = ".yes"; then
   1.476 +    case "$CXXFLAGS" in
   1.477 +        *-O* ) ;;
   1.478 +           * ) CXXFLAGS="$CXXFLAGS -O2" ;;
   1.479 +    esac
   1.480 +    case "$CXXFLAGS" in
   1.481 +        *-g* ) ;;
   1.482 +           * ) CXXFLAGS="$CXXFLAGS -g" ;;
   1.483 +    esac
   1.484 +    case "$CXXFLAGS" in
   1.485 +        *-pipe* ) ;;
   1.486 +              * ) AC_COMPILER_OPTION(pipe, -pipe, -pipe, CXXFLAGS="$CXXFLAGS -pipe") ;;
   1.487 +    esac
   1.488 +    AC_COMPILER_OPTION(defdbg, -DDEBUG, -DDEBUG, CXXFLAGS="$CXXFLAGS -DDEBUG")
   1.489 +dnl    AC_COMPILER_OPTION(ggdb3, -ggdb3, -ggdb3, CXXFLAGS="$CXXFLAGS -ggdb3")
   1.490 +    CXXFLAGS="$CXXFLAGS -pedantic"
   1.491 +    CXXFLAGS="$CXXFLAGS -Wall"
   1.492 +    WMORE="-Wshadow -Wpointer-arith -Wcast-align -Winline"
   1.493 +    WMORE="$WMORE -Wmissing-prototypes -Wmissing-declarations -Wnested-externs"
   1.494 +    AC_COMPILER_OPTION(wmore, -W<xxx>, $WMORE, CXXFLAGS="$CXXFLAGS $WMORE")
   1.495 +    AC_COMPILER_OPTION(wnolonglong, -Wno-long-long, -Wno-long-long, CXXFLAGS="$CXXFLAGS -Wno-long-long")
   1.496 +else
   1.497 +    case "$CXXFLAGS" in
   1.498 +        *-g* ) ;;
   1.499 +           * ) CXXFLAGS="$CXXFLAGS -g" ;;
   1.500 +    esac
   1.501 +fi
   1.502 +msg="enabled"
   1.503 +dnl AC_DEFINE(DEBUG, 1, [Define to 1 if you want to enable debugging])
   1.504 +],[
   1.505 +if test ".$ac_cv_prog_gcc" = ".yes"; then
   1.506 +case "$CXXFLAGS" in
   1.507 +    *-pipe* ) ;;
   1.508 +          * ) AC_COMPILER_OPTION(pipe, -pipe, -pipe, CXXFLAGS="$CXXFLAGS -pipe") ;;
   1.509 +esac
   1.510 +fi
   1.511 +case "$CXXFLAGS" in
   1.512 +    *-g* ) CXXFLAGS=`echo "$CXXFLAGS" |\
   1.513 +                   sed -e 's/ -g / /g' -e 's/ -g$//' -e 's/^-g //g' -e 's/^-g$//'` ;;
   1.514 +esac
   1.515 +case "$CXXFLAGS" in
   1.516 +    *-g* ) CXXFLAGS=`echo "$CXXFLAGS" |\
   1.517 +                     sed -e 's/ -g / /g' -e 's/ -g$//' -e 's/^-g //g' -e 's/^-g$//'` ;;
   1.518 +esac
   1.519 +
   1.520 +CXXFLAGS="$CXXFLAGS -DQT_NO_DEBUG"
   1.521 +msg=disabled
   1.522 +])dnl
   1.523 +AC_MSG_CHECKING(for compilation debug mode)
   1.524 +AC_MSG_RESULT([$msg])
   1.525 +if test ".$msg" = .enabled; then
   1.526 +    enable_shared=no
   1.527 +fi
   1.528 +])
   1.529 +
   1.530 +define(AC_IFALLYES,[dnl
   1.531 +ac_rc=yes
   1.532 +for ac_spec in $1; do
   1.533 +    ac_type=`echo "$ac_spec" | sed -e 's/:.*$//'`
   1.534 +    ac_item=`echo "$ac_spec" | sed -e 's/^.*://'`
   1.535 +    case $ac_type in
   1.536 +        header [)]
   1.537 +            ac_item=`echo "$ac_item" | sed 'y%./+-%__p_%'`
   1.538 +            ac_var="ac_cv_header_$ac_item"
   1.539 +            ;;
   1.540 +        file [)]
   1.541 +            ac_item=`echo "$ac_item" | sed 'y%./+-%__p_%'`
   1.542 +            ac_var="ac_cv_file_$ac_item"
   1.543 +            ;;
   1.544 +        func    [)] ac_var="ac_cv_func_$ac_item"   ;;
   1.545 +        lib     [)] ac_var="ac_cv_lib_$ac_item"    ;;
   1.546 +        define  [)] ac_var="ac_cv_define_$ac_item" ;;
   1.547 +        typedef [)] ac_var="ac_cv_typedef_$ac_item" ;;
   1.548 +        custom  [)] ac_var="$ac_item" ;;
   1.549 +    esac
   1.550 +    eval "ac_val=\$$ac_var"
   1.551 +    if test ".$ac_val" != .yes; then
   1.552 +        ac_rc=no
   1.553 +        break
   1.554 +    fi
   1.555 +done
   1.556 +if test ".$ac_rc" = .yes; then
   1.557 +    :
   1.558 +    $2
   1.559 +else
   1.560 +    :
   1.561 +    $3
   1.562 +fi
   1.563 +])
   1.564 +
   1.565 +
   1.566 +dnl ##
   1.567 +dnl ##  Check for an external/extension library.
   1.568 +dnl ##  - is aware of <libname>-config style scripts
   1.569 +dnl ##  - searches under standard paths include, lib, etc.
   1.570 +dnl ##  - searches under subareas like .libs, etc.
   1.571 +dnl ##
   1.572 +dnl ##  configure.in:
   1.573 +dnl ##      AC_CHECK_EXTLIB(<realname>, <libname>, <func>, <header>,
   1.574 +dnl ##                      [<success-action> [, <fail-action>]])
   1.575 +dnl ##  Makefile.in:
   1.576 +dnl ##      CFLAGS  = @CFLAGS@
   1.577 +dnl ##      LDFLAGS = @LDFLAGS@
   1.578 +dnl ##      LIBS    = @LIBS@
   1.579 +dnl ##  shell:
   1.580 +dnl ##      $ ./configure --with-<libname>[=DIR]
   1.581 +dnl ##
   1.582 +
   1.583 +AC_DEFUN(AC_CHECK_EXTLIB,[dnl
   1.584 +AC_ARG_WITH($2, [dnl
   1.585 +[  --with-]m4_substr([$2[[=DIR]]                     ], 0, 19)[build with external $1 library (default=no)]], [dnl
   1.586 +    if test ".$with_$2" = .yes; then
   1.587 +        #   via config script
   1.588 +        $2_version=`($2-config --version) 2>/dev/null`
   1.589 +        if test ".$$2_version" != .; then
   1.590 +            CFLAGS="$CFLAGS `$2-config --cflags`"
   1.591 +            LDFLAGS="$LDFLAGS `$2-config --ldflags`"
   1.592 +        fi
   1.593 +    else
   1.594 +        if test -d "$with_$2"; then
   1.595 +            found=0
   1.596 +            #   via config script
   1.597 +            for dir in $with_$2/bin $with_$2; do
   1.598 +                if test -f "$dir/$2-config"; then
   1.599 +                    $2_version=`($dir/$2-config --version) 2>/dev/null`
   1.600 +                    if test ".$$2_version" != .; then
   1.601 +                        CFLAGS="$CFLAGS `$dir/$2-config --cflags`"
   1.602 +                        LDFLAGS="$LDFLAGS `$dir/$2-config --ldflags`"
   1.603 +                        found=1
   1.604 +                        break
   1.605 +                    fi
   1.606 +                fi
   1.607 +            done
   1.608 +            #   via standard paths
   1.609 +            if test ".$found" = .0; then
   1.610 +                for dir in $with_$2/include/$2 $with_$2/include $with_$2; do
   1.611 +                    if test -f "$dir/$4"; then
   1.612 +                        CFLAGS="$CFLAGS -I$dir"
   1.613 +                        found=1
   1.614 +                        break
   1.615 +                    fi
   1.616 +                done
   1.617 +                for dir in $with_$2/lib/$2 $with_$2/lib $with_$2; do
   1.618 +                    if test -f "$dir/lib$2.a" -o -f "$dir/lib$2.so"; then
   1.619 +                        LDFLAGS="$LDFLAGS -L$dir"
   1.620 +                        found=1
   1.621 +                        break
   1.622 +                    fi
   1.623 +                done
   1.624 +            fi
   1.625 +            #   in any subarea
   1.626 +            if test ".$found" = .0; then
   1.627 +changequote(, )dnl
   1.628 +                for file in x `find $with_$2 -name "$4" -type f -print`; do
   1.629 +                    test .$file = .x && continue
   1.630 +                    dir=`echo $file | sed -e 's;[[^/]]*$;;' -e 's;\(.\)/$;\1;'`
   1.631 +                    CFLAGS="$CFLAGS -I$dir"
   1.632 +                done
   1.633 +                for file in x `find $with_$2 -name "lib$2.[[aso]]" -type f -print`; do
   1.634 +                    test .$file = .x && continue
   1.635 +                    dir=`echo $file | sed -e 's;[[^/]]*$;;' -e 's;\(.\)/$;\1;'`
   1.636 +                    LDFLAGS="$LDFLAGS -L$dir"
   1.637 +                done
   1.638 +changequote([, ])dnl
   1.639 +            fi
   1.640 +        fi
   1.641 +    fi
   1.642 +    AC_HAVE_HEADERS($4)
   1.643 +    AC_CHECK_LIB($2, $3)
   1.644 +    AC_IFALLYES(header:$4 lib:$2_$3, with_$2=yes, with_$2=no)
   1.645 +    if test ".$with_$2" = .no; then
   1.646 +        AC_ERROR([Unable to find $1 library])
   1.647 +    fi
   1.648 +    ], [dnl
   1.649 +if test ".$with_$2" = .; then
   1.650 +    with_$2=no
   1.651 +fi
   1.652 +    ])dnl
   1.653 +AC_MSG_CHECKING(whether to build against external $1 library)
   1.654 +if test ".$with_$2" = .yes; then
   1.655 +    ifelse([$5], , :, [$5])
   1.656 +else
   1.657 +    ifelse([$6], , :, [$6])
   1.658 +fi
   1.659 +AC_MSG_RESULT([$with_$2])
   1.660 +])dnl

mercurial