-
Notifications
You must be signed in to change notification settings - Fork 44
/
Copy pathconfigure.ac
1492 lines (1335 loc) · 45.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 Copyright (C) 2004-2024 Alexander Chernov <cher@ejudge.ru>
AC_INIT([ejudge],[3])
AC_PREREQ([2.71])
AC_REVISION($Revision$)
AC_PREFIX_DEFAULT([/opt/ejudge])
AC_USE_SYSTEM_EXTENSIONS
AC_PROG_INSTALL
AC_PROG_AWK
AC_PROG_GREP
AC_PROG_SED
AC_PROG_LN_S
AC_PROG_MKDIR_P
AC_PROG_YACC
AC_PROG_LEX(noyywrap)
if ! which which > /dev/null 2>/dev/null
then
echo "'which' program is not found, please install it." >&2
echo "The package is probably called 'which'." >&2
exit 1
fi
for tool in gawk grep sed make rm cp ln ar cat chmod mkdir tar gzip bzip2
do
if ! which "$tool" >/dev/null 2>/dev/null
then
echo "'$tool' program is not found. Please, install it." >&2
exit 1
fi
done
AC_PROG_CC
AC_PROG_CC_C_O
AC_PROG_CPP
AC_C_BACKSLASH_A
AC_C_BIGENDIAN
AC_C_CONST
AC_C_RESTRICT
AC_C_VOLATILE
AC_C_INLINE
AC_C_CHAR_UNSIGNED
AC_TYPE_LONG_DOUBLE
AC_C_STRINGIZE
AC_C_PROTOTYPES
AC_ARG_WITH([lib32dir], AS_HELP_STRING([--with-lib32dir=DIR],[specify directory for 32-bit libraries]),[lib32dir=$withval])
AC_ARG_WITH([libcap], AS_HELP_STRING([--with-libcap=LIBCAP-DIR],[use the linux capability library]),[ac_cv_libcap_root=$withval])
AC_ARG_WITH([libcap-include-dir], AS_HELP_STRING([--with-libcap-include-dir],[specify non-standard location of <sys/capability.h> [[LIBCAP-DIR/include]]]),[ac_cv_libcap_include_dir=$withval])
AC_ARG_WITH([libcap-lib-dir], AS_HELP_STRING([--with-libcap-lib-dir],[specify non-standard location for -lcap [[LIBCAP-DIR/lib]]]), [ac_cv_libcap_lib_dir=$withval])
AC_ARG_WITH([expat], AS_HELP_STRING([--with-expat=EXPAT-DIR],[specify non-standard path to expat library]),[ac_cv_expat_root=$withval])
AC_ARG_WITH([expat-include-dir],AS_HELP_STRING([--with-expat-include-dir],[specify non-standard location of <expat.h> [[EXPAT-DIR/include]]]),[ac_cv_expat_include_dir=$withval])
AC_ARG_WITH([expat-lib-dir],AS_HELP_STRING([--with-expat-lib-dir],[specify non-standard location of -lexpat [[EXPAT-DIR/lib]]]),[ac_cv_expat_lib_dir=$withval])
AC_ARG_WITH([mysql], AS_HELP_STRING([--with-mysql=MYSQL-DIR],[specify the path to the mysql installation directory]),[ac_cv_mysql_root="$withval"])
AC_ARG_ENABLE([cgi-suffix], AS_HELP_STRING([--enable-cgi-suffix],[append the given suffix to the CGI programs]),[ac_cv_cgi_suffix=$enableval],[ac_cv_cgi_suffix=""])
AC_ARG_ENABLE([cgi-bin-dir], AS_HELP_STRING([--enable-cgi-bin-dir],[specify the destination CGI script directory [[\${prefix}/libexec/ejudge/cgi-bin]]]),[cgibindir=$enableval], [cgibindir='${libexecdir}/ejudge/cgi-bin'])
AC_ARG_ENABLE([static], AS_HELP_STRING([--enable-static],[link programs statically]),[ac_cv_static=1],[ac_cv_static=""])
AC_ARG_ENABLE([rpath], AS_HELP_STRING([--disable-rpath],[do not use -rpath feature]),[ac_cv_rpath="$enableval"])
AC_ARG_ENABLE([nls], AS_HELP_STRING([--disable-nls],[disable localization]),[ac_cv_nls=$enableval],[ac_cv_nls=""])
AC_ARG_ENABLE([charset],AS_HELP_STRING([--enable-charset],[specify the default charset]),[ac_cv_charset="$enableval"],[ac_cv_charset=""])
AC_ARG_ENABLE([socket-path],AS_HELP_STRING([--enable-socket-path],[specify the default userlist-server socket path]),[ac_cv_socket_path="$enableval"],[ac_cv_socket_path=""])
AC_ARG_ENABLE([super-serve-socket],AS_HELP_STRING([--enable-super-serve-socket],[specify the default super-serve socket path]),[ac_cv_super_serve_socket="$enableval"],[ac_cv_super_serve_socket=""])
AC_ARG_ENABLE([new-server-socket],AS_HELP_STRING([--enable-new-server-socket],[specify the default new-server socket path]),[ac_cv_new_server_socket="$enableval"],[ac_cv_new_server_socket=""])
AC_ARG_ENABLE([conf-dir], AS_HELP_STRING([--enable-conf-dir=CONF-DIR],[specify the ejudge configuration directory]),[ac_cv_conf_dir="$enableval"],[ac_cv_conf_dir=""])
AC_ARG_ENABLE([cgi-conf-dir], AS_HELP_STRING([--enable-cgi-conf-dir],[specify path to CGI configuration files]),[ac_cv_cgi_conf_dir="$enableval"],[ac_cv_cgi_conf_dir=""])
AC_ARG_ENABLE([ejudge-xml],AS_HELP_STRING([--enable-ejudge-xml],[specify the default location of ejudge.xml]),[ac_cv_ejudge_xml="$enableval"],[ac_cv_ejudge_xml=""])
AC_ARG_ENABLE([contests-dir],AS_HELP_STRING([--enable-contests-dir],[specify the default path to the contest configuration directory]),[ac_cv_contests_dir="$enableval"],[ac_cv_contests_dir=""])
AC_ARG_ENABLE([contests-home-dir],AS_HELP_STRING([--enable-contests-home-dir],[specify the default path to the contests home directory]),[ac_cv_contests_home_dir="$enableval"],[ac_cv_contests_home_dir=""])
AC_ARG_ENABLE([compile-spool-dir],AS_HELP_STRING([--enable-compile-spool-dir],[specify the path to the compile spool directory]),[ac_cv_compile_spool_dir="$enableval"],[ac_cv_compile_spool_dir=""])
AC_ARG_ENABLE([run-spool-dir],AS_HELP_STRING([--enable-run-spool-dir],[specify the path to the run spool directory]),[ac_cv_run_spool_dir="$enableval"],[ac_cv_run_spool_dir=""])
AC_ARG_ENABLE([contests-status-dir],AS_HELP_STRING([--enable-contests-status-dir],[specify the path to the contest status directory]),[ac_cv_contests_status_dir="$enableval"],[ac_cv_contests_status_dir=""])
AC_ARG_ENABLE([local-dir],AS_HELP_STRING([--enable-local-dir],[specify the default path to the local state directory]),[ac_cv_local_dir="$enableval"],[ac_cv_local_dir=""])
AC_ARG_ENABLE([ajax],AS_HELP_STRING([--enable-ajax],[enable use of the ajax technology for the client web interface]),[ac_cv_ajax="$enableval"],[ac_cv_ajax=""])
AC_ARG_ENABLE([style-prefix],AS_HELP_STRING([--enable-style-prefix],[specify the prefix for HTML style files]),[ac_cv_style_prefix="$enableval"],[ac_cv_style_prefix=""])
AC_ARG_ENABLE([hidden-server-bins],AS_HELP_STRING([--enable-hidden-server-bins],[do not install the server binaries into bin directory]),[ac_cv_hidden_bins=1],[ac_cv_hidden_bins=])
AC_ARG_ENABLE([werror],AS_HELP_STRING([--enable-werror],[enable -Werror compilation flag]),[ac_cv_werror_flag=-Werror],[ac_cv_werror_flag=])
AC_ARG_ENABLE([preserve-scripts],AS_HELP_STRING([--enable-preserve-scripts],[do not overwrite the existing language scripts]), [ac_cv_preserve_scripts=1],[ac_cv_preserve_scripts=])
AC_ARG_ENABLE([lang-config-dir],AS_HELP_STRING([--enable-lang-config-dir],[install language config scripts into specified directory]),[ac_cv_lang_config_dir="${enableval}"],[ac_cv_lang_config_dir=])
AC_ARG_ENABLE([libmongoc],AS_HELP_STRING([--enable-libmongoc],[enable libmongoc mongo client library]),[ac_cv_enable_libmongoc="${enableval}"],[ac_cv_enable_libmongoc=])
AC_ARG_WITH([rest],AS_HELP_STRING([--with-rest],[enable RESTful API]),[ac_cv_rest="$withval"])
AC_ARG_WITH([primary-user],AS_HELP_STRING([--with-primary-user],[primary ejudge user]),[ac_cv_primary_user="$withval"])
AC_ARG_WITH([exec-user],AS_HELP_STRING([--with-exec-user],[ejudge executer user]),[ac_cv_exec_user="$withval"])
AC_ARG_WITH([compile-user],AS_HELP_STRING([--with-compile-user],[ejudge compiler user]),[ac_cv_compile_user="$withval"])
AC_ARG_WITH([httpd-cgi-bin-dir],AS_HELP_STRING([--with-httpd-cgi-bin-dir],[specify the path to the web serve CGI directory]),[ac_cv_httpd_cgi_bin_dir="${withval}"])
AC_ARG_WITH([httpd-htdocs-dir],AS_HELP_STRING([--with-httpd-htdocs-dir],[specify the path to the web server HTML directory]),[ac_cv_httpd_htdocs_dir="${withval}"])
AC_ARG_WITH([festival],AS_HELP_STRING([--with-festival],[specify the home directory of the festival speech generator]),[ac_cv_festival_home="$withval"])
dnl setup default values
[[ x"${ac_cv_contests_home_dir}" = x -o x"${ac_cv_contests_home_dir}" = xyes ]] && ac_cv_contests_home_dir="/home/judges"
[[ x"${ac_cv_local_dir}" = xyes ]] && ac_cv_local_dir="/var/lib/ejudge"
if [[ x"${ac_cv_local_dir}" != x ]]
then
[[ x"${ac_cv_socket_path}" = x -o x"${ac_cv_socket_path}" = xyes ]] && ac_cv_socket_path="${ac_cv_local_dir}/sockets/userlist"
[[ x"${ac_cv_super_serve_socket}" = x -o x"${ac_cv_super_serve_socket}" = xyes ]] && ac_cv_super_serve_socket="${ac_cv_local_dir}/sockets/super-serve"
[[ x"${ac_cv_new_server_socket}" = x -o x"${ac_cv_new_server_socket}" = xyes ]] && ac_cv_new_server_socket="${ac_cv_local_dir}/sockets/new-server"
else
[[ x"${ac_cv_socket_path}" = x -o x"${ac_cv_socket_path}" = xyes ]] && ac_cv_socket_path="${ac_cv_contests_home_dir}/var/socket/userlist-socket"
[[ x"${ac_cv_super_serve_socket}" = x -o x"${ac_cv_super_serve_socket}" = xyes ]] && ac_cv_super_serve_socket="${ac_cv_contests_home_dir}/var/socket/super-serve-socket"
[[ x"${ac_cv_new_server_socket}" = x -o x"${ac_cv_new_server_socket}" = xyes ]] && ac_cv_new_server_socket="${ac_cv_contests_home_dir}/var/socket/new-server-socket"
fi
[[ x"${ac_cv_conf_dir}" = x -o x"${ac_cv_conf_dir}" = xyes ]] && ac_cv_conf_dir="${ac_cv_contests_home_dir}/data"
[[ x"${ac_cv_cgi_conf_dir}" = x -o x"${ac_cv_cgi_conf_dir}" = xyes ]] && ac_cv_cgi_conf_dir="../cgi-data"
[[ x"${ac_cv_style_prefix}" = x -o x"${ac_cv_style_prefix}" = xyes ]] && ac_cv_style_prefix="/ejudge/"
[[ x"${ac_cv_lang_config_dir}" = x -o x"${ac_cv_lang_config_dir}" = xyes ]] && ac_cv_lang_config_dir="${ac_cv_contests_home_dir}/compile/conf/lang.d"
[[ x"${ac_cv_compile_spool_dir}" = xyes ]] && ac_cv_compile_spool_dir=`dirname "${ac_cv_contests_home_dir}"`/ej-compile-spool
[[ x"${ac_cv_run_spool_dir}" = xyes ]] && ac_cv_run_spool_dir=`dirname "${ac_cv_contests_home_dir}"`/ej-run-spool
if [[ x"${ac_cv_contests_status_dir}" = xyes ]]
then
if [[ x"${ac_cv_local_dir}" != x ]]
then
ac_cv_contests_status_dir="${ac_cv_local_dir}"/status
else
ac_cv_contests_status_dir=`dirname "${ac_cv_contests_home_dir}"`/ej-status
fi
fi
machine=`uname -m`
case "${machine}" in
x86_64)
if [[ x"${libdir}" = x'${exec_prefix}/lib' ]]
then
libdir='${exec_prefix}/lib64'
fi
if [[ x"${lib32dir}" = x ]]
then
lib32dir='${exec_prefix}/lib'
fi
ac_cv_conf_64_bit=1
;;
esac
dnl choose an arch type
AC_MSG_CHECKING([for arch type])
case "${target}" in
*-*-mingw*)
ac_cv_ejudge_arch=win32
ac_cv_exe_suffix=.exe
ac_cv_conf_dos_filenaming=1
ac_cv_dir_separator='\\'
ac_cv_path_separator=';'
#CFLAGS="${CFLAGS} -mno-cygwin"
#LDFLAGS="${LDFLAGS} -mno-cygwin"
AC_MSG_RESULT([win32])
;;
*)
ac_cv_ejudge_arch=unix
ac_cv_exe_suffix=
ac_cv_conf_unix_filenaming=1
ac_cv_dir_separator='/'
ac_cv_path_separator=':'
AC_MSG_RESULT([unix])
;;
esac
if [[ x"${ac_cv_ejudge_arch}" != xwin32 ]]
then
AC_CHECK_HEADERS([termios.h])
fi
AC_CHECK_HEADERS([iconv.h pwd.h])
AC_CHECK_FUNCS([strnlen open_memstream fmemopen truncate setsid pselect ferror_unlocked fgets_unlocked])
AC_CHECK_LIB([iconv],[iconv],[ac_cv_has_lib_iconv=-liconv],[ac_cv_has_lib_iconv=])
AC_CHECK_LIB([iconv],[libiconv],[ac_cv_has_lib_libiconv=-liconv],[ac_cv_has_lib_libiconv=])
saved_CFLAGS="${CFLAGS}"
saved_LIBS="${LIBS}"
CFLAGS="${CFLAGS} -Werror -Wall"
LIBS=" ${ac_cv_has_lib_libiconv} ${ac_cv_has_lib_iconv}"
AC_MSG_CHECKING([that iconv requires const qualifier])
AC_RUN_IFELSE(
[AC_LANG_SOURCE([[
#include <iconv.h>
#include <stdio.h>
int main(void)
{
iconv_t cvt = iconv_open("iso8859-1", "utf-8");
const char str1[] = "123";
char str2[16];
size_t sz1 = 3, sz2 = 16, sz3;
const char *p1 = str1;
char *p2 = str2;
sz3 = iconv(cvt, &p1, &sz1, &p2, &sz2);
return 0;
}
]])],[
AC_MSG_RESULT([yes])
ac_cv_iconv_needs_const=1
],[
AC_MSG_RESULT([no])
ac_cv_iconv_needs_const=""
])
LIBS="${saved_LIBS}"
CFLAGS="${saved_CFLAGS}"
ac_cv_have_so_passcred=
AC_MSG_CHECKING([SO_PASSCRED flag])
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <sys/types.h>
#include <sys/socket.h>
int main()
{
int val = 1;
setsockopt(0, SOL_SOCKET, SO_PASSCRED, &val, sizeof(val));
return 0;
}
]])],[
AC_MSG_RESULT([yes])
ac_cv_have_so_passcred=1
],[
AC_MSG_RESULT([no])
])
ac_cv_have_siocing=
AC_MSG_CHECKING([SIOCINQ flag])
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <sys/ioctl.h>
#include <linux/sockios.h>
int main()
{
int sz = 0;
ioctl(0, SIOCINQ, &sz);
return 0;
}
]])],[
AC_MSG_RESULT([yes])
ac_cv_have_siocing=1
],[
AC_MSG_RESULT([no])
])
ac_cv_have_f_notify=
AC_MSG_CHECKING([F_NOTIFY flag])
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#define _GNU_SOURCE
#include <unistd.h>
#include <sys/types.h>
#include <fcntl.h>
#include <signal.h>
#include <sys/wait.h>
#include <time.h>
int main()
{
fcntl(0, F_SETSIG, SIGRTMIN);
fcntl(0, F_NOTIFY, DN_CREATE | DN_DELETE | DN_RENAME | DN_MULTISHOT);
return 0;
}
]])],[
AC_MSG_RESULT([yes])
ac_cv_have_f_notify=1
],[
AC_MSG_RESULT([no])
])
dnl Expat checking stuff
ac_cv_has_expat=1
[[ x"${ac_cv_expat_root}" = xno ]] && ac_cv_has_expat=""
if [[ x"${ac_cv_expat_root}" = x -o x"${ac_cv_expat_root}" = xyes ]]
then
[[ x"${ac_cv_expat_include_dir}" = x -o x"${ac_cv_expat_include_dir}" = xyes -o x"${ac_cv_expat_include_dir}" = xno ]] && ac_cv_expat_include_dir=""
[[ x"${ac_cv_expat_lib_dir}" = x -o x"${ac_cv_expat_lib_dir}" = xyes -o x"${ac_cv_expat_lib_dir}" = xno ]] && ac_cv_expat_lib_dir=""
else
[[ x"${ac_cv_expat_include_dir}" = x -o x"${ac_cv_expat_include_dir}" = xyes -o x"${ac_cv_expat_include_dir}" = xno ]] && ac_cv_expat_include_dir="${ac_cv_expat_root}/include"
[[ x"${ac_cv_expat_lib_dir}" = x -o x"${ac_cv_expat_lib_dir}" = xyes -o x"${ac_cv_expat_lib_dir}" = xno ]] && ac_cv_expat_lib_dir="${ac_cv_expat_root}/lib"
fi
ac_cv_expat_include_opt=
[[ x"${ac_cv_expat_include_dir}" != x ]] && ac_cv_expat_include_opt="-I${ac_cv_expat_include_dir}"
ac_cv_expat_lib_opt=
[[ x"${ac_cv_expat_lib_dir}" != x ]] && ac_cv_expat_lib_opt="-L${ac_cv_expat_lib_dir}"
saved_CFLAGS="${CFLAGS}"
saved_CPPFLAGS="${CPPFLAGS}"
saved_LDFLAGS="${LDFLAGS}"
saved_LIBS="${LIBS}"
CFLAGS="${CFLAGS} ${ac_cv_expat_include_opt}"
CPPFLAGS="${CPPFLAGS} ${ac_cv_expat_include_opt}"
LDFLAGS="${LDFLAGS} ${ac_cv_expat_lib_opt}"
LIBS="-lexpat ${LIBS}"
if [[ x"${ac_cv_has_expat}" = x1 ]]
then
AC_CHECK_HEADER([expat.h],[ac_cv_has_expat=1],[ac_cv_has_expat=""])
fi
if [[ x"${ac_cv_has_expat}" = x1 ]]
then
AC_CHECK_LIB([expat],[XML_ExpatVersionInfo],[ac_cv_has_expat=1],[ac_cv_has_expat=""])
fi
if [[ x"${ac_cv_has_expat}" = x1 ]]
then
AC_MSG_CHECKING([that version of the expat library >= 1.95])
AC_RUN_IFELSE(
[AC_LANG_SOURCE([[
#include <expat.h>
#include <stdio.h>
int main(void)
{
XML_Expat_Version v;
v = XML_ExpatVersionInfo();
if (v.major > 1) return 0;
if (v.minor >= 95) return 0;
return 1;
}
]])],[
AC_MSG_RESULT([yes])
ac_cv_has_expat=1
],[
AC_MSG_RESULT([no])
ac_cv_has_expat=""
])
fi
CFLAGS="${saved_CFLAGS}"
CPPFLAGS="${saved_CPPFLAGS}"
LDFLAGS="${saved_LDFLAGS}"
LIBS="${saved_LIBS}"
if [[ x"${ac_cv_has_expat}" = x -a x"${ac_cv_ejudge_arch}" != xwin32 ]]
then
AC_MSG_FAILURE([expat XML parsing library missing])
fi
dnl check zlib library
AC_CHECK_HEADER([zlib.h],[ac_cv_has_zlib=1],[ac_cv_has_zlib=0])
if [[ x"${ac_cv_has_zlib}" != x1 ]]
then
AC_MSG_FAILURE([zlib.h is missing, please install zlib development package])
fi
AC_CHECK_LIB([z],[compressBound],[ac_cv_has_zlib=1],[ac_cv_has_zlib=0])
if [[ x"${ac_cv_has_zlib}" != x1 ]]
then
AC_MSG_FAILURE([zlib is too old or unusable, please update zlib])
fi
AC_MSG_CHECKING([that version of zlib >= 1.2])
AC_RUN_IFELSE(
[AC_LANG_SOURCE([[
#include <zlib.h>
#include <stdio.h>
int main(void)
{
if (ZLIB_VERNUM >= 0x1200) return 0;
return 1;
}
]])],[
AC_MSG_RESULT([yes])
ac_cv_has_zlib=1
],[
AC_MSG_RESULT([no])
ac_cv_has_zlib=0
])
if [[ x"${ac_cv_has_zlib}" != x1 ]]
then
AC_MSG_FAILURE([zlib is too old or unusable, please update zlib])
fi
AC_CHECK_LIB([intl],[gettext],[ac_cv_has_lib_intl=-lintl],[ac_cv_has_lib_intl=])
dnl check ncurses library
AC_CHECK_HEADER([ncurses.h],[ac_cv_has_ncurses=1],[ac_cv_has_ncurses=0])
#if [[ x"${ac_cv_has_ncurses}" != x1 ]]
#then
# AC_MSG_FAILURE([ncurses.h is missing, please install ncurses development package])
#fi
dnl check for menu.h
AC_CHECK_HEADER([menu.h],[ac_cv_ncurses_menu=1],[ac_cv_ncurses_menu=0])
dnl check for ncurses/menu.h
AC_CHECK_HEADER([ncurses/menu.h],[ac_cv_ncurses_ncurses_menu=1],[ac_cv_ncurses_ncurses_menu=0])
if [[ "$ac_cv_ncurses_menu" = "0" -a "$ac_cv_ncurses_ncurses_menu" = "1" ]]
then
ac_cv_ncurses_include=" -I/usr/include/ncurses"
fi
dnl check zlib library
AC_CHECK_HEADER([zip.h],[ac_cv_has_libzip=1],[ac_cv_has_libzip=0])
AC_CHECK_LIB([zip],[zip_open],[ac_cv_has_lib_libzip=-lzip],[ac_cv_has_lib_libzip=])
AC_CHECK_HEADER([lzma.h],[ac_cv_has_liblzma=1],[ac_cv_has_liblzma=0])
AC_CHECK_LIB([lzma],[lzma_version_string],[ac_cv_has_lib_liblzma=-llzma],[ac_cv_has_lib_liblzma=])
dnl check hiredis redis client library
AC_CHECK_HEADER([hiredis/hiredis.h],[ac_cv_has_hiredis=1],[ac_cv_has_hiredis=0])
AC_CHECK_LIB([hiredis],[redisConnectWithTimeout],[ac_cv_has_lib_hiredis=-lhiredis],[ac_cv_has_lib_hiredis=])
dnl check libcurl library
AC_CHECK_HEADER([curl/curl.h],[ac_cv_has_libcurl=1],[ac_cv_has_libcurl=0])
AC_CHECK_LIB([curl],[curl_easy_init],[ac_cv_has_lib_libcurl=-lcurl],[ac_cv_has_lib_libcurl=])
dnl check libuuid library
AC_CHECK_HEADER([uuid/uuid.h],[ac_cv_has_libuuid=1],[ac_cv_has_libuuid=0])
if [[ x"${ac_cv_has_libuuid}" != x1 -a x"${ac_cv_ejudge_arch}" != xwin32 ]]
then
AC_MSG_FAILURE([please install libuuid development package])
fi
AC_CHECK_LIB([uuid],[uuid_parse],[ac_cv_has_lib_libuuid=-luuid],[ac_cv_has_lib_libuuid=])
if [[ x"${ac_cv_has_libuuid}" != x1 -a x"${ac_cv_ejudge_arch}" != xwin32 ]]
then
AC_MSG_FAILURE([please install libuuid development package])
fi
dnl check regex library
AC_CHECK_HEADER([regex.h],[ac_cv_has_regex=1],[ac_cv_has_regex=0])
dnl check libelf library
AC_CHECK_HEADER([libelf.h],[ac_cv_has_libelf=1],[ac_cv_has_libelf=0])
if [[ x"${ac_cv_has_libelf}" != x1 -a x"${ac_cv_ejudge_arch}" != xwin32 ]]
then
AC_MSG_FAILURE([please install libelf development package])
fi
AC_CHECK_LIB([elf],[elf_begin],[ac_cv_has_libelf=1],[ac_cv_has_libelf=0])
if [[ x"${ac_cv_has_libelf}" != x1 -a x"${ac_cv_ejudge_arch}" != xwin32 ]]
then
AC_MSG_FAILURE([please install libelf development package])
fi
dnl checl libdwarf library
dnl saved_LIBS="${LIBS}"
dnl LIBS="-lelf"
dnl AC_CHECK_HEADER([libdwarf/libdwarf.h],[ac_cv_has_libdwarf=1],[ac_cv_has_libdwarf=0])
dnl if [[ x"${ac_cv_has_libdwarf}" != x1 -a x"${ac_cv_ejudge_arch}" != xwin32 ]]
dnl then
dnl AC_MSG_FAILURE([please install libdwarf development package])
dnl fi
dnl AC_CHECK_LIB([dwarf],[dwarf_init],[ac_cv_has_libdwarf=1],[ac_cv_has_libdwarf=0])
dnl if [[ x"${ac_cv_has_libdwarf}" != x1 -a x"${ac_cv_ejudge_arch}" != xwin32 ]]
dnl then
dnl AC_MSG_FAILURE([please install libdwarf development package])
dnl fi
dnl LIBS="${saved_LIBS}"
dnl Libcap checking stuff
ac_cv_has_libcap=1
if [[ x"${ac_cv_libcap_root}" = xno ]]
then
ac_cv_has_libcap=
fi
if [[ x"${ac_cv_libcap_root}" = x -o x"${ac_cv_libcap_root}" = xyes ]]
then
[[ x"${ac_cv_libcap_include_dir}" = x -o x"${ac_cv_libcap_include_dir}" = xyes -o x"${ac_cv_libcap_include_dir}" = xno ]] && ac_cv_libcap_include_dir=""
[[ x"${ac_cv_libcap_lib_dir}" = x -o x"${ac_cv_libcap_lib_dir}" = xyes -o x"${ac_cv_libcap_lib_dir}" = xno ]] && ac_cv_libcap_lib_dir=""
else
[[ x"${ac_cv_libcap_include_dir}" = x -o x"${ac_cv_libcap_include_dir}" = xyes -o x"${ac_cv_libcap_include_dir}" = xno ]] && ac_cv_libcap_include_dir="${ac_cv_libcap_root}/include"
[[ x"${ac_cv_libcap_lib_dir}" = x -o x"${ac_cv_libcap_lib_dir}" = xyes -o x"${ac_cv_libcap_lib_dir}" = xno ]] && ac_cv_libcap_lib_dir="${ac_cv_expat_root}/lib"
fi
ac_cv_libcap_include_opt=
[[ x"${ac_cv_libcap_include_dir}" != x ]] && ac_cv_libcap_include_opt="-I${ac_cv_libcap_include_dir}"
ac_cv_libcap_lib_opt=
[[ x"${ac_cv_libcap_lib_dir}" != x ]] && ac_cv_libcap_lib_opt="-L${ac_cv_libcap_lib_dir}"
saved_CFLAGS="${CFLAGS}"
saved_CPPFLAGS="${CPPFLAGS}"
saved_LDFLAGS="${LDFLAGS}"
saved_LIBS="${LIBS}"
CFLAGS="${CFLAGS} ${ac_cv_libcap_include_opt}"
CPPFLAGS="${CPPFLAGS} ${ac_cv_libcap_include_opt}"
LDFLAGS="${LDFLAGS} ${ac_cv_libcap_lib_opt}"
LIBS="-lcap ${LIBS}"
if [[ x"${ac_cv_has_libcap}" = x1 ]]
then
AC_CHECK_HEADER([sys/capability.h],
[ac_cv_has_libcap=1],
[ac_cv_has_libcap=""],
[
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <signal.h>
#include <errno.h>
])
fi
if [[ x"${ac_cv_has_libcap}" = x1 ]]
then
AC_CHECK_LIB([cap], [cap_get_proc],
[ac_cv_has_libcap=1],
[ac_cv_has_libcap=""])
fi
if [[ x"${ac_cv_has_libcap}" = x1 ]]
then
AC_MSG_CHECKING([for CAP_SYS_OPERATIONS bit])
AC_LINK_IFELSE(
[AC_LANG_SOURCE([[
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <signal.h>
#include <errno.h>
#include <sys/capability.h>
int main(void)
{
cap_t old_caps, new_caps;
int setcaps[] = { CAP_SYS_OPERATIONS };
old_caps = cap_get_proc();
new_caps = cap_dup(old_caps);
cap_set_flag(new_caps, CAP_EFFECTIVE, 1, setcaps, CAP_CLEAR);
cap_set_flag(new_caps, CAP_PERMITTED, 1, setcaps, CAP_CLEAR);
cap_set_flag(new_caps, CAP_INHERITABLE, 1, setcaps, CAP_CLEAR);
cap_set_proc(new_caps);
return 0;
}
]])],
[
AC_MSG_RESULT([supported])
ac_cv_has_libcap=1
],
[
AC_MSG_RESULT([missing])
ac_cv_has_libcap=""
])
fi
if [[ x"${ac_cv_has_libcap}" = x1 ]]
then
AC_MSG_CHECKING([for support of CAP_SYS_OPERATIONS bit in the running kernel])
AC_RUN_IFELSE(
[AC_LANG_SOURCE([[
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <signal.h>
#include <errno.h>
#include <sys/capability.h>
int main(void)
{
cap_t old_caps, new_caps;
int setcaps[] = { CAP_SYS_OPERATIONS };
int p;
old_caps = cap_get_proc();
new_caps = cap_dup(old_caps);
cap_set_flag(new_caps, CAP_EFFECTIVE, 1, setcaps, CAP_CLEAR);
cap_set_flag(new_caps, CAP_PERMITTED, 1, setcaps, CAP_CLEAR);
cap_set_flag(new_caps, CAP_INHERITABLE, 1, setcaps, CAP_CLEAR);
if (cap_set_proc(new_caps) < 0) return 1;
if ((p = fork()) < 0 && errno == EPERM) return 0;
if (p < 0) return 1;
if (!p) _exit(1);
return 1;
}
]])],
[
AC_MSG_RESULT([supported])
ac_cv_has_runtime_libcap=1
],
[
AC_MSG_RESULT([not supported])
ac_cv_has_runtime_libcap=""
])
fi
CFLAGS="${saved_CFLAGS}"
CPPFLAGS="${saved_CPPFLAGS}"
LDFLAGS="${saved_LDFLAGS}"
LIBS="${saved_LIBS}"
AC_MSG_CHECKING([for new secure execution interface in the running kernel])
AC_RUN_IFELSE(
[AC_LANG_SOURCE([[
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <signal.h>
#include <errno.h>
#include <sys/ptrace.h>
int main(void)
{
int p;
if (ptrace(0x4281, 0, 0, 0) < 0) _exit(1);
if ((p = fork()) < 0 && errno == EPERM) return 0;
if (p < 0) return 1;
if (!p) _exit(1);
return 1;
}
]])],
[
AC_MSG_RESULT([supported])
ac_cv_has_new_secure_exec=1
],
[
AC_MSG_RESULT([not supported])
ac_cv_has_new_secure_exec=""
])
#if [[ x"${ac_cv_has_libcap}" = x -a x"${ac_cv_has_new_secure_exec}" = x ]]
#then
#ac_cv_no_kernel=1
#else
#ac_cv_no_kernel=
#fi
dnl MySQL checking stuff
ac_cv_has_mysql=1
if [[ x"${ac_cv_mysql_root}" = xno ]]
then
ac_cv_has_mysql=
fi
if [[ x"${ac_cv_mysql_root}" = xyes ]]
then
ac_cv_mysql_root=
fi
if [[ x"${ac_cv_has_mysql}" = x1 ]]
then
if [[ x"${ac_cv_mysql_root}" = x ]]
then
mysqlconfig="mysql_config"
else
mysqlconfig="${ac_cv_mysql_root}/bin/mysql_config"
fi
AC_MSG_CHECKING([for mysql library])
mysqlversion=`"${mysqlconfig}" --version 2>/dev/null`
if [[ $? != 0 -o x"${mysqlversion}" = x ]]
then
AC_MSG_RESULT([none])
ac_cv_has_mysql=
else
AC_MSG_RESULT([version "${mysqlversion}"])
fi
fi
if [[ x"${ac_cv_has_mysql}" = x1 ]]
then
AC_MSG_CHECKING([for mysql compilation flags ])
ac_cv_mysql_include_opt=`"${mysqlconfig}" --cflags 2>/dev/null`
if [[ $? != 0 ]]
then
ac_cv_has_mysql=
fi
tmp_libs=`"${mysqlconfig}" --libs 2>/dev/null`
if [[ $? != 0 ]]
then
ac_cv_has_mysql=
fi
dnl split --libs output into library paths, adding -rpath specs
if [[ x"${ac_cv_has_mysql}" = x1 ]]
then
for xx in ${tmp_libs}
do
case "$xx" in
-L*)
[[ x"${ac_cv_mysql_lib_opt}" != x ]] && ac_cv_mysql_lib_opt="${ac_cv_mysql_lib_opt} "
ac_cv_mysql_lib_opt="${ac_cv_mysql_lib_opt}${xx}"
if [[ x"${ac_cv_rpath}" != xno ]]
then
tmp_rpath=`echo "$xx" | sed s+-L+-Wl,-rpath,+`
ac_cv_mysql_lib_opt="${ac_cv_mysql_lib_opt} ${tmp_rpath}"
fi
;;
-l*)
[[ x"${ac_cv_mysql_libs}" != x ]] && ac_cv_mysql_libs="${ac_cv_mysql_libs} "
ac_cv_mysql_libs="${ac_cv_mysql_libs}${xx}"
;;
*)
[[ x"${ac_cv_mysql_lib_opt}" != x ]] && ac_cv_mysql_lib_opt="${ac_cv_mysql_lib_opt} "
ac_cv_mysql_lib_opt="${ac_cv_mysql_lib_opt}${xx}"
;;
esac
done
fi
if [[ x"${ac_cv_has_mysql}" = x1 ]]
then
AC_MSG_RESULT([ok])
else
AC_MSG_RESULT([failed])
fi
fi
saved_CFLAGS="${CFLAGS}"
saved_CPPFLAGS="${CPPFLAGS}"
saved_LDFLAGS="${LDFLAGS}"
saved_LIBS="${LIBS}"
CFLAGS="${CFLAGS} ${ac_cv_mysql_include_opt}"
CPPFLAGS="${CPPFLAGS} ${ac_cv_mysql_include_opt}"
LDFLAGS="${LDFLAGS} ${ac_cv_mysql_lib_opt}"
LIBS="${ac_cv_mysql_libs} ${LIBS}"
if [[ x"${ac_cv_has_mysql}" = x1 ]]
then
AC_CHECK_HEADER([mysql.h],
[ac_cv_has_mysql=1],
[ac_cv_has_mysql=""],
[
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <signal.h>
#include <errno.h>
])
fi
if [[ x"${ac_cv_has_mysql}" = x1 ]]
then
AC_CHECK_LIB([mysqlclient], [mysql_real_connect],
[ac_cv_has_mysql=1],
[ac_cv_has_mysql=""])
fi
CFLAGS="${saved_CFLAGS}"
CPPFLAGS="${saved_CPPFLAGS}"
LDFLAGS="${saved_LDFLAGS}"
LIBS="${saved_LIBS}"
dnl compiler warning checking
saved_CC="${CC}"
saved_CFLAGS="${CFLAGS}"
AC_MSG_CHECKING([for -Wno-pointer-sign necessity])
CC="${CC} -Wall -Werror"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#include <string.h>
#include <stdio.h>
int main(void)
{
unsigned char *str = "zzz";
int v = strlen(str);
printf("%d\n", v);
return 0;
}
]])],[
AC_MSG_RESULT([no])
],[
AC_MSG_RESULT([yes])
ac_cv_annoying_warning=1
])
if [[ x"${ac_cv_annoying_warning}" = x1 ]]
then
AC_MSG_CHECKING([for -Wno-pointer-sign])
CC="${saved_CC} -Wno-pointer-sign -Werror"
CFLAGS=
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
int main(void)
{
unsigned char *str = "zzz";
(void) str;
return 0;
}
]])],[
AC_MSG_RESULT([yes])
ac_cv_gcc_wno_pointer_sign=-Wno-pointer-sign
],[
AC_MSG_RESULT([no])
])
fi
CC="${saved_CC}"
CFLAGS="${saved_CFLAGS}"
saved_CC="${CC}"
saved_CFLAGS="${CFLAGS}"
AC_MSG_CHECKING([for -Wno-format-truncation necessity])
CC="${CC} -Wall -Werror"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#include <string.h>
#include <stdio.h>
int main(void)
{
char buf1[32];
char buf2[32];
if (fgets(buf1, sizeof(buf1), stdin))
snprintf(buf2, sizeof(buf2), "prefix%s", buf1);
}
]])],[
AC_MSG_RESULT([no])
],[
AC_MSG_RESULT([yes])
ac_cv_annoying_warning2=1
])
if [[ x"${ac_cv_annoying_warning2}" = x1 ]]
then
AC_MSG_CHECKING([for -Wno-format-truncation])
CC="${saved_CC} -Wall -Wno-format-truncation -Werror"
CFLAGS=
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#include <string.h>
#include <stdio.h>
int main(void)
{
char buf1[32];
char buf2[32];
if (fgets(buf1, sizeof(buf1), stdin))
snprintf(buf2, sizeof(buf2), "prefix%s", buf1);
}
]])],[
AC_MSG_RESULT([yes])
ac_cv_gcc_wno_format_truncation=-Wno-format-truncation
],[
AC_MSG_RESULT([no])
])
fi
CC="${saved_CC}"
CFLAGS="${saved_CFLAGS}"
dnl check whether long long is supported
AC_MSG_CHECKING([for long long type])
AC_RUN_IFELSE(
[AC_LANG_SOURCE([[
int main(void)
{
long long a = 0;
unsigned long long b = 0;
signed long long c = 0;
return 0;
}
]])],[
AC_MSG_RESULT([yes])
ac_cv_has_long_long=1
],[
AC_MSG_RESULT([no])
ac_cv_has_long_long=""
])
dnl check whether __int64 is supported
AC_MSG_CHECKING([for __int64 type])
AC_RUN_IFELSE(
[AC_LANG_SOURCE([[
int main(void)
{
__int64 a = 0;
unsigned __int64 b = 0;
signed __int64 c = 0;
return 0;
}
]])],[
AC_MSG_RESULT([yes])
ac_cv_has___int64=1
],[
AC_MSG_RESULT([no])
ac_cv_has___int64=""
])
AC_MSG_CHECKING([for -m32 support])
saved_CC="${CC}"
saved_CFLAGS="${CFLAGS}"
CC="${CC} -m32 -fPIC -DPIC"
CFLAGS=`echo "${CFLAGS}" | sed s/-m32//g | sed s/-m64//g`
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <string.h>
#include <stdio.h>
int main(void)
{
printf("");
return 0;
}
]])],[
AC_MSG_RESULT([yes])
ac_cv_need_32=1
],[
AC_MSG_RESULT([no])
])
CC="${saved_CC}"
CFLAGS="${saved_CFLAGS}"
AC_MSG_CHECKING([for -m64 support])
saved_CC="${CC}"
saved_CFLAGS="${CFLAGS}"
CC="${CC} -m64 -fPIC -DPIC"
CFLAGS=`echo "${CFLAGS}" | sed s/-m32//g | sed s/-m64//g`
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <string.h>
#include <stdio.h>
int main(void)
{
printf("");
return 0;
}
]])],[
AC_MSG_RESULT([yes])
ac_cv_need_64=1
],[
AC_MSG_RESULT([no])
])
CC="${saved_CC}"
CFLAGS="${saved_CFLAGS}"
dnl localization stuff
if [[ x"${ac_cv_nls}" = xno ]]
then
ac_cv_nls=""
else
ac_cv_nls=1
fi
if [[ x"${ac_cv_nls}" = x1 ]]
then
AC_CHECK_PROG([ICONV],[iconv],[iconv],[false])
[[ x"${ICONV}" = xfalse ]] && ac_cv_nls=""
fi
if [[ x"${ac_cv_nls}" = x1 ]]
then
AC_CHECK_PROG([XGETTEXT],[xgettext],[xgettext],[false])
[[ x"${XGETTEXT}" = xfalse ]] && ac_cv_nls=""
fi
if [[ x"${ac_cv_nls}" = x1 ]]
then
AC_CHECK_PROG([MSGMERGE],[msgmerge],[msgmerge],[false])
[[ x"${MSGMERGE}" = xfalse ]] && ac_cv_nls=""
fi
if [[ x"${ac_cv_nls}" = x1 ]]
then
AC_CHECK_PROG([MSGFMT],[msgfmt],[msgfmt],[false])
[[ x"${MSGFMT}" = xfalse ]] && ac_cv_nls=""
fi
if [[ x"${ac_cv_nls}" = x1 -a x"${ac_cv_ejudge_arch}" != xwin32 ]]
then
AC_CHECK_HEADER([locale.h],[],[ac_cv_nls=""])
fi
if [[ x"${ac_cv_nls}" = x1 -a x"${ac_cv_ejudge_arch}" != xwin32 ]]
then
AC_CHECK_HEADER([libintl.h],[],[ac_cv_nls=""])
fi
if [[ x"${ac_cv_enable_libmongoc}" != xdisable ]]
then
AC_MSG_CHECKING([for libmongoc])
if pkg-config --atleast-version 1.13.0 libmongoc-1.0
then
AC_MSG_RESULT([yes])
ac_cv_has_libmongoc=2
elif pkg-config --exists libmongoc-1.0
then
AC_MSG_RESULT([yes])
ac_cv_has_libmongoc=1
else
AC_MSG_RESULT([no])
ac_cv_has_libmongoc=
fi
fi
if [[ x"${ac_cv_has_libmongoc}" != x ]]
then
ac_cv_libmongoc_cflags=`pkg-config --cflags libmongoc-1.0`
ac_cv_libmongoc_libs=`pkg-config --libs libmongoc-1.0`
fi
if [[ x"${ac_cv_has_libmongoc}" = x ]]
then
AC_MSG_CHECKING([for libmongo-client])
if pkg-config --exists libmongo-client
then
AC_MSG_RESULT([yes])
ac_cv_has_libmongo_client=1
else
AC_MSG_RESULT([no])
ac_cv_has_libmongo_client=
fi
if [[ x"${ac_cv_has_libmongo_client}" = x1 ]]
then
ac_cv_libmongo_client_cflags=`pkg-config --cflags libmongo-client`
ac_cv_libmongo_client_libs=`pkg-config --libs libmongo-client`
fi
fi
dnl Checking for available languages
dnl AC_MSG_NOTICE([checking available languages])
dnl Iterate over version scripts in scripts directory
dnl ac_cv_contest_LANG is passed as arg
dnl [[ -d scripts/config.d ]] || mkdir scripts/config.d