aclocal.m4

Fri, 05 Dec 2008 23:14:02 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 05 Dec 2008 23:14:02 +0100
changeset 3
c1941114ca88
parent 1
d64aaa7d146f
child 7
751d770bb5e3
permissions
-rw-r--r--

Port to the Qt4 API and bump version pending release engineering.

michael@1 1 ##
michael@1 2 ## OSSP asgui - Accounting system graphical user interface
michael@3 3 ## Copyright (c) 2002-2008 The OSSP Project (http://www.ossp.org/)
michael@3 4 ## Copyright (c) 2002-2008 Ralf S. Engelschall <rse@engelschall.com>
michael@3 5 ## Copyright (c) 2002-2008 Michael Schloh von Bennewitz <michael@schloh.com>
michael@3 6 ## Copyright (c) 2002-2008 Cable & Wireless Telecommunications Services GmbH
michael@1 7 ##
michael@1 8 ## This file is part of OSSP GUI, a graphical user interface
michael@3 9 ## for OSSP which can be found at http://asgui.europalab.com/
michael@1 10 ##
michael@1 11 ## Permission to use, copy, modify, and distribute this software for
michael@1 12 ## any purpose with or without fee is hereby granted, provided that
michael@1 13 ## the above copyright notice and this permission notice appear in all
michael@1 14 ## copies.
michael@1 15 ##
michael@1 16 ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
michael@1 17 ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
michael@1 18 ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
michael@1 19 ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
michael@1 20 ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
michael@1 21 ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
michael@1 22 ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
michael@1 23 ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
michael@1 24 ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
michael@1 25 ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
michael@1 26 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
michael@1 27 ## SUCH DAMAGE.
michael@1 28 ##
michael@1 29 ## aclocal.m4: Autoconf M4 macros
michael@1 30 ##
michael@1 31
michael@1 32
michael@1 33 dnl ##
michael@1 34 dnl ## Look for SIOCGIFHWADDR
michael@1 35 dnl ##
michael@1 36
michael@1 37 AC_DEFUN(AC_CHECK_SIOCGIFHWADDR,[
michael@1 38 AC_MSG_CHECKING(whether <sys/ioctl.h> has SIOCGIFHWADDR)
michael@1 39 AC_TRY_COMPILE([#include <sys/sockio.h>
michael@1 40 #include <sys/ioctl.h>
michael@1 41 ], [
michael@1 42 int i = SIOCGIFHWADDR;
michael@1 43 return 0;],
michael@1 44 AC_DEFINE(HAVE_SIOCGIFHWADDR, 1, [Define to 1 if <sys/ioctl.h> defines or includes SIOCGIFHWADDR.]),
michael@1 45 AC_MSG_RESULT([no]),
michael@1 46 AC_MSG_RESULT([yes]))
michael@1 47 ])dnl
michael@1 48
michael@1 49
michael@1 50 dnl ##
michael@1 51 dnl ## Look for SIOCGIFCONF
michael@1 52 dnl ##
michael@1 53
michael@1 54 AC_DEFUN(AC_CHECK_SIOCGIFCONF,[
michael@1 55 AC_MSG_CHECKING(whether <sys/ioctl.h> has SIOCGIFCONF)
michael@1 56 AC_TRY_COMPILE([#include <sys/sockio.h>
michael@1 57 #include <sys/ioctl.h>
michael@1 58 ], [
michael@1 59 int i = SIOCGIFCONF;
michael@1 60 return 0;],
michael@1 61 AC_DEFINE(HAVE_SIOCGIFCONF, 1, [Define to 1 if <sys/ioctl.h> defines or includes SIOCGIFCONF.]),
michael@1 62 AC_MSG_RESULT([no]),
michael@1 63 AC_MSG_RESULT([yes]))
michael@1 64 ])dnl
michael@1 65
michael@1 66
michael@1 67 dnl ##
michael@1 68 dnl ## Look for SIOGHWADDR
michael@1 69 dnl ##
michael@1 70
michael@1 71 AC_DEFUN(AC_CHECK_SIOGHWADDR,[
michael@1 72 AC_MSG_CHECKING(whether <sys/ioctl.h> has SIOGHWADDR)
michael@1 73 AC_TRY_COMPILE([#include <sys/sockio.h>
michael@1 74 #include <sys/ioctl.h>
michael@1 75 ], [
michael@1 76 int i = SIOGHWADDR;
michael@1 77 return 0;],
michael@1 78 AC_DEFINE(HAVE_SIOGHWADDR, 1, [Define to 1 if <sys/ioctl.h> defines or includes SIOGHWADDR.]),
michael@1 79 AC_MSG_RESULT([no]),
michael@1 80 AC_MSG_RESULT([yes]))
michael@1 81 ])dnl
michael@1 82
michael@1 83
michael@1 84 dnl ##
michael@1 85 dnl ## Look for SIOCGENADDR
michael@1 86 dnl ##
michael@1 87
michael@1 88 AC_DEFUN(AC_CHECK_SIOCGENADDR,[
michael@1 89 AC_MSG_CHECKING(whether <sys/ioctl.h> has SIOCGENADDR)
michael@1 90 AC_TRY_COMPILE([#include <sys/sockio.h>
michael@1 91 #include <sys/ioctl.h>
michael@1 92 ], [
michael@1 93 int i = SIOCGENADDR;
michael@1 94 return 0;],
michael@1 95 AC_DEFINE(HAVE_SIOCGENADDR, 1, [Define to 1 if <sys/ioctl.h> defines or includes SIOCGENADDR.]),
michael@1 96 AC_MSG_RESULT([no]),
michael@1 97 AC_MSG_RESULT([yes]))
michael@1 98 ])dnl
michael@1 99
michael@1 100
michael@1 101 dnl ##
michael@1 102 dnl ## Check for sa_len member of the sockaddr
michael@1 103 dnl ## structure found in BSD systems
michael@1 104 dnl ##
michael@1 105 dnl ## configure.in:
michael@1 106 dnl ## AC_STRUCT_SA_LEN
michael@1 107 dnl ##
michael@1 108
michael@1 109 AC_DEFUN(AC_STRUCT_SA_LEN,
michael@1 110 [AC_CACHE_CHECK([for sa_len in struct sockaddr], ac_cv_struct_sa_len,
michael@1 111 [AC_TRY_COMPILE([
michael@1 112 #include <sys/types.h>
michael@1 113 #include <sys/socket.h>
michael@1 114 ],
michael@1 115 [
michael@1 116 struct sockaddr s;
michael@1 117 s.sa_len;
michael@1 118 ],
michael@1 119 ac_cv_struct_sa_len=yes, ac_cv_struct_sa_len=no)])
michael@1 120 if test $ac_cv_struct_sa_len = yes; then
michael@1 121 AC_DEFINE(HAVE_SA_LEN, 1, [Define to 1 if your sockaddr has a sa_len member.])
michael@1 122 fi
michael@1 123 ])
michael@1 124
michael@1 125
michael@1 126 dnl ##
michael@1 127 dnl ## Support for Platform IDs
michael@1 128 dnl ##
michael@1 129 dnl ## configure.in:
michael@1 130 dnl ## AC_PLATFORM(<variable>)
michael@1 131 dnl ##
michael@1 132
michael@1 133 AC_DEFUN(AC_PLATFORM,[
michael@1 134 if test ".$host" != .NONE && test ".$host" != .; then
michael@1 135 $1="$host"
michael@1 136 else
michael@1 137 $1=`${CONFIG_SHELL-/bin/sh} $srcdir/config.guess`
michael@1 138 fi
michael@1 139 $1=`${CONFIG_SHELL-/bin/sh} $srcdir/config.sub $$1` || exit 1
michael@1 140 AC_SUBST($1)
michael@1 141 if test ".$enable_subdir" != .yes; then
michael@1 142 echo "Platform: ${TB}${$1}${TN}"
michael@1 143 fi
michael@1 144 ])dnl
michael@1 145
michael@1 146
michael@1 147 dnl ##
michael@1 148 dnl ## Support for Configuration Headers
michael@1 149 dnl ##
michael@1 150 dnl ## configure.in:
michael@1 151 dnl ## AC_HEADLINE(<short-name>, <long-name>,
michael@1 152 dnl ## <vers-var>, <vers-file>,
michael@1 153 dnl ## <copyright>)
michael@1 154 dnl ##
michael@1 155
michael@1 156 AC_DEFUN(AC_HEADLINE,[dnl
michael@1 157 # configuration header
michael@1 158 if test ".`echo dummy [$]@ | grep help`" = .; then
michael@1 159 # bootstrapping shtool
michael@1 160 ac_prog=[$]0
michael@1 161 changequote(, )dnl
michael@1 162 ac_srcdir=`echo $ac_prog | sed -e 's%/[^/][^/]*$%%' -e 's%\([^/]\)/*$%\1%'`
michael@1 163 changequote([, ])dnl
michael@1 164 test ".$ac_srcdir" = ".$ac_prog" && ac_srcdir=.
michael@1 165 ac_shtool="$ac_srcdir/shtool"
michael@1 166
michael@1 167 # find out terminal sequences
michael@1 168 TB=`$ac_shtool echo -n -e %B 2>/dev/null`
michael@1 169 TN=`$ac_shtool echo -n -e %b 2>/dev/null`
michael@1 170
michael@1 171 # find out package version
michael@1 172 $3_STR="`$ac_shtool version -l c -d long $ac_srcdir/$4`"
michael@1 173 AC_SUBST($3_STR)
michael@1 174
michael@1 175 # friendly header ;)
michael@1 176 if test ".$enable_headline" != .no; then
michael@1 177 echo "Configuring ${TB}$1${TN} ($2), Version ${TB}${$3_STR}${TN}"
michael@1 178 echo "$5"
michael@1 179 fi
michael@1 180
michael@1 181 # additionally find out hex version
michael@1 182 $3_HEX="`$ac_shtool version -l c -d hex $ac_srcdir/$4`"
michael@1 183 AC_SUBST($3_HEX)
michael@1 184 fi
michael@1 185 ])dnl
michael@1 186
michael@1 187
michael@1 188 dnl ##
michael@1 189 dnl ## Check whether compiler option works
michael@1 190 dnl ##
michael@1 191 dnl ## configure.in:
michael@1 192 dnl ## AC_COMPILER_OPTION(<name>, <display>, <option>,
michael@1 193 dnl ## <action-success>, <action-failure>)
michael@1 194 dnl ##
michael@1 195
michael@1 196 AC_DEFUN(AC_COMPILER_OPTION,[dnl
michael@1 197 AC_MSG_CHECKING(whether compiler option(s) $2 work)
michael@1 198 AC_CACHE_VAL(ac_cv_compiler_option_$1,[
michael@1 199 SAVE_CXXFLAGS="$CXXFLAGS"
michael@1 200 CXXFLAGS="$CXXFLAGS $3"
michael@1 201 AC_LANG(C++)
michael@1 202 AC_TRY_COMPILE([],[], ac_cv_compiler_option_$1=yes, ac_cv_compiler_option_$1=no)
michael@1 203 CXXFLAGS="$SAVE_CXXFLAGS"
michael@1 204 ])dnl
michael@1 205 if test ".$ac_cv_compiler_option_$1" = .yes; then
michael@1 206 ifelse([$4], , :, [$4])
michael@1 207 else
michael@1 208 ifelse([$5], , :, [$5])
michael@1 209 fi
michael@1 210 AC_MSG_RESULT([$ac_cv_compiler_option_$1])
michael@1 211 ])dnl
michael@1 212
michael@1 213
michael@1 214 dnl ##
michael@1 215 dnl ## Test for the presence of the MICO ORB
michael@1 216 dnl ##
michael@1 217 dnl ## configure.in:
michael@1 218 dnl ## AC_TEST_MICO
michael@1 219 dnl ##
michael@1 220
michael@1 221 AC_DEFUN(AC_TEST_MICO,[dnl
michael@1 222 AC_ARG_WITH(mico,dnl
michael@1 223 [ --with-mico=[DIR] prefix where MICO is installed], micodir=$withval,)
michael@1 224 if test $micodir; then
michael@1 225 AC_MSG_CHECKING(the MICO installation path)
michael@1 226
michael@1 227 dnl ## Ensure that we have a basic path to start searching
michael@1 228 if test -x "$micodir";
michael@1 229 then
michael@1 230 CORBABASE=$micodir
michael@1 231 AC_MSG_RESULT(${CORBABASE})
michael@1 232 elif test -x "${MICODIR}";
michael@1 233 then
michael@1 234 CORBABASE="${MICODIR}"
michael@1 235 AC_MSG_RESULT(${CORBABASE})
michael@1 236 else
michael@1 237 AC_MSG_RESULT(not found)
michael@1 238 AC_MSG_ERROR([Neither \$MICODIR nor --with-mico=[DIR] paths exist])
michael@1 239 fi
michael@1 240
michael@1 241 dnl ## Append paths of libs and headers
michael@1 242 LIBS="$LIBS -lmico -lmicocoss -lssl -lcrypto"
michael@1 243 LDFLAGS="$LDFLAGS -L${CORBABASE}/lib"
michael@1 244 CPPFLAGS="$CPPFLAGS -I${CORBABASE}/include"
michael@1 245 CXXCPP="$CXXCPP -I${CORBABASE}/include"
michael@1 246 CXXFLAGS="$CXXFLAGS"
michael@1 247 AC_DEFINE(HAVE_MICO, 1, [Define to 1 if building with the MICO ORB.])
michael@1 248 fi
michael@1 249 ])
michael@1 250
michael@1 251
michael@1 252 dnl ##
michael@1 253 dnl ## Test for the presence of EasySOAP
michael@1 254 dnl ##
michael@1 255 dnl ## configure.in:
michael@1 256 dnl ## AC_TEST_ESOAP
michael@1 257 dnl ##
michael@1 258
michael@1 259 AC_DEFUN(AC_TEST_ESOAP,[dnl
michael@1 260 AC_ARG_WITH(esoap,dnl
michael@1 261 [ --with-easysoap=[DIR] prefix where EasySOAP is installed], esoapdir=$withval,)
michael@1 262 if test $esoapdir; then
michael@1 263 AC_MSG_CHECKING(the EasySOAP installation path)
michael@1 264
michael@1 265 dnl ## Ensure that we have a basic path to start searching
michael@1 266 if test -x "$esoapdir";
michael@1 267 then
michael@1 268 SOAPBASE=$esoapdir
michael@1 269 AC_MSG_RESULT(${SOAPBASE})
michael@1 270 elif test -x "${ESOAPDIR}";
michael@1 271 then
michael@1 272 SOAPBASE="${ESOAPDIR}"
michael@1 273 AC_MSG_RESULT(${SOAPBASE})
michael@1 274 else
michael@1 275 AC_MSG_RESULT(not found)
michael@1 276 AC_MSG_ERROR([Neither \$ESOAPDIR nor --with-easysoap=[DIR] paths exist])
michael@1 277 fi
michael@1 278
michael@1 279 dnl ## Append paths of libs and headers
michael@1 280 LIBS="$LIBS -leasysoap -lexpat -lssl -lcrypto"
michael@1 281 LDFLAGS="$LDFLAGS -L${SOAPBASE}/lib"
michael@1 282 CPPFLAGS="$CPPFLAGS -I${SOAPBASE}/include"
michael@1 283 CXXCPP="$CXXCPP -I${SOAPBASE}/include"
michael@1 284 CXXFLAGS="$CXXFLAGS"
michael@1 285 AC_DEFINE(HAVE_ESOAP, 1, [Define to 1 if building with EasySOAP.])
michael@1 286 fi
michael@1 287 ])
michael@1 288
michael@1 289
michael@1 290 dnl ##
michael@1 291 dnl ## Check the Qt implementation path
michael@1 292 dnl ##
michael@1 293 dnl ## configure.in:
michael@1 294 dnl ## AC_CHECK_QT
michael@1 295 dnl ##
michael@1 296
michael@1 297 AC_DEFUN(AC_CHECK_QT,[dnl
michael@1 298 AC_ARG_WITH(qt,dnl
michael@1 299 [ --with-qt=[DIR] prefix where Qt is installed], qtdir=$withval,)
michael@1 300 AC_MSG_CHECKING(the Qt installation path)
michael@1 301
michael@1 302 dnl ## Ensure that we have a basic path to start searching
michael@1 303 if test -x "$qtdir";
michael@1 304 then
michael@1 305 QTBASE=$qtdir
michael@1 306 AC_MSG_RESULT(${QTBASE})
michael@1 307 elif test -x "${QTDIR}";
michael@1 308 then
michael@1 309 QTBASE="${QTDIR}"
michael@1 310 AC_MSG_RESULT(${QTBASE})
michael@1 311 else
michael@1 312 AC_MSG_RESULT(not found)
michael@1 313 AC_MSG_ERROR([Neither \$QTDIR nor --with-qt=[DIR] paths exist])
michael@1 314 fi
michael@1 315
michael@1 316 dnl ## Append paths of libs and headers
michael@1 317 if test ".$lib" != .; then
michael@1 318 LIBS="$LIBS -l$lib"
michael@1 319 fi
michael@3 320 LDFLAGS="$LDFLAGS `$PKG_CONFIG --ldlags Qt3Support QtCore QtGui`"
michael@1 321 CPPFLAGS="$CPPFLAGS -DQT_THREAD_SUPPORT"
michael@1 322 CXXCPP="$CXXCPP -DQT_THREAD_SUPPORT"
michael@3 323 CXXFLAGS="$CXXFLAGS `$PKG_CONFIG --cflags-only-I Qt3Support QtCore QtGui`"
michael@1 324 ])
michael@1 325
michael@1 326
michael@1 327 dnl ##
michael@1 328 dnl ## UIC check, should come after the Qt check
michael@1 329 dnl ##
michael@1 330 dnl ## configure.in:
michael@1 331 dnl ## AC_CHECK_UIC
michael@1 332 dnl ##
michael@1 333
michael@1 334 AC_DEFUN(AC_CHECK_UIC,[dnl
michael@1 335 AC_MSG_CHECKING(UIC location)
michael@1 336 if test -x ${QTBASE}/bin/uic
michael@1 337 then
michael@1 338 UIC=${QTBASE}/bin/uic
michael@1 339 AC_MSG_RESULT(${QTBASE}/bin/uic)
michael@1 340 else
michael@1 341 UIC=uic
michael@1 342 AC_MSG_RESULT(assumed present)
michael@1 343 fi
michael@1 344 ])
michael@1 345
michael@1 346
michael@1 347 dnl ##
michael@1 348 dnl ## MOC check, should come after the Qt check
michael@1 349 dnl ##
michael@1 350 dnl ## configure.in:
michael@1 351 dnl ## AC_CHECK_MOC
michael@1 352 dnl ##
michael@1 353
michael@1 354 AC_DEFUN(AC_CHECK_MOC,[dnl
michael@1 355 AC_MSG_CHECKING(MOC location)
michael@1 356 if test -x ${QTBASE}/bin/moc
michael@1 357 then
michael@1 358 MOC=${QTBASE}/bin/moc
michael@1 359 AC_MSG_RESULT(${QTBASE}/bin/moc)
michael@1 360 else
michael@1 361 MOC=moc
michael@1 362 AC_MSG_RESULT(assumed present)
michael@1 363 fi
michael@1 364 ])
michael@1 365
michael@1 366
michael@1 367 dnl ## PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not)
michael@1 368 dnl ## defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page
michael@1 369 dnl ## also defines GSTUFF_PKG_ERRORS on error
michael@1 370 AC_DEFUN(PKG_CHECK_MODULES, [
michael@1 371 succeeded=no
michael@1 372
michael@1 373 if test -z "$PKG_CONFIG"; then
michael@1 374 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
michael@1 375 fi
michael@1 376
michael@1 377 if test "$PKG_CONFIG" = "no" ; then
michael@1 378 echo "*** The pkg-config script could not be found. Make sure it is"
michael@1 379 echo "*** in your path, or set the PKG_CONFIG environment variable"
michael@1 380 echo "*** to the full path to pkg-config."
michael@1 381 echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
michael@1 382 else
michael@1 383 PKG_CONFIG_MIN_VERSION=0.9.0
michael@1 384 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
michael@1 385 AC_MSG_CHECKING(for $2)
michael@1 386
michael@1 387 if $PKG_CONFIG --exists "$2" ; then
michael@1 388 AC_MSG_RESULT(yes)
michael@1 389 succeeded=yes
michael@1 390
michael@1 391 AC_MSG_CHECKING($1_CFLAGS)
michael@1 392 $1_CFLAGS=`$PKG_CONFIG --cflags "$2"`
michael@1 393 AC_MSG_RESULT($$1_CFLAGS)
michael@1 394
michael@1 395 AC_MSG_CHECKING($1_LIBS)
michael@1 396 $1_LIBS=`$PKG_CONFIG --libs "$2"`
michael@1 397 AC_MSG_RESULT($$1_LIBS)
michael@1 398 else
michael@1 399 $1_CFLAGS=""
michael@1 400 $1_LIBS=""
michael@1 401 ## If we have a custom action on failure, don't print errors, but
michael@1 402 ## do set a variable so people can do so.
michael@1 403 $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
michael@1 404 ifelse([$4], ,echo $$1_PKG_ERRORS,)
michael@1 405 fi
michael@1 406
michael@1 407 AC_SUBST($1_CFLAGS)
michael@1 408 AC_SUBST($1_LIBS)
michael@1 409 else
michael@1 410 echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
michael@1 411 echo "*** See http://www.freedesktop.org/software/pkgconfig"
michael@1 412 fi
michael@1 413 fi
michael@1 414
michael@1 415 if test $succeeded = yes; then
michael@1 416 ifelse([$3], , :, [$3])
michael@1 417 else
michael@1 418 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])
michael@1 419 fi
michael@1 420 ])
michael@1 421
michael@1 422
michael@1 423 dnl ##
michael@1 424 dnl ## Debugging Support
michael@1 425 dnl ##
michael@1 426 dnl ## configure.in:
michael@1 427 dnl ## AC_CHECK_DEBUGGING
michael@1 428 dnl ##
michael@1 429
michael@1 430 AC_DEFUN(AC_CHECK_DEBUGGING,[dnl
michael@1 431 AC_ARG_ENABLE(debug,dnl
michael@1 432 [ --enable-debug build for debugging (default=no)],
michael@1 433 [dnl
michael@1 434 if test ".$ac_cv_prog_gcc" = ".yes"; then
michael@1 435 case "$CXXFLAGS" in
michael@1 436 *-O* ) ;;
michael@1 437 * ) CXXFLAGS="$CXXFLAGS -O2" ;;
michael@1 438 esac
michael@1 439 case "$CXXFLAGS" in
michael@1 440 *-g* ) ;;
michael@1 441 * ) CXXFLAGS="$CXXFLAGS -g" ;;
michael@1 442 esac
michael@1 443 case "$CXXFLAGS" in
michael@1 444 *-pipe* ) ;;
michael@1 445 * ) AC_COMPILER_OPTION(pipe, -pipe, -pipe, CXXFLAGS="$CXXFLAGS -pipe") ;;
michael@1 446 esac
michael@1 447 AC_COMPILER_OPTION(defdbg, -DDEBUG, -DDEBUG, CXXFLAGS="$CXXFLAGS -DDEBUG")
michael@1 448 dnl AC_COMPILER_OPTION(ggdb3, -ggdb3, -ggdb3, CXXFLAGS="$CXXFLAGS -ggdb3")
michael@1 449 CXXFLAGS="$CXXFLAGS -pedantic"
michael@1 450 CXXFLAGS="$CXXFLAGS -Wall"
michael@1 451 WMORE="-Wshadow -Wpointer-arith -Wcast-align -Winline"
michael@1 452 WMORE="$WMORE -Wmissing-prototypes -Wmissing-declarations -Wnested-externs"
michael@1 453 AC_COMPILER_OPTION(wmore, -W<xxx>, $WMORE, CXXFLAGS="$CXXFLAGS $WMORE")
michael@1 454 AC_COMPILER_OPTION(wnolonglong, -Wno-long-long, -Wno-long-long, CXXFLAGS="$CXXFLAGS -Wno-long-long")
michael@1 455 else
michael@1 456 case "$CXXFLAGS" in
michael@1 457 *-g* ) ;;
michael@1 458 * ) CXXFLAGS="$CXXFLAGS -g" ;;
michael@1 459 esac
michael@1 460 fi
michael@1 461 msg="enabled"
michael@1 462 dnl AC_DEFINE(DEBUG, 1, [Define to 1 if you want to enable debugging])
michael@1 463 ],[
michael@1 464 if test ".$ac_cv_prog_gcc" = ".yes"; then
michael@1 465 case "$CXXFLAGS" in
michael@1 466 *-pipe* ) ;;
michael@1 467 * ) AC_COMPILER_OPTION(pipe, -pipe, -pipe, CXXFLAGS="$CXXFLAGS -pipe") ;;
michael@1 468 esac
michael@1 469 fi
michael@1 470 case "$CXXFLAGS" in
michael@1 471 *-g* ) CXXFLAGS=`echo "$CXXFLAGS" |\
michael@1 472 sed -e 's/ -g / /g' -e 's/ -g$//' -e 's/^-g //g' -e 's/^-g$//'` ;;
michael@1 473 esac
michael@1 474 case "$CXXFLAGS" in
michael@1 475 *-g* ) CXXFLAGS=`echo "$CXXFLAGS" |\
michael@1 476 sed -e 's/ -g / /g' -e 's/ -g$//' -e 's/^-g //g' -e 's/^-g$//'` ;;
michael@1 477 esac
michael@1 478
michael@1 479 CXXFLAGS="$CXXFLAGS -DQT_NO_DEBUG"
michael@1 480 msg=disabled
michael@1 481 ])dnl
michael@1 482 AC_MSG_CHECKING(for compilation debug mode)
michael@1 483 AC_MSG_RESULT([$msg])
michael@1 484 if test ".$msg" = .enabled; then
michael@1 485 enable_shared=no
michael@1 486 fi
michael@1 487 ])
michael@1 488
michael@1 489 define(AC_IFALLYES,[dnl
michael@1 490 ac_rc=yes
michael@1 491 for ac_spec in $1; do
michael@1 492 ac_type=`echo "$ac_spec" | sed -e 's/:.*$//'`
michael@1 493 ac_item=`echo "$ac_spec" | sed -e 's/^.*://'`
michael@1 494 case $ac_type in
michael@1 495 header [)]
michael@1 496 ac_item=`echo "$ac_item" | sed 'y%./+-%__p_%'`
michael@1 497 ac_var="ac_cv_header_$ac_item"
michael@1 498 ;;
michael@1 499 file [)]
michael@1 500 ac_item=`echo "$ac_item" | sed 'y%./+-%__p_%'`
michael@1 501 ac_var="ac_cv_file_$ac_item"
michael@1 502 ;;
michael@1 503 func [)] ac_var="ac_cv_func_$ac_item" ;;
michael@1 504 lib [)] ac_var="ac_cv_lib_$ac_item" ;;
michael@1 505 define [)] ac_var="ac_cv_define_$ac_item" ;;
michael@1 506 typedef [)] ac_var="ac_cv_typedef_$ac_item" ;;
michael@1 507 custom [)] ac_var="$ac_item" ;;
michael@1 508 esac
michael@1 509 eval "ac_val=\$$ac_var"
michael@1 510 if test ".$ac_val" != .yes; then
michael@1 511 ac_rc=no
michael@1 512 break
michael@1 513 fi
michael@1 514 done
michael@1 515 if test ".$ac_rc" = .yes; then
michael@1 516 :
michael@1 517 $2
michael@1 518 else
michael@1 519 :
michael@1 520 $3
michael@1 521 fi
michael@1 522 ])
michael@1 523
michael@1 524
michael@1 525 dnl ##
michael@1 526 dnl ## Check for an external/extension library.
michael@1 527 dnl ## - is aware of <libname>-config style scripts
michael@1 528 dnl ## - searches under standard paths include, lib, etc.
michael@1 529 dnl ## - searches under subareas like .libs, etc.
michael@1 530 dnl ##
michael@1 531 dnl ## configure.in:
michael@1 532 dnl ## AC_CHECK_EXTLIB(<realname>, <libname>, <func>, <header>,
michael@1 533 dnl ## [<success-action> [, <fail-action>]])
michael@1 534 dnl ## Makefile.in:
michael@1 535 dnl ## CFLAGS = @CFLAGS@
michael@1 536 dnl ## LDFLAGS = @LDFLAGS@
michael@1 537 dnl ## LIBS = @LIBS@
michael@1 538 dnl ## shell:
michael@1 539 dnl ## $ ./configure --with-<libname>[=DIR]
michael@1 540 dnl ##
michael@1 541
michael@1 542 AC_DEFUN(AC_CHECK_EXTLIB,[dnl
michael@1 543 AC_ARG_WITH($2, [dnl
michael@1 544 [ --with-]m4_substr([$2[[=DIR]] ], 0, 19)[build with external $1 library (default=no)]], [dnl
michael@1 545 if test ".$with_$2" = .yes; then
michael@1 546 # via config script
michael@1 547 $2_version=`($2-config --version) 2>/dev/null`
michael@1 548 if test ".$$2_version" != .; then
michael@1 549 CFLAGS="$CFLAGS `$2-config --cflags`"
michael@1 550 LDFLAGS="$LDFLAGS `$2-config --ldflags`"
michael@1 551 fi
michael@1 552 else
michael@1 553 if test -d "$with_$2"; then
michael@1 554 found=0
michael@1 555 # via config script
michael@1 556 for dir in $with_$2/bin $with_$2; do
michael@1 557 if test -f "$dir/$2-config"; then
michael@1 558 $2_version=`($dir/$2-config --version) 2>/dev/null`
michael@1 559 if test ".$$2_version" != .; then
michael@1 560 CFLAGS="$CFLAGS `$dir/$2-config --cflags`"
michael@1 561 LDFLAGS="$LDFLAGS `$dir/$2-config --ldflags`"
michael@1 562 found=1
michael@1 563 break
michael@1 564 fi
michael@1 565 fi
michael@1 566 done
michael@1 567 # via standard paths
michael@1 568 if test ".$found" = .0; then
michael@1 569 for dir in $with_$2/include/$2 $with_$2/include $with_$2; do
michael@1 570 if test -f "$dir/$4"; then
michael@1 571 CFLAGS="$CFLAGS -I$dir"
michael@1 572 found=1
michael@1 573 break
michael@1 574 fi
michael@1 575 done
michael@1 576 for dir in $with_$2/lib/$2 $with_$2/lib $with_$2; do
michael@1 577 if test -f "$dir/lib$2.a" -o -f "$dir/lib$2.so"; then
michael@1 578 LDFLAGS="$LDFLAGS -L$dir"
michael@1 579 found=1
michael@1 580 break
michael@1 581 fi
michael@1 582 done
michael@1 583 fi
michael@1 584 # in any subarea
michael@1 585 if test ".$found" = .0; then
michael@1 586 changequote(, )dnl
michael@1 587 for file in x `find $with_$2 -name "$4" -type f -print`; do
michael@1 588 test .$file = .x && continue
michael@1 589 dir=`echo $file | sed -e 's;[[^/]]*$;;' -e 's;\(.\)/$;\1;'`
michael@1 590 CFLAGS="$CFLAGS -I$dir"
michael@1 591 done
michael@1 592 for file in x `find $with_$2 -name "lib$2.[[aso]]" -type f -print`; do
michael@1 593 test .$file = .x && continue
michael@1 594 dir=`echo $file | sed -e 's;[[^/]]*$;;' -e 's;\(.\)/$;\1;'`
michael@1 595 LDFLAGS="$LDFLAGS -L$dir"
michael@1 596 done
michael@1 597 changequote([, ])dnl
michael@1 598 fi
michael@1 599 fi
michael@1 600 fi
michael@1 601 AC_HAVE_HEADERS($4)
michael@1 602 AC_CHECK_LIB($2, $3)
michael@1 603 AC_IFALLYES(header:$4 lib:$2_$3, with_$2=yes, with_$2=no)
michael@1 604 if test ".$with_$2" = .no; then
michael@1 605 AC_ERROR([Unable to find $1 library])
michael@1 606 fi
michael@1 607 ], [dnl
michael@1 608 if test ".$with_$2" = .; then
michael@1 609 with_$2=no
michael@1 610 fi
michael@1 611 ])dnl
michael@1 612 AC_MSG_CHECKING(whether to build against external $1 library)
michael@1 613 if test ".$with_$2" = .yes; then
michael@1 614 ifelse([$5], , :, [$5])
michael@1 615 else
michael@1 616 ifelse([$6], , :, [$6])
michael@1 617 fi
michael@1 618 AC_MSG_RESULT([$with_$2])
michael@1 619 ])dnl

mercurial