* gxtool silence tweak
[binutils-gdb.git] / Install.in
blobfc3433a01cd0e79620b0e32bac0e1d1a4b1d0c76
1 #!/bin/sh
2 ### Copyright (C) 1991, 1992, Cygnus Support
3 ### All Rights Reserved.
5 ### This really needs to nestle up snuggly to the Release notes. If you change
6 ### this script, please be sure the release notes get coordinated too.
8 set -e
10 ### this is our version number.
11 VERSION=cygnus-sol2-||RELNO||
13 ### this is the default installation repository. We use this to test whether or
14 ### not GCC_EXEC_PREFIX should be set when doing "Install test comp-tools".
15 #INSTALLDIR_DEFAULT=/giga/rich/tmp/installdir
16 INSTALLDIR_REAL=/opt
17 INSTALLDIR_DEFAULT=${INSTALLDIR_REAL}
18 ### this is where we install into. (useful for testing).
19 INSTALLDIR=${INSTALLDIR_DEFAULT}
21 ### where to write the log files
22 LOGDIR=${INSTALLDIR}/${VERSION}
24 ### who to call in bad situations
25 HOTLINE="the Cygnus Support Hotline at +1 415 322 7836"
27 ### what the release doc is called and a few sections thereof
28 NOTES="the Installation Notes"
29 CHANGING_PATHS="\"Changing the Paths\""
30 NO_ACCESS="\"No Access to ${INSTALLDIR}\?\""
31 MIGHT_WRONG="\"Some Things that Might go Wrong\""
32 WHY_FIXINCLUDES="Why Convert System Header Files\?"
33 ANOTHER_TAPE="\"Steps to install with another machine\'s tape drive\""
35 ### for debugging
36 #PATH=/bin:/usr/bin ; export PATH
38 ### default the tape device
39 case "${TAPE}" in
40 "") TAPE=||DEVdflt||
42 *)
44 esac # ${TAPE}
46 ### clear and/or initialize some variables
47 ARCH=
48 TOOLS=
49 FTPRELEASE=no
51 REMOVE=no
52 EXTRACT=no
53 FIXINCLUDES=no
54 TESTINSTALLATION=no
56 INSTALLHOST=default
57 ERROR=
59 ### where the binaries are in the release
60 #EXECDIR=${VERSION}/H-${INSTALLHOST}
61 EXECDIR=${VERSION}
63 ### some tool defaults
64 ### perhaps these should be hard coded to absolute paths instead?
65 TAR=tar
66 TARKEYS="xvvopf -"
67 SED=sed
68 MT=mt
70 ### trigger words on the command line are:
71 ### bin, src
72 ### emacs, comp-tools
73 ### -tape=/dev/device
74 ### -installdir=/foo
75 ### extract, fixincludes, test-installation, remove
77 for arg in $* ; do
78 case "${arg}" in
79 ### options
80 -tape=* | --tape=* | --tap=* | --ta=* | --t=*)
81 TAPE=`echo ${arg} | ${SED} 's/-*t[a-z]*=//'`
84 -installdir=* | --installdir=* | --installdi=* | --installd=* | --install=* | --instal=* | --insta=* | --inst=* | --ins=* | --in=* | --i=*)
85 INSTALLDIR=`echo ${arg} | ${SED} 's/-*i[a-z]*=//'`
86 # we will make it an absolute path shortly.
89 ### actions
90 *remove* | rm | -rm | --rm) ACTIONS="${ACTIONS} rm" ;;
91 *extract*) ACTIONS="${ACTIONS} extract" ;;
92 *fix*) ACTIONS="${ACTIONS} fix" ;;
93 *test*) ACTIONS="${ACTIONS} test" ;;
94 ### hosts
95 *src* | *sour*) ARCH="${ARCH} src" ;;
96 *bin*) ARCH="${ARCH} bin" ;;
98 ### packages
99 *emacs*) TOOLS="${TOOLS} emacs" ;;
100 *comp*) TOOLS="${TOOLS} comp" ;;
101 *help*) ERROR=true ;;
103 echo '***' I do not understand the option \"${arg}\".
104 ERROR=true
106 esac # ${arg}
107 done # arg in $*
111 ### check for a myriad of sins
115 if [ ! -d "${INSTALLDIR}" ] ; then
116 echo '*** ' Can not cd to \"${INSTALLDIR}\" because it does not exist.
117 echo '*** ' Try creating it with \"mkdir ${INSTALLDIR}\" and then try running Install again.
118 exit 1
119 else
120 if (cd "${INSTALLDIR}") ; then
121 true
122 else
123 echo '*** ' Can not cd to \"${INSTALLDIR}\" because I do not have execute permission.
124 ls -lad ${INSTALLDIR}
125 echo '*** ' Please fix this and then try running Install again.
126 exit 1
127 fi # ! cd ${INSTALLDIR}
128 fi # ! -d ${INSTALLDIR}
130 # Make INSTALLDIR absolute (parts below might need it that way).
131 # FIXME, do they really?
132 # FIXME, handle pwd failure from upper dir permission
133 INSTALLDIR=`cd ${INSTALLDIR} ; pwd`
134 LOGDIR=${INSTALLDIR}/${VERSION}
136 case "${ERROR}" in
138 ### default tools
139 case "${TOOLS}" in
140 "") TOOLS="||BUNDLE||" ;;
141 *) ;;
142 esac # ${TOOLS}
144 INSTALLHOST=
146 ### decide where we are: try arch first.
147 if (arch) > /dev/null 2>&1 ; then
148 MAYBE=`arch`
149 else
150 true
151 fi # (arch)
153 case "${MAYBE}" in
154 sun3) INSTALLHOST=${MAYBE}
157 ### next try uname
158 if (uname > /dev/null) 2>&1 ; then
159 UNAME=`echo \`uname -s\`\`uname -m\`\`uname -r\``
160 else
161 UNAME="machine without a uname command (type of machine unknown)"
162 fi # (uname)
164 ### map into names we recognize
165 case "${UNAME}" in
166 AIX*)
167 INSTALLHOST=rs6000
168 MT=tctl
170 ULTRIXRISC) INSTALLHOST=decstation ;;
171 SunOSsun4*5*) INSTALLHOST=sparc-sun-solaris2 ;;
172 SunOSsun4*) INSTALLHOST=sun4 ;;
173 SunOSsun3*) INSTALLHOST=sun3 ;;
174 IRIX*) INSTALLHOST=iris4 ;;
175 *) INSTALLHOST=unknown ;;
176 esac # ${UNAME}
178 esac # ${MAYBE}
180 ### default arch
181 case "${ARCH}" in
182 "") ARCH="bin src" ;;
183 *) ;;
184 esac # ${ARCH}
186 ### default actions
188 case "${ACTIONS}" in
190 case "${FTPRELEASE}" in
191 "yes") ACTIONS="test" ;;
192 "no" ) ACTIONS="extract test" ;;
193 esac # ${FTPRELEASE}
196 ### fixincludes only if comp-tools
197 for tool in ${TOOLS} ; do
198 case ${tool} in
199 comp)
200 if echo ${ARCH} | grep bin > /dev/null 2>&1 ; then
201 ACTIONS="${ACTIONS} fix"
204 *) ;;
205 esac # ${TOOLS}
206 done # for tool in ${TOOLS}
208 *) ;;
209 esac # ${ACTIONS}
211 *) ;;
212 esac # ${ERROR}
214 case "${ERROR}" in
216 ### if binaries are not intended for this machine
217 case "${INSTALLHOST}" in
218 "||HOSTstr||") ### binaries are intended for this machine
219 for action in ${ACTIONS} ; do
220 case ${action} in
221 test)
222 for tool in ${TOOLS} ; do
223 OURWD=`(cd ${INSTALLDIR}; pwd) 2>/dev/null`
224 DEFAULTWD=`(cd ${INSTALLDIR_REAL}; pwd) 2>/dev/null`
225 case ${tool} in
226 comp)
227 case "${OURWD}" in
228 "${DEFAULTWD}") ;;
230 echo '***' If you want to use the compilation tools in an alternate
231 echo '*** ' directory, GCC_EXEC_PREFIX must be set. You probably
232 echo '*** ' want to set it with:
233 echo GCC_EXEC_PREFIX=${INSTALLDIR}/${EXECDIR}/lib/gcc-lib/||HOSTstr||/||GCCvn||/ ; export GCC_EXEC_PREFIX
234 GCC_EXEC_PREFIX=${INSTALLDIR}/${EXECDIR}/lib/gcc-lib/||HOSTstr||/||GCCvn||/ ; export GCC_EXEC_PREFIX
235 echo '*** ' This is what I will use for the installation tests.
236 # skip C++ msg on Solaris
237 case "${INSTALLHOST}" in
238 sparc-sun-solaris2) ;;
240 echo '*** ' And for g++ I will use the options:
241 echo '*** ' -I${INSTALLDIR}/${EXECDIR}/lib/g++-include
242 echo '*** ' -L${INSTALLDIR}/${EXECDIR}/lib
244 esac # ${INSTALLHOST}
245 echo '*** ' For further help, please refer to ${CHANGING_PATHS}
246 echo '*** ' in ${NOTES}.
248 GPLUSOPTIONS="-I${INSTALLDIR}/${EXECDIR}/lib/g++-include -L${INSTALLDIR}/${EXECDIR}/lib"
250 esac # ${INSTALLDIR}
252 emacs)
253 case "${OURWD}" in
254 "${DEFAULTWD}") ;;
256 echo '***' I cannot test Emacs.
257 echo '*** ' The provided Emacs binary can only run from the default
258 echo '*** ' installation directory. If you wish to run emacs, please
259 echo '*** ' refer to ${CHANGING_PATHS} in ${NOTES}.
260 exit 1
262 esac # ${INSTALLDIR}
264 *) true ;;
265 esac # ${tool}
266 done # for tool in ${TOOLS}
268 *) true ;;
269 esac # ${action}
270 done # for action in ${ACTIONS}
274 for action in ${ACTIONS} ; do
275 case ${action} in
276 rm | extract) true ;;
277 fix)
278 if echo ${TOOLS} | grep comp > /dev/null ; then
279 NOTFIXED="fixincludes"
280 if echo ${ACTIONS} | grep test > /dev/null ; then
281 JOINER=" or "
282 else
283 true
284 fi # echo ${ACTIONS}
285 else
286 # echo '***' If you only install Emacs you do not need to run fixincludes.
287 # ERROR=true
288 true
289 fi # echo ${TOOLS}
291 test) NOTTESTED="the installation tests" ;;
292 esac # ${action}
293 done # for action in ${ACTIONS}
295 esac # ${INSTALLHOST}
297 *) ;;
298 esac # ${ERROR}
300 if [ -n "${NOTFIXED}" -o -n "${NOTTESTED}" ] ; then
301 case "${INSTALLHOST}" in
302 "||HOSTstr||") ;;
304 echo '*** ' This machine appears to be a \"${INSTALLHOST}\".
305 echo '*** ' You may still run \"$0 -extract ...\" on this machine and then
306 echo '*** ' run the other steps on the machine on which you wish to install.
307 echo '*** ' You will need to do these steps separately.
308 echo '*** ' For more information, please refer to
309 echo '*** ' ${ANOTHER_TAPE} in ${NOTES}.
310 ERROR=true
312 esac # ${INSTALLHOST}
313 fi # [ -n ${NOTFIXED -o -n ${NOTTESTED} ]
315 ### if we can't read the tape drive...
316 popdir=`pwd`
318 if [ ! -d "${LOGDIR}" ] ; then
319 if mkdir ${LOGDIR}; then
320 true
321 else
322 echo '*** ' Can not write logs to \"${LOGDIR}\" because it does not exist.
323 echo '*** ' Try creating it with \"mkdir ${LOGDIR}\" and then try running Install again.
324 exit 1
326 else
327 if [ ! -w "${LOGDIR}" ] ; then
328 echo '*** ' Can not write logs to \"${LOGDIR}\" because I do not have write permission.
329 ls -lad ${LOGDIR}
330 echo '*** ' Please fix this and then try running Install again.
331 exit 1
332 fi # ! -r ${LOGDIR}
333 fi # ! -d ${LOGDIR}
336 cd ${INSTALLDIR}
338 ### There is a window here that I don't know how to handle gracefully from
339 ### shell. If the directory DID exist and WAS executable but dissappeared
340 ### before we could cd into it, we're kinda hosed. If you get a call about
341 ### this, make sure the directory exists, is readable, is executable, is the
342 ### either the default installation directory or the -installdir=directory
343 ### given on the command line. Then ask them to just try again. A few times.
344 ### If you get the same error every time, we've got a very strange bug. I
345 ### can't help you.
347 if [ "$?" != "0" ] ; then
348 echo '***' Cannot cd to \"${INSTALLDIR}\". This is a problem.
349 echo '*** ' For further help, please refer to
350 echo '*** ' ${NO_ACCESS} in ${NOTES} or call
351 echo '*** ' ${HOTLINE}
352 exit 1
355 if echo ${ACTIONS} | grep extract > /dev/null ; then
356 if [ -z "${ERROR}" -a ! -r "${TAPE}" ] ; then
357 ### try checking for a relative tape path
358 if [ -r ${popdir}/${TAPE} ] ; then
359 TAPE=${popdir}/${TAPE}
360 echo '***' Using TAPE device \"${TAPE}\".
361 else
362 echo '***' Can not read from TAPE device, \"${TAPE}\".
363 cd ${popdir} ; ls -lasd ${TAPE}
364 echo '*** ' Try using \"./Install -tape=/dev/something ...\" to name your tape
365 echo '*** ' drive or refer to ${MIGHT_WRONG} in
366 echo '*** ' ${NOTES}.
367 exit 1
368 fi # ! -r ${popdir}/${TAPE}
369 fi # -z ${ERROR}
370 fi # extract in ${ACTIONS}
372 cd ${popdir}
374 ### bail out
376 case "${ERROR}" in
377 "") ;;
379 cat <<EOF
380 You may supply at least one format on the command line. Recognized formats
381 are:
382 binaries for binaries
383 source for source code
384 The default is both source and binaries.
386 You may also supply actions. Recognized actions are:
387 extract read the appropriate files from tape
388 fixincludes build a directory of corrected header files for comp-tools
389 test run a very brief verification of your installation
390 Default actions are extract, fixincludes, and test, although fixincludes is not
391 necessary for emacs.
393 There are two other options:
394 -tape=DEVICE asks Install to read the necessary files from DEVICE. The
395 default DEVICE is ||DEVdflt||, the ||TAPdflt||, cartridge tape
396 drive on most ||HOSTstr||s.
397 -installdir=DIRECTORY asks Install to install files into DIRECTORY.
398 The default DIRECTORY is ${INSTALLDIR_DEFAULT}.
399 No action has been taken.
401 exit 1
403 esac
408 ### build a file list
409 ### (easy this round because we have only one package).
412 FILE_LIST=
413 TRIGGERS=
415 for arch in ${ARCH} ; do
416 case ${arch} in
417 bin)
418 FILE_LIST="${FILE_LIST} \
419 ${VERSION}/Install \
420 ${VERSION}/CYGNUS \
421 ${EXECDIR}/lib \
422 ${EXECDIR}/bin \
423 ${VERSION}/include \
424 ${VERSION}/info \
425 ${VERSION}/lib \
426 ${VERSION}/man"
427 for tool in ${TOOLS} ; do
428 case ${tool} in
429 comp) TRIGGERS="${TRIGGERS} ${EXECDIR}/bin/gcc" ;;
430 emacs) TRIGGERS="${TRIGGERS} ${EXECDIR}/bin/emacs" ;;
432 echo '***' Oops. Sanity failure on triggers for binaries for ${tool}.
433 exit 1
435 esac
436 done
438 src)
439 FILE_LIST="${FILE_LIST} \
440 ${VERSION}/Install \
441 ${VERSION}/CYGNUS \
442 ${VERSION}/src"
443 for tool in ${TOOLS} ; do
444 case ${tool} in
445 comp) TRIGGERS="${TRIGGERS} ${VERSION}/src/gcc/gcc.c" ;;
446 emacs) TRIGGERS="${TRIGGERS} ${VERSION}/src/emacs/src/emacs.c" ;;
448 echo '***' Oops. Sanity failure on triggers for source for ${tool}.
449 exit 1
451 esac
452 done
455 echo '***' Oops. Sanity failure on triggers for arch ${arch}.
457 esac
458 done
462 ### removal
466 if echo ${ACTIONS} | grep rm > /dev/null 2>&1 ; then
467 if [ ! -d "${INSTALLDIR}" ] ; then
468 echo '***' Cannot remove anything from \"${INSTALLDIR}\" because it does not exist.
469 echo '*** ' You probably do not need to remove anything.
470 else
471 popdir=`pwd`
472 if [ ! -d "${INSTALLDIR}" ] ; then
473 echo '***' Can not cd to \"${INSTALLDIR}\" because it does not exist.
474 echo '*** ' You probably do not need to remove anything.
475 exit 1
476 else
477 if [ ! -r "${INSTALLDIR}" ] ; then
478 echo '***' Can not cd to \"${INSTALLDIR}\" because I do not have execute permission.
479 ls -lad ${INSTALLDIR}
480 echo '*** ' Please fix this and then try running Install again. For
481 echo '*** ' more information, please refer to ${NO_ACCESS}
482 echo '*** ' in ${NOTES}.
483 exit 1
487 cd ${INSTALLDIR}
489 ### see also the above note about the timing window.
491 if [ "$?" != "0" ] ; then
492 echo '***' Cannot cd to \"${INSTALLDIR}\". This is a problem.
493 echo '*** ' For further help, please refer to
494 echo '*** ' ${NO_ACCESS} in ${NOTES} or call
495 echo '*** ' ${HOTLINE}
496 exit 1
497 else
498 true
501 if [ ! -d "${VERSION}" ] ; then
502 echo '***' Cannot remove anything from \"${INSTALLDIR}/${VERSION}\" because it does not exist.
503 echo '*** ' You probably do not need to remove anything.
504 exit 1
505 else
506 true
509 echo Removing from \"${INSTALLDIR}\"...
511 if rm -rf ${FILE_LIST} ; then
512 # if neither binaries nor source are installed, remove installdir
513 if [ -d ${INSTALLDIR}/${EXECDIR} \
514 -o -d ${INSTALLDIR}/${VERSION}/src ] ; then
515 true
516 else
517 if rm -rf "${INSTALLDIR}/${VERSION}" ; then
518 true
519 else
520 if [ ! -w "${INSTALLDIR}" ] ; then
521 echo '***' I can not remove ${INSTALLDIR}/${VERSION}
522 echo '*** ' because I do not have write access to \"${INSTALLDIR}\"
523 echo '*** ' Please fix this and try running Install again. For more information
524 echo '*** ' please refer to ${NO_ACCESS} in ${NOTES}.
525 exit 1
526 else
527 echo '***' I do not know why I can not remove ${INSTALLDIR}/${VERSION}. This is
528 echo '*** ' probably not a problem.
530 exit 1
534 echo Removed.
535 else
536 echo '***' There appears to have been a removal error.
537 echo '*** ' Chances are that this is not a problem, but you might try removing
538 echo '*** ' again.
539 exit 1
542 echo Cygnus Support software distribution removed!
543 else
544 true
545 fi # if removing
549 ### extraction
553 if echo ${ACTIONS} | grep extract > /dev/null 2>&1 ; then
554 if [ ! -d "${INSTALLDIR}" ] ; then
555 echo Trying to create \"${INSTALLDIR}\"...
556 if mkdir ${INSTALLDIR} ; then
557 echo Created \"${INSTALLDIR}\".
558 else
559 echo '***' I can not make directory, \"${INSTALLDIR}\".
561 ### attempt to diagnose...
563 DIR=`echo ${INSTALLDIR} | ${SED} -e 's:/[^/]*$::'`
564 if [ ! -d "${DIR}" ] ; then
565 echo '*** ' It looks as though \"${DIR}\" does not even exist.
566 exit 1
567 else
568 if [ ! -w "${DIR}" ] ; then
569 echo '*** ' It looks as though you do not have write access to \"${DIR}\".
570 echo '*** ' Please fix this and try running Install again. For more information
571 echo '*** ' please refer to ${NO_ACCESS} in ${NOTES}.
572 exit 1
573 else
574 echo '*** ' I do not know why I can not create \"${INSTALLDIR}\". This is a problem.
575 echo '*** ' Please call ${HOTLINE}
576 exit 1
577 fi # ! -w ${DIR}
578 fi # ! -d ${DIR}
579 fi # mkdir ${INSTALLDIR}
580 else
581 true
582 fi # ! -d ${INSTALLDIR}
584 cd ${INSTALLDIR}
586 if [ "$?" = "0" ] ; then
587 for trigger in ${TRIGGERS} ; do
588 if [ -r "${trigger}" ] ; then
589 echo '***' \"${INSTALLDIR}/${trigger}\" exists and I will not overwrite it.
590 echo '*** ' If you really want to install it again, please remove it first.
591 exit 1
592 else
593 true
594 fi # -r ${trigger}
595 done # for trigger
596 else
597 echo '***' I can not cd to \"${INSTALLDIR}\".
599 ### attempt to diagnose...
601 if [ ! -r "${INSTALLDIR}" ] ; then
602 echo '*** ' It looks as though you do not have execute permission to \"${INSTALLDIR}\".
603 else
604 true
605 fi # ! -r ${INSTALLDIR}
607 echo '*** ' For further help, please refer to
608 echo '*** ' ${NO_ACCESS} in ${NOTES}.
609 exit 1
610 fi # status is zero
613 ### remove redundant names from the list
614 echo ${FILE_LIST} ${COMMONS} ${EMACSHIBIN} | tr ' ' '
615 ' | sort | uniq > ${LOGDIR}/extract_list
617 echo It will take some time for me to read the tape.
618 echo Verbose output will be saved in ${LOGDIR}/tar.log
619 echo Extracting into \"${INSTALLDIR}\"...
621 ### make sure things come off the tape as they were written, but minus what could be a security hole.
622 umask 0
624 ### using the no rewind device, so rewind and fsf to be sure.
626 if ${MT} -f ${TAPE} rewind > /dev/null 2>&1 ; then
627 if ${MT} -f ${TAPE} fsf 1 ; then
628 true
629 else
630 echo '***' Could not forward space tape device \"${TAPE}\".
631 exit 1
633 else
634 if test -r ${TAPE} ; then
635 true
636 else
637 echo '***' Could not rewind tape device \"${TAPE}\".
638 exit 1
640 fi # mt ${TAPE} rewind
642 if dd if=${TAPE} bs=124b | compress -d | ${TAR} ${TARKEYS} `cat ${LOGDIR}/extract_list` > ${LOGDIR}/tar.log 2>&1 && test -d ${VERSION} ; then
643 if [ -d ${INSTALLDIR}/${EXECDIR}/bin ] ; then
644 echo Extracted.
645 else
646 echo '***' The extraction has failed. The directory
647 echo '***' ${INSTALLDIR}/${EXECDIR}/bin was not extracted.
648 echo '*** ' The output from the tar command has been logged in ${LOGDIR}/tar.log
649 echo '*** ' I do not know how to continue until this problem has been
650 echo '*** ' corrected. If you do not know how to fix it either, please
651 echo '*** ' call ${HOTLINE}.
652 exit 1
655 if (${MT} -f ${TAPE} rewind > /dev/null 2>&1) ; then
656 true
657 else
658 true
659 fi # mt rewind
660 else
661 echo '***' There appears to have been an extraction error.
662 echo '*** ' The output from the tar command has been logged in ${LOGDIR}/tar.log
663 echo '*** ' I do not know how to continue until this problem has been
664 echo '*** ' corrected. If you do not know how to fix it either, please
665 echo '*** ' call ${HOTLINE}.
666 exit 1
667 fi # dd | compress | tar ....
669 rm -f ${LOGDIR}/extract_list
670 echo Cygnus Support software distribution extracted!
671 else
672 true
673 fi # extraction in actions
677 ### fixincludes
681 if echo ${ACTIONS} | grep fix > /dev/null 2>&1 ; then
682 echo Running fixincludes for ${INSTALLHOST}.
683 echo Verbose output will be stored in ${LOGDIR}/fixincludes.log
684 echo This will take some time.
685 LIB=${INSTALLDIR}/${EXECDIR}/lib/gcc-lib/||HOSTstr||/||GCCvn||/include ; export LIB
687 if mkdir ${LIB}/tmpdir && mv ${LIB}/*.h ${LIB}/tmpdir ; then
688 if ${INSTALLDIR}/${VERSION}/lib/fixincludes ${LIB} /usr/include ${INSTALLDIR}/${VERSION}/src/gcc > ${LOGDIR}/fixincludes.log ; then
689 mv ${LIB}/tmpdir/* ${LIB} && rmdir ${LIB}/tmpdir
690 echo Finished with fixincludes.
691 else
692 echo '***' There seems to have been a problem with fixincludes.
693 echo '*** ' The verbose output from the fixincludes script has been logged in
694 echo '*** ' ${INSTALLDIR}/${VERSION}/fixincludes.log.
695 echo '*** ' I do not know how to continue until this problem has been
696 echo '*** ' corrected. If you do not know how to fix it either, please
697 echo '*** ' call ${HOTLINE}.
698 mv ${LIB}/tmpdir/* ${LIB} && rmdir ${LIB}/tmpdir
699 exit 1
700 fi #
701 else
702 echo '***' Not able to create the temporary include dir
703 echo '*** ' Please ensure that write permissions for
704 echo '*** ' ${LIB} are allowed.
705 echo '*** ' Or call ${HOTLINE} for more information.
706 exit 1
708 echo Fixed include files installed!
709 else
710 true
711 fi # fix in actions
715 ### testing the installation
719 if echo ${ACTIONS} | grep test > /dev/null 2>&1 && echo ${ARCH} | grep bin > /dev/null 2>&1 ; then
720 popdir=`pwd`
721 cd ${LOGDIR}
722 for tool in ${TOOLS} ; do
723 case ${tool} in
724 comp)
725 if [ -f ${INSTALLDIR}/${EXECDIR}/bin/gcc ] ; then
726 cat > ${LOGDIR}/hello.c <<'e!o!f'
727 #include <stdio.h>
729 extern int printf();
731 int main(int argc, char **argv) {
732 (void) printf("hello: The compilation tools appear to be installed correctly on your %s.\n",
733 MACHINE);
734 return(0);
735 } /* main() */
736 e!o!f
737 if ${INSTALLDIR}/${EXECDIR}/bin/gcc -Wall -O -g \
738 -DMACHINE=\"${INSTALLHOST}\" ${LOGDIR}/hello.c -o ${LOGDIR}/hello ; then
739 if ${LOGDIR}/hello ; then
740 echo This is good.
741 else
742 echo '***' Hello.c fails to run. This is a problem.
743 echo '*** ' Please call ${HOTLINE}
744 exit 1
745 fi # ./hello
746 else
747 echo '***' Hello.c fails to compile. This is a problem.
748 echo '*** ' Please call ${HOTLINE}
749 exit 1
750 fi # run gcc
752 ### now check for fixed includes.
753 cat > ${LOGDIR}/test-ioctl.c << 'e!o!f'
754 #include <sys/types.h>
755 #include <sys/stat.h>
756 #include <fcntl.h>
757 #include <math.h>
759 double atof(const char *);
761 #ifdef __sun__
762 #include <sys/filio.h>
764 extern int ioctl();
765 extern int perror();
766 #endif /* __sun__ */
768 extern int printf();
770 int main(int argc, char **argv) {
771 #ifdef __sun__
772 long l;
773 int fd;
774 int retval;
776 if ((fd = open("/dev/tty", O_RDONLY)) == -1) {
777 (void) perror("test-ioctl: can't open /dev/null");
778 return(1);
779 } else if ((retval = ioctl(fd, FIONREAD, &l)) != 0) {
780 (void) perror("test-ioctl: ioctl failed");
781 (void) printf("test-ioctl: Most likely, you have not run \"Install fixincludes\" on this machine.\n");
782 return(2);
784 #endif /* __sun__ */
786 printf("test-ioctl: Ansi versions of the system header files, (the fixed includes),\n");
787 printf("test-ioctl: appear to be installed correctly.\n");
789 /* that's right. If closing /dev/tty fails, I don't want to know about it. */
791 return(0);
793 e!o!f
795 case "||HOSTstr||" in
796 sun3 | sun4 | decstation)
797 if ${INSTALLDIR}/${EXECDIR}/bin/gcc -Wall -O -g \
798 -DMACHINE=\"${INSTALLHOST}\" ${LOGDIR}/test-ioctl.c -o ${LOGDIR}/test-ioctl ; then
799 if ${LOGDIR}/test-ioctl ; then
800 echo This is good.
801 else
802 case "$?" in
804 echo '***' test-ioctl.c fails to read /dev/tty. If you were running Install
805 echo '*** ' in batch or from a daemon, please try running it again interactively.
806 echo '*** ' If not, please call ${HOTLINE}
807 exit 1
810 echo '***' test-ioctl.c fails to ioctl.
811 echo '*** ' Most likely you need to run \"Install fixincludes\".
812 echo '*** ' Please run \"Install fixincludes\" and
813 echo '*** ' then try this test again. For an explanation see
814 echo '*** ' ${WHY_FIXINCLUDES} in ${NOTES}.
815 exit 1
818 echo '***' test-ioctl.c fails to run. This is a problem.
819 echo '*** ' Please call ${HOTLINE}
820 exit 1
822 esac # $?
823 exit 1
824 fi # test-ioctl
825 else
826 ### this presupposes that hello.c DID compile.
827 echo '***' test-ioctl.c fails to compile. This is a problem.
828 echo '*** ' Please call ${HOTLINE}
829 exit 1
830 fi # run gcc
832 iris4)
833 if [ ! -f ${INSTALLDIR}/${EXECDIR}/lib/gcc-lib/||HOSTstr||/||GCCvn||/include/sys/cfeiroute.h ]
834 then
835 echo '***' You seem to be missing ${INSTALLDIR}/${EXECDIR}/lib/gcc-lib/||HOSTstr||/||GCCvn||/include/sys/cfeiroute.h.
836 echo '*** ' Most likely you need to run \"Install fixincludes\".
837 echo '*** ' Please run \"Install fixincludes\" and
838 echo '*** ' then try this test again. For an explanation see
839 echo '*** ' ${WHY_FIXINCLUDES} in ${NOTES}.
840 exit 1
841 fi # test fixincluded file
843 sparc-sun-solaris2)
844 if [ ! -f ${INSTALLDIR}/${EXECDIR}/lib/gcc-lib/||HOSTstr||/||GCCvn||/include/ieeefp.h ]
845 then
846 echo '***' You seem to be missing ${INSTALLDIR}/${EXECDIR}/lib/gcc-lib/||HOSTstr||/||GCCvn||/include/ieeefp.h.
847 echo '*** ' Most likely you need to run \"Install fixincludes\".
848 echo '*** ' Please run \"Install fixincludes\" and
849 echo '*** ' then try this test again. For an explanation see
850 echo '*** ' ${WHY_FIXINCLUDES} in ${NOTES}.
851 exit 1
855 rs6000)
856 if [ ! -f ${INSTALLDIR}/${EXECDIR}/lib/gcc-lib/||HOSTstr||/||GCCvn||/include/piostruct.h ]
857 then
858 echo '***' You seem to be missing ${INSTALLDIR}/${EXECDIR}/lib/gcc-lib/||HOSTstr||/||GCCvn||/include/piostruct.h.
859 echo '*** ' Most likely you need to run \"Install fixincludes\".
860 echo '*** ' Please run \"Install fixincludes\" and
861 echo '*** ' then try this test again. For an explanation see
862 echo '*** ' ${WHY_FIXINCLUDES} in ${NOTES}.
863 exit 1
864 fi # test fixincluded file
866 esac # ||HOSTstr||
867 else
868 true
869 fi # test if gcc present
871 ### now check for g++.
872 if [ -f ${INSTALLDIR}/${EXECDIR}/bin/g++ ] ; then
873 cat > ${LOGDIR}/hello.C << 'e!o!f'
874 #include <iostream.h>
876 int main(int argc, char**argv)
878 char *machine = MACHINE;
879 cout << "hello: g++ appears to be installed correctly on your "
880 << machine << ".\n";
881 return(0);
883 e!o!f
884 if ${INSTALLDIR}/${EXECDIR}/bin/gcc ${GPLUSOPTIONS} -Wall -O -g \
885 -DMACHINE=\"${INSTALLHOST}\" ${LOGDIR}/hello.C -o ${LOGDIR}/Hello -lg++ ; then
886 if ${LOGDIR}/Hello ; then
887 echo This is good.
888 else
889 echo '***' hello.C fails to run. This is a problem.
890 echo '*** ' Please call ${HOTLINE}
891 exit 1
892 fi # ./Hello
893 else
894 ### this presupposes that hello.c DID compile.
895 echo '***' hello.C fails to compile. This is a problem.
896 echo '*** ' Please call ${HOTLINE}
897 exit 1
898 fi # run g++
900 ### now check for static initialization.
901 cat > ${LOGDIR}/static-init.C << 'e!o!f'
902 #include <iostream.h>
903 int Three;
905 struct Foo {
906 Foo(int i) { Three = i; }
909 Foo foo(3);
911 int main(int argc, char**argv)
913 if (Three != 3) {
914 cout << "static-init: static initialization fails.\n";
915 return(1);
918 cout << "static-init: static initialization appears to work.\n";
919 return(0);
921 e!o!f
922 if ${INSTALLDIR}/${EXECDIR}/bin/gcc ${GPLUSOPTIONS} -Wall -O -g \
923 -DMACHINE=\"${INSTALLHOST}\" ${LOGDIR}/static-init.C -o ${LOGDIR}/static-init -lg++ ; then
924 if ${LOGDIR}/static-init ; then
925 echo This is good.
926 else
927 echo '***' Static initialization is not working. This is a problem.
928 echo '*** ' Please call ${HOTLINE}
929 exit 1
930 fi # run static-init
931 else
932 ### this presupposes that it DID compile.
933 echo '***' static-init.c fails to compile. This is a problem.
934 echo '*** ' Please call ${HOTLINE}
935 exit 1
936 fi # run g++
937 else # no g++, so don't test it
938 true
939 fi # no g++
941 emacs)
942 cat > ${LOGDIR}/hello.el <<'e!o!f'
943 (server-start)
944 (message "Emacs appears to be installed correctly.")
945 (kill-emacs 0)
946 e!o!f
947 if ${INSTALLDIR}/${EXECDIR}/bin/emacs -batch -l ${LOGDIR}/hello.el ; then
948 echo This is good.
949 else
950 echo '***' Emacs fails to run. This is a problem.
951 echo '*** ' Please call ${HOTLINE}
952 exit 1
955 src) # if anyone can tell me how to test the installation of source...
956 true
959 echo '***' I do not know how to test for tool \"${tool}\" because I have never
960 echo '*** ' heard of it. This is a problem. Please call ${HOTLINE}.
961 exit 1
963 esac
964 done
965 rm -f hello* test-ioctl* static-init* Hello*
966 cd ${popdir}
967 echo Cygnus Support software distribution tested!
968 else
969 true
972 echo Done.
974 exit 0
977 ### Local Variables:
978 ### comment-column: 0
979 ### fill-column: 131
980 ### End:
983 ### End of Install