home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / utils / file / managers / mc-3.2 / mc-3 / mc-3.2.1 / aclocal.m4 < prev    next >
Encoding:
M4 Source File  |  1996-05-17  |  30.5 KB  |  1,115 lines

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