Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/bootstrap bootstrap: Consolidate setting of CC if unset.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/3189525d05e7
branches:  trunk
changeset: 432734:3189525d05e7
user:      jperkin <jperkin%pkgsrc.org@localhost>
date:      Mon May 25 07:32:59 2020 +0000

description:
bootstrap: Consolidate setting of CC if unset.

Should fix issue seen on IRIX where --compiler was specified but CC was not
passed to bootstrap, resulting in "gcc" being picked as the default.

diffstat:

 bootstrap/bootstrap |  17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

diffs (63 lines):

diff -r 7934a76c24bc -r 3189525d05e7 bootstrap/bootstrap
--- a/bootstrap/bootstrap       Mon May 25 06:47:40 2020 +0000
+++ b/bootstrap/bootstrap       Mon May 25 07:32:59 2020 +0000
@@ -1,6 +1,6 @@
 #! /bin/sh
 
-# $NetBSD: bootstrap,v 1.279 2020/05/06 15:34:31 jperkin Exp $
+# $NetBSD: bootstrap,v 1.280 2020/05/25 07:32:59 jperkin Exp $
 #
 # Copyright (c) 2001-2011 Alistair Crooks <agc%NetBSD.org@localhost>
 # All rights reserved.
@@ -1003,10 +1003,8 @@
        # Clang pretends to be GCC, so we have to check it first.
        if [ $compiler_is_clang -gt 0 ]; then
                compiler="clang"
-               test -n "$CC" || CC=clang
        elif [ $compiler_is_gnu -gt 0 ]; then
                compiler="gcc"
-               test -n "$CC" || CC=gcc
        else
                case "$opsys" in
                IRIX)
@@ -1015,15 +1013,22 @@
                        else
                                compiler="ido"
                        fi
-                       test -n "$CC" || CC=cc
                        ;;
                SunOS)  compiler="sunpro"
-                       test -n "$CC" || CC=cc
                        ;;
                esac
        fi
 fi
 
+case "$compiler" in
+clang|gcc)
+       test -n "$CC" || CC=$compiler
+       ;;
+*)
+       test -n "$CC" || CC=cc
+       ;;
+esac
+
 has_ssp_support() {
        mkdir_p_early ${wrkdir}/tmp
        echo 'int main(void){return 0;}' > ${wrkdir}/tmp/ssp.c
@@ -1237,7 +1242,6 @@
 case "$need_ksh" in
 yes)   echo_msg "Bootstrapping ksh"
        copy_src $pkgsrcdir/shells/pdksh/files ksh
-       test -n "$CC" || CC=gcc # default to gcc if no compiler is specified
        run_cmd "(cd $wrkdir/ksh && env $BSTRAP_ENV $shprog ./configure $configure_quiet_flags --prefix=$prefix --infodir=$infodir --mandir=$mandir --sysconfdir=$sysconfdir && $bmake 
$make_quiet_flags -j$make_jobs)"
        run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/ksh/ksh $wrkdir/bin/pdksh"
        echo "TOOLS_PLATFORM.sh?=               $prefix/bin/pdksh" >> ${TARGET_MKCONF}
@@ -1255,7 +1259,6 @@
 case "$need_awk" in
 yes)   echo_msg "Bootstrapping awk"
        copy_src $pkgsrcdir/lang/nawk/files awk
-       test -n "$CC" || CC=gcc # default to gcc if no compiler is specified
        run_cmd "(cd $wrkdir/awk && $bmake $make_quiet_flags -j$make_jobs -f Makefile CC=\"${CC}\" CFLAGS=\"${CFLAGS}\")"
        run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/awk/a.out $wrkdir/bin/nawk"
        echo "TOOLS_PLATFORM.awk?=              $prefix/bin/nawk" >> ${TARGET_MKCONF}



Home | Main Index | Thread Index | Old Index