Do just one arch at a time.
authorChris Hanson <org/chris-hanson/cph>
Sun, 7 Mar 2010 07:29:53 +0000 (23:29 -0800)
committerChris Hanson <org/chris-hanson/cph>
Sun, 7 Mar 2010 07:29:53 +0000 (23:29 -0800)
dist/make-native-files

index 4cc9fdee8d4e7a44d884e9bc118a2d68b21aa558..eb20e41433256db4744923f784b5ef3a2d632ec1 100755 (executable)
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 # 02110-1301, USA.
 
-# inputs: source tar, doc image tar
-# outputs: scheme binary tars
+# inputs: source tar
+# outputs: binary tar
+
+system_args ()
+{
+    (( ${#} == 2 )) || usage
+    DIST_TYPE=${1}
+    ARCH=${2}
+}
+ARGS_FUNCTION=system_args
+
+system_usage ()
+{
+    echo "usage: ${PROGRAM} TYPE ARCH"
+    usage_arg_type
+    echo "  ARCH must be 'i386' or 'x86-64'"
+}
+USAGE_FUNCTION=system_usage
 
 . "$(dirname "${0}")"/shared.sh
 make_output_dir
 
+shift 2
+
 build ()
 {
-    local ARCH=${1}
     my_configure --enable-native-code="${ARCH}" \
        --with-mcrypt=no --with-libpq=no --with-db-4=no
     my_make
 }
 
-for ARCH in i386 x86-64; do
-    OUT_ROOT=${NATIVE_OUT}-${ARCH}
+OUT_ROOT=${NATIVE_OUT}-${ARCH}
 
-    notify "Building binaries for arch ${ARCH}"
-    unpack_dist_file_to "${DIST_DIR}" "${DIST_DIR}"
-    run_command "${OUT_ROOT}"-compile "${DIST_DIR}"/src build "${ARCH}"
-    run_command "${OUT_ROOT}"-clean "${DIST_DIR}"/src/microcode make distclean
-    my_rm_f "${DIST_DIR}"/src/lib/runtime.com
+notify "Building binaries for arch ${ARCH}"
+unpack_dist_file_to "${DIST_DIR}" "${DIST_DIR}"
+run_command "${OUT_ROOT}"-compile "${DIST_DIR}"/src build
+run_command "${OUT_ROOT}"-clean "${DIST_DIR}"/src/microcode make distclean
+my_rm_f "${DIST_DIR}"/src/lib/runtime.com
 
-    notify "Making tarball"
-    fixup_perms "${DIST_DIR}"
-    make_tar_file "${OUT_ROOT}" "${DIST_DIR}"-"${ARCH}" "${DIST_DIR}"
-    cleanup_temp_files
-done
+notify "Making tarball"
+fixup_perms "${DIST_DIR}"
+make_tar_file "${OUT_ROOT}" "${DIST_DIR}"-"${ARCH}" "${DIST_DIR}"
+cleanup_temp_files
 
 notify_finished