122 | | echo "To get past this message, export the variable SAGE_PORT to" |
123 | | echo "something non-empty." |
| 97 | fail=yes |
| 98 | fi |
| 99 | |
| 100 | # Test versions of "tar" and "make". |
| 101 | have_gnu_tar=`tar --version 2>&1 | grep GNU` |
| 102 | have_bsd_tar=`tar --version 2>&1 | grep bsdtar` |
| 103 | have_gnu_make=`make --version 2>&1 | grep GNU` |
| 104 | |
| 105 | if [ -z "${have_gnu_tar}${have_bsd_tar}" ] ; then |
| 106 | echo "You MUST use either the GNU or BSD version of tar, as some parts of the" |
| 107 | echo "Sage source code are contained in tar files, which were produced with GNU" |
| 108 | echo "tar. These are not POSIX compliant tar files (unless they were created with" |
| 109 | echo "the --posix option), so can not always be extracted with other 'tar'" |
| 110 | echo "programs." |
| 111 | echo "" |
| 112 | echo "Please ensure that a GNU or BSD version of tar is first in your path." |
| 113 | echo "" |
| 114 | fail=yes |
| 115 | |
| 116 | if [ -f "/usr/sfw/bin/gtar" ] ; then |
| 117 | echo "There is a copy of GNU tar, but renamed to 'gtar' in" |
| 118 | echo "the directory /usr/sfw/bin. It is suggested that you copy" |
| 119 | echo "/usr/sfw/bin/gtar to a different directory, renaming it" |
| 120 | echo "'tar' instead of gtar. Then ensure that directory is in" |
| 121 | echo "you path before /usr/bin, so whenever you type 'tar' you" |
| 122 | echo "run the GNU version." |
| 123 | echo "" |
| 124 | echo "Executing something like" |
| 125 | echo "" |
| 126 | echo '$ mkdir $HOME/bins-for-sage' |
| 127 | echo '$ cp /usr/sfw/bin/gtar $HOME/bins-for-sage/tar' |
| 128 | echo '$ export PATH=$HOME/bins-for-sage:$PATH' |
| 129 | echo "" |
| 130 | echo "will put the GNU version of 'tar' in your path before /usr/bin/." |
| 131 | echo "" |
| 132 | echo "If you type 'tar --version', it should be obvious" |
| 133 | echo "whether the GNU version of 'tar' is first in your path or" |
| 134 | echo "not." |
| 135 | echo "" |
| 136 | fi |
| 137 | fi |
| 138 | |
| 139 | if [ -z "${have_gnu_make}" ] ; then |
| 140 | echo "Due to numerous GNUisms, you MUST use the GNU version of 'make'" |
| 141 | echo "to build Sage. Other versions will not work." |
| 142 | echo "" |
| 143 | fail=yes |
| 144 | |
| 145 | if [ -f "/usr/sfw/bin/gmake" ] ; then |
| 146 | echo "There is a copy of GNU make, but renamed to 'gmake' in" |
| 147 | echo "the directory /usr/sfw/bin. It is suggested that you copy" |
| 148 | echo "/usr/sfw/bin/gmake to a different directory, renaming it" |
| 149 | echo "'make' instead of gmake. Then ensure that directory is in" |
| 150 | echo "you path before /usr/ccs/bin, so whenever you type 'make' you" |
| 151 | echo "run the GNU version." |
| 152 | echo "" |
| 153 | echo "Executing something like" |
| 154 | echo "" |
| 155 | echo '$ mkdir $HOME/bins-for-sage' |
| 156 | echo '$ cp /usr/sfw/bin/gmake $HOME/bins-for-sage/make' |
| 157 | echo '$ export PATH=$HOME/bins-for-sage:$PATH' |
| 158 | echo "" |
| 159 | echo "will put the GNU version of 'make' in your path before /usr/ccs/bin/." |
| 160 | echo "" |
| 161 | echo "If you type 'make --version', it should be obvious" |
| 162 | echo "whether the GNU version of 'make' is first in your path or" |
| 163 | echo "not." |
| 164 | echo "" |
| 165 | fi |
| 166 | fi |
| 167 | |
| 168 | if [ x$fail = xyes ]; then |
| 169 | echo "To get past this message and try building Sage anyway," |
| 170 | echo "export the variable SAGE_PORT to something non-empty." |
264 | | # Solaris only |
265 | | # Sun's 'tar' and 'make' are unsuitable for building Sage. |
266 | | # So check on Solaris systems that the GNU versions are used. |
267 | | # One issue, which still remains and will make a build non-trivial |
268 | | # on Solaris is the fact that the first linker and assembler |
269 | | # in the path must be the ones used by gcc if the user is using gcc |
270 | | # to compile Sage. This is not addressed in this version of 'prereq' |
271 | | # but will in a later one. |
272 | | |
273 | | if [ "$UNAME" = "SunOS" ] ; then |
274 | | if [ -z "`tar --version 2>&1 | grep GNU`" ] ; then |
275 | | echo "" |
276 | | echo "ERROR **********************************************" |
277 | | echo "ERROR **********************************************" |
278 | | echo "You MUST also use the GNU version of tar, as some parts" |
279 | | echo "of the Sage source code are compressed tar files, which" |
280 | | echo "were compressed with GNU tar. GNU tar does not produce" |
281 | | echo "POSIX compliant tar files unless called with the --posix" |
282 | | echo "option, so can not always be extracted with Sun's tar." |
283 | | echo "" |
284 | | echo "" |
285 | | echo "Therefore, to build Sage on Solaris you MUST have" |
286 | | echo "the GNU version of tar in your path before the Sun version" |
287 | | echo "" |
288 | | if [ -f "/usr/sfw/bin/gtar" ] && [ -f "/usr/sfw/bin/gmake" ] ; then |
289 | | echo "There is a copy of GNU tar, but renamed to 'gtar' in" |
290 | | echo "the directory /usr/sfw/bin. It is suggested that you copy" |
291 | | echo "/usr/sfw/bin/gtar to a different directory, renaming it" |
292 | | echo "'tar' instead of gtar. Then ensure that directory is in" |
293 | | echo "you path before /usr/bin, so whenever you type 'tar' you" |
294 | | echo "run the GNU version, and not the Sun version of tar." |
295 | | echo "" |
296 | | echo "Due to some GNUisms, the same applies with 'make'" |
297 | | echo "" |
298 | | echo "Executing something like" |
299 | | echo "" |
300 | | echo "$ mkdir \$HOME/bins-for-sage" |
301 | | echo "$ cp /usr/sfw/bin/gmake \$HOME/bins-for-sage/make" |
302 | | echo "$ cp /usr/sfw/bin/gtar \$HOME/bins-for-sage/tar" |
303 | | echo "$ export PATH=\$HOME/bins-for-sage:\$PATH" |
304 | | echo "" |
305 | | echo "will put the GNU versions of 'tar' and 'make' in your path" |
306 | | echo "before the Sun versions" |
307 | | echo "" |
308 | | echo "If you type 'tar --version' it should be obvious whether" |
309 | | echo "the GNU version of 'tar' is first in your path or not" |
310 | | echo "" |
311 | | echo "If you type 'make --version' is should be obvious whether" |
312 | | echo "the GNU version of 'make' is first in your path or not" |
313 | | echo "" |
314 | | fi |
315 | | exit 1 |
316 | | fi |
317 | | if [ -z "`make --version 2>&1 | grep GNU`" ] ; then |
318 | | echo "Due to numerous GNUisms, you MUST use the GNU version of 'make'" |
319 | | echo "to build Sage on Solaris - Sun's version will not work." |
320 | | echo "" |
321 | | if [ -f "/usr/sfw/bin/gtar" ] && [ -f "/usr/sfw/bin/gmake" ] ; then |
322 | | echo "There is a copy of GNU 'make', but renamed to 'gmake' in" |
323 | | echo "the directory /usr/sfw/bin. It is suggested that you copy" |
324 | | echo "/usr/sfw/bin/gmake to a different directory, renaming it" |
325 | | echo "'make' instead of gmake. Then ensure that directory is in" |
326 | | echo "you path before /usr/ccs/bin, so whenever you type 'make' you" |
327 | | echo "run the GNU version, and not the Sun version of make." |
328 | | echo "" |
329 | | echo "You MUST also use the GNU version of tar, as some parts" |
330 | | echo "of the Sage source code are compressed tar files, which" |
331 | | echo "were compressed with GNU tar. GNU tar does not produce" |
332 | | echo "POSIX compliant tar files unless called with the --posix" |
333 | | echo "option, so can not always be extracted with Sun's tar." |
334 | | echo "" |
335 | | echo "Executing something like" |
336 | | echo "$ mkdir \$HOME/bins-for-sage" |
337 | | echo "$ cp /usr/sfw/bin/gmake \$HOME/bins-for-sage/make" |
338 | | echo "$ cp /usr/sfw/bin/gtar \$HOME/bins-for-sage/tar" |
339 | | echo "$ export PATH=\$HOME/bins-for-sage:\$PATH" |
340 | | echo "will put the GNU versions of 'tar' and 'make' in your path" |
341 | | echo "before the Sun versions" |
342 | | echo "" |
343 | | echo "If you type 'make --version' it should be obvious whether" |
344 | | echo "the GNU version of 'make' is first in your path or not" |
345 | | echo "" |
346 | | echo "If you type 'tar --version' is should be obvious whether" |
347 | | echo "the GNU version of 'tar' is first in your path or not" |
348 | | echo "" |
349 | | else |
350 | | echo "You can either compile GNU make from source, or it may be" |
351 | | echo "obtained from Blastwave or Sunfreeware.com" |
352 | | echo "" |
353 | | echo "On Open Solaris, some GNU tools can be found at /usr/gnu" |
354 | | echo "although at the time of writing, this directory did not contain" |
355 | | echo "make or tar, but you might try looking there." |
356 | | fi |
357 | | exit 1 |
358 | | fi |
359 | | fi |
360 | | |
361 | | # Test for GNU versions of tar and make on AIX, HP-UX, IRIX and Tru64 |
362 | | # Unlike on Solaris, no help is given about where to find the GNU |
363 | | # versions, as I've not used a sufficient number of these machines |
364 | | # to know where to find the GNU tools. The tests for operating system |
365 | | # are split across two lines, as it's unwise to make more than 4 test. |
366 | | # The split shown seemed the most natural, with making the |
367 | | # IRIX and IRIX64 tests on a line of their own. David Kirkby January 2010 |
368 | | |
369 | | if [ -z "`tar --version 2>&1 | grep GNU`" ] ; then |
370 | | if [ "$UNAME" = "HP-UX" ] || [ "$UNAME" = "AIX" ] || [ "$UNAME" = "Tru64" ] ; then |
371 | | echo "" |
372 | | echo "You must use the GNU version of tar on $UNAME. Please" |
373 | | echo "ensure that a GNU version of tar is first in your path" |
374 | | exit 1 |
375 | | elif [ "$UNAME" = "IRIX" ] || [ "$UNAME" = "IRIX64" ] ; then |
376 | | echo "" |
377 | | echo "You must use the GNU version of tar on IRIX. Please" |
378 | | echo "ensure that a GNU version of tar is first in your path" |
379 | | exit 1 |
380 | | fi |
381 | | fi |
382 | | |
383 | | |
384 | | if [ -z "`make --version 2>&1 | grep GNU`" ] ; then |
385 | | if [ "$UNAME" = "HP-UX" ] || [ "$UNAME" = "AIX" ] || [ "$UNAME" = "Tru64" ] ; then |
386 | | echo "" |
387 | | echo "You must use the GNU version of make on $UNAME. Please" |
388 | | echo "ensure that a GNU version of make is first in your path" |
389 | | exit 1 |
390 | | elif [ "$UNAME" = "IRIX" ] || [ "$UNAME" = "IRIX64" ] ; then |
391 | | echo "" |
392 | | echo "You must use the GNU version of make on IRIX. Please" |
393 | | echo "ensure that a GNU version of make is first in your path" |
394 | | exit 1 |
395 | | fi |
396 | | fi |
397 | | |