-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
1177 lines (1047 loc) · 37.4 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 AC_PREREQ([2.67])
dnl Make sure you change the version information
dnl in include/qse/conf-inf.h whenever you change the version
dnl here. The file doesn't depend on autoconf, thus requiring
dnl manual change.
AC_INIT([qse],[0.9.0],[Chung, Hyung-Hwan (hyunghwan.chung@gmail.com)],[],[http://code.miflux.com/@qse])
AC_CONFIG_HEADER([include/qse/config.h])
AC_CONFIG_AUX_DIR([ac])
AC_CONFIG_MACRO_DIR([m4])
dnl use CC and CPP for compilation tests with .c test programs.
AC_LANG(C)
dnl initialize automake
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
AM_PROG_AR
dnl enable silent rules if automake supports them.
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([no])])
dnl m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
dnl determine a C compiler to use
AC_PROG_CC
dnl determine a C++ compiler to use
AC_PROG_CXX
dnl check if the C++ compiler exists in PATH
AC_CHECK_PROG(HAVE_CXX, $CXX, yes, no)
dnl check if the C++ compiler supports namespace
AX_CXX_NAMESPACE_STD
dnl HAVE_CXX11
AX_CXX_COMPILE_STDCXX(11, , optional)
dnl determine some key programs
AC_PROG_INSTALL
AC_PROG_EGREP
AC_PROG_LN_S
dnl check other tools
AC_CHECK_TOOL(RM, rm)
AC_CHECK_TOOL(RMDIR, rmdir)
AC_CHECK_TOOL(TRUE, true)
AC_CHECK_TOOL(ECHO, echo)
dnl avoid "'/bin/rm: cannot remove `libtoolT': No such file or directory"
RM="$RM -f"
dnl initialize libtool
LT_INIT
AC_SUBST(LIBTOOL_DEPS)
dnl overrides the default CFLAGS setting
if test "$ac_test_CFLAGS" != "set"
then
if test "$GCC" = "yes"
then
CFLAGS="$CFLAGS -Wall"
fi
fi
if test "$ac_test_CXXFLAGS" != "set"
then
if test "$GCC" = "yes"
then
CXXFLAGS="$CXXFLAGS -Wall"
fi
fi
dnl indicate the existence of config.h
CFLAGS="$CFLAGS -DQSE_HAVE_CONFIG_H"
CXXFLAGS="$CXXFLAGS -DQSE_HAVE_CONFIG_H"
QSE_TRY_CFLAGS([-fshort-wchar])
QSE_TRY_CFLAGS([-fno-short-wchar])
dnl make visible the 64-bit interface to the file system
AC_SYS_LARGEFILE()
dnl define the WIN32 conditional if necessary
case "$host" in
*-*-mingw*|*-*-cygwin*)
#CFLAGS="$CFLAGS -D_WIN32_WINNT=0x0400"
platform_win32=yes
;;
*)
platform_win32=no
;;
esac
AM_CONDITIONAL(WIN32, test "x${platform_win32}" = "xyes" )
dnl check the math library (check if -lm is needed)
LT_LIB_M
AC_SUBST(LIBM, $LIBM)
dnl ===== enable-wide-char =====
dnl this enable option is placed way above other options
dnl as -fshort-wchar affects the size of wchar_t.
AC_ARG_ENABLE([wide-char],
[AS_HELP_STRING([--enable-wide-char],[Use the wide-character type as the default character type. one of yes, no, yes:2, yes:4, no:2, no:4 (default. yes)])],
enable_wide_char=$enableval,
enable_wide_char=yes
)
if test "${enable_wide_char}" = "yes:4" -o "${enable_wide_char}" = "yes:4w"
then
AC_DEFINE([QSE_WIDE_CHAR_SIZE],[4],[Wide-character type size])
AC_DEFINE([QSE_ENABLE_WIDE_CHAR],[1],[Use the wide-character type as the default character type])
if test "${platform_win32}" = "yes"
then
[CFLAGS="$CFLAGS -DUNICODE -D_UNICODE"]
[CXXFLAGS="$CXXFLAGS -DUNICODE -D_UNICODE"]
fi
if test "${ac_cv_cflags__fno_short_wchar}" = "yes"
then
[CFLAGS="$CFLAGS -fno-short-wchar"]
[CXXFLAGS="$CXXFLAGS -fno-short-wchar"]
fi
if test "${enable_wide_char}" = "yes:4w"
then
AC_DEFINE([QSE_PREFER_PREFIX_L],[1],[Prefix wide-character literals with L])
fi
elif test "${enable_wide_char}" = "yes:2" -o "${enable_wide_char}" = "yes:2w" -o "${enable_wide_char}" = "yes"
then
AC_DEFINE([QSE_WIDE_CHAR_SIZE],[2],[Wide-character type size])
AC_DEFINE([QSE_ENABLE_WIDE_CHAR],[1],[Use the wide-character type as the default character type])
if test "${platform_win32}" = "yes"
then
[CFLAGS="$CFLAGS -DUNICODE -D_UNICODE"]
[CXXFLAGS="$CXXFLAGS -DUNICODE -D_UNICODE"]
fi
if test "${ac_cv_cflags__fshort_wchar}" = "yes"
then
[CFLAGS="$CFLAGS -fshort-wchar"]
[CXXFLAGS="$CXXFLAGS -fshort-wchar"]
fi
if test "${enable_wide_char}" = "yes:2w"
then
AC_DEFINE([QSE_PREFER_PREFIX_L],[1],[Prefix wide-character literals with L])
fi
elif test "${enable_wide_char}" = "no:4" -o test "${enable_wide_char}" = "no:4w"
then
AC_DEFINE([QSE_WIDE_CHAR_SIZE],[4],[Wide-character type size])
if test "${ac_cv_cflags__fno_short_wchar}" = "yes"
then
[CFLAGS="$CFLAGS -fno-short-wchar"]
[CXXFLAGS="$CXXFLAGS -fno-short-wchar"]
fi
if test "${enable_wide_char}" = "no:4w"
then
AC_DEFINE([QSE_PREFER_PREFIX_L],[1],[Prefix wide-character literals with L])
fi
else
dnl no:2, no:2w, no, or anything else
AC_DEFINE([QSE_WIDE_CHAR_SIZE],[2],[Wide-character type size])
if test "${ac_cv_cflags__fshort_wchar}" = "yes"
then
[CFLAGS="$CFLAGS -fshort-wchar"]
[CXXFLAGS="$CXXFLAGS -fshort-wchar"]
fi
if test "${enable_wide_char}" = "no:2w"
then
AC_DEFINE([QSE_PREFER_PREFIX_L],[1],[Prefix wide-character literals with L])
fi
fi
AC_MSG_CHECKING([for char16_t literal])
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([], [const void* x = u"ab cd ef gh";])],
[AC_MSG_RESULT(yes)
AC_DEFINE([QSE_HAVE_PREFIX_SMALL_U], [1], [char16_t literal prefix])],
[AC_MSG_RESULT(no)]
)
AC_MSG_CHECKING([for char32_t literal])
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([], [const void* x = U"ab cd ef gh";])],
[AC_MSG_RESULT(yes)
AC_DEFINE([QSE_HAVE_PREFIX_BIG_U], [1], [char32_t literal prefix])],
[AC_MSG_RESULT(no)]
)
dnl check header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([stddef.h wchar.h wctype.h errno.h signal.h fcntl.h dirent.h stdatomic.h])
AC_CHECK_HEADERS([time.h sys/time.h utime.h spawn.h execinfo.h ucontext.h])
AC_CHECK_HEADERS([sys/resource.h sys/wait.h sys/syscall.h sys/ioctl.h])
AC_CHECK_HEADERS([sys/sendfile.h sys/epoll.h sys/event.h sys/poll.h poll.h])
AC_CHECK_HEADERS([sys/sysctl.h sys/socket.h sys/sockio.h sys/un.h])
AC_CHECK_HEADERS([ifaddrs.h tiuser.h linux/netfilter_ipv4.h netinet/tcp.h netinet/sctp.h netpacket/packet.h])
AC_CHECK_HEADERS([net/if.h net/if_dl.h], [], [], [
#include <sys/types.h>
#include <sys/socket.h>])
AC_CHECK_HEADERS([sys/stropts.h sys/macstat.h linux/ethtool.h linux/sockios.h])
AC_CHECK_HEADERS([quadmath.h crt_externs.h sys/prctl.h uci.h])
AC_CHECK_HEADERS([ltdl.h dlfcn.h])
dnl check data types
dnl AC_CHECK_TYPE([wchar_t],
dnl [ AC_DEFINE([HAVE_WCHAR_T_IN_STDDEF_H],
dnl [],[wchar_t is available in stddef.h]) ],
dnl [],
dnl [#include <stddef.h>])
dnl check functions
AC_CHECK_FUNCS([uselocale])
AC_CHECK_FUNCS([mbrlen mbrtowc wcrtomb])
AC_CHECK_FUNCS([mbsnrtowcs mbsrtowcs wcsnrtombs wcsrtombs])
AC_CHECK_FUNCS([wctype iswctype wctrans towctrans isblank iswblank])
AC_CHECK_FUNCS([snprintf _vsnprintf _vsnwprintf])
AC_CHECK_FUNCS([lseek64 ftruncate64 readdir64 dirfd])
AC_CHECK_FUNCS([stat64 fstat64 lstat64 fstatat64])
AC_CHECK_FUNCS([fstat fstatat])
AC_CHECK_FUNCS([fchmod fchmodat fchown fchownat lchown fsync ftruncate])
AC_CHECK_FUNCS([timegm timelocal localtime_r gmtime_r gettimeofday settimeofday])
AC_CHECK_FUNCS([utime utimes futimes lutimes futimens utimensat])
AC_CHECK_FUNCS([sysconf prctl fdopendir setrlimit getrlimit getpgid getpgrp])
AC_CHECK_FUNCS([backtrace backtrace_symbols])
AC_CHECK_FUNCS([fork vfork posix_spawn gettid nanosleep select])
AC_CHECK_FUNCS([makecontext swapcontext getcontext setcontext])
AC_CHECK_FUNCS([dup2 dup3 pipe2 accept4 sendmsg recvmsg writev readv])
OLDLIBS="$LIBS"
LIBS="$LIBM $LIBS"
AC_CHECK_FUNCS([powl fmodl sinl cosl tanl sinhl coshl tanhl asinl acosl atanl atan2l logl log2l log10l expl sqrtl ceill floorl roundl])
AC_CHECK_FUNCS([pow fmod sin cos tan sinh cosh tanh asin acos atan atan2 log log2 log10 exp sqrt ceil floor round])
AC_CHECK_FUNCS([powf fmodf sinf cosf tanf sinhf coshf tanhf asinf acosf atanf atan2f logf log2f log10f expf sqrtf ceilf floorf roundf])
LIBS="$OLDLIBS"
save_LIBS="$LIBS"
AC_SEARCH_LIBS([dlopen], [dl dld], [
DL_LIBS="$ac_cv_search_dlopen"
if test "x${DL_LIBS}" = "xnone required"
then
DL_LIBS=""
fi
])
LIBS="$save_LIBS"
AC_SUBST(DL_LIBS)
save_LIBS="$LIBS"
AC_SEARCH_LIBS([lt_dlopen], [ltdl], [
LTDL_LIBS="$ac_cv_search_lt_dlopen"
if test "x${LTDL_LIBS}" = "xnone required"
then
LTDL_LIBS=""
fi
])
LIBS="$save_LIBS"
AC_SUBST(LTDL_LIBS)
dnl OLDLIBS="$LIBS"
dnl AC_SEARCH_LIBS([connect], [socket])
dnl LIBS="$OLDLIBS"
dnl if test "$ac_cv_search_connect" != "none required" -a "$ac_cv_search_connect" != "no"
dnl then
dnl SOCKET_LIBS="$SOCKET_LIBS -lsocket"
dnl fi
dnl AC_SUBST(SOCKET_LIBS)
AC_CHECK_FUNCS([connect gethostbyname])
if test "x$ac_cv_func_gethostbyname" = "xno"
then
AC_CHECK_LIB([nsl], [gethostbyname], [
SOCKET_LIBS="$SOCKET_LIBS -lnsl"
AC_DEFINE(HAVE_GETHOSTBYNAME, 1)
])
fi
if test "x$ac_cv_func_connect" = "xno"
then
AC_CHECK_LIB([socket], [connect], [
SOCKET_LIBS="$SOCKET_LIBS -lsocket"
AC_DEFINE(HAVE_CONNECT, 1)
])
if test "x$ac_cv_lib_socket_connect" = xno
then
AC_CHECK_FUNCS([t_connect])
if test "x$ac_cv_func_t_connect" = "xno"
then
AC_CHECK_LIB([nsl_s], [t_connect], [
SOCKET_LIBS="$SOCKET_LIBS -lnsl_s"
AC_DEFINE(HAVE_T_CONNECT, 1)
])
fi
fi
fi
if test "x${platform_win32}" = "xyes"
then
SOCKET_LIBS="$SOCKET_LIBS -lws2_32"
fi
AC_SUBST(SOCKET_LIBS)
OLDLIBS="$LIBS"
LIBS="$SOCKET_LIBS $LIBS"
AC_CHECK_FUNCS([if_nametoindex if_indextoname getifaddrs])
LIBS="$OLDLIBS"
dnl check if sendfile and its variants exist in the standard c library
dnl it inspects the existence of each missing function in the sendfile library.
AC_CHECK_FUNCS([sendfile sendfile64 sendfilev sendfilev64])
if test "$ac_cv_func_sendfile" = "no"
then
AC_CHECK_LIB([sendfile], [sendfile], [
SENDFILE_LIBS="-lsendfile"
dnl only for consistency with AC_CHECK_FUNCS
AC_DEFINE(HAVE_SENDFILE, 1)
])
fi
if test "$ac_cv_func_sendfile64" = "no"
then
AC_CHECK_LIB([sendfile], [sendfile64], [
SENDFILE_LIBS="-lsendfile"
dnl only for consistency with AC_CHECK_FUNCS
AC_DEFINE(HAVE_SENDFILE64, 1)
])
fi
if test "$ac_cv_func_sendfilev" = "no"
then
AC_CHECK_LIB([sendfile], [sendfilev], [
SENDFILE_LIBS="-lsendfile"
dnl only for consistency with AC_CHECK_FUNCS
AC_DEFINE(HAVE_SENDFILEV, 1)
])
fi
if test "$ac_cv_func_sendfilev64" = "no"
then
AC_CHECK_LIB([sendfile], [sendfilev64], [
SENDFILE_LIBS="-lsendfile"
dnl only for consistency with AC_CHECK_FUNCS
AC_DEFINE(HAVE_SENDFILEV64, 1)
])
fi
AC_SUBST(SENDFILE_LIBS)
AC_CHECK_FUNCS([epoll_create epoll_create1])
if test "$ac_cv_func_epoll_create" = "yes"
then
AC_DEFINE(HAVE_EPOLL, 1, [epoll support])
fi
AC_CHECK_FUNCS([kqueue kqueue1 kevent])
AX_PTHREAD()
AC_CHECK_LIB([pthread], [pthread_mutex_timedlock], [
AC_DEFINE([HAVE_PTHREAD_MUTEX_TIMEDLOCK],1,[pthreads has pthread_mutex_timedlock()])
])
AC_CHECK_LIB([pthread], [pthread_mutex_trylock], [
AC_DEFINE([HAVE_PTHREAD_MUTEX_TRYLOCK],1,[pthreads has pthread_mutex_trylock()])
])
dnl check is the import library for unicows.dll exists
dnl this check doesn't look for a particular symbol
dnl but for the symbol 'main' since i want to check
dnl the existence of the libaray.
AC_CHECK_LIB([unicows], [main], [UNICOWS_LIBS="-lunicows"])
AC_SUBST(UNICOWS_LIBS)
AC_ARG_ENABLE([ssl], [AS_HELP_STRING([--enable-ssl],[build the library in the ssl mode (default. yes)])],
enable_ssl_is=$enableval,enable_ssl_is=yes)
if test "x$enable_ssl_is" = "xyes"
then
AC_CHECK_HEADERS([openssl/ssl.h openssl/err.h openssl/engine.h])
dnl check for an SSL library
dnl i used SSL_library_init at first.
dnl starting from openssl 1.1.0, SSL_library_init was made to a macro
dnl aliasing OPENSSL_init_ssl.
dnl #define SSL_library_init() OPENSSL_init_ssl(0, NULL)
dnl instead of checking both, now i use SSL_new.
AC_CHECK_FUNCS([SSL_new])
if test "x$ac_cv_func_SSL_new" = "xyes"
then
AC_DEFINE(HAVE_SSL, 1, [ssl support])
else
AC_CHECK_LIB([ssl], [SSL_new], [
SSL_LIBS="-lssl"
AC_DEFINE(HAVE_SSL, 1, [ssl support])
dnl additional check
AC_CHECK_LIB([crypto], [ERR_get_error], [
SSL_LIBS="${SSL_LIBS} -lcrypto"
])
dnl only for consistency with AC_CHECK_FUNCS
AC_DEFINE(HAVE_SSL_NEW, 1)
])
fi
OLDLIBS="$LIBS"
LIBS="$SSL_LIBS $LIBS"
AC_CHECK_FUNCS([ENGINE_cleanup CRYPTO_cleanup_all_ex_data])
LIBS="$OLDLIBS"
fi
AC_SUBST(SSL_LIBS)
dnl MPI (optional)
LX_FIND_MPI(C)
AM_CONDITIONAL(HAVE_C_MPI, test "x${have_C_mpi}" = "xyes" )
dnl AM_CONDITIONAL(HAVE_CXX_MPI, test "${have_CXX_mpi}" = "yes" )
dnl libuci (optional)
AC_CHECK_LIB([uci], [uci_alloc_context], [UCI_LIBS="-luci"])
AC_SUBST(UCI_LIBS)
AM_CONDITIONAL(HAVE_LIBUCI, test "x${ac_cv_lib_uci_uci_alloc_context}" = "xyes" -a "x${ac_cv_header_uci_h}" = "xyes")
dnl libmysqlclient
AX_LIB_MYSQL
AC_STRUCT_DIRENT_D_TYPE
AC_CHECK_MEMBERS([DIR.d_fd, DIR.dd_fd],,,[[#include <dirent.h>]])
AC_CHECK_MEMBERS([struct stat.st_birthtime])
AC_CHECK_MEMBERS([struct stat.st_mtim.tv_nsec])
AC_CHECK_MEMBERS([struct stat.st_birthtim.tv_nsec])
AC_CHECK_MEMBERS([struct stat.st_mtimespec.tv_nsec])
AC_CHECK_MEMBERS([struct stat.st_birthtimespec.tv_nsec])
AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,,[[#include <time.h>]])
AC_CHECK_MEMBERS([struct tm.__tm_gmtoff],,,[[#include <time.h>]])
AC_CHECK_MEMBERS([struct tm.tm_zone],,,[[#include <time.h>]])
AC_CHECK_MEMBERS([struct tm.__tm_zone],,,[[#include <time.h>]])
AC_CHECK_MEMBERS([struct ifreq.ifr_ifindex, struct ifreq.ifr_mtu], [], [],
[#include <sys/types.h>
#include <sys/socket.h>
#ifdef HAVE_NET_IF_H
#include <net/if.h>
#endif])
AC_CHECK_TYPES([struct lifconf, struct lifreq, struct if_laddrreq], [], [],
[#include <sys/types.h>
#include <sys/socket.h>
#ifdef HAVE_NET_IF_H
#include <net/if.h>
#endif])
AC_CHECK_MEMBERS([struct sockaddr_in6.sin6_scope_id], [], [],
[#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>])
AC_CHECK_TYPES([struct timespec], [], [],
[#include <sys/types.h>
#ifdef HAVE_TIME_H
#include <time.h>
#endif
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif])
AC_MSG_CHECKING([for va_copy])
AC_TRY_LINK(
[#include <stdarg.h>],
[
va_list x, y;
va_copy(x,y);
],
[
AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_VA_COPY], [1], [va_copy is available])
],
[AC_MSG_RESULT(no)]
)
AC_MSG_CHECKING([for __va_copy])
AC_TRY_LINK(
[#include <stdarg.h>],
[
va_list x, y;
__va_copy(x,y);
],
[
AC_MSG_RESULT(yes)
AC_DEFINE([HAVE___VA_COPY], [1], [__va_copy is available])
],
[AC_MSG_RESULT(no)]
)
dnl check the size of primitive data types
AC_CHECK_SIZEOF(char,,[[]])
AC_CHECK_SIZEOF(short,,[[]])
AC_CHECK_SIZEOF(int,,[[]])
AC_CHECK_SIZEOF(long,,[[]])
AC_CHECK_SIZEOF(long long,,[[]])
AC_CHECK_SIZEOF(__int8,,[[]])
AC_CHECK_SIZEOF(__int16,,[[]])
AC_CHECK_SIZEOF(__int32,,[[]])
AC_CHECK_SIZEOF(__int64,,[[]])
AC_CHECK_SIZEOF(__int128,,[[]])
AC_CHECK_SIZEOF(__int8_t,,[[]])
AC_CHECK_SIZEOF(__int16_t,,[[]])
AC_CHECK_SIZEOF(__int32_t,,[[]])
AC_CHECK_SIZEOF(__int64_t,,[[]])
AC_CHECK_SIZEOF(__int128_t,,[[]])
dnl AC_CHECK_SIZEOF doesn't work without white-space between void and *
AC_CHECK_SIZEOF(void *,,[[]])
AC_CHECK_SIZEOF(float,,[[]])
AC_CHECK_SIZEOF(double,,[[]])
AC_CHECK_SIZEOF(long double,,[[]])
AC_CHECK_SIZEOF(__float128,,[[]])
AC_CHECK_SIZEOF(wchar_t)
AC_CHECK_SIZEOF(off_t)
AC_CHECK_SIZEOF(off64_t)
AC_CHECK_SIZEOF(mode_t)
if test ${ac_cv_sizeof_mode_t} -gt 0
then
AX_CHECK_SIGN([mode_t],
[ AC_DEFINE(QSE_MODE_T_IS_SIGNED, 1, [Define if mode_t is signed]) ],
[ AS_ECHO_N("") ],
[])
fi
AC_CHECK_SIZEOF(mbstate_t,,[#include <wchar.h>])
AX_CHECK_NUMVALOF(MB_LEN_MAX,[32],[#include <limits.h>])
AX_CHECK_NUMVALOF(PATH_MAX,[0],[#include <limits.h>])
AX_CHECK_NUMVALOF(NSIG,[32],[#include <signal.h>])
AX_CHECK_NUMVALOF(SOCK_STREAM, [-1], [#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>])
AX_CHECK_NUMVALOF(SOCK_DGRAM, [-1], [#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>])
AX_CHECK_NUMVALOF(SOCK_RAW, [-1], [#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>])
AX_CHECK_NUMVALOF(AF_UNSPEC, [-1], [#include <sys/types.h>
#include <sys/socket.h>])
AX_CHECK_NUMVALOF(AF_INET, [-1], [#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>])
AX_CHECK_NUMVALOF(AF_INET6, [-1], [#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>])
AX_CHECK_NUMVALOF(AF_PACKET, [-1], [#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>])
AX_CHECK_NUMVALOF(AF_UNIX, [-1], [#include <sys/types.h>
#include <sys/socket.h>
#include <sys/un.h>])
AX_CHECK_NUMVALOF(IFNAMSIZ, [-1], [#include <sys/types.h>
#include <sys/socket.h>
#include <net/if.h>])
AX_CHECK_NUMVALOF(IF_NAMESIZE, [-1], [#include <sys/types.h>
#include <sys/socket.h>
#include <net/if.h>])
if test "x${platform_win32}" = "xyes"
then
AC_CHECK_SIZEOF(struct sockaddr_in,,[
#include <winsock2.h>
#include <ws2tcpip.h>])
AC_CHECK_SIZEOF(struct sockaddr_in6,,[
#include <winsock2.h>
#include <ws2tcpip.h>])
AC_CHECK_SIZEOF(struct sockaddr_un,,[
#include <winsock2.h>
#include <ws2tcpip.h>])
AC_CHECK_SIZEOF(struct sockaddr_ll,,[
#include <winsock2.h>
#include <ws2tcpip.h>])
AC_CHECK_SIZEOF(struct sockaddr_dl,,[
#include <winsock2.h>
#include <ws2tcpip.h>])
AC_CHECK_SIZEOF(socklen_t,, [
#include <winsock2.h>
#include <ws2tcpip.h>])
if test ${ac_cv_sizeof_socklen_t} -gt 0
then
AX_CHECK_SIGN([socklen_t],
[ AC_DEFINE(QSE_SOCKLEN_T_IS_SIGNED, 1, [Define if socklen_t is signed]) ],
[ AS_ECHO_N("") ],
[#include <winsock2.h>
#include <ws2tcpip.h>])
fi
AC_CHECK_SIZEOF(sa_family_t,, [
#include <winsock2.h>
#include <ws2tcpip.h>])
if test ${ac_cv_sizeof_sa_family_t} -gt 0
then
AX_CHECK_SIGN([sa_family_t],
[ AC_DEFINE(QSE_SA_FAMILY_T_IS_SIGNED, 1, [Define if sa_family_t is signed]) ],
[ AS_ECHO_N("") ],
[#include <winsock2.h>
#include <ws2tcpip.h>])
fi
else
AC_CHECK_SIZEOF(struct sockaddr_in,,[
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>])
AC_CHECK_SIZEOF(struct sockaddr_in6,,[
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>])
AC_CHECK_SIZEOF(struct sockaddr_un,,[
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/un.h>])
AC_CHECK_SIZEOF(struct sockaddr_ll,,[
#include <sys/types.h>
#include <sys/socket.h>
#include <netpacket/packet.h>])
AC_CHECK_SIZEOF(struct sockaddr_dl,,[
#include <sys/types.h>
#include <sys/socket.h>
#include <net/if_dl.h>])
AC_CHECK_SIZEOF(socklen_t,, [
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>])
if test ${ac_cv_sizeof_socklen_t} -gt 0
then
AX_CHECK_SIGN([socklen_t],
[ AC_DEFINE(QSE_SOCKLEN_T_IS_SIGNED, 1, [Define if socklen_t is signed]) ],
[ AS_ECHO_N("") ],
[#include <sys/socket.h>])
fi
AC_CHECK_SIZEOF(sa_family_t,, [
#include <sys/socket.h>
#include <netinet/in.h>])
if test ${ac_cv_sizeof_sa_family_t} -gt 0
then
AX_CHECK_SIGN([sa_family_t],
[ AC_DEFINE(QSE_SA_FAMILY_T_IS_SIGNED, 1, [Define if sa_family_t is signed]) ],
[ AS_ECHO_N("") ],
[#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>])
fi
fi
AC_CHECK_SIZEOF(struct iovec,,[#include <sys/uio.h>])
if test ${ac_cv_sizeof_struct_iovec} -gt 0
then
AC_MSG_CHECKING([offset of iov_base in struct iovec])
AC_COMPUTE_INT([ac_cv_offsetof_iov_base],
[[offsetof(struct iovec, iov_base)]],
[#include <stddef.h>
#include <sys/uio.h>], [ac_cv_offsteof_iov_base=0])
AC_MSG_RESULT([$ac_cv_offsetof_iov_base])
AC_DEFINE_UNQUOTED(QSE_OFFSETOF_IOV_BASE, ${ac_cv_offsetof_iov_base}, [offsetof(struct iovec, iov_base)])
AC_MSG_CHECKING([offset of iov_len in struct iovec])
AC_COMPUTE_INT([ac_cv_offsetof_iov_len],
[[offsetof(struct iovec, iov_len)]],
[#include <stddef.h>
#include <sys/uio.h>], [ac_cv_offsteof_iov_len=0])
AC_MSG_RESULT([$ac_cv_offsetof_iov_len])
AC_DEFINE_UNQUOTED(QSE_OFFSETOF_IOV_LEN, ${ac_cv_offsetof_iov_len}, [offsetof(struct iovec, iov_len)])
fi
AC_CHECK_SIZEOF(pthread_t,, [#include <pthread.h>])
if test ${ac_cv_sizeof_pthread_t} -gt 0
then
AX_CHECK_SIGN([pthread_t],
[AC_DEFINE(QSE_PTHREAD_T_IS_SIGNED, 1, [Define if pthread_t is signed])],
[AS_ECHO_N("")],
[#include <pthread.h>])
fi
AC_CHECK_SIZEOF(pthread_mutex_t,, [#include <pthread.h>])
if test ${ac_cv_sizeof_pthread_mutex_t} -gt 0
then
AX_CHECK_SIGN([pthread_mutex_t],
[ AC_DEFINE(QSE_PTHREAD_MUTEX_T_IS_SIGNED, 1, [Define if pthread_mutex_t is signed]) ],
[ AS_ECHO_N("") ],
[#include <pthread.h>])
fi
AC_CHECK_SIZEOF(pthread_cond_t,, [#include <pthread.h>])
if test ${ac_cv_sizeof_pthread_cond_t} -gt 0
then
AX_CHECK_SIGN([pthread_cond_t],
[ AC_DEFINE(QSE_PTHREAD_MUTEX_T_IS_SIGNED, 1, [Define if pthread_cond_t is signed]) ],
[ AS_ECHO_N("") ],
[#include <pthread.h>])
fi
dnl gcc 3.4.3 on opensolaris x86 gave this warning without -msse or
dnl something similar.
dnl SSE vector argument without SSE enabled changes the ABI
dnl it also ended with an internal compiler error while compiling
dnl some expressions like 'v % base' where v is of the __int128_t type.
dnl so i've added this check to determine if the compiler has
dnl proper support for __int128_t.
dnl
dnl Changing ac_cv_sizeof___int128_t here doesn't corret SIZEOF___INT128_T
dnl since it's already generated. It only affects QSE_SIZEOF___INT128_T below.
if test ${ac_cv_sizeof___int128_t} -gt 0
then
AC_MSG_CHECKING([__int128_t with % and va_arg])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([#include <stdarg.h>], [
va_list ap;
volatile __int128_t x, base;
va_arg (ap, __int128_t);
x = (__int128_t)&base;
base = (__int128_t)&x;
x = x % base;
return (int)x;
])],
[
AC_MSG_RESULT(yes)
],
[
AC_MSG_RESULT(no)
ac_cv_sizeof___int128_t=0
]
)
fi
dnl Some compilers doesn't seem to have full support for __float128
dnl even if the type is available.
if test ${ac_cv_sizeof___float128} -gt 0
then
AC_MSG_CHECKING([__float128 with linking])
AC_TRY_LINK(
[#include <stdio.h>],
[
__float128 x, y, z;
z = x * y + x;
printf ("%p", (char*)(int)z);
],
[AC_MSG_RESULT(yes)],
[
AC_MSG_RESULT(no)
ac_cv_sizeof___float128=0
]
)
fi
dnl Quadmath functions may not be in the default c library.
dnl Find a library containing them. Disable the float128 type
dnl if they are not available.
if test ${ac_cv_sizeof___float128} -gt 0
then
AC_CHECK_FUNCS([quadmath_snprintf])
if test "$ac_cv_func_quadmath_snprintf" = "no"
then
OLDLIBS="$LIBS"
LIBS="$LIBM $LIBS"
AC_CHECK_FUNCS([quadmath_snprintf])
LIBS="$OLDLIBS"
if test "$ac_cv_func_quadmath_snprintf" = "no"
then
dnl quadmath_snprintf not avalable in the
dnl standard math lib.
AC_CHECK_LIB([quadmath], [quadmath_snprintf], [
QUADMATH_LIBS="-lquadmath"
LIBM="$LIBM -lquadmath"
AC_DEFINE(HAVE_QUADMATH_SNPRINTF, 1)
])
if test "$ac_cv_lib_quadmath_quadmath_snprintf" = "no"
then
dnl quadmath_snprintf not avalable in the
dnl quadmath lib.
ac_cv_sizeof___float128=0
fi
else
QUADMATH_LIBS="$LIBM"
fi
fi
if test ${ac_cv_sizeof___float128} -gt 0
then
OLDLIBS="$LIBS"
LIBS="$LIBM $LIBS"
AC_CHECK_FUNCS([powq fmodq sinq cosq tanq sinhq coshq tanhq asinq acosq atanq atan2q logq log2q log10q expq sqrtq ceilq floorq roundq])
AC_CHECK_FUNCS([strtoflt128])
LIBS="$OLDLIBS"
fi
fi
AC_SUBST(QUADMATH_LIBS)
AC_DEFINE_UNQUOTED(QSE_SIZEOF_CHAR, ${ac_cv_sizeof_char}, [sizeof(char)])
AC_DEFINE_UNQUOTED(QSE_SIZEOF_SHORT, ${ac_cv_sizeof_short}, [sizeof(short)])
AC_DEFINE_UNQUOTED(QSE_SIZEOF_INT, ${ac_cv_sizeof_int}, [sizeof(int)])
AC_DEFINE_UNQUOTED(QSE_SIZEOF_LONG, ${ac_cv_sizeof_long}, [sizeof(long)])
AC_DEFINE_UNQUOTED(QSE_SIZEOF_LONG_LONG, ${ac_cv_sizeof_long_long}, [sizeof(long long)])
AC_DEFINE_UNQUOTED(QSE_SIZEOF___INT8, ${ac_cv_sizeof___int8}, [sizeof(__int8)])
AC_DEFINE_UNQUOTED(QSE_SIZEOF___INT16, ${ac_cv_sizeof___int16}, [sizeof(__int16)])
AC_DEFINE_UNQUOTED(QSE_SIZEOF___INT32, ${ac_cv_sizeof___int32}, [sizeof(__int32)])
AC_DEFINE_UNQUOTED(QSE_SIZEOF___INT64, ${ac_cv_sizeof___int64}, [sizeof(__int64)])
AC_DEFINE_UNQUOTED(QSE_SIZEOF___INT128, ${ac_cv_sizeof___int128}, [sizeof(__int128)])
AC_DEFINE_UNQUOTED(QSE_SIZEOF___INT128_T, ${ac_cv_sizeof___int128_t}, [sizeof(__int128_t)])
AC_DEFINE_UNQUOTED(QSE_SIZEOF_VOID_P, ${ac_cv_sizeof_void_p}, [sizeof(void*)])
AC_DEFINE_UNQUOTED(QSE_SIZEOF_FLOAT, ${ac_cv_sizeof_float}, [sizeof(float)])
AC_DEFINE_UNQUOTED(QSE_SIZEOF_DOUBLE, ${ac_cv_sizeof_double}, [sizeof(double)])
AC_DEFINE_UNQUOTED(QSE_SIZEOF_LONG_DOUBLE, ${ac_cv_sizeof_long_double}, [sizeof(long double)])
AC_DEFINE_UNQUOTED(QSE_SIZEOF___FLOAT128, ${ac_cv_sizeof___float128}, [sizeof(__float128)])
AC_DEFINE_UNQUOTED(QSE_SIZEOF_NATIVE_WCHAR_T, ${ac_cv_sizeof_wchar_t}, [sizeof(wchar_t)])
AC_DEFINE_UNQUOTED(QSE_SIZEOF_OFF_T, ${ac_cv_sizeof_off_t}, [sizeof(off_t)])
AC_DEFINE_UNQUOTED(QSE_SIZEOF_OFF64_T, ${ac_cv_sizeof_off64_t}, [sizeof(off64_t)])
AC_DEFINE_UNQUOTED(QSE_SIZEOF_MODE_T, ${ac_cv_sizeof_mode_t}, [sizeof(mode_t)])
AC_DEFINE_UNQUOTED(QSE_SIZEOF_MBSTATE_T, ${ac_cv_sizeof_mbstate_t}, [sizeof(mbstate_t)])
AC_DEFINE_UNQUOTED(QSE_MBLEN_MAX, ${ax_cv_numvalof_MB_LEN_MAX}, [MB_LEN_MAX])
if test ${ax_cv_numvalof_PATH_MAX} -gt 0
then
AC_DEFINE_UNQUOTED(QSE_PATH_MAX, ${ax_cv_numvalof_PATH_MAX}, [PATH_MAX])
fi
AC_DEFINE_UNQUOTED(QSE_NSIGS, ${ax_cv_numvalof_NSIG}, [NSIG])
if test ${ax_cv_numvalof_SOCK_STREAM} -ge 0
then
AC_DEFINE_UNQUOTED(QSE_SOCK_STREAM, ${ax_cv_numvalof_SOCK_STREAM}, [SOCK_STREAM])
fi
if test ${ax_cv_numvalof_SOCK_DGRAM} -ge 0
then
AC_DEFINE_UNQUOTED(QSE_SOCK_DGRAM, ${ax_cv_numvalof_SOCK_DGRAM}, [SOCK_DGRAM])
fi
if test ${ax_cv_numvalof_SOCK_RAW} -ge 0
then
AC_DEFINE_UNQUOTED(QSE_SOCK_RAW, ${ax_cv_numvalof_SOCK_RAW}, [SOCK_RAW])
fi
if test ${ax_cv_numvalof_AF_UNSPEC} -ge 0
then
AC_DEFINE_UNQUOTED(QSE_AF_UNSPEC, ${ax_cv_numvalof_AF_UNSPEC}, [AF_UNSPEC])
fi
if test ${ax_cv_numvalof_AF_INET} -ge 0
then
AC_DEFINE_UNQUOTED(QSE_AF_INET, ${ax_cv_numvalof_AF_INET}, [AF_INET])
fi
if test ${ax_cv_numvalof_AF_INET6} -ge 0
then
AC_DEFINE_UNQUOTED(QSE_AF_INET6, ${ax_cv_numvalof_AF_INET6}, [AF_INET6])
fi
if test ${ax_cv_numvalof_AF_PACKET} -ge 0
then
AC_DEFINE_UNQUOTED(QSE_AF_PACKET, ${ax_cv_numvalof_AF_PACKET}, [AF_PACKET])
fi
if test ${ax_cv_numvalof_AF_UNIX} -ge 0
then
AC_DEFINE_UNQUOTED(QSE_AF_UNIX, ${ax_cv_numvalof_AF_UNIX}, [AF_UNIX])
fi
if test ${ax_cv_numvalof_IFNAMSIZ} -ge 0
then
AC_DEFINE_UNQUOTED(QSE_IF_NAMESIZE, ${ax_cv_numvalof_IFNAMSIZ}, [IF_NAMESIZE])
elif test ${ax_cv_numvalof_IF_NAMESIZE} -ge 0
then
AC_DEFINE_UNQUOTED(QSE_IF_NAMESIZE, ${ax_cv_numvalof_IF_NAMESIZE}, [IF_NAMESIZE])
fi
AC_DEFINE_UNQUOTED(QSE_SIZEOF_STRUCT_SOCKADDR_IN, ${ac_cv_sizeof_struct_sockaddr_in}, [sizeof(struct sockaddr_in)])
AC_DEFINE_UNQUOTED(QSE_SIZEOF_STRUCT_SOCKADDR_IN6, ${ac_cv_sizeof_struct_sockaddr_in6}, [sizeof(struct sockaddr_in6)])
AC_DEFINE_UNQUOTED(QSE_SIZEOF_STRUCT_SOCKADDR_UN, ${ac_cv_sizeof_struct_sockaddr_un}, [sizeof(struct sockaddr_un)])
AC_DEFINE_UNQUOTED(QSE_SIZEOF_STRUCT_SOCKADDR_LL, ${ac_cv_sizeof_struct_sockaddr_ll}, [sizeof(struct sockaddr_ll)])
AC_DEFINE_UNQUOTED(QSE_SIZEOF_STRUCT_SOCKADDR_DL, ${ac_cv_sizeof_struct_sockaddr_dl}, [sizeof(struct sockaddr_dl)])
AC_DEFINE_UNQUOTED(QSE_SIZEOF_SOCKLEN_T, ${ac_cv_sizeof_socklen_t}, [sizeof(socklen_t)])
AC_DEFINE_UNQUOTED(QSE_SIZEOF_SA_FAMILY_T, ${ac_cv_sizeof_sa_family_t}, [sizeof(sa_family_t)])
AC_DEFINE_UNQUOTED(QSE_SIZEOF_SOCKLEN_T, ${ac_cv_sizeof_socklen_t}, [sizeof(socklen_t)])
AC_DEFINE_UNQUOTED(QSE_SIZEOF_STRUCT_IOVEC, ${ac_cv_sizeof_struct_iovec}, [sizeof(struct iovec)])
AC_DEFINE_UNQUOTED(QSE_SIZEOF_PTHREAD_T, ${ac_cv_sizeof_pthread_t}, [sizeof(pthread_t)])
AC_DEFINE_UNQUOTED(QSE_SIZEOF_PTHREAD_MUTEX_T, ${ac_cv_sizeof_pthread_mutex_t}, [sizeof(pthread_mutex_t)])
AC_DEFINE_UNQUOTED(QSE_SIZEOF_PTHREAD_COND_T, ${ac_cv_sizeof_pthread_cond_t}, [sizeof(pthread_cond_t)])
qse_package_version_major="`echo ${PACKAGE_VERSION} | cut -d. -f1`"
qse_package_version_minor="`echo ${PACKAGE_VERSION} | cut -d. -f2`"
qse_package_version_patch="`echo ${PACKAGE_VERSION} | cut -d. -f3`"
AC_SUBST(PACKAGE_VERSION_MAJOR, ${qse_package_version_major})
AC_SUBST(PACKAGE_VERSION_MINOR, ${qse_package_version_minor})
AC_SUBST(PACKAGE_VERSION_PATCH, ${qse_package_version_patch})
AC_DEFINE_UNQUOTED(QSE_PACKAGE_VERSION, "${PACKAGE_VERSION}", [Package version])
dnl AC_DEFINE_UNQUOTED(QSE_PACKAGE_VERSION_MAJOR, $(echo ${VERSION} | cut -d. -f1), [Major version number])
dnl AC_DEFINE_UNQUOTED(QSE_PACKAGE_VERSION_MINOR, $(echo ${VERSION} | cut -d. -f2), [Minor version number])
dnl AC_DEFINE_UNQUOTED(QSE_PACKAGE_VERSION_PATCH, $(echo ${VERSION} | cut -d. -f3), [Patch level])
AC_DEFINE_UNQUOTED(QSE_PACKAGE_VERSION_MAJOR, ${qse_package_version_major}, [Major version number])
AC_DEFINE_UNQUOTED(QSE_PACKAGE_VERSION_MINOR, ${qse_package_version_minor}, [Minor version number])
AC_DEFINE_UNQUOTED(QSE_PACKAGE_VERSION_PATCH, ${qse_package_version_patch}, [Patch level])
AC_DEFINE_UNQUOTED(QSE_PACKAGE_AUTHOR,"${PACKAGE_BUGREPORT}", [Author])
AC_DEFINE_UNQUOTED(QSE_PACKAGE_NAME,"${PACKAGE_NAME}", [package name])
AC_DEFINE_UNQUOTED(QSE_PACKAGE_URL, "${PACKAGE_URL}", [Project URL])
AC_C_BIGENDIAN(
[AC_DEFINE([QSE_ENDIAN_BIG],[],[Big Endian])],
[AC_DEFINE([QSE_ENDIAN_LITTLE],[],[Little Endian])],
[AC_DEFINE([QSE_ENDIAN_UNKNOWN],[],[Unknown Endian])])
dnl ===== enable-libltdl =====
AC_ARG_ENABLE([libltdl],
[AS_HELP_STRING([--enable-libltdl],[use libltdl(default. no)])],
enable_libltdl_is=$enableval,
enable_libltdl_is=no
)
if test "x${enable_libltdl_is}" = "xyes"
then
if test "x${ac_cv_header_ltdl_h}" = "xyes" -a "${LTDL_LIBS}" != ""
then
AC_DEFINE([QSE_ENABLE_LIBLTDL],[],[use libltdl when loading a dynamic module])
else
enable_libltdl_is="no"
fi
fi
AM_CONDITIONAL(ENABLE_LIBLTDL, test "x${enable_libltdl_is}" = "xyes")
dnl define extra options
AC_ARG_ENABLE([bundled-unicode], [AS_HELP_STRING([--enable-bundled-unicode],[use thn bundled unicode routines (default. no)])],
enable_bundled_unicode_is=$enableval,enable_bundled_unicode_is=yes)
if test "${ac_cv_header_wctype_h}" = "no" -o "${ac_cv_func_wctrans}" = "no" -o "${ac_cv_func_wctype}" = "no"
then
dnl force bundled-unicode to yes if some wchar functions are not available
enable_bundled_unicode_is=yes
fi
if test "${enable_bundled_unicode_is}" = "yes"
then
AC_DEFINE([QSE_ENABLE_BUNDLED_UNICODE],[],[use the bundled unicode routines])
fi
AM_CONDITIONAL(ENABLE_BUNDLED_UNICODE, test "${enable_bundled_unicode_is}" = "yes")
AC_ARG_ENABLE([xcmgrs], [AS_HELP_STRING([--enable-xcmgrs],[include more built-in cmgrs like cp949 and cp950 when enabled (default. yes)])],
enable_xcmgrs_is=$enableval,enable_xcmgrs_is=yes)
if test "${enable_xcmgrs_is}" = "yes"
then
AC_DEFINE([QSE_ENABLE_XCMGRS],[],[include more built-in cmgrs like cp949 and cp950])
fi
AM_CONDITIONAL(ENABLE_XCMGRS, test "${enable_xcmgrs_is}" = "yes" )
AC_ARG_ENABLE([syscall], [AS_HELP_STRING([--enable-syscall],[use the syscall() function to call system calls (default. no)])],
enable_syscall_is=$enableval,enable_syscall_is=no)
if test "${enable_syscall_is}" = "yes"
then
AC_DEFINE([QSE_USE_SYSCALL],[],[use the syscall() function to invoke a system call])
fi
AC_ARG_ENABLE([debug], [AS_HELP_STRING([--enable-debug],[build the library in the debug mode (default. no)])],
enable_debug_is=$enableval,enable_debug_is=no)
if test "$enable_debug_is" = "yes"
then
[CFLAGS="$CFLAGS -g -D_DEBUG -UNDEBUG -DQSE_BUILD_DEBUG -U_FORTIFY_SOURCE"]
[CXXFLAGS="$CXXFLAGS -g -D_DEBUG -UNDEBUG -DQSE_BUILD_DEBUG -U_FORTIFY_SOURCE"]
AC_SUBST(BUILD_MODE, "debug")
else
[CFLAGS="$CFLAGS -DNDEBUG -U_DEBUG -DQSE_BUILD_RELEASE -U_FORTIFY_SOURCE"]
[CXXFLAGS="$CXXFLAGS -DNDEBUG -U_DEBUG -DQSE_BUILD_RELEASE -U_FORTIFY_SOURCE"]
AC_SUBST(BUILD_MODE, "release")
fi
AC_ARG_ENABLE([cxx],
[AS_HELP_STRING([--enable-cxx],[build the library for C++ if a C++ compiler is available (default. yes)])],
enable_cxx_is=$enableval,
enable_cxx_is=yes
)
dnl disable c++ if no c++ compiler was found
test "${HAVE_CXX}" = "yes" || enable_cxx_is="no"
dnl disable c++ if the compiler is too old.
test "${ax_cv_cxx_have_std_namespace}" = "yes" || enable_cxx_is="no"
AM_CONDITIONAL(ENABLE_CXX, test "${enable_cxx_is}" = "yes" )
AC_ARG_ENABLE([awk-intmax],
[AS_HELP_STRING([--enable-awk-intmax],[use qse_intmax_t for integers in AWK (default. no)])],
enable_awk_intmax_is=$enableval,
enable_awk_intmax_is=no
)
if test "${enable_awk_intmax_is}" = "yes"
then
AC_DEFINE([QSE_USE_AWK_INTMAX],[],[use qse_intmax_t for integers in AWK])
fi
AC_ARG_ENABLE([awk-fltmax],
[AS_HELP_STRING([--enable-awk-fltmax],[use qse_fltmax_t for floating-point numbers in AWK (default. no)])],
enable_awk_fltmax_is=$enableval,