File: configure.in

package info (click to toggle)
gimp-gap 2.6.0+dfsg-5
  • links: PTS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 20,720 kB
  • ctags: 7,997
  • sloc: ansic: 119,817; sh: 3,890; makefile: 932; lisp: 97; pascal: 55
file content (1070 lines) | stat: -rw-r--r-- 36,698 bytes parent folder | download | duplicates (4)
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
dnl Process this file with autoconf to produce a configure script.

AC_PREREQ(2.52)
AC_INIT(configure.in)
AM_CONFIG_HEADER(config.h)

GAP_MAJOR_VERSION=2
GAP_MINOR_VERSION=6
GAP_MICRO_VERSION=0
GAP_VERSION=$GAP_MAJOR_VERSION.$GAP_MINOR_VERSION.$GAP_MICRO_VERSION
VERSION=$GAP_VERSION
GAP_VERSION_WITH_DATE="$GAP_VERSION; 2009/05/19"

AC_SUBST(GAP_MAJOR_VERSION)
AC_SUBST(GAP_MINOR_VERSION)
AC_SUBST(GAP_MICRO_VERSION)
AC_SUBST(GAP_VERSION)
AC_SUBST(GAP_VERSION_WITH_DATE)
	
AC_DEFINE_UNQUOTED(GAP_MAJOR_VERSION, $GAP_MAJOR_VERSION,
				      [gimp-gap major release number])
AC_DEFINE_UNQUOTED(GAP_MINOR_VERSION, $GAP_MINOR_VERSION,
				      [gimp-gap minor release number])
AC_DEFINE_UNQUOTED(GAP_MICRO_VERSION, $GAP_MICRO_VERSION,
				      [gimp-gap micro release number])

AC_DEFINE_UNQUOTED(GAP_VERSION_WITH_DATE, "$GAP_VERSION_WITH_DATE",
				      [gimp-gap version string for registrating gap plug-ins])

AM_INIT_AUTOMAKE(gimp-gap, $VERSION)

AM_MAINTAINER_MODE

AC_CANONICAL_HOST

AC_PROG_CC
AC_ISC_POSIX
AM_PROG_CC_STDC
AC_HEADER_STDC

AC_PROG_RANLIB

ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"

GETTEXT_PACKAGE=gimp20-gap
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",
                   [The gettext translation domain.])

AC_CHECK_HEADERS(unistd.h)
AC_CHECK_FUNCS(bind_textdomain_codeset)


PKG_CHECK_MODULES(GIMP, gimp-2.0 >= 2.6.0 gimpui-2.0 >= 2.6.0 gimpthumb-2.0)

GIMP_DATA_DIR=`$PKG_CONFIG gimp-2.0 --variable=gimpdatadir`
GIMP_PLUGIN_DIR=`$PKG_CONFIG gimp-2.0 --variable=gimplibdir`

AC_SUBST(GIMP_DATA_DIR)
AC_SUBST(GIMP_PLUGIN_DIR)


PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.8.0)

NEW_LINE="
"

AC_MSG_CHECKING([for target architecture])
case x"$target" in
  xNONE | x)
    target_or_host="$host" ;;
  *)
    target_or_host="$target" ;;
esac
AC_MSG_RESULT([$target_or_host])

dnl check if gmake is available
EXGMAKE=make
AC_CHECK_PROG(GMAKE_AVAILABLE, gmake, yes, no)
if test $GMAKE_AVAILABLE = yes; then
  EXGMAKE=gmake
fi
AC_SUBST(EXGMAKE)

dnl prefix and suffix of librarynames (for win32 environment)
dnl notes:
dnl older gimp-gap releases automatically used .lib suffix (MSVC style) when build runs in MinGW
dnl Win32 environment. (see notes on bug #324854 reported 2005.12.23 for details)
dnl Now i have setup a MinGW build environment based on gcc where
dnl ffmpeg-0.5 libraries are built in unix typical stlye ending with extension .a
dnl i added the configure option --enable-win32libnames to support
dnl old behaviour (but build with MSVC is not tested and not fully supported and probably may fail)

MINGW_LIBPREF="lib"
MINGW_LIBSUF=".a"

AC_ARG_ENABLE(win32libnames,
              [  --enable-win32libnames     use MSVC style for library extension .lib instead of .a on MinGW environment])
  if test "x$enable_win32libnames" = "xyes"; then
    MINGW_LIBPREF=""
    MINGW_LIBSUF=".lib"
  fi
  

AC_MSG_CHECKING([for native Win32])
case "$target_or_host" in
  *-*-mingw*)
    os_win32=yes
    PATHSEP=';'
    LIBPREF="$MINGW_LIBPREF"
    LIBSUF="$MINGW_LIBSUF"
    ;;
  *)
    os_win32=no
    PATHSEP=':'
    LIBPREF="lib"
    LIBSUF=".a"
    ;;
esac
AC_MSG_RESULT([$os_win32])
AC_SUBST(PATHSEP)
AC_SUBST(LIBPREF)
AC_SUBST(LIBSUF)
AM_CONDITIONAL(OS_WIN32, test "$os_win32" = "yes")

dnl Test for unix-frontends
dnl -----------------------
AC_ARG_ENABLE(unixfrontends,
              [  --enable-unix-frontends     build with UNIX specific frontends for OLD programs xanim and mpeg encoders])
  if test "x$enable_unix_frontends" = "xyes"; then

    dnl disable unix frontends per default on win32 systems (unless explicte specified yes)
    if test "x$os_win32" = "xyes"; then
       enable_unix_frontends=no
       frontends_warning="
WARNING: the --enable-unix-frontends is ignored on  Windows build
"
    else
       frontends_warning="
gimp-gap is configured with Linux/UNIX specific frontends for OLD  xanim
and OLD mpeg encoders.
"
    fi

  else
     enable_unix_frontends=no
  fi

AM_CONDITIONAL(GAP_UNIX_FRONTENDS, test "x$enable_unix_frontends" != "xno")


dnl check for bzip2 library (for ffmpeg matroskadec )
dnl the check result does not matter unless libavformat is linked or built later on.
FF_BZIP2=""
ffbz2_warn=""
AC_ARG_ENABLE(ff_libbz2,
              [  --disable-ff-libbz2          configure libavformat without libbz2 disables matroskadec bz2 support])
  if test "x$enable_ff_libbz2" != "xno"; then
    AC_CHECK_LIB(bz2, BZ2_bzDecompressInit,
        [AC_CHECK_HEADER(bzlib.h,
          FF_BZIP2="-lbz2",
          ffbz2_warn="$NEW_LINE ** bzip2 header file (bzlib.h) not found (limited support for ffmpeg matroskadec codec )")],
      ffbz2_warn="bzip2 library (libbz2) not found (there will be limited support)")    
  fi


dnl ## libmp3lame lame/lame.h lame_init -lmp3lame -lm

dnl check for libmp3lame library (useful for ffmpeg audio MP3 support)
dnl the check result does not matter unless libavformat is linked or built later on.
FF_LIBMP3LAME=""
mp3lame_warn=""
AC_ARG_ENABLE(ff_libmp3lame,
              [  --disable-ff-libmp3lame          configure libavformat without libmp3lame])
  if test "x$enable_ff_libmp3lame" != "xno"; then
    AC_CHECK_LIB(mp3lame, lame_init,
        [AC_CHECK_HEADER(lame/lame.h,
          FF_LIBMP3LAME="-lmp3lame",
          mp3lame_warn="$NEW_LINE ** mp3lame header file (lame/lame.h) not found (not critical)")],
      mp3lame_warn="mp3lame library (libmp3lame) not found (not critical)")    
  fi
dnl

dnl check for faac library (useful for better ffmpeg audio support)
dnl FAAC is an open source MPEG-4 and MPEG-2 AAC encoder, it is licensed under the LGPL 
dnl the check result does not matter unless libavformat is linked or built later on.
FF_LIBFAAC=""
faac_warn=""
AC_ARG_ENABLE(ff_libfaac,
              [  --disable-ff-libfaac          configure libavformat without libfaac])
  if test "x$enable_ff_libfaac" != "xno"; then
    AC_CHECK_LIB(faac, faacEncGetVersion,
        [AC_CHECK_HEADER(faac.h,
          FF_LIBFAAC="-lfaac",
          faac_warn="$NEW_LINE ** faac header file (faac.h) not found (not critical)")],
      faac_warn="faac library (libfaac) not found (not critical)")    
  fi
dnl

dnl check for faad library (useful for better ffmpeg audio support)
dnl FAAC is an open source MPEG-4 and MPEG-2 AAC encoder, it is licensed under the LGPL 
dnl the check result does not matter unless libavformat is linked or built later on.
FF_LIBFAAD=""
faad_warn=""
AC_ARG_ENABLE(ff_libfaad,
              [  --disable-ff-libfaad          configure libavformat without libfaad])
  if test "x$enable_ff_libfaad" != "xno"; then
    AC_CHECK_LIB(faad, NeAACDecOpen,
        [AC_CHECK_HEADER(faad.h,
          FF_LIBFAAD="-lfaad",
          faad_warn="$NEW_LINE ** faad header file (faad.h) not found (not critical)")],
      faad_warn="faad library (libfaad) not found (not critical)")    

    dnl additional check for faad1 library (that is also sufficient for building ffmpeg 0.5)

    if test "x$FF_LIBFAAD" = "x"; then
      AC_CHECK_LIB(faad, faacDecOpen,
        [AC_CHECK_HEADER(faad.h,
          FF_LIBFAAD="-lfaad",
          faad_warn="$NEW_LINE ** faad header file (faad.h) not found (not critical)")],
        faad_warn="faad library (libfaad) not found (not critical)")    
    fi

  fi
dnl



dnl check for x264 library (additional for ffmpeg video codec support)
dnl ### TODO check are no longer sufficient for recent ffmpeg 2009.01.31.
dnl ### check shall verify the condition "X264_BUILD >= 65
dnl ### Note that the missing check it is not critical, since ffmpeg configure script has such a check
dnl ###      and turns off x264 support when older versions are detected, and prints an error like this:
dnl ###          ERROR: libx264 version must be >= 0.65.
dnl the check result does not matter unless libavformat is linked or built later on.
FF_LIBX264=""
x264_warn=""
AC_ARG_ENABLE(ff_libx264,
              [  --disable-ff-libx264         configure libavformat without optional open source variant of H264 video codec])
  if test "x$enable_ff_libx264" != "xno"; then
    AC_CHECK_LIB(x264, x264_encoder_open,
      [AC_CHECK_HEADER(x264.h,
          FF_LIBX264="-lx264",
          x264_warn="$NEW_LINE x264 header file (x264.h) not found (not critical, but no open H264 video codec support)")],
      x264_warn="$NEW_LINE x264 library (libx264) not found (not critical, but no open H264 video codec support)")   
  fi


dnl check for xvid library (additional for ffmpeg open xvid video codec support)
dnl the check result does not matter unless libavformat is linked or built later on.
xvid_warn=""
FF_LIBXVID=""
AC_ARG_ENABLE(ff_libxvid,
              [  --disable-ff-libxvid         configure libavformat without optional open source variant of xvid video codec])
  if test "x$enable_ff_libxvid" != "xno"; then
    AC_CHECK_LIB(xvidcore, xvid_global,
      [AC_CHECK_HEADER(xvid.h,
          FF_LIBXVID="-lxvidcore",
          xvid_warn="$NEW_LINE xvid header file (xvid.h) not found (not critical, but no open xvid video codec support)")],
      xvid_warn="$NEW_LINE xvid library (libxvidcore) not found (not critical, but no open xvid video codec support)")   
  fi



dnl Test for videoapisupport
dnl ------------------------
AC_ARG_ENABLE(videoapisupport,
              [  --disable-videoapi-support   don't build with videoapi support])
  if test "x$enable_videoapi_support" != "xno"; then
    AC_DEFINE(GAP_ENABLE_VIDEOAPI_SUPPORT, 1,
              [Define to 1 to enable videoapi support])
  else
        videoapi_warning="
gimp-gap is configured without video API (libgapvidapi.a)
   There will be NO access to videofiles (mpeg, avi...) in the storyboard
   plug-in and the videoextract plug-in will not work at all.
   To compile with video API run configure with
   the --enable-videoapi-support option.
"

  fi

AM_CONDITIONAL(GAP_VIDEOAPI_SUPPORT, test "x$enable_videoapi_support" != "xno")


dnl get name of current and parent dir
pwd_dir=`pwd`
cd ..
parent_dir=`pwd`
cd "$pwd_dir"
extern_libs_dir="$pwd_dir/extern_libs"

dnl Test for video libavformat (FFMPEG)
dnl -----------------------------------
dnl the ffmpeg libs are both used as decoder implementations in the GAP Video API (GVA)
dnl and in the ffmpeg videoencoder  plug-in
dnl ffmpeg should compile on many operating systems, including UNIX and WINDOWS systems
dnl
dnl the current gimp-gap preferes static linking with ffmpeg (svn snaphots 2007.03.01 or later)
dnl therefore the ffmpeg sourcetree should be specified --with-ffmpegdir=DIR
dnl a permanent ffmpeg installation is not required in that case, but the libraries 
dnl   libavutil.a libavformat.a and libavcodec.a
dnl must be already built there. 
dnl
dnl
FFMPEG_DIRNAME="ffmpeg"
FFMPEG_TARBALL="$extern_libs_dir/ffmpeg.tar.gz"

dnl where to find the ffmpeg sourcedir (expanded ffmpeg tarball)
FFMPEG_DIR="$extern_libs_dir/$FFMPEG_DIRNAME"

AC_ARG_WITH(ffmpegsrcdir, [  --with-ffmpegsrcdir=DIR      specify where to find ffmpeg src directory DIR (this is a developers option to bypass the included ffmpeg sourcetree)],
if eval "test x$with_ffmpegsrcdir != x"; then
  if eval "test x$with_ffmpegsrcdir != xyes"; then
    if test -d "$with_ffmpegsrcdir"; then
      FFMPEG_DIR=$with_ffmpegsrcdir
    else
      echo "** ERROR option --with-ffmpegsrcdir must refere to a directory"
      echo "** $with_ffmpegsrcdir  is not a directory"
    fi
  fi
fi)


dnl assume ffmpeg libs build "no" (in case disabled)
build_ffmpeg_libs_yesno="no"

AC_ARG_WITH(ff-extra-cflags, [  --with-ff-extra-cflags=cflags    specify extra c-compiler flags for compiling ffmpeg],
   FF_EXTRA_CFLAGS=$with_ff_extra_cflags)

AC_ARG_WITH(ff-extra-ldflags, [  --with-ff-extra-ldflags=ldflags    specify extra linker flags for linking ffmpeg libs],
   FF_EXTRA_LDFLAGS=$with_ff_extra_ldflags)


moved_old_ffmpeg_warn=""
AC_ARG_ENABLE(libavformat,
              [  --disable-libavformat        don't build with libavformat/libavcodec/libavutil])
  if test "x$enable_libavformat" != "xno"; then
    dnl

    dnl check if old ffmpeg version(s) that were once part of GIMP-GAP are still there .
    dnl typically for SVN users after an svn update. note that ffmpeg source tree
    dnl is not under svn control and is derived from the tarball.

    FF_FILE_AVCODEC_H="$FFMPEG_DIR/libavcodec/avcodec.h"
    FF_FILE_AVFORMAT_H="$FFMPEG_DIR/libavformat/avformat.h"

    echo "checking $FF_FILE_AVCODEC_H for old content"
    
    ffmpeg_dir_is_old="no"
    if test -f "$FF_FILE_AVCODEC_H"; then
      if  grep '#define LIBAVCODEC_VERSION      51.47.2' $FF_FILE_AVCODEC_H >/dev/null; then
        ffmpeg_dir_is_old="yes"
      fi
    fi
    echo "checking files $FF_FILE_AVFORMAT_H for old content"
    if test -f "$FF_FILE_AVFORMAT_H"; then
      if  grep 'avformat_alloc_context' $FF_FILE_AVFORMAT_H >/dev/null; then
        echo "checking ffmpeg/libavformat/avformat.h supports avformat_alloc_context (OK)"
      else
        ffmpeg_dir_is_old="yes"
      fi
    fi
    
    if eval "test x$ffmpeg_dir_is_old = xyes"; then
        mv "$FFMPEG_DIR" "$FFMPEG_DIR-OLD"
        echo "** UPDATE of ffmpeg forced, moving $FFMPEG_DIR  to $FFMPEG_DIR-OLD"
        moved_old_ffmpeg_warn="
INFORMATION: old ffmpeg was moved to $FFMPEG_DIR-OLD
(you may delete the old ffmpeg directory)
"
    fi

    AC_DEFINE(ENABLE_GVA_LIBAVFORMAT, 1,
              [Define to 1 to enable compile and link with libavformat])
    dnl
    if test -d "$FFMPEG_DIR"; then
      dnl
      echo "FFMPEG sourcetree found at dir: $FFMPEG_DIR"
    else
      if test -f "$FFMPEG_TARBALL"; then
        cd "$extern_libs_dir"
        echo "extracting tarball: $FFMPEG_TARBALL"
	gzip -d -c "$FFMPEG_TARBALL" | tar -x
	cd "$pwd_dir"
      else
        echo "** error FFMPEG tarball not found, file: $FFMPEG_TARBALL"
      fi
    fi
    dnl
    dnl
    if test -d "$FFMPEG_DIR"; then
      dnl
      echo "FFMPEG sourcetree found at dir: $FFMPEG_DIR"
      dnl
      dnl STATIC linking of the ffmpeg libs libavformat.a libavcodec.a libavutil.a
      dnl from sourcedirectory
      dnl
      dnl   sequence of libs does matter  1. libavformat.a  2. libavcodec.a 3. libavutil.a
      dnl
      dnl Note: on minGW ffmpeg static libraries have suffix .lib (and not .a)
      dnl  
      build_ffmpeg_libs_yesno="yes"
      FFMPEG_LIBAVFORMAT_A="$FFMPEG_DIR/libavformat/${LIBPREF}avformat${LIBSUF}"
      FFMPEG_LIBAVCODEC_A="$FFMPEG_DIR/libavcodec/${LIBPREF}avcodec${LIBSUF}"
      FFMPEG_LIBAVUTIL_A="$FFMPEG_DIR/libavutil/${LIBPREF}avutil${LIBSUF}"
      FFMPEG_LIBAVDEVICE_A="$FFMPEG_DIR/libavdevice/${LIBPREF}avdevice${LIBSUF}"
      dnl
      dnl ffmpeg can be configured to use external codec libs x264, xvid ....
      dnl options for ffmpeg ext libs configuration will be passed to ffmpeg/configure
      dnl if some of those libs are installed (and not explicitly disabled)
      
      FFMPEG_EXTLIBS="$FF_LIBX264 $FF_LIBXVID $FF_BZIP2 $FF_LIBMP3LAME $FF_LIBFAAC $FF_LIBFAAD"
      if  test "x$os_win32" = "xyes"; then
        FFMPEG_EXTLIBS="$FFMPEG_EXTLIBS -lws2_32"
      fi

      GAP_VLIBS_FFMPEG="  $FFMPEG_LIBAVDEVICE_A $FFMPEG_LIBAVFORMAT_A $FFMPEG_LIBAVCODEC_A $FFMPEG_LIBAVUTIL_A $FFMPEG_EXTLIBS "
      GAP_VINCS_FFMPEG=" -I$FFMPEG_DIR -I$FFMPEG_DIR/libavcodec -I$FFMPEG_DIR/libavformat -I$FFMPEG_DIR/libavutil -I$FFMPEG_DIR/libavdevice "

      vid_ffmpeg_warning="
          $x264_warn
          $xvid_warn
          $ffbz2_warn 
          $mp3lame_warn 
          $faac_warn 
          $faad_warn
          "

      dnl read configure options for the external lib from a file      
      dnl the current simple implementation requires all options in one line
      FFMPEG_CONFIGURE_OPTIONS=`cat "$extern_libs_dir/configure_options_ffmpeg.txt" | grep -v '^#'`
      
      ff_pass_through_flags=""
      if test "x$prefix" != "x"; then
         if test "$prefix" != "NONE"; then
            ff_pass_through_flags=" --prefix=$prefix $ff_pass_through_flags"
         fi
      fi
      
      if test "x$FF_EXTRA_CFLAGS" != "x"; then
      	 ff_pass_through_flags=" $ff_pass_through_flags --extra-cflags=$FF_EXTRA_CFLAGS "
      fi
      
      if test "x$FF_EXTRA_LDFLAGS" != "x"; then
      	 ff_pass_through_flags=" $ff_pass_through_flags --extra-ldflags=$FF_EXTRA_LDFLAGS "
      fi

      if test "x$CC" != "x"; then
      	 ff_pass_through_flags=" $ff_pass_through_flags --cc=$CC "
      fi
      
      FFMPEG_CONFIGURE_OPTIONS=" $ff_pass_through_flags $FFMPEG_CONFIGURE_OPTIONS"
 
 

      dnl configure ffmpeg bzip2 usage
      if test "x$FF_BZIP2" != "x"; then
      	 FFMPEG_CONFIGURE_OPTIONS="$FFMPEG_CONFIGURE_OPTIONS --enable-bzlib"
      else
      	 FFMPEG_CONFIGURE_OPTIONS="$FFMPEG_CONFIGURE_OPTIONS --disable-bzlib"
      fi

      dnl configure ffmpeg with optional audio libraries --enable-libmp3lame --enable-libfaac --enable-libfaad
      if test "x$FF_LIBMP3LAME" != "x"; then
      	 FFMPEG_CONFIGURE_OPTIONS="$FFMPEG_CONFIGURE_OPTIONS --enable-libmp3lame"
      fi
      if test "x$FF_LIBFAAC" != "x"; then
      	 FFMPEG_CONFIGURE_OPTIONS="$FFMPEG_CONFIGURE_OPTIONS --enable-libfaac"
      fi
      if test "x$FF_LIBFAAD" != "x"; then
      	 FFMPEG_CONFIGURE_OPTIONS="$FFMPEG_CONFIGURE_OPTIONS --enable-libfaad"
      fi

      dnl configure ffmpeg libx264 usage (for optional H.264 codec support via libx264)
      if test "x$FF_LIBX264" != "x"; then
      	 FFMPEG_CONFIGURE_OPTIONS="$FFMPEG_CONFIGURE_OPTIONS --enable-libx264"
      fi

      dnl configure ffmpeg libxvid usage (for optional open xvid codec support via libxvid)
      if test "x$FF_LIBXVID" != "x"; then
      	 FFMPEG_CONFIGURE_OPTIONS="$FFMPEG_CONFIGURE_OPTIONS --enable-libxvid"
      fi
      
      if  test "x$os_win32" = "xyes"; then
         dnl here we could check for required win32 api version on MonGW Win32 Systems.
         dnl for now always disable devices on MinGW (that requires latest win32 api to compile)
         dnl disabling devices is not critical since GIMP-GAP does not use ffmpeg features that
         dnl require other access than plain videofile io.
      	 FFMPEG_CONFIGURE_OPTIONS="$FFMPEG_CONFIGURE_OPTIONS --disable-devices"
      fi

      echo "================================="
      echo "Calling FFMPEG configure script options: $FFMPEG_CONFIGURE_OPTIONS"
      echo "================================="
      
      cd "$FFMPEG_DIR"
      ./configure $FFMPEG_CONFIGURE_OPTIONS
      FF_CONFIGURE_RETCODE=$?
      cd "$pwd_dir"
      
      echo "================================="
      echo "FFMPEG configure script done options: $FFMPEG_CONFIGURE_OPTIONS"
      echo "FFMPEG configure retcode: $FF_CONFIGURE_RETCODE"
      echo "================================="

      if test "$FF_CONFIGURE_RETCODE" != "0"; then
         vid_ffmpeg_warning="ffmpeg configure script FAILED (--disable-libavformat was activated due to this ERROR)"
         build_ffmpeg_libs_yesno="no"
      fi
      
      dnl
      dnl
    else
      vid_ffmpeg_warning="
** ERROR: ffmpeg sourcetree was not found at:       
$FFMPEG_DIR

  this directory should be created automatically by extracting
  the tarball $FFMPEG_TARBALL

  if this tarball is not included in your gimp-gap distribution
  you can get the ffmpeg tarball at:
    http://www.ffmpeg.org/
    or http://ffmpeg.mplayerhq.hu/download.html
    (old http://ffmpeg.sourceforge.net)
  
  The configure option --disable-libavformat was activated due to this ERROR.
  (This reduces the number of supported videoformats both for read and write
   access.)

"
      dnl options for dynamic linking. (currently not supported via configure script)
      dnl GAP_VINCS_FFMPEG=" -I/usr/include/ffmpeg"
      dnl GAP_VLIBS_FFMPEG=" -lavcodec -lavformat -lavutil"
      dnl
    fi
  else
        vid_ffmpeg_warning="
gimp-gap is configured without libavformat
   This reduces the number of supported videoformats both for read and write
   access. libavformat, libavcodec and libavutil are part of $FFMPEG_DIRNAME.
"
        GAP_VLIBS_FFMPEG=" "
        GAP_VINCS_FFMPEG=" "
  fi

AM_CONDITIONAL(ENABLE_GVA_LIBAVFORMAT_SUPPORT, test "x$enable_libavformat" != "xno")


dnl Test for video libmpeg3
dnl ------------------------
dnl libmpeg3 is used in one of the decoder implementations in the GAP
dnl Video API (GVA) as far as i know this lib is available only on
dnl UNIX systems dnl the current gimp-gap includes the libmpeg3-1.8
dnl as (unmaintained) sourcetree and calls the libmpeg3 configure
dnl script.  The generated Makefile will call the libmpeg3 original
dnl Makefile to build the library libmpeg3.a linking with gimp-gap
dnl modules is now done statically.
dnl
REQ_LIBMPEG3_VERSION="1.8"


dnl where to find the libmpeg3 sourcedir
LMPEG3_DIR="$extern_libs_dir/libmpeg3"
LIBMPEG3_TARBALL="$extern_libs_dir/libmpeg3.tar.gz"

AC_ARG_WITH(libmpeg3srcdir, [  --with-libmpeg3srcdir=DIR    specify where to find libmpeg3 src directory DIR  (this is a developers option to bypass the included libmpeg3 sourcetree)],
if eval "test x$with_libmpeg3srcdir != x"; then
  if eval "test x$with_libmpeg3srcdir != xyes"; then
    if test -d "$with_libmpeg3srcdir"; then
      LMPEG3_DIR=$with_libmpeg3srcdir
    else
      echo "** ERROR option --with-libmpeg3srcdir must refere to a directory"
      echo "** $with_libmpeg3srcdir  is not a directory"
    fi
  fi
fi)


dnl assume libmpeg3 build "no" (in case disabled or linked as prebuilt library)
build_libmpeg3_lib_yesno="no"
preinst_libmpeg3_specified="no"
vid_mpeg3_warning=""
libmpeg3_info_msg="
## gimp-gap is now configured without libmpeg3
   This is not critical, GIMP-GAP uses libmpeg3 in the video API 
   as additional video decoding engine for MPEG videos. 
   The main decoding engine based on ffmpeg also supports MPEG.
   libmpeg3 is limited to UNIX/LINUX operating systems.
   This gimp-gap release includes the sourcecode of libmpeg3
   (this is a duplicate of the original code libmpeg3-$REQ_LIBMPEG3_VERSION copied from: 
   http:/prdownloads.sourceforge.net/heroines/libmpeg3-1.8-src.tar.bz2
   old: http://www.heroinewarrior.com/download.php3)
   
"


libmpeg3_dependencies_ok="yes"

dnl check for pthread library (required for libmpeg3)
dnl the check result does not matter unless libmpeg3 is linked or built later on.
pthread_err=""
AC_CHECK_LIB(pthread, pthread_create,
	[AC_CHECK_HEADER(pthread.h,
          GAP_PTHREAD_LIB=" -lpthread",
          pthread_err="pthread header file (pthread.h) not found")],
	pthread_err="pthread library (libpthread) not found")

if test "x$pthread_err" != "x"; then
   libmpeg3_dependencies_ok="no"
fi


dnl check for the nasm assembler program (required for build of libmpeg3)
dnl the check result does not matter unless libmpeg3 is linked or built later on.
nasm_err=""
AC_CHECK_PROG(HAVE_NASM_ASSEMBLER, nasm, yes, no)
if test "x$HAVE_NASM_ASSEMBLER" = "xno"; then
   nasm_err=" the nasm assembler (required to build libmpeg3) was not found. nasm is available at nasm.sourceforge.net "
   libmpeg3_dependencies_ok="no"
fi





AC_ARG_ENABLE(libmpeg3,
              [  --disable-libmpeg3           don't build with libmpeg3])
AC_ARG_WITH(preinstalled-libmpeg3incdir, 
              [  --with-preinstalled-libmpeg3incdir=DIR    force link with an already installed libmpeg3 library and specify where to find libmpeg3 headerfiles])
AC_ARG_WITH(preinstalled-libmpeg3, 
              [  --with-preinstalled-libmpeg3=FILE         full pathname of the preinstalled libmpeg3.a libraryfile])

dnl
dnl checks for prebuilt libmpeg3
dnl usually installed at /usr/local/lib  or /usr/lib
dnl

if test "x$with_preinstalled_libmpeg3" != "x"; then
  preinst_libmpeg3_specified="yes"
  if test "x$pthread_err" != "x"; then
    enable_libmpeg3="no"
    vid_mpeg3_warning="
** WARNING: cant build with libmpeg3 (libmpeg3 depends on pthread library)
$pthread_err
$nasm_err
$libmpeg3_info_msg
"
  fi
  
  if test "x$enable_libmpeg3" != "xno"; then


    if test -f "$with_preinstalled_libmpeg3"; then
       GAP_VLIBS_MPEG3=" $with_preinstalled_libmpeg3"
       AC_DEFINE(ENABLE_GVA_LIBMPEG3, 1,
             [Define to 1 to enable compile and link with prebuilt libmpeg3])
    else
      vid_mpeg3_warning="$libmpeg3_info_msg
** ERROR option --with-preinstalled-libmpeg3 must refere to the file libmpeg3.a including full pathname.
   Maybe you should try to build libmpeg3 from the included sourcetree
   (dont specify --with-preinstalled-libmpeg3 in that case)
"
    fi
  fi
fi

if test "x$with_preinstalled_libmpeg3incdir" != "x"; then
  preinst_libmpeg3_err=""
  if test "x$preinst_libmpeg3_specified" != "xyes"; then
      vid_mpeg3_warning="$libmpeg3_info_msg
** ERROR option --with-preinstalled-libmpeg3incdir also requires the option --with-preinstalled-libmpeg3.
"
  
  fi;
  if test "x$enable_libmpeg3" != "xno"; then
    if test -f "$with_preinstalled_libmpeg3incdir/libmpeg3.h"; then
      if test -d "$with_preinstalled_libmpeg3incdir/audio"; then
	:
      else
	preinst_libmpeg3_err="$with_preinstalled_libmpeg3incdir has no subdirectory named audio"
      fi
      if test -d "$with_preinstalled_libmpeg3incdir/video"; then
	:
      else
	preinst_libmpeg3_err="$with_preinstalled_libmpeg3incdir has no subdirectory named video"
      fi
    else
      preinst_libmpeg3_err="file not found: $with_preinstalled_libmpeg3incdir/libmpeg3.h"
    fi
    
    if test "x$preinst_libmpeg3_err" != "x"; then
      vid_mpeg3_warning="$libmpeg3_info_msg
** ERROR option --with-preinstalled-libmpeg3incdir must refere to a directory with audio and video subdir.
** $preinst_libmpeg3_err
   Maybe you should try to build libmpeg3 from the included sourcetree
   (dont specify --with-preinstalled-libmpeg3incdir in that case)
"
    fi
    
    
    if test "x$vid_mpeg3_warning" != "x"; then
      GAP_VLIBS_MPEG3=" "
      GAP_VINCS_MPEG3=" "
      enable_libmpeg3="no"
    else
      LMPEG3_DIR="$with_preinstalled_libmpeg3incdir"
      GAP_VINCS_MPEG3=" -I$LMPEG3_DIR -I$LMPEG3_DIR/audio -I$LMPEG3_DIR/video "
    fi
  fi
fi



if test "x$preinst_libmpeg3_specified" != "xyes"; then

dnl  compile ability test is now disabled for libmpeg3
dnl     Note that this check once was introduced because old libmpeg3-1.5.4 did not compile
dnl     with recent gcc compiler versions.
dnl     libmpeg3-1.8 did compile fine on my openSuse 11.1 system
dnl       gcc (SUSE Linux) 4.3.2 [gcc-4_3-branch revision 141291]

dnl   if test "x$enable_libmpeg3" != "no"; then
dnl     dnl
dnl     dnl First of all check if the compiler is able to handle the libmpeg3
dnl     dnl code.
dnl     dnl
dnl 
dnl     AC_MSG_CHECKING([if libmpeg3 code can be compiled])
dnl     AC_COMPILE_IFELSE([
dnl int main(void) {
dnl   unsigned char *data;
dnl   *((unsigned short*)data)++ = 0x0;
dnl   return 0;
dnl }],, enable_libmpeg3=no)
dnl     AC_MSG_RESULT($enable_libmpeg3)
dnl 
dnl   fi


  if test "x$enable_libmpeg3" != "xno"; then
    dnl
    dnl the original tarball from http:www.heroinewarrior.com of
    dnl libmpeg3-1.8 comes without installation help for the library
    dnl and its headers.  but (some ?) LINUX distributors provide
    dnl installation rpm packages for libmpeg3
    dnl
    dnl some older libmpeg3-1.5 rpm packages (from my SuSE 8.2
    dnl distribution) are NOT compatible with the new API, and have
    dnl limited functions -- AC3 is turned off -- other packages (like
    dnl the current debian) disable CSS decryption.
    dnl
    dnl one solution to face those problems is to get the tarball with
    dnl the full sourcetree of the libmpeg3-1.8 library configure
    dnl and make the libmpeg3 from sourcetree and then link statically
    dnl by specifying the option --with-libmpeg3srcdir.
    dnl
    dnl libmpeg3 needs the assembler nasm to compile and checks this
    dnl requirement in its configuration script.
    dnl

    dnl check if old version off ffmpeg is already there 
    dnl (typically for already existing svn build after 1st svn update to new version)

    LIBMPEG3_PRIVATE_H="$LMPEG3_DIR/mpeg3private.h"

    if test -f "$LIBMPEG3_PRIVATE_H"; then
      if  grep '#define MPEG3_MAJOR   1' $LIBMPEG3_PRIVATE_H >/dev/null; then
        if  grep '#define MPEG3_MINOR   5' $LIBMPEG3_PRIVATE_H >/dev/null; then
         if  grep '#define MPEG3_RELEASE 4' $LIBMPEG3_PRIVATE_H >/dev/null; then
           mv "$LMPEG3_DIR" "$LMPEG3_DIR-OLD"
           echo "** UPDATE of libmpeg3 forced, moving $LMPEG3_DIR  to $LMPEG3_DIR-OLD"
           moved_old_libmpeg3_warn="
INFORMATION: old libmpeg3 was moved to  $LMPEG3_DIR-OLD
(you may delete the old libmpeg3 directory)
"
          fi
        fi
      fi
    fi



    if test "x$libmpeg3_dependencies_ok" != "xyes"; then
      enable_libmpeg3="no"
      vid_mpeg3_warning="
** WARNING: cant build with libmpeg3 (libmpeg3 depends on pthread library and the nasm assembler)
$pthread_err
$nasm_err
$libmpeg3_info_msg
"

    else
      machine_dependent_odir=`uname --machine`
      dnl
      if test -d "$LMPEG3_DIR"; then
	dnl
	echo "libmpeg3 sourcetree found at dir: $LMPEG3_DIR"
      else
	if test -f "$LIBMPEG3_TARBALL"; then
          cd "$extern_libs_dir"
	  echo "extracting tarball: $LIBMPEG3_TARBALL"
	  gzip -d -c "$LIBMPEG3_TARBALL" | tar -x
	  cd "$pwd_dir"
	else
          echo "** error LIBMPEG3 tarball not found, file: $LIBMPEG3_TARBALL"
	fi
      fi
      dnl
      if test -d "$LMPEG3_DIR"; then
	dnl
	echo "LIBMPEG3 sourcetree found at dir: $LMPEG3_DIR"
	dnl
	build_libmpeg3_lib_yesno="yes"
	LMPEG3_A="$LMPEG3_DIR/$machine_dependent_odir/libmpeg3.a"
	dnl
	GAP_VLIBS_MPEG3=" $LMPEG3_A "
	GAP_VINCS_MPEG3=" -I$LMPEG3_DIR -I$LMPEG3_DIR/audio -I$LMPEG3_DIR/video "
	AC_DEFINE(ENABLE_GVA_LIBMPEG3, 1,
             [Define to 1 to enable compile and link with libmpeg3])

	dnl read configure options for the external lib from a file      
	dnl the current simple implementation requires all options in one line
	LIBMPEG3_CONFIGURE_OPTIONS=`cat "$extern_libs_dir/configure_options_libmpeg3.txt"`

	echo "================================="
	echo "Calling LIBMPEG3 configure script options: $LIBMPEG3_CONFIGURE_OPTIONS"
	echo "================================="



	cd "$LMPEG3_DIR"
	./configure $LIBMPEG3_CONFIGURE_OPTIONS
	cd "$pwd_dir"

	echo "================================="
	echo "LIBMPEG3 configure script done options: $LIBMPEG3_CONFIGURE_OPTIONS"
	echo "================================="

	dnl
      else
	GAP_VLIBS_MPEG3=" "
	GAP_VINCS_MPEG3=" "
	vid_mpeg3_warning="
** ERROR: libmpeg3 source directory was not found at:
$LMPEG3_DIR

  this directory should be created automatically by extracting
  the tarball $LIBMPEG3_TARBALL

  if this tarball is not included in your gimp-gap distribution
  you can get the source tarball libmpeg3-$REQ_LIBMPEG3_VERSION at:
    http:/prdownloads.sourceforge.net/heroines/libmpeg3-1.8-src.tar.bz2
    old: http://www.heroinewarrior.com/download.php3
  
  The configure option --disable-libmpeg3 was activated due to this ERROR.
  (This reduces the number of supported videoformats for read access.
   access.)

"
      fi
    fi
  else
    if test "x$enable_videoapi_support" != "xno"; then
      vid_mpeg3_warning="$libmpeg3_info_msg $vid_mpeg3_warning"
      GAP_VLIBS_MPEG3=" "
      GAP_VINCS_MPEG3=" "
    fi
  fi
fi

AM_CONDITIONAL(ENABLE_GVA_LIBMPEG3_SUPPORT, test "x$enable_libmpeg3" != "xno")



dnl Test for XVID codec
dnl ------------------------
dnl the xvid codec lib is used in the AVI videoencoder plug-in for
dnl MPEG4 support xvid should compile on many operating systems,
dnl including UNIX and WINDOWS systems (ffmpeg has its own builtin
dnl MPEG4 codec implementation and does not depend on this codec)
dnl
AC_ARG_ENABLE(libxvidcore,
              [  --disable-libxvidcore        don't build with libxvidcore])
  if test "x$enable_libxvidcore" != "xno"; then
    dnl
    dnl check for libxvidcore
    dnl
    xvid_err=""
    AC_CHECK_LIB(xvidcore, xvid_encore,
      [AC_CHECK_HEADER(xvid.h,
        GAP_VLIBS_XVIDCORE=" -lxvidcore",
        xvid_err="xvid header file (xvid.h) not found")],
      xvid_err="xvid library (libxvidcore) not found")

    if test "x$xvid_err" = "x"; then
      AC_DEFINE(ENABLE_LIBXVIDCORE, 1,
                [Define to 1 to enable compile and link with libxvidcore])
      GAP_VLIBS_XVIDCORE=" -lxvidcore"
      dnl GAP_VINCS_XVIDCORE=" -I/usr/local/include"
    else
        vid_xvidcore_warning="
** WARNING: $xvid_err
   The AVI encoder plug-in is built without MPEG4 support.
   You can get the xvid codec at:  http://www.xvid.org/downloads.html
"
        GAP_VLIBS_XVIDCORE=" "
        GAP_VINCS_XVIDCORE=" "
    fi
  else
        vid_xvidcore_warning="
gimp-gap is configured without libxvidcore
   The AVI encoder plug-in is built without MPEG4 support.
   You can get the xvid codec at:  http://www.xvid.org/downloads.html
"
        GAP_VLIBS_XVIDCORE=" "
        GAP_VINCS_XVIDCORE=" "

  fi

AM_CONDITIONAL(ENABLE_LIBXVIDCORE_SUPPORT, test "x$enable_libxvidcore" != "xno")


AC_SUBST(GAP_VLIBS_FFMPEG)
AC_SUBST(GAP_VINCS_FFMPEG)
AC_SUBST(GAP_VLIBS_MPEG3)
AC_SUBST(GAP_VINCS_MPEG3)
AC_SUBST(GAP_PTHREAD_LIB)
AC_SUBST(GAP_VLIBS_XVIDCORE)
AC_SUBST(GAP_VINCS_XVIDCORE)

AC_SUBST(FFMPEG_DIR)
AC_SUBST(FFMPEG_LIBAVFORMAT_A)
AC_SUBST(FFMPEG_LIBAVCODEC_A)
AC_SUBST(FFMPEG_LIBAVUTIL_A)
AC_SUBST(LMPEG3_DIR)
AC_SUBST(LMPEG3_A)

GAPVIDEOAPI_EXTLIBS="\$(GAP_VLIBS_FFMPEG) \$(GAP_VLIBS_MPEG3) -lpng -lz \$(GAP_PTHREAD_LIB) -lm"
GAPVIDEOAPI_EXTINCS="\$(GAP_VINCS_FFMPEG) \$(GAP_VINCS_MPEG3)"
AC_SUBST(GAPVIDEOAPI_EXTLIBS)
AC_SUBST(GAPVIDEOAPI_EXTINCS)

dnl 
dnl TODO: check for required gthread version, 
dnl and disable GAP_USE_GTHREAD if not available
dnl
GTHREAD_LIBS="-lgthread-2.0"
AC_SUBST(GTHREAD_LIBS)



dnl Test for audiosupport
dnl audiosupport currently is based on wavplay that is available on UNIX systems
dnl (the wavplay client does not compile on Windows)
dnl ------------------------
AC_ARG_ENABLE(audio_support,
              [  --disable-audio-support      don't build with audio support])
  if test "x$os_win32" = "xyes"; then
     enable_audio_support=no
  fi

  if test "x$enable_audio_support" != "xno"; then
    AC_CHECK_PROG(WAVPLAY_SERVER, wavplay, yes, no)
      if test $WAVPLAY_SERVER = no; then
        audio_warning="
Audio support will be compiled in but will not work because the wavplay
executable was not found. For audio support the wavplay audioserver must
be installed at runtime.
"
      fi

    AC_DEFINE(GAP_ENABLE_AUDIO_SUPPORT, 1,
              [Define to 1 to enable audio support])
  fi

AM_CONDITIONAL(GAP_AUDIO_SUPPORT, test "x$enable_audio_support" != "xno")

dnl optional compile preview widget with GDK-pixbuf support
dnl 
AC_ARG_ENABLE(gdkpixbuf_pview,
              [  --enable-gdkpixbuf-pview     use GdkPixbuf thumbnail rendering (default=no)])
  if test "x$enable_gdkpixbuf_pview" = "xyes"; then
    AC_DEFINE(GAP_PVIEW_USE_GDK_PIXBUF_RENDERING, 1,
              [use Gdk for Pixbuf rendering in gap preview widget])
  fi



AM_CONDITIONAL(BUILD_FFMPEG_LIBS, test "x$build_ffmpeg_libs_yesno" != "xno")
AM_CONDITIONAL(BUILD_LIBMPEG3_LIB, test "x$build_libmpeg3_lib_yesno" != "xno")


GAPLIBDIR=${libdir}/$PACKAGE-$GAP_MAJOR_VERSION.$GAP_MINOR_VERSION



IT_PROG_INTLTOOL([0.35.0])
AM_GLIB_GNU_GETTEXT

LOCALEDIR='$(prefix)/$(DATADIRNAME)/locale'


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

  case " $CFLAGS " in
  *[\ \	]-fPIC[\ \	]*) ;;
  *) CFLAGS="$CFLAGS -fPIC" ;;
  esac

fi
changequote([,])dnl


########################
# Disable deprecated API
########################

if ! $PKG_CONFIG --atleast-version=2.11.0 glib-2.0; then
  CPPFLAGS="${CPPFLAGS} -DG_DISABLE_DEPRECATED"
fi

if ! $PKG_CONFIG --atleast-version=2.9.0 gtk+-2.0; then
  CPPFLAGS="${CPPFLAGS} -DGDK_PIXBUF_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"
fi

if ! $PKG_CONFIG --atleast-version=1.13.0 pango; then
  CPPFLAGS="${CPPFLAGS} -DPANGO_DISABLE_DEPRECATED"
fi

if ! $PKG_CONFIG --atleast-version=2.7.0 gimp-2.0; then
  CPPFLAGS="${CPPFLAGS} -DGIMP_DISABLE_DEPRECATED"
fi


AC_SUBST(GAPLIBDIR)
AC_SUBST(LOCALEDIR)
AC_SUBST(BUILD_FFMPEG_LIBS)
AC_SUBST(BUILD_LIBMPEG3_LIB)

AC_OUTPUT([
Makefile
libgapbase/Makefile
extern_libs/Makefile
images/Makefile
gap/Makefile
libwavplayclient/Makefile
libgapvidapi/Makefile
libgapvidutil/Makefile
vid_common/Makefile
vid_enc_avi/Makefile
vid_enc_ffmpeg/Makefile
vid_enc_rawframes/Makefile
vid_enc_single/Makefile
po/Makefile.in
docs/Makefile
docs/howto/Makefile
docs/howto/txt/Makefile
docs/reference/Makefile
docs/reference/txt/Makefile
])

AC_MSG_RESULT($frontends_warning $audio_warning $videoapi_warning $moved_old_ffmpeg_warn $moved_old_libmpeg3_warn $vid_ffmpeg_warning $vid_mpeg3_warning $vid_quicktime_warning $vid_xvidcore_warning)