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