Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /sml/trunk/system/cmb-cross
ViewVC logotype

Diff of /sml/trunk/system/cmb-cross

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 5568, Fri Aug 9 05:32:57 2019 UTC revision 5569, Fri Aug 9 13:31:04 2019 UTC
# Line 3  Line 3 
3  # COPYRIGHT (c) 2019 The Fellowship of SML/NJ (http://www.smlnj.org)  # COPYRIGHT (c) 2019 The Fellowship of SML/NJ (http://www.smlnj.org)
4  # All rights reserved.  # All rights reserved.
5  #  #
6  # usage: cmb-cross <target>  # usage: cmb-cross [ -z ] <target>
7  #       <target>        -- one of amd64-unix, ppc-unix, sparc-unix, x86-unix, or x86-win32  #       <target>        -- one of amd64-unix, ppc-unix, sparc-unix, x86-unix, or x86-win32
8  #  #
9  # cross compile to the specified target  # cross compile to the specified target
# Line 16  Line 16 
16  cd $here  cd $here
17    
18  function usage {  function usage {
19    echo "usage: cmb-cross <target>"    echo "usage: cmb-cross [ -z ] <target>"
20    echo "where <target> is one of amd64-unix, ppc-unix, sparc-unix, x86-unix, or x86-win32"    echo "where <target> is one of amd64-unix, ppc-unix, sparc-unix, x86-unix, or x86-win32"
21    exit 1    exit 1
22  }  }
23    
24    # check for "-z" flag
25    if [ x"$1" = "x-z" ] ; then
26      shift
27      build_tarball=yes
28    else
29      build_tarball=no
30    fi
31    
32  if [ $# -ne 1 ] ; then  if [ $# -ne 1 ] ; then
33    usage    usage
34  fi  fi
# Line 111  Line 119 
119  #  #
120  echo "$this: cross compile to $target"  echo "$this: cross compile to $target"
121    
122  if [ $OPSYS = win32 ] ; then  if [ $HOST_OPSYS = win32 ] ; then
123      BOOT_DIR="${target}-cross.boot.${ARCH}-win32"      SUFFIX="${HOST_ARCH}-win32"
124  else  else
125      BOOT_DIR="${target}-cross.boot.${ARCH}-unix"      SUFFIX="${HOST_ARCH}-unix"
126  fi  fi
127    CROSS_BIN_DIR="${target}-cross.bin.${SUFFIX}"
128    CROSS_BOOT_DIR="${target}-cross.boot.${SUFFIX}"
129    
130  MODE="@SMLrebuild=${architecture}"  MODE="@SMLrebuild=${architecture}"
131    
132  CM_PATHCONFIG=${CM_PATHCONFIG:-$twoup/lib/pathconfig}  CM_PATHCONFIG=${CM_PATHCONFIG:-$twoup/lib/pathconfig}
133  export CM_PATHCONFIG  export CM_PATHCONFIG
134    
135  cd $BOOT_DIR  cd $CROSS_BOOT_DIR
136    
137  echo $this: $LINK $RUN @SMLboot=BOOTLIST @SMLheap=sml $MODE  echo $this: $LINK $RUN @SMLboot=BOOTLIST @SMLheap=sml $MODE
138  if $LINK $RUN @SMLboot=BOOTLIST @SMLheap=sml $MODE ; then  if $LINK $RUN @SMLboot=BOOTLIST @SMLheap=sml $MODE ; then
139        # back to the system directory
140        #
141        cd $here
142        # the new boot/bin files will be in "${architecture}.boot.${target}"
143        # and "${architecture}.bin.${target}"; we rename them with the
144        # standard naming convention by replacing "${architecture}" with "sml"
145        #
146        for xxx in bin boot ; do
147            if [ -d "${architecture}.${xxx}.${target}" ] ; then
148                rm -rf "sml.${xxx}.${target}"
149                mv "${architecture}.${xxx}.${target}" "sml.${xxx}.${target}"
150            else
151                echo "$this: ${architecture}.${xxx}.${target} is missing!"
152                exit 1
153            fi
154        done
155      echo $this: New binfiles are ready.      echo $this: New binfiles are ready.
156      exit 0      # cleanup
157        #
158        rm -rf ${CROSS_BIN_DIR} ${CROSS_BOOT_DIR}
159  else  else
160      echo $this: Something broke.      echo $this: Something broke.
161      exit 1      exit 1
162  fi  fi
163    
164    if [ $build_tarball = "yes" ] ; then
165      tar -cf - sml.boot.${target} | gzip > boot.$target.tgz
166    fi

Legend:
Removed from v.5568  
changed lines
  Added in v.5569

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0