configure.ac 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. # DT PS Tree
  2. #
  3. # Douglas Thrift
  4. #
  5. # configure.ac
  6. # Copyright 2010 Douglas Thrift
  7. #
  8. # Licensed under the Apache License, Version 2.0 (the "License");
  9. # you may not use this file except in compliance with the License.
  10. # You may obtain a copy of the License at
  11. #
  12. # http://www.apache.org/licenses/LICENSE-2.0
  13. #
  14. # Unless required by applicable law or agreed to in writing, software
  15. # distributed under the License is distributed on an "AS IS" BASIS,
  16. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  17. # See the License for the specific language governing permissions and
  18. # limitations under the License.
  19. AC_PREREQ([2.62])
  20. AC_INIT([DT PS Tree], [1.0.2], [douglas@douglasthrift.net], [dtpstree], [http://code.douglasthrift.net/trac/dtpstree])
  21. AC_CONFIG_SRCDIR([dtpstree.cpp])
  22. AC_CONFIG_AUX_DIR([build-aux])
  23. CHECK_GNU_MAKE
  24. AC_SUBST([GMAKE], [$_cv_gnu_make_command])
  25. AS_IF([test "x$GMAKE" = x], [AC_MSG_ERROR([You need GNU make])])
  26. AC_PROG_INSTALL
  27. AC_PATH_PROG([HELP2MAN], [help2man], [:])
  28. AC_MSG_CHECKING([for realpath])
  29. AC_PATH_PROGS_FEATURE_CHECK([REALPATH], [realpath readlink greadlink gnureadlink],
  30. [AS_CASE([$ac_path_REALPATH], [*realpath],
  31. [ac_cv_path_REALPATH=$ac_path_REALPATH
  32. ac_path_REALPATH_found=:],
  33. [AS_IF([$ac_path_REALPATH -f . >/dev/null 2>&1],
  34. [ac_cv_path_REALPATH="$ac_path_REALPATH -f"
  35. ac_path_REALPATH_found=:]
  36. )]
  37. )]
  38. )
  39. AS_IF([test "x$ac_cv_path_REALPATH" != x],
  40. [AC_SUBST([REALPATH], [$ac_cv_path_REALPATH])
  41. AC_MSG_RESULT([$REALPATH])],
  42. [AC_SUBST([REALPATH], [:])
  43. AC_MSG_RESULT([no])]
  44. )
  45. AC_MSG_CHECKING([for BSD tar with xz support])
  46. AC_PATH_PROGS_FEATURE_CHECK([BSDTAR], [tar bsdtar],
  47. [AS_IF([test "x`$ac_path_BSDTAR --version 2>/dev/null | grep '^bsdtar '`" != x],
  48. [AS_IF([$ac_path_BSDTAR -cJf - /dev/null >/dev/null 2>&1],
  49. [ac_cv_path_BSDTAR=$ac_path_BSDTAR
  50. ac_path_BSDTAR_found=:]
  51. )]
  52. )]
  53. )
  54. AS_IF([test "x$ac_cv_path_BSDTAR" != x],
  55. [AC_SUBST([BSDTAR], [$ac_cv_path_BSDTAR])
  56. AC_MSG_RESULT([$BSDTAR])],
  57. [AC_SUBST([BSDTAR], [:])
  58. AC_MSG_RESULT([no])]
  59. )
  60. AC_LANG([C++])
  61. AC_DEFUN([DT_MSG_TERMCAP], [AC_MSG_ERROR([You need terminfo or termcap])])
  62. AC_DEFUN([DT_CHECK_TERMCAP], [AC_CHECK_HEADERS([termcap.h])
  63. AS_CASE([$ac_cv_header_termcap_h], [no], [DT_MSG_TERMCAP],
  64. [AC_SEARCH_LIBS([tgetent], [termcap termlib], [], [DT_MSG_TERMCAP])]
  65. )]
  66. )
  67. AC_CHECK_HEADERS([ncurses/curses.h curses.h], [break])
  68. AS_CASE([$ac_cv_header_curses_h$ac_cv_header_ncurses_curses_h], [*yes*],
  69. [AC_CHECK_HEADERS([ncurses/term.h term.h], [break])
  70. AS_CASE([$ac_cv_header_term_h$ac_cv_header_ncurses_term_h], [*yes*],
  71. [AC_SEARCH_LIBS([setupterm], [ncurses curses terminfo tinfo], [],
  72. [DT_CHECK_TERMCAP]
  73. )], [DT_CHECK_TERMCAP]
  74. )], [DT_CHECK_TERMCAP]
  75. )
  76. AC_DEFUN([DT_MSG_KVM], [AC_MSG_ERROR([You need libkvm])])
  77. AC_CHECK_HEADER([kvm.h], [], [DT_MSG_KVM])
  78. AC_SEARCH_LIBS([kvm_openfiles], [kvm], [], [DT_MSG_KVM])
  79. AC_CONFIG_FILES([GNUmakefile])
  80. AC_OUTPUT