gpgme-config cleanups and --host option

gpgme-config.in: Add option --host.  Change options --cflags and
--libs to collapse duplicate include and lib dirs.  Try to put extra
libs at the end.

Note that gpgme.m4 has not yet been extended.
This commit is contained in:
Werner Koch 2011-04-06 20:10:45 +02:00
parent e54fe47db8
commit cdefec02b3
4 changed files with 75 additions and 36 deletions

View File

@ -3,6 +3,7 @@
* autogen.sh (--build-w32): Support option --build-w64. * autogen.sh (--build-w32): Support option --build-w64.
* configure.ac (HAVE_W64_SYSTEM): Define. * configure.ac (HAVE_W64_SYSTEM): Define.
(INSERT__TYPEDEFS_FOR_GPGME_H): New. (INSERT__TYPEDEFS_FOR_GPGME_H): New.
(GPGME_CONFIG_HOST): New.
2011-02-02 Marcus Brinkmann <mb@g10code.com> 2011-02-02 Marcus Brinkmann <mb@g10code.com>
@ -992,7 +993,7 @@
* autogen.sh: Added option --build-w32. * autogen.sh: Added option --build-w32.
Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 g10 Code GmbH Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2011 g10 Code GmbH
This file is free software; as a special exception the author gives This file is free software; as a special exception the author gives
unlimited permission to copy and/or distribute it, with or without unlimited permission to copy and/or distribute it, with or without

View File

@ -901,9 +901,11 @@ AH_BOTTOM([
# Substitution used for gpgme-config # Substitution used for gpgme-config
GPGME_CONFIG_LIBS="-lgpgme" GPGME_CONFIG_LIBS="-lgpgme"
GPGME_CONFIG_CFLAGS="" GPGME_CONFIG_CFLAGS=""
GPGME_CONFIG_HOST="$host"
AC_SUBST(GPGME_CONFIG_API_VERSION) AC_SUBST(GPGME_CONFIG_API_VERSION)
AC_SUBST(GPGME_CONFIG_LIBS) AC_SUBST(GPGME_CONFIG_LIBS)
AC_SUBST(GPGME_CONFIG_CFLAGS) AC_SUBST(GPGME_CONFIG_CFLAGS)
AC_SUBST(GPGME_CONFIG_HOST)
# Frob'da Variables # Frob'da Variables
LTLIBOBJS=`echo "$LIB@&t@OBJS" | LTLIBOBJS=`echo "$LIB@&t@OBJS" |

View File

@ -1,5 +1,9 @@
2011-04-06 Werner Koch <wk@g10code.com> 2011-04-06 Werner Koch <wk@g10code.com>
* gpgme-config.in: Add option --host. Change options --cflags and
--libs to collapse duplicate include and lib dirs. Try to put
extra libs at the end.
* gpgme.h.in: Use INSERT__TYPEDEFS_FOR_GPGME_H to include platform * gpgme.h.in: Use INSERT__TYPEDEFS_FOR_GPGME_H to include platform
specific typedefs. specific typedefs.

View File

@ -11,14 +11,16 @@
prefix=@prefix@ prefix=@prefix@
exec_prefix=@exec_prefix@ exec_prefix=@exec_prefix@
includedir=@includedir@
libdir=@libdir@
# Make sure that no weird locale setting messes up our sed regexps etc. # Make sure that no weird locale setting messes up our sed regexps etc.
LC_COLLATE=C LC_COLLATE=C
LC_ALL=C LC_ALL=C
LANG=C LANG=C
# GPGME's own cflags and libs
cflags="-I@includedir@"
libs="-L@libdir@"
# Network libraries. # Network libraries.
assuan_cflags="@LIBASSUAN_CFLAGS@" assuan_cflags="@LIBASSUAN_CFLAGS@"
assuan_libs="@LIBASSUAN_LIBS@" assuan_libs="@LIBASSUAN_LIBS@"
@ -55,6 +57,7 @@ Options:
[--exec-prefix] [--exec-prefix]
[--version] [--version]
[--api-version] [--api-version]
[--host]
[--libs] [--libs]
[--cflags] [--cflags]
[--get-gpg] [--get-gpg]
@ -101,46 +104,75 @@ while test $# -gt 0; do
echo "@GPGME_CONFIG_API_VERSION@" echo "@GPGME_CONFIG_API_VERSION@"
exit 0 exit 0
;; ;;
--cflags) --host)
if test "x$includedir" != "x/usr/include" -a "x$includedir" != "x/include"; then echo "@GPGME_CONFIG_HOST@"
output="$output -I$includedir" exit 0
fi
case "$thread_module" in
pthread)
output="$output $cflags_pthread"
;;
pth)
output="$output $cflags_pth"
;;
esac
output="$output $assuan_cflags $gpg_error_cflags"
if test "x$with_glib" = "xyes"; then
output="$output $glib_cflags"
fi
;; ;;
--libs) --cflags)
if test "x$libdir" != "x/usr/lib" -a "x$libdir" != "x/lib"; then result=
output="$output -L$libdir" tmp_c=
fi tmp_g=
case "$thread_module" in case "$thread_module" in
pthread) pthread) tmp_c="$cflags_pthread" ;;
output="$output -lgpgme-pthread $libs_pthread" pth) tmp_c="$cflags_pth" ;;
;; esac
pth) test "x$with_glib" = "xyes" && tmp_g="$cflags_glib"
output="$output -lgpgme-pth $libs_pth" for i in $cflags $tmp_c $assuan_cflags $gpg_error_cflags $tmp_g ; do
;; skip=no
case $i in
-I/usr/include|-I/include)
skip=yes
;;
-I*)
for j in $result ; do
if test x"$j" = x"$i" ; then
skip=yes
break;
fi
done
;;
esac
if test $skip = no ; then
result="$result $i"
fi
done
output="$output $result"
;;
--libs)
result=
tmp_x=
case "$thread_module" in
pthread) tmp_l="-lgpgme-pthread"; tmp_x="$libs_pthread" ;;
pth) tmp_l="-lgpgme-pth"; tmp_x="$libs_pth" ;;
*) *)
if test "x$with_glib" = "xyes"; then if test "x$with_glib" = "xyes" ; then
output="$output -lgpgme-glib" tmp_l="-lgpgme-glib"
tmp_x="$libs_glib"
else else
output="$output -lgpgme" tmp_l="-lgpgme"
fi fi
;; ;;
esac esac
output="$output $assuan_libs $gpg_error_libs" for i in $libs $tmp_l $assuan_libs $gpg_error_libs $tmp_x; do
if test "x$with_glib" = "xyes"; then skip=no
output="$output $glib_cflags" case $i in
fi -L/usr/lib|-L/lib)
skip=yes
;;
-L*|-l*)
for j in $result ; do
if test x"$j" = x"$i" ; then
skip=yes
break;
fi
done
;;
esac
if test $skip = no ; then
result="$result $i"
fi
done
output="$output $result"
;; ;;
--thread=*) --thread=*)
for thread_mod in $thread_modules; do for thread_mod in $thread_modules; do