]> git.decadent.org.uk Git - dak.git/blob - tools/dsync-0.0/configure.in
LOCAL: Remove replay check
[dak.git] / tools / dsync-0.0 / configure.in
1 ad
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 popular 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
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
15 AC_INIT(configure.in)
16 AC_CONFIG_AUX_DIR(buildlib)
17 AC_CONFIG_HEADER(include/config.h:buildlib/config.h.in)
18
19 dnl -- SET THIS TO THE RELEASE VERSION --
20 AC_DEFINE_UNQUOTED(VERSION,"0.0")
21 AC_DEFINE_UNQUOTED(PACKAGE,"dsync")
22
23 AC_CHECK_TOOL_PREFIX    dnl Initial guess
24
25 dnl Check our C compiler
26 AC_PROG_CC
27 AC_ISC_POSIX
28
29 dnl Check the host arch (build+target not needed... yet)
30 AC_CANONICAL_HOST
31 AC_CHECK_TOOL_PREFIX    dnl recheck, in case the initial guess was wrong
32
33 dnl Check for other programs
34 AC_PROG_CXX
35 AC_LANG_CPLUSPLUS
36 AC_CHECK_TOOL(AR,ar, :)
37
38 if test "$AR" = ":"; then
39      AC_MSG_ERROR(failed: Sorry I could not find ar in the path)
40 fi
41
42 dnl Checks for pthread
43 AC_CHECK_LIB(pthread, pthread_create,[AC_DEFINE(HAVE_PTHREAD) PTHREADLIB="-lpthread"])
44 AC_SUBST(PTHREADLIB)
45
46 dnl Converts the ARCH to be the same as dpkg
47 AC_MSG_CHECKING(system architecture)
48 archset="`awk '$1 == "'$host_cpu'" { print $2 }' $srcdir/buildlib/archtable`"
49 if test "x$archset" = "x"; then
50   AC_MSG_ERROR(failed: use --host=)
51 fi
52 AC_MSG_RESULT($archset)
53 AC_DEFINE_UNQUOTED(ARCHITECTURE,"$archset")
54
55 dnl We use C9x types if at all possible
56 AC_CACHE_CHECK([for C9x integer types],c9x_ints,[
57     AC_TRY_COMPILE([#include <inttypes.h>],
58                    [uint8_t Foo1;uint16_t Foo2;uint32_t Foo3;uint64_t Foo],
59                    c9x_ints=yes,c9x_ints=no)])
60
61 dnl Check the sizes etc. of the architecture
62 changequote(,)
63 if archline="`sed -ne 's/^'$archset':[  ]\+\(.*\)/\1/gp' $srcdir/buildlib/sizetable`"; then
64    changequote([,])
65    set $archline
66    if test "$1" = "little"; then
67       ac_cv_c_bigendian=no
68    else
69       ac_cv_c_bigendian=yes
70    fi
71    size_char=$2
72    size_int=$3
73    size_short=$4
74    size_long=$5
75 fi
76
77 if test "$cross_compiling" = "yes" -a "$archline" = ""; then
78   AC_MSG_ERROR(When cross compiling, architecture must be present in sizetable)
79 fi
80 AC_C_BIGENDIAN
81    
82 dnl We do not need this if we have inttypes..
83 HAVE_C9X=yes
84 if test x"$c9x_ints" = x"no"; then
85    AC_CHECK_SIZEOF(char,$size_char)
86    AC_CHECK_SIZEOF(int,$size_int)
87    AC_CHECK_SIZEOF(short,$size_short)
88    AC_CHECK_SIZEOF(long,$size_long)
89   
90    HAVE_C9X=
91    AC_SUBST(HAVE_C9X)
92 fi
93
94 dnl Check for debiandoc
95 AC_CHECK_PROG(DEBIANDOC_HTML,debiandoc2html,"yes","")
96 AC_CHECK_PROG(DEBIANDOC_TEXT,debiandoc2text,"yes","")
97
98 dnl Check for YODL
99 AC_CHECK_PROG(YODL_MAN,yodl2man,"yes","")
100
101 AC_OUTPUT(environment.mak:buildlib/environment.mak.in makefile:buildlib/makefile.in,make dirs)