Statistics
| Revision:

root / trunk / configure.in @ 1783

History | View | Annotate | Download (22.6 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
AC_ARG_ENABLE(dbus,
31
    [  --disable-dbus          Activate DBUS integration (enabled by default)],
32
    [case "x${enableval}" in
33
        xyes) dbus=true ;;
34
        xno) dbus=false ;;
35
        *) AC_MSG_ERROR(bad value ${enableval} for --disable-dbus) ;;
36
    esac],[dbus=true])
37

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

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

                
54
PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.10.0 gthread-2.0 gmodule-2.0 gobject-2.0,,[AC_MSG_ERROR([* GLib 2.10.0 or higher could not be found (is the package glib2-devel installed?)])])
55
PKG_CHECK_MODULES(GIO, glib-2.0 >= 2.16.0 gio-2.0,have_gio=true,[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])]; have_gio=false)
56

                
57
if test "$dbus" = "true" ; then
58
    PKG_CHECK_MODULES(DBUS, dbus-glib-1 >= 0.60,have_dbus=true,[AC_MSG_RESULT([* DBUS-Glib 0.60 or higher could not be found (is the package dbus-devel and/or dbus-glib-devel installed?).])]; have_dbus=false)
59
else
60
    have_dbus="false"
61
fi
62

                
63
if test "$online_search" = "true" ; then
64
    PKG_CHECK_MODULES(SOUP, libsoup-2.4, have_soup=true,[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])]; have_soup=false)
65
    PKG_CHECK_MODULES(SOUP_GZIP, libsoup-2.4 >= 2.28.2, have_soup_gzip=true,[AC_MSG_RESULT([* libsoup 2.28.2 or higher could not be found. This is required to enable compression in the NZBCreator service])]; have_soup_gzip=false)
66
else
67
    have_soup="false"
68
    have_soup_gzip="false"
69
fi
70

                
71
if test "$proxy" = "true" ; then
72
    PKG_CHECK_MODULES(SOUP_GNOME, libsoup-gnome-2.4, have_soup_gnome=true,[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])]; have_soup_gnome=false)
73
    PKG_CHECK_MODULES(LIBPROXY, libproxy-1.0, have_libproxy=true,[AC_MSG_RESULT([* libproxy could not be found (is the package libproxy-devel installed?). Without libproxy proxy settings won't be detected])]; have_libproxy=false)
74
else
75
    have_soup_gnome="false"
76
    have_libproxy="false"
77
fi
78

                
79
AC_SUBST(GLIB_LIBS)
80
AC_SUBST(GLIB_CFLAGS)
81
AC_SUBST(GIO_LIBS)
82
AC_SUBST(GIO_CFLAGS)
83
AM_CONDITIONAL(HAVE_GIO, $have_gio)
84
AC_SUBST(LIBXML2_LIBS)
85
AC_SUBST(LIBXML2_CFLAGS)
86
AC_SUBST(DBUS_LIBS)
87
AC_SUBST(DBUS_CFLAGS)
88
AM_CONDITIONAL(HAVE_DBUS, $have_dbus)
89
AC_SUBST(SOUP_LIBS)
90
AC_SUBST(SOUP_CFLAGS)
91
AM_CONDITIONAL(HAVE_SOUP, $have_soup)
92
AM_CONDITIONAL(HAVE_SOUP_GZIP, $have_soup_gzip)
93
AC_SUBST(SOUP_GNOME_LIBS)
94
AC_SUBST(SOUP_GNOME_CFLAGS)
95
AM_CONDITIONAL(HAVE_SOUP_GNOME, $have_soup_gnome)
96
AC_SUBST(LIBPROXY_LIBS)
97
AC_SUBST(LIBPROXY_CFLAGS)
98
AM_CONDITIONAL(HAVE_LIBPROXY, $have_libproxy)
99

                
100
AC_ARG_ENABLE(ssl,
101
    [  --disable-ssl           Activate NNTP-over-SSL support (enabled by default)],
102
    [case "x${enableval}" in
103
        xyes) ssl=true ;;
104
        xno) ssl=false ;;
105
        *) AC_MSG_ERROR(bad value ${enableval} for --disable-ssl) ;;
106
    esac],[ssl=true])
107

                
108
AC_ARG_ENABLE(php_module,
109
    [  --enable-php-module     Compile an PHP module which allows PHP scripts to call NNTPGrab methods (disabled by default)],
110
    [case "x${enableval}" in
111
        xyes) php_module=true ;;
112
        xno) php_module=false ;;
113
        *) AC_MSG_ERROR(bad value ${enableval} for --enable-php-module) ;;
114
    esac],[php_module=false])
115

                
116
AM_CONDITIONAL(ENABLE_PHP_MODULE, $php_module)
117

                
118
AC_ARG_ENABLE(networkmanager,
119
    [  --disable-networkmanager
120
                          Activate NetworkManager integration (enabled by default)],
121
    [case "x${enableval}" in
122
        xyes) networkmanager=true ;;
123
        xno) networkmanager=false ;;
124
        *) AC_MSG_ERROR(bad value ${enableval} for --disable-networkmanager) ;;
125
    esac],[networkmanager=true])
126

                
127
if test "$networkmanager" = "true" ; then
128
    PKG_CHECK_MODULES(NETWORKMANAGER, libnm-glib, have_networkmanager=true,have_networkmanager=false)
129
    if test "$have_networkmanager" = "false" ; then
130
        PKG_CHECK_MODULES(NETWORKMANAGER, libnm_glib > 0.7.0, have_networkmanager=true,[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)
131
    fi
132
else
133
    have_networkmanager=false
134
fi
135

                
136
AC_ARG_ENABLE(automatic_shutdown,
137
    [  --disable-automatic-shutdown
138
                          Activate support for automatic shutdown (enabled by default)],
139
    [case "x${enableval}" in
140
        xyes) automatic_shutdown=true ;;
141
        xno) automatic_shutdown=false ;;
142
        *) AC_MSG_ERROR(bad value ${enableval} for --disable-automatic-shutdown) ;;
143
    esac],[automatic_shutdown=true])
144

                
145
AC_SUBST(NETWORKMANAGER_LIBS)
146
AC_SUBST(NETWORKMANAGER_CFLAGS)
147
AM_CONDITIONAL(HAVE_NETWORKMANAGER, $have_networkmanager)
148

                
149
AC_ARG_ENABLE(gui,
150
    [  --disable-gui           Turn on GUI client (enabled by default)],
151
    [case "x${enableval}" in
152
        xyes) gui=true ;;
153
        xno)  gui=false ;;
154
        x) gui=true ;;
155
        *) AC_MSG_ERROR(bad value ${enableval} for --disable-gui) ;;
156
    esac],[gui=true])
157

                
158
AC_ARG_ENABLE(gtk3,
159
    [  --disable-gtk3          Build against GTK+ 3 if it's available (enabled by default)],
160
    [case "x${enableval}" in
161
        xyes) gtk3=true ;;
162
        xno) gtk3=false ;;
163
        *) AC_MSG_ERROR(bad value ${enableval} for --disable-gtk3) ;;
164
    esac],[gtk3=true])
165

                
166
AC_ARG_ENABLE(notifications,
167
    [  --disable-notifications Activate support for showing notifications using libnotify (enabled by default)],
168
    [case "x${enableval}" in
169
        xyes) notifications=true ;;
170
        xno) notifications=false ;;
171
        *) AC_MSG_ERROR(bad value ${enableval} for --disable-notifications) ;;
172
    esac],[notifications=true])
173

                
174
AM_CONDITIONAL(ENABLE_GUI, $gui)
175
if [ "$gui" = "true" ]; then
176
  if test "$gtk3" = "true" ; then
177
    PKG_CHECK_MODULES(GTK3, gtk+-3.0 gdk-3.0 gthread-2.0, have_gtk3=true,[AC_MSG_RESULT([* GTK+-3.0 or higher could not be found (is the package gtk3+-devel installed?)])]; have_gtk3=false)
178
  else
179
    have_gtk3="false"
180
  fi
181

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

                
185
    AC_MSG_CHECKING(if GTK >= 2.12.0)
186
    pkg-config --atleast-version=2.12.0 gtk+-2.0
187
    if test `echo $?` = 0; then
188
      AC_MSG_RESULT([yes])
189
    else
190
      AC_MSG_RESULT([no])
191
      PKG_CHECK_MODULES(GLADE, libglade-2.0,,[AC_MSG_ERROR([* Glade 2.0 or higher could not be found (is the package libglade2-devel installed?)])])
192
    fi
193
  fi
194

                
195
  if test "$notifications" = "true" ; then
196
    PKG_CHECK_MODULES(LIBNOTIFY, libnotify >= 0.4.1, have_libnotify=true,[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])]; have_libnotify=false)
197
  else
198
    have_libnotify="false"
199
  fi
200

                
201
  if test "$have_libnotify" = "true" ; then
202
    AC_MSG_CHECKING(if libnotify >= 0.7.0)
203
    pkg-config --atleast-version=0.7.0 libnotify
204
    if test `echo $?` = 0; then
205
      AC_MSG_RESULT([yes])
206
      have_libnotify_0_7="true"
207
    else
208
      AC_MSG_RESULT([no])
209
      have_libnotify_0_7="false"
210
    fi
211
  fi
212

                
213
  if test "$automatic_shutdown" = "true" ; then
214
    PKG_CHECK_MODULES(POLKIT, polkit-gobject-1, have_polkit1=true, [PKG_CHECK_MODULES(POLKIT, polkit-gnome, have_polkit_old=true,[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])]; have_polkit_old=false)]; have_polkit1=false)
215
  else
216
    have_polkit_old=false
217
    have_polkit1=false
218
  fi
219

                
220
  PKG_CHECK_MODULES(LIBXML2, libxml-2.0,,[AC_MSG_ERROR([* LibXML 2.0 or higher could not be found (is the package libxml2-devel installed?)])])
221
fi
222

                
223
AC_ARG_ENABLE(par2cmdline-check,
224
    [  --disable-par2cmdline-check
225
                          Check for the existance of the par2 binary (enabled by default)],
226
    [case "x${enableval}" in
227
        xyes) par2_check=true ;;
228
        xno) par2_check=false ;;
229
        *) AC_MSG_ERROR(bad value ${enableval} for --disable-par2cmdline-check) ;;
230
    esac],[par2_check=true])
231

                
232
if test "$par2_check" = "true" ; then
233
  AC_CHECK_PROGS([PAR2CMDLINE], [par2])
234
  if test "x$PAR2CMDLINE" = "x" ; then
235
    AC_MSG_ERROR([par2cmdline is not found. This is required for NNTPGrab])
236
  fi
237
fi
238

                
239
dnl PKG_CHECK_MODULES(LIBPAR2, libpar2, libpar2_found=true, libpar2_found=false)
240
dnl if test "$libpar2_found" != "true" ; then
241
dnl     AC_LANG_PUSH([C++])
242
dnl     PKG_CHECK_MODULES(SIGC, sigc++-2.0,, [AC_MSG_ERROR([* libsigc++-2.0 could not be found (is the package libsigc++-2.0 installed?)])])
243
dnl     CPPFLAGS="$CXXFLAGS $SIGC_CFLAGS"
244
dnl     AC_CHECK_LIB(par2, main,,[AC_MSG_ERROR([* libpar2 could not be found])])
245
dnl     AC_CHECK_HEADERS([libpar2/par2cmdline.h],, [AC_MSG_ERROR([* libpar2 headers could not be found])])
246
dnl     LIBPAR2_LIBS="-lpar2 $SIGC_LIBS"
247
dnl     LIBPAR2_CFLAGS="$SIGC_CFLAGS"
248
dnl     AC_LANG_POP([C++])
249
dnl fi
250

                
251
AC_SUBST(GTK3_LIBS)
252
AC_SUBST(GTK3_CFLAGS)
253
AM_CONDITIONAL(HAVE_GTK3, $have_gtk3)
254
AC_SUBST(GTK_LIBS)
255
AC_SUBST(GTK_CFLAGS)
256
AC_SUBST(GLADE_CFLAGS)
257
AC_SUBST(GLADE_LIBS)
258
AC_SUBST(POLKIT_LIBS)
259
AC_SUBST(POLKIT_CFLAGS)
260
AM_CONDITIONAL(HAVE_POLKIT, test "$have_polkit1" == "true" -o "$have_polkit_old" == "true")
261
AM_CONDITIONAL(HAVE_POLKIT1, test "$have_polkit1" == "true")
262
AM_CONDITIONAL(HAVE_POLKIT_OLD, test "$have_polkit_old" == "true")
263
AC_SUBST(LIBNOTIFY_LIBS)
264
AC_SUBST(LIBNOTIFY_CFLAGS)
265
AM_CONDITIONAL(HAVE_LIBNOTIFY, $have_libnotify)
266
AM_CONDITIONAL(HAVE_LIBNOTIFY_0_7, $have_libnotify_0_7)
267
dnl AC_SUBST(LIBPAR2_LIBS)
268
dnl AC_SUBST(LIBPAR2_CFLAGS)
269

                
270
# check for gtk-doc
271
GTK_DOC_CHECK([1.14],[--flavour no-tmpl])
272

                
273
dnl Default search paths for headers and libs
274
dnl ----------------------------------------
275

                
276
ac_default_lib_searchpath="/sw/lib /usr/lib64 /usr/local/lib64 /usr/lib /usr/local/lib /opt/lib"
277
ac_default_lib_searchpath="$ac_default_lib_searchpath /usr/lib/openssl/lib /usr/X11R6/lib"
278
ac_default_lib_searchpath="$ac_default_lib_searchpath /usr/X11R6/lib/mozilla* /usr/lib/mozilla*"
279
ac_default_lib_searchpath="$ac_default_lib_searchpath /usr/local/mozilla* /usr/local/mozilla*/lib"
280
ac_default_lib_searchpath="$ac_default_lib_searchpath /usr/local/ssl*/lib /usr/local/lib/openssl"
281
ac_default_lib_searchpath="$ac_default_lib_searchpath /opt/gnome/lib/mozilla /opt/mozilla/lib"
282
ac_default_lib_searchpath="$ac_default_lib_searchpath /usr/lib/curl /usr/local/lib/curl /opt/curl/lib"
283
ac_default_lib_searchpath="$ac_default_lib_searchpath /opt/MozillaThunderbird/lib64 /opt/openssl/lib"
284
ac_default_lib_searchpath="$ac_default_lib_searchpath /sw/lib/mozilla /dist/lib"
285

                
286
ac_default_inc_searchpath="/sw/include /usr/include /usr/include/libxml2 /usr/local/include "
287
ac_default_inc_searchpath="$ac_default_inc_searchpath /opt/include /opt/openssl/include "
288
ac_default_inc_searchpath="$ac_default_inc_searchpath /usr/lib/openssl/include /usr/include/mozilla*"
289
ac_default_inc_searchpath="$ac_default_inc_searchpath /usr/local/mozilla* /usr/local/mozilla*/include"
290
ac_default_inc_searchpath="$ac_default_inc_searchpath /usr/local/ssl/include /usr/local/include/openssl"
291
ac_default_inc_searchpath="$ac_default_inc_searchpath /usr/include/mozilla*/gtkembedmoz /usr/local/include/mozilla*/gtkembedmoz"
292
ac_default_inc_searchpath="$ac_default_inc_searchpath /opt/gnome/include/mozilla /opt/mozilla/include"
293
ac_default_inc_searchpath="$ac_default_inc_searchpath /usr/include/curl /usr/local/include/curl /opt/curl/include"
294
ac_default_inc_searchpath="$ac_default_inc_searchpath /sw/include/mozilla /usr/include/pcre /dist/include"
295

                
296
dnl --------------------
297
dnl OS specific settings
298
dnl --------------------
299

                
300
case "$host_os" in
301
        mingw32)
302
                CPPFLAGS="$CPPFLAGS -mms-bitfields"
303
                CFLAGS="$CFLAGS -DOS=\"\\\"Windows\\\"\""
304
                AC_CHECK_TOOL(WINDRES, windres, no)
305
                if test "$WINDRES" = no; then 
306
                        AC_MSG_ERROR([*** Could not find an implementation of windres in your PATH.]) 
307
                fi
308
                AM_CONDITIONAL(WIN32, true)
309
                AC_DEFINE(WIN32, 1, [Is this an Win32 platform])
310
                AM_CONDITIONAL(DARWIN, false);;
311
       cygwin)
312
                CFLAGS="$CFLAGS -DOS=\"\\\"Windows\\\"\""
313
                AC_CHECK_TOOL(WINDRES, windres, no)
314
                if test "$WINDRES" = no; then
315
                        AC_MSG_ERROR([*** Could not find an implementation of windres in your PATH.])
316
                fi
317
                AM_CONDITIONAL(WIN32, true)
318
                AC_DEFINE(WIN32, 1, [Is this an Win32 platform])
319
                AM_CONDITIONAL(DARWIN, false)
320
                LDFLAGS="$LDFLAGS -mwindows";;
321
        darwin*)
322
                CFLAGS="$CFLAGS -DOS=\"\\\"Mac_OS_X/X86\\\"\""
323
                CPPFLAGS="$CPPFLAGS -DDARWIN"
324
                AM_CONDITIONAL(WIN32, false)
325
                AM_CONDITIONAL(DARWIN, true);;
326
        *)
327
                CFLAGS="$CFLAGS -DOS=\"\\\"`uname -s`\\\"\""
328
                AM_CONDITIONAL(WIN32, false)
329
                AM_CONDITIONAL(DARWIN, false);;
330
esac
331

                
332
dnl ---------------------
333
dnl Mac OS X integration
334
dnl ---------------------
335
if test "$host_os" = "darwin9" -o "$host_os" = "darwin10" -o "$host_os" = "darwin10.2.0" ; then
336
  if [ "$gui" = "true" ]; then
337
    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])])
338
  fi
339

                
340
  # Mac OS X doesn't like 'EXPORTS' mentioned in the .def files..strip them out
341
  grep -v EXPORTS plugins/nntpgrab_plugin.def > tmp
342
  unlink plugins/nntpgrab_plugin.def
343
  mv tmp plugins/nntpgrab_plugin.def
344

                
345
  grep -v EXPORTS base/nntpgrab_utils.def > tmp
346
  unlink base/nntpgrab_utils.def
347
  mv tmp base/nntpgrab_utils.def
348

                
349
  grep -v EXPORTS nntpgrab_core/nntpgrab.def > tmp
350
  unlink nntpgrab_core/nntpgrab.def
351
  mv tmp nntpgrab_core/nntpgrab.def
352

                
353
  grep -v EXPORTS automation/nntpgrab_automation.def > tmp
354
  unlink automation/nntpgrab_automation.def
355
  mv tmp automation/nntpgrab_automation.def
356

                
357
  grep -v EXPORTS glue/nntpgrab_glue.def > tmp
358
  unlink glue/nntpgrab_glue.def
359
  mv tmp glue/nntpgrab_glue.def
360

                
361
  grep -v EXPORTS gui_base/nntpgrab_gui_base.def > tmp
362
  unlink gui_base/nntpgrab_gui_base.def
363
  mv tmp gui_base/nntpgrab_gui_base.def
364
fi
365

                
366
AC_SUBST(MAC_INTEGRATION_CFLAGS)
367
AC_SUBST(MAC_INTEGRATION_LIBS)
368

                
369
dnl ---
370
dnl PCRE is only necessary when GLib 2.14.0 or higher is not found
371
dnl ---
372
AC_MSG_CHECKING(if GLIB >= 2.14.0)
373
pkg-config --atleast-version=2.14.0 glib-2.0
374
if test `echo $?` = 0; then
375
  AC_MSG_RESULT([yes])
376
else
377
  AC_MSG_RESULT([no])
378
  AC_FIND_LIB2(pcre, $ac_default_lib_searchpath, pcre_libraries, [PCRE libraries.], [PCRE libraries could not be found])
379
  AC_FIND_HEADER2(pcre.h, $ac_default_inc_searchpath, pcre_headers, [PCRE headers.], [PCRE headers could not be found])
380
fi
381

                
382
if test "$have_soup" = "false" -a "$gui" = "true"; then
383
  dnl ---------------
384
  dnl libCURL support
385
  dnl ---------------
386
  AC_FIND_LIB2(curl, $ac_default_lib_searchpath, libcurl_libraries,
387
    [Curl library],
388
    [Curl library couldn't be found])
389

                
390
  AC_FIND_HEADER2(curl/curl.h, $ac_default_inc_searchpath, libcurl_headers,
391
    [Curl headers],
392
    [Curl headers could not be found],
393
     curl)
394
fi
395

                
396
AM_CONDITIONAL(HAVE_SSL, $ssl)
397
if test "$ssl" = "true" ; then
398
  PKG_CHECK_MODULES(GNUTLS, gnutls, gnutls_found=true,[AC_MSG_RESULT([* GNUTLS could not be found (is the package gnutls-devel installed?)])]; gnutls_found=false)
399
  if test "$gnutls_found" = "false" ; then
400
    PKG_CHECK_MODULES(NSS, nss, nss_found=true,[AC_MSG_RESULT([* NSS could not be found (is the package nss-devel installed?)])]; nss_found=false)
401
    if test "$nss_found" = "true" ; then
402
      AC_FIND_LIB(nss_compat_ossl, $ac_default_lib_searchpath, nss_compat_ossl_libraries,
403
      [nss_compat_ossl libraries],
404
      [nss_compat_ossl libraries could not be found])
405

                
406
      AC_FIND_HEADER(nss_compat_ossl/nss_compat_ossl.h, $ac_default_inc_searchpath, nss_compat_ossl_headers,
407
      [nss_compat_ossl headers],
408
      [nss_compat_oss header could not be found],
409
      nss_compat_ossl)
410
    fi
411

                
412
    if test   "$nss_found" = "true" -a \
413
      "$nss_compat_ossl_libraries_ok" = "true" -a \
414
      "$nss_compat_ossl_headers_ok" = "true" ; then
415
              have_nss_compat_ossl=true
416
              NSS_LIBS="$NSS_LIBS -lnss_compat_ossl"
417
    else
418
              have_nss_compat_ossl=false
419
              NSS_CFLAGS=""
420
              NSS_LIBS=""
421
    fi
422

                
423
    if test "$have_nss_compat_ossl" = "false" ; then
424
      AC_FIND_LIB2(ssl, $ac_default_lib_searchpath, openssl_libraries,
425
              [OpenSSL libraries],
426
              [OpenSSL library not found])
427
  
428
      AC_FIND_HEADER2(openssl/md5.h, $ac_default_inc_searchpath, openssl_headers,
429
              [OpenSSL headers],
430
              [OpenSSL headers could not be found])
431
  
432
      openssl_libraries_LIBS="$openssl_libraries_LIBS -lcrypto"
433
    fi
434
  fi
435
fi
436

                
437
AM_CONDITIONAL(HAVE_GNUTLS, test "$gnutls_found" = "true")
438
AM_CONDITIONAL(HAVE_NSS_COMPAT_OSSL, test "$have_nss_compat_ossl" = "true")
439

                
440
AC_SUBST(PCRE_CFLAGS, $pcre_headers_CFLAGS)
441
AC_SUBST(PCRE_LIBS, $pcre_libraries_LIBS)
442
AC_SUBST(CURL_CFLAGS, $libcurl_headers_CFLAGS)
443
AC_SUBST(CURL_LIBS, $libcurl_libraries_LIBS)
444
AC_SUBST(GNUTLS_CFLAGS)
445
AC_SUBST(GNUTLS_LIBS)
446
AC_SUBST(NSS_CFLAGS)
447
AC_SUBST(NSS_LIBS)
448
AC_SUBST(OPENSSL_CFLAGS, $openssl_headers_CFLAGS)
449
AC_SUBST(OPENSSL_LIBS, $openssl_libraries_LIBS)
450

                
451
# Introspection support
452
GOBJECT_INTROSPECTION_CHECK([0.9.0])
453

                
454
# gettext
455
AC_PROG_INTLTOOL([0.21], [no-xml])
456
AC_PATH_PROG(MSGFMT, msgfmt, msgfmt)
457

                
458
ALL_LINGUAS="nl fr"
459
AM_GLIB_GNU_GETTEXT
460

                
461
if test "x$WIN32_TRUE" = "x" ; then
462
    nntpgrablocaledir='../${DATADIRNAME}/locale'
463
else
464
    nntpgrablocaledir='${prefix}/${DATADIRNAME}/locale'
465
fi
466
AC_SUBST(nntpgrablocaledir)
467

                
468
AC_CHECK_FUNC(strptime,[ AC_DEFINE(HAVE_STRPTIME, 1, [strptime check]) AM_CONDITIONAL(HAVE_STRPTIME, true) ],[ AM_CONDITIONAL(HAVE_STRPTIME, false) ])
469
AC_CHECK_FUNC(backtrace_symbols, [AC_DEFINE(HAVE_BACKTRACE, 1, [backtrace_symbols check])])
470

                
471
dnl Checks for mkdtemp function
472

                
473
mkdtemp_missing=false
474
AC_CHECK_FUNC(mkdtemp,
475
    [AC_DEFINE([HAVE_MKDTEMP], 1, [Have GlibC function to make temp dirs])],
476
    mkdtemp_missing=true)
477
AM_CONDITIONAL(MKDTEMP_MISSING, test x$mkdtemp_missing = xtrue)
478

                
479
dnl Set PACKAGE SOURCE DIR in config.h.
480
packagesrcdir=`cd $srcdir && pwd`
481

                
482
dnl Set PACKAGE PREFIX
483
if test "x${prefix}" = "xNONE"; then
484
  packageprefix=${ac_default_prefix}
485
else
486
  packageprefix=${prefix}
487
fi
488

                
489
packagedatadir=share/${PACKAGE}
490
pkgdir=${packageprefix}/${packagedatadir}
491
plugindir=${libdir}/${PACKAGE}
492
wwwdir=${pkgdir}/web
493

                
494
AC_DEFINE_UNQUOTED(SHARE_DIR, "${pkgdir}", [Location of NNTPGrab icons])
495
AC_SUBST(PLUGINDIR, "${plugindir}")
496
AC_SUBST(WWWDIR, "${wwwdir}")
497
CPPFLAGS="$CPPFLAGS -DPLUGIN_DIR=\"\\\"\${PLUGINDIR}\\\"\" -DWWW_DIR=\"\\\"\${WWWDIR}\\\"\""
498

                
499
# -fstack-protector
500
AC_ARG_ENABLE([stack-protector],
501
    [AS_HELP_STRING([--disable-stack-protector],
502
        [Disable GCC's/libc's stack-smashing protection])],
503
    [case "${enableval}" in
504
         yes) enable_ssp=yes ;;
505
          no) enable_ssp=no ;;
506
           *) AC_MSG_ERROR([invalid value ${enableval} for --disable-stack-protector]) ;;
507
     esac],
508
    [enable_ssp=yes])
509

                
510
if test x"$enable_ssp" = x"yes" && test x"$GCC" != x"yes"; then
511
    AC_MSG_NOTICE([Disabling stack-smashing protection because compiler is not GCC])
512
    enable_ssp=no
513
fi
514

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

                
521
    # Get -lssp if it exists
522
    GCC_STACK_PROTECT_LIB
523

                
524
    AC_MSG_CHECKING([whether stack-smashing protection is available])
525
    ssp_old_cflags="$CFLAGS"
526
    ssp_old_ldflags="$LDFLAGS"
527
    CFLAGS="$CFLAGS -fstack-protector-all -fPIC"
528
    LDFLAGS="$LDFLAGS -Wl,-z,defs"
529
    cat confdefs.h > conftest.c
530
    cat >>conftest.c <<_ACEOF
531
void test_broken_ssp(c)
532
    const char *c;
533
{
534
    char arr[[123]], *p; /* beware of possible double-braces if copying this */
535
    for (p = arr; *c; ++p) {
536
        *p = *c;
537
        ++c;
538
    }
539
}
540
_ACEOF
541
    rm -f conftest.o
542

                
543
    if $CC -c $CFLAGS $CPPFLAGS -o conftest.o conftest.c >/dev/null 2>&1; then
544
        AC_MSG_RESULT([yes])
545
        AC_MSG_CHECKING([whether stack-smashing protection is buggy])
546
        if $CC -o conftest.so $LDFLAGS -shared conftest.o $LIBS >/dev/null 2>&1; then
547
            AC_MSG_RESULT([no])
548
        else
549
            AC_MSG_RESULT([yes])
550
            enable_ssp=no
551
        fi
552
    else
553
        AC_MSG_RESULT([no])
554
    fi
555

                
556
    rm -f conftest.c conftest.o conftest.so
557

                
558
    CFLAGS="$ssp_old_cflags"
559
    LDFLAGS="$ssp_old_ldflags"
560
fi
561

                
562
if test x"$enable_ssp" = x"yes"; then
563
    # Do this the long way so we don't call GCC_STACK_PROTECT_LIB twice
564
    GCC_STACK_PROTECT_CC
565

                
566
    AC_LANG_PUSH([C++])
567
    GCC_STACK_PROTECT_CXX
568
    AC_LANG_POP([C++])
569
    # XXX: Update the enable_ssp value now for output later?
570
fi
571

                
572
if test "$php_module" = "true" ; then
573
    AC_CONFIG_SUBDIRS(client/web/module)
574
fi
575

                
576
AC_OUTPUT([
577
Makefile
578
docs/Makefile
579
docs/reference/Makefile
580
docs/reference/version.xml
581
po/Makefile.in
582
base/Makefile
583
base/nntpgrab_utils.pc
584
gui_base/Makefile
585
automation/Makefile
586
automation/nntpgrab_automation.pc
587
nntpgrab_core/Makefile
588
nntpgrab_core/nntpgrab.pc
589
glue/Makefile
590
glue/nntpgrab_glue.pc
591
server/Makefile
592
plugins/Makefile
593
plugins/antisleep/Makefile
594
plugins/auto_import/Makefile
595
plugins/decoder/Makefile
596
plugins/example/Makefile
597
plugins/jsonrpc/Makefile
598
plugins/logger/Makefile
599
plugins/networkmanager/Makefile
600
plugins/par2/Makefile
601
plugins/unpack/Makefile
602
client/Makefile
603
client/web/Makefile
604
client/gui/Makefile
605
tests/Makefile
606
])