~ubuntu-branches/ubuntu/maverick/libtorrent-rasterbar/maverick

« back to all changes in this revision

Viewing changes to configure.in

  • Committer: Bazaar Package Importer
  • Author(s): Christophe Sauthier
  • Date: 2010-08-10 12:59:37 UTC
  • mfrom: (1.3.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20100810125937-jbcmmf17y8yo9hgz
Tags: 0.15.0-0ubuntu1
* New upstream version.
* debian/patches/100_fix_html_docs.patch: refreshed.
* debian/control: bump up standards-version to 3.9.1 (no changes).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
AC_PREREQ(2.60)
2
 
 
3
 
AC_INIT([libtorrent-rasterbar], [0.14.10], [arvid@cs.umu.se])
4
 
AM_INIT_AUTOMAKE(foreign 1.10)
5
 
AC_CONFIG_SRCDIR([src/torrent.cpp])
6
 
 
7
 
 
8
 
dnl ---------------------------------------------------------------------------
9
 
dnl interface version info
10
 
dnl ---------------------------------------------------------------------------
11
 
dnl Advanced information about versioning:
12
 
dnl   * "Writing shared libraries" by Mike Hearn
13
 
dnl         http://navi.cx/~mike/writing-shared-libraries.html
14
 
dnl   * libtool.info chapter "Versioning"
15
 
dnl   * libtool.info chapter "Updating library version information"
16
 
dnl ---------------------------------------------------------------------------
17
 
dnl Versioning:
18
 
dnl  - CURRENT (Major):  Increment if the interface has changes. AGE is always
19
 
dnl                      *changed* at the same time.
20
 
dnl  - AGE (Micro):      Increment if any interfaces have been added; set to 0
21
 
dnl                      if any interfaces have been removed. Removal has
22
 
dnl                      precedence over adding, so set to 0 if both happened.
23
 
dnl                      It denotes upward compatibility.
24
 
dnl  - REVISION (Minor): Increment any time the source changes; set to
25
 
dnl                      0 if you incremented CURRENT.
26
 
dnl
27
 
dnl  To summarize. Any interface *change* increment CURRENT. If that interface
28
 
dnl  change does not break upward compatibility (ie it is an addition),
29
 
dnl  increment AGE, Otherwise AGE is reset to 0. If CURRENT has changed,
30
 
dnl  REVISION is set to 0, otherwise REVISION is incremented.
31
 
dnl ---------------------------------------------------------------------------
32
 
VERSION_INFO_CURRENT=5
33
 
VERSION_INFO_REVISION=0
34
 
VERSION_INFO_AGE=0
35
 
INTERFACE_VERSION_INFO=$VERSION_INFO_CURRENT:$VERSION_INFO_REVISION:$VERSION_INFO_AGE
36
 
AC_SUBST(INTERFACE_VERSION_INFO)
37
 
dnl ---------------------------------------------------------------------------
38
 
 
39
 
AC_CONFIG_MACRO_DIR([m4])
40
 
 
41
 
AC_PROG_CC
42
 
 
43
 
if test -z "$(which $CC)"; then
44
 
    AC_MSG_ERROR([Unable to find a working C compiler, giving up.])
45
 
fi
46
 
 
47
 
AC_PROG_CPP
48
 
AC_PROG_CXX
49
 
 
50
 
if test -z "$(which $CXX)"; then
51
 
    AC_MSG_ERROR([Unable to find a working C++ compiler, giving up.])
52
 
fi
53
 
 
54
 
AC_CACHE_SAVE
55
 
AC_PROG_INSTALL
56
 
AC_PROG_MAKE_SET
57
 
AC_PROG_LIBTOOL
58
 
# AC_PROG_RANLIB is obsolete by AC_PROC_LIBTOOL
59
 
 
60
 
AC_SYS_LARGEFILE
61
 
 
62
 
dnl Check for pthreads.
63
 
ACX_PTHREAD
64
 
 
65
 
dnl Pass some build options to setup.py and .pc file
66
 
COMPILETIME_OPTIONS=""
67
 
 
68
 
AM_CONDITIONAL([ENABLE_SHIPPED_ASIO], false)
69
 
 
70
 
dnl Check for boost libraries.
71
 
AX_BOOST_BASE([1.35],[
72
 
   AX_BOOST_SYSTEM
73
 
   dnl check that Boost.System was found:
74
 
   if test -z "$BOOST_SYSTEM_LIB"; then
75
 
      AC_MSG_ERROR([unable to find Boost.System library, currently this is required.])
76
 
   fi
77
 
 
78
 
   AX_BOOST_ASIO
79
 
   dnl check that Boost.Asio was found:
80
 
   if test -z "$BOOST_ASIO_LIB"; then
81
 
      AC_MSG_ERROR([Unable to find Boost.Asio library, currently this is required.])
82
 
   fi
83
 
],[
84
 
   AX_BOOST_BASE([1.34],[
85
 
 
86
 
   dnl the user can choose which Asio library to use
87
 
   AC_ARG_WITH([asio],
88
 
        AS_HELP_STRING([--with-asio=shipped|system|your_path],
89
 
        [Specify the Asio library to use, shipped or system. Default is to use shipped library. You can also specify a path for your system.]),
90
 
        [[asio=$withval]],
91
 
        [[asio=shipped]]
92
 
   )
93
 
 
94
 
   dnl Check the value for the --with-asio switch
95
 
   AC_MSG_CHECKING([which Asio implementation to use])
96
 
   case "$asio" in
97
 
        "shipped")
98
 
                AC_MSG_RESULT(shipped)
99
 
                ASIO_HPP=`dirname $0`/include/libtorrent/asio.hpp
100
 
                ASIO_DIR=`dirname $0`/include/libtorrent/asio
101
 
                AC_CHECK_FILES($ASIO_HPP $ASIO_DIR/ssl/stream.hpp $ASIO_DIR/ip/tcp.hpp,
102
 
                        enable_shipped_asio=yes,
103
 
                        AC_MSG_ERROR([libtorrent-rasterbar depends on Asio library but it was not found.])
104
 
                )
105
 
                ;;
106
 
        "system")
107
 
                AC_MSG_RESULT(system)
108
 
                ASIO_HPP=/usr/include/asio.hpp
109
 
                ASIO_DIR=/usr/include/asio
110
 
                AC_CHECK_FILES($ASIO_HPP $ASIO_DIR/ssl/stream.hpp $ASIO_DIR/ip/tcp.hpp,
111
 
                        enable_shipped_asio=no,
112
 
                        AC_MSG_ERROR([libtorrent-rasterbar depends on Asio library but it was not found on your system.])
113
 
                )
114
 
                ;;
115
 
        *)
116
 
                AC_MSG_RESULT(detect)
117
 
                ASIO_HPP=$asio/../asio.hpp
118
 
                ASIO_DIR=$asio
119
 
                AC_CHECK_FILES($ASIO_HPP $ASIO_DIR/ssl/stream.hpp $ASIO_DIR/ip/tcp.hpp,
120
 
                        enable_shipped_asio=no,
121
 
                        AC_MSG_ERROR([libtorrent-rasterbar depends on Asio library but it was not found in the path you specified.])
122
 
                )
123
 
                ;;
124
 
    esac
125
 
    AM_CONDITIONAL([ENABLE_SHIPPED_ASIO], [test x$enable_shipped_asio = "xyes"])
126
 
])
127
 
])
128
 
 
129
 
AC_MSG_NOTICE([BOOST_CPPFLAGS=$BOOST_CPPFLAGS])
130
 
AC_MSG_NOTICE([BOOST_LDFLAGS=$BOOST_LDFLAGS])
131
 
 
132
 
AX_BOOST_FILESYSTEM
133
 
dnl check that Boost.Filesystem was found:
134
 
if test -z "$BOOST_FILESYSTEM_LIB"; then
135
 
   AC_MSG_ERROR([Unable to find Boost.Filesystem library, currently this is required.])
136
 
fi
137
 
 
138
 
AX_BOOST_THREAD
139
 
dnl check that Boost.Thread was found:
140
 
if test -z "$BOOST_THREAD_LIB"; then
141
 
   AC_MSG_ERROR([Unable to find Boost.Thread library, currently this is required.])
142
 
fi
143
 
 
144
 
AX_BOOST_REGEX
145
 
dnl check that Boost.Regex was found:
146
 
if test -z "$BOOST_REGEX_LIB"; then
147
 
   AC_MSG_RESULT([Unable to find Boost.Regex library, example test_client will not be build.])
148
 
   BUILD_TESTCLIENT=no;
149
 
fi
150
 
 
151
 
AX_BOOST_PROGRAM_OPTIONS
152
 
dnl check that Boost.Program_options was found:
153
 
if test -z "$BOOST_PROGRAM_OPTIONS_LIB"; then
154
 
   AC_MSG_RESULT([Unable to find Boost.Program_options library, example test_client will not be build.])
155
 
   BUILD_TESTCLIENT=no;
156
 
fi
157
 
 
158
 
dnl Apply boost config.
159
 
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
160
 
LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
161
 
 
162
 
if [[ "x$BUILD_TESTCLIENT" != "xno" ]]; then
163
 
        CLIENT_TEST_BIN=client_test;
164
 
        AC_SUBST(CLIENT_TEST_BIN)
165
 
fi
166
 
 
167
 
dnl try different ways of resolving gethostbyname
168
 
AC_CHECK_FUNC(gethostbyname, ,
169
 
        AC_CHECK_LIB(resolv, gethostbyname, ,
170
 
        AC_CHECK_LIB(nsl, gethostbyname, ,
171
 
        AC_CHECK_LIB(ws2_32, main, 
172
 
        AC_CHECK_LIB(wsock32, main, [LIBS="$LIBS -lws2_32 -lwsock32";] , 
173
 
        AC_MSG_ERROR([wsock32 not found. Stopped.])) ,
174
 
        AC_MSG_ERROR([gethostbyname not found. Stopped.]))))
175
 
)
176
 
 
177
 
dnl find out what kind of logging to use
178
 
AC_ARG_WITH(
179
 
        [logging],
180
 
        AS_HELP_STRING([--with-logging=none|default|verbose],[Specify how much logging to use. Default is none.]),
181
 
        [[logging=$withval]],
182
 
        [[logging=none]]
183
 
)
184
 
 
185
 
# this works around a bug in asio in boost-1.39
186
 
# see: https://svn.boost.org/trac/boost/ticket/3095
187
 
AC_DEFINE(BOOST_ASIO_HASH_MAP_BUCKETS,1021,)
188
 
COMPILETIME_OPTIONS+="-DBOOST_ASIO_HASH_MAP_BUCKETS=1021 "
189
 
 
190
 
dnl Check the value for the --with-logging switch
191
 
AC_MSG_CHECKING([what form of logging to use])
192
 
case "$logging" in
193
 
        "none")
194
 
                AC_MSG_RESULT(none)
195
 
                ;;
196
 
        "default")
197
 
                AC_MSG_RESULT(default)
198
 
                AC_DEFINE(TORRENT_LOGGING,,[define to use some logging])
199
 
                COMPILETIME_OPTIONS+="-DTORRENT_LOGGING "
200
 
                ;;
201
 
        "verbose")
202
 
                AC_MSG_RESULT(verbose)
203
 
                AC_DEFINE(TORRENT_VERBOSE_LOGGING,,[define to use verbose logging])
204
 
                COMPILETIME_OPTIONS+="-DTORRENT_VERBOSE_LOGGING "
205
 
                ;;
206
 
        *)
207
 
                AC_MSG_RESULT()
208
 
                AC_MSG_ERROR([Unknown logging option "$logging". Use either "none", "default" or "verbose".])
209
 
                ;;
210
 
esac
211
 
 
212
 
dnl find out what kind of dht-support to use
213
 
AC_ARG_WITH(
214
 
        [dht],
215
 
        AS_HELP_STRING([--with-dht=on|off|logging],[Specify how to use DHT support. Option logging will add extra logging. Default is on.]),
216
 
        [[dht=$withval]],
217
 
        [[dht=on]]
218
 
)
219
 
dnl Check the value for the --with-dht switch
220
 
AC_MSG_CHECKING([how to use DHT])
221
 
case "$dht" in
222
 
        "on")
223
 
                AC_MSG_RESULT(on)
224
 
                ;;
225
 
        "off")
226
 
                AC_MSG_RESULT(off)
227
 
                AC_DEFINE(TORRENT_DISABLE_DHT,,[define not to use DHT support])
228
 
                COMPILETIME_OPTIONS+="-DTORRENT_DISABLE_DHT "
229
 
                ;;
230
 
        "logging")
231
 
                AC_MSG_RESULT(logging)
232
 
                AC_DEFINE(TORRENT_DHT_VERBOSE_LOGGING,,[define to use DHT support with extra logging])
233
 
                COMPILETIME_OPTIONS+="-DTORRENT_DHT_VERBOSE_LOGGING "
234
 
                ;;
235
 
        *)
236
 
                AC_MSG_RESULT()
237
 
                AC_MSG_ERROR([Unknown dht option "$dht". Use either "on", "off" or "logging".])
238
 
                ;;
239
 
esac
240
 
AM_CONDITIONAL(USE_DHT, test "x$dht" != "xoff")
241
 
 
242
 
dnl encryption support.
243
 
AC_ARG_WITH(
244
 
       [encryption],
245
 
       AS_HELP_STRING([--with-encryption=on|off],[Specify how to use encryption support. Default is on.]),
246
 
       [[encryption=$withval]],
247
 
       [[encryption=on]]
248
 
)
249
 
 
250
 
dnl Check the value for the --with-encryption switch
251
 
AC_MSG_CHECKING([how to use encryption])
252
 
case "$encryption" in
253
 
       "on")
254
 
               AC_MSG_RESULT(on)
255
 
               CHECK_SSL()
256
 
               AC_DEFINE(TORRENT_USE_OPENSSL,,[define to use openssl with libtorrent-rasterbar])
257
 
               COMPILETIME_OPTIONS+="-DTORRENT_USE_OPENSSL "
258
 
 
259
 
               ;;
260
 
       "off")
261
 
               AC_MSG_RESULT(off)
262
 
               AC_DEFINE(TORRENT_DISABLE_ENCRYPTION,,[define not to use encryption support])
263
 
               COMPILETIME_OPTIONS+="-DTORRENT_DISABLE_ENCRYPTION "
264
 
               ;;
265
 
       *)
266
 
               AC_MSG_RESULT()
267
 
               AC_MSG_ERROR([Unknown encryption option "$encryption". Use either "on" or "off".])
268
 
               ;;
269
 
esac
270
 
AM_CONDITIONAL(USE_ENCRYPTION, test "x$encryption" != "xoff")
271
 
 
272
 
dnl the user can choose which zlib to use
273
 
AC_ARG_WITH(
274
 
        [zlib],
275
 
        AS_HELP_STRING([--with-zlib=shipped|system],[Specify the zlib to use, shipped or system. Default is to autodetect system and fallback to shipped.]),
276
 
        [[zlib=$withval]],
277
 
        [[zlib=detect]]
278
 
)
279
 
dnl Check the value for the --with-zlib switch
280
 
AC_MSG_CHECKING([which zlib implementation to use])
281
 
case "$zlib" in
282
 
        "detect")
283
 
                AC_MSG_RESULT([autodetect])
284
 
                AC_CHECK_LIB(z, main, ,
285
 
                        [zlib="shipped"]
286
 
                )
287
 
                ;;
288
 
        "shipped")
289
 
                AC_MSG_RESULT(shipped)
290
 
                ;;
291
 
        "system")
292
 
                AC_MSG_RESULT(system)
293
 
                AC_CHECK_LIB(z, main, ,
294
 
                        AC_MSG_ERROR([libtorrent-rasterbar depends on zlib but zlib was not found on your system.])
295
 
                )
296
 
                ;;
297
 
        "no")
298
 
                AC_MSG_RESULT()
299
 
                AC_MSG_ERROR([libtorrent-rasterbar depends on zlib, you must specify either "system" or "shipped".])
300
 
                ;;
301
 
        *)
302
 
                AC_MSG_RESULT()
303
 
                AC_MSG_ERROR([Unknown zlib option "$zlib". Use either "system" or "shipped".])
304
 
                ;;
305
 
esac
306
 
if [[ "$zlib" = "shipped" ]]; then
307
 
        ZLIB="\$(top_builddir)/zlib/libzlib.la"
308
 
        AM_CONDITIONAL([ENABLE_SHIPPED_ZLIB], true)
309
 
        ZLIBINCL="-I\$(top_srcdir)/zlib"
310
 
elif [[ "$zlib" = "system" ]] || [[ "$zlib" = "detect" ]]; then
311
 
        ZLIB="" # AC_CHECK_LIB will add -lz to @LIBS@ automatically
312
 
        AM_CONDITIONAL([ENABLE_SHIPPED_ZLIB], false)
313
 
        ZLIBINCL=""
314
 
fi
315
 
 
316
 
dnl make ZLIB and ZLIBDIR visible to Makefiles
317
 
AC_SUBST([ZLIB])
318
 
AC_SUBST([ZLIBINCL])
319
 
 
320
 
AC_ARG_ENABLE(
321
 
  [geoip],
322
 
  [AS_HELP_STRING(
323
 
    [--disable-geoip],
324
 
    [disable geoip support (if enabled, you can use --with-libgeoip to choose whether to link against shipped or system library) [default=yes]])],
325
 
  [
326
 
   ARG_ENABLE_GEOIP=$enableval
327
 
   ac_arg_enable_geoip=$enableval
328
 
  ],
329
 
  [
330
 
   ARG_ENABLE_GEOIP=yes
331
 
   ac_arg_enable_geoip=yes
332
 
  ]
333
 
)
334
 
 
335
 
AC_ARG_WITH(
336
 
  [libgeoip],
337
 
  [AS_HELP_STRING(
338
 
    [--with-libgeoip],
339
 
    [enable linking against system libgeoip [default=shipped]])],
340
 
  [[ARG_WITH_LIBGEOIP=$withval]],
341
 
  [[ARG_WITH_LIBGEOIP=no]]
342
 
)
343
 
 
344
 
AC_MSG_CHECKING([whether to link against system libgeoip]) #depends: $ac_arg_enable_geoip
345
 
AS_CASE(["$ARG_WITH_LIBGEOIP"],
346
 
  ["yes"|"system"], [
347
 
      AC_MSG_RESULT([yes])
348
 
 
349
 
      AS_IF([test "x$ac_arg_enable_geoip" = "xno"],
350
 
            [AC_MSG_ERROR([GeoIP support is disabled with this build configuration. Try using --enable-geoip.])])
351
 
 
352
 
      PKG_PROG_PKG_CONFIG([0.20])
353
 
 
354
 
      AC_MSG_NOTICE([libgeoip: now checking for the libgeoip library...])
355
 
 
356
 
      AC_CHECK_GEOIP([
357
 
        LIBS="$GEOIP_LIBS $LIBS"
358
 
        CFLAGS="$GEOIP_CFLAGS $CFLAGS"
359
 
       ],[
360
 
        AC_MSG_ERROR([GeoIP library not found. Try using --without-libgeoip to link against the shipped copy.])
361
 
      ])
362
 
   ],
363
 
  ["no"|"shipped"], [
364
 
      AS_IF([test "x$ac_arg_enable_geoip" = "xno"], [
365
 
            # redundant check: session_impl.hpp just won't check for any
366
 
            # GeoIP.h, so any value would be ok (ie. this AS_IF could be
367
 
            # removed)
368
 
            AC_MSG_RESULT([disabled])
369
 
            ARG_WITH_LIBGEOIP="disabled"
370
 
       ], [
371
 
            AC_MSG_RESULT([no])
372
 
            ARG_WITH_LIBGEOIP="no"
373
 
            AC_DEFINE([WITH_SHIPPED_GEOIP_H],[1],[Define to use shipped copy of GeoIP.h])
374
 
            COMPILETIME_OPTIONS+="-DWITH_SHIPPED_GEOIP_H "
375
 
      ])
376
 
   ],
377
 
  [AC_MSG_RESULT([$ARG_WITH_LIBGEOIP])
378
 
   AC_MSG_ERROR([Unknown option "$ARG_WITH_LIBGEOIP". Use either "yes" or "no".])]
379
 
)
380
 
 
381
 
AM_CONDITIONAL([WITH_SHIPPED_GEOIP], [test "x$ARG_WITH_LIBGEOIP" = "xno" ])
382
 
 
383
 
dnl Check whether python bindings should be build
384
 
AC_ARG_ENABLE(
385
 
        [python-binding],
386
 
        AS_HELP_STRING([--enable-python-binding],[Build python binding. Default is to not build them.]),
387
 
        [[ac_python_binding=$enableval]],
388
 
        [[ac_python_binding=no]]
389
 
)
390
 
 
391
 
AC_MSG_CHECKING([if python bindings should be build])
392
 
case "$ac_python_binding" in
393
 
        "yes")
394
 
                AC_MSG_RESULT(yes)
395
 
 
396
 
                AM_PATH_PYTHON([2.4],,AC_MSG_ERROR([Python not found. Python is required to build python binding.]))
397
 
 
398
 
                AX_BOOST_PYTHON
399
 
                dnl check that Boost.Python was found:
400
 
                if test -z "$BOOST_PYTHON_LIB"; then
401
 
                        AC_MSG_ERROR([Unable to find Boost.Python library, this is required to build python bindings.])
402
 
                fi
403
 
 
404
 
                AM_CONDITIONAL([ENABLE_PYTHON_BINDING],true)
405
 
 
406
 
                ;;
407
 
        "no")
408
 
                AC_MSG_RESULT(no)
409
 
                AM_CONDITIONAL([ENABLE_PYTHON_BINDING],false)
410
 
                ;;
411
 
        "")
412
 
                AC_MSG_RESULT(no)
413
 
                AM_CONDITIONAL([ENABLE_PYTHON_BINDING],false)
414
 
                ;;
415
 
        *)
416
 
                AC_MSG_RESULT()
417
 
                AC_MSG_ERROR([Unknown --enable-python option "$python". Use either "yes" or "no".])
418
 
                ;;
419
 
esac
420
 
 
421
 
dnl Use possibly specific python install params
422
 
if [[ "x$PYTHON_INSTALL_PARAMS" == "x" ]]; then
423
 
        PYTHON_INSTALL_PARAMS='--prefix=$(DESTDIR)$(prefix)'
424
 
fi
425
 
AC_SUBST(PYTHON_INSTALL_PARAMS)
426
 
 
427
 
dnl Check whether the examples should be build
428
 
AC_ARG_ENABLE(
429
 
        [examples],
430
 
        AS_HELP_STRING([--enable-examples],[Build the examples. Default is not to build them.]),
431
 
        [[examples=$enableval]],
432
 
        [[examples=no]]
433
 
)
434
 
dnl Check the value of the --with-examples switch
435
 
AC_MSG_CHECKING([if the examples should be build])
436
 
case "$examples" in
437
 
        "yes")
438
 
                AC_MSG_RESULT(yes)
439
 
                AM_CONDITIONAL([ENABLE_EXAMPLES], true)
440
 
                ;;
441
 
        "no")
442
 
                AC_MSG_RESULT(no)
443
 
                AM_CONDITIONAL([ENABLE_EXAMPLES], false)
444
 
                ;;
445
 
        "")
446
 
                AC_MSG_RESULT(yes (default))
447
 
                AM_CONDITIONAL([ENABLE_EXAMPLES], true)
448
 
                ;;
449
 
        *)
450
 
                AC_MSG_RESULT()
451
 
                AC_MSG_ERROR([Unknown --enable-examples option "$examples". Use either "yes" or "no".])
452
 
                ;;
453
 
esac
454
 
 
455
 
dnl Check whether the tests should be build
456
 
AC_ARG_ENABLE(
457
 
        [tests],
458
 
        AS_HELP_STRING([--enable-tests],[Build test files. Default is not to build them.]),
459
 
        [[tests=$enableval]],
460
 
        [[tests=no]]
461
 
)
462
 
dnl Check the value of the --with-tests switch
463
 
AC_MSG_CHECKING([if test files should be build])
464
 
case "$tests" in
465
 
        "yes")
466
 
                AC_MSG_RESULT(yes)
467
 
                AM_CONDITIONAL([ENABLE_TESTS], true)
468
 
                ;;
469
 
        "no")
470
 
                AC_MSG_RESULT(no)
471
 
                AM_CONDITIONAL([ENABLE_TESTS], false)
472
 
                ;;
473
 
        "")
474
 
                AC_MSG_RESULT(yes (default))
475
 
                AM_CONDITIONAL([ENABLE_TESTS], true)
476
 
                ;;
477
 
        *)
478
 
                AC_MSG_RESULT()
479
 
                AC_MSG_ERROR([Unknown --enable-tests option "$tests". Use either "yes" or "no".])
480
 
                ;;
481
 
esac
482
 
 
483
 
dnl Set some defines if we are building a shared library
484
 
if [[ "x$enable_shared" == "xyes" ]]; then
485
 
        AC_DEFINE(TORRENT_BUILDING_SHARED,,[Make sure the functions and classes are exported.])
486
 
        COMPILETIME_OPTIONS+="-DTORRENT_LINKING_SHARED "
487
 
fi
488
 
 
489
 
AC_DEFINE(BOOST_EXCEPTION_DISABLE,,[We do not need boost.exception features])
490
 
COMPILETIME_OPTIONS+="-DBOOST_EXCEPTION_DISABLE "
491
 
 
492
 
dnl want some debugging symbols with that?
493
 
AC_ARG_ENABLE(
494
 
        [debug],
495
 
        AS_HELP_STRING([--enable-debug],[Set compiler flags for debug symbols, default is no debugging.]),
496
 
        [case "$enableval" in
497
 
                no)
498
 
                        AC_DEFINE(NDEBUG,,[Define to disable debugging])
499
 
                        DEBUGFLAGS="-Os"
500
 
#                       COMPILETIME_OPTIONS+="-DNDEBUG "
501
 
                        ;;
502
 
                yes)
503
 
                        DEBUGFLAGS="-g"
504
 
                        COMPILETIME_OPTIONS+="-DTORRENT_DEBUG "
505
 
                        AC_DEFINE(TORRENT_DEBUG,,[Define to enable libtorrent debug build])
506
 
                        ;;
507
 
                *)
508
 
                        AC_MSG_RESULT()
509
 
                        AC_MSG_ERROR([Unknown --enable-debug option "$enableval". Use either "yes" or "no".])
510
 
                        ;;
511
 
        esac],
512
 
        [DEBUGFLAGS="-Os"
513
 
        AC_DEFINE(NDEBUG,,[Define to disable debugging])
514
 
#       COMPILETIME_OPTIONS+="-DNDEBUG "
515
 
        ]
516
 
)
517
 
AC_SUBST(DEBUGFLAGS)
518
 
 
519
 
dnl Compile time options.
520
 
AC_SUBST(COMPILETIME_OPTIONS)
521
 
 
522
 
AC_OUTPUT([Makefile
523
 
           src/Makefile
524
 
           include/Makefile
525
 
           zlib/Makefile
526
 
           examples/Makefile
527
 
           test/Makefile
528
 
           bindings/python/Makefile
529
 
           bindings/python/setup.py
530
 
           libtorrent-rasterbar.pc])