Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 1999-05

Compiling Lazarus

5 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Cliff Baeseman

yes you are doing very well here is the next step...

You will have to compile GTK and the FCL before compiling Lazarus.... The FCL is equivelent to the Delphi TComponent and Above Classes....

The GTK is the Gimp Tool Kit which make up the Lazarus Component Library...

I am including the MakeFile.fpc place it in your /usr/lib/fpc/0.99.10 or 11 whichever you have....

You will then have to run Make on the GTK source tree...This will output a couple of object files and ppus place them in the linuxunits dir..

You can then compile lazarus using ppc386 lazarus ;)

If you run into anything else just yell..

I do not recommend using the makefile on lazarus I do not know of anybody who has made it work....

Cliff

Thomas E Payne wrote 14 lines
I am too embarassed to post just yet. On the original install, fpc did not automatically create the default ppc386.cfg. I had to feed samplecfg the two arguments it wanted before it would create the file. I followed directions to install the snapshot thinking this was the V11 you spoke of. I then went into /usr/local/lazarus and typed 'make'. It complained about makefile.fpc and two environment variables. Any ideas? TOM

#
# $Id: makefile.fpc,v 1.14 1999/04/08 10:16:17 peter Exp $ # Copyright (c) 1999 by the Free Pascal Development Team #
# Common makefile for Free Pascal
#
# See the file COPYING.FPC, included in this distribution, # for details about the copyright.
#
# This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #

##################################################################### # Force default settings
#####################################################################

# Latest release version
override RELEASEVER:=0.99.11

##################################################################### # Autodetect OS (Linux or Dos or Windows NT)
# define inlinux when running under linux
# define inWinNT when running under WinNT
#####################################################################

# We want only / in the path !
override PATH:=$(subst \,/,$(PATH))

# Search for PWD and determine also if we are under linux PWD=$(strip $(wildcard $(addsuffix /pwd.exe,$(subst ;, ,$(PATH))))) ifeq ($(PWD),)
PWD=$(strip $(wildcard $(addsuffix /pwd,$(subst :, ,$(PATH))))) ifeq ($(PWD),)
nopwd:
@echo You need the GNU pwd,cp,mv,rm,install utils to use this makefile! @echo Get ftp://tflily.fys.kuleuven.ac.be/pub/fpc/dist/gnuutils.zip @exit
else
inlinux=1
endif
else
PWD:=$(firstword $(PWD))
endif

# Detect NT - NT sets OS to Windows_NT
ifndef inlinux
ifeq ($(OS),Windows_NT)
inWinNT=1
endif
endif

##################################################################### # Check for FPCDIR environment
#####################################################################

ifndef FPCDIR
nofpcdir:
@echo You need to set the FPCDIR environment variable to use @echo this Makefile.
@echo Example: SET FPCDIR=/pp
@exit
endif

##################################################################### # Targets
#####################################################################

# Target OS
ifndef OS_TARGET
ifdef inlinux
OS_TARGET=linux
else
ifdef inWinNT
OS_TARGET=win32
else
OS_TARGET=go32v2
endif
endif
endif

# Source OS
ifndef OS_SOURCE
ifdef inlinux
OS_SOURCE=linux
else
ifndef inWinNT
OS_SOURCE=win32
else
OS_SOURCE=go32v2
endif
endif
endif

# CPU
ifndef CPU
CPU=i386
endif

# Options
ifndef OPT
OPT=
endif

# What compiler to use ?
ifndef PP
PP=ppc386
endif

# assembler, redefine it if cross compiling
ifndef AS
AS=as
endif

# linker, but probably not used
ifndef LD
LD=ld
endif

# Release ? Then force OPT and don't use extra opts via commandline ifdef RELEASE
override OPT:=-Xs -OG2p2 -n
endif

# Verbose settings (warning,note,info)
ifdef VERBOSE
override OPT+=-vwni
endif

##################################################################### # Shell commands
#####################################################################

# To copy pograms
ifndef COPY
COPY=cp -fp
endif

# To move pograms
ifndef MOVE
MOVE=mv -f
endif

# Check delete program
ifndef DEL
DEL=rm -f
endif

# Check deltree program
ifndef DELTREE
DELTREE=rm -rf
endif

# To install files
ifndef INSTALL
ifdef inlinux
INSTALL=install -m 644
else
INSTALL=$(COPY)
# ginstall has the strange thing to stubify all .o files ! #INSTALL=ginstall -m 644
endif
endif

# To install programs
ifndef INSTALLEXE
ifdef inlinux
INSTALLEXE=install -m 755
else
INSTALLEXE=$(COPY)
# ginstall has the strange thing to stubify all .o files ! #INSTALLEXE=ginstall -m 755
endif
endif

# To make a directory.
ifndef MKDIR
ifdef inlinux
MKDIR=install -m 755 -d
else
MKDIR=ginstall -m 755 -d
endif
endif

##################################################################### # Default Tools
#####################################################################

# ppas.bat / ppas.sh
ifdef inlinux
PPAS=ppas.sh
else
PPAS=ppas.bat
endif

# The extension of executables
ifdef inlinux
EXEEXT=
else
EXEEXT=.exe
endif

# The path which is search separated by spaces
ifdef inlinux
SEARCHPATH=$(subst :, ,$(PATH))
else
SEARCHPATH=$(subst ;, ,$(PATH))
endif

# ldconfig to rebuild .so cache
ifdef inlinux
LDCONFIG=ldconfig
else
LDCONFIG=
endif

# Where is the ppumove program ?
ifndef PPUMOVE
PPUMOVE=ppumove
endif

# diff
ifndef DIFF
DIFF=$(strip $(wildcard $(addsuffix /diff$(EXEEXT),$(SEARCHPATH)))) ifeq ($(DIFF),)
DIFF=
else
export DIFF:=$(firstword $(DIFF))
endif
endif

# cmp
ifndef CMP
CMP=$(strip $(wildcard $(addsuffix /cmp$(EXEEXT),$(SEARCHPATH)))) ifeq ($(CMP),)
CMP=
else
export CMP:=$(firstword $(CMP))
endif
endif

# echo
ifndef ECHO
ECHO=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH)))) ifeq ($(ECHO),)
ECHO=echo
else
export ECHO:=$(firstword $(ECHO))
endif
endif

# gdate/date
ifndef DATE
DATE=$(strip $(wildcard $(addsuffix /date$(EXEEXT),$(SEARCHPATH)))) ifeq ($(DATE),)
DATE=$(strip $(wildcard $(addsuffix /gdate$(EXEEXT),$(SEACHPATH)))) ifeq ($(DATE),)
DATE=
else
export DATE:=$(firstword $(DATE))
endif
else
export DATE:=$(firstword $(DATE))
endif
endif

# Sed
ifndef SED
SED=$(strip $(wildcard $(addsuffix /sed$(EXEEXT),$(SEARCHPATH)))) ifeq ($(SED),)
SED=
else
export SED:=$(firstword $(SED))
endif
endif

# Look if UPX is found for go32v2 and win32
ifndef UPX
ifeq ($(OS_TARGET),go32v2)
UPX=1
endif
ifeq ($(OS_TARGET),win32)
UPX=1
endif
ifdef UPX
UPX=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH)))) ifeq ($(UPX),)
UPX=
else
export UPX:=$(firstword $(UPX))
endif
else
UPX=
endif
endif

# ZipProg, you can't use Zip as the var name (PFV) ifndef ZIPPROGNEW
ZIPPROG=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH)))) ifeq ($(ZIPPROG),)
ZIPPROG=
else
export ZIPPROG:=$(firstword $(ZIPPROG)) -D9 -r
endif
endif

ifndef ZIPEXT
ZIPEXT=.zip
endif

##################################################################### # Default Directories
#####################################################################

# Base dir
ifdef PWD
BASEDIR:=$(shell $(PWD))
else
BASEDIR=.
endif

# set the directory to the rtl base
ifndef RTLDIR
ifdef RTL
RTLDIR:=$(RTL)/$(OS_TARGET)
else
RTLDIR:=$(FPCDIR)/rtl/$(OS_TARGET)
endif
endif

# specify where units are.
ifndef UNITDIR
ifdef UNITS
UNITDIR=$(UNITS)/$(OS_TARGET)
else
UNITDIR=$(FPCDIR)/units/$(OS_TARGET)
endif
endif

# set the prefix directory where to install everything ifndef PREFIXINSTALLDIR
ifdef inlinux
PREFIXINSTALLDIR=/usr
else
PREFIXINSTALLDIR=/pp
endif
endif

# set the base directory where to install everything ifndef BASEINSTALLDIR
ifdef inlinux
BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(RELEASEVER) else
BASEINSTALLDIR=$(PREFIXINSTALLDIR)
endif
endif

##################################################################### # Install Directories based on BASEINSTALLDIR
#####################################################################

# Linux binary really goes to baseinstalldir
ifndef LIBINSTALLDIR
ifdef inlinux
LIBINSTALLDIR=$(BASEINSTALLDIR)
else
LIBINSTALLDIR=$(BASEINSTALLDIR)/lib
endif
endif

# set the directory where to install the binaries
ifndef BININSTALLDIR
ifdef inlinux
BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
else
BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
endif
endif

# Where the .msg files will be stored
ifndef MSGINSTALLDIR
ifdef inlinux
MSGINSTALLDIR=$(BASEINSTALLDIR)/msg
else
MSGINSTALLDIR=$(BININSTALLDIR)
endif
endif

# Where the doc files will be stored
ifndef DOCINSTALLDIR
ifdef inlinux
DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc/$(RELEASEVER) else
DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
endif
endif

########################
# Unit Directories
########################

# this can be set to 'rtl' when the RTL units are installed ifndef UNITPREFIX
UNITPREFIX=units
endif

# set the directory where to install the units.
ifndef UNITINSTALLDIR
ifdef inlinux
UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)
else
UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET) endif
endif

# set the directory where to install the units.
ifndef STATIC_UNITINSTALLDIR
STATIC_UNITINSTALLDIR=$(UNITINSTALLDIR)/static
endif

# set the directory where to install the units.
ifndef SHARED_UNITINSTALLDIR
SHARED_UNITINSTALLDIR=$(UNITINSTALLDIR)/shared
endif

# set the directory where to install the libs (must exist) ifndef STATIC_LIBINSTALLDIR
STATIC_LIBINSTALLDIR=$(STATIC_UNITINSTALLDIR)
endif

# set the directory where to install the libs (must exist) ifndef SHARED_LIBINSTALLDIR
ifdef inlinux
SHARED_LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
else
SHARED_LIBINSTALLDIR=$(SHARED_UNITINSTALLDIR)
endif
endif

##################################################################### # Compiler Command Line
#####################################################################

# Load commandline OPTDEF and add CPU define
override PPOPTDEF:=$(OPTDEF) -d$(CPU)
# Load commandline OPT and add target and unit dir to be sure
override PPOPT:=-T$(OS_TARGET) $(NEEDOPT) $(OPT)

# RTL first and then Unit dir (a unit can override RTLunit) ifdef RTLDIR
override PPOPT+=$(addprefix -Fu,$(RTLDIR))
endif
ifdef UNITDIR
override PPOPT+=$(addprefix -Fu,$(UNITDIR))
endif
ifdef NEEDUNITDIR
override PPOPT+=$(addprefix -Fu,$(NEEDUNITDIR))
endif

# Library dirs
ifdef LIBDIR
override PPOPT+=$(addprefix -Fl,$(LIBDIR))
endif
ifdef NEEDLIBDIR
override PPOPT+=$(addprefix -Fl,$(NEEDLIBDIR))
endif

# Object dirs
ifdef OBJDIR
override PPOPT+=$(addprefix -Fo,$(OBJDIR))
endif
ifdef NEEDOBJDIR
override PPOPT+=$(addprefix -Fo,$(NEEDOBJDIR))
endif

# Add include dirs INC and PROCINC and OSINC
ifdef INC
override PPOPT+=$(addprefix -Fi,$(INC))
endif
ifdef PROCINC
override PPOPT+=$(addprefix -Fi,$(PROCINC))
endif
ifdef OSINC
override PPOPT+=$(addprefix -Fi,$(OSINC))
endif

# Target dirs
ifdef TARGETDIR
override PPOPT+=-FE$(TARGETDIR)
endif
ifdef UNITTARGETDIR
override PPOPT+=-FU$(UNITTARGETDIR)
endif

# Smartlinking
ifeq ($(SMARTLINK),YES)
ifeq ($(LIBTYPE),shared)
override SMARTLINK=NO
else
override PPOPT+=-Cx
ifneq ($(LIBNAME),)
override PPOPT+=-o$(LIBNAME)
endif
endif
endif

# Add library type, for static libraries smartlinking is automatic used ifeq ($(LIBTYPE),shared)
override PPOPT+=-CD
ifneq ($(LIBNAME),)
override PPOPT+=-o$(LIBNAME)
endif
else
ifeq ($(LIBTYPE),static)
override PPOPT+=-CS
ifneq ($(LIBNAME),)
override PPOPT+=-o$(LIBNAME)
endif
endif
endif

# Add defines from PPOPTDEF to PPOPT
override PPOPT:=$(PPOPT) $(PPOPTDEF)

# Was a config file specified ?
ifdef CFGFILE
override PPOPT:=$(PPOPT) @$(CFGFILE)
endif

override COMPILER=$(PP) $(PPOPT)

##################################################################### # Default extensions
#####################################################################

# Default needed extensions (Go32v2,Linux)
LOADEREXT=.as
PPLEXT=.ppl
PPUEXT=.ppu
OEXT=.o
ASMEXT=.s
SMARTEXT=.sl
STATICLIBEXT=.a
SHAREDLIBEXT=.so
PACKAGESUFFIX=

# Go32v1
ifeq ($(OS_TARGET),go32v1)
PPUEXT=.pp1
OEXT=.o1
ASMEXT=.s1
SMARTEXT=.sl1
STATICLIBEXT=.a1
SHAREDLIBEXT=.so1
PACKAGESUFFIX=v1
endif

# Go32v2
ifeq ($(OS_TARGET),go32v2)
PACKAGESUFFIX=go32
endif

# Linux
ifeq ($(OS_TARGET),linux)
PACKAGESUFFIX=linux
endif

# Win32
ifeq ($(OS_TARGET),win32)
PPUEXT=.ppw
OEXT=.ow
ASMEXT=.sw
SMARTEXT=.slw
STATICLIBEXT=.aw
SHAREDLIBEXT=.dll
PACKAGESUFFIX=win32
endif

# OS/2
ifeq ($(OS_TARGET),os2)
PPUEXT=.ppo
ASMEXT=.so2
OEXT=.o2
SMARTEXT=.so
STATICLIBEXT=.ao
SHAREDLIBEXT=.dll
PACKAGESUFFIX=os2
endif

# determine libary extension.
ifeq ($(LIBTYPE),static)
LIBEXT=$(STATICLIBEXT)
else
LIBEXT=$(SHAREDLIBEXT)
endif

# library prefix
LIBPREFIX=lib
ifeq ($(OS_TARGET),go32v2)
LIBPREFIX=
endif
ifeq ($(OS_TARGET),go32v1)
LIBPREFIX=
endif

# determine which .pas extension is used
ifndef PASEXT
ifdef EXEOBJECTS
override TESTPAS:=$(strip $(wildcard $(addsuffix .pas,$(firstword $(EXEOBJECTS))))) else
override TESTPAS:=$(strip $(wildcard $(addsuffix .pas,$(firstword $(UNITOBJECTS))))) endif
ifeq ($(TESTPAS),)
PASEXT=.pp
else
PASEXT=.pas
endif
endif

# also call ppas if with command option -s
ifeq (,$(findstring -s ,$(COMPILER)))
EXECPPAS=
else
(PPAS)
endif

ifdef DATE
DATESTR=$(shell $(DATE) +%y%m%d)
else
DATESTR=
endif

##################################################################### # Export commandline values, so nesting use the same values #####################################################################

export FPCDIR FPCMAKE
export RELEASEVER OS_SOURCE OS_TARGET OPT OPTDEF CPU PP RELEASE VERBOSE export SMARTLINK LIBTYPE LIBNAME
export BASEINSTALLDIR PACKAGESUFFIX

##################################################################### # General compile rules
#####################################################################

# Create Filenames
LOADEROFILES=$(addsuffix $(OEXT),$(LOADEROBJECTS)) EXEFILES=$(addsuffix $(EXEEXT),$(EXEOBJECTS))
EXEOFILES=$(addsuffix $(OEXT),$(EXEOBJECTS))
UNITFILES=$(addsuffix $(PPUEXT),$(UNITOBJECTS))
UNITOFILES=$(addsuffix $(OEXT),$(UNITOBJECTS))

.PHONY : fpc_all fpc_units fpc_loaders fpc_exes \
fpc_staticlib fpc_sharedlib \
fpc_clean fpc_libsclean fpc_cleanall \
fpc_install fpc_staticlibinstall fpc_sharedlibinstall fpc_libinstall \ fpc_info fpc_cfginfo fpc_objectinfo fpc_installinfo fpc_filesinfo

.SUFFIXES : $(EXEEXT) $(PPUEXT) $(PASEXT) $(OEXT)

##################################################################### # Default
#####################################################################

ifdef DEFAULTUNITS
fpc_all: fpc_loaders fpc_units
else
fpc_all: fpc_loaders fpc_units fpc_exes
endif

fpc_loaders: $(LOADEROFILES)

fpc_units: $(UNITFILES)

fpc_exes: $(EXEFILES)

# General compile rules
%$(PPUEXT): %$(PASEXT)
$(COMPILER) $< $(REDIR)
$(EXECPASS)

%$(EXEEXT): %$(PASEXT)
$(COMPILER) $< $(REDIR)
$(EXECPASS)

%$(OEXT): %$(LOADEREXT)
$(AS) -o $*$(OEXT) $<

##################################################################### # Library
#####################################################################

fpc_staticlib:
$(MAKE) libsclean
$(MAKE) all SMARTLINK=YES LIBTYPE=static

fpc_sharedlib:
ifdef inlinux
$(MAKE) libsclean
$(MAKE) all LIBTYPE=shared
else
@$(ECHO) Shared Libraries not supported
endif

##################################################################### # Install rules
#####################################################################

fpc_install : all
ifndef DEFAULTUNITS
ifdef EXEOBJECTS
$(MKDIR) $(BININSTALLDIR)
# Compress the exes if upx is defined
ifdef UPX
-$(UPX) $(EXEFILES)
endif
$(INSTALLEXE) $(EXEFILES) $(BININSTALLDIR)
endif
endif
ifdef LOADEROBJECTS
$(MKDIR) $(UNITINSTALLDIR)
$(INSTALL) $(LOADEROFILES) $(UNITINSTALLDIR)
endif
ifdef UNITOBJECTS
$(MKDIR) $(UNITINSTALLDIR)
$(INSTALL) $(UNITFILES) $(UNITINSTALLDIR)
ifeq ($(SMARTLINK),YES)
$(INSTALL) $(LIBPREFIX)$(LIBNAME)$(LIBEXT) $(UNITINSTALLDIR) else
-$(INSTALL) $(UNITOFILES) $(UNITINSTALLDIR)
endif
endif

# Target for the sharedlib install which is not avail for all targets SHAREDINSTALL=sharedlibinstall
ifeq ($(OS_TARGET),go32v1)
SHAREDINSTALL=
endif
ifeq ($(OS_TARGET),go32v2)
SHAREDINSTALL=
endif

fpc_staticlibinstall: staticlib
$(MKDIR) $(STATIC_UNITINSTALLDIR)
$(INSTALL) $(UNITFILES) $(STATIC_UNITINSTALLDIR)
$(MKDIR) $(STATIC_LIBINSTALLDIR)
$(INSTALLEXE) *$(STATICLIBEXT) $(STATIC_LIBINSTALLDIR)

fpc_sharedlibinstall: sharedlib
$(MKDIR) $(SHARED_UNITINSTALLDIR)
$(INSTALL) $(UNITFILES) $(SHARED_UNITINSTALLDIR)
$(MKDIR) $(SHARED_LIBINSTALLDIR)
$(INSTALLEXE) *$(SHAREDLIBEXT) $(SHARED_LIBINSTALLDIR)

fpc_libinstall: staticlibinstall $(SHAREDINSTALL)

##################################################################### # Zip
#####################################################################

# Temporary path to pack a file
ifndef PACKDIR
PACKDIR=pack_tmp
endif

# Test dir if none specified
ifndef PACKAGEDIR
PACKAGEDIR=$(BASEDIR)
endif

# Add .zip/.tar.gz extension
ifdef ZIPNAME
ifndef inlinux
override ZIPNAME:=$(ZIPNAME)$(ZIPEXT)
endif
endif

# Default target which is call before zipping
ifndef ZIPTARGET
ZIPTARGET=install
endif

# Note: This will not remove the zipfile first
fpc_zipinstalladd:
ifndef ZIPNAME
@$(ECHO) Please specify ZIPNAME!
@exit
else
$(MAKE) $(ZIPTARGET) BASEINSTALLDIR=$(PACKDIR)
ifdef inlinux
gzip -d $(PACKAGEDIR)/$(ZIPNAME).tar.gz
cd $(PACKDIR) ; tar rv --file $(PACKAGEDIR)/$(ZIPNAME).tar * ; cd $(BASEDIR) gzip $(PACKAGEDIR)/$(ZIPNAME).tar
else
cd $(PACKDIR) ; $(ZIPPROG) $(PACKAGEDIR)/$(ZIPNAME) * ; cd $(BASEDIR) endif
$(DELTREE) $(PACKDIR)
endif

# First remove the zip and then install
fpc_zipinstall:
ifndef ZIPNAME
@$(ECHO) Please specify ZIPNAME!
@exit
else
$(DEL) $(PACKAGEDIR)/$(ZIPNAME)
$(MAKE) $(ZIPTARGET) BASEINSTALLDIR=$(PACKDIR)
ifdef inlinux
cd $(PACKDIR) ; tar cvz --file $(PACKAGEDIR)/$(ZIPNAME).tar.gz * ; cd $(BASEDIR) else
cd $(PACKDIR) ; $(ZIPPROG) $(PACKAGEDIR)/$(ZIPNAME) * ; cd $(BASEDIR) endif
$(DELTREE) $(PACKDIR)
endif

##################################################################### # Clean rules
#####################################################################

fpc_clean:
-$(DEL) $(UNITOFILES) $(UNITFILES) $(PPAS) link.res log ifeq ($(SMARTLINK),YES)
-$(DELTREE) *$(SMARTEXT)
endif
ifdef EXEOBJECTS
-$(DEL) $(EXEFILES) $(EXEOFILES)
endif
ifdef LOADEROBJECTS
-$(DEL) $(LOADEROFILES)
endif

fpc_libsclean: clean
-$(DEL) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)

fpc_cleanall:
ifdef EXEOBJECTS
-$(DEL) $(EXEFILES)
endif
-$(DEL) *$(OEXT) *$(PPUEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT) -$(DELTREE) *$(SMARTEXT)

##################################################################### # Depend rules
#####################################################################

fpc_depend:
makedep $(UNITOBJECTS)

##################################################################### # Info rules
#####################################################################

fpc_info: fpc_cfginfo fpc_objectinfo fpc_toolsinfo fpc_installinfo

fpc_cfginfo:
@$(ECHO)
@$(ECHO) == Configuration info ==
@$(ECHO)
@$(ECHO) FPCDir.... $(FPCDIR)
@$(ECHO) FPCMake... $(FPCMAKE)
@$(ECHO)
@$(ECHO) Source.... $(OS_SOURCE)
@$(ECHO) Target.... $(OS_TARGET)
@$(ECHO) Basedir... $(BASEDIR)
@$(ECHO)

fpc_toolsinfo:
@$(ECHO)
@$(ECHO) == Tools info ==
@$(ECHO)
@$(ECHO) Pwd....... $(PWD)
@$(ECHO) Echo...... $(ECHO)
ifdef SED
@$(ECHO) Sed....... $(SED)
endif
ifdef DATE
@$(ECHO) Date...... $(DATE)
endif
ifdef DIFF
@$(ECHO) Diff...... $(DIFF)
endif
ifdef CMP
@$(ECHO) Cmp....... $(CMP)
endif
ifdef UPX
@$(ECHO) Upx....... $(UPX)
endif
ifdef UPX
@$(ECHO) Zip....... $(ZIPPROG)
endif
@$(ECHO)

fpc_objectinfo:
@$(ECHO)
@$(ECHO) == Object info ==
@$(ECHO)
@$(ECHO) LoaderObjects. $(LOADEROBJECTS)
@$(ECHO) UnitObjects... $(UNITOBJECTS)
@$(ECHO) ExeObjects.... $(EXEOBJECTS)
@$(ECHO)

fpc_installinfo:
@$(ECHO)
@$(ECHO) == Install info ==
@$(ECHO)
@$(ECHO) DateStr.............. $(DATESTR)
@$(ECHO) PackageSuffix........ $(PACKAGESUFFIX)
@$(ECHO)
@$(ECHO) BaseInstallDir....... $(BASEINSTALLDIR)
@$(ECHO) BinInstallDir........ $(BININSTALLDIR)
@$(ECHO) UnitInstallDir....... $(UNITINSTALLDIR)
@$(ECHO) StaticUnitInstallDir. $(STATIC_UNITINSTALLDIR) @$(ECHO) SharedUnitInstallDir. $(SHARED_UNITINSTALLDIR) @$(ECHO) LibInstallDir........ $(LIBINSTALLDIR)
@$(ECHO) StaticLibInstallDir.. $(STATIC_LIBINSTALLDIR) @$(ECHO) SharedLibInstallDir.. $(SHARED_LIBINSTALLDIR) @$(ECHO) MsgInstallDir........ $(MSGINSTALLDIR)
@$(ECHO) DocInstallDir........ $(DOCINSTALLDIR)
@$(ECHO)

# try to get the files in the currentdir
PASFILES:=$(wildcard *.pas)
PPFILES:=$(wildcard *.pp)
INCFILES:=$(wildcard *.inc)
MSGFILES:=$(wildcard *.msg)
ASFILES:=$(wildcard *.as)

fpc_filesinfo:
@$(ECHO)
@$(ECHO) == Files info ==
@$(ECHO)
ifdef PASFILES
@$(ECHO) Pas files are $(PASFILES)
endif
ifdef PPFILES
@$(ECHO) PP files are $(PPFILES)
endif
ifdef INCFILES
@$(ECHO) Inc files are $(INCFILES)
endif
ifdef MSGFILES
@$(ECHO) Msg files are $(MSGFILES)
endif
ifdef ASFILES
@$(ECHO) As files are $(ASFILES)
endif

#
# $Log: makefile.fpc,v $
# Revision 1.14 1999/04/08 10:16:17 peter
# * zipinstall for linux with .tar.gz
#
# Revision 1.13 1999/04/01 22:52:28 peter
# * don't override pasext if set
#
# Revision 1.12 1999/03/29 16:04:58 peter
# * place -T as the first parameter on the commandline so a OPT=-A can # overwrite it
#
# Revision 1.11 1999/03/16 00:46:55 peter
# * makefile.fpc targets start with fpc_
# * small updates for install scripts
#
# Revision 1.10 1999/03/12 21:01:30 michael
# + Changed clean and libsclean to fpc_target
#
# Revision 1.9 1999/03/11 17:54:00 peter
# * better check for makefile.fpc
# * check if cmp exists
#
# Revision 1.8 1999/03/09 01:35:47 peter
# * makefile.fpc updates and defaultfpcdir var
#
#

Reply by email

Michael A. Hess
Cliff Baeseman wrote 5 lines
I am working a major revamping of some of the lazarus code right now. Hey got a question for you ? Do you have a copy of the sybil classes? I need to see exactly how TApplication is put together...

Yeah I do. The TApplication is in the form.pas file do you want that one?

Show quoted text 5 lines
How does a normal delphi app go about firing up? I think the project unit creates TApplication and passes the forms to be created to it and then calls run or something... In lazarus I wish to load the forms to a list in TAppplicaiton but how do I actually implement this "cleanly".

Here is a simple project file which is for the fpide help system. You tell it which units (aka forms) it needs to use.

First call Application.Initialize is not really used in Delphi and could be ignored but you might want to use it as indicated below.

Application.CreateForm of course just calls the .Create for the TForm being passed to it and depending on which one is first in line establishes it as the main form that controls termination and whether it is visible or not.

Application.Run is just a repeat until loop that keeps calling HandleMessage until it sees Terminated set true.

++++++++++++++ Sample ++++++++++++++++++++

program fpidehelp;

uses
Forms,
help in 'help.pas' {BrowserForm},

  IDKSMdlg in 'IDKSMdlg.pas' {IDKSMDialog};
{$R *.RES}
begin
  Application.Initialize;
  Application.CreateForm(TBrowserForm, BrowserForm);
  Application.CreateForm(TIDKSMDialog, IDKSMDialog);
  Application.Run;
end.

++++++++++++++++++++++++++++++++++++++++++++

in app.run I will start the gtk engine and load the forms then pass control to GTK main

I would be consistent with Delphi and have the project file actually load the forms. I would suggest you turn on the gtk engine in TApplication.Initialize. This again separates the graphics API from the application. If you want to use a different engine you would just have the Initalization routine point to a different engine to start.

in app.halt I will just free the forms and give the kill signal to gtk...

Actually you shouldn't need to call this. You will set the Terminate variable to true which will stop the repeat loop in .Run. This will make the application drop out of the program since the .Run call is followed by "end.".

To get it to clean things up you use a finalize section in the controls.pas unit that will call the clean up routines for the application. This means no matter how the program is stopped the finalization section should be called to clean up memory and what not.

In fact this is how Application gets created in the first place. You create the Application object by call TApplication.Create in the initialization section of the forms.pas unit.

BTW can you pass me your make file and I will include it in the next upload..

It is attached. :-)

I really didn't change much from what Peter submitted. I just added the ifdef for XLIBDIR and GTKLIBDIR.

==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com # # $Id: Makefile,v 1.1 1999/04/29 15:52:22 peter Exp $ # Copyright (c) 1998 by the Free Pascal Development Team # # Makefile for Lazarus # # See the file COPYING.FPC, included in this distribution, # for details about the copyright. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # ##################################################################### # Defaults ##################################################################### # Default place of the makefile.fpc DEFAULTFPCDIR=.. # Default unit dirs NEEDUNITDIR=../fcl/$(OS_TARGET) ../gtk # Where need we to place the executables/ppu/objects TARGETDIR=. # As default make only the units #DEFAULTUNITS=1 # Linux only: # Where are the X11 libraries ? XLIBDIR = /usr/X11/lib # Where are the GTK libraries (if different from the X11 dir) GTKLIBDIR = /usr/local/lib # add GCC directory to list of needed dirs. NEEDGCCLIB=YES ##################################################################### # Real targets ##################################################################### UNITOBJECTS= EXEOBJECTS=lazarus ifdef XLIBDIR override NEEDLIBDIR := $(NEEDLIBDIR) $(XLIBDIR) endif ifdef GTKLIBDIR override NEEDLIBDIR := $(NEEDLIBDIR) $(GTKLIBDIR) endif ##################################################################### # Common targets ##################################################################### .PHONY: all clean install info \ staticlib sharedlib libsclean \ staticinstall sharedinstall libinstall \ all: testfpcmake fpc_all clean: testfpcmake fpc_cleanall install: testfpcmake fpc_install info: testfpcmake fpc_info staticlib: testfpcmake fpc_staticlib sharedlib: testfpcmake fpc_sharedlib libsclean: testfpcmake fpc_libsclean staticinstall: testfpcmake fpc_staticinstall sharedinstall: testfpcmake fpc_sharedinstall libinstall: testfpcmake fpc_libinstall ##################################################################### # Include default makefile ##################################################################### # test if FPCMAKE is still valid ifdef FPCMAKE ifeq ($(strip $(wildcard $(FPCMAKE))),) FPCDIR= FPCMAKE= endif endif ifndef FPCDIR ifdef DEFAULTFPCDIR FPCDIR=$(DEFAULTFPCDIR) endif endif ifndef FPCMAKE ifdef FPCDIR FPCMAKE=$(FPCDIR)/makefile.fpc else FPCMAKE=makefile.fpc endif endif override FPCMAKE:=$(strip $(wildcard $(FPCMAKE))) ifeq ($(FPCMAKE),) testfpcmake: @echo makefile.fpc not found! @echo Check the FPCMAKE and FPCDIR environment variables. @exit else include $(FPCMAKE) testfpcmake: endif ##################################################################### # Dependencies ##################################################################### lazarus$(EXEEXT): $(wildcard *$(PASEXT)) # # $Log: Makefile,v $ # Revision 1.1 1999/04/29 15:52:22 peter # + init # #

Reply by email

Michael A. Hess
Cliff Baeseman wrote
I do not recommend using the makefile on lazarus I do not know of anybody who has made it work....

What do you mean Cliff? That is the only way I have ever compile lazarus. It works just fine for me. The only problem I have is the gtk 1.0-1.2 issue which I tweek the ppas.sh to get around.

As long as you add the patch to the lazarus makefile that I indicated it should work correctly if you have the gtk 1.0.x libs installed. :-)

==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com

Reply by email

Michael Van Canneyt
to Cliff Baeseman: I am working a major revamping of some of the lazarus code right now. Hey got a question…
Cliff Baeseman wrote 12 lines
I am working a major revamping of some of the lazarus code right now. Hey got a question for you ? Do you have a copy of the sybil classes? I need to see exactly how TApplication is put together... It has been a little while since I really looked at the Delphi implementation. How does a normal delphi app go about firing up? I think the project unit creates TApplication and passes the forms to be created to it and then calls run or something... In lazarus I wish to load the forms to a list in TAppplicaiton but how do I actually implement this "cleanly".
Easy,
  TApplication.Addform(Var,type);      // Error if forms already created. see flag
  TApplication.Addform(Var,type);
  TApplication.AddMainForm (Var,type);
  TApplication.CreateForms;            // Sets a flag. Add no longer allowed.
  Tapplication.Run;

This has the advantage that you could implement

Procedure TApplication.CreateForm (Name : String; Var Form : TForm);

So you can recreate a particular form by name whenever you want.

Delphi must also create the pointers somehow to the internal var FormName..?

Why is that needed ?

Show quoted text 6 lines
in app.run I will start the gtk engine and load the forms then pass control to GTK main in app.halt I will just free the forms and give the kill signal to gtk...

Seems like a reasonal approach.

Michael.

Reply by email

Cliff Baeseman

I am working a major revamping of some of the lazarus code right now.

Hey got a question for you ? Do you have a copy of the sybil classes? I need to see exactly how TApplication is put together...

It has been a little while since I really looked at the Delphi implementation.

How does a normal delphi app go about firing up? I think the project unit creates TApplication and passes the forms to be created to it and then calls run or something... In lazarus I wish to load the forms to a list in TAppplicaiton but how do I actually implement this "cleanly".

Delphi must also create the pointers somehow to the internal var FormName..?

in app.run I will start the gtk engine and load the forms then pass control to GTK main

in app.halt I will just free the forms and give the kill signal to gtk...

BTW can you pass me your make file and I will include it in the next upload..

Thanx
Cliff

Michael A. Hess wrote 22 lines
Cliff Baeseman wrote: > > I do not recommend using the makefile on lazarus I do not know of > anybody who has made it work.... What do you mean Cliff? That is the only way I have ever compile lazarus. It works just fine for me. The only problem I have is the gtk 1.0-1.2 issue which I tweek the ppas.sh to get around. As long as you add the patch to the lazarus makefile that I indicated it should work correctly if you have the gtk 1.0.x libs installed. :-) -- ==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

Reply by email