#!/bin/bash

# Parse gpgme-config-like flags, then invoke `pkg-config gpgme`:
# * Pass --cflags and --libs through
# * Map --version to --modversion
# * Ignore --thread=pthread

# Parse flags
for arg in "$@"; do
  case "$arg" in
	--cflags|--libs|--modversion)
	  flags="$flags $arg"
	  ;;
	--version)
	  flags="$flags --modversion"
	  ;;
	--thread=pthread)
	  ;;
	--prefix)
	  flags="$flags --variable=prefix"
	  ;;
	*)
	  echo "Unknown flag: $arg" >&2
	  exit 1
	  ;;
  esac
done

exec pkg-config gpgme $flags
