source: trunk/build_support/gen_yat_pc.sh.in @ 3811

Last change on this file since 3811 was 3811, checked in by Peter, 4 months ago

prefer variable assignment as autoconf time rather than at configure time and get rid of the variable in Makefile and gen_yat_pc script.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.5 KB
Line 
1# $Id: gen_yat_pc.sh.in 3811 2019-07-08 07:06:31Z peter $
2# @configure_input@
3
4# Copyright (C) 2011, 2012, 2013, 2014 Peter Johansson
5#
6# This file is part of the yat library, http://dev.thep.lu.se/yat
7#
8# The yat library is free software; you can redistribute it
9# and/or modify it under the terms of the GNU General Public License as
10# published by the Free Software Foundation; either version 3 of the
11# License, or (at your option) any later version.
12#
13# The yat library is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16# General Public License for more details.
17#
18# You should have received a copy of the GNU General Public License
19# along with yat. If not, see <http://www.gnu.org/licenses/>.
20
21input=yat.pc.in
22
23while test $# -gt 0; do
24    optarg=`echo "$1" | @SED@ 's|.*=||'`
25    case "$1" in
26    --prefix=*)
27    prefix=${optarg}
28    ;;
29    --exec-prefix=*)
30    exec_prefix=${optarg}
31    ;;
32    --libdir=*)
33    libdir=${optarg}
34    ;;
35    --includedir=*)
36    includedir=${optarg}
37    ;;
38    --input=*)
39    input=${optarg}
40    ;;
41    *)
42    echo "error: unknown option: $1" >&2
43    exit 1
44    ;;
45    esac
46    # next please
47    shift
48done
49
50# prefix is what it is, i.e., no variables in string
51my_prefix=${prefix}
52
53my_exec_prefix=${exec_prefix}
54# Check if exec_prefix has been modified via make commandline. If
55# exec_prefix was not set at make time, the comparison below is
56# true (also in the case when prefix was set at make time).
57if test x"${exec_prefix}" = x"@exec_prefix@"; then
58  my_exec_prefix='@exec_prefix@';
59fi
60
61# likewise for libdir
62my_libdir=${libdir}
63if test x"${libdir}" = x"@libdir@"; then
64  my_libdir='@libdir@';
65fi
66
67# likewise for includedir
68my_includedir=${includedir}
69if test x"${includedir}" = x"@includedir@"; then
70  my_includedir='@includedir@';
71fi
72
73@SED@ -e 's|@PACKAGE_URL[@]|@PACKAGE_URL@|g' \
74-e "s|@prefix[@]|${my_prefix}|g" \
75-e "s|@exec_prefix[@]|${my_exec_prefix}|g" \
76-e "s|@libdir[@]|${my_libdir}|g" \
77-e "s|@includedir[@]|${my_includedir}|g" \
78-e 's|@VERSION[@]|@VERSION@|g' \
79-e 's|@CPPFLAGS[@]|@CPPFLAGS@|g' \
80-e 's|@YAT_CPPFLAGS[@]|@YAT_CPPFLAGS@|g' \
81-e 's|@CXXFLAGS[@]|@CXXFLAGS@|g' \
82-e 's|@YAT_CXXFLAGS[@]|@YAT_CXXFLAGS@|g' \
83-e 's|@LDFLAGS[@]|@LDFLAGS@|g' \
84-e 's|@YAT_LDFLAGS[@]|@YAT_LDFLAGS@|g' \
85-e 's|@YAT_PC_LIBS[@]|@YAT_PC_LIBS@|g' \
86-e 's|@YAT_PC_LIBS_PRIVATE[@]|@YAT_PC_LIBS_PRIVATE@|g' \
87-e 's|@YAT_PC_REQUIRES[@]|@YAT_PC_REQUIRES@|g' \
88-e 's|@YAT_PC_REQUIRES_PRIVATE[@]|@YAT_PC_REQUIRES_PRIVATE@|g' \
89-e 's|@LIBS[@]|@LIBS@|g' \
90< $input
Note: See TracBrowser for help on using the repository browser.