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