2 # $Id: dialog-config.in,v 1.13 2019/09/26 00:50:46 tom Exp $
3 ##############################################################################
4 # Copyright (c) 2007-2012,2019 Thomas E. Dickey #
6 # Permission is hereby granted, free of charge, to any person obtaining a #
7 # copy of this software and associated documentation files (the "Software"), #
8 # to deal in the Software without restriction, including without limitation #
9 # the rights to use, copy, modify, merge, publish, distribute, distribute #
10 # with modifications, sublicense, and/or sell copies of the Software, and to #
11 # permit persons to whom the Software is furnished to do so, subject to the #
12 # following conditions: #
14 # The above copyright notice and this permission notice shall be included in #
15 # all copies or substantial portions of the Software. #
17 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
18 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, #
19 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL #
20 # THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER #
21 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING #
22 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER #
23 # DEALINGS IN THE SOFTWARE. #
25 # Except as contained in this notice, the name(s) of the above copyright #
26 # holders shall not be used in advertising or otherwise to promote the sale, #
27 # use or other dealings in this Software without prior written #
29 ##############################################################################
32 exec_prefix="@exec_prefix@"
33 datarootdir="@datarootdir@"
40 test $# = 0 && exec @SHELL@ "$0" --error
42 while test $# -gt 0; do
44 # (re)evaluate symbols that may depend upon $prefix
45 if [ "x$same_prefix" != "xyes" ]
47 eval exec_prefix='@exec_prefix@'
48 eval datarootdir='@datarootdir@'
49 elif [ "x$same_exec_prefix" != "xyes" ]
51 eval datarootdir='@datarootdir@'
54 eval bindir='"@bindir@"'
55 eval includedir='"@includedir@"'
56 eval libdir='"@libdir@"'
57 eval datadir='"@datadir@"'
58 eval mandir='"@mandir@"'
60 [ -z "$includedir" ] && includedir="${prefix}/include"
62 eval LDFLAGS='"@LDFLAGS@"'
64 LIBS="-l${THIS} $LIBS"
66 # If the directory given by --libdir is not in the LDFLAGS+LIBS set,
67 # prepend it to LDFLAGS to help link this application's library.
69 for opt in $LDFLAGS $LIBS
71 if [ "x$-L${libdir}" = "x$opt" ]
79 [ -n "$LFLAGS" ] && LDFLAGS=" $LFDLAGS"
80 LDFLAGS="-L${libdir}$LDFLAGS"
82 [ -z "$LDFLAGS" ] && LDFLAGS="-L${exec_prefix}/lib"
84 # Ignore -L options which do not correspond to an actual directory,
85 # or which are standard library directories (i.e., the linker is
86 # supposed to search those directories).
88 # There is no portable way to find the list of standard library
89 # directories. Require a POSIX shell anyway, to keep this simple.
91 for opt in $LDFLAGS $LIBS
95 [ -d ${opt##-L} ] || continue
97 @LD_SEARCHPATH@) # skip standard libdir
105 lib_flags="$lib_flags $opt"
110 ARG=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'`
118 # basic configuration
121 test -z "$exec_prefix" && exec_prefix="$ARG"
135 --cflags|--cflags-only-I)
137 if test "$includedir" != /usr/include ; then
140 sed -e 's,^[ ]*,,' -e 's, [ ]*, ,g' -e 's,[ ]*$,,' <<-ENDECHO
145 # no -D/-U options should be needed
150 for opt in $lib_flags
152 [ -n "$OPTS" ] && OPTS="$OPTS "
155 printf "%s\n" "$OPTS"
159 for opt in $lib_flags
163 [ -n "$OPTS" ] && OPTS="$OPTS "
168 printf "%s\n" "$OPTS"
172 for opt in $lib_flags
176 [ -n "$OPTS" ] && OPTS="$OPTS "
181 printf "%s\n" "$OPTS"
185 for opt in $lib_flags
191 [ -n "$OPTS" ] && OPTS="$OPTS "
196 printf "%s\n" "$OPTS"
200 echo "@VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@"
203 echo "@VERSION@" | sed -e 's/:/./g'
221 Usage: ${THIS}-config [options]
224 --prefix echos the package-prefix of ${THIS}
225 --prefix=ARG sets the package-prefix of ${THIS}
226 --exec-prefix echos the executable-prefix of ${THIS}
227 --exec-prefix=ARG sets the executable-prefix of ${THIS}
229 --cflags echos the C compiler flags needed to compile with ${THIS}
230 --libs echos the libraries needed to link with ${THIS}
232 --libs-only-L echos -L linker options (search path) for ${THIS}
233 --libs-only-l echos -l linker options (libraries) for ${THIS}
234 --libs-only-other echos linker options other than -L/-l
236 --version echos the release+patchdate version of ${THIS}
237 --abi-version echos the ABI version of ${THIS}
239 --bindir echos the directory containing ${THIS} programs
240 --datadir echos the directory containing ${THIS} data
241 --libdir echos the directory containing ${THIS} libraries
242 --mandir echos the directory containing ${THIS} manual pages
244 --help prints this message
248 @SHELL@ "$0" --help 1>&2