#!/bin/sh

source ../Config.sh

pp_clean_local () {
    pp_clean_default
    # force autoreconf
    rm -f configure
}

pp_build_local () {
    # force configure
    if [ ! -f configure -o "$PP_FORCE_FULL_BUILD" = "1" ]; then
	echo "Running aclocal & autoconf ..."
	aclocal
	autoconf
	rm -f Makefile
    fi

    # some variables for configure/make
    export CFLAGS="$FW_CFLAGS_3RDPARTY -ffunction-sections -fdata-sections -Wall -W"

    # configure
    if [ ! -f Makefile ]; then
	echo "Running configure ..."
	./configure \
		--host="${HOST_SYSTEM}" \
		--prefix=/ \
		--enable-static \
		--disable-shared \
		--with-zlib="${DESTDIR}"
    fi

    # make / install
    echo "Running make ..."
    make inst_dropbear
}

pp_do "$@"
