I once again spent some time trying to get the latest OOo sources (DEV300m67 by now) to build on Mac OS X 10.6. I had to apply six tweaks to the "canonical, plain" build mechanism (i.e., configured with just --enable-werror and --with-use-shell=bash, and nothing else), see below for the corresponding script (quoted, to preserve line breaks).

1 <http://www.openoffice.org/issues/show_bug.cgi?id=106059> links <http://www.openoffice.org/nonav/issues/showattachment.cgi/65460/106059_snow_leopard.patch> as necessary modifications to the code base (configure.in, solenv/inc/unxmacx.mk, lpsolve/lp_solve_5.5.patch) to allow compiling on 10.6. I left out those changes to configure.in that address the libsqlite3 problem, as it is addressed by (4) instead.

2 <http://www.openoffice.org/issues/show_bug.cgi?id=106059> also mandates to pass CC=gcc-4.0 and CXX=g++-4.0 to configure.

3 There is a place in moz/makefile.mk not correctly passing on the values of CC and CXX, see <http://www.openoffice.org/issues/show_bug.cgi?id=103763#desc17> and following.

4 <http://eis.services.openoffice.org/EIS2/cws.ShowCWS?Path=DEV300%2Fjl144> contains a fix for the libsqlite3 problem (moz/zipped/makefile.mk, nss/nss.patch, nss/prj/d.lst, solenv/inc/unxmacxi.mk).

5 It appears that <http://eis.services.openoffice.org/EIS2/cws.ShowCWS?Path=DEV300%2Fjl144> (see 4) does not work correctly if --disable-build-mozilla is not configured, so an additional fix to moz/extractfiles.mk appears to be necessary. I want to discuss this with Jochen when he is back from vacation.

6 smoketestoo_native crashes on a bug that appears to be in binfilter "from the start" (probably causing a crash only in Mac OS X 10.6 due to enhancements in its C++ standard library implementation), requiring a fix to binfilter/legacysmgr/source/legacy/legacy_binfilters_smgr.cxx (see <http://www.openoffice.org/issues/show_bug.cgi?id=107719>).

-Stephan


#!/bin/bash
set -ev

# On Mac OS X 10.6.2:
# -install latest Xcode 3.2.1 (<https://developer.apple.com/mac/scripts/
# downloader.php?path=/Developer_Tools/xcode_3.2.1_developer_tools/
# xcode321_10m2003_developerdvd.dmg>), including optional Mac OS X 10.4 Support
# - install latest MacPorts 1.8.1
# (<http://distfiles.macports.org/MacPorts/MacPorts-1.8.1-10.6-SnowLeopard.dmg>)
# sudo /opt/local/bin/port selfupdate
# sudo /opt/local/bin/port install libidl +universal
# sudo /opt/local/bin/port install mercurial pkgconfig wget

mkdir OOo

mkdir OOo/pkgconfig
ln -s /opt/local/lib/pkgconfig/glib-2.0.pc OOo/pkgconfig/
ln -s /opt/local/lib/pkgconfig/libIDL-2.0.pc OOo/pkgconfig/
export PKG_CONFIG=/opt/local/bin/pkg-config \
 PKG_CONFIG_LIBDIR=$PWD/OOo/pkgconfig

# DEV300_m67:
/opt/local/bin/hg clone -r a4be016d908d \
 http://hg.services.openoffice.org/DEV300 OOo/ooo

# parts of <http://www.openoffice.org/nonav/issues/showattachment.cgi/65460/
# 106059_snow_leopard.patch>, see
# <http://www.openoffice.org/issues/show_bug.cgi?id=106059>:
patch -d OOo/ooo -p 1 <<\EOF
diff -r a4be016d908d configure.in
--- a/configure.in      Wed Dec 09 12:25:54 2009 +0100
+++ b/configure.in      Mon Dec 14 21:58:22 2009 +0100
@@ -1460,7 +1460,6 @@
     AC_MSG_CHECKING([the GNU gcc compiler version])
    _gcc_version=`$CC -dumpversion`
    _gcc_major=`echo $_gcc_version | $AWK -F. '{ print \$1 }'`
-   _gcc_longver=`echo $_gcc_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 
}'`
    GCCVER=`echo $_gcc_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
if test "$_gcc_major" -lt "3"; then
@@ -1472,6 +1471,9 @@
            fi
       fi
    fi
+   if test "$_os" = "Darwin" -a "$GCCVER" -ge "040100" ; then
+      AC_MSG_ERROR([You need to use the gcc-4.0 compiler (gcc $_gcc_version 
won't work with the MacOSX10.4u.sdk) - set CC accordingly])
+   fi
    AC_MSG_RESULT([checked (gcc $_gcc_version)])
    if test "$_os" = "SunOS"; then
       AC_MSG_CHECKING([gcc linker])
@@ -2104,6 +2106,10 @@
    _gpp_version=`$CXX -dumpversion`
    _gpp_major=`echo $_gpp_version | $AWK -F. '{ print \$1 }'`
    _gpp_minor=`echo $_gpp_version | $AWK -F. '{ print \$2 }'`
+
+   if test "$_os" = "Darwin" -a "$_gpp_major" -ge "4" -a "$_gpp_minor" -ge "1" 
; then
+      AC_MSG_ERROR([You need to use the g++-4.0 compiler (g++ $_gpp_version 
won't work with the MacOSX10.4u.sdk) - set CXX accordingly])
+   fi
AC_MSG_RESULT([checked (g++ $_gpp_version)]) @@ -2272,21 +2278,6 @@ fi fi
 dnl ===================================================================
-dnl Extra checking for the DARWIN compiler
-dnl ===================================================================
-if test "$_os" = "Darwin"; then
-   dnl c++ packaged with cc (gcc) for Macosx
-   if test "$CC" = "cc"; then
-      AC_MSG_CHECKING([Macosx c++ Compiler])
-      if test "$CXX" != "c++"; then
-         AC_MSG_WARN([Macosx C++ was not found])
-         echo "Macosx C++ was not found" >> warn
-      else
- AC_MSG_RESULT([checked]) - fi - fi -fi -dnl ===================================================================
 dnl Extra checking for the IRIX compiler
 dnl ===================================================================
 if test "$_os" = "IRIX" -o "$_os" = "IRIX64"; then
@@ -3784,29 +3775,27 @@
 AC_SUBST(LIBXML_CFLAGS)
 AC_SUBST(LIBXML_LIBS)
-dnl ===================================================================
-dnl Check for system python
-dnl ===================================================================
+# ===================================================================
+# Check for system python
+# ===================================================================
+AC_MSG_CHECKING([which python to use])
 if test "$_os" = "Darwin" && test "$with_system_python" != "no"; then
    with_system_python=yes
-fi
-AC_MSG_CHECKING([which python to use])
-if test -n "$with_system_python" -o -n "$with_system_libs" && \
+   AC_MSG_RESULT([compiling against MacOSX10.4u.sdk (python version 2.3)])
+   
PYTHON_CFLAGS="-I/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/Python.framework/Versions/2.3/include/python2.3"
+   PYTHON_LIBS="-framework Python"
+elif test -n "$with_system_python" -o -n "$with_system_libs" && \
        test "$with_system_python" != "no"; then
-   SYSTEM_PYTHON=YES
    AC_MSG_RESULT([external])
    AM_PATH_PYTHON([2.2])
python_include=`$PYTHON -c "import distutils.sysconfig; print distutils.sysconfig.get_config_var('INCLUDEPY');"`
    python_version=`$PYTHON -c "import distutils.sysconfig; print 
distutils.sysconfig.get_config_var('VERSION');"`
    PYTHON_CFLAGS="-I$python_include"
-
-   if test "$_os" = "Darwin"; then
-      PYTHON_LIBS="-framework Python"
-   else
-      PYTHON_LIBS="-lpython$python_version"
-   fi
- + PYTHON_LIBS="-lpython$python_version"
+fi
+if test "$with_system_python" != "no" ; then + SYSTEM_PYTHON=YES
    dnl check if the headers really work:
    save_CPPFLAGS="$CPPFLAGS"
    CPPFLAGS="$CPPFLAGS $PYTHON_CFLAGS"
diff -r a4be016d908d solenv/inc/unxmacx.mk
--- a/solenv/inc/unxmacx.mk     Wed Dec 09 12:25:54 2009 +0100
+++ b/solenv/inc/unxmacx.mk     Mon Dec 14 21:45:40 2009 +0100
@@ -89,8 +89,8 @@
 # objcpp = Objective C++ compiler to use
 CXX*=g++
 CC*=gcc
-objc*=gcc
-objcpp*=g++
+objc*=$(CC)
+objcpp*=$(CXX)
CFLAGS=-fsigned-char -fmessage-length=0 -malign-natural -c $(EXTRA_CFLAGS) diff -r a4be016d908d lpsolve/lp_solve_5.5.patch
--- a/lpsolve/lp_solve_5.5.patch        Wed Dec 09 12:25:54 2009 +0100
+++ b/lpsolve/lp_solve_5.5.patch        Mon Dec 14 21:45:40 2009 +0100
@@ -42,15 +42,15 @@
  opts='-idirafter /usr/include/sys -O3 -DINTEGERTIME -Wno-long-double'
-$c -s -c -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd $opts $def -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine $src
-+$c $extra_cflags -s -c -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL 
-I../bfp/bfp_LUSOL/LUSOL -I../colamd $opts $def -DYY_NEVER_INTERACTIVE 
-DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine 
$extra_cdefs $src
++$CC $extra_cflags -s -c -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL 
-I../bfp/bfp_LUSOL/LUSOL -I../colamd $opts $def -DYY_NEVER_INTERACTIVE 
-DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine 
$extra_cdefs $src
  libtool -static -o liblpsolve55.a `echo $src|sed s/[.]c/.o/g|sed 's/[^ 
]*\///g'`
if [ "$so" != "" ]
  then
 -  $c -fPIC -fno-common -s -c -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL 
-I../bfp/bfp_LUSOL/LUSOL -I../colamd -I. $opts -DYY_NEVER_INTERACTIVE 
-DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine $src
 -  $c -dynamiclib liblpsolve55.a -compatibility_version 5.5.0 -current_version 
5.5.0 -o liblpsolve55.dylib `echo $src|sed s/[.]c/.o/g|sed 's/[^ ]*\///g'` -lc
-+  $c $extra_cflags -fPIC -fno-common -s -c -I.. -I../shared -I../bfp 
-I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -I. $opts 
-DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL 
-DRoleIsExternalInvEngine $extra_cdefs $src
-+  $c $extra_linkflags -dynamiclib liblpsolve55.a -compatibility_version 5.5.0 
-current_version 5.5.0 -o liblpsolve55.dylib `echo $src|sed s/[.]c/.o/g|sed 
's/[^ ]*\///g'` -lc
++  $CC $extra_cflags -fPIC -fno-common -s -c -I.. -I../shared -I../bfp 
-I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -I. $opts 
-DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL 
-DRoleIsExternalInvEngine $extra_cdefs $src
++  $CC $extra_linkflags -dynamiclib liblpsolve55.a -compatibility_version 
5.5.0 -current_version 5.5.0 -o liblpsolve55.dylib `echo $src|sed 
s/[.]c/.o/g|sed 's/[^ ]*\///g'` -lc
  fi
rm *.o 2>/dev/null
EOF
( cd OOo/ooo; autoconf )
rm -r OOo/ooo/autom4te.cache

# see <http://www.openoffice.org/issues/show_bug.cgi?id=103763>:
patch -d OOo/ooo -p 1 <<\EOF
diff -r a4be016d908d moz/makefile.mk
--- a/moz/makefile.mk   Wed Dec 09 12:25:54 2009 +0100
+++ b/moz/makefile.mk   Mon Dec 14 21:45:40 2009 +0100
@@ -167,7 +167,7 @@
 # create a objdir build = build files in a seperate directory, not in the 
sourcetree directly
 CONFIGURE_DIR=$(CPU)_objdir
 BUILD_DIR=$(CONFIGURE_DIR)
-MOZ_CROSSCOMPILE=CROSS_COMPILE=1 CC="gcc -arch $(MOZ_ARCH)" CXX="g++ -arch 
$(MOZ_ARCH)" AR=ar
+MOZ_CROSSCOMPILE=CROSS_COMPILE=1 CC="$(CC) -arch $(MOZ_ARCH)" CXX="$(CXX) -arch 
$(MOZ_ARCH)" AR=ar
CONFIGURE_ACTION=$(null,$(MOZ_ARCH) $(NULL) $(MOZ_CROSSCOMPILE)) ../configure $(MOZILLA_CONFIGURE_FLAGS)
EOF

# parts of CWS jl144: patch -d OOo/ooo -p 1 <<\EOF
diff -r a4be016d908d moz/zipped/makefile.mk
--- a/moz/zipped/makefile.mk    Wed Dec 09 12:25:54 2009 +0100
+++ b/moz/zipped/makefile.mk    Mon Dec 14 21:45:40 2009 +0100
@@ -175,6 +175,8 @@
.ENDIF # "$(OS)" == "SOLARIS" +#On Linux/Unix sqlite is delivered to $(SOLARLIBDIR)/sqlite/libsqlite3.so
+#See readme.txt  in module nss
 NSS_MODULE_RUNTIME_LIST:= \
     $(FREEBL) \
     nspr4 \
@@ -186,7 +188,7 @@
     plds4 \
     smime3 \
     softokn3 \
-    sqlite3 \
+    sqlite/sqlite3 \
     ssl3
@@ -200,13 +202,13 @@
         echo >& $(NULLDEV)
     $(foreach,lib,$(LIBLIST) rm -f $(LB)$/$(lib) &&) \
     echo >& $(NULLDEV)
-    $(foreach,lib,$(BIN_RUNTIMELIST) zip -d $(BIN)$/mozruntime.zip 
$(DLLPRE)$(lib)$(DLLPOST) &&) \
+    $(foreach,lib,$(BIN_RUNTIMELIST) zip -d $(BIN)$/mozruntime.zip 
$(DLLPRE)$(lib:f)$(DLLPOST) &&) \
     echo >& $(NULLDEV)
 .IF "$(GUI)"=="WNT"
-    $(foreach,lib,$(NSS_MODULE_RUNTIME_LIST) zip -g -j $(BIN)$/mozruntime.zip 
$(SOLARBINDIR)$/$(DLLPRE)$(lib)$(DLLPOST) &&) \
+    +$(foreach,lib,$(NSS_MODULE_RUNTIME_LIST) zip -g -j $(BIN)$/mozruntime.zip 
$(SOLARBINDIR)$/$(DLLPRE)$(lib:f)$(DLLPOST) &&) \
     echo >& $(NULLDEV)
 .ELSE
-    $(foreach,lib,$(NSS_MODULE_RUNTIME_LIST) zip -g -j $(BIN)$/mozruntime.zip 
$(SOLARLIBDIR)$/$(DLLPRE)$(lib)$(DLLPOST) &&) \
+    +$(foreach,lib,$(NSS_MODULE_RUNTIME_LIST) zip -g -j $(BIN)$/mozruntime.zip 
$(SOLARLIBDIR)$/$(lib:d)$(DLLPRE)$(lib:f)$(DLLPOST) &&) \
     echo >& $(NULLDEV)
 .ENDIF
$(TOUCH) $@ diff -r a4be016d908d nss/nss.patch
--- a/nss/nss.patch     Wed Dec 09 12:25:54 2009 +0100
+++ b/nss/nss.patch     Mon Dec 14 21:45:40 2009 +0100
@@ -168,3 +168,24 @@
  endif
  endif
  endif
+--- misc/mozilla/security/nss/cmd/shlibsign/Makefile   Fri Aug  7 21:06:37 2009
++++ misc/build/mozilla/security/nss/cmd/shlibsign/Makefile     Fri Nov 27 
13:07:52 2009
+@@ -78,10 +78,15 @@
+ + # sign any and all shared libraries that contain the word freebl + +-CHECKLIBS = $(DIST)/lib/$(DLL_PREFIX)softokn3.$(DLL_SUFFIX)
+-CHECKLIBS += $(wildcard $(DIST)/lib/$(DLL_PREFIX)freebl*3.$(DLL_SUFFIX))
++# Signing causes loading of some system library which in turn loads
++# libsqlite3. Then it loads libsqulite3 from nss, which does not have the 
proper
++# version. Therefore signing fails.
++# We cannot build with the system sqlite3, because it is too old (SDK
++# 10.4). Otherwise one could set NSS_USE_SYSTEM_SQLITE=1 and use the system lib. ++#CHECKLIBS = $(DIST)/lib/$(DLL_PREFIX)softokn3.$(DLL_SUFFIX)
++#CHECKLIBS += $(wildcard $(DIST)/lib/$(DLL_PREFIX)freebl*3.$(DLL_SUFFIX))
+ ifndef NSS_DISABLE_DBM
+-CHECKLIBS += $(DIST)/lib/$(DLL_PREFIX)nssdbm3.$(DLL_SUFFIX)
++#CHECKLIBS += $(DIST)/lib/$(DLL_PREFIX)nssdbm3.$(DLL_SUFFIX)
+ endif
+ CHECKLOC = $(CHECKLIBS:.$(DLL_SUFFIX)=.chk)
+ diff -r a4be016d908d nss/prj/d.lst
--- a/nss/prj/d.lst     Wed Dec 09 12:25:54 2009 +0100
+++ b/nss/prj/d.lst     Mon Dec 14 21:45:40 2009 +0100
@@ -1,10 +1,30 @@
 mkdir: %_DEST%\inc%_EXT%\mozilla\nspr
 mkdir: %_DEST%\inc%_EXT%\mozilla\nspr\obsolete
 mkdir: %_DEST%\inc%_EXT%\mozilla\nss
+mkdir: %_DEST%\lib%_EXT%\sqlite
..\%__SRC%\inc\include\* %_DEST%\inc%_EXT%\mozilla\nspr
 ..\%__SRC%\inc\include\obsolete\protypes.h 
%_DEST%\inc%_EXT%\mozilla\nspr\obsolete\protypes.h
 ..\%__SRC%\inc\nss\*.h %_DEST%\inc%_EXT%\mozilla\nss
-..\%__SRC%\lib\* %_DEST%\lib%_EXT%
+
+..\%__SRC%\lib\libfreebl3.* %_DEST%\lib%_EXT%\libfreebl.*
+..\%__SRC%\lib\libfreebl_32fpu_3.* %_DEST%\lib%_EXT%\libfreebl_32fpu_3.*
+..\%__SRC%\lib\libfreebl_32int64_3.* %_DEST%\lib%_EXT%\libfreebl_32int64_3.*
+..\%__SRC%\lib\libfreebl_32int_3.* %_DEST%\lib%_EXT%\libfreebl_32int_3.*
+..\%__SRC%\lib\libfreebl_64int_3.* %_DEST%\lib%_EXT%\libfreebl_64int_3.*
+..\%__SRC%\lib\libfreebl_64fpu_3.* %_DEST%\lib%_EXT%\libfreebl_64fpu_3.*
+..\%__SRC%\lib\libnspr4.* %_DEST%\lib%_EXT%\libnspr4.*
+..\%__SRC%\lib\libnss3.* %_DEST%\lib%_EXT%\libnss3.*
+..\%__SRC%\lib\libnssckbi.* %_DEST%\lib%_EXT%\libnssckbi.*
+..\%__SRC%\lib\libnssdbm3.* %_DEST%\lib%_EXT%\libnssdbm3.*
+..\%__SRC%\lib\libnssutil3.* %_DEST%\lib%_EXT%\libnssutil3.*
+..\%__SRC%\lib\libplc4.* %_DEST%\lib%_EXT%\libplc4.*
+..\%__SRC%\lib\libplds4.* %_DEST%\lib%_EXT%\libplds4.*
+..\%__SRC%\lib\libsmime3.* %_DEST%\lib%_EXT%\libsmime3.*
+..\%__SRC%\lib\libsoftokn3.* %_DEST%\lib%_EXT%\libsoftokn3.*
+..\%__SRC%\lib\libssl3.* %_DEST%\lib%_EXT%\libssl3.*
+
+..\%__SRC%\lib\libsqlite3.* %_DEST%\lib%_EXT%\sqlite\libsqlite3.*
+
 ..\%__SRC%\bin\* %_DEST%\bin%_EXT%
diff -r a4be016d908d solenv/inc/unxmacxi.mk
--- a/solenv/inc/unxmacxi.mk    Wed Dec 09 12:25:54 2009 +0100
+++ b/solenv/inc/unxmacxi.mk    Mon Dec 14 21:45:40 2009 +0100
@@ -55,7 +55,6 @@
.IF "$(SNOW_LEOPARD_10_4)"!=""
 JAVACOMPILER+=-target 1.5
-DYLD_INSERT_LIBRARIES=/usr/lib/libsqlite3.dylib
 .EXPORT: DYLD_INSERT_LIBRARIES
 .ENDIF # "$(SNOW_LEOPARD_10_4)"!=""
EOF

# additional fix for CWS jl144:
patch -d OOo/ooo -p 1 <<\EOF
diff -r a4be016d908d moz/extractfiles.mk
--- a/moz/extractfiles.mk       Wed Dec 09 12:25:54 2009 +0100
+++ b/moz/extractfiles.mk       Mon Dec 14 21:45:40 2009 +0100
@@ -67,9 +67,12 @@
        plds4 \
        smime3 \
        softokn3 \
-       sqlite3 \
        ssl3
+.IF "$(OS)" != "MACOSX"
+NSS_MODULE_RUNTIME_LIST += sqlite3
+.ENDIF
+
 BIN_RUNTIMELIST= \
        xpcom \
        xpcom_core \
EOF

# see <http://www.openoffice.org/issues/show_bug.cgi?id=107719>:
patch -d OOo/ooo -p 1 <<\EOF
diff -r a4be016d908d 
binfilter/legacysmgr/source/legacy/legacy_binfilters_smgr.cxx
--- a/binfilter/legacysmgr/source/legacy/legacy_binfilters_smgr.cxx     Wed Dec 
09 12:25:54 2009 +0100
+++ b/binfilter/legacysmgr/source/legacy/legacy_binfilters_smgr.cxx     Tue Dec 
15 22:13:57 2009 +0100
@@ -1323,7 +1323,7 @@
        // remove from the implementation map
        m_ImplementationMap.erase( aIt );
- m_SetLoadedFactories.erase( *aIt);
+       m_SetLoadedFactories.erase( xEle );
        // remove from the implementation name hashmap
        Reference<XServiceInfo > xInfo( Reference<XServiceInfo >::query( xEle ) 
);
        if( xInfo.is() )
EOF

/opt/local/bin/wget \
 http://tools.openoffice.org/unowinreg_prebuild/680/unowinreg.dll \
 -P OOo/ooo/external/unowinreg
/opt/local/bin/wget \
 
ftp://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/1.1.14/seamonkey-1.1.14.source.tar.bz2
 \
 -P OOo/ooo/moz/download

cd OOo/ooo
./configure --enable-werror --with-use-shell=bash CC=gcc-4.0 CXX=g++-4.0
./bootstrap
. MacOSXX86Env.Set.sh
shopt -s expand_aliases
cd smoketestoo_native
build --all -P2 -- -P2

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to