#!/bin/bash

package=openssl
version=-1.0.2u

progname=$0

source ../cascade-make/lib/cascade-lib.bash GEXT_JENA ../.. $*

prefix=$GEXT_JENA_INSTALLED

opt_run_untar $force_untar $auto_untar $package $version


#opt_run_configure $force_config $auto_config $package $version $prefix --static
if [ $force_config = "1" ] ; then
    echo "[pushd $package$version]"
    ( cd $package$version ; \
      echo CFLAGS=-fPIC $CROSSCONFIGURE_VARS ./config shared --prefix="$prefix" $CROSSCONFIGURE_ARGS $@  ; \
      CFLAGS=-fPIC $CROSSCONFIGURE_VARS ./config shared --prefix="$prefix" $CROSSCONFIGURE_ARGS $@  )
    if [ $? != 0 ] ; then
        echo "      Error encountered running *configure* stage of $progname"
        exit 1
    fi
    echo "[popd]"
  else
    if [ $auto_config = "1" ] ; then
      echo "Found top-level for ${progname%.*} => no need to run ./config"
    fi
fi




opt_run_make $compile $package $version
opt_run_make $install $package $version "install_sw"
opt_run_make $clean $package $version "clean"
opt_run_make $distclean $package $version "distclean"

opt_run_tarclean $tarclean $package $version

