summaryrefslogtreecommitdiff
path: root/src/lib/libssl/generate_pkgconfig.sh
diff options
context:
space:
mode:
authorjasper <>2011-05-05 20:58:15 +0000
committerjasper <>2011-05-05 20:58:15 +0000
commitdaa41feed7a1d73dfc71d8d7a287a7f1db625be9 (patch)
tree4aea5329d2bc9a333ee7fc75ed3ddd709cce8ae1 /src/lib/libssl/generate_pkgconfig.sh
parentad527ff4137ec2b21fca81a6af20dd16c170ea59 (diff)
downloadopenbsd-daa41feed7a1d73dfc71d8d7a287a7f1db625be9.tar.gz
openbsd-daa41feed7a1d73dfc71d8d7a287a7f1db625be9.tar.bz2
openbsd-daa41feed7a1d73dfc71d8d7a287a7f1db625be9.zip
Make this script more generic and minimize differences between
the openssl and libz versions: - use a generic ${lib_version} - define ${version_file} to look run ${version_re} on to acquire the library version. - add license - remove unused -k flag no change in generated files ok sthen@
Diffstat (limited to 'src/lib/libssl/generate_pkgconfig.sh')
-rw-r--r--src/lib/libssl/generate_pkgconfig.sh31
1 files changed, 23 insertions, 8 deletions
diff --git a/src/lib/libssl/generate_pkgconfig.sh b/src/lib/libssl/generate_pkgconfig.sh
index 434ab6cdc3..04bc77e38d 100644
--- a/src/lib/libssl/generate_pkgconfig.sh
+++ b/src/lib/libssl/generate_pkgconfig.sh
@@ -1,17 +1,31 @@
1#!/bin/sh 1#!/bin/sh
2# 2#
3# $OpenBSD: generate_pkgconfig.sh,v 1.6 2011/05/03 17:28:25 jasper Exp $ 3# $OpenBSD: generate_pkgconfig.sh,v 1.7 2011/05/05 20:58:15 jasper Exp $
4#
5# Copyright (c) 2010,2011 Jasper Lievisse Adriaanse <jasper@openbsd.org>
6#
7# Permission to use, copy, modify, and distribute this software for any
8# purpose with or without fee is hereby granted, provided that the above
9# copyright notice and this permission notice appear in all copies.
10#
11# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
4# 18#
5# Generate pkg-config files for OpenSSL. 19# Generate pkg-config files for OpenSSL.
6 20
7usage() { 21usage() {
8 echo "usage: ${0##*/} [-k] -c current_directory -o obj_directory" 22 echo "usage: ${0##*/} -c current_directory -o obj_directory"
9 exit 1 23 exit 1
10} 24}
11 25
12curdir= 26curdir=
13objdir= 27objdir=
14while getopts "c:ko:" flag; do 28while getopts "c:o:" flag; do
15 case "$flag" in 29 case "$flag" in
16 c) 30 c)
17 curdir=$OPTARG 31 curdir=$OPTARG
@@ -36,8 +50,9 @@ if [ ! -w "${objdir}" ]; then
36 exit 1 50 exit 1
37fi 51fi
38 52
39ssl_version=$(sed -nE 's/^#define[[:blank:]]+SHLIB_VERSION_NUMBER[[:blank:]]+"(.*)".*/\1/p' \ 53version_re="s/^#define[[:blank:]]+SHLIB_VERSION_NUMBER[[:blank:]]+\"(.*)\".*/\1/p"
40 ${curdir}/src/crypto/opensslv.h) 54version_file=${curdir}/src/crypto/opensslv.h
55lib_version=$(sed -nE ${version_re} ${version_file})
41 56
42# Put -I${includedir} into Cflags so configure script tests like 57# Put -I${includedir} into Cflags so configure script tests like
43# test -n "`pkg-config --cflags openssl`" 58# test -n "`pkg-config --cflags openssl`"
@@ -52,7 +67,7 @@ includedir=\${prefix}/include
52 67
53Name: OpenSSL-libcrypto 68Name: OpenSSL-libcrypto
54Description: OpenSSL cryptography library 69Description: OpenSSL cryptography library
55Version: ${ssl_version} 70Version: ${lib_version}
56Requires: 71Requires:
57Libs: -L\${libdir} -lcrypto 72Libs: -L\${libdir} -lcrypto
58Cflags: -I\${includedir} 73Cflags: -I\${includedir}
@@ -68,7 +83,7 @@ includedir=\${prefix}/include
68 83
69Name: OpenSSL 84Name: OpenSSL
70Description: Secure Sockets Layer and cryptography libraries 85Description: Secure Sockets Layer and cryptography libraries
71Version: ${ssl_version} 86Version: ${lib_version}
72Requires: 87Requires:
73Libs: -L\${libdir} -lssl -lcrypto 88Libs: -L\${libdir} -lssl -lcrypto
74Cflags: -I\${includedir} 89Cflags: -I\${includedir}
@@ -84,7 +99,7 @@ includedir=\${prefix}/include
84 99
85Name: OpenSSL 100Name: OpenSSL
86Description: Secure Sockets Layer and cryptography libraries and tools 101Description: Secure Sockets Layer and cryptography libraries and tools
87Version: ${ssl_version} 102Version: ${lib_version}
88Requires: 103Requires:
89Libs: -L\${libdir} -lssl -lcrypto 104Libs: -L\${libdir} -lssl -lcrypto
90Cflags: -I\${includedir} 105Cflags: -I\${includedir}