configure.in 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. ###############################################################################
  2. # This file is part of TinTin++ #
  3. # #
  4. # Copyright 2004-2019 Igor van den Hoven #
  5. # #
  6. # TinTin++ is free software; you can redistribute it and/or modify #
  7. # it under the terms of the GNU General Public License as published by #
  8. # the Free Software Foundation; either version 3 of the License, or #
  9. # (at your option) any later version. #
  10. # #
  11. # This program is distributed in the hope that it will be useful, #
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of #
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
  14. # GNU General Public License for more details. #
  15. # #
  16. # #
  17. # You should have received a copy of the GNU General Public License #
  18. # along with TinTin++. If not, see https://www.gnu.org/licenses. #
  19. ###############################################################################
  20. AM_INIT_AUTOMAKE
  21. AC_INIT
  22. AC_CONFIG_SRCDIR([tintin.h])
  23. AC_CONFIG_HEADER(config.h)
  24. AC_MSG_RESULT([Configuring TinTin++])
  25. AC_SUBST(MYINCLUDE)
  26. AC_SUBST(MYLIB)
  27. AC_SUBST(mybindir)
  28. AC_SUBST(BIG5)
  29. if [ test $bindir != "\${exec_prefix}/bin" ]
  30. then
  31. mybindir="$bindir"
  32. else
  33. mybindir="."
  34. fi
  35. if [ test $libdir != "\${exec_prefix}/lib" ]
  36. then
  37. MYLIB="-L$libdir"
  38. else
  39. MYLIB=""
  40. fi
  41. if [ test $includedir != "\${prefix}/include" ]
  42. then
  43. MYINCLUDE="-I$includedir"
  44. else
  45. MYINCLUDE=""
  46. fi
  47. AC_ARG_ENABLE(big5, [ --enable-big5 enable big5 support], BIG5="-DBIG5")
  48. # Checks for programs.
  49. AC_PROG_CC
  50. AC_PROG_MAKE_SET
  51. # Checks for header files.
  52. AC_HEADER_STDC
  53. AC_CHECK_HEADERS([arpa/inet.h ctype.h fcntl.h net/errno.h netdb.h netinet/in.h param.h pthread.h socks.h stdlib.h string.h strings.h sys/ioctl.h sys/param.h sys/ptem.h sys/socket.h sys/termio.h sys/time.h time.h unistd.h util.h pty.h stropts.h])
  54. AC_CHECK_HEADERS([zlib.h],,
  55. [AC_MSG_ERROR([zlib header file not found, is the development part present])])
  56. AC_CHECK_HEADERS([pcre.h],,
  57. [AC_MSG_ERROR([pcre header file not found, is the development part present])])
  58. AC_CHECK_HEADERS([gnutls/gnutls.h],
  59. [AC_DEFINE([HAVE_GNUTLS_H],[1],[Define to 1 if you have <gnutls/gnutls.h>.])],
  60. [AC_MSG_WARN([gnutls header file not found, is the develoment part present])])
  61. # Checks for typedefs, structures, and compiler characteristics.
  62. AC_C_CONST
  63. AC_HEADER_STDBOOL
  64. AC_TYPE_SIZE_T
  65. AC_HEADER_TIME
  66. AC_STRUCT_TM
  67. # Checks for library functions.
  68. AC_FUNC_MEMCMP
  69. AC_FUNC_REALLOC
  70. AC_FUNC_SELECT_ARGTYPES
  71. AC_TYPE_SIGNAL
  72. AC_FUNC_STAT
  73. AC_FUNC_STRFTIME
  74. AC_FUNC_UTIME_NULL
  75. AC_FUNC_VPRINTF
  76. AC_CHECK_FUNCS([gethostbyname gethostname gettimeofday inet_ntoa memset select socket strcasecmp strchr strdup strerror strftime strncasecmp strstr utime getaddrinfo forkpty popen])
  77. # Checks libraries
  78. AC_CHECK_LIB(z, inflate,,
  79. [AC_MSG_ERROR([zlib runtime library not working, is it AND the corresponding development (header) file installed])])
  80. AC_CHECK_LIB(pthread, pthread_create)
  81. AC_CHECK_LIB(nsl, gethostbyname)
  82. AC_CHECK_LIB(socket, rresvport)
  83. AC_CHECK_LIB(util, forkpty)
  84. AC_CHECK_LIB(pcre, pcre_compile,,
  85. [AC_MSG_ERROR([pcre runtime library not working, is it AND the corresponding development (header) file installed])])
  86. AC_CHECK_LIB(gnutls, gnutls_init)
  87. AC_CHECK_LIB(m, sqrt)
  88. AC_CHECK_PROGS(MAKE, gmake make)
  89. AC_CHECK_FILES([/dev/ptmx])
  90. AC_FUNC_GETMNTENT
  91. AC_HEADER_DIRENT
  92. AC_CONFIG_FILES([Makefile])
  93. AC_OUTPUT
  94. echo
  95. echo "Configure has finished. To compile, type: make"
  96. echo