[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Devel] Silly autoconf question
From: |
David Turner |
Subject: |
Re: [Devel] Silly autoconf question |
Date: |
Fri, 15 Nov 2002 15:53:49 +0100 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.2a) Gecko/20020910 |
Hello,
Billy Biggs wrote:
So, I have an app that uses freetype2, and I have an autoconf script
that tries to check for it. This seemed pretty easy, I make sure I can
find 'freetype-config' and then make sure it's an acceptable version.
My freetype2 code uses it like this:
#include <ft2build.h>
#include FT_FREETYPE_H
#include FT_GLYPH_H
And then I do the dirty work.
The problem I'm having is that ft2build.h is not in the include path
returned by `freetype-config --cflags`. On my debian install, provided
by package libfreetype6-dev 2.1.2-7, the file is
/usr/include/ft2build.h, and `freetype-config --cflags` returns
"-I/usr/include/freetype2".
Do you have problems compiling your program with:
gcc `freetype-config --cflags` -c yourfile.c
As far as I know, '/usr/include' is a hard-coded include path in GCC
and many other Unix compilers (to avoid typing it too often),
so this should word even if only '/usr/include/freetype2' is
returned.. Actually, any "#include <header.h>" should work
"out-of-the-box" when the header file is in "/usr/include", or am I
missing something ??
In other words, this seems normal behaviour for '--cflags' to me.
The '/usr/include/freetype2' path is not used to find "ft2build.h",
more on this below...
I have two bug reports from users. One claims to run slackware, and
the file is /usr/X11R6/include/ft2build.h (and that it isn't in his
standard include path). And yet another claims he is using RedHat 7.1,
and claims that it works fine if he uses:
#include </usr/include/freetype2/freetype/config/ftbuild.h> In both
cases, they say this path is not returned by freetype-config --cflags.
Some older versions (4.1) of XFree86 did install their own (dated) version
of FreeType 2 in /usr/X11R6/... This has certainly been one of the most
stupid decision they've made. On certain systems, this will hide any
version of the library installed in "/usr" or "/usr/local", creating all
kinds of "interesting" problems :o)
If you encounter such a scheme, immediately delete the FreeType files
from /usr/X11R6/{include,lib,bin}. You may have to re-install the library
in "/usr" though.. (and kill your X-server to be sure that the old libs
aren't kept in memory by the dynamic linker)
Again, I do not understand why "#include <ft2build.h>" doesn't work when
the file is itself located in "/usr/include", which seems to be the default
of my distributions...
Maybe you're using a custom C_INCLUDE_PATH environment variable where
this directory doesn't appear, but I would doubt it...
So, I'm a bit confused about who's at fault where, if anyone, and what
I should be doing:
1. Shouldn't `freetype-config --cflags` include the location of
ft2bulid.h? Isn't that the point?
Now, the point is to give you command-line options that can be used to
compile a program using the library. It doesn't necessarily indicate
where 'ft2build.h' is, since this won't appear if it's '/usr/include' or
any other hard-coded path.
Well, at least that's my interpretation of it. I believe that Werner
did code the freetype-config script and its installation part, so he
might be able to answer this better than me..
2. Is it the packager's responsibility to put ft2build.h in the
standard include path? If so, does that mean that freetype2 is
incorrectly installed on these systems?
or even,
>
The fact that we use those infamous FT_FREETYPE_H macros comes directly
from the fact that different people had different ideas about what
"standard install path" meant (and also because we wanted to keep
8.3 naming conventions for our files and directories, how sad).
The idea now is that you should be able to install FreeType anywhere
on your system, as long as the result of '--cflags' allows you to:
- have #include <ft2build.h> work, wherever the file itself
is located.
- find the file corresponding to any expansion of the FT_XXXX_H macros,
independently of where they're located, and how they're precisely
defined.
the "/usr/include/freetype2" path returned by '--cflags' is only
used to be able to expand the FT_XXXX_H macros, not to find
"ft2build.h"
3. Am I wrong for using ft2build.h as I do? Is there something more
modern, or better yet, something more compatible that I should be
doing?
and finally,
You don't seem to do anything wrong, which is quite surprising...
4. Does anyone have an autoconf macro that I can use to find the right
include paths to use in all of these cases? :) I can start hard
coding common paths myself, but I'd rather know what's up first..
I think that those have been added in the "builds/unix/" directory a few
times ago. Again, Werner might be able to answer this question better than
me..
Hope this helps,
- David Turner
- The FreeType Project (www.freetype.org)