qcow_utils: add pkgconfig script

Add a pkgconfig file and script to fix it up at build time.

Also fix extern "C" for the qcow_utils header.

BUG=chromium:806119
TEST=emerge-eve-kvm crosvm

Change-Id: Ib69d9e88b42d2f2c8661798c37537a4236e0506e
Reviewed-on: https://chromium-review.googlesource.com/891572
Commit-Ready: Stephen Barber <smbarber@chromium.org>
Tested-by: Stephen Barber <smbarber@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
This commit is contained in:
Stephen Barber 2018-01-29 13:25:29 -08:00 committed by chrome-bot
parent 6ecbbfd723
commit 19e57b9532
3 changed files with 32 additions and 0 deletions

View file

@ -0,0 +1,8 @@
bslot=@BSLOT@
include_dir=@INCLUDE_DIR@
Name: libqcow_utils
Description: QCOW2 shared library.
Version: ${bslot}
CFlags: -I${include_dir}
Libs: -lqcow_utils

View file

@ -0,0 +1,16 @@
#!/bin/bash
# Copyright 2018 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
set -e
v=$1
include_dir=$2
target_dir=$3
sed \
-e "s/@BSLOT@/${v}/g" \
-e "s:@INCLUDE_DIR@:${include_dir}:g" \
"qcow_utils/libqcow_utils.pc.in" > "${target_dir}/libqcow_utils.pc"

View file

@ -6,5 +6,13 @@
// Exported interface to basic qcow functionality to be used from C.
#ifdef __cplusplus
extern "C" {
#endif
// Create a basic, empty qcow2 file that can grow to `virtual_size` at `path`.
int create_qcow_with_size(const char *path, uint64_t virtual_size);
#ifdef __cplusplus
};
#endif