aboutsummaryrefslogtreecommitdiffstats
path: root/configure.ac
blob: ceb351b4a6d9bb1ae6fd11beae8b4f545e4e22a4 (plain) (blame)
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
m4_define([v_maj], [1])
m4_define([v_min], [7])
m4_define([v_mic], [99])

m4_define([v_rev], m4_esyscmd([(svnversion "${SVN_REPO_PATH:-.}" | grep -v '\(export\|Unversioned directory\)' || echo 0) | awk -F : '{printf("%s\n", $1);}' | tr -d ' :MSP\n']))
m4_if(v_rev, [0], [m4_define([v_rev], m4_esyscmd([git log 2> /dev/null | (grep -m1 git-svn-id || echo 0) | sed -e 's/.*@\([0-9]*\).*/\1/' | tr -d '\n']))])

#### FIXME: i am sure that we can do some m4 to automagically do the stuff below for release and snapshots

##--   When released, remove the dnl on the below line
dnl m4_undefine([v_rev])

##--   When doing snapshots - change soname. remove dnl on below line
dnl m4_define([relname], [ver-pre-svn-07])
dnl m4_define([v_rel], [-release relname])

m4_ifdef([v_rev], [m4_define([efl_version], [v_maj.v_min.v_mic.v_rev])], [m4_define([efl_version], [v_maj.v_min.v_mic])])

m4_define([lt_cur], m4_eval(v_maj + v_min))
m4_define([lt_rev], v_mic)
m4_define([lt_age], v_min)

AC_INIT([efl], [efl_version], [enlightenment-devel@lists.sourceforge.net])
AC_PREREQ([2.59])
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__ */
])

AC_GNU_SOURCE
AC_SYS_LARGEFILE

AM_INIT_AUTOMAKE([1.6 dist-bzip2])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])

m4_ifdef([v_rev], , [m4_define([v_rev], [0])])
AC_DEFINE_UNQUOTED([VMAJ], [v_maj], [Major version])
AC_DEFINE_UNQUOTED([VMIN], [v_min], [Minor version])
AC_DEFINE_UNQUOTED([VMIC], [v_mic], [Micro version])
AC_DEFINE_UNQUOTED([VREV], [v_rev], [Revison])
VMAJ=v_maj
AC_SUBST([VMAJ])


#### Default values


requirements_libs_evil=""
requirements_libs_eina=""
requirements_libs_eo=""
requirements_libs_eet=""

requirements_libs_deps_evil=""
requirements_libs_deps_eina=""
requirements_libs_deps_eo=""
requirements_libs_deps_eet=""

requirements_pc_evil=""
requirements_pc_eina=""
requirements_pc_eo=""
requirements_pc_eet=""

requirements_pc_deps_evil=""
requirements_pc_deps_eina=""
requirements_pc_deps_eo=""
requirements_pc_deps_eet=""

AC_SUBST([requirements_libs_evil])
AC_SUBST([requirements_libs_eina])
AC_SUBST([requirements_libs_eo])
AC_SUBST([requirements_libs_eet])

AC_SUBST([requirements_pc_evil])
AC_SUBST([requirements_pc_eina])
AC_SUBST([requirements_pc_eo])
AC_SUBST([requirements_pc_eet])


AC_CANONICAL_HOST

AC_ARG_WITH([profile],
   [AC_HELP_STRING([--with-profile=PROFILE],
                   [use the predefined build profile, one of: dev, release.
                    @<:@default=dev@:>@])],
   [build_profile=${withval}],
   [build_profile=dev])

case "$build_profile" in
   dev|release)
     ;;
   *)
     AC_MSG_ERROR([Unknown build profile --with-profile=${build_profile}])
     ;;
esac


# TODO: move me to m4 file that setups module/so related variables
have_wince="no"
have_win32="no"
have_windows="no"
case "$host_os" in
   cegcc*)
      AC_MSG_ERROR([ceGCC compiler is not supported anymore. Exiting...])
   ;;
   mingw32ce*)
      have_wince="yes"
      have_windows="yes"
      MODULE_ARCH="$host_os-$host_cpu"
      MODULE_EXT=".dll"
   ;;
   mingw*)
      have_win32="yes"
      have_windows="yes"
      MODULE_ARCH="$host_os-$host_cpu-v_maj.v_min.v_mic"
      MODULE_EXT=".dll"
   ;;
   *)
      MODULE_ARCH="$host_os-$host_cpu-v_maj.v_min.v_mic"
      MODULE_EXT=".so"
   ;;
esac

AC_DEFINE_UNQUOTED([MODULE_ARCH], ["${MODULE_ARCH}"], ["Module architecture"])
AC_DEFINE_UNQUOTED([SHARED_LIB_SUFFIX], ["${MODULE_EXT}"], [Suffix for shared objects])

# TODO: move me to m4 file that setups the windows related variables
AM_CONDITIONAL([HAVE_WINCE], [test "x${have_wince}" = "xyes"])
AM_CONDITIONAL([HAVE_WIN32], [test "x${have_win32}" = "xyes"])
AM_CONDITIONAL([HAVE_WINDOWS], [test "x${have_windows}" = "xyes"])


#### Additional options to configure


#### Checks for programs

### libtool

if test "x${have_windows}" = "xyes" ; then
   lt_cv_deplibs_check_method='pass_all'
fi
AC_LIBTOOL_WIN32_DLL
define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl
AC_PROG_LIBTOOL
version_info="lt_cur:lt_rev:lt_age"
AC_SUBST([version_info])
release_info="v_rel"
AC_SUBST([release_info])

### compilers

AM_PROG_AS
AC_PROG_CXX
AC_LANG(C)
AC_PROG_CPP
AC_PROG_CC

# 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"])


#### Checks for libraries


#### Checks for header files

EFL_CHECK_PATH_MAX


#### Checks for types


#### Checks for structures


#### Checks for compiler characteristics

AC_C_BIGENDIAN
AC_C_INLINE
# EFL_CHECK_COMPILER_FLAGS([MY_LIB], [-Wall -Wextra])


#### Checks for linker characteristics

# TODO: do we really need this? maybe setup in the specific m4 file that
# does the windows related variables? Do we need to manually specify this
# for every module? it's annoying and easy to forget!
lt_enable_auto_import=""
case "${host_os}" in
   mingw*)
      lt_enable_auto_import="-Wl,--enable-auto-import"
   ;;
esac
AC_SUBST([lt_enable_auto_import])


#### Checks for library functions

AC_FUNC_ALLOCA


######################  EFL  ######################

prefer_assert="no"
case "$build_profile" in
   dev)
     prefer_assert="yes"
     ;;
esac

# Common Checks (keep names sorted for ease of use):
AC_HEADER_DIRENT
AC_HEADER_TIME

AC_CHECK_HEADERS([ \
execinfo.h \
inttypes.h \
libgen.h \
mcheck.h \
netinet/in.h \
siginfo.h \
stdint.h \
strings.h \
sys/types.h \
unistd.h \
])

AC_CHECK_FUNCS([\
backtrace \
backtrace_symbols \
execvp \
fpathconf \
fstatat \
malloc_usable_size \
mtrace \
openat \
strlcpy \
])

# wchar_t
AC_CHECK_SIZEOF([wchar_t])
EINA_SIZEOF_WCHAR_T=$ac_cv_sizeof_wchar_t
AC_SUBST([EINA_SIZEOF_WCHAR_T])
AC_CHECK_TYPES([siginfo_t], [], [],
   [[
#include <signal.h>
#if HAVE_SIGINFO_H
# include <siginfo.h>
#endif
   ]])

# struct dirent

AC_CHECK_TYPES([struct dirent], [have_dirent="yes"], [have_dirent="no"],
   [[
#include <dirent.h>
   ]])



#### Evil

if test "x${have_windows}" = "xyes" ; then

AC_MSG_NOTICE([Evil checks])

### Default values

### Additional options to configure
EFL_SELECT_WINDOWS_VERSION

### Checks for programs

### Checks for libraries

# TODO: are these needed here? parts of this are replicated for EVERY LIB :-(
EVIL_LIBS=""
EVIL_DLFCN_LIBS=""
case "$host_os" in
  mingw32ce*)
    EVIL_LIBS="-lws2"
    EVIL_DLFCN_LIBS="-ltoolhelp"
    ;;
  *)
    EVIL_LIBS="-luuid -lole32 -lws2_32 -lsecur32"
    EVIL_DLFCN_LIBS="-lpsapi"
    ;;
esac
requirements_libs_evil="${EVIL_LIBS}"

AC_SUBST([EVIL_LIBS])
AC_SUBST([EVIL_DLFCN_LIBS])

AC_DEFINE([HAVE_EVIL], [1], [Set to 1 if Evil package is installed])

### Checks for header files

AC_CHECK_HEADERS([errno.h])

### Checks for types

### Checks for structures

### Checks for compiler characteristics

EVIL_CPPFLAGS="-DEFL_EVIL_BUILD"
EVIL_DLFCN_CPPFLAGS="-DEFL_EVIL_DLFCN_BUILD -DPSAPI_VERSION=1"
EVIL_CFLAGS="-Wall -Wextra -Wshadow -Wdeclaration-after-statement -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wpointer-arith -mms-bitfields"
EVIL_CXXFLAGS=""

if test "x${have_win32}" = "xyes" ; then
   EVIL_CXXFLAGS="-fno-rtti -fno-exceptions"
   EVIL_CPPFLAGS="${EVIL_CPPFLAGS} -DSECURITY_WIN32"
fi

AC_SUBST([EVIL_CPPFLAGS])
AC_SUBST([EVIL_DLFCN_CPPFLAGS])
AC_SUBST([EVIL_CFLAGS])
AC_SUBST([EVIL_CXXFLAGS])

### Checks for linker characteristics

### Checks for library functions

fi

#### End of Evil


#### Eina

AC_MSG_NOTICE([Eina checks])

### Default values

### Additional options to configure

have_magic_debug="yes"
have_safety_checks="yes"
want_log="yes"
case "$build_profile" in
   dev)
     with_max_log_level=""
     have_stringshare_usage="yes"
     want_valgrind="no" # TODO: "yes" is not working: relocation R_X86_64_32S against `vgPlain_interim_stack' can not be used when making a shared object; recompile with -fPIC
     want_debug_malloc="yes"
     want_debug_threads="yes"
     ;;

   release)
     with_max_log_level="3"
     have_stringshare_usage="no"
     want_valgrind="no"
     want_debug_malloc="no"
     want_debug_threads="no"
     ;;
esac

EINA_CONFIG(MAGIC_DEBUG, test "x${have_magic_debug}" = "xyes")
EINA_CONFIG(SAFETY_CHECKS, test "x${have_safety_checks}" = "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])

### Checks for programs

### Checks for libraries

## Compatibility layers

# Evil library for compilation on Windows

EFL_EINA_BUILD=""
case "$host_os" in
   mingw*)
# TODO: WHAT? evil was build before, so it should already define this
#      AC_DEFINE([HAVE_EVIL], [1], [Set to 1 if Evil package is installed])
      requirements_pc_eina="${requirements_pc_eina} evil"
      EFL_EINA_BUILD="-DEFL_EINA_BUILD"
   ;;
esac
AC_SUBST([EFL_EINA_BUILD])

# Escape library for compilation on Playstation 3

case "$host_vendor" in
  ps3*)
# TODO: add back whenever escape is merged into efl single tree
#      PKG_CHECK_EXISTS([escape])
#      AC_DEFINE([HAVE_ESCAPE], [1], [Set to 1 if Escape package is installed])
#      requirements_pc_eina="${requirements_pc_eina} escape"
    ;;
esac

## Options

# Valgrind

if test "x${want_valgrind}" = "xyes"; then
   PKG_CHECK_MODULES([VALGRIND], [valgrind >= 2.4.0],
      [
       have_valgrind="yes"
       requirements_pc_eina="valgrind >= 2.4.0 ${requirements_pc_eina}"
       requirements_pc_deps_eina="valgrind ${requirements_pc_deps_eina}"
      ],
      [
       have_valgrind="no"
       AC_MSG_ERROR([Valgrind >= 2.4.0 is required])
      ])
else
    AC_DEFINE([NVALGRIND], [1], [Valgrind support disabled])
fi

AC_DEFINE_IF([EINA_DEBUG_MALLOC],
   [test "x${ac_cv_func_malloc_usable_size}" = "xyes" -a "x${want_debug_malloc}" = "xyes"],
   [1], [Turn on debugging overhead in mempool])

## Modules
if ! test "x${requirements_pc_deps_eina}" = "x" ; then
   PKG_CHECK_MODULES([EINA], [${requirements_pc_deps_eina}])
fi


## Examples

# TODO: add once ecore-evas is merged:
#PKG_CHECK_MODULES([ECORE_EVAS],
#   [ecore-evas ecore evas],
#   [build_tiler_example="yes"],
#   [build_tiler_example="no"])

AM_CONDITIONAL([BUILD_TILER_EXAMPLE], [test "x${build_tiler_example}" = "xyes"])

## Tests

EFL_CHECK_TESTS(EINA)

## 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}"

EINA_CONFIG(HAVE_INTTYPES_H, test "x${ac_cv_header_inttypes_h}" = "xyes")
EINA_CONFIG(HAVE_STDINT_H, test "x${ac_cv_header_stdint_h}" = "xyes")

### 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

m4_ifdef([v_ver],
   [
    EFL_CHECK_COMPILER_FLAGS([EINA], [-Wall -Wextra])
   ])

EFL_CHECK_COMPILER_FLAGS([EINA], [-Wshadow -Wpointer-arith])

### Checks for linker characteristics

EFL_CHECK_LINKER_FLAGS([EINA], [-fno-strict-aliasing])

### Checks for library functions
EFL_CHECK_FUNCS([EINA], [dirfd dlopen dladdr fnmatch iconv shm_open setxattr])

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_pthread_barrier}" = "xno" ; then
   EINA_CONFIGURE_HAVE_PTHREAD_BARRIER="#define EINA_HAVE_PTHREAD_BARRIER"
fi
AC_SUBST(EINA_CONFIGURE_HAVE_PTHREAD_BARRIER)

EINA_CONFIG(HAVE_DEBUG_THREADS, test "$want_debug_threads" = "yes")

### 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])


#### End of Eina


#### Eet
AC_MSG_NOTICE([Eet checks])

### Default values

### Additional options to configure

AC_ARG_WITH([crypto],
   [AC_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 --with-crypto=${build_crypto}])
     ;;
esac

### Checks for programs

### Checks for libraries

## Compatibility layers

# Evil library for compilation on Windows

EFL_EET_BUILD=""
case "$host_os" in
   mingw*)
# TODO: WHAT? evil was build before, so it should already define this
#      AC_DEFINE([HAVE_EVIL], [1], [Set to 1 if Evil package is installed])
      requirements_pc_eet="evil ${requirements_pc_eet}"
      EFL_EET_BUILD="-DEFL_EET_BUILD"
   ;;
esac
AC_SUBST(EFL_EET_BUILD)

## Secure layer

case "$build_crypto" in
   gnutls)
      PKG_CHECK_MODULES([GNUTLS], [gnutls >= 1.7.6])
      AC_DEFINE([HAVE_GNUTLS], [1], [Have Gnutls support])
      requirements_pc_eet="gnutls >= 1.7.6 ${requirements_pc_eet}"
      requirements_pc_deps_eet="gnutls >= 1.7.6 ${requirements_pc_deps_eet}"

      # TODO: do we need this?
      # libgcrypt
      AC_PATH_GENERIC([libgcrypt], [], [:],
         [AC_MSG_ERROR([libgcrypt required but not found])])
      requirements_libs_eet="${LIBGCRYPT_LIBS} ${requirements_libs_eet}"
      requirements_libs_deps_eet="${LIBGCRYPT_LIBS} ${requirements_libs_deps_eet}"

      # TODO: do we need this? can't we just bump required version?
      # Specific GNUTLS improvement
      CFLAGS_save="${CFLAGS}"
      LIBS_save="${LIBS}"
      CFLAGS="${GNUTLS_CFLAGS}"
      LIBS="${GNUTLS_LIBS}"
      AC_CHECK_LIB([gnutls], [gnutls_x509_crt_verify_hash],
         [
          AC_DEFINE([EET_USE_NEW_GNUTLS_API], [1], [use gnutls_x509_crt_verify_hash])
         ], [AC_MSG_NOTICE([Optional gnutls_x509_crt_verify_hash not present.])])
      CFLAGS="${CFLAGS_save}"
      LIBS="${LIBS_save}"

      # TODO: do we need this? can't we just bump required version?
      CFLAGS_save="${CFLAGS}"
      LIBS_save="${LIBS}"
      CFLAGS="${GNUTLS_CFLAGS}"
      LIBS="${GNUTLS_LIBS}"
      AC_CHECK_LIB([gnutls], [gnutls_privkey_sign_data],
         [
          AC_DEFINE([EET_USE_NEW_PRIVKEY_SIGN_DATA], [1], [use gnutls_privkey_sign_data])
         ], [AC_MSG_NOTICE([Optional gnutls_privkey_sign_data not present.])])
      CFLAGS="${CFLAGS_save}"
      LIBS="${LIBS_save}"

      # TODO: do we need this? can't we just bump required version?
      CFLAGS_save="${CFLAGS}"
      LIBS_save="${LIBS}"
      CFLAGS="${GNUTLS_CFLAGS}"
      LIBS="${GNUTLS_LIBS}"
      AC_CHECK_LIB([gnutls], [gnutls_pubkey_verify_hash],
         [
          AC_DEFINE([EET_USE_NEW_PUBKEY_VERIFY_HASH], [1], [use gnutls_pubkey_verify_hash])
         ])
      CFLAGS="${CFLAGS_save}"
      LIBS="${LIBS_save}"
      ;;

   openssl)
      PKG_CHECK_MODULES([OPENSSL], [openssl])
      AC_DEFINE([HAVE_OPENSSL], [1], [Have Openssl support])
      requirements_pc_eet="openssl ${requirements_pc_eet}"
      requirements_pc_deps_eet="openssl ${requirements_pc_deps_eet}"
      ;;
esac

# Cryptography support
if test "$build_crypto" != "none" ; then
   AC_DEFINE([HAVE_CIPHER], [1], [Have cipher support built in eet])
   AC_DEFINE([HAVE_SIGNATURE], [1], [Have signature support for eet file])
fi

# libjpeg and zlib

EFL_CHECK_LIBS([EET], [libjpeg zlib])
# TODO: better way to force those instead of is secondary check
if test "x${efl_lib_zlib}" != "xyes" -o "x${efl_lib_libjpeg}" != "xyes" ; then
   AC_MSG_ERROR([Required EET libraries were not found.])
fi


# Eina library

requirements_pc_eet="eina >= 1.7.99 ${requirements_pc_eet}"

PKG_CHECK_MODULES([EET], [${requirements_pc_deps_eet}])

# Windows

case "$host_os" in
   mingw32ce*)
# TODO: are these needed here? parts of this are replicated for EVERY LIB :-(
      requirements_libs_eet="${requirements_libs_eet} -lws2"
      requirements_libs_deps_eet="${requirements_libs_deps_eet} -lws2"
      ;;
   mingw*)
# TODO: are these needed here? parts of this are replicated for EVERY LIB :-(
      requirements_libs_eet="${requirements_libs_eet} -lws2_32"
      requirements_libs_deps_eet="${requirements_libs_deps_eet} -lws2_32"
      ;;
esac

EET_LIBS="${EET_LIBS} ${requirements_libs_deps_eet}"

### Checks for header files

### Checks for types

### Checks for structures

### Checks for compiler characteristics

EFL_CHECK_COMPILER_FLAGS([EET], [-Wshadow -Wpointer-arith])

### Checks for linker characteristics

case "${host_os}" in
   openbsd*)
   ;;
   *)
# TODO: here? Why don't do everywhere or let user specify it?
      EFL_CHECK_LINKER_FLAGS([EET], [-Wl,--as-needed])
   ;;
esac

### Checks for library functions

### Check availability

#### End of Eet


#### Eo
AC_MSG_NOTICE([Eo checks])

### Default values

### Additional options to configure

### Checks for programs

### Checks for libraries

# Eina library

# TODO: really? do we need this? it's a local eina!
requirements_pc_eo="eina >= 1.7.99"

AC_ARG_VAR([EO_CFLAGS], [preprocessor flags for Eo])
AC_SUBST([EO_CFLAGS])
AC_ARG_VAR([EO_LIBS], [linker flags for Eo])
AC_SUBST([EO_LIBS])

# Example (evas one)

# TODO: add once elementary is merged
#PKG_CHECK_MODULES([ELM], [elementary >= 1.7.0], [have_elm="yes"], [have_elm="no"])
AM_CONDITIONAL([EO_BUILD_EXAMPLE_EVAS], [test "x${have_elm}" = "xyes"])

### Checks for header files

### Checks for types

### Checks for structures

### Checks for compiler characteristics

EFL_EO_BUILD=""
case "$host_os" in
   mingw*)
      EFL_EO_BUILD="-DEFL_EO_BUILD"
   ;;
esac
AC_SUBST([EFL_EO_BUILD])

### Checks for linker characteristics

### Checks for library functions

### Check availability

#### End of Eo


AC_CONFIG_FILES([
Makefile
doc/Makefile
doc/Doxyfile
src/Makefile
src/benchmarks/Makefile
src/benchmarks/eina/Makefile
src/benchmarks/eo/Makefile
src/bin/Makefile
src/bin/evil/Makefile
src/bin/eet/Makefile
src/examples/Makefile
src/examples/eina/Makefile
src/examples/eet/Makefile
src/examples/eo/Makefile
src/lib/Makefile
src/lib/evil/Makefile
src/lib/eina/Makefile
src/lib/eina/eina_config.h
src/lib/eet/Makefile
src/lib/eo/Makefile
src/modules/Makefile
src/modules/eina/Makefile
src/modules/eina/mp/Makefile
src/modules/eina/mp/chained_pool/Makefile
src/modules/eina/mp/pass_through/Makefile
src/modules/eina/mp/one_big/Makefile
src/scripts/Makefile
src/scripts/eina/Makefile
src/tests/Makefile
src/tests/eina/Makefile
src/tests/eet/Makefile
src/tests/eo/Makefile
spec/efl.spec
pc/evil.pc
pc/eina.pc
pc/eet.pc
pc/eo.pc
])

AC_OUTPUT


#### Info

echo
echo
echo
echo "------------------------------------------------------------------------"
echo "$PACKAGE_NAME $PACKAGE_VERSION"
echo "------------------------------------------------------------------------"
echo
echo "Configuration Options Summary:"
echo
echo "  OS...................: ${host_os}"
echo "  Build Profile........: ${build_profile}"
echo "  Threads Type.........: ${efl_have_threads} (spinlocks: ${efl_have_posix_threads_spinlock}) (barrier: ${efl_have_pthread_barrier})"
echo "  Cryptographic System.: ${build_crypto}"
if test "x${have_windows}" = "xyes" ; then
   echo "  Windows version......: ${_efl_windows_version}"
fi
echo
echo "Compilation............: make (or gmake)"
echo "  CPPFLAGS.............: $CPPFLAGS"
echo "  CFLAGS...............: $CFLAGS"
echo "  CXXFLAGS.............: $CXXFLAGS"
echo "  LDFLAGS..............: $LDFLAGS"
echo
echo "Tests..................: make check (Coverage: ${_efl_enable_coverage})"
echo "Examples...............: make examples (also install-examples)"
if test "x${build_doc}" = "xyes"; then
echo "Documentation..........: make doc"
fi
echo "Installation...........: make install (as root if needed, with 'su' or 'sudo')"
echo "  prefix...............: $prefix"
echo