#! /usr/bin/env bash

# file      : build/configure
# author    : Boris Kolpackov <boris@codesynthesis.com>
# copyright : Copyright (c) 2005-2007 Code Synthesis Tools CC
# license   : GNU GPL v2 + exceptions; see accompanying LICENSE file

# $1  out file
#
# bld_root     - build root
# project_name - project name
#

source $bld_root/dialog.bash


$echo
$echo
$echo "configuring '$project_name'"
$echo
$echo


$echo
$echo "Would you like the generated code and runtime to use STL?"
$echo

stl=`read_y_n y`

$echo
$echo "Would you like the generated code and runtime to use IO streams?"
$echo

iostream=`read_y_n y`

$echo
$echo "Would you like the generated code and runtime to use C++ exceptions?"
$echo

exceptions=`read_y_n y`

$echo
$echo "Would you like the parser runtime to validate against XML Schema?"
$echo

validation_parser=`read_y_n y`

$echo
$echo "Would you like the serializer runtime to validate against XML Schema?"
$echo

validation_serializer=`read_y_n y`

$echo
$echo "Is the long long int type available on your platform?"
$echo

longlong=`read_y_n y`

$echo
$echo "Is the snprintf/_snprintf function available on your platform?"
$echo

snprintf=`read_y_n y`

$echo
$echo "Is your platform little-endian?"
$echo

little=`read_y_n y`

if [ "$little" == "y" ]; then
  byteorder=l
else
  byteorder=b
fi

echo "xsde_stl                   := $stl"                    >$1
echo "xsde_iostream              := $iostream"              >>$1
echo "xsde_exceptions            := $exceptions"            >>$1
echo "xsde_validation_parser     := $validation_parser"     >>$1
echo "xsde_validation_serializer := $validation_serializer" >>$1
echo "xsde_longlong              := $longlong"              >>$1
echo "xsde_snprintf              := $snprintf"              >>$1
echo "xsde_byteorder             := $byteorder"             >>$1
