-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
1591 lines (1389 loc) · 55.1 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#
# Copyright 2008 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Process this file with autoconf to produce a configure script
# Specifies:
# Package name
# Version
# Bug report address
AC_INIT([google-gadgets-for-linux],
[0.11.2],
# Requires autoconf version >= 2.50
AC_PREREQ([2.50])
# Specifies a source file in the source directory.
AC_CONFIG_SRCDIR([ggadget/common.h])
# Tells autoconf where to find necessary build scripts and macros.
AC_CONFIG_AUX_DIR([autotools])
AC_CONFIG_MACRO_DIR([autotools])
# Save the user defined CFLAGS and CXXFLAGS, then restore them later.
# So that the value set by AC_PROG_CC and AC_PROG_CXX won't be used,
# even if they are empty.
ggl_save_CFLAGS=$CFLAGS
ggl_save_CPPFLAGS=$CPPFLAGS
ggl_save_CXXFLAGS=$CXXFLAGS
ggl_save_LDFLAGS=$LDFLAGS
###########################################################
## Some definitions of Version macros. ##
###########################################################
# Version numbers of Google Gadgets for Linux package.
GGL_MAJOR_VERSION=0
GGL_MINOR_VERSION=11
GGL_MICRO_VERSION=2
GGL_VERSION_UNQUOTED="$GGL_MAJOR_VERSION.$GGL_MINOR_VERSION.$GGL_MICRO_VERSION"
GGL_VERSION="\"$GGL_VERSION_UNQUOTED\""
AC_SUBST(GGL_MAJOR_VERSION)
AC_SUBST(GGL_MINOR_VERSION)
AC_SUBST(GGL_MICRO_VERSION)
AC_SUBST(GGL_VERSION_UNQUOTED)
AC_SUBST(GGL_VERSION)
# libtool versioning for libggadget
# Increment if the interface has additions, changes, removals.
LIBGGADGET_CURRENT=0
# Increment any time the source changes; set to 0 if you increment
# LIBGGADGET_CURRENT
LIBGGADGET_REVISION=0
# Increment if any interfaces have been added; set to 0
# if any interfaces have been removed. removal has
# precedence over adding, so set to 0 if both happened.
LIBGGADGET_AGE=0
LIBGGADGET_VERSION=$LIBGGADGET_CURRENT:$LIBGGADGET_REVISION:$LIBGGADGET_AGE
AC_SUBST(LIBGGADGET_CURRENT)
AC_SUBST(LIBGGADGET_REVISION)
AC_SUBST(LIBGGADGET_AGE)
AC_SUBST(LIBGGADGET_VERSION)
# Define a string for the earliest version that this release has
# binary compatibility with. This is used for module locations.
#
LIBGGADGET_BINARY_VERSION_UNQUOTED="1.0.0"
LIBGGADGET_BINARY_VERSION="\"$LIBGGADGET_BINARY_VERSION_UNQUOTED\""
AC_SUBST(LIBGGADGET_BINARY_VERSION_UNQUOTED)
AC_SUBST(LIBGGADGET_BINARY_VERSION)
# This string is used in auto update request. It should be updated to the
# time of a release build is made. Its format is yymmdd-HHMMSS.
GGL_VERSION_TIMESTAMP="\"100127-000000\""
AC_SUBST(GGL_VERSION_TIMESTAMP)
# Define the version of Google Desktop Gadget API that this release supports.
GGL_API_MAJOR_VERSION=5
GGL_API_MINOR_VERSION=8
GGL_API_VERSION_UNQUOTED="$GGL_API_MAJOR_VERSION.$GGL_API_MINOR_VERSION.0.0"
GGL_API_VERSION="\"$GGL_API_VERSION_UNQUOTED\""
AC_SUBST(GGL_API_MAJOR_VERSION)
AC_SUBST(GGL_API_MINOR_VERSION)
AC_SUBST(GGL_API_VERSION_UNQUOTED)
AC_SUBST(GGL_API_VERSION)
# Define a string for the earliest version that this release cannot
# coexist with. This is used for directory hierarchies.
#
GGL_EPOCH=-1.0
AC_SUBST(GGL_EPOCH)
GGL_BASE_DIR=google-gadgets
AC_SUBST(GGL_BASE_DIR)
# Check build and host system types
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
###########################################################
## Config options. ##
###########################################################
# Host conditions.
build_gtk_host=yes
build_qt_host=yes
# Library conditions.
build_libggadget_dbus=yes
build_libggadget_gtk=yes
build_libggadget_npapi=yes
build_libggadget_qt=yes
# Extension conditions.
# analytics_usage_collector will always be built.
build_curl_xml_http_request=yes
build_dbus_script_class=yes
# default_framework will always be built.
# default_options will always be built.
# google_gadget_manager will always be built.
build_gst_audio_framework=yes
build_gst_video_element=yes
build_gtk_edit_element=yes
build_gtk_flash_element=yes
build_gtk_system_framework=yes
build_gtkmoz_browser_element=yes
build_libxml2_xml_parser=yes
# linux_system_framework will only be enabled for Linux system.
build_linux_system_framework=no
build_qt_edit_element=yes
build_qt_script_runtime=yes
build_qt_system_framework=yes
build_qt_xml_http_request=yes
build_qtwebkit_browser_element=yes
build_smjs_script_runtime=yes
build_webkit_script_runtime=yes
build_gtkwebkit_browser_element=yes
build_soup_xml_http_request=yes
#================ compile options ==============
AC_ARG_ENABLE([debug],
AS_HELP_STRING([--enable-debug], [enable debug]),
[enable_debug=$enableval],
[enable_debug=no])
AC_ARG_ENABLE([werror],
AS_HELP_STRING([--disable-werror],
[Don't make all compile warnings into errors.]),
[use_werror=$withval],
[use_werror=yes])
AC_ARG_ENABLE([stack-protector],
AS_HELP_STRING([--disable-stack-protector],
[Disable stack protector.]),
[enable_stack_protector=$enableval],
[enable_stack_protector=yes])
#================ with options =================
AC_ARG_WITH([oem-brand],
AC_HELP_STRING([--with-oem-brand=code],
[Specify the OEM brand code.]),
[ggl_oem_brand=$withval],
[ggl_oem_brand=""])
AC_ARG_WITH([memcheck-command],
AS_HELP_STRING([--with-memcheck-command=CMD],
[Specify a memory check command for running unit tests.]),
[memcheck_command=$withval],
[memcheck_command=""])
AC_ARG_WITH([gst-audio-sink],
AS_HELP_STRING([--with-gst-audio-sink=audiosink],
[Use a specified audiosink instead of autoaudiosink.]),
[default_gst_audio_sink=$withval],
[default_gst_audio_sink="autoaudiosink"])
AC_ARG_WITH([browser-plugins-dir],
AS_HELP_STRING([--with-browser-plugins-dir=plugins directory],
[Specifiy directory of browser plugins. But when the program is
running, the environment variable BROWSER_PLUGINS_DIR has
higher priority if it's set. ]),
[default_browser_plugins_dir=$withval],
[default_browser_plugins_dir="$libdir/firefox/plugins"])
AC_ARG_WITH([gtkmozembed],
AC_HELP_STRING(
[--with-gtkmozembed=@<:@libxul|xulrunner|firefox2|firefox|seamonkey@:>@],
[Selects with gecko engine to build against, it affects the
search rule of spidermonkey library (libmozjs) as well.]),
[with_gtkmozembed=$withval],
[with_gtkmozembed=auto])
AC_ARG_WITH([mozjs-libname],
AC_HELP_STRING([--with-mozjs-libname=libmozjs.so],
[Specify the file name of spidermonkey library to be
dynamically loaded. It only takes effect when using a
xulrunner library which supports XPCOM_GLUE.]),
[with_mozjs_libname=$withval],
[with_mozjs_libname=libmozjs.so])
AC_ARG_WITH([ssl-ca-file],
AS_HELP_STRING([--with-ssl-ca-file=/path/to/ca-certificates.crt],
[Specifiy CA certificates file used by soup-xml-http-request
extension. If it's set to empty, then SSL certificate won't be
checked when accessing https:// sites. CAUTION: it should
always be set to a valid CA file, otherwise there will be
serious security issue. It's not set by default.]),
[default_ssl_ca_file=$withval],
[default_ssl_ca_file=""])
#=================== host options =================
AC_ARG_ENABLE([gtk-host],
AS_HELP_STRING([--disable-gtk-host],
[don't build gtk host]),
[build_gtk_host=$enableval],
[build_gtk_host=yes])
AC_ARG_ENABLE([qt-host],
AS_HELP_STRING([--disable-qt-host],
[don't build qt host]),
[build_qt_host=$enableval],
[build_qt_host=yes])
#================== library options ===============
AC_ARG_ENABLE([libggadget-dbus],
AS_HELP_STRING([--disable-libggadget-dbus],
[don't build libggadget-dbus]),
[build_libggadget_dbus=$enableval],
[build_libggadget_dbus=yes])
AC_ARG_ENABLE([libggadget-gtk],
AS_HELP_STRING([--disable-libggadget-gtk],
[don't build libggadget-gtk]),
[build_libggadget_gtk=$enableval],
[build_libggadget_gtk=yes])
AC_ARG_ENABLE([libggadget-npapi],
AS_HELP_STRING([--disable-libggadget-npapi],
[don't build libggadget-npapi]),
[build_libggadget_npapi=$enableval],
[build_libggadget_npapi=yes])
AC_ARG_ENABLE([libggadget-qt],
AS_HELP_STRING([--disable-libggadget-qt],
[don't build libggadget-qt]),
[build_libggadget_qt=$enableval],
[build_libggadget_qt=yes])
#================== extension options ==============
AC_ARG_ENABLE([curl-xml-http-request],
AS_HELP_STRING([--disable-curl-xml-http-request],
[don't build curl-xml-http-request]),
[build_curl_xml_http_request=$enableval],
[build_curl_xml_http_request=yes])
AC_ARG_ENABLE([soup-xml-http-request],
AS_HELP_STRING([--disable-soup-xml-http-request],
[don't build soup-xml-http-request]),
[build_soup_xml_http_request=$enableval],
[build_soup_xml_http_request=yes])
AC_ARG_ENABLE([dbus-script-class],
AS_HELP_STRING([--disable-dbus-script-class],
[don't build dbus-script-class]),
[build_dbus_script_class=$enableval],
[build_dbus_script_class=yes])
AC_ARG_ENABLE([gst-audio-framework],
AS_HELP_STRING([--disable-gst-audio-framework],
[don't build gst-audio-framework]),
[build_gst_audio_framework=$enableval],
[build_gst_audio_framework=yes])
AC_ARG_ENABLE([gst-video-element],
AS_HELP_STRING([--disable-gst-video-element],
[don't build gst-video-element]),
[build_gst_video_element=$enableval],
[build_gst_video_element=yes])
AC_ARG_ENABLE([gtk-edit-element],
AS_HELP_STRING([--disable-gtk-edit-element],
[don't build gtk-edit-element]),
[build_gtk_edit_element=$enableval],
[build_gtk_edit_element=yes])
AC_ARG_ENABLE([gtk-flash-element],
AS_HELP_STRING([--disable-gtk-flash-element],
[don't build gtk-flash-element]),
[build_gtk_flash_element=$enableval],
[build_gtk_flash_element=yes])
AC_ARG_ENABLE([gtk-system-framework],
AS_HELP_STRING([--disable-gtk-system-framework],
[don't build gtk-system-framework]),
[build_gtk_system_framework=$enableval],
[build_gtk_system_framework=yes])
AC_ARG_ENABLE([gtkmoz-browser-element],
AS_HELP_STRING([--disable-gtkmoz-browser-element],
[don't build gtkmoz-browser-element]),
[build_gtkmoz_browser_element=$enableval],
[build_gtkmoz_browser_element=yes])
AC_ARG_ENABLE([libxml2-xml-parser],
AS_HELP_STRING([--disable-libxml2-xml-parser],
[don't build libxml2-xml-parser]),
[build_libxml2_xml_parser=$enableval],
[build_libxml2_xml_parser=yes])
AC_ARG_ENABLE([qt-edit-framework],
AS_HELP_STRING([--disable-qt-edit-framework],
[don't build qt-edit-framework]),
[build_qt_edit_framework=$enableval],
[build_qt_edit_framework=yes])
AC_ARG_ENABLE([qt-script-runtime],
AS_HELP_STRING([--disable-qt-script-runtime],
[don't build qt-script-runtime]),
[build_qt_script_runtime=$enableval],
[build_qt_script_runtime=yes])
AC_ARG_ENABLE([qt-system-framework],
AS_HELP_STRING([--disable-qt-system-framework],
[don't build qt-system-framework]),
[build_qt_system_framework=$enableval],
[build_qt_system_framework=yes])
AC_ARG_ENABLE([qt-xml-http-request],
AS_HELP_STRING([--disable-qt-xml-http-request],
[don't build qt-xml-http-request]),
[build_qt_xml_http_request=$enableval],
[build_qt_xml_http_request=yes])
AC_ARG_ENABLE([qtwebkit-browser-element],
AS_HELP_STRING([--disable-qtwebkit-browser-element],
[don't build qtwebkit-browser-element]),
[build_qtwebkit_browser_element=$enableval],
[build_qtwebkit_browser_element=yes])
AC_ARG_ENABLE([smjs-script-runtime],
AS_HELP_STRING([--disable-smjs-script-runtime],
[don't build smjs-script-runtime]),
[build_smjs_script_runtime=$enableval],
[build_smjs_script_runtime=yes])
AC_ARG_ENABLE([webkit-script-runtime],
AS_HELP_STRING([--disable-webkit-script-runtime],
[don't build webkit-script-runtime]),
[build_webkit_script_runtime=$enableval],
[build_webkit_script_runtime=yes])
AC_ARG_ENABLE([gtkwebkit-browser-element],
AS_HELP_STRING([--disable-gtkwebkit-browser-element],
[don't build gtkwebkit-browser-element]),
[build_gtkwebkit_browser_element=$enableval],
[build_gtkwebkit_browser_element=yes])
#================ other options =======================
AC_ARG_ENABLE([update-mime-database],
AC_HELP_STRING([--disable-update-mime-database],
[don't run update-mime-database after install]),
[enable_update_mime_database=$enableval],
[enable_update_mime_database=yes])
AC_ARG_ENABLE([update-desktop-database],
AC_HELP_STRING([--disable-update-desktop-database],
[don't run update-desktop-database after install]),
[enable_update_desktop_database=$enableval],
[enable_update_desktop_database=yes])
AC_ARG_ENABLE([xdg-icon-resource],
AC_HELP_STRING([--disable-xdg-icon-resource],
[don't run xdg-icon-resource after install]),
[enable_xdg_icon_resource=$enableval],
[enable_xdg_icon_resource=yes])
AC_ARG_ENABLE([xdgmime],
AC_HELP_STRING([--disable-xdgmime],
[disable built-in xdgmime support]),
[enable_xdgmime=$enableval],
[enable_xdgmime=yes])
# correct option dependencies.
if test x$build_libggadget_dbus != xyes; then
build_dbus_script_class=no
fi
if test x$build_libggadget_gtk != xyes; then
build_gtk_host=no
build_gtk_edit_element=no
build_gtk_flash_element=no
build_gtk_system_framework=no
build_gtkmoz_browser_element=no
fi
if test x$build_libggadget_qt != xyes; then
build_qt_host=no
build_qt_edit_element=no
build_qt_script_runtime=no
build_qt_system_framework=no
build_qt_xml_http_request=no
build_qtwebkit_browser_element=no
fi
if test x$build_libggadget_npapi != xyes; then
build_gtk_flash_element=no
fi
###########################################################
## Default dirs. ##
###########################################################
GGL_MODULE_DIR=$libdir/$GGL_BASE_DIR/modules
GGL_INCLUDE_DIR=$includedir/$GGL_BASE_DIR
GGL_SYSDEPS_INCLUDE_DIR=$libdir/$GGL_BASE_DIR/include
GGL_LIBEXEC_DIR=$libdir/$GGL_BASE_DIR
GGL_RESOURCE_DIR=$datadir/$GGL_BASE_DIR
AC_SUBST(GGL_MODULE_DIR)
AC_SUBST(GGL_INCLUDE_DIR)
AC_SUBST(GGL_SYSDEPS_INCLUDE_DIR)
AC_SUBST(GGL_LIBEXEC_DIR)
AC_SUBST(GGL_RESOURCE_DIR)
###########################################################
## Default compiler options. ##
###########################################################
# Check -fstack-protector and -fstack-protector-all
has_stack_protector=no
if test x$enable_stack_protector = xyes; then
GGL_CHECK_STACK_PROTECTOR([has_stack_protector=yes], [has_stack_protector=no])
fi
if test x$enable_debug = xyes; then
DEFAULT_COMPILE_FLAGS="-g -O0 -Wall"
DEBUG_MACROS="_DEBUG";
if test x$has_stack_protector = xyes; then
DEFAULT_COMPILE_FLAGS="$DEFAULT_COMPILE_FLAGS -fstack-protector-all"
fi
else
DEFAULT_COMPILE_FLAGS="-O2 -Wall"
DEBUG_MACROS="NDEBUG";
if test x$has_stack_protector = xyes; then
DEFAULT_COMPILE_FLAGS="$DEFAULT_COMPILE_FLAGS -fstack-protector"
fi
fi
if test x$use_werror = xyes; then
DEFAULT_COMPILE_FLAGS="$DEFAULT_COMPILE_FLAGS -Werror"
fi
# Enable stdc const macros by default, like INT64_C etc.
PREDEFINED_MACROS="-D__STDC_CONSTANT_MACROS \
-D$DEBUG_MACROS \
-DGGL_MODULE_DIR=\\\"$GGL_MODULE_DIR\\\" \
-DGGL_INCLUDE_DIR=\\\"$GGL_INCLUDE_DIR\\\" \
-DGGL_SYSDEPS_INCLUDE_DIR=\\\"$GGL_SYSDEPS_INCLUDE_DIR\\\" \
-DGGL_LIBEXEC_DIR=\\\"$GGL_LIBEXEC_DIR\\\" \
-DGGL_RESOURCE_DIR=\\\"$GGL_RESOURCE_DIR\\\""
case $host_os in
*interix* | *mks* | *winnt* | *cygwin* | *mingw* )
ggl_host_type=windows
PREDEFINED_MACROS="$PREDEFINED_MACROS -DGGL_HOST_WINDOWS=1"
GGL_PLATFORM_SHORT="\"win\""
GGL_PLATFORM="\"windows\""
;;
*darwin* )
ggl_host_type=macosx
PREDEFINED_MACROS="$PREDEFINED_MACROS -DGGL_HOST_MACOSX=1"
GGL_PLATFORM_SHORT="\"mac\""
GGL_PLATFORM="\"mac\""
;;
*linux* )
ggl_host_type=linux
PREDEFINED_MACROS="$PREDEFINED_MACROS -DGGL_HOST_LINUX=1"
GGL_PLATFORM_SHORT="\"linux\""
GGL_PLATFORM="\"linux\""
build_linux_system_framework=yes
;;
*solaris* )
ggl_host_type=solaris
PREDEFINED_MACROS="$PREDEFINED_MACROS -DGGL_HOST_SOLARIS=1"
GGL_PLATFORM_SHORT="\"solaris\""
GGL_PLATFORM="\"solaris\""
;;
* )
ggl_host_type=unknown
;;
esac
AC_SUBST(GGL_PLATFORM_SHORT)
AC_SUBST(GGL_PLATFORM)
# Check OEM brand code.
if test x$ggl_oem_brand != x; then
GGL_OEM_BRAND=$ggl_oem_brand
AC_SUBST(GGL_OEM_BRAND)
PREDEFINED_MACROS="$PREDEFINED_MACROS \"-DGGL_OEM_BRAND=\\\"$GGL_OEM_BRAND\\\"\""
fi
AM_CONDITIONAL([GGL_HOST_WINDOWS], [test x$ggl_host_type = xwindows])
AM_CONDITIONAL([GGL_HOST_MACOSX], [test x$ggl_host_type = xmacosx])
AM_CONDITIONAL([GGL_HOST_LINUX], [test x$ggl_host_type = xlinux])
AM_CONDITIONAL([GGL_HOST_SOLARIS], [test x$ggl_host_type = xsolaris])
AC_SUBST(PREDEFINED_MACROS)
AC_SUBST(DEFAULT_COMPILE_FLAGS)
###########################################################
## Start Configuration. ##
###########################################################
# Init automake stuff
AM_INIT_AUTOMAKE([tar-ustar])
# Initializes libtool
AC_LIBLTDL_INSTALLABLE
AC_LIBTOOL_DLOPEN
AC_PROG_LIBTOOL
AC_SUBST(LIBLTDL)
AC_SUBST(LTDLINCL)
AC_SUBST(LIBTOOL_DEPS)
AC_CONFIG_SUBDIRS([libltdl])
AM_CONDITIONAL(GGL_BUILD_LIBLTDL, [test x$enable_ltdl_install = xyes])
# Initialize pkg-config
PKG_PROG_PKG_CONFIG([0.20])
# Checks for programs.
AC_PROG_CC
AC_PROG_CXX
AC_PROG_LN_S
AC_PROG_SED
# Checks for zip command.
AC_PATH_PROG([ZIP], [zip])
# Do compile test for C and C++ source code.
AC_LANG(C)
AC_LANG(C++)
# Checks for standard header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([stdint.h],[has_stdint=yes],[has_stdint=no])
if test x$has_stdint = xno; then
AC_MSG_ERROR([Google Gadgets for Linux depends on stdint.h])
fi
# Check necessary data types
AC_TYPE_SIZE_T
AC_CHECK_SIZEOF(char)
AC_CHECK_SIZEOF(short int)
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(long int)
AC_CHECK_SIZEOF(size_t)
AC_CHECK_SIZEOF(double)
AC_CHECK_SIZEOF(wchar_t)
GGL_SIZEOF_CHAR=$ac_cv_sizeof_char
GGL_SIZEOF_SHORT_INT=$ac_cv_sizeof_short_int
GGL_SIZEOF_INT=$ac_cv_sizeof_int
GGL_SIZEOF_LONG_INT=$ac_cv_sizeof_long_int
GGL_SIZEOF_SIZE_T=$ac_cv_sizeof_size_t
GGL_SIZEOF_DOUBLE=$ac_cv_sizeof_double
GGL_SIZEOF_WCHAR_T=$ac_cv_sizeof_wchar_t
AC_SUBST(GGL_SIZEOF_CHAR)
AC_SUBST(GGL_SIZEOF_SHORT_INT)
AC_SUBST(GGL_SIZEOF_INT)
AC_SUBST(GGL_SIZEOF_LONG_INT)
AC_SUBST(GGL_SIZEOF_SIZE_T)
AC_SUBST(GGL_SIZEOF_DOUBLE)
AC_SUBST(GGL_SIZEOF_WCHAR_T)
if test x$ac_cv_type_size_t != xyes; then
AC_MSG_ERROR([
No type size_t, but google Gadgets for Linux needs it!
This problem might be caused by missing C++ compiler, please make sure there is
an usable C++ compiler installed, for example the g++ compiler.
])
fi
# check for bytesex stuff
AC_C_BIGENDIAN(
[PREDEFINED_MACROS="$PREDEFINED_MACROS -DGGL_BIG_ENDIAN"],
[PREDEFINED_MACROS="$PREDEFINED_MACROS -DGGL_LITTLE_ENDIAN"],
)
# Check necessary libraries
# Check zlib
has_zlib=no
GGL_CHECK_ZLIB([1.2.3], [has_zlib=yes], [has_zlib=no])
if test x$has_zlib != xyes; then
AC_MSG_ERROR([zlib is not available, but it's mandatory.])
fi
# Check pthread lib
has_pthread=no
AC_CHECK_LIB([pthread], [pthread_create], [has_pthread=yes], [has_pthread=no])
if test x$has_pthread = xyes; then
PTHREAD_LIBS="-lpthread"
AC_SUBST(PTHREAD_LIBS)
PREDEFINED_MACROS="$PREDEFINED_MACROS -DHAVE_PTHREAD=1"
fi
# Check Xlib
has_xlib=no
AC_PATH_XTRA
if test "x$no_x" != "xyes"; then
PREDEFINED_MACROS="$PREDEFINED_MACROS -DHAVE_X11=1"
X_LIBS="$X_LIBS $X_PRE_LIBS -lX11"
AC_SUBST(X_CFLAGS)
AC_SUBST(X_LIBS)
AC_SUBST(X_PRE_LIBS)
has_xlib=yes
else
build_libggadget_npapi=no
build_gtk_flash_element=no
build_gtkmoz_browser_element=no
fi
# Check qt4
has_qt4=no
has_qtnetwork=no
has_qtwebkit=no
has_qtscript=no
if test x$build_libggadget_qt = xyes; then
if test x$ggl_host_type = xlinux; then
PKG_CHECK_MODULES(QT4, [QtGui >= 4.3 QtCore >= 4.3 QtNetwork >= 4.3],
[has_qt4=yes
MOC=`$PKG_CONFIG --variable=moc_location QtCore`],
[has_qt4=no])
PKG_CHECK_MODULES(QT4NETWORK, [QtCore >= 4.3 QtNetwork >= 4.3],
[has_qtnetwork=yes],
[has_qtnetwork=no])
PKG_CHECK_MODULES(QT4WEBKIT,
[QtGui >= 4.3 QtCore >= 4.3 QtNetwork >= 4.3 QtWebKit],
[has_qtwebkit=yes],
[has_qtwebkit=no])
PKG_CHECK_MODULES(QT4SCRIPT, [QtCore >= 4.4 QtScript >= 4.4],
[has_qtscript=yes],
[has_qtscript=no])
elif test x$ggl_host_type = xmacosx; then
# There is no pkgconfig for Qt on MacOSX, just do header check.
AC_CHECK_HEADERS([QtCore/QtCore QtGui/QtGui QtNetwork/QtNetwork],
[has_qt4=yes], [has_qt4=no])
AC_CHECK_HEADERS([QtNetwork/QtNetwork],
[has_qtnetwork=yes], [has_qtnetwork=no])
AC_CHECK_HEADERS([QtWebKit/QtWebKit],
[has_qtwebkit=yes], [has_qtwebkit=no])
# FIXME: Version should be checked. Only 4.4 and above are supported
AC_CHECK_HEADERS([QtScript/QtScript],
[has_qtscript=yes], [has_qtscript=no])
if test x$has_qt4 = xyes; then
QT4_LIBS="-framework QtGui \
-framework Carbon -framework AppKit -framework QtCore \
-framework QtNetwork \
-framework ApplicationServices -lz -lm"
AC_PATH_PROG([MOC], [moc])
fi
if test x$has_qtnetwork = xyes; then
QT4NETWORK_LIBS="-framework QtCore -framework QtNetwork -lz -lm"
fi
if test x$has_qtwebkit = xyes; then
QT4WEBKIT_LIBS="-framework QtGui -framework Carbon -framework AppKit \
-framework QtCore -framework QtNetwork \
-framework QtWebKit -lz -lm"
fi
if test x$has_qtscript = xyes; then
QT4SCRIPT_LIBS="-framework QtCore -framework QtScript -lz -lm"
fi
else
AC_MSG_WARN([Qt support is not available for $ggl_host_type])
fi
# MOC is mandatory to build qt related code.
AC_SUBST(MOC)
if test "x$MOC" = "x"; then
AC_MSG_WARN([Can not find moc command, which is mandatory for Qt support.])
has_qt4=no
has_qtnetwork=no
has_qtwebkit=no
has_qtscript=no
fi
if test x$has_qt4 != xyes; then
AC_MSG_WARN([Qt >= 4.3 is required by libggadget-qt.])
build_libggadget_qt=no
build_qt_host=no
build_qt_edit_element=no
build_qt_script_runtime=no
build_qt_system_framework=no
build_qt_xml_http_request=no
build_qtwebkit_browser_element=no
fi
if test x$has_qtnetwork != xyes -a x$build_qt_xml_http_request = xyes; then
AC_MSG_WARN([QtNetwork >= 4.3 is required by qt-xml-http-request.])
build_qt_xml_http_request=no
fi
if test x$has_qtwebkit != xyes -a x$build_qtwebkit_browser_element = xyes; then
AC_MSG_WARN([QtWebkit >= 4.4 is required by qtwebkit-browser-element.])
build_qtwebkit_browser_element=no
fi
if test x$has_qtscript != xyes -a x$build_qt_script_runtime = xyes; then
AC_MSG_WARN([QtScript >= 4.4 is required by qt-script-runtime.])
build_qt_script_runtime=no
fi
fi
# Check gtk2 related libraries.
has_gtk2=no
if test x$build_libggadget_gtk = xyes; then
PKG_CHECK_MODULES(GTK2,
[cairo >= 1.0.0
pango >= 1.10.0
glib-2.0 >= 2.10.0
gtk+-2.0 >= 2.8.0
gdk-2.0 >= 2.8.0
gthread-2.0 >= 2.8.0
fontconfig >= 2.0.0],
[has_gtk2=yes], [has_gtk2=no])
if test x$has_gtk2 != xyes; then
AC_MSG_WARN([Gtk+ >= 2.8.0 is required by libggadget-gtk.])
build_libggadget_gtk=no
build_gtk_host=no
build_gtk_edit_element=no
build_gtk_flash_element=no
build_gtk_system_framework=no
build_gtkmoz_browser_element=no
else
gtk2_target=`$PKG_CONFIG --variable=target gtk+-2.0`
fi
fi
# Check gstreamer-0.10 related libraries.
has_gstreamer=no
has_gstreamer_video=no
if test x$build_gst_audio_framework = xyes -o \
x$build_gst_video_element = xyes; then
PKG_CHECK_MODULES(GSTREAMER,
[gstreamer-0.10 >= 0.10.0
gstreamer-base-0.10 >= 0.10.0
gstreamer-plugins-base-0.10 >= 0.10.0],
[has_gstreamer=yes], [has_gstreamer=no])
if test x$has_gstreamer = xyes; then
CPPFLAGS="$CPPFLAGS $GSTREAMER_CFLAGS"
AC_CHECK_HEADERS([gst/video/gstvideosink.h],
[has_gstreamer_video=yes], [has_gstreamer_video=no])
if test x$has_gstreamer_video = xyes; then
GSTVIDEOSINK_LIBRARIES="-lgstvideo-0.10"
AC_SUBST(GSTVIDEOSINK_LIBRARIES)
fi
CPPFLAGS=$ggl_save_CPPFLAGS
fi
if test x$has_gstreamer != xyes; then
AC_MSG_WARN([gstreamer >= 0.10.0 is required by gst-audio-framework and gst-video-element.])
build_gst_audio_framework=no
build_gst_video_element=no
else
if test x$has_gstreamer_video != xyes -a \
x$build_gst_video_element = xyes; then
AC_MSG_WARN([gstvideo >= 0.10.0 is required by gst-video-element.])
build_gst_video_element=no
fi
fi
fi
# Check libcurl.
has_libcurl=no
if test x$build_curl_xml_http_request = xyes; then
LIBCURL_CHECK_CONFIG([yes], [7.15.0], [has_libcurl=yes], [has_libcurl=no])
if test x$libcurl_feature_SSL != xyes -o \
x$libcurl_protocol_HTTPS != xyes; then
AC_MSG_WARN([Libcurl without support SSL or HTTPS may not usable.])
fi
if test x$has_libcurl != xyes; then
AC_MSG_WARN([libcurl >= 7.15.0 is required by curl-xml-http-request.])
build_curl_xml_http_request=no
fi
fi
# Check libsoup.
has_libsoup=no
has_libsoup_gnome=no
if test x$build_soup_xml_http_request = xyes; then
PKG_CHECK_MODULES(LIBSOUP, [libsoup-2.4 >= 2.26.0],
[has_libsoup=yes], [has_libsoup=no])
if test x$has_libsoup = xyes; then
PKG_CHECK_MODULES(LIBSOUP_GNOME, [libsoup-gnome-2.4 >= 2.26.0],
[has_libsoup_gnome=yes], [has_libsoup_gnome=no])
if test x$has_libsoup_gnome = xyes; then
LIBSOUP_CFLAGS="$LIBSOUP_CFLAGS $LIBSOUP_GNOME_CFLAGS -DHAVE_LIBSOUP_GNOME"
LIBSOUP_LIBS="$LIBSOUP_LIBS $LIBSOUP_GNOME_LIBS"
fi
LDFLAGS="$LIBSOUP_LIBS"
AC_CHECK_FUNC(soup_message_headers_get_one,
[has_soup_message_headers_get_one=yes])
if test x$has_soup_message_headers_get_one = xyes; then
LIBSOUP_CFLAGS="$LIBSOUP_CFLAGS -DHAVE_SOUP_MESSAGE_HEADERS_GET_ONE"
fi
LDFLAGS=$ggl_save_LDFLAGS
else
AC_MSG_WARN([libsoup-2.4 >= 2.26.0 is required by soup-xml-http-request.])
build_soup_xml_http_request=no
fi
fi
# Check libxml2.
has_libxml2=no
if test x$build_libxml2_xml_parser = xyes; then
AM_PATH_XML2([2.4.0], [has_libxml2=yes], [has_libxml2=no])
if test x$has_libxml2 != xyes; then
AC_MSG_WARN([libxml2 >= 2.4.0 is required by libxml2-xml-parser.])
build_libxml2_xml_parser=no
fi
fi
# Check D-Bus library
has_dbus=no
if test x$build_libggadget_dbus = xyes; then
PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.0.2], [has_dbus=yes],
[PKG_CHECK_MODULES(DBUS, [dbus-1 >= 0.60],
[has_dbus=old], [has_dbus=no])])
if test x$has_dbus != xno; then
PREDEFINED_MACROS="$PREDEFINED_MACROS -DHAVE_DBUS_LIBRARY"
if test x$has_dbus = xold; then
PREDEFINED_MACROS="$PREDEFINED_MACROS -DDBUS_API_SUBJECT_TO_CHANGE=1"
fi
LDFLAGS="$DBUS_LIBS"
AC_CHECK_FUNC(dbus_watch_get_unix_fd, [has_dbus_watch_get_unix_fd=yes])
if test x$has_dbus_watch_get_unix_fd = xyes; then
PREDEFINED_MACROS="$PREDEFINED_MACROS -DHAVE_DBUS_WATCH_GET_UNIX_FD"
fi
LDFLAGS=$ggl_save_LDFLAGS
else
AC_MSG_WARN([DBus >= 0.60 is required by libggadget-dbus.])
build_libggadget_dbus=no
build_dbus_script_class=no
fi
fi
# Check librsvg
has_librsvg=no
if test x$build_libggadget_gtk = xyes; then
PKG_CHECK_MODULES(RSVG, [librsvg-2.0 >= 2.14.0],
[has_librsvg=yes], [has_librsvg=no])
if test x$has_librsvg = xyes; then
PREDEFINED_MACROS="$PREDEFINED_MACROS -DHAVE_RSVG_LIBRARY"
fi
fi
# Check startup-notification library
has_startup_notification=no
PKG_CHECK_MODULES(STARTUP_NOTIFICATION, [libstartup-notification-1.0 >= 0.8],
[has_startup_notification=yes], [has_startup_notification=no])
if test x$has_startup_notification = xyes; then
PREDEFINED_MACROS="$PREDEFINED_MACROS -DHAVE_STARTUP_NOTIFICATION"
fi
# Check NetworkManager
has_network_manager=no
PKG_CHECK_MODULES(NETWORK_MANAGER,
[NetworkManager >= 0.7], [has_network_manager=yes],
[PKG_CHECK_MODULES(NETWORK_MANAGER,
[NetworkManager >= 0.6], [has_network_manager=old],
[has_network_manager=no])])
if test x$has_network_manager != xno; then
PREDEFINED_MACROS="$PREDEFINED_MACROS -DHAVE_NETWORK_MANAGER"
if test x$has_network_manager != xold; then
PREDEFINED_MACROS="$PREDEFINED_MACROS -DHAVE_NEW_NETWORK_MANAGER_API"
fi
else
AC_MSG_WARN([Development package of NetworkManager is not installed,]
[network/wireless support of framework.system won't be built.])
fi
# Check gtkmozembed
# Check priority:
# xulrunner 1.9: libxul-embedding-unstable and mozilla-js
# xulrunner 1.8: xulrunner-gtkmozembed and xulrunner-js
# firefox 2.0: firefox2-gtkmozembed and firefox2-js
# firefox 1.5: firefox-gtkmozembed and firefox-js
# seamonkey 1.1: seamonkey-gtkmozembed seamonkey-js
# microb(Maemo): microb-engine and microb-engine-js
#
# Add more rules here if your distribution doesn't support above rules.
has_gtkmozembed=no
has_libmozjs=no
if test x$build_smjs_script_runtime = xyes -o \
x$build_gtkmoz_browser_element = xyes; then
gtkmozembed_list=""
if test x$with_gtkmozembed = xauto; then
gtkmozembed_list="libxul-embedding-unstable \
libxul-embedding \
xulrunner-gtkmozembed \
firefox2-gtkmozembed \
firefox-gtkmozembed \
seamonkey-gtkmozembed \
microb-engine"
else
case $with_gtkmozembed in
libxul)
gtkmozembed_list="libxul-embedding-unstable libxul-embedding"
;;
xulrunner)
gtkmozembed_list="xulrunner-gtkmozembed"
;;
firefox2)
gtkmozembed_list="firefox2-gtkmozembed"
;;
firefox)
gtkmozembed_list="firefox-gtkmozembed"
;;
seamonkey)
gtkmozembed_list="seamonkey-gtkmozembed"
;;
microb)
gtkmozembed_list="microb-engine"
;;
*)
AC_MSG_ERROR([--with-gtkmozembed, invalid value])
;;
esac
fi
for gtkmozembed in $gtkmozembed_list; do
PKG_CHECK_MODULES(GTKMOZEMBED, [$gtkmozembed],
[has_gtkmozembed=$gtkmozembed], [has_gtkmozembed=no])
if test x$has_gtkmozembed != xno; then
break
fi
done
# Check spidermonkey
# If gtkmozembed is available, then use bundled libmozjs.so.
# If libmozjs is not available, then set has_gtkmozembed to false as well,
# because gtkmoz-browser-child needs libmozjs.
libmozjs_list=""
case $has_gtkmozembed in
libxul-embedding-unstable | libxul-embedding)
libmozjs_list="mozilla-js"
;;
xulrunner-gtkmozembed)
libmozjs_list="xulrunner-js"
;;
firefox2-gtkmozembed)
libmozjs_list="firefox2-js"
;;
firefox-gtkmozembed)
libmozjs_list="firefox-js"
;;
seamonkey-gtkmozembed)
libmozjs_list="seamonkey-js"
;;
microb-engine)
libmozjs_list="microb-engine-js"
;;
*)
libmozjs_list="mozilla-js xulrunner-js firefox2-js \
firefox-js seamonkey-js microb-engine-js"
;;
esac