#!/bin/sh
#
# $Id: configure,v 1.3 2007/10/09 17:39:08 tat Exp $

export makl_conf_h=klapp_conf.h
export MAKL_DIR=`pwd`/build/makl

if [ -z "$MAKE" ]; then
    MAKE=make
fi

# will fail using something different then GNU make
( cd build/makecheck && ${MAKE} ) || exit 1

# before running configure the toolchain must be present
if [ ! -r ${MAKL_DIR}/etc/toolchain.cf ]; then
    ${MAKE} -C ${MAKL_DIR} toolchain
fi

# MaKL preamble
. ${MAKL_DIR}/cf/makl.init

# Preprocess arguments
makl_args_init "$@"

# General settings
makl_pkg_name           "klapp"
makl_pkg_version

# Handle command-line arguments
makl_args_handle "$@"

. ${MAKL_DIR}/cf/makl.term

ln -sf build/makl/mk/reloc.mk
