[Libreoffice] [BUG] Hide system pkg-config, to avoid finding stray freetype.

Tor Lillqvist tml at iki.fi
Thu Dec 22 02:59:32 PST 2011


> This is a protection-from-contaminated-system

But in general, a system can be contaminamed in arbitrary ways.
Should/can we really protect against arbitrary, unknown, ways in which
a system might have been changed by "helpful" 3rd-party software or
misguided sysadmins/users to not correspond to a normal installation
of the OS in question? No, we can't.

What we should do, IMHO, is to check in our own configure.in if there
is a pkg-config in PATH on a system where one is not expected to be
present (only Mac OS X, I guess?), and in that case emit a warning.

But wait, we already do that!

if test $_os = Darwin; then
    AC_MSG_CHECKING([for bogus pkg-config])
    if test -n "$PKG_CONFIG"; then
        if test "$PKG_CONFIG" = /usr/bin/pkg-config && ls -l
/usr/bin/pkg-config | grep -q Mono.framework; then
            AC_MSG_RESULT([yes, from Mono])
        else
            AC_MSG_RESULT([yes, from unknown origin])
        fi
        AC_MSG_WARN([This might have unexpected consequences, please
consider hiding $PKG_CONFIG])
        echo "Having a $PKG_CONFIG might have unexpected consequences,
please consider hiding it" >>warn
    else
        AC_MSG_RESULT([no])
    fi
fi

--tml


More information about the LibreOffice mailing list