This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: CROSS COMPILE: can build gcc 2.95.3 with glibc 2.2.5 but not libstdc++2.90.8


Sorry the actual error I get is ...

No rule to make all in linstdc++ ...

My build script is below ...

Jim

#!/bin/bash

#
# Get, build and install the latest cross-development tools and libraries
#

#
# Specify the architectures for which the tools are to be built
# To build for multiple targets: ARCHS="m68k ppc i386"
#
ARCHS="powerpc-linux"

#
# Where to install
#
PREFIX=$HOME/ppcgcc3/

#
# My kernel includes
#
KERNEL=$HOME/ppclinux/include/

#
# Where to get the GNU tools
#
RTEMS_BINUTILS_URL=ftp://ftp.gnu.org/gnu/binutils/
RTEMS_GCC_URL=ftp://ftp.gnu.org/gnu/gcc/gcc-2.95.3/
RTEMS_NEWLIB_URL=ftp://sources.redhat.com/pub/newlib/
GLIBC_URL=ftp://ftp.gnu.org/gnu/glibc
LIBSTDC_URL=ftp://ftp.gnu.org/gnu/libstdc++

#
# Specify the versions
#
GCC_VER=2.95.3
GCC=gcc-core-$GCC_VER
BINUTILS=binutils-2.13.2.1
NEWLIB=newlib-1.10.0
GLIBC_VER=2.2.5

#
# Get the source
#
getSource() {
    wget --passive-ftp --no-directories --retr-symlinks
$RTEMS_BINUTILS_URL/$BINUTILS.tar.gz
    wget --passive-ftp --no-directories --retr-symlinks
$RTEMS_BINUTILS_URL/$BINUTILS*.diff

    wget --passive-ftp --no-directories --retr-symlinks
$RTEMS_GCC_URL/$GCC.tar.gz
    wget --passive-ftp --no-directories --retr-symlinks
$RTEMS_GCC_URL/$GCC*.diff

    wget --passive-ftp --no-directories --retr-symlinks
$RTEMS_NEWLIB_URL/$NEWLIB.tar.gz
    wget --passive-ftp --no-directories --retr-symlinks
$RTEMS_NEWLIB_URL/$NEWLIB*.diff
}

getSourceGLIBC() {
    wget --passive-ftp --no-directories --retr-symlinks
$GLIBC_URL/glibc-$GLIBC_VER.tar.gz
    wget --passive-ftp --no-directories --retr-symlinks
$GLIBC_URL/glibc-$GLIBC_VER*.diff
    wget --passive-ftp --no-directories --retr-symlinks
$GLIBC_URL/glibc-linuxthreads-$GLIBC_VER.tar.gz

    

}

#
# Unpack the source
#
unpackSource() {
    rm -rf $BINUTILS
    tar xvfz $BINUTILS.tar.gz 
    for d in $BINUTILS*.diff
    do
        if [ -r "$d" ]
        then
            cat "$d" | (cd $BINUTILS ; patch -p1)
        fi
    done


    rm -rf gcc-$GCC_VER
    tar xvfz $GCC.tar.gz
    for d in $GCC*.diff
    do
        if [ -r "$d" ]
        then
            cat "$d" | (cd gcc-$GCC_VER ; patch -p1)
        fi
    done


    rm -rf $NEWLIB
    tar xvfz $NEWLIB.tar.gz
    for d in $NEWLIB*.diff
    do
        if [ -r "$d" ]
        then
            cat "$d" | (cd $NEWLIB ; patch -p1)
        fi
    done
    cd gcc-$GCC_VER 
    ln -s ../$NEWLIB/newlib newlib
    ln -s ../$NEWLIB/libgloss libgloss
    cd ..
}

unpackGLIBC() {

   rm -rf glibc-$GLIBC_VER
   tar xvfz glibc-$GLIBC_VER.tar.gz
   for d in glibc-$GLIBC_VER*.diff
   do
      if [ -r "$d" ]
      then
         cat "$d" | (cd glibc-$GLIBC_VER ; patch -p1)
        fi
    done
    cd glibc-$GLIBC_VER
    tar xvfz ../glibc-linuxthreads-$GLIBC_VER.tar.gz
    cd ..

}

#
# Build
#
build() {
    PATH=$PREFIX/bin:$PATH
    export PATH
    for arch in $ARCHS
    do
        rm -rf BINUTILS
        mkdir BINUTILS
        cd BINUTILS
        ../$BINUTILS/configure --target=$arch --prefix=$PREFIX
	make
        make install
        cd ..

        rm -rf GCC
        mkdir  GCC
        cd GCC
        ../gcc-$GCC_VER/configure --target=$arch --prefix=$PREFIX \
            --with-gnu-as --with-gnu-ld --verbose \
            --with-system-zlib --disable-nls \
            --disable-threads \
	    --disable-shared  \
            --with-newlib \
	    --with-headers=$KERNEL \
            --enable-languages=c

	make
        make install
        cd ..
    done
}

build_glibc() {
    PATH=$PREFIX/bin:$PATH
    export PATH
    for arch in $ARCHS
    do
	rm -rf GLIBC
	mkdir GLIBC
	cd GLIBC
	rm -rf $PREFIX/$arch/include $PREFIX/$arch/sys-include
$PREFIX/$arch/lib
        CC=powerpc-linux-gcc AR=powerpc-linux-ar RANLIB=powerpc-linux-ranlib
../glibc-$GLIBC_VER/configure \
	 	--host=$arch \
                --enable-add-ons=linuxthreads \
                --with-headers=$KERNEL  \
                 --prefix=$PREFIX/$arch
	make
	#make install_root=$arch install
	make install
	cd ..
   done
}

build_gcc_glibc() {
    PATH=$PREFIX/bin:$PATH
    export PATH
    for arch in $ARCHS
    do

	
	rm -rf GCC_GLIBC
	mkdir GCC_GLIBC
	cd GCC_GLIBC
        ../gcc-$GCC_VER/configure --target=$arch --prefix=$PREFIX \
                 --with-gnu-as --with-gnu-ld \
                 --enable-shared \
                 --enable-threads=posix \
                 --enable-languages=c \
                 --with-headers=$KERNEL
#\
#                 --with-headers=$PREFIX/include/
	make
        make install
	cd ..


    done
}

getCPPSource() {
    wget --passive-ftp --no-directories --retr-symlinks
$RTEMS_GCC_URL/gcc-g++-$GCC_VER.tar.gz
    wget --passive-ftp --no-directories --retr-symlinks
$RTEMS_GCC_URL/gcc-g++-$GCC_VER*.diff
    wget --passive-ftp --no-directories --retr-symlinks
$LIBSTDC_URL/libstdc++-2.90.8.tar.gz
}

unpackCPPSource(){
    pwd
    echo UNPACK G++
    tar xfz gcc-g++-$GCC_VER.tar.gz
}

build_g++_glibc() {
    PATH=$PREFIX/bin:$PATH
    export PATH
    for arch in $ARCHS
    do

	
	rm -rf G++_GLIBC
	mkdir G++_GLIBC
	cd G++_GLIBC
        #cd gcc-$GCC_VER
        ../gcc-$GCC_VER/configure --target=$arch --prefix=$PREFIX \
                 --with-gnu-as --with-gnu-ld \
                 --enable-shared \
                 --enable-threads=posix \
                 --enable-languages=c,c++ \
                 --with-headers=$KERNEL --with-sysroot=$PREFIX/$arch

	          #mkdir libstdc++
	          #cd libstdc++
                  #../gcc-2.95.3/libstdc++/configure --target=powerpc-linux
\
                  #                        --prefix=/home/jgdon/ppcgcc3 \
                  #                        --enable-shared \
                  #                        --enable-threads=posix \
                  #                        --enable-languages=c,c++ \
                  #
--with-headers=/home/jgdon/ppclinux/include/
cd l	          #cd ..
		  
                  


	make
        #make install
	cd ..


    done
}

unpackStd() {
    pwd
    echo UNPASK STDC
    tar xfz libstdc++-2.90.8.tar.gz
    patch -p0 -b -z.ORIG < libstdc++-2.90.8-compat-gcc-2.95.3.diff
    cd gcc-$GCC_VER
    #pwd
    #ls
    #echo here
    mv libstdc++ libstdc++ORIG
    mv libio     libioORIG
    ls -l libstdc++/src/Makefile.in
    sleep 10
    touch libstdc++/src/Makefile.in
    #echo here2
    cp -rf ../libstdc++-2.90.8 ./
    
    #echo here3
    #cp -rf ./libstdc++-2.90.8/* ./libstdc++/   
    #rm -rf ./libstdc++
    mv ./libstdc++-2.90.8 ./libstdc++ 
    cd ..
}


#
# Do everything
#
# Comment out any activities you wish to omit
#
#set -ex

export PATH=$PREFIX/bin/:$PATH

echo ====================================
echo BUILD BOOT STRAPPED COMPILER
echo ====================================
sleep 10
#getSource
#unpackSource
#unpackCPPSource
#build


echo ====================================
echo BUILD GLIBC
echo ====================================
#getSourceGLIBC
#unpackGLIBC
#cdbuild_glibc

echo ====================================
echo BUILD GCC WITH GLIBC
echo ====================================
#build_gcc_glibc

echo =====================================
echo BUILD G++/GCC WITH GLIBC AND LIBSTC++
echo =====================================
#getCPPSource
unpackCPPSource
unpackStd
build_g++_glibc

-----Original Message-----
From: James Don 
Sent: Thursday, February 06, 2003 8:16 PM
To: 'libstdc++@gcc.gnu.org'
Subject: CROSS COMPILE: can build gcc 2.95.3 with glibc 2.2.5 but not
libstdc++2.90.8

Hi,

I am having some trouble building libstdc++2.90.8 ...

I can build gcc with glibc 2.2.5.

However if I replace ... libstc++(with the patch) in the gcc-2.95.3 dir I
all kinds of problems ... 

I am really wondering if the build instructions for libstdc++2.90.8 are
slightly different than those in libstdc++-v3

In general what I am doing is

1.) build binutils 2.13
2.) build gcc with newlib 
3.) build glibc
4.) build gcc with glibc
5.) unzip/tar g++ to gcc-2.95.3 dir
6.) overwite libstdc++ with files from libstdc++-2.90.8 (with patch from
libstdc++ site for 2.95.3)
7.) configure gcc build in a new directory with language c++ enabled ... and
compile ... 
8.) is this correct?

I found a vague post mentioning configure libstdc++ in its own directory and
building it from there first ... but I am not sure if it's the best thing to
do?

Advice would be great!!!!! And appreciated very greatly!!!!!

Thanks,
Jim


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]