Package: fpprofiler-cross
Version: 20110108
Revision: 4
Description: Profiler for the FreePascal cross compiler
Source: mirror:sourceforge:fink/fpprofiler-%v.tar.bz2
Source-Checksum: SHA256(2bb52d973c3b667e544f272ad0ac8198addd36e8e894d249711f2058f8acea1d)
Depends: <<
  fpprofiler,
                  fpc-cross-powerpc-linux  (>= 3.0.2),
  (%m = i386)     fpc-cross-x86-64-darwin  (>= 3.0.2),
  (%m = x86_64)   fpc-cross-i386-darwin    (>= 3.0.2),
  (%m != powerpc) fpc-cross-arm-gba        (>= 3.0.2),
  (%m != powerpc) fpc-cross-arm-linux      (>= 3.0.2),
  (%m != powerpc) fpc-cross-arm-wince      (>= 3.0.2),
  (%m != powerpc) fpc-cross-i386-freebsd   (>= 3.0.2),
  (%m != powerpc) fpc-cross-i386-go32v2    (>= 3.0.2),
  (%m != powerpc) fpc-cross-i386-linux     (>= 3.0.2),
  (%m != powerpc) fpc-cross-i386-win32     (>= 3.0.2),
  (%m != powerpc) fpc-cross-i386-wince     (>= 3.0.2),
  (%m != powerpc) fpc-cross-sparc-linux    (>= 3.0.2),
  (%m != powerpc) fpc-cross-x86-64-freebsd (>= 3.0.2),
  (%m != powerpc) fpc-cross-x86-64-linux   (>= 3.0.2),
  (%m != powerpc) fpc-cross-x86-64-win64   (>= 3.0.2)
<<
Recommends: graphviz
License: GPL

UseMaxBuildJobs: false

CompileScript: <<
#!/bin/sh -ev

# Yosemite fix
  if [ "$(uname -r | cut -d. -f1)" -ge 14 ]; then export MACOSX_DEPLOYMENT_TARGET=10.9 ; fi

  cd fpprof

  if [ "%m" = "i386" ]; then
    SYSTEMS='powerpc-darwin x86_64-darwin'
  fi  
  if [ "%m" = "x86_64" ]; then
    SYSTEMS='i386-darwin'
  fi  
  for system in $SYSTEMS
  do
    cpu_target=`echo $system |cut -d '-' -f 1`
    os_target=` echo $system |cut -d '-' -f 2`
    mkdir -p units/$system/fpprof
    fpc   -FEunits/$system/fpprof -P$cpu_target -T$os_target fpprof.pp
  done

  SYSTEMS='powerpc-linux'
  if [ "%m" != "powerpc" ]; then
    SYSTEMS=$SYSTEMS' arm-linux arm-wince'
    SYSTEMS=$SYSTEMS' i386-freebsd i386-go32v2 i386-linux i386-win32 i386-wince'
    SYSTEMS=$SYSTEMS' sparc-linux'
    SYSTEMS=$SYSTEMS' x86_64-freebsd x86_64-linux x86_64-win64'
  fi  
  for system in $SYSTEMS
  do
    cpu_target=`echo $system |cut -d '-' -f 1`
    os_target=` echo $system |cut -d '-' -f 2`
	if [ "$system" = "i386-go32v2" ]; then
	  system='go32v2'
	fi
    mkdir -p units/$system/fpprof
    fpc   -FEunits/$system/fpprof -P$cpu_target -T$os_target -XP$cpu_target-$os_target- fpprof.pp
  done

<<

InstallScript: <<
#!/bin/sh -ev
# Yosemite fix
  if [ "$(uname -r | cut -d. -f1)" -ge 14 ]; then export MACOSX_DEPLOYMENT_TARGET=10.9 ; fi

  FPC_VERSION=`fpc -iV`
  mkdir -p             %i/lib/fpc/$FPC_VERSION/units
  cp -r fpprof/units/* %i/lib/fpc/$FPC_VERSION/units
<<

DocFiles: docs/COPYING.GPL docs/develop.txt

DescDetail: <<
Compile your program by using fpp as a replacement of fpc. 
This creates a profile file (Default: fpprof.xml), 
from which fppview creates output. Output in the dot language 
can be converted to a graph with the program "dot" from the 
package "graphviz".

More details about options can be obtained with
  fpp -h
and
  fppview -h

Usage Example:

  fpp MyProgram.pp
  fppview --format=graphviz --stat=callgraph >MyProgram.dot
  dot -Tpng MyProgram.dot -o MyProgram.png
  open MyProgram.png

Please check also the home page: http://wiki.lazarus.freepascal.org/FPProfiler
<<

DescPort: <<
  Note: This package installs fpc units and needs to be updated
  with a new version of fpc.
  Crosscompilers on powerpc still have some problems, although all powerpc and
  arm targets (except arm-darwin) should work.
  arm-gba has no Dos unit.
<<

Homepage: http://wiki.lazarus.freepascal.org/FPProfiler
Maintainer: Karl-Michael Schindler <karl-michael.schindler@web.de>