]> git.saurik.com Git - apt.git/blob - configure.in
4d9a6ce153631cfc78683188e0a580c0754d357f
[apt.git] / configure.in
1 ad
2 dnl Process this file with autoconf to produce a configure script.
3 dnl The ONLY thing this is used for is to configure for different
4 dnl linux architectures and configurations, it is not used to make the
5 dnl code more portable
6
7 dnl You MUST have an environment that has all the POSIX functions and
8 dnl some of the more populare bsd/sysv ones (like select). You'll also
9 dnl need a C++ compiler that is semi-standard conformant, exceptions are
10 dnl not used but STL is.
11
12 AC_INIT(configure.in)
13 AC_CONFIG_AUX_DIR(buildlib)
14 AC_CONFIG_HEADER(include/config.h:buildlib/config.h.in)
15
16 dnl -- SET THIS TO THE RELEASE VERSION --
17 AC_DEFINE_UNQUOTED(VERSION,"0.3.0")
18 AC_DEFINE_UNQUOTED(PACKAGE,"apt")
19
20 dnl Tom's host stuff
21 tl_CHECK_TOOL_PREFIX dnl Initial guess
22
23 dnl Check our C compiler
24 tl_PROG_CC
25 AC_ISC_POSIX
26
27 dnl Check the host arch (build+target not needed... yet)
28 tl_CANONICAL_HOST
29 tl_CHECK_TOOL_PREFIX dnl recheck, in case the initial guess was wrong
30
31 dnl Check for other programs
32 tl_PROG_CXX
33 AC_LANG_CPLUSPLUS
34
35 dnl Checks for X11
36 AC_PATH_X
37 AC_PATH_XTRA
38 AC_SUBST(X11LIB)
39 X11LIB=
40 if test "$no_x" != "yes"; then
41 X11LIB="-lX11"
42 AC_DEFINE(HAVE_X11)
43 dnl Checks for ZPM
44 AC_CHECK_LIB(Xpm, XpmLibraryVersion,[AC_DEFINE(HAVE_LIBXPM) XPMLIB="-lXpm"],,$X_LIBS $X_PRE_LIBS $X11LIB $X_EXTRA_LIBS)
45 AC_SUBST(XPMLIB)
46 if test "$XPMLIB" != "-lXpm"; then
47 AC_MSG_ERROR(failed: I need xpm if you are building for X)
48 fi
49 fi
50
51 dnl Checks for Slang
52 AC_CHECK_LIB(slang, SLang_Version,[AC_DEFINE(HAVE_LIBSLANG) SLANGLIB="-lslang"])
53 AC_SUBST(SLANGLIB)
54
55 dnl Checks for GPM
56 AC_ARG_WITH(gpm,[ --without-gpm do not use GPM mouse support])
57 if test "$with_gpm" != "no"; then
58 AC_CHECK_LIB(gpm, Gpm_Open,[AC_DEFINE(HAVE_LIBGPM) GPMLIB="-lgpm"])
59 AC_SUBST(GPMLIB)
60 fi
61
62 dnl Checks for pthread
63 AC_CHECK_LIB(pthread, pthread_create,[AC_DEFINE(HAVE_PTHREAD) PTHREADLIB="-lpthread"])
64 AC_SUBST(PTHREADLIB)
65 if test "$PTHREADLIB" != "-lpthread"; then
66 AC_MSG_ERROR(failed: I need posix threads, pthread)
67 fi
68
69 dnl Converts the ARCH to be the same as dpkg
70 AC_MSG_CHECKING(system architecture)
71 archset="`awk '$1 == "'$host_cpu'" { print $2 }' $srcdir/buildlib/archtable`"
72 if test "x$archset" = "x"; then
73 AC_MSG_ERROR(failed: use --host=)
74 fi
75 AC_MSG_RESULT($archset)
76 AC_DEFINE_UNQUOTED(ARCHITECTURE,"$archset")
77
78 dnl Check the sizes etc. of the architecture
79 changequote(,)
80 if archline="`sed -ne 's/^'$archset':[ ]\+\(.*\)/\1/gp' $srcdir/buildlib/sizetable`"; then
81 changequote([,])
82 set $archline
83 if test "$1" = "little"; then
84 ac_cv_c_bigendian=no
85 else
86 ac_cv_c_bigendian=yes
87 fi
88 size_char=$2
89 size_int=$3
90 size_short=$4
91 size_long=$5
92 fi
93 if test "$cross_compiling" = "yes" -a "$archline" = ""; then
94 AC_MSG_ERROR(When cross compiling, architecture must be present in sizetable)
95 fi
96 AC_C_BIGENDIAN
97 AC_CHECK_SIZEOF(char,$size_char)
98 AC_CHECK_SIZEOF(int,$size_int)
99 AC_CHECK_SIZEOF(short,$size_short)
100 AC_CHECK_SIZEOF(long,$size_long)
101
102 dnl Check for debiandoc
103 AC_CHECK_PROG(DEBIANDOC_HTML,debiandoc2html,"yes","")
104 AC_CHECK_PROG(DEBIANDOC_TEXT,debiandoc2text,"yes","")
105
106 AC_OUTPUT(environment.mak:buildlib/environment.mak.in makefile:buildlib/makefile.in,make dirs)