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
|
AC_INIT(bin/build-ooo)
AC_PREREQ(2.51)
AC_PREFIX_DEFAULT(/usr)
OOO_BUILDMAJOR_VERSION=1
OOO_BUILDMINOR_VERSION=3
OOO_BUILDMICRO_VERSION=0
dnl this includes pre-pended period.
OOO_BUILDSTRIKE_VERSION=
OOO_BUILDVERSION="$OOO_BUILDMAJOR_VERSION.$OOO_BUILDMINOR_VERSION.$OOO_BUILDMICRO_VERSION$OOO_BUILDSTRIKE_VERSION"
AM_INIT_AUTOMAKE(ooo-build, $OOO_BUILDVERSION)
dnl for strike versioning
OOO_BUILD_EXTENSION="(build $OOO_BUILDMICRO_VERSION$OOO_BUILDSTRIKE_VERSION)"
AC_SUBST(OOO_BUILD_EXTENSION)
AC_ARG_WITH(tag,
[
--with-tag: define the tag to use, defaults to the latest
release; eg. --with-tag=OOO_1_0_3
],,)
AC_ARG_WITH(srcdir,
[
--with-srcdir: define the directory containing the rest of the
source code we need to build.
],,)
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(system-gcc,
[
--with-system-gcc: use the systems gcc / binutils instead of
building our own.
],,)
AC_ARG_WITH(distro,
[
--with-distro: build with a specific distributions patch-set
values are: [NLD], Debian, ...
],,)
AC_ARG_ENABLE(devel,
[
--enable-devel: build the latest bleeding edge untested bleeding
edge, un-buildable set of patches.
],,)
AC_ARG_ENABLE(bonobo,
[
--enable-bonobo: build the ooo bonobo component.
],,)
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_ENABLE(java,
[
--enable-java: build ooo with a Jdk & Java support
],,)
AC_ARG_WITH(jdk-home,
[
--with-jdk-home: specify the path of your JDK. If you enable Java
but do not specify the JDK path, $BUILD_DIR/jdk/bin is assumed. If
Java is disabled, this option has no effect.
],,)
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(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(vendor,
[
--with-vendor: specify an overall Vendor name to simplify configuration and packaging
when a vendor does the same thing for multiple Distributions
],,)
AC_ARG_WITH(num-cpus,
[
--with-num-cpus: # of build processes/cpus to use. Multi-process/multi-cpu builds can
save a lot of time on multi-cpu machines.
],,)
AC_ARG_WITH(ccache-allowed,
[
--with-ccache-allowed: respect the setting of CC and CXX to allow building with ccache
],,)
AC_ARG_WITH(icons,
[
--with-icons: specify the sets of icons to be used. Supports more
icons sets. If more icons sets are specified, the
resource files are build more times and they are
installed to the related program/resource.$icons_set
directory. The default symlink program/resource.default
then points to the first defined icons set. The icons
set can be changed at applications start up time by
setting the envar OOO_PREFERRED_RESOURCE_PATH
Possible values: gnome (default), GNOME, kde, KDE,
kde_debug, KDE_debug, bluecurve,
Bluecurve
Example: --with-icons=gnome,kde
],,)
AC_ARG_ENABLE(gtk,
[ --enable-gtk Enables gtk+ native widgets.
Usage: --enable-gtk
],,)
AC_ARG_ENABLE(kde,
[ --enable-kde Enables KDE native widgets.
Usage: --enable-kde
],,)
AC_ARG_ENABLE(gcc33,
[
--enable-gcc33: Force use of gcc33/g++33 (ie, compat-gcc) on systems that use gcc 3.4 as the
default compiler.
Usage: --force-gcc33
],,)
AC_ARG_WITH(arch,
[
--with-arch: Define the architecture that we will target.
Usage: --with-arch=[x86|ppc|sparc]
],,)
AM_MAINTAINER_MODE
dnl
dnl Setup the misc. tweaks we need.
dnl
BASEDIR=`pwd`
TOOLSDIR=$BASEDIR
AC_PATH_PROG(PERL, perl)
if test -z "PERL"; then
AC_MSG_ERROR([perl not found; required for ooo-build])
fi
AC_SUBST(PERL)
INTLTOOL_PERL=$PERL
AC_SUBST(INTLTOOL_PERL)
AC_PATH_PROG(PKG_CONFIG, pkg-config)
if test ! -x "$PKG_CONFIG" ; then
AC_MSG_ERROR([
*** You need the latest pkg-config.
*** Get the latest version of pkg-config from
*** <http://www.freedesktop.org/software/pkgconfig/>.])
fi
AC_SUBST(PKG_CONFIG)
if test "z$enable_devel" = "z"; then
latest_flags=
else
latest_flags=--devel
fi
PKG_CHECK_MODULES( FOO_COMMON,
[ gtk+-2.0 libxml-2.0 fontconfig >= 1.0.1 \
libstartup-notification-1.0 ],
have_common=true, have_common=false )
# 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$with_win32" = "z"; then
if test ! $have_common; then
AC_MSG_ERROR([Library requirements were not met])
fi
if test "z$enable_bonobo" = "zyes"; then
ENABLE_BONOBO="yes"
else
enable_bonobo="no"
ENABLE_BONOBO=""
fi
BUILD_WIN32=
else
if test "z$with_distro" = "z"; then
with_distro="Win32"
fi
enable_bonobo="no"
ENABLE_BONOBO=""
BUILD_WIN32=yes
fi
PKG_CHECK_MODULES( FOO_GNOME, [ gnome-vfs-2.0 ],
have_gnome=true, have_gnome=false )
if test ! $have_gnome; then
AC_MSG_ERROR([Gnome library requirements were not met])
fi
AC_SUBST(ENABLE_BONOBO)
AC_SUBST(BUILD_WIN32)
AM_CONDITIONAL(BONOBO, test "z$ENABLE_BONOBO" = "zyes")
AC_MSG_CHECKING( for tag )
if test "z$with_tag" = "z"; then
with_tag=`$srcdir/bin/latest-patchset $srcdir/patches $latest_flags`;
if test "z$with_tag" = "z"; then
AC_MSG_ERROR( Can't locate latest patchset )
fi
fi
if test -f $srcdir/patches/$with_tag/apply; then
AC_MSG_RESULT( found $with_tag )
else
AC_MSG_ERROR( Can't locate patch set for: $with_tag )
fi
CVSTAG=$with_tag
AC_SUBST(CVSTAG)
warn_use_download=
AC_MSG_CHECKING( for tag's source )
if test "z$with_src" = "z"; then
ext_srcdir="$srcdir/src"
warn_use_download=" ./download
"
elif test "${with_src:0:1}" != "/"; then
AC_MSG_ERROR( --with-src= must be an absolute path );
else
ext_srcdir=$with_src
if test -d "$with_src/$CVSTAG"; then
AC_MSG_RESULT( found '$with_src/$CVSTAG' )
else
AC_MSG_WARN([
Missing pristine unpacked source in $with_src/$CVSTAG
]);
fi
fi
WITH_SRC=$with_src
AC_SUBST(WITH_SRC)
if test "z$WITH_SRC" != "z"; then
BASEDIR=$WITH_SRC
SRCDIR='<No manual unpacking required>'
BUILDDIR=$BASEDIR
else
BUILDDIR=$BASEDIR/build
SRCDIR=$BASEDIR/src
fi
if test "z$with_ooo_builddir" = "z"; then
OOBUILDDIR=$BUILDDIR/$CVSTAG
else
OOBUILDDIR=$with_ooo_builddir
fi
AC_SUBST(SRCDIR)
AC_SUBST(BUILDDIR)
AC_SUBST(TOOLSDIR)
AC_SUBST(OOBUILDDIR)
LIBART_VERSION=2.3.13
# RH9 (Shrike) and RHEL3 (Taroon) have older libart which we compensate for
if test "z$with_distro" = "zRHTaroon" -o "z$with_distro" = "zRHShrike"; then
LIBART_VERSION=2.3.11
fi
PKG_CHECK_MODULES( BAA, libart-2.0 >= $LIBART_VERSION,
have_baa=true, have_baa=false )
if test "z$with_win32" = "z"; then
if test ! $have_baa; then
AC_MSG_ERROR([You need to install libart development headers])
fi
else
AC_PATH_PROG(CABEXTRACT, cabextract)
if test "!" -x "$CABEXTRACT" ; then
AC_MSG_ERROR([
*** The cabextract utility must be installed.])
fi
fi
if test "z$with_distro" = "z"; then
with_distro="NLD";
fi
DISTRO=$with_distro
AC_SUBST(DISTRO)
PKG_CHECK_MODULES( BAZ, evolution-data-server-1.0 >= 0.0.92,
have_baz=true, have_baz=false )
if test "z$with_distro" = "NLD" -a ! $have_baz; then
AC_MSG_ERROR([You need to install evolution-data-server])
fi
VENDORNAME=OpenOffice
if test "z$with_vendor" != "z"; then
VENDORNAME="$with_vendor"
fi
AC_SUBST(VENDORNAME)
if test "z$VENDORNAME" == "zSUSE" -a "z$with_icons" == "z"; then
with_icons=KDE
fi
dnl
dnl Debian specific hard-coded defaults.
dnl
dnl
dnl Ark Linux specific hard-coded defaults.
dnl
if test "z$with_distro" = "zArk"; then
if test "z$with_icons" = "z"; then
with_icons=KDE
fi
if test "z$with_vendor" = "z"; then
with_vendor="Ark Linux"
fi
fi
JDK_HOME=
if test "z$enable_java" = "zyes"; then
ENABLE_JAVA=yes
if test "z$with_jdk_home" != "z"; then
JDK_HOME=$with_jdk_home
fi
else
AC_PATH_PROG(XSLTPROC, xsltproc, no)
if test "$XSLTPROC" = "no"; then
AC_MSG_ERROR([xsltproc is required to build without java])
fi
ENABLE_JAVA=no
fi
AC_SUBST(ENABLE_JAVA)
AC_SUBST(JDK_HOME)
AC_CHECK_HEADER(security/pam_appl.h, have_pam=true, have_pam=false)
AC_CHECK_HEADER(png.h, have_png=true, have_png=false)
AC_CHECK_HEADER(zlib.h, have_zlib=true, have_zlib=false)
if test "z$with_win32" = "z"; then
if test ! $have_pam; then
AC_MSG_ERROR(install pam-devel)
fi
if test ! $have_png; then
AC_MSG_ERROR(install png-devel)
fi
if test ! $have_zlib; then
AC_MSG_ERROR(install zlib-devel)
fi
AC_CHECK_PROG(IMG_MAGIC, convert, yes)
if ! test "z$IMG_MAGIC" = "zyes"; then
AC_MSG_ERROR( ImageMagick must be installed )
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_system_gcc" = "zyes" -o "z$with_system_gcc" = "z" ; then
SYSTEM_GCC=true
with_system_gcc=yes
else
SYSTEM_GCC=
with_system_gcc=no
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)
CCACHE_ALLOWED=""
if test "z$with_ccache_allowed" != "z"; then
CCACHE_ALLOWED=$with_ccache_allowed
fi
AC_SUBST(CCACHE_ALLOWED)
AC_MSG_CHECKING([for icons sets])
if test "z$with_icons" = "z" ; then
with_icons='gnome'
fi
IFS_save="$IFS"
IFS=","
for icons_name in $with_icons ; do
IFS="$IFS_save"
case $icons_name in
kde | KDE)
ooo_icons_ver="ooo-KDE_icons-OOO_1_1-0.2"
;;
kde.debug | kde_debug | KDE.debug | KDE_debug)
ooo_icons_ver="ooo-debug_icons-OOO_1_1-0.1"
;;
Bluecurve)
ooo_icons_ver="ooo-icons-bluecurve-OOO_1_1-9"
;;
Ximian | Gnome | gnome | GNOME )
ooo_icons_ver="ooo-icons-OOO_1_1-10"
;;
*)
IFS="$IFS_save"
AC_MSG_ERROR( The icons set \"$icons_name\" is not supported );
;;
esac
if test "z$OOO_ICONS_VERS" = "z" ; then
OOO_ICONS_VERS="$ooo_icons_ver"
OOO_ICONS_NAMES="$icons_name"
else
OOO_ICONS_VERS="$OOO_ICONS_VERS $ooo_icons_ver"
OOO_ICONS_NAMES="$OOO_ICONS_NAMES $icons_name"
fi
IFS=","
done
IFS="$IFS_save"
AC_MSG_RESULT($with_icons)
AC_SUBST(OOO_ICONS_VERS)
AC_SUBST(OOO_ICONS_NAMES)
if test "z$with_distro" = "zKDE"; then
if test "z$enable_kde" = "z" ; then
$enable_kde=true
fi
fi
AC_MSG_CHECKING([for widget sets])
OOO_WIDGET_FLAGS=
if test -n "$enable_gtk"; then
OOO_WIDGET_FLAGS="--enable-gtk "
widget_sets="gtk"
fi
if test -n "$enable_kde"; then
OOO_WIDGET_FLAGS="$OOO_WIDGET_FLAGS --enable-kde"
widget_sets="$widget_sets kde"
fi
AC_MSG_RESULT($OOO_WIDGET_FLAGS)
AC_SUBST(OOO_WIDGET_FLAGS)
FORCE_GCC33=""
if test "z$enable_gcc33" != "z"; then
FORCE_GCC33="YES"
fi
AC_SUBST(FORCE_GCC33)
ARCHITECTURE="unxlngi4"
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)
OOO_BINSUFFIX=
OOO_MAJOR=1.1
OOO_VERSION=$OOO_MAJOR.2
AC_SUBST(OOO_VERSION)
AC_SUBST(OOO_BINSUFFIX)
datestamp=`date '+%Y%m%d.%H%M'`;
SNAPSHOT_TAG="$datestamp.$TAG";
AC_SUBST(SNAPSHOT_TAG)
if test "z$enable_bonobo" = "zyes"; then
AC_CONFIG_SUBDIRS(bonobo)
fi
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)
#
# NB. OO.o 2.0 will require checks for
# + perl-Compress-Zlib
# + perl-Archive-Zip
#
AC_CONFIG_FILES([download], [chmod +x download])
AC_CONFIG_FILES([intltool-extract intltool-merge intltool-update], [chmod +x intltool*])
AC_OUTPUT([
Makefile
ooo1.1.spec
bin/setup
bin/Makefile
desktop/Makefile
etc/Makefile
fonts/Makefile
patches/Makefile
patches/evo2/Makefile
patches/vclplug/Makefile
patches/OOO_1_1/Makefile
patches/OOO_1_1_2/Makefile
patches/OOO_1_1_3/Makefile
po/Makefile
doc/Makefile
src/Makefile
stamp/Makefile
man/Makefile
www/Makefile
www/images/Makefile
www/tinder-scripts/Makefile
])
echo "
Building openoffice
tag: $CVSTAG
src: $ext_srcdir
build dir: $OOBUILDDIR
tools dir: $TOOLSDIR
src package dir: $SRCDIR
distro: $with_distro
icons: $with_icons
widget sets: $widget_sets
system gcc: $with_system_gcc
ooo-bonobo: $enable_bonobo
java: $ENABLE_JAVA
ooo-install-dir: $OOOINSTALLDIRNAME
force gcc33: $FORCE_GCC33
To build run:
$warn_use_download make
sudo make install
"
|