Monday, September 19, 2005

Building Firefox 1.0.x on MacOSX 10.4 Tiger

I found out a couple of things about building firefox 1.0.x on tiger today as I attempt once again at porting Simohealth to the mac. The first thing I did was run:

sudo gcc_select 3.3

then I created my .mozconfig

. $topsrcdir/browser/config/mozconfig


ac_add_options --disable-tests
ac_add_options --enable-debug
ac_add_options --disable-optimize

ac_add_options --without-system-nspr
ac_add_options --without-system-zlib
ac_add_options --without-system-jpeg
ac_add_options --without-system-png
ac_add_options --without-system-mng
ac_add_options --with-macos-sdk=/Developer/SDKs/MacOSX10.3.9.sdk


Notice I already had MacOSX10.3.9 sdk installed from building xulrunner.

I downloaded the firefox-1.0.6-source.tar.bz2 tar ball.

extracted the tar ball.

cd mozilla/
make -f client.mk build

I started getting errors:

c++ -o asdecode.o -c -DOSTYPE=\"Darwin8.2.0\" -DOSARCH=\"Darwin\" -I../dist/include -I../dist/include -I/Users/taf2/projects/moz1.7/debug/dist/include/nspr -fPIC -fno-rtti -fno-exceptions -Wall -Wconversion -Wpointer-arith -Wcast-align -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wno-long-long -I/Developer/SDKs/MacOSX10.3.9.sdk/usr/include -fpascal-strings -no-cpp-precomp -fno-common -fshort-wchar -I/Developer/SDKs/MacOSX10.3.9.sdk/Developer/Headers/FlatCarbon -pipe -DDEBUG -D_DEBUG -DDEBUG_taf2 -DTRACING -g -DMOZILLA_CLIENT -include ../mozilla-config.h -Wp,-MD,.deps/asdecode.pp /Users/taf2/projects/moz1.7/mozilla/config/asdecode.cpp
In file included from /Users/taf2/projects/moz1.7/mozilla/config/asdecode.cpp:41:
/usr/include/gcc/darwin/3.3/c++/cstdlib:139: error: `_Exit' not declared
/usr/include/gcc/darwin/3.3/c++/cstdlib:165: error: `_Exit' not declared
/Users/taf2/projects/moz1.7/mozilla/config/asdecode.cpp: In function `int
main(int, char**)':
/Users/taf2/projects/moz1.7/mozilla/config/asdecode.cpp:114: warning: comparison
between signed and unsigned integer expressions
/Users/taf2/projects/moz1.7/mozilla/config/asdecode.cpp: At top level:
/Users/taf2/projects/moz1.7/mozilla/config/asdecode.cpp:58: warning: `int
read_int(FILE*)' defined but not used
make[2]: *** [asdecode.o] Error 1
make[1]: *** [default] Error 2
make: *** [build] Error 2



I worked past that error manually only to hit another error:

c++ -o nsFileSpec.o -c -DOSTYPE=\"Darwin8.2.0\" -DOSARCH=\"Darwin\" -D_IMPL_NS_COM_OBSOLETE -I.. -I/Users/taf2/projects/moz1.7/mozilla/xpcom/obsolete/../io -I../../dist/include/xpcom -I../../dist/include/string -I../../dist/include/macmorefiles -I../../dist/include/xpcom_obsolete -I../../dist/include -I/Users/taf2/projects/moz1.7/debug/dist/include/nspr -fPIC -fno-rtti -fno-exceptions -Wall -Wconversion -Wpointer-arith -Wcast-align -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wno-long-long -I/Developer/SDKs/MacOSX10.3.9.sdk/usr/include -fpascal-strings -no-cpp-precomp -fno-common -fshort-wchar -I/Developer/SDKs/MacOSX10.3.9.sdk/Developer/Headers/FlatCarbon -pipe -DDEBUG -D_DEBUG -DDEBUG_taf2 -DTRACING -g -I/Developer/SDKs/MacOSX10.3.9.sdk/Developer/Headers/FlatCarbon -DMOZILLA_CLIENT -include ../../mozilla-config.h -Wp,-MD,.deps/nsFileSpec.pp /Users/taf2/projects/moz1.7/mozilla/xpcom/obsolete/nsFileSpec.cpp
In file included from /usr/include/sys/acl.h:26,
from /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Files.h:61,
from /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Components.h:32,
from /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/CarbonCore.h:81,
from /System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:21,
from /Developer/SDKs/MacOSX10.3.9.sdk/Developer/Headers/FlatCarbon/Aliases.h:1,
from /Users/taf2/projects/moz1.7/mozilla/xpcom/obsolete/nsFileSpec.cpp:79:
/usr/include/sys/kauth.h:229: error: `user_addr_t' was not declared in this
scope
/usr/include/sys/kauth.h:229: error: parse error before `,' token
In file included from /usr/include/machine/_types.h:26,
from /usr/include/sys/_types.h:27,
from /usr/include/sys/statvfs.h:30,
from /Users/taf2/projects/moz1.7/mozilla/xpcom/obsolete/nsFileSpecUnix.cpp:58,
from /Users/taf2/projects/moz1.7/mozilla/xpcom/obsolete/nsFileSpec.cpp:520:
/usr/include/ppc/_types.h:73: error: conflicting types for `typedef union
__mbstate_t __mbstate_t'
/Developer/SDKs/MacOSX10.3.9.sdk/usr/include/ppc/ansi.h:96: error: previous
declaration as `typedef union __mbstate_t __mbstate_t'
In file included from /usr/include/sys/statvfs.h:30,
from /Users/taf2/projects/moz1.7/mozilla/xpcom/obsolete/nsFileSpecUnix.cpp:58,
from /Users/taf2/projects/moz1.7/mozilla/xpcom/obsolete/nsFileSpec.cpp:520:
/usr/include/sys/_types.h:66: error: redefinition of `struct
_opaque_pthread_attr_t'
/Developer/SDKs/MacOSX10.3.9.sdk/usr/include/sys/types.h:205: error: previous
definition of `struct _opaque_pthread_attr_t'
/usr/include/sys/_types.h:67: error: redefinition of `struct
_opaque_pthread_cond_t'
/Developer/SDKs/MacOSX10.3.9.sdk/usr/include/sys/types.h:213: error: previous
definition of `struct _opaque_pthread_cond_t'
/usr/include/sys/_types.h:68: error: redefinition of `struct
_opaque_pthread_condattr_t'
/Developer/SDKs/MacOSX10.3.9.sdk/usr/include/sys/types.h:211: error: previous
definition of `struct _opaque_pthread_condattr_t'
/usr/include/sys/_types.h:69: error: redefinition of `struct
_opaque_pthread_mutex_t'
/Developer/SDKs/MacOSX10.3.9.sdk/usr/include/sys/types.h:209: error: previous
definition of `struct _opaque_pthread_mutex_t'
/usr/include/sys/_types.h:70: error: redefinition of `struct
_opaque_pthread_mutexattr_t'
/Developer/SDKs/MacOSX10.3.9.sdk/usr/include/sys/types.h:207: error: previous
definition of `struct _opaque_pthread_mutexattr_t'
/usr/include/sys/_types.h:72: error: redefinition of `struct
_opaque_pthread_rwlock_t'
/Developer/SDKs/MacOSX10.3.9.sdk/usr/include/sys/types.h:217: error: previous
definition of `struct _opaque_pthread_rwlock_t'
/usr/include/sys/_types.h:73: error: redefinition of `struct
_opaque_pthread_rwlockattr_t'
/Developer/SDKs/MacOSX10.3.9.sdk/usr/include/sys/types.h:215: error: previous
definition of `struct _opaque_pthread_rwlockattr_t'
/usr/include/sys/_types.h:74: error: redefinition of `struct _opaque_pthread_t'
/Developer/SDKs/MacOSX10.3.9.sdk/usr/include/sys/types.h:203: error: previous
definition of `struct _opaque_pthread_t'
/usr/include/sys/_types.h:146: error: redefinition of `struct sigaltstack'
/Developer/SDKs/MacOSX10.3.9.sdk/usr/include/sys/signal.h:280: error: previous
definition of `struct sigaltstack'


Seeing this error I decided I still did not having something setup quiet right... So, I signed onto irc and started to explain the build problems... I was very lucky to ge t the help of mento... He kindly directed me to Bug 292530 with Patch 185940

Next he let me know I would need to use autoconf 2.13 not autoconf 2.54

I used apt-get to replace 2.54 with 2.13 and from the advice of some fink devs from freenode.

Next per mento's advice I ran:
make -f client.mk distclean && autoconf && make -f client.mk build

Now I have a working Mac OSX Firefox 1.0.x debug build to start working with to begin working with to port simo.

2 comments:

javier said...

Any progress on a Mac version? I recently started playing around with SimoHealth. I like it, but it would be best to run it on my Mac.

todd said...

We got set back again because of intel mac. I have it working pretty nicely on the ppc mac, but am stuck getting the intel mac to compile some of our support libraries. All a matter of time.

Reading list