summaryrefslogtreecommitdiff
path: root/configure.in
blob: eedfb7aca070f0a6891e853817e92a01d7cbfc0e (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
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
AC_INIT(libreoffice-build, 3.2.99.2)
AC_PREREQ(2.51)
AC_CONFIG_SRCDIR(bin/build-ooo)
AC_PREFIX_DEFAULT(/usr)

# The option tar-ustar is necessary because of some patches have too long
# names so that they cannot be archived using the old V7 format
# This option has been supported since automake 1.8b
AM_INIT_AUTOMAKE([1.8b tar-ustar])

# The version of DejaVu fonts required by
# clone/libs-extern-sys/more_fonts/fonts/ttf_dejavu/makefile.mk
DEJAVU_FONTS_UPSTREAM_MAJOR_VER=2
DEJAVU_FONTS_UPSTREAM_MINOR_VER=32

OOO_BUILDVERSION=AC_PACKAGE_VERSION
AC_SUBST(OOO_BUILDVERSION)

PROPAGATED_ARGS=$ac_configure_args
AC_SUBST(PROPAGATED_ARGS)

AC_ARG_WITH(git,
[
  --with-git              Use git to get the up-stream sources instead of
                          downloading and unpacking the tarballs.

                          Recommended for developers, but not for package
                          maintainers.],
,)

AC_ARG_WITH(git-managed,
[
  --with-git-managed      Use GIT to manage your patches],
,)

AC_ARG_WITH(source-version,
[
  --with-source-version   define another version for the ooo source tarballs

                          Example:  --with-source-version=3.3.0.1.4],
,)

AC_ARG_WITH(split,
[
  --without-split         do not use the split package sources; use the upstream
                          tarball or so],
,with_split=yes)

AC_ARG_WITH(piece,
[
  --with-piece            build only a piece of openoffice.
                          bootstrapping goodness.

                          Examples:  --with-piece=bootstrap],
,)

AC_ARG_WITH(srcdir,
[
  --with-srcdir           define the directory where to download the source
                          tarball and other extra sources.],
,)

AC_ARG_WITH(win32,
[
  --with-win32            define the build to be on win32; this sets a number
                          of defaults suitable for that platform.],
,)

AC_ARG_WITH(internal-gcc,
[
  --with-internal-gcc     build our own gcc (vanilla gcc-4.2.3
                          and binutils 2.18).],
,)

AC_ARG_WITH(distro,
[
  --with-distro           build with a specific distributions patch-set. There
                          is no default value, so you always have to select one.

                          Examples:  --with-distro=Ark
                                     --with-distro=Debian
                                     --with-distro=SUSE

                          Hint: Run once without this option to get full list
                          of available distributions ;-)],
,)

AC_ARG_WITH(lang,
[
  --with-lang             define the localizations to build. The English one
                          is built by default.

                          Examples:  --with-lang="en-US de fr it"
                                     --with-lang=ALL],
,)

AC_ARG_WITH(poor-help-localizations,
[
  --with-poor-help-localizations
                        define the localizations with so incomplete help
                        that the English(US) one should be used instead.

                        Example:  --with-poor-help-localizations="af ar ca"],
,)

AC_ARG_WITH(additional-sections,
[
  --with-additional-sections
                        define list of additional sections that should be
                        enabled in the apply file; It allows to easily
                        enable experimental sets of patches that are not
                        applied by default.

                        Example:
                            --with-additional-sections="EMFPlus PostgreSQL"
],,)

AC_ARG_ENABLE(dbgutil,
[  --enable-dbgutil:       Include additional debugging utilities, such as
                          assertions, object counting, etc. Larger build.
                          (this generates a non-product build)
],,)

AC_ARG_ENABLE(binfilter,
[  --enable-binfilter:     Enable legacy binary file formats filters
                          this makes source download size larger
],,)

AC_ARG_ENABLE(odk,
[  --disable-odk           OO.o includes an ODK, office development kit
                          which some packagers may wish to build without
],,)

AC_ARG_WITH(mingwin,
[  --with-mingwin          For Windows users, use the mingwin32 compiler within
                          cygwin environment, this implies --with-use-shell=tcsh

                          Usage: --with-mingwin=yes

                           For !Windows use, use the mingw32 C++ compiler to (re-)
                           build unowinreg.dll

                          Usage: --with-mingwin=i586-mingw32msvc-g++
],,)

AC_ARG_ENABLE(extensions,
[  --enable-extensions    enables the unpacking of the extensions sources
],,)

AC_ARG_ENABLE(mono,
[  --enable-mono           Enables the compilation of the Mono bindings
],,)

AC_ARG_ENABLE(graphite,
[  --enable-graphite       Enables hyper-complex text rendering with
                          graphite enabled fonts.
],,)

AC_ARG_ENABLE(access,
[  --disable-access        Disable the Access import pieces.
],,)

AC_ARG_WITH(system-mdbtools,
[
  --with-system-mdbtools     Use system libmdb* for the Access base backend
],,)

AC_ARG_WITH(system-libwpd,
[
  --with-system-libwpd     Use system libwpd* library
],,)

AC_ARG_WITH(system-libwps,
[
  --with-system-libwps     Use system libwps* library
],,)

AC_ARG_WITH(system-libwpg,
[
  --with-system-libwpg     Use system libwpg* library
],,)

AC_ARG_WITH(unstable-wp,
[
  --with-unstable-wp       Use new unstable libwp* libraries
],,)

AC_ARG_ENABLE(cairo,
[
  --enable-cairo          Enables cairo canvas backend.],
,)

AC_ARG_WITH(ooo-builddir,
[
  --with-ooo-builddir     define the directory where openoffice.org will be
                          compiled, e.g. the root of an ooo cvs checkout.],
,)

AC_ARG_WITH(installed-ooo-dirname,
[
  --with-installed-ooo-dirname
                          specify the directory name of the core OOo network
                          install dir, for example "openoffice" or "ooo-1.1",
                          yielding a core install directory of
                          /usr/lib/openoffice or /usr/lib/ooo-1.1.

                          Example:  --with-installed-ooo-dirname=ooo-1.1],
,)

AC_ARG_WITH(binsuffix,
[
  --with-binsuffix
                          specify the suffix to be used on the end of script
                          names, to allow parallel installation of two versions.

                          Default:  --with-binsuffix=2.0],
,)

AC_ARG_WITH(docdir,
[
  --with-docdir           define the directory name where the extra
                          documentation will be installed.

                          Example:  --with-docdir=/usr/share/doc/packages/OpenOffice.org],
,)

AC_ARG_WITH(num-cpus,
[
  --with-num-cpus         Number of build processes/cpus to use (number of
                          projects that will build at the same time).
                          Multi-process/multi-cpu builds can save a lot of time
                          on multi-cpu machines.],
,)

AC_ARG_WITH(gcc-speedup,
[
  --with-gcc-speedup      Tool to use to speedup the compilation. Currently
                          ccache (caching results of previous compilation) and
                          icecream (distributed compiling tool) are supported.
                          Both can be used at the same time.
                          You can also choose distcc instead of icecream.

                          Example: --with-gcc-speedup=ccache,icecream],
,)

AC_ARG_WITH(icecream-bindir,
[
  --with-icecream-bindir  Location of icecream's gcc and g++.
                          Defaults to /opt/icecream/bin.],
,)

AC_ARG_WITH(max-jobs,
[
  --with-max-jobs
                          Maximum number of jobs that make will issue at
                          the same time. Defaults to 1.],
,)

AC_ARG_ENABLE(tests,
[
  --enable-tests          Enables the execution of the tests.],
,)

AC_ARG_ENABLE(gtk,
[
  --disable-gtk           Disables gtk+ native widgets.],
,)

AC_ARG_ENABLE(kde,
[
  --disable-kde           Disables KDE native widgets.],
,)

AC_ARG_ENABLE(kde4,
[
  --disable-kde4           Disables KDE4 native widgets.],
,)

AC_ARG_ENABLE(strip,
[
  --disable-strip
                          Disables the stripping of installed binaries, so
                          debugging symbols are not removed.],
,)

AC_ARG_ENABLE(build-noarch,
[
  --enable-build-noarch
                          Allow to build some pieces in architecture
                          independent RPMS (icon themes, help, l10n)],
,)

AC_ARG_ENABLE(split-app-modules,
[
  --enable-split-app-modules
                          Split file lists for app modules: base, calc, ...],
,)

AC_ARG_ENABLE(split-opt-features,
[
  --enable-split-opt-features
                          Split file lists for some optional features:
                          pyuno, testtool ...],
,)

AC_ARG_ENABLE(post-install-scripts,
[
  --disable-post-install-scripts
                          Disables post install scripts within make install.
                          It is usefull when creating a package from the
                          installed files. The scripts are then run by
                          the package after it is installed.],
,)

AC_ARG_ENABLE(defuzz-patches,
[
  --enable-defuzz-patches
                          Regenerate fuzzy patches.],
,)

AC_ARG_WITH(arch,
[
  --with-arch             Define the architecture that we will target.

                          Usage: --with-arch=(x86|ppc|sparc)],
,)

AC_ARG_WITH(arch-flags,
[
  --with-arch-flags        Define extra flags that will be passed to the
                           C and C++ compiler during bild

                           Example: --with-arch-flags="-O2 -fmessage-length=0"],
,)

AC_ARG_WITH(mono-gac-root,
[
  --with-mono-gac-root    Define the root of the mono GAC. It is especially
                          needed if you are using $DESTDIR and want to
                          preinstall the mono DLLs into the GAC.

                          Example: --with-mono-gac-root=/usr/lib],
,)


AC_ARG_WITH(openclipart,
[
  --with-openclipart      Build and install OOo galleries from the Open Clip
                          Art Library. The parameter is either a version of
                          the library or an absolute path to the prebuilt and
                          preinstalled .png files.

                          Example: --with-openclipart=0.13
                                   --with-openclipart=/usr/share/openclipart],
,)


AC_ARG_WITH(sun-templates,
[
  --with-sun-templates    Download and integrate Sun template packages.],
,)

AC_ARG_WITH(ct2n,
[
  --with-ct2n      Download and integrate ConvertTextToNumber extension.],
,)

AC_ARG_WITH(watch-window,
[
  --with-watch-window      Download and integrate Watch Window extension to Calc.],
,)

AC_ARG_WITH(google-docs,
[
  --with-google-docs      Download and integrate Google Documents extension.],
,)

AC_ARG_WITH(nlpsolver,
[
  --with-nlpsolver      Download and integrate NLPSolver extension.],
,)


AC_ARG_WITH(languagetool,
[
  --with-languagetool   Download and integrate LanguageTool extension.],
,)


AC_ARG_WITH(oooblogger,
[
  --with-oooblogger      Download and integrate oooblogger extension.],
,)


AC_ARG_WITH(dejavu-fonts,
[
  --with-dejavu-fonts     Download and install updated DejaVu fonts. The parameter is
                          a version number.

                          Example: --with-dejavu-fonts=2.32

                          You should use this only if you want a newer version than
                          that which upstream has.],
,)

AC_ARG_WITH(liberation-fonts,
[
  --with-liberation-fonts
                          Download and install updated Liberation Fonts. The parameter is
                          a version number.

                          Example: --with-liberation-fonts=1.1],
,)

AC_ARG_WITH(lightproof,
[
  --with-lightproof       Download and integrate the Lightproof "grammar
                          checker" extension.],
,)

AC_ARG_WITH(numbertext,
[
  --with-numbertext       Download and integrate the Numbertext Calc numerical extension.],
,)

AC_ARG_WITH(hunart,
[
  --with-hunart       Download and integrate the Hungarian cross-reference toolbar extension.],
,)

AC_ARG_WITH(typo,
[
  --with-typo       Download and integrate the Typography toolbar extension.],
,)

AC_ARG_WITH(gnu-patch,
[
  --with-gnu-patch        The parameter is an absolute path to GNU patch.

                          Example: --with-gnu-cp=/usr/local/bin/gpatch],
,)

AC_ARG_WITH(gnu-tar,
[
  --with-gnu-tar          The parameter is an absolute path to GNU tar.

                          Example: --with-gnu-cp=/usr/local/bin/gtar],
,)

AC_ARG_WITH(drink,
[
  --with-drink            The parameter is a favourite drink that unpack
                          should advise you to take.

                          Example: --with-drink=coffee],
,)

dnl
dnl Items here only to make --help work nicely:
dnl
AC_ARG_ENABLE(java,
[
  --with-java             build ooo with a Jdk & Java support],
,)
dnl
dnl Mirror
dnl
AC_ARG_WITH(mirror,
[
  --with-mirror           Specify a mirror of the go-ooo.org packages
                          directory.

                          Example: --with-mirror=http://foo.bar.baz/mirror

                          If you want to setup your own mirror, just add
                          something like the following to your cron:

                          rsync -azq --delete --partial go-oo.org::packages \\
                                /some/directory/where/you/want/],
,)

AM_MAINTAINER_MODE

dnl
dnl Setup the misc. tweaks we need.
dnl
BASEDIR=$PWD
TOOLSDIR=$BASEDIR

# it will be modified by the --with-additional-sections but it might
# modified also by other options
OOO_ADDITIONAL_SECTIONS=

AC_PATH_PROG(PERL, perl)
if test -z "$PERL"; then
   AC_MSG_ERROR([perl not found; required for libreoffice])
fi
AC_SUBST(PERL)
INTLTOOL_PERL=$PERL
AC_SUBST(INTLTOOL_PERL)

# ********** check for pkg-config ***********
dnl if a minimum version required, specify as argument
dnl PKG_PROG_PKG_CONFIG([0.9.0])
PKG_PROG_PKG_CONFIG()

if test ! -x "$PKG_CONFIG" -a "z`uname -s`" != "zDarwin"; then
   AC_MSG_ERROR([
*** You need the pkg-config to build LibreOffice.
*** Get the latest version of pkg-config from
*** <http://www.freedesktop.org/software/pkgconfig/>.])
fi

PKG_CHECK_MODULES( MINIMUM_REQS,
	[ libxml-2.0 fontconfig >= 1.0.1 ],
	have_common=true, have_common=false )

if test "z`uname -s`" = "zDarwin"; then
    if test -d "/Developer/SDKs/MacOSX10.4u.sdk"; then
        AC_MSG_RESULT([ok])
        have_common="yes"
    else
        AC_MSG_RESULT([not met])
        AC_MSG_ERROR([To build LibreOffice on the Mac, you need to have the 10.4u-SDK installed (rerun XCode installer)])
    fi
fi

# NB. according to:
#   http://sources.redhat.com/ml/bug-automake/2002/msg02066.html
# it's a really bad idea to do conditional tests for things.
#
if test "z`uname -s`" != "zSunOS" -a "z$with_win32" = "z" -a \( "z`uname -o 2>/dev/null`" = "zCygwin" -o "z`uname -s`" = "zInterix" \) ; then
    AC_MSG_WARN([Automatically using --with-win32 --disable-build-mozilla])
    with_win32="yes"
    enable_binfilter="yes"
    PROPAGATED_ARGS="$PROPAGATED_ARGS --disable-build-mozilla"
fi
if test "z$with_win32" = "z"; then
    if test "$have_common" = "false" ; then
        AC_MSG_ERROR([Library requirements were not met])
    fi
    BUILD_WIN32=
else
    if test "z$with_distro" = "z"; then
        with_distro="Win32"
    fi

    BUILD_WIN32=yes
fi

AC_SUBST(BUILD_WIN32)

AM_CONDITIONAL(BUILD_WIN32, [test "$BUILD_WIN32" = yes])

if test "z`uname -s`" = "zSunOS" -a -f /usr/xpg4/bin/grep ; then
   GREP=/usr/xpg4/bin/grep
else
   GREP=grep
fi

APPLY_DIR="$TOOLSDIR/patches/dev300"

# search more dirs for the apply file
# the default dir is defined by the selected tag
# the alternatives are derived by removing a part (suffix) of the tag
while test "$APPLY_DIR" != "$TOOLSDIR/patches/" ; do
   test -f $APPLY_DIR/apply && break
   APPLY_DIR=${APPLY_DIR%?}
done
test "$APPLY_DIR" = "$TOOLSDIR/patches/" && APPLY_DIR="$TOOLSDIR/patches"
if test -f $APPLY_DIR/apply; then
   AC_MSG_RESULT([using $APPLY_DIR/apply])
else
   AC_MSG_ERROR([Can't locate patch set])
fi
AC_SUBST(APPLY_DIR)

# piece source version
if test "z$with_source_version" = "z"; then
   # FIXME: do we want to guess it from the tag, e.g. 3.3.0.1 from OOO_BUILD_3_3_0_1?
   OOO_SOURCEVERSION="$OOO_BUILDVERSION"
else
   OOO_SOURCEVERSION="$with_source_version"
fi
AC_SUBST(OOO_SOURCEVERSION)

# source dir name
OOO_SOURCEDIRNAME=libreoffice-$OOO_SOURCEVERSION
AC_SUBST(OOO_SOURCEDIRNAME)

AC_MSG_CHECKING([for split sources])
if test "$with_split" = "no" ; then
    SPLIT=
else
    SPLIT=yes
fi
AC_MSG_RESULT([${SPLIT:-no}])
AC_SUBST(SPLIT)

PIECE=$with_piece
AC_SUBST(PIECE)

# FIXME: We currently do not support starting build with already unpackaged
# sources, so the following warning is always printed
warn_use_download="        ./download
"
AC_MSG_CHECKING( for directory where to download sources )
if test "z$with_srcdir" = "z"; then
    SRCDIR=$BASEDIR/src
elif (echo "${with_srcdir}" | $GREP -v -q "^/"); then
    AC_MSG_ERROR([--with-srcdir= must be an absolute path]);
else
    SRCDIR=$with_srcdir
fi
AC_MSG_RESULT([$SRCDIR])

BUILDDIR=$BASEDIR/build
if test "z$with_ooo_builddir" = "z"; then
   OOBUILDDIR=$BUILDDIR/$OOO_SOURCEDIRNAME
else
   OOBUILDDIR=$with_ooo_builddir
fi

if test "z`uname -s`" != "zSunOS" -a "z$with_win32" != "z" -a "z`uname -o 2>/dev/null`" = "zCygwin" ; then
    AC_MSG_CHECKING([that we use /cygdrive paths])
    case "$OOBUILDDIR" in
        /cygdrive/*)
            ;;
        *)  AC_MSG_ERROR([You must use /cygdrive/... style paths, not Cygwin mounts])
            ;;
    esac
    AC_MSG_RESULT([yes])
fi

if test "z`uname -s`" = "zInterix" ; then
    AC_MSG_CHECKING([that we can use /cygdrive paths])
    case "$OOBUILDDIR" in
        /cygdrive/*)
            ;;
        *)  AC_MSG_ERROR([You must set up symlinks in /cygdrive on Interix.])
            ;;
    esac
    AC_MSG_RESULT([yes])
fi

rm -f $BASEDIR/stamp/patch.apply

AC_SUBST(SRCDIR)
AC_SUBST(BUILDDIR)
AC_SUBST(TOOLSDIR)
AC_SUBST(OOBUILDDIR)

if test "z$with_win32" != "z"; then
    AC_PATH_PROG(CABEXTRACT, cabextract)
    if test "!" -x "$CABEXTRACT" ; then
      AC_MSG_ERROR([
*** The cabextract utility must be installed.])
    fi
fi

AC_MSG_CHECKING([for distribution name])
case "$with_distro" in
    ""|"yes"|"no") distros_list=`ls distro-configs/*.conf.in | sort | sed -e "s|distro-configs/\(.*\).conf.in|\t\1|g"`
        if test "z$with_git" == "z"; then
            AC_MSG_WARN([A distribution could be selected by the option --with-distro. You can choose one from:
$distros_list])
        fi
	DISTRO="LibreOfficeLinuxDevel"
        ;;
    NLD) DISTRO="SUSE"
        ;;
    NLD*) distro_version="${with_distro#NLD}"
        distro_version="${distro_version#-}"  # remove optional '-'
        DISTRO="SUSE-$distro_version.1"
        ;;
    *) DISTRO="$with_distro"
        ;;
esac
AC_MSG_RESULT([$DISTRO])
AC_SUBST(DISTRO)

AC_MSG_CHECKING([for vendor name based on the distribution name])
VENDORNAME=OpenOffice
case $DISTRO in
        ArchLinux*) VENDORNAME="ArchLinux" ;;
        Ark*) VENDORNAME="Ark" ;;
        CrossWin32*) VENDORNAME="Google Summer of Code 2009" ;;
        Debian*|Ubuntu*) VENDORNAME="Debian" ;;
        Dropline*) VENDORNAME="DroplineGNOME" ;;
        Frugalware*) VENDORNAME="Frugalware" ;;
        Gentoo*) VENDORNAME="Gentoo" ;;
        Mandriva*) VENDORNAME="Mandriva" ;;
        Pardus*) VENDORNAME="Pardus" ;;
        rPath*|rpl*) VENDORNAME="rPath" ;;
        SUSE*|Novell*|NLD*) VENDORNAME="Novell" ;;
        Slackware*) VENDORNAME="Slackware" ;;
        PLD*) VENDORNAME="PLD" ;;
        OxygenOffice*) VENDORNAME="OxygenOffice" ;;
        OOo4Kids*) VENDORNAME="EducOOo" ;;
		LibreOffice*|Raw) VENDORNAME="The Document Foundation" ;;
        *) AC_MSG_WARN([Cannot guess vendor from distro - please add it to configure.in]) ;;
esac
AC_MSG_RESULT([$VENDORNAME])
AC_SUBST(VENDORNAME)

if test "z$with_java" = "zno"; then
   AC_PATH_PROG(XSLTPROC, xsltproc, no)
   if test "$XSLTPROC" = "no"; then
      AC_MSG_ERROR([xsltproc is required to build without java])
   fi
fi

AC_CHECK_HEADER(security/pam_appl.h, have_pam=true, have_pam=false)
PKG_CHECK_MODULES([png], [libpng], have_png=true, have_png=false)
AC_CHECK_HEADER(zlib.h, have_zlib=true, have_zlib=false)

if test "z$with_win32" = "z" -a "z`uname -s`" != "zDarwin" -a "z$with_distro" != "zCrossWin32" -a "z$with_distro" != "zSlackware"; then
    if test "z$enable_pam" != "zno" && ! $have_pam; then
        AC_MSG_ERROR(install pam-devel)
    fi
    if ! $have_png; then
        AC_MSG_ERROR(install png-devel)
    fi

    if ! $have_zlib; then
        AC_MSG_ERROR(install zlib-devel)
    fi

fi

AC_CHECK_PROG(ACONF, autoconf, yes)
if ! test "z$ACONF" = "zyes"; then
    AC_MSG_ERROR( autoconf must be installed )
fi

AC_CHECK_PROG(FLEX, flex, yes)
if ! test "z$FLEX" = "zyes"; then
   AC_MSG_ERROR( flex must be installed )
fi

AC_CHECK_PROG(BISON, bison, yes)
if ! test "z$BISON" = "zyes"; then
   AC_MSG_ERROR( bison must be installed )
fi

if test "z$with_internal_gcc" = "zyes" ; then
   SYSTEM_GCC=
   gcc_to_use="internal (will be built)"
else
   SYSTEM_GCC=true
   gcc_to_use="from system"
fi
AC_SUBST(SYSTEM_GCC)

BUILD_NCPUS=1
if test "z$with_num_cpus" != "z"; then
   BUILD_NCPUS=$with_num_cpus
fi
AC_SUBST(BUILD_NCPUS)

AC_CHECK_PROG(CCACHE, ccache, yes)
AC_CHECK_PROG(DISTCC, distcc, yes)

ENABLE_CCACHE=""
ENABLE_ICECREAM=""
ENABLE_DISTCC=""
if test "z`echo "$with_gcc_speedup"|grep icecream |grep distcc`" != "z"; then
            AC_MSG_ERROR([icecream and distcc are mutually exclusive])
fi
for enable_speedup in `echo "$with_gcc_speedup" | sed 's/,/ /g'`
do
    if test "$enable_speedup" = "ccache"; then
        if test "$CCACHE" != "yes"; then
            AC_MSG_ERROR([ccache not found, but set in --with-gcc-speedup])
        else
            ENABLE_CCACHE="yes"
       fi
    elif test "$enable_speedup" = "icecream"; then
        ENABLE_ICECREAM="yes"
    elif test "$enable_speedup" = "distcc"; then
        if test "$DISTCC" != "yes"; then
            AC_MSG_ERROR([distcc not found, but set in --with-gcc-speedup])
        else
            ENABLE_DISTCC="yes"
       fi
    fi
done
AC_SUBST(ENABLE_CCACHE)
AC_SUBST(ENABLE_ICECREAM)
AC_SUBST(ENABLE_DISTCC)

ICECREAM_BINDIR="/opt/icecream/bin"
if test "z$with_icecream_bindir" != "z"; then
    ICECREAM_BINDIR="$with_icecream_bindir"
fi
if test "z$ENABLE_ICECREAM" = "zyes"; then
    if test ! -x "$ICECREAM_BINDIR/gcc" -o ! -x "$ICECREAM_BINDIR/g++" ; then
        AC_MSG_ERROR([icecream's gcc and g++ not found, please set --with-icecream-bindir])
    fi
fi
AC_SUBST(ICECREAM_BINDIR)

MAX_JOBS="1"
if test "z$ENABLE_ICECREAM" = "zyes"; then
    # for icecream, default to the maximum
    MAX_JOBS="10"
fi
if test "z$with_max_jobs" != "z"; then
    if test "$with_max_jobs" -gt "10"; then
        AC_MSG_WARN([dmake is limited to 10 jobs, using --with-max-jobs=10 (instead of $with_max_jobs).])
        with_max_jobs="10"
    fi
    MAX_JOBS="$with_max_jobs"
fi
AC_SUBST(MAX_JOBS)

OOOP_FONTS_PACK=
OOOP_GALLERY_PACK=
OOOP_SAMPLES_PACK=
OOOP_TEMPLATES_PACK=
if test "z$with_distro" = "zOxygenOfficeLinux" -o \
        "z$with_distro" = "zOxygenOfficeWindows" ; then
    OOOP_FONTS_PACK="OOOP-fonts-pack-2.8.0.1.zip"
    OOOP_GALLERY_PACK="OOOP-gallery-pack-2.8.0.0.zip"
    OOOP_SAMPLES_PACK="OOOP-samples-pack-2.7.0.0.zip"
    OOOP_TEMPLATES_PACK="OOOP-templates-pack-2.8.0.0.zip"
fi
AC_SUBST(OOOP_FONTS_PACK)
AC_SUBST(OOOP_GALLERY_PACK)
AC_SUBST(OOOP_SAMPLES_PACK)
AC_SUBST(OOOP_TEMPLATES_PACK)

AC_MSG_CHECKING([for widget sets])
OOO_WIDGET_FLAGS=
if test "$enable_kde" != "no"; then
   if test "z$with_win32" = "z" -a "z`uname -s`" != "zDarwin" -a "z$with_distro" != "zCrossWin32"; then
      OOO_WIDGET_FLAGS="--enable-kde"
      widget_sets="kde"
   fi
else
   OOO_WIDGET_FLAGS="--disable-kde"
fi

if test "$enable_kde4" != "no"; then
   if test "z$with_win32" = "z" -a "z`uname -s`" != "zDarwin" -a "z$with_distro" != "zCrossWin32"; then
      OOO_WIDGET_FLAGS="$OOO_WIDGET_FLAGS --enable-kde4"
      widget_sets="$widget_sets kde4"
   fi
else
   OOO_WIDGET_FLAGS="$OOO_WIDGET_FLAGS --disable-kde4"
fi

if test "$enable_gtk" != "no"; then
   if test "z$with_win32" = "z" -a "z`uname -s`" != "zDarwin" -a "z$with_distro" != "zCrossWin32"; then
      OOO_WIDGET_FLAGS="--enable-gtk $OOO_WIDGET_FLAGS"
      widget_sets="gtk $widget_sets"

      PKG_CHECK_MODULES( FOO_GTK, [ gtk+-2.0 ],
         have_gtk=true, have_gtk=false )
      if ! $have_gtk; then
         AC_MSG_ERROR([Gtk+ library requirements were not met])
      fi
   fi
else
   OOO_WIDGET_FLAGS="--disable-gtk $OOO_WIDGET_FLAGS"
fi
OOO_CUSTOM_IMAGES=
OOO_EXTRA_ARTWORK=extras-3.tar.bz2
AC_SUBST(OOO_CUSTOM_IMAGES)
AC_SUBST(OOO_EXTRA_ARTWORK)

AC_MSG_RESULT($OOO_WIDGET_FLAGS)
AC_SUBST(OOO_WIDGET_FLAGS)

if test "z$BUILD_WIN32" = "zyes" -a "z$enable_cairo" = "z" ; then
    AC_MSG_WARN([For Windows, automatically using --disable-cairo])
    enable_cairo="no"
fi
if test "$enable_cairo" != "no"; then
   if test "$with_system_cairo" = "yes"; then
        SYSTEM_CAIRO=TRUE
   fi
   CAIRO_ENABLED=TRUE
   # Use the latest version
   CAIRO_VER=1.4.10
   CAIRO_CONFIGURE_FLAG="--enable-cairo=yes"
   cairo_enabled=yes
else
   CAIRO_ENABLED=
   CAIRO_VER=
   CAIRO_CONFIGURE_FLAG="--enable-cairo=no"
   cairo_enabled=no
fi
AC_SUBST(CAIRO_ENABLED)
AC_SUBST(SYSTEM_CAIRO)
AC_SUBST(CAIRO_VER)
AC_SUBST(CAIRO_CONFIGURE_FLAG)

PREBUILT_WRITINGAIDS_TIMESTAMP=20091204
AC_SUBST(PREBUILT_WRITINGAIDS_TIMESTAMP)

PREBUILT_EXTENSIONAIDS_TIMESTAMP=20100813
AC_SUBST(PREBUILT_EXTENSIONAIDS_TIMESTAMP)

BUILD_MOZILLA_SOURCE='seamonkey-1.1.14.source.tar.gz'
AC_SUBST(BUILD_MOZILLA_SOURCE)

APACHE_ANT_TARBALL='apache-ant-1.8.1-bin.tar.gz'
AC_SUBST(APACHE_ANT_TARBALL)

AGFA_MONOTYPE_FONTS_SOURCE='agfa-monotype-fonts.tar.gz'
AC_SUBST(AGFA_MONOTYPE_FONTS_SOURCE)

MAGYARLINUXLIBERTINE_FONTS_TIMESTAMP=20100611
AC_SUBST(MAGYARLINUXLIBERTINE_FONTS_TIMESTAMP)

OOO_BUILD_NOARCH="NO"
if test "z$enable_build_noarch" = "zyes"; then
    OOO_BUILD_NOARCH="YES"
fi
AC_SUBST(OOO_BUILD_NOARCH)

SPLIT_APP_MODULES="NO"
if test "z$enable_split_app_modules" = "zyes"; then
   SPLIT_APP_MODULES="YES"
fi
AC_SUBST(SPLIT_APP_MODULES)

SPLIT_OPT_FEATURES="NO"
if test "z$enable_split_opt_features" = "zyes"; then
   SPLIT_OPT_FEATURES="YES"
fi
AC_SUBST(SPLIT_OPT_FEATURES)

RUN_POST_INSTALL_SCRIPTS="yes"
if test "z$enable_post_install_scripts" = "zno"; then
   RUN_POST_INSTALL_SCRIPTS="no"
fi
AC_SUBST(RUN_POST_INSTALL_SCRIPTS)

TESTS="NO"
if test "z$enable_tests" = "zyes"; then
    TESTS="YES"
fi
AC_SUBST(TESTS)

DEFUZZ_PATCHES="NO"
if test "z$enable_defuzz_patches" = "zyes"; then
   DEFUZZ_PATCHES="YES"
fi
AC_SUBST(DEFUZZ_PATCHES)

OOO_STRIP="yes"
if test "z$enable_strip" = "zno"; then
   OOO_STRIP="no"
fi
AC_SUBST(OOO_STRIP)

ARCHITECTURE="unxlngi6"
if test "z$with_arch" != "z"; then
    if test "z$with_arch" = "zppc"; then
        ARCHITECTURE="unxlngppc"
    fi
    if test "z$with_arch" = "zsparc"; then
        ARCHITECTURE="unxlngs"
    fi
fi
AC_SUBST(ARCHITECTURE)

AC_MSG_CHECKING([for broken aliases])
if `alias gcc > /dev/null 2>&1`; then
   AC_MSG_ERROR( you can't alias your gcc - that's broken );
fi
AC_MSG_RESULT(ok)

WITH_ARCH_FLAGS=
if test "z$with_arch_flags" != "zyes" -a "z$with_arch_flags" != "zno" ; then
    WITH_ARCH_FLAGS="$with_arch_flags"
fi
AC_SUBST(WITH_ARCH_FLAGS)

MONO_GAC_ROOT=
if test "z$with_mono_gac_root" != "z" -a "z$with_mono_gac_root" != "zno" ; then
    MONO_GAC_ROOT=$with_mono_gac_root
fi
AC_SUBST(MONO_GAC_ROOT)

AC_MSG_CHECKING([for Open Clip Art Library])
OPENCLIPART_VER=
OPENCLIPART_DIR=
if test "z$with_openclipart" != "z" -a "z$with_openclipart" != "zno" ; then
    if test "z$with_openclipart" = "zyes" ; then
        # the gallery from the source tarball by default
        OPENCLIPART_VER=0.12
    elif (echo "$with_openclipart" | $GREP "^[[0-9\.]]*$") ; then
        # it's a version number
        OPENCLIPART_VER=$with_openclipart
    elif test "z${with_openclipart%%/*}" = "z" ; then
        # it's an absolute path
        if test -d $with_openclipart ; then
            OPENCLIPART_DIR=$with_openclipart
        else
            AC_MSG_ERROR([The directory \"$with_openclipart\" does not exist.])
        fi
    else
        AC_MSG_ERROR([--with-openclipart requires either a version number or an absolute path])
    fi
fi
if test "z$OPENCLIPART_VER" != "z" && ! which inkscape >/dev/null 2>&1 ; then
    AC_MSG_ERROR([inkscape is necessary to process Open Clip Art library from sources])
fi
AC_MSG_RESULT([${OPENCLIPART_VER:-${OPENCLIPART_DIR:-no}}])
AC_SUBST(OPENCLIPART_VER)
AC_SUBST(OPENCLIPART_DIR)


AC_MSG_CHECKING([whether to use newer DejaVu fonts])
DEJAVU_FONTS_VER=
DEJAVU_FONTS_PACK_NAME=
if test "z$with_dejavu_fonts" != "z" -a "z$with_dejavu_fonts" != "zno" ; then
    if (echo "$with_dejavu_fonts" | $GREP "^[[0-9]]*\.[[0-9]]*$" >/dev/null) ; then
        # it's a version number
        DEJAVU_FONTS_VER=$with_dejavu_fonts
        DEJAVU_FONTS_PACK_NAME=dejavu-fonts-ttf-$with_dejavu_fonts
        DEJAVU_FONTS_MAJOR_VER=${DEJAVU_FONTS_VER%.*}
        DEJAVU_FONTS_MINOR_VER=${DEJAVU_FONTS_VER#*.}
        if test $DEJAVU_FONTS_MAJOR_VER -lt $DEJAVU_FONTS_UPSTREAM_MAJOR_VER -o \
                \( $DEJAVU_FONTS_MAJOR_VER -eq $DEJAVU_FONTS_UPSTREAM_MAJOR_VER -a \
                   $DEJAVU_FONTS_MINOR_VER -le $DEJAVU_FONTS_UPSTREAM_MINOR_VER \) ; then
                AC_MSG_ERROR([requested DejaVu font version should be newer than what upstream has])
        fi
    else
        AC_MSG_ERROR([--with-dejavu-fonts requires a version number])
    fi
fi
AC_MSG_RESULT([${DEJAVU_FONTS_VER:-no, use those in upstream}])
AC_SUBST(DEJAVU_FONTS_VER)
AC_SUBST(DEJAVU_FONTS_PACK_NAME)


AC_MSG_CHECKING([for Liberation Fonts])
LIBERATION_FONTS_VER=
if test "z$with_liberation_fonts" != "z" -a "z$with_liberation_fonts" != "zno" ; then
    if test "z$with_liberation_fonts" = "zyes" ; then
        # the fonts from the source zip by default
        LIBERATION_FONTS_VER=1.1
    elif (echo "$with_liberation_fonts" | $GREP "^[[0-9\.]]*$") ; then
        # it's a version number
        LIBERATION_FONTS_VER=$with_liberation_fonts
    else
        AC_MSG_ERROR([--with-liberation-fonts requires either yes, no, or a version number])
    fi
fi
AC_MSG_RESULT([${LIBERATION_FONTS_VER:-as upstream}])
AC_SUBST(LIBERATION_FONTS_VER)


AC_MSG_CHECKING([for GNU patch])
GNUPATCH=patch
if test "z$with_gnu_patch" != "z"; then
    if test "z${with_gnu_patch%%/*}" = "z" ; then
        # it's an absolute path
        if test -f $with_gnu_patch ; then
            GNUPATCH=$with_gnu_patch
        else
            AC_MSG_ERROR([The file \"$with_gnu_patch\" does not exist.])
        fi
    else
        AC_MSG_ERROR([--with-gnu-patch requires an absolute path])
    fi
fi
AC_MSG_RESULT([$GNUPATCH])
AC_SUBST(GNUPATCH)

AC_MSG_CHECKING([for GNU tar])
GNUTAR=tar
if test "z$with_gnu_tar" != "z"; then
    if test "z${with_gnu_tar%%/*}" = "z" ; then
        # it's an absolute path
        if test -f $with_gnu_tar ; then
                GNUTAR=$with_gnu_tar
        else
                AC_MSG_ERROR([The file "$with_gnu_tar" does not exist.])
        fi
    else
        AC_MSG_ERROR([--with-gnu-tar requires an absolute path])
    fi
elif test -f /usr/sfw/bin/gtar; then
        GNUTAR="/usr/sfw/bin/gtar"
fi
AC_MSG_RESULT([$GNUTAR])
AC_SUBST(GNUTAR)

AC_PATH_PROGS(GET_CMD, [wget curl])
if test -z "$GET_CMD" ; then
    AC_MSG_ERROR([Neither "wget" nor "curl" found, but needed for download])
fi

AC_MSG_CHECKING([for favourite drink])
DRINK=tea
if test "z$with_drink" != "z"; then
    DRINK=$with_drink
fi
AC_MSG_RESULT([$DRINK])
AC_SUBST(DRINK)

AC_MSG_CHECKING([for ooo-version])
OOO_MAJOR=3.3
OOO_VERSION=3.3
AC_MSG_RESULT([$OOO_VERSION])
AC_SUBST(OOO_VERSION)

AC_MSG_CHECKING([for binsuffix])

if test "z$with_binsuffix" = "zno"; then
    OOO_BINSUFFIX=
elif test "z$with_binsuffix" != "z"; then
    OOO_BINSUFFIX=$with_binsuffix
else
    OOO_BINSUFFIX=$OOO_MAJOR
fi
AC_MSG_RESULT([$OOO_BINSUFFIX])
AC_SUBST(OOO_BINSUFFIX)

datestamp=`date '+%Y%m%d.%H%M'`;
SNAPSHOT_TAG="$datestamp.$TAG";
AC_SUBST(SNAPSHOT_TAG)

if test "z$with_installed_ooo_dirname" != "z"; then
   OOOINSTALLDIRNAME=$with_installed_ooo_dirname
else
   OOOINSTALLDIRNAME=ooo-$OOO_MAJOR
fi
AC_SUBST(OOOINSTALLDIRNAME)

if test "z$with_docdir" != "z"; then
    docdir="$with_docdir"
else
    docdir="$datadir/doc/packages/OpenOffice.org"
fi
AC_SUBST(docdir)

# WARNING: The --with-lang= configure option changed, see
#  http://blog.janik.cz/archives/permalinks/2004-11-02T20_04_29.html
#  e.g.
#  --with-lang="ALL"      # see solenv/inc/postset.mk
#  --with-lang="en-US cs"
#  --with-lang="ALL xy"
AC_MSG_CHECKING([for requested localizations])
if test "z$with_lang" = "zno" ; then
    AC_MSG_WARN([One localization is built by default, this happens to be English.])
fi
OOO_LANGS="$with_lang"
AC_MSG_RESULT([$OOO_LANGS])
AC_SUBST(OOO_LANGS)

AC_MSG_CHECKING([for insufficient help localizations])
if test "$with_poor_help_localizations" = "yes" -o \
        "$with_poor_help_localizations" = "no" ; then
    # no default list defined for now, so it is empty for both "yes" and "no"
    OOO_POOR_HELP_LOCALIZATIONS=
else
    OOO_POOR_HELP_LOCALIZATIONS="$with_poor_help_localizations"
fi
AC_MSG_RESULT([$OOO_POOR_HELP_LOCALIZATIONS])
AC_SUBST(OOO_POOR_HELP_LOCALIZATIONS)


AC_MSG_CHECKING([whether to enable Mono bindings])
if test -n "$enable_mono" ; then
    if test "$enable_mono" != "no" ; then
        ENABLE_MONO=TRUE
        mono_enabled=yes
    else
        ENABLE_MONO=FALSE
        mono_enabled=no
    fi
else
    # mono is not explicitly requested. Though, libreoffice will install
    # the extra sources to support the build with mono
    mono_enabled=supported
    ENABLE_MONO=SUPPORTED
fi
AC_MSG_RESULT([$mono_enabled])
AC_SUBST(ENABLE_MONO)

AC_MSG_CHECKING([whether to build extensions])
if test "$enable_extensions" != "no" ; then
    ENABLE_EXTENSIONS=YES
    AC_MSG_RESULT([yes])
else
    ENABLE_EXTENSIONS=NO
    AC_MSG_RESULT([no])
fi
AC_SUBST(ENABLE_EXTENSIONS)

# FIXME: ugly hack to apply a Novell specific patch for swext sources
if test "$VENDORNAME" = "Novell" -a "$ENABLE_MEDIAWIKI" = "YES" ; then
    if test -z "$OOO_ADDITIONAL_SECTIONS" ; then
        OOO_ADDITIONAL_SECTIONS="NovellOnlyExtensionFixes"
    else
        OOO_ADDITIONAL_SECTIONS="$OOO_ADDITIONAL_SECTIONS,NovellOnlyExtensionFixes"
    fi
fi

AC_MSG_CHECKING([whether to build the binfilter])
if test "$enable_binfilter" = "yes"; then
    ENABLE_BINFILTER=TRUE
    AC_MSG_RESULT([yes])
else
    ENABLE_BINFILTER=FALSE
    AC_MSG_RESULT([no])
fi
AC_SUBST(ENABLE_BINFILTER)

AC_MSG_CHECKING([whether to build the odk stuff])
if test "$enable_odk" != "no"; then
    ENABLE_ODK=TRUE
    AC_MSG_RESULT([yes])
else
    ENABLE_ODK=FALSE
    AC_MSG_RESULT([no])
fi
AC_SUBST(ENABLE_ODK)

AC_MSG_CHECKING([whether to enable graphite support])
# if test -n "$enable_graphite" -o "$enable_graphite" != "no"; then
if test -n "$enable_graphite" -a "$enable_graphite" != "no"; then
   ENABLE_GRAPHITE=TRUE
   graphite_enabled=yes
else
   ENABLE_GRAPHITE=FALSE
   graphite_enabled=no
fi
AC_MSG_RESULT([$graphite_enabled])
AC_SUBST(ENABLE_GRAPHITE)

AC_MSG_CHECKING([whether to enable Access import])
if test "$enable_access" = "no"; then
    access_enabled=no
    ENABLE_ACCESS=
else
    if test "$with_system_mdbtools" = "yes"; then
        SYSTEM_MDBTOOLS=YES
    else
        MDBTOOLS_SRC=mdbtools-0.6pre1.tar.gz
    fi
    access_enabled=yes
    ENABLE_ACCESS=TRUE
fi
AC_MSG_RESULT([$access_enabled])
AC_SUBST(ENABLE_ACCESS)
AC_SUBST(MDBTOOLS_SRC)
AC_SUBST(SYSTEM_MDBTOOLS)


UNSTABLE_WP=NO
if test -n "$with_unstable_wp" && test "$with_unstable_wp" = "yes"; then
    UNSTABLE_WP=YES
else
    UNSTABLE_WP=NO
fi
AC_SUBST(UNSTABLE_WP)

if test -n "$with_system_mdds" && test "$with_system_mdds" = "yes"; then
    SYSTEM_MDDS=YES
else
    SYSTEM_MDDS=NO
fi
AC_SUBST(SYSTEM_MDDS)

if test -n "$with_system_libwpd" && test "$with_system_libwpd" = "yes"; then
    SYSTEM_LIBWPD=YES
else
    SYSTEM_LIBWPD=NO
    if test "$UNSTABLE_WP" = "YES"; then
        LIBWPD_TARBALL=32c8599f6f4cbb420e485288f74b398a-libwpd-0.9.0~CVS20081118.tar.gz
    fi
fi
AC_SUBST(SYSTEM_LIBWPD)
AC_SUBST(LIBWPD_TARBALL)

if test -n "$with_system_libwps" && test "$with_system_libwps" = "yes"; then
    SYSTEM_LIBWPS=YES
else
    SYSTEM_LIBWPS=NO
    if test "$UNSTABLE_WP" = "YES"; then
        LIBWPS_TARBALL=3c77ef8cb348ab6f98ebf53961cc59ea-libwps-0.2.0~CVS20081118.tar.gz
    fi
fi
AC_SUBST(SYSTEM_LIBWPS)
AC_SUBST(LIBWPS_TARBALL)

if test "$with_system_libwpg" = "yes"; then
    SYSTEM_LIBWPG=YES
else
    SYSTEM_LIBWPG=NO
    if test "$UNSTABLE_WP" = "YES"; then
        LIBWPG_TARBALL=6f0defec3c4342c0f3e1a1fe50f3f5f9-libwpg-0.2.0~CVS20081118.tar.gz
    fi
fi
AC_SUBST(SYSTEM_LIBWPG)
AC_SUBST(LIBWPG_TARBALL)


if test "$with_system_zlib" = "yes"; then
    SYSTEM_ZLIB=YES
else
    SYSTEM_ZLIB=NO
fi
AC_SUBST(SYSTEM_ZLIB)


AC_MSG_CHECKING([for Sun Professional Template Pack integration (only supported languages displayed)])
if test "z$with_sun_templates" = "z" -o "z$with_sun_templates" = "zno" ; then
    SUNTEMPLATES_LANG=""
    AC_MSG_RESULT([no integration])
else
    sun_supported_langs="en-US de it fr es hu"
    if test "z$with_sun_templates" = "zyes" ; then
        wanted_sun_templates="$sun_supported_langs"
    else
        # check whether the langs are supported by Sun
        wanted_sun_templates=
        for lang in $with_sun_templates ; do
            if test -n "`echo $sun_supported_langs | grep "$lang"`" ; then
                wanted_sun_templates="$wanted_sun_templates $lang"
            fi
        done
    fi
    SUNTEMPLATES_LANG=
    # check whether the langs are requested at all
    for lang in $wanted_sun_templates ; do
        if test -n "`echo $with_lang | grep "$lang"`" ; then
                SUNTEMPLATES_LANG="$SUNTEMPLATES_LANG $lang"
        fi
    done
    AC_MSG_RESULT([$SUNTEMPLATES_LANG])
fi
AC_SUBST(SUNTEMPLATES_LANG)

AC_MSG_CHECKING([whether to include ConvertTextToNumber extension])
if test "$enable_extensions" != "no" ; then
    if test "z$with_ct2n" = "zyes" ; then
        CT2N_EXTENSION="ConvertTextToNumber-1.3.2.oxt"
        WITH_CT2N=YES
        AC_MSG_RESULT([yes])
    else
        WITH_CT2N=NO
        AC_MSG_RESULT([no])
    fi
fi
AC_SUBST(WITH_CT2N)
AC_SUBST(CT2N_EXTENSION)

AC_MSG_CHECKING([whether to include Watch Window extension for Calc])
if test "$enable_extensions" != "no" ; then
    if test "z$with_watch_window" = "zyes" ; then
        WATCH_WINDOW_EXTENSION="WatchWindow_1.1.2.1.oxt"
        WITH_WATCH_WINDOW=YES
        AC_MSG_RESULT([yes])
    else
        WITH_WATCH_WINDOW=NO
        AC_MSG_RESULT([no])
    fi
fi
AC_SUBST(WITH_WATCH_WINDOW)
AC_SUBST(WATCH_WINDOW_EXTENSION)

AC_MSG_CHECKING([whether to include Google Docs extension])
if test "$enable_extensions" != "no" ; then
    if test "z$with_google_docs" = "zyes" ; then
        GOOGLE_DOCS_EXTENSION="gdocs_2.1.0_modified.oxt"
        WITH_GOOGLE_DOCS=YES
        AC_MSG_RESULT([yes])
    else
        WITH_GOOGLE_DOCS=NO
        AC_MSG_RESULT([no])
    fi
fi
AC_SUBST(WITH_GOOGLE_DOCS)
AC_SUBST(GOOGLE_DOCS_EXTENSION)

AC_MSG_CHECKING([whether to include NLPSolver extension])
if test "$enable_extensions" != "no" ; then
    if test "z$with_nlpsolver" = "zyes" ; then
        NLPSOLVER_EXTENSION="90401bca927835b6fbae4a707ed187c8-nlpsolver-0.9.tar.bz2"
        WITH_NLPSOLVER=YES
        AC_MSG_RESULT([yes])
    else
        WITH_NLPSOLVER=NO
        AC_MSG_RESULT([no])
    fi
fi
AC_SUBST(WITH_NLPSOLVER)
AC_SUBST(NLPSOLVER_EXTENSION)

AC_MSG_CHECKING([whether to include LanguageTool extension])
if test "$enable_extensions" != "no" ; then
    if test "z$with_languagetool" = "zyes" ; then
        LANGUAGETOOL_EXTENSION="47e1edaa44269bc537ae8cabebb0f638-JLanguageTool-1.0.0.tar.bz2"
        WITH_LANGUAGETOOL=YES
        AC_MSG_RESULT([yes])
    else
        WITH_LANGUAGETOOL=NO
        AC_MSG_RESULT([no])
    fi
fi
AC_SUBST(WITH_LANGUAGETOOL)
AC_SUBST(LANGUAGETOOL_EXTENSION)

AC_MSG_CHECKING([whether to include oooblogger extension])
if test "$enable_extensions" != "no" ; then
    if test "z$with_oooblogger" = "zyes" ; then
        OOOBLOGGER_EXTENSION="oooblogger-0.1.oxt"
        WITH_OOOBLOGGER=YES
        AC_MSG_RESULT([yes])
    else
        WITH_OOOBLOGGER=NO
        AC_MSG_RESULT([no])
    fi
fi
AC_SUBST(WITH_OOOBLOGGER)
AC_SUBST(OOOBLOGGER_EXTENSION)

AC_MSG_CHECKING([for Lightproof extensions integration (only supported languages displayed)])
if test "$enable_extensions" != "no" ; then
        if test "z$with_lightproof" = "z" -o "z$with_lightproof" = "zno" ; then
            LIGHTPROOF_LANG=""
                LIGHTPRROF_FILENAMES=""
            AC_MSG_RESULT([no integration])
        else
            lightproof_supported_langs="en-US hu"
            if test "z$with_lightproof" = "zyes" ; then
                        wanted_lightproof="$lightproof_supported_langs"
            else
                        # check whether the langs are supported by Lightproof
                        wanted_lightproof=
                        for lang in $with_lightproof ; do
                    if test -n "`echo $lightproof_supported_langs | grep "$lang"`" ; then
                                wanted_lightproof="$wanted_lightproof $lang"
                    fi
                        done
            fi
            LIGHTPROOF_LANG=
                LIGHTPROOF_FILENAMES=
            # check whether the langs are requested at all
            for lang in $wanted_lightproof ; do
                if test -n "`echo $with_lang | grep "$lang"`" ; then
                        LIGHTPROOF_LANG="$LIGHTPROOF_LANG $lang"
                        case $lang in
                        "hu") LIGHTPROOF_FILENAMES="$LIGHTPROOF_FILENAMES lightproof-hu-1.2.oxt";;
                        "en-US") LIGHTPROOF_FILENAMES="$LIGHTPROOF_FILENAMES lightproof-en-US-0.1.oxt";;
                        esac
                fi
            done
            AC_MSG_RESULT([$LIGHTPROOF_LANG])
                AC_MSG_RESULT([$LIGHTPROOF_FILENAMES])
        fi
fi
AC_SUBST(LIGHTPROOF_LANG)
AC_SUBST(LIGHTPROOF_FILENAMES)

AC_MSG_CHECKING([whether to include numbertext extension])
if test "$enable_extensions" != "no" ; then
    if test "z$with_numbertext" = "zyes" ; then
        NUMBERTEXT_EXTENSION="numbertext-0.9.3.oxt"
        WITH_NUMBERTEXT=YES
        AC_MSG_RESULT([yes])
    else
        WITH_NUMBERTEXT=NO
        AC_MSG_RESULT([no])
    fi
fi
AC_SUBST(WITH_NUMBERTEXT)
AC_SUBST(NUMBERTEXT_EXTENSION)

AC_MSG_CHECKING([whether to include hunart extension])
if test "$enable_extensions" != "no" ; then
    if test "z$with_hunart" = "zyes" ; then
        HUNART_EXTENSION="hunart-0.3.oxt"
        WITH_HUNART=YES
        AC_MSG_RESULT([yes])
    else
        WITH_HUNART=NO
        AC_MSG_RESULT([no])
    fi
fi
AC_SUBST(WITH_HUNART)
AC_SUBST(HUNART_EXTENSION)

AC_MSG_CHECKING([whether to include typo extension])
if test "$enable_extensions" != "no" ; then
    if test "z$with_typo" = "zyes" ; then
        TYPO_EXTENSION="typo-0.3.oxt"
        WITH_TYPO=YES
        AC_MSG_RESULT([yes])
    else
        WITH_TYPO=NO
        AC_MSG_RESULT([no])
    fi
fi
AC_SUBST(WITH_TYPO)
AC_SUBST(TYPO_EXTENSION)

AC_MSG_CHECKING([whether to enable debugging code])
if test "$enable_dbgutil" = "yes" ; then
    build_product=debug
else
    build_product=product
fi
AC_MSG_RESULT([$build_product])

AC_MSG_CHECKING([whether to use git to get the ooo sources])
OOO_GIT=
CLONEDIR="$BASEDIR/clone"
RAWBUILDDIR="$BASEDIR/rawbuild"
if test \( -z "$with_git" -a -f "$SRCDIR/libreoffice-$OOO_SOURCEVERSION-bootstrap.tar.bz2" \) -o "$with_git" = "no"; then
    AC_MSG_RESULT([no])
else
    OOO_GIT="git://anongit.freedesktop.org/git/libreoffice"
    if test -n "$with_git" -a "$with_git" != "yes" ; then
        OOO_GIT="$with_git"
    else
        guess=`git config remote.origin.url | sed 's#/build$##'`
        if test -n "$guess" ; then
            OOO_GIT="$guess"
        fi
    fi
    RESULT="Clone from $OOO_GIT"
    if test -e "$CLONEDIR" ; then
        RESULT="$CLONEDIR already set up"
    fi
    AC_MSG_RESULT([$RESULT])

    AC_PATH_PROG(RSYNC, rsync)
    if test -z "$RSYNC"; then
        AC_MSG_ERROR([rsync not found; required for libreoffice when using --with-git])
    fi
fi
AC_SUBST(OOO_GIT)
AC_SUBST(CLONEDIR)
AC_SUBST(RAWBUILDDIR)

AC_MSG_CHECKING([whether to use git to manage the patches])
if test -z "$with_git_managed" -o "$with_git_managed" = "no"; then
    unset OOO_GIT_MANAGED
    AC_MSG_RESULT([no])
else
    OOO_GIT_MANAGED=git
    if test "z$with_git" != "zyes"; then
        OOO_GIT_MANAGED=$with_git
    fi
    AC_MSG_RESULT([$OOO_GIT_MANAGED])
fi
AC_SUBST(OOO_GIT_MANAGED)

SOURCE_TYPE="DOWNLOAD"

# FIXME: build with upstream sources is not longer supported; patches do not apply any longer by definition => we should clean up configure/download/unpack
UPSTREAM_VERSION=
UPSTREAM_NAME=
UPSTREAM_URI=
if test -n "$UPSTREAM_VERSION"; then
   UPSTREAM_NAME="OOo_${UPSTREAM_VERSION}_src"

   if test "z$with_mirror" != "z" ; then
      SOURCE_TYPE="MIRROR"
      UPSTREAM_URI=
   else
      SOURCE_TYPE="UPSTREAM"
      UPSTREAM_URI="http://openoffice.bouncer.osuosl.org/?product=OpenOffice.org&os=src_bzip&version=${UPSTREAM_VERSION}"
   fi
fi
AC_SUBST(UPSTREAM_NAME)
AC_SUBST(UPSTREAM_URI)
AC_SUBST(SOURCE_TYPE)

MIRROR="http://download.go-oo.org/"
if test "z$with_mirror" != "z" ; then
   MIRROR="$with_mirror"
fi
AC_SUBST(MIRROR)

# IMPORTANT: keep this on the end of configure because other configure options might
# add some own OOO_ADDITIONAL_SECTIONS
AC_MSG_CHECKING([for additional sections])
if test -n "$with_additional_sections" -a \
        "$with_additional_sections" != "no" -a \
        "$with_additional_sections" != "yes" ; then
    # change the delimiter from the space to the comma
    for section in $with_additional_sections ; do
        if test -z "$OOO_ADDITIONAL_SECTIONS" ; then
            OOO_ADDITIONAL_SECTIONS="$section"
        else
            OOO_ADDITIONAL_SECTIONS="$OOO_ADDITIONAL_SECTIONS,$section"
        fi
    done
fi
AC_MSG_RESULT([$OOO_ADDITIONAL_SECTIONS])
AC_SUBST(OOO_ADDITIONAL_SECTIONS)


AC_CONFIG_FILES([bin/font-munge], [chmod +x bin/font-munge])
AC_CONFIG_FILES([bin/help-font-munge], [chmod +x bin/help-font-munge])
AC_CONFIG_FILES([download], [chmod +x download])
AC_CONFIG_FILES([scratch/place], [chmod +x scratch/place])
AC_CONFIG_FILES([intltool-extract intltool-merge intltool-update], [chmod +x intltool*])
AC_OUTPUT([
Makefile
bin/setup
bin/Makefile
patches/dev300/system-python-ure-bootstrap.diff
patches/dev300/pyuno-ooodir.diff
patches/dev300/system-python-uno-path.diff
patches/dev300/split-icons-search-usr-share.diff
bin/piece/sys-setup
bin/piece/Makefile
desktop/Makefile
desktop/16x16/Makefile
desktop/22x22/Makefile
desktop/24x24/Makefile
desktop/32x32/Makefile
desktop/48x48/Makefile
desktop/scalable/Makefile
desktop/mimetypes/Makefile
desktop/mimetypes/16x16/Makefile
desktop/mimetypes/22x22/Makefile
desktop/mimetypes/24x24/Makefile
desktop/mimetypes/32x32/Makefile
desktop/mimetypes/48x48/Makefile
distro-configs/Makefile
distro-configs/ArchLinux.conf
distro-configs/Ark.conf
distro-configs/Common.conf
distro-configs/CommonLinux.conf
distro-configs/CommonWin32.conf
distro-configs/CommonMac.conf
distro-configs/CrossWin32.conf
distro-configs/GoOoWin32.conf
distro-configs/DroplineGNOME.conf
distro-configs/DroplineGNOME64.conf
distro-configs/Debian.conf
distro-configs/DebianEtch.conf
distro-configs/DebianSarge.conf
distro-configs/OOo4Kids.conf
distro-configs/OxygenOfficeLinux.conf
distro-configs/OxygenOfficeWindows.conf
distro-configs/UbuntuL10n.conf
distro-configs/UbuntuHardy.conf
distro-configs/UbuntuJaunty.conf
distro-configs/UbuntuKarmic.conf
distro-configs/UbuntuLucid.conf
distro-configs/UbuntuMaverick.conf
distro-configs/SUSE.conf
distro-configs/SUSE-reduced.conf
distro-configs/SUSE-9.1.conf
distro-configs/SUSE-9.2.conf
distro-configs/SUSE-9.3.conf
distro-configs/SUSE-10.0.conf
distro-configs/SUSE-10.1.conf
distro-configs/SUSE-10.2.conf
distro-configs/SUSE-10.3.conf
distro-configs/SUSE-11.0.conf
distro-configs/SUSE-11.1.conf
distro-configs/SUSE-11.2.conf
distro-configs/Slackware.conf
distro-configs/Mandriva.conf
distro-configs/Mandriva64.conf
distro-configs/NovellWin32.conf
distro-configs/NovellWin32Eval.conf
distro-configs/NovellWin32ISO.conf
distro-configs/Gentoo.conf
distro-configs/Frugalware.conf
distro-configs/openmamba.conf
distro-configs/translate-org-za-linux.conf
distro-configs/translate-org-za-win32.conf
distro-configs/rpl2.conf
distro-configs/rpl2-64.conf
distro-configs/Pardus2007.conf
distro-configs/Pardus2008.conf
distro-configs/PlainLinux.conf
distro-configs/Win32.conf
distro-configs/Solaris.conf
distro-configs/GoOoLinux.conf
distro-configs/GoOoMacOSX.conf
distro-configs/Raw.conf
distro-configs/LibreOfficeWin32.conf
distro-configs/LibreOfficeLinux.conf
distro-configs/LibreOfficeLinuxDevel.conf
distro-configs/LibreOfficeMacOSX.conf
etc/Makefile
extensions/Makefile
extensions/tweakconfig/Makefile
patches/apply.pl
patches/Makefile
patches/cairo/Makefile
patches/dev300/Makefile
patches/evo2/Makefile
patches/emf+/Makefile
patches/gstreamer/Makefile
patches/hotfixes/Makefile
patches/vba/Makefile
patches/mono/Makefile
patches/ooxml/Makefile
patches/postgresql/Makefile
patches/unittesting/Makefile
patches/64bit/Makefile
po/Makefile
po/sdf-templates/Makefile
doc/Makefile
src/Makefile
src/helpcontent2/Makefile
src/icons/Makefile
src/icons/tango/Makefile
src/layout/Makefile
src/sdf/Makefile
stamp/Makefile
templates/Makefile
man/Makefile
])

if test "$ENABLE_CCACHE" = "yes"; then
    ccache_message="yes"
else
    ccache_message="no"
fi
if test "$ENABLE_ICECREAM" = "yes"; then
    icecream_message="yes, in '$ICECREAM_BINDIR'."
else
    icecream_message="no"
fi
if test "$ENABLE_DISTCC" = "yes"; then
    distcc_message="yes"
else
    distcc_message="no"
fi
if test "$MAX_JOBS" -gt 1; then
    max_job_message="'$MAX_JOBS'"
else
    max_job_message="'1'"
fi
if test "$OOO_GIT" = "" ; then
    if test "$SOURCE_TYPE" = "UPSTREAM" ; then
        upstream_sources="download tarballs from '$UPSTREAM_URI'"
    elif test "$SOURCE_TYPE" = "CGIT" ; then
        upstream_sources="download tarballs from 'http://cgit.freedesktop.org'"
    elif test "$SOURCE_TYPE" = "DOWNLOAD" ; then
        upstream_sources="download tarballs from go-oo.org"
    else
        upstream_sources="download tarballs from '$MIRROR'"
    fi
else
    upstream_sources="use git, clone/fetch from '$OOO_GIT'"
fi

echo "
Building openoffice
        source:             $OOO_SOURCEDIRNAME
        apply rules:        $APPLY_DIR/apply
        build dir:          $OOBUILDDIR
        tools dir:          $TOOLSDIR
        src package dir:    $SRCDIR
        distro:             $DISTRO
        add sections:       ${OOO_ADDITIONAL_SECTIONS:-no}
        widget sets:        ${widget_sets:-disabled}
        gcc to use:         $gcc_to_use
        openclipart:        ${OPENCLIPART_VER:-${OPENCLIPART_DIR:-no}}
        mono bindings:      $mono_enabled
        mdbtools/access:    $access_enabled
        java:               ${with_java:-yes}
        ooo-install-dir:    $OOOINSTALLDIRNAME
        ccache:             $ccache_message
        icecream:           $icecream_message
        distcc:             $distcc_message
        max jobs:           $max_job_message
        cairo:              $cairo_enabled
        build type:         $build_product build
        ooo sources:        $upstream_sources
        get externals with: $GET_CMD

To build run:
$warn_use_download        make
        bin/ooinstall <path-to-install>

        This is 'master' - the main, but unstable branch.

        If you want to build the stable OOo, use:
                ooo-build-2-4    branch for 2.4
                ooo-build-3-1-1  branch for 3.1.1
                ooo-build-3-2    branch for 3.2
                ooo-build-3-2-1  branch for 3.2.1
"

if test "$BUILD_WIN32" != "yes" -a "$ENABLE_ICECREAM" != "yes"; then
    echo "You are not using icecream
        Consider reading http://www.gnome.org/~michael/blog/icecream.html
        and configuring with --with-gcc-speedup=icecream
"
fi

if test "$BUILD_WIN32" = "yes"; then
    pwd=`pwd`
    pwd=`cygpath -m $pwd`
    pwdlen=`expr length $pwd`
    known_to_work=17
    if test $pwdlen -gt $known_to_work; then
        echo "WARNING"
        echo "You are in a folder with a quite long pathname."
        echo "That might cause the build to eventually fail"
        echo "in some more or less weird way."
        echo
        echo "If your build does succeed, please update the"
        echo "'known_to_work' value above in configure.in, and tell"
        echo "the LibreOffice mailing list. Thanks."
    fi
fi

if test "$OOO_GIT" = "" ; then
    echo "You are not using git for the upstream sources.
        Consider configuring via --with-git
"
fi
# vim: set ts=4 sw=4 expandtab :