configure.in 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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 Tom's host stuff
  13. tl_CHECK_TOOL_PREFIX dnl Initial guess
  14. dnl Check our C compiler
  15. tl_PROG_CC
  16. AC_ISC_POSIX
  17. dnl Check the host arch (build+target not needed... yet)
  18. tl_CANONICAL_HOST
  19. tl_CHECK_TOOL_PREFIX dnl recheck, in case the initial guess was wrong
  20. dnl Check for other programs
  21. tl_PROG_CXX
  22. AC_LANG_CPLUSPLUS
  23. dnl Checks for X11
  24. AC_PATH_X
  25. AC_PATH_XTRA
  26. AC_SUBST(X11LIB)
  27. X11LIB=
  28. if test "$no_x" != "yes"; then
  29. X11LIB="-lx11"
  30. AC_DEFINE(HAVE_X11)
  31. fi
  32. dnl Checks for Slang
  33. AC_CHECK_LIB(slang, init_SLang,[AC_DEFINE(HAVE_LIBSLANG) SLANGLIB="-lslang"])
  34. AC_SUBST(SLANGLIB)
  35. dnl Checks for GPM
  36. AC_ARG_WITH(gpm,[ --without-gpm do not use GPM mouse support])
  37. if test "$with_gpm" != "no"; then
  38. AC_CHECK_LIB(gpm, Gpm_Open,[AC_DEFINE(HAVE_LIBGPM) GPMLIB="-lgpm"])
  39. AC_SUBST(GPMLIB)
  40. fi
  41. dnl Converts the ARCH to be the same as dpkg
  42. AC_MSG_CHECKING(system architecture)
  43. archset="`awk '$1 == "'$host_cpu'" { print $2 }' $srcdir/buildlib/archtable`"
  44. if test "x$archset" = "x"; then
  45. AC_MSG_ERROR(failed: use --host=)
  46. fi
  47. AC_MSG_RESULT($archset)
  48. AC_DEFINE_UNQUOTED(PKG_DEB_ARCH,"$archset")
  49. dnl Check the sizes etc. of the architecture
  50. changequote(,)
  51. if archline="`sed -ne 's/^'$archset':[ ]\+\(.*\)/\1/gp' $srcdir/buildlib/sizetable`"; then
  52. changequote([,])
  53. set $archline
  54. if test "$1" = "little"; then
  55. ac_cv_c_bigendian=no
  56. else
  57. ac_cv_c_bigendian=yes
  58. fi
  59. size_char=$2
  60. size_int=$3
  61. size_short=$4
  62. size_long=$5
  63. fi
  64. if test "$cross_compiling" = "yes" -a "$archline" = ""; then
  65. AC_MSG_ERROR(When cross compiling, architecture must be present in sizetable)
  66. fi
  67. AC_C_BIGENDIAN
  68. AC_CHECK_SIZEOF(char,$size_char)
  69. AC_CHECK_SIZEOF(int,$size_int)
  70. AC_CHECK_SIZEOF(short,$size_short)
  71. AC_CHECK_SIZEOF(long,$size_long)
  72. dnl Check for debiandoc
  73. AC_CHECK_PROG(DEBIANDOC_HTML,debiandoc2html,"yes","")
  74. AC_CHECK_PROG(DEBIANDOC_TEXT,debiandoc2text,"yes","")
  75. AC_OUTPUT(environment.mak:buildlib/environment.mak.in makefile:buildlib/makefile.in,make dirs)