head	1.12;
access;
symbols
	libc-5-4-46:1.12
	libc-5-4-45:1.12
	libc-5-4-44:1.12
	libc-5-4-43:1.12
	libc-5-4-42:1.12
	libc-5-4-41:1.12
	libc-5-4-40:1.12
	libc-5-4-39:1.12
	libc-5-4-38:1.12
	libc-5-4-37:1.12
	libc-5-4-36:1.12
	libc-5-4-35:1.12
	libc-5-4-34:1.11
	libc-5-4-33:1.11
	libc-5-4-32:1.11
	libc-5-4-31:1.11
	libc-5-4-30:1.11
	libc-5-4-29:1.11
	libc-5-4-28:1.11
	libc-5-4-27:1.11
	libc-5-4-26:1.11
	libc-5-4-25:1.11
	libc-5-4-24:1.11
	libc-5-4-23:1.11
	libc-5-4-22:1.11
	libc-5-4-21:1.11
	libc-5-4-20:1.11
	libc-5-4-19:1.11
	libc-5-4-18:1.11
	libc-5-4-17-public:1.11
	libc-5-4-17:1.11
	libc-5-4-16:1.11
	libc-5-4-15:1.11
	libc-5-4-14:1.11
	libc-5-4-13:1.11
	libc-5-4-12:1.11
	libc-5-4-11:1.11
	libc-5-4-10:1.11
	libc-5-4-9:1.11
	libc-5-4-8:1.11
	libc-5-4-7-public:1.11
	libc-5-4-7:1.11
	libc-5-4-6:1.10
	libc-5-4-5:1.10
	libc-5-4-4:1.10
	libc-5-4-3:1.10
	libc-5-4-2:1.10
	libc-5-4-1:1.9
	libc-5-4-0:1.9
	libc-5-3-12:1.9
	libc-5-3-11:1.9
	libc-5-3-10:1.9
	libc-5-3-9:1.9
	libc-5-3-8:1.9
	libc-5-3-7:1.9
	libc-5-3-7-pre:1.9
	libc-5-3-6:1.9
	libc-5-3-5:1.9
	libc-5-3-4:1.9
	libc-5-3-3:1.9
	libc-5-3-2:1.9
	libc-5-3-1:1.9
	libc-5-3-0:1.8
	libc-5-2-19:1.7
	libc-5-2-18:1.7
	libc-5-2-17:1.7
	libc-5-2-16:1.7
	libc-5-2-15:1.7
	libc-5-2-14:1.6
	libc-5-2-13:1.6
	libc-5-2-12:1.6
	libc-5-2-11:1.6
	libc-5-2-10:1.6
	libc-5-2-9:1.6
	libc-5-2-8-1:1.5
	libc-5-2-8:1.5
	libc-5-2-7:1.5
	libc-5-2-6:1.5
	libc-5-2-5:1.5
	libc-5-2-4:1.5
	libc-5-2-3:1.5
	libc-5-2-2:1.5
	libc-5-2-1:1.5
	libc-5-2-0:1.5
	libc-4-7-4:1.1.1.1.2.1
	libc-5-1-4:1.5
	libc-5-1-3:1.5
	libc-5-1-2:1.5
	libc-5-1-1:1.5
	libc-5-1-0:1.5
	libc-4-7-3:1.1.1.1.2.1
	libc-5-0-12-stable:1.5
	libc-5-0-11:1.5
	libc-5-0-10:1.5
	libc-5-0-9:1.5
	libc-5-0-8:1.5
	libc-5-0-7:1.5
	libc-5-0-6:1.5
	libc-5-0-5:1.5
	libc-5-0-4:1.5
	libc-5-0-3:1.4
	libc-4-7-2:1.1.1.1.2.1
	libc-4-7-1-b:1.1.1.1.2.1.0.2
	libc-5-0-2:1.4
	libc-5-0-1-1:1.4
	libc-5-0-1:1.3
	libc-4-7-1:1.1.1.1.2.1
	libc-5-0-0:1.3
	libc-4-7-0:1.1.1.1.2.1
	libc-4-8-0:1.3
	libc-4-6-27-patches:1.1.1.1.0.2
	libc-4-6-30:1.1.1.1
	libc-4-6-29:1.1.1.1
	libc-4-6-28-6:1.1.1.1
	libc-4-6-28-5:1.1.1.1
	libc-4-6-28-4:1.1.1.1
	libc-4-6-28-3:1.1.1.1
	libc-4-6-28-2:1.1.1.1
	libc-4-6-28-1:1.1.1.1
	libc-4-6-28:1.1.1.1
	libc-4-6-27:1.1.1.1
	linux:1.1.1;
locks; strict;
comment	@# @;


1.12
date	97.07.10.15.43.49;	author hjl;	state Exp;
branches;
next	1.11;

1.11
date	96.09.24.19.02.40;	author hjl;	state Exp;
branches;
next	1.10;

1.10
date	96.06.05.16.07.34;	author hjl;	state Exp;
branches;
next	1.9;

1.9
date	96.01.19.22.03.32;	author hjl;	state Exp;
branches;
next	1.8;

1.8
date	96.01.15.02.42.37;	author hjl;	state Exp;
branches;
next	1.7;

1.7
date	95.11.30.00.47.21;	author hjl;	state Exp;
branches;
next	1.6;

1.6
date	95.09.11.02.26.21;	author hjl;	state Exp;
branches;
next	1.5;

1.5
date	95.05.04.01.04.39;	author hjl;	state Exp;
branches;
next	1.4;

1.4
date	95.04.19.02.37.55;	author hjl;	state Exp;
branches;
next	1.3;

1.3
date	95.03.16.03.03.23;	author hjl;	state Exp;
branches;
next	1.2;

1.2
date	95.03.14.04.36.57;	author hjl;	state Exp;
branches;
next	1.1;

1.1
date	95.02.18.05.33.16;	author hjl;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	95.02.18.05.33.17;	author hjl;	state Exp;
branches
	1.1.1.1.2.1;
next	;

1.1.1.1.2.1
date	95.03.16.03.44.55;	author hjl;	state Exp;
branches;
next	;


desc
@@


1.12
log
@Update for libc 5.4.35.
@
text
@#! /bin/sh
#
# Changes by H.J.Lu
# Original version Mitchum Dsouza <m.dsouza@@mrc-apu.cam.ac.uk>
#
# Simple libc configuration script tested with `bash' and `ksh' and
# Sun `sh'

# The following two are the ANSI sequences for start and end embolden
case $TERM in
vt*|ansi*|con*|xterm*|linux*|screen*)
  S=[1m
  E=[m
  ;;
*)
  S=
  E=
  ;;
esac

# Define some defaults
TARGET_OS=linux
HOST_ROOTDIR=/usr
HOST_BINDIR=${HOST_ROOTDIR}/bin
TARGET_ROOTDIR=/
STATIC_SHARED=
SPEED=fast
BAD_GCCVERSION="Invalid gcc version"
LIBGCC=`gcc --print-libgcc-file-name`
MALLOC=malloc-930716
OLD_GCC=true

# We have to do that to make sure we have the right configuration.
(cd gcc; rm -f config.h  hconfig.h tconfig.h tm.h)

# Get the latest nys directory
NYSDIR="`echo nys* | awk '{print $NF}'`"

if [ -f ./config.in ]; then 
#	 grep = ./config.in | .
	eval `grep = ./config.in`
fi

response() {
	echo -n "$1 [$2] ? " 1> /dev/tty
	read answer
	if [ x${answer} = x ]; then
		echo $2
	else
		echo ${answer}
	fi
}

getresponse ()
{
  OLD_TARGET_MACHINE=${TARGET_MACHINE}

  case ${TARGET_ARCH} in
  i*86|pentium)
    TMP=4 
    ;;
  *)
    TMP=m;
    ;;
  esac
  TARGET_ARCH=`response "Build 386, 486, 586 or m68k library code 3/4/5/m" "${TMP}"`

  case i${TARGET_ARCH} in
  i6)
    TARGET_MACHINE=i586-linux
    TARGET_ARCH_x86=5;
    TARGET_ARCH=i386;
    ;;
  i5)
    TARGET_MACHINE=i586-linux
    TARGET_ARCH_x86=5;
    TARGET_ARCH=i386;
    ;;
  i4)
    TARGET_MACHINE=i486-linux
    TARGET_ARCH_x86=4;
    TARGET_ARCH=i386;
    ;;
  i3)
    TARGET_MACHINE=i386-linux
    TARGET_ARCH_x86=3;
    TARGET_ARCH=i386;
    ;;
  im)
    TARGET_MACHINE=m68k-linux
    TARGET_ARCH_x86=;
    TARGET_ARCH=m68k;
    ;;
  *)
    echo Unknown arch: \"${TARGET_ARCH}\".
    exit 1
    ;;
  esac

  TARGET_MACHINE=`response "The target platform" "${TARGET_MACHINE}"`
  TARGET_OS=`response "The target OS" "${TARGET_OS}"`

  TMP=a
  STATIC_SHARED=`response "Build targets (static,shared/all) s/a" "${TMP}"`
  case i${STATIC_SHARED} in
  is)
    STATIC_SHARED=true
    ;;
  *)
    STATIC_SHARED=
    ;;
  esac
  
  get_host_rootdir $TARGET_MACHINE
  HOST_ROOTDIR=`response "Root path to $TARGET_MACHINE related files" "${HOST_ROOTDIR}"`
  HOST_BINDIR=`response "Bin path to gcc" "${HOST_BINDIR}"`
  GCCVERSION=`response "The gcc version" "${GCCVERSION}"`

  TMP=f
  SPEED=`response "Fast build/save space (fast default) f/s" "${TMP}"`
  case i${SPEED}x in
  ifx)
    SPEED=fast
    ;;
  *)
    SPEED=
    ;;
  esac

  MAKE=`response "GNU \\\`make' executable" "${MAKE}"`
  TARGET_ROOTDIR=`response "Root path to installation dirs" "${TARGET_ROOTDIR}"`

  if [ x${NYSDIR} != x ]; then
  TMP=n
  NYS=`response "Build a NYS libc from ${NYSDIR} (n default)  y/n" "${TMP}"`
  case i${NYS}x in
  iyx)
    NYS=true
    ;;
  *)
    NYS=
    ;;
  esac
  fi

  TMP=g
  MALLOC=`response "GNU malloc-93076/dl-malloc (GNU default) g/d" "${TMP}"`
  case i${MALLOC}x in
  igx)
    MALLOC=malloc-930716
    ;;
  *)
    MALLOC=dl-malloc
    ;;
  esac

  TMP=o
  OLD_GCC=`response "Old/new gcc (old default) o/n" "${TMP}"`

  case i${OLD_GCC}x in
  iox)
    OLD_GCC=true
    ;;
  *)
    OLD_GCC=false
    ;;
  esac

}

showdefaults ()
{
  echo 
  echo *******Current defaults********
  echo
  if [ -n "${TARGET_ARCH_x86}" ]; then
    echo "Build ${S}${TARGET_MACHINE}${E} library for ${S}i${TARGET_ARCH_x86}86${E} running ${S}${TARGET_OS}${E}"
  else
    echo "Build ${S}${TARGET_MACHINE}${E} library for ${S}${TARGET_ARCH}${E} running ${S}${TARGET_OS}${E}"
  fi
  if [ x${STATIC_SHARED} = x"true" ]; then
    echo "Build targets are ${S}static and shared libraries only${E}."
  else
    echo "Build targets are ${S}static, shared, debug and profile libraries${E}."
  fi
  echo "Root path to ${S}${TARGET_MACHINE}${E} related files is ${S}${HOST_ROOTDIR}${E}"
  echo "Bin path to gcc is ${S}${HOST_BINDIR}${E}"
  echo "The version of gcc to be used is ${S}${GCCVERSION}${E}"
  if [ x${SPEED} = x"fast" ]; then
    echo "Build option is ${S}fast build${E}."
  else
    echo "Build option is ${S}save space${E}."
  fi
  echo "GNU \`make' executable is ${S}${MAKE}${E}"
  echo "Use ${S}${MALLOC}${E}"
  if [ x${OLD_GCC} = x"true" ]; then
    echo "Use ${S}old gcc${E}."
  else
    echo "Use ${S}new gcc with the crtbegin[S]/crtend[S].o patch${E}."
  fi
  echo "Root path to installation dirs is ${S}${TARGET_ROOTDIR}${E}"
  if [ x${NYS} != x -a x${NYSDIR} != x ]; then
    echo "Build a NYS libc from ${S}${NYSDIR}${E}."
  fi

  echo
}

get_gnu_make ()
{
  make_list="make gmake gnumake"
  gf=0
  v=

  for m in $make_list
  do
    $m -v 2> /dev/null | grep GNU > /dev/null 2>&1
    if [ $? = 0 ]; then
      gf=1
      TMP=`$m -v 2> /dev/null | head -1 | grep GNU | cut -f4 -d' '`
      v="$TMP $v"
      case $TMP in
      3.7*|3.8*|3.9*|4*|5*|6*|7*|8*|9*)
        MAKE=$m
        return
       ;;
      esac
    fi
  done

  if [ $gf = 1 ]; then
    echo GNU make version, $v are found. Need GNU make 3.70 or above.
  else
    echo No GNU make is found. Need GNU make 3.70 or above.
  fi
  exit 1
}

get_target_rootdir ()
{
  if [ -d /home/linux ]; then
    TARGET_ROOTDIR=/home/linux
  fi
}

get_host_rootdir ()
{
  target=$1
#  LIBGCC=`gcc --print-libgcc-file-name`

  if [ ${LIBGCC} != libgcc.a ]; then
    position=2
    TMP=`echo $LIBGCC | cut -f$position -d'/'`
    HOST_ROOTDIR=
    HOST_ROOTDIR=$HOST_ROOTDIR/$TMP
    until [ $TMP = "lib" ]
    do
      position=`expr $position + 1`
      TMP=`echo $LIBGCC | cut -f$position -d'/'`
      HOST_ROOTDIR=$HOST_ROOTDIR/$TMP
    done
    HOST_ROOTDIR=`(cd $HOST_ROOTDIR/..; pwd)`
    HOST_BINDIR=${HOST_ROOTDIR}/bin
  fi
}

get_default_gcc_version ()
{
#  LIBGCC=`gcc -b $1 --print-libgcc-file-name`

  if [ ${LIBGCC} != libgcc.a ]; then
    position=2
    TMP=`echo $LIBGCC | cut -f$position -d'/'`
    until [ $TMP = "gcc-lib" ]
    do
      position=`expr $position + 1`
      TMP=`echo $LIBGCC | cut -f$position -d'/'`
    done
    position=`expr $position + 2`
    GCCVERSION=`echo $LIBGCC | cut -f$position -d'/'`
  else
    GCCVERSION="${BAD_GCCVERSION}"
  fi
}

get_default_gcc_target ()
{
#  LIBGCC=`gcc --print-libgcc-file-name`

  if [ ${LIBGCC} != libgcc.a ]; then
    position=2
    TMP=`echo $LIBGCC | cut -f$position -d'/'`
    until [ $TMP = "gcc-lib" ]
    do
      position=`expr $position + 1`
      TMP=`echo $LIBGCC | cut -f$position -d'/'`
    done
    position=`expr $position + 1`
    DEFAULT_GCC_TARGET=`echo $LIBGCC | cut -f$position -d'/'`
  fi
}

get_target_info ()
{
#  LIBGCC=`gcc --print-libgcc-file-name`

  if [ ${LIBGCC} != libgcc.a ]; then
    position=2
    TMP=`echo $LIBGCC | cut -f$position -d'/'`
    GCC_LIB_DIR=
    GCC_LIB_DIR=$GCC_LIB_DIR/$TMP
    until [ $TMP = "gcc-lib" ]
    do
      position=`expr $position + 1`
      TMP=`echo $LIBGCC | cut -f$position -d'/'`
      GCC_LIB_DIR=$GCC_LIB_DIR/$TMP
    done
    TARGET_MACHINE=`(cd $GCC_LIB_DIR; echo *linux*)`
    if [ xx"${TARGET_MACHINE}"xx != xxxx ]; then
      if [ `echo $TARGET_MACHINE | wc -w` != 1 ]; then
	echo More than one Linux targets found:
	echo "	$TARGET_MACHINE"
	echo $TARGET_MACHINE | grep $DEFAULT_GCC_TARGET > /dev/null
	if [ $? = 0 ]; then
	  TARGET_MACHINE=$DEFAULT_GCC_TARGET
	else
	  TARGET_MACHINE=`echo $TARGET_MACHINE | cut -f1 -d ' '`
	fi
	echo \"$TARGET_MACHINE\" is chosen.
      fi
      TARGET_OS=linux
      case $TARGET_MACHINE in
      *686*)
	TARGET_ARCH_x86=5
	TARGET_ARCH=i386
	;;
      *586*)
	TARGET_ARCH_x86=5
	TARGET_ARCH=i386
	;;
      *486*)
	TARGET_ARCH_x86=4
	TARGET_ARCH=i386
	;;
      *386*)
	TARGET_ARCH_x86=3
	TARGET_ARCH=i386
	;;
      *68*)
	TARGET_ARCH_x86=
	TARGET_ARCH=m68k
	;;
      *)
	echo Oops: Unknown target machine "$TARGET_MACHINE".
	;;
      esac
      TARGET__MACHINE=${TARGET_ARCH}-${TARGET_OS}
    fi
  fi
}

get_host_info ()
{
  # First check out who you are.
  HOST_OS=`uname -s`

  case $HOST_OS in
  [Ll][Ii][Nn][Uu][Xx])
    HOST_OS=linux
    HOST_ROOTDIR=/usr
    HOST_BINDIR=${HOST_ROOTDIR}/bin
    TARGET_ROOTDIR=/
    get_default_gcc_target
    TARGET_ARCH=`uname -m`
    case $TARGET_ARCH in
    *386*)
     TARGET_ARCH_x86=3
     TARGET_ARCH=i386
     ;;
    *486*)
     TARGET_ARCH_x86=4
     TARGET_ARCH=i386
     ;;
    *586*)
     TARGET_ARCH_x86=5
     TARGET_ARCH=i386
     ;;
    *686*)
     TARGET_ARCH_x86=5
     TARGET_ARCH=i386
     ;;
    *68*)
     TARGET_ARCH_x86=
     TARGET_ARCH=m68k
     ;;
    esac
    ;;
  *)
    get_host_rootdir $TARGET_MACHINE
    get_target_rootdir
    ;;
  esac
}

get_default_gcc_target
get_target_info
get_host_info
get_gnu_make
get_default_gcc_version $TARGET_MACHINE
#GCCVERSION=`gcc --version`
get_host_rootdir $TARGET_MACHINE

showdefaults
if [ "${GCCVERSION}" = "${BAD_GCCVERSION}" ]; then
  echo Please provide a valid gcc version: ${S}${BAD_GCCVERSION}${E}!
  echo
  ans=n
else
  ans=`response "Values correct (y/n)" "y"`
fi

while [ x${ans} != x -a x${ans} != xy ]
do
  getresponse
  showdefaults
  if [ "${GCCVERSION}" = "${BAD_GCCVERSION}" ]; then
    echo Please provide a valid gcc version: ${S}${BAD_GCCVERSION}${E}!
    echo
    ans=n
  else
    ans=`response "Values correct (y/n)" "y"`
  fi
done

rm -f config.in

{
  echo STATIC_SHARED="${STATIC_SHARED}"
  echo MAKE="${MAKE}"
  echo SPEED="${SPEED}"
  echo HOST_ROOTDIR="${HOST_ROOTDIR}"
  echo HOST_BINDIR="${HOST_BINDIR}"
  echo TARGET_ROOTDIR="${TARGET_ROOTDIR}"
  echo ifeq \(\$\(ELF\), true\)
  echo TARGET_MACHINE="${TARGET_MACHINE}"
  echo TARGET__MACHINE="${TARGET__MACHINE}"
  echo else
  echo TARGET_MACHINE="${TARGET_MACHINE}aout"
  echo TARGET__MACHINE="${TARGET__MACHINE}aout"
  echo endif
  echo TARGET_OS="${TARGET_OS}"
  echo TARGET_ARCH="${TARGET_ARCH}"
  echo TARGET_ARCH_x86="${TARGET_ARCH_x86}"
  echo MALLOC="${MALLOC}"
  echo OLD_GCC="${OLD_GCC}"
  echo GCCVERSION="${GCCVERSION}"
  if [ x${NYS} != x -a x${NYSDIR} != x ]; then
	echo NYS="${NYS}"
	echo NYSDIR="${NYSDIR}"
	echo MAKE="${MAKE} NYS=${NYS}" 
  fi
  # This is duplicated from Makeconfig; beware.
  REALCC="${HOST_BINDIR}/gcc -V ${GCCVERSION} -b ${TARGET_MACHINE}"
  echo GCC_ARCH_INC_DIR="`${REALCC} -print-libgcc-file-name |
    sed -e 's/libgcc.a/include/'`"
} > config.in
@


1.11
log
@Update for libc 5.4.7.
@
text
@d357 1
d446 1
d449 1
@


1.10
log
@Update for libc 5.4.2.
@
text
@d69 5
d333 4
d384 4
@


1.9
log
@Update for libc 5.3.1.
@
text
@d11 1
a11 1
vt*|ansi*|con*|xterm*|linux*)
d446 4
@


1.8
log
@Update for libc 5.3.0.
@
text
@d11 1
a11 1
vt*|ansi*|con*|xterm*)
d171 1
a171 1
  if [ -n ${TARGET_ARCH_x86} ]; then
@


1.7
log
@Update for libc 5.2.15.
@
text
@d30 2
d140 24
d190 6
d438 2
@


1.6
log
@Update for libc 5.2.9.
@
text
@d389 2
@


1.5
log
@Update for libc 5.0.4
@
text
@d64 1
a64 1
  TARGET_ARCH=`response "Build 386, 486 or m68k library code (486 default) 4/3/m" "${TMP}"`
d67 5
d74 1
a74 1
    TARGET_ARCH_486=true;
d79 1
a79 1
    TARGET_ARCH_486=false;
d84 1
a84 1
    TARGET_ARCH_486=false;
d97 1
a97 1
  STATIC_SHARED=`response "Build targets (static/shared default) s/a" "${TMP}"`
d145 2
a146 2
  if [ ${TARGET_ARCH_486} = "true" ]; then
    echo "Build ${S}${TARGET_MACHINE}${E} library for ${S}i486${E} running ${S}${TARGET_OS}${E}"
d296 4
d301 1
a301 1
	TARGET_ARCH_486=true
d305 1
a305 1
	TARGET_ARCH_486=false
d309 1
a309 1
	TARGET_ARCH_486=false
d335 1
a335 1
     TARGET_ARCH_486=false
d339 5
a343 1
     TARGET_ARCH_486=true
d347 1
a347 1
     TARGET_ARCH_486=false
d403 1
a403 1
  echo TARGET_ARCH_486="${TARGET_ARCH_486}"
@


1.4
log
@Fix libelf.h and add support to shared C++ libraries
@
text
@d38 2
a39 1
	 grep = ./config.in | .
@


1.3
log
@Modified for libc 4.8.0.
@
text
@d31 3
@


1.2
log
@Updated for libc 4.8.0
@
text
@d119 1
a119 1
  NYS=`response "Build a NYS libc from ${NYSDIR} (y default)  y/n" "${TMP}"`
a122 1
    ( cd jump/libc-nys; ./genfuncs )
@


1.1
log
@Initial revision
@
text
@d381 1
a381 1
  echo TARGET_MACHINE="${TARGET_MACHINE}elf"
d383 1
a383 1
  echo TARGET_MACHINE="${TARGET_MACHINE}"
@


1.1.1.1
log
@The Linux C library 4.6.27 (source files).
@
text
@@


1.1.1.1.2.1
log
@Modified for libc 4.7.0.
@
text
@d381 2
a383 2
  echo else
  echo TARGET_MACHINE="${TARGET_MACHINE}aout"
@

