LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-05-2009, 05:42 PM   #1
vofka
LQ Newbie
 
Registered: Jun 2009
Distribution: RHEL-5.2
Posts: 26

Rep: Reputation: 15
Question 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?
 
Old 11-05-2009, 06:54 PM   #2
ammorais
Member
 
Registered: Nov 2009
Location: Lisbon, Portugal
Distribution: Gentoo, CentOs, Ubuntu, Debian
Posts: 182

Rep: Reputation: 49
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.

Last edited by ammorais; 11-05-2009 at 06:57 PM.
 
Old 11-05-2009, 07:00 PM   #3
ammorais
Member
 
Registered: Nov 2009
Location: Lisbon, Portugal
Distribution: Gentoo, CentOs, Ubuntu, Debian
Posts: 182

Rep: Reputation: 49
./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.

Last edited by ammorais; 11-05-2009 at 07:05 PM.
 
Old 11-06-2009, 04:28 PM   #4
vofka
LQ Newbie
 
Registered: Jun 2009
Distribution: RHEL-5.2
Posts: 26

Original Poster
Rep: Reputation: 15
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
utf8 locale LDFLAGS -lncursesw wrong, needs to be -lncurses? Mol_Bolom Linux - Software 0 07-26-2009 01:57 AM
CFLAGS and LDFLAGS question versaulis Linux - Software 1 11-07-2008 11:33 AM
Cflags bong.mau Programming 1 04-30-2007 11:08 AM
What are LDFLAGS and AM_LDFLAGS!? wimnat Linux - Software 2 11-21-2005 04:08 AM
how to use LDFLAGS while running ./configure Kilahchris Linux - Newbie 1 08-27-2004 10:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:09 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration