configure.in 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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 populare 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.3.14.1")
  17. AC_DEFINE_UNQUOTED(PACKAGE,"apt")
  18. dnl Tom's host stuff
  19. tl_CHECK_TOOL_PREFIX dnl Initial guess
  20. dnl Check our C compiler
  21. tl_PROG_CC
  22. AC_ISC_POSIX
  23. dnl Check the host arch (build+target not needed... yet)
  24. tl_CANONICAL_HOST
  25. tl_CHECK_TOOL_PREFIX dnl recheck, in case the initial guess was wrong
  26. dnl Check for other programs
  27. tl_PROG_CXX
  28. AC_LANG_CPLUSPLUS
  29. dnl Checks for X11
  30. AC_PATH_X
  31. AC_PATH_XTRA
  32. AC_SUBST(X11LIB)
  33. X11LIB=
  34. if test "$no_x" != "yes"; then
  35. X11LIB="-lX11"
  36. AC_DEFINE(HAVE_X11)
  37. dnl Checks for ZPM
  38. AC_CHECK_LIB(Xpm, XpmLibraryVersion,[AC_DEFINE(HAVE_LIBXPM) XPMLIB="-lXpm"],,$X_LIBS $X_PRE_LIBS $X11LIB $X_EXTRA_LIBS)
  39. AC_SUBST(XPMLIB)
  40. if test "$XPMLIB" != "-lXpm"; then
  41. AC_MSG_ERROR(failed: I need xpm if you are building for X)
  42. fi
  43. fi
  44. dnl Checks for Slang
  45. AC_CHECK_LIB(slang, SLang_Version,[AC_DEFINE(HAVE_LIBSLANG) SLANGLIB="-lslang"])
  46. AC_SUBST(SLANGLIB)
  47. dnl Checks for GPM
  48. AC_ARG_WITH(gpm,[ --without-gpm do not use GPM mouse support])
  49. if test "$with_gpm" != "no"; then
  50. AC_CHECK_LIB(gpm, Gpm_Open,[AC_DEFINE(HAVE_LIBGPM) GPMLIB="-lgpm"])
  51. AC_SUBST(GPMLIB)
  52. fi
  53. dnl Checks for pthread
  54. #AC_CHECK_LIB(pthread, pthread_create,[AC_DEFINE(HAVE_PTHREAD) PTHREADLIB="-lpthread"])
  55. AC_SUBST(PTHREADLIB)
  56. #if test "$PTHREADLIB" != "-lpthread"; then
  57. # AC_MSG_ERROR(failed: I need posix threads, pthread)
  58. #fi
  59. dnl Converts the ARCH to be the same as dpkg
  60. AC_MSG_CHECKING(system architecture)
  61. archset="`awk '$1 == "'$host_cpu'" { print $2 }' $srcdir/buildlib/archtable`"
  62. if test "x$archset" = "x"; then
  63. AC_MSG_ERROR(failed: use --host=)
  64. fi
  65. AC_MSG_RESULT($archset)
  66. AC_DEFINE_UNQUOTED(ARCHITECTURE,"$archset")
  67. dnl We use C9x types if at all possible
  68. AC_CACHE_CHECK([for C9x integer types],c9x_ints,[
  69. AC_TRY_COMPILE([#include <inttypes.h>],
  70. [uint8_t Foo1;uint16_t Foo2;uint32_t Foo3;uint64_t Foo],
  71. c9x_ints=yes,c9x_ints=no)])
  72. dnl Check the sizes etc. of the architecture
  73. changequote(,)
  74. if archline="`sed -ne 's/^'$archset':[ ]\+\(.*\)/\1/gp' $srcdir/buildlib/sizetable`"; then
  75. changequote([,])
  76. set $archline
  77. if test "$1" = "little"; then
  78. ac_cv_c_bigendian=no
  79. else
  80. ac_cv_c_bigendian=yes
  81. fi
  82. size_char=$2
  83. size_int=$3
  84. size_short=$4
  85. size_long=$5
  86. fi
  87. if test "$cross_compiling" = "yes" -a "$archline" = ""; then
  88. AC_MSG_ERROR(When cross compiling, architecture must be present in sizetable)
  89. fi
  90. AC_C_BIGENDIAN
  91. dnl We do not need this if we have inttypes..
  92. HAVE_C9X=yes
  93. if test x"$c9x_ints" = x"no"; then
  94. AC_CHECK_SIZEOF(char,$size_char)
  95. AC_CHECK_SIZEOF(int,$size_int)
  96. AC_CHECK_SIZEOF(short,$size_short)
  97. AC_CHECK_SIZEOF(long,$size_long)
  98. HAVE_C9X=
  99. AC_SUBST(HAVE_C9X)
  100. fi
  101. dnl Check for debiandoc
  102. AC_CHECK_PROG(DEBIANDOC_HTML,debiandoc2html,"yes","")
  103. AC_CHECK_PROG(DEBIANDOC_TEXT,debiandoc2text,"yes","")
  104. dnl Check for YODL
  105. AC_CHECK_PROG(YODL_MAN,yodl2man,"yes","")
  106. AC_OUTPUT(environment.mak:buildlib/environment.mak.in makefile:buildlib/makefile.in,make dirs)