3 more bugs
[ntk/apt.git] / configure.in
CommitLineData
779e5b00 1ad
d7bccc73
AL
2dnl Process this file with autoconf to produce a configure script.
3dnl The ONLY thing this is used for is to configure for different
4dnl linux architectures and configurations, it is not used to make the
5dnl code more portable
6
7dnl You MUST have an environment that has all the POSIX functions and
8dnl some of the more populare bsd/sysv ones (like select). You'll also
9dnl need a C++ compiler that is semi-standard conformant, exceptions are
10dnl not used but STL is.
11
93bf083d
AL
12dnl 'make -f Makefile startup' will generate the configure file from
13dnl configure.in correctly and can be run at any time
14
d7bccc73 15AC_INIT(configure.in)
066427d0 16AC_CONFIG_AUX_DIR(buildlib)
d7bccc73
AL
17AC_CONFIG_HEADER(include/config.h:buildlib/config.h.in)
18
e1b74f61 19dnl -- SET THIS TO THE RELEASE VERSION --
8b067c22 20AC_DEFINE_UNQUOTED(VERSION,"0.3.14.1")
e1b74f61
AL
21AC_DEFINE_UNQUOTED(PACKAGE,"apt")
22
d7bccc73
AL
23dnl Tom's host stuff
24tl_CHECK_TOOL_PREFIX dnl Initial guess
25
26dnl Check our C compiler
27tl_PROG_CC
28AC_ISC_POSIX
29
30dnl Check the host arch (build+target not needed... yet)
31tl_CANONICAL_HOST
32tl_CHECK_TOOL_PREFIX dnl recheck, in case the initial guess was wrong
33
34dnl Check for other programs
35tl_PROG_CXX
36AC_LANG_CPLUSPLUS
d7bccc73
AL
37dnl Checks for X11
38AC_PATH_X
39AC_PATH_XTRA
40AC_SUBST(X11LIB)
41X11LIB=
42if test "$no_x" != "yes"; then
880e9be4 43 X11LIB="-lX11"
118a5e95 44 AC_DEFINE(HAVE_X11)
c88edf1d 45 dnl Checks for ZPM
880e9be4
AL
46 AC_CHECK_LIB(Xpm, XpmLibraryVersion,[AC_DEFINE(HAVE_LIBXPM) XPMLIB="-lXpm"],,$X_LIBS $X_PRE_LIBS $X11LIB $X_EXTRA_LIBS)
47 AC_SUBST(XPMLIB)
48 if test "$XPMLIB" != "-lXpm"; then
49 AC_MSG_ERROR(failed: I need xpm if you are building for X)
50 fi
d7bccc73
AL
51fi
52
53dnl Checks for Slang
c88edf1d 54AC_CHECK_LIB(slang, SLang_Version,[AC_DEFINE(HAVE_LIBSLANG) SLANGLIB="-lslang"])
d7bccc73
AL
55AC_SUBST(SLANGLIB)
56
57dnl Checks for GPM
58AC_ARG_WITH(gpm,[ --without-gpm do not use GPM mouse support])
59if test "$with_gpm" != "no"; then
118a5e95 60 AC_CHECK_LIB(gpm, Gpm_Open,[AC_DEFINE(HAVE_LIBGPM) GPMLIB="-lgpm"])
d7bccc73
AL
61 AC_SUBST(GPMLIB)
62fi
63
e1b74f61 64dnl Checks for pthread
afd9aaf3 65#AC_CHECK_LIB(pthread, pthread_create,[AC_DEFINE(HAVE_PTHREAD) PTHREADLIB="-lpthread"])
4fe67779
AL
66AC_SUBST(PTHREADLIB)
67#if test "$PTHREADLIB" != "-lpthread"; then
68# AC_MSG_ERROR(failed: I need posix threads, pthread)
69#fi
e1b74f61 70
d7bccc73
AL
71dnl Converts the ARCH to be the same as dpkg
72AC_MSG_CHECKING(system architecture)
73archset="`awk '$1 == "'$host_cpu'" { print $2 }' $srcdir/buildlib/archtable`"
74if test "x$archset" = "x"; then
75 AC_MSG_ERROR(failed: use --host=)
76fi
77AC_MSG_RESULT($archset)
e1b74f61 78AC_DEFINE_UNQUOTED(ARCHITECTURE,"$archset")
d7bccc73 79
021988ea
AL
80dnl We use C9x types if at all possible
81AC_CACHE_CHECK([for C9x integer types],c9x_ints,[
82 AC_TRY_COMPILE([#include <inttypes.h>],
83 [uint8_t Foo1;uint16_t Foo2;uint32_t Foo3;uint64_t Foo],
84 c9x_ints=yes,c9x_ints=no)])
85
83ab33fc
AL
86dnl Check the sizes etc. of the architecture
87changequote(,)
88if archline="`sed -ne 's/^'$archset':[ ]\+\(.*\)/\1/gp' $srcdir/buildlib/sizetable`"; then
89 changequote([,])
90 set $archline
91 if test "$1" = "little"; then
92 ac_cv_c_bigendian=no
93 else
94 ac_cv_c_bigendian=yes
021988ea 95 fi
83ab33fc
AL
96 size_char=$2
97 size_int=$3
98 size_short=$4
99 size_long=$5
100fi
021988ea 101
83ab33fc
AL
102if test "$cross_compiling" = "yes" -a "$archline" = ""; then
103 AC_MSG_ERROR(When cross compiling, architecture must be present in sizetable)
104fi
105AC_C_BIGENDIAN
021988ea 106
83ab33fc 107dnl We do not need this if we have inttypes..
51761e5e 108HAVE_C9X=yes
83ab33fc 109if test x"$c9x_ints" = x"no"; then
021988ea
AL
110 AC_CHECK_SIZEOF(char,$size_char)
111 AC_CHECK_SIZEOF(int,$size_int)
112 AC_CHECK_SIZEOF(short,$size_short)
113 AC_CHECK_SIZEOF(long,$size_long)
51761e5e
AL
114
115 HAVE_C9X=
116 AC_SUBST(HAVE_C9X)
021988ea 117fi
d7bccc73
AL
118
119dnl Check for debiandoc
120AC_CHECK_PROG(DEBIANDOC_HTML,debiandoc2html,"yes","")
121AC_CHECK_PROG(DEBIANDOC_TEXT,debiandoc2text,"yes","")
122
8a9ec519 123dnl Check for YODL
35c22def 124AC_CHECK_PROG(YODL_MAN,yodl2man,"yes","")
8a9ec519 125
51761e5e 126AC_OUTPUT(environment.mak:buildlib/environment.mak.in makefile:buildlib/makefile.in,make dirs)