]> git.saurik.com Git - apt.git/blame_incremental - configure.in
Havocs cancel patch
[apt.git] / configure.in
... / ...
CommitLineData
1ad
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
12dnl 'make -f Makefile startup' will generate the configure file from
13dnl configure.in correctly and can be run at any time
14
15AC_INIT(configure.in)
16AC_CONFIG_AUX_DIR(buildlib)
17AC_CONFIG_HEADER(include/config.h:buildlib/config.h.in)
18
19dnl -- SET THIS TO THE RELEASE VERSION --
20AC_DEFINE_UNQUOTED(VERSION,"0.3.6")
21AC_DEFINE_UNQUOTED(PACKAGE,"apt")
22
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
37dnl Checks for X11
38AC_PATH_X
39AC_PATH_XTRA
40AC_SUBST(X11LIB)
41X11LIB=
42if test "$no_x" != "yes"; then
43 X11LIB="-lX11"
44 AC_DEFINE(HAVE_X11)
45 dnl Checks for ZPM
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
51fi
52
53dnl Checks for Slang
54AC_CHECK_LIB(slang, SLang_Version,[AC_DEFINE(HAVE_LIBSLANG) SLANGLIB="-lslang"])
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
60 AC_CHECK_LIB(gpm, Gpm_Open,[AC_DEFINE(HAVE_LIBGPM) GPMLIB="-lgpm"])
61 AC_SUBST(GPMLIB)
62fi
63
64dnl Checks for pthread
65dnl AC_CHECK_LIB(pthread, pthread_create,[AC_DEFINE(HAVE_PTHREAD) PTHREADLIB="-lpthread"])
66dnl AC_SUBST(PTHREADLIB)
67dnl if test "$PTHREADLIB" != "-lpthread"; then
68dnl AC_MSG_ERROR(failed: I need posix threads, pthread)
69dnl fi
70
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)
78AC_DEFINE_UNQUOTED(ARCHITECTURE,"$archset")
79
80dnl Check the sizes etc. of the architecture
81changequote(,)
82if archline="`sed -ne 's/^'$archset':[ ]\+\(.*\)/\1/gp' $srcdir/buildlib/sizetable`"; then
83changequote([,])
84 set $archline
85 if test "$1" = "little"; then
86 ac_cv_c_bigendian=no
87 else
88 ac_cv_c_bigendian=yes
89 fi
90 size_char=$2
91 size_int=$3
92 size_short=$4
93 size_long=$5
94fi
95if test "$cross_compiling" = "yes" -a "$archline" = ""; then
96 AC_MSG_ERROR(When cross compiling, architecture must be present in sizetable)
97fi
98AC_C_BIGENDIAN
99AC_CHECK_SIZEOF(char,$size_char)
100AC_CHECK_SIZEOF(int,$size_int)
101AC_CHECK_SIZEOF(short,$size_short)
102AC_CHECK_SIZEOF(long,$size_long)
103
104dnl Check for debiandoc
105AC_CHECK_PROG(DEBIANDOC_HTML,debiandoc2html,"yes","")
106AC_CHECK_PROG(DEBIANDOC_TEXT,debiandoc2text,"yes","")
107
108dnl Check for YODL
109AC_CHECK_PROG(YODL_MAN,yodl2man,"yes","")
110
111AC_OUTPUT(environment.mak:buildlib/environment.mak.in makefile:buildlib/makefile.in,make dirs)