oetiker / rrdtool-1.x

RRDtool 1.x - Round Robin Database
http://www.rrdtool.org
GNU General Public License v2.0
1.01k stars 262 forks source link

freetype/fontconfig/cairo/pango version problem? / fontconfig compilation problem? #159

Open oetiker opened 12 years ago

oetiker commented 12 years ago

doc/rrdbuild.pod is not very clear about these versions:

{{{ grep cairo doc/rrdbuild.pod There is a problem with F on opensolaris. It suggests that xrender is required for compilation with cairo. This is not true and also perl -i~ -p -e 's/(Requires._?)\s_xrender.*/$1/' /usr/lib/pkgconfig/cairo.pc wget http://oss.oetiker.ch/rrdtool/pub/libs/cairo-1.6.4.tar.gz gunzip -c cairo-1.4.10.tar.gz | tar xf - cd cairo-1.4.10

}}}

using freetype-2.3.5, fontconfig-2.4.2, cairo-1.6.4, pango-1.21.1: Result:cairo does not find fontconfig {{{ cairo (version 1.6.4) will be compiled with the following surface backends: image: yes (always builtin) Xlib: no (disabled, use --enable-xlib to enable) Xlib Xrender: no (requires --enable-xlib) Quartz: no (CoreGraphics framework not found) Quartz-image: no (disabled, use --enable-quartz-image to enable) XCB: no (disabled, use --enable-xcb to enable) Win32: no (disabled, use --enable-win32 to enable) OS2: no (disabled, use --enable-os2 to enable) PostScript: yes PDF: yes SVG: yes glitz: no (disabled, use --enable-glitz to enable) BeOS: no (disabled, use --enable-beos to enable) DirectFB: no (disabled, use --enable-directfb to enable)

the following font backends: FreeType: no (requires fontconfig) Win32: no (disabled, use --enable-win32 to enable) Quartz: no (CoreGraphics framework not found)

the following features: PNG functions: yes

and the following debug options: gcov support: no test surfaces: no ps testing: yes pdf testing: no (requires poppler-glib >= 0.8.0) svg testing: no (requires librsvg-2.0 >= 2.15.0)

using CFLAGS: -I/usr/include/libpng12 -I/usr/local/include/pixman-1 -Wall -Wsign-compare -Werror-implicit-function-declaration -Wpoi nter-arith -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wpacked - Wmissing-format-attribute -Wdeclaration-after-statement -Wno-unused-parameter -Wno-long-long -Winline -fno-strict-alia sing

configure: error: Cairo requires at least one font backend. Please install freetype and fontconfig, then try again: http://freetype.org/ http://fontconfig.org/

}}} configure.log {{{ configure:27969: gcc -o conftest -O3 -fPIC conftest.c -lm -lfontconfig >&5 /tmp/cci157aI.o(.text+0x15): In function main': : undefined reference toFcFini' collect2: ld returned 1 exit status configure:27975: $? = 1 configure: failed program was: /* confdefs.h. _/ #define PACKAGE_NAME "cairo" #define PACKAGE_TARNAME "cairo" #define PACKAGE_VERSION "1.6.4" #define PACKAGE_STRING "cairo 1.6.4" #define PACKAGE_BUGREPORT "http://bugs.freedesktop.org/enter_bug.cgi?product=cairo" #define PACKAGE "cairo" #define VERSION "1.6.4" #define STDC_HEADERS 1 #define HAVE_SYS_TYPES_H 1 #define HAVE_SYS_STAT_H 1 #define HAVE_STDLIB_H 1 #define HAVE_STRING_H 1 #define HAVE_MEMORY_H 1 #define HAVE_STRINGS_H 1 #define HAVE_INTTYPES_H 1 #define HAVE_STDINT_H 1 #define HAVE_UNISTD_H 1 #define HAVE_DLFCN_H 1 #define STDC_HEADERS 1 #define HAVE_CTIME_R 1 #define HAVE_DRAND48 1 / end confdefs.h. / /_ Define FcFini to an innocuous variant, in case declares FcFini. For example, HP-UX 11i declares gettimeofday. _/ #define FcFini innocuous_FcFini
/_ System header to define **stub macros and hopefully few prototypes,
which can conflict with char FcFini (); below.
Prefer to if __STDC** is defined, since
exists even on freestanding compilers. _/
#ifdef STDC
# include
#else
# include
#endif
#undef FcFini
/_ Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. _/
#ifdef __cplusplus
extern "C"
#endif
char FcFini ();
/_ The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined __stub_FcFini defined __stub___FcFini
choke me
#endif
int
main ()
{
return FcFini ();
;
return 0;
}

configure:27993: result: no }}}

using freetype-2.3.5, fontconfig-2.4.2, cairo-1.4.10, pango-1.21.1: rrdtool does not find pangocairo: ...

{{{ Find 3rd-Party Libraries checking for cairo_font_options_create in -lcairo... no checking for pkg-config... pkg-config checking for cairo_font_options_create in -lcairo... yes checking cairo.h usability... yes checking cairo.h presence... yes checking for cairo.h... yes checking for cairo_svg_surface_create in -lcairo... yes checking cairo-svg.h usability... yes checking cairo-svg.h presence... yes checking for cairo-svg.h... yes checking for cairo_pdf_surface_create in -lcairo... yes checking cairo-pdf.h usability... yes checking cairo-pdf.h presence... yes checking for cairo-pdf.h... yes checking for cairo_ps_surface_create in -lcairo... yes checking cairo-ps.h usability... yes checking cairo-ps.h presence... yes checking for cairo-ps.h... yes checking for pango_cairo_context_set_font_options in -lpango-1.0... no checking for pkg-config... (cached) pkg-config checking for pango_cairo_context_set_font_options in -lpango-1.0... no

configure: WARNING:


checking for xmlParseFile in -lxml2... yes checking libxml/parser.h usability... yes checking libxml/parser.h presence... yes checking for libxml/parser.h... yes configure: error: Please fix the library issues listed above and try again.

}}}

But as FcFini is documented in fontconfig, this could also be a fontconfig configuration/compilation/installation problem, and only rrdbuild.pod should be corrected regards

A.

oetiker commented 12 years ago

[human] == order of directories in PKG_CONFIG_PATH is important == as not being able to get rid of old freetype: {{{ rpm -q freetype freetype-2.1.4-7.el3 }}} I use {{{ export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig }}} which lets cairo 1.6.4 recognize freetype another {{{ export LD_LIBRARY_PATH=/usr/local/lib }}} configure and make works!

... perhaps helpful for users with old systems ;-))

regards

A.