2 # $Id: gen-pkgconfig.in,v 1.3 2009/01/03 22:26:47 tom Exp $
3 ##############################################################################
4 # Copyright (c) 2009 Free Software Foundation, Inc. #
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 ##############################################################################
31 # Author: Thomas E. Dickey, 2009
33 # The complete configure script for ncurses is the ncurses5-config (or similar
34 # name, depending on the flavor, e.g., ncursesw5-config, ncurses6-config, etc).
35 # That provides more information than pkg-config, and is the portable and
36 # recommended solution.
38 # For each library, generate a ".pc" file which depends on the base ncurses
39 # library, except that the tinfo library does not depend on ncurses.
41 TINFO_NAME=@TINFO_NAME@
42 DFT_DEP_SUFFIX=@DFT_DEP_SUFFIX@
43 CXX_LIB_SUFFIX=@CXX_LIB_SUFFIX@
44 LD_RPATH_OPT=@LD_RPATH_OPT@
47 exec_prefix="@exec_prefix@"
48 includedir="@includedir@"
51 show_prefix='@prefix@'
52 show_exec_prefix='@exec_prefix@'
53 show_includedir='@includedir@'
54 show_libdir='@libdir@'
56 MAIN_LIBRARY="${LIB_NAME}@DFT_ARG_SUFFIX@"
57 SUB_LIBRARY="${TINFO_NAME}@DFT_ARG_SUFFIX@"
62 root=`basename $name "$DFT_DEP_SUFFIX"`
63 if test "$name" == "$root" ; then
64 root=`basename $name "$CXX_LIB_SUFFIX"`
65 if test "$name" == "$root" ; then
70 name=`echo "$name" | sed -e 's/^lib//' -e 's/\..*$//'`
72 desc="ncurses @NCURSES_MAJOR@.@NCURSES_MINOR@"
73 if test $name = $MAIN_LIBRARY ; then
76 elif test $name = $SUB_LIBRARY ; then
78 desc="$desc terminal interface library"
81 desc="$desc add-on library"
84 if test "$includedir" = "/usr/include" ; then
87 cflags="-I\${includedir}"
90 if test "$libdir" = "/usr/lib" ; then
97 # add dependencies that pkg-config cannot guess about
98 if test -z "$reqs" ; then
99 if test -z "$LD_RPATH_OPT" ; then
104 echo "** creating ${name}.pc"
105 cat >${name}.pc <<EOF
107 exec_prefix=$show_exec_prefix
109 includedir=$show_includedir
110 major_version=@NCURSES_MAJOR@
111 version=@NCURSES_MAJOR@.@NCURSES_MINOR@.@NCURSES_PATCH@