summaryrefslogtreecommitdiff
path: root/legacy/ecore/configure.in
blob: ac5265dd357403b7d132df02ddf5801b5b7fb0cf (plain)
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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
dnl Process this file with autoconf to produce a configure script.

AC_INIT(configure.in)
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
AC_ISC_POSIX
AM_INIT_AUTOMAKE(ecore, 0.9.9.022)
AM_CONFIG_HEADER(config.h)

AC_C_BIGENDIAN
AC_PROG_CC
AM_PROG_CC_STDC
AC_HEADER_STDC
AC_C_CONST
AC_CHECK_SIZEOF(int, 4)
AC_CHECK_SIZEOF(long, 4)
AM_ENABLE_SHARED
AM_PROG_LIBTOOL
AC_C___ATTRIBUTE__

if test "x${bindir}" = 'x${exec_prefix}/bin'; then
  if test "x${exec_prefix}" = "xNONE"; then
    if test "x${prefix}" = "xNONE"; then
      bindir="${ac_default_prefix}/bin";
    else
      bindir="${prefix}/bin";
    fi
  else
    if test "x${prefix}" = "xNONE"; then
      bindir="${ac_default_prefix}/bin";
    else
      bindir="${prefix}/bin";
    fi
  fi
fi

if test "x${libdir}" = 'x${exec_prefix}/lib'; then
  if test "x${exec_prefix}" = "xNONE"; then
    if test "x${prefix}" = "xNONE"; then
      libdir="${ac_default_prefix}/lib";
    else
      libdir="${prefix}/lib";
    fi
  else
    if test "x${prefix}" = "xNONE"; then
      libdir="${ac_default_prefix}/lib";
    else
      libdir="${prefix}/lib";
    fi
  fi
fi

							
dnl Set PACKAGE_DATA_DIR in config.h.
if test "x${datadir}" = 'x${prefix}/share'; then
  if test "x${prefix}" = "xNONE"; then
    AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${ac_default_prefix}/share/${PACKAGE}", [Shared Data Directory])
  else
    AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${prefix}/share/${PACKAGE}", [Shared Data Directory])
  fi
else
  AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${datadir}/${PACKAGE}", [Shared Data Directory])
fi

dnl Set PACKAGE_BIN_DIR in config.h.
if test "x${bindir}" = 'xNONE'; then
  if test "x${prefix}" = "xNONE"; then
    AC_DEFINE_UNQUOTED(PACKAGE_BIN_DIR, "${ac_default_prefix}/bin", [Installation Directory for User Executables])
  else
    AC_DEFINE_UNQUOTED(PACKAGE_BIN_DIR, "${prefix}/bin", [Installation Directory for User Executables])
  fi
else
  AC_DEFINE_UNQUOTED(PACKAGE_BIN_DIR, "${bindir}", [Installation Directory for User Executables])
fi
		
dnl Set PACKAGE_LIB_DIR in config.h.
if test "x${libdir}" = 'xNONE'; then
  if test "x${prefix}" = "xNONE"; then
    AC_DEFINE_UNQUOTED(PACKAGE_LIB_DIR, "${ac_default_prefix}/lib", [Installation Directory for Libraries])
  else
    AC_DEFINE_UNQUOTED(PACKAGE_LIB_DIR, "${prefix}/lib", [Installation Directory for Libraries])
  fi
else
  AC_DEFINE_UNQUOTED(PACKAGE_LIB_DIR, "${libdir}", [Installation Directory for Libraries])
fi
                
dnl Set PACKAGE_SOURCE_DIR in config.h.
packagesrcdir=`cd $srcdir && pwd`
AC_DEFINE_UNQUOTED(PACKAGE_SOURCE_DIR, "${packagesrcdir}", [Source Code Directory])

dnl Use -Wall if we have gcc.
changequote(,)dnl
if test "x$GCC" = "xyes"; then
  case " $CFLAGS " in
  *[\ \	]-Wall[\ \	]*) ;;
  *) CFLAGS="$CFLAGS -Wall" ;;
  esac
fi
changequote([,])dnl

AC_CHECK_FUNCS(gettimeofday)

tslib_libs=""
AC_CHECK_HEADER(tslib.h,
  [
    tslib_libs="-ltslib"
    AC_DEFINE(HAVE_TSLIB, 1, [Build Ecore_X Module])
  ]
)
AC_SUBST(tslib_libs)

AC_CHECK_HEADERS(netinet/in.h)

case "$host_os" in
	mingw|mingw32)
		winsock_libs="-lwsock32"
		;;
esac

AC_SUBST(winsock_libs)

ecore_txt_cflags=""
ecore_txt_libs=""
AC_MSG_CHECKING(whether ecore_txt module should be built)
AC_ARG_ENABLE(ecore-txt, 
  [  --disable-ecore-txt           disable the ecore_txt module],
  [
    if test "x$enableval" = "xno" ; then  
      want_ecore_txt=no
    else
      want_ecore_txt=yes
    fi
  ], [
    want_ecore_txt=maybe
  ]
)
AC_MSG_RESULT($want_ecore_txt)

iconv_cflags=""
iconv_libs=""
AC_MSG_CHECKING(for explicit iconv link options)
AC_ARG_WITH(iconv-link,
  [  --with-iconv-link=ICONV_LINK     explicitly specify an iconv link option],
  [
    iconv_libs=$withval
    AC_MSG_RESULT($iconv_libs)
  ],[
    AC_MSG_RESULT(none)
  ]
)

have_ecore_txt="no"
AC_MSG_CHECKING(whether ecore_txt module is to be built)
if test "x$want_ecore_txt" != "xno" ; then
  if test "x$iconv_libs" != "x" ; then 
    AC_CHECK_LIB(iconv, libiconv,
      [
        iconv_libs="-liconv"
        ecore_txt_libs="-lecore_txt "$iconv_libs
        have_ecore_txt="yes"
      ]
    )
  
    if test "x$have_ecore_txt" != "xyes"; then
      AC_CHECK_LIB(iconv, iconv,
        [
          iconv_libs="-liconv"
          ecore_txt_libs="-lecore_txt "$iconv_libs
          have_ecore_txt="yes"
        ]
      )
    fi

    if test "x$have_ecore_txt" != "xyes"; then
      AC_CHECK_LIB(c, libiconv,
        [
          ecore_txt_libs="-lecore_txt "$iconv_libs
          have_ecore_txt="yes"
        ]
      )
    fi

    if test "x$have_ecore_txt" != "xyes"; then
      AC_CHECK_LIB(c, iconv,
        [
          ecore_txt_libs="-lecore_txt "$iconv_libs
          have_ecore_txt="yes"
        ]
      )
    fi
  else
    ecore_txt_libs="-lecore_txt "$iconv_libs
    have_ecore_txt="yes"
  fi
fi
AC_MSG_RESULT($have_ecore_txt)
if test "x$have_ecore_txt" = "xyes" ; then
  AC_DEFINE(BUILD_ECORE_TXT, 1, [Build Ecore_Txt Module])
fi
AM_CONDITIONAL(BUILD_ECORE_TXT, test "x$have_ecore_txt" = "xyes")

AC_SUBST(iconv_cflags)
AC_SUBST(iconv_libs)

AC_SUBST(ecore_txt_cflags)
AC_SUBST(ecore_txt_libs)

want_ecore_x="yes";
have_ecore_x="no";
ecore_x_cflags="";
ecore_x_libs="";

x_dir="";
x_includes="";
x_cflags="";
x_libs="";
x_ldflags="";

if test "x$have_ecore_txt" = "xyes"; then
  AC_MSG_CHECKING(whether ecore_x module is to be built)
  AC_ARG_ENABLE(ecore-x, 
  [  --disable-ecore-x             disable the ecore_x module], [
    if test x"$enableval" = x"yes" ; then  
      AC_MSG_RESULT(yes)
    else
      AC_MSG_RESULT(no)
      want_ecore_x="no"
    fi
  ], [
    AC_MSG_RESULT(yes)
  ]
  )
else
  AC_MSG_RESULT(ecore_txt not enabled so ecore_x will not be enabled)
  want_ecore_x="no"
fi

if test "x$want_ecore_x" = "xyes"; then
  AC_PATH_XTRA
  AC_CHECK_HEADER(X11/X.h,
    [
      AM_CONDITIONAL(BUILD_ECORE_X, true)
      AC_DEFINE(BUILD_ECORE_X, 1, [Build Ecore_X Module])
      have_ecore_x="yes"
      x_dir=${x_dir:-/usr/X11R6}
      x_cflags=${x_cflags:--I${x_includes:-$x_dir/include}}
      x_libs="${x_libs:--L${x_libraries:-$x_dir/lib}} -lX11 -lXext"
      x_ldflags=" "$ecore_x_libs;
      ecore_x_libs="-lecore_x";
    ],[
      AM_CONDITIONAL(BUILD_ECORE_X, false)
    ]
  )
else
  AM_CONDITIONAL(BUILD_ECORE_X, false)
fi

AC_SUBST(x_cflags)
AC_SUBST(x_includes)
AC_SUBST(x_ldflags)
AC_SUBST(x_libs)

if test "x$have_ecore_x" = "xyes"; then
  Xcursor_libs=""
  Xcursor_cflags=""
  use_Xcursor="no"
  PCFLAGS=$CFLAGS
  CFLAGS=$x_cflags" "$x_includes
  AC_CHECK_HEADER(X11/Xcursor/Xcursor.h,
    [
      AC_CHECK_LIB(Xcursor, XcursorImageLoadCursor,
        [
          AC_DEFINE(ECORE_XCURSOR, 1, [Build support for Xcursor])
          Xcursor_cflags=""
          Xcursor_libs="-lXcursor"
          use_Xcursor="yes"
        ], [
          Xcursor_cflags=""
          Xcursor_libs=""
          use_Xcursor="no"
        ], [
          $x_libs $x_ldflags -lXrender
        ]
      )
    ], [
      Xcursor_cflags=""
      Xcursor_libs=""
      use_Xcursor="no"
    ], [
      #include <X11/Xlib.h>
    ]
  )
  CFLAGS=$PCFLAGS

  AC_SUBST(Xcursor_cflags)
  AC_SUBST(Xcursor_libs)
  
  Xprint_libs=""
  Xprint_cflags=""
  use_Xprint="no"
  PCFLAGS=$CFLAGS
  CFLAGS=$x_cflags" "$x_includes
  AC_CHECK_HEADER(X11/extensions/Print.h,
    [
      AC_CHECK_LIB(Xp, XpQueryScreens,
        [
          AC_DEFINE(ECORE_XPRINT, 1, [Build support for Xprint])
          Xprint_cflags=""
          Xprint_libs="-lXp"
          use_Xprint="yes"
        ], [
          Xprint_cflags=""
          Xprint_libs=""
          use_Xprint="no"
        ], [
          $x_libs $x_ldflags
        ]
      )
    ], [
      Xprint_cflags=""
      Xprint_libs=""
      use_Xprint="no"
    ], [
      #include <X11/Xlib.h>
    ]
  )
  CFLAGS=$PCFLAGS

  AC_SUBST(Xprint_cflags)
  AC_SUBST(Xprint_libs)
  
  Xinerama_libs=""
  Xinerama_cflags=""
  use_Xinerama="no"
  PCFLAGS=$CFLAGS
  CFLAGS=$x_cflags" "$x_includes
  AC_CHECK_HEADER(X11/extensions/Xinerama.h,
    [
      AC_CHECK_LIB(Xinerama, XineramaQueryScreens,
        [
          AC_DEFINE(ECORE_XINERAMA, 1, [Build support for Xinerama])
          Xinerama_cflags=""
          Xinerama_libs="-lXinerama"
          use_Xinerama="yes"
        ], [
          Xinerama_cflags=""
          Xinerama_libs=""
          use_Xinerama="no"
        ], [
          $x_libs $x_ldflags -lXrender
        ]
      )
    ], [
      Xinerama_cflags=""
      Xinerama_libs=""
      use_Xinerama="no"
    ], [
      #include <X11/Xlib.h>
    ]
  )
  CFLAGS=$PCFLAGS

  AC_SUBST(Xinerama_cflags)
  AC_SUBST(Xinerama_libs)
  
  Xrandr_libs=""
  Xrandr_cflags=""
  use_Xrandr="no"
  PCFLAGS=$CFLAGS
  CFLAGS=$x_cflags" "$x_includes
  AC_CHECK_HEADER(X11/extensions/Xrandr.h,
    [
      AC_CHECK_LIB(Xrandr, XRRSizes,
        [
          AC_DEFINE(ECORE_XRANDR, 1, [Build support for Xrandr])
          Xrandr_cflags=""
          Xrandr_libs="-lXrandr"
          use_Xrandr="yes"
        ], [
          Xrandr_cflags=""
          Xrandr_libs=""
          use_Xrandr="no"
        ], [
          $x_libs $x_ldflags
        ]
      )
    ], [
      Xrandr_cflags=""
      Xrandr_libs=""
      use_Xrandr="no"
    ], [
      #include <X11/Xlib.h>
    ]
  )
  CFLAGS=$PCFLAGS
  
  AC_SUBST(Xrandr_cflags)
  AC_SUBST(Xrandr_libs)
fi

AC_SUBST(ecore_x_cflags)
AC_SUBST(ecore_x_libs)

AC_MSG_CHECKING(whether ecore_job module is to be built)

want_ecore_job="yes";
have_ecore_job="no";
ecore_job_cflags="";
ecore_job_libs="";

AC_ARG_ENABLE(ecore-job, 
  [  --disable-ecore-job           disable the ecore_job module],
  [
    if test x"$enableval" = x"yes" ; then  
      AC_MSG_RESULT(yes)
    else
      AC_MSG_RESULT(no)
      want_ecore_job="no"
    fi
  ], [
    AC_MSG_RESULT(yes)
  ]
)

if test "x$want_ecore_job" = "xyes"; then
  AM_CONDITIONAL(BUILD_ECORE_JOB, true)
  AC_DEFINE(BUILD_ECORE_JOB, 1, [Build Ecore_Job Module])
  have_ecore_job="yes";
  ecore_job_libs="-lecore_job";
else
  AM_CONDITIONAL(BUILD_ECORE_JOB, false)
fi

AC_SUBST(ecore_job_cflags)
AC_SUBST(ecore_job_libs)

want_ecore_dfb="yes";
have_ecore_dfb="no";
ecore_dfb_cflags="";
ecore_dfb_libs="";

AC_MSG_CHECKING(whether ecore_dfb module is to be built)

AC_ARG_ENABLE(ecore-dfb, 
  [  --disable-ecore-dfb           disable the ecore_dfb module],
  [
    if test "$enableval" = "yes" ; then  
      AC_MSG_RESULT(yes)
    else
      AC_MSG_RESULT(no)
      want_ecore_dfb="no"
    fi
  ], [
    AC_MSG_RESULT(yes)
  ]
)

if test "x$want_ecore_dfb" = "xyes"; then
PKG_CHECK_MODULES(DIRECTFB, directfb >= 0.9.16,
    [
      AM_CONDITIONAL(BUILD_ECORE_DIRECTFB, true)
      AC_DEFINE(BUILD_ECORE_DIRECTFB, 1, [Build Ecore_DirectFB Module])
      have_ecore_dfb="yes"
      dnl ecore_dfb_libs="-lecore_fb";
    ], [
      AM_CONDITIONAL(BUILD_ECORE_DIRECTFB, false)
    ]
  )
else
  AM_CONDITIONAL(BUILD_ECORE_DIRECTFB, false)
fi
AC_SUBST(ecore_dfb_cflags)
AC_SUBST(ecore_dfb_libs)

want_ecore_fb="yes";
have_ecore_fb="no";
ecore_fb_cflags="";
ecore_fb_libs="";

AC_MSG_CHECKING(whether ecore_fb module is to be built)

AC_ARG_ENABLE(ecore-fb, 
  [  --disable-ecore-fb            disable the ecore_fb module],
  [
    if test x"$enableval" = x"yes" ; then  
      AC_MSG_RESULT(yes)
    else
      AC_MSG_RESULT(no)
      want_ecore_fb="no"
    fi
  ], [
    AC_MSG_RESULT(yes)
  ]
)

if test "x$want_ecore_fb" = "xyes"; then
  AC_CHECK_HEADER(linux/fb.h,
    [
      AM_CONDITIONAL(BUILD_ECORE_FB, true)
      AC_DEFINE(BUILD_ECORE_FB, 1, [Build Ecore_FB Module])
      have_ecore_fb="yes"
      ecore_fb_libs="-lecore_fb";
    ], [
      AM_CONDITIONAL(BUILD_ECORE_FB, false)
    ]
  )
else
  AM_CONDITIONAL(BUILD_ECORE_FB, false)
fi

AC_SUBST(ecore_fb_cflags)
AC_SUBST(ecore_fb_libs)

ecore_evas_cflags="";
ecore_evas_libs="";

want_ecore_evas="yes"
have_ecore_evas="no"
evas_cflags="";
evas_libs="";

AC_MSG_CHECKING(whether ecore_evas module is to be built)
AC_ARG_ENABLE(ecore-evas, 
  [  --disable-ecore-evas          disable the ecore_evas module],
  [
    if test x"$enableval" = x"yes" ; then  
      AC_MSG_RESULT(yes)
    else
      AC_MSG_RESULT(no)
      want_ecore_evas="no";
    fi
  ], [
    AC_MSG_RESULT(yes)
  ]
)

if test "x$want_ecore_evas" = "xyes"; then
  AC_PATH_GENERIC(evas, 0.9.9,
    [
      AM_CONDITIONAL(BUILD_ECORE_EVAS, true)
      AC_DEFINE(BUILD_ECORE_EVAS, 1, [Build Ecore_Evas Module])
      have_ecore_evas="yes"
      ecore_evas_libs="-lecore_evas";
    ], [
      AM_CONDITIONAL(BUILD_ECORE_EVAS, false)
    ]
  )
else
  AM_CONDITIONAL(BUILD_ECORE_EVAS, false)
fi

AC_SUBST(ecore_evas_cflags)
AC_SUBST(ecore_evas_libs)

want_ecore_evas_gl="yes";
have_ecore_evas_gl="no";

AC_MSG_CHECKING(whether ecore_evas gl support is to be built)
AC_ARG_ENABLE(ecore-evas-gl, 
  [  --disable-ecore-evas-gl       disable gl in the ecore_evas module],
  [
    if test x"$enableval" = x"yes" ; then  
      AC_MSG_RESULT(yes)
    else
      AC_MSG_RESULT(no)
      want_ecore_evas_gl="no"
    fi
  ], [
    AC_MSG_RESULT(yes)
  ]
)

dnl GL support requires X support, so we should
dnl handle the case where our user is on crack
dnl i.e. user disables X but enables GL
PCFLAGS=$CFLAGS
CFLAGS="$EVAS_CFLAGS $CFLAGS"
if test "x$want_ecore_evas_gl" = "xyes" -a "x$have_ecore_x" = "xyes"; then
  AC_CHECK_HEADER(Evas_Engine_GL_X11.h,
    [
      AM_CONDITIONAL(BUILD_ECORE_EVAS_GL, true)
      AC_DEFINE(BUILD_ECORE_EVAS_GL, 1, [Support for GL Engine in Ecore_Evas])
      have_ecore_evas_gl="yes";
    ], [
      AM_CONDITIONAL(BUILD_ECORE_EVAS_GL, false)
    ], [
      #include <Evas.h>
    ]
  )
else
  AM_CONDITIONAL(BUILD_ECORE_EVAS_GL, false)
  if test "x$want_ecore_evas_gl" = "xyes"; then
    AC_MSG_WARN(Silly monkey: ecore_evas_gl requires ecore_x ... disabling ecore_evas_gl)
  fi
fi

want_ecore_evas_xrender="yes";
have_ecore_evas_xrender="no";

AC_MSG_CHECKING(whether ecore_evas xrender support is to be built)
AC_ARG_ENABLE(ecore-evas-xrender, 
  [  --disable-ecore-evas-xrender  disable xrender in the ecore_evas module],
  [
    if test x"$enableval" = x"yes" ; then  
      AC_MSG_RESULT(yes)
    else
      AC_MSG_RESULT(no)
      want_ecore_evas_xrender="no"
    fi
  ], [
    AC_MSG_RESULT(yes)
  ]
)

dnl Xrender support requires X support, so we should
dnl handle the case where our user is on crack
dnl i.e. user disables X but enables Xrender
PCFLAGS=$CFLAGS
CFLAGS="$EVAS_CFLAGS $CFLAGS"
if test "x$want_ecore_evas_xrender" = "xyes" -a "x$have_ecore_x" = "xyes"; then
  AC_CHECK_HEADER(Evas_Engine_XRender_X11.h,
    [
      AM_CONDITIONAL(BUILD_ECORE_EVAS_XRENDER, true)
      AC_DEFINE(BUILD_ECORE_EVAS_XRENDER, 1, [Support for XRender Engine in Ecore_Evas])
      have_ecore_evas_xrender="yes";
    ], [
      AM_CONDITIONAL(BUILD_ECORE_EVAS_XRENDER, false)
    ], [
      #include <Evas.h>
    ]
  )
else
  AM_CONDITIONAL(BUILD_ECORE_EVAS_XRENDER, false)
  if test "x$want_ecore_evas_xrender" = "xyes"; then
    AC_MSG_WARN(Silly monkey: ecore_evas_xrender requires ecore_x ... disabling ecore_evas_xrender)
  fi
fi


AC_MSG_CHECKING(whether ecore_evas DirectFB support is to be built)
AC_ARG_ENABLE(ecore-evas-dfb,
  [  --disable-ecore-evas-dfb      disable DirectFB in the ecore_evas module],
  [
    if test "x$enableval" = "xno" ; then  
      want_ecore_evas_dfb=no
    else
      want_ecore_evas_dfb=yes
    fi
  ], [
    want_ecore_evas_dfb=maybe
  ]
)
AC_MSG_RESULT($want_ecore_evas_dfb)

have_ecore_evas_dfb="no"
if test "x$want_ecore_evas_dfb" != "xno" ; then
  save_CFLAGS="$CFLAGS"
  CFLAGS="$CFLAGS $DIRECTFB_CFLAGS"
  AC_CHECK_HEADER(Evas_Engine_DirectFB.h,
    [
      AC_DEFINE(BUILD_ECORE_EVAS_DIRECTFB, 1, [Support for DirectFB in Ecore_Evas])
      have_ecore_evas_dfb="yes"
    ], [
      if test "x$want_ecore_evas_dfb" = "xyes" ; then
        AC_MSG_ERROR(DirectFB requested but support not found)
      fi
    ], [
      #include <Evas.h>
    ]
  )
  CFLAGS="$save_CFLAGS"
fi
AM_CONDITIONAL(BUILD_ECORE_EVAS_DIRECTFB, test "x$have_ecore_evas_dfb" = "xyes")


want_ecore_evas_fb="yes";
have_ecore_evas_fb="no";

AC_MSG_CHECKING(whether ecore_evas fb support is to be built)
AC_ARG_ENABLE(ecore-evas-fb, 
  [  --disable-ecore-evas-fb       disable fb in the ecore_evas module],
  [
    if test x"$enableval" = x"yes" ; then  
      AC_MSG_RESULT(yes)
    else
      AC_MSG_RESULT(no)
      want_ecore_evas_fb="no"
    fi
  ], [
    AC_MSG_RESULT(yes)
  ]
)

if test "x$want_ecore_evas_fb" = "xyes"; then
  AC_CHECK_HEADER(Evas_Engine_FB.h,
    [
      AM_CONDITIONAL(BUILD_ECORE_EVAS_FB, true)
      AC_DEFINE(BUILD_ECORE_EVAS_FB, 1, [Support for Linux FB in Ecore_Evas])
      have_ecore_evas_fb="yes"
    ], [
      AM_CONDITIONAL(BUILD_ECORE_EVAS_FB, false)
    ], [
      #include <Evas.h>
    ]
  )
else
  AM_CONDITIONAL(BUILD_ECORE_EVAS_FB, false)
fi

want_ecore_evas_buffer="yes";
have_ecore_evas_buffer="no";

AC_MSG_CHECKING(whether ecore_evas buffer support is to be built)
AC_ARG_ENABLE(ecore-evas-buffer, 
  [  --disable-ecore-evas-buffer   disable buffer in the ecore_evas module],
  [
    if test x"$enableval" = x"yes" ; then  
      AC_MSG_RESULT(yes)
    else
      AC_MSG_RESULT(no)
      want_ecore_evas_buffer="no"
    fi
  ], [
    AC_MSG_RESULT(yes)
  ]
)

if test "x$want_ecore_evas_buffer" = "xyes"; then
  AC_CHECK_HEADER(Evas_Engine_Buffer.h,
    [
      AM_CONDITIONAL(BUILD_ECORE_EVAS_BUFFER, true)
      AC_DEFINE(BUILD_ECORE_EVAS_BUFFER, 1, [Support for Buffers in Ecore_Evas])
      have_ecore_evas_buffer="yes"
    ], [
      AM_CONDITIONAL(BUILD_ECORE_EVAS_BUFFER, false)
    ], [
      #include <Evas.h>
    ]
  )
else
  AM_CONDITIONAL(BUILD_ECORE_EVAS_BUFFER, false)
fi
CFLAGS=$PCFLAGS

AC_MSG_CHECKING(whether ecore_con module is to be built)

want_ecore_con="yes";
have_ecore_con="no";
ecore_con_cflags="";
ecore_con_libs="";

AC_ARG_ENABLE(ecore-con, 
  [  --disable-ecore-con           disable the ecore_con module],
  [
    if test x"$enableval" = x"yes" ; then  
      AC_MSG_RESULT(yes)
    else
      AC_MSG_RESULT(no)
      want_ecore_con="no"
    fi
  ], [
    AC_MSG_RESULT(yes)
  ]
)

if test "x$want_ecore_con" = "xyes"; then
  AM_CONDITIONAL(BUILD_ECORE_CON, true)
  AC_DEFINE(BUILD_ECORE_CON, 1, [Build Ecore_Con Module])
  have_ecore_con="yes"
  ecore_con_libs="-lecore_con"
else
  AM_CONDITIONAL(BUILD_ECORE_CON, false)
fi

AC_SUBST(ecore_con_cflags)
AC_SUBST(ecore_con_libs)

AC_ARG_ENABLE(openssl,
  [  --enable-openssl              enable openssl support @<:@default=auto@:>@],
  [ use_openssl=$enableval ],
  [ use_openssl=yes ]
)

if test "x$use_openssl" = "xyes"; then
  PKG_CHECK_MODULES(SSL, openssl,
    [
       use_openssl=yes
       AC_DEFINE(USE_OPENSSL, 1, [Use OpenSSL])
    ],
    [ use_openssl=no ]
  )
fi

want_ecore_ipc="yes";
have_ecore_ipc="no";
ecore_ipc_cflags="";
ecore_ipc_libs="";

if test "x$have_ecore_con" = "xyes"; then
  AC_MSG_CHECKING(whether ecore_ipc module is to be built)
    AC_ARG_ENABLE(ecore-ipc, 
    [  --disable-ecore-ipc           disable the ecore_ipc module],
    [
      if test x"$enableval" = x"yes" ; then  
        AC_MSG_RESULT(yes)
      else
        AC_MSG_RESULT(no)
        want_ecore_ipc="no"
      fi
    ], [
      AC_MSG_RESULT(yes)
    ]
  )
else
  AC_MSG_RESULT(ecore_con not enabled so ecore_ipc will not be enabled)
  want_ecore_ipc="no"
fi

if test "x$want_ecore_ipc" = "xyes"; then
  AM_CONDITIONAL(BUILD_ECORE_IPC, true)
  AC_DEFINE(BUILD_ECORE_IPC, 1, [Build Ecore_Ipc Module])
  have_ecore_ipc="yes"
  ecore_ipc_libs="-lecore_ipc"
else
  AM_CONDITIONAL(BUILD_ECORE_IPC, false)
fi

AC_SUBST(ecore_ipc_cflags)
AC_SUBST(ecore_ipc_libs)


AC_MSG_CHECKING(whether ecore_dbus module is to be built)
want_ecore_dbus="yes";
have_ecore_dbus="no";
ecore_dbus_cflags="";
ecore_dbus_libs="";
dbus_dir="";
dbus_includes="";
dbus_cflags="";
dbus_libs="";

AC_ARG_ENABLE(ecore-dbus,
  [  --disable-ecore-dbus          disable the ecore_dbus module],
  [
    if test x"$enableval" = x"yes" ; then
      AC_MSG_RESULT(yes)
    else
      AC_MSG_RESULT(no)
      want_ecore_dbus="no"
    fi
  ], [
    AC_MSG_RESULT(yes)
  ]
)

if test "x$want_ecore_dbus" = "xyes"; then
  AM_CONDITIONAL(BUILD_ECORE_DBUS, true)
  AC_DEFINE(BUILD_ECORE_DBUS, 1, [Build Ecore_DBus Module])
  have_ecore_dbus="yes"
  #dbus_dir="/usr";
  #dbus_includes="";
  #dbus_cflags="-I"$dbus_dir"/include/dbus-1.0 -I"$dbus_dir"/lib/dbus-1.0/include"
  #dbus_libs="-L"$dbus_dir"/lib"
  #dbus_ldflags="-ldbus-1";
  ecore_dbus_libs="-lecore_dbus";
else
  AM_CONDITIONAL(BUILD_ECORE_DBUS, false)
fi

AC_SUBST(dbus_cflags)
AC_SUBST(dbus_includes)
AC_SUBST(dbus_ldflags)
AC_SUBST(dbus_libs)

AC_SUBST(ecore_dbus_cflags)
AC_SUBST(ecore_dbus_libs)


AC_MSG_CHECKING(whether ecore_config module is to be built)

want_ecore_config="yes";
have_ecore_config="no";
ecore_config_cflags="";
ecore_config_libs="";

AC_ARG_ENABLE(ecore-config, 
  [  --disable-ecore-config        disable the ecore_config module],
  [
    if test x"$enableval" = x"yes" ; then  
      AC_MSG_RESULT(yes)
    else
      AC_MSG_RESULT(no)
      want_ecore_config="no";
    fi
  ], [
    AC_MSG_RESULT(yes)
  ]
)

if test "x$want_ecore_config" = "xyes"; then
  AC_PATH_GENERIC(eet, 0.9.10,
    [
      AM_CONDITIONAL(BUILD_ECORE_CONFIG, true)
      AC_DEFINE(BUILD_ECORE_CONFIG, 1, [Build Ecore_Config Module])
      have_ecore_config="yes"
      ecore_config_libs="-lecore_config";
    ], [
      AM_CONDITIONAL(BUILD_ECORE_CONFIG, false)
    ]
  )
else
  AM_CONDITIONAL(BUILD_ECORE_CONFIG, false)
fi

AC_SUBST(ecore_config_cflags)
AC_SUBST(ecore_config_libs)

want_ecore_file="yes"
have_ecore_file="no"
ecore_file_libs=""
use_fam="no"
use_inotify="yes"
use_poll="yes"
use_curl="no"

AC_MSG_CHECKING(whether ecore_file module is to be built)
AC_ARG_ENABLE(ecore-file, 
  [  --disable-ecore-file          disable the ecore_file module],
  [
    if test "$enableval" = "yes"; then  
      AC_MSG_RESULT(yes)
    else
      AC_MSG_RESULT(no)
      want_ecore_file="no"
    fi
  ], [
    AC_MSG_RESULT(yes)
  ]
)

if test "x$want_ecore_file" = "xyes"; then
  AM_CONDITIONAL(BUILD_ECORE_FILE, true)
  ecore_file_libs="-lecore_file"
  have_ecore_file="yes"
  AC_DEFINE(HAVE_POLL, 1, [ File monitoring with polling ])
else
  AM_CONDITIONAL(BUILD_ECORE_FILE, false)
fi

if test "x$have_ecore_file" = "xyes"; then
  dnl We need to check if the right inotify version is accessible
  AC_MSG_CHECKING(whether inotify is to be used for filemonitoring)
  AC_ARG_ENABLE(inotify, 
    [  --disable-inotify             disable inotify in the ecore_file module],
    [
      if test "$enableval" = "yes"; then  
        AC_MSG_RESULT(yes)
      else
        AC_MSG_RESULT(no)
        use_inotify="no"
      fi
    ], [
      AC_MSG_RESULT(yes)
    ]
  )
  
  dnl It's hard to find a good test on how to check the correct
  dnl inotify version. They changed the headers a lot.
  dnl in kernel 2.6.13 __NR_inotify_init was added to the defined syscalls
  dnl in asm/unistd.h and IN_MOVE_SELF was added to linux/inotify.h
  dnl so with this check you need a very new kernel and kernel-headers!
  if test "x$use_inotify" = "xyes"; then
    AC_TRY_COMPILE(
      [
        #include <asm/unistd.h>
        #include <linux/inotify.h>
      ],
      [ int a = __NR_inotify_init; int b = IN_MOVE_SELF; ],
      [
        AC_DEFINE(HAVE_INOTIFY, 1, [ File monitoring with Inotify ])
      ], [
        use_inotify="no"
      ]
    )
  fi
  
  #AC_MSG_CHECKING(whether FAM is to be used for filemonitoring)
  #AC_ARG_ENABLE(fam, 
  #  [  --enable-fam              enable fam in the ecore_file module],
  #  [
  #    if test "$enableval" = "yes"; then  
  #      AC_MSG_RESULT(yes)
  #      use_fam="yes"
  #    else
  #      AC_MSG_RESULT(no)
  #    fi
  #  ], [
  #    AC_MSG_RESULT(no)
  #  ]
  #)
  
  fam_libs=""
  #if test "x$use_fam" = "xyes"; then
  #  AC_CHECK_LIB(fam, FAMOpen,
  #    [
  #      AC_DEFINE(HAVE_FAM, 1, [ File monitoring with FAM ])
  #      fam_libs="-lfam"
  #      ecore_file_libs="$ecore_file_libs $fam_libs"
  #    ], [
  #      use_fam="no"
  #    ]
  #  )
  #fi
  
  AC_MSG_CHECKING(whether polling is to be used for filemonitoring)
  AC_ARG_ENABLE(poll, 
    [  --disable-poll                disable poll in the ecore_file module],
    [
      if test "$enableval" = "yes"; then  
        AC_MSG_RESULT(yes)
      else
        AC_MSG_RESULT(no)
        use_poll="no"
      fi
    ], [
      AC_MSG_RESULT(yes)
    ]
  )
  
  if test "x$use_poll" = "xyes"; then
    AC_DEFINE(HAVE_POLL, 1, [ File monitoring with polling ])
  fi
  
  use_curl="no"
  AC_MSG_CHECKING(whether CURL is to be used for file download)
  AC_ARG_ENABLE(curl, 
    [  --enable-curl                 enable curl in the ecore_file module],
    [
      if test "$enableval" = "yes"; then  
        AC_MSG_RESULT(yes)
        use_curl="yes"
      else
        AC_MSG_RESULT(no)
      fi
    ], [
      AC_MSG_RESULT(no)
    ]
  )
  
  if test "x$use_curl" = "xyes"; then
    AC_PATH_GENERIC(curl, ,
      [
        AC_DEFINE(HAVE_CURL, 1, [ Downloading with CURL ])
        ecore_file_libs="$ecore_file_libs $CURL_LIBS"
      ], [
        use_curl="no"
      ]
    )
  fi
fi

AC_SUBST(fam_libs)
AC_SUBST(ecore_file_libs)

AC_ARG_ENABLE(pthreads,
  [  --disable-pthreads            disable building with pthread support],
  [
    if test x$enableval = xyes; then
      pthreads=yes
    else
      pthreads=no
    fi
  ]
)

if test x$pthreads = xyes ; then
AC_CHECK_HEADERS(pthread.h,pthread_header_ok="yes", pthread_header_ok="no")
   if test "$pthread_header_ok" = "yes"; then
      AC_CHECK_LIB(pthread, main, PTHREAD_LIBS="-lpthread", PTHREAD_LIBS="error")
      if test "$PTHREAD_LIBS" = "error"; then
         AC_CHECK_LIB(c_r, main, PTHREAD_LIBS="-pthread", pthread_lib_ok="no")
      fi
   fi
   if test "$pthread_header_ok" = "no" -o "$pthread_lib_ok" = "no"; then
      HAVE_PTHREADS=0
   else
      HAVE_PTHREADS=1
   fi
   if test "$PTHREAD_LIBS" = "-pthread"; then
      LIBS="$LIBS $PTHREAD_LIBS"
   else
      PTHREAD_CFLAGS="-D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS"
      LIBS="$LIBS $PTHREAD_LIBS"
   fi
else
   HAVE_PTHREADS=0
   PTHREAD_LIBS=""
fi

AC_SUBST(PTHREAD_LIBS)
AC_SUBST(HAVE_PTHREADS)

AC_CHECK_LIB(dl, dlopen, dlopen_libs=-ldl)
AC_SUBST(dlopen_libs)

dnl Checking for Perl:
AC_PATH_PROG(PERL,perl,0)
AC_SUBST(PERL)

requirements=""
AC_SUBST(requirements)

AC_OUTPUT([
Makefile
ecore.pc
data/Makefile
data/fonts/Makefile
data/images/Makefile
data/pointers/Makefile
src/Makefile
src/bin/Makefile
src/lib/Makefile
src/lib/ecore/Makefile
src/lib/ecore_job/Makefile
src/lib/ecore_x/Makefile
src/lib/ecore_fb/Makefile
src/lib/ecore_evas/Makefile
src/lib/ecore_con/Makefile
src/lib/ecore_ipc/Makefile
src/lib/ecore_txt/Makefile
src/lib/ecore_config/Makefile
src/lib/ecore_file/Makefile
src/lib/ecore_dbus/Makefile
src/lib/ecore_directfb/Makefile
examples/Makefile
ecore-config
README
ecore.spec
ecore.oe
ecore-native.oe
ecore.bb
ecoreXnative.bb
debian/changelog
],[
chmod +x ecore-config
])

echo
echo "$PACKAGE $VERSION"
echo
echo "Optional Modules:"
echo
echo "  Ecore_Job....................: $have_ecore_job"
echo "  Ecore_Con....................: $have_ecore_con (OpenSSL: $use_openssl)"
echo "  Ecore_Txt....................: $have_ecore_txt"
echo "  Ecore_X......................: $have_ecore_x (Xcursor: $use_Xcursor) (Xprint: $use_Xprint) (Xinerama: $use_Xinerama) (Xrandr: $use_Xrandr)"
echo "  Ecore_FB.....................: $have_ecore_fb"
echo "  Ecore_DFB....................: $have_ecore_dfb"
echo "  Ecore_Evas...................: $have_ecore_evas"
echo "  Ecore_Evas GL Support........: $have_ecore_evas_gl"
echo "  Ecore_Evas XRender Support...: $have_ecore_evas_xrender"
echo "  Ecore_Evas FB Support........: $have_ecore_evas_fb"
echo "  Ecore_Evas DFB Support.......: $have_ecore_evas_dfb"
echo "  Ecore_Buffer.................: $have_ecore_evas_buffer"
echo "  Ecore_Ipc....................: $have_ecore_ipc (OpenSSL: $use_openssl)"
echo "  Ecore_Config.................: $have_ecore_config"
echo "  Ecore_DBUS...................: $have_ecore_dbus"
#echo "  Ecore_File...................: $have_ecore_file (Inotify: $use_inotify) (FAM: $use_fam) (Poll: $use_poll)"
echo "  Ecore_File...................: $have_ecore_file (Inotify: $use_inotify) (Poll: $use_poll) (CURL: $use_curl)"
echo
echo "Now type 'make' ('gmake' on some systems) to compile $PACKAGE."
echo