summaryrefslogtreecommitdiff
path: root/bin/build-ooo
blob: 9e46c4e31b1b4374268669e8dfb32cafcc16e84c (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
#!/bin/sh

#
# See setup for user tweakables.
#
. ./setup

# configure

#  dmake security patch
cd $OOBUILDDIR/dmake
autoconf || exit 1;

#  main configure
cd $OOBUILDDIR/config_office
rm -f config.cache
echo "configuring ...";
autoconf || exit 1;

# If we are forcing gcc33, make sure configure knows
if test "z$FORCE_GCC33" = "zYES"; then
CONFIGURE_OPTIONS="$CONFIGURE_OPTIONS CFLAGS= CXXFLAGS= CC=gcc33 CXX=g++33"
fi

./configure $CONFIGURE_OPTIONS || exit 1;

# Unfortunately, on when forcing gcc33 on x86, RPM attempts to
# inject its %{optflags} everywhere.  Since gcc33 doesn't support
# -mtune, override that here
if test "z$FORCE_GCC33" = "zYES"; then
	if test "z$DISTRO" = "zRHFedora"; then
		# Set up x86 optimization flags that gcc33 can deal with
		ARCH_FLAGS=""
		if test "z$INPATH" = "zunxlngi4.pro"; then
			ARCH_FLAGS="-march=i386 -mcpu=i686"
		fi
		export ARCH_FLAGS
		FOOBAR=`ls $OOBUILDDIR/*.Set.sh`
		echo 'ARCH_FLAGS="$ARCH_FLAGS"' >> $FOOBAR
	fi
fi

# Final build preparation

# tcsh sucks great rocks, and refuses to re-direct it's output otherwise
export TERM=
# Many Java files have 8bit char-set comments, javac barfs on them in utf8 locales
export LANG="C";

if test "z$ENABLE_JAVA" = "zyes"; then
	# Many Java's can't cope with the NPTL on Linux.
	LD_ASSUME_KERNEL=2.2.5 /bin/true 2> /dev/null || LD_ASSUME_KERNEL=2.4.10 /bin/true 2> /dev/null || LD_ASSUME_KERNEL=2.6.0 2> /dev/null || unset LD_ASSUME_KERNEL
	export LD_ASSUME_KERNEL
fi
# Don't do a massive painful install
export BUILD_MINIMAL="01";
# Embedded python dies without Home set
if test "z$HOME" = "z"; then
    export HOME="";
fi
cd $OOBUILDDIR
# Import all of the OO.o environment
if test "z$DISTRO" = "zWin32"; then
    . $OOBUILDDIR/*.set.sh
else
    . $OOBUILDDIR/*.Set.sh
fi
# Copy in missing libraries if we just built them
if test "z$SYSTEM_GCC" = "z"; then
    echo "Copying libraries to $SOLARVER/$UPD/$INPATH/lib";
    mkdir -p $SOLARVER/$UPD/$INPATH/lib || exit 1;
    cp -avf $BUILDDIR/lib/libgcc* $BUILDDIR/lib/libstdc* $SOLARVER/$UPD/$INPATH/lib || exit 1;
    cp -vf $BUILDDIR/lib/libstdc++* $SOLARVER/$UPD/$INPATH/lib/ || exit 1;
fi
echo 'Verifying environment'
echo "Path:  \'$PATH\'"
echo "Shell: \'$SHELL\'"
echo "Lang:  \'$LANGS\'"
if test "z$DISTRO" != "zWin32"; then
    echo "Gcc: "
    gcc -dumpversion
fi
bison --version
flex --version
echo 'Bootstrapping'
./bootstrap || ./bootstrap || ./bootstrap || exit 1;
echo 'Commencing main build'
cd instsetoo || exit 1;
EXTRA_BUILD_FLAGS=
if test $BUILD_NCPUS -gt 1; then
    EXTRA_BUILD_FLAGS="-P$BUILD_NCPUS"
fi
if test "z$BUILD_WIN32"="z"; then
    EXTRA_BUILD_FLAGS="--dlv_switch link $EXTRA_BUILD_FLAGS"
fi

EXTRA_DMAKE_FLAGS=
if test $BUILD_JOBS -gt 1; then
    EXTRA_DMAKE_FLAGS="-- -P$BUILD_JOBS"
fi

# Automake exports MAKEFLAGS= --unix or something
# similar that gives child nmake's pain.
unset MAKEFLAGS

# Accelerate straight-through compiles by not building / using dependencies
export nodep=1
echo "Env:"
set

# run built.pl at least ones
OOO_REBUILD_NEEDED="yes"
OOO_ICONS_VERS_TO_BUILD="$OOO_ICONS_VERS"
for ooo_icons_name in $OOO_ICONS_NAMES ; do
    ooo_icons_ver=${OOO_ICONS_VERS_TO_BUILD%% *}

    # reinstall artwork and force rebuild of resources if needed
    if (echo "${OOO_ICONS_NAMES}" | grep -q " ") &&
	test ! -d $SOLARVER/$UPD/$INPATH/bin.$ooo_icons_name/ ; then
	# reinstall artwork
	cd $TOOLSDIR/bin
 	./scale-icons ${OOBUILDDIR} --remove
	export OOO_ICONS_VER_TO_INSTALL=$ooo_icons_ver
	./install-artwork
	./fix-deps ${OOBUILDDIR}
	OOO_REBUILD_NEEDED="yes"
    fi
    
    # rebuild if needed
    if test "z$OOO_REBUILD_NEEDED" = "zyes" ; then
	cd $OOBUILDDIR/instsetoo || exit 1;
	perl $SOLARENV/bin/build.pl --all $EXTRA_BUILD_FLAGS $EXTRA_DMAKE_FLAGS || exit 1;
	OOO_REBUILD_NEEDED="no"
    fi

    # save resources if needed
    if (echo "${OOO_ICONS_NAMES}" | grep -q " ") &&
      test ! -d $SOLARVER/$UPD/$INPATH/bin.$ooo_icons_name/ ; then
	mkdir -p $SOLARVER/$UPD/$INPATH/bin.$ooo_icons_name/ || exit 1;
	for file in $SOLARVER/$UPD/$INPATH/bin/*.res ; do
	    cp -vf $file $SOLARVER/$UPD/$INPATH/bin.$ooo_icons_name/ || exit 1;
	done
    fi
    
    # remove the processed icons set from the list
    OOO_ICONS_VERS_TO_BUILD=${OOO_ICONS_VERS_TO_BUILD#* }
done
    
echo "Build succeeded ...!"
exit 0;