#! /bin/sh
-# $Id: adacurses-config.in,v 1.5 2009/01/11 00:08:19 tom Exp $
+# $Id: adacurses-config.in,v 1.14 2020/02/02 23:34:34 tom Exp $
##############################################################################
-# Copyright (c) 2007,2009 Free Software Foundation, Inc. #
+# Copyright 2019,2020 Thomas E. Dickey #
+# Copyright 2007-2014,2016 Free Software Foundation, Inc. #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
# copy of this software and associated documentation files (the "Software"), #
VERSION=@NCURSES_MAJOR@.@NCURSES_MINOR@.@NCURSES_PATCH@
-CFLAGS="-I$ADA_INCLUDE -aO$ADA_OBJECTS"
-LIBS="-L$ADA_OBJECTS -lAdaCurses"
+CFLAGS="-aI$ADA_INCLUDE -aO$ADA_OBJECTS"
+LIBS="-L$ADA_OBJECTS -l@ADA_LIBNAME@"
+
+THIS="@ADA_LIBNAME@"
+THIS_CFG="$THIS@DFT_ARG_SUFFIX@-config"
case "x$1" in
- x--version)
- echo AdaCurses $VERSION
- ;;
- x--cflags)
- echo $CFLAGS
- ;;
- x--libs)
- echo $LIBS
- ;;
- x)
- # if no parameter is given, give what gnatmake needs
- echo "$CFLAGS -i -largs $LIBS"
- ;;
- *)
- echo 'Usage: adacurses@DFT_ARG_SUFFIX@-config [--version | --cflags | --libs]' >&2
- exit 1
- ;;
+ x--version)
+ echo @ADA_LIBNAME@ $VERSION
+ ;;
+ x--cflags)
+ echo $CFLAGS
+ ;;
+ x--libs)
+ echo $LIBS
+ ;;
+ x)
+ # if no parameter is given, give what gnatmake needs
+ echo "$CFLAGS -largs $LIBS"
+ ;;
+ x--help)
+ cat <<ENDHELP
+Usage: ${THIS_CFG} [options]
+
+Options:
+ --cflags echos the gnat (Ada compiler) flags needed to compile with ${THIS}
+ --libs echos the gnat libraries needed to link with ${THIS}
+
+ --version echos the release+patchdate version of ${THIS}
+
+ --help prints this message
+
+If no options are given, echos the full set of flags needed by gnatmake.
+ENDHELP
+ ;;
+ *)
+ echo 'Usage: $THIS_CFG [--version | --cflags | --libs]' >&2
+ exit 1
+ ;;
esac