mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-18 12:39:36 +02:00
* first update to work with new cpu-os target names
This commit is contained in:
parent
02e0c6cc62
commit
ae10c66502
@ -7,8 +7,8 @@
|
||||
# Everything can be set when the script is run.
|
||||
#
|
||||
|
||||
# Release Version
|
||||
VERSION=1.9.4
|
||||
# Release Version %version% will be replaced by makepack
|
||||
VERSION=%version%
|
||||
|
||||
# some useful functions
|
||||
# ask displays 1st parameter, and ask new value for variable, whose name is
|
||||
@ -87,6 +87,57 @@ checkpath ()
|
||||
return 1
|
||||
}
|
||||
|
||||
# Install files from binary-*.tar
|
||||
# $1 = cpu-target
|
||||
installbinary ()
|
||||
{
|
||||
BINARYTAR=binary.$1.tar
|
||||
|
||||
# conversion from long to short archname for ppc<x>
|
||||
case $1 in
|
||||
m68k*)
|
||||
PPCSUFFIX=68k;;
|
||||
sparc*)
|
||||
PPCSUFFIX=sparc;;
|
||||
i386*)
|
||||
PPCSUFFIX=386;;
|
||||
powerpc*)
|
||||
PPCSUFFIX=ppc;;
|
||||
arm*)
|
||||
PPCSUFFIX=arm;;
|
||||
x86_64*)
|
||||
PPCSUFFIX=x64;;
|
||||
esac
|
||||
|
||||
# Install compiler/RTL. Mandatory.
|
||||
echo Installing compiler and RTL for $1...
|
||||
unztarfromtar $BINARYTAR base${OSNAME}.tar.gz $PREFIX
|
||||
|
||||
# Install symlink
|
||||
rm -f $EXECDIR/ppc${PPCSUFFIX}
|
||||
ln -sf $LIBDIR/ppc${PPCSUFFIX} $EXECDIR/ppc${PPCSUFFIX}
|
||||
|
||||
echo Installing utilities...
|
||||
unztarfromtar $BINARYTAR util${OSNAME}.tar.gz $PREFIX
|
||||
if yesno "Install FCL"; then
|
||||
unztarfromtar $BINARYTAR unitsfcl${OSNAME}.tar.gz $PREFIX
|
||||
fi
|
||||
if yesno "Install packages"; then
|
||||
listtarfiles $BINARYTAR packages units
|
||||
for f in $packages
|
||||
do
|
||||
if [ $f != unitsfcl${OSNAME}.tar.gz ]; then
|
||||
basename $f .tar.gz |\
|
||||
sed -e s/units// -e s/${OSNAME}// |\
|
||||
xargs echo Installing
|
||||
unztarfromtar $BINARYTAR $f $PREFIX
|
||||
fi
|
||||
done
|
||||
fi
|
||||
rm -f *${OSNAME}.tar.gz
|
||||
}
|
||||
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# welcome message.
|
||||
#
|
||||
@ -117,7 +168,6 @@ LIBDIR=$PREFIX/lib/fpc/$VERSION
|
||||
SRCDIR=$PREFIX/src/fpc-$VERSION
|
||||
EXECDIR=$PREFIX/bin
|
||||
OSNAME=`uname -s | tr A-Z a-z`
|
||||
ARCHNAME=`uname -m | tr A-Z a-z`
|
||||
|
||||
BSDHIER=0
|
||||
case $OSNAME in
|
||||
@ -125,79 +175,19 @@ case $OSNAME in
|
||||
BSDHIER=1;;
|
||||
esac
|
||||
|
||||
# conversion from GNU/OS archname to FPC archname
|
||||
case $ARCHNAME in
|
||||
*sun4u)
|
||||
ARCHNAME=sparc64;;
|
||||
*sun4)
|
||||
ARCHNAME=sparc32;;
|
||||
*i486)
|
||||
ARCHNAME=i386;;
|
||||
*i586)
|
||||
ARCHNAME=i386;;
|
||||
*i686)
|
||||
ARCHNAME=i386;;
|
||||
*ppc)
|
||||
ARCHNAME=powerpc;;
|
||||
*armc4l)
|
||||
ARCHNAME=arm;;
|
||||
*amd64)
|
||||
ARCHNAME=x86_64;;
|
||||
esac
|
||||
|
||||
SHORTARCH=$ARCHNAME
|
||||
|
||||
# conversion from long to short archname for ppc<x>
|
||||
case $SHORTARC in
|
||||
*m68k)
|
||||
SHORTARCH=68k;;
|
||||
*sparc)
|
||||
SHORTARCH=sparc;;
|
||||
*i386)
|
||||
SHORTARCH=386;;
|
||||
*powerpc)
|
||||
SHORTARCH=ppc;;
|
||||
*arm)
|
||||
SHORTARCH=arm;;
|
||||
*x86_64)
|
||||
SHORTARCH=x64;;
|
||||
esac
|
||||
|
||||
FULLARCH=$ARCHNAME-$OSNAME
|
||||
|
||||
if [ "${BSDHIER}" = "1" ]; then
|
||||
DOCDIR=$PREFIX/share/doc/fpc-$VERSION
|
||||
else
|
||||
DOCDIR=$PREFIX/doc/fpc-$VERSION
|
||||
fi
|
||||
|
||||
echo $DOCDIR
|
||||
|
||||
DEMODIR=$DOCDIR/examples
|
||||
|
||||
# Install compiler/RTL. Mandatory.
|
||||
echo Installing compiler and RTL ...
|
||||
unztarfromtar binary.tar base${OSNAME}.tar.gz $PREFIX
|
||||
rm -f $EXECDIR/ppc$(SHORTARCH)
|
||||
ln -sf $LIBDIR/ppc$(SHORTARCH) $EXECDIR/ppc$(SHORTARCH)
|
||||
echo Installing utilities...
|
||||
unztarfromtar binary.tar util${OSNAME}.tar.gz $PREFIX
|
||||
if yesno "Install FCL"; then
|
||||
unztarfromtar binary.tar unitsfcl${OSNAME}.tar.gz $PREFIX
|
||||
fi
|
||||
if yesno "Install packages"; then
|
||||
listtarfiles binary.tar packages units
|
||||
for f in $packages
|
||||
do
|
||||
if [ $f != unitsfcl${OSNAME}.tar.gz ]; then
|
||||
basename $f .tar.gz |\
|
||||
sed -e s/units// -e s/${OSNAME}// |\
|
||||
xargs echo Installing
|
||||
unztarfromtar binary.tar $f $PREFIX
|
||||
fi
|
||||
done
|
||||
fi
|
||||
rm -f *${OSNAME}.tar.gz
|
||||
# Install all binary releases
|
||||
for f in binary*.tar
|
||||
do
|
||||
a=`echo $f | sed "s+binary.\(.*\).tar+\1+"`
|
||||
installbinary $a
|
||||
done
|
||||
|
||||
echo Done.
|
||||
echo
|
||||
|
||||
|
111
install/makepack
111
install/makepack
@ -1,67 +1,106 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Shell script to make a FPC .tar package for Linux
|
||||
# Copyright 1996-2000 Michael Van Canneyt and Peter Vreman
|
||||
# Copyright 1996-2004 Michael Van Canneyt and Peter Vreman
|
||||
#
|
||||
|
||||
# Version
|
||||
VERSION=1.9.4
|
||||
RELEASE=i386
|
||||
set -e
|
||||
|
||||
# Retrieve current system info by calling FPC. We need
|
||||
# to use the | head -n1 to fix a bug in fpc 1.9.4 and earlier
|
||||
# that uses exitcode 1 also when printing info resulting in
|
||||
# fpc binary to print an error line (PFV)
|
||||
SOURCECPU=`fpc -iSP | head -n1`
|
||||
SOURCEOS=`fpc -iSO | head -n1`
|
||||
|
||||
if [ $# -ne 0 ]; then
|
||||
if [ $# -ne 2 ]; then
|
||||
echo "Usage: makepack [<cpu> <os>]"
|
||||
exit 1
|
||||
fi
|
||||
TARGETCPU=$1
|
||||
TARGETOS=$2
|
||||
else
|
||||
TARGETCPU=$SOURCECPU
|
||||
TARGETOS=$SOURCEOS
|
||||
fi
|
||||
|
||||
FULLTARGET=$TARGETCPU-$TARGETOS
|
||||
|
||||
if [ "$TARGETCPU" != "$SOURCECPU" ] || [ "$TARGETOS" != "$SOURCEOS" ]; then
|
||||
CROSS="cross"
|
||||
fi
|
||||
|
||||
unset FPCDIR
|
||||
|
||||
# Goto the toplevel if necessary
|
||||
[ -d install ] || cd ..
|
||||
|
||||
make linuxzip
|
||||
# Build everything using the makefiles
|
||||
make distclean CPU_TARGET=$TARGETCPU OS_TARGET=$TARGETOS
|
||||
make ${CROSS}zipinstall CPU_TARGET=$TARGETCPU OS_TARGET=$TARGETOS SNAPSHOT=1
|
||||
if [ $? != 0 ]; then
|
||||
echo Failed to make distribution archive.
|
||||
echo "Failed to make distribution archive."
|
||||
exit 1
|
||||
fi
|
||||
make docs
|
||||
if [ $? != 0 ]; then
|
||||
echo Failed to make documentation archive.
|
||||
exit 1
|
||||
|
||||
# Retrieve version info before it gets cleaned below
|
||||
VERSION=`cd compiler && ./utils/fpc -iV`
|
||||
|
||||
if [ "$CROSS" == "" ]; then
|
||||
make docs
|
||||
if [ $? != 0 ]; then
|
||||
echo "Failed to make documentation archive."
|
||||
exit 1
|
||||
fi
|
||||
make sourcezip
|
||||
if [ $? != 0 ]; then
|
||||
echo "Failed to make source archive."
|
||||
exit 1
|
||||
fi
|
||||
make docsrc
|
||||
if [ $? != 0 ]; then
|
||||
echo Failed to make documentation source archive.
|
||||
exit 1
|
||||
fi
|
||||
make demozip
|
||||
if [ $? != 0 ]; then
|
||||
echo Failed to make demo source archive.
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
make sourcezip
|
||||
if [ $? != 0 ]; then
|
||||
echo Failed to make source archive.
|
||||
exit 1
|
||||
fi
|
||||
make docsrc
|
||||
if [ $? != 0 ]; then
|
||||
echo Failed to make documentation source archive.
|
||||
exit 1
|
||||
fi
|
||||
make demozip
|
||||
if [ $? != 0 ]; then
|
||||
echo Failed to make demo source archive.
|
||||
exit 1
|
||||
|
||||
# Build filename
|
||||
if [ "$CROSS" == "" ]; then
|
||||
TARNAME=fpc-$VERSION.$FULLTARGET.tar
|
||||
else
|
||||
TARNAME=fpc-$FULLTARGET-$VERSION.$SOURCECPU-$SOURCEOS.tar
|
||||
fi
|
||||
BINARYTAR=binary-$FULLTARGET.tar
|
||||
|
||||
SOURCES=`/bin/ls *src.tar.gz`
|
||||
FILES=`/bin/ls *linux.tar.gz *exm.tar.gz`
|
||||
RELFILES="binary.tar sources.tar demo.tar.gz docs.tar.gz install.sh"
|
||||
FILES=`/bin/ls *linux.tar.gz`
|
||||
RELFILES="binary.$FULLTARGET.tar sources.tar demo.tar.gz docs.tar.gz install.sh"
|
||||
|
||||
echo Creating binary.tar
|
||||
tar cf binary.tar $FILES
|
||||
echo "Creating $BINARYTAR"
|
||||
tar cf $BINARYTAR $FILES
|
||||
if [ $? != 0 ]; then
|
||||
echo Failed to create binary.tar
|
||||
echo "Failed to create $BINARYTAR"
|
||||
exit 1
|
||||
fi
|
||||
echo Creating sources.tar
|
||||
echo "Creating sources.tar"
|
||||
tar cf sources.tar $SOURCES
|
||||
if [ $? != 0 ]; then
|
||||
echo Failed to create sources.tar
|
||||
echo "Failed to create sources.tar"
|
||||
exit 1
|
||||
fi
|
||||
echo Copying install.sh
|
||||
cp install/install.sh .
|
||||
echo "Copying install.sh"
|
||||
sed s+%version%+$VERSION+ install/install.sh > install.sh
|
||||
chmod 755 install.sh
|
||||
|
||||
echo Creating fpc-$VERSION.$RELEASE.tar
|
||||
tar cf fpc-$VERSION.$RELEASE.tar $RELFILES
|
||||
echo "Creating $TARNAME"
|
||||
tar cf $TARNAME $RELFILES
|
||||
if [ $? != 0 ]; then
|
||||
echo Failed to create fpc-$VERSION.$RELEASE.tar
|
||||
echo "Failed to create $TARNAME"
|
||||
exit 1
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user