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