#!/bin/sh
#
# rdesktop: A Remote Desktop Protocol client
# configure script
# Copyright (C) Matthew Chapman 1999-2001
#

echo "# Generated by $0 $*" >Makeconf

for arg in $*; do
optarg=`echo $arg | sed 's/[-a-z]*=//'`    
case $arg in
  --prefix=*)
    echo "PREFIX   = $optarg" >>Makeconf
    ;;
  --exec-prefix=*)
    echo "EPREFIX  = $optarg" >>Makeconf
    ;;
  --bindir=*)
    echo "BINDIR   = $optarg" >>Makeconf
    ;;
  --mandir=*)
    echo "MANDIR   = $optarg" >>Makeconf
    ;;
  --with-openssl*)
    echo "CFLAGS  += -DWITH_OPENSSL" >>Makeconf
    echo "LDLIBS  += -lcrypto" >>Makeconf
    echo "CRYPTOBJ =" >>Makeconf
    ;;
  --without-openssl*)
    ;;
  --with-debug*)
    echo "CFLAGS  += -g -DWITH_DEBUG" >>Makeconf
    ;;
  --without-debug*)
    ;;
  *)
    echo "rdesktop build configuration script"
    echo
    echo "Target directories:"
    echo " --prefix=PREFIX        location for architecture-independent files"
    echo " --exec-prefix=EPREFIX  location for architecture-dependent files"
    echo " --bindir=BINDIR        location for program binaries [EPREFIX/bin]"
    echo " --mandir=MANDIR        location for man pages [PREFIX/man]"
    echo
    echo "Build configuration:"
    echo " --with-openssl         use system OpenSSL libraries for crypto"
    echo " --with-debug           enable debugging output"
    echo
    rm -f Makeconf
    exit 1
    ;;
esac
done

echo "configure complete - now run make"
