shebs       02/09/08 20:06:27

  Modified:    .        build_gcc
               libstdc++-v3/libsupc++ Makefile.am Makefile.in
  Log:
  Fix up build_gcc - set build prefix instead of host prefix, disable attempt
  at HOST_CC cleverness, add $SUFFIX option to avoid stepping on installed
  gcc3.  Also make sure libtool gets CFLAGS when compiling C files in libsupc++.
  
  Revision  Changes    Path
  1.62      +25 -15    gcc3/build_gcc
  
  Index: build_gcc
  ===================================================================
  RCS file: /cvs/Darwin/gcc3/build_gcc,v
  retrieving revision 1.61
  retrieving revision 1.62
  diff -u -r1.61 -r1.62
  --- build_gcc 2002/08/21 18:07:59     1.61
  +++ build_gcc 2002/09/09 03:06:26     1.62
  @@ -72,11 +72,13 @@
       #
       ENABLE_LANGUAGES="c++,c,objc,objc++"
       COMPILERS="cpp cc1 cc1plus cc1obj cc1objplus"
  +    # Suffix to add to the tools.  ("3" for 10.2 installed version)
  +    SUFFIX=33
       # Name (and install_name!) of libstdc++.dylib to build (if any.)
       LIBSTDCPP_DYLIB=libstdc++.dylib                  # formerly 
libstdc++.${APPLE_CC}.dylib
       LIBSTDCPP_DYLIB_VERSION=A
       LIBRARIES="libgcc.a libcc_kext.a libgcc_static.a libsupc++.a $LIBSTDCPP_DYLIB 
libstdc++.a libcc_noc++.a"
  -    TOOLS="gcc3 g++3 c++3 c++filt3 gcov3 cpp3" # c++3 must be after g++3 in the list
  +    TOOLS="gcc$SUFFIX g++$SUFFIX c++$SUFFIX c++filt$SUFFIX gcov$SUFFIX cpp$SUFFIX" 
# c++3 must be after g++3 in the list
       CRTS="crtbegin.o"
       
       # uncomment to speed up testing
  @@ -619,13 +621,14 @@
       #
       # We will build libiberty for all possible hosts wint the one make call...
       #
  +    hosts="-arch $buildhost"
       for host in $HOSTS; do
        hosts="$hosts -arch $host"
       done
       
       $SET -x
       $n gnumake srcdir=$SRCROOT/libiberty \
  -            HOST_PREFIX="$buildhost-" HOST_PREFIX_1="$buildhost-" \
  +            BUILD_PREFIX="$buildhost-" BUILD_PREFIX_1="$buildhost-" \
               HOST_CC="${NEXT_ROOT:+NEXT_ROOT=} cc -arch $buildhost -no-cpp-precomp" \
               CFLAGS="$OPT_OVERRIDE $CFLAGS" \
               GCC_CFLAGS="-no-cpp-precomp $CFLAGS" \
  @@ -700,7 +703,13 @@
            else
                HOST_CC="$OBJROOT/cc-$host-on-$buildhost/xgcc 
-B$OBJROOT/cc-$host-on-$buildhost/"
            fi
  -         
  +         # The above settings of HOST_CC don't work if the same
  +         # compiler is not already installed, because the
  +         # just-built compilers need crtbegin.o etc which haven't
  +         # been built yet.  So override until somebody figures this
  +         # out. -sts 2002-09-08
  +         HOST_CC=cc
  +
            $n cd $OBJROOT/cc-$target-on-$host
            
            #
  @@ -746,8 +755,8 @@
            $n gnumake $make_target \
                       srcdir=$SRCROOT/gcc \
                       LANGUAGES="$LANGUAGES" \
  -                    HOST_PREFIX="$buildhost-" \
  -                    HOST_PREFIX_1="$buildhost-" \
  +                    BUILD_PREFIX="$buildhost-" \
  +                    BUILD_PREFIX_1="$buildhost-" \
                       HOST_CC="${NEXT_ROOT:+NEXT_ROOT=} cc -arch $buildhost 
-no-cpp-precomp" \
                       GCC_FOR_TARGET="`if [ "$NEXT_ROOT" ]; then \
                                            echo cc -no-cpp-precomp; \
  @@ -806,10 +815,10 @@
        
        if echo $TARGETS | grep $host >/dev/null; then
            for tool in $TOOLS; do
  -             if [ "$tool" = "gcc3" ]; then
  +             if [ "$tool" = "gcc$SUFFIX" ]; then
                    actual_tool=xgcc
                else
  -                 actual_tool="`echo $tool | sed -e 's/\(.*\)3$/\1/'`"
  +                 actual_tool="`echo $tool | sed -e s/$SUFFIX$//`"
                fi
                #
                # If c++ exists and is not a sym link we treat it like
  @@ -1213,8 +1222,8 @@
               LANGUAGES="$LANGUAGES" \
               GCC_FOR_TARGET="$compiler" \
               ARCH_NAME="$arch" \
  -            HOST_PREFIX="$arch-" \
  -            HOST_PREFIX_1="$arch-" \
  +            BUILD_PREFIX="$arch-" \
  +            BUILD_PREFIX_1="$arch-" \
               HOST_CC="cc -arch $arch -no-cpp-precomp" \
               CFLAGS="${OPT_OVERRIDE:--O2} $CFLAGS" \
               AR_FOR_TARGET=ar \
  @@ -1293,6 +1302,7 @@
        $SET -x
        $n gnumake CC=$OBJROOT/cc-$target-on-$arch/xgcc \
                   CXX=$OBJROOT/cc-$target-on-$arch/g++  \
  +                CPPFLAGS="-no-cpp-precomp" \
                   CFLAGS="-arch $target -no-cpp-precomp 
-B$OBJROOT/cc-$target-on-$arch/ ${OPT_OVERRIDE:--O2} $CFLAGS" \
                   CXXFLAGS="-arch $target -B$OBJROOT/cc-$target-on-$arch/ 
${OPT_OVERRIDE:--O2} $CFLAGS"
        status=$?
  @@ -1605,15 +1615,15 @@
        #
        # Create c++3 as a sym link to g++3 if c++ wasn't built.
        #
  -     if [ "$tool" = "c++3" ] && [ ! -e $fat/$file ]; then
  -         ln -s g++3 $fat/$file
  -         echo "### Creating sym link for c++3 to g++3."
  +     if [ "$tool" = "c++$SUFFIX" ] && [ ! -e $fat/$file ]; then
  +         ln -s g++$SUFFIX $fat/$file
  +         echo "### Creating sym link for c++$SUFFIX to g++$SUFFIX."
        fi
        
        if [ "$DO_SYMLINKS" = "yes" ]; then
  -         ln -s $tool $fat/$PREFIX/bin/"`echo $tool | sed -e 's/\(.*\)3$/\1/'`"
  -         if [ "$tool" = "gcc3" ]; then
  -             ln -s gcc3 $fat/$PREFIX/bin/cc
  +         ln -s $tool $fat/$PREFIX/bin/"`echo $tool | sed -e s/$SUFFIX$//`"
  +         if [ "$tool" = "gcc$SUFFIX" ]; then
  +             ln -s gcc$SUFFIX $fat/$PREFIX/bin/cc
            fi
        fi
       done
  
  
  
  1.7       +2 -1      gcc3/libstdc++-v3/libsupc++/Makefile.am
  
  Index: Makefile.am
  ===================================================================
  RCS file: /cvs/Darwin/gcc3/libstdc++-v3/libsupc++/Makefile.am,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Makefile.am       2002/08/26 05:42:19     1.6
  +++ Makefile.am       2002/09/09 03:06:27     1.7
  @@ -125,9 +125,10 @@
        $(C_COMPILE) -DIN_GLIBCPP_V3 -Wno-error -c $<
   
   # LTCOMPILE is copied from LTCXXCOMPILE below.
  +# APPLE LOCAL cpp-precomp
   LTCOMPILE = $(LIBTOOL) --tag CC --tag disable-shared --mode=compile $(CC) \
            $(DEFS) $(GCC_INCLUDES) $(LIBSUPCXX_PICFLAGS) \
  -            $(AM_CPPFLAGS) $(CPPFLAGS) 
  +            $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FLAGS) $(CFLAGS)
   
   
   # AM_CXXFLAGS needs to be in each subdirectory so that it can be
  
  
  
  1.13      +2 -1      gcc3/libstdc++-v3/libsupc++/Makefile.in
  
  Index: Makefile.in
  ===================================================================
  RCS file: /cvs/Darwin/gcc3/libstdc++-v3/libsupc++/Makefile.in,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- Makefile.in       2002/08/26 05:42:19     1.12
  +++ Makefile.in       2002/09/09 03:06:27     1.13
  @@ -222,9 +222,10 @@
   
   
   # LTCOMPILE is copied from LTCXXCOMPILE below.
  +# APPLE LOCAL cpp-precomp
   LTCOMPILE = $(LIBTOOL) --tag CC --tag disable-shared --mode=compile $(CC) \
            $(DEFS) $(GCC_INCLUDES) $(LIBSUPCXX_PICFLAGS) \
  -            $(AM_CPPFLAGS) $(CPPFLAGS) 
  +            $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
   
   
   # AM_CXXFLAGS needs to be in each subdirectory so that it can be
  
  
  


Reply via email to