#!/bin/sh
# vi:set sts=2 sw=2 autoindent:
#
# tn5250-config - Shell script for retreiving tn5250/lib5250 configuration
#                 parameters.
#

prefix="/usr/local"
exec_prefix="${prefix}"
bindir="${exec_prefix}/bin"
sbindir="${exec_prefix}/sbin"
libexecdir="${exec_prefix}/libexec"
datadir="${prefix}/share"
sysconfdir="/etc"
sharedstatedir="${prefix}/com"
localstatedir="${prefix}/var"
libdir="${exec_prefix}/lib"
infodir="${prefix}/info"
mandir="${prefix}/man"
includedir="${prefix}/include"
oldincludedir="/usr/include"
LIBS="-lssl -lcrypto -lncurses "
VERSION="0.17.3"

syntax () {
  cat <<EOF
$(basename $0) - shell script to get tn5250/lib5250 config.
Syntax:
  tn5250-config [options]

Options:
  --libs            Print libs and other linker flags necessary for creating
                    a -l5250 based program.
  --cflags          Print C compiler flags necessary for creating a -l5250
                    based program.
  --version         Print the version of the installed library.

EOF
  exit 1
}

case "$1" in
  --cflags)
    echo "-I$includedir";;
  --libs)
    echo "-L$libdir -l5250 $LIBS";;
  --version)
    echo "$VERSION";;
  *)
    syntax;;
esac
exit 0
