Mailing List Archive

Re: On perl5/solaris/gcc
Here's another draft of the perl5/solaris/gcc sanity-checker. This is
reorganized and maybe simplified. I now use Andy's suggestion to use more
of the "gcc -v" output, so I'm asking gcc what it's doing and who it's
talking to rather than making my own guesses about these things. Also
removed the assumption that the gcc binary is called "gcc" (my sight
installed 2.7.0 as "gcc.270").

How about another round of comments?

Dean


-------------

case $PATH in
*/usr/ucb*:/usr/bin:*|*/usr/ucb*:/usr/bin) cat <<END

NOTE: Some people have reported problems with /usr/ucb/cc.
Remove /usr/ucb from your PATH if you have difficulties.

END
;;
esac


# Check that /dev/fd is mounted. If it is not mounted, let the
# user know that suid scripts may not work.
/usr/bin/df /dev/fd 2>&1 > /dev/null
case $? in
0) ;;
*)
cat <<END

NOTE: Your system does not have /dev/fd mounted. If you want to
be able to use set-uid scripts you must ask your system administrator
to mount /dev/fd.

END
;;
esac


# See if libucb can be found in /usr/lib. If it is, warn the user
# that this may cause problems while building Perl extensions.
/usr/bin/ls /usr/lib/libucb* >/dev/null 2>&1
case $? in
0)
cat <<END

NOTE: libucb has been found in /usr/lib. libucb should reside in
/usr/ucblib. You may have trouble while building Perl extensions.

END
;;
esac


# See if make(1) is GNU make(1).
# If it is, make sure the setgid bit is not set.
case `make -v 2>&1` in
*GNU*)
tmp=`/usr/bin/which make`
case `/usr/bin/ls -l $tmp` in
??????s*)
cat <<END

NOTE: Your PATH points to GNU make, and your GNU make has the set-group-id
bit set. You must either rearrange your PATH to put /usr/ccs/bin before the
GNU utilities or you must ask your system administrator to disable the
set-group-id bit on GNU make.

END
;;
esac
esac


# If the C compiler is gcc:
# - check the fixed-includes
# - check as(1) and ld(1), they should not be GNU
# If the C compiler is not gcc:
# - check as(1) and ld(1), they should not be GNU
#
case `$cc -v 2>&1` in
*gcc*)
#
# Using gcc.
#
#echo Using gcc

# Get gcc to share its secrets.
echo 'main() { return 0; }' > try.c
verbose=`$cc -v -o try try.c 2>&1`
tmp=`echo "$verbose" | grep '^Reading' |
awk '{print $NF}' | sed 's/specs$/include/'`

# Determine if the fixed-includes look like they'll work.
sed 1q $tmp/stdarg.h 2>&1 | grep 'stdarg.h for GNU' 2>&1 >/dev/null
case $? in
0) ;;
*)
cat <<END

NOTE: The fixincludes or just-fixinc script for gcc was not run
properly. Your gcc may not be able to compile Perl. Inform your system
administrator that $cc is not properly installed.

END
;;
esac

# See if as(1) is GNU as(1). GNU as(1) won't work for this job.
case $verbose in
*/usr/ccs/bin/as*) ;;
*)
cat <<END

NOTE: You are using GNU as(1). GNU as(1) will not build Perl.
You must arrange to use /usr/ccs/bin/as, perhaps by setting
GCC_EXEC_PREFIX.

END
;;
esac

# See if ld(1) is GNU ld(1). GNU ld(1) won't work for this job.
case $verbose in
*/usr/ccs/bin/ld*) ;;
*)
cat <<END

NOTE: You are using GNU ld(1). GNU ld(1) will not build Perl.
You must arrange to use /usr/ccs/bin/ld, perhaps by setting
GCC_EXEC_PREFIX.

END
;;
esac

;; #using gcc
*)
#
# Not using gcc.
#
#echo Not using gcc

# See if as(1) is GNU as(1). GNU as(1) won't work for this job.
case `as --version < /dev/null 2>&1` in
*GNU*)
cat <<END

NOTE: You are using GNU as(1). GNU as(1) will not build Perl.
You must arrange to use /usr/ccs/bin, perhaps by adding it to the
beginning of your PATH.

END
;;
esac

# See if ld(1) is GNU ld(1). GNU ld(1) won't work for this job.
case `ld --version < /dev/null 2>&1` in
*GNU*)
cat <<END

NOTE: You are using GNU ld(1). GNU ld(1) will not build Perl.
You must arrange to use /usr/ccs/bin, perhaps by adding it to the
beginning of your PATH

END
;;
esac

;; #not using gcc
esac