]>
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 -- |
676478c3 | 20 | AC_DEFINE_UNQUOTED(VERSION,"0.3.15") |
e1b74f61 AL |
21 | AC_DEFINE_UNQUOTED(PACKAGE,"apt") |
22 | ||
d7bccc73 | 23 | dnl Check our C compiler |
abb9b874 | 24 | AC_CHECK_TOOL_PREFIX |
f43579d1 | 25 | AC_PROG_CC |
d7bccc73 AL |
26 | AC_ISC_POSIX |
27 | ||
28 | dnl Check the host arch (build+target not needed... yet) | |
f43579d1 AL |
29 | AC_CANONICAL_HOST |
30 | AC_CHECK_TOOL_PREFIX dnl recheck, in case the initial guess was wrong | |
d7bccc73 AL |
31 | |
32 | dnl Check for other programs | |
f43579d1 | 33 | AC_PROG_CXX |
abb9b874 | 34 | #AC_LANG_CPLUSPLUS |
d7bccc73 | 35 | |
abb9b874 AL |
36 | dnl Checks for sockets |
37 | SAVE_LIBS="$LIBS" | |
38 | LIBS="" | |
39 | AC_SEARCH_LIBS(gethostbyname,nsl) | |
40 | AC_SEARCH_LIBS(connect,socket) | |
41 | SOCKETLIBS="$LIBS" | |
42 | AC_SUBST(SOCKETLIBS) | |
43 | LIBS="$SAVE_LIBS" | |
d7bccc73 | 44 | |
abb9b874 AL |
45 | dnl Section Disabled pending removal of deity widget library -- jgg |
46 | if test "yes" != "yes"; then | |
47 | dnl Checks for X11 | |
48 | AC_PATH_X | |
49 | AC_PATH_XTRA | |
50 | AC_SUBST(X11LIB) | |
51 | X11LIB= | |
52 | if test "$no_x" != "yes"; then | |
53 | X11LIB="-lX11" | |
54 | AC_DEFINE(HAVE_X11) | |
55 | dnl Checks for ZPM | |
56 | AC_CHECK_LIB(Xpm, XpmLibraryVersion,[AC_DEFINE(HAVE_LIBXPM) XPMLIB="-lXpm"],,$X_LIBS $X_PRE_LIBS $X11LIB $X_EXTRA_LIBS) | |
57 | AC_SUBST(XPMLIB) | |
58 | if test "$XPMLIB" != "-lXpm"; then | |
59 | AC_MSG_ERROR(failed: I need xpm if you are building for X) | |
60 | fi | |
61 | fi | |
62 | ||
63 | dnl Checks for Slang | |
64 | AC_CHECK_LIB(slang, SLang_Version,[AC_DEFINE(HAVE_LIBSLANG) SLANGLIB="-lslang"]) | |
65 | AC_SUBST(SLANGLIB) | |
66 | ||
67 | dnl Checks for GPM | |
68 | AC_ARG_WITH(gpm,[ --without-gpm do not use GPM mouse support]) | |
69 | if test "$with_gpm" != "no"; then | |
70 | AC_CHECK_LIB(gpm, Gpm_Open,[AC_DEFINE(HAVE_LIBGPM) GPMLIB="-lgpm"]) | |
71 | AC_SUBST(GPMLIB) | |
72 | fi | |
d7bccc73 AL |
73 | fi |
74 | ||
e1b74f61 | 75 | dnl Checks for pthread |
afd9aaf3 | 76 | #AC_CHECK_LIB(pthread, pthread_create,[AC_DEFINE(HAVE_PTHREAD) PTHREADLIB="-lpthread"]) |
4fe67779 AL |
77 | AC_SUBST(PTHREADLIB) |
78 | #if test "$PTHREADLIB" != "-lpthread"; then | |
79 | # AC_MSG_ERROR(failed: I need posix threads, pthread) | |
80 | #fi | |
e1b74f61 | 81 | |
d7bccc73 AL |
82 | dnl Converts the ARCH to be the same as dpkg |
83 | AC_MSG_CHECKING(system architecture) | |
90f0deb3 | 84 | archset="`awk \"{ if(\\\$1 == \\\"$host_cpu\\\") print \\\$2 }\" $srcdir/buildlib/archtable`" |
d7bccc73 AL |
85 | if test "x$archset" = "x"; then |
86 | AC_MSG_ERROR(failed: use --host=) | |
87 | fi | |
88 | AC_MSG_RESULT($archset) | |
e1b74f61 | 89 | AC_DEFINE_UNQUOTED(ARCHITECTURE,"$archset") |
d7bccc73 | 90 | |
021988ea AL |
91 | dnl We use C9x types if at all possible |
92 | AC_CACHE_CHECK([for C9x integer types],c9x_ints,[ | |
93 | AC_TRY_COMPILE([#include <inttypes.h>], | |
1ae93c94 | 94 | [uint8_t Foo1;uint16_t Foo2;uint32_t Foo3;], |
021988ea AL |
95 | c9x_ints=yes,c9x_ints=no)]) |
96 | ||
101030ab | 97 | dnl Single Unix Spec statvfs |
f58a97d3 | 98 | AC_CHECK_FUNC(statvfs,[HAVE_STATVFS=yes]) |
101030ab AL |
99 | AC_SUBST(HAVE_STATVFS) |
100 | ||
83ab33fc AL |
101 | dnl Check the sizes etc. of the architecture |
102 | changequote(,) | |
c0f45387 | 103 | if archline="`grep \"^$archset\" $srcdir/buildlib/sizetable | cut -f 2- -d ' '`";then |
83ab33fc AL |
104 | changequote([,]) |
105 | set $archline | |
106 | if test "$1" = "little"; then | |
107 | ac_cv_c_bigendian=no | |
108 | else | |
109 | ac_cv_c_bigendian=yes | |
021988ea | 110 | fi |
83ab33fc AL |
111 | size_char=$2 |
112 | size_int=$3 | |
113 | size_short=$4 | |
114 | size_long=$5 | |
115 | fi | |
021988ea | 116 | |
83ab33fc AL |
117 | if test "$cross_compiling" = "yes" -a "$archline" = ""; then |
118 | AC_MSG_ERROR(When cross compiling, architecture must be present in sizetable) | |
119 | fi | |
120 | AC_C_BIGENDIAN | |
021988ea | 121 | |
83ab33fc | 122 | dnl We do not need this if we have inttypes.. |
51761e5e | 123 | HAVE_C9X=yes |
83ab33fc | 124 | if test x"$c9x_ints" = x"no"; then |
021988ea AL |
125 | AC_CHECK_SIZEOF(char,$size_char) |
126 | AC_CHECK_SIZEOF(int,$size_int) | |
127 | AC_CHECK_SIZEOF(short,$size_short) | |
128 | AC_CHECK_SIZEOF(long,$size_long) | |
51761e5e AL |
129 | |
130 | HAVE_C9X= | |
131 | AC_SUBST(HAVE_C9X) | |
021988ea | 132 | fi |
d7bccc73 AL |
133 | |
134 | dnl Check for debiandoc | |
135 | AC_CHECK_PROG(DEBIANDOC_HTML,debiandoc2html,"yes","") | |
136 | AC_CHECK_PROG(DEBIANDOC_TEXT,debiandoc2text,"yes","") | |
137 | ||
8a9ec519 | 138 | dnl Check for YODL |
35c22def | 139 | AC_CHECK_PROG(YODL_MAN,yodl2man,"yes","") |
8a9ec519 | 140 | |
f43579d1 AL |
141 | ah_NUM_PROCS |
142 | ||
51761e5e | 143 | AC_OUTPUT(environment.mak:buildlib/environment.mak.in makefile:buildlib/makefile.in,make dirs) |