acinclude.m4 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933
  1. AC_DEFUN(AC_GETTIMEOFDAY,
  2. [AC_CACHE_CHECK([for gettimeofday()],
  3. ac_cv_gettimeofday,
  4. [
  5. AC_TRY_COMPILE([
  6. #include <sys/time.h>
  7. ],[
  8. gettimeofday((struct timeval *)NULL, (struct timezone *)NULL);
  9. ], ac_cv_gettimeofday="2 params", ac_cv_gettimeofday=no)
  10. if test "$ac_cv_gettimeofday" = no; then
  11. AC_TRY_COMPILE([
  12. #include <sys/time.h>
  13. ],[
  14. gettimeofday((struct timeval *)NULL, (struct timezone *)NULL);
  15. ], ac_cv_gettimeofday="1 param", ac_cv_gettimeofday=no)
  16. fi
  17. ])
  18. if test "$ac_cv_gettimeofday" = "1 param"; then
  19. AC_DEFINE(GETTIMEOFDAY_ONE_PARAM)
  20. AC_DEFINE(HAVE_GETTIMEOFDAY)
  21. elif test "$ac_cv_gettimeofday" = "2 params"; then
  22. AC_DEFINE(HAVE_GETTIMEOFDAY)
  23. fi
  24. ])
  25. AC_DEFUN(AC_HEADER_IOSTREAM,
  26. [AC_CHECK_HEADERS(iostream,[have_iostream=yes],[have_iostream=no])])
  27. AC_DEFUN(AC_IOS_BINARY,
  28. [AC_CACHE_CHECK([for ios::binary],
  29. ac_cv_ios_binary,
  30. [
  31. if test $have_iostream = yes; then
  32. AC_TRY_COMPILE([
  33. #include <iostream>
  34. ],[
  35. int x; x = ios::binary;
  36. ], ac_cv_ios_binary=yes, ac_cv_ios_binary=no)
  37. else
  38. AC_TRY_COMPILE([
  39. #include <iostream.h>
  40. ],[
  41. int x; x = ios::binary;
  42. ], ac_cv_ios_binary=yes, ac_cv_ios_binary=no)
  43. fi
  44. ])
  45. if test $ac_cv_ios_binary = yes; then
  46. AC_DEFINE(HAVE_IOS_BINARY)
  47. fi
  48. ])
  49. AC_DEFUN(AC_NAMESPACE,
  50. [AC_CACHE_CHECK([for compiler namespace support],
  51. ac_cv_namespace,
  52. [AC_TRY_COMPILE(
  53. [namespace std { };
  54. using namespace std;],
  55. [],
  56. ac_cv_namespace=yes, ac_cv_namespace=no)])
  57. if test $ac_cv_namespace = yes; then
  58. AC_DEFINE(HAVE_NAMESPACE)
  59. fi
  60. ])
  61. dnl A handy function to see if a library is in a particular directory.
  62. dnl AC_CHECK_LIB_LOC(directory, library, function, action-if-found, action-if-not-found, other-libraries)
  63. dnl
  64. AC_DEFUN(AC_CHECK_LIB_LOC,
  65. [AC_MSG_CHECKING([for lib$2 in $1])
  66. ac_lib_var=`echo $1['_']$2 | sed 'y%./+-%__p_%'`
  67. AC_CACHE_VAL(ac_cv_lib_loc_$ac_lib_var,
  68. [ac_save_LIBS="$LIBS"
  69. LIBS="-L$1 -l$2 $6 $LIBS"
  70. AC_TRY_LINK(dnl
  71. ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus
  72. extern "C"
  73. #endif
  74. ])dnl
  75. [/* We use char because int might match the return type of a gcc2
  76. builtin and then its argument prototype would still apply. */
  77. char $3();
  78. ],
  79. [$3()],
  80. eval "ac_cv_lib_loc_$ac_lib_var=yes",
  81. eval "ac_cv_lib_loc_$ac_lib_var=no")
  82. LIBS="$ac_save_LIBS"
  83. ])dnl
  84. if eval "test \"`echo '$ac_cv_lib_loc_'$ac_lib_var`\" = yes"; then
  85. AC_MSG_RESULT(yes)
  86. ifelse([$4], ,
  87. [LIBS="-L$1 -l$2 $LIBS"
  88. ], [$4])
  89. else
  90. AC_MSG_RESULT(no)
  91. ifelse([$5], , , [$5
  92. ])dnl
  93. fi
  94. ])
  95. dnl A handy function to search a number of possible locations for a library.
  96. dnl AC_SEARCH_LIB(search-dirs, library, function, package, other-libraries)
  97. dnl
  98. dnl Sets $package_LIB to the directory containing the library, or to the
  99. dnl string "no" if the library cannot be found.
  100. AC_DEFUN(AC_SEARCH_LIB, [
  101. ac_found_lib="no"
  102. if test "$1" = ""; then
  103. AC_CHECK_LIB($2, $3, [ ac_found_lib=""; ],, $5)
  104. else
  105. for ac_check_dir in $1; do
  106. if test "$ac_found_lib" = "no"; then
  107. AC_CHECK_LIB_LOC($ac_check_dir, $2, $3, [ ac_found_lib="$ac_check_dir"; ],, $5)
  108. fi
  109. done
  110. fi
  111. $4_LIB="$ac_found_lib"
  112. ])
  113. dnl A handy function to see if a header file is in a particular directory.
  114. dnl AC_CHECK_HEADER_LOC(directory, header, action-if-found, action-if-not-found)
  115. dnl
  116. AC_DEFUN(AC_CHECK_HEADER_LOC, [
  117. AC_MSG_CHECKING([for $2 in $1])
  118. ac_include_var=`echo $1['_']$2 | sed 'y%./+-%__p_%'`
  119. AC_CACHE_VAL(ac_cv_include_loc_$ac_include_var, [
  120. ac_save_CPPFLAGS="$CPPFLAGS"
  121. CPPFLAGS="-I$1 $CPPFLAGS"
  122. AC_TRY_CPP([#include <$2>], ac_ch_found_it="yes", ac_ch_found_it="no")
  123. if test "$ac_ch_found_it" = "yes"; then
  124. AC_MSG_RESULT(yes)
  125. ifelse([$3], , :, [$3])
  126. else
  127. AC_MSG_RESULT(no)
  128. ifelse([$4], , , [$4])
  129. fi
  130. CPPFLAGS="$ac_save_CPPFLAGS"
  131. ])
  132. ])
  133. dnl A handy function to search a number of possible locations for a header
  134. dnl file.
  135. dnl
  136. dnl AC_SEARCH_HEADER(search-dirs, header, package)
  137. dnl
  138. dnl Sets $package_INCLUDE to the directory containing the header, or to
  139. dnl the string "no" if the header cannot be found.
  140. AC_DEFUN(AC_SEARCH_HEADER, [
  141. ac_found_header="no"
  142. if test "$1" = ""; then
  143. AC_CHECK_HEADER($2, [ ac_found_header="";])
  144. else
  145. for ac_check_dir in $1; do
  146. if test "$ac_found_header" = "no"; then
  147. AC_CHECK_HEADER_LOC($ac_check_dir, $2, [ ac_found_header="$ac_check_dir";])
  148. fi
  149. done
  150. fi
  151. $3_INCLUDE="$ac_found_header"
  152. ])
  153. dnl A handy function to scan for a third-party package, consisting of at
  154. dnl least a library and an include file. A few assumptions are made about
  155. dnl the relationships between lib and include directories.
  156. dnl
  157. dnl AC_SEARCH_PACKAGE(search-dirs, package-names, header, library, function, package, other-libraries)
  158. dnl
  159. dnl search-dirs is the whitespace-separated list of directory prefixes to
  160. dnl check.
  161. dnl package-names is a whitespace-separated list of possible names the
  162. dnl package may have been installed under.
  163. dnl
  164. dnl For each combination of ${search-dir} and ${package-name}, the following
  165. dnl directories are searched:
  166. dnl
  167. dnl ${search-dir}
  168. dnl ${search-dir}/lib
  169. dnl ${search-dir}/${package-name}
  170. dnl ${search-dir}/${package-name}/lib
  171. dnl ${search-dir}/lib/${package-name}
  172. dnl
  173. dnl And similarly for include.
  174. dnl
  175. dnl Sets the variables $package_INCLUDE and $package_LIB to the directories
  176. dnl containing the header file and library, respectively. If both pieces
  177. dnl are located, also sets the variable $package_PKG to "yes"; otherwise,
  178. dnl sets the variable $package_PKG to "no".
  179. dnl
  180. AC_DEFUN(AC_SEARCH_PACKAGE, [
  181. $6_LIB="no"
  182. $6_INCLUDE="no"
  183. $6_PKG="no"
  184. dnl Look for the library.
  185. AC_SEARCH_LIB("", $4, $5, $6, $7)
  186. for ac_sp_dir in $1; do
  187. if test "[$]$6_LIB" = "no"; then
  188. AC_SEARCH_LIB("$ac_sp_dir" "$ac_sp_dir/lib", $4, $5, $6, $7)
  189. for ac_sp_pkg in $2; do
  190. if test "[$]$6_LIB" = "no"; then
  191. AC_SEARCH_LIB("$ac_sp_dir/$ac_sp_pkg" "$ac_sp_dir/$ac_sp_pkg/lib" \
  192. "$ac_sp_dir/lib/$ac_sp_pkg", $4, $5, $6, $7)
  193. fi
  194. done
  195. fi
  196. done
  197. dnl Now look for the header file. Don't bother looking if the library
  198. dnl wasn't found.
  199. if test "[$]$6_LIB" != "no"; then
  200. dnl First look in the obvious directory corresponding to the lib dir.
  201. ac_sp_testinc=`echo [$]$6_LIB | sed 's:/lib:/include:'`
  202. AC_SEARCH_HEADER("$ac_sp_testinc", $3, $6)
  203. dnl If it wasn't found there, cast about.
  204. if test "[$]$6_INCLUDE" = "no"; then
  205. for ac_sp_dir in $1; do
  206. if test "[$]$6_INCLUDE" = "no"; then
  207. AC_SEARCH_HEADER("$ac_sp_dir" "$ac_sp_dir/include", $3, $6)
  208. for ac_sp_pkg in $2; do
  209. if test "[$]$6_INCLUDE" = "no"; then
  210. AC_SEARCH_HEADER("$ac_sp_dir/$ac_sp_pkg" \
  211. "$ac_sp_dir/$ac_sp_pkg/include" \
  212. "$ac_sp_dir/include/$ac_sp_pkg", $3, $6)
  213. fi
  214. done
  215. fi
  216. done
  217. fi
  218. dnl If we got both a header and a library, set the PKG variable.
  219. if test "[$]$6_INCLUDE" != "no"; then
  220. $6_PKG="yes"
  221. fi
  222. fi
  223. ])
  224. dnl A handy function, similar to AC_SEARCH_PACKAGE, above, that looks for a
  225. dnl package that only consists of header files, no libraries.
  226. dnl
  227. dnl AC_SEARCH_HPACKAGE(search-dirs, package-names, header, package)
  228. dnl
  229. dnl search-dirs is the whitespace-separated list of directory prefixes to
  230. dnl check.
  231. dnl package-names is a whitespace-separated list of possible names the
  232. dnl package may have been installed under.
  233. dnl
  234. dnl For each combination of ${search-dir} and ${package-name}, the following
  235. dnl directories are searched:
  236. dnl
  237. dnl ${search-dir}
  238. dnl ${search-dir}/include
  239. dnl ${search-dir}/${package-name}
  240. dnl ${search-dir}/${package-name}/include
  241. dnl ${search-dir}/include/${package-name}
  242. dnl
  243. dnl Sets the variable $package_INCLUDE to the directory containing the
  244. dnl header file, and sets the variable $package_PKG to "yes"; if the
  245. dnl directory is not found, sets the variable $package_PKG to "no".
  246. dnl
  247. AC_DEFUN(AC_SEARCH_HPACKAGE, [
  248. $4_INCLUDE="no"
  249. $4_PKG="no"
  250. dnl Look for the header.
  251. AC_SEARCH_HEADER("", $3, $4)
  252. for ac_sp_dir in $1; do
  253. if test "[$]$4_INCLUDE" = "no"; then
  254. AC_SEARCH_HEADER("$ac_sp_dir" "$ac_sp_dir/include", $3, $4)
  255. for ac_sp_pkg in $2; do
  256. if test "[$]$4_INCLUDE" = "no"; then
  257. AC_SEARCH_HEADER("$ac_sp_dir/$ac_sp_pkg" \
  258. "$ac_sp_dir/$ac_sp_pkg/include" \
  259. "$ac_sp_dir/include/$ac_sp_pkg", $3, $4)
  260. fi
  261. done
  262. fi
  263. done
  264. dnl If we got both a header file, set the PKG variable.
  265. if test "[$]$4_INCLUDE" != "no"; then
  266. $4_PKG="yes"
  267. fi
  268. ])
  269. # Define a conditional.
  270. AC_DEFUN(AM_CONDITIONAL,
  271. [AC_SUBST($1_TRUE)
  272. AC_SUBST($1_FALSE)
  273. if $2; then
  274. $1_TRUE=
  275. $1_FALSE='#'
  276. else
  277. $1_TRUE='#'
  278. $1_FALSE=
  279. fi])
  280. # Configure paths for GTK--
  281. # Erik Andersen 30 May 1998
  282. # Modified by Tero Pulkkinen (added the compiler checks... I hope they work..)
  283. dnl Test for GTKMM, and define GTKMM_CFLAGS and GTKMM_LIBS
  284. dnl to be used as follows:
  285. dnl AM_PATH_GTKMM([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
  286. dnl
  287. AC_DEFUN(AM_PATH_GTKMM,
  288. [dnl
  289. dnl Get the cflags and libraries from the gtkmm-config script
  290. dnl
  291. AC_ARG_WITH(gtkmm-prefix,[ --with-gtkmm-prefix=PREFIX
  292. Prefix where GTK-- is installed (optional)],
  293. gtkmm_config_prefix="$withval", gtkmm_config_prefix="")
  294. AC_ARG_WITH(gtkmm-exec-prefix,[ --with-gtkmm-exec-prefix=PREFIX
  295. Exec prefix where GTK-- is installed (optional)],
  296. gtkmm_config_exec_prefix="$withval", gtkmm_config_exec_prefix="")
  297. AC_ARG_ENABLE(gtkmmtest, [ --disable-gtkmmtest Do not try to compile and run a test GTK-- program],
  298. , enable_gtkmmtest=yes)
  299. if test x$gtkmm_config_exec_prefix != x ; then
  300. gtkmm_config_args="$gtkmm_config_args --exec-prefix=$gtkmm_config_exec_prefix"
  301. if test x${GTKMM_CONFIG+set} != xset ; then
  302. GTKMM_CONFIG=$gtkmm_config_exec_prefix/bin/gtkmm-config
  303. fi
  304. fi
  305. if test x$gtkmm_config_prefix != x ; then
  306. gtkmm_config_args="$gtkmm_config_args --prefix=$gtkmm_config_prefix"
  307. if test x${GTKMM_CONFIG+set} != xset ; then
  308. GTKMM_CONFIG=$gtkmm_config_prefix/bin/gtkmm-config
  309. fi
  310. fi
  311. AC_PATH_PROG(GTKMM_CONFIG, gtkmm-config, no)
  312. min_gtkmm_version=ifelse([$1], ,0.10.0,$1)
  313. AC_MSG_CHECKING(for GTK-- - version >= $min_gtkmm_version)
  314. no_gtkmm=""
  315. if test "$GTKMM_CONFIG" = "no" ; then
  316. no_gtkmm=yes
  317. else
  318. AC_LANG_SAVE
  319. AC_LANG_CPLUSPLUS
  320. GTKMM_CFLAGS=`$GTKMM_CONFIG $gtkmm_config_args --cflags`
  321. GTKMM_LIBS=`$GTKMM_CONFIG $gtkmm_config_args --libs`
  322. gtkmm_config_major_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
  323. sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
  324. gtkmm_config_minor_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
  325. sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
  326. gtkmm_config_micro_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \
  327. sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
  328. if test "x$enable_gtkmmtest" = "xyes" ; then
  329. ac_save_CXXFLAGS="$CXXFLAGS"
  330. ac_save_LIBS="$LIBS"
  331. CXXFLAGS="$CXXFLAGS $GTKMM_CFLAGS"
  332. LIBS="$LIBS $GTKMM_LIBS"
  333. dnl
  334. dnl Now check if the installed GTK-- is sufficiently new. (Also sanity
  335. dnl checks the results of gtkmm-config to some extent
  336. dnl
  337. rm -f conf.gtkmmtest
  338. AC_TRY_RUN([
  339. #include <gtk--.h>
  340. #include <stdio.h>
  341. #include <stdlib.h>
  342. int
  343. main ()
  344. {
  345. int major, minor, micro;
  346. char *tmp_version;
  347. system ("touch conf.gtkmmtest");
  348. /* HP/UX 0 (%@#!) writes to sscanf strings */
  349. tmp_version = g_strdup("$min_gtkmm_version");
  350. if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
  351. printf("%s, bad version string\n", "$min_gtkmm_version");
  352. exit(1);
  353. }
  354. if ((gtkmm_major_version != $gtkmm_config_major_version) ||
  355. (gtkmm_minor_version != $gtkmm_config_minor_version) ||
  356. (gtkmm_micro_version != $gtkmm_config_micro_version))
  357. {
  358. printf("\n*** 'gtkmm-config --version' returned %d.%d.%d, but GTK-- (%d.%d.%d)\n",
  359. $gtkmm_config_major_version, $gtkmm_config_minor_version, $gtkmm_config_micro_version,
  360. gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
  361. printf ("*** was found! If gtkmm-config was correct, then it is best\n");
  362. printf ("*** to remove the old version of GTK--. You may also be able to fix the error\n");
  363. printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
  364. printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
  365. printf("*** required on your system.\n");
  366. printf("*** If gtkmm-config was wrong, set the environment variable GTKMM_CONFIG\n");
  367. printf("*** to point to the correct copy of gtkmm-config, and remove the file config.cache\n");
  368. printf("*** before re-running configure\n");
  369. }
  370. /* GTK-- does not have the GTKMM_*_VERSION constants */
  371. /*
  372. else if ((gtkmm_major_version != GTKMM_MAJOR_VERSION) ||
  373. (gtkmm_minor_version != GTKMM_MINOR_VERSION) ||
  374. (gtkmm_micro_version != GTKMM_MICRO_VERSION))
  375. {
  376. printf("*** GTK-- header files (version %d.%d.%d) do not match\n",
  377. GTKMM_MAJOR_VERSION, GTKMM_MINOR_VERSION, GTKMM_MICRO_VERSION);
  378. printf("*** library (version %d.%d.%d)\n",
  379. gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
  380. }
  381. */
  382. else
  383. {
  384. if ((gtkmm_major_version > major) ||
  385. ((gtkmm_major_version == major) && (gtkmm_minor_version > minor)) ||
  386. ((gtkmm_major_version == major) && (gtkmm_minor_version == minor) && (gtkmm_micro_version >= micro)))
  387. {
  388. return 0;
  389. }
  390. else
  391. {
  392. printf("\n*** An old version of GTK-- (%d.%d.%d) was found.\n",
  393. gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version);
  394. printf("*** You need a version of GTK-- newer than %d.%d.%d. The latest version of\n",
  395. major, minor, micro);
  396. printf("*** GTK-- is always available from ftp://ftp.gtk.org.\n");
  397. printf("***\n");
  398. printf("*** If you have already installed a sufficiently new version, this error\n");
  399. printf("*** probably means that the wrong copy of the gtkmm-config shell script is\n");
  400. printf("*** being found. The easiest way to fix this is to remove the old version\n");
  401. printf("*** of GTK--, but you can also set the GTKMM_CONFIG environment to point to the\n");
  402. printf("*** correct copy of gtkmm-config. (In this case, you will have to\n");
  403. printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
  404. printf("*** so that the correct libraries are found at run-time))\n");
  405. }
  406. }
  407. return 1;
  408. }
  409. ],, no_gtkmm=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
  410. CXXFLAGS="$ac_save_CXXFLAGS"
  411. LIBS="$ac_save_LIBS"
  412. fi
  413. fi
  414. if test "x$no_gtkmm" = x ; then
  415. AC_MSG_RESULT(yes)
  416. ifelse([$2], , :, [$2])
  417. else
  418. AC_MSG_RESULT(no)
  419. if test "$GTKMM_CONFIG" = "no" ; then
  420. echo "*** The gtkmm-config script installed by GTK-- could not be found"
  421. echo "*** If GTK-- was installed in PREFIX, make sure PREFIX/bin is in"
  422. echo "*** your path, or set the GTKMM_CONFIG environment variable to the"
  423. echo "*** full path to gtkmm-config."
  424. echo "*** The gtkmm-config script was not available in GTK-- versions"
  425. echo "*** prior to 0.9.12. Perhaps you need to update your installed"
  426. echo "*** version to 0.9.12 or later"
  427. else
  428. if test -f conf.gtkmmtest ; then
  429. :
  430. else
  431. echo "*** Could not run GTK-- test program, checking why..."
  432. CXXFLAGS="$CFLAGS $GTKMM_CXXFLAGS"
  433. LIBS="$LIBS $GTKMM_LIBS"
  434. AC_TRY_LINK([
  435. #include <gtk--.h>
  436. #include <stdio.h>
  437. ], [ return ((gtkmm_major_version) || (gtkmm_minor_version) || (gtkmm_micro_version)); ],
  438. [ echo "*** The test program compiled, but did not run. This usually means"
  439. echo "*** that the run-time linker is not finding GTK-- or finding the wrong"
  440. echo "*** version of GTK--. If it is not finding GTK--, you'll need to set your"
  441. echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
  442. echo "*** to the installed location Also, make sure you have run ldconfig if that"
  443. echo "*** is required on your system"
  444. echo "***"
  445. echo "*** If you have an old version installed, it is best to remove it, although"
  446. echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
  447. [ echo "*** The test program failed to compile or link. See the file config.log for the"
  448. echo "*** exact error that occured. This usually means GTK-- was incorrectly installed"
  449. echo "*** or that you have moved GTK-- since it was installed. In the latter case, you"
  450. echo "*** may want to edit the gtkmm-config script: $GTKMM_CONFIG" ])
  451. CXXFLAGS="$ac_save_CXXFLAGS"
  452. LIBS="$ac_save_LIBS"
  453. fi
  454. fi
  455. GTKMM_CFLAGS=""
  456. GTKMM_LIBS=""
  457. ifelse([$3], , :, [$3])
  458. AC_LANG_RESTORE
  459. fi
  460. AC_SUBST(GTKMM_CFLAGS)
  461. AC_SUBST(GTKMM_LIBS)
  462. rm -f conf.gtkmmtest
  463. ])
  464. ## libtool.m4 - Configure libtool for the target system. -*-Shell-script-*-
  465. ## Copyright (C) 1996-1999 Free Software Foundation, Inc.
  466. ## Originally by Gordon Matzigkeit <[email protected]>, 1996
  467. ##
  468. ## This program is free software; you can redistribute it and/or modify
  469. ## it under the terms of the GNU General Public License as published by
  470. ## the Free Software Foundation; either version 2 of the License, or
  471. ## (at your option) any later version.
  472. ##
  473. ## This program is distributed in the hope that it will be useful, but
  474. ## WITHOUT ANY WARRANTY; without even the implied warranty of
  475. ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  476. ## General Public License for more details.
  477. ##
  478. ## You should have received a copy of the GNU General Public License
  479. ## along with this program; if not, write to the Free Software
  480. ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  481. ##
  482. ## As a special exception to the GNU General Public License, if you
  483. ## distribute this file as part of a program that contains a
  484. ## configuration script generated by Autoconf, you may include it under
  485. ## the same distribution terms that you use for the rest of that program.
  486. # serial 40 AC_PROG_LIBTOOL
  487. AC_DEFUN(AC_PROG_LIBTOOL,
  488. [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
  489. # Save cache, so that ltconfig can load it
  490. AC_CACHE_SAVE
  491. # Actually configure libtool. ac_aux_dir is where install-sh is found.
  492. CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
  493. LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
  494. LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
  495. DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
  496. ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
  497. $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
  498. || AC_MSG_ERROR([libtool configure failed])
  499. # Reload cache, that may have been modified by ltconfig
  500. AC_CACHE_LOAD
  501. # This can be used to rebuild libtool when needed
  502. LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
  503. # Always use our own libtool.
  504. LIBTOOL='$(SHELL) $(top_builddir)/libtool'
  505. AC_SUBST(LIBTOOL)dnl
  506. # Redirect the config.log output again, so that the ltconfig log is not
  507. # clobbered by the next message.
  508. exec 5>>./config.log
  509. ])
  510. AC_DEFUN(AC_LIBTOOL_SETUP,
  511. [AC_PREREQ(2.13)dnl
  512. AC_REQUIRE([AC_ENABLE_SHARED])dnl
  513. AC_REQUIRE([AC_ENABLE_STATIC])dnl
  514. AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
  515. AC_REQUIRE([AC_CANONICAL_HOST])dnl
  516. AC_REQUIRE([AC_CANONICAL_BUILD])dnl
  517. AC_REQUIRE([AC_PROG_RANLIB])dnl
  518. AC_REQUIRE([AC_PROG_CC])dnl
  519. AC_REQUIRE([AC_PROG_LD])dnl
  520. AC_REQUIRE([AC_PROG_NM])dnl
  521. AC_REQUIRE([AC_PROG_LN_S])dnl
  522. dnl
  523. # Check for any special flags to pass to ltconfig.
  524. #
  525. # the following will cause an existing older ltconfig to fail, so
  526. # we ignore this at the expense of the cache file... Checking this
  527. # will just take longer ... bummer!
  528. #libtool_flags="--cache-file=$cache_file"
  529. #
  530. test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
  531. test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
  532. test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
  533. test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
  534. test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
  535. ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
  536. [libtool_flags="$libtool_flags --enable-dlopen"])
  537. ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
  538. [libtool_flags="$libtool_flags --enable-win32-dll"])
  539. AC_ARG_ENABLE(libtool-lock,
  540. [ --disable-libtool-lock avoid locking (might break parallel builds)])
  541. test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
  542. test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
  543. # Some flags need to be propagated to the compiler or linker for good
  544. # libtool support.
  545. case "$host" in
  546. *-*-irix6*)
  547. # Find out which ABI we are using.
  548. echo '[#]line __oline__ "configure"' > conftest.$ac_ext
  549. if AC_TRY_EVAL(ac_compile); then
  550. case "`/usr/bin/file conftest.o`" in
  551. *32-bit*)
  552. LD="${LD-ld} -32"
  553. ;;
  554. *N32*)
  555. LD="${LD-ld} -n32"
  556. ;;
  557. *64-bit*)
  558. LD="${LD-ld} -64"
  559. ;;
  560. esac
  561. fi
  562. rm -rf conftest*
  563. ;;
  564. *-*-sco3.2v5*)
  565. # On SCO OpenServer 5, we need -belf to get full-featured binaries.
  566. SAVE_CFLAGS="$CFLAGS"
  567. CFLAGS="$CFLAGS -belf"
  568. AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
  569. [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
  570. if test x"$lt_cv_cc_needs_belf" != x"yes"; then
  571. # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
  572. CFLAGS="$SAVE_CFLAGS"
  573. fi
  574. ;;
  575. ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
  576. [*-*-cygwin* | *-*-mingw*)
  577. AC_CHECK_TOOL(DLLTOOL, dlltool, false)
  578. AC_CHECK_TOOL(AS, as, false)
  579. AC_CHECK_TOOL(OBJDUMP, objdump, false)
  580. ;;
  581. ])
  582. esac
  583. ])
  584. # AC_LIBTOOL_DLOPEN - enable checks for dlopen support
  585. AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
  586. # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
  587. AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
  588. # AC_ENABLE_SHARED - implement the --enable-shared flag
  589. # Usage: AC_ENABLE_SHARED[(DEFAULT)]
  590. # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
  591. # `yes'.
  592. AC_DEFUN(AC_ENABLE_SHARED, [dnl
  593. define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
  594. AC_ARG_ENABLE(shared,
  595. changequote(<<, >>)dnl
  596. << --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
  597. changequote([, ])dnl
  598. [p=${PACKAGE-default}
  599. case "$enableval" in
  600. yes) enable_shared=yes ;;
  601. no) enable_shared=no ;;
  602. *)
  603. enable_shared=no
  604. # Look at the argument we got. We use all the common list separators.
  605. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
  606. for pkg in $enableval; do
  607. if test "X$pkg" = "X$p"; then
  608. enable_shared=yes
  609. fi
  610. done
  611. IFS="$ac_save_ifs"
  612. ;;
  613. esac],
  614. enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
  615. ])
  616. # AC_DISABLE_SHARED - set the default shared flag to --disable-shared
  617. AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
  618. AC_ENABLE_SHARED(no)])
  619. # AC_ENABLE_STATIC - implement the --enable-static flag
  620. # Usage: AC_ENABLE_STATIC[(DEFAULT)]
  621. # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
  622. # `yes'.
  623. AC_DEFUN(AC_ENABLE_STATIC, [dnl
  624. define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
  625. AC_ARG_ENABLE(static,
  626. changequote(<<, >>)dnl
  627. << --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
  628. changequote([, ])dnl
  629. [p=${PACKAGE-default}
  630. case "$enableval" in
  631. yes) enable_static=yes ;;
  632. no) enable_static=no ;;
  633. *)
  634. enable_static=no
  635. # Look at the argument we got. We use all the common list separators.
  636. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
  637. for pkg in $enableval; do
  638. if test "X$pkg" = "X$p"; then
  639. enable_static=yes
  640. fi
  641. done
  642. IFS="$ac_save_ifs"
  643. ;;
  644. esac],
  645. enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
  646. ])
  647. # AC_DISABLE_STATIC - set the default static flag to --disable-static
  648. AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
  649. AC_ENABLE_STATIC(no)])
  650. # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
  651. # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
  652. # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
  653. # `yes'.
  654. AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
  655. define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
  656. AC_ARG_ENABLE(fast-install,
  657. changequote(<<, >>)dnl
  658. << --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
  659. changequote([, ])dnl
  660. [p=${PACKAGE-default}
  661. case "$enableval" in
  662. yes) enable_fast_install=yes ;;
  663. no) enable_fast_install=no ;;
  664. *)
  665. enable_fast_install=no
  666. # Look at the argument we got. We use all the common list separators.
  667. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
  668. for pkg in $enableval; do
  669. if test "X$pkg" = "X$p"; then
  670. enable_fast_install=yes
  671. fi
  672. done
  673. IFS="$ac_save_ifs"
  674. ;;
  675. esac],
  676. enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
  677. ])
  678. # AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
  679. AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
  680. AC_ENABLE_FAST_INSTALL(no)])
  681. # AC_PROG_LD - find the path to the GNU or non-GNU linker
  682. AC_DEFUN(AC_PROG_LD,
  683. [AC_ARG_WITH(gnu-ld,
  684. [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
  685. test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
  686. AC_REQUIRE([AC_PROG_CC])dnl
  687. AC_REQUIRE([AC_CANONICAL_HOST])dnl
  688. AC_REQUIRE([AC_CANONICAL_BUILD])dnl
  689. ac_prog=ld
  690. if test "$ac_cv_prog_gcc" = yes; then
  691. # Check if gcc -print-prog-name=ld gives a path.
  692. AC_MSG_CHECKING([for ld used by GCC])
  693. ac_prog=`($CC -print-prog-name=ld) 2>&5`
  694. case "$ac_prog" in
  695. # Accept absolute paths.
  696. changequote(,)dnl
  697. [\\/]* | [A-Za-z]:[\\/]*)
  698. re_direlt='/[^/][^/]*/\.\./'
  699. changequote([,])dnl
  700. # Canonicalize the path of ld
  701. ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
  702. while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
  703. ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
  704. done
  705. test -z "$LD" && LD="$ac_prog"
  706. ;;
  707. "")
  708. # If it fails, then pretend we aren't using GCC.
  709. ac_prog=ld
  710. ;;
  711. *)
  712. # If it is relative, then search for the first ld in PATH.
  713. with_gnu_ld=unknown
  714. ;;
  715. esac
  716. elif test "$with_gnu_ld" = yes; then
  717. AC_MSG_CHECKING([for GNU ld])
  718. else
  719. AC_MSG_CHECKING([for non-GNU ld])
  720. fi
  721. AC_CACHE_VAL(ac_cv_path_LD,
  722. [if test -z "$LD"; then
  723. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
  724. for ac_dir in $PATH; do
  725. test -z "$ac_dir" && ac_dir=.
  726. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
  727. ac_cv_path_LD="$ac_dir/$ac_prog"
  728. # Check to see if the program is GNU ld. I'd rather use --version,
  729. # but apparently some GNU ld's only accept -v.
  730. # Break only if it was the GNU/non-GNU ld that we prefer.
  731. if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
  732. test "$with_gnu_ld" != no && break
  733. else
  734. test "$with_gnu_ld" != yes && break
  735. fi
  736. fi
  737. done
  738. IFS="$ac_save_ifs"
  739. else
  740. ac_cv_path_LD="$LD" # Let the user override the test with a path.
  741. fi])
  742. LD="$ac_cv_path_LD"
  743. if test -n "$LD"; then
  744. AC_MSG_RESULT($LD)
  745. else
  746. AC_MSG_RESULT(no)
  747. fi
  748. test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
  749. AC_SUBST(LD)
  750. AC_PROG_LD_GNU
  751. ])
  752. AC_DEFUN(AC_PROG_LD_GNU,
  753. [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
  754. [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
  755. if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
  756. ac_cv_prog_gnu_ld=yes
  757. else
  758. ac_cv_prog_gnu_ld=no
  759. fi])
  760. ])
  761. # AC_PROG_NM - find the path to a BSD-compatible name lister
  762. AC_DEFUN(AC_PROG_NM,
  763. [AC_MSG_CHECKING([for BSD-compatible nm])
  764. AC_CACHE_VAL(ac_cv_path_NM,
  765. [if test -n "$NM"; then
  766. # Let the user override the test.
  767. ac_cv_path_NM="$NM"
  768. else
  769. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
  770. for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
  771. test -z "$ac_dir" && ac_dir=.
  772. if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
  773. # Check to see if the nm accepts a BSD-compat flag.
  774. # Adding the `sed 1q' prevents false positives on HP-UX, which says:
  775. # nm: unknown option "B" ignored
  776. if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
  777. ac_cv_path_NM="$ac_dir/nm -B"
  778. break
  779. elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
  780. ac_cv_path_NM="$ac_dir/nm -p"
  781. break
  782. else
  783. ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
  784. continue # so that we can try to find one that supports BSD flags
  785. fi
  786. fi
  787. done
  788. IFS="$ac_save_ifs"
  789. test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
  790. fi])
  791. NM="$ac_cv_path_NM"
  792. AC_MSG_RESULT([$NM])
  793. AC_SUBST(NM)
  794. ])
  795. # AC_CHECK_LIBM - check for math library
  796. AC_DEFUN(AC_CHECK_LIBM,
  797. [AC_REQUIRE([AC_CANONICAL_HOST])dnl
  798. LIBM=
  799. case "$host" in
  800. *-*-beos* | *-*-cygwin*)
  801. # These system don't have libm
  802. ;;
  803. *-ncr-sysv4.3*)
  804. AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
  805. AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
  806. ;;
  807. *)
  808. AC_CHECK_LIB(m, main, LIBM="-lm")
  809. ;;
  810. esac
  811. ])
  812. # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
  813. # the libltdl convenience library, adds --enable-ltdl-convenience to
  814. # the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
  815. # is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
  816. # to be `${top_builddir}/libltdl'. Make sure you start DIR with
  817. # '${top_builddir}/' (note the single quotes!) if your package is not
  818. # flat, and, if you're not using automake, define top_builddir as
  819. # appropriate in the Makefiles.
  820. AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
  821. case "$enable_ltdl_convenience" in
  822. no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
  823. "") enable_ltdl_convenience=yes
  824. ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
  825. esac
  826. LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
  827. INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
  828. ])
  829. # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
  830. # the libltdl installable library, and adds --enable-ltdl-install to
  831. # the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
  832. # is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
  833. # to be `${top_builddir}/libltdl'. Make sure you start DIR with
  834. # '${top_builddir}/' (note the single quotes!) if your package is not
  835. # flat, and, if you're not using automake, define top_builddir as
  836. # appropriate in the Makefiles.
  837. # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
  838. AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
  839. AC_CHECK_LIB(ltdl, main,
  840. [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
  841. [if test x"$enable_ltdl_install" = xno; then
  842. AC_MSG_WARN([libltdl not installed, but installation disabled])
  843. else
  844. enable_ltdl_install=yes
  845. fi
  846. ])
  847. if test x"$enable_ltdl_install" = x"yes"; then
  848. ac_configure_args="$ac_configure_args --enable-ltdl-install"
  849. LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
  850. INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
  851. else
  852. ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
  853. LIBLTDL="-lltdl"
  854. INCLTDL=
  855. fi
  856. ])
  857. dnl old names
  858. AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
  859. AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
  860. AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
  861. AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
  862. AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
  863. AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
  864. AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
  865. dnl This is just to silence aclocal about the macro not being used
  866. ifelse([AC_DISABLE_FAST_INSTALL])dnl