1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837
|
dnl This file is part of the hk_classes libraries/packages
dnl Copyright (C) 2001-2003 Horst Knorr (hk_classes@knoda.org)
dnl This file is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Library General Public
dnl License as published by the Free Software Foundation;
dnl version 2 of the License.
dnl This library is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dnl Library General Public License for more details.
dnl You should have received a copy of the GNU Library General Public License
dnl along with this library; see the file COPYING.LIB. If not, write to
dnl the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
dnl Boston, MA 02111-1307, USA.
dnl $Id: acinclude.m4,v 1.34 2005/03/13 16:28:52 knorr Exp $
AC_DEFUN([HK_CLASSESINIT],
[
AC_MSG_CHECKING([HK_CLASSES INIT])
if test "$prefix" = "NONE"; then
HK_CLASSESDIR=/usr/lib/hk_classes
HK_CLASSESINCDIR=/usr/include/hk_classes
else
HK_CLASSESDIR=$libdir/hk_classes
HK_CLASSESINCDIR=$includedir/hk_classes
fi
if test "$with_hk_classes_incdir" != ""; then
HK_CLASSESINCDIR=$with_hk_classes_incdir
fi
HKPYTHONDIR=""
UTILITIESDIR=""
AC_SUBST(HK_CLASSESDIR)
AC_SUBST(HK_CLASSESINCDIR)
NODRIVER=true
POSSIBLE_DRIVERS="MYSQL,ODBC,POSTGRESQL,SQLITE2,SQLITE3"
dnl AC_DEFINE_UNQUOTED(HKCLASSES, "$HK_CLASSESDIR",[PREPROCESSOR DEFINITION])
AC_MSG_RESULT(OK)
])
AC_DEFUN([HK_MYSQLTEST],
[
if test "$want_mysql" = "yes"; then
AC_MSG_CHECKING([whether MYSQL is available])
if test "$with_mysql_dir" = ""; then
MYSQLLIBDIR=/usr/lib/mysql
MYSQLINCDIR=/usr/include/mysql
else MYSQLLIBDIR=$with_mysql_dir/lib
MYSQLINCDIR=$with_mysql_dir/include
fi
if test "x$with_mysql_incdir" != "x"; then
MYSQLINCDIR=$with_mysql_incdir
fi
if test "x$with_mysql_libdir" != "x"; then
MYSQLLIBDIR=$with_mysql_libdir
fi
ac_save_LIBS="$LIBS"
ac_save_CPPFLAGS="$CPPFLAGS"
ac_save_CXXLIBS="$CXXLIBS"
CXXLIBS="$ac_save_CXXLIBS -L${MYSQLLIBDIR} -lmysqlclient"
LIBS="$ac_save_LIBS -L${MYSQLLIBDIR} -lmysqlclient"
CPPFLAGS="$ac_save_CPPFLAGS -I$MYSQLINCDIR"
AC_TRY_LINK([#include <mysql.h>],[;],[mysql_lib=yes],[mysql_lib=no])
AC_MSG_RESULT($mysql_lib)
if test $mysql_lib = yes ; then
NODRIVER=false
DRIVERSDIR="$DRIVERSDIR hk_mysqlclasses"
AC_SUBST(MYSQLLIBDIR)
AC_SUBST(MYSQLINCDIR)
MYSQLREALESCAPE
fi
LIBS="$ac_save_LIBS"
CPPFLAGS="$ac_save_CPPFLAGS"
CXXLIBS="$ac_save_CXXLIBS"
fi
])
AC_DEFUN([MYSQLREALESCAPE],
[
AC_MSG_CHECKING([MYSQL has mysql_real_escape_string function])
AC_TRY_LINK([#include <mysql.h>],[
MYSQL* m;
char* to;
mysql_real_escape_string(m,to,"test",4);
],[mysql_real=yes],[mysql_real=no])
AC_MSG_RESULT($mysql_real)
if test $mysql_real = yes ; then
AC_DEFINE(HAVE_MYSQL_REAL_ESCAPE_STRING,1,Defines if Mysql has the mysql_real_escape_string function)
fi
])
AC_DEFUN([HK_POSTGRESTEST],
[
if test "$want_postgres" = "yes"; then
AC_MSG_CHECKING([whether POSTGRES is available])
if test "$with_postgres_dir" = ""; then
POSTGRESLIBDIR=/usr/local/pgsql/lib
POSTGRESINCDIR=/usr/include/pgsql
else
POSTGRESLIBDIR=$with_postgres_dir/lib
POSTGRESINCDIR=$with_postgres_dir/include
fi
if test "x$with_postgres_incdir" != "x"; then
POSTGRESINCDIR=$with_postgres_incdir
fi
if test "x$with_postgres_libdir" != "x"; then
POSTGRESLIBDIR=$with_postgres_libdir
fi
ac_save_LIBS="$LIBS"
ac_save_CPPFLAGS="$CPPFLAGS"
ac_save_CXXLIBS="$CXXLIBS"
CXXLIBS="$ac_save_CXXLIBS -L${POSTGRESLIBDIR} -lpq"
LIBS="$ac_save_LIBS -L${POSTGRESLIBDIR} -lpq"
CPPFLAGS="$ac_save_CPPFLAGS -I$POSTGRESINCDIR"
AC_TRY_LINK([#include <libpq-fe.h>],[;],[postgres_lib=yes],[postgres_lib=no])
AC_MSG_RESULT($postgres_lib)
if test $postgres_lib = yes ; then
NODRIVER=false
DRIVERSDIR="$DRIVERSDIR hk_postgresclasses"
AC_SUBST(POSTGRESLIBDIR)
AC_SUBST(POSTGRESINCDIR)
fi
LIBS="$ac_save_LIBS"
CPPFLAGS="$ac_save_CPPFLAGS"
CXXLIBS="$ac_save_CXXLIBS"
fi
])
AC_DEFUN([HK_ODBCTEST],
[
if test "$want_odbc" = "yes"; then
AC_MSG_CHECKING([whether ODBC is available])
if test "$ODBCDIR" = ""; then
ODBCLIBDIR=/usr/local/lib
ODBCINCDIR=/usr/local/include
else ODBCLIBDIR=$ODBCDIR/lib
ODBCLINCDIR=$ODBCDIR/include
fi
ac_save_LIBS="$LIBS"
ac_save_CPPFLAGS="$CPPFLAGS"
ac_save_CXXLIBS="$CXXLIBS"
if test "$with_odbc_incdir" != ""; then
ODBCINCDIR=$with_odbc_incdir
fi
if test "$with_odbc_libdir" != ""; then
ODBCLIBDIR=$with_odbc_libdir
fi
CXXLIBS="$ac_save_CXXLIBS -L${ODBCLIBDIR} -lodbc"
LIBS="$ac_save_LIBS -L${ODBCLIBDIR} -lodbc"
CPPFLAGS="$ac_save_CPPFLAGS -I$ODBCINCDIR"
AC_TRY_LINK([#include <sql.h>],[;],[odbc_lib=yes],[odbc_lib=no])
if test x$odbc_lib = xno ; then
if test "$ODBCDIR" = ""; then
ODBCLIBDIR=/usr/local/lib
ODBCINCDIR=/usr/include/
fi
LIBS="$ac_save_LIBS -L${ODBCLIBDIR} -lodbc"
CPPFLAGS="$ac_save_CPPFLAGS -I$ODBCINCDIR"
AC_TRY_LINK([#include <sql.h>],[;],[odbc_lib=yes],[odbc_lib=no])
fi
if test x$odbc_lib = xyes ; then
ODBCLIBRARY="odbc"
else
LIBS="$ac_save_LIBS -L${ODBCLIBDIR} -liodbc"
CPPFLAGS="$ac_save_CPPFLAGS -I$ODBCINCDIR"
AC_TRY_LINK([#include <sql.h>],[;],[odbc_lib=yes],[odbc_lib=no])
if test x$odbc_lib = xyes ; then
ODBCLIBRARY="iodbc"
fi
fi
AC_MSG_RESULT($odbc_lib)
if test x$odbc_lib = xyes ; then
NODRIVER=false
DRIVERSDIR="$DRIVERSDIR hk_odbcclasses"
AC_SUBST(ODBCLIBDIR)
AC_SUBST(ODBCINCDIR)
AC_SUBST(ODBCLIBRARY)
AC_DEFINE_UNQUOTED(ODBCLIBRARY,"$ODBCLIBRARY",[DEFINES THE NAME OF THE ODBC LIBRARY])
dnl else
dnl AC_MSG_ERROR( ODBC not found )
fi
LIBS="$ac_save_LIBS"
CPPFLAGS="$ac_save_CPPFLAGS"
CXXLIBS="$ac_save_CXXLIBS"
fi
])
AC_DEFUN([HK_DEFINEDRIVERS],
[
AC_SUBST(DRIVERSDIR)
AC_SUBST(NODRIVER)
AC_SUBST(POSSIBLE_DRIVERS)
AC_SUBST(HKPYTHONDIR)
])
AC_DEFUN([AC_SSTREAM_EXISTS],
[
AC_MSG_CHECKING([whether <sstream> exists])
AC_TRY_LINK([#include <sstream>],[;],[sstream_exists=yes],[sstream_exists=no])
AC_MSG_RESULT($sstream_exists)
if test $sstream_exists = yes ; then
AC_DEFINE(HAVE_SSTREAM,1,Defines if stdc++ library contains a sstream implementation)
fi
])
AC_DEFUN([AC_IOSTREAM_EXISTS],
[
AC_MSG_CHECKING([whether <iostream> exists])
AC_TRY_LINK([#include <iostream>],[;],[iostream_exists=yes],[iostream_exists=no])
AC_MSG_RESULT($iostream_exists)
if test $iostream_exists = yes ; then
AC_DEFINE(HAVE_IOSTREAM,1,Defines if stdc++ library contains a <iostream> implementation)
else
AC_DEFINE(NO_IOSTREAM,1,Defines that stdc++ library does not have a new <iostream> implementation)
fi
])
AC_DEFUN([HK_CLEARENV_EXISTS],
[
AC_MSG_CHECKING([whether clearenv() is available])
AC_TRY_LINK([#include <stdlib.h>],[clearenv();],[ac_clearenv=yes],[ac_clearenv=no])
if test $ac_clearenv = yes ; then
AC_DEFINE(HAVE_CLEARENV,1,Defines if stdlib has function clearenv)
fi
AC_MSG_RESULT($ac_clearenv)
])
AC_DEFUN([HK_CHECK_ARGP_EXISTS],
[
dnl argp.h is not available on FreeBSD !
AC_MSG_CHECKING([whether argp.h is available])
AC_TRY_LINK([#include <argp.h>],[;],[ac_argp=yes],[ac_argp=no])
if test $ac_argp = yes ; then
AC_DEFINE(HAVE_ARGP,1,Defines whether argp.h exists)
UTILITIESDIR="utilities"
fi
AC_SUBST(UTILITIESDIR)
AC_MSG_RESULT($ac_argp)
])
dnl the following makro has been taken from GNU gettext
dnl and modified to fit for HK_CLASSES
dnl 17.02.2002 Horst Knorr
dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
dnl This file is free software, distributed under the terms of the GNU
dnl General Public License. As a special exception to the GNU General
dnl Public License, this file may be distributed as part of a program
dnl that contains a configuration script generated by Autoconf, under
dnl the same distribution terms as the rest of that program.
dnl From Bruno Haible.
AC_DEFUN([AM_ICONV_LINK],
[
dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
dnl those with the standalone portable GNU libiconv installed).
dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
dnl AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
dnl AC_REQUIRE([AC_LIB_RPATH])
dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
dnl accordingly.
dnl AC_LIB_LINKFLAGS_BODY([iconv])
AC_MSG_CHECKING([if libiconv is present])
ac_save_LIBS="$LIBS"
LIBS="$ac_save_LIBS -liconv"
AC_TRY_LINK(,
[;],
LIBICONV="-liconv"
ac_liconv="yes",
LIBS="$ac_save_LIBS"
ac_liconv="no")
AC_MSG_RESULT($ac_liconv)
dnl Add $INCICONV to CPPFLAGS before performing the following checks,
dnl because if the user has installed libiconv and not disabled its use
dnl via --without-libiconv-prefix, he wants to use it. The first
dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
am_save_CPPFLAGS="$CPPFLAGS"
dnl AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
am_cv_func_iconv="no, consider installing GNU libiconv"
am_cv_lib_iconv=no
AC_TRY_LINK([#include <stdlib.h>
#include <iconv.h>],
[iconv_t cd = iconv_open("","");
iconv(cd,NULL,NULL,NULL,NULL);
iconv_close(cd);],
am_cv_func_iconv=yes)
if test "$am_cv_func_iconv" != yes; then
am_save_LIBS="$LIBS"
LIBS="$LIBS $LIBICONV"
AC_TRY_LINK([#include <stdlib.h>
#include <iconv.h>],
[iconv_t cd = iconv_open("","");
iconv(cd,NULL,NULL,NULL,NULL);
iconv_close(cd);],
am_cv_lib_iconv=yes
am_cv_func_iconv=yes)
LIBS="$am_save_LIBS"
fi
])
if test "$am_cv_func_iconv" = yes; then
AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
fi
if test "$am_cv_lib_iconv" = yes; then
AC_MSG_CHECKING([how to link with libiconv])
AC_MSG_RESULT([$LIBICONV])
else
dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
dnl either.
CPPFLAGS="$am_save_CPPFLAGS"
LIBICONV=
LTLIBICONV=
fi
if test "$am_cv_func_iconv" != "yes" ; then
if test "$am_cv_lib_iconv" != "yes" ; then
AC_MSG_ERROR(
No iconv installation found. Either you have a very old libc or a system that doesn't support
this function. Perhaps you should install the library libiconv from Bruno Haible.
)
fi
fi
AC_SUBST(LIBICONV)
AC_SUBST(LTLIBICONV)
])
AC_DEFUN([AM_ICONV],
[
AC_REQUIRE([AM_ICONV_LINK])
if test "$am_cv_func_iconv" = yes; then
AC_MSG_CHECKING([for iconv declaration])
AC_CACHE_VAL(am_cv_proto_iconv, [
AC_TRY_COMPILE([
#include <stdlib.h>
#include <iconv.h>
extern
#ifdef __cplusplus
"C"
#endif
#if defined(__STDC__) || defined(__cplusplus)
size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
#else
size_t iconv();
#endif
], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
AC_MSG_RESULT([$]{ac_t:-
}[$]am_cv_proto_iconv)
AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
[Define as const if the declaration of iconv() needs const.])
fi
])
dnl the whole CHECK_PYTHON functions are based on the KDE configure script
AC_DEFUN([AC_FIND_FILE],
[
$3=NO
for i in $2;
do
for j in $1;
do
echo "configure: __oline__: $i/$j" >&AC_FD_CC
if test -r "$i/$j"; then
echo "taking that" >&AC_FD_CC
$3=$i
break 2
fi
done
done
])
AC_DEFUN([HK_CHECK_LIBDL],
[
AC_CHECK_LIB(dl, dlopen, [
LIBDL="-ldl"
ac_cv_have_dlfcn=yes
])
AC_CHECK_LIB(dld, shl_unload, [
LIBDL="-ldld"
ac_cv_have_shload=yes
])
AC_SUBST(LIBDL)
])
AC_DEFUN([HK_CHECK_LIBPTHREAD],
[
AC_CHECK_LIB(pthread, pthread_create, [LIBPTHREAD="-lpthread"] )
AC_SUBST(LIBPTHREAD)
])
AC_DEFUN([HK_TRY_LINK_PYTHON],
[
if test "$kde_python_link_found" = no; then
if test "$1" = normal; then
AC_MSG_CHECKING(if a Python application links)
else
AC_MSG_CHECKING(if Python depends on $2)
fi
AC_CACHE_VAL(kde_cv_try_link_python_$1,
[
AC_LANG_SAVE
AC_LANG_C
kde_save_cflags="$CFLAGS"
CFLAGS="$CFLAGS $PYTHONINC"
kde_save_libs="$LIBS"
LIBS="$LIBS $LIBPYTHON $2 $LIBDL $LIBSOCKET"
kde_save_ldflags="$LDFLAGS"
LDFLAGS="$LDFLAGS $PYTHONLIB"
AC_TRY_LINK(
[
#include <Python.h>
],[
PySys_SetArgv(1, 0);
],
[kde_cv_try_link_python_$1=yes],
[kde_cv_try_link_python_$1=no]
)
CFLAGS="$kde_save_cflags"
LIBS="$kde_save_libs"
LDFLAGS="$kde_save_ldflags"
])
if test "$kde_cv_try_link_python_$1" = "yes"; then
AC_MSG_RESULT(yes)
kde_python_link_found=yes
if test ! "$1" = normal; then
LIBPYTHON="$LIBPYTHON $2"
fi
$3
else
AC_MSG_RESULT(no)
$4
fi
AC_LANG_RESTORE
fi
])
AC_DEFUN([HK_CHECK_PYTHON_DIR],
[
AC_MSG_CHECKING([for Python directory])
AC_CACHE_VAL(kde_cv_pythondir,
[
if test -z "$PYTHONDIR"; then
kde_cv_pythondir=/usr/local
else
kde_cv_pythondir="$PYTHONDIR"
fi
])
AC_ARG_WITH(pythondir,
[ --with-pythondir=pythondir use python installed in pythondir ],
[
ac_python_dir=$withval
], ac_python_dir=$kde_cv_pythondir
)
AC_MSG_RESULT($ac_python_dir)
])
AC_DEFUN([HK_CHECK_PYTHON_INTERN],
[
AC_REQUIRE([HK_CHECK_LIBDL])
AC_REQUIRE([HK_CHECK_LIBPTHREAD])
AC_REQUIRE([HK_CHECK_PYTHON_DIR])
if test -z "$1"; then
version="1.5"
else
version="$1"
fi
AC_MSG_CHECKING([for Python$version])
python_incdirs="$ac_python_dir/include /usr/include /usr/local/include/ $kde_extra_includes"
AC_FIND_FILE(Python.h, $python_incdirs, python_incdir)
if test ! -r $python_incdir/Python.h; then
AC_FIND_FILE(python$version/Python.h, $python_incdirs, python_incdir)
python_incdir=$python_incdir/python$version
if test ! -r $python_incdir/Python.h; then
python_incdir=no
fi
fi
PYTHONINC=-I$python_incdir
python_libdirs="$ac_python_dir/lib$kdelibsuff /usr/lib$kdelibsuff /usr/local /usr/lib$kdelibsuff $kde_extra_libs"
AC_FIND_FILE(libpython$version.so, $python_libdirs, python_libdir)
if test ! -r $python_libdir/libpython$version.so; then
AC_FIND_FILE(libpython$version.a, $python_libdirs, python_libdir)
if test ! -r $python_libdir/libpython$version.a; then
AC_FIND_FILE(python$version/config/libpython$version.a, $python_libdirs, python_libdir)
python_libdir=$python_libdir/python$version/config
if test ! -r $python_libdir/libpython$version.a; then
python_libdir=no
fi
fi
fi
PYTHONLIB=-L$python_libdir
kde_orig_LIBPYTHON=$LIBPYTHON
if test -z "$LIBPYTHON"; then
LIBPYTHON=-lpython$version
fi
python_libdirs="$ac_python_dir/lib /usr/lib /usr/local /usr/lib $kde_extra_libs"
AC_FIND_FILE(python$version/copy.py, $python_libdirs, python_moddir)
python_moddir=$python_moddir/python$version
if test ! -r $python_moddir/copy.py; then
python_moddir=no
fi
PYTHONMODDIR=$python_moddir
AC_MSG_RESULT(header $python_incdir library $python_libdir modules $python_moddir)
if test x$python_incdir = xno || test x$python_libdir = xno || test x$python_moddir = xno; then
LIBPYTHON=$kde_orig_LIBPYTHON
test "x$PYTHONLIB" = "x-Lno" && PYTHONLIB=""
test "x$PYTHONINC" = "x-Ino" && PYTHONINC=""
$2
else
dnl Note: this test is very weak
kde_python_link_found=no
HK_TRY_LINK_PYTHON(normal)
HK_TRY_LINK_PYTHON(m, -lm)
HK_TRY_LINK_PYTHON(pthread, $LIBPTHREAD)
HK_TRY_LINK_PYTHON(tcl, -ltcl)
HK_TRY_LINK_PYTHON(db2, -ldb2)
HK_TRY_LINK_PYTHON(m_and_thread, [$LIBPTHREAD -lm])
HK_TRY_LINK_PYTHON(m_and_thread_and_util, [$LIBPTHREAD -lm -lutil])
HK_TRY_LINK_PYTHON(m_and_thread_and_db3, [$LIBPTHREAD -lm -ldb-3 -lutil])
HK_TRY_LINK_PYTHON(pthread_and_db3, [$LIBPTHREAD -ldb-3])
HK_TRY_LINK_PYTHON(m_and_thread_and_db, [$LIBPTHREAD -lm -ldb -ltermcap -lutil])
HK_TRY_LINK_PYTHON(pthread_and_dl, [$LIBPTHREAD $LIBDL -lutil -lreadline -lncurses -lm])
HK_TRY_LINK_PYTHON(m_and_thread_and_db_special, [$LIBPTHREAD -lm -ldb -lutil], [],
[AC_MSG_ERROR([it seems, Python depends on another library.
Pleae set LIBPYTHON to '-lpython$version -lotherlib' before calling configure to fix this
and contact the authors to let them know about this problem])
])
LIBPYTHON="$LIBPYTHON $LIBDL $LIBSOCKET"
AC_SUBST(PYTHONINC)
AC_SUBST(PYTHONLIB)
AC_SUBST(LIBPYTHON)
AC_SUBST(PYTHONMODDIR)
HKPYTHONDIR="python"
if test $kde_python_link_found=yes ; then
AC_DEFINE(HAVE_PYTHON, 1, [Define if you have the development files for python])
fi
fi
])
AC_DEFUN([HK_CHECK_PYTHON],
[
HK_CHECK_PYTHON_INTERN("2.4",
[HK_CHECK_PYTHON_INTERN("2.3",
[HK_CHECK_PYTHON_INTERN("2.2",
[HK_CHECK_PYTHON_INTERN("2.1",
[HK_CHECK_PYTHON_INTERN("2.0", [ HK_CHECK_PYTHON_INTERN($1, $2) ])
])])])])
if test ! "$kde_python_link_found" = yes ; then
AC_MSG_ERROR(
Python not available!!!
============================================================================
ERROR!
You probably have to install the Python-devel.rpm of your distribution.
The exact name of this rpm is distribution specific.
============================================================================
)
fi
])
AC_DEFUN([HK_SQLITE2TEST],
[
if test "$want_sqlite" = "yes"; then
AC_MSG_CHECKING([whether SQLITE2 is available])
if test "$with_sqlite_dir" = ""; then
SQLITELIBDIR=/usr/local/lib
SQLITEINCDIR=/usr/local/include
else SQLITELIBDIR=$with_sqlite_dir/lib
SQLITEINCDIR=$with_sqlite_dir/include
fi
if test "x$with_sqlite_incdir" != "x"; then
SQLITEINCDIR=$with_sqlite_incdir
fi
if test "x$with_sqlite_libdir" != "x"; then
SQLITELIBDIR=$with_sqlite_libdir
fi
ac_save_LIBS="$LIBS"
ac_save_CPPFLAGS="$CPPFLAGS"
ac_save_CXXLIBS="$CXXLIBS"
CXXLIBS="$ac_save_CXXLIBS -L${SQLITELIBDIR} -lsqlite"
LIBS="$ac_save_LIBS -L${SQLITELIBDIR} -lsqlite"
CPPFLAGS="$ac_save_CPPFLAGS -I$SQLITEINCDIR"
AC_TRY_LINK([#include <sqlite.h>],[char* errormsg=0;
sqlite* mydb=sqlite_open("",0,&errormsg);
sqlite_vm *vm=0;
int result =sqlite_compile(mydb,"",0,&vm,&errormsg);
;],[sqlite_lib=yes],[sqlite_lib=no])
AC_MSG_RESULT($sqlite_lib)
if test $sqlite_lib = yes ; then
NODRIVER=false
DRIVERSDIR="$DRIVERSDIR hk_sqliteclasses"
AC_SUBST(SQLITELIBDIR)
AC_SUBST(SQLITEINCDIR)
fi
LIBS="$ac_save_LIBS"
CPPFLAGS="$ac_save_CPPFLAGS"
CXXLIBS="$ac_save_CXXLIBS"
fi
])
AC_DEFUN([HK_SQLITE3TEST],
[
if test "$want_sqlite3" = "yes"; then
AC_MSG_CHECKING([whether SQLITE3 is available])
if test "$with_sqlite3_dir" = ""; then
SQLITE3LIBDIR=/usr/local/lib
SQLITE3INCDIR=/usr/local/include
else SQLITE3LIBDIR=$with_sqlite3_dir/lib
SQLITE3INCDIR=$with_sqlite3_dir/include
fi
if test "x$with_sqlite3_incdir" != "x"; then
SQLITE3INCDIR=$with_sqlite3_incdir
fi
if test "x$with_sqlite3_libdir" != "x"; then
SQLITE3LIBDIR=$with_sqlite3_libdir
fi
ac_save_LIBS="$LIBS"
ac_save_CPPFLAGS="$CPPFLAGS"
ac_save_CXXLIBS="$CXXLIBS"
CXXLIBS="$ac_save_CXXLIBS -L${SQLITE3LIBDIR} -lsqlite3"
LIBS="$ac_save_LIBS -L${SQLITE3LIBDIR} -lsqlite3"
CPPFLAGS="$ac_save_CPPFLAGS -I$SQLITE3INCDIR"
AC_TRY_LINK([#include <sqlite3.h>],[
sqlite3* mydb;
sqlite3_open("",&mydb);
sqlite3_stmt *vm=0;
int result =sqlite3_prepare(mydb,"",0,&vm,0);
;],[sqlite3_lib=yes],[sqlite3_lib=no])
AC_MSG_RESULT($sqlite3_lib)
if test $sqlite3_lib = yes ; then
NODRIVER=false
DRIVERSDIR="$DRIVERSDIR hk_sqlite3classes"
AC_SUBST(SQLITE3LIBDIR)
AC_SUBST(SQLITE3INCDIR)
fi
LIBS="$ac_save_LIBS"
CPPFLAGS="$ac_save_CPPFLAGS"
CXXLIBS="$ac_save_CXXLIBS"
fi
])
|