mc-aclocal.m4 32 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153
  1. dnl
  2. dnl XView & SlingShot library checking
  3. dnl (c) 1995 Jakub Jelinek
  4. dnl
  5. dnl Set xview_includes, xview_libraries, and no_xview (initially yes).
  6. dnl Also sets xview_no_private_headers to yes if there are no xview_private
  7. dnl headers in the system.
  8. AC_DEFUN(AC_PATH_XVIEW,
  9. [
  10. no_xview=yes
  11. AC_ARG_WITH(xview, [--with-xview Use the XView toolkit],no_xview=)
  12. AC_ARG_WITH(xview-includes, [--with-xview-includes=path Specifies XView includes directory],
  13. [
  14. if test x$withval = xyes; then
  15. AC_MSG_WARN(Usage is: --with-xview-includes=path)
  16. xview_includes=NONE
  17. no_xview=
  18. else
  19. xview_includes=$withval
  20. fi
  21. ],
  22. [
  23. xview_includes=NONE
  24. ])dnl
  25. AC_ARG_WITH(xview-libraries, [--with-xview-libraries=path Specifies XView libraries directory],
  26. [
  27. if test x$withval = xyes; then
  28. AC_MSG_WARN(Usage is: --with-xview-libraries=path)
  29. xview_libraries=NONE
  30. no_xview=
  31. else
  32. xview_libraries=$withval
  33. fi
  34. ],
  35. [
  36. xview_libraries=NONE
  37. ])dnl
  38. if test "$no_xview" != yes; then
  39. if test "$no_x" = yes; then
  40. no_xview=yes
  41. fi
  42. fi
  43. if test "$no_xview" != yes; then
  44. AC_MSG_CHECKING(for XView)
  45. if test x$xview_libraries = xNONE; then
  46. if test x$xview_includes = xNONE; then
  47. AC_CACHE_VAL(ac_cv_path_xview,
  48. [
  49. no_xview=yes
  50. AC_PATH_XVIEW_XMKMF
  51. if test "x$no_xview" = xyes; then
  52. AC_PATH_XVIEW_DIRECT
  53. fi
  54. if test "x$no_xview" = xyes; then
  55. ac_cv_path_xview="no_xview=yes"
  56. else
  57. ac_cv_path_xview="no_xview= ac_xview_includes=$ac_xview_includes ac_xview_libraries=$ac_xview_libraries ac_xview_no_private_headers=$ac_xview_no_private_headers"
  58. fi
  59. ])dnl
  60. eval "$ac_cv_path_xview"
  61. fi
  62. fi
  63. if test "x$no_xview" = xyes; then
  64. AC_MSG_RESULT(no)
  65. else
  66. if test "x$xview_includes" = x || test "x$xview_includes" = xNONE; then
  67. xview_includes=$ac_xview_includes
  68. fi
  69. if test "x$xview_libraries" = x || test "x$xview_libraries" = xNONE; then
  70. xview_libraries=$ac_xview_libraries
  71. fi
  72. xview_no_private_headers=$ac_xview_no_private_headers
  73. ac_cv_path_xview="no_xview= ac_xview_includes=$xview_includes ac_xview_libraries=$xview_libraries ac_xview_no_private_headers=$ac_xview_no_private_headers"
  74. if test "x$xview_libraries" != x; then
  75. ac_msg_xview="libraries $xview_libraries"
  76. else
  77. ac_msg_xview=""
  78. fi
  79. if test "x$xview_includes" != x; then
  80. if test "x$ac_msg_xview" != x; then
  81. ac_msg_xview="$ac_msg_xview, "
  82. fi
  83. ac_msg_xview="${ac_msg_xview}headers $xview_includes"
  84. fi
  85. if test "x$xview_no_private_headers" = xyes; then
  86. if test "x$ac_msg_xview" != x; then
  87. ac_msg_xview="$ac_msg_xview, "
  88. fi
  89. ac_msg_xview="${ac_msg_xview}without xview_private headers"
  90. fi
  91. AC_MSG_RESULT([$ac_msg_xview])
  92. fi
  93. fi
  94. ])
  95. dnl Internal subroutine of AC_PATH_XVIEW
  96. dnl Set ac_xview_includes, ac_xview_libraries, and no_xview (initially yes).
  97. AC_DEFUN(AC_PATH_XVIEW_XMKMF,
  98. [rm -fr conftestdir
  99. if mkdir conftestdir; then
  100. cd conftestdir
  101. # Make sure to not put "make" in the Imakefile rules, since we grep it out.
  102. cat > Imakefile <<'EOF'
  103. #include <XView.tmpl>
  104. acfindxv:
  105. @echo 'ac_im_library_dest="${LIBRARY_DEST}"; ac_im_header_dest="${HEADER_DEST}"'
  106. EOF
  107. if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
  108. no_xview=
  109. # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
  110. eval `make acfindxv 2>/dev/null | grep -v make`
  111. # Screen out bogus values from the imake configuration.
  112. if test -f "$ac_im_header_dest/xview/xview.h"; then
  113. ac_xview_includes="$ac_im_header_dest"
  114. else
  115. no_xview=yes
  116. fi
  117. if test -d "$ac_im_library_dest"; then
  118. ac_xview_libraries="$ac_im_library_dest"
  119. else
  120. no_xview=yes
  121. fi
  122. fi
  123. if test "x$no_xview" != xyes; then
  124. if test -f "$ac_xview_includes/xview_private/draw_impl.h"; then
  125. ac_xview_no_private_headers=
  126. else
  127. ac_xview_no_private_headers=yes
  128. fi
  129. fi
  130. cd ..
  131. rm -fr conftestdir
  132. fi
  133. ])
  134. dnl Internal subroutine of AC_PATH_XVIEW
  135. dnl Set ac_xview_includes, ac_xview_libraries, and no_xview (initially yes).
  136. AC_DEFUN(AC_PATH_XVIEW_DIRECT,
  137. [test -z "$xview_direct_test_library" && xview_direct_test_library=xview
  138. test -z "$xview_direct_test_function" && xview_direct_test_function=xv_unique_key
  139. test -z "$xview_direct_test_include" && xview_direct_test_include=xview/xview.h
  140. AC_TRY_CPP([#include <$xview_direct_test_include>],
  141. [no_xview= ac_xview_includes=],
  142. [ for ac_dir in \
  143. $OPENWINHOME/include \
  144. /usr/openwin/include \
  145. /usr/openwin/share/include \
  146. \
  147. /usr/X11R6/include \
  148. /usr/X11R5/include \
  149. /usr/X11R4/include \
  150. \
  151. /usr/include/X11R6 \
  152. /usr/include/X11R5 \
  153. /usr/include/X11R4 \
  154. \
  155. /usr/local/X11R6/include \
  156. /usr/local/X11R5/include \
  157. /usr/local/X11R4/include \
  158. \
  159. /usr/local/include/X11R6 \
  160. /usr/local/include/X11R5 \
  161. /usr/local/include/X11R4 \
  162. \
  163. /usr/X11/include \
  164. /usr/include/X11 \
  165. /usr/local/X11/include \
  166. /usr/local/include/X11 \
  167. \
  168. /usr/X386/include \
  169. /usr/x386/include \
  170. /usr/XFree86/include/X11 \
  171. \
  172. /usr/include \
  173. /usr/local/include \
  174. /usr/unsupported/include \
  175. /usr/athena/include \
  176. /usr/local/x11r5/include \
  177. /usr/lpp/Xamples/include \
  178. ; \
  179. do
  180. if test -r "$ac_dir/$xview_direct_test_include"; then
  181. no_xview= ac_xview_includes=$ac_dir
  182. break
  183. fi
  184. done])
  185. if test "x$no_xview" != xyes; then
  186. if test "x$ac_xview_includes" != x; then
  187. if test -f "$ac_xview_includes/xview_private/draw_impl.h"; then
  188. ac_xview_no_private_headers=
  189. else
  190. ac_xview_no_private_headers=yes
  191. fi
  192. else
  193. AC_TRY_CPP([#include <xview_private/draw_impl.h>],
  194. [ac_xview_no_private_headers=],[ac_xview_no_private_headers=yes])
  195. fi
  196. fi
  197. # Check for the libraries.
  198. # See if we find them without any special options.
  199. # Don't add to $LIBS permanently.
  200. ac_save_LIBS="$LIBS"
  201. ac_save_LDFLAGS="$LDFLAGS"
  202. LDFLAGS="$LDFLAGS $X_LIBS"
  203. LIBS="-l$xview_direct_test_library -lolgx $X_EXTRA_LIBS -lX11 $X_PRE_LIBS $LIBS"
  204. AC_TRY_LINK([#include <$xview_direct_test_include>
  205. ], [${xview_direct_test_function}()],
  206. [LIBS="$ac_save_LIBS" LDFLAGS="$ac_save_LDFLAGS" no_xview= ac_xview_libraries=],
  207. [LIBS="$ac_save_LIBS" LDFLAGS="$ac_save_LDFLAGS"
  208. # First see if replacing the include by lib works.
  209. for ac_dir in `echo "$ac_xview_includes" | sed s/include/lib/` \
  210. $OPENWINHOME/lib \
  211. $OPENWINHOME/share/lib \
  212. /usr/openwin/lib \
  213. /usr/openwin/share/lib \
  214. \
  215. /usr/X11R6/lib \
  216. /usr/X11R5/lib \
  217. /usr/X11R4/lib \
  218. \
  219. /usr/lib/X11R6 \
  220. /usr/lib/X11R5 \
  221. /usr/lib/X11R4 \
  222. \
  223. /usr/local/X11R6/lib \
  224. /usr/local/X11R5/lib \
  225. /usr/local/X11R4/lib \
  226. \
  227. /usr/local/lib/X11R6 \
  228. /usr/local/lib/X11R5 \
  229. /usr/local/lib/X11R4 \
  230. \
  231. /usr/X11/lib \
  232. /usr/lib/X11 \
  233. /usr/local/X11/lib \
  234. /usr/local/lib/X11 \
  235. \
  236. /usr/X386/lib \
  237. /usr/x386/lib \
  238. /usr/XFree86/lib/X11 \
  239. \
  240. /usr/lib \
  241. /usr/local/lib \
  242. /usr/unsupported/lib \
  243. /usr/athena/lib \
  244. /usr/local/x11r5/lib \
  245. /usr/lpp/Xamples/lib \
  246. ; \
  247. do
  248. for ac_extension in a so sl; do
  249. if test -r $ac_dir/lib${xview_direct_test_library}.$ac_extension; then
  250. no_xview= ac_xview_libraries=$ac_dir
  251. break 2
  252. fi
  253. done
  254. done])])
  255. dnl Substitute XVIEW_LIBS and XVIEW_CFLAGS and
  256. dnl HAVE_XVIEW, which is either yes or no.
  257. dnl Both contain X_LIBS resp. X_CFLAGS inside
  258. dnl Also substitutes HAVE_XVIEW_PRIVATE_HEADERS
  259. dnl if there are xview_private headers in the system
  260. AC_DEFUN(AC_PATH_XVIEW_XTRA,
  261. [AC_REQUIRE([AC_PATH_XVIEW])dnl
  262. if test "$no_xview" = yes; then
  263. # Not all programs may use this symbol, but it does not hurt to define it.
  264. XVIEW_CFLAGS="$X_CFGLAGS $XVIEW_CFLAGS -DXVIEW_MISSING"
  265. else
  266. if test -n "$xview_includes"; then
  267. XVIEW_CFLAGS="$X_CFLAGS $XVIEW_CFGLAGS"
  268. if test "$xview_includes" != "$x_includes"; then
  269. XVIEW_CPPFLAGS="-I$xview_includes"
  270. fi
  271. fi
  272. # It would be nice to have a more robust check for the -R ld option than
  273. # just checking for Solaris.
  274. # It would also be nice to do this for all -L options, not just this one.
  275. if test -n "$xview_libraries"; then
  276. if test "$xview_libraries" = "$x_libraries"; then
  277. XVIEW_LIBS="$X_LIBS $XVIEW_LIBS"
  278. else
  279. XVIEW_LIBS="$X_LIBS $XVIEW_LIBS -L$xview_libraries"
  280. if test "`(uname) 2>/dev/null`" = SunOS &&
  281. uname -r | grep '^5' >/dev/null; then
  282. XVIEW_LIBS="$XVIEW_LIBS -R$xview_libraries"
  283. fi
  284. fi
  285. fi
  286. fi
  287. if test "x$no_xview" = xyes; then
  288. HAVE_XVIEW=no
  289. else
  290. HAVE_XVIEW=yes
  291. fi
  292. if test "x$xview_no_private_headers" = xyes; then
  293. HAVE_XVIEW_PRIVATE_HEADERS=no
  294. else
  295. HAVE_XVIEW_PRIVATE_HEADERS=yes
  296. fi
  297. AC_SUBST(XVIEW_CFLAGS)dnl
  298. AC_SUBST(XVIEW_CPPFLAGS)dnl
  299. AC_SUBST(XVIEW_LIBS)dnl
  300. AC_SUBST(HAVE_XVIEW)dnl
  301. AC_SUBST(HAVE_XVIEW_PRIVATE_HEADERS)dnl
  302. ])dnl
  303. dnl Internal subroutine of AC_PATH_SLINGSHOT
  304. AC_DEFUN(AC_PATH_SLINGSHOT_DIRECT,
  305. [
  306. AC_TRY_CPP([#include <sspkg/rectobj.h>],[no_ss= ac_ss_includes=],
  307. [ for ac_dir in \
  308. $OPENWINHOME/include \
  309. /usr/openwin/include \
  310. /usr/openwin/share/include \
  311. \
  312. /usr/X11R6/include \
  313. /usr/X11R5/include \
  314. /usr/X11R4/include \
  315. \
  316. /usr/include/X11R6 \
  317. /usr/include/X11R5 \
  318. /usr/include/X11R4 \
  319. \
  320. /usr/local/X11R6/include \
  321. /usr/local/X11R5/include \
  322. /usr/local/X11R4/include \
  323. \
  324. /usr/local/include/X11R6 \
  325. /usr/local/include/X11R5 \
  326. /usr/local/include/X11R4 \
  327. \
  328. /usr/X11/include \
  329. /usr/include/X11 \
  330. /usr/local/X11/include \
  331. /usr/local/include/X11 \
  332. \
  333. /usr/X386/include \
  334. /usr/x386/include \
  335. /usr/XFree86/include/X11 \
  336. \
  337. /usr/include \
  338. /usr/local/include \
  339. /usr/unsupported/include \
  340. /usr/athena/include \
  341. /usr/local/x11r5/include \
  342. /usr/lpp/Xamples/include \
  343. ; \
  344. do
  345. if test -r "$ac_dir/sspkg/rectobj.h"; then
  346. no_ss= ac_ss_includes=$ac_dir
  347. break
  348. fi
  349. done])
  350. # Check for the libraries.
  351. # See if we find them without any special options.
  352. # Don't add to $LIBS permanently.
  353. ac_save_LIBS="$LIBS"
  354. ac_save_LDFLAGS="$LDFLAGS"
  355. LDFLAGS="$LDFLAGS $XVIEW_LIBS"
  356. LIBS="-lsspkg -lm -lxview -lolgx $X_EXTRA_LIBS -lX11 $X_PRE_LIBS $LIBS"
  357. AC_TRY_LINK([#include <sspkg/rectobj.h>
  358. ], [rectobj_get_selected_list()],
  359. [LIBS="$ac_save_LIBS" LDFLAGS="$ac_save_LDFLAGS" no_ss= ac_ss_libraries=],
  360. [LIBS="$ac_save_LIBS" LDFLAGS="$ac_save_LDFLAGS"
  361. # First see if replacing the include by lib works.
  362. for ac_dir in `echo "$ac_ss_includes" | sed s/include/lib/` \
  363. $OPENWINHOME/lib \
  364. $OPENWINHOME/share/lib \
  365. /usr/openwin/lib \
  366. /usr/openwin/share/lib \
  367. \
  368. /usr/X11R6/lib \
  369. /usr/X11R5/lib \
  370. /usr/X11R4/lib \
  371. \
  372. /usr/lib/X11R6 \
  373. /usr/lib/X11R5 \
  374. /usr/lib/X11R4 \
  375. \
  376. /usr/local/X11R6/lib \
  377. /usr/local/X11R5/lib \
  378. /usr/local/X11R4/lib \
  379. \
  380. /usr/local/lib/X11R6 \
  381. /usr/local/lib/X11R5 \
  382. /usr/local/lib/X11R4 \
  383. \
  384. /usr/X11/lib \
  385. /usr/lib/X11 \
  386. /usr/local/X11/lib \
  387. /usr/local/lib/X11 \
  388. \
  389. /usr/X386/lib \
  390. /usr/x386/lib \
  391. /usr/XFree86/lib/X11 \
  392. \
  393. /usr/lib \
  394. /usr/local/lib \
  395. /usr/unsupported/lib \
  396. /usr/athena/lib \
  397. /usr/local/x11r5/lib \
  398. /usr/lpp/Xamples/lib \
  399. ; \
  400. do
  401. for ac_extension in a so sl; do
  402. if test -r $ac_dir/libsspkg.$ac_extension; then
  403. no_ss= ac_ss_libraries=$ac_dir
  404. break 2
  405. fi
  406. done
  407. done])])
  408. dnl Set ss_includes, ss_libraries, and no_ss (initially yes).
  409. AC_DEFUN(AC_PATH_SLINGSHOT,
  410. [AC_REQUIRE([AC_PATH_XVIEW_XTRA])dnl
  411. AC_MSG_CHECKING(for SlingShot)
  412. AC_ARG_WITH(ss, [--with-ss Use the SlingShot extension])
  413. AC_ARG_WITH(ss-includes, [--with-ss-includes=path Specifies SlingShot includes directory],
  414. [
  415. if test x$withval = xyes; then
  416. AC_MSG_WARN(Usage is: --with-ss-includes=path)
  417. ss_includes=NONE
  418. else
  419. ss_includes=$withval
  420. fi
  421. ],
  422. [
  423. ss_includes=NONE
  424. ])dnl
  425. AC_ARG_WITH(ss-libraries, [--with-ss-libraries=path Specifies SlingShot libraries directory],
  426. [
  427. if test x$withval = xyes; then
  428. AC_MSG_WARN(Usage is: --with-ss-libraries=path)
  429. ss_libraries=NONE
  430. else
  431. ss_libraries=$withval
  432. fi
  433. ],
  434. [
  435. ss_libraries=NONE
  436. ])dnl
  437. if test "x$with_ss" = xno; then
  438. no_ss=yes
  439. else
  440. if test "x$ss_includes" != xNONE && test "x$ss_libraries" != xNONE; then
  441. no_ss=
  442. else
  443. AC_CACHE_VAL(ac_cv_path_ss,
  444. [
  445. no_ss=yes
  446. AC_PATH_SLINGSHOT_DIRECT
  447. if test "x$no_ss" = xyes; then
  448. ac_cv_path_ss="ac_noss=yes"
  449. else
  450. ac_cv_path_ss="ac_ss_includes=$ac_ss_includes ac_ss_libraries=$ac_ss_libraries"
  451. fi
  452. ])dnl
  453. eval "$ac_cv_path_ss"
  454. fi
  455. fi
  456. fi
  457. if test "x$no_ss" = xyes; then
  458. AC_MSG_RESULT(no)
  459. else
  460. if test "x$ss_includes" = x || test "x$ss_includes" = xNONE; then
  461. ss_includes=$ac_ss_includes
  462. fi
  463. if test "x$ss_libraries" = x || test "x$ss_libraries" = xNONE; then
  464. ss_libraries=$ac_ss_libraries
  465. fi
  466. ac_cv_path_ss="no_ss= ac_ss_includes=$ss_includes ac_ss_libraries=$ss_libraries"
  467. if test "x$ss_libraries" = x; then
  468. if test "x$ss_includes" = x; then
  469. AC_MSG_RESULT(yes)
  470. else
  471. AC_MSG_RESULT([headers $ss_includes])
  472. fi
  473. else
  474. if test "x$ss_includes" = x; then
  475. AC_MSG_RESULT([libraries $ss_libraries])
  476. else
  477. AC_MSG_RESULT([libraries $ss_libraries, headers $ss_includes])
  478. fi
  479. fi
  480. fi
  481. ])
  482. dnl Substitute SLINGSHOT_LIBS and SLINGSHOT_CFLAGS and
  483. dnl HAVE_SLINGSHOT, which is either yes or no.
  484. dnl Both contain XVIEW_LIBS resp. XVIEW_CFLAGS inside
  485. AC_DEFUN(AC_PATH_SLINGSHOT_XTRA,
  486. [AC_REQUIRE([AC_PATH_SLINGSHOT])dnl
  487. if test "$no_ss" = yes; then
  488. # Not all programs may use this symbol, but it does not hurt to define it.
  489. SLINGSHOT_CFLAGS="$XVIEW_CFGLAGS $SLINGSHOT_CFLAGS -DSLINGSHOT_MISSING"
  490. else
  491. if test -n "$ss_includes"; then
  492. SLINGSHOT_CFLAGS="$XVIEW_CFLAGS $SLINGSHOT_CFGLAGS -I$ss_includes"
  493. fi
  494. # It would be nice to have a more robust check for the -R ld option than
  495. # just checking for Solaris.
  496. # It would also be nice to do this for all -L options, not just this one.
  497. if test -n "$ss_libraries"; then
  498. SLINGSHOT_LIBS="$XVIEW_LIBS $SLINGSHOT_LIBS -L$ss_libraries"
  499. if test "`(uname) 2>/dev/null`" = SunOS &&
  500. uname -r | grep '^5' >/dev/null; then
  501. SLINGSHOT_LIBS="$SLINGSHOT_LIBS -R$ss_libraries"
  502. fi
  503. fi
  504. fi
  505. if test "x$no_ss" = xyes; then
  506. HAVE_SLINGSHOT=no
  507. else
  508. HAVE_SLINGSHOT=yes
  509. fi
  510. AC_SUBST(SLINGSHOT_CFLAGS)dnl
  511. AC_SUBST(SLINGSHOT_LIBS)dnl
  512. AC_SUBST(HAVE_SLINGSHOT)dnl
  513. ])dnl
  514. dnl
  515. dnl XView library checking end
  516. dnl
  517. dnl
  518. dnl Check for size of d_name dirent member
  519. dnl
  520. AC_DEFUN(AC_SHORT_D_NAME_LEN, [
  521. AC_MSG_CHECKING(filename fits on dirent.d_name)
  522. AC_CACHE_VAL(ac_cv_dnamesize, [
  523. OCFLAGS="$CFLAGS"
  524. CFLAGS="$CFLAGS -I$srcdir"
  525. AC_TRY_RUN([
  526. #include <src/fs.h>
  527. main ()
  528. {
  529. struct dirent ddd;
  530. if (sizeof (ddd.d_name) < 12)
  531. exit (0);
  532. else
  533. exit (1);
  534. }
  535. ],[
  536. ac_cv_dnamesize="no"
  537. ], [
  538. ac_cv_dnamesize="yes"
  539. ], [
  540. # Cannot find out, so assume no
  541. ac_cv_dnamesize="no"
  542. ])
  543. CFLAGS="$OCFLAGS"
  544. ])
  545. if test x$ac_cv_dnamesize = xno; then
  546. AC_DEFINE(NEED_EXTRA_DIRENT_BUFFER)
  547. fi
  548. AC_MSG_RESULT($ac_cv_dnamesize)
  549. ])
  550. dnl
  551. dnl Filesystem information detection
  552. dnl
  553. dnl To get information about the disk, mount points, etc.
  554. dnl
  555. AC_DEFUN(AC_GET_FS_INFO, [
  556. AC_CHECK_HEADERS(fcntl.h sys/dustat.h sys/param.h sys/statfs.h sys/fstyp.h)
  557. AC_CHECK_HEADERS(mnttab.h mntent.h utime.h sys/statvfs.h sys/vfs.h)
  558. AC_CHECK_HEADERS(sys/mount.h sys/filsys.h sys/fs_types.h)
  559. AC_CHECK_FUNCS(getmntinfo)
  560. dnl This configure.in code has been stolen from GNU fileutils-3.12. Its
  561. dnl job is to detect a method to get list of mounted filesystems.
  562. AC_MSG_CHECKING([for d_ino member in directory struct])
  563. AC_CACHE_VAL(fu_cv_sys_d_ino_in_dirent,
  564. [AC_TRY_LINK([
  565. #include <sys/types.h>
  566. #ifdef HAVE_DIRENT_H
  567. # include <dirent.h>
  568. #else /* not HAVE_DIRENT_H */
  569. # define dirent direct
  570. # ifdef HAVE_SYS_NDIR_H
  571. # include <sys/ndir.h>
  572. # endif /* HAVE_SYS_NDIR_H */
  573. # ifdef HAVE_SYS_DIR_H
  574. # include <sys/dir.h>
  575. # endif /* HAVE_SYS_DIR_H */
  576. # ifdef HAVE_NDIR_H
  577. # include <ndir.h>
  578. # endif /* HAVE_NDIR_H */
  579. #endif /* HAVE_DIRENT_H */
  580. ],
  581. [struct dirent dp; dp.d_ino = 0;],
  582. fu_cv_sys_d_ino_in_dirent=yes,
  583. fu_cv_sys_d_ino_in_dirent=no)])
  584. AC_MSG_RESULT($fu_cv_sys_d_ino_in_dirent)
  585. if test $fu_cv_sys_d_ino_in_dirent = yes; then
  586. AC_DEFINE(D_INO_IN_DIRENT)
  587. fi
  588. # Determine how to get the list of mounted filesystems.
  589. list_mounted_fs=
  590. # If the getmntent function is available but not in the standard library,
  591. # make sure LIBS contains -lsun (on Irix4) or -lseq (on PTX).
  592. AC_FUNC_GETMNTENT
  593. if test $ac_cv_func_getmntent = yes; then
  594. # This system has the getmntent function.
  595. # Determine whether it's the one-argument variant or the two-argument one.
  596. if test -z "$list_mounted_fs"; then
  597. # SVR4
  598. AC_MSG_CHECKING([for two-argument getmntent function])
  599. AC_CACHE_VAL(fu_cv_sys_mounted_getmntent2,
  600. [AC_EGREP_HEADER(getmntent, sys/mnttab.h,
  601. fu_cv_sys_mounted_getmntent2=yes,
  602. fu_cv_sys_mounted_getmntent2=no)])
  603. AC_MSG_RESULT($fu_cv_sys_mounted_getmntent2)
  604. if test $fu_cv_sys_mounted_getmntent2 = yes; then
  605. list_mounted_fs=found
  606. AC_DEFINE(MOUNTED_GETMNTENT2)
  607. fi
  608. fi
  609. if test -z "$list_mounted_fs"; then
  610. # 4.3BSD, SunOS, HP-UX, Dynix, Irix
  611. AC_MSG_CHECKING([for one-argument getmntent function])
  612. AC_CACHE_VAL(fu_cv_sys_mounted_getmntent1,
  613. [test $ac_cv_header_mntent_h = yes \
  614. && fu_cv_sys_mounted_getmntent1=yes \
  615. || fu_cv_sys_mounted_getmntent1=no])
  616. AC_MSG_RESULT($fu_cv_sys_mounted_getmntent1)
  617. if test $fu_cv_sys_mounted_getmntent1 = yes; then
  618. list_mounted_fs=found
  619. AC_DEFINE(MOUNTED_GETMNTENT1)
  620. fi
  621. fi
  622. if test -z "$list_mounted_fs"; then
  623. AC_WARN([could not determine how to read list of mounted fs])
  624. CPPFLAGS="$CPPFLAGS -DNO_INFOMOUNT"
  625. fi
  626. fi
  627. if test -z "$list_mounted_fs"; then
  628. # DEC Alpha running OSF/1.
  629. AC_MSG_CHECKING([for getfsstat function])
  630. AC_CACHE_VAL(fu_cv_sys_mounted_getsstat,
  631. [AC_TRY_LINK([
  632. #include <sys/types.h>
  633. #include <sys/mount.h>
  634. #include <sys/fs_types.h>],
  635. [struct statfs *stats;
  636. numsys = getfsstat ((struct statfs *)0, 0L, MNT_WAIT); ],
  637. fu_cv_sys_mounted_getsstat=yes,
  638. fu_cv_sys_mounted_getsstat=no)])
  639. AC_MSG_RESULT($fu_cv_sys_mounted_getsstat)
  640. if test $fu_cv_sys_mounted_getsstat = yes; then
  641. list_mounted_fs=found
  642. AC_DEFINE(MOUNTED_GETFSSTAT)
  643. fi
  644. fi
  645. if test -z "$list_mounted_fs"; then
  646. # AIX.
  647. AC_MSG_CHECKING([for mntctl function and struct vmount])
  648. AC_CACHE_VAL(fu_cv_sys_mounted_vmount,
  649. [AC_TRY_CPP([#include <fshelp.h>],
  650. fu_cv_sys_mounted_vmount=yes,
  651. fu_cv_sys_mounted_vmount=no)])
  652. AC_MSG_RESULT($fu_cv_sys_mounted_vmount)
  653. if test $fu_cv_sys_mounted_vmount = yes; then
  654. list_mounted_fs=found
  655. AC_DEFINE(MOUNTED_VMOUNT)
  656. fi
  657. fi
  658. if test -z "$list_mounted_fs"; then
  659. # SVR3
  660. AC_MSG_CHECKING([for existence of three headers])
  661. AC_CACHE_VAL(fu_cv_sys_mounted_fread_fstyp,
  662. [AC_TRY_CPP([
  663. #include <sys/statfs.h>
  664. #include <sys/fstyp.h>
  665. #include <mnttab.h>],
  666. fu_cv_sys_mounted_fread_fstyp=yes,
  667. fu_cv_sys_mounted_fread_fstyp=no)])
  668. AC_MSG_RESULT($fu_cv_sys_mounted_fread_fstyp)
  669. if test $fu_cv_sys_mounted_fread_fstyp = yes; then
  670. list_mounted_fs=found
  671. AC_DEFINE(MOUNTED_FREAD_FSTYP)
  672. fi
  673. fi
  674. if test -z "$list_mounted_fs"; then
  675. # 4.4BSD and DEC OSF/1.
  676. AC_MSG_CHECKING([for getmntinfo function])
  677. AC_CACHE_VAL(fu_cv_sys_mounted_getmntinfo,
  678. [
  679. ok=
  680. if test $ac_cv_func_getmntinfo = yes; then
  681. AC_EGREP_HEADER(f_type;, sys/mount.h,
  682. ok=yes)
  683. fi
  684. test -n "$ok" \
  685. && fu_cv_sys_mounted_getmntinfo=yes \
  686. || fu_cv_sys_mounted_getmntinfo=no
  687. ])
  688. AC_MSG_RESULT($fu_cv_sys_mounted_getmntinfo)
  689. if test $fu_cv_sys_mounted_getmntinfo = yes; then
  690. list_mounted_fs=found
  691. AC_DEFINE(MOUNTED_GETMNTINFO)
  692. fi
  693. fi
  694. # FIXME: add a test for netbsd-1.1 here
  695. if test -z "$list_mounted_fs"; then
  696. # Ultrix
  697. AC_MSG_CHECKING([for getmnt function])
  698. AC_CACHE_VAL(fu_cv_sys_mounted_getmnt,
  699. [AC_TRY_CPP([
  700. #include <sys/fs_types.h>
  701. #include <sys/mount.h>],
  702. fu_cv_sys_mounted_getmnt=yes,
  703. fu_cv_sys_mounted_getmnt=no)])
  704. AC_MSG_RESULT($fu_cv_sys_mounted_getmnt)
  705. if test $fu_cv_sys_mounted_getmnt = yes; then
  706. list_mounted_fs=found
  707. AC_DEFINE(MOUNTED_GETMNT)
  708. fi
  709. fi
  710. if test -z "$list_mounted_fs"; then
  711. # SVR2
  712. AC_MSG_CHECKING([whether it is possible to resort to fread on /etc/mnttab])
  713. AC_CACHE_VAL(fu_cv_sys_mounted_fread,
  714. [AC_TRY_CPP([#include <mnttab.h>],
  715. fu_cv_sys_mounted_fread=yes,
  716. fu_cv_sys_mounted_fread=no)])
  717. AC_MSG_RESULT($fu_cv_sys_mounted_fread)
  718. if test $fu_cv_sys_mounted_fread = yes; then
  719. list_mounted_fs=found
  720. AC_DEFINE(MOUNTED_FREAD)
  721. fi
  722. fi
  723. if test -z "$list_mounted_fs"; then
  724. AC_MSG_WARN([could not determine how to read list of mounted fs])
  725. CPPFLAGS="$CPPFLAGS -DNO_INFOMOUNT"
  726. # FIXME -- no need to abort building the whole package
  727. # Can't build mountlist.c or anything that needs its functions
  728. fi
  729. dnl This configure.in code has been stolen from GNU fileutils-3.12. Its
  730. dnl job is to detect a method to get file system information.
  731. AC_CHECKING(how to get filesystem space usage)
  732. space=no
  733. # Here we'll compromise a little (and perform only the link test)
  734. # since it seems there are no variants of the statvfs function.
  735. if test $space = no; then
  736. # SVR4
  737. AC_CHECK_FUNCS(statvfs)
  738. if test $ac_cv_func_statvfs = yes; then
  739. space=yes
  740. AC_DEFINE(STAT_STATVFS)
  741. fi
  742. fi
  743. if test $space = no; then
  744. # DEC Alpha running OSF/1
  745. AC_MSG_CHECKING([for 3-argument statfs function (DEC OSF/1)])
  746. AC_CACHE_VAL(fu_cv_sys_stat_statfs3_osf1,
  747. [AC_TRY_RUN([
  748. #include <sys/param.h>
  749. #include <sys/types.h>
  750. #include <sys/mount.h>
  751. main ()
  752. {
  753. struct statfs fsd;
  754. fsd.f_fsize = 0;
  755. exit (statfs (".", &fsd, sizeof (struct statfs)));
  756. }],
  757. fu_cv_sys_stat_statfs3_osf1=yes,
  758. fu_cv_sys_stat_statfs3_osf1=no,
  759. fu_cv_sys_stat_statfs3_osf1=no)])
  760. AC_MSG_RESULT($fu_cv_sys_stat_statfs3_osf1)
  761. if test $fu_cv_sys_stat_statfs3_osf1 = yes; then
  762. space=yes
  763. AC_DEFINE(STAT_STATFS3_OSF1)
  764. fi
  765. fi
  766. if test $space = no; then
  767. # AIX
  768. AC_MSG_CHECKING([for two-argument statfs with statfs.bsize member (AIX, 4.3BSD)])
  769. AC_CACHE_VAL(fu_cv_sys_stat_statfs2_bsize,
  770. [AC_TRY_RUN([
  771. #ifdef HAVE_SYS_PARAM_H
  772. #include <sys/param.h>
  773. #endif
  774. #ifdef HAVE_SYS_MOUNT_H
  775. #include <sys/mount.h>
  776. #endif
  777. #ifdef HAVE_SYS_VFS_H
  778. #include <sys/vfs.h>
  779. #endif
  780. main ()
  781. {
  782. struct statfs fsd;
  783. fsd.f_bsize = 0;
  784. exit (statfs (".", &fsd));
  785. }],
  786. fu_cv_sys_stat_statfs2_bsize=yes,
  787. fu_cv_sys_stat_statfs2_bsize=no,
  788. fu_cv_sys_stat_statfs2_bsize=no)])
  789. AC_MSG_RESULT($fu_cv_sys_stat_statfs2_bsize)
  790. if test $fu_cv_sys_stat_statfs2_bsize = yes; then
  791. space=yes
  792. AC_DEFINE(STAT_STATFS2_BSIZE)
  793. fi
  794. fi
  795. if test $space = no; then
  796. # SVR3
  797. AC_MSG_CHECKING([for four-argument statfs (AIX-3.2.5, SVR3)])
  798. AC_CACHE_VAL(fu_cv_sys_stat_statfs4,
  799. [AC_TRY_RUN([#include <sys/types.h>
  800. #include <sys/statfs.h>
  801. main ()
  802. {
  803. struct statfs fsd;
  804. exit (statfs (".", &fsd, sizeof fsd, 0));
  805. }],
  806. fu_cv_sys_stat_statfs4=yes,
  807. fu_cv_sys_stat_statfs4=no,
  808. fu_cv_sys_stat_statfs4=no)])
  809. AC_MSG_RESULT($fu_cv_sys_stat_statfs4)
  810. if test $fu_cv_sys_stat_statfs4 = yes; then
  811. space=yes
  812. AC_DEFINE(STAT_STATFS4)
  813. fi
  814. fi
  815. if test $space = no; then
  816. # 4.4BSD and NetBSD
  817. AC_MSG_CHECKING([for two-argument statfs with statfs.fsize dnl
  818. member (4.4BSD and NetBSD)])
  819. AC_CACHE_VAL(fu_cv_sys_stat_statfs2_fsize,
  820. [AC_TRY_RUN([#include <sys/types.h>
  821. #ifdef HAVE_SYS_PARAM_H
  822. #include <sys/param.h>
  823. #endif
  824. #ifdef HAVE_SYS_MOUNT_H
  825. #include <sys/mount.h>
  826. #endif
  827. main ()
  828. {
  829. struct statfs fsd;
  830. fsd.f_fsize = 0;
  831. exit (statfs (".", &fsd));
  832. }],
  833. fu_cv_sys_stat_statfs2_fsize=yes,
  834. fu_cv_sys_stat_statfs2_fsize=no,
  835. fu_cv_sys_stat_statfs2_fsize=no)])
  836. AC_MSG_RESULT($fu_cv_sys_stat_statfs2_fsize)
  837. if test $fu_cv_sys_stat_statfs2_fsize = yes; then
  838. space=yes
  839. AC_DEFINE(STAT_STATFS2_FSIZE)
  840. fi
  841. fi
  842. if test $space = no; then
  843. # Ultrix
  844. AC_MSG_CHECKING([for two-argument statfs with struct fs_data (Ultrix)])
  845. AC_CACHE_VAL(fu_cv_sys_stat_fs_data,
  846. [AC_TRY_RUN([
  847. #include <sys/types.h>
  848. #ifdef HAVE_SYS_PARAM_H
  849. #include <sys/param.h>
  850. #endif
  851. #ifdef HAVE_SYS_MOUNT_H
  852. #include <sys/mount.h>
  853. #endif
  854. #ifdef HAVE_SYS_FS_TYPES_H
  855. #include <sys/fs_types.h>
  856. #endif
  857. main ()
  858. {
  859. struct fs_data fsd;
  860. /* Ultrix's statfs returns 1 for success,
  861. 0 for not mounted, -1 for failure. */
  862. exit (statfs (".", &fsd) != 1);
  863. }],
  864. fu_cv_sys_stat_fs_data=yes,
  865. fu_cv_sys_stat_fs_data=no,
  866. fu_cv_sys_stat_fs_data=no)])
  867. AC_MSG_RESULT($fu_cv_sys_stat_fs_data)
  868. if test $fu_cv_sys_stat_fs_data = yes; then
  869. space=yes
  870. AC_DEFINE(STAT_STATFS2_FS_DATA)
  871. fi
  872. fi
  873. dnl Not supported
  874. dnl if test $space = no; then
  875. dnl # SVR2
  876. dnl AC_TRY_CPP([#include <sys/filsys.h>],
  877. dnl AC_DEFINE(STAT_READ_FILSYS) space=yes)
  878. dnl fi
  879. ])
  880. dnl AC_CHECK_HEADER_IN_PATH(HEADER-FILE, ADDITIONAL_PATH, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
  881. AC_DEFUN(AC_CHECK_HEADER_IN_PATH,
  882. [dnl Do the transliteration at runtime so arg 1 can be a shell variable.
  883. ac_safe=`echo "$1" | tr './\055' '___'`
  884. AC_MSG_CHECKING([for $1])
  885. AC_CACHE_VAL(ac_cv_header_in_path_$ac_safe,
  886. [AC_TRY_CPP([#include <$1>], ac_header_in_path=yes, [
  887. ac_header_in_path_found=no
  888. for ac_header_in_path_value in [$2]; do
  889. ac_in_path_save_CPPFLAGS=$CPPFLAGS
  890. CPPFLAGS="$CPPFLAGS -I$ac_header_in_path_value"
  891. AC_TRY_CPP([#include <$1>], [
  892. ac_header_in_path_found=yes
  893. ac_header_in_path=$ac_header_in_path_value
  894. ], )
  895. CPPFLAGS=$ac_in_path_save_CPPFLAGS
  896. if test x$ac_header_in_path_found = xyes; then
  897. break
  898. fi
  899. done
  900. if test $ac_header_in_path_found = xno; then
  901. ac_header_in_path=no
  902. fi
  903. ])
  904. eval "ac_cv_header_in_path_$ac_safe=$ac_header_in_path"
  905. ])dnl
  906. eval "ac_header_in_path=`echo '$ac_cv_header_in_path_'$ac_safe`"
  907. if test "$ac_header_in_path" = no; then
  908. AC_MSG_RESULT(no)
  909. ifelse([$4], , , [$4
  910. ])dnl
  911. else
  912. if test -n "$ac_header_in_path"; then
  913. AC_MSG_RESULT($ac_header_in_path)
  914. else
  915. AC_MSG_RESULT(yes)
  916. fi
  917. if test x$ac_header_in_path = xyes; then
  918. ac_header_in_path=
  919. eval "ac_cv_header_in_path_$ac_safe="
  920. fi
  921. ifelse([$3], , , [$3
  922. ])dnl
  923. fi
  924. ])
  925. dnl Hope I can check for libXpm only in the X11 library directory
  926. AC_DEFUN(AC_LIB_XPM, [
  927. AC_MSG_CHECKING(for -lXpm)
  928. AC_CACHE_VAL(ac_cv_has_xpm, [
  929. ac_cv_has_xpm=no
  930. if test x$no_x = xyes; then
  931. :
  932. else
  933. has_xpm_save_LIBS=$LIBS
  934. LIBS="-lXpm $X_EXTRA_LIBS -lX11 $X_PRE_LIBS $LIBS"
  935. has_xpm_save_LDFLAGS=$LDFLAGS
  936. LDFLAGS="$LDFLAGS $X_LIBS"
  937. has_xpm_save_CFLAGS=$CFLAGS
  938. CFLAGS="$CFLAGS $X_CFLAGS"
  939. AC_TRY_LINK([
  940. #include <X11/Xlib.h>
  941. #include <X11/xpm.h>
  942. ], [XpmLibraryVersion();], ac_cv_has_xpm=yes)
  943. CFLAGS="$has_xpm_save_CFLAGS"
  944. LDFLAGS="$has_xpm_save_LDFLAGS"
  945. LIBS="$has_xpm_save_LIBS"
  946. fi
  947. ])
  948. AC_MSG_RESULT($ac_cv_has_xpm)
  949. ])
  950. dnl Hope I can check for libXext only in the X11 library directory
  951. dnl and shape.h will be in X11/extensions/shape.h
  952. AC_DEFUN(AC_X_SHAPE_EXTENSION, [
  953. AC_MSG_CHECKING(for X11 non-rectangular shape extension)
  954. AC_CACHE_VAL(ac_cv_has_shape, [
  955. ac_cv_has_shape=no
  956. if test x$no_x = xyes; then
  957. :
  958. else
  959. has_shape_save_LIBS=$LIBS
  960. LIBS="-lXext $X_EXTRA_LIBS -lX11 $X_PRE_LIBS $LIBS"
  961. has_shape_save_LDFLAGS=$LDFLAGS
  962. LDFLAGS="$LDFLAGS $X_LIBS"
  963. has_shape_save_CFLAGS=$CFLAGS
  964. CFLAGS="$CFLAGS $X_CFLAGS"
  965. AC_TRY_LINK([
  966. #include <X11/Xlib.h>
  967. #include <X11/Xutil.h>
  968. #include <X11/extensions/shape.h>
  969. ], [
  970. Display *dpy = (Display *)NULL;
  971. int a, b;
  972. XShapeQueryVersion(dpy,&a,&b);
  973. ], ac_cv_has_shape=yes)
  974. CFLAGS="$has_shape_save_CFLAGS"
  975. LDFLAGS="$has_shape_save_LDFLAGS"
  976. LIBS="$has_shape_save_LIBS"
  977. fi
  978. ])
  979. AC_MSG_RESULT($ac_cv_has_shape)
  980. ])
  981. dnl AC_TRY_WARNINGS(INCLUDES, FUNCTION-BODY,
  982. dnl ACTION-IF-NO-WARNINGS [, ACTION-IF-WARNINGS-OR-ERROR])
  983. AC_DEFUN(AC_TRY_WARNINGS,
  984. [cat > conftest.$ac_ext <<EOF
  985. dnl This sometimes fails to find confdefs.h, for some reason.
  986. dnl [#]line __oline__ "[$]0"
  987. [#]line __oline__ "configure"
  988. #include "confdefs.h"
  989. [$1]
  990. int main() { return 0; }
  991. int t() {
  992. [$2]
  993. ; return 0; }
  994. EOF
  995. ac_compile_warn='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 2>&1'
  996. if { if eval $ac_compile_warn; then :; else echo arning; fi; } | grep arning 1>&AC_FD_CC 2>&AC_FD_CC; then
  997. ifelse([$4], , :, [rm -rf conftest*
  998. $4])
  999. ifelse([$3], , , [else
  1000. rm -rf conftest*
  1001. $3
  1002. ])dnl
  1003. fi
  1004. rm -f conftest*]
  1005. )
  1006. dnl Find if make is GNU make.
  1007. AC_DEFUN(AC_PROG_GNU_MAKE,
  1008. [AC_MSG_CHECKING(whether we are using GNU make)
  1009. set dummy ${MAKE-make}; ac_make=[$]2
  1010. AC_CACHE_VAL(ac_cv_prog_gnu_make,
  1011. [cat > conftestmake <<\EOF
  1012. all:
  1013. @echo ' '
  1014. EOF
  1015. if ${MAKE-make} --version -f conftestmake 2>/dev/null | grep GNU >/dev/null 2>&1; then
  1016. ac_cv_prog_gnu_make=yes
  1017. else
  1018. ac_cv_prog_gnu_make=no
  1019. fi
  1020. rm -f conftestmake])dnl
  1021. if test $ac_cv_prog_gnu_make = yes; then
  1022. AC_MSG_RESULT(yes)
  1023. GNU_MAKE="GNU_MAKE=yes"
  1024. else
  1025. AC_MSG_RESULT(no)
  1026. GNU_MAKE=
  1027. fi
  1028. AC_SUBST([GNU_MAKE])dnl
  1029. ])
  1030. dnl
  1031. dnl Local additions to Autoconf macros.
  1032. dnl Copyright (C) 1992, 1994, 1995 Free Software Foundation, Inc.
  1033. dnl François Pinard <pinard@iro.umontreal.ca>, 1992.
  1034. dnl ## ----------------------------------------- ##
  1035. dnl ## ANSIfy the C compiler whenever possible. ##
  1036. dnl ## ----------------------------------------- ##
  1037. dnl @defmac AC_PROG_CC_STDC
  1038. dnl @maindex PROG_CC_STDC
  1039. dnl @ovindex CC
  1040. dnl If the C compiler in not in ANSI C mode by default, try to add an option
  1041. dnl to output variable @code{CC} to make it so. This macro tries various
  1042. dnl options that select ANSI C on some system or another. It considers the
  1043. dnl compiler to be in ANSI C mode if it defines @code{__STDC__} to 1 and
  1044. dnl handles function prototypes correctly.
  1045. dnl
  1046. dnl If you use this macro, you should check after calling it whether the C
  1047. dnl compiler has been set to accept ANSI C; if not, the shell variable
  1048. dnl @code{ac_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
  1049. dnl code in ANSI C, you can make an un-ANSIfied copy of it by using the
  1050. dnl program @code{ansi2knr}, which comes with Ghostscript.
  1051. dnl @end defmac
  1052. dnl Unixware 2.1 defines __STDC__ to 1 only when some useful extensions are
  1053. dnl turned off. They are on by default and turned off with the option -Xc.
  1054. dnl The consequence is that __STDC__ is defined but e.g. struct sigaction
  1055. dnl is not defined. -- Norbert
  1056. dnl Below all tests but the one for HP-UX are removed. They caused more
  1057. dnl problems than they soved, sigh. -- Norbert
  1058. AC_DEFUN(MC_HPUX_PROG_CC_STDC,
  1059. [AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
  1060. AC_CACHE_VAL(ac_cv_prog_cc_stdc,
  1061. [ac_cv_prog_cc_stdc=no
  1062. ac_save_CFLAGS="$CFLAGS"
  1063. dnl Don't try gcc -ansi; that turns off useful extensions and
  1064. dnl breaks some systems' header files.
  1065. dnl AIX -qlanglvl=ansi (removed -- Norbert)
  1066. dnl Ultrix and OSF/1 -std1 (removed -- Norbert)
  1067. dnl HP-UX -Aa -D_HPUX_SOURCE
  1068. dnl SVR4 -Xc (removed -- Norbert)
  1069. for ac_arg in "" "-Aa -D_HPUX_SOURCE"
  1070. do
  1071. CFLAGS="$ac_save_CFLAGS $ac_arg"
  1072. AC_TRY_COMPILE(
  1073. [#include <signal.h>
  1074. #if !defined(__STDC__) || __STDC__ != 1
  1075. choke me
  1076. #endif
  1077. ], [int test (int i, double x);
  1078. struct sigaction sa;
  1079. struct s1 {int (*f) (int a);};
  1080. struct s2 {int (*f) (double a);};],
  1081. [ac_cv_prog_cc_stdc="$ac_arg"; break])
  1082. done
  1083. CFLAGS="$ac_save_CFLAGS"
  1084. ])
  1085. AC_MSG_RESULT($ac_cv_prog_cc_stdc)
  1086. case "x$ac_cv_prog_cc_stdc" in
  1087. x|xno) ;;
  1088. *) CC="$CC $ac_cv_prog_cc_stdc" ;;
  1089. esac
  1090. ])