home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 6 File / 06-File.zip / mc454src.zip / mc-4.5.4.src / mc-4.5.4 / aclocal.m4 < prev    next >
M4 Source File  |  1999-01-04  |  72KB  |  2,396 lines

  1. dnl aclocal.m4 generated automatically by aclocal 1.3
  2.  
  3. dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
  4. dnl This Makefile.in is free software; the Free Software Foundation
  5. dnl gives unlimited permission to copy and/or distribute it,
  6. dnl with or without modifications, as long as this notice is preserved.
  7.  
  8. dnl This program is distributed in the hope that it will be useful,
  9. dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
  10. dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  11. dnl PARTICULAR PURPOSE.
  12.  
  13. dnl
  14. dnl XView & SlingShot library checking
  15. dnl (c) 1995 Jakub Jelinek
  16. dnl
  17.  
  18. dnl Set xview_includes, xview_libraries, and no_xview (initially yes).
  19. dnl Also sets xview_no_private_headers to yes if there are no xview_private
  20. dnl headers in the system.
  21. AC_DEFUN(AC_PATH_XVIEW,
  22. [
  23. no_xview=yes
  24. AC_ARG_WITH(xview, [--with-xview              Use the XView toolkit],no_xview=)
  25.  
  26. AC_ARG_WITH(xview-includes, [--with-xview-includes=path  Specifies XView includes directory],
  27. [
  28. if test x$withval = xyes; then
  29.     AC_MSG_WARN(Usage is: --with-xview-includes=path)
  30.     xview_includes=NONE
  31.     no_xview=
  32. else
  33.     xview_includes=$withval
  34. fi
  35. ],
  36. [
  37. xview_includes=NONE
  38. ])dnl
  39. AC_ARG_WITH(xview-libraries, [--with-xview-libraries=path  Specifies XView libraries directory],
  40. [
  41. if test x$withval = xyes; then
  42.     AC_MSG_WARN(Usage is: --with-xview-libraries=path)
  43.     xview_libraries=NONE
  44.     no_xview=
  45. else
  46.     xview_libraries=$withval
  47. fi
  48. ],
  49. [
  50. xview_libraries=NONE
  51. ])dnl
  52.  
  53. if test "$no_xview" != yes; then
  54.     if test "$no_x" = yes; then
  55.         no_xview=yes
  56.     fi
  57. fi
  58. if test "$no_xview" != yes; then
  59. AC_MSG_CHECKING(for XView)
  60. if test x$xview_libraries = xNONE; then 
  61.     if test x$xview_includes = xNONE; then
  62. AC_CACHE_VAL(ac_cv_path_xview,
  63. [
  64.     no_xview=yes
  65. AC_PATH_XVIEW_XMKMF
  66.     if test "x$no_xview" = xyes; then
  67. AC_PATH_XVIEW_DIRECT
  68.     fi
  69.     if test "x$no_xview" = xyes; then
  70.         ac_cv_path_xview="no_xview=yes"
  71.     else
  72.         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"
  73.     fi
  74. ])dnl
  75.         eval "$ac_cv_path_xview"
  76.     fi
  77. fi
  78.  
  79. if test "x$no_xview" = xyes; then
  80.     AC_MSG_RESULT(no)
  81. else
  82.     if test "x$xview_includes" = x || test "x$xview_includes" = xNONE; then
  83.         xview_includes=$ac_xview_includes
  84.     fi
  85.     if test "x$xview_libraries" = x || test "x$xview_libraries" = xNONE; then
  86.         xview_libraries=$ac_xview_libraries
  87.     fi
  88.     xview_no_private_headers=$ac_xview_no_private_headers
  89.     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" 
  90.     if test "x$xview_libraries" != x; then
  91.     ac_msg_xview="libraries $xview_libraries"
  92.     else
  93.         ac_msg_xview=""
  94.     fi
  95.     if test "x$xview_includes" != x; then
  96.         if test "x$ac_msg_xview" != x; then
  97.         ac_msg_xview="$ac_msg_xview, "
  98.     fi
  99.     ac_msg_xview="${ac_msg_xview}headers $xview_includes"
  100.     fi
  101.     if test "x$xview_no_private_headers" = xyes; then
  102.         if test "x$ac_msg_xview" != x; then
  103.         ac_msg_xview="$ac_msg_xview, "
  104.     fi
  105.     ac_msg_xview="${ac_msg_xview}without xview_private headers"
  106.     fi    
  107.     AC_MSG_RESULT([$ac_msg_xview])
  108. fi
  109. fi
  110. ])
  111.  
  112. dnl Internal subroutine of AC_PATH_XVIEW
  113. dnl Set ac_xview_includes, ac_xview_libraries, and no_xview (initially yes).
  114. AC_DEFUN(AC_PATH_XVIEW_XMKMF,
  115. [rm -fr conftestdir
  116. if mkdir conftestdir; then
  117.   cd conftestdir
  118.   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
  119.   cat > Imakefile <<'EOF'
  120. #include <XView.tmpl>
  121. acfindxv:
  122.     @echo 'ac_im_library_dest="${LIBRARY_DEST}"; ac_im_header_dest="${HEADER_DEST}"'
  123. EOF
  124.   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
  125.     no_xview=
  126.     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
  127.     eval `make acfindxv 2>/dev/null | grep -v make`
  128.     # Screen out bogus values from the imake configuration.
  129.     if test -f "$ac_im_header_dest/xview/xview.h"; then
  130.         ac_xview_includes="$ac_im_header_dest"
  131.     else
  132.     no_xview=yes
  133.     fi
  134.     if test -d "$ac_im_library_dest"; then
  135.         ac_xview_libraries="$ac_im_library_dest"
  136.     else
  137.     no_xview=yes
  138.     fi
  139.   fi
  140.   if test "x$no_xview" != xyes; then
  141.     if test -f "$ac_xview_includes/xview_private/draw_impl.h"; then
  142.     ac_xview_no_private_headers=
  143.     else
  144.     ac_xview_no_private_headers=yes
  145.     fi
  146.   fi
  147.   cd ..
  148.   rm -fr conftestdir
  149. fi
  150. ])
  151.  
  152. dnl Internal subroutine of AC_PATH_XVIEW
  153. dnl Set ac_xview_includes, ac_xview_libraries, and no_xview (initially yes).
  154. AC_DEFUN(AC_PATH_XVIEW_DIRECT,
  155. [test -z "$xview_direct_test_library" && xview_direct_test_library=xview
  156. test -z "$xview_direct_test_function" && xview_direct_test_function=xv_unique_key
  157. test -z "$xview_direct_test_include" && xview_direct_test_include=xview/xview.h
  158. AC_TRY_CPP([#include <$xview_direct_test_include>],
  159. [no_xview= ac_xview_includes=],
  160. [  for ac_dir in               \
  161.     $OPENWINHOME/include    \
  162.     /usr/openwin/include      \
  163.     /usr/openwin/share/include \
  164.                               \
  165.     /usr/X11R6/include        \
  166.     /usr/X11R5/include        \
  167.     /usr/X11R4/include        \
  168.                               \
  169.     /usr/include/X11R6        \
  170.     /usr/include/X11R5        \
  171.     /usr/include/X11R4        \
  172.                               \
  173.     /usr/local/X11R6/include  \
  174.     /usr/local/X11R5/include  \
  175.     /usr/local/X11R4/include  \
  176.                               \
  177.     /usr/local/include/X11R6  \
  178.     /usr/local/include/X11R5  \
  179.     /usr/local/include/X11R4  \
  180.                               \
  181.     /usr/X11/include          \
  182.     /usr/include/X11          \
  183.     /usr/local/X11/include    \
  184.     /usr/local/include/X11    \
  185.                               \
  186.     /usr/X386/include         \
  187.     /usr/x386/include         \
  188.     /usr/XFree86/include/X11  \
  189.                               \
  190.     /usr/include              \
  191.     /usr/local/include        \
  192.     /usr/unsupported/include  \
  193.     /usr/athena/include       \
  194.     /usr/local/x11r5/include  \
  195.     /usr/lpp/Xamples/include  \
  196.     ; \
  197.   do
  198.     if test -r "$ac_dir/$xview_direct_test_include"; then
  199.       no_xview= ac_xview_includes=$ac_dir
  200.       break
  201.     fi
  202.   done])
  203.  
  204. if test "x$no_xview" != xyes; then
  205.     if test "x$ac_xview_includes" != x; then
  206.         if test -f "$ac_xview_includes/xview_private/draw_impl.h"; then
  207.         ac_xview_no_private_headers=
  208.         else
  209.         ac_xview_no_private_headers=yes
  210.         fi
  211.     else
  212. AC_TRY_CPP([#include <xview_private/draw_impl.h>],
  213. [ac_xview_no_private_headers=],[ac_xview_no_private_headers=yes])
  214.     fi
  215. fi
  216.  
  217. # Check for the libraries.
  218. # See if we find them without any special options.
  219. # Don't add to $LIBS permanently.
  220. ac_save_LIBS="$LIBS"
  221. ac_save_LDFLAGS="$LDFLAGS"
  222. LDFLAGS="$LDFLAGS $X_LIBS"
  223. LIBS="-l$xview_direct_test_library -lolgx $X_EXTRA_LIBS -lX11 $X_PRE_LIBS $LIBS"
  224. AC_TRY_LINK([#include <$xview_direct_test_include>
  225. ], [${xview_direct_test_function}()],
  226. [LIBS="$ac_save_LIBS" LDFLAGS="$ac_save_LDFLAGS" no_xview= ac_xview_libraries=],
  227. [LIBS="$ac_save_LIBS" LDFLAGS="$ac_save_LDFLAGS"
  228. # First see if replacing the include by lib works.
  229. for ac_dir in `echo "$ac_xview_includes" | sed s/include/lib/` \
  230.     $OPENWINHOME/lib    \
  231.     $OPENWINHOME/share/lib \
  232.     /usr/openwin/lib      \
  233.     /usr/openwin/share/lib \
  234.                           \
  235.     /usr/X11R6/lib        \
  236.     /usr/X11R5/lib        \
  237.     /usr/X11R4/lib        \
  238.                           \
  239.     /usr/lib/X11R6        \
  240.     /usr/lib/X11R5        \
  241.     /usr/lib/X11R4        \
  242.                           \
  243.     /usr/local/X11R6/lib  \
  244.     /usr/local/X11R5/lib  \
  245.     /usr/local/X11R4/lib  \
  246.                           \
  247.     /usr/local/lib/X11R6  \
  248.     /usr/local/lib/X11R5  \
  249.     /usr/local/lib/X11R4  \
  250.                           \
  251.     /usr/X11/lib          \
  252.     /usr/lib/X11          \
  253.     /usr/local/X11/lib    \
  254.     /usr/local/lib/X11    \
  255.                           \
  256.     /usr/X386/lib         \
  257.     /usr/x386/lib         \
  258.     /usr/XFree86/lib/X11  \
  259.                           \
  260.     /usr/lib              \
  261.     /usr/local/lib        \
  262.     /usr/unsupported/lib  \
  263.     /usr/athena/lib       \
  264.     /usr/local/x11r5/lib  \
  265.     /usr/lpp/Xamples/lib  \
  266.     ; \
  267. do
  268.   for ac_extension in a so sl; do
  269.     if test -r $ac_dir/lib${xview_direct_test_library}.$ac_extension; then
  270.       no_xview= ac_xview_libraries=$ac_dir
  271.       break 2
  272.     fi
  273.   done
  274. done])])
  275.  
  276. dnl Substitute XVIEW_LIBS and XVIEW_CFLAGS and 
  277. dnl HAVE_XVIEW, which is either yes or no.
  278. dnl Both contain X_LIBS resp. X_CFLAGS inside
  279. dnl Also substitutes HAVE_XVIEW_PRIVATE_HEADERS
  280. dnl if there are xview_private headers in the system
  281. AC_DEFUN(AC_PATH_XVIEW_XTRA,
  282. [AC_REQUIRE([AC_PATH_XVIEW])dnl
  283. if test "$no_xview" = yes; then 
  284.   # Not all programs may use this symbol, but it does not hurt to define it.
  285.   XVIEW_CFLAGS="$X_CFGLAGS $XVIEW_CFLAGS -DXVIEW_MISSING"
  286. else
  287.   if test -n "$xview_includes"; then
  288.     XVIEW_CFLAGS="$X_CFLAGS $XVIEW_CFGLAGS"
  289.     if test "$xview_includes" != "$x_includes"; then
  290.       XVIEW_CPPFLAGS="-I$xview_includes"
  291.     fi
  292.   fi
  293.  
  294.   # It would be nice to have a more robust check for the -R ld option than
  295.   # just checking for Solaris.
  296.   # It would also be nice to do this for all -L options, not just this one.
  297.   if test -n "$xview_libraries"; then
  298.     if test "$xview_libraries" = "$x_libraries"; then
  299.       XVIEW_LIBS="$X_LIBS $XVIEW_LIBS"
  300.     else
  301.       XVIEW_LIBS="$X_LIBS $XVIEW_LIBS -L$xview_libraries"
  302.       if test "`(uname) 2>/dev/null`" = SunOS &&
  303.         uname -r | grep '^5' >/dev/null; then
  304.         XVIEW_LIBS="$XVIEW_LIBS -R$xview_libraries"
  305.       fi
  306.     fi
  307.   fi
  308. fi
  309. if test "x$no_xview" = xyes; then
  310.   HAVE_XVIEW=no
  311. else
  312.   HAVE_XVIEW=yes
  313. fi
  314. if test "x$xview_no_private_headers" = xyes; then
  315.   HAVE_XVIEW_PRIVATE_HEADERS=no
  316. else
  317.   HAVE_XVIEW_PRIVATE_HEADERS=yes
  318. fi
  319. AC_SUBST(XVIEW_CFLAGS)dnl
  320. AC_SUBST(XVIEW_CPPFLAGS)dnl
  321. AC_SUBST(XVIEW_LIBS)dnl
  322. AC_SUBST(HAVE_XVIEW)dnl
  323. AC_SUBST(HAVE_XVIEW_PRIVATE_HEADERS)dnl
  324. ])dnl
  325.  
  326. dnl Internal subroutine of AC_PATH_SLINGSHOT
  327. AC_DEFUN(AC_PATH_SLINGSHOT_DIRECT,
  328. [
  329. AC_TRY_CPP([#include <sspkg/rectobj.h>],[no_ss= ac_ss_includes=],
  330. [  for ac_dir in               \
  331.     $OPENWINHOME/include    \
  332.     /usr/openwin/include      \
  333.     /usr/openwin/share/include \
  334.                               \
  335.     /usr/X11R6/include        \
  336.     /usr/X11R5/include        \
  337.     /usr/X11R4/include        \
  338.                               \
  339.     /usr/include/X11R6        \
  340.     /usr/include/X11R5        \
  341.     /usr/include/X11R4        \
  342.                               \
  343.     /usr/local/X11R6/include  \
  344.     /usr/local/X11R5/include  \
  345.     /usr/local/X11R4/include  \
  346.                               \
  347.     /usr/local/include/X11R6  \
  348.     /usr/local/include/X11R5  \
  349.     /usr/local/include/X11R4  \
  350.                               \
  351.     /usr/X11/include          \
  352.     /usr/include/X11          \
  353.     /usr/local/X11/include    \
  354.     /usr/local/include/X11    \
  355.                               \
  356.     /usr/X386/include         \
  357.     /usr/x386/include         \
  358.     /usr/XFree86/include/X11  \
  359.                               \
  360.     /usr/include              \
  361.     /usr/local/include        \
  362.     /usr/unsupported/include  \
  363.     /usr/athena/include       \
  364.     /usr/local/x11r5/include  \
  365.     /usr/lpp/Xamples/include  \
  366.     ; \
  367.   do
  368.     if test -r "$ac_dir/sspkg/rectobj.h"; then
  369.       no_ss= ac_ss_includes=$ac_dir
  370.       break
  371.     fi
  372.   done])
  373.  
  374. # Check for the libraries.
  375. # See if we find them without any special options.
  376. # Don't add to $LIBS permanently.
  377. ac_save_LIBS="$LIBS"
  378. ac_save_LDFLAGS="$LDFLAGS"
  379. LDFLAGS="$LDFLAGS $XVIEW_LIBS"
  380. LIBS="-lsspkg -lm -lxview -lolgx $X_EXTRA_LIBS -lX11 $X_PRE_LIBS $LIBS"
  381. AC_TRY_LINK([#include <sspkg/rectobj.h>
  382. ], [rectobj_get_selected_list()],
  383. [LIBS="$ac_save_LIBS" LDFLAGS="$ac_save_LDFLAGS" no_ss= ac_ss_libraries=],
  384. [LIBS="$ac_save_LIBS" LDFLAGS="$ac_save_LDFLAGS"
  385. # First see if replacing the include by lib works.
  386. for ac_dir in `echo "$ac_ss_includes" | sed s/include/lib/` \
  387.     $OPENWINHOME/lib    \
  388.     $OPENWINHOME/share/lib \
  389.     /usr/openwin/lib      \
  390.     /usr/openwin/share/lib \
  391.                           \
  392.     /usr/X11R6/lib        \
  393.     /usr/X11R5/lib        \
  394.     /usr/X11R4/lib        \
  395.                           \
  396.     /usr/lib/X11R6        \
  397.     /usr/lib/X11R5        \
  398.     /usr/lib/X11R4        \
  399.                           \
  400.     /usr/local/X11R6/lib  \
  401.     /usr/local/X11R5/lib  \
  402.     /usr/local/X11R4/lib  \
  403.                           \
  404.     /usr/local/lib/X11R6  \
  405.     /usr/local/lib/X11R5  \
  406.     /usr/local/lib/X11R4  \
  407.                           \
  408.     /usr/X11/lib          \
  409.     /usr/lib/X11          \
  410.     /usr/local/X11/lib    \
  411.     /usr/local/lib/X11    \
  412.                           \
  413.     /usr/X386/lib         \
  414.     /usr/x386/lib         \
  415.     /usr/XFree86/lib/X11  \
  416.                           \
  417.     /usr/lib              \
  418.     /usr/local/lib        \
  419.     /usr/unsupported/lib  \
  420.     /usr/athena/lib       \
  421.     /usr/local/x11r5/lib  \
  422.     /usr/lpp/Xamples/lib  \
  423.     ; \
  424. do
  425.   for ac_extension in a so sl; do
  426.     if test -r $ac_dir/libsspkg.$ac_extension; then
  427.       no_ss= ac_ss_libraries=$ac_dir
  428.       break 2
  429.     fi
  430.   done
  431. done])])
  432.  
  433. dnl Set ss_includes, ss_libraries, and no_ss (initially yes).
  434. AC_DEFUN(AC_PATH_SLINGSHOT,
  435. [AC_REQUIRE([AC_PATH_XVIEW_XTRA])dnl
  436. AC_MSG_CHECKING(for SlingShot)
  437. AC_ARG_WITH(ss, [--with-ss         Use the SlingShot extension])
  438.  
  439. AC_ARG_WITH(ss-includes, [--with-ss-includes=path  Specifies SlingShot includes directory],
  440. [
  441. if test x$withval = xyes; then
  442.     AC_MSG_WARN(Usage is: --with-ss-includes=path)
  443.     ss_includes=NONE
  444. else
  445.     ss_includes=$withval
  446. fi
  447. ],
  448. [
  449. ss_includes=NONE
  450. ])dnl
  451. AC_ARG_WITH(ss-libraries, [--with-ss-libraries=path  Specifies SlingShot libraries directory],
  452. [
  453. if test x$withval = xyes; then
  454.     AC_MSG_WARN(Usage is: --with-ss-libraries=path)
  455.     ss_libraries=NONE
  456. else
  457.     ss_libraries=$withval
  458. fi
  459. ],
  460. [
  461. ss_libraries=NONE
  462. ])dnl
  463.  
  464. if test "x$with_ss" = xno; then
  465.     no_ss=yes
  466. else
  467.     if test "x$ss_includes" != xNONE && test "x$ss_libraries" != xNONE; then
  468.         no_ss=
  469.     else
  470. AC_CACHE_VAL(ac_cv_path_ss,
  471. [
  472.     no_ss=yes
  473. AC_PATH_SLINGSHOT_DIRECT
  474.     if test "x$no_ss" = xyes; then
  475.         ac_cv_path_ss="ac_noss=yes"
  476.     else
  477.         ac_cv_path_ss="ac_ss_includes=$ac_ss_includes ac_ss_libraries=$ac_ss_libraries"
  478.     fi
  479. ])dnl
  480.         eval "$ac_cv_path_ss"
  481.     fi
  482. fi
  483. fi
  484. if test "x$no_ss" = xyes; then
  485.     AC_MSG_RESULT(no)
  486. else
  487.     if test "x$ss_includes" = x || test "x$ss_includes" = xNONE; then
  488.         ss_includes=$ac_ss_includes
  489.     fi
  490.     if test "x$ss_libraries" = x || test "x$ss_libraries" = xNONE; then
  491.         ss_libraries=$ac_ss_libraries
  492.     fi
  493.     ac_cv_path_ss="no_ss= ac_ss_includes=$ss_includes ac_ss_libraries=$ss_libraries" 
  494.     if test "x$ss_libraries" = x; then
  495.         if test "x$ss_includes" = x; then
  496.         AC_MSG_RESULT(yes)
  497.     else
  498.             AC_MSG_RESULT([headers $ss_includes])
  499.     fi
  500.     else
  501.         if test "x$ss_includes" = x; then
  502.             AC_MSG_RESULT([libraries $ss_libraries])
  503.     else
  504.             AC_MSG_RESULT([libraries $ss_libraries, headers $ss_includes])
  505.     fi
  506.     fi
  507. fi
  508. ])
  509.  
  510. dnl Substitute SLINGSHOT_LIBS and SLINGSHOT_CFLAGS and 
  511. dnl HAVE_SLINGSHOT, which is either yes or no.
  512. dnl Both contain XVIEW_LIBS resp. XVIEW_CFLAGS inside
  513. AC_DEFUN(AC_PATH_SLINGSHOT_XTRA,
  514. [AC_REQUIRE([AC_PATH_SLINGSHOT])dnl
  515. if test "$no_ss" = yes; then 
  516.   # Not all programs may use this symbol, but it does not hurt to define it.
  517.   SLINGSHOT_CFLAGS="$XVIEW_CFGLAGS $SLINGSHOT_CFLAGS -DSLINGSHOT_MISSING"
  518. else
  519.   if test -n "$ss_includes"; then
  520.     SLINGSHOT_CFLAGS="$XVIEW_CFLAGS $SLINGSHOT_CFGLAGS -I$ss_includes"
  521.   fi
  522.  
  523.   # It would be nice to have a more robust check for the -R ld option than
  524.   # just checking for Solaris.
  525.   # It would also be nice to do this for all -L options, not just this one.
  526.   if test -n "$ss_libraries"; then
  527.     SLINGSHOT_LIBS="$XVIEW_LIBS $SLINGSHOT_LIBS -L$ss_libraries"
  528.     if test "`(uname) 2>/dev/null`" = SunOS &&
  529.       uname -r | grep '^5' >/dev/null; then
  530.       SLINGSHOT_LIBS="$SLINGSHOT_LIBS -R$ss_libraries"
  531.     fi
  532.   fi
  533. fi
  534. if test "x$no_ss" = xyes; then
  535.   HAVE_SLINGSHOT=no
  536. else
  537.   HAVE_SLINGSHOT=yes
  538. fi
  539. AC_SUBST(SLINGSHOT_CFLAGS)dnl
  540. AC_SUBST(SLINGSHOT_LIBS)dnl
  541. AC_SUBST(HAVE_SLINGSHOT)dnl
  542. ])dnl
  543.  
  544. dnl
  545. dnl XView library checking end
  546. dnl
  547.  
  548. dnl
  549. dnl Check for size of d_name dirent member
  550. dnl
  551. AC_DEFUN(AC_SHORT_D_NAME_LEN, [
  552. AC_MSG_CHECKING(filename fits on dirent.d_name)
  553. AC_CACHE_VAL(ac_cv_dnamesize, [
  554. OCFLAGS="$CFLAGS"
  555. CFLAGS="$CFLAGS -I$srcdir"
  556. AC_TRY_RUN([
  557. #include <src/fs.h>
  558.  
  559. main ()
  560. {
  561.    struct dirent ddd;
  562.  
  563.    if (sizeof (ddd.d_name) < 12)
  564.     exit (0);
  565.    else
  566.        exit (1); 
  567. }
  568.  
  569. ],[
  570.     ac_cv_dnamesize="no"
  571. ], [
  572.     ac_cv_dnamesize="yes"
  573. ], [
  574. # Cannot find out, so assume no
  575.     ac_cv_dnamesize="no"
  576. ])
  577. CFLAGS="$OCFLAGS"
  578. ])
  579. if test x$ac_cv_dnamesize = xno; then
  580.     AC_DEFINE(NEED_EXTRA_DIRENT_BUFFER)
  581. fi
  582. AC_MSG_RESULT($ac_cv_dnamesize)
  583. ])
  584.  
  585. dnl
  586. dnl Filesystem information detection
  587. dnl
  588. dnl To get information about the disk, mount points, etc.
  589. dnl
  590.  
  591. AC_DEFUN(AC_GET_FS_INFO, [
  592.     AC_CHECK_HEADERS(fcntl.h sys/dustat.h sys/param.h sys/statfs.h sys/fstyp.h)
  593.     AC_CHECK_HEADERS(mnttab.h mntent.h utime.h sys/statvfs.h sys/vfs.h)
  594.     AC_CHECK_HEADERS(sys/mount.h sys/filsys.h sys/fs_types.h)
  595.     AC_CHECK_FUNCS(getmntinfo)
  596.  
  597.     dnl This configure.in code has been stolen from GNU fileutils-3.12.  Its
  598.     dnl job is to detect a method to get list of mounted filesystems.
  599.  
  600.     AC_MSG_CHECKING([for d_ino member in directory struct])
  601.     AC_CACHE_VAL(fu_cv_sys_d_ino_in_dirent,
  602.     [AC_TRY_LINK([
  603. #include <sys/types.h>
  604. #ifdef HAVE_DIRENT_H
  605. # include <dirent.h>
  606. #else /* not HAVE_DIRENT_H */
  607. # define dirent direct
  608. # ifdef HAVE_SYS_NDIR_H
  609. #  include <sys/ndir.h>
  610. # endif /* HAVE_SYS_NDIR_H */
  611. # ifdef HAVE_SYS_DIR_H
  612. #  include <sys/dir.h>
  613. # endif /* HAVE_SYS_DIR_H */
  614. # ifdef HAVE_NDIR_H
  615. #  include <ndir.h>
  616. # endif /* HAVE_NDIR_H */
  617. #endif /* HAVE_DIRENT_H */
  618.     ],
  619.       [struct dirent dp; dp.d_ino = 0;],
  620.     fu_cv_sys_d_ino_in_dirent=yes,
  621.     fu_cv_sys_d_ino_in_dirent=no)])
  622.     AC_MSG_RESULT($fu_cv_sys_d_ino_in_dirent)
  623.     if test $fu_cv_sys_d_ino_in_dirent = yes; then
  624.       AC_DEFINE(D_INO_IN_DIRENT)
  625.     fi
  626.  
  627.     # Determine how to get the list of mounted filesystems.
  628.     list_mounted_fs=
  629.  
  630.     # If the getmntent function is available but not in the standard library,
  631.     # make sure LIBS contains -lsun (on Irix4) or -lseq (on PTX).
  632.     AC_FUNC_GETMNTENT
  633.  
  634.     if test $ac_cv_func_getmntent = yes; then
  635.  
  636.       # This system has the getmntent function.
  637.       # Determine whether it's the one-argument variant or the two-argument one.
  638.  
  639.       if test -z "$list_mounted_fs"; then
  640.     # SVR4
  641.     AC_MSG_CHECKING([for two-argument getmntent function])
  642.     AC_CACHE_VAL(fu_cv_sys_mounted_getmntent2,
  643.     [AC_EGREP_HEADER(getmntent, sys/mnttab.h,
  644.       fu_cv_sys_mounted_getmntent2=yes,
  645.       fu_cv_sys_mounted_getmntent2=no)])
  646.     AC_MSG_RESULT($fu_cv_sys_mounted_getmntent2)
  647.     if test $fu_cv_sys_mounted_getmntent2 = yes; then
  648.       list_mounted_fs=found
  649.       AC_DEFINE(MOUNTED_GETMNTENT2)
  650.     fi
  651.       fi
  652.  
  653.       if test -z "$list_mounted_fs"; then
  654.     # 4.3BSD, SunOS, HP-UX, Dynix, Irix
  655.     AC_MSG_CHECKING([for one-argument getmntent function])
  656.     AC_CACHE_VAL(fu_cv_sys_mounted_getmntent1,
  657.              [test $ac_cv_header_mntent_h = yes \
  658.                && fu_cv_sys_mounted_getmntent1=yes \
  659.                || fu_cv_sys_mounted_getmntent1=no])
  660.     AC_MSG_RESULT($fu_cv_sys_mounted_getmntent1)
  661.     if test $fu_cv_sys_mounted_getmntent1 = yes; then
  662.       list_mounted_fs=found
  663.       AC_DEFINE(MOUNTED_GETMNTENT1)
  664.     fi
  665.       fi
  666.  
  667.       if test -z "$list_mounted_fs"; then
  668.     AC_WARN([could not determine how to read list of mounted fs])
  669.     CPPFLAGS="$CPPFLAGS -DNO_INFOMOUNT"
  670.       fi
  671.  
  672.     fi
  673.  
  674.     if test -z "$list_mounted_fs"; then
  675.       # DEC Alpha running OSF/1.
  676.       AC_MSG_CHECKING([for getfsstat function])
  677.       AC_CACHE_VAL(fu_cv_sys_mounted_getsstat,
  678.       [AC_TRY_LINK([
  679. #include <sys/types.h>
  680. #include <sys/mount.h>
  681. #include <sys/fs_types.h>],
  682.       [struct statfs *stats;
  683.       numsys = getfsstat ((struct statfs *)0, 0L, MNT_WAIT); ],
  684.     fu_cv_sys_mounted_getsstat=yes,
  685.     fu_cv_sys_mounted_getsstat=no)])
  686.       AC_MSG_RESULT($fu_cv_sys_mounted_getsstat)
  687.       if test $fu_cv_sys_mounted_getsstat = yes; then
  688.     list_mounted_fs=found
  689.     AC_DEFINE(MOUNTED_GETFSSTAT)
  690.       fi
  691.     fi
  692.  
  693.     if test -z "$list_mounted_fs"; then
  694.       # AIX.
  695.       AC_MSG_CHECKING([for mntctl function and struct vmount])
  696.       AC_CACHE_VAL(fu_cv_sys_mounted_vmount,
  697.       [AC_TRY_CPP([#include <fshelp.h>],
  698.     fu_cv_sys_mounted_vmount=yes,
  699.     fu_cv_sys_mounted_vmount=no)])
  700.       AC_MSG_RESULT($fu_cv_sys_mounted_vmount)
  701.       if test $fu_cv_sys_mounted_vmount = yes; then
  702.     list_mounted_fs=found
  703.     AC_DEFINE(MOUNTED_VMOUNT)
  704.       fi
  705.     fi
  706.  
  707.     if test -z "$list_mounted_fs"; then
  708.       # SVR3
  709.       AC_MSG_CHECKING([for existence of three headers])
  710.       AC_CACHE_VAL(fu_cv_sys_mounted_fread_fstyp,
  711.     [AC_TRY_CPP([
  712. #include <sys/statfs.h>
  713. #include <sys/fstyp.h>
  714. #include <mnttab.h>],
  715.             fu_cv_sys_mounted_fread_fstyp=yes,
  716.             fu_cv_sys_mounted_fread_fstyp=no)])
  717.       AC_MSG_RESULT($fu_cv_sys_mounted_fread_fstyp)
  718.       if test $fu_cv_sys_mounted_fread_fstyp = yes; then
  719.     list_mounted_fs=found
  720.     AC_DEFINE(MOUNTED_FREAD_FSTYP)
  721.       fi
  722.     fi
  723.  
  724.     if test -z "$list_mounted_fs"; then
  725.       # 4.4BSD and DEC OSF/1.
  726.       AC_MSG_CHECKING([for getmntinfo function])
  727.       AC_CACHE_VAL(fu_cv_sys_mounted_getmntinfo,
  728.     [
  729.       ok=
  730.       if test $ac_cv_func_getmntinfo = yes; then
  731.         AC_EGREP_HEADER(f_type;, sys/mount.h,
  732.                 ok=yes)
  733.       fi
  734.       test -n "$ok" \
  735.           && fu_cv_sys_mounted_getmntinfo=yes \
  736.           || fu_cv_sys_mounted_getmntinfo=no
  737.     ])
  738.       AC_MSG_RESULT($fu_cv_sys_mounted_getmntinfo)
  739.       if test $fu_cv_sys_mounted_getmntinfo = yes; then
  740.     list_mounted_fs=found
  741.     AC_DEFINE(MOUNTED_GETMNTINFO)
  742.       fi
  743.     fi
  744.  
  745.     # FIXME: add a test for netbsd-1.1 here
  746.  
  747.     if test -z "$list_mounted_fs"; then
  748.       # Ultrix
  749.       AC_MSG_CHECKING([for getmnt function])
  750.       AC_CACHE_VAL(fu_cv_sys_mounted_getmnt,
  751.     [AC_TRY_CPP([
  752. #include <sys/fs_types.h>
  753. #include <sys/mount.h>],
  754.             fu_cv_sys_mounted_getmnt=yes,
  755.             fu_cv_sys_mounted_getmnt=no)])
  756.       AC_MSG_RESULT($fu_cv_sys_mounted_getmnt)
  757.       if test $fu_cv_sys_mounted_getmnt = yes; then
  758.     list_mounted_fs=found
  759.     AC_DEFINE(MOUNTED_GETMNT)
  760.       fi
  761.     fi
  762.  
  763.     if test -z "$list_mounted_fs"; then
  764.       # SVR2
  765.     AC_MSG_CHECKING([whether it is possible to resort to fread on /etc/mnttab])
  766.       AC_CACHE_VAL(fu_cv_sys_mounted_fread,
  767.     [AC_TRY_CPP([#include <mnttab.h>],
  768.             fu_cv_sys_mounted_fread=yes,
  769.             fu_cv_sys_mounted_fread=no)])
  770.       AC_MSG_RESULT($fu_cv_sys_mounted_fread)
  771.       if test $fu_cv_sys_mounted_fread = yes; then
  772.     list_mounted_fs=found
  773.     AC_DEFINE(MOUNTED_FREAD)
  774.       fi
  775.     fi
  776.  
  777.     if test -z "$list_mounted_fs"; then
  778.       AC_MSG_WARN([could not determine how to read list of mounted fs])
  779.       CPPFLAGS="$CPPFLAGS -DNO_INFOMOUNT"
  780.       # FIXME -- no need to abort building the whole package
  781.       # Can't build mountlist.c or anything that needs its functions
  782.     fi
  783.  
  784. dnl This configure.in code has been stolen from GNU fileutils-3.12.  Its
  785. dnl job is to detect a method to get file system information.
  786.  
  787.     AC_CHECKING(how to get filesystem space usage)
  788.     space=no
  789.  
  790.     # Here we'll compromise a little (and perform only the link test)
  791.     # since it seems there are no variants of the statvfs function.
  792.     if test $space = no; then
  793.       # SVR4
  794.       AC_CHECK_FUNCS(statvfs)
  795.       if test $ac_cv_func_statvfs = yes; then
  796.     space=yes
  797.     AC_DEFINE(STAT_STATVFS)
  798.       fi
  799.     fi
  800.  
  801.     if test $space = no; then
  802.       # DEC Alpha running OSF/1
  803.       AC_MSG_CHECKING([for 3-argument statfs function (DEC OSF/1)])
  804.       AC_CACHE_VAL(fu_cv_sys_stat_statfs3_osf1,
  805.       [AC_TRY_RUN([
  806. #include <sys/param.h>
  807. #include <sys/types.h>
  808. #include <sys/mount.h>
  809.       main ()
  810.       {
  811.     struct statfs fsd;
  812.     fsd.f_fsize = 0;
  813.     exit (statfs (".", &fsd, sizeof (struct statfs)));
  814.       }],
  815.       fu_cv_sys_stat_statfs3_osf1=yes,
  816.       fu_cv_sys_stat_statfs3_osf1=no,
  817.       fu_cv_sys_stat_statfs3_osf1=no)])
  818.       AC_MSG_RESULT($fu_cv_sys_stat_statfs3_osf1)
  819.       if test $fu_cv_sys_stat_statfs3_osf1 = yes; then
  820.     space=yes
  821.     AC_DEFINE(STAT_STATFS3_OSF1)
  822.       fi
  823.     fi
  824.  
  825.     if test $space = no; then
  826.     # AIX
  827.       AC_MSG_CHECKING([for two-argument statfs with statfs.bsize member (AIX, 4.3BSD)])
  828.       AC_CACHE_VAL(fu_cv_sys_stat_statfs2_bsize,
  829.       [AC_TRY_RUN([
  830. #ifdef HAVE_SYS_PARAM_H
  831. #include <sys/param.h>
  832. #endif
  833. #ifdef HAVE_SYS_MOUNT_H
  834. #include <sys/mount.h>
  835. #endif
  836. #ifdef HAVE_SYS_VFS_H
  837. #include <sys/vfs.h>
  838. #endif
  839.       main ()
  840.       {
  841.       struct statfs fsd;
  842.       fsd.f_bsize = 0;
  843.       exit (statfs (".", &fsd));
  844.       }],
  845.       fu_cv_sys_stat_statfs2_bsize=yes,
  846.       fu_cv_sys_stat_statfs2_bsize=no,
  847.       fu_cv_sys_stat_statfs2_bsize=no)])
  848.       AC_MSG_RESULT($fu_cv_sys_stat_statfs2_bsize)
  849.       if test $fu_cv_sys_stat_statfs2_bsize = yes; then
  850.     space=yes
  851.     AC_DEFINE(STAT_STATFS2_BSIZE)
  852.       fi
  853.     fi
  854.  
  855.     if test $space = no; then
  856.     # SVR3
  857.       AC_MSG_CHECKING([for four-argument statfs (AIX-3.2.5, SVR3)])
  858.       AC_CACHE_VAL(fu_cv_sys_stat_statfs4,
  859.       [AC_TRY_RUN([#include <sys/types.h>
  860. #include <sys/statfs.h>
  861.       main ()
  862.       {
  863.       struct statfs fsd;
  864.       exit (statfs (".", &fsd, sizeof fsd, 0));
  865.       }],
  866.     fu_cv_sys_stat_statfs4=yes,
  867.     fu_cv_sys_stat_statfs4=no,
  868.     fu_cv_sys_stat_statfs4=no)])
  869.       AC_MSG_RESULT($fu_cv_sys_stat_statfs4)
  870.       if test $fu_cv_sys_stat_statfs4 = yes; then
  871.     space=yes
  872.     AC_DEFINE(STAT_STATFS4)
  873.       fi
  874.     fi
  875.  
  876.     if test $space = no; then
  877.     # 4.4BSD and NetBSD
  878.       AC_MSG_CHECKING([for two-argument statfs with statfs.fsize dnl
  879.     member (4.4BSD and NetBSD)])
  880.       AC_CACHE_VAL(fu_cv_sys_stat_statfs2_fsize,
  881.       [AC_TRY_RUN([#include <sys/types.h>
  882. #ifdef HAVE_SYS_PARAM_H
  883. #include <sys/param.h>
  884. #endif
  885. #ifdef HAVE_SYS_MOUNT_H
  886. #include <sys/mount.h>
  887. #endif
  888.       main ()
  889.       {
  890.       struct statfs fsd;
  891.       fsd.f_fsize = 0;
  892.       exit (statfs (".", &fsd));
  893.       }],
  894.       fu_cv_sys_stat_statfs2_fsize=yes,
  895.       fu_cv_sys_stat_statfs2_fsize=no,
  896.       fu_cv_sys_stat_statfs2_fsize=no)])
  897.       AC_MSG_RESULT($fu_cv_sys_stat_statfs2_fsize)
  898.       if test $fu_cv_sys_stat_statfs2_fsize = yes; then
  899.     space=yes
  900.     AC_DEFINE(STAT_STATFS2_FSIZE)
  901.       fi
  902.     fi
  903.  
  904.     if test $space = no; then
  905.       # Ultrix
  906.       AC_MSG_CHECKING([for two-argument statfs with struct fs_data (Ultrix)])
  907.       AC_CACHE_VAL(fu_cv_sys_stat_fs_data,
  908.       [AC_TRY_RUN([
  909. #include <sys/types.h>
  910. #ifdef HAVE_SYS_PARAM_H
  911. #include <sys/param.h>
  912. #endif
  913. #ifdef HAVE_SYS_MOUNT_H
  914. #include <sys/mount.h>
  915. #endif
  916. #ifdef HAVE_SYS_FS_TYPES_H
  917. #include <sys/fs_types.h>
  918. #endif
  919.       main ()
  920.       {
  921.       struct fs_data fsd;
  922.       /* Ultrix's statfs returns 1 for success,
  923.      0 for not mounted, -1 for failure.  */
  924.       exit (statfs (".", &fsd) != 1);
  925.       }],
  926.       fu_cv_sys_stat_fs_data=yes,
  927.       fu_cv_sys_stat_fs_data=no,
  928.       fu_cv_sys_stat_fs_data=no)])
  929.       AC_MSG_RESULT($fu_cv_sys_stat_fs_data)
  930.       if test $fu_cv_sys_stat_fs_data = yes; then
  931.     space=yes
  932.     AC_DEFINE(STAT_STATFS2_FS_DATA)
  933.       fi
  934.     fi
  935.  
  936.     dnl Not supported
  937.     dnl if test $space = no; then
  938.     dnl # SVR2
  939.     dnl AC_TRY_CPP([#include <sys/filsys.h>],
  940.     dnl   AC_DEFINE(STAT_READ_FILSYS) space=yes)
  941.     dnl fi
  942. ])
  943.  
  944. dnl AC_CHECK_HEADER_IN_PATH(HEADER-FILE, ADDITIONAL_PATH, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
  945. AC_DEFUN(AC_CHECK_HEADER_IN_PATH,
  946. [dnl Do the transliteration at runtime so arg 1 can be a shell variable.
  947. ac_safe=`echo "$1" | tr './\055' '___'`
  948. AC_MSG_CHECKING([for $1])
  949. AC_CACHE_VAL(ac_cv_header_in_path_$ac_safe,
  950. [AC_TRY_CPP([#include <$1>], ac_header_in_path=yes, [
  951.   ac_header_in_path_found=no
  952.   for ac_header_in_path_value in [$2]; do
  953.     ac_in_path_save_CPPFLAGS=$CPPFLAGS
  954.     CPPFLAGS="$CPPFLAGS -I$ac_header_in_path_value"
  955.     AC_TRY_CPP([#include <$1>], [
  956. ac_header_in_path_found=yes
  957. ac_header_in_path=$ac_header_in_path_value
  958. ], )
  959.     CPPFLAGS=$ac_in_path_save_CPPFLAGS
  960.     if test x$ac_header_in_path_found = xyes; then
  961.         break
  962.     fi
  963.   done
  964.   if test $ac_header_in_path_found = xno; then
  965.     ac_header_in_path=no
  966.   fi
  967. ])
  968.   eval "ac_cv_header_in_path_$ac_safe=$ac_header_in_path"
  969. ])dnl
  970. eval "ac_header_in_path=`echo '$ac_cv_header_in_path_'$ac_safe`"
  971. if test "$ac_header_in_path" = no; then
  972.   AC_MSG_RESULT(no)
  973. ifelse([$4], , , [$4
  974. ])dnl
  975. else
  976.   if test -n "$ac_header_in_path"; then
  977.       AC_MSG_RESULT($ac_header_in_path)
  978.   else
  979.       AC_MSG_RESULT(yes)
  980.   fi
  981.   if test x$ac_header_in_path = xyes; then
  982.       ac_header_in_path=
  983.       eval "ac_cv_header_in_path_$ac_safe="
  984.   fi
  985.   ifelse([$3], , , [$3
  986. ])dnl
  987. fi
  988. ])
  989.  
  990. dnl Hope I can check for libXpm only in the X11 library directory
  991. AC_DEFUN(AC_LIB_XPM, [
  992. AC_MSG_CHECKING(for -lXpm)
  993. AC_CACHE_VAL(ac_cv_has_xpm, [
  994.     ac_cv_has_xpm=no
  995.     if test x$no_x = xyes; then
  996.     :
  997.     else
  998.         has_xpm_save_LIBS=$LIBS
  999.     LIBS="-lXpm $X_EXTRA_LIBS -lX11 $X_PRE_LIBS $LIBS"
  1000.     has_xpm_save_LDFLAGS=$LDFLAGS
  1001.     LDFLAGS="$LDFLAGS $X_LIBS"
  1002.     has_xpm_save_CFLAGS=$CFLAGS
  1003.     CFLAGS="$CFLAGS $X_CFLAGS"
  1004.     AC_TRY_LINK([
  1005. #include <X11/Xlib.h>
  1006. #include <X11/xpm.h>
  1007. ], [XpmLibraryVersion();], ac_cv_has_xpm=yes)
  1008.     CFLAGS="$has_xpm_save_CFLAGS"
  1009.     LDFLAGS="$has_xpm_save_LDFLAGS"
  1010.     LIBS="$has_xpm_save_LIBS"
  1011.     fi
  1012. ])
  1013. AC_MSG_RESULT($ac_cv_has_xpm)
  1014. ])
  1015.  
  1016. dnl Hope I can check for libXext only in the X11 library directory
  1017. dnl and shape.h will be in X11/extensions/shape.h
  1018. AC_DEFUN(AC_X_SHAPE_EXTENSION, [
  1019. AC_MSG_CHECKING(for X11 non-rectangular shape extension)
  1020. AC_CACHE_VAL(ac_cv_has_shape, [
  1021.     ac_cv_has_shape=no
  1022.     if test x$no_x = xyes; then
  1023.     :
  1024.     else
  1025.         has_shape_save_LIBS=$LIBS
  1026.     LIBS="-lXext $X_EXTRA_LIBS -lX11 $X_PRE_LIBS $LIBS"
  1027.     has_shape_save_LDFLAGS=$LDFLAGS
  1028.     LDFLAGS="$LDFLAGS $X_LIBS"
  1029.     has_shape_save_CFLAGS=$CFLAGS
  1030.     CFLAGS="$CFLAGS $X_CFLAGS"
  1031.     AC_TRY_LINK([
  1032. #include <X11/Xlib.h>
  1033. #include <X11/Xutil.h>
  1034. #include <X11/extensions/shape.h>
  1035. ], [
  1036. Display *dpy = (Display *)NULL;
  1037. int a, b;
  1038. XShapeQueryVersion(dpy,&a,&b);
  1039. ], ac_cv_has_shape=yes)
  1040.     CFLAGS="$has_shape_save_CFLAGS"
  1041.     LDFLAGS="$has_shape_save_LDFLAGS"
  1042.     LIBS="$has_shape_save_LIBS"
  1043.     fi
  1044. ])
  1045. AC_MSG_RESULT($ac_cv_has_shape)
  1046. ])
  1047.  
  1048. dnl AC_TRY_WARNINGS(INCLUDES, FUNCTION-BODY,
  1049. dnl             ACTION-IF-NO-WARNINGS [, ACTION-IF-WARNINGS-OR-ERROR])
  1050. AC_DEFUN(AC_TRY_WARNINGS,
  1051. [cat > conftest.$ac_ext <<EOF
  1052. dnl This sometimes fails to find confdefs.h, for some reason.
  1053. dnl [#]line __oline__ "[$]0"
  1054. [#]line __oline__ "configure"
  1055. #include "confdefs.h"
  1056. [$1]
  1057. int main() { return 0; }
  1058. int t() {
  1059. [$2]
  1060. ; return 0; }
  1061. EOF
  1062. ac_compile_warn='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 2>&1'
  1063. if { if eval $ac_compile_warn; then :; else echo arning; fi; } | grep arning 1>&AC_FD_CC 2>&AC_FD_CC; then
  1064.   ifelse([$4], , :, [rm -rf conftest*
  1065.   $4])
  1066. ifelse([$3], , , [else
  1067.   rm -rf conftest*
  1068.   $3
  1069. ])dnl
  1070. fi
  1071. rm -f conftest*]
  1072. )
  1073.  
  1074. dnl Find if make is GNU make.
  1075. AC_DEFUN(AC_PROG_GNU_MAKE,
  1076. [AC_MSG_CHECKING(whether we are using GNU make)
  1077. set dummy ${MAKE-make}; ac_make=[$]2
  1078. AC_CACHE_VAL(ac_cv_prog_gnu_make,
  1079. [cat > conftestmake <<\EOF
  1080. all:
  1081.     @echo ' '
  1082. EOF
  1083. if ${MAKE-make} --version -f conftestmake 2>/dev/null | grep GNU >/dev/null 2>&1; then
  1084.   ac_cv_prog_gnu_make=yes
  1085. else
  1086.   ac_cv_prog_gnu_make=no
  1087. fi
  1088. rm -f conftestmake])dnl
  1089. if test $ac_cv_prog_gnu_make = yes; then
  1090.   AC_MSG_RESULT(yes)
  1091.   GNU_MAKE="GNU_MAKE=yes"
  1092. else
  1093.   AC_MSG_RESULT(no)
  1094.   GNU_MAKE= 
  1095. fi
  1096. AC_SUBST([GNU_MAKE])dnl
  1097. ])
  1098.  
  1099. dnl 
  1100. dnl Local additions to Autoconf macros.
  1101. dnl Copyright (C) 1992, 1994, 1995 Free Software Foundation, Inc.
  1102. dnl Franτois Pinard <pinard@iro.umontreal.ca>, 1992.
  1103.  
  1104. dnl ## ----------------------------------------- ##
  1105. dnl ## ANSIfy the C compiler whenever possible.  ##
  1106. dnl ## ----------------------------------------- ##
  1107.  
  1108. dnl @defmac AC_PROG_CC_STDC
  1109. dnl @maindex PROG_CC_STDC
  1110. dnl @ovindex CC
  1111. dnl If the C compiler in not in ANSI C mode by default, try to add an option
  1112. dnl to output variable @code{CC} to make it so.  This macro tries various
  1113. dnl options that select ANSI C on some system or another.  It considers the
  1114. dnl compiler to be in ANSI C mode if it defines @code{__STDC__} to 1 and
  1115. dnl handles function prototypes correctly.
  1116. dnl 
  1117. dnl If you use this macro, you should check after calling it whether the C
  1118. dnl compiler has been set to accept ANSI C; if not, the shell variable
  1119. dnl @code{ac_cv_prog_cc_stdc} is set to @samp{no}.  If you wrote your source
  1120. dnl code in ANSI C, you can make an un-ANSIfied copy of it by using the
  1121. dnl program @code{ansi2knr}, which comes with Ghostscript.
  1122. dnl @end defmac
  1123.  
  1124. dnl Unixware 2.1 defines __STDC__ to 1 only when some useful extensions are
  1125. dnl turned off. They are on by default and turned off with the option -Xc. 
  1126. dnl The consequence is that __STDC__ is defined but e.g. struct sigaction
  1127. dnl is not defined. -- Norbert 
  1128.  
  1129. dnl Below all tests but the one for HP-UX are removed. They caused more
  1130. dnl problems than they soved, sigh. -- Norbert
  1131.  
  1132. AC_DEFUN(MC_HPUX_PROG_CC_STDC,
  1133. [AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
  1134. AC_CACHE_VAL(ac_cv_prog_cc_stdc,
  1135. [ac_cv_prog_cc_stdc=no
  1136. ac_save_CFLAGS="$CFLAGS"
  1137. dnl Don't try gcc -ansi; that turns off useful extensions and
  1138. dnl breaks some systems' header files.
  1139. dnl AIX            -qlanglvl=ansi      (removed -- Norbert)
  1140. dnl Ultrix and OSF/1    -std1               (removed -- Norbert)
  1141. dnl HP-UX        -Aa -D_HPUX_SOURCE
  1142. dnl SVR4        -Xc                 (removed -- Norbert)
  1143. for ac_arg in "" "-Aa -D_HPUX_SOURCE" 
  1144. do
  1145.   CFLAGS="$ac_save_CFLAGS $ac_arg"
  1146.   AC_TRY_COMPILE(
  1147. [#include <signal.h>
  1148. #if !defined(__STDC__) || __STDC__ != 1
  1149. choke me
  1150. #endif    
  1151. ], [int test (int i, double x);
  1152. struct sigaction sa;
  1153. struct s1 {int (*f) (int a);};
  1154. struct s2 {int (*f) (double a);};],
  1155. [ac_cv_prog_cc_stdc="$ac_arg"; break])
  1156. done
  1157. CFLAGS="$ac_save_CFLAGS"
  1158. ])
  1159. AC_MSG_RESULT($ac_cv_prog_cc_stdc)
  1160. case "x$ac_cv_prog_cc_stdc" in
  1161.   x|xno) ;;
  1162.   *) CC="$CC $ac_cv_prog_cc_stdc" ;;
  1163. esac
  1164. ])
  1165.  
  1166. dnl aclocal.m4 generated automatically by aclocal 1.2f
  1167.  
  1168. dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
  1169. dnl This Makefile.in is free software; the Free Software Foundation
  1170. dnl gives unlimited permission to copy and/or distribute it,
  1171. dnl with or without modifications, as long as this notice is preserved.
  1172.  
  1173. dnl This program is distributed in the hope that it will be useful,
  1174. dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
  1175. dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  1176. dnl PARTICULAR PURPOSE.
  1177.  
  1178.  
  1179. # progtest.m4 from gettext 0.32
  1180. # Search path for a program which passes the given test.
  1181. # Ulrich Drepper <drepper@cygnus.com>, 1996.
  1182. #
  1183. # This file file be copied and used freely without restrictions.  It can
  1184. # be used in projects which are not available under the GNU Public License
  1185. # but which still want to provide support for the GNU gettext functionality.
  1186. # Please note that the actual code is *not* freely available.
  1187.  
  1188. # serial 1
  1189.  
  1190. dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
  1191. dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
  1192. AC_DEFUN(AM_PATH_PROG_WITH_TEST,
  1193. [# Extract the first word of "$2", so it can be a program name with args.
  1194. set dummy $2; ac_word=[$]2
  1195. AC_MSG_CHECKING([for $ac_word])
  1196. AC_CACHE_VAL(ac_cv_path_$1,
  1197. [case "[$]$1" in
  1198.   /*)
  1199.   ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
  1200.   ;;
  1201.   *)
  1202.   IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
  1203.   for ac_dir in ifelse([$5], , $PATH, [$5]); do
  1204.     test -z "$ac_dir" && ac_dir=.
  1205.     if test -f $ac_dir/$ac_word; then
  1206.       if [$3]; then
  1207.     ac_cv_path_$1="$ac_dir/$ac_word"
  1208.     break
  1209.       fi
  1210.     fi
  1211.   done
  1212.   IFS="$ac_save_ifs"
  1213. dnl If no 4th arg is given, leave the cache variable unset,
  1214. dnl so AC_PATH_PROGS will keep looking.
  1215. ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
  1216. ])dnl
  1217.   ;;
  1218. esac])dnl
  1219. $1="$ac_cv_path_$1"
  1220. if test -n "[$]$1"; then
  1221.   AC_MSG_RESULT([$]$1)
  1222. else
  1223.   AC_MSG_RESULT(no)
  1224. fi
  1225. AC_SUBST($1)dnl
  1226. ])
  1227.  
  1228.  
  1229. # lcmessage.m4 from gettext 0.32
  1230. # Check whether LC_MESSAGES is available in <locale.h>.
  1231. # Ulrich Drepper <drepper@cygnus.com>, 1995.
  1232. #
  1233. # This file file be copied and used freely without restrictions.  It can
  1234. # be used in projects which are not available under the GNU Public License
  1235. # but which still want to provide support for the GNU gettext functionality.
  1236. # Please note that the actual code is *not* freely available.
  1237.  
  1238. # serial 1
  1239.  
  1240. AC_DEFUN(AM_LC_MESSAGES,
  1241.   [if test $ac_cv_header_locale_h = yes; then
  1242.     AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
  1243.       [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
  1244.        am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
  1245.     if test $am_cv_val_LC_MESSAGES = yes; then
  1246.       AC_DEFINE(HAVE_LC_MESSAGES)
  1247.     fi
  1248.   fi])
  1249.  
  1250.  
  1251.  
  1252. # gettext.m4 from gettext 0.32
  1253. # Macro to add for using GNU gettext.
  1254. # Ulrich Drepper <drepper@cygnus.com>, 1995.
  1255. #
  1256. # This file file be copied and used freely without restrictions.  It can
  1257. # be used in projects which are not available under the GNU Public License
  1258. # but which still want to provide support for the GNU gettext functionality.
  1259. # Please note that the actual code is *not* freely available.
  1260.  
  1261. # serial 3
  1262.  
  1263. AC_DEFUN(AM_WITH_NLS,
  1264.   [AC_MSG_CHECKING([whether NLS is requested])
  1265.     dnl Default is enabled NLS
  1266.     AC_ARG_ENABLE(nls,
  1267.       [  --disable-nls           do not use Native Language Support],
  1268.       USE_NLS=$enableval, USE_NLS=yes)
  1269.     AC_MSG_RESULT($USE_NLS)
  1270.     AC_SUBST(USE_NLS)
  1271.  
  1272.     USE_INCLUDED_LIBINTL=no
  1273.  
  1274.     dnl If we use NLS figure out what method
  1275.     if test "$USE_NLS" = "yes"; then
  1276.       AC_DEFINE(ENABLE_NLS)
  1277.       AC_MSG_CHECKING([whether included gettext is requested])
  1278.       AC_ARG_WITH(included-gettext,
  1279.         [  --with-included-gettext use the GNU gettext library included here],
  1280.         nls_cv_force_use_gnu_gettext=$withval,
  1281.         nls_cv_force_use_gnu_gettext=no)
  1282.       AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
  1283.  
  1284.       nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
  1285.       if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
  1286.         dnl User does not insist on using GNU NLS library.  Figure out what
  1287.         dnl to use.  If gettext or catgets are available (in this order) we
  1288.         dnl use this.  Else we have to fall back to GNU NLS library.
  1289.     dnl catgets is only used if permitted by option --with-catgets.
  1290.     nls_cv_header_intl=
  1291.     nls_cv_header_libgt=
  1292.     CATOBJEXT=NONE
  1293.  
  1294.     AC_CHECK_HEADER(libintl.h,
  1295.       [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
  1296.         [AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")],
  1297.            gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)])
  1298.  
  1299.        if test "$gt_cv_func_gettext_libc" != "yes"; then
  1300.          AC_CHECK_LIB(intl, bindtextdomain,
  1301.            [AC_CACHE_CHECK([for gettext in libintl],
  1302.          gt_cv_func_gettext_libintl,
  1303.          [AC_TRY_LINK([], [return (int) gettext ("")],
  1304.          gt_cv_func_gettext_libintl=yes,
  1305.          gt_cv_func_gettext_libintl=no)])])
  1306.        fi
  1307.  
  1308.        if test "$gt_cv_func_gettext_libc" = "yes" \
  1309.           || test "$gt_cv_func_gettext_libintl" = "yes"; then
  1310.           AC_DEFINE(HAVE_GETTEXT)
  1311.           AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
  1312.         [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
  1313.           if test "$MSGFMT" != "no"; then
  1314.         AC_CHECK_FUNCS(dcgettext)
  1315.         AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
  1316.         AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
  1317.           [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
  1318.         AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
  1319.                    return _nl_msg_cat_cntr],
  1320.           [CATOBJEXT=.gmo
  1321.            DATADIRNAME=share],
  1322.           [CATOBJEXT=.mo
  1323.            DATADIRNAME=lib])
  1324.         INSTOBJEXT=.mo
  1325.           fi
  1326.         fi
  1327.     ])
  1328.  
  1329.         if test "$CATOBJEXT" = "NONE"; then
  1330.       AC_MSG_CHECKING([whether catgets can be used])
  1331.       AC_ARG_WITH(catgets,
  1332.         [  --with-catgets          use catgets functions if available],
  1333.         nls_cv_use_catgets=$withval, nls_cv_use_catgets=no)
  1334.       AC_MSG_RESULT($nls_cv_use_catgets)
  1335.  
  1336.       if test "$nls_cv_use_catgets" = "yes"; then
  1337.         dnl No gettext in C library.  Try catgets next.
  1338.         AC_CHECK_LIB(i, main)
  1339.         AC_CHECK_FUNC(catgets,
  1340.           [AC_DEFINE(HAVE_CATGETS)
  1341.            INTLOBJS="\$(CATOBJS)"
  1342.            AC_PATH_PROG(GENCAT, gencat, no)dnl
  1343.            if test "$GENCAT" != "no"; then
  1344.          AC_PATH_PROG(GMSGFMT, gmsgfmt, no)
  1345.          if test "$GMSGFMT" = "no"; then
  1346.            AM_PATH_PROG_WITH_TEST(GMSGFMT, msgfmt,
  1347.             [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)
  1348.          fi
  1349.          AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
  1350.            [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
  1351.          USE_INCLUDED_LIBINTL=yes
  1352.          CATOBJEXT=.cat
  1353.          INSTOBJEXT=.cat
  1354.          DATADIRNAME=lib
  1355.          INTLDEPS='$(top_builddir)/intl/libintl.a'
  1356.          INTLLIBS=$INTLDEPS
  1357.          LIBS=`echo $LIBS | sed -e 's/-lintl//'`
  1358.          nls_cv_header_intl=intl/libintl.h
  1359.          nls_cv_header_libgt=intl/libgettext.h
  1360.            fi])
  1361.       fi
  1362.         fi
  1363.  
  1364.         if test "$CATOBJEXT" = "NONE"; then
  1365.       dnl Neither gettext nor catgets in included in the C library.
  1366.       dnl Fall back on GNU gettext library.
  1367.       nls_cv_use_gnu_gettext=yes
  1368.         fi
  1369.       fi
  1370.  
  1371.       if test "$nls_cv_use_gnu_gettext" = "yes"; then
  1372.         dnl Mark actions used to generate GNU NLS library.
  1373.         INTLOBJS="\$(GETTOBJS)"
  1374.         AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
  1375.       [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
  1376.         AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
  1377.         AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
  1378.       [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
  1379.         AC_SUBST(MSGFMT)
  1380.     USE_INCLUDED_LIBINTL=yes
  1381.         CATOBJEXT=.gmo
  1382.         INSTOBJEXT=.mo
  1383.         DATADIRNAME=share
  1384.     INTLDEPS='$(top_builddir)/intl/libintl.a'
  1385.     INTLLIBS=$INTLDEPS
  1386.     LIBS=`echo $LIBS | sed -e 's/-lintl//'`
  1387.         nls_cv_header_intl=intl/libintl.h
  1388.         nls_cv_header_libgt=intl/libgettext.h
  1389.       fi
  1390.  
  1391.       dnl Test whether we really found GNU xgettext.
  1392.       if test "$XGETTEXT" != ":"; then
  1393.     dnl If it is no GNU xgettext we define it as : so that the
  1394.     dnl Makefiles still can work.
  1395.     if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
  1396.       : ;
  1397.     else
  1398.       AC_MSG_RESULT(
  1399.         [found xgettext programs is not GNU xgettext; ignore it])
  1400.       XGETTEXT=":"
  1401.     fi
  1402.       fi
  1403.  
  1404.       # We need to process the po/ directory.
  1405.       POSUB=po
  1406.     else
  1407.       DATADIRNAME=share
  1408.       nls_cv_header_intl=intl/libintl.h
  1409.       nls_cv_header_libgt=intl/libgettext.h
  1410.     fi
  1411.  
  1412.     # If this is used in GNU gettext we have to set USE_NLS to `yes'
  1413.     # because some of the sources are only built for this goal.
  1414.     if test "$PACKAGE" = gettext; then
  1415.       USE_NLS=yes
  1416.       USE_INCLUDED_LIBINTL=yes
  1417.     fi
  1418.  
  1419.     dnl These rules are solely for the distribution goal.  While doing this
  1420.     dnl we only have to keep exactly one list of the available catalogs
  1421.     dnl in configure.in.
  1422.     for lang in $ALL_LINGUAS; do
  1423.       GMOFILES="$GMOFILES $lang.gmo"
  1424.       POFILES="$POFILES $lang.po"
  1425.     done
  1426.  
  1427.     dnl Make all variables we use known to autoconf.
  1428.     AC_SUBST(USE_INCLUDED_LIBINTL)
  1429.     AC_SUBST(CATALOGS)
  1430.     AC_SUBST(CATOBJEXT)
  1431.     AC_SUBST(DATADIRNAME)
  1432.     AC_SUBST(GMOFILES)
  1433.     AC_SUBST(INSTOBJEXT)
  1434.     AC_SUBST(INTLDEPS)
  1435.     AC_SUBST(INTLLIBS)
  1436.     AC_SUBST(INTLOBJS)
  1437.     AC_SUBST(POFILES)
  1438.     AC_SUBST(POSUB)
  1439.   ])
  1440.  
  1441. AC_DEFUN(AM_GNU_GETTEXT,
  1442.   [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
  1443.    AC_REQUIRE([AC_PROG_CC])dnl
  1444.    AC_REQUIRE([AC_PROG_RANLIB])dnl
  1445.    AC_REQUIRE([AC_ISC_POSIX])dnl
  1446.    AC_REQUIRE([AC_HEADER_STDC])dnl
  1447.    AC_REQUIRE([AC_C_CONST])dnl
  1448.    AC_REQUIRE([AC_C_INLINE])dnl
  1449.    AC_REQUIRE([AC_TYPE_OFF_T])dnl
  1450.    AC_REQUIRE([AC_TYPE_SIZE_T])dnl
  1451.    AC_REQUIRE([AC_FUNC_ALLOCA])dnl
  1452.    AC_REQUIRE([AC_FUNC_MMAP])dnl
  1453.  
  1454.    AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
  1455. unistd.h values.h sys/param.h])
  1456.    AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
  1457. __argz_count __argz_stringify __argz_next])
  1458.  
  1459.    if test "${ac_cv_func_stpcpy+set}" != "set"; then
  1460.      AC_CHECK_FUNCS(stpcpy)
  1461.    fi
  1462.    if test "${ac_cv_func_stpcpy}" = "yes"; then
  1463.      AC_DEFINE(HAVE_STPCPY)
  1464.    fi
  1465.  
  1466.    AM_LC_MESSAGES
  1467.    AM_WITH_NLS
  1468.  
  1469.    if test "x$CATOBJEXT" != "x"; then
  1470.      if test "x$ALL_LINGUAS" = "x"; then
  1471.        LINGUAS=
  1472.      else
  1473.        AC_MSG_CHECKING(for catalogs to be installed)
  1474.        NEW_LINGUAS=
  1475.        for lang in ${LINGUAS=$ALL_LINGUAS}; do
  1476.          case "$ALL_LINGUAS" in
  1477.           *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
  1478.          esac
  1479.        done
  1480.        LINGUAS=$NEW_LINGUAS
  1481.        AC_MSG_RESULT($LINGUAS)
  1482.      fi
  1483.  
  1484.      dnl Construct list of names of catalog files to be constructed.
  1485.      if test -n "$LINGUAS"; then
  1486.        for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
  1487.      fi
  1488.    fi
  1489.  
  1490.    dnl The reference to <locale.h> in the installed <libintl.h> file
  1491.    dnl must be resolved because we cannot expect the users of this
  1492.    dnl to define HAVE_LOCALE_H.
  1493.    if test $ac_cv_header_locale_h = yes; then
  1494.      INCLUDE_LOCALE_H="#include <locale.h>"
  1495.    else
  1496.      INCLUDE_LOCALE_H="\
  1497. /* The system does not provide the header <locale.h>.  Take care yourself.  */"
  1498.    fi
  1499.    AC_SUBST(INCLUDE_LOCALE_H)
  1500.  
  1501.    dnl Determine which catalog format we have (if any is needed)
  1502.    dnl For now we know about two different formats:
  1503.    dnl   Linux libc-5 and the normal X/Open format
  1504.    test -d intl || mkdir intl
  1505.    if test "$CATOBJEXT" = ".cat"; then
  1506.      AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
  1507.  
  1508.      dnl Transform the SED scripts while copying because some dumb SEDs
  1509.      dnl cannot handle comments.
  1510.      sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed
  1511.    fi
  1512.    dnl po2tbl.sed is always needed.
  1513.    sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
  1514.      $srcdir/intl/po2tbl.sed.in > intl/po2tbl.sed
  1515.  
  1516.    dnl In the intl/Makefile.in we have a special dependency which makes
  1517.    dnl only sense for gettext.  We comment this out for non-gettext
  1518.    dnl packages.
  1519.    if test "$PACKAGE" = "gettext"; then
  1520.      GT_NO="#NO#"
  1521.      GT_YES=
  1522.    else
  1523.      GT_NO=
  1524.      GT_YES="#YES#"
  1525.    fi
  1526.    AC_SUBST(GT_NO)
  1527.    AC_SUBST(GT_YES)
  1528.  
  1529.    dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
  1530.    dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
  1531.    dnl Try to locate is.
  1532.    MKINSTALLDIRS=
  1533.    if test -n "$ac_aux_dir"; then
  1534.      MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
  1535.    fi
  1536.    if test -z "$MKINSTALLDIRS"; then
  1537.      MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
  1538.    fi
  1539.    AC_SUBST(MKINSTALLDIRS)
  1540.  
  1541.    dnl *** For now the libtool support in intl/Makefile is not for real.
  1542.    l=
  1543.    AC_SUBST(l)
  1544.  
  1545.    dnl Generate list of files to be processed by xgettext which will
  1546.    dnl be included in po/Makefile.
  1547.    test -d po || mkdir po
  1548.    if test "x$srcdir" != "x."; then
  1549.      if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
  1550.        posrcprefix="$srcdir/"
  1551.      else
  1552.        posrcprefix="../$srcdir/"
  1553.      fi
  1554.    else
  1555.      posrcprefix="../"
  1556.    fi
  1557.    rm -f po/POTFILES
  1558.    sed -e "/^#/d" -e "/^\$/d" -e "s,.*,    $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
  1559.     < $srcdir/po/POTFILES.in > po/POTFILES
  1560.   ])
  1561.  
  1562.  
  1563. # Configure paths for GLIB
  1564. # Owen Taylor     97-11-3
  1565.  
  1566. dnl AM_PATH_GLIB([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
  1567. dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if "gmodule" or 
  1568. dnl gthread is specified in MODULES, pass to glib-config
  1569. dnl
  1570. AC_DEFUN(AM_PATH_GLIB,
  1571. [dnl 
  1572. dnl Get the cflags and libraries from the glib-config script
  1573. dnl
  1574. AC_ARG_WITH(glib-prefix,[  --with-glib-prefix=PFX   Prefix where GLIB is installed (optional)],
  1575.             glib_config_prefix="$withval", glib_config_prefix="")
  1576. AC_ARG_WITH(glib-exec-prefix,[  --with-glib-exec-prefix=PFX Exec prefix where GLIB is installed (optional)],
  1577.             glib_config_exec_prefix="$withval", glib_config_exec_prefix="")
  1578. AC_ARG_ENABLE(glibtest, [  --disable-glibtest       Do not try to compile and run a test GLIB program],
  1579.             , enable_glibtest=yes)
  1580.  
  1581.   if test x$glib_config_exec_prefix != x ; then
  1582.      glib_config_args="$glib_config_args --exec-prefix=$glib_config_exec_prefix"
  1583.      if test x${GLIB_CONFIG+set} != xset ; then
  1584.         GLIB_CONFIG=$glib_config_exec_prefix/bin/glib-config
  1585.      fi
  1586.   fi
  1587.   if test x$glib_config_prefix != x ; then
  1588.      glib_config_args="$glib_config_args --prefix=$glib_config_prefix"
  1589.      if test x${GLIB_CONFIG+set} != xset ; then
  1590.         GLIB_CONFIG=$glib_config_prefix/bin/glib-config
  1591.      fi
  1592.   fi
  1593.  
  1594.   for module in . $4
  1595.   do
  1596.       case "$module" in
  1597.          gmodule) 
  1598.              glib_config_args="$glib_config_args gmodule"
  1599.          ;;
  1600.          gthread) 
  1601.              glib_config_args="$glib_config_args gthread"
  1602.          ;;
  1603.       esac
  1604.   done
  1605.  
  1606.   AC_PATH_PROG(GLIB_CONFIG, glib-config, no)
  1607.   min_glib_version=ifelse([$1], ,0.99.7,$1)
  1608.   AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
  1609.   no_glib=""
  1610.   if test "$GLIB_CONFIG" = "no" ; then
  1611.     no_glib=yes
  1612.   else
  1613.     GLIB_CFLAGS=`$GLIB_CONFIG $glib_config_args --cflags`
  1614.     GLIB_LIBS=`$GLIB_CONFIG $glib_config_args --libs`
  1615.     glib_config_major_version=`$GLIB_CONFIG $glib_config_args --version | \
  1616.            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
  1617.     glib_config_minor_version=`$GLIB_CONFIG $glib_config_args --version | \
  1618.            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
  1619.     glib_config_micro_version=`$GLIB_CONFIG $glib_config_args --version | \
  1620.            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
  1621.     if test "x$enable_glibtest" = "xyes" ; then
  1622.       ac_save_CFLAGS="$CFLAGS"
  1623.       ac_save_LIBS="$LIBS"
  1624.       CFLAGS="$CFLAGS $GLIB_CFLAGS"
  1625.       LIBS="$LIBS $GLIB_LIBS"
  1626. dnl
  1627. dnl Now check if the installed GLIB is sufficiently new. (Also sanity
  1628. dnl checks the results of glib-config to some extent
  1629. dnl
  1630.       rm -f conf.glibtest
  1631.       AC_TRY_RUN([
  1632. #include <glib.h>
  1633. #include <stdio.h>
  1634. #include <stdlib.h>
  1635.  
  1636. int 
  1637. main ()
  1638. {
  1639.   int major, minor, micro;
  1640.   char *tmp_version;
  1641.  
  1642.   system ("touch conf.glibtest");
  1643.  
  1644.   /* HP/UX 9 (%@#!) writes to sscanf strings */
  1645.   tmp_version = g_strdup("$min_glib_version");
  1646.   if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
  1647.      printf("%s, bad version string\n", "$min_glib_version");
  1648.      exit(1);
  1649.    }
  1650.  
  1651.   if ((glib_major_version != $glib_config_major_version) ||
  1652.       (glib_minor_version != $glib_config_minor_version) ||
  1653.       (glib_micro_version != $glib_config_micro_version))
  1654.     {
  1655.       printf("\n*** 'glib-config --version' returned %d.%d.%d, but GLIB (%d.%d.%d)\n", 
  1656.              $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
  1657.              glib_major_version, glib_minor_version, glib_micro_version);
  1658.       printf ("*** was found! If glib-config was correct, then it is best\n");
  1659.       printf ("*** to remove the old version of GLIB. You may also be able to fix the error\n");
  1660.       printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
  1661.       printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
  1662.       printf("*** required on your system.\n");
  1663.       printf("*** If glib-config was wrong, set the environment variable GLIB_CONFIG\n");
  1664.       printf("*** to point to the correct copy of glib-config, and remove the file config.cache\n");
  1665.       printf("*** before re-running configure\n");
  1666.     } 
  1667.   else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
  1668.        (glib_minor_version != GLIB_MINOR_VERSION) ||
  1669.            (glib_micro_version != GLIB_MICRO_VERSION))
  1670.     {
  1671.       printf("*** GLIB header files (version %d.%d.%d) do not match\n",
  1672.          GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
  1673.       printf("*** library (version %d.%d.%d)\n",
  1674.          glib_major_version, glib_minor_version, glib_micro_version);
  1675.     }
  1676.   else
  1677.     {
  1678.       if ((glib_major_version > major) ||
  1679.         ((glib_major_version == major) && (glib_minor_version > minor)) ||
  1680.         ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
  1681.       {
  1682.         return 0;
  1683.        }
  1684.      else
  1685.       {
  1686.         printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n",
  1687.                glib_major_version, glib_minor_version, glib_micro_version);
  1688.         printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n",
  1689.            major, minor, micro);
  1690.         printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
  1691.         printf("***\n");
  1692.         printf("*** If you have already installed a sufficiently new version, this error\n");
  1693.         printf("*** probably means that the wrong copy of the glib-config shell script is\n");
  1694.         printf("*** being found. The easiest way to fix this is to remove the old version\n");
  1695.         printf("*** of GLIB, but you can also set the GLIB_CONFIG environment to point to the\n");
  1696.         printf("*** correct copy of glib-config. (In this case, you will have to\n");
  1697.         printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
  1698.         printf("*** so that the correct libraries are found at run-time))\n");
  1699.       }
  1700.     }
  1701.   return 1;
  1702. }
  1703. ],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
  1704.        CFLAGS="$ac_save_CFLAGS"
  1705.        LIBS="$ac_save_LIBS"
  1706.      fi
  1707.   fi
  1708.   if test "x$no_glib" = x ; then
  1709.      AC_MSG_RESULT(yes)
  1710.      ifelse([$2], , :, [$2])     
  1711.   else
  1712.      AC_MSG_RESULT(no)
  1713.      if test "$GLIB_CONFIG" = "no" ; then
  1714.        echo "*** The glib-config script installed by GLIB could not be found"
  1715.        echo "*** If GLIB was installed in PREFIX, make sure PREFIX/bin is in"
  1716.        echo "*** your path, or set the GLIB_CONFIG environment variable to the"
  1717.        echo "*** full path to glib-config."
  1718.      else
  1719.        if test -f conf.glibtest ; then
  1720.         :
  1721.        else
  1722.           echo "*** Could not run GLIB test program, checking why..."
  1723.           CFLAGS="$CFLAGS $GLIB_CFLAGS"
  1724.           LIBS="$LIBS $GLIB_LIBS"
  1725.           AC_TRY_LINK([
  1726. #include <glib.h>
  1727. #include <stdio.h>
  1728. ],      [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ],
  1729.         [ echo "*** The test program compiled, but did not run. This usually means"
  1730.           echo "*** that the run-time linker is not finding GLIB or finding the wrong"
  1731.           echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
  1732.           echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
  1733.           echo "*** to the installed location  Also, make sure you have run ldconfig if that"
  1734.           echo "*** is required on your system"
  1735.       echo "***"
  1736.           echo "*** If you have an old version installed, it is best to remove it, although"
  1737.           echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
  1738.           echo "***"
  1739.           echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
  1740.           echo "*** came with the system with the command"
  1741.           echo "***"
  1742.           echo "***    rpm --erase --nodeps gtk gtk-devel" ],
  1743.         [ echo "*** The test program failed to compile or link. See the file config.log for the"
  1744.           echo "*** exact error that occured. This usually means GLIB was incorrectly installed"
  1745.           echo "*** or that you have moved GLIB since it was installed. In the latter case, you"
  1746.           echo "*** may want to edit the glib-config script: $GLIB_CONFIG" ])
  1747.           CFLAGS="$ac_save_CFLAGS"
  1748.           LIBS="$ac_save_LIBS"
  1749.        fi
  1750.      fi
  1751.      GLIB_CFLAGS=""
  1752.      GLIB_LIBS=""
  1753.      ifelse([$3], , :, [$3])
  1754.   fi
  1755.   AC_SUBST(GLIB_CFLAGS)
  1756.   AC_SUBST(GLIB_LIBS)
  1757.   rm -f conf.glibtest
  1758. ])
  1759.  
  1760. dnl GNOME_VFS_CHECKS
  1761. dnl   Check for various functions needed by libvfs.
  1762. dnl   This has various effects:
  1763. dnl     Sets GNOME_VFS_LIBS to libraries required
  1764. dnl     Sets termnet  to true or false depending on whether it is required.
  1765. dnl        If yes, defines USE_TERMNET.
  1766. dnl     Sets vfs_flags to "pretty" list of vfs implementations we include.
  1767. dnl     Calls AC_SUBST(mcserv), which is either empty or "mcserv".
  1768.  
  1769. AC_DEFUN([GNOME_VFS_CHECKS],[
  1770.   dnl FIXME: network checks should probably be in their own macro.
  1771.   AC_CHECK_LIB(nsl, t_accept)
  1772.   AC_CHECK_LIB(socket, socket)
  1773.  
  1774.   have_socket=no
  1775.   AC_CHECK_FUNCS(socket, have_socket=yes)
  1776.   if test $have_socket = no; then
  1777.     # socket is not in the default libraries.  See if it's in some other.
  1778.     for lib in bsd socket inet; do
  1779.       AC_CHECK_LIB($lib, socket, [
  1780.       LIBS="$LIBS -l$lib"
  1781.       have_socket=yes
  1782.       AC_DEFINE(HAVE_SOCKET)
  1783.       break])
  1784.     done
  1785.   fi
  1786.  
  1787.   have_gethostbyname=no
  1788.   AC_CHECK_FUNC(gethostbyname, have_gethostbyname=yes)
  1789.   if test $have_gethostbyname = no; then
  1790.     # gethostbyname is not in the default libraries.  See if it's in some other.
  1791.     for lib in bsd socket inet; do
  1792.       AC_CHECK_LIB($lib, gethostbyname, [LIBS="$LIBS -l$lib"; have_gethostbyname=yes; break])
  1793.     done
  1794.   fi
  1795.  
  1796.  
  1797.   vfs_flags="tarfs"
  1798.   use_net_code=false
  1799.   if test $have_socket = yes; then
  1800.       AC_STRUCT_LINGER
  1801.       AC_CHECK_FUNCS(pmap_set, , [
  1802.      AC_CHECK_LIB(rpc, pmap_set, [
  1803.        LIBS="-lrpc $LIBS"
  1804.       AC_DEFINE(HAVE_PMAP_SET)
  1805.       ])])
  1806.       AC_CHECK_FUNCS(pmap_getport pmap_getmaps rresvport)
  1807.       dnl add for source routing support setsockopt
  1808.       AC_CHECK_HEADERS(rpc/pmap_clnt.h)
  1809.       vfs_flags="$vfs_flags, mcfs, ftpfs, fish"
  1810.       use_net_code=true
  1811.   fi
  1812.  
  1813.   dnl
  1814.   dnl The termnet support
  1815.   dnl
  1816.   termnet=false
  1817.   AC_ARG_WITH(termnet,
  1818.       [--with-termnet             If you want a termified net support],[
  1819.       if test x$withval = xyes; then
  1820.           AC_DEFINE(USE_TERMNET)
  1821.           termnet=true        
  1822.       fi
  1823.   ])
  1824.  
  1825.   TERMNET=""
  1826.   AC_DEFINE(USE_VFS)
  1827.   if $use_net_code; then
  1828.      AC_DEFINE(USE_NETCODE)
  1829.   fi
  1830.   mcserv=
  1831.   if test $have_socket = yes; then
  1832.      mcserv="mcserv"
  1833.      if $termnet; then
  1834.     TERMNET="-ltermnet"
  1835.      fi
  1836.   fi
  1837.   AC_SUBST(TERMNET)
  1838.   AC_SUBST(mcserv)
  1839. ])
  1840.  
  1841. dnl
  1842. dnl Check for struct linger
  1843. dnl
  1844. AC_DEFUN(AC_STRUCT_LINGER, [
  1845. av_struct_linger=no
  1846. AC_MSG_CHECKING(struct linger is available)
  1847. AC_TRY_RUN([
  1848. #include <sys/types.h>
  1849. #include <sys/socket.h>
  1850.  
  1851. struct linger li;
  1852.  
  1853. main ()
  1854. {
  1855.     li.l_onoff = 1;
  1856.     li.l_linger = 120;
  1857.     exit (0);
  1858. }
  1859. ],[
  1860. AC_DEFINE(HAVE_STRUCT_LINGER)
  1861. av_struct_linger=yes
  1862. ],[
  1863. av_struct_linger=no
  1864. ],[
  1865. av_struct_linger=no
  1866. ])
  1867. AC_MSG_RESULT($av_struct_linger)
  1868. ])
  1869.  
  1870. dnl Curses detection: Munged from Midnight Commander's configure.in
  1871. dnl
  1872. dnl What it does:
  1873. dnl =============
  1874. dnl
  1875. dnl - Determine which version of curses is installed on your system
  1876. dnl   and set the -I/-L/-l compiler entries and add a few preprocessor
  1877. dnl   symbols 
  1878. dnl - Do an AC_SUBST on the CURSES_INCLUDEDIR and CURSES_LIBS so that
  1879. dnl   @CURSES_INCLUDEDIR@ and @CURSES_LIBS@ will be available in
  1880. dnl   Makefile.in's
  1881. dnl - Modify the following configure variables (these are the only
  1882. dnl   curses.m4 variables you can access from within configure.in)
  1883. dnl   CURSES_INCLUDEDIR - contains -I's and possibly -DRENAMED_CURSES if
  1884. dnl                       an ncurses.h that's been renamed to curses.h
  1885. dnl                       is found.
  1886. dnl   CURSES_LIBS       - sets -L and -l's appropriately
  1887. dnl   CFLAGS            - if --with-sco, add -D_SVID3 
  1888. dnl   has_curses        - exports result of tests to rest of configure
  1889. dnl
  1890. dnl Usage:
  1891. dnl ======
  1892. dnl 1) Add lines indicated below to acconfig.h
  1893. dnl 2) call AC_CHECK_CURSES after AC_PROG_CC in your configure.in
  1894. dnl 3) Instead of #include <curses.h> you should use the following to
  1895. dnl    properly locate ncurses or curses header file
  1896. dnl
  1897. dnl    #if defined(USE_NCURSES) && !defined(RENAMED_NCURSES)
  1898. dnl    #include <ncurses.h>
  1899. dnl    #else
  1900. dnl    #include <curses.h>
  1901. dnl    #endif
  1902. dnl
  1903. dnl 4) Make sure to add @CURSES_INCLUDEDIR@ to your preprocessor flags
  1904. dnl 5) Make sure to add @CURSES_LIBS@ to your linker flags or LIBS
  1905. dnl
  1906. dnl Notes with automake:
  1907. dnl - call AM_CONDITIONAL(HAS_CURSES, test "$has_curses" = true) from
  1908. dnl   configure.in
  1909. dnl - your Makefile.am can look something like this
  1910. dnl   -----------------------------------------------
  1911. dnl   INCLUDES= blah blah blah $(CURSES_INCLUDEDIR) 
  1912. dnl   if HAS_CURSES
  1913. dnl   CURSES_TARGETS=name_of_curses_prog
  1914. dnl   endif
  1915. dnl   bin_PROGRAMS = other_programs $(CURSES_TARGETS)
  1916. dnl   other_programs_SOURCES = blah blah blah
  1917. dnl   name_of_curses_prog_SOURCES = blah blah blah
  1918. dnl   other_programs_LDADD = blah
  1919. dnl   name_of_curses_prog_LDADD = blah $(CURSES_LIBS)
  1920. dnl   -----------------------------------------------
  1921. dnl
  1922. dnl
  1923. dnl The following lines should be added to acconfig.h:
  1924. dnl ==================================================
  1925. dnl
  1926. dnl /*=== Curses version detection defines ===*/
  1927. dnl /* Found some version of curses that we're going to use */
  1928. dnl #undef HAS_CURSES
  1929. dnl    
  1930. dnl /* Use SunOS SysV curses? */
  1931. dnl #undef USE_SUNOS_CURSES
  1932. dnl 
  1933. dnl /* Use old BSD curses - not used right now */
  1934. dnl #undef USE_BSD_CURSES
  1935. dnl 
  1936. dnl /* Use SystemV curses? */
  1937. dnl #undef USE_SYSV_CURSES
  1938. dnl 
  1939. dnl /* Use Ncurses? */
  1940. dnl #undef USE_NCURSES
  1941. dnl 
  1942. dnl /* If you Curses does not have color define this one */
  1943. dnl #undef NO_COLOR_CURSES
  1944. dnl 
  1945. dnl /* Define if you want to turn on SCO-specific code */
  1946. dnl #undef SCO_FLAVOR
  1947. dnl 
  1948. dnl /* Set to reflect version of ncurses *
  1949. dnl  *   0 = version 1.*
  1950. dnl  *   1 = version 1.9.9g
  1951. dnl  *   2 = version 4.0/4.1 */
  1952. dnl #undef NCURSES_970530
  1953. dnl
  1954. dnl /*=== End new stuff for acconfig.h ===*/
  1955. dnl 
  1956.  
  1957.  
  1958. AC_DEFUN(AC_CHECK_CURSES,[
  1959.     search_ncurses=true
  1960.     screen_manager=""
  1961.     has_curses=false
  1962.  
  1963.     CFLAGS=${CFLAGS--O}
  1964.  
  1965.     AC_SUBST(CURSES_LIBS)
  1966.     AC_SUBST(CURSES_INCLUDEDIR)
  1967.  
  1968.     AC_ARG_WITH(sco,
  1969.       [  --with-sco              Use this to turn on SCO-specific code],[
  1970.       if test x$withval = xyes; then
  1971.         AC_DEFINE(SCO_FLAVOR)
  1972.         CFLAGS="$CFLAGS -D_SVID3"
  1973.       fi
  1974.     ])
  1975.  
  1976.     AC_ARG_WITH(sunos-curses,
  1977.       [  --with-sunos-curses     Used to force SunOS 4.x curses],[
  1978.       if test x$withval = xyes; then
  1979.         AC_USE_SUNOS_CURSES
  1980.       fi
  1981.     ])
  1982.  
  1983.     AC_ARG_WITH(osf1-curses,
  1984.       [  --with-osf1-curses      Used to force OSF/1 curses],[
  1985.       if test x$withval = xyes; then
  1986.         AC_USE_OSF1_CURSES
  1987.       fi
  1988.     ])
  1989.  
  1990.     AC_ARG_WITH(vcurses,
  1991.       [  --with-vcurses[=incdir] Used to force SysV curses],
  1992.       if test x$withval != xyes; then
  1993.         CURSES_INCLUDEDIR="-I$withval"
  1994.       fi
  1995.       AC_USE_SYSV_CURSES
  1996.     )
  1997.  
  1998.     AC_ARG_WITH(ncurses,
  1999.       [  --with-ncurses[=dir]  Compile with ncurses/locate base dir],
  2000.       if test x$withval = xno ; then
  2001.         search_ncurses=false
  2002.       elif test x$withval != xyes ; then
  2003.         CURSES_LIBS="$LIBS -L$withval/lib -lncurses"
  2004.         CURSES_INCLUDEDIR="-I$withval/include"
  2005.         search_ncurses=false
  2006.         screen_manager="ncurses"
  2007.         AC_DEFINE(USE_NCURSES)
  2008.         AC_DEFINE(HAS_CURSES)
  2009.         has_curses=true
  2010.       fi
  2011.     )
  2012.  
  2013.     if $search_ncurses
  2014.     then
  2015.         AC_SEARCH_NCURSES()
  2016.     fi
  2017.  
  2018.  
  2019. ])
  2020.  
  2021.  
  2022. AC_DEFUN(AC_USE_SUNOS_CURSES, [
  2023.     search_ncurses=false
  2024.     screen_manager="SunOS 4.x /usr/5include curses"
  2025.     AC_MSG_RESULT(Using SunOS 4.x /usr/5include curses)
  2026.     AC_DEFINE(USE_SUNOS_CURSES)
  2027.     AC_DEFINE(HAS_CURSES)
  2028.     has_curses=true
  2029.     AC_DEFINE(NO_COLOR_CURSES)
  2030.     AC_DEFINE(USE_SYSV_CURSES)
  2031.     CURSES_INCLUDEDIR="-I/usr/5include"
  2032.     CURSES_LIBS="/usr/5lib/libcurses.a /usr/5lib/libtermcap.a"
  2033.     AC_MSG_RESULT(Please note that some screen refreshs may fail)
  2034. ])
  2035.  
  2036. AC_DEFUN(AC_USE_OSF1_CURSES, [
  2037.        AC_MSG_RESULT(Using OSF1 curses)
  2038.        search_ncurses=false
  2039.        screen_manager="OSF1 curses"
  2040.        AC_DEFINE(HAS_CURSES)
  2041.        has_curses=true
  2042.        AC_DEFINE(NO_COLOR_CURSES)
  2043.        AC_DEFINE(USE_SYSV_CURSES)
  2044.        CURSES_LIBS="-lcurses"
  2045. ])
  2046.  
  2047. AC_DEFUN(AC_USE_SYSV_CURSES, [
  2048.     AC_MSG_RESULT(Using SysV curses)
  2049.     AC_DEFINE(HAS_CURSES)
  2050.     has_curses=true
  2051.     AC_DEFINE(USE_SYSV_CURSES)
  2052.     search_ncurses=false
  2053.     screen_manager="SysV/curses"
  2054.     CURSES_LIBS="-lcurses"
  2055. ])
  2056.  
  2057. dnl AC_ARG_WITH(bsd-curses,
  2058. dnl [--with-bsd-curses         Used to compile with bsd curses, not very fancy],
  2059. dnl     search_ncurses=false
  2060. dnl    screen_manager="Ultrix/cursesX"
  2061. dnl    if test $system = ULTRIX
  2062. dnl    then
  2063. dnl        THIS_CURSES=cursesX
  2064. dnl        else
  2065. dnl        THIS_CURSES=curses
  2066. dnl    fi
  2067. dnl
  2068. dnl    CURSES_LIBS="-l$THIS_CURSES -ltermcap"
  2069. dnl    AC_DEFINE(HAS_CURSES)
  2070. dnl    has_curses=true
  2071. dnl    AC_DEFINE(USE_BSD_CURSES)
  2072. dnl    AC_MSG_RESULT(Please note that some screen refreshs may fail)
  2073. dnl    AC_WARN(Use of the bsdcurses extension has some)
  2074. dnl    AC_WARN(display/input problems.)
  2075. dnl    AC_WARN(Reconsider using xcurses)
  2076. dnl)
  2077.  
  2078.     
  2079. dnl
  2080. dnl Parameters: directory filename cureses_LIBS curses_INCLUDEDIR nicename
  2081. dnl
  2082. AC_DEFUN(AC_NCURSES, [
  2083.     if $search_ncurses
  2084.     then
  2085.         if test -f $1/$2
  2086.     then
  2087.         AC_MSG_RESULT(Found ncurses on $1/$2)
  2088.          CURSES_LIBS="$3"
  2089.         CURSES_INCLUDEDIR="$4"
  2090.         search_ncurses=false
  2091.         screen_manager=$5
  2092.             AC_DEFINE(HAS_CURSES)
  2093.             has_curses=true
  2094.         AC_DEFINE(USE_NCURSES)
  2095.     fi
  2096.     fi
  2097. ])
  2098.  
  2099. AC_DEFUN(AC_SEARCH_NCURSES, [
  2100.     AC_CHECKING("location of ncurses.h file")
  2101.  
  2102.     AC_NCURSES(/usr/include, ncurses.h, -lncurses,, "ncurses on /usr/include")
  2103.     AC_NCURSES(/usr/include/ncurses, ncurses.h, -lncurses, -I/usr/include/ncurses, "ncurses on /usr/include/ncurses")
  2104.     AC_NCURSES(/usr/local/include, ncurses.h, -L/usr/local/lib -lncurses, -I/usr/local/include, "ncurses on /usr/local")
  2105.     AC_NCURSES(/usr/local/include/ncurses, ncurses.h, -L/usr/local/lib -L/usr/local/lib/ncurses -lncurses, -I/usr/local/include/ncurses, "ncurses on /usr/local/include/ncurses")
  2106.  
  2107.     AC_NCURSES(/usr/local/include/ncurses, curses.h, -L/usr/local/lib -lncurses, -I/usr/local/include/ncurses -DRENAMED_NCURSES, "renamed ncurses on /usr/local/.../ncurses")
  2108.  
  2109.     AC_NCURSES(/usr/include/ncurses, curses.h, -lncurses, -I/usr/include/ncurses -DRENAMED_NCURSES, "renamed ncurses on /usr/include/ncurses")
  2110.  
  2111.     dnl
  2112.     dnl We couldn't find ncurses, try SysV curses
  2113.     dnl
  2114.     if $search_ncurses 
  2115.     then
  2116.         AC_EGREP_HEADER(init_color, /usr/include/curses.h,
  2117.         AC_USE_SYSV_CURSES)
  2118.     AC_EGREP_CPP(USE_NCURSES,[
  2119. #include <curses.h>
  2120. #ifdef __NCURSES_H
  2121. #undef USE_NCURSES
  2122. USE_NCURSES
  2123. #endif
  2124. ],[
  2125.     CURSES_INCLUDEDIR="$CURSES_INCLUDEDIR -DRENAMED_NCURSES"
  2126.         AC_DEFINE(HAS_CURSES)
  2127.     has_curses=true
  2128.         AC_DEFINE(USE_NCURSES)
  2129.         search_ncurses=false
  2130.         screen_manager="ncurses installed as curses"
  2131. ])
  2132.     fi
  2133.  
  2134.     dnl
  2135.     dnl Try SunOS 4.x /usr/5{lib,include} ncurses
  2136.     dnl The flags USE_SUNOS_CURSES, USE_BSD_CURSES and BUGGY_CURSES
  2137.     dnl should be replaced by a more fine grained selection routine
  2138.     dnl
  2139.     if $search_ncurses
  2140.     then
  2141.     if test -f /usr/5include/curses.h
  2142.     then
  2143.         AC_USE_SUNOS_CURSES
  2144.         fi
  2145.     else
  2146.         # check for ncurses version, to properly ifdef mouse-fix
  2147.     AC_MSG_CHECKING(for ncurses version)
  2148.     ncurses_version=unknown
  2149. cat > conftest.$ac_ext <<EOF
  2150. [#]line __oline__ "configure"
  2151. #include "confdefs.h"
  2152. #ifdef RENAMED_NCURSES
  2153. #include <curses.h>
  2154. #else
  2155. #include <ncurses.h>
  2156. #endif
  2157. #undef VERSION
  2158. VERSION:NCURSES_VERSION
  2159. EOF
  2160.         if (eval "$ac_cpp conftest.$ac_ext") 2>&AC_FD_CC |
  2161.   egrep "VERSION:" >conftest.out 2>&1; then
  2162. changequote(,)dnl
  2163.             ncurses_version=`cat conftest.out|sed -e 's/^[^"]*"//' -e 's/".*//'`
  2164. changequote([,])dnl
  2165.     fi
  2166.     rm -rf conftest*
  2167.         AC_MSG_RESULT($ncurses_version)
  2168.     case "$ncurses_version" in
  2169. changequote(,)dnl
  2170.     4.[01])
  2171. changequote([,])dnl
  2172.             AC_DEFINE(NCURSES_970530,2)
  2173.             ;;
  2174.     1.9.9g)
  2175.             AC_DEFINE(NCURSES_970530,1)
  2176.             ;;
  2177.     1*)
  2178.             AC_DEFINE(NCURSES_970530,0)
  2179.             ;;
  2180.     esac
  2181.     fi
  2182. ])
  2183.  
  2184.  
  2185.  
  2186.  
  2187.  
  2188.  
  2189. # Define a conditional.
  2190.  
  2191. AC_DEFUN(AM_CONDITIONAL,
  2192. [AC_SUBST($1_TRUE)
  2193. AC_SUBST($1_FALSE)
  2194. if $2; then
  2195.   $1_TRUE=
  2196.   $1_FALSE='#'
  2197. else
  2198.   $1_TRUE='#'
  2199.   $1_FALSE=
  2200. fi])
  2201.  
  2202. dnl
  2203. dnl GNOME_INIT_HOOK (script-if-gnome-enabled, failflag)
  2204. dnl
  2205. dnl if failflag is "fail" then GNOME_INIT_HOOK will abort if gnomeConf.sh
  2206. dnl is not found. 
  2207. dnl
  2208.  
  2209. AC_DEFUN([GNOME_INIT_HOOK],
  2210. [    
  2211.     AC_SUBST(GNOME_LIBS)
  2212.     AC_SUBST(GNOMEUI_LIBS)
  2213.     AC_SUBST(GNOMEGNORBA_LIBS)
  2214.     AC_SUBST(GTKXMHTML_LIBS)
  2215.     AC_SUBST(GNOME_APPLET_LIBS)
  2216.     AC_SUBST(GNOME_LIBDIR)
  2217.     AC_SUBST(GNOME_INCLUDEDIR)
  2218.  
  2219.     AC_ARG_WITH(gnome-includes,
  2220.     [  --with-gnome-includes   Specify location of GNOME headers],[
  2221.     CFLAGS="$CFLAGS -I$withval"
  2222.     ])
  2223.     
  2224.     AC_ARG_WITH(gnome-libs,
  2225.     [  --with-gnome-libs       Specify location of GNOME libs],[
  2226.     LDFLAGS="$LDFLAGS -L$withval"
  2227.     gnome_prefix=$withval
  2228.     ])
  2229.  
  2230.     AC_ARG_WITH(gnome,
  2231.     [  --with-gnome            Specify prefix for GNOME files],
  2232.         if test x$withval = xyes; then
  2233.                 want_gnome=yes
  2234.                 dnl Note that an empty true branch is not
  2235.             dnl valid sh syntax.
  2236.                 ifelse([$1], [], :, [$1])
  2237.             else
  2238.                 if test "x$withval" = xno; then
  2239.                     want_gnome=no
  2240.                 else
  2241.                     want_gnome=yes
  2242.                     LDFLAGS="$LDFLAGS -L$withval/lib"
  2243.                     CFLAGS="$CFLAGS -I$withval/include"
  2244.                     gnome_prefix=$withval/lib
  2245.                 fi
  2246.           fi,
  2247.         want_gnome=yes)
  2248.  
  2249.     if test "x$want_gnome" = xyes; then
  2250.  
  2251.         AC_PATH_PROG(GNOME_CONFIG,gnome-config,no)
  2252.         if test "$GNOME_CONFIG" = "no"; then
  2253.           no_gnome_config="yes"
  2254.         else
  2255.           AC_MSG_CHECKING(if $GNOME_CONFIG works)
  2256.           if $GNOME_CONFIG --libs-only-l gnome >/dev/null 2>&1; then
  2257.             AC_MSG_RESULT(yes)
  2258.             GNOME_GNORBA_HOOK([],$2)
  2259.             GNOME_LIBS="`$GNOME_CONFIG --libs-only-l gnome`"
  2260.             GNOMEUI_LIBS="`$GNOME_CONFIG --libs-only-l gnomeui`"
  2261.             GNOMEGNORBA_LIBS="`$GNOME_CONFIG --libs-only-l gnorba gnomeui`"
  2262.             GTKXMHTML_LIBS="`$GNOME_CONFIG --libs-only-l gtkxmhtml`"
  2263.             GNOME_APPLET_LIBS="`$GNOME_CONFIG --libs-only-l applets`"
  2264.             GNOME_LIBDIR="`$GNOME_CONFIG --libs-only-L gnorba gnomeui`"
  2265.             GNOME_INCLUDEDIR="`$GNOME_CONFIG --cflags gnorba gnomeui`"
  2266.                 $1
  2267.           else
  2268.             AC_MSG_RESULT(no)
  2269.             no_gnome_config="yes"
  2270.               fi
  2271.             fi
  2272.  
  2273.         if test x$exec_prefix = xNONE; then
  2274.             if test x$prefix = xNONE; then
  2275.             gnome_prefix=$ac_default_prefix/lib
  2276.             else
  2277.              gnome_prefix=$prefix/lib
  2278.             fi
  2279.         else
  2280.             gnome_prefix=`eval echo \`echo $libdir\``
  2281.         fi
  2282.     
  2283.         if test "$no_gnome_config" = "yes"; then
  2284.               AC_MSG_CHECKING(for gnomeConf.sh file in $gnome_prefix)
  2285.           if test -f $gnome_prefix/gnomeConf.sh; then
  2286.             AC_MSG_RESULT(found)
  2287.             echo "loading gnome configuration from" \
  2288.              "$gnome_prefix/gnomeConf.sh"
  2289.             . $gnome_prefix/gnomeConf.sh
  2290.             $1
  2291.           else
  2292.             AC_MSG_RESULT(not found)
  2293.              if test x$2 = xfail; then
  2294.               AC_MSG_ERROR(Could not find the gnomeConf.sh file that is generated by gnome-libs install)
  2295.              fi
  2296.           fi
  2297.             fi
  2298.     fi
  2299. ])
  2300.  
  2301. AC_DEFUN([GNOME_INIT],[
  2302.     GNOME_INIT_HOOK([],fail)
  2303. ])
  2304.  
  2305. dnl
  2306. dnl GNOME_GNORBA_HOOK (script-if-gnorba-found, failflag)
  2307. dnl
  2308. dnl if failflag is "failure" it aborts if gnorba is not found.
  2309. dnl
  2310.  
  2311. AC_DEFUN([GNOME_GNORBA_HOOK],[
  2312.     GNOME_ORBIT_HOOK([],$2)
  2313.     AC_CACHE_CHECK([for gnorba libraries],gnome_cv_gnorba_found,[
  2314.         gnome_cv_gnorba_found=no
  2315.         if test x$gnome_cv_orbit_found = xyes; then
  2316.             GNORBA_CFLAGS="`gnome-config --cflags gnorba gnomeui`"
  2317.             GNORBA_LIBS="`gnome-config --libs gnorba gnomeui`"
  2318.             if test -n "$GNORBA_LIBS"; then
  2319.                 gnome_cv_gnorba_found=yes
  2320.             fi
  2321.         fi
  2322.     ])
  2323.     AM_CONDITIONAL(HAVE_GNORBA, test x$gnome_cv_gnorba_found = xyes)
  2324.     if test x$gnome_cv_orbit_found = xyes; then
  2325.         $1
  2326.         GNORBA_CFLAGS="`gnome-config --cflags gnorba gnomeui`"
  2327.         GNORBA_LIBS="`gnome-config --libs gnorba gnomeui`"
  2328.         AC_SUBST(GNORBA_CFLAGS)
  2329.         AC_SUBST(GNORBA_LIBS)
  2330.     else
  2331.             if test x$2 = xfailure; then
  2332.             AC_MSG_ERROR(gnorba library not installed or installation problem)
  2333.             fi
  2334.     fi
  2335. ])
  2336.  
  2337. AC_DEFUN([GNOME_GNORBA_CHECK], [
  2338.     GNOME_GNORBA_HOOK([],failure)
  2339. ])
  2340.  
  2341. dnl
  2342. dnl GNOME_ORBIT_HOOK (script-if-orbit-found, failflag)
  2343. dnl
  2344. dnl if failflag is "failure" it aborts if orbit is not found.
  2345. dnl
  2346.  
  2347. AC_DEFUN([GNOME_ORBIT_HOOK],[
  2348.     AC_PATH_PROG(ORBIT_CONFIG,orbit-config,no)
  2349.     AC_PATH_PROG(ORBIT_IDL,orbit-idl,no)
  2350.     AC_CACHE_CHECK([for working ORBit environment],gnome_cv_orbit_found,[
  2351.         if test x$ORBIT_CONFIG = xno -o x$ORBIT_IDL = xno; then
  2352.             gnome_cv_orbit_found=no
  2353.         else
  2354.             gnome_cv_orbit_found=yes
  2355.         fi
  2356.     ])
  2357.     AM_CONDITIONAL(HAVE_ORBIT, test x$gnome_cv_orbit_found = xyes)
  2358.     if test x$gnome_cv_orbit_found = xyes; then
  2359.         $1
  2360.         ORBIT_CFLAGS=`orbit-config --cflags client server`
  2361.         ORBIT_LIBS=`orbit-config --use-service=name --libs client server`
  2362.         AC_SUBST(ORBIT_CFLAGS)
  2363.         AC_SUBST(ORBIT_LIBS)
  2364.     else
  2365.             if test x$2 = xfailure; then
  2366.             AC_MSG_ERROR(ORBit not installed or installation problem)
  2367.             fi
  2368.     fi
  2369. ])
  2370.  
  2371. AC_DEFUN([GNOME_ORBIT_CHECK], [
  2372.     GNOME_ORBIT_HOOK([],failure)
  2373. ])
  2374.  
  2375. dnl GNOME_UNDELFS_CHECKS
  2376. dnl    Check for ext2fs undel support.
  2377. dnl    Set shell variable ext2fs_undel to "yes" if we have it,
  2378. dnl    "no" otherwise.  May define USE_EXT2FSLIB for cpp.
  2379. dnl    Will set EXT2FS_UNDEL_LIBS to required libraries.
  2380.  
  2381. AC_DEFUN([GNOME_UNDELFS_CHECKS], [
  2382.   AC_CHECK_HEADERS(ext2fs/ext2fs.h linux/ext2_fs.h)
  2383.   ext2fs_undel=no
  2384.   EXT2FS_UNDEL_LIBS=
  2385.   if test x$ac_cv_header_ext2fs_ext2fs_h = xyes
  2386.   then
  2387.     if test x$ac_cv_header_linux_ext2_fs_h = xyes
  2388.     then
  2389.       AC_DEFINE(USE_EXT2FSLIB)
  2390.       ext2fs_undel=yes
  2391.       EXT2FS_UNDEL_LIBS="-lext2fs -lcom_err"
  2392.     fi
  2393.   fi
  2394. ])
  2395.  
  2396.