-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfigure.ac
173 lines (154 loc) · 4.72 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
dnl Process this file with autoconf to produce a configure script.
AC_INIT(wopr, 1.git)
AC_CONFIG_SRCDIR(src/main.cc)
AC_CONFIG_MACRO_DIR([m4])
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE
AC_PROG_CXX
AC_PROG_INSTALL
# This "magic" seems to be necessary...
if test "x$PKG_CONFIG_PATH" = x; then
export PKG_CONFIG_PATH=""
fi
AC_ARG_WITH([timbl],
[AS_HELP_STRING([--without-timbl],
[disable support for timbl])],
[
AC_MSG_NOTICE([Checking for Timbl])
],
[
AC_MSG_NOTICE([Checking for Timbl])
with_timbl=yes
])
AS_IF([test "x$with_timbl" != xno],
[
AC_MSG_NOTICE([Checking for Timbl])
AC_ARG_WITH(timbl,
[ --with-timbl=DIR use timbl installed in <DIR>],
[
PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$withval/lib/pkgconfig"
AC_DEFINE_UNQUOTED(TIMBL,"$withval",[ Have Timbl ])
],
[
PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$prefix/lib/pkgconfig"
AC_DEFINE_UNQUOTED(TIMBL,"$prefix",[ Have Timbl ])
])
PKG_CHECK_MODULES([timbl], [timbl >= 6.2.1] )
CXXFLAGS="$CXXFLAGS $timbl_CFLAGS"
LIBS="$LIBS $timbl_LIBS"
]
)
# Checks for timblserve library.
#AC_ARG_WITH(timblserver,
# [ --with-timblserver=DIR use timblserver installed in <DIR>;
# note that you can install Timbl in a non-default directory with
# ./configure --prefix=<DIR> in the Timbl installation directory],
# [PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$withval/lib/pkgconfig"
# AC_DEFINE_UNQUOTED(TIMBLSERVER,"$prefix",[ Have TimblServer ])
# AC_MSG_NOTICE( [pkg-config search path: $PKG_CONFIG_PATH] )
#PKG_CHECK_MODULES([timblserver], [timblserver >= 1.0.0] )
#CXXFLAGS="$CXXFLAGS $timblserver_CFLAGS"
#LIBS="$LIBS $timblserver_LIBS"
#])
AC_DEFINE_UNQUOTED(TIMBLSERVER,"yes",[ Have TimblServer ])
dnl ------ socklen_t
dnl We check for socklen_t by making prototypes with the
dnl various types. First socklen_t, then size_t, finally int.
dnl If the prototype succeeds, we are probably safe.
dnl That works if accept is not preprocessor defined (such sa AIX)
AC_MSG_CHECKING([for socklen_t])
AC_CACHE_VAL(ac_cv_check_socklen_t,[ac_cv_check_socklen_t=''
AC_TRY_COMPILE([
#include <sys/types.h>
#include <sys/socket.h>
#ifdef __cplusplus
extern "C" {
#endif
#define try 1
#ifdef AIX
#if AIX >= 51
#define try 0
#endif
#endif
#if try
extern int accept(int, struct sockaddr *, socklen_t *);
#endif
#ifdef __cplusplus
}
#endif
],,[ac_cv_check_socklen_t=socklen_t],[
AC_TRY_COMPILE([
#include <sys/types.h>
#include <sys/socket.h>
#ifdef __cplusplus
extern "C" {
#endif
#define try 1
#ifdef AIX
#if AIX >= 42
#define try 0
#endif
#endif
#if try
extern int accept(int, struct sockaddr *, size_t t *);
#endif
#ifdef __cplusplus
}
#endif
],,[ac_cv_check_socklen_t=size_t],[ac_cv_check_socklen_t=int])
])
])
AC_MSG_RESULT($ac_cv_check_socklen_t)
AC_DEFINE_UNQUOTED(TIMBL_SOCKLEN_T,$ac_cv_check_socklen_t, "sock_len" )
AC_CHECK_HEADER([pthread.h],
[AC_DEFINE([PTHREADS], [1], [pthreads]) LIBS="-lpthread $LIBS"])
AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [Enable debugging support]),
[ if test x$enableval = xyes ; then
AC_DEFINE(DEBUG,1,[ Define to enable debugging. ])
fi
])
# Fix problems 32/64 bits
AC_TYPE_SIZE_T
if test "$ac_cv_type_size_t" = "yes"; then
size_t_value="size_t"
else
size_t_value="switch_int32_t"
fi
AC_DEFINE_UNQUOTED(WOPR_SIZE_T,$size_t_value, "size_t" )
AC_DEFINE_UNQUOTED(HAVE_SIZE_T,$ac_cv_type_size_t, "have_size_t" )
## from ucto
#
useICU=1;
# inspired by feh-1.3.4/configure.ac. Tnx Tom Gilbert and feh hackers.
AC_ARG_WITH(icu,
[ --with-icu=DIR use ICU installed in <DIR>],
[if test "$with_icu" = "no"; then
useICU=0
else
CXXFLAGS="$CXXFLAGS -I$withval/include"
LIBS="-L$withval/lib $LIBS"
fi] )
if test "$useICU" = "1"; then
AX_ICU_CHECK( [3.6],
[CXXFLAGS="$CXXFLAGS $ICU_CPPSEARCHPATH"
LIBS="$ICU_LIBPATH $ICU_LIBS $ICU_IOLIBS $LIBS"],
[AC_MSG_FAILURE( "No ICU development environment found. Please check if libicu-dev or the like is installed" )] )
AC_DEFINE(HAVE_ICU, 1, we want to use ICU )
else
#AC_MSG_ERROR("ICU support is required")
AC_MSG_NOTICE([No ICU support])
#AC_DEFINE(HAVE_NOICU, 0, we do not want to use ICU )
fi
# ---
# Levenshtein distance transposition
#
AC_ARG_WITH(transpose, [ --with-transpose make transpose LD:1])
if test "$with_transpose" == "yes"
then
AC_MSG_NOTICE([You enabled transpose LD:1.])
else
AC_MSG_NOTICE([Transpose is LD:2.])
AC_DEFINE(TRANSPLD2, 1, we want transpose to be LD:2 )
fi
# ---
AC_OUTPUT(Makefile)