#!/bin/sh -x
# Only make Makefile if it does not exist.
if [ -e Makefile ]; then
  exit 0
fi

TOPDIR=`cd ../../..; pwd`

# SU="eval sudo"
AR="mips-ar cr"
CC=mips-gcc
# CP="${SU} ${TOPDIR}/brecis/holes/gzipelf/gzipelf.sh"
RANLIB=mips-ranlib

# LIBS="-lc -lgcc"

INSTALL="${CP}"
INSTALL_PROGRAM="${INSTALL}"
INSTALL_DATA="${INSTALL}"
INSTALL_SCRIPT="${INSTALL}"

PERL=perl

export AR
export CC
export CFLAGS
export CPPFLAGS
# export LDFLAGS
# export LIBS
export RANLIB
export INSTALL
export INSTALL_PROGRAM
export INSTALL_DATA
export INSTALL_SCRIPT
export PERL

# ./Configure TABLE
# 
# ./Configure LIST
# exit 1

./Configure --prefix=/share \
	--openssldir=${TOPDIR}/uC-src/share \
	threads \
	no-shared \
	no-asm \
	linux-brecis-mips
