#!/bin/sh
# Configuration script for the sC++ distribution.
# Made by Jan Madsen
# Last modified the 16th January 1997.
# Copyright: Computer Networking Laboratory,
#            Swiss Federal Institute of Technology, Lausanne - Switzerland

# The INSTALL variable holds the absolute path in which we will install
# the libraries and programs (except gcc) from the distribution.
INSTALL=/usr/local/sCxx

# Default compiler to use when compiling (should be a compiler that accepts
# sC++).
COMPILER=${INSTALL}/bin/gcc

# Default values for the Motif include files and Motif libraries.
MOTIF_INCLUDES_A=-I/logiciels/licences/Motif/include
MOTIF_LIBRARIES_A=-L/logiciels/licences/Motif/lib

# Default value for the X11 library directories.
X_INCLUDE=-I/logiciels/public/X11R5/include
X_LIB=-L/logiciels/public/X11R5/lib
 
# Test the parameters given for the script if they override the current values.
for param in $* ; do
   case ${param} in
   INSTALL=*)
	INSTALL=`echo $param | sed 's/INSTALL=//g'`
	;;
   COMPILER=*)
	COMPILER=`echo $param | sed 's/COMPILER=//g'`
	;;
   MOTIF_INCLUDE_OPTIONS=*)
        MOTIF_INCLUDES_A=`echo $param | sed 's/MOTIF_INCLUDE_OPTIONS=//g'`
        ;;
   MOTIF_LIBRARY_OPTIONS=*)
        MOTIF_LIBRARIES_A=`echo $param | sed 's/MOTIF_LIBRARY_OPTIONS=//g'`
        ;;
   X_INCLUDE_OPTIONS=*)
        X_INCLUDE=`echo $param | sed 's/X_INCLUDE_OPTIONS=//g'`
        ;;
   X_LIBRARY_OPTIONS=*)
        X_LIB=`echo $param | sed 's/X_LIBRARY_OPTIONS=//g'`
        ;;
   esac
done

# ADAPT THE NEXT LINE TO TELL WHICH DIRECTORY WE ARE CURRENTLY CONFIGURING.
echo Configuring the Sockets directory.

# Configure the subdirectories.
for directories in Sockets Sockets_Motif ; do
    cd ./${directories} ;
    ./configure COMPILER=${COMPILER} INSTALL=${INSTALL} MOTIF_INCLUDE_OPTIONS=${MOTIF_INCLUDES_A} MOTIF_LIBRARY_OPTIONS=${MOTIF_LIBRARIES_A} X_INCLUDE_OPTIONS=${X_INCLUDE} X_LIBRARY_OPTIONS=${X_LIB} ;
    cd .. ;
done

# Create the Makefile in the current directory by concatenating the following
# echo'ed lines with the Makefile.header (Found as MAKE_HEADER) and the
# Makefile.in from the current directory.
