]> git.saurik.com Git - apt.git/blame - configure.in
Added build depends.
[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)
53d3d263 17AC_CONFIG_HEADER(include/config.h:buildlib/config.h.in include/netdb.h:buildlib/netdb.h.in)
d7bccc73 18
e1b74f61 19dnl -- SET THIS TO THE RELEASE VERSION --
53d3d263 20AC_DEFINE_UNQUOTED(VERSION,"0.3.15.1")
e1b74f61
AL
21AC_DEFINE_UNQUOTED(PACKAGE,"apt")
22
d7bccc73 23dnl Check our C compiler
abb9b874 24AC_CHECK_TOOL_PREFIX
f43579d1 25AC_PROG_CC
d7bccc73
AL
26AC_ISC_POSIX
27
28dnl Check the host arch (build+target not needed... yet)
f43579d1
AL
29AC_CANONICAL_HOST
30AC_CHECK_TOOL_PREFIX dnl recheck, in case the initial guess was wrong
d7bccc73
AL
31
32dnl Check for other programs
f43579d1 33AC_PROG_CXX
b819effd
AL
34AC_PROG_CPP
35AC_PROG_RANLIB
36AC_CHECK_TOOL(AR,ar,"ar")
d7bccc73 37
abb9b874
AL
38dnl Checks for sockets
39SAVE_LIBS="$LIBS"
40LIBS=""
41AC_SEARCH_LIBS(gethostbyname,nsl)
42AC_SEARCH_LIBS(connect,socket)
43SOCKETLIBS="$LIBS"
44AC_SUBST(SOCKETLIBS)
45LIBS="$SAVE_LIBS"
d7bccc73 46
abb9b874
AL
47dnl Section Disabled pending removal of deity widget library -- jgg
48if test "yes" != "yes"; then
49 dnl Checks for X11
50 AC_PATH_X
51 AC_PATH_XTRA
52 AC_SUBST(X11LIB)
53 X11LIB=
54 if test "$no_x" != "yes"; then
55 X11LIB="-lX11"
56 AC_DEFINE(HAVE_X11)
57 dnl Checks for ZPM
58 AC_CHECK_LIB(Xpm, XpmLibraryVersion,[AC_DEFINE(HAVE_LIBXPM) XPMLIB="-lXpm"],,$X_LIBS $X_PRE_LIBS $X11LIB $X_EXTRA_LIBS)
59 AC_SUBST(XPMLIB)
60 if test "$XPMLIB" != "-lXpm"; then
61 AC_MSG_ERROR(failed: I need xpm if you are building for X)
62 fi
63 fi
64
65 dnl Checks for Slang
66 AC_CHECK_LIB(slang, SLang_Version,[AC_DEFINE(HAVE_LIBSLANG) SLANGLIB="-lslang"])
67 AC_SUBST(SLANGLIB)
68
69 dnl Checks for GPM
70 AC_ARG_WITH(gpm,[ --without-gpm do not use GPM mouse support])
71 if test "$with_gpm" != "no"; then
72 AC_CHECK_LIB(gpm, Gpm_Open,[AC_DEFINE(HAVE_LIBGPM) GPMLIB="-lgpm"])
73 AC_SUBST(GPMLIB)
74 fi
d7bccc73
AL
75fi
76
e1b74f61 77dnl Checks for pthread
afd9aaf3 78#AC_CHECK_LIB(pthread, pthread_create,[AC_DEFINE(HAVE_PTHREAD) PTHREADLIB="-lpthread"])
4fe67779
AL
79AC_SUBST(PTHREADLIB)
80#if test "$PTHREADLIB" != "-lpthread"; then
81# AC_MSG_ERROR(failed: I need posix threads, pthread)
82#fi
e1b74f61 83
d7bccc73
AL
84dnl Converts the ARCH to be the same as dpkg
85AC_MSG_CHECKING(system architecture)
90f0deb3 86archset="`awk \"{ if(\\\$1 == \\\"$host_cpu\\\") print \\\$2 }\" $srcdir/buildlib/archtable`"
d7bccc73
AL
87if test "x$archset" = "x"; then
88 AC_MSG_ERROR(failed: use --host=)
89fi
90AC_MSG_RESULT($archset)
e1b74f61 91AC_DEFINE_UNQUOTED(ARCHITECTURE,"$archset")
d7bccc73 92
021988ea
AL
93dnl We use C9x types if at all possible
94AC_CACHE_CHECK([for C9x integer types],c9x_ints,[
95 AC_TRY_COMPILE([#include <inttypes.h>],
1ae93c94 96 [uint8_t Foo1;uint16_t Foo2;uint32_t Foo3;],
021988ea
AL
97 c9x_ints=yes,c9x_ints=no)])
98
101030ab 99dnl Single Unix Spec statvfs
f58a97d3 100AC_CHECK_FUNC(statvfs,[HAVE_STATVFS=yes])
101030ab
AL
101AC_SUBST(HAVE_STATVFS)
102
b819effd
AL
103dnl Arg, linux and bsd put their statfs function in different places
104if test x"$HAVE_STATVFS" != x"yes"; then
105 AC_EGREP_HEADER(statfs,sys/vfs.h,[AC_DEFINE(HAVE_VFS_H)],[
106 AC_EGREP_HEADER(statfs,sys/mount.h,[AC_DEFINE(HAVE_MOUNT_H)],[AC_MSG_ERROR(failed: Need statvfs)])
107 ])
108fi
109
83ab33fc
AL
110dnl Check the sizes etc. of the architecture
111changequote(,)
c0f45387 112if archline="`grep \"^$archset\" $srcdir/buildlib/sizetable | cut -f 2- -d ' '`";then
83ab33fc
AL
113 changequote([,])
114 set $archline
115 if test "$1" = "little"; then
116 ac_cv_c_bigendian=no
117 else
118 ac_cv_c_bigendian=yes
021988ea 119 fi
83ab33fc
AL
120 size_char=$2
121 size_int=$3
122 size_short=$4
123 size_long=$5
124fi
021988ea 125
83ab33fc
AL
126if test "$cross_compiling" = "yes" -a "$archline" = ""; then
127 AC_MSG_ERROR(When cross compiling, architecture must be present in sizetable)
128fi
129AC_C_BIGENDIAN
021988ea 130
83ab33fc 131dnl We do not need this if we have inttypes..
51761e5e 132HAVE_C9X=yes
83ab33fc 133if test x"$c9x_ints" = x"no"; then
021988ea
AL
134 AC_CHECK_SIZEOF(char,$size_char)
135 AC_CHECK_SIZEOF(int,$size_int)
136 AC_CHECK_SIZEOF(short,$size_short)
137 AC_CHECK_SIZEOF(long,$size_long)
51761e5e
AL
138
139 HAVE_C9X=
140 AC_SUBST(HAVE_C9X)
021988ea 141fi
d7bccc73 142
53d3d263
AL
143AC_MSG_CHECKING(for socklen_t)
144AC_EGREP_HEADER(socklen_t, sys/socket.h, [
145 AC_DEFINE(HAVE_SYS_SOCKET_H)
146 AC_MSG_RESULT(sys/socket.h)
147], [
148 AC_DEFINE(NEED_SOCKLEN_T_DEFINE)
149 AC_MSG_RESULT([socklen_t size_t])
150])
151
152AC_MSG_CHECKING(for h_errno)
153AC_EGREP_HEADER(h_errno, netdb.h, [AC_DEFINE(HAVE_NETDB_H)
154 AC_MSG_RESULT(found)
155], [AC_TRY_COMPILE(netdb.h, h_errno foo, [AC_MSG_RESULT(found)
156 AC_MSG_RESULT(found)
157 ], [ah_CFLAGS="$CFLAGS"
158 CFLAGS="$CFLAGS -D_XOPEN_SOURCE_EXTENDED"
159 AC_TRY_COMPILE([netdb.h], [h_errno foo], [AC_DEFINE(NEED_XOPEN_NETDB_H)
160 AC_MSG_RESULT([found, needed -D_XOPEN_SOURCE_EXTENDED])
161 ], [CFLAGS="$ah_CFLAGS"
162 AC_MSG_ERROR(["not found."])
163 ])
164 ])
165])
166
d7bccc73
AL
167dnl Check for debiandoc
168AC_CHECK_PROG(DEBIANDOC_HTML,debiandoc2html,"yes","")
169AC_CHECK_PROG(DEBIANDOC_TEXT,debiandoc2text,"yes","")
170
8a9ec519 171dnl Check for YODL
35c22def 172AC_CHECK_PROG(YODL_MAN,yodl2man,"yes","")
8a9ec519 173
f43579d1
AL
174ah_NUM_PROCS
175
51761e5e 176AC_OUTPUT(environment.mak:buildlib/environment.mak.in makefile:buildlib/makefile.in,make dirs)