LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   CFLAGS and LDFLAGS configuration problem (https://www.linuxquestions.org/questions/linux-general-1/cflags-and-ldflags-configuration-problem-767165/)

vofka 11-05-2009 05:42 PM

CFLAGS and LDFLAGS configuration problem
 
Hello! I have the following problem: i using Red Hat Enterprise 5.
I want to build and install cairo to the folder differrent from /usr/local. So i using the following statement:
./configure --prefix=/opt CFLAGS=-I/opt/include LDFLAGS=-L/opt/lib
after configuring the configure script write me the following information message:
using CFLAGS:
-I/usr/include/freetype2 -I/usr/local/include -I/usr/include/libpng12 -I/usr/local/include -I/usr/local/include...
However i have the freetype2 in /opt/include/. So i don't understand why configure script ignore the CFLAGS, when i set the location to my freetype in opt folder?
My PKG_CONFIG_PATH is:
PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:/usr/lib/pkgconfig"
LD_LIBRARY_PATH="/usr/local/lib:/usr/lib"

However if add before the configure script execution, the line:
export PKG_CONFIG_PATH=/opt/lib/pkgconfig
and then:
./configure --prefix=/opt CFLAGS=-I/opt/include LDFLAGS=-L/opt/lib
It will use the expected path to freetype:
using CFLAGS:
-I/opt/include/freetype2 -I/opt/include -I/usr/include/libpng12.
So how CFLAGS work?

ammorais 11-05-2009 06:54 PM

You don't need to use CFLAGS to build cairo in to opt. CFLAGS are normaly use to optimization flags or debugging.

You can simple ./configure --prefix=/opt

PS: My answer is incomplete.

ammorais 11-05-2009 07:00 PM

./configure --help gives:
Code:

FONTCONFIG_CFLAGS
              C compiler flags for FONTCONFIG, overriding pkg-config
  FONTCONFIG_LIBS
              linker flags for FONTCONFIG, overriding pkg-config
  FREETYPE_CFLAGS
              C compiler flags for FREETYPE, overriding pkg-config
  FREETYPE_LIBS
              linker flags for FREETYPE, overriding pkg-config

So it's to assume you have to work with FREETYPE_CFLAGS and FREETYPE_LIBS

PS: I've made a test compile and I believe it's FREETYPE_CFLAGS that you want.

vofka 11-06-2009 04:28 PM

Thank you very much for your answer. Using FREETYPE_CFLAGS and FREETYPE_LIBS solve my problem.My mistake was that i simply thought that CFLAGS and LDFLAGS override the pkg-config


All times are GMT -5. The time now is 12:28 AM.