1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178
|
#!/bin/bash
#
# File: platform.sh
# Original: 6-Aug-97 J. Westbrook
#
# Copy the platform specific section of the Makefile in
# the current directory to:
#
# Makefile.platform.
#
#
sysid="unknown"
release="0.0.0"
#
# Use uname(1) to figure out what O/S is running.
#
case `uname -s` in
# Check if it is a Windows 2000 platform
CYGWIN_NT-5.0)
sysid="cygwin"
;;
# Check if it is a Windows XP platform
CYGWIN_NT-5.1)
sysid="cygwin"
;;
# Check if it is a Mac OS platform
Darwin)
# First check if it is clang-xxxx
clang_ver=`gcc --version | grep -e "clang-5"`
if [[ ! -z $clang_ver ]]
then
sysid="darwin4"
else
# Check if it is GCC version 4.x
gcc_ver=`gcc --version | grep -e " 4\."`
if [[ -z $gcc_ver ]]
then
# It is not GCC version 4.x. Check if it is GCC version 3.x
gcc_ver=`gcc --version | grep -e " 3\."`
if [[ -z $gcc_ver ]]
then
# It is not GCC version 3.x. Check if it is GCC version 2.x
gcc_ver=`gcc --version | grep -e "2\."`
if [[ -z $gcc_ver ]]
then
# It is not GCC version 2.x either. Production can not be compiled.
sysid="unknown"
else
# It is GCC version 2.x
sysid="darwin2"
fi
else
# It is GCC version 3.x
sysid="darwin3"
fi
else
# It is GCC version 4.x
sysid="darwin4"
fi
fi
;;
# Check if it is a Linux platform
Linux)
sysid="gnu4"
;;
# Debian GNU/kFreeBSD
GNU/kFreeBSD)
sysid="gnu4"
;;
# Debian GNU/Hurd
GNU)
sysid="gnu4"
;;
SunOS)
sysid="sunos5"
;;
IRIX)
release=`/usr/bin/uname -r`
case "$release" in
6.*) sysid="sgi6" ;;
5.*) sysid="sgi6" ;;
4.*) sysid="sgi6" ;;
*) sysid="unknown" ;;
esac
;;
IRIX64)
release=`/usr/bin/uname -r`
case "$release" in
6.*) sysid="sgi6" ;;
5.*) sysid="sgi6" ;;
*) sysid="unknown" ;;
esac
;;
HP-UX)
case `uname -m` in
9000/7**) sysid=unknown
;;
*) sysid=unknown
;;
esac
;;
OSF1)
sysid="osf"
;;
esac
#
# If system type is unknown, write warning message and exit with 1.
#
if [ "$sysid" = "unknown" ] ; then
echo "Warning: this seems to be an unsupported operating system."
echo " "
echo "Supported systems are:"
echo " SunOS ...... version 4.1.x and 5.2 or higher"
echo " Linux ...... any version "
echo " SGI IRIX ... version 5.3-6.4"
# echo " HP-UX ...... version 9.x, on HP9000/7xx computers"
exit 1
fi
echo "Using platform specific configuration for system: $sysid"
#
# Create source filename, test for presence.
#
source=make.platform.$sysid
if [ ! -r "$source" ] ; then
echo "Can't locate the following file:"
echo " "
echo " $source"
echo " "
exit 1
fi
#
# Copy the file.
#
dest=Makefile.platform
#echo "Copying $source"
#echo " to $dest"
rm -f $dest
cp $source $dest
# Check if make is GNU make
make_prog=`make --version 2>&1 | grep -e "GNU"`
if [ x"$make_prog" = x ]
then
echo
echo "Critical Build Error: GNU Make not accessible!"
echo " GNU Make must be accessible in order to build this software."
echo " If GNU make is already installed on this platform, make it"
echo " accessible to this user. If not installed, please install it."
echo
exit 1
fi
# Add source distribution preparation statements to the end of the
# platform makefile.
echo >> $dest
echo "# Added by platform.sh script" >> $dest
echo EXPORT=perl ../../etc/fileUpdate.pl >> $dest
echo EXPORT_LIST=../../etc/export_list >> $dest
echo EXPORT_DIR=export_dir >> $dest
echo "Platform configuration done."
exit 0
|