|
@@ -1,4 +1,4 @@
|
|
-#!/bin/sh
|
|
|
|
|
|
+#!/usr/bin/env bash
|
|
#
|
|
#
|
|
# Shell script to make a FPC .tar package for Linux
|
|
# Shell script to make a FPC .tar package for Linux
|
|
# Copyright 1996-2004 Michael Van Canneyt and Peter Vreman
|
|
# Copyright 1996-2004 Michael Van Canneyt and Peter Vreman
|
|
@@ -7,6 +7,7 @@
|
|
set -e
|
|
set -e
|
|
|
|
|
|
# Al
|
|
# Al
|
|
|
|
+
|
|
unset FPCDIR
|
|
unset FPCDIR
|
|
|
|
|
|
# Goto the toplevel if necessary
|
|
# Goto the toplevel if necessary
|
|
@@ -22,6 +23,19 @@ VERSION=`grep '^version' compiler/Makefile.fpc | sed 's+[^=]*= *\(.*\)+\1+'`
|
|
SOURCECPU=`fpc -iSP | head -n1`
|
|
SOURCECPU=`fpc -iSP | head -n1`
|
|
SOURCEOS=`fpc -iSO | head -n1`
|
|
SOURCEOS=`fpc -iSO | head -n1`
|
|
|
|
|
|
|
|
+# retrieve real OS.
|
|
|
|
+HOSTARCH=`uname -p | tr "[:upper:]" "[:lower:]"`
|
|
|
|
+HOSTOS=`uname -s | tr "[:upper:]" "[:lower:]"`
|
|
|
|
+
|
|
|
|
+MAKE=make
|
|
|
|
+
|
|
|
|
+case "$HOSTOS" in
|
|
|
|
+ *BSD*) MAKE=gmake
|
|
|
|
+ ;;
|
|
|
|
+ *bsd*) MAKE=gmake
|
|
|
|
+ ;;
|
|
|
|
+esac
|
|
|
|
+
|
|
if [ $# -ne 0 ]; then
|
|
if [ $# -ne 0 ]; then
|
|
if [ $# -ne 1 ]; then
|
|
if [ $# -ne 1 ]; then
|
|
echo "Usage: makepack [<cpu>-<os>]"
|
|
echo "Usage: makepack [<cpu>-<os>]"
|
|
@@ -49,30 +63,30 @@ else
|
|
fi
|
|
fi
|
|
|
|
|
|
# Build everything using the makefiles
|
|
# Build everything using the makefiles
|
|
-make distclean CPU_TARGET=$TARGETCPU OS_TARGET=$TARGETOS
|
|
|
|
-make ${CROSS}zipinstall CPU_TARGET=$TARGETCPU OS_TARGET=$TARGETOS
|
|
|
|
|
|
+${MAKE} distclean CPU_TARGET=$TARGETCPU OS_TARGET=$TARGETOS
|
|
|
|
+${MAKE} ${CROSS}zipinstall CPU_TARGET=$TARGETCPU OS_TARGET=$TARGETOS
|
|
if [ $? != 0 ]; then
|
|
if [ $? != 0 ]; then
|
|
echo "Failed to make distribution archive."
|
|
echo "Failed to make distribution archive."
|
|
exit 1
|
|
exit 1
|
|
fi
|
|
fi
|
|
|
|
|
|
if [ "$CROSS" == "" ]; then
|
|
if [ "$CROSS" == "" ]; then
|
|
- make makepackdocs
|
|
|
|
|
|
+ ${MAKE} makepackdocs
|
|
if [ $? != 0 ]; then
|
|
if [ $? != 0 ]; then
|
|
echo "Failed to make documentation archive."
|
|
echo "Failed to make documentation archive."
|
|
exit 1
|
|
exit 1
|
|
fi
|
|
fi
|
|
- make sourcezip
|
|
|
|
|
|
+ ${MAKE} sourcezip
|
|
if [ $? != 0 ]; then
|
|
if [ $? != 0 ]; then
|
|
echo "Failed to make source archive."
|
|
echo "Failed to make source archive."
|
|
exit 1
|
|
exit 1
|
|
fi
|
|
fi
|
|
- make docsrc
|
|
|
|
|
|
+ ${MAKE} docsrc
|
|
if [ $? != 0 ]; then
|
|
if [ $? != 0 ]; then
|
|
echo "Failed to make documentation source archive."
|
|
echo "Failed to make documentation source archive."
|
|
exit 1
|
|
exit 1
|
|
fi
|
|
fi
|
|
- make demozip
|
|
|
|
|
|
+ ${MAKE} demozip
|
|
if [ $? != 0 ]; then
|
|
if [ $? != 0 ]; then
|
|
echo "Failed to make demo source archive."
|
|
echo "Failed to make demo source archive."
|
|
exit 1
|
|
exit 1
|