Runtime check in configure (was: Re: ib - r30900 - in abiword/trunk: plugins/wmf src/af/gr/xp)

From: Hubert Figuière <hfiguiere_at_teaser.fr>
Date: Mon Apr 30 2012 - 06:48:29 CEST

On 29/04/12 06:56 AM, cvs@abisource.com wrote:
>
> Author: ib
> Date: 2012-04-29 15:56:36 +0200 (Sun, 29 Apr 2012)
> New Revision: 30900
>
> Modified:
> abiword/trunk/plugins/wmf/plugin.m4
> abiword/trunk/src/af/gr/xp/gr_CairoGraphics.cpp
> Log:
> Allow usage of font family 'Standard Symbols L'.
>
> Don't unconditionally disable it by commenting the code.
> Check whether libwmf has installed the font and if so, use it.
>
>
> Modified: abiword/trunk/plugins/wmf/plugin.m4
> ===================================================================
> --- abiword/trunk/plugins/wmf/plugin.m4 2012-04-29 13:51:15 UTC (rev 30899)
> +++ abiword/trunk/plugins/wmf/plugin.m4 2012-04-29 13:56:36 UTC (rev 30900)
> @@ -42,6 +42,15 @@
> fi
> fi
>
> +AC_PATH_PROG(libwmffontmap, libwmf-fontmap)
> +if test "$libwmffontmap" != ""; then
> + $libwmffontmap --map=libwmf.fontmap >/dev/null
> + grep -q 'familyname="Standard Symbols L"' libwmf.fontmap
> + if test $? -eq 0; then
> + AC_DEFINE([WITH_STANDARD_SYMBOLS_L], [1], [Font family 'Standard Symbols L' available])
> + fi
> +fi
> +
> if test "$enable_wmf" = "yes" || \
> test "$wmf_deps" = "yes"; then

This is just wrong. You are checking a runtime thing at compile time.
This just breaks in case of cross-compilation (including when the host
and target OS are the same).

Hub

>
>
> Modified: abiword/trunk/src/af/gr/xp/gr_CairoGraphics.cpp
> ===================================================================
> --- abiword/trunk/src/af/gr/xp/gr_CairoGraphics.cpp 2012-04-29 13:51:15 UTC (rev 30899)
> +++ abiword/trunk/src/af/gr/xp/gr_CairoGraphics.cpp 2012-04-29 13:56:36 UTC (rev 30900)
> @@ -2712,14 +2712,12 @@
> const char * pWeight = pszFontWeight;
> const char * pStretch = pszFontStretch;
>
> -// This substitution does not seem to be need on my Linux system
> -// and acutally cause problem on Mac with Cairo as it never finds the
> -// font "Standards Symbols L" -- hub
> -//
> -// if(pszFontFamily && !strcmp(pszFontFamily, "Symbol"))
> -// {
> -// pszFontFamily = "Standard Symbols L";
> -// }
> +#ifdef WITH_STANDARD_SYMBOLS_L
> + if(pszFontFamily && !strcmp(pszFontFamily, "Symbol"))
> + {
> + pszFontFamily = "Standard Symbols L";
> + }
> +#endif
>
> if(pszFontStyle && *pszFontStyle == 'n')
> pStyle = "";
>
> -----------------------------------------------
> To unsubscribe from this list, send a message to
> abisource-cvs-commit-request@abisource.com with the word
> unsubscribe in the message body.
Received on Mon Apr 30 06:48:40 2012

This archive was generated by hypermail 2.1.8 : Mon Apr 30 2012 - 06:48:41 CEST