shebs       02/08/20 21:09:48

  Modified:    .        GNUmakefile build_gcc
  Log:
  Update Apple-way build machinery to work.  Note that -mdynamic-no-pic
  is off temporarily.
  
  Revision  Changes    Path
  1.30      +11 -9     gcc3/GNUmakefile
  
  Index: GNUmakefile
  ===================================================================
  RCS file: /cvs/Darwin/gcc3/GNUmakefile,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- GNUmakefile       2002/07/22 19:16:07     1.29
  +++ GNUmakefile       2002/08/21 04:09:47     1.30
  @@ -128,7 +128,7 @@
       endif
   endif
   
  -VERSION = 3.1
  +VERSION = 3.3
   
   ARCH = `arch`
   
  @@ -181,8 +181,9 @@
          rm -f default && \
          ln -s $(VERSION) default; \
        fi
  -     
  -installhdrs: DSTROOT #cplusplus_hdrs
  +
  +# Add cplusplus_hdrs someday...
  +installhdrs: DSTROOT
        @echo
        @echo ++++++++++++++++++++++
        @echo + Installing headers +
  @@ -223,11 +224,12 @@
          rm -f $(std_include_dir)/machine/limits.h && \
          ln -s ../gcc/darwin/default/machine/limits.h $(std_include_dir)/machine; \
        fi
  -     
  -# Note for future reference: Relative symlinks like the one above are aways
  -# relative to the sym link.  So in the above ln -s $(std_include_dir)/machine
  -# is "in" the machine dir.  So we need to go "up" to $(std_include_dir) and
  -# then down to the actual machine/limits.
  +
  +# Note for future reference: Relative symlinks like the one above are
  +# always relative to the sym link.  So in the above ln -s
  +# $(std_include_dir)/machine is "in" the machine dir.  So we need to
  +# go "up" to $(std_include_dir) and then down to the actual
  +# machine/limits.
   
   build: OBJROOT SYMROOT
        @echo
  @@ -410,7 +412,7 @@
                                   KEYMGR_OBJ
        $(CC) $(CFLAGS) -pg -c -o $(KEYMGR_OBJ)/keymgr.o keymgr.c
        libtool -static -o $@ $(KEYMGR_OBJ)/keymgr.o
  -                             
  +
   #######################################################################
   
   clean:
  
  
  
  1.60      +120 -17   gcc3/build_gcc
  
  Index: build_gcc
  ===================================================================
  RCS file: /cvs/Darwin/gcc3/build_gcc,v
  retrieving revision 1.59
  retrieving revision 1.60
  diff -u -r1.59 -r1.60
  --- build_gcc 2002/07/22 19:16:08     1.59
  +++ build_gcc 2002/08/21 04:09:47     1.60
  @@ -84,7 +84,7 @@
       #ENABLE_LANGUAGES="c++,c"
       #COMPILERS="cpp cc1 cc1plus"
       
  -    COMPILERS="$COMPILERS cpp0 tradcpp0 gcov"
  +    COMPILERS="$COMPILERS gcov"
       LANGUAGES="`echo $ENABLE_LANGUAGES | sed -e 's/,/ /g'`"
       
       #
  @@ -213,6 +213,7 @@
       if [ ! "$NEXT_ROOT" ]; then
        $nc build_libgcc_and_specs
        $nc build_libstdcpp
  +     $nc build_libgcc_kext
       fi
       
       #
  @@ -741,6 +742,7 @@
            #
            # This will build the compilers
            #
  +         # -mdynamic-no-pic removed until compiler is fixed
            $SET -x
            $n gnumake $make_target \
                       srcdir=$SRCROOT/gcc \
  @@ -759,7 +761,7 @@
                       BISON=bison \
                       CFLAGS="$no_boot_opt_flag $OPT_OVERRIDE $CFLAGS" \
                       GCC_CFLAGS="-no-cpp-precomp $CFLAGS" \
  -                    BOOT_CFLAGS="${OPT_OVERRIDE:--O2} $CFLAGS -no-cpp-precomp 
-mdynamic-no-pic" \
  +                    BOOT_CFLAGS="${OPT_OVERRIDE:--O2} $CFLAGS -no-cpp-precomp" \
                       BOOT_LDFLAGS= \
                       CC="$HOST_CC -arch $host -no-cpp-precomp 
${bootstrap:+"$CFLAGS"}"
            status=$?
  @@ -980,7 +982,6 @@
        $n rm -f libgcc.a
        libgcc_rebuilt=
           
  -        $nc build_libgcc kext    "$compiler" $specs $target
           $nc build_libgcc static  "$compiler" $specs $target
           $nc build_libgcc dynamic "$compiler" $specs $target
           
  @@ -996,14 +997,6 @@
                     "From: cc-$target-on-$host" \
                     "To:   $sym/lib/$target"
         
  -     #
  -     # List of modules in libgcc.a need to removed from libcc_kext.a...
  -     # Used by build_libgcc_and_specs.
  -     # Probably want to remove unwind-dw2.o and friends also,
  -     # need to check on possibility of exceptions in a kext.
  -     #
  -     unneeded_kext_modules="_bb.o _exit.o"
  -        
        for host in $HOSTS; do
            sym=$SYMROOT/$host
            
  @@ -1011,10 +1004,6 @@
            
            $nc install_newer "-m 444" specs            $sym/lib/$target/specs
            
  -         #$n ar -d libgcc_kext.a $unneeded_kext_modules
  -         $nc install_newer "-m 444" libgcc_kext.a    $sym/lib/$target/libcc_kext.a
  -         $n ranlib                                   $sym/lib/$target/libcc_kext.a
  -         
            $nc install_newer "-m 444" libgcc_static.a  
$sym/lib/$target/libgcc_static.a
            $n ranlib                                   
$sym/lib/$target/libgcc_static.a
   
  @@ -1034,6 +1023,121 @@
       done
   }
   
  +# libgcc_kext must happen after libstdc++ exists.  This can remerge
  +# with build_libgcc_and_specs if we figure out how to preinstall
  +# libstdc++ headers.
  +
  +build_libgcc_kext()
  +{
  +    #
  +    # Make sure -static and -dynamic are removed from CFLAGS if it's there.
  +    #
  +    CFLAGS=`echo $CFLAGS | sed 's/-dynamic//' | sed 's/-static//'`
  +    
  +    #
  +    # Only need to build for targets since these are libs to be used on those
  +    # targets.
  +    #
  +    for target in $TARGETS; do 
  +     host=$arch
  +     $n mkdir -p $OBJROOT/cc-$target-on-$host
  +     $n cd $OBJROOT/cc-$target-on-$host
  +             
  +             #
  +     # The buildhost is in hosts..
  +     # Determine which compiler to use.  Use the native to build native libs
  +     # or cross to build the libs for the target.
  +     #
  +     if echo $HOSTS | grep $host >/dev/null; then
  +         compiler='./xgcc -B./'
  +         specs=specs
  +     else
  +         #
  +         # If the list of hosts does not include the machine we're 
  +         # building on then run the following.
  +         # ��� This probably needs to be removed, at the very least changed.
  +         # Example build ONLY for i386 on my ppc machine.
  +         #
  +         if [ -d /lib/$target ]; then
  +             #
  +             # Get version of installed $target compiler...
  +             #
  +             $n cc -arch $target -v 2> $TEMP/tmp.$$
  +             target_vers=`cat $TEMP/tmp.$$ \
  +                          | grep 'version' \
  +                          | sed 's/, gcc.*$//' \
  +                          | sed 's/^.*version //'`
  +             rm $TEMP/tmp.$$
  +     
  +             if [ "$target_vers" != "$CCVERS" ]; then
  +                 install_new_cc
  +             fi
  +     
  +             compiler=cc
  +             
  +             $n rm -f specs
  +             $n cp /lib/$target/specs specs
  +             specs=
  +         else
  +             install_new_cc
  +         fi
  +     fi
  +             
  +     #
  +     # Now, build the gcc specs and runtime libraries ...
  +     #
  +     local v="`$compiler -v 2>&1 | grep -i version`"
  +     if [ ! "$v" ]; then
  +         v="<unknown version>"
  +     fi
  +     box_title -+ "Building kext runtime libraries using new compiler" \
  +                  +- \
  +                  "target = $target" \
  +                  "cwd    = `pwd`" \
  +                  "$v"
  +        
  +        # ���
  +        # We may be able to use the fact that a bootstrap build creates
  +        # a (dynamic) libgcc.a as part of the build.  But for now we'll
  +        # rebuild it.
  +        #
  +     $n rm -f libgcc.a
  +     libgcc_rebuilt=
  +        
  +        $nc build_libgcc kext    "$compiler" $specs $target
  +        
  +        if [ "$libgcc_rebuilt" = "" ]; then
  +            echo "### None of the $target libgcc libraries needed to be rebuilt."
  +            continue
  +        fi
  +         
  +        $n cd $OBJROOT/cc-$target-on-$host
  +       
  +     box_title -+ "Installing libgcc libs in SYMROOT" \
  +                  +- \
  +                  "From: cc-$target-on-$host" \
  +                  "To:   $sym/lib/$target"
  +      
  +     #
  +     # List of modules in libgcc.a need to removed from libcc_kext.a...
  +     # Used by build_libgcc_and_specs.
  +     # Probably want to remove unwind-dw2.o and friends also,
  +     # need to check on possibility of exceptions in a kext.
  +     #
  +     unneeded_kext_modules="_bb.o _exit.o"
  +        
  +     for host in $HOSTS; do
  +         sym=$SYMROOT/$host
  +         
  +         $n mkdir -p $sym/lib/$target
  +         
  +         #$n ar -d libgcc_kext.a $unneeded_kext_modules
  +         $nc install_newer "-m 444" libgcc_kext.a    $sym/lib/$target/libcc_kext.a
  +         $n ranlib                                   $sym/lib/$target/libcc_kext.a
  +     done
  +    done
  +}
  +
   #
   ## build_libgcc kind compiler specs target
   ##
  @@ -1118,6 +1222,7 @@
               srcdir=$SRCROOT/gcc \
               LANGUAGES="$LANGUAGES" \
               GCC_FOR_TARGET="$compiler" \
  +            ARCH_NAME="$arch" \
               HOST_PREFIX="$arch-" \
               HOST_PREFIX_1="$arch-" \
               HOST_CC="cc -arch $arch -no-cpp-precomp" \
  @@ -1252,8 +1357,6 @@
   ##                               /VERSION/cc1*
   ##                                       /specs
   ##                                       /cpp
  -##                                       /cpp0
  -##                                       /tradcpp0
   ##                               /default --> VERSION
   ## 
   ## /usr/lib/gcc/darwin/VERSION/libstdc++.a
  
  
  


Reply via email to