Statistics
| Revision:

root / trunk / configure.in @ 1834

History | View | Annotate | Download (22.4 KB)

1
AC_INIT(nntpgrab, 0.6.91)
2
AC_DEFINE(MAJOR_VERSION, 0, [Major version number])
3
AC_DEFINE(MINOR_VERSION, 6, [Minor version number])
4
AC_DEFINE(MICRO_VERSION, 91, [Micro version number])
5
AM_INIT_AUTOMAKE([no-dist-gzip dist-bzip2])
6
AC_PROG_CXX
7
AC_PROG_INSTALL
8
AC_LIBTOOL_DLOPEN
9
AC_LIBTOOL_WIN32_DLL
10
AC_DISABLE_STATIC
11
AC_CONFIG_HEADERS(config.h)
12
AC_SUBST(CPPFLAGS,$CPPFLAGS)
13
AC_PROG_LIBTOOL
14
AC_CHECK_SIZEOF(time_t)
15
AC_CHECK_SIZEOF(long)
16
AM_PROG_CC_C_O
17

                
18
GETTEXT_PACKAGE=NNTPGrab
19
AC_SUBST(GETTEXT_PACKAGE)
20
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Gettext package])
21

                
22
dnl Find pkg-config
23
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
24
if test "x$PKG_CONFIG" = "xno"; then
25
 AC_MSG_ERROR([You need to install pkg-config])
26
fi
27

                
28
AM_PATH_GLIB_2_0("2.10.0")
29

                
30
# Optional configure arguments
31
AC_ARG_ENABLE(dbus,
32
 [  --disable-dbus          Activate DBUS integration (enabled by default)],
33
 [case "x${enableval}" in
34
         xyes) dbus=true ;;
35
         xno) dbus=false ;;
36
         *) AC_MSG_ERROR(bad value ${enableval} for --disable-dbus) ;;
37
 esac],[dbus=true])
38

                
39
AC_ARG_ENABLE(online-search,
40
 [  --disable-online-search Activate support for the Online Search(enabled by default)],
41
 [case "x${enableval}" in
42
         xyes) online_search=true ;;
43
         xno) online_search=false ;;
44
         *) AC_MSG_ERROR(bad value ${enableval} for --disable-online-search) ;;
45
 esac],[online_search=true])
46

                
47
AC_ARG_ENABLE(proxy,
48
 [  --disable-proxy         Activate support for downloading using a proxy server (enabled by default)],
49
 [case "x${enableval}" in
50
         xyes) proxy=true ;;
51
         xno) proxy=false ;;
52
         *) AC_MSG_ERROR(bad value ${enableval} for --disable-proxy) ;;
53
 esac],[proxy=true])
54

                
55
# Search for GLib
56
PKG_CHECK_MODULES(GLIB,
57
 glib-2.0 >= 2.10.0 gthread-2.0 gmodule-2.0 gobject-2.0,
58
 ,
59
 [AC_MSG_ERROR([* GLib 2.10.0 or higher could not be found (is the package glib2-devel installed?)])])
60

                
61
# Search for GIO
62
PKG_CHECK_MODULES(GIO,
63
 glib-2.0 >= 2.16.0 gio-2.0,
64
 have_gio=true; AC_DEFINE_UNQUOTED(HAVE_GIO, 1, [Do we have GIO]),
65
 have_gio=false; [AC_MSG_RESULT([* GLib 2.16.0 or higher could not be found. Without GLib 2.16.0, automatic NZB import won't be possible])])
66

                
67
# Search for socket support in GIO
68
AC_MSG_CHECKING(if GIO >= 2.22.0)
69
pkg-config --atleast-version=2.22.0 gio-2.0
70
if test `echo $?` = 0; then
71
 AC_MSG_RESULT([yes]);
72
 AC_DEFINE_UNQUOTED(HAVE_GIO_SOCKET, 1, [Do we have socket support in GIO])
73
else
74
 AC_MSG_RESULT([no])
75
fi
76

                
77
# Search for dbus-glib
78
if test "$dbus" = "true" ; then
79
 PKG_CHECK_MODULES(DBUS,
80
         dbus-glib-1 >= 0.60,
81
         have_dbus=true; AC_DEFINE_UNQUOTED(HAVE_DBUS, 1, [Do we have DBus-glib]),
82
         have_dbus=false; [AC_MSG_RESULT([* DBUS-Glib 0.60 or higher could not be found (is the package dbus-devel and/or dbus-glib-devel installed?).])])
83
fi
84

                
85
# Search for libsoup
86
if test "$online_search" = "true" ; then
87
 PKG_CHECK_MODULES(SOUP,
88
         libsoup-2.4,
89
         have_soup=true; [AC_DEFINE_UNQUOTED(HAVE_SOUP, 1, [Do we have libsoup])],
90
         have_soup=false; [AC_MSG_RESULT([* libsoup 2.4 or higher could not be found (is the package libsoup-devel installed?). Without libsoup, the NZBCreator service can't be accessed])])
91

                
92
 PKG_CHECK_MODULES(SOUP_GZIP,
93
         libsoup-2.4 >= 2.28.2,
94
         [AC_DEFINE_UNQUOTED(HAVE_SOUP_GZIP, 1, [Do we have gzip support in libsoup])],
95
         [AC_MSG_RESULT([* libsoup 2.28.2 or higher could not be found. This is required to enable compression in the NZBCreator service])])
96
else
97
    have_soup="false"
98
fi
99

                
100
# Search for libproxy and libsoup-gnome
101
if test "$proxy" = "true" ; then
102
      PKG_CHECK_MODULES(SOUP_GNOME,
103
              libsoup-gnome-2.4,
104
              [AC_DEFINE_UNQUOTED(HAVE_SOUP_GNOME, 1, [Do we have libsoup-gnome])],
105
              [AC_MSG_RESULT([* libsoup-gnome 2.4 or higher could not be found (is the package libsoup-devel installed?). Without libsoup-gnome proxy settings won't be detected on Linux])])
106

                
107
      PKG_CHECK_MODULES(LIBPROXY,
108
              libproxy-1.0,
109
              [AC_DEFINE_UNQUOTED(HAVE_LIBPROXY, 1, [Do we have libproxy])],
110
              [AC_MSG_RESULT([* libproxy could not be found (is the package libproxy-devel installed?). Without libproxy proxy settings won't be detected])])
111
fi
112

                
113
# Search for glib-networking
114
AC_MSG_CHECKING([for glib-networking (glib TLS implementation)])
115
save_CFLAGS="$CFLAGS"
116
save_LIBS="$LIBS"
117
CFLAGS="$CFLAGS $GIO_CFLAGS"
118
LIBS="$LIBS $GIO_LIBS"
119
AC_RUN_IFELSE([AC_LANG_PROGRAM([#include ],
120
                              [g_type_init (); return !g_tls_backend_supports_tls (g_tls_backend_get_default ());])],
121
      [have_glib_networking=yes]; [AC_DEFINE_UNQUOTED(HAVE_GLIB_NETWORKING, 1, [Do we have glib-networking])],
122
      [have_glib_networking=no],
123
      [have_glib_networking="unknown (cross-compiling)"])
124
CFLAGS="$save_CFLAGS"
125
LIBS="$save_LIBS"
126
AC_MSG_RESULT($have_glib_networking)
127

                
128
AC_SUBST(GLIB_LIBS)
129
AC_SUBST(GLIB_CFLAGS)
130
AC_SUBST(GIO_LIBS)
131
AC_SUBST(GIO_CFLAGS)
132
AM_CONDITIONAL(HAVE_GIO, $have_gio)
133
AC_SUBST(LIBXML2_LIBS)
134
AC_SUBST(LIBXML2_CFLAGS)
135
AC_SUBST(DBUS_LIBS)
136
AC_SUBST(DBUS_CFLAGS)
137
AM_CONDITIONAL(HAVE_DBUS, $have_dbus)
138
AC_SUBST(SOUP_LIBS)
139
AC_SUBST(SOUP_CFLAGS)
140
AC_SUBST(SOUP_GNOME_LIBS)
141
AC_SUBST(SOUP_GNOME_CFLAGS)
142
AC_SUBST(LIBPROXY_LIBS)
143
AC_SUBST(LIBPROXY_CFLAGS)
144

                
145
AC_ARG_ENABLE(ssl,
146
      [  --disable-ssl           Activate NNTP-over-SSL support (enabled by default)],
147
      [case "x${enableval}" in
148
              xyes) ssl=true ;;
149
              xno) ssl=false ;;
150
              *) AC_MSG_ERROR(bad value ${enableval} for --disable-ssl) ;;
151
      esac],[ssl=true])
152

                
153
AC_ARG_ENABLE(php_module,
154
      [  --enable-php-module     Compile an PHP module which allows PHP scripts to call NNTPGrab methods (disabled by default)],
155
      [case "x${enableval}" in
156
              xyes) php_module=true ;;
157
              xno) php_module=false ;;
158
              *) AC_MSG_ERROR(bad value ${enableval} for --enable-php-module) ;;
159
      esac],[php_module=false])
160

                
161
AM_CONDITIONAL(ENABLE_PHP_MODULE, $php_module)
162

                
163
AC_ARG_ENABLE(networkmanager,
164
      [  --disable-networkmanager
165
                          Activate NetworkManager integration (enabled by default)],
166
      [case "x${enableval}" in
167
              xyes) networkmanager=true ;;
168
              xno) networkmanager=false ;;
169
              *) AC_MSG_ERROR(bad value ${enableval} for --disable-networkmanager) ;;
170
      esac],[networkmanager=true])
171

                
172
if test "$networkmanager" = "true" ; then
173
      PKG_CHECK_MODULES(NETWORKMANAGER, libnm-glib, have_networkmanager=true,have_networkmanager=false)
174
      if test "$have_networkmanager" = "false" ; then
175
              PKG_CHECK_MODULES(NETWORKMANAGER,
176
                      libnm_glib > 0.7.0,
177
                      have_networkmanager=true,
178
                      [AC_MSG_RESULT([* NetworkManager-glib could not be found (is the package NetworkManager-glib-devel installed?) Without NetworkManager-glib, NetworkManager integration won't be possible])]; have_networkmanager=false)
179
      fi
180
else
181
    have_networkmanager=false
182
fi
183

                
184
AC_ARG_ENABLE(automatic_shutdown,
185
      [  --disable-automatic-shutdown
186
                          Activate support for automatic shutdown (enabled by default)],
187
      [case "x${enableval}" in
188
              xyes) automatic_shutdown=true ;;
189
              xno) automatic_shutdown=false ;;
190
              *) AC_MSG_ERROR(bad value ${enableval} for --disable-automatic-shutdown) ;;
191
      esac],[automatic_shutdown=true])
192

                
193
AC_SUBST(NETWORKMANAGER_LIBS)
194
AC_SUBST(NETWORKMANAGER_CFLAGS)
195
AM_CONDITIONAL(HAVE_NETWORKMANAGER, $have_networkmanager)
196

                
197
AC_ARG_ENABLE(gui,
198
      [  --disable-gui           Turn on GUI client (enabled by default)],
199
      [case "x${enableval}" in
200
              xyes) gui=true ;;
201
              xno)  gui=false ;;
202
              x) gui=true ;;
203
              *) AC_MSG_ERROR(bad value ${enableval} for --disable-gui) ;;
204
      esac],[gui=true])
205

                
206
AC_ARG_ENABLE(gtk3,
207
      [  --disable-gtk3          Build against GTK+ 3 if it's available (enabled by default)],
208
      [case "x${enableval}" in
209
              xyes) gtk3=true ;;
210
              xno) gtk3=false ;;
211
              *) AC_MSG_ERROR(bad value ${enableval} for --disable-gtk3) ;;
212
      esac],[gtk3=true])
213

                
214
AC_ARG_ENABLE(notifications,
215
      [  --disable-notifications Activate support for showing notifications using libnotify (enabled by default)],
216
      [case "x${enableval}" in
217
              xyes) notifications=true ;;
218
              xno) notifications=false ;;
219
              *) AC_MSG_ERROR(bad value ${enableval} for --disable-notifications) ;;
220
      esac],[notifications=true])
221

                
222
AM_CONDITIONAL(ENABLE_GUI, $gui)
223
if [ "$gui" = "true" ]; then
224
      if test "$gtk3" = "true" ; then
225
              PKG_CHECK_MODULES(GTK3,
226
                      gtk+-3.0 gdk-3.0 gthread-2.0,
227
                      have_gtk3=true; AC_DEFINE_UNQUOTED(HAVE_GTK3, 1, [Do we have GTK-3 available]),
228
                      have_gtk3=false; [AC_MSG_RESULT([* GTK+-3.0 or higher could not be found (is the package gtk3+-devel installed?)])])
229
      else
230
              have_gtk3="false"
231
      fi
232

                
233
      if test "$have_gtk3" = "false" ; then
234
              PKG_CHECK_MODULES(GTK,
235
                      gtk+-2.0 gdk-2.0 gthread-2.0,
236
                      ,
237
                      [AC_MSG_ERROR([* GTK+-2.2 or higher could not be found (is the package gtk2+-devel installed?)])])
238

                
239
              AC_MSG_CHECKING(if GTK >= 2.12.0)
240
              pkg-config --atleast-version=2.12.0 gtk+-2.0
241
              if test `echo $?` = 0; then
242
                      AC_MSG_RESULT([yes])
243
              else
244
                      AC_MSG_RESULT([no])
245
                      PKG_CHECK_MODULES(GLADE,
246
                              libglade-2.0,
247
                              ,
248
                              [AC_MSG_ERROR([* Glade 2.0 or higher could not be found (is the package libglade2-devel installed?)])])
249
              fi
250
      fi
251

                
252
      if test "$notifications" = "true" ; then
253
              PKG_CHECK_MODULES(LIBNOTIFY,
254
                      libnotify >= 0.4.1,
255
                      AC_DEFINE_UNQUOTED(HAVE_LIBNOTIFY, 1, [Do we have libnotify available]),
256
                      [AC_MSG_RESULT([* libnotify 0.4.1 or higher could not be found (is the package libnotify-devel installed?). Without libnotify, notification balloons aren't possible])])
257

                
258
              AC_MSG_CHECKING(if libnotify >= 0.7.0)
259
              pkg-config --atleast-version=0.7.0 libnotify
260
              if test `echo $?` = 0; then
261
                      AC_MSG_RESULT([yes])
262
                      AC_DEFINE_UNQUOTED(HAVE_LIBNOTIFY_0_7, 1, [Do we have libnotify 0.7 available])
263
              else
264
                      AC_MSG_RESULT([no])
265
              fi
266
      fi
267

                
268
      if test "$automatic_shutdown" = "true" ; then
269
              PKG_CHECK_MODULES(POLKIT,
270
                      polkit-gobject-1,
271
                      AC_DEFINE_UNQUOTED(HAVE_POLKIT1, 1, [Do we have PolicyKit 1.0 available]),
272
                      [PKG_CHECK_MODULES(POLKIT,
273
                              polkit-gnome,
274
                              AC_DEFINE_UNQUOTED(HAVE_POLKIT_OLD, 1, [Do we have PolicyKit 0.9 available]),
275
                              [AC_MSG_RESULT([* PolicyKit could not be found (is the package polkit-devel or PolicyKit-gnome-devel installed?). Without PolicyKit, automatic shutdown won't be possible])])
276
                      ])
277
      fi
278

                
279
      PKG_CHECK_MODULES(LIBXML2,
280
              libxml-2.0,
281
              ,
282
              [AC_MSG_ERROR([* LibXML 2.0 or higher could not be found (is the package libxml2-devel installed?)])])
283
fi
284

                
285
AC_ARG_ENABLE(par2cmdline-check,
286
      [  --disable-par2cmdline-check
287
                          Check for the existance of the par2 binary (enabled by default)],
288
      [case "x${enableval}" in
289
              xyes) par2_check=true ;;
290
              xno) par2_check=false ;;
291
              *) AC_MSG_ERROR(bad value ${enableval} for --disable-par2cmdline-check) ;;
292
      esac],[par2_check=true])
293

                
294
if test "$par2_check" = "true" ; then
295
      AC_CHECK_PROGS([PAR2CMDLINE], [par2])
296
      if test "x$PAR2CMDLINE" = "x" ; then
297
              AC_MSG_ERROR([par2cmdline is not found. This is required for NNTPGrab])
298
      fi
299
fi
300

                
301
AC_SUBST(GTK3_LIBS)
302
AC_SUBST(GTK3_CFLAGS)
303
AC_SUBST(GTK_LIBS)
304
AC_SUBST(GTK_CFLAGS)
305
AC_SUBST(GLADE_CFLAGS)
306
AC_SUBST(GLADE_LIBS)
307
AC_SUBST(POLKIT_LIBS)
308
AC_SUBST(POLKIT_CFLAGS)
309
AC_SUBST(LIBNOTIFY_LIBS)
310
AC_SUBST(LIBNOTIFY_CFLAGS)
311

                
312
# check for gtk-doc
313
GTK_DOC_CHECK([1.14],[--flavour no-tmpl])
314

                
315
dnl Default search paths for headers and libs
316
dnl ----------------------------------------
317

                
318
ac_default_lib_searchpath="/sw/lib /usr/lib64 /usr/local/lib64 /usr/lib /usr/local/lib /opt/lib"
319
ac_default_lib_searchpath="$ac_default_lib_searchpath /usr/lib/openssl/lib /usr/X11R6/lib"
320
ac_default_lib_searchpath="$ac_default_lib_searchpath /usr/X11R6/lib/mozilla* /usr/lib/mozilla*"
321
ac_default_lib_searchpath="$ac_default_lib_searchpath /usr/local/mozilla* /usr/local/mozilla*/lib"
322
ac_default_lib_searchpath="$ac_default_lib_searchpath /usr/local/ssl*/lib /usr/local/lib/openssl"
323
ac_default_lib_searchpath="$ac_default_lib_searchpath /opt/gnome/lib/mozilla /opt/mozilla/lib"
324
ac_default_lib_searchpath="$ac_default_lib_searchpath /usr/lib/curl /usr/local/lib/curl /opt/curl/lib"
325
ac_default_lib_searchpath="$ac_default_lib_searchpath /opt/MozillaThunderbird/lib64 /opt/openssl/lib"
326
ac_default_lib_searchpath="$ac_default_lib_searchpath /sw/lib/mozilla /dist/lib"
327

                
328
ac_default_inc_searchpath="/sw/include /usr/include /usr/include/libxml2 /usr/local/include "
329
ac_default_inc_searchpath="$ac_default_inc_searchpath /opt/include /opt/openssl/include "
330
ac_default_inc_searchpath="$ac_default_inc_searchpath /usr/lib/openssl/include /usr/include/mozilla*"
331
ac_default_inc_searchpath="$ac_default_inc_searchpath /usr/local/mozilla* /usr/local/mozilla*/include"
332
ac_default_inc_searchpath="$ac_default_inc_searchpath /usr/local/ssl/include /usr/local/include/openssl"
333
ac_default_inc_searchpath="$ac_default_inc_searchpath /usr/include/mozilla*/gtkembedmoz /usr/local/include/mozilla*/gtkembedmoz"
334
ac_default_inc_searchpath="$ac_default_inc_searchpath /opt/gnome/include/mozilla /opt/mozilla/include"
335
ac_default_inc_searchpath="$ac_default_inc_searchpath /usr/include/curl /usr/local/include/curl /opt/curl/include"
336
ac_default_inc_searchpath="$ac_default_inc_searchpath /sw/include/mozilla /usr/include/pcre /dist/include"
337

                
338
dnl --------------------
339
dnl OS specific settings
340
dnl --------------------
341

                
342
case "$host_os" in
343
        mingw32)
344
                CPPFLAGS="$CPPFLAGS -mms-bitfields"
345
                CFLAGS="$CFLAGS -DOS=\"\\\"Windows\\\"\""
346
                AC_CHECK_TOOL(WINDRES, windres, no)
347
                if test "$WINDRES" = no; then 
348
                        AC_MSG_ERROR([*** Could not find an implementation of windres in your PATH.]) 
349
                fi
350
                AM_CONDITIONAL(WIN32, true)
351
                AC_DEFINE(WIN32, 1, [Is this a Win32 platform])
352
                AM_CONDITIONAL(DARWIN, false);;
353
       cygwin)
354
                CFLAGS="$CFLAGS -DOS=\"\\\"Windows\\\"\""
355
                AC_CHECK_TOOL(WINDRES, windres, no)
356
                if test "$WINDRES" = no; then
357
                        AC_MSG_ERROR([*** Could not find an implementation of windres in your PATH.])
358
                fi
359
                AM_CONDITIONAL(WIN32, true)
360
                AC_DEFINE(WIN32, 1, [Is this a Win32 platform])
361
                AM_CONDITIONAL(DARWIN, false)
362
                LDFLAGS="$LDFLAGS -mwindows";;
363
        darwin*)
364
                CFLAGS="$CFLAGS -DOS=\"\\\"Mac_OS_X/X86\\\"\""
365
                CPPFLAGS="$CPPFLAGS -DDARWIN"
366
                AM_CONDITIONAL(WIN32, false)
367
                AM_CONDITIONAL(DARWIN, true);;
368
        *)
369
                CFLAGS="$CFLAGS -DOS=\"\\\"`uname -s`\\\"\""
370
                AM_CONDITIONAL(WIN32, false)
371
                AM_CONDITIONAL(DARWIN, false);;
372
esac
373

                
374
dnl ---------------------
375
dnl Mac OS X integration
376
dnl ---------------------
377
if test "$host_os" = "darwin9" -o "$host_os" = "darwin10" -o "$host_os" = "darwin10.2.0" ; then
378
  if [ "$gui" = "true" ]; then
379
    PKG_CHECK_MODULES(MAC_INTEGRATION, ige-mac-integration,, [AC_MSG_ERROR([* ige-mac-integration could not be found. Please install it from https://developer.imendio.com/projects/gtk-macosx/integration])])
380
  fi
381

                
382
  # Mac OS X doesn't like 'EXPORTS' mentioned in the .def files..strip them out
383
  grep -v EXPORTS plugins/nntpgrab_plugin.def > tmp
384
  unlink plugins/nntpgrab_plugin.def
385
  mv tmp plugins/nntpgrab_plugin.def
386

                
387
  grep -v EXPORTS base/nntpgrab_utils.def > tmp
388
  unlink base/nntpgrab_utils.def
389
  mv tmp base/nntpgrab_utils.def
390

                
391
  grep -v EXPORTS nntpgrab_core/nntpgrab.def > tmp
392
  unlink nntpgrab_core/nntpgrab.def
393
  mv tmp nntpgrab_core/nntpgrab.def
394

                
395
  grep -v EXPORTS automation/nntpgrab_automation.def > tmp
396
  unlink automation/nntpgrab_automation.def
397
  mv tmp automation/nntpgrab_automation.def
398

                
399
  grep -v EXPORTS glue/nntpgrab_glue.def > tmp
400
  unlink glue/nntpgrab_glue.def
401
  mv tmp glue/nntpgrab_glue.def
402

                
403
  grep -v EXPORTS gui_base/nntpgrab_gui_base.def > tmp
404
  unlink gui_base/nntpgrab_gui_base.def
405
  mv tmp gui_base/nntpgrab_gui_base.def
406
fi
407

                
408
AC_SUBST(MAC_INTEGRATION_CFLAGS)
409
AC_SUBST(MAC_INTEGRATION_LIBS)
410

                
411
dnl ---
412
dnl PCRE is only necessary when GLib 2.14.0 or higher is not found
413
dnl ---
414
AC_MSG_CHECKING(if GLIB >= 2.14.0)
415
pkg-config --atleast-version=2.14.0 glib-2.0
416
if test `echo $?` = 0; then
417
  AC_MSG_RESULT([yes])
418
else
419
  AC_MSG_RESULT([no])
420
  AC_FIND_LIB2(pcre, $ac_default_lib_searchpath, pcre_libraries, [PCRE libraries.], [PCRE libraries could not be found])
421
  AC_FIND_HEADER2(pcre.h, $ac_default_inc_searchpath, pcre_headers, [PCRE headers.], [PCRE headers could not be found])
422
fi
423

                
424
if test "$have_soup" = "false" -a "$gui" = "true"; then
425
  dnl ---------------
426
  dnl libCURL support
427
  dnl ---------------
428
  AC_FIND_LIB2(curl, $ac_default_lib_searchpath, libcurl_libraries,
429
    [Curl library],
430
    [Curl library couldn't be found])
431

                
432
  AC_FIND_HEADER2(curl/curl.h, $ac_default_inc_searchpath, libcurl_headers,
433
    [Curl headers],
434
    [Curl headers could not be found],
435
     curl)
436
fi
437

                
438
AM_CONDITIONAL(HAVE_SSL, $ssl)
439
if test "$ssl" = "true" ; then
440
      AC_DEFINE_UNQUOTED(HAVE_SSL, 1, [Do we have to build with SSL support])
441

                
442
      PKG_CHECK_MODULES(GNUTLS,
443
              gnutls,
444
              gnutls_found=true; AC_DEFINE_UNQUOTED(HAVE_GNUTLS, 1, [Do we have to build with GNUTLS support]),
445
              [AC_MSG_RESULT([* GNUTLS could not be found (is the package gnutls-devel installed?)])]; gnutls_found=false)
446

                
447
      if test "$gnutls_found" = "false" ; then
448
              PKG_CHECK_MODULES(NSS,
449
                      nss,
450
                      nss_found=true,
451
                      [AC_MSG_RESULT([* NSS could not be found (is the package nss-devel installed?)])]; nss_found=false)
452

                
453
              if test "$nss_found" = "true" ; then
454
                      AC_FIND_LIB(nss_compat_ossl, $ac_default_lib_searchpath, nss_compat_ossl_libraries,
455
                              [nss_compat_ossl libraries],
456
                              [nss_compat_ossl libraries could not be found])
457

                
458
                      AC_FIND_HEADER(nss_compat_ossl/nss_compat_ossl.h, $ac_default_inc_searchpath, nss_compat_ossl_headers,
459
                              [nss_compat_ossl headers],
460
                              [nss_compat_oss header could not be found],
461
                              nss_compat_ossl)
462
              fi
463

                
464
              if test "$nss_found" = "true" -a \
465
                      "$nss_compat_ossl_libraries_ok" = "true" -a \
466
                      "$nss_compat_ossl_headers_ok" = "true" ; then
467

                
468
                      have_nss_compat_ossl=true
469
                      AC_DEFINE_UNQUOTED(HAVE_NSS_COMPAT_OSSL, 1, [Do we have to build with nss-compat-openSSL support])
470
                      NSS_LIBS="$NSS_LIBS -lnss_compat_ossl"
471
              else
472
                      have_nss_compat_ossl=false
473
                      NSS_CFLAGS=""
474
                      NSS_LIBS=""
475
              fi
476

                
477
              if test "$have_nss_compat_ossl" = "false" ; then
478
                      AC_FIND_LIB2(ssl, $ac_default_lib_searchpath, openssl_libraries,
479
                              [OpenSSL libraries],
480
                              [OpenSSL library not found])
481
  
482
                      AC_FIND_HEADER2(openssl/md5.h, $ac_default_inc_searchpath, openssl_headers,
483
                              [OpenSSL headers],
484
                              [OpenSSL headers could not be found])
485
  
486
                      openssl_libraries_LIBS="$openssl_libraries_LIBS -lcrypto"
487
              fi
488
      fi
489
fi
490

                
491
AC_SUBST(PCRE_CFLAGS, $pcre_headers_CFLAGS)
492
AC_SUBST(PCRE_LIBS, $pcre_libraries_LIBS)
493
AC_SUBST(CURL_CFLAGS, $libcurl_headers_CFLAGS)
494
AC_SUBST(CURL_LIBS, $libcurl_libraries_LIBS)
495
AC_SUBST(GNUTLS_CFLAGS)
496
AC_SUBST(GNUTLS_LIBS)
497
AC_SUBST(NSS_CFLAGS)
498
AC_SUBST(NSS_LIBS)
499
AC_SUBST(OPENSSL_CFLAGS, $openssl_headers_CFLAGS)
500
AC_SUBST(OPENSSL_LIBS, $openssl_libraries_LIBS)
501

                
502
# Introspection support
503
GOBJECT_INTROSPECTION_CHECK([0.9.0])
504

                
505
# gettext
506
AC_PROG_INTLTOOL([0.21], [no-xml])
507
AC_PATH_PROG(MSGFMT, msgfmt, msgfmt)
508

                
509
ALL_LINGUAS="nl fr"
510
AM_GLIB_GNU_GETTEXT
511

                
512
if test "x$WIN32_TRUE" = "x" ; then
513
    nntpgrablocaledir='../${DATADIRNAME}/locale'
514
else
515
    nntpgrablocaledir='${prefix}/${DATADIRNAME}/locale'
516
fi
517
AC_SUBST(nntpgrablocaledir)
518

                
519
AC_CHECK_FUNC(strptime,[ AC_DEFINE(HAVE_STRPTIME, 1, [strptime check]) AM_CONDITIONAL(HAVE_STRPTIME, true) ],[ AM_CONDITIONAL(HAVE_STRPTIME, false) ])
520
AC_CHECK_FUNC(backtrace_symbols, [AC_DEFINE(HAVE_BACKTRACE, 1, [backtrace_symbols check])])
521

                
522
dnl Checks for mkdtemp function
523

                
524
mkdtemp_missing=false
525
AC_CHECK_FUNC(mkdtemp,
526
    [AC_DEFINE([HAVE_MKDTEMP], 1, [Have GlibC function to make temp dirs])],
527
    mkdtemp_missing=true)
528
AM_CONDITIONAL(MKDTEMP_MISSING, test x$mkdtemp_missing = xtrue)
529

                
530
dnl Set PACKAGE SOURCE DIR in config.h.
531
packagesrcdir=`cd $srcdir && pwd`
532

                
533
dnl Set PACKAGE PREFIX
534
if test "x${prefix}" = "xNONE"; then
535
  packageprefix=${ac_default_prefix}
536
else
537
  packageprefix=${prefix}
538
fi
539

                
540
packagedatadir=share/${PACKAGE}
541
pkgdir=${packageprefix}/${packagedatadir}
542
plugindir=${libdir}/${PACKAGE}
543
wwwdir=${pkgdir}/web
544

                
545
AC_DEFINE_UNQUOTED(SHARE_DIR, "${pkgdir}", [Location of NNTPGrab icons])
546
AC_SUBST(PLUGINDIR, "${plugindir}")
547
AC_SUBST(WWWDIR, "${wwwdir}")
548
CPPFLAGS="$CPPFLAGS -DPLUGIN_DIR=\"\\\"\${PLUGINDIR}\\\"\" -DWWW_DIR=\"\\\"\${WWWDIR}\\\"\""
549

                
550
# -fstack-protector
551
AC_ARG_ENABLE([stack-protector],
552
    [AS_HELP_STRING([--disable-stack-protector],
553
        [Disable GCC's/libc's stack-smashing protection])],
554
    [case "${enableval}" in
555
         yes) enable_ssp=yes ;;
556
          no) enable_ssp=no ;;
557
           *) AC_MSG_ERROR([invalid value ${enableval} for --disable-stack-protector]) ;;
558
     esac],
559
    [enable_ssp=yes])
560

                
561
if test x"$enable_ssp" = x"yes" && test x"$GCC" != x"yes"; then
562
    AC_MSG_NOTICE([Disabling stack-smashing protection because compiler is not GCC])
563
    enable_ssp=no
564
fi
565

                
566
if test x"$enable_ssp" = x"yes"; then
567
    # Check for broken ssp in libc: https://www.avahi.org/ticket/105
568
    # libc's brokenness will get in the way regardless of whether -lssp is
569
    # provided, but provide it anyway (otherwise non-libc ssp would wrongly
570
    # break here)
571

                
572
    # Get -lssp if it exists
573
    GCC_STACK_PROTECT_LIB
574

                
575
    AC_MSG_CHECKING([whether stack-smashing protection is available])
576
    ssp_old_cflags="$CFLAGS"
577
    ssp_old_ldflags="$LDFLAGS"
578
    CFLAGS="$CFLAGS -fstack-protector-all -fPIC"
579
    LDFLAGS="$LDFLAGS -Wl,-z,defs"
580
    cat confdefs.h > conftest.c
581
    cat >>conftest.c <<_ACEOF
582
void test_broken_ssp(c)
583
    const char *c;
584
{
585
    char arr[[123]], *p; /* beware of possible double-braces if copying this */
586
    for (p = arr; *c; ++p) {
587
        *p = *c;
588
        ++c;
589
    }
590
}
591
_ACEOF
592
    rm -f conftest.o
593

                
594
    if $CC -c $CFLAGS $CPPFLAGS -o conftest.o conftest.c >/dev/null 2>&1; then
595
        AC_MSG_RESULT([yes])
596
        AC_MSG_CHECKING([whether stack-smashing protection is buggy])
597
        if $CC -o conftest.so $LDFLAGS -shared conftest.o $LIBS >/dev/null 2>&1; then
598
            AC_MSG_RESULT([no])
599
        else
600
            AC_MSG_RESULT([yes])
601
            enable_ssp=no
602
        fi
603
    else
604
        AC_MSG_RESULT([no])
605
    fi
606

                
607
    rm -f conftest.c conftest.o conftest.so
608

                
609
    CFLAGS="$ssp_old_cflags"
610
    LDFLAGS="$ssp_old_ldflags"
611
fi
612

                
613
if test x"$enable_ssp" = x"yes"; then
614
    # Do this the long way so we don't call GCC_STACK_PROTECT_LIB twice
615
    GCC_STACK_PROTECT_CC
616

                
617
    AC_LANG_PUSH([C++])
618
    GCC_STACK_PROTECT_CXX
619
    AC_LANG_POP([C++])
620
    # XXX: Update the enable_ssp value now for output later?
621
fi
622

                
623
if test "$php_module" = "true" ; then
624
    AC_CONFIG_SUBDIRS(client/web/module)
625
fi
626

                
627
AC_OUTPUT([
628
Makefile
629
docs/Makefile
630
docs/reference/Makefile
631
docs/reference/version.xml
632
po/Makefile.in
633
base/Makefile
634
base/nntpgrab_utils.pc
635
gui_base/Makefile
636
automation/Makefile
637
automation/nntpgrab_automation.pc
638
nntpgrab_core/Makefile
639
nntpgrab_core/nntpgrab.pc
640
glue/Makefile
641
glue/nntpgrab_glue.pc
642
server/Makefile
643
plugins/Makefile
644
plugins/antisleep/Makefile
645
plugins/auto_import/Makefile
646
plugins/decoder/Makefile
647
plugins/example/Makefile
648
plugins/jsonrpc/Makefile
649
plugins/logger/Makefile
650
plugins/networkmanager/Makefile
651
plugins/par2/Makefile
652
plugins/unpack/Makefile
653
client/Makefile
654
client/web/Makefile
655
client/gui/Makefile
656
tests/Makefile
657
])