configure.in 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. dnl Process this file with autoconf to produce a configure script.
  2. dnl The ONLY thing this is used for is to configure for different
  3. dnl linux architectures and configurations, it is not used to make the
  4. dnl code more portable
  5. dnl You MUST have an environment that has all the POSIX functions and
  6. dnl some of the more populare bsd/sysv ones (like select). You'll also
  7. dnl need a C++ compiler that is semi-standard conformant, exceptions are
  8. dnl not used but STL is.
  9. AC_INIT(configure.in)
  10. AC_CONFIG_AUX_DIR(buildlib)
  11. AC_CONFIG_HEADER(include/config.h:buildlib/config.h.in)
  12. dnl -- SET THIS TO THE RELEASE VERSION --
  13. AC_DEFINE_UNQUOTED(VERSION,"0.3.0")
  14. AC_DEFINE_UNQUOTED(PACKAGE,"apt")
  15. dnl Tom's host stuff
  16. tl_CHECK_TOOL_PREFIX dnl Initial guess
  17. dnl Check our C compiler
  18. tl_PROG_CC
  19. AC_ISC_POSIX
  20. dnl Check the host arch (build+target not needed... yet)
  21. tl_CANONICAL_HOST
  22. tl_CHECK_TOOL_PREFIX dnl recheck, in case the initial guess was wrong
  23. dnl Check for other programs
  24. tl_PROG_CXX
  25. AC_LANG_CPLUSPLUS
  26. dnl Checks for X11
  27. AC_PATH_X
  28. AC_PATH_XTRA
  29. AC_SUBST(X11LIB)
  30. X11LIB=
  31. if test "$no_x" != "yes"; then
  32. X11LIB="-lX11"
  33. AC_DEFINE(HAVE_X11)
  34. dnl Checks for ZPM
  35. AC_CHECK_LIB(Xpm, XpmLibraryVersion,[AC_DEFINE(HAVE_LIBXPM) XPMLIB="-lXpm"],,$X_LIBS $X_PRE_LIBS $X11LIB $X_EXTRA_LIBS)
  36. AC_SUBST(XPMLIB)
  37. if test "$XPMLIB" != "-lXpm"; then
  38. AC_MSG_ERROR(failed: I need xpm if you are building for X)
  39. fi
  40. fi
  41. dnl Checks for Slang
  42. AC_CHECK_LIB(slang, SLang_Version,[AC_DEFINE(HAVE_LIBSLANG) SLANGLIB="-lslang"])
  43. AC_SUBST(SLANGLIB)
  44. dnl Checks for GPM
  45. AC_ARG_WITH(gpm,[ --without-gpm do not use GPM mouse support])
  46. if test "$with_gpm" != "no"; then
  47. AC_CHECK_LIB(gpm, Gpm_Open,[AC_DEFINE(HAVE_LIBGPM) GPMLIB="-lgpm"])
  48. AC_SUBST(GPMLIB)
  49. fi
  50. dnl Checks for pthread
  51. AC_CHECK_LIB(pthread, pthread_create,[AC_DEFINE(HAVE_PTHREAD) PTHREADLIB="-lpthread"])
  52. AC_SUBST(PTHREADLIB)
  53. if test "$XPMLIB" != "-lXpm"; then
  54. AC_MSG_ERROR(failed: I need posix threads, pthread)
  55. fi
  56. dnl Converts the ARCH to be the same as dpkg
  57. AC_MSG_CHECKING(system architecture)
  58. archset="`awk '$1 == "'$host_cpu'" { print $2 }' $srcdir/buildlib/archtable`"
  59. if test "x$archset" = "x"; then
  60. AC_MSG_ERROR(failed: use --host=)
  61. fi
  62. AC_MSG_RESULT($archset)
  63. AC_DEFINE_UNQUOTED(ARCHITECTURE,"$archset")
  64. dnl Check the sizes etc. of the architecture
  65. changequote(,)
  66. if archline="`sed -ne 's/^'$archset':[ ]\+\(.*\)/\1/gp' $srcdir/buildlib/sizetable`"; then
  67. changequote([,])
  68. set $archline
  69. if test "$1" = "little"; then
  70. ac_cv_c_bigendian=no
  71. else
  72. ac_cv_c_bigendian=yes
  73. fi
  74. size_char=$2
  75. size_int=$3
  76. size_short=$4
  77. size_long=$5
  78. fi
  79. if test "$cross_compiling" = "yes" -a "$archline" = ""; then
  80. AC_MSG_ERROR(When cross compiling, architecture must be present in sizetable)
  81. fi
  82. AC_C_BIGENDIAN
  83. AC_CHECK_SIZEOF(char,$size_char)
  84. AC_CHECK_SIZEOF(int,$size_int)
  85. AC_CHECK_SIZEOF(short,$size_short)
  86. AC_CHECK_SIZEOF(long,$size_long)
  87. dnl Check for debiandoc
  88. AC_CHECK_PROG(DEBIANDOC_HTML,debiandoc2html,"yes","")
  89. AC_CHECK_PROG(DEBIANDOC_TEXT,debiandoc2text,"yes","")
  90. AC_OUTPUT(environment.mak:buildlib/environment.mak.in makefile:buildlib/makefile.in,make dirs)