configure.ac 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. # -*- Autoconf -*-
  2. # Process this file with autoconf to produce a configure script.
  3. # $Id: configure.ac 17 2004-01-23 23:25:07Z lennart $
  4. # This file is part of ifmetric.
  5. #
  6. # ifmetric is free software; you can redistribute it and/or modify it
  7. # under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2 of the License, or
  9. # (at your option) any later version.
  10. #
  11. # ifmetric is distributed in the hope that it will be useful, but
  12. # WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. # General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU General Public License
  17. # along with ifmetric; if not, write to the Free Software Foundation,
  18. # Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  19. AC_PREREQ(2.59)
  20. AC_INIT([ifmetric],[0.3],[mzvszrgevp (at) 0pointer (dot) de])
  21. AC_CONFIG_SRCDIR([src/ifmetric.c])
  22. AC_CONFIG_HEADERS([config.h])
  23. AM_INIT_AUTOMAKE([foreign -Wall])
  24. AC_SUBST(PACKAGE_URL, [http://0pointer.de/lennart/projects/ifmetric/])
  25. if type -p stow > /dev/null && test -d /usr/local/stow ; then
  26. AC_MSG_NOTICE([*** Found /usr/local/stow: default install prefix set to /usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION} ***])
  27. ac_default_prefix="/usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION}"
  28. fi
  29. # Checks for programs.
  30. AC_PROG_CC
  31. # If using GCC specifiy some additional parameters
  32. if test "x$GCC" = "xyes" ; then
  33. CFLAGS="$CFLAGS -pipe -Wall"
  34. fi
  35. AC_CHECK_FUNCS([memset socket strerror strrchr])
  36. AC_CHECK_HEADERS([stdlib.h string.h sys/socket.h unistd.h])
  37. AC_FUNC_MALLOC
  38. AC_FUNC_REALLOC
  39. AC_HEADER_STDC
  40. AC_PROG_LN_S
  41. AC_TYPE_PID_T
  42. AC_CHECK_HEADER([linux/version.h],, [AC_MSG_ERROR([*** Sorry, you have to install the kernel header files ***])])
  43. # LYNX documentation generation
  44. AC_ARG_ENABLE(lynx,
  45. AS_HELP_STRING(--disable-lynx,Turn off lynx usage for documentation generation),
  46. [case "${enableval}" in
  47. yes) lynx=yes ;;
  48. no) lynx=no ;;
  49. *) AC_MSG_ERROR(bad value ${enableval} for --disable-lynx) ;;
  50. esac],[lynx=yes])
  51. if test x$lynx = xyes ; then
  52. AC_CHECK_PROG(have_lynx, lynx, yes, no)
  53. if test x$have_lynx = xno ; then
  54. AC_MSG_ERROR([*** Sorry, you have to install lynx or use --disable-lynx ***])
  55. fi
  56. fi
  57. AM_CONDITIONAL([USE_LYNX], [test "x$lynx" = xyes])
  58. # XMLTOMAN manpage generation
  59. AC_ARG_ENABLE(xmltoman,
  60. AS_HELP_STRING(--disable-xmltoman,Disable rebuilding of man pages with xmltoman),
  61. [case "${enableval}" in
  62. yes) xmltoman=yes ;;
  63. no) xmltoman=no ;;
  64. *) AC_MSG_ERROR([bad value ${enableval} for --disable-xmltoman]) ;;
  65. esac],[xmltoman=yes])
  66. if test x$xmltoman = xyes ; then
  67. AC_CHECK_PROG(have_xmltoman, xmltoman, yes, no)
  68. if test x$have_xmltoman = xno ; then
  69. AC_MSG_WARN([*** Not rebuilding man pages as xmltoman is not found ***])
  70. xmltoman=no
  71. fi
  72. fi
  73. AM_CONDITIONAL([USE_XMLTOMAN], [test "x$xmltoman" = xyes])
  74. AC_CONFIG_FILES([src/Makefile Makefile man/Makefile doc/Makefile doc/README.html])
  75. AC_OUTPUT