Skip to content
This repository has been archived by the owner on Nov 9, 2021. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
lazbuild: auto create ide/revision.inc if missing
git-svn-id: http://svn.freepascal.org/svn/lazarus/trunk@36733 4005530d-fff6-0310-9dd1-cebe43e6787f
  • Loading branch information
mattias committed Apr 12, 2012
1 parent 0d678e1 commit 2d8019a
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 5 deletions.
2 changes: 2 additions & 0 deletions Makefile
Expand Up @@ -2727,6 +2727,8 @@ bigidecomponents:
$(MAKE) -C components bigide
tools:
$(MAKE) -C tools
revisioninc:
$(MAKE) -C ide revisioninc
ide:
$(MAKE) -C ide ide
idebig:
Expand Down
6 changes: 6 additions & 0 deletions Makefile.fpc
Expand Up @@ -150,6 +150,12 @@ bigidecomponents:
tools:
$(MAKE) -C tools

#-----------------------------------------------------------------------------
# create/update ide/revision.inc
# requires tools
revisioninc:
$(MAKE) -C ide revisioninc

#-----------------------------------------------------------------------------
# build lazarus exe with minimum of packages for the LCL_PLATFORM
# requires basecomponents and tools
Expand Down
35 changes: 32 additions & 3 deletions ide/Makefile
@@ -1,8 +1,8 @@
#
# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/03/26]
# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/09]
#
default: all
MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
BSDs = freebsd netbsd openbsd darwin
UNIXs = linux $(BSDs) solaris qnx haiku
LIMIT83fs = go32v2 os2 emx watcom
Expand Down Expand Up @@ -482,6 +482,9 @@ endif
ifeq ($(FULL_TARGET),x86_64-solaris)
override TARGET_PROGRAMS+=lazarus startlazarus lazbuild
endif
ifeq ($(FULL_TARGET),x86_64-openbsd)
override TARGET_PROGRAMS+=lazarus startlazarus lazbuild
endif
ifeq ($(FULL_TARGET),x86_64-darwin)
override TARGET_PROGRAMS+=lazarus startlazarus lazbuild
endif
Expand Down Expand Up @@ -674,6 +677,9 @@ endif
ifeq ($(FULL_TARGET),x86_64-solaris)
override CLEAN_FILES+=$(wildcard $(COMPILER_UNITTARGETDIR)/*$(OEXT)) $(wildcard $(COMPILER_UNITTARGETDIR)/*$(PPUEXT)) $(wildcard $(COMPILER_UNITTARGETDIR)/*$(RSTEXT)) $(wildcard $(COMPILER_UNITTARGETDIR)/*.lfm) $(wildcard $(COMPILER_UNITTARGETDIR)/*.or) $(wildcard $(COMPILER_UNITTARGETDIR)/*.res) $(wildcard ../designer/*$(OEXT)) $(wildcard ../designer/*$(PPUEXT)) $(wildcard ../debugger/*$(OEXT)) $(wildcard ../debugger/*$(PPUEXT)) $(wildcard ../converter/*$(OEXT)) $(wildcard ../converter/*$(PPUEXT)) $(wildcard ../packager/*$(OEXT)) $(wildcard ../packager/*$(PPUEXT)) $(wildcard ../*$(OEXT)) $(wildcard ../*$(PPUEXT)) $(wildcard *$(OEXT)) $(wildcard *$(PPUEXT)) $(wildcard *$(RSTEXT))
endif
ifeq ($(FULL_TARGET),x86_64-openbsd)
override CLEAN_FILES+=$(wildcard $(COMPILER_UNITTARGETDIR)/*$(OEXT)) $(wildcard $(COMPILER_UNITTARGETDIR)/*$(PPUEXT)) $(wildcard $(COMPILER_UNITTARGETDIR)/*$(RSTEXT)) $(wildcard $(COMPILER_UNITTARGETDIR)/*.lfm) $(wildcard $(COMPILER_UNITTARGETDIR)/*.or) $(wildcard $(COMPILER_UNITTARGETDIR)/*.res) $(wildcard ../designer/*$(OEXT)) $(wildcard ../designer/*$(PPUEXT)) $(wildcard ../debugger/*$(OEXT)) $(wildcard ../debugger/*$(PPUEXT)) $(wildcard ../converter/*$(OEXT)) $(wildcard ../converter/*$(PPUEXT)) $(wildcard ../packager/*$(OEXT)) $(wildcard ../packager/*$(PPUEXT)) $(wildcard ../*$(OEXT)) $(wildcard ../*$(PPUEXT)) $(wildcard *$(OEXT)) $(wildcard *$(PPUEXT)) $(wildcard *$(RSTEXT))
endif
ifeq ($(FULL_TARGET),x86_64-darwin)
override CLEAN_FILES+=$(wildcard $(COMPILER_UNITTARGETDIR)/*$(OEXT)) $(wildcard $(COMPILER_UNITTARGETDIR)/*$(PPUEXT)) $(wildcard $(COMPILER_UNITTARGETDIR)/*$(RSTEXT)) $(wildcard $(COMPILER_UNITTARGETDIR)/*.lfm) $(wildcard $(COMPILER_UNITTARGETDIR)/*.or) $(wildcard $(COMPILER_UNITTARGETDIR)/*.res) $(wildcard ../designer/*$(OEXT)) $(wildcard ../designer/*$(PPUEXT)) $(wildcard ../debugger/*$(OEXT)) $(wildcard ../debugger/*$(PPUEXT)) $(wildcard ../converter/*$(OEXT)) $(wildcard ../converter/*$(PPUEXT)) $(wildcard ../packager/*$(OEXT)) $(wildcard ../packager/*$(PPUEXT)) $(wildcard ../*$(OEXT)) $(wildcard ../*$(PPUEXT)) $(wildcard *$(OEXT)) $(wildcard *$(PPUEXT)) $(wildcard *$(RSTEXT))
endif
Expand Down Expand Up @@ -869,6 +875,9 @@ endif
ifeq ($(FULL_TARGET),x86_64-solaris)
override COMPILER_OPTIONS+=-gl -Sci -dlcl$(LCL_PLATFORM)
endif
ifeq ($(FULL_TARGET),x86_64-openbsd)
override COMPILER_OPTIONS+=-gl -Sci -dlcl$(LCL_PLATFORM)
endif
ifeq ($(FULL_TARGET),x86_64-darwin)
override COMPILER_OPTIONS+=-gl -Sci -dlcl$(LCL_PLATFORM)
endif
Expand Down Expand Up @@ -1061,6 +1070,9 @@ endif
ifeq ($(FULL_TARGET),x86_64-solaris)
override COMPILER_INCLUDEDIR+=include include/$(OS_TARGET) ../images
endif
ifeq ($(FULL_TARGET),x86_64-openbsd)
override COMPILER_INCLUDEDIR+=include include/$(OS_TARGET) ../images
endif
ifeq ($(FULL_TARGET),x86_64-darwin)
override COMPILER_INCLUDEDIR+=include include/$(OS_TARGET) ../images
endif
Expand Down Expand Up @@ -1253,6 +1265,9 @@ endif
ifeq ($(FULL_TARGET),x86_64-solaris)
override COMPILER_UNITDIR+=../lcl/units/$(CPU_TARGET)-$(OS_TARGET) ../lcl/units/$(CPU_TARGET)-$(OS_TARGET)/$(LCL_PLATFORM) ../components/codetools/units/$(CPU_TARGET)-$(OS_TARGET) ../components/lazutils/lib/$(CPU_TARGET)-$(OS_TARGET) ../components/synedit/units/$(CPU_TARGET)-$(OS_TARGET)/$(LCL_PLATFORM) ../components/lazcontrols/lib/$(CPU_TARGET)-$(OS_TARGET)/$(LCL_PLATFORM) ../components/custom ../ideintf/units/$(CPU_TARGET)-$(OS_TARGET)/$(LCL_PLATFORM) ../designer ../debugger ../debugger/frames ../converter ../packager ../packager/frames ../packager/units/$(CPU_TARGET)-$(OS_TARGET) ../units/$(CPU_TARGET)-$(OS_TARGET)/$(LCL_PLATFORM) frames .
endif
ifeq ($(FULL_TARGET),x86_64-openbsd)
override COMPILER_UNITDIR+=../lcl/units/$(CPU_TARGET)-$(OS_TARGET) ../lcl/units/$(CPU_TARGET)-$(OS_TARGET)/$(LCL_PLATFORM) ../components/codetools/units/$(CPU_TARGET)-$(OS_TARGET) ../components/lazutils/lib/$(CPU_TARGET)-$(OS_TARGET) ../components/synedit/units/$(CPU_TARGET)-$(OS_TARGET)/$(LCL_PLATFORM) ../components/lazcontrols/lib/$(CPU_TARGET)-$(OS_TARGET)/$(LCL_PLATFORM) ../components/custom ../ideintf/units/$(CPU_TARGET)-$(OS_TARGET)/$(LCL_PLATFORM) ../designer ../debugger ../debugger/frames ../converter ../packager ../packager/frames ../packager/units/$(CPU_TARGET)-$(OS_TARGET) ../units/$(CPU_TARGET)-$(OS_TARGET)/$(LCL_PLATFORM) frames .
endif
ifeq ($(FULL_TARGET),x86_64-darwin)
override COMPILER_UNITDIR+=../lcl/units/$(CPU_TARGET)-$(OS_TARGET) ../lcl/units/$(CPU_TARGET)-$(OS_TARGET)/$(LCL_PLATFORM) ../components/codetools/units/$(CPU_TARGET)-$(OS_TARGET) ../components/lazutils/lib/$(CPU_TARGET)-$(OS_TARGET) ../components/synedit/units/$(CPU_TARGET)-$(OS_TARGET)/$(LCL_PLATFORM) ../components/lazcontrols/lib/$(CPU_TARGET)-$(OS_TARGET)/$(LCL_PLATFORM) ../components/custom ../ideintf/units/$(CPU_TARGET)-$(OS_TARGET)/$(LCL_PLATFORM) ../designer ../debugger ../debugger/frames ../converter ../packager ../packager/frames ../packager/units/$(CPU_TARGET)-$(OS_TARGET) ../units/$(CPU_TARGET)-$(OS_TARGET)/$(LCL_PLATFORM) frames .
endif
Expand Down Expand Up @@ -1445,6 +1460,9 @@ endif
ifeq ($(FULL_TARGET),x86_64-solaris)
override COMPILER_TARGETDIR+=..
endif
ifeq ($(FULL_TARGET),x86_64-openbsd)
override COMPILER_TARGETDIR+=..
endif
ifeq ($(FULL_TARGET),x86_64-darwin)
override COMPILER_TARGETDIR+=..
endif
Expand Down Expand Up @@ -1637,6 +1655,9 @@ endif
ifeq ($(FULL_TARGET),x86_64-solaris)
override COMPILER_UNITTARGETDIR+=../units/$(CPU_TARGET)-$(OS_TARGET)/$(LCL_PLATFORM)
endif
ifeq ($(FULL_TARGET),x86_64-openbsd)
override COMPILER_UNITTARGETDIR+=../units/$(CPU_TARGET)-$(OS_TARGET)/$(LCL_PLATFORM)
endif
ifeq ($(FULL_TARGET),x86_64-darwin)
override COMPILER_UNITTARGETDIR+=../units/$(CPU_TARGET)-$(OS_TARGET)/$(LCL_PLATFORM)
endif
Expand Down Expand Up @@ -2679,6 +2700,14 @@ REQUIRE_PACKAGES_HASH=1
REQUIRE_PACKAGES_FPMKUNIT=1
REQUIRE_PACKAGES_REGEXPR=1
endif
ifeq ($(FULL_TARGET),x86_64-openbsd)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_PASZLIB=1
REQUIRE_PACKAGES_FCL-PROCESS=1
REQUIRE_PACKAGES_HASH=1
REQUIRE_PACKAGES_FPMKUNIT=1
REQUIRE_PACKAGES_REGEXPR=1
endif
ifeq ($(FULL_TARGET),x86_64-darwin)
REQUIRE_PACKAGES_RTL=1
REQUIRE_PACKAGES_PASZLIB=1
Expand Down Expand Up @@ -3695,7 +3724,7 @@ ifeq ($(LAZARUS_OPT),)
else
$(MAKE) --assume-new=lazarus.pp lazarus$(EXEEXT) OPT='$(LAZARUS_OPT) $(OPT)'
endif
idepkg: $(COMPILER_UNITTARGETDIR)
idepkg: $(COMPILER_UNITTARGETDIR) revisioninc
$(MAKE) --assume-new=lazarus.pp lazarus$(EXEEXT) OPT='$(LAZARUS_OPT) $(OPT) @$(LAZARUS_IDE_CONFIG)'
bigide: $(COMPILER_UNITTARGETDIR) revisioninc
-$(DEL) $(COMPILER_UNITTARGETDIR)/pkgmanager$(PPUEXT)
Expand Down
2 changes: 1 addition & 1 deletion ide/Makefile.fpc
Expand Up @@ -155,7 +155,7 @@ else
endif

#-----------------------------------------------------------------------------
idepkg: $(COMPILER_UNITTARGETDIR)
idepkg: $(COMPILER_UNITTARGETDIR) revisioninc
$(MAKE) --assume-new=lazarus.pp lazarus$(EXEEXT) OPT='$(LAZARUS_OPT) $(OPT) @$(LAZARUS_IDE_CONFIG)'

#-----------------------------------------------------------------------------
Expand Down
26 changes: 25 additions & 1 deletion ide/buildlazdialog.pas
Expand Up @@ -252,6 +252,28 @@ function MakeLazarus(Profile: TBuildLazarusProfile;
FindCloseUTF8(FileInfo);
end;

procedure CheckRevisionInc;
var
RevisionIncFile: String;
sl: TStringList;
begin
RevisionIncFile:=AppendPathDelim(EnvironmentOptions.GetParsedLazarusDirectory)+'ide'+PathDelim+'revision.inc';
if not FileExistsUTF8(RevisionIncFile) then begin
debugln(['Note: revision.inc file missing: ',RevisionIncFile]);
sl:=TStringList.Create;
sl.Add('// Created by lazbuild');
sl.Add('const RevisionStr = '''+LazarusVersionStr+''';');
try
sl.SaveToFile(RevisionIncFile);
except
on E: Exception do begin
debugln(['Note: can not write ',RevisionIncFile,': ',E.Message]);
end;
end;
sl.Free;
end;
end;

var
Tool: TExternalToolOptions;
ExOptions: String;
Expand Down Expand Up @@ -368,8 +390,10 @@ function MakeLazarus(Profile: TBuildLazarusProfile;

if ExOptions<>'' then
Tool.EnvironmentOverrides.Values['OPT'] := ExOptions;
if not UpdateRevisionInc then
if not UpdateRevisionInc then begin
CheckRevisionInc;
Tool.EnvironmentOverrides.Values['USESVN2REVISIONINC'] := '0';
end;
Tool.CmdLineParams:=Tool.CmdLineParams+CmdLineParams;
// run
Result:=ExternalTools.Run(Tool,Macros,false);
Expand Down

0 comments on commit 2d8019a

Please sign in to comment.