PKG_CONFIG_PATH how to set LDFLAGS and CPPFLAGS when compiling RRDtool

The mission is to install rrdtool on Red Hat, and yum or packages are not allowed. Compilation of all dependencies for rrdtool from the source into a separate directory: / Application / start / sepatare_folder

So, all I have is as follows:

ls cairo glib pango pixman -- pwd /apps/run 

After compiling the four dependencies, rrdtool complains about the time. / configure --prefix = / apps / run / rrdtool

The compiler cannot find libs [because I compiled them into a separate folder, not the standard one, as this is forbidden)

All military operations are as follows:

 Find 3rd-Party Libraries checking dbi/dbi.h usability... no checking dbi/dbi.h presence... no checking for dbi/dbi.h... no checking tcpd.h usability... no checking tcpd.h presence... no checking for tcpd.h... no checking for cairo_font_options_create in -lcairo... no checking for pkg-config... pkg-config configure: WARNING: ---------------------------------------------------------------------------- * I found a copy of pkgconfig, but there is no cairo-png.pc file around. You may want to set the PKG_CONFIG_PATH variable to point to its location. ---------------------------------------------------------------------------- configure: WARNING: ---------------------------------------------------------------------------- * I could not find a working copy of cairo-png. Check config.log for hints on why this is the case. Maybe you need to set LDFLAGS and CPPFLAGS appropriately so that compiler and the linker can find libcairo and its header files. If you have not installed cairo-png, you can get it either from its original home on http://cairographics.org/releases/ You can find also find an archive copy on http://oss.oetiker.ch/rrdtool/pub/libs The last tested version of cairo-png is 1.10.2. LIBS=-lm LDFLAGS= CPPFLAGS= ---------------------------------------------------------------------------- checking for cairo_svg_surface_create in -lcairo... no checking for pkg-config... (cached) pkg-config configure: WARNING: ---------------------------------------------------------------------------- * I found a copy of pkgconfig, but there is no cairo-svg.pc file around. You may want to set the PKG_CONFIG_PATH variable to point to its location. ---------------------------------------------------------------------------- configure: WARNING: ---------------------------------------------------------------------------- * I could not find a working copy of cairo-svg. Check config.log for hints on why this is the case. Maybe you need to set LDFLAGS and CPPFLAGS appropriately so that compiler and the linker can find libcairo and its header files. If you have not installed cairo-svg, you can get it either from its original home on http://cairographics.org/releases/ You can find also find an archive copy on http://oss.oetiker.ch/rrdtool/pub/libs The last tested version of cairo-svg is 1.10.2. LIBS=-lm LDFLAGS= CPPFLAGS= ---------------------------------------------------------------------------- checking for cairo_pdf_surface_create in -lcairo... no checking for pkg-config... (cached) pkg-config configure: WARNING: ---------------------------------------------------------------------------- * I found a copy of pkgconfig, but there is no cairo-pdf.pc file around. You may want to set the PKG_CONFIG_PATH variable to point to its location. ---------------------------------------------------------------------------- configure: WARNING: ---------------------------------------------------------------------------- * I could not find a working copy of cairo-pdf. Check config.log for hints on why this is the case. Maybe you need to set LDFLAGS and CPPFLAGS appropriately so that compiler and the linker can find libcairo and its header files. If you have not installed cairo-pdf, you can get it either from its original home on http://cairographics.org/releases/ You can find also find an archive copy on http://oss.oetiker.ch/rrdtool/pub/libs The last tested version of cairo-pdf is 1.10.2. LIBS=-lm LDFLAGS= CPPFLAGS= ---------------------------------------------------------------------------- checking for cairo_ps_surface_create in -lcairo... no checking for pkg-config... (cached) pkg-config configure: WARNING: ---------------------------------------------------------------------------- * I found a copy of pkgconfig, but there is no cairo-ps.pc file around. You may want to set the PKG_CONFIG_PATH variable to point to its location. ---------------------------------------------------------------------------- configure: WARNING: ---------------------------------------------------------------------------- * I could not find a working copy of cairo-ps. Check config.log for hints on why this is the case. Maybe you need to set LDFLAGS and CPPFLAGS appropriately so that compiler and the linker can find libcairo and its header files. If you have not installed cairo-ps, you can get it either from its original home on http://cairographics.org/releases/ You can find also find an archive copy on http://oss.oetiker.ch/rrdtool/pub/libs The last tested version of cairo-ps is 1.10.2. LIBS=-lm LDFLAGS= CPPFLAGS= ---------------------------------------------------------------------------- checking for pango_cairo_context_set_font_options in -lpangocairo-1.0... no checking for pkg-config... (cached) pkg-config configure: WARNING: ---------------------------------------------------------------------------- * I found a copy of pkgconfig, but there is no pangocairo.pc file around. You may want to set the PKG_CONFIG_PATH variable to point to its location. ---------------------------------------------------------------------------- configure: WARNING: ---------------------------------------------------------------------------- * I could not find a working copy of pangocairo. Check config.log for hints on why this is the case. Maybe you need to set LDFLAGS and CPPFLAGS appropriately so that compiler and the linker can find libpangocairo-1.0 and its header files. If you have not installed pangocairo, you can get it either from its original home on http://ftp.gnome.org/pub/GNOME/sources/pango/1.28 You can find also find an archive copy on http://oss.oetiker.ch/rrdtool/pub/libs The last tested version of pangocairo is 1.28.4. LIBS=-lm LDFLAGS= CPPFLAGS= ---------------------------------------------------------------------------- checking for glib_check_version in -lglib-2.0... no checking for pkg-config... (cached) pkg-config configure: WARNING: ---------------------------------------------------------------------------- * I found a copy of pkgconfig, but there is no glib-2.0.pc file around. You may want to set the PKG_CONFIG_PATH variable to point to its location. ---------------------------------------------------------------------------- configure: WARNING: ---------------------------------------------------------------------------- * I could not find a working copy of **glib-2.0**. Check config.log for hints on why this is the case. Maybe you need to set LDFLAGS and CPPFLAGS appropriately so that compiler and the linker can find libglib-2.0 and its header files. If you have not installed glib-2.0, you can get it either from its original home on ftp://ftp.gtk.org/pub/glib/2.28/ You can find also find an archive copy on http://oss.oetiker.ch/rrdtool/pub/libs The last tested version of glib-2.0 is 2.28.7. LIBS=-lm LDFLAGS= CPPFLAGS= ---------------------------------------------------------------------------- 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. 

I have all the missing libraries, but I need to tell the compiler how to find them - a big pain. For example, glib-2.0 is missing:

 pwd /apps/run/glib/lib ls -la total 2300 drwxr-xr-x 4 root root 4096 May 3 08:18 . drwxr-xr-x 6 root root 4096 May 3 08:17 .. drwxr-xr-x 3 root root 4096 May 3 08:17 glib-2.0 -rwxr-xr-x 1 root root 928 May 3 08:18 libgio-2.0.la lrwxrwxrwx 1 root root 19 May 3 08:18 libgio-2.0.so -> libgio-2.0.so.0.0.0 lrwxrwxrwx 1 root root 19 May 3 08:18 libgio-2.0.so.0 -> libgio-2.0.so.0.0.0 -rwxr-xr-x 1 root root 712052 May 3 08:18 libgio-2.0.so.0.0.0 -rwxr-xr-x 1 root root 830 May 3 08:17 libglib-2.0.la lrwxrwxrwx 1 root root 23 May 3 08:17 libglib-2.0.so -> libglib-2.0.so.0.1504.0 lrwxrwxrwx 1 root root 23 May 3 08:17 libglib-2.0.so.0 -> libglib-2.0.so.0.1504.0 -rwxr-xr-x 1 root root 1168721 May 3 08:17 libglib-2.0.so.0.1504.0 -rwxr-xr-x 1 root root 887 May 3 08:18 libgmodule-2.0.la lrwxrwxrwx 1 root root 26 May 3 08:18 libgmodule-2.0.so -> libgmodule-2.0.so.0.1504.0 lrwxrwxrwx 1 root root 26 May 3 08:18 libgmodule-2.0.so.0 -> libgmodule-2.0.so.0.1504.0 -rwxr-xr-x 1 root root 16107 May 3 08:18 libgmodule-2.0.so.0.1504.0 -rwxr-xr-x 1 root root 882 May 3 08:18 libgobject-2.0.la lrwxrwxrwx 1 root root 26 May 3 08:18 libgobject-2.0.so -> libgobject-2.0.so.0.1504.0 lrwxrwxrwx 1 root root 26 May 3 08:18 libgobject-2.0.so.0 -> libgobject-2.0.so.0.1504.0 -rwxr-xr-x 1 root root 378273 May 3 08:18 libgobject-2.0.so.0.1504.0 -rwxr-xr-x 1 root root 897 May 3 08:18 libgthread-2.0.la lrwxrwxrwx 1 root root 26 May 3 08:18 libgthread-2.0.so -> libgthread-2.0.so.0.1504.0 lrwxrwxrwx 1 root root 26 May 3 08:18 libgthread-2.0.so.0 -> libgthread-2.0.so.0.1504.0 -rwxr-xr-x 1 root root 24126 May 3 08:18 libgthread-2.0.so.0.1504.0 drwxr-xr-x 2 root root 4096 May 3 08:17 pkgconfig 

There are good tips, but unfortunately I canโ€™t understand them:

  • You can set the PKG_CONFIG_PATH variable to indicate its location.
  • You may need to install LDFLAGS and CPPFLAGS accordingly so that the compiler and linker can find libglib-2.0 and its header files.

There is not enough skill to set PKG_CONFIG_PATH to include a directory in which several required libs [eg glib-2.0.pc, cairo-ps, cairo-png, ..] can be found. Tried something like this:

 export LD_LIBRARY_PATH=/apps/run/glib/lib;export LD_LIBRARY_PATH=/apps/run//apps/run/cairo/lib 

but does not work. Also not sure if this will be enough, as there are recommendations for configuring LDFLAGS and CPPFLAGS . Tried this:

 export LDFLAGS='-L/apps/run/cairo/libs' 

but that does not seem right. Or shloud, I specify LDFLAGS and CPPFLAGS as part. / configure? What should be the syntax? Please advice, look for general principles, but are not able to fit into my surroundings. thanks

+4
source share
1 answer

To set paths, for example. LD_LIBRARY_PATH of PKG_CONFIG_PATH , you must use one export and split the paths with : For instance:

export PKG_CONFIG_PATH=/my/path:/my/other/path:/yet/another/path

Running the mulitple export one after another, as you showed for LD_LIBRARY_PATH , will overwrite them, i.e. only the last one will remain. As a rule, it is reasonable to always include the current value (it is normal if it is empty):

export PKG_CONFIG_PATH=/my/path:/my/other/path:/yet/another/path:$PKG_CONFIG_PATH

Try to find the cairo-png.pc on your system, and then set PKG_CONFIG_PATH to the directory in which it is contained.

No need to bother with LD_LIBRARY_PATH LDFLAGS , the pkgconfig .pc file should take care of this for you.

+7
source

Source: https://habr.com/ru/post/1478983/


All Articles