~ubuntu-branches/ubuntu/vivid/sphinxsearch/vivid

« back to all changes in this revision

Viewing changes to .pc/04_libstemmer.patch/configure.ac

  • Committer: Package Import Robot
  • Author(s): Clint Byrum
  • Date: 2012-04-05 09:25:55 UTC
  • mfrom: (1.2.1) (7.1.3 sid)
  • Revision ID: package-import@ubuntu.com-20120405092555-65tc91rowhls3kob
Tags: 2.0.4-0ubuntu1
* New upstream release (LP: #930747)
* Remove explicit depends on libmysqlcient16 (LP: #974427)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
dnl Process this file with autoconf to produce a configure script.
 
2
 
 
3
AC_PREREQ(2.59)
 
4
AC_INIT([sphinx], [2.0.4], [shodan(at)sphinxsearch.com])
 
5
 
 
6
dnl --------------------------------------------------------------------------
 
7
 
 
8
SPHINX_CONFIGURE_PART([checking build environment])
 
9
 
 
10
AC_CONFIG_AUX_DIR([config])
 
11
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
 
12
AM_MAINTAINER_MODE
 
13
AC_CONFIG_SRCDIR([src/searchd.cpp])
 
14
AC_CONFIG_HEADER([config/config.h])
 
15
 
 
16
# hack to locate expat/iconv in /usr/local on BSD systems
 
17
CPPFLAGS="$CPPFLAGS -I/usr/local/include"
 
18
LIBS="$LIBS -L/usr/local/lib"
 
19
 
 
20
dnl --------------------------------------------------------------------------
 
21
 
 
22
SPHINX_CONFIGURE_PART([checking for compiler programs])
 
23
 
 
24
AC_ARG_WITH([debug],
 
25
        AC_HELP_STRING([--with-debug], [compile slower debug version (default is disabled)]),
 
26
        [ac_cv_use_debug=$withval], [ac_cv_use_debug=no]
 
27
)
 
28
 
 
29
AC_MSG_CHECKING([whether to compile debug version])
 
30
if test x$ac_cv_use_debug != xno; then
 
31
        SPHINX_CFLAGS="-Wall -g -D_FILE_OFFSET_BITS=64"
 
32
        SPHINX_INJECT_FLAGS="-D_FILE_OFFSET_BITS=64"
 
33
        AC_MSG_RESULT([yes])
 
34
else
 
35
        SPHINX_CFLAGS="-Wall -g -D_FILE_OFFSET_BITS=64 -O3 -DNDEBUG"
 
36
        SPHINX_INJECT_FLAGS="-D_FILE_OFFSET_BITS=64 -DNDEBUG"
 
37
        AC_MSG_RESULT([no])
 
38
fi
 
39
 
 
40
dnl set flags for C compiler if there are no user overrides
 
41
dnl inject required defines if there are
 
42
if test x$ac_env_CFLAGS_set != xset; then
 
43
        CFLAGS=$SPHINX_CFLAGS
 
44
else
 
45
        CFLAGS="$CFLAGS $SPHINX_INJECT_FLAGS"
 
46
fi
 
47
 
 
48
dnl set flags for C++ compiler if there are no user overrides
 
49
dnl inject required defines if there are
 
50
if test x$ac_env_CXXFLAGS_set != xset; then
 
51
        CXXFLAGS=$SPHINX_CFLAGS
 
52
else
 
53
        CXXFLAGS="$CXXFLAGS $SPHINX_INJECT_FLAGS"
 
54
fi
 
55
 
 
56
AC_PROG_CC
 
57
AC_PROG_CXX
 
58
AC_PROG_RANLIB
 
59
 
 
60
AC_COMPILE_IFELSE([
 
61
#ifdef __GNUC__
 
62
#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 3)
 
63
void main() {}
 
64
#else
 
65
syntax error
 
66
#endif
 
67
#endif
 
68
], [], [AC_MSG_ERROR([Gcc version error. Minspec is 3.4])])
 
69
 
 
70
AC_DEFINE_UNQUOTED([COMPILER],"$CC `$CC -dumpversion`",[Define to be the name of the compiler.])
 
71
AC_DEFINE_UNQUOTED([OS_UNAME],"`uname -a`",[Full name OS])
 
72
 
 
73
dnl --------------------------------------------------------------------------
 
74
 
 
75
SPHINX_CONFIGURE_PART([checking for header files])
 
76
 
 
77
# Checks for header files.
 
78
AC_HEADER_STDC
 
79
AC_HEADER_SYS_WAIT
 
80
AC_CHECK_HEADERS([fcntl.h limits.h netdb.h netinet/in.h stdlib.h string.h sys/file.h sys/socket.h sys/time.h unistd.h pthread.h execinfo.h])
 
81
AC_CHECK_HEADER(expat.h,[have_expat_h=yes],[have_expat_h=no])
 
82
AC_CHECK_HEADER(iconv.h,[have_iconv_h=yes],[have_iconv_h=no])
 
83
AC_CHECK_HEADER(zlib.h,[have_zlib_h=yes],[have_zlib_h=no])
 
84
AC_CHECK_HEADER(sql.h,[have_sql_h=yes],[have_sql_h=no])
 
85
AC_CHECK_HEADER(syslog.h,[have_syslog_h=yes],[have_syslog_h=no])
 
86
 
 
87
dnl --------------------------------------------------------------------------
 
88
 
 
89
SPHINX_CONFIGURE_PART([checking for types])
 
90
 
 
91
# Checks for typedefs, structures, and compiler characteristics.
 
92
AC_HEADER_STDBOOL
 
93
AC_C_CONST
 
94
AC_C_INLINE
 
95
AC_TYPE_OFF_T
 
96
AC_TYPE_SIZE_T
 
97
AC_HEADER_TIME
 
98
 
 
99
dnl --------------------------------------------------------------------------
 
100
 
 
101
SPHINX_CONFIGURE_PART([checking for library functions])
 
102
 
 
103
# Checks for library functions.
 
104
AC_FUNC_FORK
 
105
AC_FUNC_MALLOC
 
106
AC_FUNC_REALLOC
 
107
AC_FUNC_SELECT_ARGTYPES
 
108
AC_TYPE_SIGNAL
 
109
AC_FUNC_STAT
 
110
AC_FUNC_VPRINTF
 
111
AC_SEARCH_LIBS([setsockopt],[socket])
 
112
AC_SEARCH_LIBS([gethostbyname],[nsl socket resolv])
 
113
AC_SEARCH_LIBS([XML_Parse],[expat],[have_libexpat=yes],[have_libexpat=no])
 
114
AC_SEARCH_LIBS([iconv],[iconv],[have_libiconv=yes],[have_libiconv=no])
 
115
AC_SEARCH_LIBS([inflate],[z],[have_lz=yes],[have_lz=no])
 
116
AC_SEARCH_LIBS([logf],[m])
 
117
AC_CHECK_FUNCS([dup2 gethostbyname gettimeofday memmove memset select socket strcasecmp strchr strerror strncasecmp strstr strtol logf pread])
 
118
AC_CHECK_FUNCS([backtrace backtrace_symbols])
 
119
 
 
120
# most systems require the program be linked with librt library to use
 
121
# the function clock_gettime 
 
122
my_save_LIBS="$LIBS"
 
123
LIBS=""
 
124
AC_CHECK_LIB(rt,clock_gettime)
 
125
 
 
126
LIBRT=$LIBS
 
127
LIBS="$my_save_LIBS"
 
128
AC_SUBST(LIBRT)
 
129
 
 
130
LIBS="$LIBS $LIBRT"
 
131
AC_CHECK_FUNCS(clock_gettime)
 
132
 
 
133
SPHINX_CHECK_DEFINE(LOCK_EX,sys/file.h)
 
134
SPHINX_CHECK_DEFINE(F_SETLKW,fcntl.h)
 
135
 
 
136
# check for dlopen
 
137
# FIXME! technically, only needed in searchd
 
138
# but as UDF manager is curently in libsphinx, we link everything
 
139
AC_CHECK_LIB(dl,dlopen)
 
140
AC_CHECK_FUNCS(dlopen dlerror)
 
141
 
 
142
dnl --------------------------------------------------------------------------
 
143
 
 
144
SPHINX_CONFIGURE_PART([configuring Sphinx])
 
145
 
 
146
dnl ---
 
147
 
 
148
# check for pthreads
 
149
 
 
150
dnl helper that runs a test program and checks for success
 
151
pthread_prog="
 
152
#include <pthread.h>
 
153
#include <stddef.h>
 
154
 
 
155
void * thread_routine ( void * data )
 
156
{
 
157
        return data;
 
158
}
 
159
 
 
160
int main ()
 
161
{
 
162
        pthread_t thd;
 
163
        pthread_mutexattr_t mattr;
 
164
        pthread_once_t once_init = PTHREAD_ONCE_INIT;
 
165
        int data = 1;
 
166
 
 
167
        pthread_mutexattr_init ( &mattr );
 
168
        return pthread_create ( &thd, NULL, thread_routine, &data );
 
169
}
 
170
"
 
171
 
 
172
AC_DEFUN([PTHREADS_TRY_RUNCOMPILE],[
 
173
if test x$cross_compiling = xno ; then
 
174
        AC_TRY_RUN($pthread_prog, [pthreads_try_run=yes], [pthreads_try_run=no], [pthreads_try_run=no])
 
175
        if test x$pthreads_try_run = xyes ; then
 
176
                $1
 
177
        fi
 
178
else
 
179
        AC_COMPILE_IFELSE($pthread_prog, [pthreads_try_compile=yes], [pthreads_try_compile=no], [pthreads_try_compile=no])
 
180
        if test x$pthreads_try_compile = xyes ; then
 
181
                $1
 
182
        fi
 
183
fi
 
184
])
 
185
 
 
186
 
 
187
AC_DEFUN([PTHREADS_TRY_RUNLINK],[
 
188
if test x$cross_compiling = xno ; then
 
189
        AC_TRY_RUN($pthread_prog, [pthreads_try_run=yes], [pthreads_try_run=no], [pthreads_try_run=no])
 
190
        if test x$pthreads_try_run = xyes ; then
 
191
                $1
 
192
        fi
 
193
else
 
194
        AC_LINK_IFELSE($pthread_prog, [pthreads_try_link=yes], [pthreads_try_link=no], [pthreads_try_link=no])
 
195
        if test x$pthreads_try_link = xyes ; then
 
196
                $1
 
197
        fi
 
198
fi
 
199
])
 
200
 
 
201
# check for needed cflags
 
202
AC_CACHE_CHECK([for CFLAGS needed for pthreads], [sphinx_cv_pthreads_cflags],
 
203
[
 
204
        save_cflags=$CFLAGS
 
205
        for flag in none -kthread -pthread -pthreads -mt -mthreads -Kthread -threads; do
 
206
                CFLAGS=$save_cflags
 
207
        test "x$flag" != "xnone" && CFLAGS="$CFLAGS $flag"
 
208
                PTHREADS_TRY_RUNCOMPILE([
 
209
                        sphinx_cv_pthreads_cflags="$flag"
 
210
                        break
 
211
                ])
 
212
        done
 
213
        CFLAGS=$save_cflags
 
214
])
 
215
 
 
216
if test -n "$sphinx_cv_pthreads_cflags"; then
 
217
        have_pthreads=yes
 
218
        if test "x$sphinx_cv_pthreads_cflags" != "xnone"; then
 
219
                CPPFLAGS="$CPPFLAGS $sphinx_cv_pthreads_cflags"
 
220
        fi
 
221
fi
 
222
 
 
223
# check for needed libs
 
224
AC_CACHE_CHECK([for LIBS needed for pthreads], [sphinx_cv_pthreads_libs], [
 
225
        save_libs=$LIBS
 
226
        for lib in -lpthread -lpthreads -lc_r; do
 
227
                LIBS="$save_libs $lib"
 
228
                PTHREADS_TRY_RUNLINK([
 
229
                        sphinx_cv_pthreads_libs=$lib
 
230
                        break
 
231
                ])
 
232
        done
 
233
        LIBS=$save_libs
 
234
])
 
235
 
 
236
if test -n "$sphinx_cv_pthreads_libs"; then
 
237
        have_pthreads=yes
 
238
        LIBS="$LIBS $sphinx_cv_pthreads_libs"
 
239
fi
 
240
 
 
241
# final check
 
242
AC_MSG_CHECKING([for pthreads])
 
243
if test x$have_pthreads = xyes; then
 
244
        if test x$cross_compiling = xno; then
 
245
                AC_MSG_RESULT([found])
 
246
        else
 
247
                AC_MSG_RESULT([assumed as found (cross-compiling)])
 
248
        fi
 
249
else
 
250
        AC_MSG_ERROR([no working pthreads library found])
 
251
fi
 
252
 
 
253
AC_CHECK_FUNCS([pthread_mutex_timedlock])
 
254
 
 
255
dnl ---
 
256
 
 
257
# check if we should compile with MySQL support
 
258
AC_ARG_WITH([mysql], 
 
259
            AC_HELP_STRING([--with-mysql], [compile with MySQL support (default is enabled)]),
 
260
            [ac_cv_use_mysql=$withval], [ac_cv_use_mysql=yes]
 
261
)
 
262
AC_MSG_CHECKING([whether to compile with MySQL support])
 
263
if test x$ac_cv_use_mysql != xno; then
 
264
        AC_MSG_RESULT([yes])
 
265
    AC_CHECK_MYSQL([$ac_cv_use_mysql])
 
266
    AC_DEFINE(USE_MYSQL,1,[Define to 1 if you want to compile with MySQL support])
 
267
    AC_SUBST([MYSQL_LIBS])
 
268
    AC_SUBST([MYSQL_CFLAGS])
 
269
else
 
270
        AC_MSG_RESULT([no])
 
271
fi
 
272
AM_CONDITIONAL(USE_MYSQL, test x$ac_cv_use_mysql != xno)
 
273
 
 
274
# check if we should statically link the mysql library
 
275
AC_ARG_WITH([static-mysql], 
 
276
            AC_HELP_STRING([--with-static-mysql], [link statically with MySQL library (default is no)]),
 
277
            [ac_cv_use_static_mysql=$withval], [ac_cv_use_static_mysql=no]
 
278
)
 
279
AC_MSG_CHECKING([whether to link statically with MySQL support])
 
280
if test x$ac_cv_use_mysql != xno; then
 
281
if test x$ac_cv_use_static_mysql != xno; then
 
282
        AC_CHECK_MYSQL([$ac_cv_use_static_mysql])
 
283
        MYSQL_LIBS=`echo $MYSQL_LIBS | sed -e 's/\-Bdynamic/\-Bstatic/g'`
 
284
        MYSQL_LIBS="-Wl,-Bstatic $MYSQL_LIBS -Wl,-Bdynamic"
 
285
        AC_MSG_RESULT([yes])
 
286
else
 
287
        AC_MSG_RESULT([no])
 
288
fi
 
289
fi
 
290
 
 
291
# check if we should compile with PostgreSQL support
 
292
AC_ARG_WITH([pgsql],
 
293
            AC_HELP_STRING([--with-pgsql], [compile with PostgreSQL support (default is disabled)]),
 
294
            [ac_cv_use_pgsql=$withval], [ac_cv_use_pgsql=no]
 
295
)
 
296
AC_MSG_CHECKING([whether to compile with PostgreSQL support])
 
297
if test x$ac_cv_use_pgsql != xno; then
 
298
        AC_MSG_RESULT([yes])
 
299
    AC_CHECK_PGSQL([$ac_cv_use_pgsql])
 
300
    AC_DEFINE(USE_PGSQL,1,[Define to 1 if you want to compile with PostgreSQL support])
 
301
    AC_SUBST([PGSQL_LIBS])
 
302
    AC_SUBST([PGSQL_CFLAGS])
 
303
else
 
304
        AC_MSG_RESULT([no])
 
305
fi
 
306
AM_CONDITIONAL(USE_PGSQL, test x$ac_cv_use_pgsql != xno)
 
307
 
 
308
# add macports include directory
 
309
if (echo $MYSQL_LIBS | grep -q -- -L/opt/local/lib); then
 
310
   MYSQL_CFLAGS="$MYSQL_CFLAGS -I/opt/local/include"
 
311
fi
 
312
 
 
313
# we can now set preprocessor flags for both C and C++ compilers
 
314
CPPFLAGS="$CPPFLAGS $MYSQL_CFLAGS $PGSQL_CFLAGS"
 
315
 
 
316
dnl ---
 
317
 
 
318
AC_MSG_CHECKING([whether to use 64-bit document/word IDs])
 
319
sph_enable_id64=no
 
320
AC_ARG_ENABLE([id64],
 
321
        [  --enable-id64           use 64-bit document and word IDs (default is no)],
 
322
        [sph_enable_id64=$enableval])
 
323
if test x$sph_enable_id64 != xno; then
 
324
        AC_DEFINE(USE_64BIT, 1, [64-bit document and word IDs])
 
325
        AC_MSG_RESULT([yes])
 
326
else
 
327
        AC_DEFINE(USE_64BIT, 0, [64-bit document and word IDs])
 
328
        AC_MSG_RESULT([no])
 
329
fi
 
330
 
 
331
dnl ---
 
332
 
 
333
AC_ARG_WITH([libstemmer],
 
334
        AC_HELP_STRING([--with-libstemmer], [compile with libstemmer support (default is disabled)]),
 
335
        [ac_cv_use_libstemmer=$withval], [ac_cv_use_libstemmer=no]
 
336
)
 
337
 
 
338
AC_MSG_CHECKING([whether to compile with libstemmer support])
 
339
if test x$ac_cv_use_libstemmer != xno; then
 
340
        if test -d libstemmer_c && test -f libstemmer_c/include/libstemmer.h; then
 
341
                AC_MSG_RESULT([yes])
 
342
                AC_DEFINE(USE_LIBSTEMMER, 1, [libstemmer support])
 
343
        else
 
344
                AC_MSG_ERROR([missing libstemmer sources from libstemmer_c.
 
345
 
 
346
Please download the C version of libstemmer library from
 
347
http://snowball.tartarus.org/ and extract its sources over libstemmer_c/
 
348
subdirectory in order to build Sphinx with libstemmer support.
 
349
])
 
350
        fi
 
351
else
 
352
        AC_MSG_RESULT([no])
 
353
        AC_DEFINE(USE_LIBSTEMMER, 0, [libstemmer support])
 
354
fi
 
355
AM_CONDITIONAL(USE_LIBSTEMMER, test x$ac_cv_use_libstemmer != xno)
 
356
 
 
357
dnl ---
 
358
 
 
359
got_expat=0
 
360
AC_MSG_CHECKING([for libexpat])
 
361
if test [ $have_expat_h = yes -a $have_libexpat = yes ]; then
 
362
        AC_DEFINE([USE_LIBEXPAT],1,[define to use expat XML library])
 
363
        AC_MSG_RESULT([found])
 
364
        got_expat=1
 
365
else
 
366
        AC_MSG_RESULT([not found])
 
367
        AC_MSG_WARN([xmlpipe2 will NOT be available])
 
368
fi
 
369
 
 
370
dnl ---
 
371
 
 
372
AC_ARG_WITH([iconv],
 
373
        AC_HELP_STRING([--with-iconv], [compile with iconv support (default is autodetect)]),
 
374
        [ac_cv_use_iconv=$withval], [ac_cv_use_iconv=yes]
 
375
)
 
376
AC_MSG_CHECKING([for libiconv])
 
377
if test [ $have_iconv_h = yes \
 
378
        -a $have_libiconv = yes \
 
379
        -a $got_expat -eq 1 \
 
380
        -a $ac_cv_use_iconv != no ]; \
 
381
then
 
382
        AC_DEFINE([USE_LIBICONV],1,[define to use iconv library])
 
383
        AC_MSG_RESULT([found])
 
384
 
 
385
        AC_MSG_CHECKING([for iconv() arg types])
 
386
        AC_LANG_PUSH([C++])
 
387
        AC_COMPILE_IFELSE(
 
388
                [AC_LANG_PROGRAM([[
 
389
                        #include <iconv.h>      
 
390
                        #include <stdio.h>]],
 
391
                        [const char * inbuf;
 
392
                        iconv_t cd;
 
393
                        iconv ( cd, &inbuf, NULL, NULL, NULL );
 
394
                        ])],
 
395
                [iconv_inbuf_const=yes],
 
396
                [iconv_inbuf_const=no])
 
397
        AC_LANG_POP([C++])
 
398
        if test [ $iconv_inbuf_const = yes ]; then
 
399
                AC_DEFINE([ICONV_INBUF_CONST],1,[whether 2nd arg to iconv() is const ptr])
 
400
                AC_MSG_RESULT([const char **])
 
401
        else
 
402
                AC_DEFINE([ICONV_INBUF_CONST],0,[whether 2nd arg to iconv() is const ptr])
 
403
                AC_MSG_RESULT([char **])
 
404
        fi
 
405
else
 
406
        if test [ $got_expat -eq 1 ]; then
 
407
                if test [ $ac_cv_use_iconv = no ]; then
 
408
                        AC_MSG_RESULT([disabled])
 
409
                else
 
410
                        AC_MSG_RESULT([not found])
 
411
                fi
 
412
                AC_MSG_WARN([xmlpipe2 will only support default encodings (latin-1, utf-8)])
 
413
        else
 
414
                AC_MSG_RESULT([not required])
 
415
        fi
 
416
fi
 
417
 
 
418
dnl ---
 
419
 
 
420
if test [ $have_zlib_h = yes -a $have_lz = yes ]; then
 
421
   AC_DEFINE([USE_ZLIB],1,[define to use Zlib])
 
422
fi
 
423
 
 
424
dnl ---
 
425
 
 
426
AC_ARG_WITH([unixodbc],
 
427
        AC_HELP_STRING([--with-unixodbc], [compile with UnixODBC support (default is autodetect)]),
 
428
        [ac_cv_use_unixodbc=$withval], [ac_cv_use_unixodbc=yes]
 
429
)
 
430
AC_MSG_CHECKING([for UnixODBC])
 
431
if test [ $ac_cv_use_unixodbc != no ]; then
 
432
        if test [ $have_sql_h = yes ]; then
 
433
                AC_SEARCH_LIBS([SQLConnect],[odbc iodbc],[have_libodbc=yes],[have_libodbc=no])
 
434
                if test [ $have_libodbc = yes ]; then
 
435
                        AC_DEFINE([USE_ODBC],1,[define to use ODBC library])
 
436
                        AC_MSG_RESULT([found])
 
437
                else
 
438
                        AC_MSG_RESULT([not found])
 
439
                        AC_MSG_WARN([ODBC source support will NOT be available])
 
440
                fi
 
441
        fi
 
442
else
 
443
        AC_MSG_RESULT([disabled])
 
444
fi
 
445
 
 
446
dnl ---
 
447
 
 
448
 
 
449
AC_ARG_WITH([syslog],
 
450
        AC_HELP_STRING([--with-syslog], [compile with possibility to use syslog for logging (default is no)]),
 
451
        [ac_cv_use_syslog=$withval], [ac_cv_use_syslog=no]
 
452
)
 
453
AC_MSG_CHECKING([for Syslog])
 
454
if test [ $ac_cv_use_syslog != no ]; then
 
455
        if test [ $have_syslog_h = yes ]; then
 
456
                AC_DEFINE([USE_SYSLOG],1,[define to use POSIX Syslog for logging])
 
457
                AC_MSG_RESULT([yes])
 
458
        else
 
459
                AC_MSG_RESULT([no])
 
460
        fi
 
461
else
 
462
        AC_MSG_RESULT([disabled])
 
463
fi
 
464
 
 
465
dnl ---
 
466
 
 
467
AC_CACHE_CHECK([for unaligned RAM access],[sphinx_cv_unaligned_ram_access],[
 
468
AC_LANG_PUSH([C++])
 
469
AC_RUN_IFELSE(
 
470
        [AC_LANG_PROGRAM([[
 
471
                #include <stdlib.h>
 
472
                #include <string.h>]],
 
473
                [[char * sBuf = new char [ 8*sizeof(int) ];
 
474
                for ( int i=0; i<8*sizeof(int); i++ )
 
475
                        sBuf[i] = i;
 
476
 
 
477
                // check for crashes (SPARC)
 
478
                volatile int iRes = 0;
 
479
                for ( int i=0; i<(int)sizeof(int); i++ )
 
480
                {
 
481
                        int * pPtr = (int*)( sBuf+i );
 
482
                        iRes += *pPtr;
 
483
                }
 
484
 
 
485
                // check for correct values (ARM)
 
486
                iRes = *(int*)( sBuf+1 );
 
487
                if (!( iRes==0x01020304 || iRes==0x04030201 ))
 
488
                        return 1;
 
489
                // all seems ok
 
490
                return 0;]])],
 
491
        [sphinx_cv_unaligned_ram_access=yes],
 
492
        [sphinx_cv_unaligned_ram_access=no],
 
493
        [AC_MSG_RESULT([unknown (cross-compiling), assume no])
 
494
                sphinx_cv_unaligned_ram_access=no])
 
495
])
 
496
 
 
497
if test x$sphinx_cv_unaligned_ram_access = xyes ; then
 
498
        AC_DEFINE([UNALIGNED_RAM_ACCESS],1,[whether unaligned RAM access is possible])
 
499
else
 
500
        AC_DEFINE([UNALIGNED_RAM_ACCESS],0)
 
501
fi
 
502
 
 
503
# check endianness
 
504
AC_C_BIGENDIAN(
 
505
        AC_DEFINE(USE_LITTLE_ENDIAN, 0, [big-endian]),
 
506
        AC_DEFINE(USE_LITTLE_ENDIAN, 1, [little-endian]),
 
507
        AC_MSG_ERROR(unknown endianess not supported),
 
508
        AC_MSG_ERROR(universial endianess not supported)
 
509
)
 
510
 
 
511
dnl --------------------------------------------------------------------------
 
512
 
 
513
SPHINX_CONFIGURE_PART([generating configuration files])
 
514
 
 
515
if test "$prefix" = "NONE"; then
 
516
        my_op_prefix="/var"
 
517
else
 
518
        my_op_prefix="$localstatedir"
 
519
fi
 
520
 
 
521
 
 
522
CONFDIR=`eval echo "${my_op_prefix}"`
 
523
AC_SUBST(CONFDIR)
 
524
 
 
525
AC_CONFIG_FILES([Makefile src/Makefile libstemmer_c/Makefile doc/Makefile sphinx.conf.dist:sphinx.conf.in \
 
526
        sphinx-min.conf.dist:sphinx-min.conf.in])
 
527
AC_OUTPUT
 
528
 
 
529
dnl --------------------------------------------------------------------------
 
530
 
 
531
SPHINX_CONFIGURE_PART([configuration done])
 
532
 
 
533
echo "You can now run 'make install' to build and install Sphinx binaries."
 
534
echo "On a multi-core machine, try 'make -j4 install' to speed up the build."
 
535
echo
 
536
echo "Updates, articles, help forum, and commercial support, consulting, training,"
 
537
echo "and development services are available at http://sphinxsearch.com/"
 
538
echo
 
539
echo "Thank you for choosing Sphinx!"
 
540
echo