KTechlab – circuit simulator for microcontrollers and electronics
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

11631 lines
358 KiB

  1. ## -*- autoconf -*-
  2. dnl This file is part of the KDE libraries/packages
  3. dnl Copyright (C) 1997 Janos Farkas (chexum@shadow.banki.hu)
  4. dnl (C) 1997,98,99 Stephan Kulow (coolo@kde.org)
  5. dnl This file is free software; you can redistribute it and/or
  6. dnl modify it under the terms of the GNU Library General Public
  7. dnl License as published by the Free Software Foundation; either
  8. dnl version 2 of the License, or (at your option) any later version.
  9. dnl This library is distributed in the hope that it will be useful,
  10. dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. dnl Library General Public License for more details.
  13. dnl You should have received a copy of the GNU Library General Public License
  14. dnl along with this library; see the file COPYING.LIB. If not, write to
  15. dnl the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  16. dnl Boston, MA 02110-1301, USA.
  17. dnl IMPORTANT NOTE:
  18. dnl Please do not modify this file unless you expect your modifications to be
  19. dnl carried into every other module in the repository.
  20. dnl
  21. dnl Single-module modifications are best placed in configure.in for tdelibs
  22. dnl and tdebase or configure.in.in if present.
  23. # KDE_PATH_X_DIRECT
  24. dnl Internal subroutine of AC_PATH_X.
  25. dnl Set ac_x_includes and/or ac_x_libraries.
  26. AC_DEFUN([KDE_PATH_X_DIRECT],
  27. [
  28. AC_REQUIRE([KDE_CHECK_LIB64])
  29. if test "$ac_x_includes" = NO; then
  30. # Guess where to find include files, by looking for this one X11 .h file.
  31. test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
  32. # First, try using that file with no special directory specified.
  33. AC_TRY_CPP([#include <$x_direct_test_include>],
  34. [# We can compile using X headers with no special include directory.
  35. ac_x_includes=],
  36. [# Look for the header file in a standard set of common directories.
  37. # Check X11 before X11Rn because it is often a symlink to the current release.
  38. for ac_dir in \
  39. /usr/X11/include \
  40. /usr/X11R6/include \
  41. /usr/X11R5/include \
  42. /usr/X11R4/include \
  43. \
  44. /usr/include/X11 \
  45. /usr/include/X11R6 \
  46. /usr/include/X11R5 \
  47. /usr/include/X11R4 \
  48. \
  49. /usr/local/X11/include \
  50. /usr/local/X11R6/include \
  51. /usr/local/X11R5/include \
  52. /usr/local/X11R4/include \
  53. \
  54. /usr/local/include/X11 \
  55. /usr/local/include/X11R6 \
  56. /usr/local/include/X11R5 \
  57. /usr/local/include/X11R4 \
  58. \
  59. /usr/X386/include \
  60. /usr/x386/include \
  61. /usr/XFree86/include/X11 \
  62. \
  63. /usr/include \
  64. /usr/local/include \
  65. /usr/unsupported/include \
  66. /usr/athena/include \
  67. /usr/local/x11r5/include \
  68. /usr/lpp/Xamples/include \
  69. \
  70. /usr/openwin/include \
  71. /usr/openwin/share/include \
  72. ; \
  73. do
  74. if test -r "$ac_dir/$x_direct_test_include"; then
  75. ac_x_includes=$ac_dir
  76. break
  77. fi
  78. done])
  79. fi # $ac_x_includes = NO
  80. if test "$ac_x_libraries" = NO; then
  81. # Check for the libraries.
  82. test -z "$x_direct_test_library" && x_direct_test_library=Xt
  83. test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
  84. # See if we find them without any special options.
  85. # Don't add to $LIBS permanently.
  86. ac_save_LIBS="$LIBS"
  87. LIBS="-l$x_direct_test_library $LIBS"
  88. AC_TRY_LINK([#include <X11/Intrinsic.h>], [${x_direct_test_function}(1)],
  89. [LIBS="$ac_save_LIBS"
  90. # We can link X programs with no special library path.
  91. ac_x_libraries=],
  92. [LIBS="$ac_save_LIBS"
  93. # First see if replacing the include by lib works.
  94. # Check X11 before X11Rn because it is often a symlink to the current release.
  95. for ac_dir in `echo "$ac_x_includes" | sed s/include/lib${tdelibsuff}/` \
  96. /usr/X11/lib${tdelibsuff} \
  97. /usr/X11R6/lib${tdelibsuff} \
  98. /usr/X11R5/lib${tdelibsuff} \
  99. /usr/X11R4/lib${tdelibsuff} \
  100. \
  101. /usr/lib${tdelibsuff}/X11 \
  102. /usr/lib${tdelibsuff}/X11R6 \
  103. /usr/lib${tdelibsuff}/X11R5 \
  104. /usr/lib${tdelibsuff}/X11R4 \
  105. \
  106. /usr/local/X11/lib${tdelibsuff} \
  107. /usr/local/X11R6/lib${tdelibsuff} \
  108. /usr/local/X11R5/lib${tdelibsuff} \
  109. /usr/local/X11R4/lib${tdelibsuff} \
  110. \
  111. /usr/local/lib${tdelibsuff}/X11 \
  112. /usr/local/lib${tdelibsuff}/X11R6 \
  113. /usr/local/lib${tdelibsuff}/X11R5 \
  114. /usr/local/lib${tdelibsuff}/X11R4 \
  115. \
  116. /usr/X386/lib${tdelibsuff} \
  117. /usr/x386/lib${tdelibsuff} \
  118. /usr/XFree86/lib${tdelibsuff}/X11 \
  119. \
  120. /usr/lib${tdelibsuff} \
  121. /usr/local/lib${tdelibsuff} \
  122. /usr/unsupported/lib${tdelibsuff} \
  123. /usr/athena/lib${tdelibsuff} \
  124. /usr/local/x11r5/lib${tdelibsuff} \
  125. /usr/lpp/Xamples/lib${tdelibsuff} \
  126. /lib/usr/lib${tdelibsuff}/X11 \
  127. \
  128. /usr/openwin/lib${tdelibsuff} \
  129. /usr/openwin/share/lib${tdelibsuff} \
  130. ; \
  131. do
  132. dnl Don't even attempt the hair of trying to link an X program!
  133. for ac_extension in a so sl; do
  134. if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
  135. ac_x_libraries=$ac_dir
  136. break 2
  137. fi
  138. done
  139. done])
  140. fi # $ac_x_libraries = NO
  141. ])
  142. dnl ------------------------------------------------------------------------
  143. dnl Find a file (or one of more files in a list of dirs)
  144. dnl ------------------------------------------------------------------------
  145. dnl
  146. AC_DEFUN([AC_FIND_FILE],
  147. [
  148. $3=NO
  149. for i in $2;
  150. do
  151. for j in $1;
  152. do
  153. echo "configure: __oline__: $i/$j" >&AC_FD_CC
  154. if test -r "$i/$j"; then
  155. echo "taking that" >&AC_FD_CC
  156. $3=$i
  157. break 2
  158. fi
  159. done
  160. done
  161. ])
  162. dnl KDE_FIND_PATH(program-name, variable-name, list-of-dirs,
  163. dnl if-not-found, test-parameter, prepend-path)
  164. dnl
  165. dnl Look for program-name in list-of-dirs+$PATH.
  166. dnl If prepend-path is set, look in $PATH+list-of-dirs instead.
  167. dnl If found, $variable-name is set. If not, if-not-found is evaluated.
  168. dnl test-parameter: if set, the program is executed with this arg,
  169. dnl and only a successful exit code is required.
  170. AC_DEFUN([KDE_FIND_PATH],
  171. [
  172. AC_MSG_CHECKING([for $1])
  173. if test -n "$$2"; then
  174. kde_cv_path="$$2";
  175. else
  176. kde_cache=`echo $1 | sed 'y%./+-%__p_%'`
  177. AC_CACHE_VAL(kde_cv_path_$kde_cache,
  178. [
  179. kde_cv_path="NONE"
  180. kde_save_IFS=$IFS
  181. IFS=':'
  182. dirs=""
  183. for dir in $PATH; do
  184. dirs="$dirs $dir"
  185. done
  186. if test -z "$6"; then dnl Append dirs in PATH (default)
  187. dirs="$3 $dirs"
  188. else dnl Prepend dirs in PATH (if 6th arg is set)
  189. dirs="$dirs $3"
  190. fi
  191. IFS=$kde_save_IFS
  192. for dir in $dirs; do
  193. if test -x "$dir/$1"; then
  194. if test -n "$5"
  195. then
  196. evalstr="$dir/$1 $5 2>&1 "
  197. if eval $evalstr; then
  198. kde_cv_path="$dir/$1"
  199. break
  200. fi
  201. else
  202. kde_cv_path="$dir/$1"
  203. break
  204. fi
  205. fi
  206. done
  207. eval "kde_cv_path_$kde_cache=$kde_cv_path"
  208. ])
  209. eval "kde_cv_path=\"`echo '$kde_cv_path_'$kde_cache`\""
  210. fi
  211. if test -z "$kde_cv_path" || test "$kde_cv_path" = NONE; then
  212. AC_MSG_RESULT(not found)
  213. $4
  214. else
  215. AC_MSG_RESULT($kde_cv_path)
  216. $2=$kde_cv_path
  217. fi
  218. ])
  219. AC_DEFUN([KDE_MOC_ERROR_MESSAGE],
  220. [
  221. AC_MSG_ERROR([No Qt meta object compiler (moc) found!
  222. Please check whether you installed Qt correctly.
  223. You need to have a running moc binary.
  224. configure tried to run $ac_cv_path_moc and the test didn't
  225. succeed. If configure shouldn't have tried this one, set
  226. the environment variable MOC to the right one before running
  227. configure.
  228. ])
  229. ])
  230. AC_DEFUN([KDE_UIC_ERROR_MESSAGE],
  231. [
  232. AC_MSG_WARN([No Qt ui compiler (uic) found!
  233. Please check whether you installed Qt correctly.
  234. You need to have a running uic binary.
  235. configure tried to run $ac_cv_path_uic and the test didn't
  236. succeed. If configure shouldn't have tried this one, set
  237. the environment variable UIC to the right one before running
  238. configure.
  239. ])
  240. ])
  241. AC_DEFUN([KDE_CHECK_UIC_FLAG],
  242. [
  243. AC_MSG_CHECKING([whether uic supports -$1 ])
  244. kde_cache=`echo $1 | sed 'y% .=/+-%____p_%'`
  245. AC_CACHE_VAL(kde_cv_prog_uic_$kde_cache,
  246. [
  247. cat >conftest.ui <<EOT
  248. <!DOCTYPE UI><UI version="3" stdsetdef="1"></UI>
  249. EOT
  250. ac_uic_testrun="$UIC_PATH -$1 $2 conftest.ui >/dev/null"
  251. if AC_TRY_EVAL(ac_uic_testrun); then
  252. eval "kde_cv_prog_uic_$kde_cache=yes"
  253. else
  254. eval "kde_cv_prog_uic_$kde_cache=no"
  255. fi
  256. rm -f conftest*
  257. ])
  258. if eval "test \"`echo '$kde_cv_prog_uic_'$kde_cache`\" = yes"; then
  259. AC_MSG_RESULT([yes])
  260. :
  261. $3
  262. else
  263. AC_MSG_RESULT([no])
  264. :
  265. $4
  266. fi
  267. ])
  268. dnl ------------------------------------------------------------------------
  269. dnl Find the meta object compiler and the ui compiler in the PATH,
  270. dnl in $QTDIR/bin, and some more usual places
  271. dnl ------------------------------------------------------------------------
  272. dnl
  273. AC_DEFUN([AC_PATH_TQT_MOC_UIC],
  274. [
  275. AC_REQUIRE([KDE_CHECK_PERL])
  276. qt_bindirs=""
  277. for dir in $kde_qt_dirs; do
  278. qt_bindirs="$qt_bindirs $dir/bin $dir/src/moc"
  279. done
  280. qt_bindirs="$qt_bindirs /usr/bin /usr/X11R6/bin /usr/local/qt/bin"
  281. if test ! "$ac_qt_bindir" = "NO"; then
  282. qt_bindirs="$ac_qt_bindir $qt_bindirs"
  283. fi
  284. KDE_FIND_PATH(moc, MOC, [$qt_bindirs], [KDE_MOC_ERROR_MESSAGE])
  285. if test -z "$UIC_NOT_NEEDED"; then
  286. KDE_FIND_PATH(uic, UIC_PATH, [$qt_bindirs], [UIC_PATH=""])
  287. if test -z "$UIC_PATH" ; then
  288. KDE_UIC_ERROR_MESSAGE
  289. exit 1
  290. else
  291. UIC=$UIC_PATH
  292. if test $kde_qtver = 3; then
  293. KDE_CHECK_UIC_FLAG(L,[/nonexistent],ac_uic_supports_libpath=yes,ac_uic_supports_libpath=no)
  294. KDE_CHECK_UIC_FLAG(nounload,,ac_uic_supports_nounload=yes,ac_uic_supports_nounload=no)
  295. if test x$ac_uic_supports_libpath = xyes; then
  296. UIC="$UIC -L \$(kde_widgetdir)"
  297. fi
  298. if test x$ac_uic_supports_nounload = xyes; then
  299. UIC="$UIC -nounload"
  300. fi
  301. fi
  302. fi
  303. else
  304. UIC="echo uic not available: "
  305. fi
  306. AC_SUBST(MOC)
  307. AC_SUBST(UIC)
  308. UIC_TR="i18n"
  309. if test $kde_qtver = 3; then
  310. UIC_TR="tr2i18n"
  311. fi
  312. AC_SUBST(UIC_TR)
  313. ])
  314. AC_DEFUN([KDE_1_CHECK_PATHS],
  315. [
  316. KDE_1_CHECK_PATH_HEADERS
  317. KDE_TEST_RPATH=
  318. if test -n "$USE_RPATH"; then
  319. if test -n "$kde_libraries"; then
  320. KDE_TEST_RPATH="-R $kde_libraries"
  321. fi
  322. if test -n "$qt_libraries"; then
  323. KDE_TEST_RPATH="$KDE_TEST_RPATH -R $qt_libraries"
  324. fi
  325. if test -n "$x_libraries"; then
  326. KDE_TEST_RPATH="$KDE_TEST_RPATH -R $x_libraries"
  327. fi
  328. KDE_TEST_RPATH="$KDE_TEST_RPATH $KDE_EXTRA_RPATH"
  329. fi
  330. AC_MSG_CHECKING([for KDE libraries installed])
  331. ac_link='$LIBTOOL_SHELL --silent --mode=link ${CXX-g++} -o conftest $CXXFLAGS $all_includes $CPPFLAGS $LDFLAGS $all_libraries conftest.$ac_ext $LIBS -ltdecore $LIBQT $KDE_TEST_RPATH 1>&5'
  332. if AC_TRY_EVAL(ac_link) && test -s conftest; then
  333. AC_MSG_RESULT(yes)
  334. else
  335. AC_MSG_ERROR([your system fails at linking a small KDE application!
  336. Check, if your compiler is installed correctly and if you have used the
  337. same compiler to compile Qt and tdelibs as you did use now.
  338. For more details about this problem, look at the end of config.log.])
  339. fi
  340. if eval `TDEDIR= ./conftest 2>&5`; then
  341. kde_result=done
  342. else
  343. kde_result=problems
  344. fi
  345. TDEDIR= ./conftest 2> /dev/null >&5 # make an echo for config.log
  346. kde_have_all_paths=yes
  347. KDE_SET_PATHS($kde_result)
  348. ])
  349. AC_DEFUN([KDE_SET_PATHS],
  350. [
  351. kde_cv_all_paths="kde_have_all_paths=\"yes\" \
  352. kde_htmldir=\"$kde_htmldir\" \
  353. kde_appsdir=\"$kde_appsdir\" \
  354. kde_icondir=\"$kde_icondir\" \
  355. kde_sounddir=\"$kde_sounddir\" \
  356. kde_datadir=\"$kde_datadir\" \
  357. kde_locale=\"$kde_locale\" \
  358. kde_cgidir=\"$kde_cgidir\" \
  359. kde_confdir=\"$kde_confdir\" \
  360. kde_kcfgdir=\"$kde_kcfgdir\" \
  361. kde_mimedir=\"$kde_mimedir\" \
  362. kde_toolbardir=\"$kde_toolbardir\" \
  363. kde_wallpaperdir=\"$kde_wallpaperdir\" \
  364. kde_templatesdir=\"$kde_templatesdir\" \
  365. kde_bindir=\"$kde_bindir\" \
  366. kde_servicesdir=\"$kde_servicesdir\" \
  367. kde_servicetypesdir=\"$kde_servicetypesdir\" \
  368. kde_moduledir=\"$kde_moduledir\" \
  369. kde_styledir=\"$kde_styledir\" \
  370. kde_widgetdir=\"$kde_widgetdir\" \
  371. xdg_appsdir=\"$xdg_appsdir\" \
  372. xdg_menudir=\"$xdg_menudir\" \
  373. xdg_directorydir=\"$xdg_directorydir\" \
  374. kde_result=$1"
  375. ])
  376. AC_DEFUN([KDE_SET_DEFAULT_PATHS],
  377. [
  378. if test "$1" = "default"; then
  379. if test -z "$kde_htmldir"; then
  380. if test -f /etc/debian_version; then
  381. if dpkg -s tdelibs4 | grep Status | grep not-installed 2>&1 >/dev/null; then
  382. kde_htmldir='\${prefix}/share/doc/tde/HTML';
  383. else
  384. kde_htmldir='\${prefix}/share/doc/tde/HTML'
  385. fi
  386. else
  387. kde_htmldir='\${prefix}/share/doc/tde/HTML'
  388. fi
  389. fi
  390. if test -z "$kde_appsdir"; then
  391. kde_appsdir='\${datadir}/applnk'
  392. fi
  393. if test -z "$kde_icondir"; then
  394. kde_icondir='\${datadir}/icons'
  395. fi
  396. if test -z "$kde_sounddir"; then
  397. kde_sounddir='\${datadir}/sounds'
  398. fi
  399. if test -z "$kde_datadir"; then
  400. kde_datadir='\${datadir}/apps'
  401. fi
  402. if test -z "$kde_locale"; then
  403. kde_locale='\${datadir}/locale'
  404. fi
  405. if test -z "$kde_cgidir"; then
  406. kde_cgidir='\${exec_prefix}/cgi-bin'
  407. fi
  408. if test -z "$kde_confdir"; then
  409. kde_confdir='\${datadir}/config'
  410. fi
  411. if test -z "$kde_kcfgdir"; then
  412. kde_kcfgdir='\${datadir}/config.kcfg'
  413. fi
  414. if test -z "$kde_mimedir"; then
  415. kde_mimedir='\${datadir}/mimelnk'
  416. fi
  417. if test -z "$kde_toolbardir"; then
  418. kde_toolbardir='\${datadir}/toolbar'
  419. fi
  420. if test -z "$kde_wallpaperdir"; then
  421. kde_wallpaperdir='\${datadir}/wallpapers'
  422. fi
  423. if test -z "$kde_templatesdir"; then
  424. kde_templatesdir='\${datadir}/templates'
  425. fi
  426. if test -z "$kde_bindir"; then
  427. kde_bindir='\${exec_prefix}/bin'
  428. fi
  429. if test -z "$kde_servicesdir"; then
  430. kde_servicesdir='\${datadir}/services'
  431. fi
  432. if test -z "$kde_servicetypesdir"; then
  433. kde_servicetypesdir='\${datadir}/servicetypes'
  434. fi
  435. if test -z "$kde_moduledir"; then
  436. if test "$kde_qtver" = "2"; then
  437. kde_moduledir='\${libdir}/kde2'
  438. else
  439. kde_moduledir='\${libdir}/trinity'
  440. fi
  441. fi
  442. if test -z "$kde_styledir"; then
  443. kde_styledir='\${libdir}/trinity/plugins/styles'
  444. fi
  445. if test -z "$kde_widgetdir"; then
  446. kde_widgetdir='\${libdir}/trinity/plugins/designer'
  447. fi
  448. if test -z "$xdg_appsdir"; then
  449. xdg_appsdir='\${datadir}/applications/tde'
  450. fi
  451. if test -z "$xdg_menudir"; then
  452. xdg_menudir='\${sysconfdir}/xdg/menus'
  453. fi
  454. if test -z "$xdg_directorydir"; then
  455. xdg_directorydir='\${datadir}/desktop-directories'
  456. fi
  457. KDE_SET_PATHS(defaults)
  458. else
  459. if test $kde_qtver = 1; then
  460. AC_MSG_RESULT([compiling])
  461. KDE_1_CHECK_PATHS
  462. else
  463. AC_MSG_ERROR([path checking not yet supported for KDE 2])
  464. fi
  465. fi
  466. ])
  467. AC_DEFUN([KDE_CHECK_PATHS_FOR_COMPLETENESS],
  468. [ if test -z "$kde_htmldir" || test -z "$kde_appsdir" ||
  469. test -z "$kde_icondir" || test -z "$kde_sounddir" ||
  470. test -z "$kde_datadir" || test -z "$kde_locale" ||
  471. test -z "$kde_cgidir" || test -z "$kde_confdir" ||
  472. test -z "$kde_kcfgdir" ||
  473. test -z "$kde_mimedir" || test -z "$kde_toolbardir" ||
  474. test -z "$kde_wallpaperdir" || test -z "$kde_templatesdir" ||
  475. test -z "$kde_bindir" || test -z "$kde_servicesdir" ||
  476. test -z "$kde_servicetypesdir" || test -z "$kde_moduledir" ||
  477. test -z "$kde_styledir" || test -z "kde_widgetdir" ||
  478. test -z "$xdg_appsdir" || test -z "$xdg_menudir" || test -z "$xdg_directorydir" ||
  479. test "x$kde_have_all_paths" != "xyes"; then
  480. kde_have_all_paths=no
  481. fi
  482. ])
  483. AC_DEFUN([KDE_MISSING_PROG_ERROR],
  484. [
  485. AC_MSG_ERROR([The important program $1 was not found!
  486. Please check whether you installed KDE correctly.
  487. ])
  488. ])
  489. AC_DEFUN([KDE_MISSING_ARTS_ERROR],
  490. [
  491. AC_MSG_ERROR([The important program $1 was not found!
  492. Please check whether you installed aRts correctly or use
  493. --without-arts to compile without aRts support (this will remove functionality).
  494. ])
  495. ])
  496. AC_DEFUN([KDE_SET_DEFAULT_BINDIRS],
  497. [
  498. kde_default_bindirs="/usr/bin /usr/local/bin /opt/local/bin /usr/X11R6/bin /opt/kde/bin /opt/trinity/bin /usr/kde/bin /usr/local/kde/bin"
  499. test -n "$TDEDIR" && kde_default_bindirs="$TDEDIR/bin $kde_default_bindirs"
  500. if test -n "$TDEDIRS"; then
  501. kde_save_IFS=$IFS
  502. IFS=:
  503. for dir in $TDEDIRS; do
  504. kde_default_bindirs="$dir/bin $kde_default_bindirs "
  505. done
  506. IFS=$kde_save_IFS
  507. fi
  508. ])
  509. AC_DEFUN([KDE_SUBST_PROGRAMS],
  510. [
  511. AC_ARG_WITH(arts,
  512. AC_HELP_STRING([--without-arts],[build without aRts [default=no]]),
  513. [build_arts=$withval],
  514. [build_arts=yes]
  515. )
  516. AM_CONDITIONAL(include_ARTS, test "$build_arts" '!=' "no")
  517. if test "$build_arts" = "no"; then
  518. AC_DEFINE(WITHOUT_ARTS, 1, [Defined if compiling without arts])
  519. fi
  520. KDE_SET_DEFAULT_BINDIRS
  521. kde_default_bindirs="$exec_prefix/bin $prefix/bin $kde_libs_prefix/bin $kde_default_bindirs"
  522. KDE_FIND_PATH(dcopidl, DCOPIDL, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl)])
  523. KDE_FIND_PATH(dcopidl2cpp, DCOPIDL2CPP, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl2cpp)])
  524. if test "$build_arts" '!=' "no"; then
  525. KDE_FIND_PATH(mcopidl, MCOPIDL, [$kde_default_bindirs], [KDE_MISSING_ARTS_ERROR(mcopidl)])
  526. KDE_FIND_PATH(artsc-config, ARTSCCONFIG, [$kde_default_bindirs], [KDE_MISSING_ARTS_ERROR(artsc-config)])
  527. fi
  528. KDE_FIND_PATH(meinproc, MEINPROC, [$kde_default_bindirs])
  529. trinity2ornewer=1
  530. trinity3ornewer=1
  531. if test -n "$kde_qtver" && test "$kde_qtver" -lt 3; then
  532. trinity2ornewer=
  533. trinity3ornewer=
  534. else
  535. if test "$kde_qtver" = "3"; then
  536. if test "$kde_qtsubver" -le 1; then
  537. trinity2ornewer=
  538. fi
  539. if test "$kde_qtsubver" -le 2; then
  540. trinity3ornewer=
  541. fi
  542. fi
  543. fi
  544. if test -n "$trinity2ornewer"; then
  545. KDE_FIND_PATH(tdeconfig_compiler, KCONFIG_COMPILER, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(tdeconfig_compiler)])
  546. KDE_FIND_PATH(dcopidlng, DCOPIDLNG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidlng)])
  547. fi
  548. if test -n "$trinity3ornewer"; then
  549. KDE_FIND_PATH(maketdewidgets, MAKETDEWIDGETS, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(maketdewidgets)])
  550. AC_SUBST(MAKETDEWIDGETS)
  551. fi
  552. KDE_FIND_PATH(xmllint, XMLLINT, [${prefix}/bin ${exec_prefix}/bin], [XMLLINT=""])
  553. if test -n "$MEINPROC" && test ! "$MEINPROC" = "compiled"; then
  554. kde_sharedirs="$prefix/share /opt/trinity/share /opt/trinity/share /opt/kde/share /usr/share/kde /usr/local/share /usr/share"
  555. test -n "$TDEDIR" && kde_sharedirs="$TDEDIR/share $kde_sharedirs"
  556. AC_FIND_FILE(apps/ksgmltools2/customization/tde-chunk.xsl, $kde_sharedirs, KDE_XSL_STYLESHEET)
  557. if test "$KDE_XSL_STYLESHEET" = "NO"; then
  558. KDE_XSL_STYLESHEET=""
  559. else
  560. KDE_XSL_STYLESHEET="$KDE_XSL_STYLESHEET/apps/ksgmltools2/customization/tde-chunk.xsl"
  561. fi
  562. fi
  563. DCOP_DEPENDENCIES='$(DCOPIDL)'
  564. if test -n "$trinity2ornewer"; then
  565. KCFG_DEPENDENCIES='$(KCONFIG_COMPILER)'
  566. DCOP_DEPENDENCIES='$(DCOPIDL) $(DCOPIDLNG)'
  567. AC_SUBST(KCONFIG_COMPILER)
  568. AC_SUBST(KCFG_DEPENDENCIES)
  569. AC_SUBST(DCOPIDLNG)
  570. fi
  571. AC_SUBST(DCOPIDL)
  572. AC_SUBST(DCOPIDL2CPP)
  573. AC_SUBST(DCOP_DEPENDENCIES)
  574. AC_SUBST(MCOPIDL)
  575. AC_SUBST(ARTSCCONFIG)
  576. AC_SUBST(MEINPROC)
  577. AC_SUBST(KDE_XSL_STYLESHEET)
  578. AC_SUBST(XMLLINT)
  579. ])dnl
  580. AC_DEFUN([AC_CREATE_KFSSTND],
  581. [
  582. AC_REQUIRE([AC_CHECK_RPATH])
  583. AC_MSG_CHECKING([for KDE paths])
  584. kde_result=""
  585. kde_cached_paths=yes
  586. AC_CACHE_VAL(kde_cv_all_paths,
  587. [
  588. KDE_SET_DEFAULT_PATHS($1)
  589. kde_cached_paths=no
  590. ])
  591. eval "$kde_cv_all_paths"
  592. KDE_CHECK_PATHS_FOR_COMPLETENESS
  593. if test "$kde_have_all_paths" = "no" && test "$kde_cached_paths" = "yes"; then
  594. # wrong values were cached, may be, we can set better ones
  595. kde_result=
  596. kde_htmldir= kde_appsdir= kde_icondir= kde_sounddir=
  597. kde_datadir= kde_locale= kde_cgidir= kde_confdir= kde_kcfgdir=
  598. kde_mimedir= kde_toolbardir= kde_wallpaperdir= kde_templatesdir=
  599. kde_bindir= kde_servicesdir= kde_servicetypesdir= kde_moduledir=
  600. kde_have_all_paths=
  601. kde_styledir=
  602. kde_widgetdir=
  603. xdg_appsdir = xdg_menudir= xdg_directorydir=
  604. KDE_SET_DEFAULT_PATHS($1)
  605. eval "$kde_cv_all_paths"
  606. KDE_CHECK_PATHS_FOR_COMPLETENESS
  607. kde_result="$kde_result (cache overridden)"
  608. fi
  609. if test "$kde_have_all_paths" = "no"; then
  610. AC_MSG_ERROR([configure could not run a little KDE program to test the environment.
  611. Since it had compiled and linked before, it must be a strange problem on your system.
  612. Look at config.log for details. If you are not able to fix this, look at
  613. http://www.kde.org/faq/installation.html or any www.kde.org mirror.
  614. (If you're using an egcs version on Linux, you may update binutils!)
  615. ])
  616. else
  617. rm -f conftest*
  618. AC_MSG_RESULT($kde_result)
  619. fi
  620. bindir=$kde_bindir
  621. KDE_SUBST_PROGRAMS
  622. ])
  623. AC_DEFUN([AC_SUBST_KFSSTND],
  624. [
  625. AC_SUBST(kde_htmldir)
  626. AC_SUBST(kde_appsdir)
  627. AC_SUBST(kde_icondir)
  628. AC_SUBST(kde_sounddir)
  629. AC_SUBST(kde_datadir)
  630. AC_SUBST(kde_locale)
  631. AC_SUBST(kde_confdir)
  632. AC_SUBST(kde_kcfgdir)
  633. AC_SUBST(kde_mimedir)
  634. AC_SUBST(kde_wallpaperdir)
  635. AC_SUBST(kde_bindir)
  636. dnl X Desktop Group standards
  637. AC_SUBST(xdg_appsdir)
  638. AC_SUBST(xdg_menudir)
  639. AC_SUBST(xdg_directorydir)
  640. dnl for KDE 2
  641. AC_SUBST(kde_templatesdir)
  642. AC_SUBST(kde_servicesdir)
  643. AC_SUBST(kde_servicetypesdir)
  644. AC_SUBST(kde_moduledir)
  645. AC_SUBST(tdeinitdir, '$(kde_moduledir)')
  646. AC_SUBST(kde_styledir)
  647. AC_SUBST(kde_widgetdir)
  648. if test "$kde_qtver" = 1; then
  649. kde_minidir="$kde_icondir/mini"
  650. else
  651. # for KDE 1 - this breaks KDE2 apps using minidir, but
  652. # that's the plan ;-/
  653. kde_minidir="/dev/null"
  654. fi
  655. dnl AC_SUBST(kde_minidir)
  656. dnl AC_SUBST(kde_cgidir)
  657. dnl AC_SUBST(kde_toolbardir)
  658. ])
  659. AC_DEFUN([KDE_MISC_TESTS],
  660. [
  661. dnl Checks for libraries.
  662. AC_CHECK_LIB(util, main, [LIBUTIL="-lutil"]) dnl for *BSD
  663. AC_SUBST(LIBUTIL)
  664. AC_CHECK_LIB(compat, main, [LIBCOMPAT="-lcompat"]) dnl for *BSD
  665. AC_SUBST(LIBCOMPAT)
  666. kde_have_crypt=
  667. AC_CHECK_LIB(crypt, crypt, [LIBCRYPT="-lcrypt"; kde_have_crypt=yes],
  668. AC_CHECK_LIB(c, crypt, [kde_have_crypt=yes], [
  669. AC_MSG_WARN([you have no crypt in either libcrypt or libc.
  670. You should install libcrypt from another source or configure with PAM
  671. support])
  672. kde_have_crypt=no
  673. ]))
  674. AC_SUBST(LIBCRYPT)
  675. if test $kde_have_crypt = yes; then
  676. AC_DEFINE_UNQUOTED(HAVE_CRYPT, 1, [Defines if your system has the crypt function])
  677. fi
  678. AC_CHECK_SOCKLEN_T
  679. AC_CHECK_LIB(dnet, dnet_ntoa, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"])
  680. if test $ac_cv_lib_dnet_dnet_ntoa = no; then
  681. AC_CHECK_LIB(dnet_stub, dnet_ntoa,
  682. [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"])
  683. fi
  684. AC_CHECK_FUNC(inet_ntoa)
  685. if test $ac_cv_func_inet_ntoa = no; then
  686. AC_CHECK_LIB(nsl, inet_ntoa, X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl")
  687. fi
  688. AC_CHECK_FUNC(connect)
  689. if test $ac_cv_func_connect = no; then
  690. AC_CHECK_LIB(socket, connect, X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS", ,
  691. $X_EXTRA_LIBS)
  692. fi
  693. AC_CHECK_FUNC(remove)
  694. if test $ac_cv_func_remove = no; then
  695. AC_CHECK_LIB(posix, remove, X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix")
  696. fi
  697. # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
  698. AC_CHECK_FUNC(shmat, ,
  699. AC_CHECK_LIB(ipc, shmat, X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"))
  700. # more headers that need to be explicitly included on darwin
  701. AC_CHECK_HEADERS(sys/types.h stdint.h)
  702. # sys/bitypes.h is needed for uint32_t and friends on Tru64
  703. AC_CHECK_HEADERS(sys/bitypes.h)
  704. # darwin requires a poll emulation library
  705. AC_CHECK_LIB(poll, poll, LIB_POLL="-lpoll")
  706. # for some image handling on Mac OS X
  707. AC_CHECK_HEADERS(Carbon/Carbon.h)
  708. # CoreAudio framework
  709. AC_CHECK_HEADER(CoreAudio/CoreAudio.h, [
  710. AC_DEFINE(HAVE_COREAUDIO, 1, [Define if you have the CoreAudio API])
  711. FRAMEWORK_COREAUDIO="-Xlinker -framework -Xlinker CoreAudio"
  712. ])
  713. AC_CHECK_RES_INIT
  714. AC_SUBST(LIB_POLL)
  715. AC_SUBST(FRAMEWORK_COREAUDIO)
  716. LIBSOCKET="$X_EXTRA_LIBS"
  717. AC_SUBST(LIBSOCKET)
  718. AC_SUBST(X_EXTRA_LIBS)
  719. AC_CHECK_LIB(ucb, killpg, [LIBUCB="-lucb"]) dnl for Solaris2.4
  720. AC_SUBST(LIBUCB)
  721. case $host in dnl this *is* LynxOS specific
  722. *-*-lynxos* )
  723. AC_MSG_CHECKING([LynxOS header file wrappers])
  724. [CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__"]
  725. AC_MSG_RESULT(disabled)
  726. AC_CHECK_LIB(bsd, gethostbyname, [LIBSOCKET="-lbsd"]) dnl for LynxOS
  727. ;;
  728. esac
  729. KDE_CHECK_TYPES
  730. KDE_CHECK_LIBDL
  731. KDE_CHECK_STRLCPY
  732. # darwin needs this to initialize the environment
  733. AC_CHECK_HEADERS(crt_externs.h)
  734. AC_CHECK_FUNC(_NSGetEnviron, [AC_DEFINE(HAVE_NSGETENVIRON, 1, [Define if your system needs _NSGetEnviron to set up the environment])])
  735. AH_VERBATIM(_DARWIN_ENVIRON,
  736. [
  737. #if defined(HAVE_NSGETENVIRON) && defined(HAVE_CRT_EXTERNS_H)
  738. # include <sys/time.h>
  739. # include <crt_externs.h>
  740. # define environ (*_NSGetEnviron())
  741. #endif
  742. ])
  743. AH_VERBATIM(_AIX_STRINGS_H_BZERO,
  744. [
  745. /*
  746. * AIX defines FD_SET in terms of bzero, but fails to include <strings.h>
  747. * that defines bzero.
  748. */
  749. #if defined(_AIX)
  750. #include <strings.h>
  751. #endif
  752. ])
  753. AC_CHECK_FUNCS([vsnprintf snprintf])
  754. AH_VERBATIM(_TRU64,[
  755. /*
  756. * On HP-UX, the declaration of vsnprintf() is needed every time !
  757. */
  758. #if !defined(HAVE_VSNPRINTF) || defined(hpux)
  759. #if __STDC__
  760. #include <stdarg.h>
  761. #include <stdlib.h>
  762. #else
  763. #include <varargs.h>
  764. #endif
  765. #ifdef __cplusplus
  766. extern "C"
  767. #endif
  768. int vsnprintf(char *str, size_t n, char const *fmt, va_list ap);
  769. #ifdef __cplusplus
  770. extern "C"
  771. #endif
  772. int snprintf(char *str, size_t n, char const *fmt, ...);
  773. #endif
  774. ])
  775. ])
  776. dnl ------------------------------------------------------------------------
  777. dnl Find the header files and libraries for X-Windows. Extended the
  778. dnl macro AC_PATH_X
  779. dnl ------------------------------------------------------------------------
  780. dnl
  781. AC_DEFUN([K_PATH_X],
  782. [
  783. AC_REQUIRE([KDE_MISC_TESTS])dnl
  784. AC_REQUIRE([KDE_CHECK_LIB64])
  785. AC_ARG_ENABLE(
  786. embedded,
  787. AC_HELP_STRING([--enable-embedded],[link to Qt-embedded, don't use X]),
  788. kde_use_qt_emb=$enableval,
  789. kde_use_qt_emb=no
  790. )
  791. AC_ARG_ENABLE(
  792. qtopia,
  793. AC_HELP_STRING([--enable-qtopia],[link to Qt-embedded, link to the Qtopia Environment]),
  794. kde_use_qt_emb_palm=$enableval,
  795. kde_use_qt_emb_palm=no
  796. )
  797. AC_ARG_ENABLE(
  798. mac,
  799. AC_HELP_STRING([--enable-mac],[link to Qt/Mac (don't use X)]),
  800. kde_use_qt_mac=$enableval,
  801. kde_use_qt_mac=no
  802. )
  803. # used to disable x11-specific stuff on special platforms
  804. AM_CONDITIONAL(include_x11, test "$kde_use_qt_emb" = "no" && test "$kde_use_qt_mac" = "no")
  805. if test "$kde_use_qt_emb" = "no" && test "$kde_use_qt_mac" = "no"; then
  806. AC_MSG_CHECKING(for X)
  807. AC_CACHE_VAL(kde_cv_have_x,
  808. [# One or both of the vars are not set, and there is no cached value.
  809. if test "{$x_includes+set}" = set || test "$x_includes" = NONE; then
  810. kde_x_includes=NO
  811. else
  812. kde_x_includes=$x_includes
  813. fi
  814. if test "{$x_libraries+set}" = set || test "$x_libraries" = NONE; then
  815. kde_x_libraries=NO
  816. else
  817. kde_x_libraries=$x_libraries
  818. fi
  819. # below we use the standard autoconf calls
  820. ac_x_libraries=$kde_x_libraries
  821. ac_x_includes=$kde_x_includes
  822. KDE_PATH_X_DIRECT
  823. dnl AC_PATH_X_XMKMF picks /usr/lib as the path for the X libraries.
  824. dnl Unfortunately, if compiling with the N32 ABI, this is not the correct
  825. dnl location. The correct location is /usr/lib32 or an undefined value
  826. dnl (the linker is smart enough to pick the correct default library).
  827. dnl Things work just fine if you use just AC_PATH_X_DIRECT.
  828. dnl Solaris has a similar problem. AC_PATH_X_XMKMF forces x_includes to
  829. dnl /usr/openwin/include, which doesn't work. /usr/include does work, so
  830. dnl x_includes should be left alone.
  831. case "$host" in
  832. mips-sgi-irix6*)
  833. ;;
  834. *-*-solaris*)
  835. ;;
  836. *)
  837. _AC_PATH_X_XMKMF
  838. if test -z "$ac_x_includes"; then
  839. ac_x_includes="."
  840. fi
  841. if test -z "$ac_x_libraries"; then
  842. ac_x_libraries="/usr/lib${tdelibsuff}"
  843. fi
  844. esac
  845. #from now on we use our own again
  846. # when the user already gave --x-includes, we ignore
  847. # what the standard autoconf macros told us.
  848. if test "$kde_x_includes" = NO; then
  849. kde_x_includes=$ac_x_includes
  850. fi
  851. # for --x-libraries too
  852. if test "$kde_x_libraries" = NO; then
  853. kde_x_libraries=$ac_x_libraries
  854. fi
  855. if test "$kde_x_includes" = NO; then
  856. AC_MSG_ERROR([Can't find X includes. Please check your installation and add the correct paths!])
  857. fi
  858. if test "$kde_x_libraries" = NO; then
  859. AC_MSG_ERROR([Can't find X libraries. Please check your installation and add the correct paths!])
  860. fi
  861. # Record where we found X for the cache.
  862. kde_cv_have_x="have_x=yes \
  863. kde_x_includes=$kde_x_includes kde_x_libraries=$kde_x_libraries"
  864. ])dnl
  865. eval "$kde_cv_have_x"
  866. if test "$have_x" != yes; then
  867. AC_MSG_RESULT($have_x)
  868. no_x=yes
  869. else
  870. AC_MSG_RESULT([libraries $kde_x_libraries, headers $kde_x_includes])
  871. fi
  872. if test -z "$kde_x_includes" || test "x$kde_x_includes" = xNONE; then
  873. X_INCLUDES=""
  874. x_includes="."; dnl better than nothing :-
  875. else
  876. x_includes=$kde_x_includes
  877. X_INCLUDES="-I$x_includes"
  878. fi
  879. if test -z "$kde_x_libraries" || test "x$kde_x_libraries" = xNONE; then
  880. X_LDFLAGS=""
  881. x_libraries="/usr/lib"; dnl better than nothing :-
  882. else
  883. x_libraries=$kde_x_libraries
  884. X_LDFLAGS="-L$x_libraries"
  885. fi
  886. all_includes="$X_INCLUDES"
  887. all_libraries="$X_LDFLAGS $LDFLAGS_AS_NEEDED $LDFLAGS_NEW_DTAGS"
  888. # Check for libraries that X11R6 Xt/Xaw programs need.
  889. ac_save_LDFLAGS="$LDFLAGS"
  890. LDFLAGS="$LDFLAGS $X_LDFLAGS"
  891. # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
  892. # check for ICE first), but we must link in the order -lSM -lICE or
  893. # we get undefined symbols. So assume we have SM if we have ICE.
  894. # These have to be linked with before -lX11, unlike the other
  895. # libraries we check for below, so use a different variable.
  896. # --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
  897. AC_CHECK_LIB(ICE, IceConnectionNumber,
  898. [LIBSM="-lSM -lICE"], , $X_EXTRA_LIBS)
  899. LDFLAGS="$ac_save_LDFLAGS"
  900. LIB_X11='-lX11 $(LIBSOCKET)'
  901. AC_MSG_CHECKING(for libXext)
  902. AC_CACHE_VAL(kde_cv_have_libXext,
  903. [
  904. kde_ldflags_safe="$LDFLAGS"
  905. kde_libs_safe="$LIBS"
  906. LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS"
  907. LIBS="-lXext -lX11 $LIBSOCKET"
  908. AC_TRY_LINK([
  909. #include <stdio.h>
  910. #ifdef STDC_HEADERS
  911. # include <stdlib.h>
  912. #endif
  913. ],
  914. [
  915. printf("hello Xext\n");
  916. ],
  917. kde_cv_have_libXext=yes,
  918. kde_cv_have_libXext=no
  919. )
  920. LDFLAGS=$kde_ldflags_safe
  921. LIBS=$kde_libs_safe
  922. ])
  923. AC_MSG_RESULT($kde_cv_have_libXext)
  924. if test "$kde_cv_have_libXext" = "no"; then
  925. AC_MSG_ERROR([We need a working libXext to proceed. Since configure
  926. can't find it itself, we stop here assuming that make wouldn't find
  927. them either.])
  928. fi
  929. LIB_XEXT="-lXext"
  930. QTE_NORTTI=""
  931. elif test "$kde_use_qt_emb" = "yes"; then
  932. dnl We're using QT Embedded
  933. CPPFLAGS=-DQWS
  934. CXXFLAGS="$CXXFLAGS -fno-rtti"
  935. QTE_NORTTI="-fno-rtti -DQWS"
  936. X_PRE_LIBS=""
  937. LIB_X11=""
  938. LIB_XEXT=""
  939. LIB_XRENDER=""
  940. LIBSM=""
  941. X_INCLUDES=""
  942. X_LDFLAGS=""
  943. x_includes=""
  944. x_libraries=""
  945. elif test "$kde_use_qt_mac" = "yes"; then
  946. dnl We're using QT/Mac (I use QT_MAC so that qglobal.h doesn't *have* to
  947. dnl be included to get the information) --Sam
  948. CXXFLAGS="$CXXFLAGS -DQT_MAC -no-cpp-precomp"
  949. CFLAGS="$CFLAGS -DQT_MAC -no-cpp-precomp"
  950. X_PRE_LIBS=""
  951. LIB_X11=""
  952. LIB_XEXT=""
  953. LIB_XRENDER=""
  954. LIBSM=""
  955. X_INCLUDES=""
  956. X_LDFLAGS=""
  957. x_includes=""
  958. x_libraries=""
  959. fi
  960. AC_SUBST(X_PRE_LIBS)
  961. AC_SUBST(LIB_X11)
  962. AC_SUBST(LIB_XRENDER)
  963. AC_SUBST(LIBSM)
  964. AC_SUBST(X_INCLUDES)
  965. AC_SUBST(X_LDFLAGS)
  966. AC_SUBST(x_includes)
  967. AC_SUBST(x_libraries)
  968. AC_SUBST(QTE_NORTTI)
  969. AC_SUBST(LIB_XEXT)
  970. ])
  971. AC_DEFUN([KDE_PRINT_QT_PROGRAM],
  972. [
  973. AC_REQUIRE([KDE_USE_TQT])
  974. cat > conftest.$ac_ext <<EOF
  975. #include "confdefs.h"
  976. #include <qglobal.h>
  977. #include <qapplication.h>
  978. EOF
  979. if test "$kde_qtver" = "2"; then
  980. cat >> conftest.$ac_ext <<EOF
  981. #include <qevent.h>
  982. #include <qstring.h>
  983. #include <qstyle.h>
  984. EOF
  985. if test $kde_qtsubver -gt 0; then
  986. cat >> conftest.$ac_ext <<EOF
  987. #if TQT_VERSION < 210
  988. #error 1
  989. #endif
  990. EOF
  991. fi
  992. fi
  993. if test "$kde_qtver" = "3"; then
  994. cat >> conftest.$ac_ext <<EOF
  995. #include <qcursor.h>
  996. #include <qstylefactory.h>
  997. #include <private/qucomextra_p.h>
  998. EOF
  999. fi
  1000. echo "#if ! ($kde_qt_verstring)" >> conftest.$ac_ext
  1001. cat >> conftest.$ac_ext <<EOF
  1002. #error 1
  1003. #endif
  1004. int main() {
  1005. EOF
  1006. if test "$kde_qtver" = "2"; then
  1007. cat >> conftest.$ac_ext <<EOF
  1008. QStringList *t = new QStringList();
  1009. Q_UNUSED(t);
  1010. EOF
  1011. if test $kde_qtsubver -gt 0; then
  1012. cat >> conftest.$ac_ext <<EOF
  1013. QString s;
  1014. s.setLatin1("Elvis is alive", 14);
  1015. EOF
  1016. fi
  1017. fi
  1018. if test "$kde_qtver" = "3"; then
  1019. cat >> conftest.$ac_ext <<EOF
  1020. (void)QStyleFactory::create(QString::null);
  1021. QCursor c(Qt::WhatsThisCursor);
  1022. EOF
  1023. fi
  1024. cat >> conftest.$ac_ext <<EOF
  1025. return 0;
  1026. }
  1027. EOF
  1028. ])
  1029. AC_DEFUN([KDE_USE_TQT],
  1030. [
  1031. if test -z "$1"; then
  1032. # Current default Qt version: 3.3
  1033. kde_qtver=3
  1034. kde_qtsubver=3
  1035. else
  1036. kde_qtsubver=`echo "$1" | sed -e 's#[0-9][0-9]*\.\([0-9][0-9]*\).*#\1#'`
  1037. # following is the check if subversion isnt found in passed argument
  1038. if test "$kde_qtsubver" = "$1"; then
  1039. kde_qtsubver=1
  1040. fi
  1041. kde_qtver=`echo "$1" | sed -e 's#^\([0-9][0-9]*\)\..*#\1#'`
  1042. if test "$kde_qtver" = "1"; then
  1043. kde_qtsubver=42
  1044. fi
  1045. fi
  1046. if test -z "$2"; then
  1047. if test "$kde_qtver" = "2"; then
  1048. if test $kde_qtsubver -gt 0; then
  1049. kde_qt_minversion=">= Qt 2.2.2"
  1050. else
  1051. kde_qt_minversion=">= Qt 2.0.2"
  1052. fi
  1053. fi
  1054. if test "$kde_qtver" = "3"; then
  1055. if test $kde_qtsubver -gt 0; then
  1056. if test $kde_qtsubver -gt 1; then
  1057. if test $kde_qtsubver -gt 2; then
  1058. kde_qt_minversion=">= Qt 3.3"
  1059. else
  1060. kde_qt_minversion=">= Qt 3.2"
  1061. fi
  1062. else
  1063. kde_qt_minversion=">= Qt 3.1 (20021021)"
  1064. fi
  1065. else
  1066. kde_qt_minversion=">= Qt 3.0"
  1067. fi
  1068. fi
  1069. if test "$kde_qtver" = "1"; then
  1070. kde_qt_minversion=">= 1.42 and < 2.0"
  1071. fi
  1072. else
  1073. kde_qt_minversion="$2"
  1074. fi
  1075. if test -z "$3"; then
  1076. if test $kde_qtver = 3; then
  1077. if test $kde_qtsubver -gt 0; then
  1078. kde_qt_verstring="TQT_VERSION >= 0x03@VER@00 && TQT_VERSION < 0x040000"
  1079. qtsubver=`echo "00$kde_qtsubver" | sed -e 's,.*\(..\)$,\1,'`
  1080. kde_qt_verstring=`echo $kde_qt_verstring | sed -e "s,@VER@,$qtsubver,"`
  1081. else
  1082. kde_qt_verstring="TQT_VERSION >= 300 && TQT_VERSION < 0x040000"
  1083. fi
  1084. fi
  1085. if test $kde_qtver = 2; then
  1086. if test $kde_qtsubver -gt 0; then
  1087. kde_qt_verstring="TQT_VERSION >= 222"
  1088. else
  1089. kde_qt_verstring="TQT_VERSION >= 200"
  1090. fi
  1091. fi
  1092. if test $kde_qtver = 1; then
  1093. kde_qt_verstring="TQT_VERSION >= 142 && TQT_VERSION < 200"
  1094. fi
  1095. else
  1096. kde_qt_verstring="$3"
  1097. fi
  1098. if test $kde_qtver = 3; then
  1099. kde_qt_dirs="$QTDIR /usr/lib/qt3 /usr/lib/qt /usr/share/qt3"
  1100. fi
  1101. if test $kde_qtver = 2; then
  1102. kde_qt_dirs="$QTDIR /usr/lib/qt2 /usr/lib/qt"
  1103. fi
  1104. if test $kde_qtver = 1; then
  1105. kde_qt_dirs="$QTDIR /usr/lib/qt"
  1106. fi
  1107. ])
  1108. AC_DEFUN([KDE_CHECK_QT_DIRECT],
  1109. [
  1110. AC_REQUIRE([KDE_USE_TQT])
  1111. AC_MSG_CHECKING([if Qt compiles without flags])
  1112. AC_CACHE_VAL(kde_cv_qt_direct,
  1113. [
  1114. AC_LANG_SAVE
  1115. AC_LANG_CPLUSPLUS
  1116. ac_LD_LIBRARY_PATH_safe=$LD_LIBRARY_PATH
  1117. ac_LIBRARY_PATH="$LIBRARY_PATH"
  1118. ac_cxxflags_safe="$CXXFLAGS"
  1119. ac_ldflags_safe="$LDFLAGS"
  1120. ac_libs_safe="$LIBS"
  1121. CXXFLAGS="$CXXFLAGS -I$qt_includes"
  1122. LDFLAGS="$LDFLAGS $X_LDFLAGS"
  1123. if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
  1124. LIBS="$LIBQT -lXext -lX11 $LIBSOCKET"
  1125. else
  1126. LIBS="$LIBQT $LIBSOCKET"
  1127. fi
  1128. LD_LIBRARY_PATH=
  1129. export LD_LIBRARY_PATH
  1130. LIBRARY_PATH=
  1131. export LIBRARY_PATH
  1132. KDE_PRINT_QT_PROGRAM
  1133. if AC_TRY_EVAL(ac_link) && test -s conftest; then
  1134. kde_cv_qt_direct="yes"
  1135. else
  1136. kde_cv_qt_direct="no"
  1137. echo "configure: failed program was:" >&AC_FD_CC
  1138. cat conftest.$ac_ext >&AC_FD_CC
  1139. fi
  1140. rm -f conftest*
  1141. CXXFLAGS="$ac_cxxflags_safe"
  1142. LDFLAGS="$ac_ldflags_safe"
  1143. LIBS="$ac_libs_safe"
  1144. LD_LIBRARY_PATH="$ac_LD_LIBRARY_PATH_safe"
  1145. export LD_LIBRARY_PATH
  1146. LIBRARY_PATH="$ac_LIBRARY_PATH"
  1147. export LIBRARY_PATH
  1148. AC_LANG_RESTORE
  1149. ])
  1150. if test "$kde_cv_qt_direct" = "yes"; then
  1151. AC_MSG_RESULT(yes)
  1152. $1
  1153. else
  1154. AC_MSG_RESULT(no)
  1155. $2
  1156. fi
  1157. ])
  1158. dnl ------------------------------------------------------------------------
  1159. dnl Try to find the Qt headers and libraries.
  1160. dnl $(QT_LDFLAGS) will be -Lqtliblocation (if needed)
  1161. dnl and $(QT_INCLUDES) will be -Iqthdrlocation (if needed)
  1162. dnl ------------------------------------------------------------------------
  1163. dnl
  1164. AC_DEFUN([AC_PATH_TQT_1_3],
  1165. [
  1166. AC_REQUIRE([K_PATH_X])
  1167. AC_REQUIRE([KDE_USE_TQT])
  1168. AC_REQUIRE([KDE_CHECK_LIB64])
  1169. dnl ------------------------------------------------------------------------
  1170. dnl Add configure flag to enable linking to MT version of Qt library.
  1171. dnl ------------------------------------------------------------------------
  1172. AC_ARG_ENABLE(
  1173. mt,
  1174. AC_HELP_STRING([--disable-mt],[link to non-threaded Qt (deprecated)]),
  1175. kde_use_qt_mt=$enableval,
  1176. [
  1177. if test $kde_qtver = 3; then
  1178. kde_use_qt_mt=yes
  1179. else
  1180. kde_use_qt_mt=no
  1181. fi
  1182. ]
  1183. )
  1184. USING_QT_MT=""
  1185. dnl ------------------------------------------------------------------------
  1186. dnl If we not get --disable-qt-mt then adjust some vars for the host.
  1187. dnl ------------------------------------------------------------------------
  1188. KDE_MT_LDFLAGS=
  1189. KDE_MT_LIBS=
  1190. if test "x$kde_use_qt_mt" = "xyes"; then
  1191. KDE_CHECK_THREADING
  1192. if test "x$kde_use_threading" = "xyes"; then
  1193. CPPFLAGS="$USE_THREADS -DTQT_THREAD_SUPPORT $CPPFLAGS"
  1194. KDE_MT_LDFLAGS="$USE_THREADS"
  1195. KDE_MT_LIBS="$LIBPTHREAD"
  1196. else
  1197. kde_use_qt_mt=no
  1198. fi
  1199. fi
  1200. AC_SUBST(KDE_MT_LDFLAGS)
  1201. AC_SUBST(KDE_MT_LIBS)
  1202. kde_qt_was_given=yes
  1203. dnl ------------------------------------------------------------------------
  1204. dnl If we haven't been told how to link to Qt, we work it out for ourselves.
  1205. dnl ------------------------------------------------------------------------
  1206. if test -z "$LIBQT_GLOB"; then
  1207. if test "x$kde_use_qt_emb" = "xyes"; then
  1208. LIBQT_GLOB="libqte.*"
  1209. else
  1210. LIBQT_GLOB="libqt.*"
  1211. fi
  1212. fi
  1213. if test -z "$LIBQT"; then
  1214. dnl ------------------------------------------------------------
  1215. dnl If we got --enable-embedded then adjust the Qt library name.
  1216. dnl ------------------------------------------------------------
  1217. if test "x$kde_use_qt_emb" = "xyes"; then
  1218. qtlib="qte"
  1219. else
  1220. qtlib="qt"
  1221. fi
  1222. kde_int_qt="-l$qtlib"
  1223. else
  1224. kde_int_qt="$LIBQT"
  1225. kde_lib_qt_set=yes
  1226. fi
  1227. if test -z "$LIBQPE"; then
  1228. dnl ------------------------------------------------------------
  1229. dnl If we got --enable-palmtop then add -lqpe to the link line
  1230. dnl ------------------------------------------------------------
  1231. if test "x$kde_use_qt_emb" = "xyes"; then
  1232. if test "x$kde_use_qt_emb_palm" = "xyes"; then
  1233. LIB_QPE="-lqpe"
  1234. else
  1235. LIB_QPE=""
  1236. fi
  1237. else
  1238. LIB_QPE=""
  1239. fi
  1240. fi
  1241. dnl ------------------------------------------------------------------------
  1242. dnl If we got --enable-qt-mt then adjust the Qt library name for the host.
  1243. dnl ------------------------------------------------------------------------
  1244. if test "x$kde_use_qt_mt" = "xyes"; then
  1245. if test -z "$LIBQT"; then
  1246. LIBQT="-l$qtlib-mt"
  1247. kde_int_qt="-l$qtlib-mt"
  1248. else
  1249. LIBQT="$qtlib-mt"
  1250. kde_int_qt="$qtlib-mt"
  1251. fi
  1252. LIBQT_GLOB="lib$qtlib-mt.*"
  1253. USING_QT_MT="using -mt"
  1254. else
  1255. LIBQT="-l$qtlib"
  1256. fi
  1257. if test $kde_qtver != 1; then
  1258. AC_REQUIRE([AC_FIND_PNG])
  1259. AC_REQUIRE([AC_FIND_JPEG])
  1260. LIBQT="$LIBQT $LIBPNG $LIBJPEG"
  1261. fi
  1262. if test $kde_qtver = 3; then
  1263. AC_REQUIRE([KDE_CHECK_LIBDL])
  1264. LIBQT="$LIBQT $LIBDL"
  1265. fi
  1266. AC_MSG_CHECKING([for Qt])
  1267. if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
  1268. LIBQT="$LIBQT $X_PRE_LIBS -lXext -lX11 $LIBSM $LIBSOCKET"
  1269. fi
  1270. ac_qt_includes=NO ac_qt_libraries=NO ac_qt_bindir=NO
  1271. qt_libraries=""
  1272. qt_includes=""
  1273. AC_ARG_WITH(qt-dir,
  1274. AC_HELP_STRING([--with-qt-dir=DIR],[where the root of Qt is installed ]),
  1275. [ ac_qt_includes="$withval"/include
  1276. ac_qt_libraries="$withval"/lib${tdelibsuff}
  1277. ac_qt_bindir="$withval"/bin
  1278. ])
  1279. AC_ARG_WITH(qt-includes,
  1280. AC_HELP_STRING([--with-qt-includes=DIR],[where the Qt includes are. ]),
  1281. [
  1282. ac_qt_includes="$withval"
  1283. ])
  1284. kde_qt_libs_given=no
  1285. AC_ARG_WITH(qt-libraries,
  1286. AC_HELP_STRING([--with-qt-libraries=DIR],[where the Qt library is installed.]),
  1287. [ ac_qt_libraries="$withval"
  1288. kde_qt_libs_given=yes
  1289. ])
  1290. AC_CACHE_VAL(ac_cv_have_qt,
  1291. [#try to guess Qt locations
  1292. qt_incdirs=""
  1293. for dir in $kde_qt_dirs; do
  1294. qt_incdirs="$qt_incdirs $dir/include $dir"
  1295. done
  1296. qt_incdirs="$QTINC $qt_incdirs /usr/local/qt/include /usr/include/qt /usr/include /usr/X11R6/include/X11/qt /usr/X11R6/include/qt /usr/X11R6/include/qt2 /usr/include/qt3 $x_includes"
  1297. if test ! "$ac_qt_includes" = "NO"; then
  1298. qt_incdirs="$ac_qt_includes $qt_incdirs"
  1299. fi
  1300. if test "$kde_qtver" != "1"; then
  1301. kde_qt_header=qstyle.h
  1302. else
  1303. kde_qt_header=qglobal.h
  1304. fi
  1305. AC_FIND_FILE($kde_qt_header, $qt_incdirs, qt_incdir)
  1306. ac_qt_includes="$qt_incdir"
  1307. qt_libdirs=""
  1308. for dir in $kde_qt_dirs; do
  1309. qt_libdirs="$qt_libdirs $dir/lib${tdelibsuff} $dir"
  1310. done
  1311. qt_libdirs="$QTLIB $qt_libdirs /usr/X11R6/lib /usr/lib /usr/local/qt/lib $x_libraries"
  1312. if test ! "$ac_qt_libraries" = "NO"; then
  1313. qt_libdir=$ac_qt_libraries
  1314. else
  1315. qt_libdirs="$ac_qt_libraries $qt_libdirs"
  1316. # if the Qt was given, the chance is too big that libqt.* doesn't exist
  1317. qt_libdir=NONE
  1318. for dir in $qt_libdirs; do
  1319. try="ls -1 $dir/${LIBQT_GLOB}"
  1320. if test -n "`$try 2> /dev/null`"; then qt_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
  1321. done
  1322. fi
  1323. for a in $qt_libdir/lib`echo ${kde_int_qt} | sed 's,^-l,,'`_incremental.*; do
  1324. if test -e "$a"; then
  1325. LIBQT="$LIBQT ${kde_int_qt}_incremental"
  1326. break
  1327. fi
  1328. done
  1329. ac_qt_libraries="$qt_libdir"
  1330. AC_LANG_SAVE
  1331. AC_LANG_CPLUSPLUS
  1332. ac_cxxflags_safe="$CXXFLAGS"
  1333. ac_ldflags_safe="$LDFLAGS"
  1334. ac_libs_safe="$LIBS"
  1335. CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
  1336. LDFLAGS="$LDFLAGS -L$qt_libdir $all_libraries $USER_LDFLAGS $KDE_MT_LDFLAGS"
  1337. LIBS="$LIBS $LIBQT $KDE_MT_LIBS"
  1338. KDE_PRINT_QT_PROGRAM
  1339. if AC_TRY_EVAL(ac_link) && test -s conftest; then
  1340. rm -f conftest*
  1341. else
  1342. echo "configure: failed program was:" >&AC_FD_CC
  1343. cat conftest.$ac_ext >&AC_FD_CC
  1344. ac_qt_libraries="NO"
  1345. fi
  1346. rm -f conftest*
  1347. CXXFLAGS="$ac_cxxflags_safe"
  1348. LDFLAGS="$ac_ldflags_safe"
  1349. LIBS="$ac_libs_safe"
  1350. AC_LANG_RESTORE
  1351. if test "$ac_qt_includes" = NO || test "$ac_qt_libraries" = NO; then
  1352. ac_cv_have_qt="have_qt=no"
  1353. ac_qt_notfound=""
  1354. missing_qt_mt=""
  1355. if test "$ac_qt_includes" = NO; then
  1356. if test "$ac_qt_libraries" = NO; then
  1357. ac_qt_notfound="(headers and libraries)";
  1358. else
  1359. ac_qt_notfound="(headers)";
  1360. fi
  1361. else
  1362. if test "x$kde_use_qt_mt" = "xyes"; then
  1363. missing_qt_mt="
  1364. Make sure that you have compiled Qt with thread support!"
  1365. ac_qt_notfound="(library $qtlib-mt)";
  1366. else
  1367. ac_qt_notfound="(library $qtlib)";
  1368. fi
  1369. fi
  1370. AC_MSG_ERROR([Qt ($kde_qt_minversion) $ac_qt_notfound not found. Please check your installation!
  1371. For more details about this problem, look at the end of config.log.$missing_qt_mt])
  1372. else
  1373. have_qt="yes"
  1374. fi
  1375. ])
  1376. eval "$ac_cv_have_qt"
  1377. if test "$have_qt" != yes; then
  1378. AC_MSG_RESULT([$have_qt]);
  1379. else
  1380. ac_cv_have_qt="have_qt=yes \
  1381. ac_qt_includes=$ac_qt_includes ac_qt_libraries=$ac_qt_libraries"
  1382. AC_MSG_RESULT([libraries $ac_qt_libraries, headers $ac_qt_includes $USING_QT_MT])
  1383. qt_libraries="$ac_qt_libraries"
  1384. qt_includes="$ac_qt_includes"
  1385. fi
  1386. if test ! "$kde_qt_libs_given" = "yes" && test ! "$kde_qtver" = 3; then
  1387. KDE_CHECK_QT_DIRECT(qt_libraries= ,[])
  1388. fi
  1389. AC_SUBST(qt_libraries)
  1390. AC_SUBST(qt_includes)
  1391. if test "$qt_includes" = "$x_includes" || test -z "$qt_includes"; then
  1392. QT_INCLUDES=""
  1393. else
  1394. QT_INCLUDES="-I$qt_includes"
  1395. all_includes="$QT_INCLUDES $all_includes"
  1396. fi
  1397. if test "$qt_libraries" = "$x_libraries" || test -z "$qt_libraries"; then
  1398. QT_LDFLAGS=""
  1399. else
  1400. QT_LDFLAGS="-L$qt_libraries"
  1401. all_libraries="$QT_LDFLAGS $all_libraries"
  1402. fi
  1403. test -z "$KDE_MT_LDFLAGS" || all_libraries="$all_libraries $KDE_MT_LDFLAGS"
  1404. AC_SUBST(QT_INCLUDES)
  1405. AC_SUBST(QT_LDFLAGS)
  1406. AC_PATH_TQT_MOC_UIC
  1407. KDE_CHECK_QT_JPEG
  1408. if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
  1409. LIB_TQT="$kde_int_qt $LIBJPEG_QT "'$(LIBZ) $(LIBPNG) -lXext $(LIB_X11) $(LIBSM)'
  1410. else
  1411. LIB_TQT="$kde_int_qt $LIBJPEG_QT "'$(LIBZ) $(LIBPNG)'
  1412. fi
  1413. test -z "$KDE_MT_LIBS" || LIB_TQT="$LIB_TQT $KDE_MT_LIBS"
  1414. for a in $qt_libdir/lib`echo ${kde_int_qt} | sed 's,^-l,,'`_incremental.*; do
  1415. if test -e "$a"; then
  1416. LIB_TQT="$LIB_TQT ${kde_int_qt}_incremental"
  1417. break
  1418. fi
  1419. done
  1420. AC_SUBST(LIB_TQT)
  1421. AC_SUBST(LIB_QPE)
  1422. AC_SUBST(kde_qtver)
  1423. ])
  1424. AC_DEFUN([AC_PATH_TQT],
  1425. [
  1426. AC_PATH_TQT_1_3
  1427. ])
  1428. AC_DEFUN([KDE_CHECK_UIC_PLUGINS],
  1429. [
  1430. AC_REQUIRE([AC_PATH_TQT_MOC_UIC])
  1431. if test x$ac_uic_supports_libpath = xyes; then
  1432. AC_MSG_CHECKING([if UIC has KDE plugins available])
  1433. AC_CACHE_VAL(kde_cv_uic_plugins,
  1434. [
  1435. cat > actest.ui << EOF
  1436. <!DOCTYPE UI><UI version="3.0" stdsetdef="1">
  1437. <class>NewConnectionDialog</class>
  1438. <widget class="QDialog">
  1439. <widget class="KLineEdit">
  1440. <property name="name">
  1441. <cstring>testInput</cstring>
  1442. </property>
  1443. </widget>
  1444. </widget>
  1445. </UI>
  1446. EOF
  1447. kde_cv_uic_plugins=no
  1448. kde_line="$UIC_PATH -L $kde_widgetdir"
  1449. if test x$ac_uic_supports_nounload = xyes; then
  1450. kde_line="$kde_line -nounload"
  1451. fi
  1452. kde_line="$kde_line -impl actest.h actest.ui > actest.cpp"
  1453. if AC_TRY_EVAL(kde_line); then
  1454. # if you're trying to debug this check and think it's incorrect,
  1455. # better check your installation. The check _is_ correct - your
  1456. # installation is not.
  1457. if test -f actest.cpp && grep klineedit actest.cpp > /dev/null; then
  1458. kde_cv_uic_plugins=yes
  1459. fi
  1460. fi
  1461. rm -f actest.ui actest.cpp
  1462. ])
  1463. AC_MSG_RESULT([$kde_cv_uic_plugins])
  1464. if test "$kde_cv_uic_plugins" != yes; then
  1465. AC_MSG_ERROR([you need to install tdelibs first.])
  1466. fi
  1467. fi
  1468. ])
  1469. AC_DEFUN([KDE_CHECK_FINAL],
  1470. [
  1471. AC_ARG_ENABLE(final,
  1472. AC_HELP_STRING([--enable-final],
  1473. [build size optimized apps (experimental - needs lots of memory)]),
  1474. kde_use_final=$enableval, kde_use_final=no)
  1475. if test "x$kde_use_final" = "xyes"; then
  1476. KDE_USE_FINAL_TRUE=""
  1477. KDE_USE_FINAL_FALSE="#"
  1478. else
  1479. KDE_USE_FINAL_TRUE="#"
  1480. KDE_USE_FINAL_FALSE=""
  1481. fi
  1482. AC_SUBST(KDE_USE_FINAL_TRUE)
  1483. AC_SUBST(KDE_USE_FINAL_FALSE)
  1484. ])
  1485. AC_DEFUN([KDE_CHECK_CLOSURE],
  1486. [
  1487. AC_ARG_ENABLE(closure,
  1488. AC_HELP_STRING([--enable-closure],[delay template instantiation]),
  1489. kde_use_closure=$enableval, kde_use_closure=no)
  1490. KDE_NO_UNDEFINED=""
  1491. if test "x$kde_use_closure" = "xyes"; then
  1492. KDE_USE_CLOSURE_TRUE=""
  1493. KDE_USE_CLOSURE_FALSE="#"
  1494. # CXXFLAGS="$CXXFLAGS $REPO"
  1495. else
  1496. KDE_USE_CLOSURE_TRUE="#"
  1497. KDE_USE_CLOSURE_FALSE=""
  1498. KDE_NO_UNDEFINED=""
  1499. case $host in
  1500. *-*-linux-gnu)
  1501. KDE_CHECK_COMPILER_FLAG([Wl,--no-undefined],
  1502. [KDE_CHECK_COMPILER_FLAG([Wl,--allow-shlib-undefined],
  1503. [KDE_NO_UNDEFINED="-Wl,--no-undefined -Wl,--allow-shlib-undefined"],
  1504. [KDE_NO_UNDEFINED=""])],
  1505. [KDE_NO_UNDEFINED=""])
  1506. ;;
  1507. esac
  1508. fi
  1509. AC_SUBST(KDE_USE_CLOSURE_TRUE)
  1510. AC_SUBST(KDE_USE_CLOSURE_FALSE)
  1511. AC_SUBST(KDE_NO_UNDEFINED)
  1512. ])
  1513. dnl Check if the linker supports --enable-new-dtags and --as-needed
  1514. AC_DEFUN([KDE_CHECK_NEW_LDFLAGS],
  1515. [
  1516. AC_ARG_ENABLE(new_ldflags,
  1517. AC_HELP_STRING([--enable-new-ldflags],
  1518. [enable the new linker flags]),
  1519. kde_use_new_ldflags=$enableval,
  1520. kde_use_new_ldflags=no)
  1521. LDFLAGS_AS_NEEDED=""
  1522. LDFLAGS_NEW_DTAGS=""
  1523. if test "x$kde_use_new_ldflags" = "xyes"; then
  1524. LDFLAGS_NEW_DTAGS=""
  1525. KDE_CHECK_COMPILER_FLAG([Wl,--enable-new-dtags],
  1526. [LDFLAGS_NEW_DTAGS="-Wl,--enable-new-dtags"],)
  1527. KDE_CHECK_COMPILER_FLAG([Wl,--as-needed],
  1528. [LDFLAGS_AS_NEEDED="-Wl,--as-needed"],)
  1529. fi
  1530. AC_SUBST(LDFLAGS_AS_NEEDED)
  1531. AC_SUBST(LDFLAGS_NEW_DTAGS)
  1532. ])
  1533. AC_DEFUN([KDE_CHECK_NMCHECK],
  1534. [
  1535. AC_ARG_ENABLE(nmcheck,AC_HELP_STRING([--enable-nmcheck],[enable automatic namespace cleanness check]),
  1536. kde_use_nmcheck=$enableval, kde_use_nmcheck=no)
  1537. if test "$kde_use_nmcheck" = "yes"; then
  1538. KDE_USE_NMCHECK_TRUE=""
  1539. KDE_USE_NMCHECK_FALSE="#"
  1540. else
  1541. KDE_USE_NMCHECK_TRUE="#"
  1542. KDE_USE_NMCHECK_FALSE=""
  1543. fi
  1544. AC_SUBST(KDE_USE_NMCHECK_TRUE)
  1545. AC_SUBST(KDE_USE_NMCHECK_FALSE)
  1546. ])
  1547. AC_DEFUN([KDE_EXPAND_MAKEVAR], [
  1548. savex=$exec_prefix
  1549. test "x$exec_prefix" = xNONE && exec_prefix=$prefix
  1550. tmp=$$2
  1551. while $1=`eval echo "$tmp"`; test "x$$1" != "x$tmp"; do tmp=$$1; done
  1552. exec_prefix=$savex
  1553. ])
  1554. dnl ------------------------------------------------------------------------
  1555. dnl Now, the same with KDE
  1556. dnl $(KDE_LDFLAGS) will be the kdeliblocation (if needed)
  1557. dnl and $(kde_includes) will be the kdehdrlocation (if needed)
  1558. dnl ------------------------------------------------------------------------
  1559. dnl
  1560. AC_DEFUN([AC_BASE_PATH_KDE],
  1561. [
  1562. AC_REQUIRE([KDE_CHECK_STL])
  1563. AC_REQUIRE([AC_PATH_TQT])dnl
  1564. AC_REQUIRE([KDE_CHECK_LIB64])
  1565. AC_CHECK_RPATH
  1566. AC_MSG_CHECKING([for KDE])
  1567. if test "${prefix}" != NONE; then
  1568. kde_includes=${includedir}
  1569. KDE_EXPAND_MAKEVAR(ac_kde_includes, includedir)
  1570. kde_libraries=${libdir}
  1571. KDE_EXPAND_MAKEVAR(ac_kde_libraries, libdir)
  1572. else
  1573. ac_kde_includes=
  1574. ac_kde_libraries=
  1575. kde_libraries=""
  1576. kde_includes=""
  1577. fi
  1578. AC_CACHE_VAL(ac_cv_have_kde,
  1579. [#try to guess kde locations
  1580. if test "$kde_qtver" = 1; then
  1581. kde_check_header="ksock.h"
  1582. kde_check_lib="libtdecore.la"
  1583. else
  1584. kde_check_header="ksharedptr.h"
  1585. kde_check_lib="libtdeio.la"
  1586. fi
  1587. if test -z "$1"; then
  1588. kde_incdirs="$kde_libs_prefix/include /opt/trinity/include/tde /usr/lib/kde/include /usr/local/kde/include /usr/local/include /usr/kde/include /usr/include/tde /usr/include /opt/trinity/include /opt/kde/include $x_includes $qt_includes"
  1589. test -n "$TDEDIR" && kde_incdirs="$TDEDIR/include $TDEDIR/include/tde $TDEDIR $kde_incdirs"
  1590. kde_incdirs="$ac_kde_includes $kde_incdirs"
  1591. AC_FIND_FILE($kde_check_header, $kde_incdirs, kde_incdir)
  1592. ac_kde_includes="$kde_incdir"
  1593. if test -n "$ac_kde_includes" && test ! -r "$ac_kde_includes/$kde_check_header"; then
  1594. AC_MSG_ERROR([
  1595. in the prefix, you've chosen, are no KDE headers installed. This will fail.
  1596. So, check this please and use another prefix!])
  1597. fi
  1598. kde_libdirs="$kde_libs_prefix/lib${tdelibsuff} /usr/lib/kde/lib${tdelibsuff} /usr/local/kde/lib${tdelibsuff} /usr/kde/lib${tdelibsuff} /usr/lib${tdelibsuff}/kde /usr/lib${tdelibsuff}/trinity /usr/lib${tdelibsuff} /usr/X11R6/lib${tdelibsuff} /usr/local/lib${tdelibsuff} /opt/trinity/lib${tdelibsuff} /opt/kde/lib${tdelibsuff} /usr/X11R6/kde/lib${tdelibsuff}"
  1599. test -n "$TDEDIR" && kde_libdirs="$TDEDIR/lib${tdelibsuff} $TDEDIR $kde_libdirs"
  1600. kde_libdirs="$ac_kde_libraries $libdir $kde_libdirs"
  1601. AC_FIND_FILE($kde_check_lib, $kde_libdirs, kde_libdir)
  1602. ac_kde_libraries="$kde_libdir"
  1603. kde_widgetdir=NO
  1604. dnl this might be somewhere else
  1605. AC_FIND_FILE("trinity/plugins/designer/tdewidgets.la", $kde_libdirs, kde_widgetdir)
  1606. if test -n "$ac_kde_libraries" && test ! -r "$ac_kde_libraries/$kde_check_lib"; then
  1607. AC_MSG_ERROR([
  1608. in the prefix, you've chosen, are no KDE libraries installed. This will fail.
  1609. So, check this please and use another prefix!])
  1610. fi
  1611. if test -n "$kde_widgetdir" && test ! -r "$kde_widgetdir/trinity/plugins/designer/tdewidgets.la"; then
  1612. AC_MSG_ERROR([
  1613. I can't find the designer plugins. These are required and should have been installed
  1614. by tdelibs])
  1615. fi
  1616. if test -n "$kde_widgetdir"; then
  1617. kde_widgetdir="$kde_widgetdir/trinity/plugins/designer"
  1618. fi
  1619. if test "$ac_kde_includes" = NO || test "$ac_kde_libraries" = NO || test "$kde_widgetdir" = NO; then
  1620. ac_cv_have_kde="have_kde=no"
  1621. else
  1622. ac_cv_have_kde="have_kde=yes \
  1623. ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
  1624. fi
  1625. else dnl test -z $1, e.g. from tdelibs
  1626. ac_cv_have_kde="have_kde=no"
  1627. fi
  1628. ])dnl
  1629. eval "$ac_cv_have_kde"
  1630. if test "$have_kde" != "yes"; then
  1631. if test "${prefix}" = NONE; then
  1632. ac_kde_prefix="$ac_default_prefix"
  1633. else
  1634. ac_kde_prefix="$prefix"
  1635. fi
  1636. if test "$exec_prefix" = NONE; then
  1637. ac_kde_exec_prefix="$ac_kde_prefix"
  1638. AC_MSG_RESULT([will be installed in $ac_kde_prefix])
  1639. else
  1640. ac_kde_exec_prefix="$exec_prefix"
  1641. AC_MSG_RESULT([will be installed in $ac_kde_prefix and $ac_kde_exec_prefix])
  1642. fi
  1643. kde_libraries="${libdir}"
  1644. kde_includes="${includedir}"
  1645. else
  1646. ac_cv_have_kde="have_kde=yes \
  1647. ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
  1648. AC_MSG_RESULT([libraries $ac_kde_libraries, headers $ac_kde_includes])
  1649. kde_libraries="$ac_kde_libraries"
  1650. kde_includes="$ac_kde_includes"
  1651. fi
  1652. AC_SUBST(kde_libraries)
  1653. AC_SUBST(kde_includes)
  1654. if test "$kde_includes" = "$x_includes" || test "$kde_includes" = "$qt_includes" || test "$kde_includes" = "/usr/include"; then
  1655. KDE_INCLUDES=""
  1656. else
  1657. KDE_INCLUDES="-I$kde_includes"
  1658. all_includes="$KDE_INCLUDES $all_includes"
  1659. fi
  1660. KDE_DEFAULT_CXXFLAGS="-DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION"
  1661. KDE_LDFLAGS="-L$kde_libraries"
  1662. if test ! "$kde_libraries" = "$x_libraries" && test ! "$kde_libraries" = "$qt_libraries" ; then
  1663. all_libraries="$KDE_LDFLAGS $all_libraries"
  1664. fi
  1665. AC_SUBST(KDE_LDFLAGS)
  1666. AC_SUBST(KDE_INCLUDES)
  1667. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  1668. all_libraries="$all_libraries $USER_LDFLAGS"
  1669. all_includes="$all_includes $USER_INCLUDES"
  1670. AC_SUBST(all_includes)
  1671. AC_SUBST(all_libraries)
  1672. if test -z "$1"; then
  1673. KDE_CHECK_UIC_PLUGINS
  1674. fi
  1675. ac_kde_libraries="$kde_libdir"
  1676. AC_SUBST(AUTODIRS)
  1677. ])
  1678. AC_DEFUN([KDE_CHECK_EXTRA_LIBS],
  1679. [
  1680. AC_MSG_CHECKING(for extra includes)
  1681. AC_ARG_WITH(extra-includes,AC_HELP_STRING([--with-extra-includes=DIR],[adds non standard include paths]),
  1682. kde_use_extra_includes="$withval",
  1683. kde_use_extra_includes=NONE
  1684. )
  1685. kde_extra_includes=
  1686. if test -n "$kde_use_extra_includes" && \
  1687. test "$kde_use_extra_includes" != "NONE"; then
  1688. ac_save_ifs=$IFS
  1689. IFS=':'
  1690. for dir in $kde_use_extra_includes; do
  1691. kde_extra_includes="$kde_extra_includes $dir"
  1692. USER_INCLUDES="$USER_INCLUDES -I$dir"
  1693. done
  1694. IFS=$ac_save_ifs
  1695. kde_use_extra_includes="added"
  1696. else
  1697. kde_use_extra_includes="no"
  1698. fi
  1699. AC_SUBST(USER_INCLUDES)
  1700. AC_MSG_RESULT($kde_use_extra_includes)
  1701. kde_extra_libs=
  1702. AC_MSG_CHECKING(for extra libs)
  1703. AC_ARG_WITH(extra-libs,AC_HELP_STRING([--with-extra-libs=DIR],[adds non standard library paths]),
  1704. kde_use_extra_libs=$withval,
  1705. kde_use_extra_libs=NONE
  1706. )
  1707. if test -n "$kde_use_extra_libs" && \
  1708. test "$kde_use_extra_libs" != "NONE"; then
  1709. ac_save_ifs=$IFS
  1710. IFS=':'
  1711. for dir in $kde_use_extra_libs; do
  1712. kde_extra_libs="$kde_extra_libs $dir"
  1713. KDE_EXTRA_RPATH="$KDE_EXTRA_RPATH -R $dir"
  1714. USER_LDFLAGS="$USER_LDFLAGS -L$dir"
  1715. done
  1716. IFS=$ac_save_ifs
  1717. kde_use_extra_libs="added"
  1718. else
  1719. kde_use_extra_libs="no"
  1720. fi
  1721. AC_SUBST(USER_LDFLAGS)
  1722. AC_MSG_RESULT($kde_use_extra_libs)
  1723. ])
  1724. AC_DEFUN([KDE_1_CHECK_PATH_HEADERS],
  1725. [
  1726. AC_MSG_CHECKING([for KDE headers installed])
  1727. AC_LANG_SAVE
  1728. AC_LANG_CPLUSPLUS
  1729. cat > conftest.$ac_ext <<EOF
  1730. #ifdef STDC_HEADERS
  1731. # include <stdlib.h>
  1732. #endif
  1733. #include <stdio.h>
  1734. #include "confdefs.h"
  1735. #include <kapp.h>
  1736. int main() {
  1737. printf("kde_htmldir=\\"%s\\"\n", TDEApplication::kde_htmldir().data());
  1738. printf("kde_appsdir=\\"%s\\"\n", TDEApplication::kde_appsdir().data());
  1739. printf("kde_icondir=\\"%s\\"\n", TDEApplication::kde_icondir().data());
  1740. printf("kde_sounddir=\\"%s\\"\n", TDEApplication::kde_sounddir().data());
  1741. printf("kde_datadir=\\"%s\\"\n", TDEApplication::kde_datadir().data());
  1742. printf("kde_locale=\\"%s\\"\n", TDEApplication::kde_localedir().data());
  1743. printf("kde_cgidir=\\"%s\\"\n", TDEApplication::kde_cgidir().data());
  1744. printf("kde_confdir=\\"%s\\"\n", TDEApplication::kde_configdir().data());
  1745. printf("kde_mimedir=\\"%s\\"\n", TDEApplication::kde_mimedir().data());
  1746. printf("kde_toolbardir=\\"%s\\"\n", TDEApplication::kde_toolbardir().data());
  1747. printf("kde_wallpaperdir=\\"%s\\"\n",
  1748. TDEApplication::kde_wallpaperdir().data());
  1749. printf("kde_bindir=\\"%s\\"\n", TDEApplication::kde_bindir().data());
  1750. printf("kde_partsdir=\\"%s\\"\n", TDEApplication::kde_partsdir().data());
  1751. printf("kde_servicesdir=\\"/tmp/dummy\\"\n");
  1752. printf("kde_servicetypesdir=\\"/tmp/dummy\\"\n");
  1753. printf("kde_moduledir=\\"/tmp/dummy\\"\n");
  1754. printf("kde_styledir=\\"/tmp/dummy\\"\n");
  1755. printf("kde_widgetdir=\\"/tmp/dummy\\"\n");
  1756. printf("xdg_appsdir=\\"/tmp/dummy\\"\n");
  1757. printf("xdg_menudir=\\"/tmp/dummy\\"\n");
  1758. printf("xdg_directorydir=\\"/tmp/dummy\\"\n");
  1759. printf("kde_kcfgdir=\\"/tmp/dummy\\"\n");
  1760. return 0;
  1761. }
  1762. EOF
  1763. ac_save_CPPFLAGS=$CPPFLAGS
  1764. CPPFLAGS="$all_includes $CPPFLAGS"
  1765. if AC_TRY_EVAL(ac_compile); then
  1766. AC_MSG_RESULT(yes)
  1767. else
  1768. AC_MSG_ERROR([your system is not able to compile a small KDE application!
  1769. Check, if you installed the KDE header files correctly.
  1770. For more details about this problem, look at the end of config.log.])
  1771. fi
  1772. CPPFLAGS=$ac_save_CPPFLAGS
  1773. AC_LANG_RESTORE
  1774. ])
  1775. AC_DEFUN([KDE_CHECK_KDEQTADDON],
  1776. [
  1777. AC_MSG_CHECKING(for kde-qt-addon)
  1778. AC_CACHE_VAL(kde_cv_have_kdeqtaddon,
  1779. [
  1780. kde_ldflags_safe="$LDFLAGS"
  1781. kde_libs_safe="$LIBS"
  1782. kde_cxxflags_safe="$CXXFLAGS"
  1783. LIBS="-lkde-qt-addon $LIBQT $LIBS"
  1784. CXXFLAGS="$CXXFLAGS -I$prefix/include -I$prefix/include/tde $all_includes"
  1785. LDFLAGS="$LDFLAGS $all_libraries $USER_LDFLAGS"
  1786. AC_TRY_LINK([
  1787. #include <qdom.h>
  1788. ],
  1789. [
  1790. QDomDocument doc;
  1791. ],
  1792. kde_cv_have_kdeqtaddon=yes,
  1793. kde_cv_have_kdeqtaddon=no
  1794. )
  1795. LDFLAGS=$kde_ldflags_safe
  1796. LIBS=$kde_libs_safe
  1797. CXXFLAGS=$kde_cxxflags_safe
  1798. ])
  1799. AC_MSG_RESULT($kde_cv_have_kdeqtaddon)
  1800. if test "$kde_cv_have_kdeqtaddon" = "no"; then
  1801. AC_MSG_ERROR([Can't find libkde-qt-addon. You need to install it first.
  1802. It is a separate package (and CVS module) named kde-qt-addon.])
  1803. fi
  1804. ])
  1805. AC_DEFUN([KDE_CREATE_LIBS_ALIASES],
  1806. [
  1807. AC_REQUIRE([KDE_MISC_TESTS])
  1808. AC_REQUIRE([KDE_CHECK_LIBDL])
  1809. AC_REQUIRE([K_PATH_X])
  1810. if test $kde_qtver = 3; then
  1811. AC_SUBST(LIB_TDECORE, "-ltdecore")
  1812. AC_SUBST(LIB_TDEUI, "-ltdeui")
  1813. AC_SUBST(LIB_TDEIO, "-ltdeio")
  1814. AC_SUBST(LIB_KJS, "-lkjs")
  1815. AC_SUBST(LIB_SMB, "-lsmb")
  1816. AC_SUBST(LIB_KAB, "-lkab")
  1817. AC_SUBST(LIB_TDEABC, "-ltdeabc")
  1818. AC_SUBST(LIB_TDEHTML, "-ltdehtml")
  1819. AC_SUBST(LIB_TDESPELL, "-ltdespell")
  1820. AC_SUBST(LIB_TDEPARTS, "-ltdeparts")
  1821. AC_SUBST(LIB_TDEPRINT, "-ltdeprint")
  1822. AC_SUBST(LIB_TDEUTILS, "-ltdeutils")
  1823. AC_SUBST(LIB_TDEPIM, "-ltdepim")
  1824. AC_SUBST(LIB_TDEIMPROXY, "-ltdeimproxy")
  1825. AC_SUBST(LIB_KNEWSTUFF, "-lknewstuff")
  1826. AC_SUBST(LIB_TDEDNSSD, "-ltdednssd")
  1827. # these are for backward compatibility
  1828. AC_SUBST(LIB_TDESYCOCA, "-ltdeio")
  1829. AC_SUBST(LIB_TDEFILE, "-ltdeio")
  1830. elif test $kde_qtver = 2; then
  1831. AC_SUBST(LIB_TDECORE, "-ltdecore")
  1832. AC_SUBST(LIB_TDEUI, "-ltdeui")
  1833. AC_SUBST(LIB_TDEIO, "-ltdeio")
  1834. AC_SUBST(LIB_TDESYCOCA, "-ltdesycoca")
  1835. AC_SUBST(LIB_SMB, "-lsmb")
  1836. AC_SUBST(LIB_TDEFILE, "-ltdefile")
  1837. AC_SUBST(LIB_KAB, "-lkab")
  1838. AC_SUBST(LIB_TDEHTML, "-ltdehtml")
  1839. AC_SUBST(LIB_TDESPELL, "-ltdespell")
  1840. AC_SUBST(LIB_TDEPARTS, "-ltdeparts")
  1841. AC_SUBST(LIB_TDEPRINT, "-ltdeprint")
  1842. else
  1843. AC_SUBST(LIB_TDECORE, "-ltdecore -lXext $(LIB_TQT)")
  1844. AC_SUBST(LIB_TDEUI, "-ltdeui $(LIB_TDECORE)")
  1845. AC_SUBST(LIB_KFM, "-lkfm $(LIB_TDECORE)")
  1846. AC_SUBST(LIB_TDEFILE, "-ltdefile $(LIB_KFM) $(LIB_TDEUI)")
  1847. AC_SUBST(LIB_KAB, "-lkab $(LIB_KIMGIO) $(LIB_TDECORE)")
  1848. fi
  1849. ])
  1850. AC_DEFUN([AC_PATH_KDE],
  1851. [
  1852. AC_BASE_PATH_KDE
  1853. AC_ARG_ENABLE(path-check,AC_HELP_STRING([--disable-path-check],[don't try to find out, where to install]),
  1854. [
  1855. if test "$enableval" = "no";
  1856. then ac_use_path_checking="default"
  1857. else ac_use_path_checking=""
  1858. fi
  1859. ],
  1860. [
  1861. if test "$kde_qtver" = 1;
  1862. then ac_use_path_checking=""
  1863. else ac_use_path_checking="default"
  1864. fi
  1865. ]
  1866. )
  1867. AC_CREATE_KFSSTND($ac_use_path_checking)
  1868. AC_SUBST_KFSSTND
  1869. KDE_CREATE_LIBS_ALIASES
  1870. ])
  1871. dnl KDE_CHECK_FUNC_EXT(<func>, [headers], [sample-use], [C prototype], [autoheader define], [call if found])
  1872. AC_DEFUN([KDE_CHECK_FUNC_EXT],
  1873. [
  1874. AC_MSG_CHECKING(for $1)
  1875. AC_CACHE_VAL(kde_cv_func_$1,
  1876. [
  1877. AC_LANG_SAVE
  1878. AC_LANG_CPLUSPLUS
  1879. save_CXXFLAGS="$CXXFLAGS"
  1880. kde_safe_LIBS="$LIBS"
  1881. LIBS="$LIBS $X_EXTRA_LIBS"
  1882. if test "$GXX" = "yes"; then
  1883. CXXFLAGS="$CXXFLAGS -pedantic-errors"
  1884. fi
  1885. AC_TRY_COMPILE([
  1886. $2
  1887. ],
  1888. [
  1889. $3
  1890. ],
  1891. kde_cv_func_$1=yes,
  1892. kde_cv_func_$1=no)
  1893. CXXFLAGS="$save_CXXFLAGS"
  1894. LIBS="$kde_safe_LIBS"
  1895. AC_LANG_RESTORE
  1896. ])
  1897. AC_MSG_RESULT($kde_cv_func_$1)
  1898. AC_MSG_CHECKING([if $1 needs custom prototype])
  1899. AC_CACHE_VAL(kde_cv_proto_$1,
  1900. [
  1901. if test "x$kde_cv_func_$1" = xyes; then
  1902. kde_cv_proto_$1=no
  1903. else
  1904. case "$1" in
  1905. setenv|unsetenv|usleep|random|srandom|seteuid|mkstemps|mkstemp|revoke|vsnprintf|strlcpy|strlcat)
  1906. kde_cv_proto_$1="yes - in libtdefakes"
  1907. ;;
  1908. *)
  1909. kde_cv_proto_$1=unknown
  1910. ;;
  1911. esac
  1912. fi
  1913. if test "x$kde_cv_proto_$1" = xunknown; then
  1914. AC_LANG_SAVE
  1915. AC_LANG_CPLUSPLUS
  1916. kde_safe_libs=$LIBS
  1917. LIBS="$LIBS $X_EXTRA_LIBS"
  1918. AC_TRY_LINK([
  1919. $2
  1920. extern "C" $4;
  1921. ],
  1922. [
  1923. $3
  1924. ],
  1925. [ kde_cv_func_$1=yes
  1926. kde_cv_proto_$1=yes ],
  1927. [kde_cv_proto_$1="$1 unavailable"]
  1928. )
  1929. LIBS=$kde_safe_libs
  1930. AC_LANG_RESTORE
  1931. fi
  1932. ])
  1933. AC_MSG_RESULT($kde_cv_proto_$1)
  1934. if test "x$kde_cv_func_$1" = xyes; then
  1935. AC_DEFINE(HAVE_$5, 1, [Define if you have $1])
  1936. $6
  1937. fi
  1938. if test "x$kde_cv_proto_$1" = xno; then
  1939. AC_DEFINE(HAVE_$5_PROTO, 1,
  1940. [Define if you have the $1 prototype])
  1941. fi
  1942. AH_VERBATIM([_HAVE_$5_PROTO],
  1943. [
  1944. #if !defined(HAVE_$5_PROTO)
  1945. #ifdef __cplusplus
  1946. extern "C" {
  1947. #endif
  1948. $4;
  1949. #ifdef __cplusplus
  1950. }
  1951. #endif
  1952. #endif
  1953. ])
  1954. ])
  1955. AC_DEFUN([AC_CHECK_SETENV],
  1956. [
  1957. KDE_CHECK_FUNC_EXT(setenv, [
  1958. #include <stdlib.h>
  1959. ],
  1960. [setenv("VAR", "VALUE", 1);],
  1961. [int setenv (const char *, const char *, int)],
  1962. [SETENV])
  1963. ])
  1964. AC_DEFUN([AC_CHECK_UNSETENV],
  1965. [
  1966. KDE_CHECK_FUNC_EXT(unsetenv, [
  1967. #include <stdlib.h>
  1968. ],
  1969. [unsetenv("VAR");],
  1970. [void unsetenv (const char *)],
  1971. [UNSETENV])
  1972. ])
  1973. AC_DEFUN([AC_CHECK_GETDOMAINNAME],
  1974. [
  1975. KDE_CHECK_FUNC_EXT(getdomainname, [
  1976. #include <stdlib.h>
  1977. #include <unistd.h>
  1978. #include <netdb.h>
  1979. ],
  1980. [
  1981. char buffer[200];
  1982. getdomainname(buffer, 200);
  1983. ],
  1984. [#include <sys/types.h>
  1985. int getdomainname (char *, size_t)],
  1986. [GETDOMAINNAME])
  1987. ])
  1988. AC_DEFUN([AC_CHECK_GETHOSTNAME],
  1989. [
  1990. KDE_CHECK_FUNC_EXT(gethostname, [
  1991. #include <stdlib.h>
  1992. #include <unistd.h>
  1993. ],
  1994. [
  1995. char buffer[200];
  1996. gethostname(buffer, 200);
  1997. ],
  1998. [int gethostname (char *, unsigned int)],
  1999. [GETHOSTNAME])
  2000. ])
  2001. AC_DEFUN([AC_CHECK_USLEEP],
  2002. [
  2003. KDE_CHECK_FUNC_EXT(usleep, [
  2004. #include <unistd.h>
  2005. ],
  2006. [
  2007. usleep(200);
  2008. ],
  2009. [int usleep (unsigned int)],
  2010. [USLEEP])
  2011. ])
  2012. AC_DEFUN([AC_CHECK_RANDOM],
  2013. [
  2014. KDE_CHECK_FUNC_EXT(random, [
  2015. #include <stdlib.h>
  2016. ],
  2017. [
  2018. random();
  2019. ],
  2020. [long int random(void)],
  2021. [RANDOM])
  2022. KDE_CHECK_FUNC_EXT(srandom, [
  2023. #include <stdlib.h>
  2024. ],
  2025. [
  2026. srandom(27);
  2027. ],
  2028. [void srandom(unsigned int)],
  2029. [SRANDOM])
  2030. ])
  2031. AC_DEFUN([AC_CHECK_INITGROUPS],
  2032. [
  2033. KDE_CHECK_FUNC_EXT(initgroups, [
  2034. #include <sys/types.h>
  2035. #include <unistd.h>
  2036. #include <grp.h>
  2037. ],
  2038. [
  2039. char buffer[200];
  2040. initgroups(buffer, 27);
  2041. ],
  2042. [int initgroups(const char *, gid_t)],
  2043. [INITGROUPS])
  2044. ])
  2045. AC_DEFUN([AC_CHECK_MKSTEMPS],
  2046. [
  2047. KDE_CHECK_FUNC_EXT(mkstemps, [
  2048. #include <stdlib.h>
  2049. #include <unistd.h>
  2050. ],
  2051. [
  2052. mkstemps("/tmp/aaaXXXXXX", 6);
  2053. ],
  2054. [int mkstemps(char *, int)],
  2055. [MKSTEMPS])
  2056. ])
  2057. AC_DEFUN([AC_CHECK_MKSTEMP],
  2058. [
  2059. KDE_CHECK_FUNC_EXT(mkstemp, [
  2060. #include <stdlib.h>
  2061. #include <unistd.h>
  2062. ],
  2063. [
  2064. mkstemp("/tmp/aaaXXXXXX");
  2065. ],
  2066. [int mkstemp(char *)],
  2067. [MKSTEMP])
  2068. ])
  2069. AC_DEFUN([AC_CHECK_MKDTEMP],
  2070. [
  2071. KDE_CHECK_FUNC_EXT(mkdtemp, [
  2072. #include <stdlib.h>
  2073. #include <unistd.h>
  2074. ],
  2075. [
  2076. mkdtemp("/tmp/aaaXXXXXX");
  2077. ],
  2078. [char *mkdtemp(char *)],
  2079. [MKDTEMP])
  2080. ])
  2081. AC_DEFUN([AC_CHECK_RES_INIT],
  2082. [
  2083. AC_MSG_CHECKING([if res_init needs -lresolv])
  2084. kde_libs_safe="$LIBS"
  2085. LIBS="$LIBS $X_EXTRA_LIBS -lresolv"
  2086. AC_TRY_LINK(
  2087. [
  2088. #include <sys/types.h>
  2089. #include <netinet/in.h>
  2090. #include <arpa/nameser.h>
  2091. #include <resolv.h>
  2092. ],
  2093. [
  2094. res_init();
  2095. ],
  2096. [
  2097. LIBRESOLV="-lresolv"
  2098. AC_MSG_RESULT(yes)
  2099. AC_DEFINE(HAVE_RES_INIT, 1, [Define if you have the res_init function])
  2100. ],
  2101. [ AC_MSG_RESULT(no) ]
  2102. )
  2103. LIBS=$kde_libs_safe
  2104. AC_SUBST(LIBRESOLV)
  2105. KDE_CHECK_FUNC_EXT(res_init,
  2106. [
  2107. #include <sys/types.h>
  2108. #include <netinet/in.h>
  2109. #include <arpa/nameser.h>
  2110. #include <resolv.h>
  2111. ],
  2112. [res_init()],
  2113. [int res_init(void)],
  2114. [RES_INIT])
  2115. ])
  2116. AC_DEFUN([AC_CHECK_STRLCPY],
  2117. [
  2118. KDE_CHECK_FUNC_EXT(strlcpy, [
  2119. #include <string.h>
  2120. ],
  2121. [ char buf[20];
  2122. strlcpy(buf, "KDE function test", sizeof(buf));
  2123. ],
  2124. [unsigned long strlcpy(char*, const char*, unsigned long)],
  2125. [STRLCPY])
  2126. ])
  2127. AC_DEFUN([AC_CHECK_STRLCAT],
  2128. [
  2129. KDE_CHECK_FUNC_EXT(strlcat, [
  2130. #include <string.h>
  2131. ],
  2132. [ char buf[20];
  2133. buf[0]='\0';
  2134. strlcat(buf, "KDE function test", sizeof(buf));
  2135. ],
  2136. [unsigned long strlcat(char*, const char*, unsigned long)],
  2137. [STRLCAT])
  2138. ])
  2139. AC_DEFUN([AC_CHECK_RES_QUERY],
  2140. [
  2141. KDE_CHECK_FUNC_EXT(res_query, [
  2142. #include <sys/types.h>
  2143. #include <netinet/in.h>
  2144. #include <arpa/nameser.h>
  2145. #include <resolv.h>
  2146. #include <netdb.h>
  2147. ],
  2148. [
  2149. res_query(NULL, 0, 0, NULL, 0);
  2150. ],
  2151. [int res_query(const char *, int, int, unsigned char *, int)],
  2152. [RES_QUERY])
  2153. ])
  2154. AC_DEFUN([AC_CHECK_DN_SKIPNAME],
  2155. [
  2156. KDE_CHECK_FUNC_EXT(dn_skipname, [
  2157. #include <sys/types.h>
  2158. #include <netinet/in.h>
  2159. #include <arpa/nameser.h>
  2160. #include <resolv.h>
  2161. ],
  2162. [
  2163. dn_skipname (NULL, NULL);
  2164. ],
  2165. [int dn_skipname (unsigned char *, unsigned char *)],
  2166. [DN_SKIPNAME])
  2167. ])
  2168. AC_DEFUN([AC_FIND_GIF],
  2169. [AC_MSG_CHECKING([for giflib])
  2170. AC_CACHE_VAL(ac_cv_lib_gif,
  2171. [ac_save_LIBS="$LIBS"
  2172. if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
  2173. LIBS="$all_libraries -lgif -lX11 $LIBSOCKET"
  2174. else
  2175. LIBS="$all_libraries -lgif"
  2176. fi
  2177. AC_TRY_LINK(dnl
  2178. [
  2179. #ifdef __cplusplus
  2180. extern "C" {
  2181. #endif
  2182. int GifLastError(void);
  2183. #ifdef __cplusplus
  2184. }
  2185. #endif
  2186. /* We use char because int might match the return type of a gcc2
  2187. builtin and then its argument prototype would still apply. */
  2188. ],
  2189. [return GifLastError();],
  2190. eval "ac_cv_lib_gif=yes",
  2191. eval "ac_cv_lib_gif=no")
  2192. LIBS="$ac_save_LIBS"
  2193. ])dnl
  2194. if eval "test \"`echo $ac_cv_lib_gif`\" = yes"; then
  2195. AC_MSG_RESULT(yes)
  2196. AC_DEFINE_UNQUOTED(HAVE_LIBGIF, 1, [Define if you have libgif])
  2197. else
  2198. AC_MSG_ERROR(You need giflib30. Please install the tdesupport package)
  2199. fi
  2200. ])
  2201. AC_DEFUN([KDE_FIND_JPEG_HELPER],
  2202. [
  2203. AC_MSG_CHECKING([for libjpeg$2])
  2204. AC_CACHE_VAL(ac_cv_lib_jpeg_$1,
  2205. [
  2206. ac_save_LIBS="$LIBS"
  2207. LIBS="$all_libraries $USER_LDFLAGS -ljpeg$2 -lm"
  2208. ac_save_CFLAGS="$CFLAGS"
  2209. CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
  2210. AC_TRY_LINK(
  2211. [/* Override any gcc2 internal prototype to avoid an error. */
  2212. struct jpeg_decompress_struct;
  2213. typedef struct jpeg_decompress_struct * j_decompress_ptr;
  2214. typedef int size_t;
  2215. #ifdef __cplusplus
  2216. extern "C" {
  2217. #endif
  2218. void jpeg_CreateDecompress(j_decompress_ptr cinfo,
  2219. int version, size_t structsize);
  2220. #ifdef __cplusplus
  2221. }
  2222. #endif
  2223. /* We use char because int might match the return type of a gcc2
  2224. builtin and then its argument prototype would still apply. */
  2225. ],
  2226. [jpeg_CreateDecompress(0L, 0, 0);],
  2227. eval "ac_cv_lib_jpeg_$1=-ljpeg$2",
  2228. eval "ac_cv_lib_jpeg_$1=no")
  2229. LIBS="$ac_save_LIBS"
  2230. CFLAGS="$ac_save_CFLAGS"
  2231. ])
  2232. if eval "test ! \"`echo $ac_cv_lib_jpeg_$1`\" = no"; then
  2233. LIBJPEG="$ac_cv_lib_jpeg_$1"
  2234. AC_MSG_RESULT($ac_cv_lib_jpeg_$1)
  2235. else
  2236. AC_MSG_RESULT(no)
  2237. $3
  2238. fi
  2239. ])
  2240. AC_DEFUN([AC_FIND_JPEG],
  2241. [
  2242. dnl first look for libraries
  2243. KDE_FIND_JPEG_HELPER(6b, 6b,
  2244. KDE_FIND_JPEG_HELPER(normal, [],
  2245. [
  2246. LIBJPEG=
  2247. ]
  2248. )
  2249. )
  2250. dnl then search the headers (can't use simply AC_TRY_xxx, as jpeglib.h
  2251. dnl requires system dependent includes loaded before it)
  2252. jpeg_incdirs="$includedir /usr/include /usr/local/include $kde_extra_includes"
  2253. AC_FIND_FILE(jpeglib.h, $jpeg_incdirs, jpeg_incdir)
  2254. test "x$jpeg_incdir" = xNO && jpeg_incdir=
  2255. dnl if headers _and_ libraries are missing, this is no error, and we
  2256. dnl continue with a warning (the user will get no jpeg support in tdehtml)
  2257. dnl if only one is missing, it means a configuration error, but we still
  2258. dnl only warn
  2259. if test -n "$jpeg_incdir" && test -n "$LIBJPEG" ; then
  2260. AC_DEFINE_UNQUOTED(HAVE_LIBJPEG, 1, [Define if you have libjpeg])
  2261. else
  2262. if test -n "$jpeg_incdir" || test -n "$LIBJPEG" ; then
  2263. AC_MSG_WARN([
  2264. There is an installation error in jpeg support. You seem to have only one
  2265. of either the headers _or_ the libraries installed. You may need to either
  2266. provide correct --with-extra-... options, or the development package of
  2267. libjpeg6b. You can get a source package of libjpeg from http://www.ijg.org/
  2268. Disabling JPEG support.
  2269. ])
  2270. else
  2271. AC_MSG_WARN([libjpeg not found. disable JPEG support.])
  2272. fi
  2273. jpeg_incdir=
  2274. LIBJPEG=
  2275. fi
  2276. AC_SUBST(LIBJPEG)
  2277. AH_VERBATIM(_AC_CHECK_JPEG,
  2278. [/*
  2279. * jpeg.h needs HAVE_BOOLEAN, when the system uses boolean in system
  2280. * headers and I'm too lazy to write a configure test as long as only
  2281. * unixware is related
  2282. */
  2283. #ifdef _UNIXWARE
  2284. #define HAVE_BOOLEAN
  2285. #endif
  2286. ])
  2287. ])
  2288. AC_DEFUN([KDE_CHECK_QT_JPEG],
  2289. [
  2290. if test -n "$LIBJPEG"; then
  2291. AC_MSG_CHECKING([if Qt needs $LIBJPEG])
  2292. AC_CACHE_VAL(kde_cv_qt_jpeg,
  2293. [
  2294. AC_LANG_SAVE
  2295. AC_LANG_CPLUSPLUS
  2296. ac_save_LIBS="$LIBS"
  2297. LIBS="$all_libraries $USER_LDFLAGS $LIBQT"
  2298. LIBS=`echo $LIBS | sed "s/$LIBJPEG//"`
  2299. ac_save_CXXFLAGS="$CXXFLAGS"
  2300. CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
  2301. AC_TRY_LINK(
  2302. [#include <qapplication.h>],
  2303. [
  2304. int argc;
  2305. char** argv;
  2306. QApplication app(argc, argv);],
  2307. eval "kde_cv_qt_jpeg=no",
  2308. eval "kde_cv_qt_jpeg=yes")
  2309. LIBS="$ac_save_LIBS"
  2310. CXXFLAGS="$ac_save_CXXFLAGS"
  2311. AC_LANG_RESTORE
  2312. fi
  2313. ])
  2314. if eval "test ! \"`echo $kde_cv_qt_jpeg`\" = no"; then
  2315. AC_MSG_RESULT(yes)
  2316. LIBJPEG_QT='$(LIBJPEG)'
  2317. else
  2318. AC_MSG_RESULT(no)
  2319. LIBJPEG_QT=
  2320. fi
  2321. ])
  2322. AC_DEFUN([AC_FIND_ZLIB],
  2323. [
  2324. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  2325. AC_MSG_CHECKING([for libz])
  2326. AC_CACHE_VAL(ac_cv_lib_z,
  2327. [
  2328. kde_save_LIBS="$LIBS"
  2329. LIBS="$all_libraries $USER_LDFLAGS -lz $LIBSOCKET"
  2330. kde_save_CFLAGS="$CFLAGS"
  2331. CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
  2332. AC_TRY_LINK(dnl
  2333. [
  2334. #include<zlib.h>
  2335. ],
  2336. [
  2337. char buf[42];
  2338. gzFile f = (gzFile) 0;
  2339. /* this would segfault.. but we only link, don't run */
  2340. (void) gzgets(f, buf, sizeof(buf));
  2341. return (zlibVersion() == ZLIB_VERSION);
  2342. ],
  2343. eval "ac_cv_lib_z='-lz'",
  2344. eval "ac_cv_lib_z=no")
  2345. LIBS="$kde_save_LIBS"
  2346. CFLAGS="$kde_save_CFLAGS"
  2347. ])dnl
  2348. if test ! "$ac_cv_lib_z" = no; then
  2349. AC_DEFINE_UNQUOTED(HAVE_LIBZ, 1, [Define if you have libz])
  2350. LIBZ="$ac_cv_lib_z"
  2351. AC_MSG_RESULT($ac_cv_lib_z)
  2352. else
  2353. AC_MSG_ERROR(not found.
  2354. Possibly configure picks up an outdated version
  2355. installed by XFree86. Remove it from your system.
  2356. Check your installation and look into config.log)
  2357. LIBZ=""
  2358. fi
  2359. AC_SUBST(LIBZ)
  2360. ])
  2361. AC_DEFUN([KDE_TRY_TIFFLIB],
  2362. [
  2363. AC_MSG_CHECKING([for libtiff $1])
  2364. AC_CACHE_VAL(kde_cv_libtiff_$1,
  2365. [
  2366. AC_LANG_SAVE
  2367. AC_LANG_CPLUSPLUS
  2368. kde_save_LIBS="$LIBS"
  2369. if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
  2370. LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lX11 $LIBSOCKET -lm"
  2371. else
  2372. LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lm"
  2373. fi
  2374. kde_save_CXXFLAGS="$CXXFLAGS"
  2375. CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
  2376. AC_TRY_LINK(dnl
  2377. [
  2378. #include<tiffio.h>
  2379. ],
  2380. [return (TIFFOpen( "", "r") == 0); ],
  2381. [
  2382. kde_cv_libtiff_$1="-l$1 $LIBJPEG $LIBZ"
  2383. ], [
  2384. kde_cv_libtiff_$1=no
  2385. ])
  2386. LIBS="$kde_save_LIBS"
  2387. CXXFLAGS="$kde_save_CXXFLAGS"
  2388. AC_LANG_RESTORE
  2389. ])
  2390. if test "$kde_cv_libtiff_$1" = "no"; then
  2391. AC_MSG_RESULT(no)
  2392. LIBTIFF=""
  2393. $3
  2394. else
  2395. LIBTIFF="$kde_cv_libtiff_$1"
  2396. AC_MSG_RESULT(yes)
  2397. AC_DEFINE_UNQUOTED(HAVE_LIBTIFF, 1, [Define if you have libtiff])
  2398. $2
  2399. fi
  2400. ])
  2401. AC_DEFUN([AC_FIND_TIFF],
  2402. [
  2403. AC_REQUIRE([K_PATH_X])
  2404. AC_REQUIRE([AC_FIND_ZLIB])
  2405. AC_REQUIRE([AC_FIND_JPEG])
  2406. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  2407. KDE_TRY_TIFFLIB(tiff, [],
  2408. KDE_TRY_TIFFLIB(tiff34))
  2409. AC_SUBST(LIBTIFF)
  2410. ])
  2411. AC_DEFUN([AC_FIND_PNG],
  2412. [
  2413. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  2414. AC_REQUIRE([AC_FIND_ZLIB])
  2415. AC_MSG_CHECKING([for libpng])
  2416. AC_CACHE_VAL(ac_cv_lib_png,
  2417. [
  2418. kde_save_LIBS="$LIBS"
  2419. if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
  2420. LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm -lX11 $LIBSOCKET"
  2421. else
  2422. LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm"
  2423. fi
  2424. kde_save_CFLAGS="$CFLAGS"
  2425. CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
  2426. AC_TRY_LINK(dnl
  2427. [
  2428. #include<png.h>
  2429. ],
  2430. [
  2431. png_structp png_ptr = png_create_read_struct( /* image ptr */
  2432. PNG_LIBPNG_VER_STRING, 0, 0, 0 );
  2433. return( png_ptr != 0 );
  2434. ],
  2435. eval "ac_cv_lib_png='-lpng $LIBZ -lm'",
  2436. eval "ac_cv_lib_png=no"
  2437. )
  2438. LIBS="$kde_save_LIBS"
  2439. CFLAGS="$kde_save_CFLAGS"
  2440. ])dnl
  2441. if eval "test ! \"`echo $ac_cv_lib_png`\" = no"; then
  2442. AC_DEFINE_UNQUOTED(HAVE_LIBPNG, 1, [Define if you have libpng])
  2443. LIBPNG="$ac_cv_lib_png"
  2444. AC_SUBST(LIBPNG)
  2445. AC_MSG_RESULT($ac_cv_lib_png)
  2446. else
  2447. AC_MSG_RESULT(no)
  2448. LIBPNG=""
  2449. AC_SUBST(LIBPNG)
  2450. fi
  2451. ])
  2452. AC_DEFUN([AC_FIND_JASPER],
  2453. [
  2454. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  2455. AC_REQUIRE([AC_FIND_JPEG])
  2456. AC_MSG_CHECKING([for jasper])
  2457. AC_CACHE_VAL(ac_cv_jasper,
  2458. [
  2459. kde_save_LIBS="$LIBS"
  2460. LIBS="$LIBS $all_libraries $USER_LDFLAGS -ljasper $LIBJPEG -lm"
  2461. kde_save_CFLAGS="$CFLAGS"
  2462. CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
  2463. AC_TRY_LINK(dnl
  2464. [
  2465. #include<jasper/jasper.h>
  2466. ],
  2467. [
  2468. return( jas_init() );
  2469. ],
  2470. eval "ac_cv_jasper='-ljasper $LIBJPEG -lm'",
  2471. eval "ac_cv_jasper=no"
  2472. )
  2473. LIBS="$kde_save_LIBS"
  2474. CFLAGS="$kde_save_CFLAGS"
  2475. ])dnl
  2476. if eval "test ! \"`echo $ac_cv_jasper`\" = no"; then
  2477. AC_DEFINE_UNQUOTED(HAVE_JASPER, 1, [Define if you have jasper])
  2478. LIB_JASPER="$ac_cv_jasper"
  2479. AC_MSG_RESULT($ac_cv_jasper)
  2480. else
  2481. AC_MSG_RESULT(no)
  2482. LIB_JASPER=""
  2483. fi
  2484. AC_SUBST(LIB_JASPER)
  2485. ])
  2486. AC_DEFUN([AC_CHECK_BOOL],
  2487. [
  2488. AC_DEFINE_UNQUOTED(HAVE_BOOL, 1, [You _must_ have bool])
  2489. ])
  2490. AC_DEFUN([AC_CHECK_GNU_EXTENSIONS],
  2491. [
  2492. AC_MSG_CHECKING(if you need GNU extensions)
  2493. AC_CACHE_VAL(ac_cv_gnu_extensions,
  2494. [
  2495. cat > conftest.c << EOF
  2496. #include <features.h>
  2497. #ifdef __GNU_LIBRARY__
  2498. yes
  2499. #endif
  2500. EOF
  2501. if (eval "$ac_cpp conftest.c") 2>&5 |
  2502. egrep "yes" >/dev/null 2>&1; then
  2503. rm -rf conftest*
  2504. ac_cv_gnu_extensions=yes
  2505. else
  2506. ac_cv_gnu_extensions=no
  2507. fi
  2508. ])
  2509. AC_MSG_RESULT($ac_cv_gnu_extensions)
  2510. if test "$ac_cv_gnu_extensions" = "yes"; then
  2511. AC_DEFINE_UNQUOTED(_GNU_SOURCE, 1, [Define if you need to use the GNU extensions])
  2512. fi
  2513. ])
  2514. AC_DEFUN([KDE_CHECK_COMPILER_FLAG],
  2515. [
  2516. AC_MSG_CHECKING([whether $CXX supports -$1])
  2517. kde_cache=`echo $1 | sed 'y% .=/+-,%____p__%'`
  2518. AC_CACHE_VAL(kde_cv_prog_cxx_$kde_cache,
  2519. [
  2520. AC_LANG_SAVE
  2521. AC_LANG_CPLUSPLUS
  2522. save_CXXFLAGS="$CXXFLAGS"
  2523. CXXFLAGS="$CXXFLAGS -$1"
  2524. AC_TRY_LINK([],[ return 0; ], [eval "kde_cv_prog_cxx_$kde_cache=yes"], [])
  2525. CXXFLAGS="$save_CXXFLAGS"
  2526. AC_LANG_RESTORE
  2527. ])
  2528. if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
  2529. AC_MSG_RESULT(yes)
  2530. :
  2531. $2
  2532. else
  2533. AC_MSG_RESULT(no)
  2534. :
  2535. $3
  2536. fi
  2537. ])
  2538. AC_DEFUN([KDE_CHECK_C_COMPILER_FLAG],
  2539. [
  2540. AC_MSG_CHECKING([whether $CC supports -$1])
  2541. kde_cache=`echo $1 | sed 'y% .=/+-,%____p__%'`
  2542. AC_CACHE_VAL(kde_cv_prog_cc_$kde_cache,
  2543. [
  2544. AC_LANG_SAVE
  2545. AC_LANG_C
  2546. save_CFLAGS="$CFLAGS"
  2547. CFLAGS="$CFLAGS -$1"
  2548. AC_TRY_LINK([],[ return 0; ], [eval "kde_cv_prog_cc_$kde_cache=yes"], [])
  2549. CFLAGS="$save_CFLAGS"
  2550. AC_LANG_RESTORE
  2551. ])
  2552. if eval "test \"`echo '$kde_cv_prog_cc_'$kde_cache`\" = yes"; then
  2553. AC_MSG_RESULT(yes)
  2554. :
  2555. $2
  2556. else
  2557. AC_MSG_RESULT(no)
  2558. :
  2559. $3
  2560. fi
  2561. ])
  2562. dnl AC_REMOVE_FORBIDDEN removes forbidden arguments from variables
  2563. dnl use: AC_REMOVE_FORBIDDEN(CC, [-forbid -bad-option whatever])
  2564. dnl it's all white-space separated
  2565. AC_DEFUN([AC_REMOVE_FORBIDDEN],
  2566. [ __val=$$1
  2567. __forbid=" $2 "
  2568. if test -n "$__val"; then
  2569. __new=""
  2570. ac_save_IFS=$IFS
  2571. IFS=" "
  2572. for i in $__val; do
  2573. case "$__forbid" in
  2574. *" $i "*) AC_MSG_WARN([found forbidden $i in $1, removing it]) ;;
  2575. *) # Careful to not add spaces, where there were none, because otherwise
  2576. # libtool gets confused, if we change e.g. CXX
  2577. if test -z "$__new" ; then __new=$i ; else __new="$__new $i" ; fi ;;
  2578. esac
  2579. done
  2580. IFS=$ac_save_IFS
  2581. $1=$__new
  2582. fi
  2583. ])
  2584. dnl AC_VALIDIFY_CXXFLAGS checks for forbidden flags the user may have given
  2585. AC_DEFUN([AC_VALIDIFY_CXXFLAGS],
  2586. [dnl
  2587. if test "x$kde_use_qt_emb" != "xyes"; then
  2588. AC_REMOVE_FORBIDDEN(CXX, [-fno-rtti -rpath])
  2589. AC_REMOVE_FORBIDDEN(CXXFLAGS, [-fno-rtti -rpath])
  2590. else
  2591. AC_REMOVE_FORBIDDEN(CXX, [-rpath])
  2592. AC_REMOVE_FORBIDDEN(CXXFLAGS, [-rpath])
  2593. fi
  2594. ])
  2595. AC_DEFUN([AC_CHECK_COMPILERS],
  2596. [
  2597. AC_ARG_ENABLE(debug,
  2598. AC_HELP_STRING([--enable-debug=ARG],[enables debug symbols (yes|no|full) [default=no]]),
  2599. [
  2600. case $enableval in
  2601. yes)
  2602. kde_use_debug_code="yes"
  2603. kde_use_debug_define=no
  2604. ;;
  2605. full)
  2606. kde_use_debug_code="full"
  2607. kde_use_debug_define=no
  2608. ;;
  2609. *)
  2610. kde_use_debug_code="no"
  2611. kde_use_debug_define=yes
  2612. ;;
  2613. esac
  2614. ],
  2615. [kde_use_debug_code="no"
  2616. kde_use_debug_define=no
  2617. ])
  2618. dnl Just for configure --help
  2619. AC_ARG_ENABLE(dummyoption,
  2620. AC_HELP_STRING([--disable-debug],
  2621. [disables debug output and debug symbols [default=no]]),
  2622. [],[])
  2623. AC_ARG_ENABLE(strict,
  2624. AC_HELP_STRING([--enable-strict],
  2625. [compiles with strict compiler options (may not work!)]),
  2626. [
  2627. if test $enableval = "no"; then
  2628. kde_use_strict_options="no"
  2629. else
  2630. kde_use_strict_options="yes"
  2631. fi
  2632. ], [kde_use_strict_options="no"])
  2633. AC_ARG_ENABLE(warnings,AC_HELP_STRING([--disable-warnings],[disables compilation with -Wall and similar]),
  2634. [
  2635. if test $enableval = "no"; then
  2636. kde_use_warnings="no"
  2637. else
  2638. kde_use_warnings="yes"
  2639. fi
  2640. ], [kde_use_warnings="yes"])
  2641. dnl enable warnings for debug build
  2642. if test "$kde_use_debug_code" != "no"; then
  2643. kde_use_warnings=yes
  2644. fi
  2645. AC_ARG_ENABLE(profile,AC_HELP_STRING([--enable-profile],[creates profiling infos [default=no]]),
  2646. [kde_use_profiling=$enableval],
  2647. [kde_use_profiling="no"]
  2648. )
  2649. dnl this prevents stupid AC_PROG_CC to add "-g" to the default CFLAGS
  2650. CFLAGS=" $CFLAGS"
  2651. AC_PROG_CC
  2652. AC_PROG_CPP
  2653. if test "$GCC" = "yes"; then
  2654. if test "$kde_use_debug_code" != "no"; then
  2655. if test $kde_use_debug_code = "full"; then
  2656. CFLAGS="-g3 -fno-inline $CFLAGS"
  2657. else
  2658. CFLAGS="-g -O2 $CFLAGS"
  2659. fi
  2660. else
  2661. CFLAGS="-O2 $CFLAGS"
  2662. fi
  2663. fi
  2664. if test "$kde_use_debug_define" = "yes"; then
  2665. CFLAGS="-DNDEBUG $CFLAGS"
  2666. fi
  2667. case "$host" in
  2668. *-*-sysv4.2uw*) CFLAGS="-D_UNIXWARE $CFLAGS";;
  2669. *-*-sysv5uw7*) CFLAGS="-D_UNIXWARE7 $CFLAGS";;
  2670. esac
  2671. if test -z "$LDFLAGS" && test "$kde_use_debug_code" = "no" && test "$GCC" = "yes"; then
  2672. LDFLAGS=""
  2673. fi
  2674. CXXFLAGS=" $CXXFLAGS"
  2675. AC_PROG_CXX
  2676. if test "$GXX" = "yes" || test "$CXX" = "KCC"; then
  2677. if test "$kde_use_debug_code" != "no"; then
  2678. if test "$CXX" = "KCC"; then
  2679. CXXFLAGS="+K0 -Wall -pedantic -W -Wpointer-arith -Wwrite-strings $CXXFLAGS"
  2680. else
  2681. if test "$kde_use_debug_code" = "full"; then
  2682. CXXFLAGS="-g3 -fno-inline $CXXFLAGS"
  2683. else
  2684. CXXFLAGS="-g -O2 $CXXFLAGS"
  2685. fi
  2686. fi
  2687. KDE_CHECK_COMPILER_FLAG(fno-builtin,[CXXFLAGS="-fno-builtin $CXXFLAGS"])
  2688. dnl convenience compiler flags
  2689. KDE_CHECK_COMPILER_FLAG(Woverloaded-virtual, [WOVERLOADED_VIRTUAL="-Woverloaded-virtual"], [WOVERLOADED_VRITUAL=""])
  2690. AC_SUBST(WOVERLOADED_VIRTUAL)
  2691. else
  2692. if test "$CXX" = "KCC"; then
  2693. CXXFLAGS="+K3 $CXXFLAGS"
  2694. else
  2695. CXXFLAGS="-O2 $CXXFLAGS"
  2696. fi
  2697. fi
  2698. fi
  2699. if test "$kde_use_debug_define" = "yes"; then
  2700. CXXFLAGS="-DNDEBUG -DNO_DEBUG $CXXFLAGS"
  2701. fi
  2702. if test "$kde_use_profiling" = "yes"; then
  2703. KDE_CHECK_COMPILER_FLAG(pg,
  2704. [
  2705. CFLAGS="-pg $CFLAGS"
  2706. CXXFLAGS="-pg $CXXFLAGS"
  2707. ])
  2708. fi
  2709. if test "$kde_use_warnings" = "yes"; then
  2710. if test "$GCC" = "yes"; then
  2711. CXXFLAGS="-Wall -W -Wpointer-arith -Wwrite-strings $CXXFLAGS"
  2712. case $host in
  2713. *-*-linux-gnu)
  2714. CFLAGS="-std=iso9899:1990 -W -Wall -Wchar-subscripts -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -D_XOPEN_SOURCE=500 -D_BSD_SOURCE $CFLAGS"
  2715. CXXFLAGS="-ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts $CXXFLAGS"
  2716. KDE_CHECK_COMPILER_FLAG(Wmissing-format-attribute, [CXXFLAGS="$CXXFLAGS -Wformat-security -Wmissing-format-attribute"])
  2717. KDE_CHECK_C_COMPILER_FLAG(Wmissing-format-attribute, [CFLAGS="$CFLAGS -Wformat-security -Wmissing-format-attribute"])
  2718. ;;
  2719. esac
  2720. KDE_CHECK_COMPILER_FLAG(Wundef,[CXXFLAGS="-Wundef $CXXFLAGS"])
  2721. KDE_CHECK_COMPILER_FLAG(Wno-long-long,[CXXFLAGS="-Wno-long-long $CXXFLAGS"])
  2722. KDE_CHECK_COMPILER_FLAG(Wnon-virtual-dtor,[CXXFLAGS="-Wnon-virtual-dtor $CXXFLAGS"])
  2723. fi
  2724. fi
  2725. if test "$GXX" = "yes" && test "$kde_use_strict_options" = "yes"; then
  2726. CXXFLAGS="-Wcast-qual -Wshadow -Wcast-align $CXXFLAGS"
  2727. fi
  2728. AC_ARG_ENABLE(pch,
  2729. AC_HELP_STRING([--enable-pch],
  2730. [enables precompiled header support (currently only KCC or gcc >=3.4+unsermake) [default=no]]),
  2731. [ kde_use_pch=$enableval ],[ kde_use_pch=no ])
  2732. HAVE_GCC_VISIBILITY=0
  2733. AC_SUBST([HAVE_GCC_VISIBILITY])
  2734. if test "$GXX" = "yes"; then
  2735. KDE_CHECK_COMPILER_FLAG(fno-exceptions,[CXXFLAGS="$CXXFLAGS -fno-exceptions"])
  2736. KDE_CHECK_COMPILER_FLAG(fno-check-new, [CXXFLAGS="$CXXFLAGS -fno-check-new"])
  2737. KDE_CHECK_COMPILER_FLAG(fno-common, [CXXFLAGS="$CXXFLAGS -fno-common"])
  2738. KDE_CHECK_COMPILER_FLAG(fexceptions, [USE_EXCEPTIONS="-fexceptions"], USE_EXCEPTIONS= )
  2739. ENABLE_PERMISSIVE_FLAG="-fpermissive"
  2740. if test "$kde_use_pch" = "yes"; then
  2741. AC_MSG_CHECKING(whether gcc supports precompiling c header files)
  2742. echo >conftest.h
  2743. if $CC -x c-header conftest.h >/dev/null 2>/dev/null; then
  2744. kde_gcc_supports_pch=yes
  2745. AC_MSG_RESULT(yes)
  2746. else
  2747. kde_gcc_supports_pch=no
  2748. AC_MSG_RESULT(no)
  2749. fi
  2750. if test "$kde_gcc_supports_pch" = "yes"; then
  2751. AC_MSG_CHECKING(whether gcc supports precompiling c++ header files)
  2752. if $CXX -x c++-header conftest.h >/dev/null 2>/dev/null; then
  2753. kde_gcc_supports_pch=yes
  2754. AC_MSG_RESULT(yes)
  2755. else
  2756. kde_gcc_supports_pch=no
  2757. AC_MSG_RESULT(no)
  2758. fi
  2759. fi
  2760. rm -f conftest.h conftest.h.gch
  2761. fi
  2762. AM_CONDITIONAL(unsermake_enable_pch, test "$kde_use_pch" = "yes" && test "$kde_gcc_supports_pch" = "yes")
  2763. fi
  2764. if test "$CXX" = "KCC"; then
  2765. dnl unfortunately we currently cannot disable exception support in KCC
  2766. dnl because doing so is binary incompatible and Qt by default links with exceptions :-(
  2767. dnl KDE_CHECK_COMPILER_FLAG(-no_exceptions,[CXXFLAGS="$CXXFLAGS --no_exceptions"])
  2768. dnl KDE_CHECK_COMPILER_FLAG(-exceptions, [USE_EXCEPTIONS="--exceptions"], USE_EXCEPTIONS= )
  2769. if test "$kde_use_pch" = "yes"; then
  2770. dnl TODO: support --pch-dir!
  2771. KDE_CHECK_COMPILER_FLAG(-pch,[CXXFLAGS="$CXXFLAGS --pch"])
  2772. dnl the below works (but the dir must exist), but it's
  2773. dnl useless for a whole package.
  2774. dnl The are precompiled headers for each source file, so when compiling
  2775. dnl from scratch, it doesn't make a difference, and they take up
  2776. dnl around ~5Mb _per_ sourcefile.
  2777. dnl KDE_CHECK_COMPILER_FLAG(-pch_dir /tmp,
  2778. dnl [CXXFLAGS="$CXXFLAGS --pch_dir `pwd`/pcheaders"])
  2779. fi
  2780. dnl this flag controls inlining. by default KCC inlines in optimisation mode
  2781. dnl all implementations that are defined inside the class {} declaration.
  2782. dnl because of templates-compatibility with broken gcc compilers, this
  2783. dnl can cause excessive inlining. This flag limits it to a sane level
  2784. KDE_CHECK_COMPILER_FLAG(-inline_keyword_space_time=6,[CXXFLAGS="$CXXFLAGS --inline_keyword_space_time=6"])
  2785. KDE_CHECK_COMPILER_FLAG(-inline_auto_space_time=2,[CXXFLAGS="$CXXFLAGS --inline_auto_space_time=2"])
  2786. KDE_CHECK_COMPILER_FLAG(-inline_implicit_space_time=2.0,[CXXFLAGS="$CXXFLAGS --inline_implicit_space_time=2.0"])
  2787. KDE_CHECK_COMPILER_FLAG(-inline_generated_space_time=2.0,[CXXFLAGS="$CXXFLAGS --inline_generated_space_time=2.0"])
  2788. dnl Some source files are shared between multiple executables
  2789. dnl (or libraries) and some of those need template instantiations.
  2790. dnl In that case KCC needs to compile those sources with
  2791. dnl --one_instantiation_per_object. To make it easy for us we compile
  2792. dnl _all_ objects with that flag (--one_per is a shorthand).
  2793. KDE_CHECK_COMPILER_FLAG(-one_per, [CXXFLAGS="$CXXFLAGS --one_per"])
  2794. fi
  2795. AC_SUBST(USE_EXCEPTIONS)
  2796. dnl obsolete macro - provided to keep things going
  2797. USE_RTTI=
  2798. AC_SUBST(USE_RTTI)
  2799. case "$host" in
  2800. *-*-irix*) test "$GXX" = yes && CXXFLAGS="-D_LANGUAGE_C_PLUS_PLUS -D__LANGUAGE_C_PLUS_PLUS $CXXFLAGS" ;;
  2801. *-*-sysv4.2uw*) CXXFLAGS="-D_UNIXWARE $CXXFLAGS";;
  2802. *-*-sysv5uw7*) CXXFLAGS="-D_UNIXWARE7 $CXXFLAGS";;
  2803. *-*-solaris*)
  2804. if test "$GXX" = yes; then
  2805. libstdcpp=`$CXX -print-file-name=libstdc++.so`
  2806. if test ! -f $libstdcpp; then
  2807. AC_MSG_ERROR([You've compiled gcc without --enable-shared. This doesn't work with KDE. Please recompile gcc with --enable-shared to receive a libstdc++.so])
  2808. fi
  2809. fi
  2810. ;;
  2811. esac
  2812. AC_VALIDIFY_CXXFLAGS
  2813. AC_PROG_CXXCPP
  2814. if test "$GCC" = yes; then
  2815. NOOPT_CFLAGS=-O0
  2816. fi
  2817. KDE_CHECK_COMPILER_FLAG(O0,[NOOPT_CXXFLAGS=-O0])
  2818. AC_ARG_ENABLE(coverage,
  2819. AC_HELP_STRING([--enable-coverage],[use gcc coverage testing]), [
  2820. if test "$am_cv_CC_dependencies_compiler_type" = "gcc3"; then
  2821. ac_coverage_compiler="-fprofile-arcs -ftest-coverage"
  2822. ac_coverage_linker="-lgcc"
  2823. elif test "$am_cv_CC_dependencies_compiler_type" = "gcc"; then
  2824. ac_coverage_compiler="-fprofile-arcs -ftest-coverage"
  2825. ac_coverage_linker=""
  2826. else
  2827. AC_MSG_ERROR([coverage with your compiler is not supported])
  2828. fi
  2829. CFLAGS="$CFLAGS $ac_coverage_compiler"
  2830. CXXFLAGS="$CXXFLAGS $ac_coverage_compiler"
  2831. LDFLAGS="$LDFLAGS $ac_coverage_linker"
  2832. ])
  2833. AC_SUBST(NOOPT_CXXFLAGS)
  2834. AC_SUBST(NOOPT_CFLAGS)
  2835. AC_SUBST(ENABLE_PERMISSIVE_FLAG)
  2836. KDE_CHECK_NEW_LDFLAGS
  2837. KDE_CHECK_FINAL
  2838. KDE_CHECK_CLOSURE
  2839. KDE_CHECK_NMCHECK
  2840. ifdef([AM_DEPENDENCIES], AC_REQUIRE([KDE_ADD_DEPENDENCIES]), [])
  2841. ])
  2842. AC_DEFUN([KDE_CHECK_VISIBILITY_GCC_BUG],
  2843. [
  2844. AC_CACHE_CHECK([for gcc -fvisibility-inlines-hidden bug], kde_cv_val_gcc_visibility_bug,
  2845. [
  2846. AC_LANG_SAVE
  2847. AC_LANG_CPLUSPLUS
  2848. safe_CXXFLAGS=$CXXFLAGS
  2849. safe_LDFLAGS=$LDFLAGS
  2850. CXXFLAGS="$CXXFLAGS -fPIC -fvisibility-inlines-hidden -O0"
  2851. LDFLAGS="$LDFLAGS -shared -fPIC"
  2852. AC_TRY_LINK(
  2853. [
  2854. /* http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19664 */
  2855. template<typename CharT>
  2856. struct VisTest
  2857. {
  2858. inline VisTest ();
  2859. };
  2860. template<typename CharT>
  2861. inline VisTest<CharT>::VisTest()
  2862. {}
  2863. extern template class VisTest<char>; // It works if we drop that line
  2864. int some_function( int do_something ) __attribute__ ((visibility("default")));
  2865. int some_function( int )
  2866. {
  2867. VisTest<char> a;
  2868. return 0;
  2869. }
  2870. ], [/* elvis is alive */],
  2871. kde_cv_val_gcc_visibility_bug=no, kde_cv_val_gcc_visibility_bug=yes)
  2872. CXXFLAGS=$safe_CXXFLAGS
  2873. LDFLAGS=$safe_LDFLAGS
  2874. AC_LANG_RESTORE
  2875. ]
  2876. )
  2877. if test x$kde_cv_val_gcc_visibility_bug = xno; then
  2878. CXXFLAGS="$CXXFLAGS -fvisibility-inlines-hidden"
  2879. fi
  2880. ]
  2881. )
  2882. AC_DEFUN([KDE_CHECK_AND_ADD_HIDDEN_VISIBILITY],
  2883. [
  2884. if test "$GXX" = "yes"; then
  2885. KDE_CHECK_COMPILER_FLAG(fno-exceptions,[CXXFLAGS="$CXXFLAGS -fno-exceptions"])
  2886. KDE_CHECK_COMPILER_FLAG(fno-check-new, [CXXFLAGS="$CXXFLAGS -fno-check-new"])
  2887. KDE_CHECK_COMPILER_FLAG(fno-common, [CXXFLAGS="$CXXFLAGS -fno-common"])
  2888. KDE_CHECK_COMPILER_FLAG(fvisibility=hidden,
  2889. [
  2890. CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
  2891. KDE_CHECK_VISIBILITY_GCC_BUG
  2892. HAVE_GCC_VISIBILITY=1
  2893. AC_DEFINE_UNQUOTED(__KDE_HAVE_GCC_VISIBILITY, "$HAVE_GCC_VISIBILITY", [define to 1 if -fvisibility is supported])
  2894. ])
  2895. fi
  2896. ])
  2897. AC_DEFUN([KDE_ENABLE_HIDDEN_VISIBILITY],
  2898. [
  2899. AC_REQUIRE([KDE_CHECK_AND_ADD_HIDDEN_VISIBILITY])
  2900. ])
  2901. AC_DEFUN([KDE_ADD_DEPENDENCIES],
  2902. [
  2903. [A]M_DEPENDENCIES(CC)
  2904. [A]M_DEPENDENCIES(CXX)
  2905. ])
  2906. dnl just a wrapper to clean up configure.in
  2907. AC_DEFUN([KDE_PROG_LIBTOOL],
  2908. [
  2909. AC_REQUIRE([AC_CHECK_COMPILERS])
  2910. AC_REQUIRE([AC_ENABLE_SHARED])
  2911. AC_REQUIRE([AC_ENABLE_STATIC])
  2912. AC_REQUIRE([AC_LIBTOOL_DLOPEN])
  2913. AC_REQUIRE([KDE_CHECK_LIB64])
  2914. AC_OBJEXT
  2915. AC_EXEEXT
  2916. AM_PROG_LIBTOOL
  2917. AC_LIBTOOL_CXX
  2918. LIBTOOL_SHELL="/bin/sh ./libtool"
  2919. # LIBTOOL="$LIBTOOL --silent"
  2920. KDE_PLUGIN="-avoid-version -module -no-undefined \$(KDE_NO_UNDEFINED) \$(KDE_RPATH) \$(KDE_MT_LDFLAGS)"
  2921. AC_SUBST(KDE_PLUGIN)
  2922. # we patch configure quite some so we better keep that consistent for incremental runs
  2923. AC_SUBST(AUTOCONF,'$(SHELL) $(top_srcdir)/admin/cvs.sh configure || touch configure')
  2924. ])
  2925. AC_DEFUN([KDE_CHECK_LIB64],
  2926. [
  2927. tdelibsuff="$kde_libs_suffix"
  2928. if test -z "$tdelibsuff"; then
  2929. tdelibsuff=no
  2930. fi
  2931. AC_ARG_ENABLE(libsuffix,
  2932. AC_HELP_STRING([--enable-libsuffix],
  2933. [/lib directory suffix (64,32,none[=default])]),
  2934. tdelibsuff=$enableval)
  2935. # TODO: add an auto case that compiles a little C app to check
  2936. # where the glibc is
  2937. if test "$tdelibsuff" = "no"; then
  2938. tdelibsuff=
  2939. fi
  2940. if test -z "$tdelibsuff"; then
  2941. AC_MSG_RESULT([not using lib directory suffix])
  2942. AC_DEFINE(KDELIBSUFF, [""], Suffix for lib directories)
  2943. else
  2944. if test "$libdir" = '${exec_prefix}/lib'; then
  2945. libdir="$libdir${tdelibsuff}"
  2946. AC_SUBST([libdir], ["$libdir"]) dnl ugly hack for lib64 platforms
  2947. fi
  2948. AC_DEFINE_UNQUOTED(KDELIBSUFF, ["${tdelibsuff}"], Suffix for lib directories)
  2949. AC_MSG_RESULT([using lib directory suffix $tdelibsuff])
  2950. fi
  2951. ])
  2952. AC_DEFUN([KDE_CHECK_TYPES],
  2953. [ AC_CHECK_SIZEOF(int, 4)dnl
  2954. AC_CHECK_SIZEOF(short)dnl
  2955. AC_CHECK_SIZEOF(long, 4)dnl
  2956. AC_CHECK_SIZEOF(char *, 4)dnl
  2957. ])dnl
  2958. dnl Not used - kept for compat only?
  2959. AC_DEFUN([KDE_DO_IT_ALL],
  2960. [
  2961. AC_CANONICAL_SYSTEM
  2962. AC_ARG_PROGRAM
  2963. AM_INIT_AUTOMAKE($1, $2)
  2964. AM_DISABLE_LIBRARIES
  2965. AC_PREFIX_DEFAULT(${TDEDIR:-/usr/local/kde})
  2966. AC_CHECK_COMPILERS
  2967. KDE_PROG_LIBTOOL
  2968. AM_KDE_WITH_NLS
  2969. AC_PATH_KDE
  2970. ])
  2971. AC_DEFUN([AC_CHECK_RPATH],
  2972. [
  2973. AC_MSG_CHECKING(for rpath)
  2974. AC_ARG_ENABLE(rpath,
  2975. AC_HELP_STRING([--disable-rpath],[do not use the rpath feature of ld]),
  2976. USE_RPATH=$enableval, USE_RPATH=yes)
  2977. if test -z "$KDE_RPATH" && test "$USE_RPATH" = "yes"; then
  2978. KDE_RPATH="-R \$(libdir)"
  2979. if test "$kde_libraries" != "$libdir"; then
  2980. KDE_RPATH="$KDE_RPATH -R \$(kde_libraries)"
  2981. fi
  2982. if test -n "$qt_libraries"; then
  2983. KDE_RPATH="$KDE_RPATH -R \$(qt_libraries)"
  2984. fi
  2985. dnl $x_libraries is set to /usr/lib in case
  2986. if test -n "$X_LDFLAGS"; then
  2987. X_RPATH="-R \$(x_libraries)"
  2988. KDE_RPATH="$KDE_RPATH $X_RPATH"
  2989. fi
  2990. if test -n "$KDE_EXTRA_RPATH"; then
  2991. KDE_RPATH="$KDE_RPATH \$(KDE_EXTRA_RPATH)"
  2992. fi
  2993. fi
  2994. AC_SUBST(KDE_EXTRA_RPATH)
  2995. AC_SUBST(KDE_RPATH)
  2996. AC_SUBST(X_RPATH)
  2997. AC_MSG_RESULT($USE_RPATH)
  2998. ])
  2999. dnl Check for the type of the third argument of getsockname
  3000. AC_DEFUN([AC_CHECK_SOCKLEN_T],
  3001. [
  3002. AC_MSG_CHECKING(for socklen_t)
  3003. AC_CACHE_VAL(kde_cv_socklen_t,
  3004. [
  3005. AC_LANG_PUSH(C++)
  3006. kde_cv_socklen_t=no
  3007. AC_TRY_COMPILE([
  3008. #include <sys/types.h>
  3009. #include <sys/socket.h>
  3010. ],
  3011. [
  3012. socklen_t len;
  3013. getpeername(0,0,&len);
  3014. ],
  3015. [
  3016. kde_cv_socklen_t=yes
  3017. kde_cv_socklen_t_equiv=socklen_t
  3018. ])
  3019. AC_LANG_POP(C++)
  3020. ])
  3021. AC_MSG_RESULT($kde_cv_socklen_t)
  3022. if test $kde_cv_socklen_t = no; then
  3023. AC_MSG_CHECKING([for socklen_t equivalent for socket functions])
  3024. AC_CACHE_VAL(kde_cv_socklen_t_equiv,
  3025. [
  3026. kde_cv_socklen_t_equiv=int
  3027. AC_LANG_PUSH(C++)
  3028. for t in int size_t unsigned long "unsigned long"; do
  3029. AC_TRY_COMPILE([
  3030. #include <sys/types.h>
  3031. #include <sys/socket.h>
  3032. ],
  3033. [
  3034. $t len;
  3035. getpeername(0,0,&len);
  3036. ],
  3037. [
  3038. kde_cv_socklen_t_equiv="$t"
  3039. break
  3040. ])
  3041. done
  3042. AC_LANG_POP(C++)
  3043. ])
  3044. AC_MSG_RESULT($kde_cv_socklen_t_equiv)
  3045. fi
  3046. AC_DEFINE_UNQUOTED(kde_socklen_t, $kde_cv_socklen_t_equiv,
  3047. [type to use in place of socklen_t if not defined])
  3048. AC_DEFINE_UNQUOTED(ksize_t, $kde_cv_socklen_t_equiv,
  3049. [type to use in place of socklen_t if not defined (deprecated, use kde_socklen_t)])
  3050. ])
  3051. dnl This is a merge of some macros out of the gettext aclocal.m4
  3052. dnl since we don't need anything, I took the things we need
  3053. dnl the copyright for them is:
  3054. dnl >
  3055. dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
  3056. dnl This Makefile.in is free software; the Free Software Foundation
  3057. dnl gives unlimited permission to copy and/or distribute it,
  3058. dnl with or without modifications, as long as this notice is preserved.
  3059. dnl This program is distributed in the hope that it will be useful,
  3060. dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
  3061. dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  3062. dnl PARTICULAR PURPOSE.
  3063. dnl >
  3064. dnl for this file it is relicensed under LGPL
  3065. AC_DEFUN([AM_KDE_WITH_NLS],
  3066. [
  3067. dnl If we use NLS figure out what method
  3068. AM_PATH_PROG_WITH_TEST_KDE(MSGFMT, msgfmt,
  3069. [test -n "`$ac_dir/$ac_word --version 2>&1 | grep 'GNU gettext'`"], msgfmt)
  3070. AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
  3071. if test -z "`$GMSGFMT --version 2>&1 | grep 'GNU gettext'`"; then
  3072. AC_MSG_RESULT([found msgfmt program is not GNU msgfmt; ignore it])
  3073. GMSGFMT=":"
  3074. fi
  3075. MSGFMT=$GMSGFMT
  3076. AC_SUBST(GMSGFMT)
  3077. AC_SUBST(MSGFMT)
  3078. AM_PATH_PROG_WITH_TEST_KDE(XGETTEXT, xgettext,
  3079. [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
  3080. dnl Test whether we really found GNU xgettext.
  3081. if test "$XGETTEXT" != ":"; then
  3082. dnl If it is no GNU xgettext we define it as : so that the
  3083. dnl Makefiles still can work.
  3084. if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
  3085. : ;
  3086. else
  3087. AC_MSG_RESULT(
  3088. [found xgettext programs is not GNU xgettext; ignore it])
  3089. XGETTEXT=":"
  3090. fi
  3091. fi
  3092. AC_SUBST(XGETTEXT)
  3093. ])
  3094. # Search path for a program which passes the given test.
  3095. # Ulrich Drepper <drepper@cygnus.com>, 1996.
  3096. # serial 1
  3097. # Stephan Kulow: I appended a _KDE against name conflicts
  3098. dnl AM_PATH_PROG_WITH_TEST_KDE(VARIABLE, PROG-TO-CHECK-FOR,
  3099. dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
  3100. AC_DEFUN([AM_PATH_PROG_WITH_TEST_KDE],
  3101. [# Extract the first word of "$2", so it can be a program name with args.
  3102. set dummy $2; ac_word=[$]2
  3103. AC_MSG_CHECKING([for $ac_word])
  3104. AC_CACHE_VAL(ac_cv_path_$1,
  3105. [case "[$]$1" in
  3106. /*)
  3107. ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
  3108. ;;
  3109. *)
  3110. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
  3111. for ac_dir in ifelse([$5], , $PATH, [$5]); do
  3112. test -z "$ac_dir" && ac_dir=.
  3113. if test -f $ac_dir/$ac_word; then
  3114. if [$3]; then
  3115. ac_cv_path_$1="$ac_dir/$ac_word"
  3116. break
  3117. fi
  3118. fi
  3119. done
  3120. IFS="$ac_save_ifs"
  3121. dnl If no 4th arg is given, leave the cache variable unset,
  3122. dnl so AC_PATH_PROGS will keep looking.
  3123. ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
  3124. ])dnl
  3125. ;;
  3126. esac])dnl
  3127. $1="$ac_cv_path_$1"
  3128. if test -n "[$]$1"; then
  3129. AC_MSG_RESULT([$]$1)
  3130. else
  3131. AC_MSG_RESULT(no)
  3132. fi
  3133. AC_SUBST($1)dnl
  3134. ])
  3135. # Check whether LC_MESSAGES is available in <locale.h>.
  3136. # Ulrich Drepper <drepper@cygnus.com>, 1995.
  3137. # serial 1
  3138. AC_DEFUN([AM_LC_MESSAGES],
  3139. [if test $ac_cv_header_locale_h = yes; then
  3140. AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
  3141. [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
  3142. am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
  3143. if test $am_cv_val_LC_MESSAGES = yes; then
  3144. AC_DEFINE(HAVE_LC_MESSAGES, 1, [Define if your locale.h file contains LC_MESSAGES])
  3145. fi
  3146. fi])
  3147. dnl From Jim Meyering.
  3148. dnl FIXME: migrate into libit.
  3149. AC_DEFUN([AM_FUNC_OBSTACK],
  3150. [AC_CACHE_CHECK([for obstacks], am_cv_func_obstack,
  3151. [AC_TRY_LINK([#include "obstack.h"],
  3152. [struct obstack *mem;obstack_free(mem,(char *) 0)],
  3153. am_cv_func_obstack=yes,
  3154. am_cv_func_obstack=no)])
  3155. if test $am_cv_func_obstack = yes; then
  3156. AC_DEFINE(HAVE_OBSTACK)
  3157. else
  3158. LIBOBJS="$LIBOBJS obstack.o"
  3159. fi
  3160. ])
  3161. dnl From Jim Meyering. Use this if you use the GNU error.[ch].
  3162. dnl FIXME: Migrate into libit
  3163. AC_DEFUN([AM_FUNC_ERROR_AT_LINE],
  3164. [AC_CACHE_CHECK([for error_at_line], am_cv_lib_error_at_line,
  3165. [AC_TRY_LINK([],[error_at_line(0, 0, "", 0, "");],
  3166. am_cv_lib_error_at_line=yes,
  3167. am_cv_lib_error_at_line=no)])
  3168. if test $am_cv_lib_error_at_line = no; then
  3169. LIBOBJS="$LIBOBJS error.o"
  3170. fi
  3171. AC_SUBST(LIBOBJS)dnl
  3172. ])
  3173. # Macro to add for using GNU gettext.
  3174. # Ulrich Drepper <drepper@cygnus.com>, 1995.
  3175. # serial 1
  3176. # Stephan Kulow: I put a KDE in it to avoid name conflicts
  3177. AC_DEFUN([AM_KDE_GNU_GETTEXT],
  3178. [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
  3179. AC_REQUIRE([AC_PROG_RANLIB])dnl
  3180. AC_REQUIRE([AC_HEADER_STDC])dnl
  3181. AC_REQUIRE([AC_TYPE_OFF_T])dnl
  3182. AC_REQUIRE([AC_TYPE_SIZE_T])dnl
  3183. AC_REQUIRE([AC_FUNC_ALLOCA])dnl
  3184. AC_REQUIRE([AC_FUNC_MMAP])dnl
  3185. AC_REQUIRE([AM_KDE_WITH_NLS])dnl
  3186. AC_CHECK_HEADERS([limits.h locale.h nl_types.h string.h values.h alloca.h])
  3187. AC_CHECK_FUNCS([getcwd munmap putenv setlocale strchr strcasecmp \
  3188. __argz_count __argz_stringify __argz_next])
  3189. AC_MSG_CHECKING(for stpcpy)
  3190. AC_CACHE_VAL(kde_cv_func_stpcpy,
  3191. [
  3192. kde_safe_cxxflags=$CXXFLAGS
  3193. CXXFLAGS="-Werror"
  3194. AC_LANG_SAVE
  3195. AC_LANG_CPLUSPLUS
  3196. AC_TRY_COMPILE([
  3197. #include <string.h>
  3198. ],
  3199. [
  3200. char buffer[200];
  3201. stpcpy(buffer, buffer);
  3202. ],
  3203. kde_cv_func_stpcpy=yes,
  3204. kde_cv_func_stpcpy=no)
  3205. AC_LANG_RESTORE
  3206. CXXFLAGS=$kde_safe_cxxflags
  3207. ])
  3208. AC_MSG_RESULT($kde_cv_func_stpcpy)
  3209. if eval "test \"`echo $kde_cv_func_stpcpy`\" = yes"; then
  3210. AC_DEFINE(HAVE_STPCPY, 1, [Define if you have stpcpy])
  3211. fi
  3212. AM_LC_MESSAGES
  3213. if test "x$CATOBJEXT" != "x"; then
  3214. if test "x$ALL_LINGUAS" = "x"; then
  3215. LINGUAS=
  3216. else
  3217. AC_MSG_CHECKING(for catalogs to be installed)
  3218. NEW_LINGUAS=
  3219. for lang in ${LINGUAS=$ALL_LINGUAS}; do
  3220. case "$ALL_LINGUAS" in
  3221. *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
  3222. esac
  3223. done
  3224. LINGUAS=$NEW_LINGUAS
  3225. AC_MSG_RESULT($LINGUAS)
  3226. fi
  3227. dnl Construct list of names of catalog files to be constructed.
  3228. if test -n "$LINGUAS"; then
  3229. for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
  3230. fi
  3231. fi
  3232. ])
  3233. AC_DEFUN([AC_HAVE_XPM],
  3234. [AC_REQUIRE_CPP()dnl
  3235. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  3236. test -z "$XPM_LDFLAGS" && XPM_LDFLAGS=
  3237. test -z "$XPM_INCLUDE" && XPM_INCLUDE=
  3238. AC_ARG_WITH(xpm,AC_HELP_STRING([--without-xpm],[disable color pixmap XPM tests]),
  3239. xpm_test=$withval, xpm_test="yes")
  3240. if test "x$xpm_test" = xno; then
  3241. ac_cv_have_xpm=no
  3242. else
  3243. AC_MSG_CHECKING(for XPM)
  3244. AC_CACHE_VAL(ac_cv_have_xpm,
  3245. [
  3246. ac_save_ldflags="$LDFLAGS"
  3247. ac_save_cflags="$CFLAGS"
  3248. if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
  3249. LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm -lX11 -lXext $LIBZ $LIBSOCKET"
  3250. else
  3251. LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm $LIBZ $LIBSOCKET"
  3252. fi
  3253. CFLAGS="$CFLAGS $X_INCLUDES $USER_INCLUDES"
  3254. test -n "$XPM_INCLUDE" && CFLAGS="-I$XPM_INCLUDE $CFLAGS"
  3255. AC_TRY_LINK([#include <X11/xpm.h>],[],
  3256. ac_cv_have_xpm="yes",ac_cv_have_xpm="no")
  3257. LDFLAGS="$ac_save_ldflags"
  3258. CFLAGS="$ac_save_cflags"
  3259. ])dnl
  3260. if test "$ac_cv_have_xpm" = no; then
  3261. AC_MSG_RESULT(no)
  3262. XPM_LDFLAGS=""
  3263. XPMINC=""
  3264. $2
  3265. else
  3266. AC_DEFINE(HAVE_XPM, 1, [Define if you have XPM support])
  3267. if test "$XPM_LDFLAGS" = ""; then
  3268. XPMLIB='-lXpm $(LIB_X11)'
  3269. else
  3270. XPMLIB="-L$XPM_LDFLAGS -lXpm "'$(LIB_X11)'
  3271. fi
  3272. if test "$XPM_INCLUDE" = ""; then
  3273. XPMINC=""
  3274. else
  3275. XPMINC="-I$XPM_INCLUDE"
  3276. fi
  3277. AC_MSG_RESULT(yes)
  3278. $1
  3279. fi
  3280. fi
  3281. AC_SUBST(XPMINC)
  3282. AC_SUBST(XPMLIB)
  3283. ])
  3284. AC_DEFUN([AC_HAVE_DPMS],
  3285. [AC_REQUIRE_CPP()dnl
  3286. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  3287. test -z "$DPMS_LDFLAGS" && DPMS_LDFLAGS=
  3288. test -z "$DPMS_INCLUDE" && DPMS_INCLUDE=
  3289. DPMS_LIB=
  3290. AC_ARG_WITH(dpms,AC_HELP_STRING([--without-dpms],[disable DPMS power saving]),
  3291. dpms_test=$withval, dpms_test="yes")
  3292. if test "x$dpms_test" = xno; then
  3293. ac_cv_have_dpms=no
  3294. else
  3295. AC_MSG_CHECKING(for DPMS)
  3296. dnl Note: ac_cv_have_dpms can be no, yes, or -lXdpms.
  3297. dnl 'yes' means DPMS_LIB="", '-lXdpms' means DPMS_LIB="-lXdpms".
  3298. AC_CACHE_VAL(ac_cv_have_dpms,
  3299. [
  3300. if test "x$kde_use_qt_emb" = "xyes" || test "x$kde_use_qt_mac" = "xyes"; then
  3301. AC_MSG_RESULT(no)
  3302. ac_cv_have_dpms="no"
  3303. else
  3304. ac_save_ldflags="$LDFLAGS"
  3305. ac_save_cflags="$CFLAGS"
  3306. ac_save_libs="$LIBS"
  3307. LDFLAGS="$LDFLAGS $DPMS_LDFLAGS $all_libraries -lX11 -lXext $LIBSOCKET"
  3308. CFLAGS="$CFLAGS $X_INCLUDES"
  3309. test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
  3310. AC_TRY_LINK([
  3311. #include <X11/Xproto.h>
  3312. #include <X11/X.h>
  3313. #include <X11/Xlib.h>
  3314. #include <X11/extensions/dpms.h>
  3315. int foo_test_dpms()
  3316. { return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[],
  3317. ac_cv_have_dpms="yes", [
  3318. LDFLAGS="$ac_save_ldflags"
  3319. CFLAGS="$ac_save_cflags"
  3320. LDFLAGS="$LDFLAGS $DPMS_LDFLAGS $all_libraries -lX11 -lXext $LIBSOCKET"
  3321. LIBS="$LIBS -lXdpms"
  3322. CFLAGS="$CFLAGS $X_INCLUDES"
  3323. test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
  3324. AC_TRY_LINK([
  3325. #include <X11/Xproto.h>
  3326. #include <X11/X.h>
  3327. #include <X11/Xlib.h>
  3328. #include <X11/extensions/dpms.h>
  3329. int foo_test_dpms()
  3330. { return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[],
  3331. [
  3332. ac_cv_have_dpms="-lXdpms"
  3333. ],ac_cv_have_dpms="no")
  3334. ])
  3335. LDFLAGS="$ac_save_ldflags"
  3336. CFLAGS="$ac_save_cflags"
  3337. LIBS="$ac_save_libs"
  3338. fi
  3339. ])dnl
  3340. if test "$ac_cv_have_dpms" = no; then
  3341. AC_MSG_RESULT(no)
  3342. DPMS_LDFLAGS=""
  3343. DPMSINC=""
  3344. $2
  3345. else
  3346. AC_DEFINE(HAVE_DPMS, 1, [Define if you have DPMS support])
  3347. if test "$ac_cv_have_dpms" = "-lXdpms"; then
  3348. DPMS_LIB="-lXdpms"
  3349. fi
  3350. if test "$DPMS_LDFLAGS" = ""; then
  3351. DPMSLIB="$DPMS_LIB "'$(LIB_X11)'
  3352. else
  3353. DPMSLIB="$DPMS_LDFLAGS $DPMS_LIB "'$(LIB_X11)'
  3354. fi
  3355. if test "$DPMS_INCLUDE" = ""; then
  3356. DPMSINC=""
  3357. else
  3358. DPMSINC="-I$DPMS_INCLUDE"
  3359. fi
  3360. AC_MSG_RESULT(yes)
  3361. $1
  3362. fi
  3363. fi
  3364. ac_save_cflags="$CFLAGS"
  3365. CFLAGS="$CFLAGS $X_INCLUDES"
  3366. test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
  3367. AH_TEMPLATE(HAVE_DPMSCAPABLE_PROTO,
  3368. [Define if you have the DPMSCapable prototype in <X11/extensions/dpms.h>])
  3369. AC_CHECK_DECL(DPMSCapable,
  3370. AC_DEFINE(HAVE_DPMSCAPABLE_PROTO),,
  3371. [#include <X11/extensions/dpms.h>])
  3372. AH_TEMPLATE(HAVE_DPMSINFO_PROTO,
  3373. [Define if you have the DPMSInfo prototype in <X11/extensions/dpms.h>])
  3374. AC_CHECK_DECL(DPMSInfo,
  3375. AC_DEFINE(HAVE_DPMSINFO_PROTO),,
  3376. [#include <X11/extensions/dpms.h>])
  3377. CFLAGS="$ac_save_cflags"
  3378. AC_SUBST(DPMSINC)
  3379. AC_SUBST(DPMSLIB)
  3380. ])
  3381. AC_DEFUN([AC_HAVE_GL],
  3382. [AC_REQUIRE_CPP()dnl
  3383. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  3384. test -z "$GL_LDFLAGS" && GL_LDFLAGS=
  3385. test -z "$GL_INCLUDE" && GL_INCLUDE=
  3386. AC_ARG_WITH(gl,AC_HELP_STRING([--without-gl],[disable 3D GL modes]),
  3387. gl_test=$withval, gl_test="yes")
  3388. if test "x$kde_use_qt_emb" = "xyes"; then
  3389. # GL and Qt Embedded is a no-go for now.
  3390. ac_cv_have_gl=no
  3391. elif test "x$gl_test" = xno; then
  3392. ac_cv_have_gl=no
  3393. else
  3394. AC_MSG_CHECKING(for GL)
  3395. AC_CACHE_VAL(ac_cv_have_gl,
  3396. [
  3397. AC_LANG_SAVE
  3398. AC_LANG_CPLUSPLUS
  3399. ac_save_ldflags="$LDFLAGS"
  3400. ac_save_cxxflags="$CXXFLAGS"
  3401. LDFLAGS="$LDFLAGS $GL_LDFLAGS $X_LDFLAGS $all_libraries -lGL -lGLU"
  3402. test "x$kde_use_qt_mac" != xyes && test "x$kde_use_qt_emb" != xyes && LDFLAGS="$LDFLAGS -lX11"
  3403. LDFLAGS="$LDFLAGS $LIB_XEXT -lm $LIBSOCKET"
  3404. CXXFLAGS="$CFLAGS $X_INCLUDES"
  3405. test -n "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS"
  3406. AC_TRY_LINK([#include <GL/gl.h>
  3407. #include <GL/glu.h>
  3408. ], [],
  3409. ac_cv_have_gl="yes", ac_cv_have_gl="no")
  3410. AC_LANG_RESTORE
  3411. LDFLAGS="$ac_save_ldflags"
  3412. CXXFLAGS="$ac_save_cxxflags"
  3413. ])dnl
  3414. if test "$ac_cv_have_gl" = "no"; then
  3415. AC_MSG_RESULT(no)
  3416. GL_LDFLAGS=""
  3417. GLINC=""
  3418. $2
  3419. else
  3420. AC_DEFINE(HAVE_GL, 1, [Defines if you have GL (Mesa, OpenGL, ...)])
  3421. if test "$GL_LDFLAGS" = ""; then
  3422. GLLIB='-lGLU -lGL $(LIB_X11)'
  3423. else
  3424. GLLIB="$GL_LDFLAGS -lGLU -lGL "'$(LIB_X11)'
  3425. fi
  3426. if test "$GL_INCLUDE" = ""; then
  3427. GLINC=""
  3428. else
  3429. GLINC="-I$GL_INCLUDE"
  3430. fi
  3431. AC_MSG_RESULT($ac_cv_have_gl)
  3432. $1
  3433. fi
  3434. fi
  3435. AC_SUBST(GLINC)
  3436. AC_SUBST(GLLIB)
  3437. ])
  3438. dnl shadow password and PAM magic - maintained by ossi@kde.org
  3439. AC_DEFUN([KDE_PAM], [
  3440. AC_REQUIRE([KDE_CHECK_LIBDL])
  3441. want_pam=
  3442. AC_ARG_WITH(pam,
  3443. AC_HELP_STRING([--with-pam[=ARG]],[enable support for PAM: ARG=[yes|no|service name]]),
  3444. [ if test "x$withval" = "xyes"; then
  3445. want_pam=yes
  3446. pam_service=kde
  3447. elif test "x$withval" = "xno"; then
  3448. want_pam=no
  3449. else
  3450. want_pam=yes
  3451. pam_service=$withval
  3452. fi
  3453. ], [ pam_service=kde ])
  3454. use_pam=
  3455. PAMLIBS=
  3456. if test "x$want_pam" != xno; then
  3457. AC_CHECK_LIB(pam, pam_start, [
  3458. AC_CHECK_HEADER(security/pam_appl.h,
  3459. [ pam_header=security/pam_appl.h ],
  3460. [ AC_CHECK_HEADER(pam/pam_appl.h,
  3461. [ pam_header=pam/pam_appl.h ],
  3462. [
  3463. AC_MSG_WARN([PAM detected, but no headers found!
  3464. Make sure you have the necessary development packages installed.])
  3465. ]
  3466. )
  3467. ]
  3468. )
  3469. ], , $LIBDL)
  3470. if test -z "$pam_header"; then
  3471. if test "x$want_pam" = xyes; then
  3472. AC_MSG_ERROR([--with-pam was specified, but cannot compile with PAM!])
  3473. fi
  3474. else
  3475. AC_DEFINE(HAVE_PAM, 1, [Defines if you have PAM (Pluggable Authentication Modules)])
  3476. PAMLIBS="$PAM_MISC_LIB -lpam $LIBDL"
  3477. use_pam=yes
  3478. dnl darwin claims to be something special
  3479. if test "$pam_header" = "pam/pam_appl.h"; then
  3480. AC_DEFINE(HAVE_PAM_PAM_APPL_H, 1, [Define if your PAM headers are in pam/ instead of security/])
  3481. fi
  3482. dnl test whether struct pam_message is const (Linux) or not (Sun)
  3483. AC_MSG_CHECKING(for const pam_message)
  3484. AC_EGREP_HEADER([struct pam_message], $pam_header,
  3485. [ AC_EGREP_HEADER([const struct pam_message], $pam_header,
  3486. [AC_MSG_RESULT([const: Linux-type PAM])],
  3487. [AC_MSG_RESULT([nonconst: Sun-type PAM])
  3488. AC_DEFINE(PAM_MESSAGE_NONCONST, 1, [Define if your PAM support takes non-const arguments (Solaris)])]
  3489. )],
  3490. [AC_MSG_RESULT([not found - assume const, Linux-type PAM])])
  3491. fi
  3492. fi
  3493. AC_SUBST(PAMLIBS)
  3494. ])
  3495. dnl DEF_PAM_SERVICE(arg name, full name, define name)
  3496. AC_DEFUN([DEF_PAM_SERVICE], [
  3497. AC_ARG_WITH($1-pam,
  3498. AC_HELP_STRING([--with-$1-pam=[val]],[override PAM service from --with-pam for $2]),
  3499. [ if test "x$use_pam" = xyes; then
  3500. $3_PAM_SERVICE=$withval
  3501. else
  3502. AC_MSG_ERROR([Cannot use use --with-$1-pam, as no PAM was detected.
  3503. You may want to enforce it by using --with-pam.])
  3504. fi
  3505. ],
  3506. [ if test "x$use_pam" = xyes; then
  3507. $3_PAM_SERVICE="$pam_service"
  3508. fi
  3509. ])
  3510. if test -n "$$3_PAM_SERVICE"; then
  3511. AC_MSG_RESULT([The PAM service used by $2 will be $$3_PAM_SERVICE])
  3512. AC_DEFINE_UNQUOTED($3_PAM_SERVICE, "$$3_PAM_SERVICE", [The PAM service to be used by $2])
  3513. fi
  3514. AC_SUBST($3_PAM_SERVICE)
  3515. ])
  3516. AC_DEFUN([KDE_SHADOWPASSWD], [
  3517. AC_REQUIRE([KDE_PAM])
  3518. AC_CHECK_LIB(shadow, getspent,
  3519. [ LIBSHADOW="-lshadow"
  3520. ac_use_shadow=yes
  3521. ],
  3522. [ dnl for UnixWare
  3523. AC_CHECK_LIB(gen, getspent,
  3524. [ LIBGEN="-lgen"
  3525. ac_use_shadow=yes
  3526. ],
  3527. [ AC_CHECK_FUNC(getspent,
  3528. [ ac_use_shadow=yes ],
  3529. [ ac_use_shadow=no ])
  3530. ])
  3531. ])
  3532. AC_SUBST(LIBSHADOW)
  3533. AC_SUBST(LIBGEN)
  3534. AC_MSG_CHECKING([for shadow passwords])
  3535. AC_ARG_WITH(shadow,
  3536. AC_HELP_STRING([--with-shadow],[If you want shadow password support]),
  3537. [ if test "x$withval" != "xno"; then
  3538. use_shadow=yes
  3539. else
  3540. use_shadow=no
  3541. fi
  3542. ], [
  3543. use_shadow="$ac_use_shadow"
  3544. ])
  3545. if test "x$use_shadow" = xyes; then
  3546. AC_MSG_RESULT(yes)
  3547. AC_DEFINE(HAVE_SHADOW, 1, [Define if you use shadow passwords])
  3548. else
  3549. AC_MSG_RESULT(no)
  3550. LIBSHADOW=
  3551. LIBGEN=
  3552. fi
  3553. dnl finally make the relevant binaries setuid root, if we have shadow passwds.
  3554. dnl this still applies, if we could use it indirectly through pam.
  3555. if test "x$use_shadow" = xyes ||
  3556. ( test "x$use_pam" = xyes && test "x$ac_use_shadow" = xyes ); then
  3557. case $host in
  3558. *-*-freebsd* | *-*-netbsd* | *-*-openbsd*)
  3559. SETUIDFLAGS="-m 4755 -o root";;
  3560. *)
  3561. SETUIDFLAGS="-m 4755";;
  3562. esac
  3563. fi
  3564. AC_SUBST(SETUIDFLAGS)
  3565. ])
  3566. AC_DEFUN([KDE_PASSWDLIBS], [
  3567. AC_REQUIRE([KDE_MISC_TESTS]) dnl for LIBCRYPT
  3568. AC_REQUIRE([KDE_PAM])
  3569. AC_REQUIRE([KDE_SHADOWPASSWD])
  3570. if test "x$use_pam" = "xyes"; then
  3571. PASSWDLIBS="$PAMLIBS"
  3572. else
  3573. PASSWDLIBS="$LIBCRYPT $LIBSHADOW $LIBGEN"
  3574. fi
  3575. dnl FreeBSD uses a shadow-like setup, where /etc/passwd holds the users, but
  3576. dnl /etc/master.passwd holds the actual passwords. /etc/master.passwd requires
  3577. dnl root to read, so kcheckpass needs to be root (even when using pam, since pam
  3578. dnl may need to read /etc/master.passwd).
  3579. case $host in
  3580. *-*-freebsd*)
  3581. SETUIDFLAGS="-m 4755 -o root"
  3582. ;;
  3583. *)
  3584. ;;
  3585. esac
  3586. AC_SUBST(PASSWDLIBS)
  3587. ])
  3588. AC_DEFUN([KDE_CHECK_LIBDL],
  3589. [
  3590. AC_CHECK_LIB(dl, dlopen, [
  3591. LIBDL="-ldl"
  3592. ac_cv_have_dlfcn=yes
  3593. ])
  3594. AC_CHECK_LIB(dld, shl_unload, [
  3595. LIBDL="-ldld"
  3596. ac_cv_have_shload=yes
  3597. ])
  3598. AC_SUBST(LIBDL)
  3599. ])
  3600. AC_DEFUN([KDE_CHECK_DLOPEN],
  3601. [
  3602. KDE_CHECK_LIBDL
  3603. AC_CHECK_HEADERS(dlfcn.h dl.h)
  3604. if test "$ac_cv_header_dlfcn_h" = "no"; then
  3605. ac_cv_have_dlfcn=no
  3606. fi
  3607. if test "$ac_cv_header_dl_h" = "no"; then
  3608. ac_cv_have_shload=no
  3609. fi
  3610. dnl XXX why change enable_dlopen? its already set by autoconf's AC_ARG_ENABLE
  3611. dnl (MM)
  3612. AC_ARG_ENABLE(dlopen,
  3613. AC_HELP_STRING([--disable-dlopen],[link statically [default=no]]),
  3614. enable_dlopen=$enableval,
  3615. enable_dlopen=yes)
  3616. # override the user's opinion, if we know it better ;)
  3617. if test "$ac_cv_have_dlfcn" = "no" && test "$ac_cv_have_shload" = "no"; then
  3618. enable_dlopen=no
  3619. fi
  3620. if test "$ac_cv_have_dlfcn" = "yes"; then
  3621. AC_DEFINE_UNQUOTED(HAVE_DLFCN, 1, [Define if you have dlfcn])
  3622. fi
  3623. if test "$ac_cv_have_shload" = "yes"; then
  3624. AC_DEFINE_UNQUOTED(HAVE_SHLOAD, 1, [Define if you have shload])
  3625. fi
  3626. if test "$enable_dlopen" = no ; then
  3627. test -n "$1" && eval $1
  3628. else
  3629. test -n "$2" && eval $2
  3630. fi
  3631. ])
  3632. AC_DEFUN([KDE_CHECK_DYNAMIC_LOADING],
  3633. [
  3634. KDE_CHECK_DLOPEN(libtool_enable_shared=yes, libtool_enable_static=no)
  3635. KDE_PROG_LIBTOOL
  3636. AC_MSG_CHECKING([dynamic loading])
  3637. eval "`egrep '^build_libtool_libs=' libtool`"
  3638. if test "$build_libtool_libs" = "yes" && test "$enable_dlopen" = "yes"; then
  3639. dynamic_loading=yes
  3640. AC_DEFINE_UNQUOTED(HAVE_DYNAMIC_LOADING)
  3641. else
  3642. dynamic_loading=no
  3643. fi
  3644. AC_MSG_RESULT($dynamic_loading)
  3645. if test "$dynamic_loading" = "yes"; then
  3646. $1
  3647. else
  3648. $2
  3649. fi
  3650. ])
  3651. AC_DEFUN([KDE_ADD_INCLUDES],
  3652. [
  3653. if test -z "$1"; then
  3654. test_include="Pix.h"
  3655. else
  3656. test_include="$1"
  3657. fi
  3658. AC_MSG_CHECKING([for libg++ ($test_include)])
  3659. AC_CACHE_VAL(kde_cv_libgpp_includes,
  3660. [
  3661. kde_cv_libgpp_includes=no
  3662. for ac_dir in \
  3663. \
  3664. /usr/include/g++ \
  3665. /usr/include \
  3666. /usr/unsupported/include \
  3667. /opt/include \
  3668. $extra_include \
  3669. ; \
  3670. do
  3671. if test -r "$ac_dir/$test_include"; then
  3672. kde_cv_libgpp_includes=$ac_dir
  3673. break
  3674. fi
  3675. done
  3676. ])
  3677. AC_MSG_RESULT($kde_cv_libgpp_includes)
  3678. if test "$kde_cv_libgpp_includes" != "no"; then
  3679. all_includes="-I$kde_cv_libgpp_includes $all_includes $USER_INCLUDES"
  3680. fi
  3681. ])
  3682. ])
  3683. AC_DEFUN([KDE_CHECK_LIBPTHREAD],
  3684. [
  3685. dnl This code is here specifically to handle the
  3686. dnl various flavors of threading library on FreeBSD
  3687. dnl 4-, 5-, and 6-, and the (weird) rules around it.
  3688. dnl There may be an environment PTHREAD_LIBS that
  3689. dnl specifies what to use; otherwise, search for it.
  3690. dnl -pthread is special cased and unsets LIBPTHREAD
  3691. dnl below if found.
  3692. LIBPTHREAD=""
  3693. if test -n "$PTHREAD_LIBS"; then
  3694. if test "x$PTHREAD_LIBS" = "x-pthread" ; then
  3695. LIBPTHREAD="PTHREAD"
  3696. else
  3697. PTHREAD_LIBS_save="$PTHREAD_LIBS"
  3698. PTHREAD_LIBS=`echo "$PTHREAD_LIBS_save" | sed -e 's,^-l,,g'`
  3699. AC_MSG_CHECKING([for pthread_create in $PTHREAD_LIBS])
  3700. KDE_CHECK_LIB($PTHREAD_LIBS, pthread_create, [
  3701. LIBPTHREAD="$PTHREAD_LIBS_save"])
  3702. PTHREAD_LIBS="$PTHREAD_LIBS_save"
  3703. fi
  3704. fi
  3705. dnl Is this test really needed, in the face of the Tru64 test below?
  3706. if test -z "$LIBPTHREAD"; then
  3707. AC_CHECK_LIB(pthread, pthread_create, [LIBPTHREAD="-lpthread"])
  3708. fi
  3709. dnl This is a special Tru64 check, see BR 76171 issue #18.
  3710. if test -z "$LIBPTHREAD" ; then
  3711. AC_MSG_CHECKING([for pthread_create in -lpthread])
  3712. kde_safe_libs=$LIBS
  3713. LIBS="$LIBS -lpthread"
  3714. AC_TRY_LINK([#include <pthread.h>],[(void)pthread_create(0,0,0,0);],[
  3715. AC_MSG_RESULT(yes)
  3716. LIBPTHREAD="-lpthread"],[
  3717. AC_MSG_RESULT(no)])
  3718. LIBS=$kde_safe_libs
  3719. fi
  3720. dnl Un-special-case for FreeBSD.
  3721. if test "x$LIBPTHREAD" = "xPTHREAD" ; then
  3722. LIBPTHREAD=""
  3723. fi
  3724. AC_SUBST(LIBPTHREAD)
  3725. ])
  3726. AC_DEFUN([KDE_CHECK_PTHREAD_OPTION],
  3727. [
  3728. USE_THREADS=""
  3729. if test -z "$LIBPTHREAD"; then
  3730. KDE_CHECK_COMPILER_FLAG(pthread, [USE_THREADS="-D_THREAD_SAFE -pthread"])
  3731. fi
  3732. AH_VERBATIM(__svr_define, [
  3733. #if defined(__SVR4) && !defined(__svr4__)
  3734. #define __svr4__ 1
  3735. #endif
  3736. ])
  3737. case $host_os in
  3738. solaris*)
  3739. KDE_CHECK_COMPILER_FLAG(mt, [USE_THREADS="-mt"])
  3740. CPPFLAGS="$CPPFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_SOLARIS -DSVR4"
  3741. ;;
  3742. freebsd*)
  3743. CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE $PTHREAD_CFLAGS"
  3744. ;;
  3745. aix*)
  3746. CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
  3747. LIBPTHREAD="$LIBPTHREAD -lc_r"
  3748. ;;
  3749. linux*) CPPFLAGS="$CPPFLAGS -D_REENTRANT"
  3750. if test "$CXX" = "KCC"; then
  3751. CXXFLAGS="$CXXFLAGS --thread_safe"
  3752. NOOPT_CXXFLAGS="$NOOPT_CXXFLAGS --thread_safe"
  3753. fi
  3754. ;;
  3755. *)
  3756. ;;
  3757. esac
  3758. AC_SUBST(USE_THREADS)
  3759. AC_SUBST(LIBPTHREAD)
  3760. ])
  3761. AC_DEFUN([KDE_CHECK_THREADING],
  3762. [
  3763. AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
  3764. AC_REQUIRE([KDE_CHECK_PTHREAD_OPTION])
  3765. dnl default is yes if libpthread is found and no if no libpthread is available
  3766. if test -z "$LIBPTHREAD"; then
  3767. if test -z "$USE_THREADS"; then
  3768. kde_check_threading_default=no
  3769. else
  3770. kde_check_threading_default=yes
  3771. fi
  3772. else
  3773. kde_check_threading_default=yes
  3774. fi
  3775. AC_ARG_ENABLE(threading,AC_HELP_STRING([--disable-threading],[disables threading even if libpthread found]),
  3776. kde_use_threading=$enableval, kde_use_threading=$kde_check_threading_default)
  3777. if test "x$kde_use_threading" = "xyes"; then
  3778. AC_DEFINE(HAVE_LIBPTHREAD, 1, [Define if you have a working libpthread (will enable threaded code)])
  3779. fi
  3780. ])
  3781. AC_DEFUN([KDE_TRY_LINK_PYTHON],
  3782. [
  3783. if test "$kde_python_link_found" = no; then
  3784. if test "$1" = normal; then
  3785. AC_MSG_CHECKING(if a Python application links)
  3786. else
  3787. AC_MSG_CHECKING(if Python depends on $2)
  3788. fi
  3789. AC_CACHE_VAL(kde_cv_try_link_python_$1,
  3790. [
  3791. kde_save_cflags="$CFLAGS"
  3792. CFLAGS="$CFLAGS $PYTHONINC"
  3793. kde_save_libs="$LIBS"
  3794. LIBS="$LIBS $LIBPYTHON $2 $LIBDL $LIBSOCKET"
  3795. kde_save_ldflags="$LDFLAGS"
  3796. LDFLAGS="$LDFLAGS $PYTHONLIB"
  3797. AC_TRY_LINK(
  3798. [
  3799. #include <Python.h>
  3800. ],[
  3801. PySys_SetArgv(1, 0);
  3802. ],
  3803. [kde_cv_try_link_python_$1=yes],
  3804. [kde_cv_try_link_python_$1=no]
  3805. )
  3806. CFLAGS="$kde_save_cflags"
  3807. LIBS="$kde_save_libs"
  3808. LDFLAGS="$kde_save_ldflags"
  3809. ])
  3810. if test "$kde_cv_try_link_python_$1" = "yes"; then
  3811. AC_MSG_RESULT(yes)
  3812. kde_python_link_found=yes
  3813. if test ! "$1" = normal; then
  3814. LIBPYTHON="$LIBPYTHON $2"
  3815. fi
  3816. $3
  3817. else
  3818. AC_MSG_RESULT(no)
  3819. $4
  3820. fi
  3821. fi
  3822. ])
  3823. AC_DEFUN([KDE_CHECK_PYTHON_DIR],
  3824. [
  3825. AC_MSG_CHECKING([for Python directory])
  3826. AC_CACHE_VAL(kde_cv_pythondir,
  3827. [
  3828. if test -z "$PYTHONDIR"; then
  3829. kde_cv_pythondir=/usr/local
  3830. else
  3831. kde_cv_pythondir="$PYTHONDIR"
  3832. fi
  3833. ])
  3834. AC_ARG_WITH(pythondir,
  3835. AC_HELP_STRING([--with-pythondir=pythondir],[use python installed in pythondir]),
  3836. [
  3837. ac_python_dir=$withval
  3838. ], ac_python_dir=$kde_cv_pythondir
  3839. )
  3840. AC_MSG_RESULT($ac_python_dir)
  3841. ])
  3842. AC_DEFUN([KDE_CHECK_PYTHON_INTERN],
  3843. [
  3844. AC_REQUIRE([KDE_CHECK_LIBDL])
  3845. AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
  3846. AC_REQUIRE([KDE_CHECK_PYTHON_DIR])
  3847. if test -z "$1"; then
  3848. version="1.5"
  3849. else
  3850. version="$1"
  3851. fi
  3852. AC_MSG_CHECKING([for Python$version])
  3853. python_incdirs="$ac_python_dir/include /usr/include /usr/local/include/ $kde_extra_includes"
  3854. AC_FIND_FILE(Python.h, $python_incdirs, python_incdir)
  3855. if test ! -r $python_incdir/Python.h; then
  3856. AC_FIND_FILE(python$version/Python.h, $python_incdirs, python_incdir)
  3857. python_incdir=$python_incdir/python$version
  3858. if test ! -r $python_incdir/Python.h; then
  3859. python_incdir=no
  3860. fi
  3861. fi
  3862. PYTHONINC=-I$python_incdir
  3863. python_libdirs="$ac_python_dir/lib$tdelibsuff /usr/lib$tdelibsuff /usr/local /usr/lib$tdelibsuff $kde_extra_libs"
  3864. AC_FIND_FILE(libpython$version.so, $python_libdirs, python_libdir)
  3865. if test ! -r $python_libdir/libpython$version.so; then
  3866. AC_FIND_FILE(libpython$version.a, $python_libdirs, python_libdir)
  3867. if test ! -r $python_libdir/libpython$version.a; then
  3868. AC_FIND_FILE(python$version/config/libpython$version.a, $python_libdirs, python_libdir)
  3869. python_libdir=$python_libdir/python$version/config
  3870. if test ! -r $python_libdir/libpython$version.a; then
  3871. python_libdir=no
  3872. fi
  3873. fi
  3874. fi
  3875. PYTHONLIB=-L$python_libdir
  3876. kde_orig_LIBPYTHON=$LIBPYTHON
  3877. if test -z "$LIBPYTHON"; then
  3878. LIBPYTHON=-lpython$version
  3879. fi
  3880. AC_FIND_FILE(python$version/copy.py, $python_libdirs, python_moddir)
  3881. python_moddir=$python_moddir/python$version
  3882. if test ! -r $python_moddir/copy.py; then
  3883. python_moddir=no
  3884. fi
  3885. PYTHONMODDIR=$python_moddir
  3886. AC_MSG_RESULT(header $python_incdir library $python_libdir modules $python_moddir)
  3887. if test x$python_incdir = xno || test x$python_libdir = xno || test x$python_moddir = xno; then
  3888. LIBPYTHON=$kde_orig_LIBPYTHON
  3889. test "x$PYTHONLIB" = "x-Lno" && PYTHONLIB=""
  3890. test "x$PYTHONINC" = "x-Ino" && PYTHONINC=""
  3891. $2
  3892. else
  3893. dnl Note: this test is very weak
  3894. kde_python_link_found=no
  3895. KDE_TRY_LINK_PYTHON(normal)
  3896. KDE_TRY_LINK_PYTHON(m, -lm)
  3897. KDE_TRY_LINK_PYTHON(pthread, $LIBPTHREAD)
  3898. KDE_TRY_LINK_PYTHON(tcl, -ltcl)
  3899. KDE_TRY_LINK_PYTHON(db2, -ldb2)
  3900. KDE_TRY_LINK_PYTHON(m_and_thread, [$LIBPTHREAD -lm])
  3901. KDE_TRY_LINK_PYTHON(m_and_thread_and_util, [$LIBPTHREAD -lm -lutil])
  3902. KDE_TRY_LINK_PYTHON(m_and_thread_and_db3, [$LIBPTHREAD -lm -ldb-3 -lutil])
  3903. KDE_TRY_LINK_PYTHON(pthread_and_db3, [$LIBPTHREAD -ldb-3])
  3904. KDE_TRY_LINK_PYTHON(m_and_thread_and_db, [$LIBPTHREAD -lm -ldb -ltermcap -lutil])
  3905. KDE_TRY_LINK_PYTHON(pthread_and_dl, [$LIBPTHREAD $LIBDL -lutil -lreadline -lncurses -lm])
  3906. KDE_TRY_LINK_PYTHON(pthread_and_panel_curses, [$LIBPTHREAD $LIBDL -lm -lpanel -lcurses])
  3907. KDE_TRY_LINK_PYTHON(m_and_thread_and_db_special, [$LIBPTHREAD -lm -ldb -lutil], [],
  3908. [AC_MSG_WARN([it seems, Python depends on another library.
  3909. Please set LIBPYTHON to '-lpython$version -lotherlib' before calling configure to fix this
  3910. and contact the authors to let them know about this problem])
  3911. ])
  3912. LIBPYTHON="$LIBPYTHON $LIBDL $LIBSOCKET"
  3913. AC_SUBST(PYTHONINC)
  3914. AC_SUBST(PYTHONLIB)
  3915. AC_SUBST(LIBPYTHON)
  3916. AC_SUBST(PYTHONMODDIR)
  3917. AC_DEFINE(HAVE_PYTHON, 1, [Define if you have the development files for python])
  3918. fi
  3919. ])
  3920. AC_DEFUN([KDE_CHECK_PYTHON],
  3921. [
  3922. KDE_CHECK_PYTHON_INTERN("2.4",
  3923. [KDE_CHECK_PYTHON_INTERN("2.3",
  3924. [KDE_CHECK_PYTHON_INTERN("2.2",
  3925. [KDE_CHECK_PYTHON_INTERN("2.1",
  3926. [KDE_CHECK_PYTHON_INTERN("2.0",
  3927. [KDE_CHECK_PYTHON_INTERN($1, $2) ])
  3928. ])
  3929. ])
  3930. ])
  3931. ])
  3932. ])
  3933. AC_DEFUN([KDE_CHECK_STL],
  3934. [
  3935. AC_LANG_SAVE
  3936. AC_LANG_CPLUSPLUS
  3937. ac_save_CXXFLAGS="$CXXFLAGS"
  3938. CXXFLAGS="`echo $CXXFLAGS | sed s/-fno-exceptions//`"
  3939. AC_MSG_CHECKING([if C++ programs can be compiled])
  3940. AC_CACHE_VAL(kde_cv_stl_works,
  3941. [
  3942. AC_TRY_COMPILE([
  3943. #include <string>
  3944. using namespace std;
  3945. ],[
  3946. string astring="Hallo Welt.";
  3947. astring.erase(0, 6); // now astring is "Welt"
  3948. return 0;
  3949. ], kde_cv_stl_works=yes,
  3950. kde_cv_stl_works=no)
  3951. ])
  3952. AC_MSG_RESULT($kde_cv_stl_works)
  3953. if test "$kde_cv_stl_works" = "yes"; then
  3954. # back compatible
  3955. AC_DEFINE_UNQUOTED(HAVE_SGI_STL, 1, [Define if you have a STL implementation by SGI])
  3956. else
  3957. AC_MSG_ERROR([Your Installation isn't able to compile simple C++ programs.
  3958. Check config.log for details - if you're using a Linux distribution you might miss
  3959. a package named similar to libstdc++-dev.])
  3960. fi
  3961. CXXFLAGS="$ac_save_CXXFLAGS"
  3962. AC_LANG_RESTORE
  3963. ])
  3964. AC_DEFUN([AC_FIND_QIMGIO],
  3965. [AC_REQUIRE([AC_FIND_JPEG])
  3966. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  3967. AC_MSG_CHECKING([for qimgio])
  3968. AC_CACHE_VAL(ac_cv_lib_qimgio,
  3969. [
  3970. AC_LANG_SAVE
  3971. AC_LANG_CPLUSPLUS
  3972. ac_save_LIBS="$LIBS"
  3973. ac_save_CXXFLAGS="$CXXFLAGS"
  3974. LIBS="$all_libraries -lqimgio -lpng -lz $LIBJPEG $LIBQT"
  3975. CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
  3976. AC_TRY_RUN(dnl
  3977. [
  3978. #include <qimageio.h>
  3979. #include <qstring.h>
  3980. int main() {
  3981. QString t = "hallo";
  3982. t.fill('t');
  3983. qInitImageIO();
  3984. }
  3985. ],
  3986. ac_cv_lib_qimgio=yes,
  3987. ac_cv_lib_qimgio=no,
  3988. ac_cv_lib_qimgio=no)
  3989. LIBS="$ac_save_LIBS"
  3990. CXXFLAGS="$ac_save_CXXFLAGS"
  3991. AC_LANG_RESTORE
  3992. ])dnl
  3993. if eval "test \"`echo $ac_cv_lib_qimgio`\" = yes"; then
  3994. LIBQIMGIO="-lqimgio -lpng -lz $LIBJPEG"
  3995. AC_MSG_RESULT(yes)
  3996. AC_DEFINE_UNQUOTED(HAVE_QIMGIO, 1, [Define if you have the Qt extension qimgio available])
  3997. AC_SUBST(LIBQIMGIO)
  3998. else
  3999. AC_MSG_RESULT(not found)
  4000. fi
  4001. ])
  4002. AC_DEFUN([AM_DISABLE_LIBRARIES],
  4003. [
  4004. AC_PROVIDE([AM_ENABLE_STATIC])
  4005. AC_PROVIDE([AM_ENABLE_SHARED])
  4006. enable_static=no
  4007. enable_shared=yes
  4008. ])
  4009. AC_DEFUN([AC_CHECK_UTMP_FILE],
  4010. [
  4011. AC_MSG_CHECKING([for utmp file])
  4012. AC_CACHE_VAL(kde_cv_utmp_file,
  4013. [
  4014. kde_cv_utmp_file=no
  4015. for ac_file in \
  4016. \
  4017. /var/run/utmp \
  4018. /var/adm/utmp \
  4019. /etc/utmp \
  4020. ; \
  4021. do
  4022. if test -r "$ac_file"; then
  4023. kde_cv_utmp_file=$ac_file
  4024. break
  4025. fi
  4026. done
  4027. ])
  4028. if test "$kde_cv_utmp_file" != "no"; then
  4029. AC_DEFINE_UNQUOTED(UTMP, "$kde_cv_utmp_file", [Define the file for utmp entries])
  4030. $1
  4031. AC_MSG_RESULT($kde_cv_utmp_file)
  4032. else
  4033. $2
  4034. AC_MSG_RESULT([non found])
  4035. fi
  4036. ])
  4037. AC_DEFUN([KDE_CREATE_SUBDIRSLIST],
  4038. [
  4039. DO_NOT_COMPILE="$DO_NOT_COMPILE CVS debian bsd-port admin"
  4040. TOPSUBDIRS=""
  4041. if test ! -s $srcdir/subdirs; then
  4042. dnl Note: Makefile.common creates subdirs, so this is just a fallback
  4043. files=`cd $srcdir && ls -1`
  4044. dirs=`for i in $files; do if test -d $i; then echo $i; fi; done`
  4045. for i in $dirs; do
  4046. echo $i >> $srcdir/subdirs
  4047. done
  4048. fi
  4049. ac_topsubdirs=
  4050. if test -s $srcdir/inst-apps; then
  4051. ac_topsubdirs="`cat $srcdir/inst-apps`"
  4052. elif test -s $srcdir/subdirs; then
  4053. ac_topsubdirs="`cat $srcdir/subdirs`"
  4054. fi
  4055. for i in $ac_topsubdirs; do
  4056. AC_MSG_CHECKING([if $i should be compiled])
  4057. if test -d $srcdir/$i; then
  4058. install_it="yes"
  4059. for j in $DO_NOT_COMPILE; do
  4060. if test $i = $j; then
  4061. install_it="no"
  4062. fi
  4063. done
  4064. else
  4065. install_it="no"
  4066. fi
  4067. AC_MSG_RESULT($install_it)
  4068. vari=`echo $i | sed -e 's,[[-+.@]],_,g'`
  4069. if test $install_it = "yes"; then
  4070. TOPSUBDIRS="$TOPSUBDIRS $i"
  4071. eval "$vari""_SUBDIR_included=yes"
  4072. else
  4073. eval "$vari""_SUBDIR_included=no"
  4074. fi
  4075. done
  4076. AC_SUBST(TOPSUBDIRS)
  4077. ])
  4078. AC_DEFUN([KDE_CHECK_NAMESPACES],
  4079. [
  4080. AC_MSG_CHECKING(whether C++ compiler supports namespaces)
  4081. AC_LANG_SAVE
  4082. AC_LANG_CPLUSPLUS
  4083. AC_TRY_COMPILE([
  4084. ],
  4085. [
  4086. namespace Foo {
  4087. extern int i;
  4088. namespace Bar {
  4089. extern int i;
  4090. }
  4091. }
  4092. int Foo::i = 0;
  4093. int Foo::Bar::i = 1;
  4094. ],[
  4095. AC_MSG_RESULT(yes)
  4096. AC_DEFINE(HAVE_NAMESPACES)
  4097. ], [
  4098. AC_MSG_RESULT(no)
  4099. ])
  4100. AC_LANG_RESTORE
  4101. ])
  4102. dnl ------------------------------------------------------------------------
  4103. dnl Check for S_ISSOCK macro. Doesn't exist on Unix SCO. faure@kde.org
  4104. dnl ------------------------------------------------------------------------
  4105. dnl
  4106. AC_DEFUN([AC_CHECK_S_ISSOCK],
  4107. [
  4108. AC_MSG_CHECKING(for S_ISSOCK)
  4109. AC_CACHE_VAL(ac_cv_have_s_issock,
  4110. [
  4111. AC_TRY_LINK(
  4112. [
  4113. #include <sys/stat.h>
  4114. ],
  4115. [
  4116. struct stat buff;
  4117. int b = S_ISSOCK( buff.st_mode );
  4118. ],
  4119. ac_cv_have_s_issock=yes,
  4120. ac_cv_have_s_issock=no)
  4121. ])
  4122. AC_MSG_RESULT($ac_cv_have_s_issock)
  4123. if test "$ac_cv_have_s_issock" = "yes"; then
  4124. AC_DEFINE_UNQUOTED(HAVE_S_ISSOCK, 1, [Define if sys/stat.h declares S_ISSOCK.])
  4125. fi
  4126. AH_VERBATIM(_ISSOCK,
  4127. [
  4128. #ifndef HAVE_S_ISSOCK
  4129. #define HAVE_S_ISSOCK
  4130. #define S_ISSOCK(mode) (1==0)
  4131. #endif
  4132. ])
  4133. ])
  4134. dnl ------------------------------------------------------------------------
  4135. dnl Check for MAXPATHLEN macro, defines KDEMAXPATHLEN. faure@kde.org
  4136. dnl ------------------------------------------------------------------------
  4137. dnl
  4138. AC_DEFUN([AC_CHECK_KDEMAXPATHLEN],
  4139. [
  4140. AC_MSG_CHECKING(for MAXPATHLEN)
  4141. AC_CACHE_VAL(ac_cv_maxpathlen,
  4142. [
  4143. cat > conftest.$ac_ext <<EOF
  4144. #ifdef STDC_HEADERS
  4145. # include <stdlib.h>
  4146. #endif
  4147. #include <stdio.h>
  4148. #include <sys/param.h>
  4149. #ifndef MAXPATHLEN
  4150. #define MAXPATHLEN 1024
  4151. #endif
  4152. KDE_HELLO MAXPATHLEN
  4153. EOF
  4154. ac_try="$ac_cpp conftest.$ac_ext 2>/dev/null | grep '^KDE_HELLO' >conftest.out"
  4155. if AC_TRY_EVAL(ac_try) && test -s conftest.out; then
  4156. ac_cv_maxpathlen=`sed 's#KDE_HELLO ##' conftest.out`
  4157. else
  4158. ac_cv_maxpathlen=1024
  4159. fi
  4160. rm conftest.*
  4161. ])
  4162. AC_MSG_RESULT($ac_cv_maxpathlen)
  4163. AC_DEFINE_UNQUOTED(KDEMAXPATHLEN,$ac_cv_maxpathlen, [Define a safe value for MAXPATHLEN] )
  4164. ])
  4165. AC_DEFUN([KDE_CHECK_HEADER],
  4166. [
  4167. kde_safe_cppflags=$CPPFLAGS
  4168. CPPFLAGS="$CPPFLAGS $all_includes"
  4169. AC_LANG_SAVE
  4170. AC_LANG_CPLUSPLUS
  4171. AC_CHECK_HEADER([$1], [$2], [$3], [$4])
  4172. AC_LANG_RESTORE
  4173. CPPFLAGS=$kde_safe_cppflags
  4174. ])
  4175. AC_DEFUN([KDE_CHECK_HEADERS],
  4176. [
  4177. AH_CHECK_HEADERS([$1])
  4178. AC_LANG_SAVE
  4179. kde_safe_cppflags=$CPPFLAGS
  4180. CPPFLAGS="$CPPFLAGS $all_includes"
  4181. AC_LANG_CPLUSPLUS
  4182. AC_CHECK_HEADERS([$1], [$2], [$3], [$4])
  4183. CPPFLAGS=$kde_safe_cppflags
  4184. AC_LANG_RESTORE
  4185. ])
  4186. AC_DEFUN([KDE_FAST_CONFIGURE],
  4187. [
  4188. dnl makes configure fast (needs perl)
  4189. AC_ARG_ENABLE(fast-perl, AC_HELP_STRING([--disable-fast-perl],[disable fast Makefile generation (needs perl)]),
  4190. with_fast_perl=$enableval, with_fast_perl=yes)
  4191. ])
  4192. AC_DEFUN([KDE_CONF_FILES],
  4193. [
  4194. val=
  4195. if test -f $srcdir/configure.files ; then
  4196. val=`sed -e 's%^%\$(top_srcdir)/%' $srcdir/configure.files`
  4197. fi
  4198. CONF_FILES=
  4199. if test -n "$val" ; then
  4200. for i in $val ; do
  4201. CONF_FILES="$CONF_FILES $i"
  4202. done
  4203. fi
  4204. AC_SUBST(CONF_FILES)
  4205. ])dnl
  4206. dnl This sets the prefix, for arts and tdelibs
  4207. dnl Do NOT use in any other module.
  4208. dnl It only looks at --prefix, TDEDIR and falls back to /usr/local/kde
  4209. AC_DEFUN([KDE_SET_PREFIX_CORE],
  4210. [
  4211. unset CDPATH
  4212. dnl make $TDEDIR the default for the installation
  4213. AC_PREFIX_DEFAULT(${TDEDIR:-/usr/local/kde})
  4214. if test "x$prefix" = "xNONE"; then
  4215. prefix=$ac_default_prefix
  4216. ac_configure_args="$ac_configure_args --prefix=$prefix"
  4217. fi
  4218. # And delete superfluous '/' to make compares easier
  4219. prefix=`echo "$prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
  4220. exec_prefix=`echo "$exec_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
  4221. kde_libs_prefix='$(prefix)'
  4222. kde_libs_htmldir='$(kde_htmldir)'
  4223. AC_SUBST(kde_libs_prefix)
  4224. AC_SUBST(kde_libs_htmldir)
  4225. KDE_FAST_CONFIGURE
  4226. KDE_CONF_FILES
  4227. ])
  4228. AC_DEFUN([KDE_SET_PREFIX],
  4229. [
  4230. unset CDPATH
  4231. dnl We can't give real code to that macro, only a value.
  4232. dnl It only matters for --help, since we set the prefix in this function anyway.
  4233. AC_PREFIX_DEFAULT(${TDEDIR:-the kde prefix})
  4234. KDE_SET_DEFAULT_BINDIRS
  4235. if test "x$prefix" = "xNONE"; then
  4236. dnl no prefix given: look for tde-config in the PATH and deduce the prefix from it
  4237. KDE_FIND_PATH(tde-config, KDECONFIG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(tde-config)], [], prepend)
  4238. else
  4239. dnl prefix given: look for tde-config, preferrably in prefix, otherwise in PATH
  4240. kde_save_PATH="$PATH"
  4241. PATH="$exec_prefix/bin:$prefix/bin:$PATH"
  4242. KDE_FIND_PATH(tde-config, KDECONFIG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(tde-config)], [], prepend)
  4243. PATH="$kde_save_PATH"
  4244. fi
  4245. kde_libs_prefix=`$KDECONFIG --prefix`
  4246. if test -z "$kde_libs_prefix" || test ! -x "$kde_libs_prefix"; then
  4247. AC_MSG_ERROR([$KDECONFIG --prefix outputed the non existant prefix '$kde_libs_prefix' for tdelibs.
  4248. This means it has been moved since you installed it.
  4249. This won't work. Please recompile tdelibs for the new prefix.
  4250. ])
  4251. fi
  4252. kde_libs_htmldir=`$KDECONFIG --install html --expandvars`
  4253. kde_libs_suffix=`$KDECONFIG --libsuffix`
  4254. AC_MSG_CHECKING([where to install])
  4255. if test "x$prefix" = "xNONE"; then
  4256. prefix=$kde_libs_prefix
  4257. AC_MSG_RESULT([$prefix (as returned by tde-config)])
  4258. else
  4259. dnl --prefix was given. Compare prefixes and warn (in configure.in.bot.end) if different
  4260. given_prefix=$prefix
  4261. AC_MSG_RESULT([$prefix (as requested)])
  4262. fi
  4263. # And delete superfluous '/' to make compares easier
  4264. prefix=`echo "$prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
  4265. exec_prefix=`echo "$exec_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
  4266. given_prefix=`echo "$given_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
  4267. AC_SUBST(KDECONFIG)
  4268. AC_SUBST(kde_libs_prefix)
  4269. AC_SUBST(kde_libs_htmldir)
  4270. KDE_FAST_CONFIGURE
  4271. KDE_CONF_FILES
  4272. ])
  4273. pushdef([AC_PROG_INSTALL],
  4274. [
  4275. dnl our own version, testing for a -p flag
  4276. popdef([AC_PROG_INSTALL])
  4277. dnl as AC_PROG_INSTALL works as it works we first have
  4278. dnl to save if the user didn't specify INSTALL, as the
  4279. dnl autoconf one overwrites INSTALL and we have no chance to find
  4280. dnl out afterwards
  4281. test -n "$INSTALL" && kde_save_INSTALL_given=$INSTALL
  4282. test -n "$INSTALL_PROGRAM" && kde_save_INSTALL_PROGRAM_given=$INSTALL_PROGRAM
  4283. test -n "$INSTALL_SCRIPT" && kde_save_INSTALL_SCRIPT_given=$INSTALL_SCRIPT
  4284. AC_PROG_INSTALL
  4285. if test -z "$kde_save_INSTALL_given" ; then
  4286. # OK, user hasn't given any INSTALL, autoconf found one for us
  4287. # now we test, if it supports the -p flag
  4288. AC_MSG_CHECKING(for -p flag to install)
  4289. rm -f confinst.$$.* > /dev/null 2>&1
  4290. echo "Testtest" > confinst.$$.orig
  4291. ac_res=no
  4292. if ${INSTALL} -p confinst.$$.orig confinst.$$.new > /dev/null 2>&1 ; then
  4293. if test -f confinst.$$.new ; then
  4294. # OK, -p seems to do no harm to install
  4295. INSTALL="${INSTALL} -p"
  4296. ac_res=yes
  4297. fi
  4298. fi
  4299. rm -f confinst.$$.*
  4300. AC_MSG_RESULT($ac_res)
  4301. fi
  4302. dnl the following tries to resolve some signs and wonders coming up
  4303. dnl with different autoconf/automake versions
  4304. dnl e.g.:
  4305. dnl *automake 1.4 install-strip sets A_M_INSTALL_PROGRAM_FLAGS to -s
  4306. dnl and has INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(A_M_INSTALL_PROGRAM_FLAGS)
  4307. dnl it header-vars.am, so there the actual INSTALL_PROGRAM gets the -s
  4308. dnl *automake 1.4a (and above) use INSTALL_STRIP_FLAG and only has
  4309. dnl INSTALL_PROGRAM = @INSTALL_PROGRAM@ there, but changes the
  4310. dnl install-@DIR@PROGRAMS targets to explicitly use that flag
  4311. dnl *autoconf 2.13 is dumb, and thinks it can use INSTALL_PROGRAM as
  4312. dnl INSTALL_SCRIPT, which breaks with automake <= 1.4
  4313. dnl *autoconf >2.13 (since 10.Apr 1999) has not that failure
  4314. dnl *sometimes KDE does not use the install-@DIR@PROGRAM targets from
  4315. dnl automake (due to broken Makefile.am or whatever) to install programs,
  4316. dnl and so does not see the -s flag in automake > 1.4
  4317. dnl to clean up that mess we:
  4318. dnl +set INSTALL_PROGRAM to use INSTALL_STRIP_FLAG
  4319. dnl which cleans KDE's program with automake > 1.4;
  4320. dnl +set INSTALL_SCRIPT to only use INSTALL, to clean up autoconf's problems
  4321. dnl with automake<=1.4
  4322. dnl note that dues to this sometimes two '-s' flags are used (if KDE
  4323. dnl properly uses install-@DIR@PROGRAMS, but I don't care
  4324. dnl
  4325. dnl And to all this comes, that I even can't write in comments variable
  4326. dnl names used by automake, because it is so stupid to think I wanted to
  4327. dnl _use_ them, therefor I have written A_M_... instead of AM_
  4328. dnl hmm, I wanted to say something ... ahh yes: Arghhh.
  4329. if test -z "$kde_save_INSTALL_PROGRAM_given" ; then
  4330. INSTALL_PROGRAM='${INSTALL} $(INSTALL_STRIP_FLAG)'
  4331. fi
  4332. if test -z "$kde_save_INSTALL_SCRIPT_given" ; then
  4333. INSTALL_SCRIPT='${INSTALL}'
  4334. fi
  4335. ])dnl
  4336. AC_DEFUN([KDE_LANG_CPLUSPLUS],
  4337. [AC_LANG_CPLUSPLUS
  4338. ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&AC_FD_CC'
  4339. pushdef([AC_LANG_CPLUSPLUS], [popdef([AC_LANG_CPLUSPLUS]) KDE_LANG_CPLUSPLUS])
  4340. ])
  4341. pushdef([AC_LANG_CPLUSPLUS],
  4342. [popdef([AC_LANG_CPLUSPLUS])
  4343. KDE_LANG_CPLUSPLUS
  4344. ])
  4345. AC_DEFUN([KDE_CHECK_LONG_LONG],
  4346. [
  4347. AC_MSG_CHECKING(for long long)
  4348. AC_CACHE_VAL(kde_cv_c_long_long,
  4349. [
  4350. AC_LANG_SAVE
  4351. AC_LANG_CPLUSPLUS
  4352. AC_TRY_LINK([], [
  4353. long long foo = 0;
  4354. foo = foo+1;
  4355. ],
  4356. kde_cv_c_long_long=yes, kde_cv_c_long_long=no)
  4357. AC_LANG_RESTORE
  4358. ])
  4359. AC_MSG_RESULT($kde_cv_c_long_long)
  4360. if test "$kde_cv_c_long_long" = yes; then
  4361. AC_DEFINE(HAVE_LONG_LONG, 1, [Define if you have long long as datatype])
  4362. fi
  4363. ])
  4364. AC_DEFUN([KDE_CHECK_LIB],
  4365. [
  4366. kde_save_LDFLAGS="$LDFLAGS"
  4367. dnl AC_CHECK_LIB modifies LIBS, so save it here
  4368. kde_save_LIBS="$LIBS"
  4369. LDFLAGS="$LDFLAGS $all_libraries"
  4370. case $host_os in
  4371. aix*) LDFLAGS="-brtl $LDFLAGS"
  4372. test "$GCC" = yes && LDFLAGS="-Wl,$LDFLAGS"
  4373. ;;
  4374. esac
  4375. AC_CHECK_LIB($1, $2, $3, $4, $5)
  4376. LDFLAGS="$kde_save_LDFLAGS"
  4377. LIBS="$kde_save_LIBS"
  4378. ])
  4379. AC_DEFUN([KDE_JAVA_PREFIX],
  4380. [
  4381. dir=`dirname "$1"`
  4382. base=`basename "$1"`
  4383. list=`ls -1 $dir 2> /dev/null`
  4384. for entry in $list; do
  4385. if test -d $dir/$entry/bin; then
  4386. case $entry in
  4387. $base)
  4388. javadirs="$javadirs $dir/$entry/bin"
  4389. ;;
  4390. esac
  4391. elif test -d $dir/$entry/jre/bin; then
  4392. case $entry in
  4393. $base)
  4394. javadirs="$javadirs $dir/$entry/jre/bin"
  4395. ;;
  4396. esac
  4397. fi
  4398. done
  4399. ])
  4400. dnl KDE_CHEC_JAVA_DIR(onlyjre)
  4401. AC_DEFUN([KDE_CHECK_JAVA_DIR],
  4402. [
  4403. AC_ARG_WITH(java,
  4404. AC_HELP_STRING([--with-java=javadir],[use java installed in javadir, --without-java disables]),
  4405. [ ac_java_dir=$withval
  4406. ], ac_java_dir=""
  4407. )
  4408. AC_MSG_CHECKING([for Java])
  4409. dnl at this point ac_java_dir is either a dir, 'no' to disable, or '' to say look in $PATH
  4410. if test "x$ac_java_dir" = "xno"; then
  4411. kde_java_bindir=no
  4412. kde_java_includedir=no
  4413. kde_java_libjvmdir=no
  4414. kde_java_libgcjdir=no
  4415. kde_java_libhpidir=no
  4416. else
  4417. if test "x$ac_java_dir" = "x"; then
  4418. dnl No option set -> collect list of candidate paths
  4419. if test -n "$JAVA_HOME"; then
  4420. KDE_JAVA_PREFIX($JAVA_HOME)
  4421. fi
  4422. KDE_JAVA_PREFIX(/usr/j2se)
  4423. KDE_JAVA_PREFIX(/usr/lib/j2se)
  4424. KDE_JAVA_PREFIX(/usr/j*dk*)
  4425. KDE_JAVA_PREFIX(/usr/lib/j*dk*)
  4426. KDE_JAVA_PREFIX(/opt/j*sdk*)
  4427. KDE_JAVA_PREFIX(/usr/lib/java*)
  4428. KDE_JAVA_PREFIX(/usr/java*)
  4429. KDE_JAVA_PREFIX(/usr/java/j*dk*)
  4430. KDE_JAVA_PREFIX(/usr/java/j*re*)
  4431. KDE_JAVA_PREFIX(/usr/lib/SunJava2*)
  4432. KDE_JAVA_PREFIX(/usr/lib/SunJava*)
  4433. KDE_JAVA_PREFIX(/usr/lib/IBMJava2*)
  4434. KDE_JAVA_PREFIX(/usr/lib/IBMJava*)
  4435. KDE_JAVA_PREFIX(/opt/java*)
  4436. kde_cv_path="NONE"
  4437. kde_save_IFS=$IFS
  4438. IFS=':'
  4439. for dir in $PATH; do
  4440. if test -d "$dir"; then
  4441. javadirs="$javadirs $dir"
  4442. fi
  4443. done
  4444. IFS=$kde_save_IFS
  4445. jredirs=
  4446. dnl Now javadirs contains a list of paths that exist, all ending with bin/
  4447. for dir in $javadirs; do
  4448. dnl Check for the java executable
  4449. if test -x "$dir/java"; then
  4450. dnl And also check for a libjvm.so somewhere under there
  4451. dnl Since we have to go to the parent dir, /usr/bin is excluded, /usr is too big.
  4452. if test "$dir" != "/usr/bin"; then
  4453. libjvmdir=`find $dir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1`
  4454. if test ! -f $libjvmdir/libjvm.so; then continue; fi
  4455. jredirs="$jredirs $dir"
  4456. fi
  4457. fi
  4458. done
  4459. dnl Now jredirs contains a reduced list, of paths where both java and ../**/libjvm.so was found
  4460. JAVAC=
  4461. JAVA=
  4462. kde_java_bindir=no
  4463. for dir in $jredirs; do
  4464. JAVA="$dir/java"
  4465. kde_java_bindir=$dir
  4466. if test -x "$dir/javac"; then
  4467. JAVAC="$dir/javac"
  4468. break
  4469. fi
  4470. done
  4471. if test -n "$JAVAC"; then
  4472. dnl this substitution might not work - well, we test for jni.h below
  4473. kde_java_includedir=`echo $JAVAC | sed -e 's,bin/javac$,include/,'`
  4474. else
  4475. kde_java_includedir=no
  4476. fi
  4477. else
  4478. dnl config option set
  4479. kde_java_bindir=$ac_java_dir/bin
  4480. if test -x $ac_java_dir/bin/java && test ! -x $ac_java_dir/bin/javac; then
  4481. kde_java_includedir=no
  4482. else
  4483. kde_java_includedir=$ac_java_dir/include
  4484. fi
  4485. fi
  4486. fi
  4487. dnl At this point kde_java_bindir and kde_java_includedir are either set or "no"
  4488. if test "x$kde_java_bindir" != "xno"; then
  4489. dnl Look for libjvm.so
  4490. kde_java_libjvmdir=`find $kde_java_bindir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1`
  4491. dnl Look for libgcj.so
  4492. kde_java_libgcjdir=`find $kde_java_bindir/.. -name libgcj.so | sed 's,libgcj.so,,'|head -n 1`
  4493. dnl Look for libhpi.so and avoid green threads
  4494. kde_java_libhpidir=`find $kde_java_bindir/.. -name libhpi.so | grep -v green | sed 's,libhpi.so,,' | head -n 1`
  4495. dnl Now check everything's fine under there
  4496. dnl the include dir is our flag for having the JDK
  4497. if test -d "$kde_java_includedir"; then
  4498. if test ! -x "$kde_java_bindir/javac"; then
  4499. AC_MSG_ERROR([javac not found under $kde_java_bindir - it seems you passed a wrong --with-java.])
  4500. fi
  4501. if test ! -x "$kde_java_bindir/javah"; then
  4502. AC_MSG_ERROR([javah not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
  4503. fi
  4504. if test ! -x "$kde_java_bindir/jar"; then
  4505. AC_MSG_ERROR([jar not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
  4506. fi
  4507. if test ! -r "$kde_java_includedir/jni.h"; then
  4508. AC_MSG_ERROR([jni.h not found under $kde_java_includedir. Use --with-java or --without-java.])
  4509. fi
  4510. jni_includes="-I$kde_java_includedir"
  4511. dnl Strange thing, jni.h requires jni_md.h which is under genunix here..
  4512. dnl and under linux here..
  4513. dnl not needed for gcj
  4514. if test "x$kde_java_libgcjdir" = "x"; then
  4515. test -d "$kde_java_includedir/linux" && jni_includes="$jni_includes -I$kde_java_includedir/linux"
  4516. test -d "$kde_java_includedir/solaris" && jni_includes="$jni_includes -I$kde_java_includedir/solaris"
  4517. test -d "$kde_java_includedir/genunix" && jni_includes="$jni_includes -I$kde_java_includedir/genunix"
  4518. fi
  4519. else
  4520. JAVAC=
  4521. jni_includes=
  4522. fi
  4523. if test "x$kde_java_libgcjdir" = "x"; then
  4524. if test ! -r "$kde_java_libjvmdir/libjvm.so"; then
  4525. AC_MSG_ERROR([libjvm.so not found under $kde_java_libjvmdir. Use --without-java.])
  4526. fi
  4527. else
  4528. if test ! -r "$kde_java_libgcjdir/libgcj.so"; then
  4529. AC_MSG_ERROR([libgcj.so not found under $kde_java_libgcjdir. Use --without-java.])
  4530. fi
  4531. fi
  4532. if test ! -x "$kde_java_bindir/java"; then
  4533. AC_MSG_ERROR([java not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
  4534. fi
  4535. dnl not needed for gcj compile
  4536. if test "x$kde_java_libgcjdir" = "x"; then
  4537. if test ! -r "$kde_java_libhpidir/libhpi.so"; then
  4538. AC_MSG_ERROR([libhpi.so not found under $kde_java_libhpidir. Use --without-java.])
  4539. fi
  4540. fi
  4541. if test -n "$jni_includes"; then
  4542. dnl Check for JNI version
  4543. AC_LANG_SAVE
  4544. AC_LANG_CPLUSPLUS
  4545. ac_cxxflags_safe="$CXXFLAGS"
  4546. CXXFLAGS="$CXXFLAGS $all_includes $jni_includes"
  4547. AC_TRY_COMPILE([
  4548. #include <jni.h>
  4549. ],
  4550. [
  4551. #ifndef JNI_VERSION_1_2
  4552. Syntax Error
  4553. #endif
  4554. ],[ kde_jni_works=yes ],
  4555. [ kde_jni_works=no ])
  4556. if test $kde_jni_works = no; then
  4557. AC_MSG_ERROR([Incorrect version of $kde_java_includedir/jni.h.
  4558. You need to have Java Development Kit (JDK) version 1.2.
  4559. Use --with-java to specify another location.
  4560. Use --without-java to configure without java support.
  4561. Or download a newer JDK and try again.
  4562. See e.g. http://java.sun.com/products/jdk/1.2 ])
  4563. fi
  4564. CXXFLAGS="$ac_cxxflags_safe"
  4565. AC_LANG_RESTORE
  4566. dnl All tests ok, inform and subst the variables
  4567. JAVAC=$kde_java_bindir/javac
  4568. JAVAH=$kde_java_bindir/javah
  4569. JAR=$kde_java_bindir/jar
  4570. AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
  4571. if test "x$kde_java_libgcjdir" = "x"; then
  4572. JVMLIBS="-L$kde_java_libjvmdir -ljvm -L$kde_java_libhpidir -lhpi"
  4573. else
  4574. JVMLIBS="-L$kde_java_libgcjdir -lgcj"
  4575. fi
  4576. AC_MSG_RESULT([java JDK in $kde_java_bindir])
  4577. else
  4578. AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
  4579. AC_MSG_RESULT([java JRE in $kde_java_bindir])
  4580. fi
  4581. elif test -d "/Library/Java/Home"; then
  4582. kde_java_bindir="/Library/Java/Home/bin"
  4583. jni_includes="-I/Library/Java/Home/include"
  4584. JAVAC=$kde_java_bindir/javac
  4585. JAVAH=$kde_java_bindir/javah
  4586. JAR=$kde_java_bindir/jar
  4587. JVMLIBS="-Xlinker -framework -Xlinker JavaVM"
  4588. AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
  4589. AC_MSG_RESULT([Apple Java Framework])
  4590. else
  4591. AC_MSG_RESULT([none found])
  4592. fi
  4593. AC_SUBST(JAVAC)
  4594. AC_SUBST(JAVAH)
  4595. AC_SUBST(JAR)
  4596. AC_SUBST(JVMLIBS)
  4597. AC_SUBST(jni_includes)
  4598. # for backward compat
  4599. kde_cv_java_includedir=$kde_java_includedir
  4600. kde_cv_java_bindir=$kde_java_bindir
  4601. ])
  4602. dnl this is a redefinition of autoconf 2.5x's AC_FOREACH.
  4603. dnl When the argument list becomes big, as in KDE for AC_OUTPUT in
  4604. dnl big packages, m4_foreach is dog-slow. So use our own version of
  4605. dnl it. (matz@kde.org)
  4606. m4_define([mm_foreach],
  4607. [m4_pushdef([$1])_mm_foreach($@)m4_popdef([$1])])
  4608. m4_define([mm_car], [[$1]])
  4609. m4_define([mm_car2], [[$@]])
  4610. m4_define([_mm_foreach],
  4611. [m4_if(m4_quote($2), [], [],
  4612. [m4_define([$1], mm_car($2))$3[]_mm_foreach([$1],
  4613. mm_car2(m4_shift($2)),
  4614. [$3])])])
  4615. m4_define([AC_FOREACH],
  4616. [mm_foreach([$1], m4_split(m4_normalize([$2])), [$3])])
  4617. AC_DEFUN([KDE_NEED_FLEX],
  4618. [
  4619. kde_libs_safe=$LIBS
  4620. LIBS="$LIBS $USER_LDFLAGS"
  4621. AM_PROG_LEX
  4622. LIBS=$kde_libs_safe
  4623. if test -z "$LEXLIB"; then
  4624. AC_MSG_ERROR([You need to have flex installed.])
  4625. fi
  4626. AC_SUBST(LEXLIB)
  4627. ])
  4628. AC_DEFUN([AC_PATH_TQTOPIA],
  4629. [
  4630. dnl TODO: use AC_CACHE_VAL
  4631. if test -z "$1"; then
  4632. qtopia_minver_maj=1
  4633. qtopia_minver_min=5
  4634. qtopia_minver_pat=0
  4635. else
  4636. qtopia_minver_maj=`echo "$1" | sed -e "s/^\(.*\)\..*\..*$/\1/"`
  4637. qtopia_minver_min=`echo "$1" | sed -e "s/^.*\.\(.*\)\..*$/\1/"`
  4638. qtopia_minver_pat=`echo "$1" | sed -e "s/^.*\..*\.\(.*\)$/\1/"`
  4639. fi
  4640. qtopia_minver="$qtopia_minver_maj$qtopia_minver_min$qtopia_minver_pat"
  4641. qtopia_minverstr="$qtopia_minver_maj.$qtopia_minver_min.$qtopia_minver_pat"
  4642. AC_REQUIRE([AC_PATH_TQT])
  4643. AC_MSG_CHECKING([for Qtopia])
  4644. LIB_TQTOPIA="-lqpe"
  4645. AC_SUBST(LIB_TQTOPIA)
  4646. kde_qtopia_dirs="$QPEDIR /opt/Qtopia"
  4647. ac_qtopia_incdir=NO
  4648. AC_ARG_WITH(qtopia-dir,
  4649. AC_HELP_STRING([--with-qtopia-dir=DIR],[where the root of Qtopia is installed]),
  4650. [ ac_qtopia_incdir="$withval"/include] )
  4651. qtopia_incdirs=""
  4652. for dir in $kde_qtopia_dirs; do
  4653. qtopia_incdirs="$qtopia_incdirs $dir/include"
  4654. done
  4655. if test ! "$ac_qtopia_incdir" = "NO"; then
  4656. qtopia_incdirs="$ac_qtopia_incdir $qtopia_incdirs"
  4657. fi
  4658. qtopia_incdir=""
  4659. AC_FIND_FILE(qpe/qpeapplication.h, $qtopia_incdirs, qtopia_incdir)
  4660. ac_qtopia_incdir="$qtopia_incdir"
  4661. if test -z "$qtopia_incdir"; then
  4662. AC_MSG_ERROR([Cannot find Qtopia headers. Please check your installation.])
  4663. fi
  4664. qtopia_ver_maj=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION "\(.*\)\..*\..*".*,\1,p'`;
  4665. qtopia_ver_min=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION ".*\.\(.*\)\..*".*,\1,p'`;
  4666. qtopia_ver_pat=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION ".*\..*\.\(.*\)".*,\1,p'`;
  4667. qtopia_ver="$qtopia_ver_maj$qtopia_ver_min$qtopia_ver_pat"
  4668. qtopia_verstr="$qtopia_ver_maj.$qtopia_ver_min.$qtopia_ver_pat"
  4669. if test "$qtopia_ver" -lt "$qtopia_minver"; then
  4670. AC_MSG_ERROR([found Qtopia version $qtopia_verstr but version $qtopia_minverstr
  4671. is required.])
  4672. fi
  4673. AC_LANG_SAVE
  4674. AC_LANG_CPLUSPLUS
  4675. ac_cxxflags_safe="$CXXFLAGS"
  4676. ac_ldflags_safe="$LDFLAGS"
  4677. ac_libs_safe="$LIBS"
  4678. CXXFLAGS="$CXXFLAGS -I$qtopia_incdir $all_includes"
  4679. LDFLAGS="$LDFLAGS $QT_LDFLAGS $all_libraries $USER_LDFLAGS $KDE_MT_LDFLAGS"
  4680. LIBS="$LIBS $LIB_TQTOPIA $LIBQT"
  4681. cat > conftest.$ac_ext <<EOF
  4682. #include "confdefs.h"
  4683. #include <qpe/qpeapplication.h>
  4684. #include <qpe/version.h>
  4685. int main( int argc, char **argv )
  4686. {
  4687. QPEApplication app( argc, argv );
  4688. return 0;
  4689. }
  4690. EOF
  4691. if AC_TRY_EVAL(ac_link) && test -s conftest; then
  4692. rm -f conftest*
  4693. else
  4694. rm -f conftest*
  4695. AC_MSG_ERROR([Cannot link small Qtopia Application. For more details look at
  4696. the end of config.log])
  4697. fi
  4698. CXXFLAGS="$ac_cxxflags_safe"
  4699. LDFLAGS="$ac_ldflags_safe"
  4700. LIBS="$ac_libs_safe"
  4701. AC_LANG_RESTORE
  4702. QTOPIA_INCLUDES="-I$qtopia_incdir"
  4703. AC_SUBST(QTOPIA_INCLUDES)
  4704. AC_MSG_RESULT([found version $qtopia_verstr with headers at $qtopia_incdir])
  4705. ])
  4706. AC_DEFUN([KDE_INIT_DOXYGEN],
  4707. [
  4708. AC_MSG_CHECKING([for Qt docs])
  4709. kde_qtdir=
  4710. if test "${with_qt_dir+set}" = set; then
  4711. kde_qtdir="$with_qt_dir"
  4712. fi
  4713. AC_FIND_FILE(qsql.html, [ $kde_qtdir/doc/html $QTDIR/doc/html /usr/share/doc/packages/qt3/html /usr/lib/qt/doc /usr/lib/qt3/doc /usr/lib/qt3/doc/html /usr/doc/qt3/html /usr/doc/qt3 /usr/share/doc/qt3-doc /usr/share/qt3/doc/html /usr/X11R6/share/doc/qt/html ], QTDOCDIR)
  4714. AC_MSG_RESULT($QTDOCDIR)
  4715. AC_SUBST(QTDOCDIR)
  4716. KDE_FIND_PATH(dot, DOT, [], [])
  4717. if test -n "$DOT"; then
  4718. KDE_HAVE_DOT="YES"
  4719. else
  4720. KDE_HAVE_DOT="NO"
  4721. fi
  4722. AC_SUBST(KDE_HAVE_DOT)
  4723. KDE_FIND_PATH(doxygen, DOXYGEN, [], [])
  4724. AC_SUBST(DOXYGEN)
  4725. DOXYGEN_PROJECT_NAME="$1"
  4726. DOXYGEN_PROJECT_NUMBER="$2"
  4727. AC_SUBST(DOXYGEN_PROJECT_NAME)
  4728. AC_SUBST(DOXYGEN_PROJECT_NUMBER)
  4729. KDE_HAS_DOXYGEN=no
  4730. if test -n "$DOXYGEN" && test -x "$DOXYGEN" && test -f $QTDOCDIR/qsql.html; then
  4731. KDE_HAS_DOXYGEN=yes
  4732. fi
  4733. AC_SUBST(KDE_HAS_DOXYGEN)
  4734. ])
  4735. AC_DEFUN([AC_FIND_BZIP2],
  4736. [
  4737. AC_MSG_CHECKING([for bzDecompress in libbz2])
  4738. AC_CACHE_VAL(ac_cv_lib_bzip2,
  4739. [
  4740. AC_LANG_SAVE
  4741. AC_LANG_CPLUSPLUS
  4742. kde_save_LIBS="$LIBS"
  4743. LIBS="$all_libraries $USER_LDFLAGS -lbz2 $LIBSOCKET"
  4744. kde_save_CXXFLAGS="$CXXFLAGS"
  4745. CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
  4746. AC_TRY_LINK(dnl
  4747. [
  4748. #define BZ_NO_STDIO
  4749. #include<bzlib.h>
  4750. ],
  4751. [ bz_stream s; (void) bzDecompress(&s); ],
  4752. eval "ac_cv_lib_bzip2='-lbz2'",
  4753. eval "ac_cv_lib_bzip2=no")
  4754. LIBS="$kde_save_LIBS"
  4755. CXXFLAGS="$kde_save_CXXFLAGS"
  4756. AC_LANG_RESTORE
  4757. ])dnl
  4758. AC_MSG_RESULT($ac_cv_lib_bzip2)
  4759. if test ! "$ac_cv_lib_bzip2" = no; then
  4760. BZIP2DIR=bzip2
  4761. LIBBZ2="$ac_cv_lib_bzip2"
  4762. AC_SUBST(LIBBZ2)
  4763. else
  4764. cxx_shared_flag=
  4765. ld_shared_flag=
  4766. KDE_CHECK_COMPILER_FLAG(shared, [
  4767. ld_shared_flag="-shared"
  4768. ])
  4769. KDE_CHECK_COMPILER_FLAG(fPIC, [
  4770. cxx_shared_flag="-fPIC"
  4771. ])
  4772. AC_MSG_CHECKING([for BZ2_bzDecompress in (shared) libbz2])
  4773. AC_CACHE_VAL(ac_cv_lib_bzip2_prefix,
  4774. [
  4775. AC_LANG_SAVE
  4776. AC_LANG_CPLUSPLUS
  4777. kde_save_LIBS="$LIBS"
  4778. LIBS="$all_libraries $USER_LDFLAGS $ld_shared_flag -lbz2 $LIBSOCKET"
  4779. kde_save_CXXFLAGS="$CXXFLAGS"
  4780. CXXFLAGS="$CFLAGS $cxx_shared_flag $all_includes $USER_INCLUDES"
  4781. AC_TRY_LINK(dnl
  4782. [
  4783. #define BZ_NO_STDIO
  4784. #include<bzlib.h>
  4785. ],
  4786. [ bz_stream s; (void) BZ2_bzDecompress(&s); ],
  4787. eval "ac_cv_lib_bzip2_prefix='-lbz2'",
  4788. eval "ac_cv_lib_bzip2_prefix=no")
  4789. LIBS="$kde_save_LIBS"
  4790. CXXFLAGS="$kde_save_CXXFLAGS"
  4791. AC_LANG_RESTORE
  4792. ])dnl
  4793. AC_MSG_RESULT($ac_cv_lib_bzip2_prefix)
  4794. if test ! "$ac_cv_lib_bzip2_prefix" = no; then
  4795. BZIP2DIR=bzip2
  4796. LIBBZ2="$ac_cv_lib_bzip2_prefix"
  4797. AC_SUBST(LIBBZ2)
  4798. AC_DEFINE(NEED_BZ2_PREFIX, 1, [Define if the libbz2 functions need the BZ2_ prefix])
  4799. dnl else, we just ignore this
  4800. fi
  4801. fi
  4802. AM_CONDITIONAL(include_BZIP2, test -n "$BZIP2DIR")
  4803. ])
  4804. dnl ------------------------------------------------------------------------
  4805. dnl Try to find the SSL headers and libraries.
  4806. dnl $(SSL_LDFLAGS) will be -Lsslliblocation (if needed)
  4807. dnl and $(SSL_INCLUDES) will be -Isslhdrlocation (if needed)
  4808. dnl ------------------------------------------------------------------------
  4809. dnl
  4810. AC_DEFUN([KDE_CHECK_SSL],
  4811. [
  4812. LIBSSL="-lssl -lcrypto"
  4813. AC_REQUIRE([KDE_CHECK_LIB64])
  4814. ac_ssl_includes=NO ac_ssl_libraries=NO
  4815. ssl_libraries=""
  4816. ssl_includes=""
  4817. AC_ARG_WITH(ssl-dir,
  4818. AC_HELP_STRING([--with-ssl-dir=DIR],[where the root of OpenSSL is installed]),
  4819. [ ac_ssl_includes="$withval"/include
  4820. ac_ssl_libraries="$withval"/lib$tdelibsuff
  4821. ])
  4822. want_ssl=yes
  4823. AC_ARG_WITH(ssl,
  4824. AC_HELP_STRING([--without-ssl],[disable SSL checks]),
  4825. [want_ssl=$withval])
  4826. if test $want_ssl = yes; then
  4827. AC_MSG_CHECKING(for OpenSSL)
  4828. AC_CACHE_VAL(ac_cv_have_ssl,
  4829. [#try to guess OpenSSL locations
  4830. ssl_incdirs="/usr/include /usr/local/include /usr/ssl/include /usr/local/ssl/include $prefix/include $kde_extra_includes"
  4831. ssl_incdirs="$ac_ssl_includes $ssl_incdirs"
  4832. AC_FIND_FILE(openssl/ssl.h, $ssl_incdirs, ssl_incdir)
  4833. ac_ssl_includes="$ssl_incdir"
  4834. ssl_libdirs="/usr/lib$tdelibsuff /usr/local/lib$tdelibsuff /usr/ssl/lib$tdelibsuff /usr/local/ssl/lib$tdelibsuff $libdir $prefix/lib$tdelibsuff $exec_prefix/lib$tdelibsuff $kde_extra_libs"
  4835. if test ! "$ac_ssl_libraries" = "NO"; then
  4836. ssl_libdirs="$ac_ssl_libraries $ssl_libdirs"
  4837. fi
  4838. test=NONE
  4839. ssl_libdir=NONE
  4840. for dir in $ssl_libdirs; do
  4841. try="ls -1 $dir/libssl*"
  4842. if test=`eval $try 2> /dev/null`; then ssl_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
  4843. done
  4844. ac_ssl_libraries="$ssl_libdir"
  4845. ac_ldflags_safe="$LDFLAGS"
  4846. ac_libs_safe="$LIBS"
  4847. LDFLAGS="$LDFLAGS -L$ssl_libdir $all_libraries"
  4848. LIBS="$LIBS $LIBSSL -lRSAglue -lrsaref"
  4849. AC_TRY_LINK(,void RSAPrivateEncrypt(void);RSAPrivateEncrypt();,
  4850. ac_ssl_rsaref="yes"
  4851. ,
  4852. ac_ssl_rsaref="no"
  4853. )
  4854. LDFLAGS="$ac_ldflags_safe"
  4855. LIBS="$ac_libs_safe"
  4856. if test "$ac_ssl_includes" = NO || test "$ac_ssl_libraries" = NO; then
  4857. have_ssl=no
  4858. else
  4859. have_ssl=yes;
  4860. fi
  4861. ])
  4862. eval "$ac_cv_have_ssl"
  4863. AC_MSG_RESULT([libraries $ac_ssl_libraries, headers $ac_ssl_includes])
  4864. AC_MSG_CHECKING([whether OpenSSL uses rsaref])
  4865. AC_MSG_RESULT($ac_ssl_rsaref)
  4866. AC_MSG_CHECKING([for easter eggs])
  4867. AC_MSG_RESULT([none found])
  4868. else
  4869. have_ssl=no
  4870. fi
  4871. if test "$have_ssl" = yes; then
  4872. AC_MSG_CHECKING(for OpenSSL version)
  4873. dnl Check for SSL version
  4874. AC_CACHE_VAL(ac_cv_ssl_version,
  4875. [
  4876. cat >conftest.$ac_ext <<EOF
  4877. #include <openssl/opensslv.h>
  4878. #include <stdio.h>
  4879. int main() {
  4880. #ifndef OPENSSL_VERSION_NUMBER
  4881. printf("ssl_version=\\"error\\"\n");
  4882. #else
  4883. if (OPENSSL_VERSION_NUMBER < 0x00906000)
  4884. printf("ssl_version=\\"old\\"\n");
  4885. else
  4886. printf("ssl_version=\\"ok\\"\n");
  4887. #endif
  4888. return (0);
  4889. }
  4890. EOF
  4891. ac_save_CPPFLAGS=$CPPFLAGS
  4892. if test "$ac_ssl_includes" != "/usr/include"; then
  4893. CPPFLAGS="$CPPFLAGS -I$ac_ssl_includes"
  4894. fi
  4895. if AC_TRY_EVAL(ac_link); then
  4896. if eval `./conftest 2>&5`; then
  4897. if test $ssl_version = error; then
  4898. AC_MSG_ERROR([$ssl_incdir/openssl/opensslv.h doesn't define OPENSSL_VERSION_NUMBER !])
  4899. else
  4900. if test $ssl_version = old; then
  4901. AC_MSG_WARN([OpenSSL version too old. Upgrade to 0.9.6 at least, see http://www.openssl.org. SSL support disabled.])
  4902. have_ssl=no
  4903. fi
  4904. fi
  4905. ac_cv_ssl_version="ssl_version=$ssl_version"
  4906. else
  4907. AC_MSG_ERROR([Your system couldn't run a small SSL test program.
  4908. Check config.log, and if you can't figure it out, send a mail to
  4909. David Faure <faure@kde.org>, attaching your config.log])
  4910. fi
  4911. else
  4912. AC_MSG_ERROR([Your system couldn't link a small SSL test program.
  4913. Check config.log, and if you can't figure it out, send a mail to
  4914. David Faure <faure@kde.org>, attaching your config.log])
  4915. fi
  4916. CPPFLAGS=$ac_save_CPPFLAGS
  4917. ])
  4918. eval "$ac_cv_ssl_version"
  4919. AC_MSG_RESULT($ssl_version)
  4920. fi
  4921. if test "$have_ssl" != yes; then
  4922. LIBSSL="";
  4923. else
  4924. AC_DEFINE(HAVE_SSL, 1, [If we are going to use OpenSSL])
  4925. ac_cv_have_ssl="have_ssl=yes \
  4926. ac_ssl_includes=$ac_ssl_includes ac_ssl_libraries=$ac_ssl_libraries ac_ssl_rsaref=$ac_ssl_rsaref"
  4927. ssl_libraries="$ac_ssl_libraries"
  4928. ssl_includes="$ac_ssl_includes"
  4929. if test "$ac_ssl_rsaref" = yes; then
  4930. LIBSSL="-lssl -lcrypto -lRSAglue -lrsaref"
  4931. fi
  4932. if test $ssl_version = "old"; then
  4933. AC_DEFINE(HAVE_OLD_SSL_API, 1, [Define if you have OpenSSL < 0.9.6])
  4934. fi
  4935. fi
  4936. SSL_INCLUDES=
  4937. if test "$ssl_includes" = "/usr/include"; then
  4938. if test -f /usr/kerberos/include/krb5.h; then
  4939. SSL_INCLUDES="-I/usr/kerberos/include"
  4940. fi
  4941. elif test "$ssl_includes" != "/usr/local/include" && test -n "$ssl_includes"; then
  4942. SSL_INCLUDES="-I$ssl_includes"
  4943. fi
  4944. if test "$ssl_libraries" = "/usr/lib" || test "$ssl_libraries" = "/usr/local/lib" || test -z "$ssl_libraries" || test "$ssl_libraries" = "NONE"; then
  4945. SSL_LDFLAGS=""
  4946. else
  4947. SSL_LDFLAGS="-L$ssl_libraries -R$ssl_libraries"
  4948. fi
  4949. AC_SUBST(SSL_INCLUDES)
  4950. AC_SUBST(SSL_LDFLAGS)
  4951. AC_SUBST(LIBSSL)
  4952. ])
  4953. AC_DEFUN([KDE_CHECK_STRLCPY],
  4954. [
  4955. AC_REQUIRE([AC_CHECK_STRLCAT])
  4956. AC_REQUIRE([AC_CHECK_STRLCPY])
  4957. AC_CHECK_SIZEOF(size_t)
  4958. AC_CHECK_SIZEOF(unsigned long)
  4959. AC_MSG_CHECKING([sizeof size_t == sizeof unsigned long])
  4960. AC_TRY_COMPILE(,[
  4961. #if SIZEOF_SIZE_T != SIZEOF_UNSIGNED_LONG
  4962. choke me
  4963. #endif
  4964. ],AC_MSG_RESULT([yes]),[
  4965. AC_MSG_RESULT(no)
  4966. AC_MSG_ERROR([
  4967. Apparently on your system our assumption sizeof size_t == sizeof unsigned long
  4968. does not apply. Please mail kde-devel@kde.org with a description of your system!
  4969. ])
  4970. ])
  4971. ])
  4972. AC_DEFUN([KDE_CHECK_BINUTILS],
  4973. [
  4974. AC_MSG_CHECKING([if ld supports unversioned version maps])
  4975. kde_save_LDFLAGS="$LDFLAGS"
  4976. LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map"
  4977. echo "{ local: extern \"C++\" { foo }; };" > conftest.map
  4978. AC_TRY_LINK([int foo;],
  4979. [
  4980. #ifdef __INTEL_COMPILER
  4981. icc apparently does not support libtools version-info and version-script
  4982. at the same time. Dunno where the bug is, but until somebody figured out,
  4983. better disable the optional version scripts.
  4984. #endif
  4985. foo = 42;
  4986. ], kde_supports_versionmaps=yes, kde_supports_versionmaps=no)
  4987. LDFLAGS="$kde_save_LDFLAGS"
  4988. rm -f conftest.map
  4989. AM_CONDITIONAL(include_VERSION_SCRIPT,
  4990. [test "$kde_supports_versionmaps" = "yes" && test "$kde_use_debug_code" = "no"])
  4991. AC_MSG_RESULT($kde_supports_versionmaps)
  4992. ])
  4993. AC_DEFUN([AM_PROG_OBJC],[
  4994. AC_CHECK_PROGS(OBJC, gcc, gcc)
  4995. test -z "$OBJC" && AC_MSG_ERROR([no acceptable objective-c gcc found in \$PATH])
  4996. if test "x${OBJCFLAGS-unset}" = xunset; then
  4997. OBJCFLAGS="-g -O2"
  4998. fi
  4999. AC_SUBST(OBJCFLAGS)
  5000. _AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES(OBJC)])
  5001. ])
  5002. AC_DEFUN([KDE_CHECK_PERL],
  5003. [
  5004. KDE_FIND_PATH(perl, PERL, [$bindir $exec_prefix/bin $prefix/bin], [
  5005. AC_MSG_ERROR([No Perl found in your $PATH.
  5006. We need perl to generate some code.])
  5007. ])
  5008. AC_SUBST(PERL)
  5009. ])
  5010. AC_DEFUN([KDE_CHECK_LARGEFILE],
  5011. [
  5012. AC_SYS_LARGEFILE
  5013. if test "$ac_cv_sys_file_offset_bits" != no; then
  5014. CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
  5015. fi
  5016. if test "x$ac_cv_sys_large_files" != "xno"; then
  5017. CPPFLAGS="$CPPFLAGS -D_LARGE_FILES=1"
  5018. fi
  5019. ])
  5020. dnl A small extension to PKG_CHECK_MODULES (defined in pkg.m4.in)
  5021. dnl which allows to search for libs that get installed into the KDE prefix.
  5022. dnl
  5023. dnl Syntax: KDE_PKG_CHECK_MODULES(KSTUFF, libkexif >= 0.2 glib = 1.3.4, action-if, action-not)
  5024. dnl defines KSTUFF_LIBS, KSTUFF_CFLAGS, see pkg-config man page
  5025. dnl also defines KSTUFF_PKG_ERRORS on error
  5026. AC_DEFUN([KDE_PKG_CHECK_MODULES], [
  5027. PKG_CONFIG_PATH="$prefix/lib/pkgconfig:$PKG_CONFIG_PATH"
  5028. if test "$prefix" != "$kde_libs_prefix"; then
  5029. PKG_CONFIG_PATH="$kde_libs_prefix/lib/pkgconfig:$PKG_CONFIG_PATH"
  5030. fi
  5031. export PKG_CONFIG_PATH
  5032. PKG_CHECK_MODULES($1,$2,$3,$4)
  5033. ])
  5034. # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
  5035. ## Copyright 1996, 1997, 1998, 1999, 2000, 2001
  5036. ## Free Software Foundation, Inc.
  5037. ## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
  5038. ##
  5039. ## This program is free software; you can redistribute it and/or modify
  5040. ## it under the terms of the GNU General Public License as published by
  5041. ## the Free Software Foundation; either version 2 of the License, or
  5042. ## (at your option) any later version.
  5043. ##
  5044. ## This program is distributed in the hope that it will be useful, but
  5045. ## WITHOUT ANY WARRANTY; without even the implied warranty of
  5046. ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  5047. ## General Public License for more details.
  5048. ##
  5049. ## You should have received a copy of the GNU General Public License
  5050. ## along with this program; if not, write to the Free Software
  5051. ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  5052. ##
  5053. ## As a special exception to the GNU General Public License, if you
  5054. ## distribute this file as part of a program that contains a
  5055. ## configuration script generated by Autoconf, you may include it under
  5056. ## the same distribution terms that you use for the rest of that program.
  5057. # serial 47 AC_PROG_LIBTOOL
  5058. # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
  5059. # -----------------------------------------------------------
  5060. # If this macro is not defined by Autoconf, define it here.
  5061. m4_ifdef([AC_PROVIDE_IFELSE],
  5062. [],
  5063. [m4_define([AC_PROVIDE_IFELSE],
  5064. [m4_ifdef([AC_PROVIDE_$1],
  5065. [$2], [$3])])])
  5066. # AC_PROG_LIBTOOL
  5067. # ---------------
  5068. AC_DEFUN([AC_PROG_LIBTOOL],
  5069. [AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
  5070. dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
  5071. dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
  5072. AC_PROVIDE_IFELSE([AC_PROG_CXX],
  5073. [AC_LIBTOOL_CXX],
  5074. [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
  5075. ])])
  5076. dnl And a similar setup for Fortran 77 support
  5077. AC_PROVIDE_IFELSE([AC_PROG_F77],
  5078. [AC_LIBTOOL_F77],
  5079. [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
  5080. ])])
  5081. dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
  5082. dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
  5083. dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
  5084. AC_PROVIDE_IFELSE([AC_PROG_GCJ],
  5085. [AC_LIBTOOL_GCJ],
  5086. [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
  5087. [AC_LIBTOOL_GCJ],
  5088. [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
  5089. [AC_LIBTOOL_GCJ],
  5090. [ifdef([AC_PROG_GCJ],
  5091. [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])
  5092. ifdef([A][M_PROG_GCJ],
  5093. [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])
  5094. ifdef([LT_AC_PROG_GCJ],
  5095. [define([LT_AC_PROG_GCJ],
  5096. defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
  5097. ])])# AC_PROG_LIBTOOL
  5098. # _AC_PROG_LIBTOOL
  5099. # ----------------
  5100. AC_DEFUN([_AC_PROG_LIBTOOL],
  5101. [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
  5102. AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
  5103. AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl
  5104. AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
  5105. # This can be used to rebuild libtool when needed
  5106. LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
  5107. # Always use our own libtool.
  5108. LIBTOOL='$(SHELL) $(top_builddir)/libtool --silent'
  5109. AC_SUBST(LIBTOOL)dnl
  5110. # Prevent multiple expansion
  5111. define([AC_PROG_LIBTOOL], [])
  5112. ])# _AC_PROG_LIBTOOL
  5113. # AC_LIBTOOL_SETUP
  5114. # ----------------
  5115. AC_DEFUN([AC_LIBTOOL_SETUP],
  5116. [AC_PREREQ(2.50)dnl
  5117. AC_REQUIRE([AC_ENABLE_SHARED])dnl
  5118. AC_REQUIRE([AC_ENABLE_STATIC])dnl
  5119. AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
  5120. AC_REQUIRE([AC_CANONICAL_HOST])dnl
  5121. AC_REQUIRE([AC_CANONICAL_BUILD])dnl
  5122. AC_REQUIRE([AC_PROG_CC])dnl
  5123. AC_REQUIRE([AC_PROG_LD])dnl
  5124. AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
  5125. AC_REQUIRE([AC_PROG_NM])dnl
  5126. AC_REQUIRE([AC_PROG_LN_S])dnl
  5127. AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
  5128. # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
  5129. AC_REQUIRE([AC_OBJEXT])dnl
  5130. AC_REQUIRE([AC_EXEEXT])dnl
  5131. dnl
  5132. AC_LIBTOOL_SYS_MAX_CMD_LEN
  5133. AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
  5134. AC_LIBTOOL_OBJDIR
  5135. AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
  5136. _LT_AC_PROG_ECHO_BACKSLASH
  5137. case $host_os in
  5138. aix3*)
  5139. # AIX sometimes has problems with the GCC collect2 program. For some
  5140. # reason, if we set the COLLECT_NAMES environment variable, the problems
  5141. # vanish in a puff of smoke.
  5142. if test "X${COLLECT_NAMES+set}" != Xset; then
  5143. COLLECT_NAMES=
  5144. export COLLECT_NAMES
  5145. fi
  5146. ;;
  5147. esac
  5148. # Sed substitution that helps us do robust quoting. It backslashifies
  5149. # metacharacters that are still active within double-quoted strings.
  5150. Xsed='sed -e s/^X//'
  5151. [sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
  5152. # Same as above, but do not quote variable references.
  5153. [double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g']
  5154. # Sed substitution to delay expansion of an escaped shell variable in a
  5155. # double_quote_subst'ed string.
  5156. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
  5157. # Sed substitution to avoid accidental globbing in evaled expressions
  5158. no_glob_subst='s/\*/\\\*/g'
  5159. # Constants:
  5160. rm="rm -f"
  5161. # Global variables:
  5162. default_ofile=libtool
  5163. can_build_shared=yes
  5164. # All known linkers require a `.a' archive for static linking (except M$VC,
  5165. # which needs '.lib').
  5166. libext=a
  5167. ltmain="$ac_aux_dir/ltmain.sh"
  5168. ofile="$default_ofile"
  5169. with_gnu_ld="$lt_cv_prog_gnu_ld"
  5170. AC_CHECK_TOOL(AR, ar, false)
  5171. AC_CHECK_TOOL(RANLIB, ranlib, :)
  5172. AC_CHECK_TOOL(STRIP, strip, :)
  5173. old_CC="$CC"
  5174. old_CFLAGS="$CFLAGS"
  5175. # Set sane defaults for various variables
  5176. test -z "$AR" && AR=ar
  5177. test -z "$AR_FLAGS" && AR_FLAGS=cru
  5178. test -z "$AS" && AS=as
  5179. test -z "$CC" && CC=cc
  5180. test -z "$LTCC" && LTCC=$CC
  5181. test -z "$DLLTOOL" && DLLTOOL=dlltool
  5182. test -z "$LD" && LD=ld
  5183. test -z "$LN_S" && LN_S="ln -s"
  5184. test -z "$MAGIC_CMD" && MAGIC_CMD=file
  5185. test -z "$NM" && NM=nm
  5186. test -z "$SED" && SED=sed
  5187. test -z "$OBJDUMP" && OBJDUMP=objdump
  5188. test -z "$RANLIB" && RANLIB=:
  5189. test -z "$STRIP" && STRIP=:
  5190. test -z "$ac_objext" && ac_objext=o
  5191. # Determine commands to create old-style static archives.
  5192. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
  5193. old_postinstall_cmds='chmod 644 $oldlib'
  5194. old_postuninstall_cmds=
  5195. if test -n "$RANLIB"; then
  5196. case $host_os in
  5197. openbsd*)
  5198. old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
  5199. ;;
  5200. *)
  5201. old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
  5202. ;;
  5203. esac
  5204. old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
  5205. fi
  5206. # Only perform the check for file, if the check method requires it
  5207. case $deplibs_check_method in
  5208. file_magic*)
  5209. if test "$file_magic_cmd" = '$MAGIC_CMD'; then
  5210. AC_PATH_MAGIC
  5211. fi
  5212. ;;
  5213. esac
  5214. AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
  5215. AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
  5216. enable_win32_dll=yes, enable_win32_dll=no)
  5217. AC_ARG_ENABLE([libtool-lock],
  5218. [AC_HELP_STRING([--disable-libtool-lock],
  5219. [avoid locking (might break parallel builds)])])
  5220. test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
  5221. AC_ARG_WITH([pic],
  5222. [AC_HELP_STRING([--with-pic],
  5223. [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
  5224. [pic_mode="$withval"],
  5225. [pic_mode=default])
  5226. test -z "$pic_mode" && pic_mode=default
  5227. # Use C for the default configuration in the libtool script
  5228. tagname=
  5229. AC_LIBTOOL_LANG_C_CONFIG
  5230. _LT_AC_TAGCONFIG
  5231. ])# AC_LIBTOOL_SETUP
  5232. # _LT_AC_SYS_COMPILER
  5233. # -------------------
  5234. AC_DEFUN([_LT_AC_SYS_COMPILER],
  5235. [AC_REQUIRE([AC_PROG_CC])dnl
  5236. # If no C compiler was specified, use CC.
  5237. LTCC=${LTCC-"$CC"}
  5238. # Allow CC to be a program name with arguments.
  5239. compiler=$CC
  5240. ])# _LT_AC_SYS_COMPILER
  5241. # _LT_AC_SYS_LIBPATH_AIX
  5242. # ----------------------
  5243. # Links a minimal program and checks the executable
  5244. # for the system default hardcoded library path. In most cases,
  5245. # this is /usr/lib:/lib, but when the MPI compilers are used
  5246. # the location of the communication and MPI libs are included too.
  5247. # If we don't find anything, use the default library path according
  5248. # to the aix ld manual.
  5249. AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
  5250. [AC_LINK_IFELSE(AC_LANG_PROGRAM,[
  5251. aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
  5252. }'`
  5253. # Check for a 64-bit object if we didn't find anything.
  5254. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
  5255. }'`; fi],[])
  5256. if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
  5257. ])# _LT_AC_SYS_LIBPATH_AIX
  5258. # _LT_AC_SHELL_INIT(ARG)
  5259. # ----------------------
  5260. AC_DEFUN([_LT_AC_SHELL_INIT],
  5261. [ifdef([AC_DIVERSION_NOTICE],
  5262. [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
  5263. [AC_DIVERT_PUSH(NOTICE)])
  5264. $1
  5265. AC_DIVERT_POP
  5266. ])# _LT_AC_SHELL_INIT
  5267. # _LT_AC_PROG_ECHO_BACKSLASH
  5268. # --------------------------
  5269. # Add some code to the start of the generated configure script which
  5270. # will find an echo command which doesn't interpret backslashes.
  5271. AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
  5272. [_LT_AC_SHELL_INIT([
  5273. # Check that we are running under the correct shell.
  5274. SHELL=${CONFIG_SHELL-/bin/sh}
  5275. case X$ECHO in
  5276. X*--fallback-echo)
  5277. # Remove one level of quotation (which was required for Make).
  5278. ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
  5279. ;;
  5280. esac
  5281. echo=${ECHO-echo}
  5282. if test "X[$]1" = X--no-reexec; then
  5283. # Discard the --no-reexec flag, and continue.
  5284. shift
  5285. elif test "X[$]1" = X--fallback-echo; then
  5286. # Avoid inline document here, it may be left over
  5287. :
  5288. elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
  5289. # Yippee, $echo works!
  5290. :
  5291. else
  5292. # Restart under the correct shell.
  5293. exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
  5294. fi
  5295. if test "X[$]1" = X--fallback-echo; then
  5296. # used as fallback echo
  5297. shift
  5298. cat <<EOF
  5299. [$]*
  5300. EOF
  5301. exit 0
  5302. fi
  5303. # The HP-UX ksh and POSIX shell print the target directory to stdout
  5304. # if CDPATH is set.
  5305. if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
  5306. if test -z "$ECHO"; then
  5307. if test "X${echo_test_string+set}" != Xset; then
  5308. # find a string as large as possible, as long as the shell can cope with it
  5309. for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
  5310. # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
  5311. if (echo_test_string="`eval $cmd`") 2>/dev/null &&
  5312. echo_test_string="`eval $cmd`" &&
  5313. (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
  5314. then
  5315. break
  5316. fi
  5317. done
  5318. fi
  5319. if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
  5320. echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
  5321. test "X$echo_testing_string" = "X$echo_test_string"; then
  5322. :
  5323. else
  5324. # The Solaris, AIX, and Digital Unix default echo programs unquote
  5325. # backslashes. This makes it impossible to quote backslashes using
  5326. # echo "$something" | sed 's/\\/\\\\/g'
  5327. #
  5328. # So, first we look for a working echo in the user's PATH.
  5329. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
  5330. for dir in $PATH /usr/ucb; do
  5331. IFS="$lt_save_ifs"
  5332. if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
  5333. test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
  5334. echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
  5335. test "X$echo_testing_string" = "X$echo_test_string"; then
  5336. echo="$dir/echo"
  5337. break
  5338. fi
  5339. done
  5340. IFS="$lt_save_ifs"
  5341. if test "X$echo" = Xecho; then
  5342. # We didn't find a better echo, so look for alternatives.
  5343. if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
  5344. echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
  5345. test "X$echo_testing_string" = "X$echo_test_string"; then
  5346. # This shell has a builtin print -r that does the trick.
  5347. echo='print -r'
  5348. elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
  5349. test "X$CONFIG_SHELL" != X/bin/ksh; then
  5350. # If we have ksh, try running configure again with it.
  5351. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
  5352. export ORIGINAL_CONFIG_SHELL
  5353. CONFIG_SHELL=/bin/ksh
  5354. export CONFIG_SHELL
  5355. exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
  5356. else
  5357. # Try using printf.
  5358. echo='printf %s\n'
  5359. if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
  5360. echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
  5361. test "X$echo_testing_string" = "X$echo_test_string"; then
  5362. # Cool, printf works
  5363. :
  5364. elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
  5365. test "X$echo_testing_string" = 'X\t' &&
  5366. echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
  5367. test "X$echo_testing_string" = "X$echo_test_string"; then
  5368. CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
  5369. export CONFIG_SHELL
  5370. SHELL="$CONFIG_SHELL"
  5371. export SHELL
  5372. echo="$CONFIG_SHELL [$]0 --fallback-echo"
  5373. elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
  5374. test "X$echo_testing_string" = 'X\t' &&
  5375. echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
  5376. test "X$echo_testing_string" = "X$echo_test_string"; then
  5377. echo="$CONFIG_SHELL [$]0 --fallback-echo"
  5378. else
  5379. # maybe with a smaller string...
  5380. prev=:
  5381. for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
  5382. if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
  5383. then
  5384. break
  5385. fi
  5386. prev="$cmd"
  5387. done
  5388. if test "$prev" != 'sed 50q "[$]0"'; then
  5389. echo_test_string=`eval $prev`
  5390. export echo_test_string
  5391. exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
  5392. else
  5393. # Oops. We lost completely, so just stick with echo.
  5394. echo=echo
  5395. fi
  5396. fi
  5397. fi
  5398. fi
  5399. fi
  5400. fi
  5401. # Copy echo and quote the copy suitably for passing to libtool from
  5402. # the Makefile, instead of quoting the original, which is used later.
  5403. ECHO=$echo
  5404. if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
  5405. ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
  5406. fi
  5407. AC_SUBST(ECHO)
  5408. ])])# _LT_AC_PROG_ECHO_BACKSLASH
  5409. # _LT_AC_LOCK
  5410. # -----------
  5411. AC_DEFUN([_LT_AC_LOCK],
  5412. [AC_ARG_ENABLE([libtool-lock],
  5413. [AC_HELP_STRING([--disable-libtool-lock],
  5414. [avoid locking (might break parallel builds)])])
  5415. test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
  5416. # Some flags need to be propagated to the compiler or linker for good
  5417. # libtool support.
  5418. case $host in
  5419. ia64-*-hpux*)
  5420. # Find out which ABI we are using.
  5421. echo 'int i;' > conftest.$ac_ext
  5422. if AC_TRY_EVAL(ac_compile); then
  5423. case `/usr/bin/file conftest.$ac_objext` in
  5424. *ELF-32*)
  5425. HPUX_IA64_MODE="32"
  5426. ;;
  5427. *ELF-64*)
  5428. HPUX_IA64_MODE="64"
  5429. ;;
  5430. esac
  5431. fi
  5432. rm -rf conftest*
  5433. ;;
  5434. *-*-irix6*)
  5435. # Find out which ABI we are using.
  5436. echo '[#]line __oline__ "configure"' > conftest.$ac_ext
  5437. if AC_TRY_EVAL(ac_compile); then
  5438. if test "$lt_cv_prog_gnu_ld" = yes; then
  5439. case `/usr/bin/file conftest.$ac_objext` in
  5440. *32-bit*)
  5441. LD="${LD-ld} -melf32bsmip"
  5442. ;;
  5443. *N32*)
  5444. LD="${LD-ld} -melf32bmipn32"
  5445. ;;
  5446. *64-bit*)
  5447. LD="${LD-ld} -melf64bmip"
  5448. ;;
  5449. esac
  5450. else
  5451. case `/usr/bin/file conftest.$ac_objext` in
  5452. *32-bit*)
  5453. LD="${LD-ld} -32"
  5454. ;;
  5455. *N32*)
  5456. LD="${LD-ld} -n32"
  5457. ;;
  5458. *64-bit*)
  5459. LD="${LD-ld} -64"
  5460. ;;
  5461. esac
  5462. fi
  5463. fi
  5464. rm -rf conftest*
  5465. ;;
  5466. x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
  5467. # Find out which ABI we are using.
  5468. echo 'int i;' > conftest.$ac_ext
  5469. if AC_TRY_EVAL(ac_compile); then
  5470. case "`/usr/bin/file conftest.o`" in
  5471. *32-bit*)
  5472. LINUX_64_MODE="32"
  5473. case $host in
  5474. x86_64-*linux*)
  5475. LD="${LD-ld} -m elf_i386"
  5476. ;;
  5477. ppc64-*linux*)
  5478. LD="${LD-ld} -m elf32ppclinux"
  5479. ;;
  5480. s390x-*linux*)
  5481. LD="${LD-ld} -m elf_s390"
  5482. ;;
  5483. sparc64-*linux*)
  5484. LD="${LD-ld} -m elf32_sparc"
  5485. ;;
  5486. esac
  5487. ;;
  5488. *64-bit*)
  5489. LINUX_64_MODE="64"
  5490. case $host in
  5491. x86_64-*linux*)
  5492. LD="${LD-ld} -m elf_x86_64"
  5493. ;;
  5494. ppc*-*linux*|powerpc*-*linux*)
  5495. LD="${LD-ld} -m elf64ppc"
  5496. ;;
  5497. s390*-*linux*)
  5498. LD="${LD-ld} -m elf64_s390"
  5499. ;;
  5500. sparc*-*linux*)
  5501. LD="${LD-ld} -m elf64_sparc"
  5502. ;;
  5503. esac
  5504. ;;
  5505. esac
  5506. fi
  5507. rm -rf conftest*
  5508. ;;
  5509. *-*-sco3.2v5*)
  5510. # On SCO OpenServer 5, we need -belf to get full-featured binaries.
  5511. SAVE_CFLAGS="$CFLAGS"
  5512. CFLAGS="$CFLAGS -belf"
  5513. AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
  5514. [AC_LANG_PUSH(C)
  5515. AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
  5516. AC_LANG_POP])
  5517. if test x"$lt_cv_cc_needs_belf" != x"yes"; then
  5518. # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
  5519. CFLAGS="$SAVE_CFLAGS"
  5520. fi
  5521. ;;
  5522. AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
  5523. [*-*-cygwin* | *-*-mingw* | *-*-pw32*)
  5524. AC_CHECK_TOOL(DLLTOOL, dlltool, false)
  5525. AC_CHECK_TOOL(AS, as, false)
  5526. AC_CHECK_TOOL(OBJDUMP, objdump, false)
  5527. ;;
  5528. ])
  5529. esac
  5530. need_locks="$enable_libtool_lock"
  5531. ])# _LT_AC_LOCK
  5532. # AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
  5533. # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
  5534. # ----------------------------------------------------------------
  5535. # Check whether the given compiler option works
  5536. AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
  5537. [AC_REQUIRE([LT_AC_PROG_SED])
  5538. AC_CACHE_CHECK([$1], [$2],
  5539. [$2=no
  5540. ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
  5541. printf "$lt_simple_compile_test_code" > conftest.$ac_ext
  5542. lt_compiler_flag="$3"
  5543. # Insert the option either (1) after the last *FLAGS variable, or
  5544. # (2) before a word containing "conftest.", or (3) at the end.
  5545. # Note that $ac_compile itself does not contain backslashes and begins
  5546. # with a dollar sign (not a hyphen), so the echo should work correctly.
  5547. # The option is referenced via a variable to avoid confusing sed.
  5548. lt_compile=`echo "$ac_compile" | $SED \
  5549. -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
  5550. -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
  5551. -e 's:$: $lt_compiler_flag:'`
  5552. (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
  5553. (eval "$lt_compile" 2>conftest.err)
  5554. ac_status=$?
  5555. cat conftest.err >&AS_MESSAGE_LOG_FD
  5556. echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
  5557. if (exit $ac_status) && test -s "$ac_outfile"; then
  5558. # The compiler can only warn and ignore the option if not recognized
  5559. # So say no if there are warnings
  5560. if test ! -s conftest.err; then
  5561. $2=yes
  5562. fi
  5563. fi
  5564. $rm conftest*
  5565. ])
  5566. if test x"[$]$2" = xyes; then
  5567. ifelse([$5], , :, [$5])
  5568. else
  5569. ifelse([$6], , :, [$6])
  5570. fi
  5571. ])# AC_LIBTOOL_COMPILER_OPTION
  5572. # AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
  5573. # [ACTION-SUCCESS], [ACTION-FAILURE])
  5574. # ------------------------------------------------------------
  5575. # Check whether the given compiler option works
  5576. AC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
  5577. [AC_CACHE_CHECK([$1], [$2],
  5578. [$2=no
  5579. save_LDFLAGS="$LDFLAGS"
  5580. LDFLAGS="$LDFLAGS $3"
  5581. printf "$lt_simple_link_test_code" > conftest.$ac_ext
  5582. if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
  5583. # The compiler can only warn and ignore the option if not recognized
  5584. # So say no if there are warnings
  5585. if test -s conftest.err; then
  5586. # Append any errors to the config.log.
  5587. cat conftest.err 1>&AS_MESSAGE_LOG_FD
  5588. else
  5589. $2=yes
  5590. fi
  5591. fi
  5592. $rm conftest*
  5593. LDFLAGS="$save_LDFLAGS"
  5594. ])
  5595. if test x"[$]$2" = xyes; then
  5596. ifelse([$4], , :, [$4])
  5597. else
  5598. ifelse([$5], , :, [$5])
  5599. fi
  5600. ])# AC_LIBTOOL_LINKER_OPTION
  5601. # AC_LIBTOOL_SYS_MAX_CMD_LEN
  5602. # --------------------------
  5603. AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN],
  5604. [# find the maximum length of command line arguments
  5605. AC_MSG_CHECKING([the maximum length of command line arguments])
  5606. AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
  5607. i=0
  5608. testring="ABCD"
  5609. case $build_os in
  5610. msdosdjgpp*)
  5611. # On DJGPP, this test can blow up pretty badly due to problems in libc
  5612. # (any single argument exceeding 2000 bytes causes a buffer overrun
  5613. # during glob expansion). Even if it were fixed, the result of this
  5614. # check would be larger than it should be.
  5615. lt_cv_sys_max_cmd_len=12288; # 12K is about right
  5616. ;;
  5617. gnu*)
  5618. # Under GNU Hurd, this test is not required because there is
  5619. # no limit to the length of command line arguments.
  5620. # Libtool will interpret -1 as no limit whatsoever
  5621. lt_cv_sys_max_cmd_len=-1;
  5622. ;;
  5623. cygwin* | mingw*)
  5624. # On Win9x/ME, this test blows up -- it succeeds, but takes
  5625. # about 5 minutes as the teststring grows exponentially.
  5626. # Worse, since 9x/ME are not pre-emptively multitasking,
  5627. # you end up with a "frozen" computer, even though with patience
  5628. # the test eventually succeeds (with a max line length of 256k).
  5629. # Instead, let's just punt: use the minimum linelength reported by
  5630. # all of the supported platforms: 8192 (on NT/2K/XP).
  5631. lt_cv_sys_max_cmd_len=8192;
  5632. ;;
  5633. *)
  5634. # If test is not a shell built-in, we'll probably end up computing a
  5635. # maximum length that is only half of the actual maximum length, but
  5636. # we can't tell.
  5637. while (test "X"`$CONFIG_SHELL [$]0 --fallback-echo "X$testring" 2>/dev/null` \
  5638. = "XX$testring") >/dev/null 2>&1 &&
  5639. new_result=`expr "X$testring" : ".*" 2>&1` &&
  5640. lt_cv_sys_max_cmd_len=$new_result &&
  5641. test $i != 17 # 1/2 MB should be enough
  5642. do
  5643. i=`expr $i + 1`
  5644. testring=$testring$testring
  5645. done
  5646. testring=
  5647. # Add a significant safety factor because C++ compilers can tack on massive
  5648. # amounts of additional arguments before passing them to the linker.
  5649. # It appears as though 1/2 is a usable value.
  5650. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
  5651. ;;
  5652. esac
  5653. ])
  5654. if test -n $lt_cv_sys_max_cmd_len ; then
  5655. AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
  5656. else
  5657. AC_MSG_RESULT(none)
  5658. fi
  5659. ])# AC_LIBTOOL_SYS_MAX_CMD_LEN
  5660. # _LT_AC_CHECK_DLFCN
  5661. # --------------------
  5662. AC_DEFUN([_LT_AC_CHECK_DLFCN],
  5663. [AC_CHECK_HEADERS(dlfcn.h)dnl
  5664. ])# _LT_AC_CHECK_DLFCN
  5665. # _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
  5666. # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
  5667. # ------------------------------------------------------------------
  5668. AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
  5669. [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
  5670. if test "$cross_compiling" = yes; then :
  5671. [$4]
  5672. else
  5673. lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
  5674. lt_status=$lt_dlunknown
  5675. cat > conftest.$ac_ext <<EOF
  5676. [#line __oline__ "configure"
  5677. #include "confdefs.h"
  5678. #if HAVE_DLFCN_H
  5679. #include <dlfcn.h>
  5680. #endif
  5681. #include <stdio.h>
  5682. #ifdef RTLD_GLOBAL
  5683. # define LT_DLGLOBAL RTLD_GLOBAL
  5684. #else
  5685. # ifdef DL_GLOBAL
  5686. # define LT_DLGLOBAL DL_GLOBAL
  5687. # else
  5688. # define LT_DLGLOBAL 0
  5689. # endif
  5690. #endif
  5691. /* We may have to define LT_DLLAZY_OR_NOW in the command line if we
  5692. find out it does not work in some platform. */
  5693. #ifndef LT_DLLAZY_OR_NOW
  5694. # ifdef RTLD_LAZY
  5695. # define LT_DLLAZY_OR_NOW RTLD_LAZY
  5696. # else
  5697. # ifdef DL_LAZY
  5698. # define LT_DLLAZY_OR_NOW DL_LAZY
  5699. # else
  5700. # ifdef RTLD_NOW
  5701. # define LT_DLLAZY_OR_NOW RTLD_NOW
  5702. # else
  5703. # ifdef DL_NOW
  5704. # define LT_DLLAZY_OR_NOW DL_NOW
  5705. # else
  5706. # define LT_DLLAZY_OR_NOW 0
  5707. # endif
  5708. # endif
  5709. # endif
  5710. # endif
  5711. #endif
  5712. #ifdef __cplusplus
  5713. extern "C" void exit (int);
  5714. #endif
  5715. void fnord() { int i=42;}
  5716. int main ()
  5717. {
  5718. void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
  5719. int status = $lt_dlunknown;
  5720. if (self)
  5721. {
  5722. if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
  5723. else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
  5724. /* dlclose (self); */
  5725. }
  5726. exit (status);
  5727. }]
  5728. EOF
  5729. if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
  5730. (./conftest; exit; ) 2>/dev/null
  5731. lt_status=$?
  5732. case x$lt_status in
  5733. x$lt_dlno_uscore) $1 ;;
  5734. x$lt_dlneed_uscore) $2 ;;
  5735. x$lt_unknown|x*) $3 ;;
  5736. esac
  5737. else :
  5738. # compilation failed
  5739. $3
  5740. fi
  5741. fi
  5742. rm -fr conftest*
  5743. ])# _LT_AC_TRY_DLOPEN_SELF
  5744. # AC_LIBTOOL_DLOPEN_SELF
  5745. # -------------------
  5746. AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
  5747. [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
  5748. if test "x$enable_dlopen" != xyes; then
  5749. enable_dlopen=unknown
  5750. enable_dlopen_self=unknown
  5751. enable_dlopen_self_static=unknown
  5752. else
  5753. lt_cv_dlopen=no
  5754. lt_cv_dlopen_libs=
  5755. case $host_os in
  5756. beos*)
  5757. lt_cv_dlopen="load_add_on"
  5758. lt_cv_dlopen_libs=
  5759. lt_cv_dlopen_self=yes
  5760. ;;
  5761. mingw* | pw32*)
  5762. lt_cv_dlopen="LoadLibrary"
  5763. lt_cv_dlopen_libs=
  5764. ;;
  5765. cygwin*)
  5766. lt_cv_dlopen="dlopen"
  5767. lt_cv_dlopen_libs=
  5768. ;;
  5769. darwin*)
  5770. # if libdl is installed we need to link against it
  5771. AC_CHECK_LIB([dl], [dlopen],
  5772. [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
  5773. lt_cv_dlopen="dyld"
  5774. lt_cv_dlopen_libs=
  5775. lt_cv_dlopen_self=yes
  5776. ])
  5777. ;;
  5778. *)
  5779. AC_CHECK_FUNC([shl_load],
  5780. [lt_cv_dlopen="shl_load"],
  5781. [AC_CHECK_LIB([dld], [shl_load],
  5782. [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
  5783. [AC_CHECK_FUNC([dlopen],
  5784. [lt_cv_dlopen="dlopen"],
  5785. [AC_CHECK_LIB([dl], [dlopen],
  5786. [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
  5787. [AC_CHECK_LIB([svld], [dlopen],
  5788. [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
  5789. [AC_CHECK_LIB([dld], [dld_link],
  5790. [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
  5791. ])
  5792. ])
  5793. ])
  5794. ])
  5795. ])
  5796. ;;
  5797. esac
  5798. if test "x$lt_cv_dlopen" != xno; then
  5799. enable_dlopen=yes
  5800. else
  5801. enable_dlopen=no
  5802. fi
  5803. case $lt_cv_dlopen in
  5804. dlopen)
  5805. save_CPPFLAGS="$CPPFLAGS"
  5806. test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
  5807. save_LDFLAGS="$LDFLAGS"
  5808. eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
  5809. save_LIBS="$LIBS"
  5810. LIBS="$lt_cv_dlopen_libs $LIBS"
  5811. AC_CACHE_CHECK([whether a program can dlopen itself],
  5812. lt_cv_dlopen_self, [dnl
  5813. _LT_AC_TRY_DLOPEN_SELF(
  5814. lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
  5815. lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
  5816. ])
  5817. if test "x$lt_cv_dlopen_self" = xyes; then
  5818. LDFLAGS="$LDFLAGS $link_static_flag"
  5819. AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
  5820. lt_cv_dlopen_self_static, [dnl
  5821. _LT_AC_TRY_DLOPEN_SELF(
  5822. lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
  5823. lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross)
  5824. ])
  5825. fi
  5826. CPPFLAGS="$save_CPPFLAGS"
  5827. LDFLAGS="$save_LDFLAGS"
  5828. LIBS="$save_LIBS"
  5829. ;;
  5830. esac
  5831. case $lt_cv_dlopen_self in
  5832. yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
  5833. *) enable_dlopen_self=unknown ;;
  5834. esac
  5835. case $lt_cv_dlopen_self_static in
  5836. yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
  5837. *) enable_dlopen_self_static=unknown ;;
  5838. esac
  5839. fi
  5840. ])# AC_LIBTOOL_DLOPEN_SELF
  5841. # AC_LIBTOOL_PROG_CC_C_O([TAGNAME])
  5842. # ---------------------------------
  5843. # Check to see if options -c and -o are simultaneously supported by compiler
  5844. AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
  5845. [AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
  5846. AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
  5847. [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
  5848. [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
  5849. $rm -r conftest 2>/dev/null
  5850. mkdir conftest
  5851. cd conftest
  5852. mkdir out
  5853. printf "$lt_simple_compile_test_code" > conftest.$ac_ext
  5854. # According to Tom Tromey, Ian Lance Taylor reported there are C compilers
  5855. # that will create temporary files in the current directory regardless of
  5856. # the output directory. Thus, making CWD read-only will cause this test
  5857. # to fail, enabling locking or at least warning the user not to do parallel
  5858. # builds.
  5859. chmod -w .
  5860. lt_compiler_flag="-o out/conftest2.$ac_objext"
  5861. # Insert the option either (1) after the last *FLAGS variable, or
  5862. # (2) before a word containing "conftest.", or (3) at the end.
  5863. # Note that $ac_compile itself does not contain backslashes and begins
  5864. # with a dollar sign (not a hyphen), so the echo should work correctly.
  5865. lt_compile=`echo "$ac_compile" | $SED \
  5866. -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
  5867. -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
  5868. -e 's:$: $lt_compiler_flag:'`
  5869. (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
  5870. (eval "$lt_compile" 2>out/conftest.err)
  5871. ac_status=$?
  5872. cat out/conftest.err >&AS_MESSAGE_LOG_FD
  5873. echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
  5874. if (exit $ac_status) && test -s out/conftest2.$ac_objext
  5875. then
  5876. # The compiler can only warn and ignore the option if not recognized
  5877. # So say no if there are warnings
  5878. if test ! -s out/conftest.err; then
  5879. _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
  5880. fi
  5881. fi
  5882. chmod u+w .
  5883. $rm conftest* out/*
  5884. rmdir out
  5885. cd ..
  5886. rmdir conftest
  5887. $rm conftest*
  5888. ])
  5889. ])# AC_LIBTOOL_PROG_CC_C_O
  5890. # AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME])
  5891. # -----------------------------------------
  5892. # Check to see if we can do hard links to lock some files if needed
  5893. AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS],
  5894. [AC_REQUIRE([_LT_AC_LOCK])dnl
  5895. hard_links="nottested"
  5896. if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
  5897. # do not overwrite the value of need_locks provided by the user
  5898. AC_MSG_CHECKING([if we can lock with hard links])
  5899. hard_links=yes
  5900. $rm conftest*
  5901. ln conftest.a conftest.b 2>/dev/null && hard_links=no
  5902. touch conftest.a
  5903. ln conftest.a conftest.b 2>&5 || hard_links=no
  5904. ln conftest.a conftest.b 2>/dev/null && hard_links=no
  5905. AC_MSG_RESULT([$hard_links])
  5906. if test "$hard_links" = no; then
  5907. AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
  5908. need_locks=warn
  5909. fi
  5910. else
  5911. need_locks=no
  5912. fi
  5913. ])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS
  5914. # AC_LIBTOOL_OBJDIR
  5915. # -----------------
  5916. AC_DEFUN([AC_LIBTOOL_OBJDIR],
  5917. [AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
  5918. [rm -f .libs 2>/dev/null
  5919. mkdir .libs 2>/dev/null
  5920. if test -d .libs; then
  5921. lt_cv_objdir=.libs
  5922. else
  5923. # MS-DOS does not allow filenames that begin with a dot.
  5924. lt_cv_objdir=_libs
  5925. fi
  5926. rmdir .libs 2>/dev/null])
  5927. objdir=$lt_cv_objdir
  5928. ])# AC_LIBTOOL_OBJDIR
  5929. # AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME])
  5930. # ----------------------------------------------
  5931. # Check hardcoding attributes.
  5932. AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH],
  5933. [AC_MSG_CHECKING([how to hardcode library paths into programs])
  5934. _LT_AC_TAGVAR(hardcode_action, $1)=
  5935. if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
  5936. test -n "$_LT_AC_TAGVAR(runpath_var $1)" || \
  5937. test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)"="Xyes" ; then
  5938. # We can hardcode non-existant directories.
  5939. if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no &&
  5940. # If the only mechanism to avoid hardcoding is shlibpath_var, we
  5941. # have to relink, otherwise we might link with an installed library
  5942. # when we should be linking with a yet-to-be-installed one
  5943. ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
  5944. test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then
  5945. # Linking always hardcodes the temporary library directory.
  5946. _LT_AC_TAGVAR(hardcode_action, $1)=relink
  5947. else
  5948. # We can link without hardcoding, and we can hardcode nonexisting dirs.
  5949. _LT_AC_TAGVAR(hardcode_action, $1)=immediate
  5950. fi
  5951. else
  5952. # We cannot hardcode anything, or else we can only hardcode existing
  5953. # directories.
  5954. _LT_AC_TAGVAR(hardcode_action, $1)=unsupported
  5955. fi
  5956. AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)])
  5957. if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then
  5958. # Fast installation is not supported
  5959. enable_fast_install=no
  5960. elif test "$shlibpath_overrides_runpath" = yes ||
  5961. test "$enable_shared" = no; then
  5962. # Fast installation is not necessary
  5963. enable_fast_install=needless
  5964. fi
  5965. ])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH
  5966. # AC_LIBTOOL_SYS_LIB_STRIP
  5967. # ------------------------
  5968. AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP],
  5969. [striplib=
  5970. old_striplib=
  5971. AC_MSG_CHECKING([whether stripping libraries is possible])
  5972. if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
  5973. test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
  5974. test -z "$striplib" && striplib="$STRIP --strip-unneeded"
  5975. AC_MSG_RESULT([yes])
  5976. else
  5977. # FIXME - insert some real tests, host_os isn't really good enough
  5978. case $host_os in
  5979. darwin*)
  5980. if test -n "$STRIP" ; then
  5981. striplib="$STRIP -x"
  5982. AC_MSG_RESULT([yes])
  5983. else
  5984. AC_MSG_RESULT([no])
  5985. fi
  5986. ;;
  5987. *)
  5988. AC_MSG_RESULT([no])
  5989. ;;
  5990. esac
  5991. fi
  5992. ])# AC_LIBTOOL_SYS_LIB_STRIP
  5993. # AC_LIBTOOL_SYS_DYNAMIC_LINKER
  5994. # -----------------------------
  5995. # PORTME Fill in your ld.so characteristics
  5996. AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
  5997. [AC_MSG_CHECKING([dynamic linker characteristics])
  5998. library_names_spec=
  5999. libname_spec='lib$name'
  6000. soname_spec=
  6001. shrext=".so"
  6002. postinstall_cmds=
  6003. postuninstall_cmds=
  6004. finish_cmds=
  6005. finish_eval=
  6006. shlibpath_var=
  6007. shlibpath_overrides_runpath=unknown
  6008. version_type=none
  6009. dynamic_linker="$host_os ld.so"
  6010. sys_lib_dlsearch_path_spec="/lib /usr/lib"
  6011. sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
  6012. need_lib_prefix=unknown
  6013. hardcode_into_libs=no
  6014. # when you set need_version to no, make sure it does not cause -set_version
  6015. # flags to be left without arguments
  6016. need_version=unknown
  6017. case $host_os in
  6018. aix3*)
  6019. version_type=linux
  6020. library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
  6021. shlibpath_var=LIBPATH
  6022. # AIX 3 has no versioning support, so we append a major version to the name.
  6023. soname_spec='${libname}${release}${shared_ext}$major'
  6024. ;;
  6025. aix4* | aix5*)
  6026. version_type=linux
  6027. need_lib_prefix=no
  6028. need_version=no
  6029. hardcode_into_libs=yes
  6030. if test "$host_cpu" = ia64; then
  6031. # AIX 5 supports IA64
  6032. library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
  6033. shlibpath_var=LD_LIBRARY_PATH
  6034. else
  6035. # With GCC up to 2.95.x, collect2 would create an import file
  6036. # for dependence libraries. The import file would start with
  6037. # the line `#! .'. This would cause the generated library to
  6038. # depend on `.', always an invalid library. This was fixed in
  6039. # development snapshots of GCC prior to 3.0.
  6040. case $host_os in
  6041. aix4 | aix4.[[01]] | aix4.[[01]].*)
  6042. if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
  6043. echo ' yes '
  6044. echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
  6045. :
  6046. else
  6047. can_build_shared=no
  6048. fi
  6049. ;;
  6050. esac
  6051. # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
  6052. # soname into executable. Probably we can add versioning support to
  6053. # collect2, so additional links can be useful in future.
  6054. if test "$aix_use_runtimelinking" = yes; then
  6055. # If using run time linking (on AIX 4.2 or later) use lib<name>.so
  6056. # instead of lib<name>.a to let people know that these are not
  6057. # typical AIX shared libraries.
  6058. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
  6059. else
  6060. # We preserve .a as extension for shared libraries through AIX4.2
  6061. # and later when we are not doing run time linking.
  6062. library_names_spec='${libname}${release}.a $libname.a'
  6063. soname_spec='${libname}${release}${shared_ext}$major'
  6064. fi
  6065. shlibpath_var=LIBPATH
  6066. fi
  6067. ;;
  6068. amigaos*)
  6069. library_names_spec='$libname.ixlibrary $libname.a'
  6070. # Create ${libname}_ixlibrary.a entries in /sys/libs.
  6071. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done'
  6072. ;;
  6073. beos*)
  6074. library_names_spec='${libname}${shared_ext}'
  6075. dynamic_linker="$host_os ld.so"
  6076. shlibpath_var=LIBRARY_PATH
  6077. ;;
  6078. bsdi4*)
  6079. version_type=linux
  6080. need_version=no
  6081. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
  6082. soname_spec='${libname}${release}${shared_ext}$major'
  6083. finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
  6084. shlibpath_var=LD_LIBRARY_PATH
  6085. sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
  6086. sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
  6087. # the default ld.so.conf also contains /usr/contrib/lib and
  6088. # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
  6089. # libtool to hard-code these into programs
  6090. ;;
  6091. cygwin* | mingw* | pw32*)
  6092. version_type=windows
  6093. shrext=".dll"
  6094. need_version=no
  6095. need_lib_prefix=no
  6096. case $GCC,$host_os in
  6097. yes,cygwin* | yes,mingw* | yes,pw32*)
  6098. library_names_spec='$libname.dll.a'
  6099. # DLL is installed to $(libdir)/../bin by postinstall_cmds
  6100. postinstall_cmds='base_file=`basename \${file}`~
  6101. dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
  6102. dldir=$destdir/`dirname \$dlpath`~
  6103. test -d \$dldir || mkdir -p \$dldir~
  6104. $install_prog $dir/$dlname \$dldir/$dlname'
  6105. postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
  6106. dlpath=$dir/\$dldll~
  6107. $rm \$dlpath'
  6108. shlibpath_overrides_runpath=yes
  6109. case $host_os in
  6110. cygwin*)
  6111. # Cygwin DLLs use 'cyg' prefix rather than 'lib'
  6112. soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
  6113. sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
  6114. ;;
  6115. mingw*)
  6116. # MinGW DLLs use traditional 'lib' prefix
  6117. soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
  6118. sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
  6119. if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then
  6120. # It is most probably a Windows format PATH printed by
  6121. # mingw gcc, but we are running on Cygwin. Gcc prints its search
  6122. # path with ; separators, and with drive letters. We can handle the
  6123. # drive letters (cygwin fileutils understands them), so leave them,
  6124. # especially as we might pass files found there to a mingw objdump,
  6125. # which wouldn't understand a cygwinified path. Ahh.
  6126. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
  6127. else
  6128. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
  6129. fi
  6130. ;;
  6131. pw32*)
  6132. # pw32 DLLs use 'pw' prefix rather than 'lib'
  6133. library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
  6134. ;;
  6135. esac
  6136. ;;
  6137. *)
  6138. library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
  6139. ;;
  6140. esac
  6141. dynamic_linker='Win32 ld.exe'
  6142. # FIXME: first we should search . and the directory the executable is in
  6143. shlibpath_var=PATH
  6144. ;;
  6145. darwin* | rhapsody*)
  6146. dynamic_linker="$host_os dyld"
  6147. version_type=darwin
  6148. need_lib_prefix=no
  6149. need_version=no
  6150. library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
  6151. soname_spec='${libname}${release}${major}$shared_ext'
  6152. shlibpath_overrides_runpath=yes
  6153. shlibpath_var=DYLD_LIBRARY_PATH
  6154. shrext='$(test .$module = .yes && echo .so || echo .dylib)'
  6155. # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
  6156. if test "$GCC" = yes; then
  6157. sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
  6158. else
  6159. sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
  6160. fi
  6161. sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
  6162. ;;
  6163. dgux*)
  6164. version_type=linux
  6165. need_lib_prefix=no
  6166. need_version=no
  6167. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
  6168. soname_spec='${libname}${release}${shared_ext}$major'
  6169. shlibpath_var=LD_LIBRARY_PATH
  6170. ;;
  6171. freebsd1*)
  6172. dynamic_linker=no
  6173. ;;
  6174. freebsd*-gnu*)
  6175. version_type=linux
  6176. need_lib_prefix=no
  6177. need_version=no
  6178. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
  6179. soname_spec='${libname}${release}${shared_ext}$major'
  6180. shlibpath_var=LD_LIBRARY_PATH
  6181. shlibpath_overrides_runpath=no
  6182. hardcode_into_libs=yes
  6183. dynamic_linker='GNU ld.so'
  6184. ;;
  6185. freebsd*)
  6186. objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
  6187. version_type=freebsd-$objformat
  6188. case $version_type in
  6189. freebsd-elf*)
  6190. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
  6191. need_version=no
  6192. need_lib_prefix=no
  6193. ;;
  6194. freebsd-*)
  6195. library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
  6196. need_version=yes
  6197. ;;
  6198. esac
  6199. shlibpath_var=LD_LIBRARY_PATH
  6200. case $host_os in
  6201. freebsd2*)
  6202. shlibpath_overrides_runpath=yes
  6203. ;;
  6204. freebsd3.[01]* | freebsdelf3.[01]*)
  6205. shlibpath_overrides_runpath=yes
  6206. hardcode_into_libs=yes
  6207. ;;
  6208. *) # from 3.2 on
  6209. shlibpath_overrides_runpath=no
  6210. hardcode_into_libs=yes
  6211. ;;
  6212. esac
  6213. ;;
  6214. gnu*)
  6215. version_type=linux
  6216. need_lib_prefix=no
  6217. need_version=no
  6218. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
  6219. soname_spec='${libname}${release}${shared_ext}$major'
  6220. shlibpath_var=LD_LIBRARY_PATH
  6221. hardcode_into_libs=yes
  6222. ;;
  6223. hpux9* | hpux10* | hpux11*)
  6224. # Give a soname corresponding to the major version so that dld.sl refuses to
  6225. # link against other versions.
  6226. version_type=sunos
  6227. need_lib_prefix=no
  6228. need_version=no
  6229. case "$host_cpu" in
  6230. ia64*)
  6231. shrext='.so'
  6232. hardcode_into_libs=yes
  6233. dynamic_linker="$host_os dld.so"
  6234. shlibpath_var=LD_LIBRARY_PATH
  6235. shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
  6236. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
  6237. soname_spec='${libname}${release}${shared_ext}$major'
  6238. if test "X$HPUX_IA64_MODE" = X32; then
  6239. sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
  6240. else
  6241. sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
  6242. fi
  6243. sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
  6244. ;;
  6245. hppa*64*)
  6246. shrext='.sl'
  6247. hardcode_into_libs=yes
  6248. dynamic_linker="$host_os dld.sl"
  6249. shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
  6250. shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
  6251. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
  6252. soname_spec='${libname}${release}${shared_ext}$major'
  6253. sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
  6254. sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
  6255. ;;
  6256. *)
  6257. shrext='.sl'
  6258. dynamic_linker="$host_os dld.sl"
  6259. shlibpath_var=SHLIB_PATH
  6260. shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
  6261. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
  6262. soname_spec='${libname}${release}${shared_ext}$major'
  6263. ;;
  6264. esac
  6265. # HP-UX runs *really* slowly unless shared libraries are mode 555.
  6266. postinstall_cmds='chmod 555 $lib'
  6267. ;;
  6268. irix5* | irix6* | nonstopux*)
  6269. case $host_os in
  6270. nonstopux*) version_type=nonstopux ;;
  6271. *)
  6272. if test "$lt_cv_prog_gnu_ld" = yes; then
  6273. version_type=linux
  6274. else
  6275. version_type=irix
  6276. fi ;;
  6277. esac
  6278. need_lib_prefix=no
  6279. need_version=no
  6280. soname_spec='${libname}${release}${shared_ext}$major'
  6281. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
  6282. case $host_os in
  6283. irix5* | nonstopux*)
  6284. libsuff= shlibsuff=
  6285. ;;
  6286. *)
  6287. case $LD in # libtool.m4 will add one of these switches to LD
  6288. *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
  6289. libsuff= shlibsuff= libmagic=32-bit;;
  6290. *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
  6291. libsuff=32 shlibsuff=N32 libmagic=N32;;
  6292. *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
  6293. libsuff=64 shlibsuff=64 libmagic=64-bit;;
  6294. *) libsuff= shlibsuff= libmagic=never-match;;
  6295. esac
  6296. ;;
  6297. esac
  6298. shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
  6299. shlibpath_overrides_runpath=no
  6300. sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
  6301. sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
  6302. hardcode_into_libs=yes
  6303. ;;
  6304. # No shared lib support for Linux oldld, aout, or coff.
  6305. linux*oldld* | linux*aout* | linux*coff*)
  6306. dynamic_linker=no
  6307. ;;
  6308. # This must be Linux ELF.
  6309. linux*)
  6310. version_type=linux
  6311. need_lib_prefix=no
  6312. need_version=no
  6313. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
  6314. soname_spec='${libname}${release}${shared_ext}$major'
  6315. finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'