2009-01-04 10:08:30 +08:00
|
|
|
#!@SHELL@
|
2015-02-22 10:09:20 +08:00
|
|
|
# $Id: gen-pkgconfig.in,v 1.21 2015/02/21 21:36:31 tom Exp $
|
2009-01-04 10:08:30 +08:00
|
|
|
##############################################################################
|
2015-02-22 10:09:20 +08:00
|
|
|
# Copyright (c) 2009-2014,2015 Free Software Foundation, Inc. #
|
2009-01-04 10:08:30 +08:00
|
|
|
# #
|
|
|
|
# Permission is hereby granted, free of charge, to any person obtaining a #
|
|
|
|
# copy of this software and associated documentation files (the "Software"), #
|
|
|
|
# to deal in the Software without restriction, including without limitation #
|
|
|
|
# the rights to use, copy, modify, merge, publish, distribute, distribute #
|
|
|
|
# with modifications, sublicense, and/or sell copies of the Software, and to #
|
|
|
|
# permit persons to whom the Software is furnished to do so, subject to the #
|
|
|
|
# following conditions: #
|
|
|
|
# #
|
|
|
|
# The above copyright notice and this permission notice shall be included in #
|
|
|
|
# all copies or substantial portions of the Software. #
|
|
|
|
# #
|
|
|
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
|
|
|
|
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, #
|
|
|
|
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL #
|
|
|
|
# THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER #
|
|
|
|
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING #
|
|
|
|
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER #
|
|
|
|
# DEALINGS IN THE SOFTWARE. #
|
|
|
|
# #
|
|
|
|
# Except as contained in this notice, the name(s) of the above copyright #
|
|
|
|
# holders shall not be used in advertising or otherwise to promote the sale, #
|
|
|
|
# use or other dealings in this Software without prior written #
|
|
|
|
# authorization. #
|
|
|
|
##############################################################################
|
|
|
|
#
|
2011-10-09 08:51:26 +08:00
|
|
|
# Author: Thomas E. Dickey
|
2009-01-04 10:08:30 +08:00
|
|
|
#
|
|
|
|
# The complete configure script for ncurses is the ncurses5-config (or similar
|
|
|
|
# name, depending on the flavor, e.g., ncursesw5-config, ncurses6-config, etc).
|
|
|
|
# That provides more information than pkg-config, and is the portable and
|
|
|
|
# recommended solution.
|
|
|
|
#
|
|
|
|
# For each library, generate a ".pc" file which depends on the base ncurses
|
|
|
|
# library, except that the tinfo library does not depend on ncurses.
|
|
|
|
LIB_NAME=@LIB_NAME@
|
|
|
|
TINFO_NAME=@TINFO_NAME@
|
2013-03-17 09:23:04 +08:00
|
|
|
PANEL_NAME=@PANEL_NAME@
|
|
|
|
MENU_NAME=@MENU_NAME@
|
|
|
|
FORM_NAME=@FORM_NAME@
|
|
|
|
CXX_NAME=@CXX_NAME@
|
2009-01-04 10:08:30 +08:00
|
|
|
DFT_DEP_SUFFIX=@DFT_DEP_SUFFIX@
|
2010-02-07 09:40:29 +08:00
|
|
|
TINFO_ARG_SUFFIX=@TINFO_ARG_SUFFIX@
|
2009-01-04 10:08:30 +08:00
|
|
|
CXX_LIB_SUFFIX=@CXX_LIB_SUFFIX@
|
|
|
|
|
2014-12-14 10:33:09 +08:00
|
|
|
suffix=@PC_MODULE_SUFFIX@
|
2009-01-04 10:08:30 +08:00
|
|
|
prefix="@prefix@"
|
|
|
|
exec_prefix="@exec_prefix@"
|
2014-01-19 08:49:51 +08:00
|
|
|
includedir="@includedir@@includesubdir@"
|
2009-01-04 10:08:30 +08:00
|
|
|
libdir="@libdir@"
|
|
|
|
|
|
|
|
show_prefix='@prefix@'
|
|
|
|
show_exec_prefix='@exec_prefix@'
|
2014-01-19 08:49:51 +08:00
|
|
|
show_includedir='@includedir@@includesubdir@'
|
2009-01-04 10:08:30 +08:00
|
|
|
show_libdir='@libdir@'
|
|
|
|
|
|
|
|
MAIN_LIBRARY="${LIB_NAME}@DFT_ARG_SUFFIX@"
|
2010-02-07 09:40:29 +08:00
|
|
|
SUB_LIBRARY="${TINFO_ARG_SUFFIX}"
|
2009-03-15 09:02:54 +08:00
|
|
|
PANEL_LIBRARY="${PANEL_NAME}@DFT_ARG_SUFFIX@"
|
|
|
|
MENU_LIBRARY="${MENU_NAME}@DFT_ARG_SUFFIX@"
|
|
|
|
FORM_LIBRARY="${FORM_NAME}@DFT_ARG_SUFFIX@"
|
|
|
|
|
2015-02-22 10:09:20 +08:00
|
|
|
CFLAGS="@PKG_CFLAGS@"
|
|
|
|
if test "$includedir" != "/usr/include" ; then
|
2014-12-14 10:33:09 +08:00
|
|
|
includetop=`echo "$includedir" | sed -e 's,/include/[^/]*$,/include/,'`
|
|
|
|
test "$includetop" = "/usr/include" && includetop="$includedir"
|
|
|
|
if test "x$includetop" != "$includedir"
|
|
|
|
then
|
2015-02-22 10:09:20 +08:00
|
|
|
CFLAGS="$CFLAGS -I${includetop}"
|
2014-12-14 10:33:09 +08:00
|
|
|
fi
|
2015-02-22 10:09:20 +08:00
|
|
|
CFLAGS="$CFLAGS -I\${includedir}"
|
2011-10-09 08:51:26 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
if test "$libdir" = "/usr/lib" ; then
|
|
|
|
LDFLAGS=
|
|
|
|
else
|
|
|
|
LDFLAGS="-L\${libdir}"
|
|
|
|
fi
|
|
|
|
|
2011-11-27 10:34:54 +08:00
|
|
|
for name in @PC_MODULES_TO_MAKE@
|
2009-01-04 10:08:30 +08:00
|
|
|
do
|
2012-01-01 11:05:05 +08:00
|
|
|
name="${name}"
|
2009-01-04 10:08:30 +08:00
|
|
|
|
|
|
|
desc="ncurses @NCURSES_MAJOR@.@NCURSES_MINOR@"
|
2011-10-09 08:51:26 +08:00
|
|
|
reqs=
|
|
|
|
|
2009-01-04 10:08:30 +08:00
|
|
|
if test $name = $MAIN_LIBRARY ; then
|
|
|
|
desc="$desc library"
|
|
|
|
elif test $name = $SUB_LIBRARY ; then
|
|
|
|
desc="$desc terminal interface library"
|
2009-03-15 09:02:54 +08:00
|
|
|
elif expr $name : ".*${CXX_NAME}.*" >/dev/null ; then
|
2014-12-14 10:33:09 +08:00
|
|
|
reqs="$PANEL_LIBRARY${suffix}, $MENU_LIBRARY${suffix}, $FORM_LIBRARY${suffix}, $MAIN_LIBRARY${suffix}"
|
2009-03-15 09:02:54 +08:00
|
|
|
desc="$desc add-on library"
|
2009-01-04 10:08:30 +08:00
|
|
|
else
|
2014-12-14 10:33:09 +08:00
|
|
|
reqs="$MAIN_LIBRARY${suffix}"
|
2009-01-04 10:08:30 +08:00
|
|
|
desc="$desc add-on library"
|
|
|
|
fi
|
|
|
|
|
2012-01-01 11:05:05 +08:00
|
|
|
if test $name != $SUB_LIBRARY && test $SUB_LIBRARY != $MAIN_LIBRARY ; then
|
2011-10-09 08:51:26 +08:00
|
|
|
if test $name != $TINFO_NAME ; then
|
|
|
|
test -n "$reqs" && reqs="$reqs, "
|
2014-12-14 10:33:09 +08:00
|
|
|
reqs="${reqs}${SUB_LIBRARY}${suffix}"
|
2011-10-09 08:51:26 +08:00
|
|
|
fi
|
2009-01-04 10:08:30 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
echo "** creating ${name}.pc"
|
2014-12-14 10:33:09 +08:00
|
|
|
cat >${name}${suffix}.pc <<EOF
|
2009-01-04 10:08:30 +08:00
|
|
|
prefix=$show_prefix
|
|
|
|
exec_prefix=$show_exec_prefix
|
|
|
|
libdir=$show_libdir
|
|
|
|
includedir=$show_includedir
|
|
|
|
major_version=@NCURSES_MAJOR@
|
|
|
|
version=@NCURSES_MAJOR@.@NCURSES_MINOR@.@NCURSES_PATCH@
|
|
|
|
|
2014-12-14 10:33:09 +08:00
|
|
|
Name: ${name}${suffix}
|
2009-01-04 10:08:30 +08:00
|
|
|
Description: $desc
|
|
|
|
Version: \${version}
|
2011-10-09 08:51:26 +08:00
|
|
|
URL: http://invisible-island.net/ncurses
|
|
|
|
Requires.private: $reqs
|
|
|
|
Libs: $LDFLAGS -l$name
|
|
|
|
Libs.private: @LIBS@
|
|
|
|
Cflags: $CFLAGS
|
2009-01-04 10:08:30 +08:00
|
|
|
EOF
|
2011-10-09 08:51:26 +08:00
|
|
|
|
|
|
|
#pr -f ${name}.pc
|
2009-01-04 10:08:30 +08:00
|
|
|
done
|
|
|
|
# vile:shmode
|