configure.in 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. ad
  2. dnl Process this file with autoconf to produce a configure script.
  3. dnl The ONLY thing this is used for is to configure for different
  4. dnl linux architectures and configurations, it is not used to make the
  5. dnl code more portable
  6. dnl You MUST have an environment that has all the POSIX functions and
  7. dnl some of the more popular bsd/sysv ones (like select). You'll also
  8. dnl need a C++ compiler that is semi-standard conformant, exceptions are
  9. dnl not used but STL is.
  10. dnl 'make -f Makefile startup' will generate the configure file from
  11. dnl configure.in correctly and can be run at any time
  12. AC_INIT(configure.in)
  13. AC_CONFIG_AUX_DIR(buildlib)
  14. AC_CONFIG_HEADER(include/config.h:buildlib/config.h.in)
  15. dnl -- SET THIS TO THE RELEASE VERSION --
  16. AC_DEFINE_UNQUOTED(VERSION,"0.0")
  17. AC_DEFINE_UNQUOTED(PACKAGE,"dsync")
  18. AC_CHECK_TOOL_PREFIX dnl Initial guess
  19. dnl Check our C compiler
  20. AC_PROG_CC
  21. AC_ISC_POSIX
  22. dnl Check the host arch (build+target not needed... yet)
  23. AC_CANONICAL_HOST
  24. AC_CHECK_TOOL_PREFIX dnl recheck, in case the initial guess was wrong
  25. dnl Check for other programs
  26. AC_PROG_CXX
  27. AC_LANG_CPLUSPLUS
  28. AC_CHECK_TOOL(AR,ar, :)
  29. if test "$AR" = ":"; then
  30. AC_MSG_ERROR(failed: Sorry I could not find ar in the path)
  31. fi
  32. dnl Checks for pthread
  33. AC_CHECK_LIB(pthread, pthread_create,[AC_DEFINE(HAVE_PTHREAD) PTHREADLIB="-lpthread"])
  34. AC_SUBST(PTHREADLIB)
  35. dnl Converts the ARCH to be the same as dpkg
  36. AC_MSG_CHECKING(system architecture)
  37. archset="`awk '$1 == "'$host_cpu'" { print $2 }' $srcdir/buildlib/archtable`"
  38. if test "x$archset" = "x"; then
  39. AC_MSG_ERROR(failed: use --host=)
  40. fi
  41. AC_MSG_RESULT($archset)
  42. AC_DEFINE_UNQUOTED(ARCHITECTURE,"$archset")
  43. dnl We use C9x types if at all possible
  44. AC_CACHE_CHECK([for C9x integer types],c9x_ints,[
  45. AC_TRY_COMPILE([#include <inttypes.h>],
  46. [uint8_t Foo1;uint16_t Foo2;uint32_t Foo3;uint64_t Foo],
  47. c9x_ints=yes,c9x_ints=no)])
  48. dnl Check the sizes etc. of the architecture
  49. changequote(,)
  50. if archline="`sed -ne 's/^'$archset':[ ]\+\(.*\)/\1/gp' $srcdir/buildlib/sizetable`"; then
  51. changequote([,])
  52. set $archline
  53. if test "$1" = "little"; then
  54. ac_cv_c_bigendian=no
  55. else
  56. ac_cv_c_bigendian=yes
  57. fi
  58. size_char=$2
  59. size_int=$3
  60. size_short=$4
  61. size_long=$5
  62. fi
  63. if test "$cross_compiling" = "yes" -a "$archline" = ""; then
  64. AC_MSG_ERROR(When cross compiling, architecture must be present in sizetable)
  65. fi
  66. AC_C_BIGENDIAN
  67. dnl We do not need this if we have inttypes..
  68. HAVE_C9X=yes
  69. if test x"$c9x_ints" = x"no"; then
  70. AC_CHECK_SIZEOF(char,$size_char)
  71. AC_CHECK_SIZEOF(int,$size_int)
  72. AC_CHECK_SIZEOF(short,$size_short)
  73. AC_CHECK_SIZEOF(long,$size_long)
  74. HAVE_C9X=
  75. AC_SUBST(HAVE_C9X)
  76. fi
  77. dnl Check for debiandoc
  78. AC_CHECK_PROG(DEBIANDOC_HTML,debiandoc2html,"yes","")
  79. AC_CHECK_PROG(DEBIANDOC_TEXT,debiandoc2text,"yes","")
  80. dnl Check for YODL
  81. AC_CHECK_PROG(YODL_MAN,yodl2man,"yes","")
  82. AC_OUTPUT(environment.mak:buildlib/environment.mak.in makefile:buildlib/makefile.in,make dirs)