1 | # $Id: gen_yat_pc.sh.in 3111 2013-11-10 01:22:53Z peter $ |
---|
2 | # @configure_input@ |
---|
3 | |
---|
4 | # Copyright (C) 2011, 2012, 2013 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 | |
---|
21 | input=yat.pc.in |
---|
22 | |
---|
23 | while 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 |
---|
48 | done |
---|
49 | |
---|
50 | # prefix is what it is, i.e., no variables in string |
---|
51 | my_prefix=${prefix} |
---|
52 | |
---|
53 | my_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). |
---|
57 | if test x"${exec_prefix}" = x"@exec_prefix@"; then |
---|
58 | my_exec_prefix='@exec_prefix@'; |
---|
59 | fi |
---|
60 | |
---|
61 | # likewise for libdir |
---|
62 | my_libdir=${libdir} |
---|
63 | if test x"${libdir}" = x"@libdir@"; then |
---|
64 | my_libdir='@libdir@'; |
---|
65 | fi |
---|
66 | |
---|
67 | # likewise for includedir |
---|
68 | my_includedir=${includedir} |
---|
69 | if test x"${includedir}" = x"@includedir@"; then |
---|
70 | my_includedir='@includedir@'; |
---|
71 | fi |
---|
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|@gsl_version[@]|@gsl_version@|g' \ |
---|
80 | -e 's|@CPPFLAGS[@]|@CPPFLAGS@|g' \ |
---|
81 | -e 's|@YAT_CPPFLAGS[@]|@YAT_CPPFLAGS@|g' \ |
---|
82 | -e 's|@CXXFLAGS[@]|@CXXFLAGS@|g' \ |
---|
83 | -e 's|@YAT_CXXFLAGS[@]|@YAT_CXXFLAGS@|g' \ |
---|
84 | -e 's|@LDFLAGS[@]|@LDFLAGS@|g' \ |
---|
85 | -e 's|@YAT_LDFLAGS[@]|@YAT_LDFLAGS@|g' \ |
---|
86 | -e 's|@YAT_PC_LIBS[@]|@YAT_PC_LIBS@|g' \ |
---|
87 | -e 's|@LIBS[@]|@LIBS@|g' \ |
---|
88 | < $input |
---|