Add/update tests.
[eruntime.git] / eruntime-config.in
blob36a93f69272ffd7fc9ec71fa63d560ff8d86db9c
1 #!/usr/bin/env bash
3 # {{{
5 # Copyright (C) 2006, 2007 Elfyn McBratney.
6 # All rights reserved.
8 # This file is part of eruntime.
10 # License:
12 # eruntime is free software; you can redistribute it and/or modify
13 # it under the terms of the GNU General Public License, version 2,
14 # as published by the Free Software Foundation.
16 # eruntime is distributed in the hope that it will be useful, but
17 # WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 # GNU General Public License for more details.
21 # You should have received a copy of the GNU General Public License
22 # along with eruntime; if not, write to:
24 # Free Software Foundation, Inc.
25 # 59 Temple Place
26 # Suite 330
27 # Boston, MA 02111-1307
28 # USA
30 # Authors:
32 # Elfyn McBratney <elfyn.mcbratney@gmail.com>
34 # }}}
36 prog="$(basename "$0")"
38 # {{{ usage()
39 usage() {
40 local st=$1 out=
41 [[ ${st} == 0 ]] || out=>&2
43 echo "Usage: ${prog} [options...]" ${out}
44 if [[ ${st} == 0 ]]; then
45 echo " --cflags Compiler flags" ${out}
46 echo " --inc Include flags" ${out}
47 echo " --libs Linker flags" ${out}
48 echo " -h, --help Display usage information" ${out}
51 exit ${st}
53 # }}}
55 # {{{ die()
56 die() {
57 echo "${prog}: error: $*"
58 exit 1
60 # }}}
62 [[ $# == 0 ]] && usage 1
64 prefix="@prefix@"
65 exec_prefix="@exec_prefix@"
66 includedir="@includedir@"
67 libdir="@libdir@"
69 topdir="${prefix}"
71 cflags=""
72 inc=""
73 libs=""
75 [[ ${includedir} != /usr/include ]] && inc="${inc} -I${includedir}/eruntime"
76 [[ ${libdir} != /usr/lib ]] && libs="${libs} -L${libdir} -leruntime"
78 while [[ $# > 0 ]]; do
79 arg="$1"; shift
81 case "${arg}" in
82 --cflags)
83 echo -n ${cflags} ${inc} ''
86 --inc)
87 echo -n ${inc} ''
90 --libs)
91 echo -n ${libs} ''
94 -h|--help)
95 usage 0
98 -*)
99 die "unrecognised option \`${arg}'"
103 die "invalid argument \`${arg}'"
105 esac
106 done
108 echo
109 exit 0
112 # vim: ts=8 sw=8 noet fdm=marker tw=80