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