gen-pkgconfig.in (262629) | gen-pkgconfig.in (262685) |
---|---|
1#!@SHELL@ | 1#!@SHELL@ |
2# $Id: gen-pkgconfig.in,v 1.8 2010/02/06 22:12:07 Miroslav.Lichvar Exp $ | 2# $Id: gen-pkgconfig.in,v 1.16 2014/01/18 20:21:45 tom Exp $ |
3############################################################################## | 3############################################################################## |
4# Copyright (c) 2009,2010 Free Software Foundation, Inc. # | 4# Copyright (c) 2009-2013,2014 Free Software Foundation, Inc. # |
5# # 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: # --- 10 unchanged lines hidden (view full) --- 23# DEALINGS IN THE SOFTWARE. # 24# # 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 # 28# authorization. # 29############################################################################## 30# | 5# # 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: # --- 10 unchanged lines hidden (view full) --- 23# DEALINGS IN THE SOFTWARE. # 24# # 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 # 28# authorization. # 29############################################################################## 30# |
31# Author: Thomas E. Dickey, 2009 | 31# Author: Thomas E. Dickey |
32# 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. 37# 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. 40LIB_NAME=@LIB_NAME@ 41TINFO_NAME=@TINFO_NAME@ | 32# 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. 37# 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. 40LIB_NAME=@LIB_NAME@ 41TINFO_NAME=@TINFO_NAME@ |
42PANEL_NAME=panel # @PANEL_NAME@ 43MENU_NAME=menu # @MENU_NAME@ 44FORM_NAME=form # @FORM_NAME@ 45CXX_NAME=ncurses++ # @CXX_NAME@ | 42PANEL_NAME=@PANEL_NAME@ 43MENU_NAME=@MENU_NAME@ 44FORM_NAME=@FORM_NAME@ 45CXX_NAME=@CXX_NAME@ |
46DFT_DEP_SUFFIX=@DFT_DEP_SUFFIX@ 47TINFO_ARG_SUFFIX=@TINFO_ARG_SUFFIX@ 48CXX_LIB_SUFFIX=@CXX_LIB_SUFFIX@ 49 50prefix="@prefix@" 51exec_prefix="@exec_prefix@" | 46DFT_DEP_SUFFIX=@DFT_DEP_SUFFIX@ 47TINFO_ARG_SUFFIX=@TINFO_ARG_SUFFIX@ 48CXX_LIB_SUFFIX=@CXX_LIB_SUFFIX@ 49 50prefix="@prefix@" 51exec_prefix="@exec_prefix@" |
52includedir="@includedir@" | 52includedir="@includedir@@includesubdir@" |
53libdir="@libdir@" 54 55show_prefix='@prefix@' 56show_exec_prefix='@exec_prefix@' | 53libdir="@libdir@" 54 55show_prefix='@prefix@' 56show_exec_prefix='@exec_prefix@' |
57show_includedir='@includedir@' | 57show_includedir='@includedir@@includesubdir@' |
58show_libdir='@libdir@' 59 60MAIN_LIBRARY="${LIB_NAME}@DFT_ARG_SUFFIX@" 61SUB_LIBRARY="${TINFO_ARG_SUFFIX}" 62PANEL_LIBRARY="${PANEL_NAME}@DFT_ARG_SUFFIX@" 63MENU_LIBRARY="${MENU_NAME}@DFT_ARG_SUFFIX@" 64FORM_LIBRARY="${FORM_NAME}@DFT_ARG_SUFFIX@" 65 | 58show_libdir='@libdir@' 59 60MAIN_LIBRARY="${LIB_NAME}@DFT_ARG_SUFFIX@" 61SUB_LIBRARY="${TINFO_ARG_SUFFIX}" 62PANEL_LIBRARY="${PANEL_NAME}@DFT_ARG_SUFFIX@" 63MENU_LIBRARY="${MENU_NAME}@DFT_ARG_SUFFIX@" 64FORM_LIBRARY="${FORM_NAME}@DFT_ARG_SUFFIX@" 65 |
66SUB_LIBRARY_REQ=${SUB_LIBRARY} 67if test $TINFO_NAME = $LIB_NAME ; then 68 SUB_LIBRARY_REQ= | 66if test "$includedir" = "/usr/include" ; then 67 CFLAGS= 68else 69 CFLAGS="-I\${includedir}" |
69fi 70 | 70fi 71 |
71for lib in ../lib/* | 72if test "$libdir" = "/usr/lib" ; then 73 LDFLAGS= 74else 75 LDFLAGS="-L\${libdir}" 76fi 77 78for name in @PC_MODULES_TO_MAKE@ |
72do | 79do |
73 name=`basename $lib` 74 if test "$name" = "*" ; then 75 break 76 fi | 80 name="${name}" |
77 | 81 |
78 root=`basename $name "$DFT_DEP_SUFFIX"` 79 if test "$name" = "$root" ; then 80 root=`basename $name "$CXX_LIB_SUFFIX"` 81 if test "$name" = "$root" ; then 82 continue 83 fi 84 fi 85 86 name=`echo "$name" | sed -e 's/^lib//' -e 's/\..*$//'` 87 | |
88 desc="ncurses @NCURSES_MAJOR@.@NCURSES_MINOR@" | 82 desc="ncurses @NCURSES_MAJOR@.@NCURSES_MINOR@" |
83 reqs= 84 |
|
89 if test $name = $MAIN_LIBRARY ; then | 85 if test $name = $MAIN_LIBRARY ; then |
90 reqs=$SUB_LIBRARY_REQ | |
91 desc="$desc library" 92 elif test $name = $SUB_LIBRARY ; then | 86 desc="$desc library" 87 elif test $name = $SUB_LIBRARY ; then |
93 reqs= | |
94 desc="$desc terminal interface library" 95 elif expr $name : ".*${CXX_NAME}.*" >/dev/null ; then | 88 desc="$desc terminal interface library" 89 elif expr $name : ".*${CXX_NAME}.*" >/dev/null ; then |
96 reqs="$PANEL_LIBRARY $MENU_LIBRARY $FORM_LIBRARY $MAIN_LIBRARY $SUB_LIBRARY_REQ" | 90 reqs="$PANEL_LIBRARY, $MENU_LIBRARY, $FORM_LIBRARY, $MAIN_LIBRARY" |
97 desc="$desc add-on library" 98 else | 91 desc="$desc add-on library" 92 else |
99 reqs="$MAIN_LIBRARY $SUB_LIBRARY_REQ" | 93 reqs="$MAIN_LIBRARY" |
100 desc="$desc add-on library" 101 fi 102 | 94 desc="$desc add-on library" 95 fi 96 |
103 if test "$includedir" = "/usr/include" ; then 104 cflags= 105 else 106 cflags="-I\${includedir}" | 97 if test $name != $SUB_LIBRARY && test $SUB_LIBRARY != $MAIN_LIBRARY ; then 98 if test $name != $TINFO_NAME ; then 99 test -n "$reqs" && reqs="$reqs, " 100 reqs="${reqs}${SUB_LIBRARY}" 101 fi |
107 fi 108 | 102 fi 103 |
109 if test "$libdir" = "/usr/lib" ; then 110 libs= 111 else 112 libs="-L\${libdir}" 113 fi 114 libs="$libs -l$name" 115 116 # add dependencies that pkg-config cannot guess about 117 if test -z "$reqs" ; then 118 libs="$libs @LIBS@" 119 fi 120 | |
121 echo "** creating ${name}.pc" 122 cat >${name}.pc <<EOF 123prefix=$show_prefix 124exec_prefix=$show_exec_prefix 125libdir=$show_libdir 126includedir=$show_includedir 127major_version=@NCURSES_MAJOR@ 128version=@NCURSES_MAJOR@.@NCURSES_MINOR@.@NCURSES_PATCH@ 129 130Name: $name 131Description: $desc 132Version: \${version} | 104 echo "** creating ${name}.pc" 105 cat >${name}.pc <<EOF 106prefix=$show_prefix 107exec_prefix=$show_exec_prefix 108libdir=$show_libdir 109includedir=$show_includedir 110major_version=@NCURSES_MAJOR@ 111version=@NCURSES_MAJOR@.@NCURSES_MINOR@.@NCURSES_PATCH@ 112 113Name: $name 114Description: $desc 115Version: \${version} |
133Requires: $reqs 134Libs: $libs 135Cflags: $cflags | 116URL: http://invisible-island.net/ncurses 117Requires.private: $reqs 118Libs: $LDFLAGS -l$name 119Libs.private: @LIBS@ 120Cflags: $CFLAGS |
136EOF | 121EOF |
137 # pr -f ${name}.pc | 122 123 #pr -f ${name}.pc |
138done 139# vile:shmode | 124done 125# vile:shmode |