-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathconfigure.ac
1667 lines (1357 loc) · 44.8 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
#
###-------------------------------------------------------------------------
#
# The following line makes sure that this file is always touched when a new
# revision is checked out.
#
# $Rev$
#
# info
GWENHYWFAR_AUTHOR="Martin Preuss<[email protected]>"
GWENHYWFAR_BUGREPORT_ADDR="<[email protected]>"
AC_PREREQ(2.60)
AC_INIT
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
AC_CONFIG_SRCDIR([src/gwenhywfarapi.h])
AC_CONFIG_HEADERS([config.h])
###-------------------------------------------------------------------------
#
# versions
#
GWENHYWFAR_VERSION_MAJOR=5
GWENHYWFAR_VERSION_MINOR=10
GWENHYWFAR_VERSION_PATCHLEVEL=1
GWENHYWFAR_VERSION_BUILD=1
dnl "stable", "rcX", "betaX", "cvs"
GWENHYWFAR_VERSION_TAG="git"
###-------------------------------------------------------------------------
#
# SO version for Gwenhywfar
#
GWENHYWFAR_SO_CURRENT="89"
GWENHYWFAR_SO_AGE="10"
GWENHYWFAR_SO_REVISION="1"
GWENHYWFAR_SO_EFFECTIVE="`echo \$(($GWENHYWFAR_SO_CURRENT-$GWENHYWFAR_SO_AGE))`"
###-------------------------------------------------------------------------
#
# Generate version strings and BUILD
#
#GWENHYWFAR_VERSION_BUILD="0"
# Let svn write the revision number directly into here on
# each svn update. Note: The trailing space is necessary for
# cvs versions.
#GWENHYWFAR_VERSION_BUILD=`echo "$Rev$ " | cut -d' ' -f2`
#if test "x$GWENHYWFAR_VERSION_BUILD" = "x" ; then
# GWENHYWFAR_VERSION_BUILD="0"
#fi
GWENHYWFAR_VERSION_FULL_STRING="$GWENHYWFAR_VERSION_MAJOR.$GWENHYWFAR_VERSION_MINOR.${GWENHYWFAR_VERSION_PATCHLEVEL}${GWENHYWFAR_VERSION_TAG}-${GWENHYWFAR_VERSION_BUILD}"
GWENHYWFAR_VERSION_STRING="$GWENHYWFAR_VERSION_MAJOR.$GWENHYWFAR_VERSION_MINOR.$GWENHYWFAR_VERSION_PATCHLEVEL"
# The version number for the plugin/ct/ohbci/ohbci.la
OHBCI_VERSION_STRING="0.1.0"
###-------------------------------------------------------------------------
#
# Create release strings
#
case "$GWENHYWFAR_VERSION_TAG" in
cvs|svn|git)
GWENHYWFAR_VERSION_RELEASE_STRING="$GWENHYWFAR_VERSION_MAJOR.$GWENHYWFAR_VERSION_MINOR.$GWENHYWFAR_VERSION_PATCHLEVEL.${GWENHYWFAR_VERSION_BUILD}"
;;
stable)
GWENHYWFAR_VERSION_RELEASE_STRING="$GWENHYWFAR_VERSION_MAJOR.$GWENHYWFAR_VERSION_MINOR.$GWENHYWFAR_VERSION_PATCHLEVEL"
;;
*)
GWENHYWFAR_VERSION_RELEASE_STRING="$GWENHYWFAR_VERSION_MAJOR.$GWENHYWFAR_VERSION_MINOR.$GWENHYWFAR_VERSION_PATCHLEVEL"
# add TAG
GWENHYWFAR_VERSION_RELEASE_STRING="${GWENHYWFAR_VERSION_RELEASE_STRING}${GWENHYWFAR_VERSION_TAG}"
;;
esac
AC_SUBST(GWENHYWFAR_VERSION_MAJOR)
AC_SUBST(GWENHYWFAR_VERSION_MINOR)
AC_SUBST(GWENHYWFAR_VERSION_PATCHLEVEL)
AC_SUBST(GWENHYWFAR_VERSION_BUILD)
AC_SUBST(GWENHYWFAR_VERSION_TAG)
AC_SUBST(GWENHYWFAR_VERSION_FULL_STRING)
AC_SUBST(GWENHYWFAR_VERSION_STRING)
AC_SUBST(GWENHYWFAR_VERSION_RELEASE_STRING)
AC_SUBST(OHBCI_VERSION_STRING)
AC_DEFINE_UNQUOTED(GWENHYWFAR_VERSION_MAJOR,$GWENHYWFAR_VERSION_MAJOR,
[major version])
AC_DEFINE_UNQUOTED(GWENHYWFAR_VERSION_MINOR,$GWENHYWFAR_VERSION_MINOR,
[minor version])
AC_DEFINE_UNQUOTED(GWENHYWFAR_VERSION_PATCHLEVEL,$GWENHYWFAR_VERSION_PATCHLEVEL,
[patchlevel])
AC_DEFINE_UNQUOTED(GWENHYWFAR_VERSION_BUILD,$GWENHYWFAR_VERSION_BUILD, [build])
AC_DEFINE_UNQUOTED(GWENHYWFAR_VERSION_STRING,"$GWENHYWFAR_VERSION_STRING",
[version string])
AC_DEFINE_UNQUOTED(GWENHYWFAR_VERSION_FULL_STRING,"$GWENHYWFAR_VERSION_FULL_STRING",
[full version string])
AC_DEFINE_UNQUOTED(GWENHYWFAR_VERSION_TAG,$GWENHYWFAR_VERSION_TAG, [tag])
AC_SUBST(GWENHYWFAR_SO_CURRENT)
AC_SUBST(GWENHYWFAR_SO_REVISION)
AC_SUBST(GWENHYWFAR_SO_AGE)
AC_SUBST(GWENHYWFAR_SO_EFFECTIVE)
AM_INIT_AUTOMAKE(gwenhywfar, $GWENHYWFAR_VERSION_RELEASE_STRING)
###-------------------------------------------------------------------------
#
# SO version for GwenUI
#
GWENUI_SO_CURRENT="1"
GWENUI_SO_REVISION="1"
GWENUI_SO_AGE="0"
GWENUI_SO_EFFECTIVE="`echo \$(($GWENUI_SO_CURRENT-$GWENUI_SO_AGE))`"
AC_SUBST(GWENUI_SO_CURRENT)
AC_SUBST(GWENUI_SO_REVISION)
AC_SUBST(GWENUI_SO_AGE)
AC_SUBST(GWENUI_SO_EFFECTIVE)
###-------------------------------------------------------------------------
#
# SO version for GwenPP
#
GWENPP_SO_CURRENT="16"
GWENPP_SO_REVISION="0"
GWENPP_SO_AGE="0"
GWENPP_SO_EFFECTIVE="`echo \$(($GWENPP_SO_CURRENT-$GWENPP_SO_AGE))`"
AC_SUBST(GWENPP_SO_CURRENT)
AC_SUBST(GWENPP_SO_REVISION)
AC_SUBST(GWENPP_SO_AGE)
AC_SUBST(GWENPP_SO_EFFECTIVE)
###-------------------------------------------------------------------------
# check for OS
AQ_CHECK_OS
if test "$OSYSTEM" = "osx"; then
COCOA_FRAMEWORK="-framework Cocoa"
FOUNDATION_FRAMEWORK="-framework CoreFoundation"
SYSCONF_FRAMEWORK="-framework SystemConfiguration"
APPKIT_FRAMEWORK="-framework AppKit"
COREDATA_FRAMEWORK="-framework CoreData"
WEBKIT_FRAMEWORK="-framework WebKit"
fi
AC_SUBST(COCOA_FRAMEWORK)
AC_SUBST(FOUNDATION_FRAMEWORK)
AC_SUBST(SYSCONF_FRAMEWORK)
AC_SUBST(APPKIT_FRAMEWORK)
AC_SUBST(COREDATA_FRAMEWORK)
AC_SUBST(WEBKIT_FRAMEWORK)
###-------------------------------------------------------------------------
# prefix handling
AC_PREFIX_DEFAULT(/usr/local)
if test "x$prefix" = "xNONE"; then
prefix=$ac_default_prefix
ac_configure_args="$ac_configure_args --prefix $prefix"
fi
AC_SUBST(prefix)
###-------------------------------------------------------------------------
#
# static/shared handling
#
AC_ENABLE_STATIC(no)
AC_ENABLE_SHARED(yes)
###-------------------------------------------------------------------------
#
# Checks for programs.
#
AC_PROG_CC
AC_PROG_CXX
AC_PROG_CPP
AC_PROG_OBJC
#AC_PROG_OBJCXX
#AC_PROG_OBJCXXCPP
AC_PROG_INSTALL
AC_PROG_LIBTOOL
AC_LIBTOOL_WIN32_DLL
AC_LIBTOOL_RC
# Newer libtool doesn't have AC_LIBTOOL_RC anymore. Need to check for
# $(RC) by ourselves.
AC_CHECK_TOOL([RC], [windres], [no])
AC_PROG_AWK
AC_CHECK_PROG(USE_DOT,dot,YES,NO)
AC_CHECK_PROG(SED,sed,sed)
# Check for the tool "astyle", but if not found, replace its program call by the no-op "echo" instead
AC_CHECK_PROG(ASTYLE, astyle, astyle, echo)
###-------------------------------------------------------------------------
#
# Checks for libraries.
#
AC_CHECK_LIB(dl, dlopen)
# note: this AC_CHECK_LIB will also add -ldl to LIBS.
AX_PTHREAD
#AC_CHECK_LIB(rt, sem_init,
# [
# rt_libs="-lrt -pthread"
# AC_DEFINE(HAVE_LIBRT, "1", [whether librt is available])
# ], [], [-pthread])
#AC_SUBST(rt_libs)
# Some systems have iconv in libc, some have it in libiconv (OSF/1 and
# those with the standalone portable GNU libiconv installed). Check
# which one is available. The define ICONV_CONST will be "" or "const"
# accordingly.
AM_ICONV
###-------------------------------------------------------------------------
#
# Checks for header files.
#
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h])
AC_CHECK_HEADERS([stdlib.h string.h strings.h sys/socket.h sys/time.h])
AC_CHECK_HEADERS([syslog.h unistd.h])
AC_CHECK_HEADERS([unistd.h])
AC_CHECK_HEADERS([dlfcn.h])
AC_CHECK_HEADERS([signal.h termios.h langinfo.h localcharset.h iconv.h])
AC_CHECK_HEADERS([time.h locale.h])
AC_CHECK_HEADERS([syslog.h])
AC_CHECK_HEADERS([sys/stat.h])
AC_CHECK_HEADERS([sys/types.h])
AC_CHECK_HEADERS([sys/wait.h])
AC_CHECK_HEADERS([regex.h])
AC_CHECK_HEADERS([endian.h])
###-------------------------------------------------------------------------
#
# Checks for declarations
#
AC_CHECK_DECLS([sigprocmask], [], [], [
#ifdef HAVE_SIGNAL_H
# include <signal.h>
#endif
])
###-------------------------------------------------------------------------
#
# Checks for typedefs, structures, and compiler characteristics.
#
AC_C_CONST
AC_HEADER_TIME
AC_STRUCT_TM
###-------------------------------------------------------------------------
#
# Checks for library functions.
#
AC_FUNC_CLOSEDIR_VOID
AC_FUNC_MKTIME
AC_FUNC_SELECT_ARGTYPES
AC_CHECK_FUNCS([gethostbyaddr gethostbyname inet_ntoa isascii getpid])
AC_CHECK_FUNCS([memmove memset])
AC_CHECK_FUNCS([select socket])
AC_CHECK_FUNCS([strcasecmp strchr strdup strerror])
AC_CHECK_FUNCS([snprintf])
AC_CHECK_FUNCS([symlink setlocale])
AC_CHECK_FUNCS([srandom random])
# Init binreloc
AM_BINRELOC
###-------------------------------------------------------------------------
#
# check whether gwen is a subproject to another one
#
AC_MSG_CHECKING(if gwen is a subproject)
AC_ARG_ENABLE(gwen-subproject,
[ --enable-gwen-subproject make gwen only a subproject (default=no)],
enable_gwen_subproject="$enableval",
enable_gwen_subproject="no")
AC_MSG_RESULT($enable_gwen_subproject)
if test "$enable_gwen_subproject" != "no"; then
AC_DEFINE(GWENHYWFAR_IS_SUBPROJECT, 1, [whether gwen is a subproject])
fi
###-------------------------------------------------------------------------
#
# check whether accompanying certificates should be used
#
AC_MSG_CHECKING(whether system-wide trusted certificates should be set)
AC_ARG_ENABLE(system-certs,
[ --enable-system-certs use system-wide certificates (default=yes)],
enable_system_certs="$enableval",
enable_system_certs="yes")
AC_MSG_RESULT($enable_system_certs)
if test "$enable_system_certs" != "no"; then
AC_DEFINE(GWEN_TLS_USE_SYSTEM_CERTIFICATES, 1, [whether system-wide trusted certificates should be set])
fi
AM_CONDITIONAL(INSTALL_CERTS, [test "$enable_system_certs" = "no"])
###-------------------------------------------------------------------------
#
# check whether 'make check' should run checks that depend on network connectivity
#
AC_MSG_CHECKING(network connectivity can be assumed available during 'make check')
AC_ARG_ENABLE(network-checks,
[ --disable-network-checks disables checks that assume available network during build (default=enabled)],
enable_gwen_network_checks="$enableval",
enable_gwen_network_checks="yes")
AC_MSG_RESULT($enable_gwen_network_checks)
if test "$enable_gwen_network_checks" = "no"; then
AC_DEFINE(GWENHYWFAR_SKIP_NETWORK_CHECKS, 1, [whether to run network-dependent checks during build])
fi
###-------------------------------------------------------------------------
#
# check whether test code should be enabled
#
AC_MSG_CHECKING(whether to enable test code)
AC_ARG_ENABLE(testcode,
[ --enable-testcode allow compiling of test code (default=no)],
enable_testcode="$enableval",
enable_testcode="no")
AC_MSG_RESULT($enable_testcode)
if test "$enable_testcode" != "no"; then
AC_DEFINE(GWENHYWFAR_ENABLE_TESTCODE, 1, [whether to enable test code])
fi
###-------------------------------------------------------------------------
#
# check whether local installation mode is enabled
#
AC_MSG_CHECKING(whether local installation mode is wanted)
AC_ARG_ENABLE(local-install,
[ --enable-local-install allow local installation mode (default=no)],
enable_local_install="$enableval",
enable_local_install="no")
AC_MSG_RESULT($enable_local_install)
if test "$enable_local_install" != "no"; then
AC_DEFINE(ENABLE_LOCAL_INSTALL, 1, [whether local install is wanted])
fi
###-------------------------------------------------------------------------
#
# OS dependant settings
#
# Common settings for all OSs
gwenhywfar_bindir="\${bindir}"
gwenhywfar_libs="-lgwenhywfar"
gwenhywfar_ldflags="-L\${libdir}"
gwenhywfar_internal_libname="libgwenhywfar.la"
gwenhywfar_headerdir_am="\$(includedir)/gwenhywfar5"
gwenhywfar_headerdir="\${includedir}/gwenhywfar5"
gwenhywfar_plugindir="\${libdir}/gwenhywfar/plugins/${GWENHYWFAR_SO_EFFECTIVE}"
gwenhywfar_symlinkdir="\$(top_builddir)/gwenhywfar5"
gwenhywfar_datadir="\${datadir}/gwenhywfar"
gwenhywfar_sysdatadir="\${datadir}"
# Now the specific settings
case "$OS_TYPE" in
posix)
gwenhywfar_sys_is_windows=0
gwenhywfar_os_lib="os/posix/libos.la"
GWEN_OS="posix"
# add special libraries for solaris
if test "$OSYSTEM" = "solaris"; then
all_libraries="${all_libraries} -lresolv -lsocket"
PROG_LIBRARIES="${PROG_LIBRARIES} -lresolv -lsocket"
fi
# add special libraries for darwin
if test "$OSYSTEM" = "osx"; then
# hmm, this should be detected by the GETTEXT macro...
#PROG_LIBRARIES="${PROG_LIBRARIES} -lintl"
# for local install mode on Mac OS X link with the CoreFoundation framework
if test "$enable_local_install" != "no"; then
all_libraries="${all_libraries} -framework CoreFoundation"
fi
fi
gwenbuild_tool="gwenbuild"
;;
windows)
gwenhywfar_sys_is_windows=1
dnl ACX_WINDOWS_PATHS
gwenhywfar_os_lib="os/windows/libos.la"
GWEN_OS="windows"
all_libraries="${all_libraries} -lwsock32"
gwenbuild_tool=""
;;
*)
AC_MSG_ERROR(**** Unknown operating system type)
;;
esac
AM_CONDITIONAL(IS_WINDOWS, [test "$OS_TYPE" = "windows"])
AC_SUBST(gwenhywfar_sys_is_windows)
AC_SUBST(gwenbuild_tool)
dnl # Check for x86_64 architecture; potentially set lib-directory suffix
dnl if test "$target_cpu" = "x86_64"; then
dnl libdirsuffix="64"
dnl else
dnl libdirsuffix=""
dnl fi
dnl AC_DEFINE_UNQUOTED(LIBDIRSUFFIX, ["$libdirsuffix"], [Defined to the suffix string of the library directory])
dnl --- no longer needed since $libdir is used directly
###-------------------------------------------------------------------------
#
# check plugin search path
#
AC_MSG_CHECKING(plugin search dir)
AC_ARG_WITH(plugin-searchdir, [ --with-plugin-searchdir=DIR where to search for plugins],
[gwenhywfar_plugin_searchdir="$withval"],
[gwenhywfar_plugin_searchdir=""])
if test -z "${gwenhywfar_plugin_searchdir}"; then
if test "$OSYSTEM" = "windows"; then
gwenhywfar_plugin_searchdir="lib/gwenhywfar/plugins/${GWENHYWFAR_SO_EFFECTIVE}"
else
if test "$enable_local_install" != "no"; then
gwenhywfar_plugin_searchdir="lib/gwenhywfar/plugins/${GWENHYWFAR_SO_EFFECTIVE}"
else
gwenhywfar_plugin_searchdir="$gwenhywfar_plugindir"
fi
fi
fi
AC_SUBST(gwenhywfar_plugin_searchdir)
AC_MSG_RESULT($gwenhywfar_plugin_searchdir)
###-------------------------------------------------------------------------
#
# check data search dir
#
AC_MSG_CHECKING(data search dir)
AC_ARG_WITH(data-searchdir, [ --with-data-searchdir=DIR where to search for data files],
[gwenhywfar_data_searchdir="$withval"],
[gwenhywfar_data_searchdir=""])
if test -z "${gwenhywfar_data_searchdir}"; then
if test "$OSYSTEM" = "windows"; then
gwenhywfar_data_searchdir="share/gwenhywfar"
else
if test "$enable_local_install" != "no"; then
gwenhywfar_data_searchdir="share/gwenhywfar"
else
gwenhywfar_data_searchdir="$gwenhywfar_datadir"
fi
fi
fi
AC_SUBST(gwenhywfar_data_searchdir)
AC_MSG_RESULT($gwenhywfar_data_searchdir)
###-------------------------------------------------------------------------
#
# check system data search dir
#
AC_MSG_CHECKING(system data search dir)
AC_ARG_WITH(sysdata-searchdir, [ --with-sysdata-searchdir=DIR where to search for data files],
[gwenhywfar_sysdata_searchdir="$withval"],
[gwenhywfar_sysdata_searchdir=""])
if test -z "${gwenhywfar_sysdata_searchdir}"; then
if test "$OSYSTEM" = "windows"; then
gwenhywfar_sysdata_searchdir="share"
else
if test "$enable_local_install" != "no"; then
gwenhywfar_sysdata_searchdir="share"
else
gwenhywfar_sysdata_searchdir="$gwenhywfar_sysdatadir"
fi
fi
fi
AC_SUBST(gwenhywfar_sysdata_searchdir)
AC_MSG_RESULT($gwenhywfar_sysdata_searchdir)
###-------------------------------------------------------------------------
#
# check locale search dir
#
AC_MSG_CHECKING(locale search dir)
AC_ARG_WITH(locale-searchdir, [ --with-locale-searchdir=DIR where to search for locale files],
[gwenhywfar_locale_searchdir="$withval"],
[gwenhywfar_locale_searchdir=""])
if test -z "${gwenhywfar_locale_searchdir}"; then
if test "$OSYSTEM" = "windows"; then
gwenhywfar_locale_searchdir="share/locale"
else
if test "$enable_local_install" != "no"; then
gwenhywfar_locale_searchdir="share/locale"
else
gwenhywfar_locale_searchdir="\$(localedir)"
fi
fi
fi
AC_SUBST(gwenhywfar_locale_searchdir)
AC_MSG_RESULT($gwenhywfar_locale_searchdir)
###-------------------------------------------------------------------------
#
# check cfg search dir
#
AC_MSG_CHECKING(cfg search dir)
AC_ARG_WITH(cfg-searchdir, [ --with-cfg-searchdir=DIR where to search for cfg files],
[gwenhywfar_cfg_searchdir="$withval"],
[gwenhywfar_cfg_searchdir=""])
if test -z "$gwenhywfar_cfg_searchdir"; then
if test "$OSYSTEM" = "windows"; then
gwenhywfar_cfg_searchdir="etc"
else
if test "$enable_local_install" != "no"; then
gwenhywfar_cfg_searchdir="etc"
else
gwenhywfar_cfg_searchdir="\$(sysconfdir)"
fi
fi
fi
AC_SUBST(gwenhywfar_cfg_searchdir)
AC_MSG_RESULT($gwenhywfar_cfg_searchdir)
###-------------------------------------------------------------------------
#
# check whether variadic macros should be supported
#
AC_MSG_CHECKING(if compiling with variadic macros)
AC_ARG_ENABLE(variadic-macros,
[ --enable-variadic-macros enable variadic macros (default=yes)],
enable_variadic_macros="$enableval",
enable_variadic_macros="yes")
AC_MSG_RESULT($enable_variadic_macros)
if test "x$enable_variadic_macros" = "xno"; then
AC_DEFINE(NO_VARIADIC_MACROS, 1, [Define if variadic macros should be disabled])
fi
###-------------------------------------------------------------------------
#
# check whether profiling is to be supported
#
AC_MSG_CHECKING(if profiling is to be supported)
AC_ARG_ENABLE(profiling,
[ --enable-profiling enable profiling (default=no)],
enable_profiling="$enableval",
enable_profiling="no")
AC_MSG_RESULT($enable_profiling)
if test "x$enable_profiling" = "xyes"; then
PROFILING_CFLAGS="-pg"
PROFILING_LDFLAGS="-pg"
else
PROFILING_CFLAGS=""
PROFILING_LDFLAGS=""
fi
AC_SUBST(PROFILING_CFLAGS)
AC_SUBST(PROFILING_LDFLAGS)
###-------------------------------------------------------------------------
#
# check for Debian multiarch paths
#
AC_PATH_TOOL([DPKG_ARCH], [dpkg-architecture])
AC_MSG_CHECKING([for multiarch paths])
multiarch_triplet=""
DEBIAN_MULTIARCH_DIRS=""
if test -n "$DPKG_ARCH"; then
multiarch_triplet=$($DPKG_ARCH -qDEB_HOST_MULTIARCH 2> /dev/null)
if test -z "$multiarch_triplet"; then
multiarch_triplet=$($DPKG_ARCH -qDEB_HOST_GNU_TYPE)
fi
fi
if test -n "$multiarch_triplet"; then
DEBIAN_MULTIARCH_DIRS="/lib/$multiarch_triplet /usr/lib/$multiarch_triplet"
AC_MSG_RESULT([$DEBIAN_MULTIARCH_DIRS])
else
AC_MSG_RESULT([not found])
fi
###-------------------------------------------------------------------------
#
# check for libgcrypt
#
NEED_LIBGCRYPT_API=1
NEED_LIBGCRYPT_VERSION=1.2.0
AC_DEFINE_UNQUOTED(NEED_LIBGCRYPT_VERSION, "$NEED_LIBGCRYPT_VERSION",
[Required version of Libgcrypt])
case "$OS_TYPE" in
windows)
LIBGCRYPT_CFLAGS=""
LIBGCRYPT_LIBS="-lgcrypt"
AC_SUBST(LIBGCRYPT_CFLAGS)
AC_SUBST(LIBGCRYPT_LIBS)
;;
*)
AM_PATH_LIBGCRYPT("$NEED_LIBGCRYPT_API:$NEED_LIBGCRYPT_VERSION",
[have_gcrypt="yes"], [have_gcrypt="no"])
if test "$have_gcrypt" != "yes"; then
AC_MSG_ERROR([
**** Libgcrypt is required for Gwenhywfar. Please install it (including devel packages)
**** (at least version $NEED_LIBGCRYPT_VERSION using API $NEED_LIBGCRYPT_API is required.)])
fi
;;
esac
###-------------------------------------------------------------------------
#
# check for library for common error values and messages in GnuPG components
#
AM_PATH_GPG_ERROR
###-------------------------------------------------------------------------
#
# check for libgnutls
#
PKG_CHECK_MODULES([LIBGNUTLS], [gnutls >= 2.9.8])
###-------------------------------------------------------------------------
#
# check for OpenSSL
#
PKG_CHECK_MODULES([OPENSSL], [openssl], [ssl_available=yes], [ssl_available=no])
if test "$ssl_available" = "yes"; then
AC_DEFINE_UNQUOTED(HAVE_OPENSSL, 1, [Defined if OpenSSL is available])
fi
AM_CONDITIONAL(IF_HAVE_OPENSSL, [test "$ssl_available" = "yes"])
AC_SUBST(ssl_available)
###-------------------------------------------------------------------------
# check for Distribution
AQ_DISTRIBUTION
###-------------------------------------------------------------------------
#
# check for I18N
#
# check whether i18n files are to be created
AC_CHECK_PROG(XGETTEXT,xgettext,xgettext, missing)
MAKE_I18N_FILES="yes"
if test "$XGETTEXT" = "missing"; then
MAKE_I18N_FILES="no"
AC_MSG_WARN([xgettext is missing. Locale suport is disabled.])
fi
AC_PATH_PROG([MSGFMT], [msgfmt], [missing])
if test "$MSGFMT" = "missing"; then
MAKE_I18N_FILES="no"
AC_MSG_WARN([msgfmt is missing. Locale suport is disabled.])
fi
AC_SUBST(MAKE_I18N_FILES)
AM_CONDITIONAL(IF_MAKE_I18N_FILES, [test "$MAKE_I18N_FILES" = "yes"])
## then check whether i18n support is to be compiled in
#i18n_libs=""
#HAVE_I18N="yes"
#AC_CHECK_HEADERS([locale.h libintl.h], [], [HAVE_I18N="no"])
#if test "$OS_TYPE" != "windows"; then
# oldlibs="$LIBS"
# LIBS=""
# AC_SEARCH_LIBS(libintl_bindtextdomain, intl, [], [HAVE_I18N="no"])
# i18n_libs="$LIBS"
# LIBS="$oldlibs"
#else
# if test "$HAVE_I18N" != "no"; then
# i18n_libs="-lintl"
# all_libraries="${all_libraries} -lintl"
# fi
#fi
#
#if test "$HAVE_I18N" != "no"; then
# AC_DEFINE_UNQUOTED(HAVE_I18N, 1, [whether I18N is available])
#fi
#
#AC_SUBST(HAVE_I18N)
#AC_SUBST(i18n_libs)
AM_GNU_GETTEXT([external])
i18n_libs="$LTLIBINTL"
all_libraries="${all_libraries} $LTLIBINTL"
HAVE_I18N="$USE_NLS"
if test "$HAVE_I18N" != "no"; then
AC_DEFINE_UNQUOTED(HAVE_I18N, 1, [whether I18N is available])
fi
AC_SUBST(i18n_libs)
AC_SUBST(HAVE_I18N)
###-------------------------------------------------------------------------
#
# check for iconv
#
AC_ARG_WITH(iconv, [ --with-iconv=PATH take iconv from PATH],
[ICONV_DIR="$withval"],
[ICONV_DIR="/usr"])
if test "$ICONV_DIR" = "no" ; then
echo Disabling ICONV support
else
if test "$with_iconv" != "yes" -a "$with_iconv" != "" ; then
CPPFLAGS="${CPPFLAGS} -I$with_iconv/include"
# Export this since our headers include iconv.h
ICONV_INCLUDES="-I$ICONV_DIR/include"
ICONV_LIBS="-L$ICONV_DIR/lib"
fi
AC_CHECK_HEADER(iconv.h,
AC_MSG_CHECKING(for iconv)
AC_TRY_LINK([#include <stdlib.h>
#include <iconv.h>],[
iconv_t cd = iconv_open ("","");
iconv (cd, NULL, NULL, NULL, NULL);],[
AC_MSG_RESULT(yes)
WITH_ICONV=1],[
AC_MSG_RESULT(no)
AC_MSG_CHECKING(for iconv in -liconv)
_ldflags="${LDFLAGS}"
_libs="${LIBS}"
LDFLAGS="${LDFLAGS} ${ICONV_LIBS}"
LIBS="${LIBS} -liconv"
AC_TRY_LINK([#include <stdlib.h>
#include <iconv.h>],[
iconv_t cd = iconv_open ("","");
iconv (cd, NULL, NULL, NULL, NULL);],[
AC_MSG_RESULT(yes)
WITH_ICONV=1
ICONV_LIBS="${ICONV_LIBS} -liconv"
LIBS="${_libs}"
LDFLAGS="${_ldflags}"],[
AC_MSG_RESULT(no)
LIBS="${_libs}"
LDFLAGS="${_ldflags}"])]))
fi
AC_DEFINE_UNQUOTED(HAVE_ICONV, $WITH_ICONV, [Defined if libiconv is available])
AC_SUBST(WITH_ICONV)
AC_SUBST(ICONV_LIBS)
###-------------------------------------------------------------------------
#
# guis
#
AC_ARG_WITH(guis,
[ --with-guis=list space separated list of GUI implementations (default:all)],
[gwenhywfar_guis="$withval"],
[gwenhywfar_guis="qt5 gtk3"]
)
if test "$gwenhywfar_guis" = "none"; then
gwenhywfar_guis=""
fi
if test "$gwenhywfar_guis" = "yes"; then
gwenhywfar_guis=""
fi
AC_SUBST(gwenhywfar_guis)
###-------------------------------------------------------------------------
# Check for fox toolkit
#
case "$gwenhywfar_guis" in
*fox16*)
AQ_CHECK_FOX
if test "$have_fox" != "yes"; then
AC_MSG_ERROR([
**** FOX Toolkit missing.
**** If you want to use the FOX-GUI you will have to install the package
**** libfox-1.6 and libfox-1.6-devel on Debian-like systems.
**** On RPM systems like SuSE those packages might have different names.
**** If you don't need the FOX-GUI you might want to use the option
**** --with-guis])
fi
AC_DEFINE(BUILD_GUI_FOX16, 1, [if gwen gui for fox16 is built])
with_gui_fox16="yes"
;;
esac
AC_SUBST(with_gui_fox16)
AM_CONDITIONAL(WITH_GUI_FOX16, [test "$with_gui_fox16" = "yes"])
###-------------------------------------------------------------------------
# Check for GTK+
#
case "$gwenhywfar_guis" in
*gtk2*)
# We need at least GTK 2.17.5 because we use functions like
# gtk_widget_get_sensitive() and gtk_widget_has_focus()
pkg_modules="gtk+-2.0 >= 2.17.5"
dnl $4=true => don't die in case of failure.
PKG_CHECK_MODULES(GTK2, [$pkg_modules], [], true)
AC_DEFINE(BUILD_GUI_GTK2, 1, [if gwen gui for gtk2 is built])
with_gui_gtk2="yes"
;;
esac
AC_SUBST(with_gui_gtk2)
AM_CONDITIONAL(WITH_GUI_GTK2, [test "$with_gui_gtk2" = "yes"])
###-------------------------------------------------------------------------
# Check for GTK+
#
case "$gwenhywfar_guis" in
*gtk3*)
# Minimum required gtk3 version
pkg_modules="gtk+-3.0 >= 3.10.8"
PKG_CHECK_MODULES(GTK3, [$pkg_modules])
AC_DEFINE(BUILD_GUI_GTK3, 1, [if gwen gui for gtk3 is built])
with_gui_gtk3="yes"
;;
esac
AC_SUBST(with_gui_gtk3)
AM_CONDITIONAL(WITH_GUI_GTK3, [test "$with_gui_gtk3" = "yes"])
###-------------------------------------------------------------------------
#
# check whether libXML2 code is to be compiled
#
AC_MSG_CHECKING(libXML2-depending code)
AC_ARG_WITH(libxml2-code, [ --with-libxml2-code=yes compile libXML2-depending code],
[gwen_with_libxml2_code="$withval"],
[gwen_with_libxml2_code="no"])
AC_MSG_RESULT($gwen_with_libxml2_code)
AM_CONDITIONAL(WITH_LIBXML2_CODE, [test "$gwen_with_libxml2_code" = "yes"])
###-------------------------------------------------------------------------
#
# Check for libxml
#
if test "$gwen_with_libxml2_code" = "yes"; then
AC_DEFINE(GWEN_COMPILE_LIBXML2_CODE, 1, [if libxml2-code is wanted])
PKG_CHECK_MODULES(LIBXML, [libxml-2.0])
fi
###-------------------------------------------------------------------------
#
# QT4
#
UIC4="NO"
QT4_BINDIR=""
case "$gwenhywfar_guis" in
*qt4*)
AQ_CHECK_QT4
if test "$have_qt4" = "yes"; then
# Define this macro to disable the cast from QString to const char
# which implicitly uses latin1()!
AC_DEFINE(QT_NO_ASCII_CAST,[1],[Disable the cast from QString to const char.])
fi
dnl windows/mingw doesnt have the yes program, so add this emulation
AC_CHECK_PROG(YES, yes, yes, [[echo -e 'y\ny\ny\ny\n']])
dnl Store the bin dir for the windows dlls
QT4_BINDIR="` echo ${qt4_moc} | ${SED} 's-/moc--' | ${SED} 's-/c/-c:\\\\-' | ${SED} 's-/-\\\\-g' `"
UIC4="${qt4_uic}"
AC_DEFINE(BUILD_GUI_QT4, 1, [if gwen gui for qt4 is built])
with_gui_qt4="yes"
;;
*)
;;
esac
dnl Store the bin dir for the windows dlls
AC_SUBST(QT4_BINDIR)
AC_SUBST(with_gui_qt4)
AM_CONDITIONAL(WITH_GUI_QT4, [test "$with_gui_qt4" = "yes"])
###-------------------------------------------------------------------------
#
# QT5
#
case "$gwenhywfar_guis" in