2009-01-04 10:08:30 +08:00
|
|
|
#!@SHELL@
|
2012-01-01 11:05:05 +08:00
|
|
|
# $Id: gen-pkgconfig.in,v 1.14 2012/01/01 01:48:23 tom Exp $
|
2009-01-04 10:08:30 +08:00
|
|
|
##############################################################################
|
2011-10-09 08:51:26 +08:00
|
|
|
# Copyright (c) 2009-2010,2011 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@
|
2009-03-15 09:02:54 +08:00
|
|
|
PANEL_NAME=panel # @PANEL_NAME@
|
|
|
|
MENU_NAME=menu # @MENU_NAME@
|
|
|
|
FORM_NAME=form # @FORM_NAME@
|
|
|
|
CXX_NAME=ncurses++ # @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@
|
|
|
|
|
|
|
|
prefix="@prefix@"
|
|
|
|
exec_prefix="@exec_prefix@"
|
|
|
|
includedir="@includedir@"
|
|
|
|
libdir="@libdir@"
|
|
|
|
|
|
|
|
show_prefix='@prefix@'
|
|
|
|
show_exec_prefix='@exec_prefix@'
|
|
|
|
show_includedir='@includedir@'
|
|
|
|
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@"
|
|
|
|
|
2011-10-09 08:51:26 +08:00
|
|
|
if test "$includedir" = "/usr/include" ; then
|
|
|
|
CFLAGS=
|
|
|
|
else
|
|
|
|
CFLAGS="-I\${includedir}"
|
|
|
|
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
|
2011-10-09 08:51:26 +08:00
|
|
|
reqs="$PANEL_LIBRARY, $MENU_LIBRARY, $FORM_LIBRARY, $MAIN_LIBRARY"
|
2009-03-15 09:02:54 +08:00
|
|
|
desc="$desc add-on library"
|
2009-01-04 10:08:30 +08:00
|
|
|
else
|
2011-10-09 08:51:26 +08:00
|
|
|
reqs="$MAIN_LIBRARY"
|
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, "
|
|
|
|
reqs="${reqs}${SUB_LIBRARY}"
|
|
|
|
fi
|
2009-01-04 10:08:30 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
echo "** creating ${name}.pc"
|
|
|
|
cat >${name}.pc <<EOF
|
2011-10-09 08:51:26 +08:00
|
|
|
# vile:makemode
|
|
|
|
|
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@
|
|
|
|
|
|
|
|
Name: $name
|
|
|
|
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
|