]> www.ginac.de Git - ginac.git/blobdiff - acinclude.m4
Patch from Alexei for enabling compilation on MinGW.
[ginac.git] / acinclude.m4
index 09d71cb3b2fa84fe7c49ba3e5d1e7c63c8e68748..45ea8dae4661662cbf5709a4b82a96b881c3223d 100644 (file)
@@ -43,6 +43,10 @@ dnl When both libtermcap and libncurses exist, we prefer the latter, because
 dnl libtermcap is being phased out.
 AC_DEFUN([GINAC_TERMCAP],
 [LIBTERMCAP=
+case $host_os in
+*mingw32*)
+ ;; dnl no termcap libraries are necessary (need hacked libreadline)
+*)
 AC_CHECK_FUNCS(tgetent)
 if test "x$ac_cv_func_tgetent" = "xyes"; then
     :
@@ -52,6 +56,8 @@ else
         AC_CHECK_LIB(termcap, tgetent, LIBTERMCAP="-ltermcap")
     fi
 fi
+;;
+esac
 AC_SUBST(LIBTERMCAP)
 ])
 
@@ -100,3 +106,22 @@ else
     fi
     echo "Configuration of GiNaC $VERSION done. Now type \"make\"."
 fi])
+
+AC_DEFUN([GINAC_HAVE_RUSAGE],
+[AC_CACHE_CHECK([whether struct rusage is declared in <sys/resource.h>],
+ac_cv_have_rusage,
+ [AC_TRY_COMPILE([#include <sys/times.h>
+                  #include <sys/resource.h>],
+                  [struct rusage resUsage;
+                   getrusage(RUSAGE_SELF, &resUsage);
+                   return 0;],
+                 [ac_cv_have_rusage=yes],
+                 [ac_cv_have_rusage=no])
+])
+CONFIG_RUSAGE="no"
+if test "$ac_cv_have_rusage" = yes; then
+  CONFIG_RUSAGE="yes"
+  AC_DEFINE(HAVE_RUSAGE,,[define if struct rusage declared in <sys/resource.h>])
+fi
+AC_SUBST(CONFIG_RUSAGE)
+])