configure.ac 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. # Copyright (C) 2012 Anders Sundman <anders@4zm.org>
  2. #
  3. # This file is part of mfterm.
  4. #
  5. # mfterm is free software: you can redistribute it and/or modify
  6. # it under the terms of the GNU General Public License as published by
  7. # the Free Software Foundation, either version 3 of the License, or
  8. # (at your option) any later version.
  9. #
  10. # mfterm is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. # GNU General Public License for more details.
  14. #
  15. # You should have received a copy of the GNU General Public License
  16. # along with mfterm. If not, see <http://www.gnu.org/licenses/>.
  17. AC_PREREQ([2.67])
  18. AC_INIT([mfterm], [1.0.3], [anders@4zm.org])
  19. AC_CONFIG_SRCDIR([mfterm.c])
  20. AC_CONFIG_HEADERS([config.h])
  21. AM_INIT_AUTOMAKE
  22. # Checks for programs.
  23. AC_CHECK_PROGS(YACC, 'bison -y' byacc yacc, :)
  24. if test "x$YACC" == "x:"; then
  25. AC_MSG_ERROR([Bison or some other YACC compatible parser generator is required.])
  26. fi
  27. AC_PROG_YACC
  28. AC_PROG_CC
  29. AC_CHECK_PROGS(LEX, flex lex, :)
  30. if test "x$LEX" == "x:"; then
  31. AC_MSG_ERROR([Lex or Flex or is required.])
  32. fi
  33. AM_PROG_LEX
  34. AC_PROG_MAKE_SET
  35. AC_PROG_RANLIB
  36. AM_PROG_CC_C_O
  37. # Checks for libraries.
  38. AC_CHECK_LIB([nfc], [nfc_open], [],
  39. [AC_MSG_ERROR([libnfc >= 1.7 is required (http://www.libnfc.org/download)])])
  40. AC_CHECK_LIB([readline], [rl_completion_matches], [],
  41. [AC_MSG_ERROR([libreadline is required])])
  42. AC_CHECK_LIB([crypto], [DES_set_key_unchecked], [HAVE_LIBCRYPTO=yes],
  43. [AC_MSG_ERROR([libcrypto is required])])
  44. # Checks for header files.
  45. AC_CHECK_HEADERS([stddef.h stdint.h stdlib.h string.h strings.h], [],
  46. [AC_MSG_ERROR([A required header file was not found.])])
  47. # Checks for typedefs, structures, and compiler characteristics.
  48. AC_HEADER_STDBOOL
  49. AC_TYPE_SIZE_T
  50. AC_TYPE_UINT8_T
  51. AC_CHECK_TYPES([ptrdiff_t])
  52. # Checks for library functions.
  53. AC_FUNC_MALLOC
  54. AC_CHECK_FUNCS([memset strcasecmp strchr strdup strtol strtoul], [],
  55. [AC_MSG_ERROR([A required function was not found.])])
  56. AC_CONFIG_FILES([Makefile])
  57. AC_OUTPUT