KDirStat – a graphical disk usage utility
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.
 
 
 

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