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
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.
12 dnl 'make -f Makefile startup' will generate the configure file from
13 dnl configure.in correctly and can be run at any time
16 AC_CONFIG_AUX_DIR(buildlib)
17 AC_CONFIG_HEADER(include/config.h:buildlib/config.h.in)
19 dnl -- SET THIS TO THE RELEASE VERSION --
20 AC_DEFINE_UNQUOTED(VERSION,"0.3.2")
21 AC_DEFINE_UNQUOTED(PACKAGE,"apt")
24 tl_CHECK_TOOL_PREFIX dnl Initial guess
26 dnl Check our C compiler
30 dnl Check the host arch (build+target not needed... yet)
32 tl_CHECK_TOOL_PREFIX dnl recheck, in case the initial guess was wrong
34 dnl Check for other programs
43 if test "$no_x" != "yes"; then
47 AC_CHECK_LIB(Xpm, XpmLibraryVersion,[AC_DEFINE(HAVE_LIBXPM) XPMLIB="-lXpm"],,$X_LIBS $X_PRE_LIBS $X11LIB $X_EXTRA_LIBS)
49 if test "$XPMLIB" != "-lXpm"; then
50 AC_MSG_ERROR(failed: I need xpm if you are building for X)
55 AC_CHECK_LIB(slang, SLang_Version,[AC_DEFINE(HAVE_LIBSLANG) SLANGLIB="-lslang"])
59 AC_ARG_WITH(gpm,[ --without-gpm do not use GPM mouse support])
60 if test "$with_gpm" != "no"; then
61 AC_CHECK_LIB(gpm, Gpm_Open,[AC_DEFINE(HAVE_LIBGPM) GPMLIB="-lgpm"])
65 dnl Checks for pthread
66 AC_CHECK_LIB(pthread, pthread_create,[AC_DEFINE(HAVE_PTHREAD) PTHREADLIB="-lpthread"])
68 if test "$PTHREADLIB" != "-lpthread"; then
69 AC_MSG_ERROR(failed: I need posix threads, pthread)
72 dnl Converts the ARCH to be the same as dpkg
73 AC_MSG_CHECKING(system architecture)
74 archset="`awk '$1 == "'$host_cpu'" { print $2 }' $srcdir/buildlib/archtable`"
75 if test "x$archset" = "x"; then
76 AC_MSG_ERROR(failed: use --host=)
78 AC_MSG_RESULT($archset)
79 AC_DEFINE_UNQUOTED(ARCHITECTURE,"$archset")
81 dnl Check the sizes etc. of the architecture
83 if archline="`sed -ne 's/^'$archset':[ ]\+\(.*\)/\1/gp' $srcdir/buildlib/sizetable`"; then
86 if test "$1" = "little"; then
96 if test "$cross_compiling" = "yes" -a "$archline" = ""; then
97 AC_MSG_ERROR(When cross compiling, architecture must be present in sizetable)
100 AC_CHECK_SIZEOF(char,$size_char)
101 AC_CHECK_SIZEOF(int,$size_int)
102 AC_CHECK_SIZEOF(short,$size_short)
103 AC_CHECK_SIZEOF(long,$size_long)
105 dnl Check for debiandoc
106 AC_CHECK_PROG(DEBIANDOC_HTML,debiandoc2html,"yes","")
107 AC_CHECK_PROG(DEBIANDOC_TEXT,debiandoc2text,"yes","")
110 AC_CHECK_PROG(YODL_MAN,yodl2man,"yes","")
112 AC_OUTPUT(environment.mak:buildlib/environment.mak.in makefile:buildlib/makefile.in,make dirs)