using .pc file

Werner Koch wk at gnupg.org
Mon Mar 14 23:47:04 CET 2011


On Mon, 14 Mar 2011 21:36, mabrand at mabrand.nl said:
> On 03/14/2011 07:30 PM, Vincent Torri wrote:

>>  * for XP on linux using the cross-compilation toolchain that is on
>> my distro
>>  * for CE on linux using mingw32ce

> I think Vincent has a point. Pkg-config can be useful when building
> for MinGW. It's quite valuable actually for the mingw-cross-env

On short:

Except that we need to use the wrapper script below around pkg-config to
do it properly: No such problem with the native libgcrypt et al config
scripts - they just work.  See the gpg4win meta installer for the whole
stuff.


Shalom-Salam,

   Werner

=== Stuff in the Makefile ===
# We need to fix the prefix in the various packages using pkgconfig,
# or we can't substitute it properly in our pkg-config wrapper.
define gpg4win_pkg_glib_post_install
 (cd $$$${pkgidir};                                                     \
 perl -pi -e 's/^prefix=.*$$$$/prefix=\/usr/' `find . -name \*.pc`)
endef

=== pkg-config ====
CMD=/usr/bin/pkg-config
PREFIX=/usr

if [ ! "$SYSROOT" ]; then
    echo "pkg-config-filter: missing \$SYSROOT environment variable"
    exit 2
fi

#if [ ! "$PKG_CONFIG_LIBDIR" ]; then
#    export PKG_CONFIG_LIBDIR=$SYSROOT/lib/pkgconfig/
#fi

export PKG_CONFIG_LIBDIR
export PKG_CONFIG_PATH

if $CMD $* |
    sed -e "s~\-L/*$SYSROOT/*~-L=/~g; s~\-I/*$SYSROOT/*~-I=/~g;" | # protect already given sysroot 
    sed -e "s~\-L$PREFIX/~-L=/~g; s~\-I$PREFIX/~-I=/~g;" | # add sysroot symbol to all absolute pathes
    sed -e "s~\-L\=~-L$SYSROOT~g; s~\-I\=~-I$SYSROOT~g;"  # replace sysroot sign to sysroot path
#    sed -e "s~\-x11\-~-win32-~g;" # replace x11 with win32 (target)
#    sed -e "s~pangoxft~pangow32ft~g;" # replace x11 with win32 (target)
then    
#    echo "PKG_CONFIG_LIBDIR=$PKG_CONFIG_LIBDIR" >&2
#    echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH" >&2
#    echo "OKAY" >&2;
    # See question 11 in comp.unix.shell FAQ.
    exit ${PIPESTATUS[0]};
else
    echo "pkg-config pipe failed!" >&2 
    exit 1
fi

-- 
Die Gedanken sind frei.  Ausnahmen regelt ein Bundesgesetz.




More information about the Gcrypt-devel mailing list