#!/bin/bash
# Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0

set -o errexit
set -o pipefail
set -o nounset

. util/build_consts.sh

echo "Detected \$REPO_TOP at $REPO_TOP."
echo "Object directory set at $OBJ_DIR."
echo "Binary directory set at $BIN_DIR."
echo "OpenTitan version: $OT_VERSION"
echo

function usage() {
  cat << USAGE
Configure Meson build targets.

Usage: $0 [-r|-f]

  -f: Remove build directories before running Meson.
  -r: Force reconfiguration of build directories.
  -K: Keep include search paths as generated by Meson.

USAGE
}

FLAGS_force=false
FLAGS_reconfigure=""
FLAGS_keep_includes=false
while getopts 'r?:f?:K?' flag; do
  case "${flag}" in
    f) FLAGS_force=true;;
    r) FLAGS_reconfigure="--reconfigure";;
    K) FLAGS_keep_includes=true;;
    ?) usage && exit 1;;
    *) usage
       error "Unexpected option ${flag}"
       ;;
  esac
done

if [[ "${FLAGS_force}" == true && -n "${FLAGS_reconfigure}" ]]; then
  usage >&2
  echo "Error: -r and -f cannont be used at the same time." >&2
  exit 1
fi

if [[ ! -n "$(command -v meson)" ]]; then
  echo "Unable to find meson. Please install meson before running this command." >&2
  exit 1
fi

if [[ ! -n "$(command -v ninja)" ]]; then
  echo "Unable to find ninja. Please install ninja before running this command." >&2
  exit 1
fi

if [[ "${FLAGS_force}" == true ]]; then
  rm -rf $BUILD_ROOT/build-*
fi

if [[ ! -n "${FLAGS_reconfigure}" ]] ; then
  for platform in "${PLATFORMS[@]}"; do
    obj_dir="$(sw_obj_dir "$platform")"
    if [[ -d "$obj_dir" ]]; then
      usage >&2
      echo "Error: $obj_dir  already exists. Remove directory, or rerun $0 " \
        "with the -r option" >&2
      exit 1
    fi
  done
fi

readonly DEFAULT_RISCV_TOOLS=/tools/riscv
TOOLCHAIN_PATH="${TOOLCHAIN_PATH:-$DEFAULT_RISCV_TOOLS}"
CROSS_FILE=$(mktemp /tmp/toolchain.XXXXXX.txt)
cp toolchain.txt "$CROSS_FILE"
perl -pi -e "s#$DEFAULT_RISCV_TOOLS#$TOOLCHAIN_PATH#g" "$CROSS_FILE"
echo "Set up toolchain file at $CROSS_FILE." >&2

# purge_includes $build_dir deletes any -I command line arguments that are not
# - Absolute paths.
# - Ephemeral build directories.
#
# This function is necessary because Meson does not give adequate
# control over what directories are passed in as -I search directories
# to the C compiler. While Meson does provide |implicit_include_directories|,
# support for this option is poor: empirically, Meson ignores this option for
# some targerts. Doing it as a post-processing step ensures that Meson does
# not allow improper #includes to compile successfully.
function purge_includes() {
  if [[ "${FLAGS_keep_includes}" == "true" ]]; then
    return
  fi
  echo "Purging superfluous -I arguments from $1."
  local ninja_file="$1/build.ninja"
  perl -pi -e 's#-I[^/][^@ ]+ # #g' -- "$ninja_file"
}

for platform in ${PLATFORMS[@]}; do
  obj_dir="$(sw_obj_dir "$platform")"
  bin_dir="$(sw_bin_dir "$platform")"
  mkdir -p "$obj_dir"
  mkdir -p "$bin_dir"
  meson ${FLAGS_reconfigure} \
    -Dtarget="$platform" \
    -Dot_version="$OT_VERSION" \
    -Ddev_bin_dir="$bin_dir" \
    -Dhost_bin_dir="$HOST_BIN_DIR" \
    --cross-file="$CROSS_FILE" \
    --buildtype=plain \
    "$obj_dir"
  purge_includes "$obj_dir"
done
