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