forked from FirebirdSQL/firebird
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
1694 lines (1505 loc) · 52 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
dnl ############################# INITIALISATION ###############################
AC_PREREQ([2.67])
AC_INIT
AC_CONFIG_SRCDIR([src])
AC_CONFIG_AUX_DIR(builds/make.new/config)
AC_CACHE_VAL(ac_cv_prog_make_set, [AC_PROG_MAKE_SET])
AC_PREFIX_DEFAULT(/usr/local/firebird)
m4_ifdef([AC_CONFIG_MACRO_DIR],
[],
[m4_define([AC_CONFIG_MACRO_DIR], [])])
AC_CONFIG_MACRO_DIR(m4)
AC_CONFIG_HEADER(src/include/gen/autoconfig.auto:builds/make.new/config/config.h.in)
dnl XE_APPEND(value, varname)
define([XE_APPEND],[[$2]="$[$2] [$1]"])
dnl XE_PREPEND(value, varname)
define([XE_PREPEND],[[$2]="[$1] $[$2]"])
CHANGE_PATH_SUPPORT=yes
dnl XE_CONF_DIR(param, help, variable, default)
define([XE_CONF_DIR],[
AC_ARG_WITH([$1],
[AS_HELP_STRING([--with-$1],[$2])],
[
case "$withval" in
/*)
CHANGE_PATH_SUPPORT=no
[$3]="$withval"
;;
*)
[$3]='${fb_install_prefix}'/"${withval}"
;;
esac
AC_DEFINE_UNQUOTED([$3], "${withval}", [$2])
],
[[$3]='${fb_install_prefix}[$4]'
AC_DEFINE_UNQUOTED([$3], [""], [$2])]
)
AC_SUBST([$3])
])
define([XE_CONF_FILE],[
AC_ARG_WITH([$1],
[AS_HELP_STRING([--with-$1],[$2])],
[[$3]="$withval"
AC_DEFINE_UNQUOTED([$3], "$[$3]", [$2])],
[[$3]="$4"
AC_DEFINE_UNQUOTED([$3], ["$4"], [$2])]
)
AC_SUBST([$3])
])
define([XE_SAVE_ENV], [
pre_save_restore_cflags=$CFLAGS
pre_save_restore_cxxflags=$CXXFLAGS
pre_save_restore_libs=$LIBS
])
define([XE_RESTORE_ENV], [
CFLAGS=$pre_save_restore_cflags
CXXFLAGS=$pre_save_restore_cxxflags
LIBS=$pre_save_restore_libs
])
sinclude(acx_pthread.m4)
sinclude(binreloc.m4)
dnl ############################# ADD TESTS BELOW ##############################
AC_CANONICAL_BUILD
CPU_TYPE=$build_cpu
AC_SUBST(CPU_TYPE)
case "$build" in
aarch64-*-darwin*)
VCPKG_TRIPLET=fb-arm64-osx
;;
x*64-*-darwin*)
VCPKG_TRIPLET=fb-x64-osx
;;
esac
if test "x$VCPKG_TRIPLET" != "x" ; then
if ! test -f ./vcpkg/vcpkg; then
./vcpkg/bootstrap-vcpkg.sh -disableMetrics
fi
./vcpkg/vcpkg install --triplet=$VCPKG_TRIPLET
VCPKG_INSTALLED=`pwd`/vcpkg_installed/$VCPKG_TRIPLET
AC_SUBST(VCPKG_INSTALLED)
fi
dnl EKU: set appropiate defaults for each platform
dnl EDITLINE_FLG : support fancy command line editing in isql
dnl SHRLIB_EXT : suffix of shared library files
RAW_DEVICES_FLG=Y
EXPORT_SYMBOLS_STYLE=linux
INSTALL_PREFIX=""
dnl Use /usr/lib for library links on most platforms except some 64-bit ones
libdir=/usr/lib
dnl Should system editline be used
STD_EDITLINE=false
dnl Test for special ar options?
AR_OPT_CHECK=false
case "$build" in
aarch64-*-darwin*)
MAKEFILE_PREFIX=darwin_aarch64
MAKEFILE_POSTFIX=darwin
PLATFORM=DARWIN
INSTALL_PREFIX=darwin
AC_DEFINE(DARWIN, 1, [Define this if OS is DARWIN])
XE_APPEND(-framework CoreFoundation,LIBS)
EDITLINE_FLG=Y
SHRLIB_EXT=dylib
CPU_TYPE=arm64
EXPORT_SYMBOLS_STYLE=darwin
RAW_DEVICES_FLG=N
;;
x*64-*-darwin*)
MAKEFILE_PREFIX=darwin_x86_64
MAKEFILE_POSTFIX=darwin
PLATFORM=DARWIN
INSTALL_PREFIX=darwin
AC_DEFINE(DARWIN, 1, [Define this if OS is DARWIN])
XE_APPEND(-framework CoreFoundation,LIBS)
EDITLINE_FLG=Y
SHRLIB_EXT=dylib
CPU_TYPE=x64
EXPORT_SYMBOLS_STYLE=darwin
RAW_DEVICES_FLG=N
;;
i*86-*-darwin*)
MAKEFILE_PREFIX=darwin_i386
MAKEFILE_POSTFIX=darwin
PLATFORM=DARWIN
INSTALL_PREFIX=darwin
AC_DEFINE(DARWIN, 1, [Define this if OS is DARWIN])
XE_APPEND(-framework CoreFoundation,LIBS)
EDITLINE_FLG=Y
SHRLIB_EXT=dylib
CPU_TYPE=x86
EXPORT_SYMBOLS_STYLE=darwin
;;
powerpc-*-darwin*)
MAKEFILE_PREFIX=darwin_powerpc
dnl MAKEFILE_PREFIX=darwin_ppc64
MAKEFILE_POSTFIX=darwin
PLATFORM=DARWIN
INSTALL_PREFIX=darwin
AC_DEFINE(DARWIN, 1, [Define this if OS is DARWIN])
XE_APPEND(-framework CoreFoundation,LIBS)
EDITLINE_FLG=Y
SHRLIB_EXT=dylib
dnl CPU_TYPE=ppc64
EXPORT_SYMBOLS_STYLE=darwin
;;
powerpc-*-aix*)
dnl ibm xlC has many invocations, like xlC, xlc++, or xlc_r7
comp=`echo "$CXX" | cut -c1-3 | dd conv=lcase 2>/dev/null`
if test "$comp" = "xlc"; then
AR_OPT_CHECK=true
TLS_OPTIONS="-qtls=default"
MAKEFILE_PREFIX=aix_powerpc_xlc
else
MAKEFILE_PREFIX=aix_powerpc
fi
MAKEFILE_POSTFIX=aix
PLATFORM=AIX
INSTALL_PREFIX=aix
AC_DEFINE(AIX, 1, [Define this if OS is AIX])
EDITLINE_FLG=N
SHRLIB_EXT=so
EXPORT_SYMBOLS_STYLE=aix
;;
amd64-*-freebsd* | x86_64*-*-freebsd* | x86_64*-*-k*bsd*-gnu)
MAKEFILE_PREFIX=freebsd_amd64
case "$build" in
x86_64*-*-k*bsd-gnu) # Debian/kFreeBSD
PLATFORM=GENTOOFREEBSD
INSTALL_PREFIX=linux
;;
*)
PLATFORM=FREEBSD
INSTALL_PREFIX=freebsd
;;
esac
AC_DEFINE(FREEBSD, 1, [Define this if OS is FreeBSD])
AC_DEFINE(AMD64, 1, [Define this if CPU is amd64])
EDITLINE_FLG=Y
SHRLIB_EXT=so
;;
powerpc64le-*-freebsd*)
MAKEFILE_PREFIX=freebsd_powerpc64el
PLATFORM=FREEBSD
INSTALL_PREFIX=freebsd
AC_DEFINE(FREEBSD, 1, [Define this if OS is FreeBSD])
AC_DEFINE(PPC64EL, 1, [Define this if CPU is ppc64el])
EDITLINE_FLG=Y
SHRLIB_EXT=so
;;
powerpc64-*-freebsd*)
MAKEFILE_PREFIX=freebsd_powerpc64
PLATFORM=FREEBSD
INSTALL_PREFIX=freebsd
AC_DEFINE(FREEBSD, 1, [Define this if OS is FreeBSD])
AC_DEFINE(PPC64, 1, [Define this if CPU is ppc64])
EDITLINE_FLG=Y
SHRLIB_EXT=so
;;
powerpc-*-freebsd*)
MAKEFILE_PREFIX=freebsd_powerpc
PLATFORM=FREEBSD
INSTALL_PREFIX=freebsd
AC_DEFINE(FREEBSD, 1, [Define this if OS is FreeBSD])
AC_DEFINE(PPC, 1, [Define this if CPU is ppc])
EDITLINE_FLG=Y
SHRLIB_EXT=so
;;
*-gentoo-freebsd*)
MAKEFILE_PREFIX=freebsd
PLATFORM=GENTOOFREEBSD
AC_DEFINE(FREEBSD, 1, [Define this if OS is FreeBSD])
EDITLINE_FLG=Y
SHRLIB_EXT=so
;;
*-*-freebsd* | *-*-k*bsd*-gnu)
MAKEFILE_PREFIX=freebsd
case "$build" in
*-*-k*bsd-gnu) # Debian/kFreeBSD
PLATFORM=GENTOOFREEBSD
INSTALL_PREFIX=linux
;;
*)
PLATFORM=FREEBSD
;;
esac
AC_DEFINE(FREEBSD, 1, [Define this if OS is FreeBSD])
EDITLINE_FLG=Y
SHRLIB_EXT=so
;;
mips-*-linux*)
MAKEFILE_PREFIX=linux_mips
INSTALL_PREFIX=linux
PLATFORM=LINUX
AC_DEFINE(LINUX)
EDITLINE_FLG=Y
SHRLIB_EXT=so
;;
mipsel-*-linux*)
MAKEFILE_PREFIX=linux_mipsel
INSTALL_PREFIX=linux
PLATFORM=LINUX
AC_DEFINE(LINUX)
EDITLINE_FLG=Y
SHRLIB_EXT=so
;;
mips64el-*-linux* | mips*64*el-*-linux*)
MAKEFILE_PREFIX=linux_mips64el
INSTALL_PREFIX=linux
PLATFORM=LINUX
AC_DEFINE(LINUX)
EDITLINE_FLG=Y
SHRLIB_EXT=so
;;
x86_64*-*-linux* | x86_64*-*-gnu*)
MAKEFILE_PREFIX=linux_amd64
INSTALL_PREFIX=linux
PLATFORM=LINUX
AC_DEFINE(LINUX, 1, [Define this if OS is Linux])
EDITLINE_FLG=Y
SHRLIB_EXT=so
libdir=/usr/lib64
CPU_TYPE=x64
;;
ia64*-*-linux*)
MAKEFILE_PREFIX=linux_ia64
INSTALL_PREFIX=linux
PLATFORM=LINUX
AC_DEFINE(LINUX, 1, [Define this if OS is Linux])
EDITLINE_FLG=Y
SHRLIB_EXT=so
libdir=/usr/lib
CPU_TYPE=ia64
;;
arm*-*-linux*)
MAKEFILE_PREFIX=linux_arm
INSTALL_PREFIX=linux
PLATFORM=LINUX
AC_DEFINE(LINUX, 1, [Define this if OS is Linux])
EDITLINE_FLG=Y
SHRLIB_EXT=so
CPU_TYPE=arm32
STD_EDITLINE=true
;;
aarch64*-*-linux*)
MAKEFILE_PREFIX=linux_arm64
INSTALL_PREFIX=linux
PLATFORM=LINUX
AC_DEFINE(LINUX, 1, [Define this if OS is Linux])
EDITLINE_FLG=Y
SHRLIB_EXT=so
CPU_TYPE=arm64
STD_EDITLINE=true
STD_ICU=true
libdir=/usr/lib64
;;
loongarch*-*-linux*)
MAKEFILE_PREFIX=linux_loongarch
INSTALL_PREFIX=linux
PLATFORM=LINUX
AC_DEFINE(LINUX, 1, [Define this if OS is Linux])
EDITLINE_FLG=Y
SHRLIB_EXT=so
STD_EDITLINE=true
STD_ICU=true
libdir=/usr/lib64
;;
riscv64*-*-linux*)
MAKEFILE_PREFIX=linux_riscv64
INSTALL_PREFIX=linux
PLATFORM=LINUX
AC_DEFINE(LINUX, 1, [Define this if OS is Linux])
EDITLINE_FLG=Y
SHRLIB_EXT=so
STD_EDITLINE=true
STD_ICU=true
libdir=/usr/lib64
;;
powerpc64le-*-linux*)
MAKEFILE_PREFIX=linux_powerpc64el
INSTALL_PREFIX=linux
PLATFORM=LINUX
AC_DEFINE(LINUX, 1, [Define this if OS is Linux])
EDITLINE_FLG=Y
SHRLIB_EXT=so
STD_EDITLINE=true
STD_ICU=true
libdir=/usr/lib64
;;
powerpc64-*-linux*)
MAKEFILE_PREFIX=linux_powerpc64
INSTALL_PREFIX=linux
PLATFORM=LINUX
AC_DEFINE(LINUX, 1, [Define this if OS is Linux])
EDITLINE_FLG=Y
SHRLIB_EXT=so
STD_EDITLINE=true
STD_ICU=true
libdir=/usr/lib64
;;
sparc*-*-linux* | sparc*-*-gnu* | sparc*-*-k*bsd*-gnu)
MAKEFILE_PREFIX=linux_sparc32
INSTALL_PREFIX=linux
PLATFORM=LINUX
AC_DEFINE(LINUX, 1, [Define this if OS is Linux])
EDITLINE_FLG=Y
SHRLIB_EXT=so
;;
powerpc*-*-linux*)
MAKEFILE_PREFIX=linux_powerpc
INSTALL_PREFIX=linux
PLATFORM=LINUX
AC_DEFINE(LINUX, 1, [Define this if OS is Linux])
EDITLINE_FLG=Y
SHRLIB_EXT=so
;;
i*86*-*-linux*)
MAKEFILE_PREFIX=linux
PLATFORM=LINUX
AC_DEFINE(LINUX)
EDITLINE_FLG=Y
SHRLIB_EXT=so
CPU_TYPE=x86
;;
s390x-*-linux*)
MAKEFILE_PREFIX=linux_s390x
INSTALL_PREFIX=linux
PLATFORM=LINUX
AC_DEFINE(LINUX, 1, [Define this if OS is Linux])
EDITLINE_FLG=Y
SHRLIB_EXT=so
libdir=/usr/lib64
;;
s390*-*-linux*)
MAKEFILE_PREFIX=linux_s390x
INSTALL_PREFIX=linux
PLATFORM=LINUX
AC_DEFINE(LINUX, 1, [Define this if OS is Linux])
EDITLINE_FLG=Y
SHRLIB_EXT=so
;;
sh*eb-*-linux*)
MAKEFILE_PREFIX=linux_generic
INSTALL_PREFIX=linux
PLATFORM=LINUX
AC_DEFINE(LINUX, 1, [Define this if OS is Linux])
AC_DEFINE(SHEB, 1, [Architecture is big-edian sh4])
LOCK_MANAGER_FLG=Y
EDITLINE_FLG=Y
SHRLIB_EXT=so
;;
sh*-*-linux*)
MAKEFILE_PREFIX=linux_generic
INSTALL_PREFIX=linux
PLATFORM=LINUX
AC_DEFINE(LINUX, 1, [Define this if OS is Linux])
AC_DEFINE(SH, 1, [Architecture is little-endian sh4])
LOCK_MANAGER_FLG=Y
EDITLINE_FLG=Y
SHRLIB_EXT=so
;;
hppa*-*-linux*)
MAKEFILE_PREFIX=linux_generic
INSTALL_PREFIX=linux
PLATFORM=LINUX
AC_DEFINE(LINUX, 1, [Define this if OS is Linux])
AC_DEFINE(HPPA, 1, [Define this if CPU is HPPA])
LOCK_MANAGER_FLG=Y
EDITLINE_FLG=Y
SHRLIB_EXT=so
;;
alpha*-*-linux*)
MAKEFILE_PREFIX=linux_generic
INSTALL_PREFIX=linux
PLATFORM=LINUX
AC_DEFINE(LINUX, 1, [Define this if OS is Linux])
AC_DEFINE(ALPHA, 1, [Define this if CPU is Alpha])
LOCK_MANAGER_FLG=Y
EDITLINE_FLG=Y
SHRLIB_EXT=so
;;
m68k*-*-linux*)
MAKEFILE_PREFIX=linux_generic
INSTALL_PREFIX=linux
PLATFORM=LINUX
AC_DEFINE(LINUX, 1, [Define this if OS is Linux])
AC_DEFINE(M68K, 1, [Define this if CPU is M68k])
LOCK_MANAGER_FLG=Y
EDITLINE_FLG=Y
SHRLIB_EXT=so
;;
*-*-linux* | *-*-gnu*)
MAKEFILE_PREFIX=linux_generic
INSTALL_PREFIX=linux
PLATFORM=LINUX
AC_DEFINE(LINUX, 1, [Define this if OS is Linux])
EDITLINE_FLG=Y
SHRLIB_EXT=so
;;
*-*-netbsd*)
MAKEFILE_PREFIX=netbsd
PLATFORM=NETBSD
AC_DEFINE(NETBSD, 1, [Define this if OS is NetBSD])
EDITLINE_FLG=Y
SHRLIB_EXT=so
;;
ia64-*-hpux*)
comp=`echo "$CXX" | cut -c1-3`
case $comp in
aCC) MAKEFILE_PREFIX=hpux_aCC ;
PTHREAD_CFLAGS=-mt
;;
*) MAKEFILE_PREFIX=hpux_ia64 ;
;;
esac
INSTALL_PREFIX=hpux
PLATFORM=HPUX
AC_DEFINE(HPUX, 1, [Define this if OS is HP-UX])
EDITLINE_FLG=Y
SHRLIB_EXT=so
libdir=/usr/lib/pa20_64
EXPORT_SYMBOLS_STYLE=hpux
;;
hppa*-*-hpux*)
comp=`echo "$CXX" | cut -c1-3`
case $comp in
aCC) MAKEFILE_PREFIX=hpux_aCC ;
PTHREAD_CFLAGS=-mt
;;
*) MAKEFILE_PREFIX=hpux ;
;;
esac
INSTALL_PREFIX=hpux
PLATFORM=HPUX
AC_DEFINE(HPUX, 1, [Define this if OS is HP-UX])
EDITLINE_FLG=Y
SHRLIB_EXT=sl
libdir=/usr/lib/pa20_64
EXPORT_SYMBOLS_STYLE=hpux
;;
i386-pc-solaris*)
dnl detect native compiler, Sun Studio Pro
comp=`echo "$CXX" | cut -c1-2`
case $comp in
CC) MAKEFILE_PREFIX=solaris
PTHREAD_CFLAGS=-mt
PTHREAD_LIBS=-lpthread
;;
*) MAKEFILE_PREFIX=solx86gcc ;
PTHREAD_CFLAGS=-pthreads ;;
esac
dnl if this is amd64 system, we should install our libraries in /usr/lib/amd64
isa=`isainfo -k`
if test "$isa" = "amd64"; then
libdir=/usr/lib/amd64
fi
CAS_OPTIONS=`pwd`"/src/common/classes/fb_cas_sax.il";
INSTALL_PREFIX=solaris
PLATFORM=solx86
AC_DEFINE(solx86, 1, [Define this if OS is Solarix x86])
EDITLINE_FLG=Y
SHRLIB_EXT=so
;;
sparc-sun-solaris*)
dnl detect native compiler, Sun Studio Pro
comp=`echo "$CXX" | cut -c1-3`
case $comp in
CC)
MAKEFILE_PREFIX=solaris
PTHREAD_CFLAGS=-mt
PTHREAD_LIBS=-lpthread
;;
*)
MAKEFILE_PREFIX=solaris-64gcc
;;
esac
CAS_OPTIONS=`pwd`"/src/common/classes/fb_cas.il";
INSTALL_PREFIX=solaris
PLATFORM=SOLARIS
AC_DEFINE(SOLARIS, 1, [Define this if OS is Solaris Sparc])
EDITLINE_FLG=Y
SHRLIB_EXT=so
;;
*-*-mingw*)
MAKEFILE_PREFIX=mingw
PLATFORM=win32
AC_DEFINE(WIN_NT, 1, [Define this if OS is Windows NT])
AC_DEFINE(HAVE_MULTI_THREAD, 1, [Define this if multi-threading should be supported])
EDITLINE_FLG=N
RAW_DEVICES_FLG=N
SHRLIB_EXT=dll
;;
*)
AC_MSG_ERROR(unsupported platform ${build})
;;
esac
if test "$INSTALL_PREFIX" = ""; then
INSTALL_PREFIX=$MAKEFILE_PREFIX
fi
AM_BINRELOC
if test -z "$BINRELOC_CFLAGS"
then
CHANGE_PATH_SUPPORT=no
fi
AC_SUBST(MAKEFILE_PREFIX)
AC_SUBST(AR_OPTIONS)
AC_SUBST(PLATFORM)
AC_SUBST(SHRLIB_EXT)
AC_DEFINE_UNQUOTED(SHRLIB_EXT, "$SHRLIB_EXT", [Extension for shared libraries])
AC_DEFINE(CASE_SENSITIVITY, true, [Define this if paths are case sensitive])
dnl Some controllable options
AC_ARG_ENABLE(developer,
[ --enable-developer use developer mode rules (default=no)],
[case "$enableval" in
yes) DEVEL_FLG=Y;;
no) DEVEL_FLG=N;;
*) AC_MSG_ERROR(bad value '${enableval}' for --enable-developer);;
esac])
AC_SUBST(DEVEL_FLG)
CLIENT_ONLY_FLG=N
AC_ARG_ENABLE(client-only,
[ --enable-client-only use client-only mode rules (default=no)],
[case "$enableval" in
yes) CLIENT_ONLY_FLG=Y;;
no) CLIENT_ONLY_FLG=N;;
*) AC_MSG_ERROR(bad value '${enableval}' for --enable-client-only);;
esac])
AC_SUBST(CLIENT_ONLY_FLG)
CROSS=
IS_CROSS=N
AC_ARG_WITH(cross-build,
[ --with-cross-build build for platform different from current one],
[CROSS=${withval}
IS_CROSS=Y])
AC_SUBST(IS_CROSS)
TOMMATH_BUILD=N
AC_ARG_WITH(builtin-tommath,
[ --with-builtin-tommath build libtommath library from firebird tree],
[TOMMATH_BUILD=Y])
AC_SUBST(TOMMATH_BUILD)
WITH_TOMCRYPT=Y
AC_ARG_WITH(tomcrypt,
[ --without-tomcrypt do not use libtomcrypt (allowed with --enable-client-only)],
[case "$withval" in
yes) WITH_TOMCRYPT=Y;;
no) WITH_TOMCRYPT=N;;
*) AC_MSG_ERROR(bad value '${withval}' for --with-tomcrypt);;
esac])
AC_SUBST(WITH_TOMCRYPT)
TOMCRYPT_BUILD=N
AC_ARG_WITH(builtin-tomcrypt,
[ --with-builtin-tomcrypt build libtomcrypt library from firebird tree],
[TOMCRYPT_BUILD=Y])
AC_SUBST(TOMCRYPT_BUILD)
TERMLIB=
AC_ARG_WITH(termlib,
[ --with-termlib build with explicitly specified termcap support library],
[TERMLIB=${withval}])
RE2_BUILD=Y
AC_ARG_WITH(system-re2,
[ --with-system-re2 use system-wide re2 library instead of embedded copy],
[RE2_BUILD=N])
AC_SUBST(RE2_BUILD)
dnl This is currently used for internal and public (API headers) needs
SYSTEM_BOOST=N
AC_ARG_WITH(system-boost,
[ --with-system-boost use system-wide boost library instead of embedded copy],
[SYSTEM_BOOST=Y])
AC_SUBST(SYSTEM_BOOST)
ATOMICLIB=atomic
AC_ARG_WITH(atomiclib,
[ --with-atomiclib build with explicitly specified atomic support library],
[ATOMICLIB=${withval}])
dnl Avoid dumb '-g -O2' autoconf's default
dnl Debugging information and optimization flags should be set in prefix.$platform file
dnl Should be replaced with AC_PROG_GCC_DEFAULT_FLAGS() when available
if test "$CFLAGS" = "-g -O2" -o "$CFLAGS" = "-g" -o "$CFLAGS" = "-O2"; then
CFLAGS=
fi
dnl Find out how to use threads on this platform
XE_SAVE_ENV()
ACX_PTHREAD([
AC_DEFINE(HAVE_MULTI_THREAD, 1,
[Define this if multi-threading should be supported])])
XE_RESTORE_ENV()
AC_SUBST(PTHREAD_LIBS)
AC_SUBST(PTHREAD_CFLAGS)
dnl Later we always build threaded binaries
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS"
LIBS="$LIBS $PTHREAD_LIBS"
case "$build" in
*-*-darwin*)
CFLAGS="$CFLAGS -I${VCPKG_INSTALLED}/include"
CXXFLAGS="$CXXFLAGS -nostdinc++ -isystem ${VCPKG_INSTALLED}/include/c++/v1 -I${VCPKG_INSTALLED}/include"
LDFLAGS="$LDFLAGS -nostdlib++ -stdlib=libc++ -L${VCPKG_INSTALLED}/lib -lc++"
;;
esac
AC_ARG_ENABLE(raw-devices,
[ --enable-raw-devices enable databases on raw devices (default on POSIX)],
[case "$enableval" in
yes) RAW_DEVICES_FLG=Y;;
no) RAW_DEVICES_FLG=N;;
*) AC_MSG_ERROR(bad value '${enableval}' for --enable-raw-devices);;
esac])
if test "$RAW_DEVICES_FLG" = "Y"; then
AC_DEFINE(SUPPORT_RAW_DEVICES, 1,
[Define this if databases on raw devices should be supported])
fi
AC_ARG_ENABLE(rpath,
[ --enable-rpath enable linking with RPATH (default)],
[],
[enable_rpath=yes])
if test "x$enable_rpath" != "xno" || test "x$enable_rpath" = "x" ; then
AC_SUBST(USE_RPATH, 1)
fi
LSB_FLG=N
AC_ARG_ENABLE(lsb-build,
[ --enable-lsb-build build LSB-compliant binaries (default=no)],
[case "$enableval" in
yes) LSB_FLG=Y;;
no) LSB_FLG=N;;
*) AC_MSG_ERROR(bad value '${enableval}' for --enable-lsb-build);;
esac])
AC_SUBST(LSB_FLG)
if test "$LSB_FLG" = "Y"; then
CFLAGS="$CFLAGS --lsb-besteffort --lsb-shared-libs=fbclient:ib_util:tommath:tomcrypt --lsb-target-version=4.1"
CXXFLAGS="$CXXFLAGS --lsb-besteffort --lsb-shared-libs=fbclient:ib_util:tommath:tomcrypt --lsb-target-version=4.1"
AC_SUBST(TOMMATH_BUILD, Y)
AC_SUBST(TOMCRYPT_BUILD, Y)
AC_SUBST(RE2_BUILD, Y)
AC_SUBST(SYSTEM_BOOST, N)
AC_PATH_PROG(CC, lsbcc, "", [$PATH$PATH_SEPARATOR/opt/lsb/bin$PATH_SEPARATOR])
AC_PATH_PROG(CXX, lsbc++, "", [$PATH$PATH_SEPARATOR/opt/lsb/bin$PATH_SEPARATOR])
if test "x$CC" = "x" || test "x$CXX" = "x" ; then
AC_MSG_ERROR(Can not find LSB compilers in /opt/lsb/bin)
fi
fi
AC_ARG_WITH(editline,
[ --with-editline support fancy command line editing],
[case "$withval" in
yes) EDITLINE_FLG=Y;;
no) EDITLINE_FLG=N;;
*) AC_MSG_ERROR(bad value '${withval}' for --with-editline);;
esac])
AC_ARG_WITH(system-editline,
[ --with-system-editline use OS supplied libeditline],
[case "$withval" in
yes) STD_EDITLINE=true;;
no) STD_EDITLINE=false;;
*) AC_MSG_ERROR(bad value '${withval}' for --with-system-editline);;
esac])
# not need editline in default libs, but need to test for its presence
READLINE=edit # builtin default
XE_SAVE_ENV()
if test "$STD_EDITLINE" = "true"; then
AC_CHECK_LIB(edit, readline, [READLINE=edit EDITLINE_FLG=Y],
AC_CHECK_LIB(editline, readline, [READLINE=editline EDITLINE_FLG=Y],
AC_CHECK_LIB(readline, readline, [READLINE=readline EDITLINE_FLG=Y],
[STD_EDITLINE=false
if test "$EDITLINE_FLG" = "Y"; then
AC_MSG_WARN([[[--with-system-editline specified, not found. Using bundled editline]]])
fi
])))
fi
XE_RESTORE_ENV()
AC_SUBST(READLINE)
AC_SUBST(STD_EDITLINE)
AC_SUBST(EDITLINE_FLG)
FB_SERVICE_NAME=gds_db
FB_SERVICE_PORT=3050
FB_IPC_NAME=FirebirdIPI
AC_ARG_WITH(service-name,
[ --with-service-name specify inet service name (default=gds_db)],
[FB_SERVICE_NAME=${withval}])
AC_ARG_WITH(service-port,
[ --with-service-port specify inet service port (default=3050)],
[FB_SERVICE_PORT=${withval}])
AC_ARG_WITH(ipc-name,
[ --with-ipc-name specify local IPC name (default=FirebirdIPI)],
[FB_IPC_NAME=${withval}])
AC_DEFINE_UNQUOTED(FB_SERVICE_NAME,"$FB_SERVICE_NAME", [Inet service name])
AC_DEFINE_UNQUOTED(FB_SERVICE_PORT,$FB_SERVICE_PORT, [Inet service port])
AC_DEFINE_UNQUOTED(FB_IPC_NAME,"$FB_IPC_NAME", [Local IPC name])
AC_SUBST(FB_SERVICE_NAME)
AC_SUBST(FB_SERVICE_PORT)
AC_SUBST(FB_IPC_NAME)
dnl Use non-standard directory placement control
dnl Sorry - GNU standard is not Ok for us
XE_CONF_DIR(fbbin, [executables DIR (PREFIX/bin)], FB_BINDIR, /bin)
XE_CONF_DIR(fbsbin, [system admin executables DIR (PREFIX/bin)], FB_SBINDIR, /bin)
XE_CONF_DIR(fbconf, [config files DIR (PREFIX)], FB_CONFDIR)
XE_CONF_DIR(fblib, [object code libraries DIR (PREFIX/lib)], FB_LIBDIR, /lib)
XE_CONF_DIR(fbinclude, [C/C++ header files DIR (PREFIX/include)], FB_INCDIR, /include)
XE_CONF_DIR(fbdoc, [documentation root DIR (PREFIX/doc)], FB_DOCDIR, /doc)
XE_CONF_DIR(fbsample, [examples DIR (PREFIX/examples)], FB_SAMPLEDIR, /examples)
XE_CONF_DIR(fbsample-db, [examples database DIR (PREFIX/examples/empbuild)], FB_SAMPLEDBDIR, /examples/empbuild)
XE_CONF_DIR(fbintl, [international DIR (PREFIX/intl)], FB_INTLDIR, /intl)
XE_CONF_DIR(fbmisc, [misc DIR (PREFIX/misc)], FB_MISCDIR, /misc)
XE_CONF_DIR(fbsecure-db, [security database DIR (PREFIX)], FB_SECDBDIR)
XE_CONF_DIR(fbmsg, [message files DIR (PREFIX)], FB_MSGDIR)
XE_CONF_DIR(fblog, [log files DIR (PREFIX)], FB_LOGDIR)
XE_CONF_FILE(fblogfilename, [log file name within log dir (firebird.log)], FB_LOGFILENAME, firebird.log)
XE_CONF_DIR(fbglock, [guardian lock DIR (PREFIX)], FB_GUARDDIR)
XE_CONF_DIR(fbplugins, [plugins DIR (PREFIX)], FB_PLUGDIR, /plugins)
XE_CONF_DIR(fbtzdata, [tzdata DIR (PREFIX/tzdata)], FB_TZDATADIR, /tzdata)
AC_SUBST(CHANGE_PATH_SUPPORT)
dnl gpre built-in language support (C/C++ are mandatory)
GPRE_LANGUAGE_MODULES=""
AC_ARG_WITH(gpre-ada,
[ --with-gpre-ada support ADA in gpre (default=no)],
[case "$withval" in
yes) XE_APPEND(ada.cpp,GPRE_LANGUAGE_MODULES)
AC_DEFINE(GPRE_ADA, 1, [Define this if GPRE should support ADA]);;
no) ;;
*) AC_MSG_ERROR(bad value '${withval}' for --with-gpre-ada);;
esac])
AC_ARG_WITH(gpre-cobol,
[ --with-gpre-cobol support COBOL in gpre (default=no)],
[case "$withval" in
yes) XE_APPEND(cob.cpp rmc.cpp,GPRE_LANGUAGE_MODULES)
AC_DEFINE(GPRE_COBOL, 1, [Define this if GPRE should support COBOL]);;
no) ;;
*) AC_MSG_ERROR(bad value '${withval}' for --with-gpre-cobol);;
esac])
AC_ARG_WITH(gpre-fortran,
[ --with-gpre-fortran support FORTRAN in gpre (default=no)],
[case "$withval" in
yes) XE_APPEND(ftn.cpp,GPRE_LANGUAGE_MODULES)
AC_DEFINE(GPRE_FORTRAN, 1, [Define this if GPRE should support FORTRAN]);;
no) ;;
*) AC_MSG_ERROR(bad value '${withval}' for --with-gpre-fortran);;
esac])
AC_ARG_WITH(gpre-pascal,
[ --with-gpre-pascal support PASCAL in gpre (default=no)],
[case "$withval" in
yes) XE_APPEND(pas.cpp,GPRE_LANGUAGE_MODULES)
AC_DEFINE(GPRE_PASCAL, 1, [Define this if GPRE should support PASCAL]);;
no) ;;
*) AC_MSG_ERROR(bad value '${withval}' for --with-gpre-pascal);;
esac])
AC_SUBST(GPRE_LANGUAGE_MODULES)
dnl Compression switch
COMPRESSION=Y
AC_ARG_WITH(wire-compress,
[ --with-wire-compress support compression of data, transfered over the wire (default=yes)],
[case "$withval" in
yes) ;;
no) COMPRESSION=N;;
*) AC_MSG_ERROR(bad value '${withval}' for --with-wire-compress);;
esac])
dnl Checks for programs.
AC_PROG_AWK
AC_PROG_CC_STDC
AC_PROG_GCC_TRADITIONAL
AC_PROG_CXX
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_CHECK_TOOL([OBJCOPY], [objcopy])
AC_CHECK_TOOL([OBJDUMP], [objdump])
AC_CHECK_TOOL([RANLIB], [ranlib])
AC_CHECK_TOOL([READELF], [readelf])
LT_INIT([dlopen win32-dll])
dnl Check for system header files
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(assert.h)
AC_CHECK_HEADERS(ctype.h)
AC_CHECK_HEADERS(errno.h)
AC_CHECK_HEADERS(fcntl.h)
AC_CHECK_HEADERS(grp.h)
AC_CHECK_HEADERS(pwd.h)
AC_CHECK_HEADERS(locale.h)
AC_CHECK_HEADERS(math.h)
AC_CHECK_HEADERS(pthread.h)
AC_CHECK_HEADERS(sys/types.h)
AC_CHECK_HEADERS(sys/stat.h)
AC_CHECK_HEADERS(sys/uio.h)
AC_HEADER_SYS_WAIT
AC_HEADER_TIME
AC_CHECK_HEADERS(sys/time.h)
AC_CHECK_HEADERS(sys/timeb.h)
AC_CHECK_HEADERS(sys/param.h)
AC_CHECK_HEADERS(sys/mount.h)
AC_CHECK_HEADERS(sys/ioctl.h)
AC_CHECK_HEADERS(sys/select.h)
AC_CHECK_HEADERS(sys/syscall.h)
AC_CHECK_HEADERS(sys/signal.h)
AC_CHECK_HEADERS(limits.h)
AC_CHECK_HEADERS(setjmp.h)
AC_CHECK_HEADERS(stdarg.h)
AC_CHECK_HEADERS(stdlib.h)
AC_CHECK_HEADERS(string.h)
AC_CHECK_HEADERS(signal.h sys/signal.h sys/siginfo.h)
AC_CHECK_HEADERS(termio.h termios.h)
if test "$EDITLINE_FLG" = "Y"; then
AC_HEADER_DIRENT
AC_DEFINE(HAVE_EDITLINE_H, 1, [Define this if editline is in use])
fi
AC_CHECK_HEADERS(unistd.h)
AC_CHECK_HEADERS(varargs.h)
AC_CHECK_HEADERS(crypt.h)
AC_CHECK_HEADERS(netinet/in.h rpc/rpc.h netconfig.h)
AC_CHECK_HEADERS(rpc/xdr.h,,,[#include <rpc/rpc.h>])
AC_CHECK_HEADERS(aio.h)
AC_CHECK_HEADERS(mntent.h mnttab.h sys/mntent.h sys/mnttab.h)
AC_CHECK_HEADERS(sys/ipc.h sys/file.h)
AC_CHECK_HEADERS(sys/resource.h)
AC_CHECK_HEADERS(sys/sem.h)
AC_CHECK_HEADERS(semaphore.h)
AC_CHECK_HEADERS(float.h)
AC_CHECK_HEADERS(poll.h)
AC_CHECK_HEADERS(langinfo.h)
AC_CHECK_HEADERS(iconv.h)
AC_CHECK_HEADERS(linux/falloc.h)
AC_CHECK_HEADERS(utime.h)
AC_CHECK_HEADERS(socket.h sys/socket.h sys/sockio.h winsock2.h)
AC_CHECK_DECLS(SOCK_CLOEXEC,,,[[
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#ifdef HAVE_SOCKET_H
#include <socket.h>
#endif
#ifdef HAVE_SYS_SOCKIO_H
#include <sys/sockio.h>
#endif
#ifdef HAVE_WINSOCK2_H
#include <winsock2.h>
#endif
]])
dnl check for compression
if test "$COMPRESSION" = "Y"; then
AC_CHECK_HEADERS(zlib.h,,AC_MSG_ERROR(zlib header not found - please install development zlib package))
fi
dnl check for ICU presence
AC_CHECK_HEADER(unicode/ucnv.h,,AC_MSG_ERROR(ICU support not found - please install development ICU package))
if test "$LSB_FLG" = "N"; then
dnl setting ICU_OK here is done to only avoid default action
AC_CHECK_LIB(icuuc, main, ICU_OK=yes, AC_MSG_ERROR(ICU support not found - please install development ICU package))
fi
dnl check for tommath presence
if test "$TOMMATH_BUILD" = "Y"; then
MATHLIB=-ltommath
else
AC_CHECK_HEADER(tommath.h,,
AC_MSG_ERROR(Include file for tommath not found - please install development tommath package or use --with-builtin-tommath))
XE_SAVE_ENV()
LIBS=
AC_CHECK_LIB(tommath, mp_init, MATHLIB=-ltommath,
AC_MSG_ERROR(Library tommath not found - please install development tommath package or use --with-builtin-tommath))
XE_RESTORE_ENV()
fi
AC_SUBST(MATHLIB)
dnl check for tomcrypt presence
if test "$TOMCRYPT_BUILD" = "Y"; then