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 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773
|
AC_DEFUN(KDE_USE_QT,
[
if test -z "$1"; then
kde_qtver=2
kde_qtsubver=1
else
kde_qtsubver=`echo "$1" | sed -e 's#[0-9]\+\.\([0-9]\+\).*#\1#'`
# following is the check if subversion isnt found in passed argument
if test "$kde_qtsubver" = "$1"; then
kde_qtsubver=1
fi
kde_qtver=`echo "$1" | sed -e 's#^\([0-9]\+\)\..*#\1#'`
if test "$kde_qtver" = "1"; then
kde_qtsubver=42
else
# this is the version number fallback to 2.1, unless major version is 1 or 2
if test "$kde_qtver" != "2"; then
kde_qtver=2
kde_qtsubver=1
fi
fi
fi
if test -z "$2"; then
if test $kde_qtver = 2; then
if test $kde_qtsubver -gt 0; then
kde_qt_minversion=">= Qt 2.2.1"
else
kde_qt_minversion=">= Qt 2.0.2"
fi
else
kde_qt_minversion=">= 1.42 and < 2.0"
fi
else
kde_qt_minversion=$2
fi
if test -z "$3"; then
if test $kde_qtver = 2; then
if test $kde_qtsubver -gt 0; then
kde_qt_verstring="QT_VERSION >= 221"
else
kde_qt_verstring="QT_VERSION >= 200"
fi
else
kde_qt_verstring="QT_VERSION >= 142 && QT_VERSION < 200"
fi
else
kde_qt_verstring=$3
fi
if test $kde_qtver = 2; then
kde_qt_dirs="$QTDIR /usr/lib/qt2 /usr/lib/qt"
else
kde_qt_dirs="$QTDIR /usr/lib/qt"
fi
])
dnl ------------------------------------------------------------------------
dnl Find a file (or one of more files in a list of dirs)
dnl ------------------------------------------------------------------------
dnl
AC_DEFUN(AC_FIND_FILE,
[
$3=NO
for i in $2;
do
for j in $1;
do
if test -r "$i/$j"; then
$3=$i
break 2
fi
done
done
])
AC_DEFUN(KDE_CHECK_THREADING,
[
AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
AC_REQUIRE([KDE_CHECK_PTHREAD_OPTION])
dnl default is yes if libpthread is found and no if no libpthread is available
if test -z "$LIBPTHREAD"; then
kde_check_threading_default=no
else
kde_check_threading_default=yes
fi
AC_ARG_ENABLE(threading, [ --disable-threading disables threading even if libpthread found ],
kde_use_threading=$enableval, kde_use_threading=$kde_check_threading_default)
if test "x$kde_use_threading" = "xyes"; then
AC_DEFINE(HAVE_LIBPTHREAD, 1, [Define if you have a working libpthread (will enable threaded code)])
fi
])
AC_DEFUN(KDE_CHECK_LIBPTHREAD,
[
AC_CHECK_LIB(pthread,pthread_create, [LIBPTHREAD="-lpthread"] )
AC_SUBST(LIBPTHREAD)
])
AC_DEFUN(KDE_CHECK_PTHREAD_OPTION,
[
AC_ARG_ENABLE(kernel-threads, [ --enable-kernel-threads Enable the use of the LinuxThreads port on FreeBSD/i386 only.],
kde_use_kernthreads=$enableval, kde_use_kernthreads=no)
if test "$kde_use_kernthreads" = "yes"; then
ac_save_CXXFLAGS="$CXXFLAGS"
ac_save_CFLAGS="$CXXFLAGS"
CXXFLAGS="-I/usr/local/include/pthread/linuxthreads $CXXFLAGS"
CFLAGS="-I/usr/local/include/pthread/linuxthreads $CFLAGS"
AC_CHECK_HEADERS(pthread/linuxthreads/pthread.h)
CXXFLAGS="$ac_save_CXXFLAGS"
CFLAGS="$ac_save_CFLAGS"
if test "$ac_cv_header_pthread_linuxthreads_pthread_h" = "no"; then
kde_use_kernthreads=no
else
dnl Add proper -I and -l statements
AC_CHECK_LIB(lthread, pthread_join, [LIBPTHREAD="-llthread -llgcc_r"]) dnl for FreeBSD
if test "x$LIBPTHREAD" = "x"; then
kde_use_kernthreads=no
else
USE_THREADS="-D_THREAD_SAFE -I/usr/local/include/pthread/linuxthreads"
fi
fi
else
USE_THREADS=""
if test -z "$LIBPTHREAD"; then
KDE_CHECK_COMPILER_FLAG(pthread, [USE_THREADS="-pthread"] )
fi
fi
case $host_os in
solaris*)
KDE_CHECK_COMPILER_FLAG(mt, [USE_THREADS="-mt"])
CPPFLAGS="$CPPFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_SOLARIS"
echo "Setting Solaris pthread compilation options"
;;
freebsd*)
CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
echo "Setting FreeBSD pthread compilation options"
;;
aix*)
CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
LIBPTHREAD="$LIBPTHREAD -lc_r"
echo "Setting AIX pthread compilation options"
;;
linux*) CPPFLAGS="$CPPFLAGS -D_REENTRANT"
USE_THREADS="$USE_THREADS -DPIC -fPIC"
echo "Setting Linux pthread compilation options"
;;
*)
;;
esac
AC_SUBST(USE_THREADS)
AC_SUBST(LIBPTHREAD)
])
AC_DEFUN(KDE_CHECK_COMPILER_FLAG,
[
AC_REQUIRE([AC_CHECK_COMPILERS])
AC_MSG_CHECKING(whether $CXX supports -$1)
kde_cache=`echo $1 | sed 'y%.=/+-%___p_%'`
AC_CACHE_VAL(kde_cv_prog_cxx_$kde_cache,
[
echo 'int main() { return 0; }' >conftest.cc
eval "kde_cv_prog_cxx_$kde_cache=no"
if test -z "`$CXX -$1 -c conftest.cc 2>&1`"; then
if test -z "`$CXX -$1 -o conftest conftest.o 2>&1`"; then
eval "kde_cv_prog_cxx_$kde_cache=yes"
fi
fi
rm -f conftest*
])
if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
AC_MSG_RESULT(yes)
:
$2
else
AC_MSG_RESULT(no)
:
$3
fi
])
AC_DEFUN(KDE_ADD_DEPENDENCIES,
[
[A]M_DEPENDENCIES(CC)
[A]M_DEPENDENCIES(CXX)
])
dnl AC_REMOVE_FORBIDDEN removes forbidden arguments from variables
dnl use: AC_REMOVE_FORBIDDEN(CC, [-forbid -bad-option whatever])
dnl it's all white-space separated
AC_DEFUN(AC_REMOVE_FORBIDDEN,
[ __val=$$1
__forbid=" $2 "
if test -n "$__val"; then
__new=""
ac_save_IFS=$IFS
IFS=" "
for i in $__val; do
case "$__forbid" in
*" $i "*) AC_MSG_WARN([found forbidden $i in $1, removing it]) ;;
*) # Careful to not add spaces, where there were none, because otherwise
# libtool gets confused, if we change e.g. CXX
if test -z "$__new" ; then __new=$i ; else __new="$__new $i" ; fi ;;
esac
done
IFS=$ac_save_IFS
$1=$__new
fi
])
dnl AC_VALIDIFY_CXXFLAGS checks for forbidden flags the user may have given
AC_DEFUN(AC_VALIDIFY_CXXFLAGS,
[dnl
AC_REMOVE_FORBIDDEN(CXX, [-fno-rtti])
AC_REMOVE_FORBIDDEN(CXXFLAGS, [-fno-rtti])
])
AC_DEFUN(AC_CHECK_COMPILERS,
[
AC_PROVIDE([AC_CHECK_COMPILERS])
dnl this is somehow a fat lie, but prevents other macros from double checking
AC_PROVIDE([AC_PROG_CC])
AC_PROVIDE([AC_PROG_CPP])
AC_PROVIDE([AC_PROG_CXX])
AC_PROVIDE([AC_PROG_CXXCPP])
AC_ARG_ENABLE(debug,[ --enable-debug creates debugging code [default=no]],
[
if test $enableval = "no"; dnl
then
kde_use_debug_code="no"
kde_use_debug_define=yes
else
kde_use_debug_code="yes"
kde_use_debug_define=no
fi
], [kde_use_debug_code="no"
kde_use_debug_define=no
])
AC_ARG_ENABLE(strict,[ --enable-strict compiles with strict compiler options (may not work!)],
[
if test $enableval = "no"; then
kde_use_strict_options="no"
else
kde_use_strict_options="yes"
fi
], [kde_use_strict_options="no"])
AC_ARG_ENABLE(profile,[ --enable-profile creates profiling infos [default=no]],
[kde_use_profiling=$enableval],
[kde_use_profiling="no"]
)
dnl this was AC_PROG_CC. I had to include it manualy, since I had to patch it
AC_MSG_CHECKING(for a C-Compiler)
dnl if there is one, print out. if not, don't matter
AC_MSG_RESULT($CC)
if test -z "$CC"; then AC_CHECK_PROG(CC, gcc, gcc) fi
if test -z "$CC"; then AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) fi
if test -z "$CC"; then AC_CHECK_PROG(CC, xlc, xlc) fi
test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
AC_PROG_CC_WORKS
AC_PROG_CC_GNU
if test $ac_cv_prog_gcc = yes; then
GCC=yes
else
GCC=
fi
USER_CFLAGS=$CFLAGS
CFLAGS=
if test -z "$CFLAGS"; then
if test "$kde_use_debug_code" = "yes"; then
AC_PROG_CC_G
if test $ac_cv_prog_cc_g = yes; then
CFLAGS="-g"
case $host in
*-*-linux-gnu)
CFLAGS="$CFLAGS -ansi -W -Wall -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -D_XOPEN_SOURCE -D_BSD_SOURCE"
;;
esac
fi
else
if test "$GCC" = "yes"; then
CFLAGS="-O2"
else
CFLAGS=""
fi
if test "$kde_use_debug_define" = "yes"; then
CFLAGS="$CFLAGS -DNDEBUG"
fi
fi
if test "$kde_use_profiling" = yes; then
KDE_PROG_CC_PG
if test "$kde_cv_prog_cc_pg" = yes; then
CFLAGS="$CFLAGS -pg"
fi
fi
if test "$GCC" = "yes"; then
CFLAGS="$CFLAGS"
if test "$kde_use_strict_options" = "yes"; then
CFLAGS="$CFLAGS -W -Wall -ansi -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings"
fi
fi
fi
case "$host" in
*-*-sysv4.2uw*) CFLAGS="$CFLAGS -D_UNIXWARE";;
esac
if test -n "$USER_CFLAGS"; then
CFLAGS="$CFLAGS $USER_CFLAGS"
fi
if test -z "$LDFLAGS" && test "$kde_use_debug_code" = "no" && test "$GCC" = "yes"; then
LDFLAGS=""
fi
dnl this is AC_PROG_CPP. I had to include it here, since autoconf checks
dnl dependecies between AC_PROG_CPP and AC_PROG_CC (or is it automake?)
AC_MSG_CHECKING(how to run the C preprocessor)
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
fi
if test -z "$CPP"; then
AC_CACHE_VAL(ac_cv_prog_CPP,
[ # This must be in double quotes, not single quotes, because CPP may get
# substituted into the Makefile and "${CC-cc}" will confuse make.
CPP="${CC-cc} -E"
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
dnl Use a header file that comes with gcc, so configuring glibc
dnl with a fresh cross-compiler works.
AC_TRY_CPP([#include <assert.h>
Syntax Error], ,
CPP="${CC-cc} -E -traditional-cpp"
AC_TRY_CPP([#include <assert.h>
Syntax Error], , CPP=/lib/cpp))
ac_cv_prog_CPP="$CPP"])dnl
CPP="$ac_cv_prog_CPP"
else
ac_cv_prog_CPP="$CPP"
fi
AC_MSG_RESULT($CPP)
AC_SUBST(CPP)dnl
AC_MSG_CHECKING(for a C++-Compiler)
dnl if there is one, print out. if not, don't matter
AC_MSG_RESULT($CXX)
if test -z "$CXX"; then AC_CHECK_PROG(CXX, g++, g++) fi
if test -z "$CXX"; then AC_CHECK_PROG(CXX, CC, CC) fi
if test -z "$CXX"; then AC_CHECK_PROG(CXX, xlC, xlC) fi
if test -z "$CXX"; then AC_CHECK_PROG(CXX, DCC, DCC) fi
test -z "$CXX" && AC_MSG_ERROR([no acceptable C++-compiler found in \$PATH])
AC_PROG_CXX_WORKS
AC_PROG_CXX_GNU
if test $ac_cv_prog_gxx = yes; then
GXX=yes
fi
USER_CXXFLAGS=$CXXFLAGS
CXXFLAGS=""
if test -z "$CXXFLAGS"; then
if test "$kde_use_debug_code" = "yes"; then
AC_PROG_CXX_G
if test $ac_cv_prog_cxx_g = yes; then
CXXFLAGS="-g"
case $host in dnl
*-*-linux-gnu)
CXXFLAGS="$CXXFLAGS -ansi -D_XOPEN_SOURCE -D_BSD_SOURCE -Wbad-function-cast -Wcast-align -Wundef -Wconversion"
;;
esac
fi
else
if test "$GXX" = "yes"; then
CXXFLAGS="-O2"
fi
if test "$kde_use_debug_define" = "yes"; then
CXXFLAGS="$CXXFLAGS -DNDEBUG"
fi
fi
if test "$kde_use_profiling" = yes; then
KDE_PROG_CXX_PG
if test "$kde_cv_prog_cxx_pg" = yes; then
CXXFLAGS="$CXXFLAGS -pg"
fi
fi
KDE_CHECK_COMPILER_FLAG(fno-exceptions,
[
CXXFLAGS="$CXXFLAGS -fno-exceptions"
])
dnl WABA: Nothing wrong with RTTI, keep it on.
dnl KDE_CHECK_COMPILER_FLAG(fno-rtti,
dnl [
dnl CXXFLAGS="$CXXFLAGS -fno-rtti"
dnl ])
KDE_CHECK_COMPILER_FLAG(fno-check-new,
[
CXXFLAGS="$CXXFLAGS -fno-check-new"
])
if test "$GXX" = "yes"; then
CXXFLAGS="$CXXFLAGS"
if test true || test "$kde_use_debug_code" = "yes"; then
CXXFLAGS="$CXXFLAGS -Wall -pedantic -W -Wpointer-arith -Wmissing-prototypes -Wwrite-strings"
KDE_CHECK_COMPILER_FLAG(Wno-long-long,
[
CXXFLAGS="$CXXFLAGS -Wno-long-long"
])
KDE_CHECK_COMPILER_FLAG(fno-builtin,
[
CXXFLAGS="$CXXFLAGS -fno-builtin"
])
fi
if test "$kde_use_strict_options" = "yes"; then
CXXFLAGS="$CXXFLAGS -Wcast-qual -Wbad-function-cast -Wshadow -Wcast-align"
fi
if test "$kde_very_strict" = "yes"; then
CXXFLAGS="$CXXFLAGS -Wold-style-cast -Wredundant-decls -Wconversion"
fi
fi
fi
KDE_CHECK_COMPILER_FLAG(fexceptions,
[
USE_EXCEPTIONS="-fexceptions"
],
USE_EXCEPTIONS=
)
AC_SUBST(USE_EXCEPTIONS)
KDE_CHECK_COMPILER_FLAG(frtti,
[
USE_RTTI="-frtti"
],
USE_RTTI=
)
AC_SUBST(USE_RTTI)
case "$host" in
*-*-irix*) test "$GXX" = yes && CXXFLAGS="$CXXFLAGS -D_LANGUAGE_C_PLUS_PLUS -D__LANGUAGE_C_PLUS_PLUS" ;;
*-*-sysv4.2uw*) CXXFLAGS="$CXXFLAGS -D_UNIXWARE";;
esac
if test -n "$USER_CXXFLAGS"; then
CXXFLAGS="$CXXFLAGS $USER_CXXFLAGS"
fi
AC_VALIDIFY_CXXFLAGS
AC_MSG_CHECKING(how to run the C++ preprocessor)
if test -z "$CXXCPP"; then
AC_CACHE_VAL(ac_cv_prog_CXXCPP,
[
AC_LANG_SAVE[]dnl
AC_LANG_CPLUSPLUS[]dnl
CXXCPP="${CXX-g++} -E"
AC_TRY_CPP([#include <stdlib.h>], , CXXCPP=/lib/cpp)
ac_cv_prog_CXXCPP="$CXXCPP"
AC_LANG_RESTORE[]dnl
])dnl
CXXCPP="$ac_cv_prog_CXXCPP"
fi
AC_MSG_RESULT($CXXCPP)
AC_SUBST(CXXCPP)dnl
# the following is to allow programs, that are known to
# have problems when compiled with -O2
if test -n "$CXXFLAGS"; then
kde_safe_IFS=$IFS
IFS=" "
NOOPT_CXXFLAGS=""
for i in $CXXFLAGS; do
case $i in
-O*)
;;
*)
NOOPT_CXXFLAGS="$NOOPT_CXXFLAGS $i"
;;
esac
done
IFS=$kde_safe_IFS
fi
AC_SUBST(NOOPT_CXXFLAGS)
# KDE_CHECK_FINAL
ifdef([AM_DEPENDENCIES], AC_REQUIRE([KDE_ADD_DEPENDENCIES]), [])
KDE_CXXFLAGS=
AC_SUBST(KDE_CXXFLAGS)
])
AC_DEFUN(KDE_CHECK_PATHS_FOR_COMPLETENESS,
[ if test -z "$kde_htmldir" || test -z "$kde_appsdir" ||
test -z "$kde_icondir" || test -z "$kde_sounddir" ||
test -z "$kde_datadir" || test -z "$kde_locale" ||
test -z "$kde_cgidir" || test -z "$kde_confdir" ||
test -z "$kde_mimedir" || test -z "$kde_toolbardir" ||
test -z "$kde_wallpaperdir" || test -z "$kde_templatesdir" ||
test -z "$kde_bindir" || test -z "$kde_servicesdir" ||
test -z "$kde_servicetypesdir" || test "$kde_have_all_paths" != "yes"; then
kde_have_all_paths=no
fi
])
AC_DEFUN(KDE_SUBST_PROGRAMS,
[AC_REQUIRE([AC_CREATE_KFSSTND])dnl
kde_default_bindirs="/usr/bin /usr/local/bin /opt/local/bin /usr/X11R6/bin /opt/kde2/bin /opt/kde/bin /usr/kde/bin /usr/local/kde/bin"
if test -n "$KDEDIRS"; then
kde_save_IFS=$IFS
IFS=:
for dir in $KDEDIRS; do
kde_default_bindirs="$dir/bin $kde_default_bindirs "
done
IFS=$kde_save_IFS
fi
kde_default_bindirs="$exec_prefix/bin $prefix/bin $kde_default_bindirs"
KDE_FIND_PATH(dcopidl, DCOPIDL, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl)])
KDE_FIND_PATH(dcopidl2cpp, DCOPIDL2CPP, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl2cpp)])
KDE_FIND_PATH(mcopidl, MCOPIDL, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(mcopidl)])
KDE_FIND_PATH(kdb2html, KDB2HTML, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(kdb2html)])
KDE_FIND_PATH(artsc-config, ARTSCCONFIG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(artsc-config)])
DCOP_DEPENDENCIES='$(DCOPIDL)'
AC_SUBST(DCOPIDL)
AC_SUBST(DCOPIDL2CPP)
AC_SUBST(DCOP_DEPENDENCIES)
AC_SUBST(MCOPIDL)
AC_SUBST(KDB2HTML)
AC_SUBST(ARTSCCONFIG)
])dnl
AC_DEFUN(KDE_CREATE_LIBS_ALIASES,
[
AC_REQUIRE([KDE_MISC_TESTS])
AC_REQUIRE([KDE_CHECK_LIBDL])
AC_REQUIRE([K_PATH_X])
if test $kde_qtver = 2; then
LIB_KDECORE='-lkdecore'
AC_SUBST(LIB_KDECORE)
LIB_KDEUI='-lkdeui'
AC_SUBST(LIB_KDEUI)
LIB_KFORMULA='-lkformula'
AC_SUBST(LIB_KFORMULA)
LIB_KIO='-lkio'
AC_SUBST(LIB_KIO)
LIB_KSYCOCA='-lksycoca'
AC_SUBST(LIB_KSYCOCA)
LIB_SMB='-lsmb'
AC_SUBST(LIB_SMB)
LIB_KFILE='-lkfile'
AC_SUBST(LIB_KFILE)
LIB_KAB='-lkab'
AC_SUBST(LIB_KAB)
LIB_KHTML='-lkhtml'
AC_SUBST(LIB_KHTML)
LIB_KSPELL='-lkspell'
AC_SUBST(LIB_KSPELL)
LIB_KPARTS='-lkparts'
AC_SUBST(LIB_KPARTS)
LIB_KWRITE='-lkwrite'
AC_SUBST(LIB_KWRITE)
else
LIB_KDECORE='-lkdecore -lXext $(LIB_QT)'
AC_SUBST(LIB_KDECORE)
LIB_KDEUI='-lkdeui $(LIB_KDECORE)'
AC_SUBST(LIB_KDEUI)
LIB_KFM='-lkfm $(LIB_KDECORE)'
AC_SUBST(LIB_KFM)
LIB_KFILE='-lkfile $(LIB_KFM) $(LIB_KDEUI)'
AC_SUBST(LIB_KFILE)
LIB_KAB='-lkab $(LIB_KIMGIO) $(LIB_KDECORE)'
AC_SUBST(LIB_KAB)
fi
])
AC_DEFUN(KDE_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(KDE_SET_PATHS,
[
kde_cv_all_paths="kde_have_all_paths=\"yes\" \
kde_htmldir=\"$kde_htmldir\" \
kde_appsdir=\"$kde_appsdir\" \
kde_icondir=\"$kde_icondir\" \
kde_sounddir=\"$kde_sounddir\" \
kde_datadir=\"$kde_datadir\" \
kde_locale=\"$kde_locale\" \
kde_cgidir=\"$kde_cgidir\" \
kde_confdir=\"$kde_confdir\" \
kde_mimedir=\"$kde_mimedir\" \
kde_toolbardir=\"$kde_toolbardir\" \
kde_wallpaperdir=\"$kde_wallpaperdir\" \
kde_templatesdir=\"$kde_templatesdir\" \
kde_bindir=\"$kde_bindir\" \
kde_servicesdir=\"$kde_servicesdir\" \
kde_servicetypesdir=\"$kde_servicetypesdir\" \
kde_result=$1"
])
AC_DEFUN(KDE_SET_DEFAULT_PATHS,
[
if test "$1" = "default"; then
if test -z "$kde_htmldir"; then
kde_htmldir='\${prefix}/share/doc/HTML'
fi
if test -z "$kde_appsdir"; then
kde_appsdir='\${prefix}/share/applnk'
fi
if test -z "$kde_icondir"; then
kde_icondir='\${prefix}/share/icons'
fi
if test -z "$kde_sounddir"; then
kde_sounddir='\${prefix}/share/sounds'
fi
if test -z "$kde_datadir"; then
kde_datadir='\${prefix}/share/apps'
fi
if test -z "$kde_locale"; then
kde_locale='\${prefix}/share/locale'
fi
if test -z "$kde_cgidir"; then
kde_cgidir='\${exec_prefix}/cgi-bin'
fi
if test -z "$kde_confdir"; then
kde_confdir='\${prefix}/share/config'
fi
if test -z "$kde_mimedir"; then
kde_mimedir='\${prefix}/share/mimelnk'
fi
if test -z "$kde_toolbardir"; then
kde_toolbardir='\${prefix}/share/toolbar'
fi
if test -z "$kde_wallpaperdir"; then
kde_wallpaperdir='\${prefix}/share/wallpapers'
fi
if test -z "$kde_templatesdir"; then
kde_templatesdir='\${prefix}/share/templates'
fi
if test -z "$kde_bindir"; then
kde_bindir='\${exec_prefix}/bin'
fi
if test -z "$kde_servicesdir"; then
kde_servicesdir='\${prefix}/share/services'
fi
if test -z "$kde_servicetypesdir"; then
kde_servicetypesdir='\${prefix}/share/servicetypes'
fi
KDE_SET_PATHS(defaults)
else
if test $kde_qtver = 1; then
AC_MSG_RESULT([compiling])
KDE_1_CHECK_PATHS
else
AC_MSG_ERROR([path checking not yet supported for KDE 2])
fi
fi
])
AC_DEFUN(AC_CHECK_RPATH,
[
AC_MSG_CHECKING(for rpath)
AC_ARG_ENABLE(rpath,
[ --disable-rpath do not use the rpath feature of ld],
USE_RPATH=$enableval, USE_RPATH=yes)
if test -z "$KDE_RPATH" && test "$USE_RPATH" = "yes"; then
KDE_RPATH="-R \$(kde_libraries)"
if test -n "$qt_libraries"; then
KDE_RPATH="$KDE_RPATH -R \$(qt_libraries)"
fi
dnl $x_libraries is set to /usr/lib in case
if test -n "$X_LDFLAGS"; then
KDE_RPATH="$KDE_RPATH -R \$(x_libraries)"
fi
if test -n "$KDE_EXTRA_RPATH"; then
KDE_RPATH="$KDE_RPATH \$(KDE_EXTRA_RPATH)"
fi
fi
AC_SUBST(KDE_EXTRA_RPATH)
AC_SUBST(KDE_RPATH)
AC_MSG_RESULT($USE_RPATH)
])
AC_DEFUN(AC_CREATE_KFSSTND,
[
AC_REQUIRE([AC_CHECK_RPATH])
AC_MSG_CHECKING([for KDE paths])
kde_result=""
kde_cached_paths=yes
AC_CACHE_VAL(kde_cv_all_paths,
[
KDE_SET_DEFAULT_PATHS($1)
kde_cached_paths=no
])
eval "$kde_cv_all_paths"
KDE_CHECK_PATHS_FOR_COMPLETENESS
if test "$kde_have_all_paths" = "no" && test "$kde_cached_paths" = "yes"; then
# wrong values were cached, may be, we can set better ones
kde_result=
kde_htmldir= kde_appsdir= kde_icondir= kde_sounddir=
kde_datadir= kde_locale= kde_cgidir= kde_confdir=
kde_mimedir= kde_toolbardir= kde_wallpaperdir= kde_templatesdir=
kde_bindir= kde_servicesdir= kde_servicetypesdir= kde_have_all_paths=
KDE_SET_DEFAULT_PATHS($1)
eval "$kde_cv_all_paths"
KDE_CHECK_PATHS_FOR_COMPLETENESS
kde_result="$kde_result (cache overridden)"
fi
if test "$kde_have_all_paths" = "no"; then
AC_MSG_ERROR([configure could not run a little KDE program to test the environment.
Since it had compiled and linked before, it must be a strange problem on your system.
Look at config.log for details. If you are not able to fix this, look at
http://www.kde.org/faq/installation.html or any www.kde.org mirror.
(If you're using an egcs version on Linux, you may update binutils!)
])
else
rm -f conftest*
AC_MSG_RESULT($kde_result)
fi
bindir=$kde_bindir
KDE_SUBST_PROGRAMS
])
AC_DEFUN(AC_SUBST_KFSSTND,
[
AC_SUBST(kde_htmldir)
AC_SUBST(kde_appsdir)
AC_SUBST(kde_icondir)
AC_SUBST(kde_sounddir)
AC_SUBST(kde_datadir)
AC_SUBST(kde_locale)
AC_SUBST(kde_confdir)
AC_SUBST(kde_mimedir)
AC_SUBST(kde_wallpaperdir)
AC_SUBST(kde_bindir)
dnl for KDE 2
AC_SUBST(kde_templatesdir)
AC_SUBST(kde_servicesdir)
AC_SUBST(kde_servicetypesdir)
if test "$kde_qtver" = 1; then
kde_minidir="$kde_icondir/mini"
else
# for KDE 1 - this breaks KDE2 apps using minidir, but
# that's the plan ;-/
kde_minidir="/dev/null"
fi
dnl AC_SUBST(kde_minidir)
dnl AC_SUBST(kde_cgidir)
dnl AC_SUBST(kde_toolbardir)
])
AC_DEFUN(KDE_CHECK_EXTRA_LIBS,
[
AC_MSG_CHECKING(for extra includes)
AC_ARG_WITH(extra-includes, [ --with-extra-includes=DIR
adds non standard include paths],
kde_use_extra_includes="$withval",
kde_use_extra_includes=NONE
)
kde_extra_includes=
if test -n "$kde_use_extra_includes" && \
test "$kde_use_extra_includes" != "NONE"; then
ac_save_ifs=$IFS
IFS=':'
for dir in $kde_use_extra_includes; do
kde_extra_includes="$kde_extra_includes $dir"
USER_INCLUDES="$USER_INCLUDES -I$dir"
done
IFS=$ac_save_ifs
kde_use_extra_includes="added"
else
kde_use_extra_includes="no"
fi
AC_SUBST(USER_INCLUDES)
AC_MSG_RESULT($kde_use_extra_includes)
kde_extra_libs=
AC_MSG_CHECKING(for extra libs)
AC_ARG_WITH(extra-libs, [ --with-extra-libs=DIR adds non standard library paths],
kde_use_extra_libs=$withval,
kde_use_extra_libs=NONE
)
if test -n "$kde_use_extra_libs" && \
test "$kde_use_extra_libs" != "NONE"; then
ac_save_ifs=$IFS
IFS=':'
for dir in $kde_use_extra_libs; do
kde_extra_libs="$kde_extra_libs $dir"
KDE_EXTRA_RPATH="$KDE_EXTRA_RPATH -R $dir"
USER_LDFLAGS="$USER_LDFLAGS -L$dir"
done
IFS=$ac_save_ifs
kde_use_extra_libs="added"
else
kde_use_extra_libs="no"
fi
AC_SUBST(USER_LDFLAGS)
AC_MSG_RESULT($kde_use_extra_libs)
])
AC_DEFUN(AC_BASE_PATH_KDE,
[
AC_PREREQ([2.13])
AC_REQUIRE([AC_PATH_QT])dnl
AC_CHECK_RPATH
AC_MSG_CHECKING([for KDE])
if test "${prefix}" != NONE; then
kde_includes=${prefix}/include
ac_kde_includes=$prefix/include
if test "${exec_prefix}" != NONE; then
kde_libraries=${exec_prefix}/lib
ac_kde_libraries=$exec_prefix/lib
else
kde_libraries=${prefix}/lib
ac_kde_libraries=$prefix/lib
fi
else
ac_kde_includes=
ac_kde_libraries=
kde_libraries=""
kde_includes=""
fi
AC_CACHE_VAL(ac_cv_have_kde,
[#try to guess kde locations
if test -z "$1"; then
kde_incdirs="/usr/lib/kde/include /usr/local/kde/include /usr/kde/include /usr/include/kde /usr/include /opt/kde2/include /opt/kde/include $x_includes $qt_includes"
test -n "$KDEDIR2" && kde_incdirs="$KDEDIR2/include $KDEDIR2/include/kde $KDEDIR2 $kde_incdirs"
kde_incdirs="$ac_kde_includes $kde_incdirs"
AC_FIND_FILE(ksock.h, $kde_incdirs, kde_incdir)
ac_kde_includes="$kde_incdir"
if test -n "$ac_kde_includes" && test ! -r "$ac_kde_includes/ksock.h"; then
AC_MSG_WARN([
in the prefix, you've chosen, are no KDE headers installed. If you want compile
LinCVS with KDE2-support this will fail.
So, check this please and use another prefix!])
fi
kde_libdirs="/usr/lib/kde/lib /usr/local/kde/lib /usr/kde/lib /usr/lib/kde /usr/lib /usr/X11R6/lib /opt/kde2/lib /opt/kde/lib /usr/X11R6/kde/lib"
test -n "$KDEDIR2" && kde_libdirs="$KDEDIR2/lib $KDEDIR2 $kde_libdirs"
kde_libdirs="$ac_kde_libraries $kde_libdirs"
AC_FIND_FILE(libkdecore.la, $kde_libdirs, kde_libdir)
ac_kde_libraries="$kde_libdir"
if test -n "$ac_kde_libraries" && test ! -r "$ac_kde_libraries/libkdecore.la"; then
AC_MSG_WARN([
in the prefix, you've chosen, are no KDE libraries installed. If you want compile
LinCVS with KDE2-support this will fail.
So, check this please and use another prefix!])
fi
ac_kde_libraries="$kde_libdir"
if test "$ac_kde_includes" = NO || test "$ac_kde_libraries" = NO; then
ac_cv_have_kde="have_kde=no"
else
ac_cv_have_kde="have_kde=yes \
ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
fi
else dnl test -z $1
ac_cv_have_kde="have_kde=no"
fi
])dnl
eval "$ac_cv_have_kde"
if test "$have_kde" != "yes"; then
if test "${prefix}" = NONE; then
ac_kde_prefix="$ac_default_prefix"
else
ac_kde_prefix="$prefix"
fi
if test "$exec_prefix" = NONE; then
ac_kde_exec_prefix="$ac_kde_prefix"
AC_MSG_RESULT([will be installed in $ac_kde_prefix])
else
ac_kde_exec_prefix="$exec_prefix"
AC_MSG_RESULT([will be installed in $ac_kde_prefix and $ac_kde_exec_prefix])
fi
kde_libraries="${ac_kde_exec_prefix}/lib"
kde_includes=${ac_kde_prefix}/include
else
ac_cv_have_kde="have_kde=yes \
ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
AC_MSG_RESULT([libraries $ac_kde_libraries, headers $ac_kde_includes])
kde_libraries="$ac_kde_libraries"
kde_includes="$ac_kde_includes"
fi
AC_SUBST(kde_libraries)
AC_SUBST(kde_includes)
if test "$kde_includes" = "$x_includes" || test "$kde_includes" = "$qt_includes" ; then
KDE_INCLUDES=""
else
KDE_INCLUDES="-I$kde_includes"
all_includes="$KDE_INCLUDES $all_includes"
fi
KDE_LDFLAGS="-L$kde_libraries"
if test ! "$kde_libraries" = "$x_libraries" && test ! "$kde_libraries" = "$qt_libraries" ; then
all_libraries="$all_libraries $KDE_LDFLAGS"
fi
AC_SUBST(KDE_LDFLAGS)
AC_SUBST(KDE_INCLUDES)
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
all_libraries="$all_libraries $USER_LDFLAGS"
all_includes="$all_includes $USER_INCLUDES"
AC_SUBST(all_includes)
AC_SUBST(all_libraries)
AC_SUBST(AUTODIRS)
])
AC_DEFUN(AC_PATH_KDE,
[
AC_BASE_PATH_KDE
AC_ARG_ENABLE(path-check, [ --disable-path-check don't try to find out, where to install],
[
if test "$enableval" = "no";
then ac_use_path_checking="default"
else ac_use_path_checking=""
fi
],
[
if test "$kde_qtver" = 1;
then ac_use_path_checking=""
else ac_use_path_checking="default"
fi
]
)
AC_CREATE_KFSSTND($ac_use_path_checking)
AC_SUBST_KFSSTND
KDE_CREATE_LIBS_ALIASES
])
dnl ------------------------------------------------------------------------
dnl Try to find the Qt headers and libraries.
dnl $(QT_LDFLAGS) will be -Lqtliblocation (if needed)
dnl and $(QT_INCLUDES) will be -Iqthdrlocation (if needed)
dnl ------------------------------------------------------------------------
dnl
AC_DEFUN(AC_PATH_QT,
[
AC_REQUIRE([K_PATH_X])
AC_REQUIRE([KDE_USE_QT])
dnl ------------------------------------------------------------------------
dnl Add configure flag to enable linking to MT version of Qt library.
dnl ------------------------------------------------------------------------
AC_ARG_ENABLE(
mt,
[ --enable-mt link to threaded Qt (experimental)],
kde_use_qt_mt=$enableval,
kde_use_qt_mt=yes
)
USING_QT_MT=""
dnl ------------------------------------------------------------------------
dnl If we got --enable-qt-mt then adjust some vars for the host.
dnl ------------------------------------------------------------------------
if test "x$kde_use_qt_mt" = "xyes"; then
case $host in
*-*-linux-*)
if test "x$GCC" = "xyes"; then
CPPFLAGS="$CPPFLAGS -DQT_THREAD_SUPPORT -pthread"
X_EXTRA_LIBS="$X_EXTRA_LIBS -pthread"
else
AC_MSG_WARN([Compiler is not gcc. MT support disabled.])
fi
;;
*)
AC_MSG_WARN([MT not yet supported on $host - disabled.])
;;
esac
fi
kde_qt_was_given=yes
dnl ------------------------------------------------------------------------
dnl If we haven't been told how to link to Qt, we work it out for ourselves.
dnl ------------------------------------------------------------------------
LIBQT_GLOB="libqt.*"
if test -z "$LIBQT"; then
LIBQT="-lqt"
kde_int_qt="-lqt"
dnl ------------------------------------------------------------------------
dnl If we got --enable-qt-mt then adjust the Qt library name for the host.
dnl ------------------------------------------------------------------------
if test "x$kde_use_qt_mt" = "xyes"; then
case $host in
*-*-linux-*)
if test "x$GCC" = "xyes"; then
LIBQT="-lqt-mt"
kde_int_qt="-lqt-mt"
LIBQT_GLOB="libqt-mt.*"
USING_QT_MT="using -mt"
fi
;;
esac
fi
kde_qt_was_given=no
else
kde_int_qt="$LIBQT"
fi
AC_MSG_CHECKING([for Qt])
LIBQT="$LIBQT $X_PRE_LIBS -lXext -lX11 $LIBSM $LIBSOCKET"
ac_qt_includes=NO ac_qt_libraries=NO ac_qt_bindir=NO
qt_libraries=""
qt_includes=""
AC_ARG_WITH(qt-dir,
[ --with-qt-dir=DIR where the root of Qt is installed ],
[ ac_qt_includes="$withval"/include
ac_qt_libraries="$withval"/lib
ac_qt_bindir="$withval"/bin
])
AC_ARG_WITH(qt-includes,
[ --with-qt-includes=DIR where the Qt includes are. ],
[
ac_qt_includes="$withval"
])
kde_qt_libs_given=no
AC_ARG_WITH(qt-libraries,
[ --with-qt-libraries=DIR where the Qt library is installed.],
[ ac_qt_libraries="$withval"
kde_qt_libs_given=yes
])
AC_CACHE_VAL(ac_cv_have_qt,
[#try to guess Qt locations
qt_incdirs=""
for dir in $kde_qt_dirs; do
qt_incdirs="$qt_incdirs $dir/include $dir"
done
qt_incdirs="$QTINC $qt_incdirs /usr/local/qt/include /usr/include/qt /usr/include /usr/X11R6/include/X11/qt /usr/X11R6/include/qt $x_includes"
if test ! "$ac_qt_includes" = "NO"; then
qt_incdirs="$ac_qt_includes $qt_incdirs"
fi
if test "$kde_qtver" = "2"; then
kde_qt_header=qstyle.h
else
kde_qt_header=qglobal.h
fi
AC_FIND_FILE($kde_qt_header, $qt_incdirs, qt_incdir)
ac_qt_includes="$qt_incdir"
qt_libdirs=""
for dir in $kde_qt_dirs; do
qt_libdirs="$qt_libdirs $dir/lib $dir"
done
qt_libdirs="$QTLIB $qt_libdirs /usr/X11R6/lib /usr/lib /usr/local/qt/lib $x_libraries"
if test ! "$ac_qt_libraries" = "NO"; then
qt_libdir=$ac_qt_libraries
else
qt_libdirs="$ac_qt_libraries $qt_libdirs"
# if the Qt was given, the chance is too big that libqt.* doesn't exist
qt_libdir=NONE
for dir in $qt_libdirs; do
try="ls -1 $dir/${LIBQT_GLOB}"
if test -n "`$try 2> /dev/null`"; then qt_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
done
fi
ac_qt_libraries="$qt_libdir"
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
ac_cxxflags_safe="$CXXFLAGS"
ac_ldflags_safe="$LDFLAGS"
ac_libs_safe="$LIBS"
CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
LDFLAGS="$LDFLAGS -L$qt_libdir $all_libraries $USER_LDFLAGS"
LIBS="$LIBS $LIBQT"
KDE_PRINT_QT_PROGRAM
if AC_TRY_EVAL(ac_link) && test -s conftest; then
rm -f conftest*
else
echo "configure: failed program was:" >&AC_FD_CC
cat conftest.$ac_ext >&AC_FD_CC
ac_qt_libraries="NO"
fi
rm -f conftest*
CXXFLAGS="$ac_cxxflags_safe"
LDFLAGS="$ac_ldflags_safe"
LIBS="$ac_libs_safe"
AC_LANG_RESTORE
if test "$ac_qt_includes" = NO || test "$ac_qt_libraries" = NO; then
ac_cv_have_qt="have_qt=no"
ac_qt_notfound=""
if test "$ac_qt_includes" = NO; then
if test "$ac_qt_libraries" = NO; then
ac_qt_notfound="(headers and libraries)";
else
ac_qt_notfound="(headers)";
fi
else
ac_qt_notfound="(libraries)";
fi
AC_MSG_ERROR([Qt ($kde_qt_minversion) $ac_qt_notfound not found. Please check your installation!
For more details about this problem, look at the end of config.log.])
else
have_qt="yes"
fi
])
eval "$ac_cv_have_qt"
if test "$have_qt" != yes; then
AC_MSG_RESULT([$have_qt]);
else
ac_cv_have_qt="have_qt=yes \
ac_qt_includes=$ac_qt_includes ac_qt_libraries=$ac_qt_libraries"
AC_MSG_RESULT([libraries $ac_qt_libraries, headers $ac_qt_includes $USING_QT_MT])
qt_libraries="$ac_qt_libraries"
qt_includes="$ac_qt_includes"
fi
if test ! "$kde_qt_libs_given" = "yes"; then
KDE_CHECK_QT_DIRECT(qt_libraries= ,[])
fi
AC_SUBST(qt_libraries)
AC_SUBST(qt_includes)
if test "$qt_includes" = "$x_includes" || test -z "$qt_includes"; then
QT_INCLUDES="";
else
QT_INCLUDES="-I$qt_includes"
all_includes="$QT_INCLUDES $all_includes"
fi
if test "$qt_libraries" = "$x_libraries" || test -z "$qt_libraries"; then
QT_LDFLAGS=""
else
QT_LDFLAGS="-L$qt_libraries"
all_libraries="$all_libraries $QT_LDFLAGS"
fi
AC_SUBST(all_includes)
AC_SUBST(QT_INCLUDES)
AC_SUBST(all_libraries)
AC_SUBST(QT_LDFLAGS)
AC_PATH_QT_MOC_UIC
LIB_QT="$kde_int_qt "'-lXext $(LIB_X11) $(LIBSM)'
AC_SUBST(LIB_QT)
])
dnl KDE_FIND_PATH(programm-name, variable-name, list of directories,
dnl if-not-found, test-parameter)
AC_DEFUN(KDE_FIND_PATH,
[
AC_MSG_CHECKING([for $1])
if test -n "$$2"; then
kde_cv_path="$$2";
else
kde_cache=`echo $1 | sed 'y%./+-%__p_%'`
AC_CACHE_VAL(kde_cv_path_$kde_cache,
[
kde_cv_path="NONE"
dirs="$3"
kde_save_IFS=$IFS
IFS=':'
for dir in $PATH; do
dirs="$dirs $dir"
done
IFS=$kde_save_IFS
for dir in $dirs; do
if test -x "$dir/$1"; then
if test -n "$5"
then
evalstr="$dir/$1 $5 2>&1 "
if eval $evalstr; then
kde_cv_path="$dir/$1"
break
fi
else
kde_cv_path="$dir/$1"
break
fi
fi
done
eval "kde_cv_path_$kde_cache=$kde_cv_path"
])
eval "kde_cv_path=\"`echo '$kde_cv_path_'$kde_cache`\""
fi
if test -z "$kde_cv_path" || test "$kde_cv_path" = NONE; then
AC_MSG_RESULT(not found)
$4
else
AC_MSG_RESULT($kde_cv_path)
$2=$kde_cv_path
fi
])
AC_DEFUN(KDE_MOC_ERROR_MESSAGE,
[
AC_MSG_ERROR([No Qt meta object compiler (moc) found!
Please check whether you installed Qt correctly.
You need to have a running moc binary.
configure tried to run $ac_cv_path_moc and the test didn't
succeed. If configure shouldn't have tried this one, set
the environment variable MOC to the right one before running
configure.
])
])
AC_DEFUN(KDE_UIC_ERROR_MESSAGE,
[
AC_MSG_WARN([No Qt ui compiler (uic) found!
Please check whether you installed Qt correctly.
You need to have a running uic binary.
configure tried to run $ac_cv_path_uic and the test didn't
succeed. If configure shouldn't have tried this one, set
the environment variable UIC to the right one before running
configure.
])
])
dnl ------------------------------------------------------------------------
dnl Find the meta object compiler and the ui compiler in the PATH,
dnl in $QTDIR/bin, and some more usual places
dnl ------------------------------------------------------------------------
dnl
AC_DEFUN(AC_PATH_QT_MOC_UIC,
[
AC_REQUIRE([KDE_USE_QT])
AC_MSG_CHECKING([if Qt compiles without flags])
qt_bindirs=""
for dir in $kde_qt_dirs; do
qt_bindirs="$qt_bindirs $dir/bin $dir/src/moc"
done
qt_bindirs="$qt_bindirs /usr/bin /usr/X11R6/bin /usr/local/qt/bin"
if test ! "$ac_qt_bindir" = "NO"; then
qt_bindirs="$ac_qt_bindir $qt_bindirs"
fi
KDE_FIND_PATH(moc, MOC, [$qt_bindirs], [KDE_MOC_ERROR_MESSAGE])
KDE_FIND_PATH(uic, UIC, [$qt_bindirs], [UIC="" ; KDE_UIC_ERROR_MESSAGE])
if test -z "$UIC" ; then
if test -z "$UIC_NOT_NEEDED" ; then
exit 1
else
UIC="echo uic not available: "
fi
fi
AC_SUBST(MOC)
AC_SUBST(UIC)
])
AC_DEFUN(KDE_CHECK_QT_DIRECT,
[
AC_REQUIRE([KDE_USE_QT])
AC_MSG_CHECKING([if Qt compiles without flags])
AC_CACHE_VAL(kde_cv_qt_direct,
[
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
ac_LD_LIBRARY_PATH_safe=$LD_LIBRARY_PATH
ac_LIBRARY_PATH="$LIBRARY_PATH"
ac_cxxflags_safe="$CXXFLAGS"
ac_ldflags_safe="$LDFLAGS"
ac_libs_safe="$LIBS"
CXXFLAGS="$CXXFLAGS -I$qt_includes"
LDFLAGS="$LDFLAGS $X_LDFLAGS"
LIBS="$LIBQT -lXext -lX11 $LIBSOCKET"
LD_LIBRARY_PATH=
export LD_LIBRARY_PATH
LIBRARY_PATH=
export LIBRARY_PATH
KDE_PRINT_QT_PROGRAM
if AC_TRY_EVAL(ac_link) && test -s conftest; then
kde_cv_qt_direct="yes"
else
kde_cv_qt_direct="no"
echo "configure: failed program was:" >&AC_FD_CC
cat conftest.$ac_ext >&AC_FD_CC
fi
rm -f conftest*
CXXFLAGS="$ac_cxxflags_safe"
LDFLAGS="$ac_ldflags_safe"
LIBS="$ac_libs_safe"
LD_LIBRARY_PATH="$ac_LD_LIBRARY_PATH_safe"
export LD_LIBRARY_PATH
LIBRARY_PATH="$ac_LIBRARY_PATH"
export LIBRARY_PATH
AC_LANG_RESTORE
])
if test "$kde_cv_qt_direct" = "yes"; then
AC_MSG_RESULT(yes)
$1
else
AC_MSG_RESULT(no)
$2
fi
])
AC_DEFUN(KDE_MISSING_PROG_ERROR,
[
AC_MSG_WARN([The important program $1 was not found!
If you want compile LinCVS with KDE2-support this will fail.
Please check whether you installed KDE correctly.
])
])
AC_DEFUN(AC_CHECK_BOOL,
[
AC_MSG_CHECKING([for bool])
AC_CACHE_VAL(ac_cv_have_bool,
[
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([],
[bool aBool = true;],
[ac_cv_have_bool="yes"],
[ac_cv_have_bool="no"])
AC_LANG_RESTORE
]) dnl end AC_CHECK_VAL
AC_MSG_RESULT($ac_cv_have_bool)
if test "$ac_cv_have_bool" = "yes"; then
AC_DEFINE(HAVE_BOOL, 1, [Define if the C++ compiler supports BOOL])
fi
])
AC_DEFUN(KDE_MISC_TESTS,
[
AC_LANG_C
dnl Checks for libraries.
AC_CHECK_LIB(compat, main, [LIBCOMPAT="-lcompat"]) dnl for FreeBSD
AC_SUBST(LIBCOMPAT)
kde_have_crypt=
AC_CHECK_LIB(crypt, crypt, [LIBCRYPT="-lcrypt"; kde_have_crypt=yes],
AC_CHECK_LIB(c, crypt, [kde_have_crypt=yes], [
AC_MSG_WARN([you have no crypt in either libcrypt or libc.
You should install libcrypt from another source or configure with PAM
support])
kde_have_crypt=no
]))
AC_SUBST(LIBCRYPT)
if test $kde_have_crypt = yes; then
AC_DEFINE_UNQUOTED(HAVE_CRYPT, 1, [Defines if your system has the crypt function])
fi
dnl AC_CHECK_KSIZE_T
AC_LANG_C
AC_CHECK_LIB(dnet, dnet_ntoa, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"])
if test $ac_cv_lib_dnet_dnet_ntoa = no; then
AC_CHECK_LIB(dnet_stub, dnet_ntoa,
[X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"])
fi
AC_CHECK_FUNC(inet_ntoa)
if test $ac_cv_func_inet_ntoa = no; then
AC_CHECK_LIB(nsl, inet_ntoa, X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl")
fi
AC_CHECK_FUNC(connect)
if test $ac_cv_func_connect = no; then
AC_CHECK_LIB(socket, connect, X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS", ,
$X_EXTRA_LIBS)
fi
AC_CHECK_FUNC(remove)
if test $ac_cv_func_remove = no; then
AC_CHECK_LIB(posix, remove, X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix")
fi
# BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
AC_CHECK_FUNC(shmat)
if test $ac_cv_func_shmat = no; then
AC_CHECK_LIB(ipc, shmat, X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc")
fi
LIBSOCKET="$X_EXTRA_LIBS"
AC_SUBST(LIBSOCKET)
AC_SUBST(X_EXTRA_LIBS)
AC_CHECK_LIB(ucb, killpg, [LIBUCB="-lucb"]) dnl for Solaris2.4
AC_SUBST(LIBUCB)
case $host in dnl this *is* LynxOS specific
*-*-lynxos* )
AC_MSG_CHECKING([LynxOS header file wrappers])
[CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__"]
AC_MSG_RESULT(disabled)
AC_CHECK_LIB(bsd, gethostbyname, [LIBSOCKET="-lbsd"]) dnl for LynxOS
;;
esac
KDE_CHECK_TYPES
dnl KDE_CHECK_LIBDL
AC_CHECK_BOOL
])
AC_DEFUN(KDE_CHECK_TYPES,
[ AC_CHECK_SIZEOF(int, 4)dnl
AC_CHECK_SIZEOF(long, 4)dnl
AC_CHECK_SIZEOF(char *, 4)dnl
])dnl
dnl ------------------------------------------------------------------------
dnl Find the header files and libraries for X-Windows. Extended the
dnl macro AC_PATH_X
dnl ------------------------------------------------------------------------
dnl
AC_DEFUN(K_PATH_X,
[
AC_REQUIRE([AC_PROG_CPP])dnl
AC_REQUIRE([KDE_MISC_TESTS])dnl
AC_MSG_CHECKING(for X)
AC_LANG_SAVE
AC_LANG_C
AC_CACHE_VAL(kde_cv_have_x,
[# One or both of the vars are not set, and there is no cached value.
if test "{$x_includes+set}" = set || test "$x_includes" = NONE; then
kde_x_includes=NO
else
kde_x_includes=$x_includes
fi
if test "{$x_libraries+set}" = set || test "$x_libraries" = NONE; then
kde_x_libraries=NO
else
kde_x_libraries=$x_libraries
fi
# below we use the standard autoconf calls
ac_x_libraries=$kde_x_libraries
ac_x_includes=$kde_x_includes
AC_PATH_X_DIRECT
dnl AC_PATH_X_XMKMF picks /usr/lib as the path for the X libraries.
dnl Unfortunately, if compiling with the N32 ABI, this is not the correct
dnl location. The correct location is /usr/lib32 or an undefined value
dnl (the linker is smart enough to pick the correct default library).
dnl Things work just fine if you use just AC_PATH_X_DIRECT.
case "$host" in
mips-sgi-irix6*)
;;
*)
AC_PATH_X_XMKMF
if test -z "$ac_x_includes"; then
ac_x_includes="."
fi
if test -z "$ac_x_libraries"; then
ac_x_libraries="/usr/lib"
fi
esac
#from now on we use our own again
# when the user already gave --x-includes, we ignore
# what the standard autoconf macros told us.
if test "$kde_x_includes" = NO; then
kde_x_includes=$ac_x_includes
fi
# for --x-libraries too
if test "$kde_x_libraries" = NO; then
kde_x_libraries=$ac_x_libraries
fi
if test "$kde_x_includes" = NO; then
AC_MSG_ERROR([Can't find X includes. Please check your installation and add the correct paths!])
fi
if test "$kde_x_libraries" = NO; then
AC_MSG_ERROR([Can't find X libraries. Please check your installation and add the correct paths!])
fi
# Record where we found X for the cache.
kde_cv_have_x="have_x=yes \
kde_x_includes=$kde_x_includes kde_x_libraries=$kde_x_libraries"
])dnl
eval "$kde_cv_have_x"
if test "$have_x" != yes; then
AC_MSG_RESULT($have_x)
no_x=yes
else
AC_MSG_RESULT([libraries $kde_x_libraries, headers $kde_x_includes])
fi
if test -z "$kde_x_includes" || test "x$kde_x_includes" = xNONE; then
X_INCLUDES=""
x_includes="."; dnl better than nothing :-
else
x_includes=$kde_x_includes
X_INCLUDES="-I$x_includes"
fi
if test -z "$kde_x_libraries" || test "x$kde_x_libraries" = xNONE; then
X_LDFLAGS=""
x_libraries="/usr/lib"; dnl better than nothing :-
else
x_libraries=$kde_x_libraries
X_LDFLAGS="-L$x_libraries"
fi
all_includes="$X_INCLUDES"
all_libraries="$X_LDFLAGS"
AC_SUBST(X_INCLUDES)
AC_SUBST(X_LDFLAGS)
AC_SUBST(x_libraries)
AC_SUBST(x_includes)
# Check for libraries that X11R6 Xt/Xaw programs need.
ac_save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS $X_LDFLAGS"
# SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
# check for ICE first), but we must link in the order -lSM -lICE or
# we get undefined symbols. So assume we have SM if we have ICE.
# These have to be linked with before -lX11, unlike the other
# libraries we check for below, so use a different variable.
# --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
AC_CHECK_LIB(ICE, IceConnectionNumber,
[LIBSM="-lSM -lICE"], , $X_EXTRA_LIBS)
AC_SUBST(LIBSM)
LDFLAGS="$ac_save_LDFLAGS"
AC_SUBST(X_PRE_LIBS)
LIB_X11='-lX11 $(LIBSOCKET)'
AC_SUBST(LIB_X11)
AC_MSG_CHECKING(for libXext)
AC_CACHE_VAL(kde_cv_have_libXext,
[
kde_ldflags_safe="$LDFLAGS"
kde_libs_safe="$LIBS"
LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS"
LIBS="-lXext -lX11 $LIBSOCKET"
AC_TRY_LINK([
#include <stdio.h>
],
[
printf("hello Xext\n");
],
kde_cv_have_libXext=yes,
kde_cv_have_libXext=no
)
LDFLAGS=$kde_ldflags_safe
LIBS=$kde_libs_safe
])
AC_MSG_RESULT($kde_cv_have_libXext)
if test "$kde_cv_have_libXext" = "no"; then
AC_MSG_ERROR([We need a working libXext to proceed. Since configure
can't find it itself, we stop here assuming that make wouldn't find
them either.])
fi
])
AC_LANG_RESTORE
])
AC_DEFUN(KDE_PRINT_QT_PROGRAM,
[
AC_REQUIRE([KDE_USE_QT])
cat > conftest.$ac_ext <<EOF
#include "confdefs.h"
#include <qglobal.h>
#include <qapplication.h>
#include <qapp.h>
#include <qobjcoll.h>
EOF
if test "$kde_qtver" = "2"; then
cat >> conftest.$ac_ext <<EOF
#include <qevent.h>
#include <qstring.h>
#include <qstyle.h>
EOF
if test $kde_qtsubver -gt 0; then
cat >> conftest.$ac_ext <<EOF
#include <qiconview.h>
EOF
fi
fi
echo "#if ! ($kde_qt_verstring)" >> conftest.$ac_ext
cat >> conftest.$ac_ext <<EOF
#error 1
#endif
int main() {
EOF
if test "$kde_qtver" = "2"; then
cat >> conftest.$ac_ext <<EOF
QStringList *t = new QStringList();
EOF
if test $kde_qtsubver -gt 0; then
cat >> conftest.$ac_ext <<EOF
QIconView iv(0);
iv.setWordWrapIconText(false);
QString s;
s.setLatin1("Elvis is alive", 14);
int magnolia = QEvent::Speech; /* new in 2.2 beta2 */
EOF
fi
fi
cat >> conftest.$ac_ext <<EOF
return 0;
}
EOF
])
dnl ######################################################################
dnl AC_MSG: a simple printout message
define(AC_MSG,
[echo "*** $1:" 1>&AC_FD_MSG])
dnl ======================================================================
|