mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-13 21:39:39 +02:00
fixed compilation, started fpc_crosswin32 rpm
git-svn-id: trunk@7720 -
This commit is contained in:
parent
68d9383057
commit
7b002e587b
2
.gitattributes
vendored
2
.gitattributes
vendored
@ -1965,6 +1965,7 @@ tools/install/create_lazarus_export_tgz.sh -text svneol=native#application/x-sh
|
||||
tools/install/create_lazarus_rpm.sh -text svneol=native#application/x-sh
|
||||
tools/install/create_lazarus_snapshot_rpm.sh svneol=native#text/plain
|
||||
tools/install/create_lazarus_tgz_from_local_dir.sh -text svneol=native#application/x-sh
|
||||
tools/install/cross_unix/build_linux_cross_win32_rpm.sh svneol=native#text/plain
|
||||
tools/install/cross_unix/update_cross_fpc.sh svneol=native#text/plain
|
||||
tools/install/cvsexportlocal.pas svneol=native#text/pascal
|
||||
tools/install/do_nothing.sh -text svneol=native#application/x-sh
|
||||
@ -1974,6 +1975,7 @@ tools/install/get_lazarus_version.sh -text svneol=native#application/x-sh
|
||||
tools/install/macosx/fpc_installer_info.zip -text svneol=unset#application/zip
|
||||
tools/install/replace_in_files.pl -text svneol=native#application/x-perl
|
||||
tools/install/rpm/fpc.spec.template svneol=native#text/plain
|
||||
tools/install/rpm/fpc_crosswin32.spec.template svneol=native#text/plain
|
||||
tools/install/rpm/lazarus.spec.template svneol=native#text/plain
|
||||
tools/install/setup.sh -text svneol=native#application/x-sh
|
||||
tools/install/smart_strip.sh -text svneol=native#application/x-sh
|
||||
|
@ -76,7 +76,7 @@ end;
|
||||
---------------------------------------------------------------------------}
|
||||
procedure SetPrimaryConfigPath(const NewValue: String);
|
||||
begin
|
||||
debugln('SetPrimaryConfigPath NewValue="',NewValue,'" -> "',ExpandFileName(NewValue),'"');
|
||||
//writeln('SetPrimaryConfigPath NewValue="',NewValue,'" -> "',ExpandFileName(NewValue),'"');
|
||||
PrimaryConfigPath:=ExpandFileName(NewValue);
|
||||
end;
|
||||
|
||||
|
@ -161,7 +161,7 @@ else
|
||||
cd -
|
||||
rpmbuild --nodeps -ba $SpecFile
|
||||
|
||||
echo "The new rpms can be found in /usr/src/redhat/RPMS/i386/"
|
||||
echo "The new rpm can be found in /usr/src/redhat/RPMS/i386/"
|
||||
fi
|
||||
|
||||
# end.
|
||||
|
127
tools/install/cross_unix/build_linux_cross_win32_rpm.sh
Executable file
127
tools/install/cross_unix/build_linux_cross_win32_rpm.sh
Executable file
@ -0,0 +1,127 @@
|
||||
#!/usr/bin/env bash
|
||||
# Author: Mattias Gaertner
|
||||
# License: LGPL
|
||||
# Abstract: Download, compile binutils and FPC
|
||||
|
||||
set -e
|
||||
set -x
|
||||
|
||||
# This is the root for all download and building directories
|
||||
BuildRoot=~/freepascal
|
||||
|
||||
#===============================================================================
|
||||
# parse command line parameters
|
||||
DownloadBinutils=no
|
||||
DownloadFPC=no
|
||||
BuildBinutils=no
|
||||
BuildCrossFPC=no
|
||||
BuildNormalFPC=no
|
||||
BuildCrossWin32RPM=no
|
||||
|
||||
Params=$@
|
||||
for p in $Params; do
|
||||
case "$p" in
|
||||
all)
|
||||
DownloadBinutils=yes
|
||||
DownloadFPC=yes
|
||||
BuildBinutils=yes
|
||||
BuildLinWin32RPM=no
|
||||
BuildNormalRPM=no
|
||||
;;
|
||||
downloadbinutils)
|
||||
DownloadBinutils=yes
|
||||
;;
|
||||
downloadfpc)
|
||||
DownloadFPC=yes
|
||||
;;
|
||||
buildbinutils)
|
||||
BuildBinutils=yes
|
||||
;;
|
||||
buildnormalfpc)
|
||||
BuildNormalFPC=yes
|
||||
;;
|
||||
buildcrossfpc)
|
||||
BuildCrossFPC=yes
|
||||
;;
|
||||
buildcrosswin32rpm)
|
||||
BuildCrossWin32RPM=yes
|
||||
;;
|
||||
*)
|
||||
echo "Unknown option: $p"
|
||||
echo
|
||||
echo "Usage:"
|
||||
echo " $0 [all] [downloadbinutils] [downloadfpc] [buildbinutils] [buildcrossfpc] [buildcrosswin32rpm]"
|
||||
exit -1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# expand paths
|
||||
BuildRoot=$(echo $BuildRoot | sed -e 's#//#/#g' -e 's#/$##')
|
||||
|
||||
#===============================================================================
|
||||
# download and build binutils and fpc
|
||||
Params=""
|
||||
if [ $DownloadBinutils = "yes" ]; then
|
||||
Params="$Params downloadbinutils"
|
||||
fi
|
||||
if [ $DownloadFPC = "yes" ]; then
|
||||
Params="$Params downloadfpc"
|
||||
fi
|
||||
if [ $BuildBinutils = "yes" ]; then
|
||||
Params="$Params buildbinutils"
|
||||
fi
|
||||
if [ $BuildNormalFPC = "yes" ]; then
|
||||
Params="$Params buildnormalfpc"
|
||||
fi
|
||||
if [ $BuildCrossFPC = "yes" ]; then
|
||||
Params="$Params buildcrossfpc"
|
||||
fi
|
||||
if [ ! -z $Params ]; then
|
||||
Params="$Params targets=i386-win32"
|
||||
./update_cross_fpc.sh $Params
|
||||
fi
|
||||
|
||||
#===============================================================================
|
||||
# build fpc_crosswin32 rpm
|
||||
if [ $BuildCrossWin32RPM = "yes" ]; then
|
||||
#----------------------------------------------------------------------------
|
||||
# retrieve the version information
|
||||
#----------------------------------------------------------------------------
|
||||
VersionFile="$BuildRoot/fpc/compiler/version.pas"
|
||||
CompilerVersion=`cat $VersionFile | grep ' *version_nr *=.*;' | sed -e 's/[^0-9]//g'`
|
||||
CompilerRelease=`cat $VersionFile | grep ' *release_nr *=.*;' | sed -e 's/[^0-9]//g'`
|
||||
CompilerPatch=`cat $VersionFile | grep ' *patch_nr *=.*;' | sed -e 's/[^0-9]//g'`
|
||||
CompilerVersionStr="$CompilerVersion.$CompilerRelease.$CompilerPatch"
|
||||
|
||||
Release=$(date +%y%m%d)
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# create source directory
|
||||
#----------------------------------------------------------------------------
|
||||
TmpDir=/tmp/fpc_patchdir
|
||||
rm -rf $TmpDir
|
||||
mkdir -p $TmpDir
|
||||
|
||||
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# change spec file
|
||||
#----------------------------------------------------------------------------
|
||||
SpecFileTemplate=../rpm/fpc_crosswin32.spec.template
|
||||
SpecFile=../rpm/fpc_crosswin32.spec
|
||||
cat $SpecFileTemplate | \
|
||||
sed -e 's/FPCVERSION/'"$CompilerVersionStr/" \
|
||||
-e 's/FPCRELEASE/'"$Release/" \
|
||||
> $SpecFile
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# compile
|
||||
#----------------------------------------------------------------------------
|
||||
rpmbuild --nodeps -ba $SpecFile
|
||||
|
||||
echo "The new rpm can be found in /usr/src/redhat/RPMS/i386/"
|
||||
fi
|
||||
|
||||
# end.
|
||||
|
@ -68,11 +68,14 @@ for p in $Params; do
|
||||
installbin=*)
|
||||
InstallBin=$(echo $p | sed -e 's#^installbin=##')
|
||||
;;
|
||||
targets=*)
|
||||
Targets=$p
|
||||
;;
|
||||
*)
|
||||
echo "Unknown option: $p"
|
||||
echo
|
||||
echo "Usage:"
|
||||
echo " $0 [all] [downloadbinutils] [downloadfpc] [buildbinutils] [buildnormalfpc] [buildcrossfpc] [createfpccfg]"
|
||||
echo " $0 [all] [downloadbinutils] [downloadfpc] [buildbinutils] [buildnormalfpc] [buildcrossfpc] [createfpccfg] [install] [installbin=<dir>] [targets=<i386-win32>]"
|
||||
exit -1
|
||||
;;
|
||||
esac
|
||||
|
28
tools/install/rpm/fpc_crosswin32.spec.template
Normal file
28
tools/install/rpm/fpc_crosswin32.spec.template
Normal file
@ -0,0 +1,28 @@
|
||||
Name: fpc_crosswin32
|
||||
Version: FPCVERSION
|
||||
Release: FPCRELEASE
|
||||
Summary: Free Pascal Compiler cross binaries for win32
|
||||
|
||||
Group: Development/Languages
|
||||
License: GPL and modified LGPL
|
||||
URL: http://www.freepascal.org/
|
||||
Source0: ftp://ftp.freepascal.org/pub/fpc/dist/source-%{version}/%{name}-%{version}-%{release}.source.tar.gz
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
|
||||
Requires: glibc, binutils, fpc=FPCVERSION
|
||||
BuildRequires: binutils, glibc-devel
|
||||
|
||||
%description
|
||||
|
||||
Units and binutils needed by Freepascal to cross compile to target win32.
|
||||
|
||||
%prep
|
||||
%setup -c
|
||||
|
||||
%build
|
||||
|
||||
%install
|
||||
rm -rf %{buildroot}
|
||||
mkdir -p %{buildroot}%{_libdir}/%{name}
|
||||
mkdir -p %{buildroot}%{_bindir}
|
||||
|
Loading…
Reference in New Issue
Block a user