/rusxmms/librcc

To get this branch, use:
bzr branch http://suren.me/webbzr/rusxmms/librcc
1 by Suren A. Chilingaryan
Initial Import
1
dnl Process this file with autoconf to produce a configure script.
77 by Suren A. Chilingaryan
Fix build system for compatibility with latest versions of automake
2
3
4
AC_INIT(librcc, m4_esyscmd([head -n 1 VERSION | sed -e s/CVS.*$// | tr -d \\n]))
5
AC_CONFIG_SRCDIR([src/librcc.c])
3 by Suren A. Chilingaryan
29.06.2005
6
AC_CONFIG_HEADERS(config.h)
87 by Suren A. Chilingaryan
Multiple fixes of build system
7
#AM_INIT_AUTOMAKE([subdir-objects])
8
XC_AUTOMAKE()
9
77 by Suren A. Chilingaryan
Fix build system for compatibility with latest versions of automake
10
AC_CONFIG_MACRO_DIR([m4])
11
12
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
13
3 by Suren A. Chilingaryan
29.06.2005
14
LIBRCC_VERSION_MAJOR=`cat VERSION | sed -e s/CVS// | cut -d . -f 1 | sed -e s/^$/0/`
15
LIBRCC_VERSION_MINOR=`cat VERSION | sed -e s/CVS// | cut -d . -f 2 | sed -e s/^$/0/`
16
LIBRCC_VERSION_SUBMINOR=`cat VERSION | sed -e s/CVS// | cut -d . -f 3 | sed -e s/^$/0/`
1 by Suren A. Chilingaryan
Initial Import
17
LIBRCC_VERSION=$LIBRCC_VERSION_MAJOR.$LIBRCC_VERSION_MINOR.$LIBRCC_VERSION_SUBMINOR
18
LIBRCC_VERSION_INFO=`echo $LIBRCC_VERSION | awk -F. '{ printf "%d:%d:%d", $1+$2, $3, $2 }'`
19
20
AC_SUBST(LIBRCC_VERSION)
21
AC_SUBST(LIBRCC_VERSION_MAJOR)
22
AC_SUBST(LIBRCC_VERSION_MINOR)
23
AC_SUBST(LIBRCC_VERSION_SUBMINOR)
24
AC_SUBST(LIBRCC_VERSION_INFO)
25
5 by Suren A. Chilingaryan
04.07.2005
26
LIBRCC_CVS=`cat VERSION | sed -e s/.*CVS.*/CVS/`
17 by Suren A. Chilingaryan
0.1.0
27
if test "x$LIBRCC_CVS" = "xCVS"; then
28
LIBRCC_CVS=1
29
LIBRCC_CVS_DATE=`date +%y%m%d.%H`
30
else 
5 by Suren A. Chilingaryan
04.07.2005
31
LIBRCC_CVS=0
32
LIBRCC_CVS_DATE=0
33
fi
34
AC_SUBST(LIBRCC_CVS)
35
AC_SUBST(LIBRCC_CVS_DATE)
36
1 by Suren A. Chilingaryan
Initial Import
37
AC_PROG_CC
40 by Suren A. Chilingaryan
FreeBSD fixes
38
AM_PROG_CC_C_O
1 by Suren A. Chilingaryan
Initial Import
39
AC_PROG_INSTALL
40
AM_PROG_LIBTOOL
87 by Suren A. Chilingaryan
Multiple fixes of build system
41
AC_PROG_MAKE_SET
77 by Suren A. Chilingaryan
Fix build system for compatibility with latest versions of automake
42
43
41 by Suren A. Chilingaryan
VERSION 0.2.4: Ultimate fixes
44
AC_C_CONST
45
AC_TYPE_SIZE_T
46
AC_CHECK_TYPE(ssize_t, long)
47
48
13 by Suren A. Chilingaryan
Engine Plugins
49
pkgdatadir=${libdir}/rcc/
50
AC_SUBST(pkgdatadir)
51
18 by Suren A. Chilingaryan
API Improvements
52
CFLAGS="$CFLAGS -Wall -Wpointer-arith"
41 by Suren A. Chilingaryan
VERSION 0.2.4: Ultimate fixes
53
if test ! -f /usr/include/iconv.h  -a -f /usr/local/include/iconv.h ; then
46 by Suren A. Chilingaryan
Portability Fixes
54
    CFLAGS="$CFLAGS -I/usr/local/include"
55
    LIBS="$LIBS -L/usr/local/lib"
41 by Suren A. Chilingaryan
VERSION 0.2.4: Ultimate fixes
56
fi
18 by Suren A. Chilingaryan
API Improvements
57
13 by Suren A. Chilingaryan
Engine Plugins
58
dnl Checks for programs.
1 by Suren A. Chilingaryan
Initial Import
59
AC_PATH_PROG(RM, rm, /bin/rm)
60
AC_PATH_PROG(MV, mv, /bin/mv)
61
AC_PATH_PROG(TAR, tar, /bin/tar)
62
53 by Suren A. Chilingaryan
Support systems without lockf (OpenSolaris), check GTK1 headers in configure.in, complain on missing macros in autogen.sh, patches by Ivan Borzenkov and Colin Watson for eglibc compatibility
63
dnl Fixing ugly libtool, see for details
64
dnl http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=523750
65
RM="$RM -f"
66
3 by Suren A. Chilingaryan
29.06.2005
67
dnl Checks for header files.
41 by Suren A. Chilingaryan
VERSION 0.2.4: Ultimate fixes
68
AC_CHECK_HEADERS(iconv.h,, [AC_MSG_ERROR(Missing iconv header)])
24 by Suren A. Chilingaryan
Translation
69
AC_CHECK_HEADERS(mntent.h pwd.h sys/types.h sys/stat.h sys/file.h sys/socket.h sys/un.h sys/time.h sys/select.h sys/wait.h signal.h unistd.h fcntl.h)
3 by Suren A. Chilingaryan
29.06.2005
70
5 by Suren A. Chilingaryan
04.07.2005
71
AC_TRY_COMPILE([#include <langinfo.h>],
72
    [char *codeset = nl_langinfo (CODESET);],
73
    [AC_DEFINE(HAVE_CODESET,,[Define if nl_langinfo(CODESET) is available.])]
74
)
75
    
1 by Suren A. Chilingaryan
Initial Import
76
dnl Checks for libraries.
77
46 by Suren A. Chilingaryan
Portability Fixes
78
dnl ***
79
dnl *** LibXML2 (Mandatory)
80
dnl ***
3 by Suren A. Chilingaryan
29.06.2005
81
AC_PATH_PROG(XML2_CONFIG, xml2-config, no)
82
if test $XML2_CONFIG = no; then
83
    AC_MSG_ERROR(LibXML2 is required)
2 by Suren A. Chilingaryan
26.06.2005
84
fi
3 by Suren A. Chilingaryan
29.06.2005
85
XML_LIBS="\`xml2-config --libs\`"
6 by Suren A. Chilingaryan
Save / Load
86
XML_INCLUDES="\`xml2-config --cflags\`"
2 by Suren A. Chilingaryan
26.06.2005
87
AC_SUBST(XML_LIBS)
88
AC_SUBST(XML_INCLUDES)
89
46 by Suren A. Chilingaryan
Portability Fixes
90
dnl ***
91
dnl *** GTK1 (Optional)
92
dnl ***
73 by Suren A. Chilingaryan
Allow disabling of GTK1 UI support
93
AC_ARG_ENABLE(gtk1,
94
	      [  --disable-gtk1        disable gtk1 [default=enabled]],,
77 by Suren A. Chilingaryan
Fix build system for compatibility with latest versions of automake
95
	      [enable_gtk1="yes"])
73 by Suren A. Chilingaryan
Allow disabling of GTK1 UI support
96
97
if test "x$enable_gtk1" = "xyes"; then
98
    AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
99
else
100
    GTK_CONFIG="no"
101
fi
102
9 by Suren A. Chilingaryan
08.07.2005
103
if test $GTK_CONFIG = no; then
104
    HAVE_GTK=no
105
else
23 by Suren A. Chilingaryan
Fixes
106
    GTK1_LIBS="\`gtk-config --libs\`"
107
    GTK1_INCLUDES="\`gtk-config --cflags\`"
53 by Suren A. Chilingaryan
Support systems without lockf (OpenSolaris), check GTK1 headers in configure.in, complain on missing macros in autogen.sh, patches by Ivan Borzenkov and Colin Watson for eglibc compatibility
108
    
109
    saved_CFLAGS="$CFLAGS"
110
    CFLAGS="$CFLAGS `gtk-config --cflags`"
91 by Suren A. Chilingaryan
Set CPPFLAGS for GTK1 check to prevent preprocessor complains (gtk/gtk.h: accepted by the compiler, rejected by the preprocessor!)
111
dnl *** Preprocessor using CPPFLAGS
112
    saved_CPPFLAGS="$CPPFLAGS"
113
    CPPFLAGS="$CPPFLAGS `gtk-config --cflags`"
53 by Suren A. Chilingaryan
Support systems without lockf (OpenSolaris), check GTK1 headers in configure.in, complain on missing macros in autogen.sh, patches by Ivan Borzenkov and Colin Watson for eglibc compatibility
114
    AC_CHECK_HEADER([gtk/gtk.h], [HAVE_GTK=yes], [HAVE_GTK=no])
91 by Suren A. Chilingaryan
Set CPPFLAGS for GTK1 check to prevent preprocessor complains (gtk/gtk.h: accepted by the compiler, rejected by the preprocessor!)
115
    CPPFLAGS=$saved_CPPFLAGS
53 by Suren A. Chilingaryan
Support systems without lockf (OpenSolaris), check GTK1 headers in configure.in, complain on missing macros in autogen.sh, patches by Ivan Borzenkov and Colin Watson for eglibc compatibility
116
    CFLAGS=$saved_CFLAGS
117
fi
118
119
AM_CONDITIONAL(HAVE_GTK, [ test $HAVE_GTK = yes ])
120
121
if test $HAVE_GTK = no; then
122
    GTK1_LIBS=""
123
    GTK1_INCLUDES=""
124
fi
125
23 by Suren A. Chilingaryan
Fixes
126
AC_SUBST(GTK1_LIBS)
127
AC_SUBST(GTK1_INCLUDES)
128
46 by Suren A. Chilingaryan
Portability Fixes
129
dnl ***
130
dnl *** GLIB 2.0 (Optional)
131
dnl ***
132
AC_ARG_ENABLE(glib2,
133
	      [  --disable-glib2        disable glib2 [default=enabled]],,
77 by Suren A. Chilingaryan
Fix build system for compatibility with latest versions of automake
134
	      [enable_glib2="yes"])
46 by Suren A. Chilingaryan
Portability Fixes
135
136
if test "x$enable_glib2" = "xyes"; then
77 by Suren A. Chilingaryan
Fix build system for compatibility with latest versions of automake
137
	PKG_CHECK_MODULES(GLIB2, [glib-2.0 >= 2.0.0], [HAVE_GLIB2=yes], [HAVE_GLIB2=no])
46 by Suren A. Chilingaryan
Portability Fixes
138
else
139
        HAVE_GLIB2=no
140
fi
141
AM_CONDITIONAL(HAVE_GLIB2, [ test $HAVE_GLIB2 = yes ])
142
143
144
dnl ***
145
dnl *** GTK 2.0 (Optional)
146
dnl ***
147
AC_ARG_ENABLE(gtk2,
148
	      [  --disable-gtk2        disable gtk2 [default=enabled]],,
77 by Suren A. Chilingaryan
Fix build system for compatibility with latest versions of automake
149
	      [enable_gtk2="yes"])
46 by Suren A. Chilingaryan
Portability Fixes
150
151
if test "x$enable_gtk2" = "xyes"; then
77 by Suren A. Chilingaryan
Fix build system for compatibility with latest versions of automake
152
	PKG_CHECK_MODULES(GTK2, [gtk+-2.0 >= 2.0.0], [HAVE_GTK2=yes], [HAVE_GTK2=no])
46 by Suren A. Chilingaryan
Portability Fixes
153
else
154
        HAVE_GTK2=no
155
fi
23 by Suren A. Chilingaryan
Fixes
156
AM_CONDITIONAL(HAVE_GTK2, [ test $HAVE_GTK2 = yes ])
4 by Suren A. Chilingaryan
02.07.2005
157
63 by Suren A. Chilingaryan
Initial GTK3 support
158
159
dnl ***
160
dnl *** GTK 3.0 (Optional)
161
dnl ***
162
AC_ARG_ENABLE(gtk3,
163
	      [  --disable-gtk3        disable gtk3 [default=enabled]],,
77 by Suren A. Chilingaryan
Fix build system for compatibility with latest versions of automake
164
	      [enable_gtk3="yes"])
63 by Suren A. Chilingaryan
Initial GTK3 support
165
166
if test "x$enable_gtk3" = "xyes"; then
77 by Suren A. Chilingaryan
Fix build system for compatibility with latest versions of automake
167
	PKG_CHECK_MODULES(GTK3, [gtk+-3.0 >= 3.0.0], [HAVE_GTK3=yes], [HAVE_GTK3=no])
63 by Suren A. Chilingaryan
Initial GTK3 support
168
else
169
        HAVE_GTK3=no
170
fi
171
AM_CONDITIONAL(HAVE_GTK3, [ test $HAVE_GTK3 = yes ])
172
173
46 by Suren A. Chilingaryan
Portability Fixes
174
dnl ***
175
dnl *** Shared libraries support
176
dnl ***
9 by Suren A. Chilingaryan
08.07.2005
177
AC_CHECK_HEADER(dlfcn.h, [AC_CHECK_LIB(dl, dlopen, [
178
    AC_DEFINE(HAVE_DLOPEN,1,[Defines if dlopen is available])
179
    DLOPEN_LIBS="-ldl"
180
    DLOPEN_INCLUDES=""
181
    HAVE_DLOPEN=yes
182
],[
183
    DLOPEN_LIBS=""
184
    DLOPEN_INCLUDES=""
40 by Suren A. Chilingaryan
FreeBSD fixes
185
    
186
    AC_CHECK_FUNCS(dlopen, [
187
        HAVE_DLOPEN=yes
188
    ],[
189
        HAVE_DLOPEN=no
190
    ])
9 by Suren A. Chilingaryan
08.07.2005
191
])])
192
42 by Suren A. Chilingaryan
Engines rework
193
46 by Suren A. Chilingaryan
Portability Fixes
194
dnl ***
195
dnl *** Find IConv library (External / GLibc embeded)
196
dnl ***
42 by Suren A. Chilingaryan
Engines rework
197
EXTRA_LIBS=""
46 by Suren A. Chilingaryan
Portability Fixes
198
HAVE_LIBCHARSET=no
42 by Suren A. Chilingaryan
Engines rework
199
EXTERNAL_ICONV=no
46 by Suren A. Chilingaryan
Portability Fixes
200
201
AC_ARG_ENABLE( force-system-iconv,
202
    [  --enable-force-system-iconv	force usage of iconv library from glibc],,
203
    enable_force_system_iconv="no")
42 by Suren A. Chilingaryan
Engines rework
204
205
if test "x$enable_force_system_iconv" != "xyes"; then
46 by Suren A. Chilingaryan
Portability Fixes
206
    AC_CHECK_LIB(iconv, iconv_open, [
207
	EXTERNAL_ICONV=yes
208
	EXTRA_LIBS="$EXTRA_LIBS -liconv"
209
    ])
210
    AC_CHECK_HEADER(libcharset.h, [AC_CHECK_LIB(charset, locale_charset, [
42 by Suren A. Chilingaryan
Engines rework
211
	AC_DEFINE(HAVE_LIBCHARSET,1,[Defines if libRCD is available])
212
	HAVE_LIBCHARSET=yes
46 by Suren A. Chilingaryan
Portability Fixes
213
	EXTRA_LIBS="$EXTRA_LIBS -lcharset"
214
    ])])
42 by Suren A. Chilingaryan
Engines rework
215
fi
216
AM_CONDITIONAL(HAVE_LIBCHARSET, [ test "x$HAVE_LIBCHARSET" = "xyes" ])
217
AC_SUBST(EXTRA_LIBS)
218
219
46 by Suren A. Chilingaryan
Portability Fixes
220
dnl ***
221
dnl *** Encoding detection engines: LibRCD, Enca, LibGUESS
222
dnl ***
21 by Suren A. Chilingaryan
Fixes
223
RCD_LIBS=""
224
RCD_INCLUDES=""
225
HAVE_RCD=no
226
ENCA_LIBS=""
227
ENCA_INCLUDES=""
228
HAVE_ENCA=no
42 by Suren A. Chilingaryan
Engines rework
229
LIBGUESS_LIBS=""
230
LIBGUESS_INCLUDES=""
231
HAVE_LIBGUESS=no
24 by Suren A. Chilingaryan
Translation
232
46 by Suren A. Chilingaryan
Portability Fixes
233
AC_ARG_ENABLE( force-dynamic-engines,
234
    [  --enable-force-dynamic-engines	force usage of dynamic engines],,
235
    enable_force_dynamic_engines="no")
236
21 by Suren A. Chilingaryan
Fixes
237
if test "x$enable_force_dynamic_engines" != "xyes"; then
46 by Suren A. Chilingaryan
Portability Fixes
238
    AC_CHECK_HEADER(librcd.h, [AC_CHECK_LIB(rcd, rcdGetRussianCharset, [
9 by Suren A. Chilingaryan
08.07.2005
239
	AC_DEFINE(HAVE_RCD,1,[Defines if libRCD is available])
3 by Suren A. Chilingaryan
29.06.2005
240
	RCD_LIBS="-lrcd"
241
	RCD_INCLUDES=""
9 by Suren A. Chilingaryan
08.07.2005
242
	HAVE_RCD=yes
46 by Suren A. Chilingaryan
Portability Fixes
243
    ])])
244
    AC_CHECK_HEADER(enca.h, [AC_CHECK_LIB(enca, enca_analyse, [ 
9 by Suren A. Chilingaryan
08.07.2005
245
	AC_DEFINE(HAVE_ENCA,1,[Defines if enca is available])
246
	ENCA_LIBS="-lenca"
247
	ENCA_INCLUDES=""
248
	HAVE_ENCA=yes
46 by Suren A. Chilingaryan
Portability Fixes
249
    ])])
9 by Suren A. Chilingaryan
08.07.2005
250
fi
251
76 by Suren A. Chilingaryan
Support LibGuess 1.1
252
AC_CHECK_HEADERS([libguess/libguess.h libguess.h], [AC_CHECK_LIB(guess, guess_jp, [ 
42 by Suren A. Chilingaryan
Engines rework
253
	AC_DEFINE(HAVE_LIBGUESS,1,[Defines if libguess is available])
254
	LIBGUESS_LIBS="-lguess"
255
	LIBGUESS_INCLUDES=""
256
	HAVE_LIBGUESS=yes
257
])])
258
76 by Suren A. Chilingaryan
Support LibGuess 1.1
259
21 by Suren A. Chilingaryan
Fixes
260
AM_CONDITIONAL(HAVE_RCD, [ test "x$HAVE_RCD" = "xyes" ])
261
AM_CONDITIONAL(HAVE_ENCA, [ test "x$HAVE_ENCA" = "xyes" ])
42 by Suren A. Chilingaryan
Engines rework
262
AM_CONDITIONAL(HAVE_LIBGUESS, [ test "x$HAVE_LIBGUESS" = "xyes" ])
13 by Suren A. Chilingaryan
Engine Plugins
263
3 by Suren A. Chilingaryan
29.06.2005
264
AC_SUBST(RCD_LIBS)
265
AC_SUBST(RCD_INCLUDES)
266
AC_SUBST(ENCA_LIBS)
267
AC_SUBST(ENCA_INCLUDES)
42 by Suren A. Chilingaryan
Engines rework
268
AC_SUBST(LIBGUESS_LIBS)
269
AC_SUBST(LIBGUESS_INCLUDES)
1 by Suren A. Chilingaryan
Initial Import
270
9 by Suren A. Chilingaryan
08.07.2005
271
USE_DLOPEN=no
21 by Suren A. Chilingaryan
Fixes
272
if test "x$HAVE_DLOPEN" = "xyes"; then
273
    if test "x$HAVE_ENCA" = "xno"; then
9 by Suren A. Chilingaryan
08.07.2005
274
	HAVE_ENCA=dynamic
275
	USE_DLOPEN=yes
276
    fi
21 by Suren A. Chilingaryan
Fixes
277
    if test "x$HAVE_RCD" = "xno"; then
9 by Suren A. Chilingaryan
08.07.2005
278
	HAVE_RCD=dynamic
279
	USE_DLOPEN=yes
280
    fi
281
    
21 by Suren A. Chilingaryan
Fixes
282
    if test "x$USE_DLOPEN" = "xno"; then
9 by Suren A. Chilingaryan
08.07.2005
283
	DLOPEN_LIBS=""
284
	DLOPEN_INCLUDES=""
285
    fi
286
fi
287
AC_SUBST(DLOPEN_LIBS)
288
AC_SUBST(DLOPEN_INCLUDES)
289
46 by Suren A. Chilingaryan
Portability Fixes
290
dnl ***
291
dnl *** BerkeleyDB
292
dnl ***
293
AC_ARG_ENABLE( bdb,
294
    [  --disable-bdb			disable support of recodings caching using BerkeleyDB],,
295
    enable_bdb="yes")
9 by Suren A. Chilingaryan
08.07.2005
296
46 by Suren A. Chilingaryan
Portability Fixes
297
if test "x$enable_bdb" = "xyes"; then
40 by Suren A. Chilingaryan
FreeBSD fixes
298
    AX_PATH_BDB([4],[
299
	BDB_LIBS="$BDB_LDFLAGS $BDB_LIBS"
300
	BDB_INCLUDES="$BDB_CPPFLAGS"
301
	HAVE_BDB=yes
302
    ],[
303
	BDB_LIBS=""
304
	BDB_INCLUDES=""
305
	HAVE_BDB=no
306
    ])
46 by Suren A. Chilingaryan
Portability Fixes
307
else
308
    BDB_LIBS=""
309
    BDB_INCLUDES=""
310
    HAVE_BDB=no
40 by Suren A. Chilingaryan
FreeBSD fixes
311
fi
9 by Suren A. Chilingaryan
08.07.2005
312
AC_SUBST(BDB_LIBS)
313
AC_SUBST(BDB_INCLUDES)
314
46 by Suren A. Chilingaryan
Portability Fixes
315
dnl ***
316
dnl *** LibTranslate (Optional)
317
dnl ***
318
AC_ARG_ENABLE( libtranslate,
319
    [  --disable-libtranslate		disable usage of libtranslate],,
320
    enable_libtranslate="yes")
321
322
if test "x$enable_libtranslate" = "xyes"; then
323
    PKG_CHECK_MODULES(LIBTRANSLATE, [libtranslate], [
324
	HAVE_LIBTRANSLATE=yes
325
    ],[ 
326
	HAVE_LIBTRANSLATE=no
327
    ])
328
329
    if test $HAVE_LIBTRANSLATE = yes; then
330
	AC_DEFINE(HAVE_LIBTRANSLATE,1,[Defines if libtranslate is available])
331
	AC_CHECK_LIB(translate, translate_session_timed_translate_text, [
332
	    HAVE_LIBTRANSLATE_TIMED_TRANSLATE=yes
333
    	    AC_DEFINE(HAVE_LIBTRANSLATE_TIMED_TRANSLATE,1,[Defines if libtranslate has time limited translate])
334
	],[
335
	    HAVE_LIBTRANSLATE_TIMED_TRANSLATE=no
336
	])
337
    else
338
	HAVE_LIBTRANSLATE_TIMED_TRANSLATE=no
339
    fi
340
else
24 by Suren A. Chilingaryan
Translation
341
    HAVE_LIBTRANSLATE=no
342
    HAVE_LIBTRANSLATE_TIMED_TRANSLATE=no
343
    LIBTRANSLATE_LIBS=""
344
    LIBTRANSLATE_CFLAGS=""
345
    AC_SUBST(LIBTRANSLATE_LIBS)
346
    AC_SUBST(LIBTRANSLATE_CFLAGS)
46 by Suren A. Chilingaryan
Portability Fixes
347
fi
348
349
dnl ***
350
dnl *** Aspell (Optional)
351
dnl ***
25 by Suren A. Chilingaryan
Language autodetection
352
AM_PATH_ASPELL([
353
    AC_DEFINE(HAVE_ASPELL,1,[Defines if aspell is available])
354
    HAVE_ASPELL=yes
355
],[
356
    HAVE_ASPELL=no
357
])
358
26 by Suren A. Chilingaryan
Language Fixes and Improvements
359
46 by Suren A. Chilingaryan
Portability Fixes
360
dnl ***
361
dnl *** Threading library
362
dnl ***
363
AC_MSG_CHECKING([for PTHREAD_LIBS])
364
if test "x$PTHREAD_LIBS" = "x"; then
365
  PTHREAD_LIBS=error
366
else
367
  AC_MSG_RESULT([$PTHREAD_LIBS])
368
fi
369
370
if test "x$PTHREAD_LIBS" = "xerror"; then
26 by Suren A. Chilingaryan
Language Fixes and Improvements
371
AC_EGREP_CPP(yes,[
372
#if (defined(__FreeBSD_cc_version) && __FreeBSD_cc_version <= 500001) || defined(__OpenBSD__)
373
	  yes
374
#endif
375
],
376
	PTHREAD_CFLAGS="-D_THREAD_SAFE" 
377
	PTHREAD_LIBS="-pthread"
378
)
46 by Suren A. Chilingaryan
Portability Fixes
379
fi
26 by Suren A. Chilingaryan
Language Fixes and Improvements
380
if test "x$PTHREAD_LIBS" = "xerror"; then
381
	AC_CHECK_LIB(pthread, pthread_mutex_lock, PTHREAD_LIBS="-lpthread")
382
fi
383
if test "x$PTHREAD_LIBS" = xerror; then
384
        AC_CHECK_LIB(pthreads, pthread_mutex_lock, PTHREAD_LIBS="-lpthreads")
385
fi
386
if test "x$PTHREAD_LIBS" = xerror; then
387
        AC_CHECK_LIB(c_r, pthread_mutex_lock, PTHREAD_LIBS="-lc_r")
388
fi
389
if test "x$PTHREAD_LIBS" = xerror; then
390
	AC_CHECK_FUNC(pthread_mutex_lock, PTHREAD_LIBS="")
391
fi
392
if test "x$PTHREAD_LIBS" = xerror; then
393
	PTHREAD_LIBS=""
394
	PTHREAD_CFLAGS=""
395
else
396
    AC_CHECK_HEADER(pthread.h, [
397
	AC_DEFINE(HAVE_PTHREAD,1,[Defines if pthread is available])
398
	HAVE_PTHREAD=yes
399
    ],[
400
	HAVE_PTHREAD=no
401
	PTHREAD_LIBS=""
402
	PTHREAD_CFLAGS=""
403
    ])
404
fi
405
AC_SUBST(PTHREAD_CFLAGS)
406
AC_SUBST(PTHREAD_LIBS)
407
408
    
1 by Suren A. Chilingaryan
Initial Import
409
dnl Checks for typedefs, structures, and compiler characteristics.
410
AC_C_CONST
411
412
dnl Checks for library functions.
61 by Suren A. Chilingaryan
Windows fixes and CMake scripts to build under Windows
413
AC_CHECK_FUNCS(strcasecmp strncasecmp strdup strnlen flock lockf nanosleep usleep fsync ftruncate)
1 by Suren A. Chilingaryan
Initial Import
414
71 by Suren A. Chilingaryan
pkgconfig
415
AC_OUTPUT(src/Makefile engines/Makefile external/Makefile ui/Makefile examples/Makefile Makefile librcc.spec librcc.pc)
9 by Suren A. Chilingaryan
08.07.2005
416
87 by Suren A. Chilingaryan
Multiple fixes of build system
417
dnl This is a remedy of distclean in src destroying .deps directory and while distcleaning external it fails to include the dependencies
418
dnl Stolen from curl and slightly adapted
419
XC_AMEND_DISTCLEAN([external src])
420
46 by Suren A. Chilingaryan
Portability Fixes
421
dnl ***
422
dnl *** Data directory
423
dnl ***
42 by Suren A. Chilingaryan
Engines rework
424
rccdir=${pkgdatadir}
46 by Suren A. Chilingaryan
Portability Fixes
425
while expr "${rccdir}" : "\\\$" >/dev/null; do
42 by Suren A. Chilingaryan
Engines rework
426
    rccdir=`eval echo $rccdir`
427
done
428
429
9 by Suren A. Chilingaryan
08.07.2005
430
echo ""
431
echo "Configuration:"
26 by Suren A. Chilingaryan
Language Fixes and Improvements
432
echo "  POSIX Threading Support:               $HAVE_PTHREAD"
433
echo ""
42 by Suren A. Chilingaryan
Engines rework
434
echo "  External IConv Library:                $EXTERNAL_ICONV"
435
echo "  LibCharset Library:                    $HAVE_LIBCHARSET"
436
echo ""
9 by Suren A. Chilingaryan
08.07.2005
437
echo "  Dynamic Engine Loading Support:        $HAVE_DLOPEN"
438
echo "  Enca Charset Detection Support:        $HAVE_ENCA"
439
echo "  LibRCD Charset Detection Support:      $HAVE_RCD"
42 by Suren A. Chilingaryan
Engines rework
440
echo "  LibGUESS Charset Detection Support:    $HAVE_LIBGUESS"
9 by Suren A. Chilingaryan
08.07.2005
441
echo ""
442
echo "  Multilanguage support with DB4:        $HAVE_BDB"
25 by Suren A. Chilingaryan
Language autodetection
443
echo "  Language autodetection using aspell:   $HAVE_ASPELL"
24 by Suren A. Chilingaryan
Translation
444
echo "  Libtranslate support:                  $HAVE_LIBTRANSLATE"
445
echo "  Libtranslate Timed Translate:          $HAVE_LIBTRANSLATE_TIMED_TRANSLATE"
9 by Suren A. Chilingaryan
08.07.2005
446
echo ""
447
echo "User Interfaces:"
448
echo "  GTK User Interface:                    $HAVE_GTK"
23 by Suren A. Chilingaryan
Fixes
449
echo "  GTK2 User Interface:                   $HAVE_GTK2"
63 by Suren A. Chilingaryan
Initial GTK3 support
450
echo "  GTK3 User Interface:                   $HAVE_GTK3"
9 by Suren A. Chilingaryan
08.07.2005
451
echo ""
42 by Suren A. Chilingaryan
Engines rework
452
echo "Directories:"
453
echo "  RCC Data Directory:                    ${rccdir}"
454
echo ""
9 by Suren A. Chilingaryan
08.07.2005
455
echo ""
456
echo ""