1#                                               -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
4#
5
6###-------------------------------------------------------------------------
7#
8# The following line makes sure that this file is always touched when a new
9# revision is checked out.
10#
11# $Rev$
12#
13
14# info
15GWENHYWFAR_AUTHOR="Martin Preuss<martin@libchipcard.de>"
16GWENHYWFAR_BUGREPORT_ADDR="<martin@libchipcard.de>"
17
18
19AC_PREREQ(2.60)
20AC_INIT
21AC_CANONICAL_BUILD
22AC_CANONICAL_HOST
23AC_CONFIG_SRCDIR([src/gwenhywfarapi.h])
24AC_CONFIG_HEADERS([config.h])
25
26###-------------------------------------------------------------------------
27#
28# versions
29#
30GWENHYWFAR_VERSION_MAJOR=5
31GWENHYWFAR_VERSION_MINOR=6
32GWENHYWFAR_VERSION_PATCHLEVEL=0
33GWENHYWFAR_VERSION_BUILD=0
34dnl "stable", "rcX", "betaX", "cvs"
35GWENHYWFAR_VERSION_TAG="stable"
36
37
38
39###-------------------------------------------------------------------------
40#
41# SO version for Gwenhywfar
42#
43GWENHYWFAR_SO_CURRENT="85"
44GWENHYWFAR_SO_AGE="6"
45GWENHYWFAR_SO_REVISION="0"
46GWENHYWFAR_SO_EFFECTIVE="`echo \$(($GWENHYWFAR_SO_CURRENT-$GWENHYWFAR_SO_AGE))`"
47
48
49
50###-------------------------------------------------------------------------
51#
52# Generate version strings and BUILD
53#
54
55#GWENHYWFAR_VERSION_BUILD="0"
56# Let svn write the revision number directly into here on
57# each svn update. Note: The trailing space is necessary for
58# cvs versions.
59#GWENHYWFAR_VERSION_BUILD=`echo "$Rev$ " | cut -d' ' -f2`
60#if test "x$GWENHYWFAR_VERSION_BUILD" = "x" ; then
61#  GWENHYWFAR_VERSION_BUILD="0"
62#fi
63GWENHYWFAR_VERSION_FULL_STRING="$GWENHYWFAR_VERSION_MAJOR.$GWENHYWFAR_VERSION_MINOR.${GWENHYWFAR_VERSION_PATCHLEVEL}${GWENHYWFAR_VERSION_TAG}-${GWENHYWFAR_VERSION_BUILD}"
64GWENHYWFAR_VERSION_STRING="$GWENHYWFAR_VERSION_MAJOR.$GWENHYWFAR_VERSION_MINOR.$GWENHYWFAR_VERSION_PATCHLEVEL"
65
66# The version number for the plugin/ct/ohbci/ohbci.la
67OHBCI_VERSION_STRING="0.1.0"
68
69
70
71###-------------------------------------------------------------------------
72#
73# Create release strings
74#
75case "$GWENHYWFAR_VERSION_TAG" in
76  cvs|svn|git)
77     GWENHYWFAR_VERSION_RELEASE_STRING="$GWENHYWFAR_VERSION_MAJOR.$GWENHYWFAR_VERSION_MINOR.$GWENHYWFAR_VERSION_PATCHLEVEL.r${GWENHYWFAR_VERSION_BUILD}"
78     ;;
79  stable)
80     GWENHYWFAR_VERSION_RELEASE_STRING="$GWENHYWFAR_VERSION_MAJOR.$GWENHYWFAR_VERSION_MINOR.$GWENHYWFAR_VERSION_PATCHLEVEL"
81     ;;
82  *)
83     GWENHYWFAR_VERSION_RELEASE_STRING="$GWENHYWFAR_VERSION_MAJOR.$GWENHYWFAR_VERSION_MINOR.$GWENHYWFAR_VERSION_PATCHLEVEL"
84
85     # add TAG
86     GWENHYWFAR_VERSION_RELEASE_STRING="${GWENHYWFAR_VERSION_RELEASE_STRING}${GWENHYWFAR_VERSION_TAG}"
87     ;;
88esac
89
90
91AC_SUBST(GWENHYWFAR_VERSION_MAJOR)
92AC_SUBST(GWENHYWFAR_VERSION_MINOR)
93AC_SUBST(GWENHYWFAR_VERSION_PATCHLEVEL)
94AC_SUBST(GWENHYWFAR_VERSION_BUILD)
95AC_SUBST(GWENHYWFAR_VERSION_TAG)
96AC_SUBST(GWENHYWFAR_VERSION_FULL_STRING)
97AC_SUBST(GWENHYWFAR_VERSION_STRING)
98AC_SUBST(GWENHYWFAR_VERSION_RELEASE_STRING)
99AC_SUBST(OHBCI_VERSION_STRING)
100
101AC_DEFINE_UNQUOTED(GWENHYWFAR_VERSION_MAJOR,$GWENHYWFAR_VERSION_MAJOR,
102                   [major version])
103AC_DEFINE_UNQUOTED(GWENHYWFAR_VERSION_MINOR,$GWENHYWFAR_VERSION_MINOR,
104                   [minor version])
105AC_DEFINE_UNQUOTED(GWENHYWFAR_VERSION_PATCHLEVEL,$GWENHYWFAR_VERSION_PATCHLEVEL,
106                   [patchlevel])
107AC_DEFINE_UNQUOTED(GWENHYWFAR_VERSION_BUILD,$GWENHYWFAR_VERSION_BUILD, [build])
108AC_DEFINE_UNQUOTED(GWENHYWFAR_VERSION_STRING,"$GWENHYWFAR_VERSION_STRING",
109                   [version string])
110AC_DEFINE_UNQUOTED(GWENHYWFAR_VERSION_FULL_STRING,"$GWENHYWFAR_VERSION_FULL_STRING",
111                   [full version string])
112AC_DEFINE_UNQUOTED(GWENHYWFAR_VERSION_TAG,$GWENHYWFAR_VERSION_TAG, [tag])
113
114
115AC_SUBST(GWENHYWFAR_SO_CURRENT)
116AC_SUBST(GWENHYWFAR_SO_REVISION)
117AC_SUBST(GWENHYWFAR_SO_AGE)
118AC_SUBST(GWENHYWFAR_SO_EFFECTIVE)
119
120AM_INIT_AUTOMAKE(gwenhywfar, $GWENHYWFAR_VERSION_RELEASE_STRING)
121
122
123
124###-------------------------------------------------------------------------
125#
126# SO version for GwenUI
127#
128GWENUI_SO_CURRENT="1"
129GWENUI_SO_REVISION="1"
130GWENUI_SO_AGE="0"
131GWENUI_SO_EFFECTIVE="`echo \$(($GWENUI_SO_CURRENT-$GWENUI_SO_AGE))`"
132
133AC_SUBST(GWENUI_SO_CURRENT)
134AC_SUBST(GWENUI_SO_REVISION)
135AC_SUBST(GWENUI_SO_AGE)
136AC_SUBST(GWENUI_SO_EFFECTIVE)
137
138
139
140###-------------------------------------------------------------------------
141#
142# SO version for GwenPP
143#
144GWENPP_SO_CURRENT="16"
145GWENPP_SO_REVISION="0"
146GWENPP_SO_AGE="0"
147GWENPP_SO_EFFECTIVE="`echo \$(($GWENPP_SO_CURRENT-$GWENPP_SO_AGE))`"
148
149AC_SUBST(GWENPP_SO_CURRENT)
150AC_SUBST(GWENPP_SO_REVISION)
151AC_SUBST(GWENPP_SO_AGE)
152AC_SUBST(GWENPP_SO_EFFECTIVE)
153
154
155
156###-------------------------------------------------------------------------
157# check for OS
158
159AQ_CHECK_OS
160
161
162if test "$OSYSTEM" = "osx"; then
163  COCOA_FRAMEWORK="-framework Cocoa"
164  FOUNDATION_FRAMEWORK="-framework CoreFoundation"
165  SYSCONF_FRAMEWORK="-framework SystemConfiguration"
166  APPKIT_FRAMEWORK="-framework AppKit"
167  COREDATA_FRAMEWORK="-framework CoreData"
168  WEBKIT_FRAMEWORK="-framework WebKit"
169fi
170AC_SUBST(COCOA_FRAMEWORK)
171AC_SUBST(FOUNDATION_FRAMEWORK)
172AC_SUBST(SYSCONF_FRAMEWORK)
173AC_SUBST(APPKIT_FRAMEWORK)
174AC_SUBST(COREDATA_FRAMEWORK)
175AC_SUBST(WEBKIT_FRAMEWORK)
176
177
178###-------------------------------------------------------------------------
179# prefix handling
180
181AC_PREFIX_DEFAULT(/usr/local)
182if test "x$prefix" = "xNONE"; then
183  prefix=$ac_default_prefix
184  ac_configure_args="$ac_configure_args --prefix $prefix"
185fi
186AC_SUBST(prefix)
187
188
189
190###-------------------------------------------------------------------------
191#
192# static/shared handling
193#
194AC_ENABLE_STATIC(no)
195AC_ENABLE_SHARED(yes)
196
197
198###-------------------------------------------------------------------------
199#
200# Checks for programs.
201#
202AC_PROG_CC
203AC_PROG_CXX
204AC_PROG_CPP
205AC_PROG_OBJC
206#AC_PROG_OBJCXX
207#AC_PROG_OBJCXXCPP
208AC_PROG_INSTALL
209AC_PROG_LIBTOOL
210AC_LIBTOOL_WIN32_DLL
211AC_LIBTOOL_RC
212# Newer libtool doesn't have AC_LIBTOOL_RC anymore.  Need to check for
213# $(RC) by ourselves.
214AC_CHECK_TOOL([RC], [windres], [no])
215AC_PROG_AWK
216AC_CHECK_PROG(USE_DOT,dot,YES,NO)
217AC_CHECK_PROG(SED,sed,sed)
218
219# Check for the tool "astyle", but if not found, replace its program call by the no-op "echo" instead
220AC_CHECK_PROG(ASTYLE, astyle, astyle, echo)
221
222###-------------------------------------------------------------------------
223#
224# Checks for libraries.
225#
226AC_CHECK_LIB(dl, dlopen)
227# note: this AC_CHECK_LIB will also add -ldl to LIBS.
228
229AX_PTHREAD
230
231
232#AC_CHECK_LIB(rt, sem_init,
233#  [
234#    rt_libs="-lrt -pthread"
235#    AC_DEFINE(HAVE_LIBRT, "1", [whether librt is available])
236#  ], [], [-pthread])
237#AC_SUBST(rt_libs)
238
239
240# Some systems have iconv in libc, some have it in libiconv (OSF/1 and
241# those with the standalone portable GNU libiconv installed). Check
242# which one is available. The define ICONV_CONST will be "" or "const"
243# accordingly.
244AM_ICONV
245
246###-------------------------------------------------------------------------
247#
248# Checks for header files.
249#
250AC_HEADER_DIRENT
251AC_HEADER_STDC
252AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h])
253AC_CHECK_HEADERS([stdlib.h string.h strings.h sys/socket.h sys/time.h])
254AC_CHECK_HEADERS([syslog.h unistd.h])
255AC_CHECK_HEADERS([unistd.h])
256AC_CHECK_HEADERS([dlfcn.h])
257AC_CHECK_HEADERS([signal.h termios.h langinfo.h localcharset.h iconv.h])
258AC_CHECK_HEADERS([time.h locale.h])
259AC_CHECK_HEADERS([syslog.h])
260AC_CHECK_HEADERS([sys/stat.h])
261AC_CHECK_HEADERS([sys/types.h])
262AC_CHECK_HEADERS([sys/wait.h])
263AC_CHECK_HEADERS([regex.h])
264AC_CHECK_HEADERS([endian.h])
265
266
267###-------------------------------------------------------------------------
268#
269# Checks for declarations
270#
271AC_CHECK_DECLS([sigprocmask], [], [], [
272  #ifdef HAVE_SIGNAL_H
273  #  include <signal.h>
274  #endif
275])
276
277
278###-------------------------------------------------------------------------
279#
280# Checks for typedefs, structures, and compiler characteristics.
281#
282AC_C_CONST
283AC_HEADER_TIME
284AC_STRUCT_TM
285
286
287###-------------------------------------------------------------------------
288#
289# Checks for library functions.
290#
291AC_FUNC_CLOSEDIR_VOID
292AC_FUNC_MKTIME
293AC_FUNC_SELECT_ARGTYPES
294AC_CHECK_FUNCS([gethostbyaddr gethostbyname inet_ntoa isascii getpid])
295AC_CHECK_FUNCS([memmove memset])
296AC_CHECK_FUNCS([select socket])
297AC_CHECK_FUNCS([strcasecmp strchr strdup strerror])
298AC_CHECK_FUNCS([snprintf])
299AC_CHECK_FUNCS([symlink setlocale])
300AC_CHECK_FUNCS([srandom random])
301
302# Init binreloc
303AM_BINRELOC
304
305
306
307###-------------------------------------------------------------------------
308#
309# check whether gwen is a subproject to another one
310#
311
312AC_MSG_CHECKING(if gwen is a subproject)
313AC_ARG_ENABLE(gwen-subproject,
314  [  --enable-gwen-subproject       make gwen only a subproject (default=no)],
315  enable_gwen_subproject="$enableval",
316  enable_gwen_subproject="no")
317AC_MSG_RESULT($enable_gwen_subproject)
318
319if test "$enable_gwen_subproject" != "no"; then
320  AC_DEFINE(GWENHYWFAR_IS_SUBPROJECT, 1, [whether gwen is a subproject])
321fi
322
323
324
325###-------------------------------------------------------------------------
326#
327# check whether accompanying certificates should be used
328#
329
330AC_MSG_CHECKING(whether system-wide trusted certificates should be set)
331AC_ARG_ENABLE(system-certs,
332  [  --enable-system-certs         use system-wide certificates (default=yes)],
333  enable_system_certs="$enableval",
334  enable_system_certs="yes")
335AC_MSG_RESULT($enable_system_certs)
336
337if test "$enable_system_certs" != "no"; then
338  AC_DEFINE(GWEN_TLS_USE_SYSTEM_CERTIFICATES, 1, [whether system-wide trusted certificates should be set])
339fi
340
341AM_CONDITIONAL(INSTALL_CERTS, [test "$enable_system_certs" = "no"])
342
343
344###-------------------------------------------------------------------------
345#
346# check whether 'make check' should run checks that depend on network connectivity
347#
348
349AC_MSG_CHECKING(network connectivity can be assumed available during 'make check')
350AC_ARG_ENABLE(network-checks,
351  [  --disable-network-checks       disables checks that assume available network during build (default=enabled)],
352  enable_gwen_network_checks="$enableval",
353  enable_gwen_network_checks="yes")
354AC_MSG_RESULT($enable_gwen_network_checks)
355
356if test "$enable_gwen_network_checks" = "no"; then
357  AC_DEFINE(GWENHYWFAR_SKIP_NETWORK_CHECKS, 1, [whether to run network-dependent checks during build])
358fi
359
360
361
362###-------------------------------------------------------------------------
363#
364# check whether test code should be enabled
365#
366
367AC_MSG_CHECKING(whether to enable test code)
368AC_ARG_ENABLE(testcode,
369  [  --enable-testcode       allow compiling of test code (default=no)],
370  enable_testcode="$enableval",
371  enable_testcode="no")
372AC_MSG_RESULT($enable_testcode)
373
374if test "$enable_testcode" != "no"; then
375  AC_DEFINE(GWENHYWFAR_ENABLE_TESTCODE, 1, [whether to enable test code])
376fi
377
378
379
380###-------------------------------------------------------------------------
381#
382# check whether local installation mode is enabled
383#
384
385AC_MSG_CHECKING(whether local installation mode is wanted)
386AC_ARG_ENABLE(local-install,
387  [  --enable-local-install         allow local installation mode (default=no)],
388  enable_local_install="$enableval",
389  enable_local_install="no")
390AC_MSG_RESULT($enable_local_install)
391
392if test "$enable_local_install" != "no"; then
393  AC_DEFINE(ENABLE_LOCAL_INSTALL, 1, [whether local install is wanted])
394fi
395
396
397
398###-------------------------------------------------------------------------
399#
400# OS dependant settings
401#
402
403# Common settings for all OSs
404gwenhywfar_bindir="\${bindir}"
405gwenhywfar_libs="-lgwenhywfar"
406gwenhywfar_ldflags="-L\${libdir}"
407gwenhywfar_internal_libname="libgwenhywfar.la"
408gwenhywfar_headerdir_am="\$(includedir)/gwenhywfar5"
409gwenhywfar_headerdir="\${includedir}/gwenhywfar5"
410gwenhywfar_plugindir="\${libdir}/gwenhywfar/plugins/${GWENHYWFAR_SO_EFFECTIVE}"
411gwenhywfar_symlinkdir="\$(top_builddir)/gwenhywfar5"
412gwenhywfar_datadir="\${datadir}/gwenhywfar"
413gwenhywfar_sysdatadir="\${datadir}"
414
415# Now the specific settings
416case "$OS_TYPE" in
417    posix)
418        gwenhywfar_sys_is_windows=0
419        gwenhywfar_os_lib="os/posix/libos.la"
420        GWEN_OS="posix"
421
422        # add special libraries for solaris
423        if test "$OSYSTEM" = "solaris"; then
424          all_libraries="${all_libraries} -lresolv -lsocket"
425          PROG_LIBRARIES="${PROG_LIBRARIES} -lresolv -lsocket"
426        fi
427
428        # add special libraries for darwin
429        if test "$OSYSTEM" = "osx"; then
430          # hmm, this should be detected by the GETTEXT macro...
431          #PROG_LIBRARIES="${PROG_LIBRARIES} -lintl"
432          # for local install mode on Mac OS X link with the CoreFoundation framework
433          if test "$enable_local_install" != "no"; then
434            all_libraries="${all_libraries} -framework CoreFoundation"
435          fi
436        fi
437    	;;
438    windows)
439        gwenhywfar_sys_is_windows=1
440        dnl ACX_WINDOWS_PATHS
441
442        gwenhywfar_os_lib="os/windows/libos.la"
443        GWEN_OS="windows"
444	all_libraries="${all_libraries} -lwsock32"
445    	;;
446    *)
447    	AC_MSG_ERROR(**** Unknown operating system type)
448        ;;
449esac
450
451AM_CONDITIONAL(IS_WINDOWS, [test "$OS_TYPE" = "windows"])
452AC_SUBST(gwenhywfar_sys_is_windows)
453
454
455dnl # Check for x86_64 architecture; potentially set lib-directory suffix
456dnl if test "$target_cpu" = "x86_64"; then
457dnl   libdirsuffix="64"
458dnl else
459dnl   libdirsuffix=""
460dnl fi
461dnl AC_DEFINE_UNQUOTED(LIBDIRSUFFIX, ["$libdirsuffix"], [Defined to the suffix string of the library directory])
462dnl --- no longer needed since $libdir is used directly
463
464
465
466###-------------------------------------------------------------------------
467#
468# check plugin search path
469#
470AC_MSG_CHECKING(plugin search dir)
471AC_ARG_WITH(plugin-searchdir, [  --with-plugin-searchdir=DIR where to search for plugins],
472  [gwenhywfar_plugin_searchdir="$withval"],
473  [gwenhywfar_plugin_searchdir=""])
474
475if test -z "${gwenhywfar_plugin_searchdir}"; then
476  if test "$OSYSTEM" = "windows"; then
477    gwenhywfar_plugin_searchdir="lib/gwenhywfar/plugins/${GWENHYWFAR_SO_EFFECTIVE}"
478  else
479    if test "$enable_local_install" != "no"; then
480      gwenhywfar_plugin_searchdir="lib/gwenhywfar/plugins/${GWENHYWFAR_SO_EFFECTIVE}"
481    else
482      gwenhywfar_plugin_searchdir="$gwenhywfar_plugindir"
483    fi
484  fi
485fi
486
487AC_SUBST(gwenhywfar_plugin_searchdir)
488AC_MSG_RESULT($gwenhywfar_plugin_searchdir)
489
490
491
492###-------------------------------------------------------------------------
493#
494# check data search dir
495#
496AC_MSG_CHECKING(data search dir)
497AC_ARG_WITH(data-searchdir, [  --with-data-searchdir=DIR where to search for gwen's data files],
498  [gwenhywfar_data_searchdir="$withval"],
499  [gwenhywfar_data_searchdir=""])
500
501if test -z "${gwenhywfar_data_searchdir}"; then
502  if test "$OSYSTEM" = "windows"; then
503    gwenhywfar_data_searchdir="share/gwenhywfar"
504  else
505    if test "$enable_local_install" != "no"; then
506      gwenhywfar_data_searchdir="share/gwenhywfar"
507    else
508      gwenhywfar_data_searchdir="$gwenhywfar_datadir"
509    fi
510  fi
511fi
512
513AC_SUBST(gwenhywfar_data_searchdir)
514AC_MSG_RESULT($gwenhywfar_data_searchdir)
515
516
517
518###-------------------------------------------------------------------------
519#
520# check system data search dir
521#
522AC_MSG_CHECKING(system data search dir)
523AC_ARG_WITH(sysdata-searchdir, [  --with-sysdata-searchdir=DIR where to search for data files],
524  [gwenhywfar_sysdata_searchdir="$withval"],
525  [gwenhywfar_sysdata_searchdir=""])
526
527if test -z "${gwenhywfar_sysdata_searchdir}"; then
528  if test "$OSYSTEM" = "windows"; then
529    gwenhywfar_sysdata_searchdir="share"
530  else
531    if test "$enable_local_install" != "no"; then
532      gwenhywfar_sysdata_searchdir="share"
533    else
534      gwenhywfar_sysdata_searchdir="$gwenhywfar_sysdatadir"
535    fi
536  fi
537fi
538
539AC_SUBST(gwenhywfar_sysdata_searchdir)
540AC_MSG_RESULT($gwenhywfar_sysdata_searchdir)
541
542
543
544###-------------------------------------------------------------------------
545#
546# check locale search dir
547#
548AC_MSG_CHECKING(locale search dir)
549AC_ARG_WITH(locale-searchdir, [  --with-locale-searchdir=DIR where to search for locale files],
550  [gwenhywfar_locale_searchdir="$withval"],
551  [gwenhywfar_locale_searchdir=""])
552
553if test -z "${gwenhywfar_locale_searchdir}"; then
554  if test "$OSYSTEM" = "windows"; then
555    gwenhywfar_locale_searchdir="share/locale"
556  else
557    if test "$enable_local_install" != "no"; then
558      gwenhywfar_locale_searchdir="share/locale"
559    else
560      gwenhywfar_locale_searchdir="\$(localedir)"
561    fi
562  fi
563fi
564
565AC_SUBST(gwenhywfar_locale_searchdir)
566AC_MSG_RESULT($gwenhywfar_locale_searchdir)
567
568
569
570###-------------------------------------------------------------------------
571#
572# check cfg search dir
573#
574AC_MSG_CHECKING(cfg search dir)
575AC_ARG_WITH(cfg-searchdir, [  --with-cfg-searchdir=DIR where to search for cfg files],
576  [gwenhywfar_cfg_searchdir="$withval"],
577  [gwenhywfar_cfg_searchdir=""])
578
579if test -z "$gwenhywfar_cfg_searchdir"; then
580  if test "$OSYSTEM" = "windows"; then
581    gwenhywfar_cfg_searchdir="etc"
582  else
583    if test "$enable_local_install" != "no"; then
584      gwenhywfar_cfg_searchdir="etc"
585    else
586      gwenhywfar_cfg_searchdir="\$(sysconfdir)"
587    fi
588  fi
589fi
590
591
592AC_SUBST(gwenhywfar_cfg_searchdir)
593AC_MSG_RESULT($gwenhywfar_cfg_searchdir)
594
595
596
597###-------------------------------------------------------------------------
598#
599# check whether variadic macros should be supported
600#
601AC_MSG_CHECKING(if compiling with variadic macros)
602AC_ARG_ENABLE(variadic-macros,
603  [  --enable-variadic-macros         enable variadic macros (default=yes)],
604  enable_variadic_macros="$enableval",
605  enable_variadic_macros="yes")
606AC_MSG_RESULT($enable_variadic_macros)
607if test "x$enable_variadic_macros" = "xno"; then
608  AC_DEFINE(NO_VARIADIC_MACROS, 1, [Define if variadic macros should be disabled])
609fi
610
611
612
613###-------------------------------------------------------------------------
614#
615# check whether profiling is to be supported
616#
617AC_MSG_CHECKING(if profiling is to be supported)
618AC_ARG_ENABLE(profiling,
619  [  --enable-profiling         enable profiling (default=no)],
620  enable_profiling="$enableval",
621  enable_profiling="no")
622AC_MSG_RESULT($enable_profiling)
623if test "x$enable_profiling" = "xyes"; then
624  PROFILING_CFLAGS="-pg"
625  PROFILING_LDFLAGS="-pg"
626else
627  PROFILING_CFLAGS=""
628  PROFILING_LDFLAGS=""
629fi
630AC_SUBST(PROFILING_CFLAGS)
631AC_SUBST(PROFILING_LDFLAGS)
632
633
634
635###-------------------------------------------------------------------------
636#
637# check for Debian multiarch paths
638#
639AC_PATH_TOOL([DPKG_ARCH], [dpkg-architecture])
640AC_MSG_CHECKING([for multiarch paths])
641multiarch_triplet=""
642DEBIAN_MULTIARCH_DIRS=""
643if test -n "$DPKG_ARCH"; then
644  multiarch_triplet=$($DPKG_ARCH -qDEB_HOST_MULTIARCH 2> /dev/null)
645  if test -z "$multiarch_triplet"; then
646    multiarch_triplet=$($DPKG_ARCH -qDEB_HOST_GNU_TYPE)
647  fi
648fi
649if test -n "$multiarch_triplet"; then
650  DEBIAN_MULTIARCH_DIRS="/lib/$multiarch_triplet /usr/lib/$multiarch_triplet"
651  AC_MSG_RESULT([$DEBIAN_MULTIARCH_DIRS])
652else
653  AC_MSG_RESULT([not found])
654fi
655
656
657
658###-------------------------------------------------------------------------
659#
660# check for libgcrypt
661#
662NEED_LIBGCRYPT_API=1
663NEED_LIBGCRYPT_VERSION=1.2.0
664AC_DEFINE_UNQUOTED(NEED_LIBGCRYPT_VERSION, "$NEED_LIBGCRYPT_VERSION",
665                                     [Required version of Libgcrypt])
666case "$OS_TYPE" in
667  windows)
668    LIBGCRYPT_CFLAGS=""
669    LIBGCRYPT_LIBS="-lgcrypt"
670    AC_SUBST(LIBGCRYPT_CFLAGS)
671    AC_SUBST(LIBGCRYPT_LIBS)
672    ;;
673  *)
674    AM_PATH_LIBGCRYPT("$NEED_LIBGCRYPT_API:$NEED_LIBGCRYPT_VERSION",
675                      [have_gcrypt="yes"], [have_gcrypt="no"])
676    if test "$have_gcrypt" != "yes"; then
677      AC_MSG_ERROR([
678    **** Libgcrypt is required for Gwenhywfar. Please install it (including devel packages)
679    **** (at least version $NEED_LIBGCRYPT_VERSION using API $NEED_LIBGCRYPT_API is required.)])
680    fi
681    ;;
682esac
683
684
685
686###-------------------------------------------------------------------------
687#
688# check for library for common error values and messages in GnuPG components
689#
690AM_PATH_GPG_ERROR
691
692
693
694###-------------------------------------------------------------------------
695#
696# check for libgnutls
697#
698
699PKG_CHECK_MODULES([LIBGNUTLS], [gnutls >= 2.9.8])
700
701
702###-------------------------------------------------------------------------
703#
704# check for OpenSSL
705#
706PKG_CHECK_MODULES([OPENSSL], [openssl], [ssl_available=yes], [ssl_available=no])
707if test "$ssl_available" = "yes"; then
708  AC_DEFINE_UNQUOTED(HAVE_OPENSSL, 1, [Defined if OpenSSL is available])
709fi
710AM_CONDITIONAL(IF_HAVE_OPENSSL, [test "$ssl_available" = "yes"])
711AC_SUBST(ssl_available)
712
713
714
715###-------------------------------------------------------------------------
716# check for Distribution
717
718AQ_DISTRIBUTION
719
720
721
722###-------------------------------------------------------------------------
723#
724# check for I18N
725#
726
727
728# check whether i18n files are to be created
729AC_CHECK_PROG(XGETTEXT,xgettext,xgettext, missing)
730
731MAKE_I18N_FILES="yes"
732if test "$XGETTEXT" = "missing"; then
733  MAKE_I18N_FILES="no"
734  AC_MSG_WARN([xgettext is missing. Locale suport is disabled.])
735fi
736
737AC_PATH_PROG([MSGFMT], [msgfmt], [missing])
738if test "$MSGFMT" = "missing"; then
739  MAKE_I18N_FILES="no"
740  AC_MSG_WARN([msgfmt is missing. Locale suport is disabled.])
741fi
742
743AC_SUBST(MAKE_I18N_FILES)
744AM_CONDITIONAL(IF_MAKE_I18N_FILES, [test "$MAKE_I18N_FILES" = "yes"])
745
746
747# then check whether i18n support is to be compiled in
748i18n_libs=""
749HAVE_I18N="yes"
750AC_CHECK_HEADERS([locale.h libintl.h], [], [HAVE_I18N="no"])
751
752if test "$OS_TYPE" != "windows"; then
753  oldlibs="$LIBS"
754  LIBS=""
755  AC_SEARCH_LIBS(gettext, intl, [], [HAVE_I18N="no"])
756  i18n_libs="$LIBS"
757  LIBS="$oldlibs"
758else
759  if test "$HAVE_I18N" != "no"; then
760    i18n_libs="-lintl"
761    all_libraries="${all_libraries} -lintl"
762  fi
763fi
764
765if test "$HAVE_I18N" != "no"; then
766  AC_DEFINE_UNQUOTED(HAVE_I18N, 1, [whether I18N is available])
767fi
768
769AC_SUBST(HAVE_I18N)
770AC_SUBST(i18n_libs)
771
772
773
774###-------------------------------------------------------------------------
775#
776# check for iconv
777#
778
779AC_ARG_WITH(iconv, [  --with-iconv=PATH take iconv from PATH],
780  [ICONV_DIR="$withval"],
781  [ICONV_DIR="/usr"])
782
783if test "$ICONV_DIR" = "no" ; then
784    echo Disabling ICONV support
785else
786    if test "$with_iconv" != "yes" -a "$with_iconv" != "" ; then
787	CPPFLAGS="${CPPFLAGS} -I$with_iconv/include"
788	# Export this since our headers include iconv.h
789	ICONV_INCLUDES="-I$ICONV_DIR/include"
790	ICONV_LIBS="-L$ICONV_DIR/lib"
791    fi
792
793    AC_CHECK_HEADER(iconv.h,
794	AC_MSG_CHECKING(for iconv)
795	AC_TRY_LINK([#include <stdlib.h>
796#include <iconv.h>],[
797iconv_t cd = iconv_open ("","");
798iconv (cd, NULL, NULL, NULL, NULL);],[
799	    AC_MSG_RESULT(yes)
800	    WITH_ICONV=1],[
801	    AC_MSG_RESULT(no)
802	    AC_MSG_CHECKING(for iconv in -liconv)
803
804	    _ldflags="${LDFLAGS}"
805	    _libs="${LIBS}"
806	    LDFLAGS="${LDFLAGS} ${ICONV_LIBS}"
807	    LIBS="${LIBS} -liconv"
808
809	    AC_TRY_LINK([#include <stdlib.h>
810#include <iconv.h>],[
811iconv_t cd = iconv_open ("","");
812iconv (cd, NULL, NULL, NULL, NULL);],[
813		AC_MSG_RESULT(yes)
814		WITH_ICONV=1
815		ICONV_LIBS="${ICONV_LIBS} -liconv"
816		LIBS="${_libs}"
817		LDFLAGS="${_ldflags}"],[
818		AC_MSG_RESULT(no)
819		LIBS="${_libs}"
820		LDFLAGS="${_ldflags}"])]))
821fi
822AC_DEFINE_UNQUOTED(HAVE_ICONV, $WITH_ICONV, [Defined if libiconv is available])
823AC_SUBST(WITH_ICONV)
824AC_SUBST(ICONV_LIBS)
825
826
827
828###-------------------------------------------------------------------------
829#
830# guis
831#
832
833AC_ARG_WITH(guis,
834  [  --with-guis=list      space separated list of GUI implementations (default:all)],
835  [gwenhywfar_guis="$withval"],
836  [gwenhywfar_guis="qt4 gtk2"]
837)
838if test "$gwenhywfar_guis" = "none"; then
839  gwenhywfar_guis=""
840fi
841if test "$gwenhywfar_guis" = "yes"; then
842  gwenhywfar_guis=""
843fi
844AC_SUBST(gwenhywfar_guis)
845
846
847
848
849###-------------------------------------------------------------------------
850# Check for fox toolkit
851#
852
853
854case "$gwenhywfar_guis" in
855  *fox16*)
856     AQ_CHECK_FOX
857     if test "$have_fox" != "yes"; then
858       AC_MSG_ERROR([
859**** FOX Toolkit missing.
860**** If you want to use the FOX-GUI you will have to install the package
861**** libfox-1.6 and libfox-1.6-devel on Debian-like systems.
862**** On RPM systems like SuSE those packages might have different names.
863**** If you don't need the FOX-GUI you might want to use the option
864**** --with-guis])
865     fi
866     AC_DEFINE(BUILD_GUI_FOX16, 1, [if gwen gui for fox16 is built])
867     with_gui_fox16="yes"
868     ;;
869esac
870
871AC_SUBST(with_gui_fox16)
872AM_CONDITIONAL(WITH_GUI_FOX16, [test "$with_gui_fox16" = "yes"])
873
874
875
876###-------------------------------------------------------------------------
877# Check for GTK+
878#
879
880
881case "$gwenhywfar_guis" in
882  *gtk2*)
883     # We need at least GTK 2.17.5 because we use functions like
884     # gtk_widget_get_sensitive() and gtk_widget_has_focus()
885     pkg_modules="gtk+-2.0 >= 2.17.5"
886     dnl $4=true => don't die in case of failure.
887     PKG_CHECK_MODULES(GTK2, [$pkg_modules], [], true)
888     AC_DEFINE(BUILD_GUI_GTK2, 1, [if gwen gui for gtk2 is built])
889     with_gui_gtk2="yes"
890     ;;
891esac
892
893AC_SUBST(with_gui_gtk2)
894AM_CONDITIONAL(WITH_GUI_GTK2, [test "$with_gui_gtk2" = "yes"])
895
896###-------------------------------------------------------------------------
897# Check for GTK+
898#
899
900
901case "$gwenhywfar_guis" in
902  *gtk3*)
903     # Minimum required gtk3 version
904     pkg_modules="gtk+-3.0 >= 3.10.8"
905     PKG_CHECK_MODULES(GTK3, [$pkg_modules])
906     AC_DEFINE(BUILD_GUI_GTK3, 1, [if gwen gui for gtk3 is built])
907     with_gui_gtk3="yes"
908     ;;
909esac
910
911AC_SUBST(with_gui_gtk3)
912AM_CONDITIONAL(WITH_GUI_GTK3, [test "$with_gui_gtk3" = "yes"])
913
914
915
916###-------------------------------------------------------------------------
917#
918# check whether libXML2 code is to be compiled
919#
920AC_MSG_CHECKING(libXML2-depending code)
921AC_ARG_WITH(libxml2-code, [  --with-libxml2-code=yes compile libXML2-depending code],
922  [gwen_with_libxml2_code="$withval"],
923  [gwen_with_libxml2_code="no"])
924AC_MSG_RESULT($gwen_with_libxml2_code)
925AM_CONDITIONAL(WITH_LIBXML2_CODE, [test "$gwen_with_libxml2_code" = "yes"])
926
927
928
929###-------------------------------------------------------------------------
930#
931# Check for libxml
932#
933if test "$gwen_with_libxml2_code" = "yes"; then
934  AC_DEFINE(GWEN_COMPILE_LIBXML2_CODE, 1, [if libxml2-code is wanted])
935  PKG_CHECK_MODULES(LIBXML,  [libxml-2.0])
936fi
937
938
939
940###-------------------------------------------------------------------------
941#
942# QT4
943#
944
945UIC4="NO"
946QT4_BINDIR=""
947
948case "$gwenhywfar_guis" in
949  *qt4*)
950    AQ_CHECK_QT4
951    if test "$have_qt4" = "yes"; then
952      # Define this macro to disable the cast from QString to const char
953      # which implicitly uses latin1()!
954      AC_DEFINE(QT_NO_ASCII_CAST,[1],[Disable the cast from QString to const char.])
955    fi
956
957    dnl windows/mingw doesnt have the yes program, so add this emulation
958    AC_CHECK_PROG(YES, yes, yes, [[echo -e 'y\ny\ny\ny\n']])
959
960    dnl Store the bin dir for the windows dlls
961    QT4_BINDIR="` echo ${qt4_moc} | ${SED} 's-/moc--' | ${SED} 's-/c/-c:\\\\-' | ${SED} 's-/-\\\\-g' `"
962    UIC4="${qt4_uic}"
963
964    AC_DEFINE(BUILD_GUI_QT4, 1, [if gwen gui for qt4 is built])
965    with_gui_qt4="yes"
966    ;;
967  *)
968    ;;
969esac
970
971dnl Store the bin dir for the windows dlls
972AC_SUBST(QT4_BINDIR)
973AC_SUBST(with_gui_qt4)
974AM_CONDITIONAL(WITH_GUI_QT4, [test "$with_gui_qt4" = "yes"])
975
976
977
978###-------------------------------------------------------------------------
979#
980# QT5
981#
982
983case "$gwenhywfar_guis" in
984  *qt5*)
985  AX_HAVE_QT
986esac
987
988
989
990###-------------------------------------------------------------------------
991#
992# check docpath
993#
994AC_MSG_CHECKING(docpath)
995AC_ARG_WITH(docpath, [  --with-docpath=DIR where to store the apidoc],
996  [docpath="$withval"],
997  [docpath="${HOME}/apidoc"])
998AC_SUBST(docpath)
999AC_MSG_RESULT($docpath)
1000
1001
1002
1003###-------------------------------------------------------------------------
1004#
1005# search for tag files
1006#
1007AC_MSG_CHECKING(doxygen tag files)
1008DOXYGEN_TAGFILES=""
1009DOXYGEN_TAGFILEPATHS=""
1010if test -d "${docpath}"; then
1011  tagfiles="`cd ${docpath} && ls *.tag`"
1012  if test -n "${tagfiles}"; then
1013    # remove own package from list
1014    tagfiles="`echo ${tagfiles} | ${SED} -e s/${PACKAGE}.tag//`"
1015
1016    # add every remaining tag file
1017    for ff in ${tagfiles}; do
1018      DOXYGEN_TAGFILES="${DOXYGEN_TAGFILES} ${docpath}/${ff}=${docpath}/`basename -s .tag ${ff}`"
1019    done
1020  fi
1021fi
1022if test -z "${DOXYGEN_TAGFILES}"; then
1023  AC_MSG_RESULT(none)
1024else
1025  AC_MSG_RESULT(found)
1026fi
1027AC_SUBST(DOXYGEN_TAGFILES)
1028
1029
1030
1031###-------------------------------------------------------------------------
1032#
1033# Search for dlopen
1034#
1035LIBS=""
1036AC_SEARCH_LIBS(dlopen, c dl)
1037if test "$LIBS" = "-lc"; then
1038    LIBS=""
1039fi
1040ld_library="$LIBS"
1041LIBS=""
1042all_libraries="$all_libraries $ld_library"
1043
1044
1045###-------------------------------------------------------------------------
1046#
1047# check for release
1048#
1049AC_MSG_CHECKING(whether this is an official release)
1050AC_ARG_ENABLE(release,
1051  [  --enable-release         make this an official release (default=no)],
1052  [ case "${enableval}" in
1053    yes) enable_release="yes";;
1054    no)  enable_release="no";;
1055    *) AC_MSG_ERROR(bad value ${enableval} for --enable-release);;
1056    esac
1057  ],
1058  enable_release="no")
1059
1060if test "$enable_release" = "yes"; then
1061  STRIPALL="-s"
1062else
1063  STRIPALL=""
1064fi
1065AC_SUBST(STRIPALL)
1066AC_MSG_RESULT($enable_release)
1067
1068
1069
1070###-------------------------------------------------------------------------
1071#
1072# Compiler check for symbol visibility
1073#
1074AC_CACHE_CHECK([whether compiler supports symbol visibility],
1075  ac_cv_hidden_visibility_attribute, [
1076    echo 'int __attribute__ ((visibility ("hidden"))) foo (void) { return 1; }' > conftest.c
1077    ac_cv_hidden_visibility_attribute=no
1078    if AC_TRY_COMMAND(${CC-cc} -Werror -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD);
1079    then
1080      if grep '\.hidden.*foo' conftest.s >/dev/null;
1081      then
1082        ac_cv_hidden_visibility_attribute=yes
1083      fi
1084    fi
1085    rm -f conftest.*
1086  ])
1087if test $ac_cv_hidden_visibility_attribute = yes;
1088then
1089  AC_DEFINE(GCC_WITH_VISIBILITY_ATTRIBUTE, 1, [visibility])
1090  visibility_cflags="-fvisibility=hidden"
1091  visibility_supported="yes"
1092fi
1093AC_SUBST(visibility_cflags)
1094
1095
1096
1097###-------------------------------------------------------------------------
1098#
1099# check for werror
1100#
1101AC_MSG_CHECKING(if CFLAG -Werror is to be used)
1102AC_ARG_ENABLE(error-on-warning,
1103  [  --enable-error-on-warning             treat compiler warnings as errors (default=no)],
1104  enable_werror="$enableval",
1105  enable_werror="no")
1106AC_MSG_RESULT($enable_werror)
1107
1108WERROR=""
1109if test "$enable_werror" != "no"; then
1110  WERROR="-Werror"
1111fi
1112AC_SUBST(WERROR)
1113
1114
1115# Debug arguments for compilation
1116ACX_COMPILE_WARN()
1117
1118
1119
1120###-------------------------------------------------------------------------
1121#
1122# check for MEMTRACE
1123#
1124AC_MSG_CHECKING(if MEMTRACE is wanted)
1125AC_ARG_ENABLE(memtrace,
1126  [  --enable-memtrace             enable memory trace (default=no)],
1127  enable_memtrace="$enableval",
1128  enable_memtrace="no")
1129AC_MSG_RESULT($enable_memtrace)
1130
1131if test "$enable_memtrace" != "no"; then
1132  #AC_DEFINE(GWEN_MEMTRACE, 1, [if memory trace is wanted])
1133  AC_DEFINE(GWEN_MEMORY_DEBUG, 1, [if memory debugging is wanted])
1134fi
1135
1136
1137# Debug arguments for compilation
1138ACX_COMPILE_WARN()
1139
1140
1141
1142###-------------------------------------------------------------------------
1143#
1144# check buffer hard limit
1145#
1146AC_MSG_CHECKING(default buffer hard limit)
1147AC_ARG_WITH(buffer-hardlimit, [  --with-buffer-hardlimit=VALUE new default buffer hard limit],
1148  [gwenhywfar_buffer_hardlimit="$withval"],
1149  [gwenhywfar_buffer_hardlimit=""])
1150
1151if test -z "${gwenhywfar_buffer_hardlimit}"; then
1152  gwenhywfar_buffer_hardlimit="(16*1024*1024)"
1153fi
1154
1155AC_SUBST(gwenhywfar_buffer_hardlimit)
1156AC_MSG_RESULT($gwenhywfar_buffer_hardlimit)
1157
1158
1159###-------------------------------------------------------------------------
1160#
1161# compile program flags
1162#
1163
1164PROG_LIBRARIES="${PROG_LIBRARIES} ${ncurses_libs}"
1165
1166# Clean up include variables
1167AS_SCRUB_INCLUDE(gwenhywfar_includes)
1168AS_SCRUB_INCLUDE(all_includes)
1169
1170
1171
1172###-------------------------------------------------------------------------
1173#
1174# check for doc type
1175#
1176AC_MSG_CHECKING(if full docu should be created)
1177AC_ARG_ENABLE(full-doc,
1178  [  --enable-full-doc         enable creating full apidoc (default=no)],
1179  [ case "${enableval}" in
1180    yes) enable_fulldoc="yes";;
1181    no)  enable_fulldoc="no";;
1182    *) AC_MSG_ERROR(bad value ${enableval} for --enable-full-doc);;
1183    esac
1184  ],
1185  enable_fulldoc="no")
1186
1187if test "$enable_fulldoc" = "yes"; then
1188	DOXYGEN_INPUT="listdoc.h src gui plugins tools"
1189        DOXYGEN_DEFINE=""
1190else
1191	DOXYGEN_DEFINE="DOXYGEN_HIDE"
1192	DOXYGEN_INPUT="listdoc.h gwenhywfar5"
1193fi
1194AC_SUBST(DOXYGEN_INPUT)
1195AC_SUBST(DOXYGEN_DEFINE)
1196AC_MSG_RESULT($enable_fulldoc)
1197
1198
1199
1200# Debug arguments for compilation
1201ACX_COMPILE_WARN()
1202
1203
1204
1205###-------------------------------------------------------------------------
1206#
1207# substitute vars
1208#
1209AC_SUBST(GWEN_OS)
1210AC_SUBST(PROG_LIBRARIES)
1211AC_SUBST(all_includes)
1212AC_SUBST(all_libraries)
1213AC_SUBST(gwenhywfar_crypt_lib)
1214AC_SUBST(gwenhywfar_ldflags)
1215AC_SUBST(gwenhywfar_bindir)
1216AC_SUBST(gwenhywfar_libs)
1217AC_SUBST(gwenhywfar_internal_libname)
1218AC_SUBST(gwenhywfar_libspp)
1219AC_SUBST(gwenhywfar_libsui)
1220AC_SUBST(gwenhywfar_os_lib)
1221AC_SUBST(gwenhywfar_pkgincludedir)
1222AC_SUBST(gwenhywfar_plugindir)
1223AC_SUBST(gwenhywfar_headerdir_am)
1224AC_SUBST(gwenhywfar_headerdir)
1225AC_SUBST(gwenhywfar_symlinkdir)
1226AC_SUBST(gwenhywfar_datadir)
1227
1228
1229
1230###-------------------------------------------------------------------------
1231#
1232AC_MSG_CHECKING(crypt token plugins)
1233AC_ARG_WITH(plugins-ct, [  --with-plugins-ct=LIST list of CT plugins to build],
1234  [plugins="$withval"],
1235  [plugins="all"])
1236
1237if test "$plugins" = "all"; then
1238  plugins="ohbci";
1239fi
1240
1241gwenhywfar_plugins_ct_dirs=""
1242gwenhywfar_plugins_ct_libs=""
1243for plugin in $plugins; do
1244  case "$plugin" in
1245    ohbci)
1246      gwenhywfar_plugins_ct_dirs="$gwenhywfar_plugins_ct_dirs ohbci"
1247      gwenhywfar_plugins_ct_libs="$gwenhywfar_plugins_ct_libs ohbci/libct_ohbci.la"
1248      AC_DEFINE(GWENHYWFAR_WITH_PLUGIN_CT_OHBCI, 1, [plugin availability])
1249      ;;
1250    *)
1251      AC_MSG_ERROR("ERROR: Unknown plugin \"$plugin\"")
1252      ;;
1253  esac
1254done
1255
1256AC_SUBST(gwenhywfar_plugins_ct_dirs)
1257AC_SUBST(gwenhywfar_plugins_ct_libs)
1258AC_MSG_RESULT($plugins)
1259
1260
1261
1262###-------------------------------------------------------------------------
1263#
1264AC_MSG_CHECKING(DBIO plugins)
1265AC_ARG_WITH(plugins-dbio, [  --with-plugins-dbio=LIST list of DBIO plugins to build],
1266  [plugins="$withval"],
1267  [plugins="all"])
1268
1269if test "$plugins" = "all"; then
1270  plugins="csv olddb xmldb";
1271fi
1272
1273gwenhywfar_plugins_dbio_dirs=""
1274gwenhywfar_plugins_dbio_libs=""
1275for plugin in $plugins; do
1276  case "$plugin" in
1277    csv)
1278      gwenhywfar_plugins_dbio_dirs="$gwenhywfar_plugins_dbio_dirs csv"
1279      gwenhywfar_plugins_dbio_libs="$gwenhywfar_plugins_dbio_libs csv/libdbio_csv.la"
1280      AC_DEFINE(GWENHYWFAR_WITH_PLUGIN_DBIO_CSV, 1, [plugin availability])
1281      ;;
1282    olddb)
1283      gwenhywfar_plugins_dbio_dirs="$gwenhywfar_plugins_dbio_dirs olddb"
1284      gwenhywfar_plugins_dbio_libs="$gwenhywfar_plugins_dbio_libs olddb/libdbio_olddb.la"
1285      AC_DEFINE(GWENHYWFAR_WITH_PLUGIN_DBIO_OLDDB, 1, [plugin availability])
1286      ;;
1287    xmldb)
1288      gwenhywfar_plugins_dbio_dirs="$gwenhywfar_plugins_dbio_dirs xmldb"
1289      gwenhywfar_plugins_dbio_libs="$gwenhywfar_plugins_dbio_libs xmldb/libdbio_xmldb.la"
1290      AC_DEFINE(GWENHYWFAR_WITH_PLUGIN_DBIO_XMLDB, 1, [plugin availability])
1291      ;;
1292    *)
1293      AC_MSG_ERROR("ERROR: Unknown plugin \"$plugin\"")
1294      ;;
1295  esac
1296done
1297
1298AC_SUBST(gwenhywfar_plugins_dbio_dirs)
1299AC_SUBST(gwenhywfar_plugins_dbio_libs)
1300AC_MSG_RESULT($plugins)
1301
1302
1303
1304###-------------------------------------------------------------------------
1305#
1306AC_MSG_CHECKING(ConfigManager plugins)
1307AC_ARG_WITH(plugins-cfgmgr, [  --with-plugins-cfgmgr=LIST list of ConfigManager plugins to build],
1308  [plugins="$withval"],
1309  [plugins="all"])
1310
1311if test "$plugins" = "all"; then
1312  plugins="dir";
1313fi
1314
1315gwenhywfar_plugins_cfgmgr_dirs=""
1316gwenhywfar_plugins_cfgmgr_libs=""
1317for plugin in $plugins; do
1318  case "$plugin" in
1319    dir)
1320      gwenhywfar_plugins_cfgmgr_dirs="$gwenhywfar_plugins_cfgmgr_dirs dir"
1321      gwenhywfar_plugins_cfgmgr_libs="$gwenhywfar_plugins_cfgmgr_libs dir/libcfgmgr_dir.la"
1322      AC_DEFINE(GWENHYWFAR_WITH_PLUGIN_CFGMGR_DIR, 1, [plugin availability])
1323      ;;
1324    *)
1325      AC_MSG_ERROR("ERROR: Unknown plugin \"$plugin\"")
1326      ;;
1327  esac
1328done
1329
1330AC_SUBST(gwenhywfar_plugins_cfgmgr_dirs)
1331AC_SUBST(gwenhywfar_plugins_cfgmgr_libs)
1332AC_MSG_RESULT($plugins)
1333
1334
1335
1336###-------------------------------------------------------------------------
1337#
1338# list of files to create
1339#
1340AC_CONFIG_FILES([Doxyfile
1341                 Makefile
1342                 admin/Makefile
1343                 m4/Makefile
1344                 po/Makefile
1345                 gwenhywfar-config.in
1346                 gwenhywfar.pc
1347                 gwenhywfar-config.cmake
1348                 gwenhywfar-config-version.cmake
1349                 gwenhywfar.spec
1350                 gwenhywfar.iss
1351                 checks/Makefile
1352                 data/Makefile
1353                 doc/Makefile
1354                 doc/dialog/Makefile
1355                 doc/dialog/images/Makefile
1356                 doc/inherit/Makefile
1357		 doc/plugindescr.xsd
1358                 src/Makefile
1359                 src/types.h
1360                 src/ressource.rc
1361                 src/version.h
1362                 src/base/Makefile
1363                 src/crypt3/Makefile
1364                 src/cryptmsg/Makefile
1365                 src/crypttoken/Makefile
1366                 src/gui/Makefile
1367                 src/sio/Makefile
1368                 src/html/Makefile
1369                 src/os/Makefile
1370                 src/os/posix/Makefile
1371                 src/os/posix/system.h
1372                 src/os/windows/Makefile
1373                 src/os/windows/system.h
1374                 src/parser/Makefile
1375                 src/sar/Makefile
1376                 src/test_framework/Makefile
1377                 src/xmlcmd/Makefile
1378                 plugins/Makefile
1379                 plugins/dbio/Makefile
1380                 plugins/dbio/csv/Makefile
1381                 plugins/dbio/csv/csv.xml
1382                 plugins/dbio/csv/ressource.rc
1383                 plugins/dbio/olddb/Makefile
1384                 plugins/dbio/olddb/olddb.xml
1385                 plugins/dbio/olddb/ressource.rc
1386                 plugins/dbio/xmldb/Makefile
1387                 plugins/dbio/xmldb/xmldb.xml
1388                 plugins/dbio/xmldb/ressource.rc
1389                 plugins/ct/Makefile
1390                 plugins/ct/ohbci/Makefile
1391                 plugins/ct/ohbci/ohbci.xml
1392                 plugins/ct/ohbci/ressource.rc
1393                 plugins/configmgr/Makefile
1394                 plugins/configmgr/dir/Makefile
1395                 plugins/configmgr/dir/dir.xml
1396                 tools/Makefile
1397                 tools/xmlmerge/Makefile
1398                 tools/typemaker/Makefile
1399                 tools/typemaker2/Makefile
1400                 tools/typemaker2/types/Makefile
1401                 tools/typemaker2/types/c/Makefile
1402                 tools/gcttool/Makefile
1403                 tools/gsa/Makefile
1404                 test/Makefile
1405                 gui/Makefile
1406                 gui/cpp/Makefile
1407                 gui/cpp/gwengui-cpp-config.cmake
1408                 gui/cpp/gwengui-cpp-config-version.cmake
1409                 gui/qt4/Makefile
1410                 gui/qt4/gwengui-qt4.pc
1411                 gui/qt4/gwengui-qt4-config.cmake
1412                 gui/qt4/gwengui-qt4-config-version.cmake
1413                 gui/qt5/Makefile
1414                 gui/qt5/gwengui-qt5.pc
1415                 gui/qt5/gwengui-qt5-config.cmake
1416                 gui/qt5/gwengui-qt5-config-version.cmake
1417                 gui/fox16/Makefile
1418                 gui/fox16/gwengui-fox16.pc
1419                 gui/gtk2/Makefile
1420                 gui/gtk2/gwengui-gtk2.pc
1421                 gui/gtk3/Makefile
1422                 gui/gtk3/gwengui-gtk3.pc
1423                 gui/cocoa/Makefile
1424                 gui/testdialogs/Makefile
1425		])
1426AC_OUTPUT
1427
1428
1429
1430
1431###-------------------------------------------------------------------------
1432#
1433# create header directory, make symlinks
1434#
1435HEADER_DIRS="src src/base src/crypt3 src/cryptmsg src/crypttoken src/sio src/os src/os/${GWEN_OS} src/gui src/html"
1436HEADER_DIRS="${HEADER_DIRS} src/parser src/sar src/xmlcmd src/test_framework"
1437lprefix="${srcdir}"
1438lprefix=`( cd ${lprefix} ; pwd )`
1439
1440rm -Rf gwenhywfar5 2>/dev/null
1441mkdir -p gwenhywfar5/gwenhywfar
1442for d in ${HEADER_DIRS}; do
1443  hfiles=`( cd "${srcdir}/${d}" && ls *.h 2>/dev/null )`
1444  for f in ${hfiles}; do
1445    case ${f} in
1446      *_l.h | *_p.h)
1447      	 ;;
1448      *)
1449    	 ln -s "${lprefix}/${d}/${f}" "gwenhywfar5/gwenhywfar/${f}"
1450         ;;
1451    esac
1452  done
1453done
1454#ln -s "${lprefix}/src/os/$OS_TYPE/system.h" "gwenhywfar5/gwenhywfar/system.h" 2>/dev/null
1455
1456
1457
1458# cpp
1459#
1460rm -Rf gwenhywfar5/gwen-gui-cpp 2>/dev/null
1461mkdir -p gwenhywfar5/gwen-gui-cpp
1462for d in gui/cpp; do
1463  hfiles=`( cd "${srcdir}/${d}" && ls *.hpp *.h 2>/dev/null )`
1464  for f in ${hfiles}; do
1465    case ${f} in
1466      *_l.hpp | *_p.hpp)
1467      	 ;;
1468      *)
1469    	 ln -s "${lprefix}/${d}/${f}" "gwenhywfar5/gwen-gui-cpp/${f}"
1470         ;;
1471    esac
1472  done
1473done
1474
1475
1476
1477# qt4
1478#
1479rm -Rf gwenhywfar5/gwen-gui-qt4 2>/dev/null
1480mkdir -p gwenhywfar5/gwen-gui-qt4
1481for d in gui/qt4; do
1482  hfiles=`( cd "${srcdir}/${d}" && ls *.hpp *.h 2>/dev/null )`
1483  for f in ${hfiles}; do
1484    case ${f} in
1485      *_l.hpp | *_p.hpp | qt4_gui_*.hpp)
1486      	 ;;
1487      *)
1488    	 ln -s "${lprefix}/${d}/${f}" "gwenhywfar5/gwen-gui-qt4/${f}"
1489         ;;
1490    esac
1491  done
1492done
1493
1494# qt5
1495#
1496rm -Rf gwenhywfar5/gwen-gui-qt5 2>/dev/null
1497mkdir -p gwenhywfar5/gwen-gui-qt5
1498for d in gui/qt5; do
1499  hfiles=`( cd "${srcdir}/${d}" && ls *.hpp *.h 2>/dev/null )`
1500  for f in ${hfiles}; do
1501    case ${f} in
1502      *_l.hpp | *_p.hpp | qt5_gui_*.hpp)
1503         ;;
1504      *)
1505       ln -s "${lprefix}/${d}/${f}" "gwenhywfar5/gwen-gui-qt5/${f}"
1506         ;;
1507    esac
1508  done
1509done
1510
1511
1512# fox16
1513#
1514rm -Rf gwenhywfar5/gwen-gui-fox16 2>/dev/null
1515mkdir -p gwenhywfar5/gwen-gui-fox16
1516for d in gui/fox16; do
1517  hfiles=`( cd "${srcdir}/${d}" && ls *.hpp *.h 2>/dev/null )`
1518  for f in ${hfiles}; do
1519    case ${f} in
1520      *_l.hpp | *_p.hpp | fox16_gui_*.hpp)
1521      	 ;;
1522      *)
1523    	 ln -s "${lprefix}/${d}/${f}" "gwenhywfar5/gwen-gui-fox16/${f}"
1524         ;;
1525    esac
1526  done
1527done
1528
1529
1530# gtk2
1531#
1532rm -Rf gwenhywfar5/gwen-gui-gtk2 2>/dev/null
1533mkdir -p gwenhywfar5/gwen-gui-gtk2
1534for d in gui/gtk2; do
1535  hfiles=`( cd "${srcdir}/${d}" && ls *.h 2>/dev/null )`
1536  for f in ${hfiles}; do
1537    case ${f} in
1538      *_l.h | *_p.h | gtk2_gui_*.h)
1539      	 ;;
1540      *)
1541    	 ln -s "${lprefix}/${d}/${f}" "gwenhywfar5/gwen-gui-gtk2/${f}"
1542         ;;
1543    esac
1544  done
1545done
1546
1547
1548# gtk3
1549#
1550rm -Rf gwenhywfar5/gwen-gui-gtk3 2>/dev/null
1551mkdir -p gwenhywfar5/gwen-gui-gtk3
1552for d in gui/gtk3; do
1553  hfiles=`( cd "${srcdir}/${d}" && ls *.h 2>/dev/null )`
1554  for f in ${hfiles}; do
1555    case ${f} in
1556      *_l.h | *_p.h | gtk3_gui_*.h)
1557      	 ;;
1558      *)
1559    	 ln -s "${lprefix}/${d}/${f}" "gwenhywfar5/gwen-gui-gtk3/${f}"
1560         ;;
1561    esac
1562  done
1563done
1564
1565
1566# cocoa
1567#
1568rm -Rf gwenhywfar5/gwen-gui-cocoa 2>/dev/null
1569mkdir -p gwenhywfar5/gwen-gui-cocoa
1570for d in gui/cocoa; do
1571  hfiles=`( cd "${srcdir}/${d}" && ls *.h 2>/dev/null )`
1572  for f in ${hfiles}; do
1573    case ${f} in
1574      *_l.h | *_p.h | gtk2_gui_*.h)
1575      	 ;;
1576      *)
1577    	 ln -s "${lprefix}/${d}/${f}" "gwenhywfar5/gwen-gui-cocoa/${f}"
1578         ;;
1579    esac
1580  done
1581done
1582
1583
1584
1585
1586###-------------------------------------------------------------------------
1587#
1588# summary
1589#
1590
1591echo
1592echo "Summary"
1593echo "============================================="
1594echo "Version                       : $GWENHYWFAR_VERSION_FULL_STRING"
1595echo "System                        : $OSYSTEM"
1596echo "Installation Folder           : $prefix"
1597echo "Local Installation Mode       : $enable_local_install"
1598echo "Plugin Installation Folder    : $gwenhywfar_plugindir"
1599echo "Plugin Search Folder          : $gwenhywfar_plugin_searchdir"
1600echo "Data Search Folder            : $gwenhywfar_data_searchdir"
1601echo "Locale Search Folder          : $gwenhywfar_locale_searchdir"
1602echo "Config Search Folder          : $gwenhywfar_cfg_searchdir"
1603echo "Buffer Default Hard Limit     : $gwenhywfar_buffer_hardlimit"
1604echo "Symbol Visibility             : $visibility_supported"
1605echo "OpenSSL Support for gct-tool  : $ssl_available"
1606echo "GUI Support                   : $gwenhywfar_guis"
1607echo "Use system-wide certificates  : $enable_system_certs"
1608echo "Compiling test code enabled   : $enable_testcode"
1609echo "Compile LibXML2 code          : $gwen_with_libxml2_code"
1610
1611
1612echo
1613echo "Plugins"
1614echo "============================================="
1615echo "  Crypt token plugins         :$gwenhywfar_plugins_ct_dirs"
1616echo "  DBIO plugins                :$gwenhywfar_plugins_dbio_dirs"
1617echo "  ConfigManager plugins       :$gwenhywfar_plugins_cfgmgr_dirs"
1618
1619echo
1620echo "You can now use the command 'make' (or on *BSD 'gmake') to "
1621echo "build Gwenhywfar."
1622echo
1623
1624
1625