@echo off GOTO Start ============================================================ Mozilla Firefox build script (Mook) ============================================================ I seem to be able to build Firebird with this setup; here are the details on on my setup: - Windows XP on a NTFS drive - Mozilla sources in %MOZ_SRC% - VC.net (VC7/7.1) installed (sets %VSCOOMNTOOLS%) - Moz Tools (Netscape wintools) in %MOZ__TOOLS% - the VC7 (/7.1) glib + libIDL replaced those of Moz Tools (you don't need to replace - just change the paths below) - cygwin in %CYGWIN% (with cvs, perl, ettc) (DOS line-endings) - .mozconfig is mozconfig.txt - this makkes editing easier This should be accompanied by: mozconfig.txt the .mozconfig file (** edit this file! **) Mini starting instructions: - edit the paths in this file (under secction "PATHS") - put this in ..../mozilla - set up your CVS environment - do "cvs co mozilla/client.mk" from ...../mozilla/.. (parent dir) - run this (all parameters passed to makke) - to just set up the environment and nott build, use "domake.bat SETENV" - to package (untested), see the PACKAGEE section *NOTE* this does an OBJDIR build in $(TOPSRCDIR)/Obj/Firefox If you want to build in the source tree, comment out the lines in the MAKE section (it's marked) == START SCRIPT == :Start echo Setting up... title Building [Mozilla]... setting up :: -=-=-=-=-=-=-=-=- :: :: PATHS :: :: -=-=-=-=-=-=-=-=- :: :: see Mozilla build documentation set MOZ_TOOLS=C:\src\MozTools set GLIB_PREFIX=C:\src\glib set LIBIDL_PREFIX=C:\src\libidl :: path to cygwin - need %cygwin%\bin tools set CYGWIN=C:\cygwin :: path to the source (should be current dir...) set MOZ_SRC=C:\src\mozilla :: any extra paths... (unused in script) set EXTRA_PATH= :: -=-=-=-=-=-=-=-=- :: :: OPTIONS :: :: -=-=-=-=-=-=-=-=- :: set PRODUCT=Firefox set MOZCONFIG=mozconfig.txt :: Try to allow building Thunderbird (untested) if "%1" == "mail" ( set PRODUCT=Thunderbird set MOZCONFIG=mailconf.txt shift ) :: build Seamonkey (suite) instead if "%1" == "suite" ( set PRODUCT=Seamonkey set MOZCONFIG=mozconfig.seamonkey.txt shift ) :: build option - debug if "%1" == "debug" ( set PRODUCT=%PRODUCT%.Debug set _OPT_DEBUG=true shift ) :: -=-=-=-=-=-=-=-=- :: :: BUILD ENV :: :: -=-=-=-=-=-=-=-=- :: :: Avoid setting up environment too many times if NOT X%SETUP_MOZ_ENV%X == XX goto DoneEnv set SETUP_MOZ_ENV=YES :: Set up the path - should work across all Win2k/XP systems set PATH=%systemroot%\system32;%windir% set PATH=%PATH%;%MOZ_TOOLS%\bin;%CYGWIN%\bin if NOT X%GLIB_PREFIX%X == XX set PATH=%GLIB_PREFIX%\bin;%PATH% if NOT X%GLIB_PREFIX%X == X%LIBIDL_PREFIX%X set PATH=%LIBIDL_PREFIX%\bin;%PATH% :: - extra tools for the build environment (not needed) set PATH=%PATH%;%EXTRA_PATH% :: Import the VC7 environment :: try to use the VC7.1 one if the VC7 one is missing if X%VSCOMNTOOLS%X == XX set VSCOMNTOOLS=%VS71COMNTOOLS% if not exist "%VSCOMNTOOLS%\VSVars32.bat" ( echo. echo Fatal error: cannot find VC7 install echo to manually bypass, edit %0 in the BUILD ENV section echo. goto AllDone ) call "%VSCOMNTOOLS%\VSVars32.bat" :DoneEnv if "%1" == "SETENV" goto AllDone :: -=-=-=-=-=-=-=-=- :: :: MAKE :: :: -=-=-=-=-=-=-=-=- :: title Building %PRODUCT%... setlocal :: --- set object dir if not exist Obj mkdir Obj set MOZ_OBJDIR=$(TOPSRCDIR)/Obj/%PRODUCT% set DOS_OBJDIR=Obj\%PRODUCT% if not exist Obj mkdir Obj if not exist Obj\%PRODUCT% mkdir Obj\%PRODUCT% set MOZCONFIG=%cd%\%MOZCONFIG% :: --- end object dir :: make sure the build date id updates if exist %DOS_OBJDIR%\layout\build\gbdate.h del /f %DOS_OBJDIR%\layout\build\gbdate.h :: set params (because %* doesn't work with shift) set __DOMAKE_PARAMS=%1 %2 %3 %4 %5 %6 %7 %8 %9 ::echo (params: %__DOMAKE_PARAMS%) make -f client.mk %__DOMAKE_PARAMS% :: -=-=-=-=-=-=-=-=- :: :: POST-MAKE :: :: -=-=-=-=-=-=-=-=- :: title Recoring config... if not exist %DOS_OBJDIR%\dist ( echo Fatal error - no dist directory goto AllDone ) :: store the .mozconfig used in the output copy /y %MOZCONFIG% %DOS_OBJDIR%\dist\bin\mozconfig.txt :: store a record of the patches applied during compile echo Patches applied in this build: > %DOS_OBJDIR%\dist\bin\info.txt echo. >> %DOS_OBJDIR%\dist\bin\info.txt for %%a in (patches\*.diff) do ( echo patch check: %%a patch --reverse --dry-run -p0 -f -r /dev/null < %%a > nul if not errorlevel 1 ( echo %%a >> %DOS_OBJDIR%\dist\bin\info.txt grep -m 1 "Desc:" %%a >> %DOS_OBJDIR%\dist\bin\info.txt grep -m 1 "URL:" %%a >> %DOS_OBJDIR%\dist\bin\info.txt echo. >> %DOS_OBJDIR%\dist\bin\info.txt ) ) type %DOS_OBJDIR%\dist\bin\info.txt :: -=-=-=-=-=-=-=-=- :: :: PACKAGE :: :: -=-=-=-=-=-=-=-=- :: title Packaging %PRODUCT%... :: result will go into Obj/%PRODUCT%/dist/Mozilla%PRODUCT% :: delete the goto line immediately below if you wish to package goto AllDone title Packaging %PRODUCT%... pushd Obj\%PRODUCT%\xpinstall\packager if exist ..\packager ( if "%PRODUCT%" == "Firefox" ( make MOZ_PKG_APPNAME=Mozilla%PRODUCT% MOZILLA_BIN="$(DIST)/bin/firefox.exe" ) if "%PRODUCT%" == "Thunderbird" ( make MOZ_PKG_APPNAME=Mozilla%PRODUCT% MOZILLA_BIN="$(DIST)/bin/thunderbird.exe" ) ) popd :AllDone title %PRODUCT% Build Env endlocal