-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfigure.ac
5113 lines (3965 loc) · 142 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
EFL_VERSION([1], [14], [0], [release])
AC_INIT([efl], [efl_version-beta2], [[email protected]])
AC_PREREQ([2.60])
AC_CONFIG_SRCDIR([configure.ac])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([config.h])
AH_TOP([
#ifndef EFL_CONFIG_H__
#define EFL_CONFIG_H__
])
AH_BOTTOM([
#endif /* EFL_CONFIG_H__ */
])
AM_INIT_AUTOMAKE([1.6 dist-xz -Wall color-tests subdir-objects])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
# Due to a bug in automake 1.14 we need to use this after AM_INIT_AUTOMAKE
# http://debbugs.gnu.org/cgi/bugreport.cgi?bug=15981
AC_USE_SYSTEM_EXTENSIONS
CFOPT_WARNING=""
#### Apply configuring with legacy api's only, eo api's or both.
EFL_API_LEGACY_DEF="#define EFL_NOLEGACY_API_SUPPORT"
EFL_API_EO_DEF="#define EFL_EO_API_SUPPORT"
efl_api="both"
#### For the moment the Eo EFL API is not ready you need to explicitely optin.
EFL_ENABLE_EO_API_SUPPORT
EFL_ENABLE_BETA_API_SUPPORT
AC_ARG_WITH([api],
[AS_HELP_STRING([--with-api=@<:@eo/legacy/both@:>@],[Select the EFL API Model @<:@default=both@:>@])],
[efl_api=${withval}],
[efl_api="both"])
case "$efl_api" in
eo)
EFL_API_LEGACY_DEF="#define EFL_NOLEGACY_API_SUPPORT"
EFL_API_EO_DEF="#define EFL_EO_API_SUPPORT"
CFOPT_WARNING="xyes"
;;
legacy)
EFL_API_LEGACY_DEF=""
EFL_API_EO_DEF=""
;;
both)
EFL_API_LEGACY_DEF=""
EFL_API_EO_DEF="#define EFL_EO_API_SUPPORT"
;;
*) AC_MSG_ERROR([Invalid api (${efl_api}): must be eo, legacy or both]) ;;
esac
AC_SUBST(EFL_API_LEGACY_DEF)
AC_SUBST(EFL_API_EO_DEF)
#### Additional options to configure
# string to identify the build
AC_ARG_WITH([id],
[AS_HELP_STRING([--with-id=BUILD_ID],[Specify a string to identify the build (vendor, maintainer, etc).
@<:@default=none@:>@])],
[EFL_BUILD_ID="${withval}"],
[EFL_BUILD_ID="none"])
AC_SUBST(EFL_BUILD_ID)
# profile
AC_ARG_WITH([profile],
[AS_HELP_STRING([--with-profile=PROFILE],[use the predefined build profile, one of: dev, debug and release.
@<:@default=dev@:>@])],
[build_profile=${withval}],
[build_profile=def_build_profile])
case "${build_profile}" in
dev|debug|release)
;;
*)
AC_MSG_ERROR([Unknown build profile --with-profile=${build_profile}])
;;
esac
prefer_assert="no"
case "${build_profile}" in
dev|debug)
prefer_assert="yes"
;;
esac
# TODO: add some build "profile" (server, full, etc...)
AC_ARG_WITH([crypto],
[AS_HELP_STRING([--with-crypto=CRYPTO],[use the predefined build crypto, one of:
openssl, gnutls or none.
@<:@default=openssl@:>@])],
[build_crypto=${withval}],
[build_crypto=openssl])
case "${build_crypto}" in
openssl|gnutls|none)
;;
*)
AC_MSG_ERROR([Unknown build crypto option: --with-crypto=${build_crypto}])
;;
esac
AC_ARG_WITH([tests],
[AS_HELP_STRING([--with-tests=none|regular|coverage],[choose testing method: regular, coverage or none.
@<:@default=none@:>@])],
[build_tests=${withval}],
[build_tests=auto])
want_coverage="no"
want_tests="no"
case "${build_tests}" in
auto)
if test "${build_profile}" = "dev"; then
want_tests="yes"
fi
;;
regular)
want_tests="yes"
;;
coverage)
want_tests="yes"
want_coverage="yes"
;;
no*)
;;
*)
AC_MSG_ERROR([Unknown build tests option: --with-tests=${build_tests}])
;;
esac
AC_ARG_WITH([ecore-con-http-test-url],
[AS_HELP_STRING([--with-ecore-con-http-test-url=http://username:[email protected]],[Url of http server for testing with username and password])],[ECORE_CON_HTTP_TEST_URL=${withval}][AC_DEFINE_UNQUOTED([ECORE_CON_HTTP_TEST_URL],["$withval"],[Http url for testing])])
AC_ARG_WITH([ecore-con-ftp-test-url],
[AS_HELP_STRING([--with-ecore-con-ftp-test-url=ftp://username:[email protected]?file=filename&directory=dir],[Url of ftp server for testing with username, password, complete filepath for upload with optional directory])],[ECORE_CON_FTP_TEST_URL=${withval}][AC_DEFINE_UNQUOTED([ECORE_CON_FTP_TEST_URL],["$withval"],[Ftp url for testing])])
dbusservicedir="${datadir}/dbus-1/services"
AC_ARG_WITH([dbus-services],
[AS_HELP_STRING([--with-dbus-services=DBUS_SERVICES],[specify a directory to store dbus service files.])],
[dbusservicedir=$withval])
AC_SUBST(dbusservicedir)
efl_deprecated_option="no"
EFL_WITH_BIN([edje], [edje-cc])
EFL_WITH_BIN([eolian], [eolian-gen])
EFL_WITH_BIN([eolian_cxx], [eolian-cxx])
EFL_WITH_BIN_SUFFIX([elua], [elua], [_bin])
#### Default values
requirements_pc_eflall=""
requirements_pc_deps_eflall=""
requirements_libs_eflall=""
requirements_cflags_eflall=""
requirements_pc_crypto=""
requirements_pc_deps_crypto=""
requirements_libs_crypto=""
requirements_cflags_crypto=""
AC_CANONICAL_HOST
# TODO: move me to m4 file that setups module/so related variables
case "$host_os" in
cegcc*|mingw32ce*)
AC_MSG_ERROR([ceGCC compiler is not supported anymore. Exiting...])
;;
mingw*)
have_win32="yes"
have_windows="yes"
MODULE_ARCH="v-v_maj.v_min"
MODULE_EXT=".dll"
;;
cygwin*)
MODULE_ARCH="v-v_maj.v_min"
MODULE_EXT=".dll"
;;
*)
MODULE_ARCH="v-v_maj.v_min"
MODULE_EXT=".so"
;;
esac
EFL_VERSION_MAJOR="v_maj"
EFL_VERSION_MINOR="v_min"
AC_SUBST(EFL_VERSION_MAJOR)
AC_SUBST(EFL_VERSION_MINOR)
have_systemd_pkg="no"
have_win32="no"
have_windows="no"
have_freebsd="no"
have_darwin="no"
have_linux="no"
have_ps3="no"
case "$host_os" in
mingw*|cygwin*)
# TODO: check cygwin* here
have_win32="yes"
have_windows="yes"
EFLALL_CFLAGS="${EFLALL_CFLAGS} -D__USE_MINGW_ANSI_STDIO"
;;
freebsd*)
have_freebsd="yes"
;;
darwin*)
have_darwin="yes"
;;
linux*)
have_linux="yes"
have_systemd_pkg="auto"
;;
esac
case "$host_vendor" in
ps3*)
have_ps3="yes"
;;
esac
AC_SUBST([MODULE_ARCH])
AC_DEFINE_UNQUOTED([MODULE_ARCH], ["${MODULE_ARCH}"], ["Module architecture"])
AC_DEFINE_UNQUOTED([SHARED_LIB_SUFFIX], ["${MODULE_EXT}"], [Suffix for shared objects])
AC_DEFINE_UNQUOTED([EXEEXT], ["${EXEEXT}"], [Suffix for binary objects])
# TODO: move me to m4 file that setups the windows related variables
AM_CONDITIONAL([HAVE_WIN32], [test "x${have_win32}" = "xyes"])
AM_CONDITIONAL([HAVE_WINDOWS], [test "x${have_windows}" = "xyes"])
AM_CONDITIONAL([HAVE_PS3], [test "x${have_ps3}" = "xyes"])
AM_CONDITIONAL([HAVE_FREEBSD], [test "x${have_freebsd}" = "xyes"])
AM_CONDITIONAL([HAVE_OSX], [test "x${have_darwin}" = "xyes"])
AM_CONDITIONAL([HAVE_X86_64], [test "x${host_cpu}" = "xx86_64"])
#### Checks for programs
### libtool
if test "x${have_windows}" = "xyes" ; then
lt_cv_deplibs_check_method='pass_all'
fi
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
LT_INIT([win32-dll disable-static pic-only])
EFL_INIT
### gettext
AM_GNU_GETTEXT_VERSION([0.18])
m4_ifdef([AC_GNU_GETTEXT], [
AC_GNU_GETTEXT([external])
po_makefile_in=po/Makefile.in
have_po="yes"
],
[
m4_ifdef([AM_GNU_GETTEXT], [
AM_GNU_GETTEXT([external])
po_makefile_in=po/Makefile.in
have_po="yes"
],
[
have_po="no"
])
])
AC_SUBST([LTLIBINTL])
LOCALE_DIR="${localedir}"
AC_SUBST(LOCALE_DIR)
if test "x${POSUB}" = "x" ; then
have_po="no"
fi
AM_CONDITIONAL([HAVE_PO], [test "x${have_po}" = "xyes"])
### compilers
AC_PROG_MKDIR_P
AM_PROG_AS
AC_PROG_CXX
AC_PROG_OBJC
AC_LANG(C)
AC_PROG_CC_C99
AM_PROG_CC_C_O
AC_PROG_SED
AM_CONDITIONAL([BUILD_EFL_NATIVE], [test "x${cross_compiling}" = "xno"])
if test "x${ac_cv_prog_cc_c99}" = "xno" ; then
AC_MSG_ERROR([efl requires a c99-capable compiler])
fi
# We should be using ${CXX} here, but there is a bug in
# autotools macro and CXX is always set to g++ even if
# it's not found. So we are using an internal variable
# that does the work for now, may get broken in the future.
if test "x${ac_ct_CXX}" = "x" -a "x${CXX}" = "xg++"; then
AC_MSG_ERROR([efl requires a C++ compiler got ${ac_ct_CXX} and ${CXX}.])
fi
AC_SYS_LARGEFILE
# pkg-config
PKG_PROG_PKG_CONFIG
if test "x${PKG_CONFIG}" = "x" ; then
AC_MSG_ERROR([pkg-config tool not found. Install it or set PKG_CONFIG environment variable to that path tool. Exiting...])
fi
# doxygen program for documentation building
EFL_CHECK_DOXYGEN([build_doc="yes"], [build_doc="no"])
# lcov
if test "${want_coverage}" = "yes" ; then
AC_CHECK_PROG([have_lcov], [lcov], [yes], [no])
if test "x${have_lcov}" = "xyes" ; then
EFLALL_COV_CFLAGS="${EFLALL_COV_CFLAGS} -fprofile-arcs -ftest-coverage"
EFLALL_COV_LIBS="${EFLALL_COV_LIBS} -lgcov"
if test "x${prefer_assert}" = "xno"; then
EFLALL_COV_CFLAGS="${EFLALL_COV_CFLAGS} -DNDEBUG"
else
EFLALL_COV_CFLAGS="${EFLALL_COV_CFLAGS} -g -O0 -DDEBUG"
fi
else
AC_MSG_ERROR([lcov is not found])
fi
fi
AM_CONDITIONAL([EFL_ENABLE_COVERAGE], [test "${want_coverage}" = "yes"])
#### Checks for libraries
# check unit testing library
if test "${want_tests}" = "yes"; then
PKG_CHECK_MODULES([CHECK], [check >= 0.9.5])
fi
AM_CONDITIONAL([EFL_ENABLE_TESTS], [test "${want_tests}" = "yes"])
# check for crypto/tls library to use
case "$build_crypto" in
gnutls)
EFL_DEPEND_PKG([crypto], [GNUTLS], [gnutls >= 2.12.16])
AM_PATH_LIBGCRYPT([], [:],
[AC_MSG_ERROR([libgcrypt required but not found])])
requirements_libs_crypto="${LIBGCRYPT_LIBS} ${requirements_libs_crypto}"
requirements_cflags_crypto="${LIBGCRYPT_CFLAGS} ${requirements_cflags_crypto}"
;;
openssl)
EFL_DEPEND_PKG([crypto], [OPENSSL], [openssl])
;;
esac
AM_CONDITIONAL([HAVE_CRYPTO_GNUTLS], [test "${build_crypto}" = "gnutls"])
AM_CONDITIONAL([HAVE_CRYPTO_OPENSSL], [test "${build_crypto}" = "openssl"])
# check for lua old
want_lua_old="no"
AC_ARG_ENABLE([lua-old],
[AS_HELP_STRING([--enable-lua-old],[Enable interpreted Lua support (5.1 or 5.2). @<:@default=disabled@:>@])],
[
if test "x${enableval}" = "xyes" ; then
want_lua_old="yes"
else
want_lua_old="no"
fi
],
[want_lua_old="no"])
AM_CONDITIONAL([ENABLE_LUA_OLD], [test "${want_lua_old}" = "yes"])
AC_DEFINE_IF([ENABLE_LUA_OLD], [test "${want_lua_old}" = "yes"],
[1], [Use interpreted Lua (5.1 or 5.2)])
AC_SUBST([want_lua_old])
want_liblz4="no"
AC_ARG_ENABLE([liblz4],
[AS_HELP_STRING([--enable-liblz4],[Enable usage of liblz4 instead of our embedded copy. @<:@default=disabled@:>@])],
[
if test "x${enableval}" = "xyes" ; then
# Only ships pc file since r120
PKG_CHECK_MODULES([LIBLZ4], [liblz4])
EFL_DEPEND_PKG([EET], [LIBLZ4], [liblz4])
EFL_DEPEND_PKG([EVAS], [LIBLZ4], [liblz4])
want_liblz4="yes"
else
want_liblz4="no"
fi
],
[want_liblz4="no"])
AM_CONDITIONAL([ENABLE_LIBLZ4], [test "${want_liblz4}" = "yes"])
AC_DEFINE_IF([ENABLE_LIBLZ4], [test "${want_liblz4}" = "yes"], [1], [Use liblz4 external library instead of embedded copy])
AC_SUBST([want_liblz4])
AC_SUBST([ENABLE_LIBLZ4])
#### Checks for header files
# Common Checks (keep names sorted for ease of use):
AC_HEADER_DIRENT
AC_HEADER_TIME
AC_CHECK_HEADERS([ \
execinfo.h \
mcheck.h \
sys/epoll.h \
sys/inotify.h \
sys/signalfd.h \
sys/types.h \
sys/param.h \
sys/mman.h \
netinet/in.h \
])
EFL_CHECK_PATH_MAX
#### Checks for types
# wchar_t
AC_CHECK_SIZEOF([wchar_t])
EINA_SIZEOF_WCHAR_T=$ac_cv_sizeof_wchar_t
AC_SUBST([EINA_SIZEOF_WCHAR_T])
AC_CHECK_SIZEOF(int, 4)
AC_CHECK_SIZEOF(long, 4)
AC_CHECK_SIZEOF([uintptr_t])
AC_CHECK_TYPES([siginfo_t], [], [],
[[
#include <signal.h>
#if HAVE_SIGINFO_H
# include <siginfo.h>
#endif
]])
#### Checks for structures
#### Checks for compiler characteristics
AC_C_BIGENDIAN
AC_C_INLINE
EFL_CHECK_COMPILER_FLAGS([EFLALL], [-Wall -Wextra -Wpointer-arith -Wno-missing-field-initializers -fvisibility=hidden -fdata-sections -ffunction-sections])
EFL_CHECK_LINKER_FLAGS([EFLALL], [-fvisibility=hidden -fdata-sections -ffunction-sections -Wl,--gc-sections -fno-strict-aliasing -Wl,--as-needed -Wl,--no-copy-dt-needed-entries])
case "${build_profile}" in
dev)
dnl Check if compiler has a dodgy -Wshadow that emits errors when shadowing a global
AC_MSG_CHECKING([whether -Wshadow generates spurious warnings])
CFLAGS_save="${CFLAGS}"
CFLAGS="${CFLAGS} -Werror -Wshadow"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[int x;]], [[int x = 0; (void)x;]])],[AC_MSG_RESULT([no])
EFL_CHECK_COMPILER_FLAGS([EFLALL], [-Wshadow])],[AC_MSG_RESULT([yes])])
CFLAGS="${CFLAGS_save}"
;;
debug)
;;
release)
;;
esac
EFL_ATTRIBUTE_VECTOR
EFL_ATTRIBUTE_ALWAYS_INLINE
EFLALL_LIBS="${EFLALL_LIBS}"
EFLALL_CFLAGS="${EFLALL_CFLAGS}"
## CPU architecture specific assembly
build_cpu_mmx="no"
build_cpu_sse3="no"
build_cpu_altivec="no"
build_cpu_neon="no"
want_neon="yes"
AC_ARG_ENABLE([neon],
[AS_HELP_STRING([--disable-neon],[disable neon support @<:@default=enable@:>@])],
[
if test "x${enableval}" = "xyes"; then
want_neon="yes"
else
want_neon="no"
fi
])
SSE3_CFLAGS=""
ALTIVEC_CFLAGS=""
NEON_CFLAGS=""
case $host_cpu in
i*86|x86_64|amd64)
AC_DEFINE([BUILD_MMX], [1], [Build MMX Code])
build_cpu_mmx="yes"
AC_CHECK_HEADER([immintrin.h],
[
AC_DEFINE(BUILD_SSE3, 1, [Build SSE3 Code])
build_cpu_sse3="yes"
],
[build_cpu_sse3="no"])
AC_MSG_CHECKING([whether to build SSE3 code])
AC_MSG_RESULT([${build_cpu_sse3}])
if test "x$build_cpu_sse3" = "xyes" ; then
SSE3_CFLAGS="-msse3"
fi
;;
*power* | *ppc*)
build_cpu_altivec="yes"
AC_CHECK_HEADER([altivec.h],
[
AC_DEFINE([BUILD_ALTIVEC], [1], [Build Altivec Code])
AC_DEFINE([HAVE_ALTIVEC_H], [1], [Have altivec.h header file])
build_cpu_altivec="yes"
],
[
save_CFLAGS=$CFLAGS
save_CPPFLAGS=$CPPFLAGS
CFLAGS=$CFLAGS" -maltivec"
CPPFLAGS=$CPPFLAGS" -maltivec"
unset ac_cv_header_altivec_h
AC_CHECK_HEADER([altivec.h],
[
AC_DEFINE([BUILD_ALTIVEC], [1], [Build Altivec Code])
AC_DEFINE([HAVE_ALTIVEC_H], [1], [Have altivec.h header file])
build_cpu_altivec="yes"
],
[build_cpu_altivec="no"]
)
CFLAGS=$save_CFLAGS
CPPFLAGS=$save_CPPFLAGS
]
)
if test "x${build_cpu_altivec}" = "xyes"; then
AC_MSG_CHECKING([whether to use altivec compiler flag])
if test "x$GCC" = "xyes"; then
if echo "int main(){return 0;}" | ${CPP} -faltivec - > /dev/null 2>&1; then
altivec_cflags="-faltivec"
AC_DEFINE([BUILD_ALTIVEC], [1], [Build Altivec Code])
elif echo "int main(){return 0;}" | ${CPP} -maltivec - > /dev/null 2>&1; then
altivec_cflags="-maltivec"
AC_DEFINE([BUILD_ALTIVEC], [1], [Build Altivec Code])
fi
fi
AC_MSG_RESULT([${altivec_cflags}])
CFLAGS="$CFLAGS ${altivec_cflags}"
ALTIVEC_CFLAGS="-maltivec"
fi
;;
arm*)
if test "x${want_neon}" = "xyes"; then
build_cpu_neon="yes"
AC_MSG_CHECKING([whether to use NEON instructions])
CFLAGS_save="${CFLAGS}"
CFLAGS="${CFLAGS} -mfpu=neon -ftree-vectorize"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <arm_neon.h>]], [[asm volatile ("vqadd.u8 d0, d1, d0\n")]])],[
AC_MSG_RESULT([yes])
AC_DEFINE([BUILD_NEON], [1], [Build NEON Code])
build_cpu_neon="yes"
NEON_CFLAGS="-mfpu=neon"
],[
AC_MSG_RESULT([no])
build_cpu_neon="no"
])
CFLAGS="${CFLAGS_save}"
fi
;;
esac
AC_SUBST([ALTIVEC_CFLAGS])
AC_SUBST([SSE3_CFLAGS])
AC_SUBST([NEON_CFLAGS])
#### Checks for linker characteristics
#### Checks for library functions
AC_CHECK_FUNCS([\
backtrace \
backtrace_symbols \
execvp \
fpathconf \
fstatat \
malloc_usable_size \
mkdirat \
mtrace \
realpath \
strlcpy \
geteuid \
getuid \
pause \
])
AC_FUNC_ALLOCA
AC_FUNC_MMAP
EFL_CHECK_FUNCS([EFLALL], [fnmatch gettimeofday dirfd fcntl])
have_atfile_source="${ac_cv_func_fstatat}"
AC_DEFINE_IF([HAVE_ATFILE_SOURCE],
[test "x${have_atfile_source}" = "xyes"],
[1], [Use fstatat and other -at file functions])
###################### EFL ######################
AC_ARG_ENABLE([systemd],
[AS_HELP_STRING([--enable-systemd],[Enable systemd support. @<:@default=disabled@:>@])],
[
if test "x${enableval}" = "xyes" ; then
want_systemd="yes"
else
want_systemd="no"
fi
], [
want_systemd="no"
])
systemd_dbus_prefix="# "
if test "${want_systemd}" = "yes"; then
systemd_dbus_prefix=""
fi
AC_SUBST(systemd_dbus_prefix)
AC_ARG_WITH([systemdunitdir],
AS_HELP_STRING([--with-systemdunitdir=DIR],[path to systemd user services directory]),
[USER_SESSION_DIR=${withval}])
if test "$want_systemd" == "no"; then
have_systemd_user_session="no"
elif test -n "${USER_SESSION_DIR}"; then
have_systemd_user_session="yes"
AC_MSG_NOTICE([Using systemd user services directory as ${USER_SESSION_DIR}])
else
# Detect systemd user session directory properly
EFL_PKG_CHECK_VAR([USER_SESSION_DIR], [systemd >= 192], [systemduserunitdir],
[have_systemd_user_session="yes"], [have_systemd_user_session="no"])
if test "$want_systemd" = "yes" -a "$have_systemd_user_session" = "no"; then
AC_MSG_ERROR([systemd support wanted, but systemd was not found.])
fi
fi
AM_CONDITIONAL([HAVE_SYSTEMD_USER_SESSION], [test "x${have_systemd_user_session}" = "xyes"])
AC_SUBST([USER_SESSION_DIR])
if test "x${have_systemd_pkg}" = "xauto" -o "x${have_systemd_pkg}" = "xyes"; then
PKG_CHECK_MODULES([SYSTEMD], [libsystemd-daemon >= 192 libsystemd-journal >= 192],
[have_systemd_pkg="yes"],
[have_systemd_pkg="no"])
fi
PKG_CHECK_MODULES(SYSTEMD_LOGIN, [libsystemd-login >= 198],
[have_systemd_login=yes], [have_systemd_login=no])
AS_IF([test "x$have_systemd_login" = "xyes"],
[AC_DEFINE([HAVE_SYSTEMD_LOGIN], [1], [Have systemd-login])])
AM_CONDITIONAL(HAVE_SYSTEMD_LOGIN, test "x$have_systemd_login" = "xyes")
# check for systemd library if requested
if test "x${want_systemd}" = "xyes" -a "x${have_systemd_pkg}" = "xno"; then
AC_MSG_ERROR([Systemd dependency requested but not found])
fi
AM_CONDITIONAL([WANT_SYSTEMD], [test "${want_systemd}" = "yes"])
#### Platform-dependent
DL_LIBS=""
DL_INTERNAL_LIBS=""
#### Evil
EFL_LIB_START_OPTIONAL([Evil], [test "${have_windows}" = "yes"])
### Default values
### Additional options to configure
EFL_SELECT_WINDOWS_VERSION
### Checks for programs
### Checks for libraries
EFL_ADD_LIBS([EVIL], [-lole32 -lws2_32 -lsecur32 -luuid])
EVIL_DLFCN_LIBS="-lpsapi"
AC_SUBST([EVIL_DLFCN_LIBS])
### Checks for header files
### Checks for types
### Checks for structures
### Checks for compiler characteristics
EVIL_DLFCN_CPPFLAGS="-DEFL_EVIL_DLFCN_BUILD -DPSAPI_VERSION=1"
# TODO: should we have these at EFL (global?)
# Note: these warnings should not be used with C++ code
EVIL_CFLAGS_WRN="-Wdeclaration-after-statement -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls"
EVIL_CXXFLAGS="${EVIL_CXXFLAGS}"
if test "x${have_win32}" = "xyes" ; then
EVIL_CFLAGS="-DSECURITY_WIN32 ${EVIL_CFLAGS}"
EVIL_CXXFLAGS="-fno-rtti -fno-exceptions -DSECURITY_WIN32 ${EVIL_CXXFLAGS}"
fi
AC_SUBST([EVIL_DLFCN_CPPFLAGS])
AC_SUBST([EVIL_CFLAGS_WRN])
AC_SUBST([EVIL_CXXFLAGS])
### Checks for linker characteristics
### Checks for library functions
DL_LIBS="lib/evil/libdl.la"
DL_INTERNAL_LIBS="lib/evil/libdl.la"
EFL_LIB_END_OPTIONAL([Evil])
AC_SUBST([USE_EVIL_CFLAGS])
AC_SUBST([USE_EVIL_LIBS])
#### End of Evil
#### Escape
EFL_LIB_START_OPTIONAL([Escape], [test "${have_ps3}" = "yes"])
### Additional options to configure
### Default values
### Checks for programs
### Checks for libraries
EFL_ADD_LIBS([ESCAPE], [-llv2 -lm -lnet -lsysmodule -liberty])
### Checks for header files
### Checks for types
### Checks for structures
### Checks for compiler characteristics
### Checks for linker characteristics
### Checks for library functions
EFL_LIB_END_OPTIONAL([Escape])
#### End of Escape
EFL_CHECK_FUNC([SHM], [shm_open])
SHM_LIBS="${requirements_libs_shm}"
AC_SUBST([SHM_LIBS])
AC_SUBST([DL_LIBS])
AC_SUBST([DL_INTERNAL_LIBS])
#### End of Platform-dependent
#### Eina
EFL_LIB_START([Eina])
### Default values
have_safety_checks="yes"
want_log="yes"
case "${build_profile}" in
dev)
with_max_log_level=""
have_stringshare_usage="no"
want_valgrind="auto"
want_debug_malloc="no"
want_debug_threads="no"
want_default_mempool="no"
want_cow_magic="no"
;;
debug)
with_max_log_level=""
have_stringshare_usage="yes"
want_valgrind="auto"
want_debug_malloc="yes"
want_debug_threads="yes"
want_default_mempool="yes"
want_cow_magic="yes"
;;
release)
with_max_log_level="3"
have_stringshare_usage="no"
want_valgrind="no"
want_debug_malloc="no"
want_debug_threads="no"
want_default_mempool="no"
want_cow_magic="no"
;;
esac
EINA_CONFIG([HAVE_ALLOCA_H], [test "x${ac_cv_working_alloca_h}" = "xyes"])
EINA_CONFIG([SAFETY_CHECKS], [test "x${have_safety_checks}" = "xyes"])
EINA_CONFIG([DEFAULT_MEMPOOL], [test "x${want_default_mempool}" = "xyes"])
if test -n "${with_max_log_level}"; then
AC_MSG_NOTICE([ignoring any EINA_LOG() with level greater than ${with_max_log_level}])
AC_DEFINE_UNQUOTED([EINA_LOG_LEVEL_MAXIMUM], [${with_max_log_level}], [if set, logging is limited to this amount.])
fi
AC_DEFINE_IF([EINA_STRINGSHARE_USAGE],
[test "x${have_stringshare_usage}" = "xyes"],
[1], [Report Eina stringshare usage pattern])
### Additional options to configure
AC_ARG_ENABLE([magic-debug],
[AS_HELP_STRING([--disable-magic-debug],[disable magic debug of eina structure @<:@default=enabled@:>@])],
[
if test "x${enableval}" = "xyes" ; then
have_magic_debug="yes"
else
have_magic_debug="no"
fi
],
[have_magic_debug="yes"])
EINA_CONFIG([MAGIC_DEBUG], [test "x${have_magic_debug}" = "xyes"])
AC_ARG_WITH([xattr-tests-path],
[AS_HELP_STRING([--with-xattr-tests-path=DIR],[path of xattr enabled directory to create test files])],[XATTR_TEST_DIR=${withval}][AC_DEFINE_UNQUOTED([XATTR_TEST_DIR],["$withval"], [xattr enabled directory])])
### Checks for programs
### Checks for libraries
EFL_PLATFORM_DEPEND([EINA], [all])
EFL_ADD_LIBS([EINA], [-lm])
## Options
# Valgrind
AC_ARG_ENABLE([valgrind],
[AS_HELP_STRING([--disable-valgrind],[enable valgrind mempool declaration. @<:@default=disabled@:>@])],
[
if test "x${enableval}" = "xyes" ; then
want_valgrind="yes"
else
want_valgrind="no"
fi
])
if test "${want_valgrind}" = "auto"; then
PKG_CHECK_EXISTS([valgrind >= 2.4.0], [want_valgrind="yes"],
[want_valgrind="no"
AC_MSG_WARN([valgrind support desired by --with-profile=${build_profile} but not found. If your platform supports it, install valgrind.])])
fi
if test "${want_valgrind}" = "no"; then
AC_DEFINE([NVALGRIND], [1], [Valgrind support disabled])
else
PKG_CHECK_MODULES([VALGRIND], [valgrind >= 2.4.0])
AC_DEFINE([HAVE_VALGRIND], [1], [Valgrind support enabled])
fi
AC_DEFINE_IF([EINA_DEBUG_MALLOC],
[test "x${ac_cv_func_malloc_usable_size}" = "xyes" && test "x${want_debug_malloc}" = "xyes"],
[1], [Turn on debugging overhead in mempool])
AC_DEFINE_IF([EINA_COW_MAGIC_ON],
[test "x${want_cow_magic}" = "xyes" ],
[1], [Turn on Eina_Magic in Eina_Cow])
EFL_OPTIONAL_DEPEND_PKG([EINA], [${want_systemd}], [SYSTEMD], [libsystemd-journal])
EFL_EVAL_PKGS([EINA])
## Examples
## Benchmarks
PKG_CHECK_MODULES([GLIB],
[glib-2.0],
[have_glib="yes"],
[have_glib="no"])
if test "x${have_glib}" = "xyes" ; then
GLIB_CFLAGS="${GLIB_CFLAGS} -DEINA_BENCH_HAVE_GLIB"
fi
### Checks for header files
# sys/mman.h could be provided by evil/escape/exotic so we need to set CFLAGS accordingly
CFLAGS_save="${CFLAGS}"
CFLAGS="${CFLAGS} ${EINA_CFLAGS}"
AC_CHECK_HEADERS([sys/mman.h])
CFLAGS="${CFLAGS_save}"
AC_CHECK_HEADER([byteswap.h], [have_byteswap="yes"], [have_byteswap="no"])
### Checks for types
EINA_CONFIG([HAVE_DIRENT_H], [test "x${have_dirent}" = "xyes"])
AC_DEFINE_IF([HAVE_DIRENT_H], [test "x${have_dirent}" = "xyes"],
[1], [Define to 1 if you have a valid <dirent.h> header file.])
### Checks for structures
### Checks for compiler characteristics
EINA_CONFIG([HAVE_BYTESWAP_H], [test "x${have_byteswap}" = "xyes"])
EFL_CHECK_GCC_BUILTIN([bswap16], [HAVE_BSWAP16])
EFL_CHECK_GCC_BUILTIN([bswap32], [HAVE_BSWAP32])
EFL_CHECK_GCC_BUILTIN([bswap64], [HAVE_BSWAP64])
### Checks for linker characteristics
### Checks for library functions
AC_CHECK_FUNCS([fchmod])
EFL_CHECK_FUNCS([EINA], [dlopen dladdr iconv shm_open splice setxattr getpagesize])
enable_log="no"
if test "x${efl_func_fnmatch}" = "xyes" && test "x${want_log}" = "xyes" ; then
enable_log="yes"
fi
AC_MSG_CHECKING([wether to build Eina_Log infrastructure])
AC_MSG_RESULT([${enable_log}])
EINA_CONFIG([ENABLE_LOG], [test "x${enable_log}" = "xyes"])
EFL_CHECK_THREADS
if test "x${efl_have_threads}" = "xno"; then
CFOPT_WARNING="xyes"
fi
EFL_ADD_PUBLIC_LIBS([EINA], [${EFL_PTHREAD_LIBS}])
EFL_ADD_CFLAGS([EINA], [${EFL_PTHREAD_CFLAGS}])
EINA_CONFIG([HAVE_PTHREAD_BARRIER], [test "x${efl_have_pthread_barrier}" = "xyes"])
EINA_CONFIG([HAVE_PTHREAD_AFFINITY], [test "x${efl_have_setaffinity}" = "xyes"])
EINA_CONFIG([HAVE_DEBUG_THREADS], [test "x${want_debug_threads}" = "xyes"])
EINA_CONFIG([HAVE_POSIX_SPINLOCK], [test "x${efl_have_posix_threads_spinlock}" = "xyes"])
EINA_CONFIG([HAVE_OSX_SPINLOCK], [test "x${efl_have_osx_spinlock}" = "xyes"])
EINA_CONFIG([HAVE_OSX_SEMAPHORE], [test "x${have_darwin}" = "xyes"])
### Modules
EINA_CHECK_MODULE([chained-pool], [static], [chained pool])
EINA_CHECK_MODULE([pass-through], [static], [pass through])
EINA_CHECK_MODULE([one-big], [static], [one big])
EFL_ADD_FEATURE([EINA], [systemd-journal], [${want_systemd}])
EFL_LIB_END([Eina])
#### End of Eina
#### Eina CXX
EFL_LIB_START([Eina_Cxx])
EFL_CXX_COMPILE_STDCXX_11([ext])
AC_ARG_ENABLE([cxx-bindings],
[AS_HELP_STRING([--disable-cxx-bindings],[disable C++11 bindings. @<:@default=enabled@:>@])],
[want_cxx11="${enableval}"], [want_cxx11="yes"])
if test "x${HAVE_CXX11}" = "x1" -a "x${want_cxx11}" = "xyes"; then
have_cxx11="yes"
else
have_cxx11="no"
fi
AM_CONDITIONAL([HAVE_CXX11], [test "x${have_cxx11}" = "xyes"])
EFL_INTERNAL_DEPEND_PKG([EINA_CXX], [Eina])
EFL_ADD_CFLAGS([EINA_CXX], [${EFL_PTHREAD_CFLAGS}])
EFL_EVAL_PKGS([EINA_CXX])
EFL_LIB_END([Eina_Cxx])
#### End of Eina CXX
#### Eo
EFL_LIB_START([Eo])
### Default values
### Additional options to configure
### Checks for programs