KMatplot – a gnuplot-like tool for plotting data sets in either two or three dimensions
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.
 
 
 
 
 
 

4986 lines
135 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., 59 Temple Place - Suite 330,
  16. dnl Boston, MA 02111-1307, 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. If you decide that you
  20. dnl really want to modify it, contact coolo@kde.org mentioning that you have
  21. dnl and that the modified file should be committed to every module.
  22. dnl
  23. dnl Single-module modifications are best placed in configure.in for kdelibs
  24. dnl and kdebase or configure.in.in if present.
  25. dnl ------------------------------------------------------------------------
  26. dnl Forward compatibility macros (make autoconf 2.13 look like 2.50),
  27. dnl thanks to Raja R Harinath.
  28. dnl ------------------------------------------------------------------------
  29. dnl
  30. ifdef([_AC_PATH_X_DIRECT],[],
  31. [AC_DEFUN([_AC_PATH_X_DIRECT],[AC_PATH_X_DIRECT])])
  32. ifdef([_AC_PATH_X_XMKMF],[],
  33. [AC_DEFUN([_AC_PATH_X_XMKMF],[AC_PATH_X_XMKMF])])
  34. dnl ------------------------------------------------------------------------
  35. dnl Find a file (or one of more files in a list of dirs)
  36. dnl ------------------------------------------------------------------------
  37. dnl
  38. AC_DEFUN(AC_FIND_FILE,
  39. [
  40. $3=NO
  41. for i in $2;
  42. do
  43. for j in $1;
  44. do
  45. echo "configure: __oline__: $i/$j" >&AC_FD_CC
  46. if test -r "$i/$j"; then
  47. echo "taking that" >&AC_FD_CC
  48. $3=$i
  49. break 2
  50. fi
  51. done
  52. done
  53. ])
  54. dnl KDE_FIND_PATH(programm-name, variable-name, list of directories,
  55. dnl if-not-found, test-parameter)
  56. AC_DEFUN(KDE_FIND_PATH,
  57. [
  58. AC_MSG_CHECKING([for $1])
  59. if test -n "$$2"; then
  60. kde_cv_path="$$2";
  61. else
  62. kde_cache=`echo $1 | sed 'y%./+-%__p_%'`
  63. AC_CACHE_VAL(kde_cv_path_$kde_cache,
  64. [
  65. kde_cv_path="NONE"
  66. dirs="$3"
  67. kde_save_IFS=$IFS
  68. IFS=':'
  69. for dir in $PATH; do
  70. dirs="$dirs $dir"
  71. done
  72. IFS=$kde_save_IFS
  73. for dir in $dirs; do
  74. if test -x "$dir/$1"; then
  75. if test -n "$5"
  76. then
  77. evalstr="$dir/$1 $5 2>&1 "
  78. if eval $evalstr; then
  79. kde_cv_path="$dir/$1"
  80. break
  81. fi
  82. else
  83. kde_cv_path="$dir/$1"
  84. break
  85. fi
  86. fi
  87. done
  88. eval "kde_cv_path_$kde_cache=$kde_cv_path"
  89. ])
  90. eval "kde_cv_path=\"`echo '$kde_cv_path_'$kde_cache`\""
  91. fi
  92. if test -z "$kde_cv_path" || test "$kde_cv_path" = NONE; then
  93. AC_MSG_RESULT(not found)
  94. $4
  95. else
  96. AC_MSG_RESULT($kde_cv_path)
  97. $2=$kde_cv_path
  98. fi
  99. ])
  100. AC_DEFUN(KDE_MOC_ERROR_MESSAGE,
  101. [
  102. AC_MSG_ERROR([No Qt meta object compiler (moc) found!
  103. Please check whether you installed Qt correctly.
  104. You need to have a running moc binary.
  105. configure tried to run $ac_cv_path_moc and the test didn't
  106. succeed. If configure shouldn't have tried this one, set
  107. the environment variable MOC to the right one before running
  108. configure.
  109. ])
  110. ])
  111. AC_DEFUN(KDE_UIC_ERROR_MESSAGE,
  112. [
  113. AC_MSG_WARN([No Qt ui compiler (uic) found!
  114. Please check whether you installed Qt correctly.
  115. You need to have a running uic binary.
  116. configure tried to run $ac_cv_path_uic and the test didn't
  117. succeed. If configure shouldn't have tried this one, set
  118. the environment variable UIC to the right one before running
  119. configure.
  120. ])
  121. ])
  122. dnl ------------------------------------------------------------------------
  123. dnl Find the meta object compiler and the ui compiler in the PATH,
  124. dnl in $QTDIR/bin, and some more usual places
  125. dnl ------------------------------------------------------------------------
  126. dnl
  127. AC_DEFUN(AC_PATH_QT_MOC_UIC,
  128. [
  129. qt_bindirs=""
  130. for dir in $kde_qt_dirs; do
  131. qt_bindirs="$qt_bindirs $dir/bin $dir/src/moc"
  132. done
  133. qt_bindirs="$qt_bindirs /usr/bin /usr/X11R6/bin /usr/local/qt/bin"
  134. if test ! "$ac_qt_bindir" = "NO"; then
  135. qt_bindirs="$ac_qt_bindir $qt_bindirs"
  136. fi
  137. KDE_FIND_PATH(moc, MOC, [$qt_bindirs], [KDE_MOC_ERROR_MESSAGE])
  138. if test -z "$UIC_NOT_NEEDED"; then
  139. KDE_FIND_PATH(uic, UIC, [$qt_bindirs], [UIC=""])
  140. if test -z "$UIC" ; then
  141. KDE_UIC_ERROR_MESSAGE
  142. exit 1
  143. fi
  144. else
  145. UIC="echo uic not available: "
  146. fi
  147. AC_SUBST(MOC)
  148. AC_SUBST(UIC)
  149. ])
  150. AC_DEFUN(KDE_1_CHECK_PATHS,
  151. [
  152. KDE_1_CHECK_PATH_HEADERS
  153. KDE_TEST_RPATH=
  154. if test -n "$USE_RPATH"; then
  155. if test -n "$kde_libraries"; then
  156. KDE_TEST_RPATH="-R $kde_libraries"
  157. fi
  158. if test -n "$qt_libraries"; then
  159. KDE_TEST_RPATH="$KDE_TEST_RPATH -R $qt_libraries"
  160. fi
  161. if test -n "$x_libraries"; then
  162. KDE_TEST_RPATH="$KDE_TEST_RPATH -R $x_libraries"
  163. fi
  164. KDE_TEST_RPATH="$KDE_TEST_RPATH $KDE_EXTRA_RPATH"
  165. fi
  166. AC_MSG_CHECKING([for KDE libraries installed])
  167. ac_link='$LIBTOOL_SHELL --silent --mode=link ${CXX-g++} -o conftest $CXXFLAGS $all_includes $CPPFLAGS $LDFLAGS $all_libraries conftest.$ac_ext $LIBS -lkdecore $LIBQT $KDE_TEST_RPATH 1>&5'
  168. if AC_TRY_EVAL(ac_link) && test -s conftest; then
  169. AC_MSG_RESULT(yes)
  170. else
  171. AC_MSG_ERROR([your system fails at linking a small KDE application!
  172. Check, if your compiler is installed correctly and if you have used the
  173. same compiler to compile Qt and kdelibs as you did use now.
  174. For more details about this problem, look at the end of config.log.])
  175. fi
  176. if eval `KDEDIR= ./conftest 2>&5`; then
  177. kde_result=done
  178. else
  179. kde_result=problems
  180. fi
  181. KDEDIR= ./conftest 2> /dev/null >&5 # make an echo for config.log
  182. kde_have_all_paths=yes
  183. KDE_SET_PATHS($kde_result)
  184. ])
  185. AC_DEFUN(KDE_SET_PATHS,
  186. [
  187. kde_cv_all_paths="kde_have_all_paths=\"yes\" \
  188. kde_htmldir=\"$kde_htmldir\" \
  189. kde_appsdir=\"$kde_appsdir\" \
  190. kde_icondir=\"$kde_icondir\" \
  191. kde_sounddir=\"$kde_sounddir\" \
  192. kde_datadir=\"$kde_datadir\" \
  193. kde_locale=\"$kde_locale\" \
  194. kde_cgidir=\"$kde_cgidir\" \
  195. kde_confdir=\"$kde_confdir\" \
  196. kde_mimedir=\"$kde_mimedir\" \
  197. kde_toolbardir=\"$kde_toolbardir\" \
  198. kde_wallpaperdir=\"$kde_wallpaperdir\" \
  199. kde_templatesdir=\"$kde_templatesdir\" \
  200. kde_bindir=\"$kde_bindir\" \
  201. kde_servicesdir=\"$kde_servicesdir\" \
  202. kde_servicetypesdir=\"$kde_servicetypesdir\" \
  203. kde_moduledir=\"$kde_moduledir\" \
  204. kde_result=$1"
  205. ])
  206. AC_DEFUN(KDE_SET_DEFAULT_PATHS,
  207. [
  208. if test "$1" = "default"; then
  209. if test -z "$kde_htmldir"; then
  210. kde_htmldir='\${prefix}/share/doc/HTML'
  211. fi
  212. if test -z "$kde_appsdir"; then
  213. kde_appsdir='\${prefix}/share/applnk'
  214. fi
  215. if test -z "$kde_icondir"; then
  216. kde_icondir='\${prefix}/share/icons'
  217. fi
  218. if test -z "$kde_sounddir"; then
  219. kde_sounddir='\${prefix}/share/sounds'
  220. fi
  221. if test -z "$kde_datadir"; then
  222. kde_datadir='\${prefix}/share/apps'
  223. fi
  224. if test -z "$kde_locale"; then
  225. kde_locale='\${prefix}/share/locale'
  226. fi
  227. if test -z "$kde_cgidir"; then
  228. kde_cgidir='\${exec_prefix}/cgi-bin'
  229. fi
  230. if test -z "$kde_confdir"; then
  231. kde_confdir='\${prefix}/share/config'
  232. fi
  233. if test -z "$kde_mimedir"; then
  234. kde_mimedir='\${prefix}/share/mimelnk'
  235. fi
  236. if test -z "$kde_toolbardir"; then
  237. kde_toolbardir='\${prefix}/share/toolbar'
  238. fi
  239. if test -z "$kde_wallpaperdir"; then
  240. kde_wallpaperdir='\${prefix}/share/wallpapers'
  241. fi
  242. if test -z "$kde_templatesdir"; then
  243. kde_templatesdir='\${prefix}/share/templates'
  244. fi
  245. if test -z "$kde_bindir"; then
  246. kde_bindir='\${exec_prefix}/bin'
  247. fi
  248. if test -z "$kde_servicesdir"; then
  249. kde_servicesdir='\${prefix}/share/services'
  250. fi
  251. if test -z "$kde_servicetypesdir"; then
  252. kde_servicetypesdir='\${prefix}/share/servicetypes'
  253. fi
  254. if test -z "$kde_moduledir"; then
  255. kde_moduledir='\${exec_prefix}/lib/kde2'
  256. fi
  257. KDE_SET_PATHS(defaults)
  258. else
  259. if test $kde_qtver = 1; then
  260. AC_MSG_RESULT([compiling])
  261. KDE_1_CHECK_PATHS
  262. else
  263. AC_MSG_ERROR([path checking not yet supported for KDE 2])
  264. fi
  265. fi
  266. ])
  267. AC_DEFUN(KDE_CHECK_PATHS_FOR_COMPLETENESS,
  268. [ if test -z "$kde_htmldir" || test -z "$kde_appsdir" ||
  269. test -z "$kde_icondir" || test -z "$kde_sounddir" ||
  270. test -z "$kde_datadir" || test -z "$kde_locale" ||
  271. test -z "$kde_cgidir" || test -z "$kde_confdir" ||
  272. test -z "$kde_mimedir" || test -z "$kde_toolbardir" ||
  273. test -z "$kde_wallpaperdir" || test -z "$kde_templatesdir" ||
  274. test -z "$kde_bindir" || test -z "$kde_servicesdir" ||
  275. test -z "$kde_servicetypesdir" || test -z "$kde_moduledir" ||
  276. test "$kde_have_all_paths" != "yes"; then
  277. kde_have_all_paths=no
  278. fi
  279. ])
  280. AC_DEFUN(KDE_MISSING_PROG_ERROR,
  281. [
  282. AC_MSG_ERROR([The important program $1 was not found!
  283. Please check whether you installed KDE correctly.
  284. ])
  285. ])
  286. AC_DEFUN(KDE_SUBST_PROGRAMS,
  287. [
  288. kde_default_bindirs="/usr/bin /usr/local/bin /opt/local/bin /usr/X11R6/bin /opt/kde/bin /opt/kde2/bin /usr/kde/bin /usr/local/kde/bin"
  289. if test -n "$KDEDIRS"; then
  290. kde_save_IFS=$IFS
  291. IFS=:
  292. for dir in $KDEDIRS; do
  293. kde_default_bindirs="$dir/bin $kde_default_bindirs "
  294. done
  295. IFS=$kde_save_IFS
  296. fi
  297. kde_default_bindirs="$exec_prefix/bin $prefix/bin $kde_default_bindirs"
  298. KDE_FIND_PATH(dcopidl, DCOPIDL, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl)])
  299. KDE_FIND_PATH(dcopidl2cpp, DCOPIDL2CPP, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl2cpp)])
  300. KDE_FIND_PATH(mcopidl, MCOPIDL, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(mcopidl)])
  301. KDE_FIND_PATH(artsc-config, ARTSCCONFIG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(artsc-config)])
  302. KDE_FIND_PATH(kde-config, KDECONFIG, [$kde_default_bindirs])
  303. KDE_FIND_PATH(meinproc, MEINPROC, [$kde_default_bindirs])
  304. if test -n "$MEINPROC" && test ! "$MEINPROC" = "compiled"; then
  305. kde_sharedirs="/usr/share/kde /usr/local/share /usr/share /opt/kde2/share /opt/kde/share $prefix/share"
  306. test -n "$KDEDIR" && kde_sharedirs="$KDEDIR/share $kde_sharedirs"
  307. AC_FIND_FILE(apps/ksgmltools2/customization/kde-chunk.xsl, $kde_sharedirs, KDE_XSL_STYLESHEET)
  308. if test "$KDE_XSL_STYLESHEET" = "NO"; then
  309. KDE_XSL_STYLESHEET=""
  310. else
  311. KDE_XSL_STYLESHEET="$KDE_XSL_STYLESHEET/apps/ksgmltools2/customization/kde-chunk.xsl"
  312. fi
  313. fi
  314. DCOP_DEPENDENCIES='$(DCOPIDL)'
  315. AC_SUBST(DCOPIDL)
  316. AC_SUBST(DCOPIDL2CPP)
  317. AC_SUBST(DCOP_DEPENDENCIES)
  318. AC_SUBST(MCOPIDL)
  319. AC_SUBST(ARTSCCONFIG)
  320. AC_SUBST(KDECONFIG)
  321. AC_SUBST(MEINPROC)
  322. AC_SUBST(KDE_XSL_STYLESHEET)
  323. if test -x "$KDECONFIG"; then # it can be "compiled"
  324. kde_libs_prefix=`$KDECONFIG --prefix`
  325. if test -z "$kde_libs_prefix" || test ! -x "$kde_libs_prefix"; then
  326. AC_MSG_ERROR([$KDECONFIG --prefix outputed the non existant prefix '$kde_libs_prefix' for kdelibs.
  327. This means it has been moved since you installed it.
  328. This won't work. Please recompile kdelibs for the new prefix.
  329. ])
  330. fi
  331. kde_libs_htmldir=`$KDECONFIG --install html --expandvars`
  332. else
  333. kde_libs_prefix='$(prefix)'
  334. kde_libs_htmldir='$(kde_htmldir)'
  335. fi
  336. AC_SUBST(kde_libs_prefix)
  337. AC_SUBST(kde_libs_htmldir)
  338. ])dnl
  339. AC_DEFUN(AC_CREATE_KFSSTND,
  340. [
  341. AC_REQUIRE([AC_CHECK_RPATH])
  342. AC_MSG_CHECKING([for KDE paths])
  343. kde_result=""
  344. kde_cached_paths=yes
  345. AC_CACHE_VAL(kde_cv_all_paths,
  346. [
  347. KDE_SET_DEFAULT_PATHS($1)
  348. kde_cached_paths=no
  349. ])
  350. eval "$kde_cv_all_paths"
  351. KDE_CHECK_PATHS_FOR_COMPLETENESS
  352. if test "$kde_have_all_paths" = "no" && test "$kde_cached_paths" = "yes"; then
  353. # wrong values were cached, may be, we can set better ones
  354. kde_result=
  355. kde_htmldir= kde_appsdir= kde_icondir= kde_sounddir=
  356. kde_datadir= kde_locale= kde_cgidir= kde_confdir=
  357. kde_mimedir= kde_toolbardir= kde_wallpaperdir= kde_templatesdir=
  358. kde_bindir= kde_servicesdir= kde_servicetypesdir= kde_moduledir=
  359. kde_have_all_paths=
  360. KDE_SET_DEFAULT_PATHS($1)
  361. eval "$kde_cv_all_paths"
  362. KDE_CHECK_PATHS_FOR_COMPLETENESS
  363. kde_result="$kde_result (cache overridden)"
  364. fi
  365. if test "$kde_have_all_paths" = "no"; then
  366. AC_MSG_ERROR([configure could not run a little KDE program to test the environment.
  367. Since it had compiled and linked before, it must be a strange problem on your system.
  368. Look at config.log for details. If you are not able to fix this, look at
  369. http://www.kde.org/faq/installation.html or any www.kde.org mirror.
  370. (If you're using an egcs version on Linux, you may update binutils!)
  371. ])
  372. else
  373. rm -f conftest*
  374. AC_MSG_RESULT($kde_result)
  375. fi
  376. bindir=$kde_bindir
  377. KDE_SUBST_PROGRAMS
  378. ])
  379. AC_DEFUN(AC_SUBST_KFSSTND,
  380. [
  381. AC_SUBST(kde_htmldir)
  382. AC_SUBST(kde_appsdir)
  383. AC_SUBST(kde_icondir)
  384. AC_SUBST(kde_sounddir)
  385. AC_SUBST(kde_datadir)
  386. AC_SUBST(kde_locale)
  387. AC_SUBST(kde_confdir)
  388. AC_SUBST(kde_mimedir)
  389. AC_SUBST(kde_wallpaperdir)
  390. AC_SUBST(kde_bindir)
  391. dnl for KDE 2
  392. AC_SUBST(kde_templatesdir)
  393. AC_SUBST(kde_servicesdir)
  394. AC_SUBST(kde_servicetypesdir)
  395. AC_SUBST(kde_moduledir)
  396. if test "$kde_qtver" = 1; then
  397. kde_minidir="$kde_icondir/mini"
  398. else
  399. # for KDE 1 - this breaks KDE2 apps using minidir, but
  400. # that's the plan ;-/
  401. kde_minidir="/dev/null"
  402. fi
  403. dnl AC_SUBST(kde_minidir)
  404. dnl AC_SUBST(kde_cgidir)
  405. dnl AC_SUBST(kde_toolbardir)
  406. ])
  407. AC_DEFUN(KDE_MISC_TESTS,
  408. [
  409. AC_LANG_C
  410. dnl Checks for libraries.
  411. AC_CHECK_LIB(util, main, [LIBUTIL="-lutil"]) dnl for *BSD
  412. AC_SUBST(LIBUTIL)
  413. AC_CHECK_LIB(compat, main, [LIBCOMPAT="-lcompat"]) dnl for *BSD
  414. AC_SUBST(LIBCOMPAT)
  415. kde_have_crypt=
  416. AC_CHECK_LIB(crypt, crypt, [LIBCRYPT="-lcrypt"; kde_have_crypt=yes],
  417. AC_CHECK_LIB(c, crypt, [kde_have_crypt=yes], [
  418. AC_MSG_WARN([you have no crypt in either libcrypt or libc.
  419. You should install libcrypt from another source or configure with PAM
  420. support])
  421. kde_have_crypt=no
  422. ]))
  423. AC_SUBST(LIBCRYPT)
  424. if test $kde_have_crypt = yes; then
  425. AC_DEFINE_UNQUOTED(HAVE_CRYPT, 1, [Defines if your system has the crypt function])
  426. fi
  427. AC_CHECK_SOCKLEN_T
  428. AC_LANG_C
  429. AC_CHECK_LIB(dnet, dnet_ntoa, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"])
  430. if test $ac_cv_lib_dnet_dnet_ntoa = no; then
  431. AC_CHECK_LIB(dnet_stub, dnet_ntoa,
  432. [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"])
  433. fi
  434. AC_CHECK_FUNC(inet_ntoa)
  435. if test $ac_cv_func_inet_ntoa = no; then
  436. AC_CHECK_LIB(nsl, inet_ntoa, X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl")
  437. fi
  438. AC_CHECK_FUNC(connect)
  439. if test $ac_cv_func_connect = no; then
  440. AC_CHECK_LIB(socket, connect, X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS", ,
  441. $X_EXTRA_LIBS)
  442. fi
  443. AC_CHECK_FUNC(remove)
  444. if test $ac_cv_func_remove = no; then
  445. AC_CHECK_LIB(posix, remove, X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix")
  446. fi
  447. # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
  448. AC_CHECK_FUNC(shmat, ,
  449. AC_CHECK_LIB(ipc, shmat, X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"))
  450. # Solaris 2.6 and others need -lresolv for res_init
  451. AC_CHECK_FUNCS(res_init, , [
  452. kde_libs_safe="$LIBS"
  453. LIBS="$LIBS $X_EXTRA_LIBS -lresolv"
  454. AC_TRY_LINK(
  455. [
  456. #include <resolv.h>
  457. ],
  458. [
  459. res_init();
  460. ],
  461. LIBRESOLV="-lresolv"
  462. X_EXTRA_LIBS="$X_EXTRA_LIBS $LIBRESOLV"
  463. AC_DEFINE(HAVE_RES_INIT, 1, [Define if you have the res_init function])
  464. )
  465. LIBS=$kde_libs_safe
  466. ])
  467. LIBSOCKET="$X_EXTRA_LIBS"
  468. AC_SUBST(LIBSOCKET)
  469. AC_SUBST(LIBRESOLV)
  470. AC_SUBST(X_EXTRA_LIBS)
  471. AC_CHECK_LIB(ucb, killpg, [LIBUCB="-lucb"]) dnl for Solaris2.4
  472. AC_SUBST(LIBUCB)
  473. case $host in dnl this *is* LynxOS specific
  474. *-*-lynxos* )
  475. AC_MSG_CHECKING([LynxOS header file wrappers])
  476. [CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__"]
  477. AC_MSG_RESULT(disabled)
  478. AC_CHECK_LIB(bsd, gethostbyname, [LIBSOCKET="-lbsd"]) dnl for LynxOS
  479. ;;
  480. esac
  481. KDE_CHECK_TYPES
  482. KDE_CHECK_LIBDL
  483. ])
  484. dnl ------------------------------------------------------------------------
  485. dnl Find the header files and libraries for X-Windows. Extended the
  486. dnl macro AC_PATH_X
  487. dnl ------------------------------------------------------------------------
  488. dnl
  489. AC_DEFUN(K_PATH_X,
  490. [
  491. AC_REQUIRE([AC_PROG_CPP])dnl
  492. AC_REQUIRE([KDE_MISC_TESTS])dnl
  493. AC_MSG_CHECKING(for X)
  494. AC_LANG_SAVE
  495. AC_LANG_C
  496. AC_CACHE_VAL(kde_cv_have_x,
  497. [# One or both of the vars are not set, and there is no cached value.
  498. if test "{$x_includes+set}" = set || test "$x_includes" = NONE; then
  499. kde_x_includes=NO
  500. else
  501. kde_x_includes=$x_includes
  502. fi
  503. if test "{$x_libraries+set}" = set || test "$x_libraries" = NONE; then
  504. kde_x_libraries=NO
  505. else
  506. kde_x_libraries=$x_libraries
  507. fi
  508. # below we use the standard autoconf calls
  509. ac_x_libraries=$kde_x_libraries
  510. ac_x_includes=$kde_x_includes
  511. _AC_PATH_X_DIRECT
  512. dnl AC_PATH_X_XMKMF picks /usr/lib as the path for the X libraries.
  513. dnl Unfortunately, if compiling with the N32 ABI, this is not the correct
  514. dnl location. The correct location is /usr/lib32 or an undefined value
  515. dnl (the linker is smart enough to pick the correct default library).
  516. dnl Things work just fine if you use just AC_PATH_X_DIRECT.
  517. dnl Solaris has a similar problem. AC_PATH_X_XMKMF forces x_includes to
  518. dnl /usr/openwin/include, which doesn't work. /usr/include does work, so
  519. dnl x_includes should be left alone.
  520. case "$host" in
  521. mips-sgi-irix6*)
  522. ;;
  523. *-*-solaris*)
  524. ;;
  525. *)
  526. _AC_PATH_X_XMKMF
  527. if test -z "$ac_x_includes"; then
  528. ac_x_includes="."
  529. fi
  530. if test -z "$ac_x_libraries"; then
  531. ac_x_libraries="/usr/lib"
  532. fi
  533. esac
  534. #from now on we use our own again
  535. # when the user already gave --x-includes, we ignore
  536. # what the standard autoconf macros told us.
  537. if test "$kde_x_includes" = NO; then
  538. kde_x_includes=$ac_x_includes
  539. fi
  540. # for --x-libraries too
  541. if test "$kde_x_libraries" = NO; then
  542. kde_x_libraries=$ac_x_libraries
  543. fi
  544. if test "$kde_x_includes" = NO; then
  545. AC_MSG_ERROR([Can't find X includes. Please check your installation and add the correct paths!])
  546. fi
  547. if test "$kde_x_libraries" = NO; then
  548. AC_MSG_ERROR([Can't find X libraries. Please check your installation and add the correct paths!])
  549. fi
  550. # Record where we found X for the cache.
  551. kde_cv_have_x="have_x=yes \
  552. kde_x_includes=$kde_x_includes kde_x_libraries=$kde_x_libraries"
  553. ])dnl
  554. eval "$kde_cv_have_x"
  555. if test "$have_x" != yes; then
  556. AC_MSG_RESULT($have_x)
  557. no_x=yes
  558. else
  559. AC_MSG_RESULT([libraries $kde_x_libraries, headers $kde_x_includes])
  560. fi
  561. if test -z "$kde_x_includes" || test "x$kde_x_includes" = xNONE; then
  562. X_INCLUDES=""
  563. x_includes="."; dnl better than nothing :-
  564. else
  565. x_includes=$kde_x_includes
  566. X_INCLUDES="-I$x_includes"
  567. fi
  568. if test -z "$kde_x_libraries" || test "x$kde_x_libraries" = xNONE; then
  569. X_LDFLAGS=""
  570. x_libraries="/usr/lib"; dnl better than nothing :-
  571. else
  572. x_libraries=$kde_x_libraries
  573. X_LDFLAGS="-L$x_libraries"
  574. fi
  575. all_includes="$X_INCLUDES"
  576. all_libraries="$X_LDFLAGS"
  577. AC_SUBST(X_INCLUDES)
  578. AC_SUBST(X_LDFLAGS)
  579. AC_SUBST(x_libraries)
  580. AC_SUBST(x_includes)
  581. # Check for libraries that X11R6 Xt/Xaw programs need.
  582. ac_save_LDFLAGS="$LDFLAGS"
  583. LDFLAGS="$LDFLAGS $X_LDFLAGS"
  584. # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
  585. # check for ICE first), but we must link in the order -lSM -lICE or
  586. # we get undefined symbols. So assume we have SM if we have ICE.
  587. # These have to be linked with before -lX11, unlike the other
  588. # libraries we check for below, so use a different variable.
  589. # --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
  590. AC_CHECK_LIB(ICE, IceConnectionNumber,
  591. [LIBSM="-lSM -lICE"], , $X_EXTRA_LIBS)
  592. AC_SUBST(LIBSM)
  593. LDFLAGS="$ac_save_LDFLAGS"
  594. AC_SUBST(X_PRE_LIBS)
  595. LIB_X11='-lX11 $(LIBSOCKET)'
  596. AC_SUBST(LIB_X11)
  597. AC_MSG_CHECKING(for libXext)
  598. AC_CACHE_VAL(kde_cv_have_libXext,
  599. [
  600. kde_ldflags_safe="$LDFLAGS"
  601. kde_libs_safe="$LIBS"
  602. LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS"
  603. LIBS="-lXext -lX11 $LIBSOCKET"
  604. AC_TRY_LINK([
  605. #include <stdio.h>
  606. #ifdef STDC_HEADERS
  607. # include <stdlib.h>
  608. #endif
  609. ],
  610. [
  611. printf("hello Xext\n");
  612. ],
  613. kde_cv_have_libXext=yes,
  614. kde_cv_have_libXext=no
  615. )
  616. LDFLAGS=$kde_ldflags_safe
  617. LIBS=$kde_libs_safe
  618. ])
  619. AC_MSG_RESULT($kde_cv_have_libXext)
  620. if test "$kde_cv_have_libXext" = "no"; then
  621. AC_MSG_ERROR([We need a working libXext to proceed. Since configure
  622. can't find it itself, we stop here assuming that make wouldn't find
  623. them either.])
  624. fi
  625. AC_MSG_CHECKING(for Xinerama)
  626. AC_ARG_WITH(xinerama,
  627. [ --with-xinerama enable support for Xinerama ],
  628. [
  629. no_xinerama=no
  630. ], [
  631. no_xinerama=yes
  632. ]
  633. )
  634. kde_save_LDFLAGS="$LDFLAGS"
  635. kde_save_CFLAGS="$CFLAGS"
  636. kde_save_LIBS="$LIBS"
  637. LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS"
  638. CFLAGS="$CFLAGS -I$x_includes"
  639. LIBS="-lXinerama -lXext"
  640. if test "x$no_xinerama" = "xno"; then
  641. AC_CACHE_VAL(ac_cv_have_xinerama,
  642. [
  643. AC_TRY_LINK([#include <X11/Xlib.h>
  644. #include <X11/extensions/Xinerama.h>],
  645. [XineramaIsActive(NULL);],
  646. [ac_cv_have_xinerama="yes"],
  647. [ac_cv_have_xinerama="no"])
  648. ])
  649. else
  650. ac_cv_have_xinerama=no;
  651. fi
  652. AC_MSG_RESULT($ac_cv_have_xinerama)
  653. LIBXINERAMA=""
  654. if test "$ac_cv_have_xinerama" = "yes"; then
  655. AC_DEFINE(HAVE_XINERAMA, 1, [Define if you want Xinerama support])
  656. LIBXINERAMA="-lXinerama"
  657. fi
  658. AC_SUBST(LIBXINERAMA)
  659. LDFLAGS="$kde_save_LDFLAGS"
  660. CFLAGS="$kde_save_CFLAGS"
  661. LIBS="$kde_save_LIBS"
  662. AC_LANG_RESTORE
  663. ])
  664. AC_DEFUN(KDE_PRINT_QT_PROGRAM,
  665. [
  666. AC_REQUIRE([KDE_USE_QT])
  667. cat > conftest.$ac_ext <<EOF
  668. #include "confdefs.h"
  669. #include <qglobal.h>
  670. #include <qapplication.h>
  671. EOF
  672. if test "$kde_qtver" = "2"; then
  673. cat >> conftest.$ac_ext <<EOF
  674. #include <qevent.h>
  675. #include <qstring.h>
  676. #include <qstyle.h>
  677. EOF
  678. if test $kde_qtsubver -gt 0; then
  679. cat >> conftest.$ac_ext <<EOF
  680. #include <qiconview.h>
  681. EOF
  682. fi
  683. fi
  684. echo "#if ! ($kde_qt_verstring)" >> conftest.$ac_ext
  685. cat >> conftest.$ac_ext <<EOF
  686. #error 1
  687. #endif
  688. int main() {
  689. EOF
  690. if test "$kde_qtver" = "2"; then
  691. cat >> conftest.$ac_ext <<EOF
  692. QStringList *t = new QStringList();
  693. EOF
  694. if test $kde_qtsubver -gt 0; then
  695. cat >> conftest.$ac_ext <<EOF
  696. QIconView iv(0);
  697. iv.setWordWrapIconText(false);
  698. QString s;
  699. s.setLatin1("Elvis is alive", 14);
  700. int magnolia = QEvent::Speech; /* new in 2.2 beta2 */
  701. EOF
  702. fi
  703. fi
  704. cat >> conftest.$ac_ext <<EOF
  705. return 0;
  706. }
  707. EOF
  708. ])
  709. AC_DEFUN(KDE_USE_QT,
  710. [
  711. if test -z "$1"; then
  712. kde_qtver=2
  713. kde_qtsubver=1
  714. else
  715. kde_qtsubver=`echo "$1" | sed -e 's#[0-9]\+\.\([0-9]\+\).*#\1#'`
  716. # following is the check if subversion isn´t found in passed argument
  717. if test "$kde_qtsubver" = "$1"; then
  718. kde_qtsubver=1
  719. fi
  720. kde_qtver=`echo "$1" | sed -e 's#^\([0-9]\+\)\..*#\1#'`
  721. if test "$kde_qtver" = "1"; then
  722. kde_qtsubver=42
  723. else
  724. # this is the version number fallback to 2.1, unless major version is 1 or 2
  725. if test "$kde_qtver" != "2"; then
  726. kde_qtver=2
  727. kde_qtsubver=1
  728. fi
  729. fi
  730. fi
  731. if test -z "$2"; then
  732. if test $kde_qtver = 2; then
  733. if test $kde_qtsubver -gt 0; then
  734. kde_qt_minversion=">= Qt 2.2.2"
  735. else
  736. kde_qt_minversion=">= Qt 2.0.2"
  737. fi
  738. else
  739. kde_qt_minversion=">= 1.42 and < 2.0"
  740. fi
  741. else
  742. kde_qt_minversion=$2
  743. fi
  744. if test -z "$3"; then
  745. if test $kde_qtver = 2; then
  746. if test $kde_qtsubver -gt 0; then
  747. kde_qt_verstring="QT_VERSION >= 222"
  748. else
  749. kde_qt_verstring="QT_VERSION >= 200"
  750. fi
  751. else
  752. kde_qt_verstring="QT_VERSION >= 142 && QT_VERSION < 200"
  753. fi
  754. else
  755. kde_qt_verstring=$3
  756. fi
  757. if test $kde_qtver = 2; then
  758. kde_qt_dirs="$QTDIR /usr/lib/qt2 /usr/lib/qt"
  759. else
  760. kde_qt_dirs="$QTDIR /usr/lib/qt"
  761. fi
  762. ])
  763. AC_DEFUN(KDE_CHECK_QT_DIRECT,
  764. [
  765. AC_REQUIRE([KDE_USE_QT])
  766. AC_MSG_CHECKING([if Qt compiles without flags])
  767. AC_CACHE_VAL(kde_cv_qt_direct,
  768. [
  769. AC_LANG_SAVE
  770. AC_LANG_CPLUSPLUS
  771. ac_LD_LIBRARY_PATH_safe=$LD_LIBRARY_PATH
  772. ac_LIBRARY_PATH="$LIBRARY_PATH"
  773. ac_cxxflags_safe="$CXXFLAGS"
  774. ac_ldflags_safe="$LDFLAGS"
  775. ac_libs_safe="$LIBS"
  776. CXXFLAGS="$CXXFLAGS -I$qt_includes"
  777. LDFLAGS="$LDFLAGS $X_LDFLAGS"
  778. LIBS="$LIBQT -lXext -lX11 $LIBSOCKET"
  779. LD_LIBRARY_PATH=
  780. export LD_LIBRARY_PATH
  781. LIBRARY_PATH=
  782. export LIBRARY_PATH
  783. KDE_PRINT_QT_PROGRAM
  784. if AC_TRY_EVAL(ac_link) && test -s conftest; then
  785. kde_cv_qt_direct="yes"
  786. else
  787. kde_cv_qt_direct="no"
  788. echo "configure: failed program was:" >&AC_FD_CC
  789. cat conftest.$ac_ext >&AC_FD_CC
  790. fi
  791. rm -f conftest*
  792. CXXFLAGS="$ac_cxxflags_safe"
  793. LDFLAGS="$ac_ldflags_safe"
  794. LIBS="$ac_libs_safe"
  795. LD_LIBRARY_PATH="$ac_LD_LIBRARY_PATH_safe"
  796. export LD_LIBRARY_PATH
  797. LIBRARY_PATH="$ac_LIBRARY_PATH"
  798. export LIBRARY_PATH
  799. AC_LANG_RESTORE
  800. ])
  801. if test "$kde_cv_qt_direct" = "yes"; then
  802. AC_MSG_RESULT(yes)
  803. $1
  804. else
  805. AC_MSG_RESULT(no)
  806. $2
  807. fi
  808. ])
  809. dnl ------------------------------------------------------------------------
  810. dnl Try to find the Qt headers and libraries.
  811. dnl $(QT_LDFLAGS) will be -Lqtliblocation (if needed)
  812. dnl and $(QT_INCLUDES) will be -Iqthdrlocation (if needed)
  813. dnl ------------------------------------------------------------------------
  814. dnl
  815. AC_DEFUN(AC_PATH_QT_1_3,
  816. [
  817. AC_REQUIRE([K_PATH_X])
  818. AC_REQUIRE([KDE_USE_QT])
  819. dnl ------------------------------------------------------------------------
  820. dnl Add configure flag to enable linking to MT version of Qt library.
  821. dnl ------------------------------------------------------------------------
  822. AC_ARG_ENABLE(
  823. mt,
  824. [ --enable-mt link to threaded Qt (experimental)],
  825. kde_use_qt_mt=$enableval,
  826. kde_use_qt_mt=no
  827. )
  828. USING_QT_MT=""
  829. dnl ------------------------------------------------------------------------
  830. dnl If we got --enable-qt-mt then adjust some vars for the host.
  831. dnl ------------------------------------------------------------------------
  832. if test "x$kde_use_qt_mt" = "xyes"; then
  833. case $host in
  834. *-*-linux-* | *-*-kfreebsd*-gnu)
  835. if test "x$GCC" = "xyes"; then
  836. CPPFLAGS="$CPPFLAGS -DQT_THREAD_SUPPORT -pthread"
  837. X_EXTRA_LIBS="$X_EXTRA_LIBS -pthread"
  838. else
  839. AC_MSG_WARN([Compiler is not gcc. MT support disabled.])
  840. fi
  841. ;;
  842. *)
  843. AC_MSG_WARN([MT not yet supported on $host - disabled.])
  844. ;;
  845. esac
  846. fi
  847. kde_qt_was_given=yes
  848. dnl ------------------------------------------------------------------------
  849. dnl If we haven't been told how to link to Qt, we work it out for ourselves.
  850. dnl ------------------------------------------------------------------------
  851. if test -z "$LIBQT_GLOB"; then
  852. LIBQT_GLOB="libqt.*"
  853. fi
  854. if test -z "$LIBQT"; then
  855. LIBQT="-lqt"
  856. kde_int_qt="-lqt"
  857. dnl ------------------------------------------------------------------------
  858. dnl If we got --enable-qt-mt then adjust the Qt library name for the host.
  859. dnl ------------------------------------------------------------------------
  860. if test "x$kde_use_qt_mt" = "xyes"; then
  861. case $host in
  862. *-*-linux-* | *-*-kfreebsd*-gnu)
  863. if test "x$GCC" = "xyes"; then
  864. LIBQT="-lqt-mt"
  865. kde_int_qt="-lqt-mt"
  866. LIBQT_GLOB="libqt-mt.*"
  867. USING_QT_MT="using -mt"
  868. fi
  869. ;;
  870. esac
  871. fi
  872. kde_qt_was_given=no
  873. else
  874. kde_int_qt="$LIBQT"
  875. fi
  876. if test $kde_qtver = 2; then
  877. AC_REQUIRE([AC_FIND_PNG])
  878. AC_REQUIRE([AC_FIND_JPEG])
  879. LIBQT="$LIBQT $LIBPNG $LIBJPEG"
  880. fi
  881. AC_MSG_CHECKING([for Qt])
  882. LIBQT="$LIBQT $X_PRE_LIBS -lXext -lX11 $LIBSM $LIBSOCKET"
  883. ac_qt_includes=NO ac_qt_libraries=NO ac_qt_bindir=NO
  884. qt_libraries=""
  885. qt_includes=""
  886. AC_ARG_WITH(qt-dir,
  887. [ --with-qt-dir=DIR where the root of Qt is installed ],
  888. [ ac_qt_includes="$withval"/include
  889. ac_qt_libraries="$withval"/lib
  890. ac_qt_bindir="$withval"/bin
  891. ])
  892. AC_ARG_WITH(qt-includes,
  893. [ --with-qt-includes=DIR where the Qt includes are. ],
  894. [
  895. ac_qt_includes="$withval"
  896. ])
  897. kde_qt_libs_given=no
  898. AC_ARG_WITH(qt-libraries,
  899. [ --with-qt-libraries=DIR where the Qt library is installed.],
  900. [ ac_qt_libraries="$withval"
  901. kde_qt_libs_given=yes
  902. ])
  903. AC_CACHE_VAL(ac_cv_have_qt,
  904. [#try to guess Qt locations
  905. qt_incdirs=""
  906. for dir in $kde_qt_dirs; do
  907. qt_incdirs="$qt_incdirs $dir/include $dir"
  908. done
  909. 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 $x_includes"
  910. if test ! "$ac_qt_includes" = "NO"; then
  911. qt_incdirs="$ac_qt_includes $qt_incdirs"
  912. fi
  913. if test "$kde_qtver" = "2"; then
  914. kde_qt_header=qstyle.h
  915. else
  916. kde_qt_header=qglobal.h
  917. fi
  918. AC_FIND_FILE($kde_qt_header, $qt_incdirs, qt_incdir)
  919. ac_qt_includes="$qt_incdir"
  920. qt_libdirs=""
  921. for dir in $kde_qt_dirs; do
  922. qt_libdirs="$qt_libdirs $dir/lib $dir"
  923. done
  924. qt_libdirs="$QTLIB $qt_libdirs /usr/X11R6/lib /usr/lib /usr/local/qt/lib $x_libraries"
  925. if test ! "$ac_qt_libraries" = "NO"; then
  926. qt_libdir=$ac_qt_libraries
  927. else
  928. qt_libdirs="$ac_qt_libraries $qt_libdirs"
  929. # if the Qt was given, the chance is too big that libqt.* doesn't exist
  930. qt_libdir=NONE
  931. for dir in $qt_libdirs; do
  932. try="ls -1 $dir/${LIBQT_GLOB}"
  933. if test -n "`$try 2> /dev/null`"; then qt_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
  934. done
  935. fi
  936. ac_qt_libraries="$qt_libdir"
  937. AC_LANG_SAVE
  938. AC_LANG_CPLUSPLUS
  939. ac_cxxflags_safe="$CXXFLAGS"
  940. ac_ldflags_safe="$LDFLAGS"
  941. ac_libs_safe="$LIBS"
  942. CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
  943. LDFLAGS="$LDFLAGS -L$qt_libdir $all_libraries $USER_LDFLAGS"
  944. LIBS="$LIBS $LIBQT"
  945. KDE_PRINT_QT_PROGRAM
  946. if AC_TRY_EVAL(ac_link) && test -s conftest; then
  947. rm -f conftest*
  948. else
  949. echo "configure: failed program was:" >&AC_FD_CC
  950. cat conftest.$ac_ext >&AC_FD_CC
  951. ac_qt_libraries="NO"
  952. fi
  953. rm -f conftest*
  954. CXXFLAGS="$ac_cxxflags_safe"
  955. LDFLAGS="$ac_ldflags_safe"
  956. LIBS="$ac_libs_safe"
  957. AC_LANG_RESTORE
  958. if test "$ac_qt_includes" = NO || test "$ac_qt_libraries" = NO; then
  959. ac_cv_have_qt="have_qt=no"
  960. ac_qt_notfound=""
  961. if test "$ac_qt_includes" = NO; then
  962. if test "$ac_qt_libraries" = NO; then
  963. ac_qt_notfound="(headers and libraries)";
  964. else
  965. ac_qt_notfound="(headers)";
  966. fi
  967. else
  968. ac_qt_notfound="(libraries)";
  969. fi
  970. AC_MSG_ERROR([Qt ($kde_qt_minversion) $ac_qt_notfound not found. Please check your installation!
  971. For more details about this problem, look at the end of config.log.])
  972. else
  973. have_qt="yes"
  974. fi
  975. ])
  976. eval "$ac_cv_have_qt"
  977. if test "$have_qt" != yes; then
  978. AC_MSG_RESULT([$have_qt]);
  979. else
  980. ac_cv_have_qt="have_qt=yes \
  981. ac_qt_includes=$ac_qt_includes ac_qt_libraries=$ac_qt_libraries"
  982. AC_MSG_RESULT([libraries $ac_qt_libraries, headers $ac_qt_includes $USING_QT_MT])
  983. qt_libraries="$ac_qt_libraries"
  984. qt_includes="$ac_qt_includes"
  985. fi
  986. if test ! "$kde_qt_libs_given" = "yes"; then
  987. KDE_CHECK_QT_DIRECT(qt_libraries= ,[])
  988. fi
  989. AC_SUBST(qt_libraries)
  990. AC_SUBST(qt_includes)
  991. if test "$qt_includes" = "$x_includes" || test -z "$qt_includes"; then
  992. QT_INCLUDES="";
  993. else
  994. QT_INCLUDES="-I$qt_includes"
  995. all_includes="$QT_INCLUDES $all_includes"
  996. fi
  997. if test "$qt_libraries" = "$x_libraries" || test -z "$qt_libraries"; then
  998. QT_LDFLAGS=""
  999. else
  1000. QT_LDFLAGS="-L$qt_libraries"
  1001. all_libraries="$all_libraries $QT_LDFLAGS"
  1002. fi
  1003. AC_SUBST(QT_INCLUDES)
  1004. AC_SUBST(QT_LDFLAGS)
  1005. AC_PATH_QT_MOC_UIC
  1006. LIB_QT="$kde_int_qt "'$(LIBPNG) $(LIBJPEG) -lXext $(LIB_X11) $(LIBSM)'
  1007. AC_SUBST(LIB_QT)
  1008. ])
  1009. AC_DEFUN(AC_PATH_QT,
  1010. [
  1011. AC_PATH_QT_1_3
  1012. ])
  1013. AC_DEFUN(KDE_CHECK_FINAL,
  1014. [
  1015. AC_ARG_ENABLE(final, [ --enable-final build size optimized apps (experimental - needs lots of memory)],
  1016. kde_use_final=$enableval, kde_use_final=no)
  1017. KDE_COMPILER_REPO
  1018. if test "x$kde_use_final" = "xyes"; then
  1019. KDE_USE_FINAL_TRUE=""
  1020. KDE_USE_FINAL_FALSE="#"
  1021. else
  1022. KDE_USE_FINAL_TRUE="#"
  1023. KDE_USE_FINAL_FALSE=""
  1024. fi
  1025. AC_SUBST(KDE_USE_FINAL_TRUE)
  1026. AC_SUBST(KDE_USE_FINAL_FALSE)
  1027. AC_ARG_ENABLE(closure, [ --disable-closure don't delay template instantiation],
  1028. kde_use_closure=$enableval, kde_use_closure=yes)
  1029. if test "x$kde_use_closure" = "xyes"; then
  1030. KDE_USE_CLOSURE_TRUE=""
  1031. KDE_USE_CLOSURE_FALSE="#"
  1032. # CXXFLAGS="$CXXFLAGS $REPO"
  1033. else
  1034. KDE_USE_CLOSURE_TRUE="#"
  1035. KDE_USE_CLOSURE_FALSE=""
  1036. fi
  1037. AC_SUBST(KDE_USE_CLOSURE_TRUE)
  1038. AC_SUBST(KDE_USE_CLOSURE_FALSE)
  1039. ])
  1040. dnl ------------------------------------------------------------------------
  1041. dnl Now, the same with KDE
  1042. dnl $(KDE_LDFLAGS) will be the kdeliblocation (if needed)
  1043. dnl and $(kde_includes) will be the kdehdrlocation (if needed)
  1044. dnl ------------------------------------------------------------------------
  1045. dnl
  1046. AC_DEFUN(AC_BASE_PATH_KDE,
  1047. [
  1048. AC_PREREQ([2.13])
  1049. AC_REQUIRE([AC_PATH_QT])dnl
  1050. AC_CHECK_RPATH
  1051. AC_MSG_CHECKING([for KDE])
  1052. if test "${prefix}" != NONE; then
  1053. kde_includes=${prefix}/include
  1054. ac_kde_includes=$prefix/include
  1055. if test "${exec_prefix}" != NONE; then
  1056. kde_libraries=${exec_prefix}/lib
  1057. ac_kde_libraries=$exec_prefix/lib
  1058. else
  1059. kde_libraries=${prefix}/lib
  1060. ac_kde_libraries=$prefix/lib
  1061. fi
  1062. else
  1063. ac_kde_includes=
  1064. ac_kde_libraries=
  1065. kde_libraries=""
  1066. kde_includes=""
  1067. fi
  1068. AC_CACHE_VAL(ac_cv_have_kde,
  1069. [#try to guess kde locations
  1070. if test "$kde_qtver" = 1; then
  1071. kde_check_header="ksock.h"
  1072. kde_check_lib="libkdecore.la"
  1073. else
  1074. kde_check_header="ksharedptr.h"
  1075. kde_check_lib="libkio.la"
  1076. fi
  1077. if test -z "$1"; then
  1078. kde_incdirs="/usr/lib/kde/include /usr/local/kde/include /usr/local/include /usr/kde/include /usr/include/kde /usr/include /opt/kde2/include /opt/kde/include $x_includes $qt_includes"
  1079. test -n "$KDEDIR" && kde_incdirs="$KDEDIR/include $KDEDIR/include/kde $KDEDIR $kde_incdirs"
  1080. kde_incdirs="$ac_kde_includes $kde_incdirs"
  1081. AC_FIND_FILE($kde_check_header, $kde_incdirs, kde_incdir)
  1082. ac_kde_includes="$kde_incdir"
  1083. if test -n "$ac_kde_includes" && test ! -r "$ac_kde_includes/$kde_check_header"; then
  1084. AC_MSG_ERROR([
  1085. in the prefix, you've chosen, are no KDE headers installed. This will fail.
  1086. So, check this please and use another prefix!])
  1087. fi
  1088. kde_libdirs="/usr/lib/kde/lib /usr/local/kde/lib /usr/kde/lib /usr/lib/kde /usr/lib /usr/X11R6/lib /usr/local/lib /opt/kde2/lib /opt/kde/lib /usr/X11R6/kde/lib"
  1089. test -n "$KDEDIR" && kde_libdirs="$KDEDIR/lib $KDEDIR $kde_libdirs"
  1090. kde_libdirs="$ac_kde_libraries $kde_libdirs"
  1091. AC_FIND_FILE($kde_check_lib, $kde_libdirs, kde_libdir)
  1092. ac_kde_libraries="$kde_libdir"
  1093. if test -n "$ac_kde_libraries" && test ! -r "$ac_kde_libraries/$kde_check_lib"; then
  1094. AC_MSG_ERROR([
  1095. in the prefix, you've chosen, are no KDE libraries installed. This will fail.
  1096. So, check this please and use another prefix!])
  1097. fi
  1098. ac_kde_libraries="$kde_libdir"
  1099. if test "$ac_kde_includes" = NO || test "$ac_kde_libraries" = NO; then
  1100. ac_cv_have_kde="have_kde=no"
  1101. else
  1102. ac_cv_have_kde="have_kde=yes \
  1103. ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
  1104. fi
  1105. else dnl test -z $1
  1106. ac_cv_have_kde="have_kde=no"
  1107. fi
  1108. ])dnl
  1109. eval "$ac_cv_have_kde"
  1110. if test "$have_kde" != "yes"; then
  1111. if test "${prefix}" = NONE; then
  1112. ac_kde_prefix="$ac_default_prefix"
  1113. else
  1114. ac_kde_prefix="$prefix"
  1115. fi
  1116. if test "$exec_prefix" = NONE; then
  1117. ac_kde_exec_prefix="$ac_kde_prefix"
  1118. AC_MSG_RESULT([will be installed in $ac_kde_prefix])
  1119. else
  1120. ac_kde_exec_prefix="$exec_prefix"
  1121. AC_MSG_RESULT([will be installed in $ac_kde_prefix and $ac_kde_exec_prefix])
  1122. fi
  1123. kde_libraries="${ac_kde_exec_prefix}/lib"
  1124. kde_includes=${ac_kde_prefix}/include
  1125. else
  1126. ac_cv_have_kde="have_kde=yes \
  1127. ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
  1128. AC_MSG_RESULT([libraries $ac_kde_libraries, headers $ac_kde_includes])
  1129. kde_libraries="$ac_kde_libraries"
  1130. kde_includes="$ac_kde_includes"
  1131. fi
  1132. AC_SUBST(kde_libraries)
  1133. AC_SUBST(kde_includes)
  1134. if test "$kde_includes" = "$x_includes" || test "$kde_includes" = "$qt_includes" || test "$kde_includes" = "/usr/include"; then
  1135. KDE_INCLUDES=""
  1136. else
  1137. KDE_INCLUDES="-I$kde_includes"
  1138. all_includes="$KDE_INCLUDES $all_includes"
  1139. fi
  1140. KDE_LDFLAGS="-L$kde_libraries"
  1141. if test ! "$kde_libraries" = "$x_libraries" && test ! "$kde_libraries" = "$qt_libraries" ; then
  1142. all_libraries="$all_libraries $KDE_LDFLAGS"
  1143. fi
  1144. AC_SUBST(KDE_LDFLAGS)
  1145. AC_SUBST(KDE_INCLUDES)
  1146. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  1147. all_libraries="$all_libraries $USER_LDFLAGS"
  1148. all_includes="$all_includes $USER_INCLUDES"
  1149. AC_SUBST(all_includes)
  1150. AC_SUBST(all_libraries)
  1151. AC_SUBST(AUTODIRS)
  1152. ])
  1153. AC_DEFUN(KDE_CHECK_EXTRA_LIBS,
  1154. [
  1155. AC_MSG_CHECKING(for extra includes)
  1156. AC_ARG_WITH(extra-includes, [ --with-extra-includes=DIR
  1157. adds non standard include paths],
  1158. kde_use_extra_includes="$withval",
  1159. kde_use_extra_includes=NONE
  1160. )
  1161. kde_extra_includes=
  1162. if test -n "$kde_use_extra_includes" && \
  1163. test "$kde_use_extra_includes" != "NONE"; then
  1164. ac_save_ifs=$IFS
  1165. IFS=':'
  1166. for dir in $kde_use_extra_includes; do
  1167. kde_extra_includes="$kde_extra_includes $dir"
  1168. USER_INCLUDES="$USER_INCLUDES -I$dir"
  1169. done
  1170. IFS=$ac_save_ifs
  1171. kde_use_extra_includes="added"
  1172. else
  1173. kde_use_extra_includes="no"
  1174. fi
  1175. AC_SUBST(USER_INCLUDES)
  1176. AC_MSG_RESULT($kde_use_extra_includes)
  1177. kde_extra_libs=
  1178. AC_MSG_CHECKING(for extra libs)
  1179. AC_ARG_WITH(extra-libs, [ --with-extra-libs=DIR adds non standard library paths],
  1180. kde_use_extra_libs=$withval,
  1181. kde_use_extra_libs=NONE
  1182. )
  1183. if test -n "$kde_use_extra_libs" && \
  1184. test "$kde_use_extra_libs" != "NONE"; then
  1185. ac_save_ifs=$IFS
  1186. IFS=':'
  1187. for dir in $kde_use_extra_libs; do
  1188. kde_extra_libs="$kde_extra_libs $dir"
  1189. KDE_EXTRA_RPATH="$KDE_EXTRA_RPATH -R $dir"
  1190. USER_LDFLAGS="$USER_LDFLAGS -L$dir"
  1191. done
  1192. IFS=$ac_save_ifs
  1193. kde_use_extra_libs="added"
  1194. else
  1195. kde_use_extra_libs="no"
  1196. fi
  1197. AC_SUBST(USER_LDFLAGS)
  1198. AC_MSG_RESULT($kde_use_extra_libs)
  1199. ])
  1200. AC_DEFUN(KDE_1_CHECK_PATH_HEADERS,
  1201. [
  1202. AC_MSG_CHECKING([for KDE headers installed])
  1203. AC_LANG_SAVE
  1204. AC_LANG_CPLUSPLUS
  1205. cat > conftest.$ac_ext <<EOF
  1206. #ifdef STDC_HEADERS
  1207. # include <stdlib.h>
  1208. #endif
  1209. #include <stdio.h>
  1210. #include "confdefs.h"
  1211. #include <kapp.h>
  1212. int main() {
  1213. printf("kde_htmldir=\\"%s\\"\n", KApplication::kde_htmldir().data());
  1214. printf("kde_appsdir=\\"%s\\"\n", KApplication::kde_appsdir().data());
  1215. printf("kde_icondir=\\"%s\\"\n", KApplication::kde_icondir().data());
  1216. printf("kde_sounddir=\\"%s\\"\n", KApplication::kde_sounddir().data());
  1217. printf("kde_datadir=\\"%s\\"\n", KApplication::kde_datadir().data());
  1218. printf("kde_locale=\\"%s\\"\n", KApplication::kde_localedir().data());
  1219. printf("kde_cgidir=\\"%s\\"\n", KApplication::kde_cgidir().data());
  1220. printf("kde_confdir=\\"%s\\"\n", KApplication::kde_configdir().data());
  1221. printf("kde_mimedir=\\"%s\\"\n", KApplication::kde_mimedir().data());
  1222. printf("kde_toolbardir=\\"%s\\"\n", KApplication::kde_toolbardir().data());
  1223. printf("kde_wallpaperdir=\\"%s\\"\n",
  1224. KApplication::kde_wallpaperdir().data());
  1225. printf("kde_bindir=\\"%s\\"\n", KApplication::kde_bindir().data());
  1226. printf("kde_partsdir=\\"%s\\"\n", KApplication::kde_partsdir().data());
  1227. printf("kde_servicesdir=\\"/tmp/dummy\\"\n");
  1228. printf("kde_servicetypesdir=\\"/tmp/dummy\\"\n");
  1229. printf("kde_moduledir=\\"/tmp/dummy\\"\n");
  1230. return 0;
  1231. }
  1232. EOF
  1233. ac_compile='${CXX-g++} -c $CXXFLAGS $all_includes $CPPFLAGS conftest.$ac_ext'
  1234. if AC_TRY_EVAL(ac_compile); then
  1235. AC_MSG_RESULT(yes)
  1236. else
  1237. AC_MSG_ERROR([your system is not able to compile a small KDE application!
  1238. Check, if you installed the KDE header files correctly.
  1239. For more details about this problem, look at the end of config.log.])
  1240. fi
  1241. AC_LANG_RESTORE
  1242. ])
  1243. AC_DEFUN(KDE_CHECK_KDEQTADDON,
  1244. [
  1245. AC_MSG_CHECKING(for kde-qt-addon)
  1246. AC_CACHE_VAL(kde_cv_have_kdeqtaddon,
  1247. [
  1248. kde_ldflags_safe="$LDFLAGS"
  1249. kde_libs_safe="$LIBS"
  1250. kde_cxxflags_safe="$CXXFLAGS"
  1251. LIBS="-lkde-qt-addon $LIBQT $LIBS"
  1252. CXXFLAGS="$CXXFLAGS -I$prefix/include -I$prefix/include/kde $all_includes"
  1253. LDFLAGS="$LDFLAGS $all_libraries $USER_LDFLAGS"
  1254. AC_TRY_LINK([
  1255. #include <qdom.h>
  1256. ],
  1257. [
  1258. QDomDocument doc;
  1259. ],
  1260. kde_cv_have_kdeqtaddon=yes,
  1261. kde_cv_have_kdeqtaddon=no
  1262. )
  1263. LDFLAGS=$kde_ldflags_safe
  1264. LIBS=$kde_libs_safe
  1265. kde_cxxflags_safe="$CXXFLAGS"
  1266. ])
  1267. AC_MSG_RESULT($kde_cv_have_kdeqtaddon)
  1268. if test "$kde_cv_have_kdeqtaddon" = "no"; then
  1269. AC_MSG_ERROR([Can't find libkde-qt-addon. You need to install it first.
  1270. It is a separate package (and CVS module) named kde-qt-addon.])
  1271. fi
  1272. ])
  1273. AC_DEFUN(KDE_CHECK_KIMGIO,
  1274. [
  1275. AC_REQUIRE([AC_BASE_PATH_KDE])
  1276. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  1277. AC_REQUIRE([AC_FIND_TIFF])
  1278. AC_REQUIRE([AC_FIND_JPEG])
  1279. AC_REQUIRE([AC_FIND_PNG])
  1280. AC_REQUIRE([KDE_CREATE_LIBS_ALIASES])
  1281. if test "$1" = "existance"; then
  1282. AC_LANG_SAVE
  1283. AC_LANG_CPLUSPLUS
  1284. kde_save_LIBS="$LIBS"
  1285. LIBS="$LIBS $all_libraries $LIBJPEG $LIBTIFF $LIBPNG $LIBQT -lm"
  1286. AC_CHECK_LIB(kimgio, kimgioRegister, [
  1287. LIBKIMGIO_EXISTS=yes],LIBKIMGIO_EXISTS=no)
  1288. LIBS="$kde_save_LIBS"
  1289. AC_LANG_RESTORE
  1290. else
  1291. LIBKIMGIO_EXISTS=yes
  1292. fi
  1293. if test "$LIBKIMGIO_EXISTS" = "yes"; then
  1294. LIB_KIMGIO='-lkimgio'
  1295. else
  1296. LIB_KIMGIO=''
  1297. fi
  1298. AC_SUBST(LIB_KIMGIO)
  1299. ])
  1300. AC_DEFUN(KDE_CREATE_LIBS_ALIASES,
  1301. [
  1302. AC_REQUIRE([KDE_MISC_TESTS])
  1303. AC_REQUIRE([KDE_CHECK_LIBDL])
  1304. AC_REQUIRE([K_PATH_X])
  1305. if test $kde_qtver = 2; then
  1306. LIB_KDECORE='-lkdecore'
  1307. AC_SUBST(LIB_KDECORE)
  1308. LIB_KDEUI='-lkdeui'
  1309. AC_SUBST(LIB_KDEUI)
  1310. LIB_KFORMULA='-lkformula'
  1311. AC_SUBST(LIB_KFORMULA)
  1312. LIB_KIO='-lkio'
  1313. AC_SUBST(LIB_KIO)
  1314. LIB_KSYCOCA='-lksycoca'
  1315. AC_SUBST(LIB_KSYCOCA)
  1316. LIB_SMB='-lsmb'
  1317. AC_SUBST(LIB_SMB)
  1318. LIB_KFILE='-lkfile'
  1319. AC_SUBST(LIB_KFILE)
  1320. LIB_KAB='-lkab'
  1321. AC_SUBST(LIB_KAB)
  1322. LIB_KHTML='-lkhtml'
  1323. AC_SUBST(LIB_KHTML)
  1324. LIB_KSPELL='-lkspell'
  1325. AC_SUBST(LIB_KSPELL)
  1326. LIB_KPARTS='-lkparts'
  1327. AC_SUBST(LIB_KPARTS)
  1328. LIB_KWRITE='-lkwrite'
  1329. AC_SUBST(LIB_KWRITE)
  1330. else
  1331. LIB_KDECORE='-lkdecore -lXext $(LIB_QT)'
  1332. AC_SUBST(LIB_KDECORE)
  1333. LIB_KDEUI='-lkdeui $(LIB_KDECORE)'
  1334. AC_SUBST(LIB_KDEUI)
  1335. LIB_KFM='-lkfm $(LIB_KDECORE)'
  1336. AC_SUBST(LIB_KFM)
  1337. LIB_KFILE='-lkfile $(LIB_KFM) $(LIB_KDEUI)'
  1338. AC_SUBST(LIB_KFILE)
  1339. LIB_KAB='-lkab $(LIB_KIMGIO) $(LIB_KDECORE)'
  1340. AC_SUBST(LIB_KAB)
  1341. fi
  1342. ])
  1343. AC_DEFUN(AC_PATH_KDE,
  1344. [
  1345. AC_BASE_PATH_KDE
  1346. AC_ARG_ENABLE(path-check, [ --disable-path-check don't try to find out, where to install],
  1347. [
  1348. if test "$enableval" = "no";
  1349. then ac_use_path_checking="default"
  1350. else ac_use_path_checking=""
  1351. fi
  1352. ],
  1353. [
  1354. if test "$kde_qtver" = 1;
  1355. then ac_use_path_checking=""
  1356. else ac_use_path_checking="default"
  1357. fi
  1358. ]
  1359. )
  1360. AC_CREATE_KFSSTND($ac_use_path_checking)
  1361. AC_SUBST_KFSSTND
  1362. KDE_CREATE_LIBS_ALIASES
  1363. ])
  1364. dnl obsolete
  1365. AC_DEFUN(AC_CHECK_SETENV,
  1366. [
  1367. AC_OBSOLETE([$0], [; instead use AC_CHECK_FUNCS([setenv unsetenv])])dnl
  1368. AC_CHECK_FUNCS([setenv unsetenv])
  1369. ])
  1370. AC_DEFUN(AC_CHECK_GETDOMAINNAME,
  1371. [
  1372. AC_MSG_CHECKING(for getdomainname)
  1373. AC_CACHE_VAL(ac_cv_func_getdomainname,
  1374. [
  1375. AC_LANG_SAVE
  1376. AC_LANG_CPLUSPLUS
  1377. save_CXXFLAGS="$CXXFLAGS"
  1378. kde_safe_LIBS="$LIBS"
  1379. LIBS="$LIBS $X_EXTRA_LIBS"
  1380. if test "$GCC" = "yes"; then
  1381. CXXFLAGS="$CXXFLAGS -pedantic-errors"
  1382. fi
  1383. AC_TRY_COMPILE([
  1384. #include <stdlib.h>
  1385. #include <unistd.h>
  1386. ],
  1387. [
  1388. char buffer[200];
  1389. getdomainname(buffer, 200);
  1390. ],
  1391. ac_cv_func_getdomainname=yes,
  1392. ac_cv_func_getdomainname=no)
  1393. CXXFLAGS="$save_CXXFLAGS"
  1394. LIBS=$kde_safe_LIBS
  1395. AC_LANG_RESTORE
  1396. ])
  1397. AC_MSG_RESULT($ac_cv_func_getdomainname)
  1398. AC_MSG_CHECKING([if getdomainname needs custom prototype])
  1399. AC_CACHE_VAL(ac_cv_proto_getdomainname,
  1400. [
  1401. AC_LANG_SAVE
  1402. AC_LANG_CPLUSPLUS
  1403. if eval "test \"`echo $ac_cv_func_getdomainname`\" = yes"; then
  1404. ac_cv_proto_getdomainname=no
  1405. else
  1406. kde_safe_libs=$LIBS
  1407. LIBS="$LIBS $X_EXTRA_LIBS"
  1408. AC_TRY_LINK([
  1409. #include <stdlib.h>
  1410. #include <unistd.h>
  1411. extern "C" int getdomainname (char *, int);
  1412. ],
  1413. [
  1414. char buffer[200];
  1415. getdomainname(buffer, 200);
  1416. ],
  1417. ac_cv_func_getdomainname=yes
  1418. ac_cv_proto_getdomainname=yes,
  1419. AC_MSG_RESULT([fatal error])
  1420. AC_MSG_ERROR([getdomainname unavailable]))
  1421. fi
  1422. LIBS=$kde_safe_libs
  1423. AC_LANG_RESTORE
  1424. ])
  1425. AC_MSG_RESULT($ac_cv_proto_getdomainname)
  1426. if eval "test \"`echo $ac_cv_func_getdomainname`\" = yes"; then
  1427. AC_DEFINE(HAVE_GETDOMAINNAME, 1, [Define if you have getdomainname])
  1428. fi
  1429. if eval "test \"`echo $ac_cv_proto_getdomainname`\" = no"; then
  1430. AC_DEFINE(HAVE_GETDOMAINNAME_PROTO, 1,
  1431. [Define if you have getdomainname prototype])
  1432. fi
  1433. ])
  1434. AC_DEFUN(AC_CHECK_GETHOSTNAME,
  1435. [
  1436. AC_MSG_CHECKING([for gethostname])
  1437. AC_CACHE_VAL(ac_cv_func_gethostname,
  1438. [
  1439. AC_LANG_SAVE
  1440. AC_LANG_CPLUSPLUS
  1441. save_CXXFLAGS="$CXXFLAGS"
  1442. if test "$GCC" = "yes"; then
  1443. CXXFLAGS="$CXXFLAGS -pedantic-errors"
  1444. fi
  1445. AC_TRY_LINK([
  1446. #include <stdlib.h>
  1447. #include <unistd.h>
  1448. ],
  1449. [
  1450. char buffer[200];
  1451. gethostname(buffer, 200);
  1452. ],
  1453. ac_cv_func_gethostname=yes,
  1454. ac_cv_func_gethostname=no)
  1455. CXXFLAGS="$save_CXXFLAGS"
  1456. AC_LANG_RESTORE
  1457. ])
  1458. AC_MSG_RESULT($ac_cv_func_gethostname)
  1459. AC_MSG_CHECKING([if gethostname needs custom prototype])
  1460. AC_CACHE_VAL(ac_cv_proto_gethostname,
  1461. [
  1462. AC_LANG_SAVE
  1463. AC_LANG_CPLUSPLUS
  1464. if eval "test \"`echo $ac_cv_func_gethostname`\" = yes"; then
  1465. ac_cv_proto_gethostname=no
  1466. else
  1467. AC_TRY_LINK([
  1468. #include <stdlib.h>
  1469. #include <unistd.h>
  1470. extern "C" int gethostname (char *, int);
  1471. ],
  1472. [
  1473. char buffer[200];
  1474. gethostname(buffer, 200);
  1475. ],
  1476. ac_cv_func_gethostname=yes
  1477. ac_cv_proto_gethostname=yes,
  1478. AC_MSG_RESULT([fatal error])
  1479. AC_MSG_ERROR(gethostname unavailable))
  1480. fi
  1481. AC_LANG_RESTORE
  1482. ])
  1483. AC_MSG_RESULT($ac_cv_proto_gethostname)
  1484. if eval "test \"`echo $ac_cv_proto_gethostname`\" = no"; then
  1485. AC_DEFINE(HAVE_GETHOSTNAME_PROTO, 1,
  1486. [Define if you have gethostname prototype])
  1487. fi
  1488. if eval "test \"`echo $ac_cv_func_gethostname`\" = yes"; then
  1489. AC_DEFINE(HAVE_GETHOSTNAME, 1, [Define if you have gethostname])
  1490. fi
  1491. ])
  1492. AC_DEFUN(AC_CHECK_USLEEP,
  1493. [
  1494. AC_MSG_CHECKING([for usleep])
  1495. AC_CACHE_VAL(ac_cv_func_usleep,
  1496. [
  1497. AC_LANG_SAVE
  1498. AC_LANG_CPLUSPLUS
  1499. ac_libs_safe="$LIBS"
  1500. LIBS="$LIBS $LIBUCB"
  1501. AC_TRY_LINK([
  1502. #include <stdlib.h>
  1503. #include <unistd.h>
  1504. ],
  1505. [
  1506. usleep(200);
  1507. ],
  1508. ac_cv_func_usleep=yes,
  1509. ac_cv_func_usleep=no)
  1510. LIBS="$ac_libs_safe"
  1511. AC_LANG_RESTORE
  1512. ])
  1513. AC_MSG_RESULT($ac_cv_func_usleep)
  1514. if eval "test \"`echo $ac_cv_func_usleep`\" = yes"; then
  1515. AC_DEFINE(HAVE_USLEEP, 1, [Define if you have the usleep function])
  1516. fi
  1517. ])
  1518. AC_DEFUN(AC_CHECK_RANDOM,
  1519. [
  1520. AC_MSG_CHECKING([for random])
  1521. AC_CACHE_VAL(ac_cv_func_random,
  1522. [
  1523. AC_LANG_SAVE
  1524. AC_LANG_CPLUSPLUS
  1525. ac_libs_safe="$LIBS"
  1526. LIBS="$LIBS $LIBUCB"
  1527. AC_TRY_LINK([
  1528. #include <stdlib.h>
  1529. ],
  1530. [
  1531. random();
  1532. ],
  1533. ac_cv_func_random=yes,
  1534. ac_cv_func_random=no)
  1535. LIBS="$ac_libs_safe"
  1536. AC_LANG_RESTORE
  1537. ])
  1538. AC_MSG_RESULT($ac_cv_func_random)
  1539. if eval "test \"`echo $ac_cv_func_random`\" = yes"; then
  1540. AC_DEFINE(HAVE_RANDOM, 1, [Define if you have random])
  1541. fi
  1542. ])
  1543. AC_DEFUN(AC_FIND_GIF,
  1544. [AC_MSG_CHECKING([for giflib])
  1545. AC_CACHE_VAL(ac_cv_lib_gif,
  1546. [ac_save_LIBS="$LIBS"
  1547. LIBS="$all_libraries -lgif -lX11 $LIBSOCKET"
  1548. AC_TRY_LINK(dnl
  1549. [
  1550. #ifdef __cplusplus
  1551. extern "C" {
  1552. #endif
  1553. int GifLastError(void);
  1554. #ifdef __cplusplus
  1555. }
  1556. #endif
  1557. /* We use char because int might match the return type of a gcc2
  1558. builtin and then its argument prototype would still apply. */
  1559. ],
  1560. [return GifLastError();],
  1561. eval "ac_cv_lib_gif=yes",
  1562. eval "ac_cv_lib_gif=no")
  1563. LIBS="$ac_save_LIBS"
  1564. ])dnl
  1565. if eval "test \"`echo $ac_cv_lib_gif`\" = yes"; then
  1566. AC_MSG_RESULT(yes)
  1567. AC_DEFINE_UNQUOTED(HAVE_LIBGIF, 1, [Define if you have libgif])
  1568. else
  1569. AC_MSG_ERROR(You need giflib30. Please install the kdesupport package)
  1570. fi
  1571. ])
  1572. AC_DEFUN(KDE_FIND_JPEG_HELPER,
  1573. [
  1574. AC_MSG_CHECKING([for libjpeg$2])
  1575. AC_CACHE_VAL(ac_cv_lib_jpeg_$1,
  1576. [
  1577. AC_LANG_C
  1578. ac_save_LIBS="$LIBS"
  1579. LIBS="$all_libraries $USER_LDFLAGS -ljpeg$2 -lm"
  1580. ac_save_CFLAGS="$CFLAGS"
  1581. CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
  1582. AC_TRY_LINK(
  1583. [/* Override any gcc2 internal prototype to avoid an error. */
  1584. struct jpeg_decompress_struct;
  1585. typedef struct jpeg_decompress_struct * j_decompress_ptr;
  1586. typedef int size_t;
  1587. #ifdef __cplusplus
  1588. extern "C" {
  1589. #endif
  1590. void jpeg_CreateDecompress(j_decompress_ptr cinfo,
  1591. int version, size_t structsize);
  1592. #ifdef __cplusplus
  1593. }
  1594. #endif
  1595. /* We use char because int might match the return type of a gcc2
  1596. builtin and then its argument prototype would still apply. */
  1597. ],
  1598. [jpeg_CreateDecompress(0L, 0, 0);],
  1599. eval "ac_cv_lib_jpeg_$1=-ljpeg$2",
  1600. eval "ac_cv_lib_jpeg_$1=no")
  1601. LIBS="$ac_save_LIBS"
  1602. CFLAGS="$ac_save_CFLAGS"
  1603. ])
  1604. if eval "test ! \"`echo $ac_cv_lib_jpeg_$1`\" = no"; then
  1605. LIBJPEG="$ac_cv_lib_jpeg_$1"
  1606. AC_MSG_RESULT($ac_cv_lib_jpeg_$1)
  1607. else
  1608. AC_MSG_RESULT(no)
  1609. $3
  1610. fi
  1611. ])
  1612. AC_DEFUN(AC_FIND_JPEG,
  1613. [
  1614. dnl first look for libraries
  1615. KDE_FIND_JPEG_HELPER(6b, 6b,
  1616. KDE_FIND_JPEG_HELPER(normal, [],
  1617. [
  1618. LIBJPEG=
  1619. ]
  1620. )
  1621. )
  1622. dnl then search the headers (can't use simply AC_TRY_xxx, as jpeglib.h
  1623. dnl requires system dependent includes loaded before it)
  1624. jpeg_incdirs="/usr/include /usr/local/include $kde_extra_includes"
  1625. AC_FIND_FILE(jpeglib.h, $jpeg_incdirs, jpeg_incdir)
  1626. test "x$jpeg_incdir" = xNO && jpeg_incdir=
  1627. dnl if headers _and_ libraries are missing, this is no error, and we
  1628. dnl continue with a warning (the user will get no jpeg support in khtml)
  1629. dnl if only one is missing, it means a configuration error, but we still
  1630. dnl only warn
  1631. if test -n "$jpeg_incdir" && test -n "$LIBJPEG" ; then
  1632. AC_DEFINE_UNQUOTED(HAVE_LIBJPEG, 1, [Define if you have libjpeg])
  1633. else
  1634. if test -n "$jpeg_incdir" || test -n "$LIBJPEG" ; then
  1635. AC_MSG_WARN([
  1636. There is an installation error in jpeg support. You seem to have only one
  1637. of either the headers _or_ the libraries installed. You may need to either
  1638. provide correct --with-extra-... options, or the development package of
  1639. libjpeg6b. You can get a source package of libjpeg from http://www.ijg.org/
  1640. Disabling JPEG support.
  1641. ])
  1642. else
  1643. AC_MSG_WARN([libjpeg not found. disable JPEG support.])
  1644. fi
  1645. jpeg_incdir=
  1646. LIBJPEG=
  1647. fi
  1648. AC_SUBST(LIBJPEG)
  1649. ])
  1650. AC_DEFUN(AC_FIND_ZLIB,
  1651. [
  1652. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  1653. AC_MSG_CHECKING([for libz])
  1654. AC_CACHE_VAL(ac_cv_lib_z,
  1655. [
  1656. AC_LANG_C
  1657. kde_save_LIBS="$LIBS"
  1658. LIBS="$all_libraries $USER_LDFLAGS -lz $LIBSOCKET"
  1659. kde_save_CFLAGS="$CFLAGS"
  1660. CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
  1661. AC_TRY_LINK(dnl
  1662. [
  1663. #include<zlib.h>
  1664. ],
  1665. [return (zlibVersion() == ZLIB_VERSION); ],
  1666. eval "ac_cv_lib_z='-lz'",
  1667. eval "ac_cv_lib_z=no")
  1668. LIBS="$kde_save_LIBS"
  1669. CFLAGS="$kde_save_CFLAGS"
  1670. ])dnl
  1671. if test ! "$ac_cv_lib_z" = no; then
  1672. AC_DEFINE_UNQUOTED(HAVE_LIBZ, 1, [Define if you have libz])
  1673. LIBZ="$ac_cv_lib_z"
  1674. AC_SUBST(LIBZ)
  1675. AC_MSG_RESULT($ac_cv_lib_z)
  1676. else
  1677. AC_MSG_ERROR(not found. Check your installation and look into config.log)
  1678. LIBZ=""
  1679. AC_SUBST(LIBZ)
  1680. fi
  1681. ])
  1682. AC_DEFUN(KDE_TRY_TIFFLIB,
  1683. [
  1684. AC_MSG_CHECKING([for libtiff $1])
  1685. AC_CACHE_VAL(kde_cv_libtiff_$1,
  1686. [
  1687. AC_LANG_SAVE
  1688. AC_LANG_CPLUSPLUS
  1689. kde_save_LIBS="$LIBS"
  1690. LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lX11 $LIBSOCKET -lm"
  1691. kde_save_CXXFLAGS="$CXXFLAGS"
  1692. CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
  1693. AC_TRY_LINK(dnl
  1694. [
  1695. #include<tiffio.h>
  1696. ],
  1697. [return (TIFFOpen( "", "r") == 0); ],
  1698. [
  1699. kde_cv_libtiff_$1="-l$1 $LIBJPEG $LIBZ"
  1700. ], [
  1701. kde_cv_libtiff_$1=no
  1702. ])
  1703. LIBS="$kde_save_LIBS"
  1704. CXXFLAGS="$kde_save_CXXFLAGS"
  1705. AC_LANG_RESTORE
  1706. ])
  1707. if test "$kde_cv_libtiff_$1" = "no"; then
  1708. AC_MSG_RESULT(no)
  1709. LIBTIFF=""
  1710. $3
  1711. else
  1712. LIBTIFF="$kde_cv_libtiff_$1"
  1713. AC_MSG_RESULT(yes)
  1714. AC_DEFINE_UNQUOTED(HAVE_LIBTIFF, 1, [Define if you have libtiff])
  1715. $2
  1716. fi
  1717. ])
  1718. AC_DEFUN(AC_FIND_TIFF,
  1719. [
  1720. AC_REQUIRE([K_PATH_X])
  1721. AC_REQUIRE([AC_FIND_ZLIB])
  1722. AC_REQUIRE([AC_FIND_JPEG])
  1723. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  1724. KDE_TRY_TIFFLIB(tiff, [],
  1725. KDE_TRY_TIFFLIB(tiff34))
  1726. AC_SUBST(LIBTIFF)
  1727. ])
  1728. AC_DEFUN(AC_FIND_PNG,
  1729. [
  1730. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  1731. AC_REQUIRE([AC_FIND_ZLIB])
  1732. AC_MSG_CHECKING([for libpng])
  1733. AC_CACHE_VAL(ac_cv_lib_png,
  1734. [
  1735. kde_save_LIBS="$LIBS"
  1736. LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm -lX11 $LIBSOCKET"
  1737. kde_save_CFLAGS="$CFLAGS"
  1738. CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
  1739. AC_LANG_C
  1740. AC_TRY_LINK(dnl
  1741. [
  1742. #include<png.h>
  1743. ],
  1744. [
  1745. png_structp png_ptr = png_create_read_struct( /* image ptr */
  1746. PNG_LIBPNG_VER_STRING, 0, 0, 0 );
  1747. return( png_ptr != 0 );
  1748. ],
  1749. eval "ac_cv_lib_png='-lpng $LIBZ -lm'",
  1750. eval "ac_cv_lib_png=no"
  1751. )
  1752. LIBS="$kde_save_LIBS"
  1753. CFLAGS="$kde_save_CFLAGS"
  1754. ])dnl
  1755. if eval "test ! \"`echo $ac_cv_lib_png`\" = no"; then
  1756. AC_DEFINE_UNQUOTED(HAVE_LIBPNG, 1, [Define if you have libpng])
  1757. LIBPNG="$ac_cv_lib_png"
  1758. AC_SUBST(LIBPNG)
  1759. AC_MSG_RESULT($ac_cv_lib_png)
  1760. else
  1761. AC_MSG_RESULT(no)
  1762. LIBPNG=""
  1763. AC_SUBST(LIBPNG)
  1764. fi
  1765. ])
  1766. AC_DEFUN(AC_CHECK_BOOL,
  1767. [
  1768. AC_DEFINE_UNQUOTED(HAVE_BOOL, 1, [You _must_ have bool])
  1769. ])
  1770. AC_DEFUN(AC_CHECK_GNU_EXTENSIONS,
  1771. [
  1772. AC_MSG_CHECKING(if you need GNU extensions)
  1773. AC_CACHE_VAL(ac_cv_gnu_extensions,
  1774. [
  1775. cat > conftest.c << EOF
  1776. #include <features.h>
  1777. #ifdef __GNU_LIBRARY__
  1778. yes
  1779. #endif
  1780. EOF
  1781. if (eval "$ac_cpp conftest.c") 2>&5 |
  1782. egrep "yes" >/dev/null 2>&1; then
  1783. rm -rf conftest*
  1784. ac_cv_gnu_extensions=yes
  1785. else
  1786. ac_cv_gnu_extensions=no
  1787. fi
  1788. ])
  1789. AC_MSG_RESULT($ac_cv_gnu_extensions)
  1790. if test "$ac_cv_gnu_extensions" = "yes"; then
  1791. AC_DEFINE_UNQUOTED(_GNU_SOURCE, 1, [Define if you need to use the GNU extensions])
  1792. fi
  1793. ])
  1794. AC_DEFUN(KDE_CHECK_COMPILER_FLAG,
  1795. [
  1796. dnl AC_REQUIRE([AC_CHECK_COMPILERS]) <- breaks with autoconf 2.50
  1797. AC_MSG_CHECKING(whether $CXX supports -$1)
  1798. kde_cache=`echo $1 | sed 'y%.=/+-%___p_%'`
  1799. AC_CACHE_VAL(kde_cv_prog_cxx_$kde_cache,
  1800. [
  1801. echo 'int main() { return 0; }' >conftest.cc
  1802. eval "kde_cv_prog_cxx_$kde_cache=no"
  1803. if test -z "`$CXX -$1 -c conftest.cc 2>&1`"; then
  1804. if test -z "`$CXX -$1 -o conftest conftest.o 2>&1`"; then
  1805. eval "kde_cv_prog_cxx_$kde_cache=yes"
  1806. fi
  1807. fi
  1808. rm -f conftest*
  1809. ])
  1810. if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
  1811. AC_MSG_RESULT(yes)
  1812. :
  1813. $2
  1814. else
  1815. AC_MSG_RESULT(no)
  1816. :
  1817. $3
  1818. fi
  1819. ])
  1820. dnl AC_REMOVE_FORBIDDEN removes forbidden arguments from variables
  1821. dnl use: AC_REMOVE_FORBIDDEN(CC, [-forbid -bad-option whatever])
  1822. dnl it's all white-space separated
  1823. AC_DEFUN(AC_REMOVE_FORBIDDEN,
  1824. [ __val=$$1
  1825. __forbid=" $2 "
  1826. if test -n "$__val"; then
  1827. __new=""
  1828. ac_save_IFS=$IFS
  1829. IFS=" "
  1830. for i in $__val; do
  1831. case "$__forbid" in
  1832. *" $i "*) AC_MSG_WARN([found forbidden $i in $1, removing it]) ;;
  1833. *) # Careful to not add spaces, where there were none, because otherwise
  1834. # libtool gets confused, if we change e.g. CXX
  1835. if test -z "$__new" ; then __new=$i ; else __new="$__new $i" ; fi ;;
  1836. esac
  1837. done
  1838. IFS=$ac_save_IFS
  1839. $1=$__new
  1840. fi
  1841. ])
  1842. dnl AC_VALIDIFY_CXXFLAGS checks for forbidden flags the user may have given
  1843. AC_DEFUN(AC_VALIDIFY_CXXFLAGS,
  1844. [dnl
  1845. AC_REMOVE_FORBIDDEN(CXX, [-fno-rtti -rpath])
  1846. AC_REMOVE_FORBIDDEN(CXXFLAGS, [-fno-rtti -rpath])
  1847. ])
  1848. AC_DEFUN(AC_CHECK_COMPILERS,
  1849. [
  1850. AC_ARG_ENABLE(debug,[ --enable-debug enables debug symbols [default=no]],
  1851. [
  1852. if test $enableval = "no"; dnl
  1853. then
  1854. kde_use_debug_code="no"
  1855. kde_use_debug_define=yes
  1856. else
  1857. kde_use_debug_code="yes"
  1858. kde_use_debug_define=no
  1859. fi
  1860. ],
  1861. [kde_use_debug_code="no"
  1862. kde_use_debug_define=no
  1863. ])
  1864. dnl Just for configure --help
  1865. AC_ARG_ENABLE(dummyoption,[ --disable-debug disables debug output and debug symbols [default=no]],[],[])
  1866. AC_ARG_ENABLE(strict,[ --enable-strict compiles with strict compiler options (may not work!)],
  1867. [
  1868. if test $enableval = "no"; then
  1869. kde_use_strict_options="no"
  1870. else
  1871. kde_use_strict_options="yes"
  1872. fi
  1873. ], [kde_use_strict_options="no"])
  1874. AC_ARG_ENABLE(profile,[ --enable-profile creates profiling infos [default=no]],
  1875. [kde_use_profiling=$enableval],
  1876. [kde_use_profiling="no"]
  1877. )
  1878. dnl this prevents stupid AC_PROG_CC to add "-g" to the default CFLAGS
  1879. CFLAGS=" $CFLAGS"
  1880. AC_PROG_CC
  1881. if test "$GCC" = "yes"; then
  1882. if test "$kde_use_debug_code" = "yes"; then
  1883. CFLAGS="-g -O0 $CFLAGS"
  1884. case $host in
  1885. *-*-linux-gnu)
  1886. CFLAGS="-ansi -W -Wall -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -D_XOPEN_SOURCE=500 -D_BSD_SOURCE $CFLAGS"
  1887. ;;
  1888. esac
  1889. else
  1890. CFLAGS="-O0 $CFLAGS"
  1891. fi
  1892. fi
  1893. if test "$kde_use_debug_define" = "yes"; then
  1894. CFLAGS="-DNDEBUG $CFLAGS"
  1895. fi
  1896. case "$host" in
  1897. *-*-sysv4.2uw*) CFLAGS="-D_UNIXWARE $CFLAGS";;
  1898. *-*-sysv5uw7*) CFLAGS="-D_UNIXWARE7 $CFLAGS";;
  1899. esac
  1900. if test -z "$LDFLAGS" && test "$kde_use_debug_code" = "no" && test "$GCC" = "yes"; then
  1901. LDFLAGS=""
  1902. fi
  1903. CXXFLAGS=" $CXXFLAGS"
  1904. AC_PROG_CXX
  1905. if test "$GXX" = "yes"; then
  1906. if test "$kde_use_debug_code" = "yes"; then
  1907. CXXFLAGS="-g -O0 -Wall -pedantic -W -Wpointer-arith -Wmissing-prototypes -Wwrite-strings $CXXFLAGS"
  1908. KDE_CHECK_COMPILER_FLAG(Wno-long-long,[CXXFLAGS="-Wno-long-long $CXXFLAGS"])
  1909. KDE_CHECK_COMPILER_FLAG(Wnon-virtual-dtor,[CXXFLAGS="-Wnon-virtual-dtor $CXXFLAGS"])
  1910. KDE_CHECK_COMPILER_FLAG(fno-builtin,[CXXFLAGS="-fno-builtin $CXXFLAGS"])
  1911. case $host in dnl
  1912. *-*-linux-gnu | *-*-kfreebsd*-gnu)
  1913. CXXFLAGS="-ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wbad-function-cast -Wcast-align -Wundef -Wconversion $CXXFLAGS"
  1914. ;;
  1915. esac
  1916. if test "$kde_use_strict_options" = "yes"; then
  1917. CXXFLAGS="-Wcast-qual -Wbad-function-cast -Wshadow -Wcast-align $CXXFLAGS"
  1918. fi
  1919. if test "$kde_very_strict" = "yes"; then
  1920. CXXFLAGS="-Wold-style-cast -Wredundant-decls -Wconversion $CXXFLAGS"
  1921. fi
  1922. else
  1923. CXXFLAGS="-O0 $CXXFLAGS"
  1924. fi
  1925. fi
  1926. if test "$kde_use_debug_define" = "yes"; then
  1927. CXXFLAGS="-DNDEBUG $CXXFLAGS"
  1928. fi
  1929. if test "$kde_use_profiling" = "yes"; then
  1930. KDE_CHECK_COMPILER_FLAG(pg,
  1931. [
  1932. CFLAGS="-pg $CFLAGS"
  1933. CXXFLAGS="-pg $CXXFLAGS"
  1934. ])
  1935. fi
  1936. KDE_CHECK_COMPILER_FLAG(fno-exceptions,[CXXFLAGS="$CXXFLAGS -fno-exceptions"])
  1937. KDE_CHECK_COMPILER_FLAG(fno-check-new, [CXXFLAGS="$CXXFLAGS -fno-check-new"])
  1938. KDE_CHECK_COMPILER_FLAG(fexceptions, [USE_EXCEPTIONS="-fexceptions"], USE_EXCEPTIONS= )
  1939. AC_SUBST(USE_EXCEPTIONS)
  1940. dnl obsolete macro - provided to keep things going
  1941. USE_RTTI=
  1942. AC_SUBST(USE_RTTI)
  1943. case "$host" in
  1944. *-*-irix*) test "$GXX" = yes && CXXFLAGS="-D_LANGUAGE_C_PLUS_PLUS -D__LANGUAGE_C_PLUS_PLUS $CXXFLAGS" ;;
  1945. *-*-sysv4.2uw*) CXXFLAGS="-D_UNIXWARE $CXXFLAGS";;
  1946. *-*-sysv5uw7*) CXXFLAGS="-D_UNIXWARE7 $CXXFLAGS";;
  1947. *-*-solaris*)
  1948. if test "$GXX" = yes; then
  1949. libstdcpp=`$CXX -print-file-name=libstdc++.so`
  1950. if test ! -f $libstdcpp; then
  1951. 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])
  1952. fi
  1953. fi
  1954. ;;
  1955. esac
  1956. AC_VALIDIFY_CXXFLAGS
  1957. AC_PROG_CXXCPP
  1958. # the following is to allow programs, that are known to
  1959. # have problems when compiled with -O2
  1960. if test -n "$CXXFLAGS"; then
  1961. kde_safe_IFS=$IFS
  1962. IFS=" "
  1963. NOOPT_CXXFLAGS=""
  1964. for i in $CXXFLAGS; do
  1965. case $i in
  1966. -O*)
  1967. ;;
  1968. *)
  1969. NOOPT_CXXFLAGS="$NOOPT_CXXFLAGS $i"
  1970. ;;
  1971. esac
  1972. done
  1973. IFS=$kde_safe_IFS
  1974. fi
  1975. AC_SUBST(NOOPT_CXXFLAGS)
  1976. KDE_CHECK_FINAL
  1977. ifdef([AM_DEPENDENCIES], AC_REQUIRE([KDE_ADD_DEPENDENCIES]), [])
  1978. KDE_CXXFLAGS=
  1979. AC_SUBST(KDE_CXXFLAGS)
  1980. ])
  1981. AC_DEFUN(KDE_ADD_DEPENDENCIES,
  1982. [
  1983. [A]M_DEPENDENCIES(CC)
  1984. [A]M_DEPENDENCIES(CXX)
  1985. ])
  1986. dnl just a wrapper to clean up configure.in
  1987. AC_DEFUN(KDE_PROG_LIBTOOL,
  1988. [
  1989. AC_REQUIRE([AC_CHECK_COMPILERS])
  1990. AC_REQUIRE([AC_ENABLE_SHARED])
  1991. AC_REQUIRE([AC_ENABLE_STATIC])
  1992. AC_REQUIRE([AC_LIBTOOL_DLOPEN])
  1993. AC_LANG_SAVE
  1994. AC_LANG_C
  1995. AC_OBJEXT
  1996. AC_EXEEXT
  1997. AC_LANG_RESTORE
  1998. AM_PROG_LIBTOOL
  1999. AC_LIBTOOL_CXX
  2000. LIBTOOL_SHELL="/bin/sh ./libtool"
  2001. # LIBTOOL="$LIBTOOL --silent"
  2002. KDE_PLUGIN="-avoid-version -module -no-undefined \$(KDE_RPATH)"
  2003. AC_SUBST(KDE_PLUGIN)
  2004. ])
  2005. AC_DEFUN(KDE_CHECK_TYPES,
  2006. [ AC_CHECK_SIZEOF(int, 4)dnl
  2007. AC_CHECK_SIZEOF(long, 4)dnl
  2008. AC_CHECK_SIZEOF(char *, 4)dnl
  2009. AC_CHECK_SIZEOF(char, 1)dnl
  2010. ])dnl
  2011. AC_DEFUN(KDE_DO_IT_ALL,
  2012. [
  2013. AC_CANONICAL_SYSTEM
  2014. AC_ARG_PROGRAM
  2015. AM_INIT_AUTOMAKE($1, $2)
  2016. AM_DISABLE_LIBRARIES
  2017. AC_PREFIX_DEFAULT(${KDEDIR:-/usr/local/kde})
  2018. AC_CHECK_COMPILERS
  2019. KDE_PROG_LIBTOOL
  2020. AM_KDE_WITH_NLS
  2021. AC_PATH_KDE
  2022. ])
  2023. AC_DEFUN(AC_CHECK_RPATH,
  2024. [
  2025. AC_MSG_CHECKING(for rpath)
  2026. AC_ARG_ENABLE(rpath,
  2027. [ --disable-rpath do not use the rpath feature of ld],
  2028. USE_RPATH=$enableval, USE_RPATH=yes)
  2029. if test -z "$KDE_RPATH" && test "$USE_RPATH" = "yes"; then
  2030. KDE_RPATH="-R \$(kde_libraries)"
  2031. if test -n "$qt_libraries"; then
  2032. KDE_RPATH="$KDE_RPATH -R \$(qt_libraries)"
  2033. fi
  2034. dnl $x_libraries is set to /usr/lib in case
  2035. if test -n "$X_LDFLAGS"; then
  2036. KDE_RPATH="$KDE_RPATH -R \$(x_libraries)"
  2037. fi
  2038. if test -n "$KDE_EXTRA_RPATH"; then
  2039. KDE_RPATH="$KDE_RPATH \$(KDE_EXTRA_RPATH)"
  2040. fi
  2041. fi
  2042. AC_SUBST(KDE_EXTRA_RPATH)
  2043. AC_SUBST(KDE_RPATH)
  2044. AC_MSG_RESULT($USE_RPATH)
  2045. ])
  2046. dnl Check for the type of the third argument of getsockname
  2047. AC_DEFUN(AC_CHECK_SOCKLEN_T, [
  2048. AC_MSG_CHECKING(for socklen_t)
  2049. AC_CACHE_VAL(ac_cv_socklen_t, [
  2050. AC_LANG_SAVE
  2051. AC_LANG_CPLUSPLUS
  2052. AC_TRY_COMPILE([
  2053. #include <sys/types.h>
  2054. #include <sys/socket.h>
  2055. ],[
  2056. socklen_t a=0;
  2057. getsockname(0,(struct sockaddr*)0, &a);
  2058. ],
  2059. ac_cv_socklen_t=socklen_t,
  2060. AC_TRY_COMPILE([
  2061. #include <sys/types.h>
  2062. #include <sys/socket.h>
  2063. ],[
  2064. int a=0;
  2065. getsockname(0,(struct sockaddr*)0, &a);
  2066. ],
  2067. ac_cv_socklen_t=int,
  2068. ac_cv_socklen_t=size_t
  2069. )
  2070. )
  2071. AC_LANG_RESTORE
  2072. ])
  2073. AC_MSG_RESULT($ac_cv_socklen_t)
  2074. if test "$ac_cv_socklen_t" != "socklen_t"; then
  2075. AC_DEFINE_UNQUOTED(socklen_t, $ac_cv_socklen_t,
  2076. [Define the real type of socklen_t])
  2077. fi
  2078. AC_DEFINE_UNQUOTED(ksize_t, socklen_t, [Compatibility define])
  2079. ])
  2080. dnl This is a merge of some macros out of the gettext aclocal.m4
  2081. dnl since we don't need anything, I took the things we need
  2082. dnl the copyright for them is:
  2083. dnl >
  2084. dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
  2085. dnl This Makefile.in is free software; the Free Software Foundation
  2086. dnl gives unlimited permission to copy and/or distribute it,
  2087. dnl with or without modifications, as long as this notice is preserved.
  2088. dnl This program is distributed in the hope that it will be useful,
  2089. dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
  2090. dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  2091. dnl PARTICULAR PURPOSE.
  2092. dnl >
  2093. dnl for this file it is relicensed under LGPL
  2094. AC_DEFUN(AM_KDE_WITH_NLS,
  2095. [
  2096. dnl If we use NLS figure out what method
  2097. AM_PATH_PROG_WITH_TEST_KDE(MSGFMT, msgfmt,
  2098. [test -n "`$ac_dir/$ac_word --version 2>&1 | grep 'GNU gettext'`"], msgfmt)
  2099. AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
  2100. if test -z "`$GMSGFMT --version 2>&1 | grep 'GNU gettext'`"; then
  2101. AC_MSG_RESULT([found msgfmt program is not GNU msgfmt; ignore it])
  2102. GMSGFMT=":"
  2103. fi
  2104. MSGFMT=$GMSGFMT
  2105. AC_SUBST(GMSGFMT)
  2106. AC_SUBST(MSGFMT)
  2107. AM_PATH_PROG_WITH_TEST_KDE(XGETTEXT, xgettext,
  2108. [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
  2109. dnl Test whether we really found GNU xgettext.
  2110. if test "$XGETTEXT" != ":"; then
  2111. dnl If it is no GNU xgettext we define it as : so that the
  2112. dnl Makefiles still can work.
  2113. if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
  2114. : ;
  2115. else
  2116. AC_MSG_RESULT(
  2117. [found xgettext programs is not GNU xgettext; ignore it])
  2118. XGETTEXT=":"
  2119. fi
  2120. fi
  2121. AC_SUBST(XGETTEXT)
  2122. ])
  2123. # Search path for a program which passes the given test.
  2124. # Ulrich Drepper <drepper@cygnus.com>, 1996.
  2125. # serial 1
  2126. # Stephan Kulow: I appended a _KDE against name conflicts
  2127. dnl AM_PATH_PROG_WITH_TEST_KDE(VARIABLE, PROG-TO-CHECK-FOR,
  2128. dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
  2129. AC_DEFUN(AM_PATH_PROG_WITH_TEST_KDE,
  2130. [# Extract the first word of "$2", so it can be a program name with args.
  2131. set dummy $2; ac_word=[$]2
  2132. AC_MSG_CHECKING([for $ac_word])
  2133. AC_CACHE_VAL(ac_cv_path_$1,
  2134. [case "[$]$1" in
  2135. /*)
  2136. ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
  2137. ;;
  2138. *)
  2139. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
  2140. for ac_dir in ifelse([$5], , $PATH, [$5]); do
  2141. test -z "$ac_dir" && ac_dir=.
  2142. if test -f $ac_dir/$ac_word; then
  2143. if [$3]; then
  2144. ac_cv_path_$1="$ac_dir/$ac_word"
  2145. break
  2146. fi
  2147. fi
  2148. done
  2149. IFS="$ac_save_ifs"
  2150. dnl If no 4th arg is given, leave the cache variable unset,
  2151. dnl so AC_PATH_PROGS will keep looking.
  2152. ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
  2153. ])dnl
  2154. ;;
  2155. esac])dnl
  2156. $1="$ac_cv_path_$1"
  2157. if test -n "[$]$1"; then
  2158. AC_MSG_RESULT([$]$1)
  2159. else
  2160. AC_MSG_RESULT(no)
  2161. fi
  2162. AC_SUBST($1)dnl
  2163. ])
  2164. # Check whether LC_MESSAGES is available in <locale.h>.
  2165. # Ulrich Drepper <drepper@cygnus.com>, 1995.
  2166. # serial 1
  2167. AC_DEFUN(AM_LC_MESSAGES,
  2168. [if test $ac_cv_header_locale_h = yes; then
  2169. AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
  2170. [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
  2171. am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
  2172. if test $am_cv_val_LC_MESSAGES = yes; then
  2173. AC_DEFINE(HAVE_LC_MESSAGES, 1, [Define if your locale.h file contains LC_MESSAGES])
  2174. fi
  2175. fi])
  2176. dnl From Jim Meyering.
  2177. dnl FIXME: migrate into libit.
  2178. AC_DEFUN(AM_FUNC_OBSTACK,
  2179. [AC_CACHE_CHECK([for obstacks], am_cv_func_obstack,
  2180. [AC_TRY_LINK([#include "obstack.h"],
  2181. [struct obstack *mem;obstack_free(mem,(char *) 0)],
  2182. am_cv_func_obstack=yes,
  2183. am_cv_func_obstack=no)])
  2184. if test $am_cv_func_obstack = yes; then
  2185. AC_DEFINE(HAVE_OBSTACK)
  2186. else
  2187. LIBOBJS="$LIBOBJS obstack.o"
  2188. fi
  2189. ])
  2190. dnl From Jim Meyering. Use this if you use the GNU error.[ch].
  2191. dnl FIXME: Migrate into libit
  2192. AC_DEFUN(AM_FUNC_ERROR_AT_LINE,
  2193. [AC_CACHE_CHECK([for error_at_line], am_cv_lib_error_at_line,
  2194. [AC_TRY_LINK([],[error_at_line(0, 0, "", 0, "");],
  2195. am_cv_lib_error_at_line=yes,
  2196. am_cv_lib_error_at_line=no)])
  2197. if test $am_cv_lib_error_at_line = no; then
  2198. LIBOBJS="$LIBOBJS error.o"
  2199. fi
  2200. AC_SUBST(LIBOBJS)dnl
  2201. ])
  2202. # Macro to add for using GNU gettext.
  2203. # Ulrich Drepper <drepper@cygnus.com>, 1995.
  2204. # serial 1
  2205. # Stephan Kulow: I put a KDE in it to avoid name conflicts
  2206. AC_DEFUN(AM_KDE_GNU_GETTEXT,
  2207. [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
  2208. AC_REQUIRE([AC_PROG_RANLIB])dnl
  2209. AC_REQUIRE([AC_HEADER_STDC])dnl
  2210. AC_REQUIRE([AC_TYPE_OFF_T])dnl
  2211. AC_REQUIRE([AC_TYPE_SIZE_T])dnl
  2212. AC_REQUIRE([AC_FUNC_ALLOCA])dnl
  2213. AC_REQUIRE([AC_FUNC_MMAP])dnl
  2214. AC_REQUIRE([AM_KDE_WITH_NLS])dnl
  2215. AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h string.h values.h alloca.h])
  2216. AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
  2217. __argz_count __argz_stringify __argz_next])
  2218. AC_MSG_CHECKING(for stpcpy)
  2219. AC_CACHE_VAL(kde_cv_func_stpcpy,
  2220. [
  2221. kde_safe_cxxflags=$CXXFLAGS
  2222. CXXFLAGS="-Wmissing-prototypes -Werror"
  2223. AC_LANG_SAVE
  2224. AC_LANG_CPLUSPLUS
  2225. AC_TRY_COMPILE([
  2226. #include <string.h>
  2227. ],
  2228. [
  2229. char buffer[200];
  2230. stpcpy(buffer, buffer);
  2231. ],
  2232. kde_cv_func_stpcpy=yes,
  2233. kde_cv_func_stpcpy=no)
  2234. AC_LANG_RESTORE
  2235. CXXFLAGS=$kde_safe_cxxflags
  2236. ])
  2237. AC_MSG_RESULT($kde_cv_func_stpcpy)
  2238. if eval "test \"`echo $kde_cv_func_stpcpy`\" = yes"; then
  2239. AC_DEFINE(HAVE_STPCPY, 1, [Define if you have stpcpy])
  2240. fi
  2241. AM_LC_MESSAGES
  2242. if test "x$CATOBJEXT" != "x"; then
  2243. if test "x$ALL_LINGUAS" = "x"; then
  2244. LINGUAS=
  2245. else
  2246. AC_MSG_CHECKING(for catalogs to be installed)
  2247. NEW_LINGUAS=
  2248. for lang in ${LINGUAS=$ALL_LINGUAS}; do
  2249. case "$ALL_LINGUAS" in
  2250. *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
  2251. esac
  2252. done
  2253. LINGUAS=$NEW_LINGUAS
  2254. AC_MSG_RESULT($LINGUAS)
  2255. fi
  2256. dnl Construct list of names of catalog files to be constructed.
  2257. if test -n "$LINGUAS"; then
  2258. for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
  2259. fi
  2260. fi
  2261. ])
  2262. AC_DEFUN(AC_HAVE_XPM,
  2263. [AC_REQUIRE_CPP()dnl
  2264. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  2265. test -z "$XPM_LDFLAGS" && XPM_LDFLAGS=
  2266. test -z "$XPM_INCLUDE" && XPM_INCLUDE=
  2267. AC_ARG_WITH(xpm, [ --without-xpm disable color pixmap XPM tests],
  2268. xpm_test=$withval, xpm_test="yes")
  2269. if test "x$xpm_test" = xno; then
  2270. ac_cv_have_xpm=no
  2271. else
  2272. AC_MSG_CHECKING(for XPM)
  2273. AC_CACHE_VAL(ac_cv_have_xpm,
  2274. [
  2275. AC_LANG_C
  2276. ac_save_ldflags="$LDFLAGS"
  2277. ac_save_cflags="$CFLAGS"
  2278. LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm -lX11 -lXext $LIBZ $LIBSOCKET"
  2279. CFLAGS="$CFLAGS $X_INCLUDES $USER_INCLUDES"
  2280. test -n "$XPM_INCLUDE" && CFLAGS="-I$XPM_INCLUDE $CFLAGS"
  2281. AC_TRY_LINK([#include <X11/xpm.h>],[],
  2282. ac_cv_have_xpm="yes",ac_cv_have_xpm="no")
  2283. LDFLAGS="$ac_save_ldflags"
  2284. CFLAGS="$ac_save_cflags"
  2285. ])dnl
  2286. if test "$ac_cv_have_xpm" = no; then
  2287. AC_MSG_RESULT(no)
  2288. XPM_LDFLAGS=""
  2289. XPMINC=""
  2290. $2
  2291. else
  2292. AC_DEFINE(HAVE_XPM, 1, [Define if you have XPM support])
  2293. if test "$XPM_LDFLAGS" = ""; then
  2294. XPMLIB='-lXpm $(LIB_X11)'
  2295. else
  2296. XPMLIB="-L$XPM_LDFLAGS -lXpm "'$(LIB_X11)'
  2297. fi
  2298. if test "$XPM_INCLUDE" = ""; then
  2299. XPMINC=""
  2300. else
  2301. XPMINC="-I$XPM_INCLUDE"
  2302. fi
  2303. AC_MSG_RESULT(yes)
  2304. $1
  2305. fi
  2306. fi
  2307. AC_SUBST(XPMINC)
  2308. AC_SUBST(XPMLIB)
  2309. ])
  2310. AC_DEFUN(AC_HAVE_DPMS,
  2311. [AC_REQUIRE_CPP()dnl
  2312. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  2313. test -z "$DPMS_LDFLAGS" && DPMS_LDFLAGS=
  2314. test -z "$DPMS_INCLUDE" && DPMS_INCLUDE=
  2315. DPMS_LIB=
  2316. AC_ARG_WITH(dpms, [ --without-dpms disable DPMS power saving],
  2317. dpms_test=$withval, dpms_test="yes")
  2318. if test "x$dpms_test" = xno; then
  2319. ac_cv_have_dpms=no
  2320. else
  2321. AC_MSG_CHECKING(for DPMS)
  2322. dnl Note: ac_cv_have_dpms can be no, yes, or -lXdpms.
  2323. dnl 'yes' means DPMS_LIB="", '-lXdpms' means DPMS_LIB="-lXdpms".
  2324. AC_CACHE_VAL(ac_cv_have_dpms,
  2325. [
  2326. AC_LANG_C
  2327. ac_save_ldflags="$LDFLAGS"
  2328. ac_save_cflags="$CFLAGS"
  2329. ac_save_libs="$LIBS"
  2330. LDFLAGS="$LDFLAGS $DPMS_LDFLAGS $all_libraries -lX11 -lXext $LIBSOCKET"
  2331. CFLAGS="$CFLAGS $X_INCLUDES"
  2332. test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
  2333. AC_TRY_LINK([
  2334. #include <X11/Xproto.h>
  2335. #include <X11/X.h>
  2336. #include <X11/Xlib.h>
  2337. #include <X11/extensions/dpms.h>
  2338. int foo_test_dpms()
  2339. { return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[],
  2340. ac_cv_have_dpms="yes", [
  2341. LDFLAGS="$ac_save_ldflags"
  2342. CFLAGS="$ac_save_cflags"
  2343. LDFLAGS="$LDFLAGS $DPMS_LDFLAGS $all_libraries -lX11 -lXext $LIBSOCKET"
  2344. LIBS="$LIBS -lXdpms"
  2345. CFLAGS="$CFLAGS $X_INCLUDES"
  2346. test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
  2347. AC_TRY_LINK([
  2348. #include <X11/Xproto.h>
  2349. #include <X11/X.h>
  2350. #include <X11/Xlib.h>
  2351. #include <X11/extensions/dpms.h>
  2352. int foo_test_dpms()
  2353. { return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[],
  2354. [
  2355. ac_cv_have_dpms="-lXdpms"
  2356. ],ac_cv_have_dpms="no")
  2357. ])
  2358. LDFLAGS="$ac_save_ldflags"
  2359. CFLAGS="$ac_save_cflags"
  2360. LIBS="$ac_save_libs"
  2361. ])dnl
  2362. if test "$ac_cv_have_dpms" = no; then
  2363. AC_MSG_RESULT(no)
  2364. DPMS_LDFLAGS=""
  2365. DPMSINC=""
  2366. $2
  2367. else
  2368. AC_DEFINE(HAVE_DPMS, 1, [Define if you have DPMS support])
  2369. if test "$ac_cv_have_dpms" = "-lXdpms"; then
  2370. DPMS_LIB="-lXdpms"
  2371. fi
  2372. if test "$DPMS_LDFLAGS" = ""; then
  2373. DPMSLIB="$DPMS_LIB "'$(LIB_X11)'
  2374. else
  2375. DPMSLIB="$DPMS_LDFLAGS $DPMS_LIB "'$(LIB_X11)'
  2376. fi
  2377. if test "$DPMS_INCLUDE" = ""; then
  2378. DPMSINC=""
  2379. else
  2380. DPMSINC="-I$DPMS_INCLUDE"
  2381. fi
  2382. AC_MSG_RESULT(yes)
  2383. $1
  2384. fi
  2385. fi
  2386. AC_SUBST(DPMSINC)
  2387. AC_SUBST(DPMSLIB)
  2388. ])
  2389. AC_DEFUN(AC_HAVE_GL,
  2390. [AC_REQUIRE_CPP()dnl
  2391. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  2392. test -z "$GL_LDFLAGS" && GL_LDFLAGS=
  2393. test -z "$GL_INCLUDE" && GL_INCLUDE=
  2394. AC_ARG_WITH(gl, [ --without-gl disable 3D GL modes],
  2395. gl_test=$withval, gl_test="yes")
  2396. if test "x$gl_test" = xno; then
  2397. ac_cv_have_gl=no
  2398. else
  2399. AC_MSG_CHECKING(for GL)
  2400. AC_CACHE_VAL(ac_cv_have_gl,
  2401. [
  2402. AC_LANG_C
  2403. ac_save_ldflags="$LDFLAGS"
  2404. ac_save_cflags="$CFLAGS"
  2405. LDFLAGS="$LDFLAGS $GL_LDFLAGS $X_LDFLAGS $all_libraries -lMesaGL -lMesaGLU -lX11 -lXext -lm $LIBSOCKET"
  2406. CFLAGS="$CFLAGS $X_INCLUDES"
  2407. test -n "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS"
  2408. AC_TRY_LINK([#include <GL/gl.h>
  2409. #include <GL/glu.h>
  2410. ], [],
  2411. ac_cv_have_gl="mesa", ac_cv_have_gl="no")
  2412. if test "x$ac_cv_have_gl" = "xno"; then
  2413. LDFLAGS="$ac_save_ldflags $X_LDFLAGS $GL_LDFLAGS $all_libraries -lGL -lGLU -lX11 -lXext -lm $LIBSOCKET"
  2414. CFLAGS="$ac_save_cflags $X_INCLUDES"
  2415. test -n "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS"
  2416. AC_TRY_LINK([#include <GL/gl.h>
  2417. #include <GL/glu.h>
  2418. ], [],
  2419. ac_cv_have_gl="yes", ac_cv_have_gl="no")
  2420. fi
  2421. LDFLAGS="$ac_save_ldflags"
  2422. CFLAGS="$ac_save_cflags"
  2423. ])dnl
  2424. if test "$ac_cv_have_gl" = "no"; then
  2425. AC_MSG_RESULT(no)
  2426. GL_LDFLAGS=""
  2427. GLINC=""
  2428. $2
  2429. else
  2430. AC_DEFINE(HAVE_GL, 1, [Defines if you have GL (Mesa, OpenGL, ...)])
  2431. if test "$GL_LDFLAGS" = ""; then
  2432. if test "$ac_cv_have_gl" = "mesa"; then
  2433. GLLIB='-lMesaGL -lMesaGLU $(LIB_X11)'
  2434. else
  2435. GLLIB='-lGL -lGLU $(LIB_X11)'
  2436. fi
  2437. else
  2438. if test "$ac_cv_have_gl" = "mesa"; then
  2439. GLLIB="$GL_LDFLAGS -lMesaGL -lMesaGLU "'$(LIB_X11)'
  2440. else
  2441. GLLIB="$GL_LDFLAGS -lGL -lGLU "'$(LIB_X11)'
  2442. fi
  2443. fi
  2444. if test "$GL_INCLUDE" = ""; then
  2445. GLINC=""
  2446. else
  2447. GLINC="-I$GL_INCLUDE"
  2448. fi
  2449. AC_MSG_RESULT($ac_cv_have_gl)
  2450. $1
  2451. fi
  2452. fi
  2453. AC_SUBST(GLINC)
  2454. AC_SUBST(GLLIB)
  2455. ])
  2456. dnl shadow password and PAM magic - maintained by ossi@kde.org
  2457. AC_DEFUN(KDE_PAM, [
  2458. AC_REQUIRE([KDE_CHECK_LIBDL])
  2459. AC_ARG_WITH(pam,
  2460. [ --with-pam[=ARG] enable support for PAM: ARG=[yes|no|service name]],
  2461. [ if test "x$withval" = "xyes"; then
  2462. use_pam=yes
  2463. pam_service=kde
  2464. elif test "x$withval" = "xno"; then
  2465. use_pam=no
  2466. else
  2467. use_pam=yes
  2468. pam_service=$withval
  2469. fi
  2470. ac_cv_path_pam="use_pam=$use_pam pam_service=$pam_service"
  2471. ], [
  2472. AC_CACHE_VAL(ac_cv_path_pam,
  2473. [ use_pam=no
  2474. AC_CHECK_LIB(pam, pam_start,
  2475. [ AC_CHECK_HEADER(security/pam_appl.h,
  2476. [ use_pam=yes
  2477. pam_service=kde ])
  2478. ], , $LIBDL)
  2479. ac_cv_path_pam="use_pam=$use_pam pam_service=$pam_service"
  2480. ])
  2481. ])
  2482. eval "$ac_cv_path_pam"
  2483. AC_MSG_CHECKING(for PAM)
  2484. if test "x$use_pam" = xno; then
  2485. AC_MSG_RESULT(no)
  2486. PAMLIBS=""
  2487. else
  2488. AC_MSG_RESULT(yes)
  2489. AC_DEFINE(HAVE_PAM, 1, [Defines if you have PAM (Pluggable Authentication Modules)])
  2490. PAMLIBS="$PAM_MISC_LIB -lpam $LIBDL"
  2491. dnl test whether struct pam_message is const (Linux) or not (Sun)
  2492. AC_MSG_CHECKING(for const pam_message)
  2493. AC_EGREP_HEADER([struct pam_message], security/pam_appl.h,
  2494. [ AC_EGREP_HEADER([const struct pam_message], security/pam_appl.h,
  2495. [AC_MSG_RESULT([const: Linux-type PAM])],
  2496. [AC_MSG_RESULT([nonconst: Sun-type PAM])
  2497. AC_DEFINE(PAM_MESSAGE_NONCONST, 1, [Define if your PAM support takes non-const arguments (Solaris)])]
  2498. )],
  2499. [AC_MSG_RESULT([not found - assume const, Linux-type PAM])])
  2500. fi
  2501. AC_SUBST(PAMLIBS)
  2502. ])
  2503. dnl DEF_PAM_SERVICE(arg name, full name, define name)
  2504. AC_DEFUN(DEF_PAM_SERVICE, [
  2505. AC_ARG_WITH($1-pam,
  2506. [ --with-$1-pam=[val] override PAM service from --with-pam for $2],
  2507. [ if test "x$use_pam" = xyes; then
  2508. $3_PAM_SERVICE="$withval"
  2509. else
  2510. AC_MSG_ERROR([Cannot use use --with-$1-pam, as no PAM was detected.
  2511. You may want to enforce it by using --with-pam.])
  2512. fi
  2513. ],
  2514. [ if test "x$use_pam" = xyes; then
  2515. $3_PAM_SERVICE="$pam_service"
  2516. fi
  2517. ])
  2518. if test -n "$$3_PAM_SERVICE"; then
  2519. AC_MSG_RESULT([The PAM service used by $2 will be $$3_PAM_SERVICE])
  2520. AC_DEFINE_UNQUOTED($3_PAM_SERVICE, "$$3_PAM_SERVICE", [The PAM service to be used by $2])
  2521. fi
  2522. AC_SUBST($3_PAM_SERVICE)
  2523. ])
  2524. AC_DEFUN(KDE_SHADOWPASSWD, [
  2525. AC_REQUIRE([KDE_PAM])
  2526. AC_CHECK_LIB(shadow, getspent,
  2527. [ LIBSHADOW="-lshadow"
  2528. ac_use_shadow=yes
  2529. ],
  2530. [ dnl for UnixWare
  2531. AC_CHECK_LIB(gen, getspent,
  2532. [ LIBGEN="-lgen"
  2533. ac_use_shadow=yes
  2534. ],
  2535. [ AC_CHECK_FUNC(getspent,
  2536. [ ac_use_shadow=yes ],
  2537. [ ac_use_shadow=no ])
  2538. ])
  2539. ])
  2540. AC_SUBST(LIBSHADOW)
  2541. AC_SUBST(LIBGEN)
  2542. AC_MSG_CHECKING([for shadow passwords])
  2543. AC_ARG_WITH(shadow,
  2544. [ --with-shadow If you want shadow password support ],
  2545. [ if test "x$withval" != "xno"; then
  2546. use_shadow=yes
  2547. else
  2548. use_shadow=no
  2549. fi
  2550. ], [
  2551. use_shadow="$ac_use_shadow"
  2552. ])
  2553. if test "x$use_shadow" = xyes; then
  2554. AC_MSG_RESULT(yes)
  2555. AC_DEFINE(HAVE_SHADOW, 1, [Define if you use shadow passwords])
  2556. else
  2557. AC_MSG_RESULT(no)
  2558. LIBSHADOW=
  2559. LIBGEN=
  2560. fi
  2561. dnl finally make the relevant binaries setuid root, if we have shadow passwds.
  2562. dnl this still applies, if we could use it indirectly through pam.
  2563. if test "x$use_shadow" = xyes ||
  2564. ( test "x$use_pam" = xyes && test "x$ac_use_shadow" = xyes ); then
  2565. case $host in
  2566. *-*-freebsd* | *-*-netbsd* | *-*-openbsd*)
  2567. SETUIDFLAGS="-m 4755 -o root";;
  2568. *)
  2569. SETUIDFLAGS="-m 4755";;
  2570. esac
  2571. fi
  2572. AC_SUBST(SETUIDFLAGS)
  2573. ])
  2574. AC_DEFUN(KDE_PASSWDLIBS, [
  2575. AC_REQUIRE([KDE_MISC_TESTS]) dnl for LIBCRYPT
  2576. AC_REQUIRE([KDE_PAM])
  2577. AC_REQUIRE([KDE_SHADOWPASSWD])
  2578. if test "x$use_pam" = "xyes"; then
  2579. PASSWDLIBS="$PAMLIBS"
  2580. else
  2581. PASSWDLIBS="$LIBCRYPT $LIBSHADOW $LIBGEN"
  2582. fi
  2583. AC_SUBST(PASSWDLIBS)
  2584. ])
  2585. AC_DEFUN(KDE_CHECK_LIBDL,
  2586. [
  2587. AC_CHECK_LIB(dl, dlopen, [
  2588. LIBDL="-ldl"
  2589. ac_cv_have_dlfcn=yes
  2590. ])
  2591. AC_CHECK_LIB(dld, shl_unload, [
  2592. LIBDL="-ldld"
  2593. ac_cv_have_shload=yes
  2594. ])
  2595. AC_SUBST(LIBDL)
  2596. ])
  2597. AC_DEFUN(KDE_CHECK_DLOPEN,
  2598. [
  2599. KDE_CHECK_LIBDL
  2600. AC_CHECK_HEADERS(dlfcn.h dl.h)
  2601. if test "$ac_cv_header_dlfcn_h" = "no"; then
  2602. ac_cv_have_dlfcn=no
  2603. fi
  2604. if test "$ac_cv_header_dl_h" = "no"; then
  2605. ac_cv_have_shload=no
  2606. fi
  2607. dnl XXX why change enable_dlopen? its already set by autoconf's AC_ARG_ENABLE
  2608. dnl (MM)
  2609. AC_ARG_ENABLE(dlopen,
  2610. [ --disable-dlopen link statically [default=no]] ,
  2611. enable_dlopen=$enableval,
  2612. enable_dlopen=yes)
  2613. # override the user's opinion, if we know it better ;)
  2614. if test "$ac_cv_have_dlfcn" = "no" && test "$ac_cv_have_shload" = "no"; then
  2615. enable_dlopen=no
  2616. fi
  2617. if test "$ac_cv_have_dlfcn" = "yes"; then
  2618. AC_DEFINE_UNQUOTED(HAVE_DLFCN, 1, [Define if you have dlfcn])
  2619. fi
  2620. if test "$ac_cv_have_shload" = "yes"; then
  2621. AC_DEFINE_UNQUOTED(HAVE_SHLOAD, 1, [Define if you have shload])
  2622. fi
  2623. if test "$enable_dlopen" = no ; then
  2624. test -n "$1" && eval $1
  2625. else
  2626. test -n "$2" && eval $2
  2627. fi
  2628. ])
  2629. AC_DEFUN(KDE_CHECK_DYNAMIC_LOADING,
  2630. [
  2631. KDE_CHECK_DLOPEN(libtool_enable_shared=yes, libtool_enable_static=no)
  2632. KDE_PROG_LIBTOOL
  2633. AC_MSG_CHECKING([dynamic loading])
  2634. eval "`egrep '^build_libtool_libs=' libtool`"
  2635. if test "$build_libtool_libs" = "yes" && test "$enable_dlopen" = "yes"; then
  2636. dynamic_loading=yes
  2637. AC_DEFINE_UNQUOTED(HAVE_DYNAMIC_LOADING)
  2638. else
  2639. dynamic_loading=no
  2640. fi
  2641. AC_MSG_RESULT($dynamic_loading)
  2642. if test "$dynamic_loading" = "yes"; then
  2643. $1
  2644. else
  2645. $2
  2646. fi
  2647. ])
  2648. AC_DEFUN(KDE_ADD_INCLUDES,
  2649. [
  2650. if test -z "$1"; then
  2651. test_include="Pix.h"
  2652. else
  2653. test_include="$1"
  2654. fi
  2655. AC_MSG_CHECKING([for libg++ ($test_include)])
  2656. AC_CACHE_VAL(kde_cv_libgpp_includes,
  2657. [
  2658. kde_cv_libgpp_includes=no
  2659. for ac_dir in \
  2660. \
  2661. /usr/include/g++ \
  2662. /usr/include \
  2663. /usr/unsupported/include \
  2664. /opt/include \
  2665. $extra_include \
  2666. ; \
  2667. do
  2668. if test -r "$ac_dir/$test_include"; then
  2669. kde_cv_libgpp_includes=$ac_dir
  2670. break
  2671. fi
  2672. done
  2673. ])
  2674. AC_MSG_RESULT($kde_cv_libgpp_includes)
  2675. if test "$kde_cv_libgpp_includes" != "no"; then
  2676. all_includes="-I$kde_cv_libgpp_includes $all_includes $USER_INCLUDES"
  2677. fi
  2678. ])
  2679. ])
  2680. AC_DEFUN(KDE_CHECK_MICO,
  2681. [
  2682. AC_REQUIRE([KDE_CHECK_LIBDL])
  2683. AC_REQUIRE([KDE_MISC_TESTS])
  2684. AC_MSG_CHECKING(for MICO)
  2685. if test -z "$MICODIR"; then
  2686. kde_micodir=/usr/local
  2687. else
  2688. kde_micodir="$MICODIR"
  2689. fi
  2690. AC_ARG_WITH(micodir,
  2691. [ --with-micodir=micodir where mico is installed ],
  2692. kde_micodir=$withval,
  2693. kde_micodir=$kde_micodir
  2694. )
  2695. AC_CACHE_VAL(kde_cv_mico_incdir,
  2696. [
  2697. mico_incdirs="$kde_micodir/include /usr/include /usr/local/include /usr/local/include /opt/local/include $kde_extra_includes"
  2698. AC_FIND_FILE(CORBA.h, $mico_incdirs, kde_cv_mico_incdir)
  2699. ])
  2700. kde_micodir=`echo $kde_cv_mico_incdir | sed -e 's#/include##'`
  2701. if test ! -r $kde_micodir/include/CORBA.h; then
  2702. AC_MSG_ERROR([No CORBA.h found, specify another micodir])
  2703. fi
  2704. AC_MSG_RESULT($kde_micodir)
  2705. MICO_INCLUDES=-I$kde_micodir/include
  2706. AC_SUBST(MICO_INCLUDES)
  2707. MICO_LDFLAGS=-L$kde_micodir/lib
  2708. AC_SUBST(MICO_LDFLAGS)
  2709. micodir=$kde_micodir
  2710. AC_SUBST(micodir)
  2711. AC_MSG_CHECKING([for MICO version])
  2712. AC_CACHE_VAL(kde_cv_mico_version,
  2713. [
  2714. AC_LANG_C
  2715. cat >conftest.$ac_ext <<EOF
  2716. #include <stdio.h>
  2717. #include <mico/version.h>
  2718. int main() {
  2719. printf("MICO_VERSION=%s\n",MICO_VERSION);
  2720. return (0);
  2721. }
  2722. EOF
  2723. ac_compile='${CC-gcc} $CFLAGS $MICO_INCLUDES conftest.$ac_ext -o conftest'
  2724. if AC_TRY_EVAL(ac_compile); then
  2725. if eval `./conftest 2>&5`; then
  2726. kde_cv_mico_version=$MICO_VERSION
  2727. else
  2728. AC_MSG_ERROR([your system is not able to execute a small application to
  2729. find MICO version! Check $kde_micodir/include/mico/version.h])
  2730. fi
  2731. else
  2732. AC_MSG_ERROR([your system is not able to compile a small application to
  2733. find MICO version! Check $kde_micodir/include/mico/version.h])
  2734. fi
  2735. ])
  2736. dnl installed MICO version
  2737. mico_v_maj=`echo $kde_cv_mico_version | sed -e 's/^\(.*\)\..*\..*$/\1/'`
  2738. mico_v_mid=`echo $kde_cv_mico_version | sed -e 's/^.*\.\(.*\)\..*$/\1/'`
  2739. mico_v_min=`echo $kde_cv_mico_version | sed -e 's/^.*\..*\.\(.*\)$/\1/'`
  2740. if test "x$1" = "x"; then
  2741. req_version="2.3.0"
  2742. else
  2743. req_version=$1
  2744. fi
  2745. dnl required MICO version
  2746. req_v_maj=`echo $req_version | sed -e 's/^\(.*\)\..*\..*$/\1/'`
  2747. req_v_mid=`echo $req_version | sed -e 's/^.*\.\(.*\)\..*$/\1/'`
  2748. req_v_min=`echo $req_version | sed -e 's/^.*\..*\.\(.*\)$/\1/'`
  2749. if test "$mico_v_maj" -lt "$req_v_maj" || \
  2750. ( test "$mico_v_maj" -eq "$req_v_maj" && \
  2751. test "$mico_v_mid" -lt "$req_v_mid" ) || \
  2752. ( test "$mico_v_mid" -eq "$req_v_mid" && \
  2753. test "$mico_v_min" -lt "$req_v_min" )
  2754. then
  2755. AC_MSG_ERROR([found MICO version $kde_cv_mico_version but version $req_version \
  2756. at least is required. You should upgrade MICO.])
  2757. else
  2758. AC_MSG_RESULT([$kde_cv_mico_version (minimum version $req_version, ok)])
  2759. fi
  2760. LIBMICO="-lmico$kde_cv_mico_version $LIBCRYPT $LIBSOCKET $LIBDL"
  2761. AC_SUBST(LIBMICO)
  2762. if test -z "$IDL"; then
  2763. IDL='$(kde_bindir)/cuteidl'
  2764. fi
  2765. AC_SUBST(IDL)
  2766. IDL_DEPENDENCIES='$(kde_includes)/CUTE.h'
  2767. AC_SUBST(IDL_DEPENDENCIES)
  2768. idldir="\$(includedir)/idl"
  2769. AC_SUBST(idldir)
  2770. ])
  2771. AC_DEFUN(KDE_CHECK_MINI_STL,
  2772. [
  2773. AC_REQUIRE([KDE_CHECK_MICO])
  2774. AC_MSG_CHECKING(if we use mico's mini-STL)
  2775. AC_CACHE_VAL(kde_cv_have_mini_stl,
  2776. [
  2777. AC_LANG_SAVE
  2778. AC_LANG_CPLUSPLUS
  2779. kde_save_cxxflags="$CXXFLAGS"
  2780. CXXFLAGS="$CXXFLAGS $MICO_INCLUDES"
  2781. AC_TRY_COMPILE(
  2782. [
  2783. #include <mico/config.h>
  2784. ],
  2785. [
  2786. #ifdef HAVE_MINI_STL
  2787. #error "nothing"
  2788. #endif
  2789. ],
  2790. kde_cv_have_mini_stl=no,
  2791. kde_cv_have_mini_stl=yes)
  2792. CXXFLAGS="$kde_save_cxxflags"
  2793. AC_LANG_RESTORE
  2794. ])
  2795. if test "x$kde_cv_have_mini_stl" = "xyes"; then
  2796. AC_MSG_RESULT(yes)
  2797. $1
  2798. else
  2799. AC_MSG_RESULT(no)
  2800. $2
  2801. fi
  2802. ])
  2803. ])
  2804. AC_DEFUN(KDE_CHECK_LIBPTHREAD,
  2805. [
  2806. AC_CHECK_LIB(pthread, pthread_create, [LIBPTHREAD="-lpthread"] )
  2807. AC_SUBST(LIBPTHREAD)
  2808. ])
  2809. AC_DEFUN(KDE_CHECK_PTHREAD_OPTION,
  2810. [
  2811. AC_ARG_ENABLE(kernel-threads, [ --enable-kernel-threads Enable the use of the LinuxThreads port on FreeBSD/i386 only.],
  2812. kde_use_kernthreads=$enableval, kde_use_kernthreads=no)
  2813. if test "$kde_use_kernthreads" = "yes"; then
  2814. ac_save_CXXFLAGS="$CXXFLAGS"
  2815. ac_save_CFLAGS="$CXXFLAGS"
  2816. CXXFLAGS="-I/usr/local/include/pthread/linuxthreads $CXXFLAGS"
  2817. CFLAGS="-I/usr/local/include/pthread/linuxthreads $CFLAGS"
  2818. AC_CHECK_HEADERS(pthread/linuxthreads/pthread.h)
  2819. CXXFLAGS="$ac_save_CXXFLAGS"
  2820. CFLAGS="$ac_save_CFLAGS"
  2821. if test "$ac_cv_header_pthread_linuxthreads_pthread_h" = "no"; then
  2822. kde_use_kernthreads=no
  2823. else
  2824. dnl Add proper -I and -l statements
  2825. AC_CHECK_LIB(lthread, pthread_join, [LIBPTHREAD="-llthread -llgcc_r"]) dnl for FreeBSD
  2826. if test "x$LIBPTHREAD" = "x"; then
  2827. kde_use_kernthreads=no
  2828. else
  2829. USE_THREADS="-D_THREAD_SAFE -I/usr/local/include/pthread/linuxthreads"
  2830. fi
  2831. fi
  2832. else
  2833. USE_THREADS=""
  2834. if test -z "$LIBPTHREAD"; then
  2835. KDE_CHECK_COMPILER_FLAG(pthread, [USE_THREADS="-pthread"] )
  2836. fi
  2837. fi
  2838. case $host_os in
  2839. solaris*)
  2840. KDE_CHECK_COMPILER_FLAG(mt, [USE_THREADS="-mt"])
  2841. CPPFLAGS="$CPPFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_SOLARIS -DSVR4"
  2842. echo "Setting Solaris pthread compilation options"
  2843. ;;
  2844. freebsd*)
  2845. CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
  2846. echo "Setting FreeBSD pthread compilation options"
  2847. ;;
  2848. aix*)
  2849. CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
  2850. LIBPTHREAD="$LIBPTHREAD -lc_r"
  2851. echo "Setting AIX pthread compilation options"
  2852. ;;
  2853. linux*) CPPFLAGS="$CPPFLAGS -D_REENTRANT"
  2854. USE_THREADS="$USE_THREADS -DPIC -fPIC"
  2855. echo "Setting Linux pthread compilation options"
  2856. ;;
  2857. *)
  2858. ;;
  2859. esac
  2860. AC_SUBST(USE_THREADS)
  2861. AC_SUBST(LIBPTHREAD)
  2862. ])
  2863. AC_DEFUN(KDE_CHECK_THREADING,
  2864. [
  2865. AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
  2866. AC_REQUIRE([KDE_CHECK_PTHREAD_OPTION])
  2867. dnl default is yes if libpthread is found and no if no libpthread is available
  2868. if test -z "$LIBPTHREAD"; then
  2869. kde_check_threading_default=no
  2870. else
  2871. kde_check_threading_default=yes
  2872. fi
  2873. AC_ARG_ENABLE(threading, [ --disable-threading disables threading even if libpthread found ],
  2874. kde_use_threading=$enableval, kde_use_threading=$kde_check_threading_default)
  2875. if test "x$kde_use_threading" = "xyes"; then
  2876. AC_DEFINE(HAVE_LIBPTHREAD, 1, [Define if you have a working libpthread (will enable threaded code)])
  2877. fi
  2878. ])
  2879. AC_DEFUN(KDE_TRY_LINK_PYTHON,
  2880. [
  2881. if test "$kde_python_link_found" = no; then
  2882. if test "$1" = normal; then
  2883. AC_MSG_CHECKING(if a Python application links)
  2884. else
  2885. AC_MSG_CHECKING(if Python depends on $2)
  2886. fi
  2887. AC_CACHE_VAL(kde_cv_try_link_python_$1,
  2888. [
  2889. AC_LANG_SAVE
  2890. AC_LANG_C
  2891. kde_save_cflags="$CFLAGS"
  2892. CFLAGS="$CFLAGS $PYTHONINC"
  2893. kde_save_libs="$LIBS"
  2894. LIBS="$LIBS $LIBPYTHON $2 $LIBDL $LIBSOCKET"
  2895. kde_save_ldflags="$LDFLAGS"
  2896. LDFLAGS="$LDFLAGS $PYTHONLIB"
  2897. AC_TRY_LINK(
  2898. [
  2899. #include <Python.h>
  2900. ],[
  2901. PySys_SetArgv(1, 0);
  2902. ],
  2903. [kde_cv_try_link_python_$1=yes],
  2904. [kde_cv_try_link_python_$1=no]
  2905. )
  2906. CFLAGS="$kde_save_cflags"
  2907. LIBS="$kde_save_libs"
  2908. LDFLAGS="$kde_save_ldflags"
  2909. ])
  2910. if test "$kde_cv_try_link_python_$1" = "yes"; then
  2911. AC_MSG_RESULT(yes)
  2912. kde_python_link_found=yes
  2913. if test ! "$1" = normal; then
  2914. LIBPYTHON="$LIBPYTHON $2"
  2915. fi
  2916. $3
  2917. else
  2918. AC_MSG_RESULT(no)
  2919. $4
  2920. fi
  2921. AC_LANG_RESTORE
  2922. fi
  2923. ])
  2924. AC_DEFUN(KDE_CHECK_PYTHON_DIR,
  2925. [
  2926. AC_MSG_CHECKING([for Python directory])
  2927. AC_CACHE_VAL(kde_cv_pythondir,
  2928. [
  2929. if test -z "$PYTHONDIR"; then
  2930. kde_cv_pythondir=/usr/local
  2931. else
  2932. kde_cv_pythondir="$PYTHONDIR"
  2933. fi
  2934. ])
  2935. AC_ARG_WITH(pythondir,
  2936. [ --with-pythondir=pythondir use python installed in pythondir ],
  2937. [
  2938. ac_python_dir=$withval
  2939. ], ac_python_dir=$kde_cv_pythondir
  2940. )
  2941. AC_MSG_RESULT($ac_python_dir)
  2942. ])
  2943. AC_DEFUN(KDE_CHECK_PYTHON_INTERN,
  2944. [
  2945. AC_REQUIRE([KDE_CHECK_LIBDL])
  2946. AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
  2947. AC_REQUIRE([KDE_CHECK_PYTHON_DIR])
  2948. if test -z "$1"; then
  2949. version="1.5"
  2950. else
  2951. version="$1"
  2952. fi
  2953. AC_MSG_CHECKING([for Python$version])
  2954. python_incdirs="$ac_python_dir/include /usr/include /usr/local/include/ $kde_extra_includes"
  2955. AC_FIND_FILE(Python.h, $python_incdirs, python_incdir)
  2956. if test ! -r $python_incdir/Python.h; then
  2957. AC_FIND_FILE(python$version/Python.h, $python_incdirs, python_incdir)
  2958. python_incdir=$python_incdir/python$version
  2959. if test ! -r $python_incdir/Python.h; then
  2960. python_incdir=no
  2961. fi
  2962. fi
  2963. PYTHONINC=-I$python_incdir
  2964. python_libdirs="$ac_python_dir/lib /usr/lib /usr/local /usr/lib $kde_extra_libs"
  2965. AC_FIND_FILE(libpython$version.a, $python_libdirs, python_libdir)
  2966. if test ! -r $python_libdir/libpython$version.a; then
  2967. AC_FIND_FILE(python$version/config/libpython$version.a, $python_libdirs, python_libdir)
  2968. python_libdir=$python_libdir/python$version/config
  2969. if test ! -r $python_libdir/libpython$version.a; then
  2970. python_libdir=no
  2971. fi
  2972. fi
  2973. PYTHONLIB=-L$python_libdir
  2974. kde_orig_LIBPYTHON=$LIBPYTHON
  2975. if test -z "$LIBPYTHON"; then
  2976. LIBPYTHON=-lpython$version
  2977. fi
  2978. python_libdirs="$ac_python_dir/lib /usr/lib /usr/local /usr/lib $kde_extra_libs"
  2979. AC_FIND_FILE(python$version/copy.py, $python_libdirs, python_moddir)
  2980. python_moddir=$python_moddir/python$version
  2981. if test ! -r $python_moddir/copy.py; then
  2982. python_moddir=no
  2983. fi
  2984. PYTHONMODDIR=$python_moddir
  2985. AC_MSG_RESULT(header $python_incdir library $python_libdir modules $python_moddir)
  2986. if test x$python_incdir = xno || test x$python_libdir = xno || test x$python_moddir = xno; then
  2987. LIBPYTHON=$kde_orig_LIBPYTHON
  2988. test "x$PYTHONLIB" = "x-Lno" && PYTHONLIB=""
  2989. test "x$PYTHONINC" = "x-Ino" && PYTHONINC=""
  2990. $2
  2991. else
  2992. dnl Note: this test is very weak
  2993. kde_python_link_found=no
  2994. KDE_TRY_LINK_PYTHON(normal)
  2995. KDE_TRY_LINK_PYTHON(m, -lm)
  2996. KDE_TRY_LINK_PYTHON(pthread, $LIBPTHREAD)
  2997. KDE_TRY_LINK_PYTHON(tcl, -ltcl)
  2998. KDE_TRY_LINK_PYTHON(m_and_thread, [$LIBPTHREAD -lm])
  2999. KDE_TRY_LINK_PYTHON(m_and_thread_and_util, [$LIBPTHREAD -lm -lutil])
  3000. KDE_TRY_LINK_PYTHON(m_and_thread_and_db3, [$LIBPTHREAD -lm -ldb-3 -lutil])
  3001. KDE_TRY_LINK_PYTHON(pthread_and_db3, [$LIBPTHREAD -ldb-3])
  3002. KDE_TRY_LINK_PYTHON(m_and_thread_and_db, [$LIBPTHREAD -lm -ldb -ltermcap -lutil])
  3003. KDE_TRY_LINK_PYTHON(m_and_thread_and_db_special, [$LIBPTHREAD -lm -ldb -lutil], [],
  3004. [AC_MSG_WARN([it seems, Python depends on another library.
  3005. Pleae use \"make LIBPYTHON='-lpython$version -lotherlib'\" to fix this
  3006. and contact the authors to let them know about this problem])
  3007. ])
  3008. LIBPYTHON="$LIBPYTHON $LIBDL $LIBSOCKET"
  3009. AC_SUBST(PYTHONINC)
  3010. AC_SUBST(PYTHONLIB)
  3011. AC_SUBST(LIBPYTHON)
  3012. AC_SUBST(PYTHONMODDIR)
  3013. AC_DEFINE(HAVE_PYTHON, 1, [Define if you have the development files for python])
  3014. fi
  3015. ])
  3016. AC_DEFUN(KDE_CHECK_PYTHON,
  3017. [
  3018. KDE_CHECK_PYTHON_INTERN("2.1", [KDE_CHECK_PYTHON_INTERN("2.0",
  3019. [ KDE_CHECK_PYTHON_INTERN($1, $2) ])
  3020. ])
  3021. ])
  3022. AC_DEFUN(KDE_CHECK_STL_SGI,
  3023. [
  3024. AC_MSG_CHECKING([if STL implementation is SGI like])
  3025. AC_CACHE_VAL(kde_cv_stl_type_sgi,
  3026. [
  3027. AC_TRY_COMPILE([
  3028. #include <string>
  3029. using namespace std;
  3030. ],[
  3031. string astring="Hallo Welt.";
  3032. astring.erase(0, 6); // now astring is "Welt"
  3033. return 0;
  3034. ], kde_cv_stl_type_sgi=yes,
  3035. kde_cv_stl_type_sgi=no)
  3036. ])
  3037. AC_MSG_RESULT($kde_cv_stl_type_sgi)
  3038. if test "$kde_cv_stl_type_sgi" = "yes"; then
  3039. AC_DEFINE_UNQUOTED(HAVE_SGI_STL, 1, [Define if you have a STL implementation by SGI])
  3040. fi
  3041. ])
  3042. AC_DEFUN(KDE_CHECK_STL_HP,
  3043. [
  3044. AC_MSG_CHECKING([if STL implementation is HP like])
  3045. AC_CACHE_VAL(kde_cv_stl_type_hp,
  3046. [
  3047. AC_TRY_COMPILE([
  3048. #include <string>
  3049. using namespace std;
  3050. ],[
  3051. string astring="Hello World";
  3052. astring.remove(0, 6); // now astring is "World"
  3053. return 0;
  3054. ], kde_cv_stl_type_hp=yes,
  3055. kde_cv_stl_type_hp=no)
  3056. ])
  3057. AC_MSG_RESULT($kde_cv_stl_type_hp)
  3058. if test "$kde_cv_stl_type_hp" = "yes"; then
  3059. AC_DEFINE_UNQUOTED(HAVE_HP_STL, 1, [Define if you have a STL implementation by HP])
  3060. fi
  3061. ])
  3062. AC_DEFUN(KDE_CHECK_STL,
  3063. [
  3064. AC_LANG_SAVE
  3065. AC_LANG_CPLUSPLUS
  3066. ac_save_CXXFLAGS="$CXXFLAGS"
  3067. CXXFLAGS="`echo $CXXFLAGS | sed s/-fno-exceptions//`"
  3068. KDE_CHECK_STL_SGI
  3069. if test "$kde_cv_stl_type_sgi" = "no"; then
  3070. KDE_CHECK_STL_HP
  3071. if test "$kde_cv_stl_type_hp" = "no"; then
  3072. AC_MSG_ERROR("no known STL type found")
  3073. fi
  3074. fi
  3075. CXXFLAGS="$ac_save_CXXFLAGS"
  3076. AC_LANG_RESTORE
  3077. ])
  3078. AC_DEFUN(AC_FIND_QIMGIO,
  3079. [AC_REQUIRE([AC_FIND_JPEG])
  3080. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  3081. AC_MSG_CHECKING([for qimgio])
  3082. AC_CACHE_VAL(ac_cv_lib_qimgio,
  3083. [
  3084. AC_LANG_SAVE
  3085. AC_LANG_CPLUSPLUS
  3086. ac_save_LIBS="$LIBS"
  3087. ac_save_CXXFLAGS="$CXXFLAGS"
  3088. LIBS="$all_libraries -lqimgio -lpng -lz $LIBJPEG $LIBQT"
  3089. CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
  3090. AC_TRY_RUN(dnl
  3091. [
  3092. #include <qimageio.h>
  3093. #include <qstring.h>
  3094. int main() {
  3095. QString t = "hallo";
  3096. t.fill('t');
  3097. qInitImageIO();
  3098. }
  3099. ],
  3100. ac_cv_lib_qimgio=yes,
  3101. ac_cv_lib_qimgio=no,
  3102. ac_cv_lib_qimgio=no)
  3103. LIBS="$ac_save_LIBS"
  3104. CXXFLAGS="$ac_save_CXXFLAGS"
  3105. AC_LANG_RESTORE
  3106. ])dnl
  3107. if eval "test \"`echo $ac_cv_lib_qimgio`\" = yes"; then
  3108. LIBQIMGIO="-lqimgio -lpng -lz $LIBJPEG"
  3109. AC_MSG_RESULT(yes)
  3110. AC_DEFINE_UNQUOTED(HAVE_QIMGIO, 1, [Define if you have the Qt extension qimgio available])
  3111. AC_SUBST(LIBQIMGIO)
  3112. else
  3113. AC_MSG_RESULT(not found)
  3114. fi
  3115. ])
  3116. AC_DEFUN(KDE_CHECK_ANSI,
  3117. [
  3118. ])
  3119. AC_DEFUN(KDE_CHECK_INSURE,
  3120. [
  3121. AC_ARG_ENABLE(insure, [ --enable-insure use insure++ for debugging [default=no]],
  3122. [
  3123. if test $enableval = "no"; dnl
  3124. then ac_use_insure="no"
  3125. else ac_use_insure="yes"
  3126. fi
  3127. ], [ac_use_insure="no"])
  3128. AC_MSG_CHECKING(if we will use Insure++ to debug)
  3129. AC_MSG_RESULT($ac_use_insure)
  3130. if test "$ac_use_insure" = "yes"; dnl
  3131. then CC="insure"; CXX="insure"; dnl CFLAGS="$CLAGS -fno-rtti -fno-exceptions "????
  3132. fi
  3133. ])
  3134. AC_DEFUN(AM_DISABLE_LIBRARIES,
  3135. [
  3136. AC_PROVIDE([AM_ENABLE_STATIC])
  3137. AC_PROVIDE([AM_ENABLE_SHARED])
  3138. enable_static=no
  3139. enable_shared=yes
  3140. ])
  3141. AC_DEFUN(AC_CHECK_UTMP_FILE,
  3142. [
  3143. AC_MSG_CHECKING([for utmp file])
  3144. AC_CACHE_VAL(kde_cv_utmp_file,
  3145. [
  3146. kde_cv_utmp_file=no
  3147. for ac_file in \
  3148. \
  3149. /var/run/utmp \
  3150. /var/adm/utmp \
  3151. /etc/utmp \
  3152. ; \
  3153. do
  3154. if test -r "$ac_file"; then
  3155. kde_cv_utmp_file=$ac_file
  3156. break
  3157. fi
  3158. done
  3159. ])
  3160. if test "$kde_cv_utmp_file" != "no"; then
  3161. AC_DEFINE_UNQUOTED(UTMP, "$kde_cv_utmp_file", [Define the file for utmp entries])
  3162. $1
  3163. AC_MSG_RESULT($kde_cv_utmp_file)
  3164. else
  3165. $2
  3166. AC_MSG_RESULT([non found])
  3167. fi
  3168. ])
  3169. AC_DEFUN(KDE_CREATE_SUBDIRSLIST,
  3170. [
  3171. DO_NOT_COMPILE="$DO_NOT_COMPILE CVS debian bsd-port admin"
  3172. if test ! -s $srcdir/subdirs; then
  3173. dnl Note: Makefile.common creates subdirs, so this is just a fallback
  3174. TOPSUBDIRS=""
  3175. files=`cd $srcdir && ls -1`
  3176. dirs=`for i in $files; do if test -d $i; then echo $i; fi; done`
  3177. for i in $dirs; do
  3178. echo $i >> $srcdir/subdirs
  3179. done
  3180. fi
  3181. if test -s $srcdir/inst-apps; then
  3182. ac_topsubdirs="`cat $srcdir/inst-apps`"
  3183. else
  3184. ac_topsubdirs="`cat $srcdir/subdirs`"
  3185. fi
  3186. for i in $ac_topsubdirs; do
  3187. AC_MSG_CHECKING([if $i should be compiled])
  3188. if test -d $srcdir/$i; then
  3189. install_it="yes"
  3190. for j in $DO_NOT_COMPILE; do
  3191. if test $i = $j; then
  3192. install_it="no"
  3193. fi
  3194. done
  3195. else
  3196. install_it="no"
  3197. fi
  3198. AC_MSG_RESULT($install_it)
  3199. if test $install_it = "yes"; then
  3200. TOPSUBDIRS="$TOPSUBDIRS $i"
  3201. fi
  3202. done
  3203. AC_SUBST(TOPSUBDIRS)
  3204. ])
  3205. AC_DEFUN(KDE_CHECK_NAMESPACES,
  3206. [
  3207. AC_MSG_CHECKING(whether C++ compiler supports namespaces)
  3208. AC_LANG_SAVE
  3209. AC_LANG_CPLUSPLUS
  3210. AC_TRY_COMPILE([
  3211. ],
  3212. [
  3213. namespace Foo {
  3214. extern int i;
  3215. namespace Bar {
  3216. extern int i;
  3217. }
  3218. }
  3219. int Foo::i = 0;
  3220. int Foo::Bar::i = 1;
  3221. ],[
  3222. AC_MSG_RESULT(yes)
  3223. AC_DEFINE(HAVE_NAMESPACES)
  3224. ], [
  3225. AC_MSG_RESULT(no)
  3226. ])
  3227. AC_LANG_RESTORE
  3228. ])
  3229. AC_DEFUN(KDE_CHECK_NEWLIBS,
  3230. [
  3231. ])
  3232. dnl ------------------------------------------------------------------------
  3233. dnl Check for S_ISSOCK macro. Doesn't exist on Unix SCO. faure@kde.org
  3234. dnl ------------------------------------------------------------------------
  3235. dnl
  3236. AC_DEFUN(AC_CHECK_S_ISSOCK,
  3237. [
  3238. AC_MSG_CHECKING(for S_ISSOCK)
  3239. AC_CACHE_VAL(ac_cv_have_s_issock,
  3240. [
  3241. AC_LANG_SAVE
  3242. AC_LANG_C
  3243. AC_TRY_LINK(
  3244. [
  3245. #include <sys/stat.h>
  3246. ],
  3247. [
  3248. struct stat buff;
  3249. int b = S_ISSOCK( buff.st_mode );
  3250. ],
  3251. ac_cv_have_s_issock=yes,
  3252. ac_cv_have_s_issock=no)
  3253. AC_LANG_RESTORE
  3254. ])
  3255. AC_MSG_RESULT($ac_cv_have_s_issock)
  3256. if test "$ac_cv_have_s_issock" = "yes"; then
  3257. AC_DEFINE_UNQUOTED(HAVE_S_ISSOCK, 1, [Define if sys/stat.h declares S_ISSOCK.])
  3258. fi
  3259. ])
  3260. dnl ------------------------------------------------------------------------
  3261. dnl Check for MAXPATHLEN macro, defines KDEMAXPATHLEN. faure@kde.org
  3262. dnl ------------------------------------------------------------------------
  3263. dnl
  3264. AC_DEFUN(AC_CHECK_KDEMAXPATHLEN,
  3265. [
  3266. AC_MSG_CHECKING(for MAXPATHLEN)
  3267. AC_CACHE_VAL(ac_cv_maxpathlen,
  3268. [
  3269. AC_LANG_C
  3270. cat > conftest.$ac_ext <<EOF
  3271. #ifdef STDC_HEADERS
  3272. # include <stdlib.h>
  3273. #endif
  3274. #include <stdio.h>
  3275. #include <sys/param.h>
  3276. #ifndef MAXPATHLEN
  3277. #define MAXPATHLEN 1024
  3278. #endif
  3279. KDE_HELLO MAXPATHLEN
  3280. EOF
  3281. ac_try="$ac_cpp conftest.$ac_ext 2>/dev/null | grep '^KDE_HELLO' >conftest.out"
  3282. if AC_TRY_EVAL(ac_try) && test -s conftest.out; then
  3283. ac_cv_maxpathlen=`sed 's#KDE_HELLO ##' conftest.out`
  3284. else
  3285. ac_cv_maxpathlen=1024
  3286. fi
  3287. rm conftest.*
  3288. ])
  3289. AC_MSG_RESULT($ac_cv_maxpathlen)
  3290. AC_DEFINE_UNQUOTED(KDEMAXPATHLEN,$ac_cv_maxpathlen, [Define a safe value for MAXPATHLEN] )
  3291. ])
  3292. dnl -------------------------------------------------------------------------
  3293. dnl See if the compiler supports a template repository bero@redhat.de
  3294. dnl -------------------------------------------------------------------------
  3295. AC_DEFUN(KDE_COMPILER_REPO,
  3296. [
  3297. REPO=""
  3298. NOREPO=""
  3299. KDE_CHECK_COMPILER_FLAG(frepo,
  3300. [
  3301. REPO="-frepo"
  3302. NOREPO="-fno-repo"
  3303. ])
  3304. if test -z "$REPO"; then
  3305. KDE_CHECK_COMPILER_FLAG(instances=explicit,
  3306. [
  3307. REPO="-instances=explicit"
  3308. NOREPO="-instances=extern"
  3309. ])
  3310. fi
  3311. if test -n "$REPO"; then
  3312. AC_DEFINE_UNQUOTED(HAVE_TEMPLATE_REPOSITORY, 1,
  3313. [C++ compiler supports template repository])
  3314. $1
  3315. fi
  3316. AC_SUBST(REPO)
  3317. AC_SUBST(NOREPO)
  3318. ])
  3319. AC_DEFUN(KDE_CHECK_HEADER,
  3320. [
  3321. AC_LANG_SAVE
  3322. kde_safe_cppflags=$CPPFLAGS
  3323. CPPFLAGS="$CPPFLAGS $all_includes"
  3324. AC_LANG_CPLUSPLUS
  3325. AC_CHECK_HEADER($1, $2, $3)
  3326. CPPFLAGS=$kde_safe_cppflags
  3327. AC_LANG_RESTORE
  3328. ])
  3329. AC_DEFUN(KDE_CHECK_QWSPRITEFIELD,
  3330. [
  3331. KDE_CHECK_HEADER(QwSpriteField.h, ,
  3332. [
  3333. AC_MSG_WARN([you don't have QwSpriteField.h somewhere. Please install
  3334. QwSpriteField out of kdesupport.])
  3335. $1
  3336. ])
  3337. ])
  3338. AC_DEFUN(KDE_FAST_CONFIGURE,
  3339. [
  3340. dnl makes configure fast (needs perl)
  3341. AC_ARG_ENABLE(fast-perl, [ --disable-fast-perl disable fast Makefile generation (needs perl)],
  3342. with_fast_perl=$enableval, with_fast_perl=yes)
  3343. ])
  3344. AC_DEFUN(KDE_CONF_FILES,
  3345. [
  3346. val=
  3347. if test -f $srcdir/configure.files ; then
  3348. val=`sed -e 's%^%\$(top_srcdir)/%' $srcdir/configure.files`
  3349. fi
  3350. CONF_FILES=
  3351. if test -n "$val" ; then
  3352. for i in $val ; do
  3353. CONF_FILES="$CONF_FILES $i"
  3354. done
  3355. fi
  3356. AC_SUBST(CONF_FILES)
  3357. ])dnl
  3358. AC_DEFUN(KDE_SET_PREFIX,
  3359. [
  3360. unset CDPATH
  3361. dnl make $KDEDIR the default for the installation
  3362. AC_PREFIX_DEFAULT(${KDEDIR:-/usr/local/kde})
  3363. if test "x$prefix" = "xNONE"; then
  3364. prefix=$ac_default_prefix
  3365. ac_configure_args="$ac_configure_args --prefix $prefix"
  3366. fi
  3367. KDE_FAST_CONFIGURE
  3368. KDE_CONF_FILES
  3369. ])
  3370. pushdef([AC_PROG_INSTALL],
  3371. [
  3372. dnl our own version, testing for a -p flag
  3373. popdef([AC_PROG_INSTALL])
  3374. dnl as AC_PROG_INSTALL works as it works we first have
  3375. dnl to save if the user didn't specify INSTALL, as the
  3376. dnl autoconf one overwrites INSTALL and we have no chance to find
  3377. dnl out afterwards
  3378. test -n "$INSTALL" && kde_save_INSTALL_given=$INSTALL
  3379. test -n "$INSTALL_PROGRAM" && kde_save_INSTALL_PROGRAM_given=$INSTALL_PROGRAM
  3380. test -n "$INSTALL_SCRIPT" && kde_save_INSTALL_SCRIPT_given=$INSTALL_SCRIPT
  3381. AC_PROG_INSTALL
  3382. if test -z "$kde_save_INSTALL_given" ; then
  3383. # OK, user hasn't given any INSTALL, autoconf found one for us
  3384. # now we test, if it supports the -p flag
  3385. AC_MSG_CHECKING(for -p flag to install)
  3386. rm -f confinst.$$.* > /dev/null 2>&1
  3387. echo "Testtest" > confinst.$$.orig
  3388. ac_res=no
  3389. if ${INSTALL} -p confinst.$$.orig confinst.$$.new > /dev/null 2>&1 ; then
  3390. if test -f confinst.$$.new ; then
  3391. # OK, -p seems to do no harm to install
  3392. INSTALL="${INSTALL} -p"
  3393. ac_res=yes
  3394. fi
  3395. fi
  3396. rm -f confinst.$$.*
  3397. AC_MSG_RESULT($ac_res)
  3398. fi
  3399. dnl the following tries to resolve some signs and wonders coming up
  3400. dnl with different autoconf/automake versions
  3401. dnl e.g.:
  3402. dnl *automake 1.4 install-strip sets A_M_INSTALL_PROGRAM_FLAGS to -s
  3403. dnl and has INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(A_M_INSTALL_PROGRAM_FLAGS)
  3404. dnl it header-vars.am, so there the actual INSTALL_PROGRAM gets the -s
  3405. dnl *automake 1.4a (and above) use INSTALL_STRIP_FLAG and only has
  3406. dnl INSTALL_PROGRAM = @INSTALL_PROGRAM@ there, but changes the
  3407. dnl install-@DIR@PROGRAMS targets to explicitly use that flag
  3408. dnl *autoconf 2.13 is dumb, and thinks it can use INSTALL_PROGRAM as
  3409. dnl INSTALL_SCRIPT, which breaks with automake <= 1.4
  3410. dnl *autoconf >2.13 (since 10.Apr 1999) has not that failure
  3411. dnl *sometimes KDE does not use the install-@DIR@PROGRAM targets from
  3412. dnl automake (due to broken Makefile.am or whatever) to install programs,
  3413. dnl and so does not see the -s flag in automake > 1.4
  3414. dnl to clean up that mess we:
  3415. dnl +set INSTALL_PROGRAM to use INSTALL_STRIP_FLAG
  3416. dnl which cleans KDE's program with automake > 1.4;
  3417. dnl +set INSTALL_SCRIPT to only use INSTALL, to clean up autoconf's problems
  3418. dnl with automake<=1.4
  3419. dnl note that dues to this sometimes two '-s' flags are used (if KDE
  3420. dnl properly uses install-@DIR@PROGRAMS, but I don't care
  3421. dnl
  3422. dnl And to all this comes, that I even can't write in comments variable
  3423. dnl names used by automake, because it is so stupid to think I wanted to
  3424. dnl _use_ them, therefor I have written A_M_... instead of AM_
  3425. dnl hmm, I wanted to say something ... ahh yes: Arghhh.
  3426. if test -z "$kde_save_INSTALL_PROGRAM_given" ; then
  3427. INSTALL_PROGRAM='${INSTALL} $(INSTALL_STRIP_FLAG)'
  3428. fi
  3429. if test -z "$kde_save_INSTALL_SCRIPT_given" ; then
  3430. INSTALL_SCRIPT='${INSTALL}'
  3431. fi
  3432. ])dnl
  3433. AC_DEFUN(KDE_LANG_CPLUSPLUS,
  3434. [AC_LANG_CPLUSPLUS
  3435. ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&AC_FD_CC'
  3436. pushdef([AC_LANG_CPLUSPLUS], [popdef([AC_LANG_CPLUSPLUS]) KDE_LANG_CPLUSPLUS])
  3437. ])
  3438. pushdef([AC_LANG_CPLUSPLUS],
  3439. [popdef([AC_LANG_CPLUSPLUS])
  3440. KDE_LANG_CPLUSPLUS
  3441. ])
  3442. AC_DEFUN(KDE_CHECK_LONG_LONG,
  3443. [
  3444. AC_MSG_CHECKING(for long long)
  3445. AC_CACHE_VAL(kde_cv_c_long_long,
  3446. [
  3447. AC_LANG_SAVE
  3448. AC_LANG_CPLUSPLUS
  3449. AC_TRY_LINK([], [
  3450. long long foo = 0;
  3451. foo = foo+1;
  3452. ],
  3453. kde_cv_c_long_long=yes, kde_cv_c_long_long=no)
  3454. ])
  3455. AC_MSG_RESULT($kde_cv_c_long_long)
  3456. if test "$kde_cv_c_long_long" = yes; then
  3457. AC_DEFINE(HAVE_LONG_LONG, 1, [Define if you have long long as datatype])
  3458. fi
  3459. ])
  3460. AC_DEFUN(KDE_CHECK_LIB,
  3461. [
  3462. kde_save_LIBS="$LIBS"
  3463. LIBS="$LIBS $all_libraries"
  3464. case $host_os in
  3465. aix*) LIBS="-brtl $LIBS"
  3466. test "$GCC" = yes && LIBS="-Wl,$LIBS"
  3467. ;;
  3468. esac
  3469. AC_CHECK_LIB($1, $2, $3, $4, $5)
  3470. LIBS="$kde_save_LIBS"
  3471. ])
  3472. AC_DEFUN(KDE_CHECK_INITGROUPS,
  3473. [
  3474. AC_REQUIRE([AC_CANONICAL_HOST])
  3475. AC_CHECK_FUNCS(initgroups)
  3476. if test "x$ac_cv_func_initgroups" = "xyes"; then
  3477. case $host_os in
  3478. aix*) AC_LANG_SAVE
  3479. AC_LANG_CPLUSPLUS
  3480. AC_MSG_CHECKING([for initgroups prototype])
  3481. AC_CACHE_VAL(kde_cv_check_initgroups_proto,
  3482. [ AC_TRY_COMPILE(
  3483. [ #include <grp.h>
  3484. ],
  3485. [ char buffer[10];
  3486. gid_t id;
  3487. int x = initgroups(buffer,id);
  3488. ],
  3489. kde_cv_check_initgroups_proto=yes,
  3490. kde_cv_check_initgroups_proto=no)
  3491. ])
  3492. AC_MSG_RESULT($kde_cv_check_initgroups_proto)
  3493. AC_LANG_RESTORE
  3494. ;;
  3495. *)
  3496. kde_cv_check_initgroups_proto=yes
  3497. ;;
  3498. esac
  3499. else
  3500. kde_cv_check_initgroups_proto=no
  3501. fi
  3502. if test "x$kde_cv_check_initgroups_proto" = "xyes"; then
  3503. kde_check_initgroups_proto=1
  3504. else
  3505. kde_check_initgroups_proto=0
  3506. fi
  3507. AC_DEFINE_UNQUOTED(HAVE_INITGROUPS_PROTO,$kde_check_initgroups_proto,
  3508. [initgroups may exist but not its prototype (e.g. AIX<4.3.3:8)])
  3509. ])
  3510. AC_DEFUN(KDE_CHECK_JAVA_DIR,
  3511. [
  3512. AC_MSG_CHECKING([for Java directory])
  3513. AC_ARG_WITH(java,
  3514. [ --with-java=javadir use java installed in javadir, --without-java disables ],
  3515. [ ac_java_dir=$withval
  3516. ], ac_java_dir=""
  3517. )
  3518. dnl at this point ac_java_dir is either a dir, 'no' to disable, or '' to say look in $PATH
  3519. if test "x$ac_java_dir" = xno; then
  3520. kde_cv_java_bindir=no
  3521. kde_cv_java_includedir=no
  3522. kde_cv_java_libjvmdir=no
  3523. kde_cv_java_libhpidir=no
  3524. else
  3525. if test "x$ac_java_dir" = x; then
  3526. dnl No option set -> look in $PATH
  3527. AC_CACHE_VAL(kde_cv_java_bindir,
  3528. [
  3529. dnl First look for javac in $PATH. If not found we'll look at the option.
  3530. KDE_FIND_PATH(javac, JAVAC, [], [])
  3531. if test -n "$JAVAC"; then
  3532. kde_cv_java_bindir=`echo $JAVAC | sed -e 's,/javac$,/,'`
  3533. dnl this substitution might not work - well, we test for jni.h below
  3534. kde_cv_java_includedir=`echo $kde_cv_java_bindir | sed -e 's,bin/$,include/,'`
  3535. else
  3536. kde_cv_java_bindir=no
  3537. fi
  3538. ])
  3539. else
  3540. dnl config option set
  3541. kde_cv_java_bindir=$ac_java_dir/bin
  3542. kde_cv_java_includedir=$ac_java_dir/include
  3543. fi
  3544. fi
  3545. dnl Look for libjvm.so
  3546. kde_cv_java_libjvmdir=`find $kde_cv_java_bindir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1`
  3547. dnl Look for libhpi.so and avoid green threads
  3548. kde_cv_java_libhpidir=`find $kde_cv_java_bindir/.. -name libhpi.so | grep -v green | sed 's,libhpi.so,,'`
  3549. dnl At this point kde_cv_java_bindir and kde_cv_java_includedir are either set or "no"
  3550. if test ! "x$kde_cv_java_bindir" = xno; then
  3551. dnl Now check everything's fine under there
  3552. if test ! -x "$kde_cv_java_bindir/javac"; then
  3553. AC_MSG_ERROR([javac not found under $kde_cv_java_bindir - it seems you passed a wrong --with-java.])
  3554. fi
  3555. if test ! -x "$kde_cv_java_bindir/javah"; then
  3556. AC_MSG_ERROR([javah not found under $kde_cv_java_bindir. javac was found though! Use --with-java or --without-java.])
  3557. fi
  3558. if test ! -x "$kde_cv_java_bindir/jar"; then
  3559. AC_MSG_ERROR([jar not found under $kde_cv_java_bindir. javac was found though! Use --with-java or --without-java.])
  3560. fi
  3561. if test ! -r "$kde_cv_java_includedir/jni.h"; then
  3562. AC_MSG_ERROR([jni.h not found under $kde_cv_java_includedir. Use --with-java or --without-java.])
  3563. fi
  3564. if test ! -r "$kde_cv_java_libjvmdir/libjvm.so"; then
  3565. AC_MSG_ERROR([libjvm.so not found under $kde_cv_java_libjvmdir. Use --without-java.])
  3566. fi
  3567. if test ! -r "$kde_cv_java_libhpidir/libhpi.so"; then
  3568. AC_MSG_ERROR([libhpi.so not found under $kde_cv_java_libhpidir. Use --without-java.])
  3569. fi
  3570. jni_includes="-I$kde_cv_java_includedir"
  3571. dnl Strange thing, jni.h requires jni_md.h which is under genunix here..
  3572. dnl and under linux here..
  3573. test -d "$kde_cv_java_includedir/linux" && jni_includes="$jni_includes -I$kde_cv_java_includedir/linux"
  3574. test -d "$kde_cv_java_includedir/genunix" && jni_includes="$jni_includes -I$kde_cv_java_includedir/genunix"
  3575. dnl Check for JNI version
  3576. AC_LANG_SAVE
  3577. AC_LANG_CPLUSPLUS
  3578. ac_cxxflags_safe="$CXXFLAGS"
  3579. CXXFLAGS="$CXXFLAGS $all_includes $jni_includes"
  3580. AC_TRY_COMPILE([
  3581. #include <jni.h>
  3582. ],
  3583. [
  3584. #ifndef JNI_VERSION_1_2
  3585. Syntax Error
  3586. #endif
  3587. ],[
  3588. ],[ AC_MSG_ERROR([Incorrect version of $kde_cv_java_includedir/jni.h.
  3589. You need to have Java Development Kit (JDK) version 1.2.
  3590. Use --with-java to specify another location.
  3591. Use --without-java to configure without java support.
  3592. Or download a newer JDK and try again.
  3593. See e.g. http://java.sun.com/products/jdk/1.2 ])
  3594. ])
  3595. CXXFLAGS="$ac_cxxflags_safe"
  3596. AC_LANG_RESTORE
  3597. dnl All tests ok, inform and subst the variables
  3598. AC_MSG_RESULT([javac/javah/jar in $kde_cv_java_bindir, jni.h in $kde_cv_java_includedir])
  3599. JAVAC=$kde_cv_java_bindir/javac
  3600. AC_SUBST(JAVAC)
  3601. JAVAH=$kde_cv_java_bindir/javah
  3602. AC_SUBST(JAVAH)
  3603. JAR=$kde_cv_java_bindir/jar
  3604. AC_SUBST(JAR)
  3605. AC_SUBST(jni_includes)
  3606. JVMLIBS="-L$kde_cv_java_libjvmdir -ljvm -L$kde_cv_java_libhpidir -lhpi"
  3607. AC_SUBST(JVMLIBS)
  3608. fi
  3609. ])
  3610. ## libtool.m4 - Configure libtool for the host system. -*-Shell-script-*-
  3611. ## Copyright 1996, 1997, 1998, 1999, 2000, 2001
  3612. ## Free Software Foundation, Inc.
  3613. ## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
  3614. ##
  3615. ## This program is free software; you can redistribute it and/or modify
  3616. ## it under the terms of the GNU General Public License as published by
  3617. ## the Free Software Foundation; either version 2 of the License, or
  3618. ## (at your option) any later version.
  3619. ##
  3620. ## This program is distributed in the hope that it will be useful, but
  3621. ## WITHOUT ANY WARRANTY; without even the implied warranty of
  3622. ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  3623. ## General Public License for more details.
  3624. ##
  3625. ## You should have received a copy of the GNU General Public License
  3626. ## along with this program; if not, write to the Free Software
  3627. ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  3628. ##
  3629. ## As a special exception to the GNU General Public License, if you
  3630. ## distribute this file as part of a program that contains a
  3631. ## configuration script generated by Autoconf, you may include it under
  3632. ## the same distribution terms that you use for the rest of that program.
  3633. # serial 46 AC_PROG_LIBTOOL
  3634. AC_DEFUN([AC_PROG_LIBTOOL],
  3635. [AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
  3636. dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
  3637. dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
  3638. AC_PROVIDE_IFELSE([AC_PROG_CXX],
  3639. [AC_LIBTOOL_CXX],
  3640. [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
  3641. ])])
  3642. dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
  3643. dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
  3644. dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
  3645. AC_PROVIDE_IFELSE([AC_PROG_GCJ],
  3646. [AC_LIBTOOL_GCJ],
  3647. [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
  3648. [AC_LIBTOOL_GCJ],
  3649. [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
  3650. [AC_LIBTOOL_GCJ],
  3651. [ifdef([AC_PROG_GCJ],
  3652. [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ
  3653. ])])
  3654. ifdef([A][M_PROG_GCJ],
  3655. [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ
  3656. ])])
  3657. ifdef([LT_AC_PROG_GCJ],
  3658. [define([LT_AC_PROG_GCJ], defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ
  3659. ])])])])])])
  3660. AC_DEFUN([_AC_PROG_LIBTOOL],
  3661. [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
  3662. AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
  3663. AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
  3664. # Save cache, so that ltconfig can load it
  3665. AC_CACHE_SAVE
  3666. # Actually configure libtool. ac_aux_dir is where install-sh is found.
  3667. AR="$AR" LTCC="$CC" CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
  3668. MAGIC_CMD="$MAGIC_CMD" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
  3669. LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \
  3670. AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \
  3671. objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \
  3672. deplibs_check_method="$deplibs_check_method" file_magic_cmd="$file_magic_cmd" \
  3673. ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
  3674. $libtool_flags --no-verify --build="$build" $ac_aux_dir/ltmain.sh $host \
  3675. || AC_MSG_ERROR([libtool configure failed])
  3676. # Reload cache, that may have been modified by ltconfig
  3677. AC_CACHE_LOAD
  3678. # This can be used to rebuild libtool when needed
  3679. LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh $ac_aux_dir/ltcf-c.sh"
  3680. # Always use our own libtool.
  3681. LIBTOOL='$(SHELL) $(top_builddir)/libtool'
  3682. AC_SUBST(LIBTOOL)dnl
  3683. # Redirect the config.log output again, so that the ltconfig log is not
  3684. # clobbered by the next message.
  3685. exec 5>>./config.log
  3686. ])
  3687. AC_DEFUN([AC_LIBTOOL_SETUP],
  3688. [AC_PREREQ(2.13)dnl
  3689. AC_REQUIRE([AC_ENABLE_SHARED])dnl
  3690. AC_REQUIRE([AC_ENABLE_STATIC])dnl
  3691. AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
  3692. AC_REQUIRE([AC_CANONICAL_HOST])dnl
  3693. AC_REQUIRE([AC_CANONICAL_BUILD])dnl
  3694. AC_REQUIRE([AC_PROG_CC])dnl
  3695. AC_REQUIRE([AC_PROG_LD])dnl
  3696. AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
  3697. AC_REQUIRE([AC_PROG_NM])dnl
  3698. AC_REQUIRE([AC_PROG_LN_S])dnl
  3699. AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
  3700. # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
  3701. AC_REQUIRE([AC_OBJEXT])dnl
  3702. AC_REQUIRE([AC_EXEEXT])dnl
  3703. dnl
  3704. # Only perform the check for file, if the check method requires it
  3705. case $deplibs_check_method in
  3706. file_magic*)
  3707. if test "$file_magic_cmd" = '$MAGIC_CMD'; then
  3708. AC_PATH_MAGIC
  3709. fi
  3710. ;;
  3711. esac
  3712. AC_CHECK_TOOL(RANLIB, ranlib, :)
  3713. AC_CHECK_TOOL(STRIP, strip, :)
  3714. # Check for any special flags to pass to ltconfig.
  3715. libtool_flags="--cache-file=$cache_file"
  3716. test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
  3717. test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
  3718. test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
  3719. test "$GCC" = yes && libtool_flags="$libtool_flags --with-gcc"
  3720. test "$lt_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
  3721. ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
  3722. [libtool_flags="$libtool_flags --enable-dlopen"])
  3723. ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
  3724. [libtool_flags="$libtool_flags --enable-win32-dll"])
  3725. AC_ARG_ENABLE(libtool-lock,
  3726. [ --disable-libtool-lock avoid locking (might break parallel builds)])
  3727. test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
  3728. test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
  3729. AC_ARG_WITH(pic,
  3730. [ --with-pic try to use only PIC/non-PIC objects [default=use both]],
  3731. pic_mode="$withval", pic_mode=default)
  3732. test x"$pic_mode" = xyes && libtool_flags="$libtool_flags --prefer-pic"
  3733. test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic"
  3734. # Some flags need to be propagated to the compiler or linker for good
  3735. # libtool support.
  3736. case $host in
  3737. *-*-irix6*)
  3738. # Find out which ABI we are using.
  3739. echo '[#]line __oline__ "configure"' > conftest.$ac_ext
  3740. if AC_TRY_EVAL(ac_compile); then
  3741. case `/usr/bin/file conftest.$ac_objext` in
  3742. *32-bit*)
  3743. LD="${LD-ld} -32"
  3744. ;;
  3745. *N32*)
  3746. LD="${LD-ld} -n32"
  3747. ;;
  3748. *64-bit*)
  3749. LD="${LD-ld} -64"
  3750. ;;
  3751. esac
  3752. fi
  3753. rm -rf conftest*
  3754. ;;
  3755. *-*-sco3.2v5*)
  3756. # On SCO OpenServer 5, we need -belf to get full-featured binaries.
  3757. SAVE_CFLAGS="$CFLAGS"
  3758. CFLAGS="$CFLAGS -belf"
  3759. AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
  3760. [AC_LANG_SAVE
  3761. AC_LANG_C
  3762. AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
  3763. AC_LANG_RESTORE])
  3764. if test x"$lt_cv_cc_needs_belf" != x"yes"; then
  3765. # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
  3766. CFLAGS="$SAVE_CFLAGS"
  3767. fi
  3768. ;;
  3769. ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
  3770. [*-*-cygwin* | *-*-mingw* | *-*-pw32*)
  3771. AC_CHECK_TOOL(DLLTOOL, dlltool, false)
  3772. AC_CHECK_TOOL(AS, as, false)
  3773. AC_CHECK_TOOL(OBJDUMP, objdump, false)
  3774. # recent cygwin and mingw systems supply a stub DllMain which the user
  3775. # can override, but on older systems we have to supply one
  3776. AC_CACHE_CHECK([if libtool should supply DllMain function], lt_cv_need_dllmain,
  3777. [AC_TRY_LINK([],
  3778. [extern int __attribute__((__stdcall__)) DllMain(void*, int, void*);
  3779. DllMain (0, 0, 0);],
  3780. [lt_cv_need_dllmain=no],[lt_cv_need_dllmain=yes])])
  3781. case $host/$CC in
  3782. *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*)
  3783. # old mingw systems require "-dll" to link a DLL, while more recent ones
  3784. # require "-mdll"
  3785. SAVE_CFLAGS="$CFLAGS"
  3786. CFLAGS="$CFLAGS -mdll"
  3787. AC_CACHE_CHECK([how to link DLLs], lt_cv_cc_dll_switch,
  3788. [AC_TRY_LINK([], [], [lt_cv_cc_dll_switch=-mdll],[lt_cv_cc_dll_switch=-dll])])
  3789. CFLAGS="$SAVE_CFLAGS" ;;
  3790. *-*-cygwin* | *-*-pw32*)
  3791. # cygwin systems need to pass --dll to the linker, and not link
  3792. # crt.o which will require a WinMain@16 definition.
  3793. lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;;
  3794. esac
  3795. ;;
  3796. ])
  3797. esac
  3798. ])
  3799. # AC_LIBTOOL_DLOPEN - enable checks for dlopen support
  3800. AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
  3801. # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
  3802. AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
  3803. # AC_ENABLE_SHARED - implement the --enable-shared flag
  3804. # Usage: AC_ENABLE_SHARED[(DEFAULT)]
  3805. # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
  3806. # `yes'.
  3807. AC_DEFUN([AC_ENABLE_SHARED],
  3808. [define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
  3809. AC_ARG_ENABLE(shared,
  3810. changequote(<<, >>)dnl
  3811. << --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
  3812. changequote([, ])dnl
  3813. [p=${PACKAGE-default}
  3814. case $enableval in
  3815. yes) enable_shared=yes ;;
  3816. no) enable_shared=no ;;
  3817. *)
  3818. enable_shared=no
  3819. # Look at the argument we got. We use all the common list separators.
  3820. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
  3821. for pkg in $enableval; do
  3822. if test "X$pkg" = "X$p"; then
  3823. enable_shared=yes
  3824. fi
  3825. done
  3826. IFS="$ac_save_ifs"
  3827. ;;
  3828. esac],
  3829. enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
  3830. ])
  3831. # AC_DISABLE_SHARED - set the default shared flag to --disable-shared
  3832. AC_DEFUN([AC_DISABLE_SHARED], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
  3833. AC_ENABLE_SHARED(no)])
  3834. # AC_ENABLE_STATIC - implement the --enable-static flag
  3835. # Usage: AC_ENABLE_STATIC[(DEFAULT)]
  3836. # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
  3837. # `yes'.
  3838. AC_DEFUN([AC_ENABLE_STATIC],
  3839. [define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
  3840. AC_ARG_ENABLE(static,
  3841. changequote(<<, >>)dnl
  3842. << --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
  3843. changequote([, ])dnl
  3844. [p=${PACKAGE-default}
  3845. case $enableval in
  3846. yes) enable_static=yes ;;
  3847. no) enable_static=no ;;
  3848. *)
  3849. enable_static=no
  3850. # Look at the argument we got. We use all the common list separators.
  3851. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
  3852. for pkg in $enableval; do
  3853. if test "X$pkg" = "X$p"; then
  3854. enable_static=yes
  3855. fi
  3856. done
  3857. IFS="$ac_save_ifs"
  3858. ;;
  3859. esac],
  3860. enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
  3861. ])
  3862. # AC_DISABLE_STATIC - set the default static flag to --disable-static
  3863. AC_DEFUN([AC_DISABLE_STATIC],
  3864. [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
  3865. AC_ENABLE_STATIC(no)])
  3866. # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
  3867. # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
  3868. # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
  3869. # `yes'.
  3870. AC_DEFUN([AC_ENABLE_FAST_INSTALL],
  3871. [define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
  3872. AC_ARG_ENABLE(fast-install,
  3873. changequote(<<, >>)dnl
  3874. << --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
  3875. changequote([, ])dnl
  3876. [p=${PACKAGE-default}
  3877. case $enableval in
  3878. yes) enable_fast_install=yes ;;
  3879. no) enable_fast_install=no ;;
  3880. *)
  3881. enable_fast_install=no
  3882. # Look at the argument we got. We use all the common list separators.
  3883. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
  3884. for pkg in $enableval; do
  3885. if test "X$pkg" = "X$p"; then
  3886. enable_fast_install=yes
  3887. fi
  3888. done
  3889. IFS="$ac_save_ifs"
  3890. ;;
  3891. esac],
  3892. enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
  3893. ])
  3894. # AC_DISABLE_FAST_INSTALL - set the default to --disable-fast-install
  3895. AC_DEFUN([AC_DISABLE_FAST_INSTALL],
  3896. [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
  3897. AC_ENABLE_FAST_INSTALL(no)])
  3898. # AC_LIBTOOL_PICMODE - implement the --with-pic flag
  3899. # Usage: AC_LIBTOOL_PICMODE[(MODE)]
  3900. # Where MODE is either `yes' or `no'. If omitted, it defaults to
  3901. # `both'.
  3902. AC_DEFUN([AC_LIBTOOL_PICMODE],
  3903. [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
  3904. pic_mode=ifelse($#,1,$1,default)])
  3905. # AC_PATH_TOOL_PREFIX - find a file program which can recognise shared library
  3906. AC_DEFUN([AC_PATH_TOOL_PREFIX],
  3907. [AC_MSG_CHECKING([for $1])
  3908. AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
  3909. [case $MAGIC_CMD in
  3910. /*)
  3911. lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
  3912. ;;
  3913. ?:/*)
  3914. lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
  3915. ;;
  3916. *)
  3917. ac_save_MAGIC_CMD="$MAGIC_CMD"
  3918. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
  3919. dnl $ac_dummy forces splitting on constant user-supplied paths.
  3920. dnl POSIX.2 word splitting is done only on the output of word expansions,
  3921. dnl not every word. This closes a longstanding sh security hole.
  3922. ac_dummy="ifelse([$2], , $PATH, [$2])"
  3923. for ac_dir in $ac_dummy; do
  3924. test -z "$ac_dir" && ac_dir=.
  3925. if test -f $ac_dir/$1; then
  3926. lt_cv_path_MAGIC_CMD="$ac_dir/$1"
  3927. if test -n "$file_magic_test_file"; then
  3928. case $deplibs_check_method in
  3929. "file_magic "*)
  3930. file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
  3931. MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
  3932. if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
  3933. egrep "$file_magic_regex" > /dev/null; then
  3934. :
  3935. else
  3936. cat <<EOF 1>&2
  3937. *** Warning: the command libtool uses to detect shared libraries,
  3938. *** $file_magic_cmd, produces output that libtool cannot recognize.
  3939. *** The result is that libtool may fail to recognize shared libraries
  3940. *** as such. This will affect the creation of libtool libraries that
  3941. *** depend on shared libraries, but programs linked with such libtool
  3942. *** libraries will work regardless of this problem. Nevertheless, you
  3943. *** may want to report the problem to your system manager and/or to
  3944. *** bug-libtool@gnu.org
  3945. EOF
  3946. fi ;;
  3947. esac
  3948. fi
  3949. break
  3950. fi
  3951. done
  3952. IFS="$ac_save_ifs"
  3953. MAGIC_CMD="$ac_save_MAGIC_CMD"
  3954. ;;
  3955. esac])
  3956. MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
  3957. if test -n "$MAGIC_CMD"; then
  3958. AC_MSG_RESULT($MAGIC_CMD)
  3959. else
  3960. AC_MSG_RESULT(no)
  3961. fi
  3962. ])
  3963. # AC_PATH_MAGIC - find a file program which can recognise a shared library
  3964. AC_DEFUN([AC_PATH_MAGIC],
  3965. [AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl
  3966. AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin:$PATH)
  3967. if test -z "$lt_cv_path_MAGIC_CMD"; then
  3968. if test -n "$ac_tool_prefix"; then
  3969. AC_PATH_TOOL_PREFIX(file, /usr/bin:$PATH)
  3970. else
  3971. MAGIC_CMD=:
  3972. fi
  3973. fi
  3974. ])
  3975. # AC_PROG_LD - find the path to the GNU or non-GNU linker
  3976. AC_DEFUN([AC_PROG_LD],
  3977. [AC_ARG_WITH(gnu-ld,
  3978. [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
  3979. test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
  3980. AC_REQUIRE([AC_PROG_CC])dnl
  3981. AC_REQUIRE([AC_CANONICAL_HOST])dnl
  3982. AC_REQUIRE([AC_CANONICAL_BUILD])dnl
  3983. ac_prog=ld
  3984. if test "$GCC" = yes; then
  3985. # Check if gcc -print-prog-name=ld gives a path.
  3986. AC_MSG_CHECKING([for ld used by GCC])
  3987. case $host in
  3988. *-*-mingw*)
  3989. # gcc leaves a trailing carriage return which upsets mingw
  3990. ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
  3991. *)
  3992. ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
  3993. esac
  3994. case $ac_prog in
  3995. # Accept absolute paths.
  3996. [[\\/]* | [A-Za-z]:[\\/]*)]
  3997. re_direlt=['/[^/][^/]*/\.\./']
  3998. # Canonicalize the path of ld
  3999. ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
  4000. while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
  4001. ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
  4002. done
  4003. test -z "$LD" && LD="$ac_prog"
  4004. ;;
  4005. "")
  4006. # If it fails, then pretend we aren't using GCC.
  4007. ac_prog=ld
  4008. ;;
  4009. *)
  4010. # If it is relative, then search for the first ld in PATH.
  4011. with_gnu_ld=unknown
  4012. ;;
  4013. esac
  4014. elif test "$with_gnu_ld" = yes; then
  4015. AC_MSG_CHECKING([for GNU ld])
  4016. else
  4017. AC_MSG_CHECKING([for non-GNU ld])
  4018. fi
  4019. AC_CACHE_VAL(lt_cv_path_LD,
  4020. [if test -z "$LD"; then
  4021. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
  4022. for ac_dir in $PATH; do
  4023. test -z "$ac_dir" && ac_dir=.
  4024. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
  4025. lt_cv_path_LD="$ac_dir/$ac_prog"
  4026. # Check to see if the program is GNU ld. I'd rather use --version,
  4027. # but apparently some GNU ld's only accept -v.
  4028. # Break only if it was the GNU/non-GNU ld that we prefer.
  4029. if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
  4030. test "$with_gnu_ld" != no && break
  4031. else
  4032. test "$with_gnu_ld" != yes && break
  4033. fi
  4034. fi
  4035. done
  4036. IFS="$ac_save_ifs"
  4037. else
  4038. lt_cv_path_LD="$LD" # Let the user override the test with a path.
  4039. fi])
  4040. LD="$lt_cv_path_LD"
  4041. if test -n "$LD"; then
  4042. AC_MSG_RESULT($LD)
  4043. else
  4044. AC_MSG_RESULT(no)
  4045. fi
  4046. test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
  4047. AC_PROG_LD_GNU
  4048. ])
  4049. AC_DEFUN([AC_PROG_LD_GNU],
  4050. [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
  4051. [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
  4052. if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
  4053. lt_cv_prog_gnu_ld=yes
  4054. else
  4055. lt_cv_prog_gnu_ld=no
  4056. fi])
  4057. with_gnu_ld=$lt_cv_prog_gnu_ld
  4058. ])
  4059. # AC_PROG_LD_RELOAD_FLAG - find reload flag for linker
  4060. # -- PORTME Some linkers may need a different reload flag.
  4061. AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
  4062. [AC_CACHE_CHECK([for $LD option to reload object files], lt_cv_ld_reload_flag,
  4063. [lt_cv_ld_reload_flag='-r'])
  4064. reload_flag=$lt_cv_ld_reload_flag
  4065. test -n "$reload_flag" && reload_flag=" $reload_flag"
  4066. ])
  4067. # AC_DEPLIBS_CHECK_METHOD - how to check for library dependencies
  4068. # -- PORTME fill in with the dynamic library characteristics
  4069. AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
  4070. [AC_CACHE_CHECK([how to recognise dependant libraries],
  4071. lt_cv_deplibs_check_method,
  4072. [lt_cv_file_magic_cmd='$MAGIC_CMD'
  4073. lt_cv_file_magic_test_file=
  4074. lt_cv_deplibs_check_method='unknown'
  4075. # Need to set the preceding variable on all platforms that support
  4076. # interlibrary dependencies.
  4077. # 'none' -- dependencies not supported.
  4078. # `unknown' -- same as none, but documents that we really don't know.
  4079. # 'pass_all' -- all dependencies passed with no checks.
  4080. # 'test_compile' -- check by making test program.
  4081. # 'file_magic [regex]' -- check by looking for files in library path
  4082. # which responds to the $file_magic_cmd with a given egrep regex.
  4083. # If you have `file' or equivalent on your system and you're not sure
  4084. # whether `pass_all' will *always* work, you probably want this one.
  4085. case $host_os in
  4086. aix*)
  4087. lt_cv_deplibs_check_method=pass_all
  4088. ;;
  4089. beos*)
  4090. lt_cv_deplibs_check_method=pass_all
  4091. ;;
  4092. bsdi4*)
  4093. lt_cv_deplibs_check_method=['file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)']
  4094. lt_cv_file_magic_cmd='/usr/bin/file -L'
  4095. lt_cv_file_magic_test_file=/shlib/libc.so
  4096. ;;
  4097. cygwin* | mingw* |pw32*)
  4098. lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
  4099. lt_cv_file_magic_cmd='$OBJDUMP -f'
  4100. ;;
  4101. darwin* | rhapsody*)
  4102. lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
  4103. lt_cv_file_magic_cmd='/usr/bin/file -L'
  4104. case "$host_os" in
  4105. rhapsody* | darwin1.[012])
  4106. lt_cv_file_magic_test_file='/System/Library/Frameworks/System.framework/System'
  4107. ;;
  4108. *) # Darwin 1.3 on
  4109. lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
  4110. ;;
  4111. esac
  4112. ;;
  4113. freebsd* )
  4114. if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
  4115. case $host_cpu in
  4116. i*86 )
  4117. # Not sure whether the presence of OpenBSD here was a mistake.
  4118. # Let's accept both of them until this is cleared up.
  4119. lt_cv_deplibs_check_method=['file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library']
  4120. lt_cv_file_magic_cmd=/usr/bin/file
  4121. lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
  4122. ;;
  4123. esac
  4124. else
  4125. lt_cv_deplibs_check_method=pass_all
  4126. fi
  4127. ;;
  4128. gnu*)
  4129. lt_cv_deplibs_check_method=pass_all
  4130. ;;
  4131. hpux10.20*|hpux11*)
  4132. lt_cv_deplibs_check_method=['file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library']
  4133. lt_cv_file_magic_cmd=/usr/bin/file
  4134. lt_cv_file_magic_test_file=/usr/lib/libc.sl
  4135. ;;
  4136. irix5* | irix6*)
  4137. case $host_os in
  4138. irix5*)
  4139. # this will be overridden with pass_all, but let us keep it just in case
  4140. lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
  4141. ;;
  4142. *)
  4143. case $LD in
  4144. *-32|*"-32 ") libmagic=32-bit;;
  4145. *-n32|*"-n32 ") libmagic=N32;;
  4146. *-64|*"-64 ") libmagic=64-bit;;
  4147. *) libmagic=never-match;;
  4148. esac
  4149. # this will be overridden with pass_all, but let us keep it just in case
  4150. lt_cv_deplibs_check_method=["file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"]
  4151. ;;
  4152. esac
  4153. lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
  4154. lt_cv_deplibs_check_method=pass_all
  4155. ;;
  4156. # This must be Linux ELF.
  4157. linux-gnu*)
  4158. case $host_cpu in
  4159. alpha* | i*86 | powerpc* | sparc* | ia64* | s390* | m68k* | arm* | mips* | hppa* | sh* )
  4160. lt_cv_deplibs_check_method=pass_all ;;
  4161. *)
  4162. # glibc up to 2.1.1 does not perform some relocations on ARM
  4163. lt_cv_deplibs_check_method=['file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'] ;;
  4164. esac
  4165. lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
  4166. ;;
  4167. netbsd*)
  4168. if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
  4169. [lt_cv_deplibs_check_method='file_magic NetBSD/[a-z0-9]* demand paged shared library']
  4170. else
  4171. [lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object']
  4172. fi
  4173. lt_cv_file_magic_cmd='/usr/bin/file -L'
  4174. lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
  4175. ;;
  4176. openbsd* )
  4177. if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
  4178. case "$host_cpu" in
  4179. i*86 )
  4180. changequote(,)dnl
  4181. lt_cv_deplibs_check_method='file_magic OpenBSD/i[3-9]86 demand paged shared library'
  4182. changequote([, ])dnl
  4183. lt_cv_file_magic_cmd=/usr/bin/file
  4184. lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
  4185. ;;
  4186. esac
  4187. else
  4188. lt_cv_deplibs_check_method=pass_all
  4189. fi
  4190. ;;
  4191. newsos6)
  4192. [lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)']
  4193. lt_cv_file_magic_cmd=/usr/bin/file
  4194. lt_cv_file_magic_test_file=/usr/lib/libnls.so
  4195. ;;
  4196. osf3* | osf4* | osf5*)
  4197. # this will be overridden with pass_all, but let us keep it just in case
  4198. lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
  4199. lt_cv_file_magic_test_file=/shlib/libc.so
  4200. lt_cv_deplibs_check_method=pass_all
  4201. ;;
  4202. sco3.2v5*)
  4203. lt_cv_deplibs_check_method=pass_all
  4204. ;;
  4205. solaris*)
  4206. lt_cv_deplibs_check_method=pass_all
  4207. lt_cv_file_magic_test_file=/lib/libc.so
  4208. ;;
  4209. sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
  4210. case $host_vendor in
  4211. ncr)
  4212. lt_cv_deplibs_check_method=pass_all
  4213. ;;
  4214. motorola)
  4215. lt_cv_deplibs_check_method=['file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]']
  4216. lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
  4217. ;;
  4218. esac
  4219. ;;
  4220. esac
  4221. ])
  4222. file_magic_cmd=$lt_cv_file_magic_cmd
  4223. deplibs_check_method=$lt_cv_deplibs_check_method
  4224. ])
  4225. # AC_PROG_NM - find the path to a BSD-compatible name lister
  4226. AC_DEFUN([AC_PROG_NM],
  4227. [AC_MSG_CHECKING([for BSD-compatible nm])
  4228. AC_CACHE_VAL(lt_cv_path_NM,
  4229. [if test -n "$NM"; then
  4230. # Let the user override the test.
  4231. lt_cv_path_NM="$NM"
  4232. else
  4233. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
  4234. for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
  4235. test -z "$ac_dir" && ac_dir=.
  4236. tmp_nm=$ac_dir/${ac_tool_prefix}nm
  4237. if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then
  4238. # Check to see if the nm accepts a BSD-compat flag.
  4239. # Adding the `sed 1q' prevents false positives on HP-UX, which says:
  4240. # nm: unknown option "B" ignored
  4241. # Tru64's nm complains that /dev/null is an invalid object file
  4242. if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
  4243. lt_cv_path_NM="$tmp_nm -B"
  4244. break
  4245. elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
  4246. lt_cv_path_NM="$tmp_nm -p"
  4247. break
  4248. else
  4249. lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
  4250. continue # so that we can try to find one that supports BSD flags
  4251. fi
  4252. fi
  4253. done
  4254. IFS="$ac_save_ifs"
  4255. test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
  4256. fi])
  4257. NM="$lt_cv_path_NM"
  4258. AC_MSG_RESULT([$NM])
  4259. ])
  4260. # AC_CHECK_LIBM - check for math library
  4261. AC_DEFUN([AC_CHECK_LIBM],
  4262. [AC_REQUIRE([AC_CANONICAL_HOST])dnl
  4263. LIBM=
  4264. case $host in
  4265. *-*-beos* | *-*-cygwin* | *-*-pw32*)
  4266. # These system don't have libm
  4267. ;;
  4268. *-ncr-sysv4.3*)
  4269. AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
  4270. AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
  4271. ;;
  4272. *)
  4273. AC_CHECK_LIB(m, main, LIBM="-lm")
  4274. ;;
  4275. esac
  4276. ])
  4277. # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
  4278. # the libltdl convenience library and INCLTDL to the include flags for
  4279. # the libltdl header and adds --enable-ltdl-convenience to the
  4280. # configure arguments. Note that LIBLTDL and INCLTDL are not
  4281. # AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If DIR is not
  4282. # provided, it is assumed to be `libltdl'. LIBLTDL will be prefixed
  4283. # with '${top_builddir}/' and INCLTDL will be prefixed with
  4284. # '${top_srcdir}/' (note the single quotes!). If your package is not
  4285. # flat and you're not using automake, define top_builddir and
  4286. # top_srcdir appropriately in the Makefiles.
  4287. AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
  4288. [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
  4289. case $enable_ltdl_convenience in
  4290. no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
  4291. "") enable_ltdl_convenience=yes
  4292. ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
  4293. esac
  4294. LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
  4295. INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
  4296. ])
  4297. # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
  4298. # the libltdl installable library and INCLTDL to the include flags for
  4299. # the libltdl header and adds --enable-ltdl-install to the configure
  4300. # arguments. Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is
  4301. # AC_CONFIG_SUBDIRS called. If DIR is not provided and an installed
  4302. # libltdl is not found, it is assumed to be `libltdl'. LIBLTDL will
  4303. # be prefixed with '${top_builddir}/' and INCLTDL will be prefixed
  4304. # with '${top_srcdir}/' (note the single quotes!). If your package is
  4305. # not flat and you're not using automake, define top_builddir and
  4306. # top_srcdir appropriately in the Makefiles.
  4307. # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
  4308. AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
  4309. [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
  4310. AC_CHECK_LIB(ltdl, main,
  4311. [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
  4312. [if test x"$enable_ltdl_install" = xno; then
  4313. AC_MSG_WARN([libltdl not installed, but installation disabled])
  4314. else
  4315. enable_ltdl_install=yes
  4316. fi
  4317. ])
  4318. if test x"$enable_ltdl_install" = x"yes"; then
  4319. ac_configure_args="$ac_configure_args --enable-ltdl-install"
  4320. LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
  4321. INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
  4322. else
  4323. ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
  4324. LIBLTDL="-lltdl"
  4325. INCLTDL=
  4326. fi
  4327. ])
  4328. # If this macro is not defined by Autoconf, define it here.
  4329. ifdef([AC_PROVIDE_IFELSE],
  4330. [],
  4331. [define([AC_PROVIDE_IFELSE],
  4332. [ifdef([AC_PROVIDE_$1],
  4333. [$2], [$3])])])
  4334. # AC_LIBTOOL_CXX - enable support for C++ libraries
  4335. AC_DEFUN([AC_LIBTOOL_CXX], [AC_REQUIRE([_AC_LIBTOOL_CXX])])
  4336. AC_DEFUN([_AC_LIBTOOL_CXX],
  4337. [AC_REQUIRE([AC_PROG_CXX])
  4338. AC_REQUIRE([AC_PROG_CXXCPP])
  4339. LIBTOOL_DEPS=$LIBTOOL_DEPS" $ac_aux_dir/ltcf-cxx.sh"
  4340. lt_save_CC="$CC"
  4341. lt_save_CFLAGS="$CFLAGS"
  4342. dnl Make sure LTCC is set to the C compiler, i.e. set LTCC before CC
  4343. dnl is set to the C++ compiler.
  4344. AR="$AR" LTCC="$CC" CC="$CXX" CXX="$CXX" CFLAGS="$CXXFLAGS" CPPFLAGS="$CPPFLAGS" \
  4345. MAGIC_CMD="$MAGIC_CMD" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
  4346. LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \
  4347. AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \
  4348. objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \
  4349. deplibs_check_method="$deplibs_check_method" \
  4350. file_magic_cmd="$file_magic_cmd" \
  4351. ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig -o libtool $libtool_flags \
  4352. --build="$build" --add-tag=CXX $ac_aux_dir/ltcf-cxx.sh $host \
  4353. || AC_MSG_ERROR([libtool tag configuration failed])
  4354. CC="$lt_save_CC"
  4355. CFLAGS="$lt_save_CFLAGS"
  4356. # Redirect the config.log output again, so that the ltconfig log is not
  4357. # clobbered by the next message.
  4358. exec 5>>./config.log
  4359. ])
  4360. # AC_LIBTOOL_GCJ - enable support for GCJ libraries
  4361. AC_DEFUN([AC_LIBTOOL_GCJ],[AC_REQUIRE([_AC_LIBTOOL_GCJ])])
  4362. AC_DEFUN([_AC_LIBTOOL_GCJ],
  4363. [AC_REQUIRE([AC_PROG_LIBTOOL])
  4364. AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
  4365. [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
  4366. [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
  4367. [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
  4368. [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
  4369. [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
  4370. LIBTOOL_DEPS=$LIBTOOL_DEPS" $ac_aux_dir/ltcf-gcj.sh"
  4371. lt_save_CC="$CC"
  4372. lt_save_CFLAGS="$CFLAGS"
  4373. dnl Make sure LTCC is set to the C compiler, i.e. set LTCC before CC
  4374. dnl is set to the C++ compiler.
  4375. AR="$AR" LTCC="$CC" CC="$GCJ" CFLAGS="$GCJFLAGS" CPPFLAGS="$CPPFLAGS" \
  4376. MAGIC_CMD="$MAGIC_CMD" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
  4377. LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \
  4378. AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \
  4379. objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \
  4380. deplibs_check_method="$deplibs_check_method" \
  4381. file_magic_cmd="$file_magic_cmd" \
  4382. ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig -o libtool $libtool_flags \
  4383. --build="$build" --add-tag=GCJ $ac_aux_dir/ltcf-gcj.sh $host \
  4384. || AC_MSG_ERROR([libtool tag configuration failed])
  4385. CC="$lt_save_CC"
  4386. CFLAGS="$lt_save_CFLAGS"
  4387. # Redirect the config.log output again, so that the ltconfig log is not
  4388. # clobbered by the next message.
  4389. exec 5>>./config.log
  4390. ])
  4391. dnl old names
  4392. AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL])
  4393. AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
  4394. AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
  4395. AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
  4396. AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
  4397. AC_DEFUN([AM_PROG_LD], [AC_PROG_LD])
  4398. AC_DEFUN([AM_PROG_NM], [AC_PROG_NM])
  4399. dnl This is just to silence aclocal about the macro not being used
  4400. ifelse([AC_DISABLE_FAST_INSTALL])dnl
  4401. AC_DEFUN([LT_AC_PROG_GCJ],
  4402. [AC_CHECK_TOOL(GCJ, gcj, no)
  4403. test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
  4404. AC_SUBST(GCJFLAGS)
  4405. ])