You are not logged in.

#1 2008-04-11 04:29:51

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Include file question [solved]

EDIT--

Good, no one answered yet. I should have mentioned that this is only an example. I'd like to know generically if this is possible with a general configure option and not just for this situation.


---

GEGL is now building against parts of FFmpeg. The include call looks like this for avformat.h:

#include <ffmpeg/avformat.h>

avformat.h on my system is in /usr/include/libavformat

Since there is no directory ffmpeg in the PATH anywhere, is there any parameter to pass to ./configure to get GCC to see avformat.h, or is it tied to ffmpeg/avformat.h? I have a working hack, but it's ugly!

Last edited by skottish (2008-04-13 05:15:53)

Offline

#2 2008-04-12 19:19:20

kakTuZ
Member
From: Hannover, Germany
Registered: 2007-10-20
Posts: 86

Re: Include file question [solved]

Try running "configure --help". This gives some general hints.
You can pass additional include paths using environment variables. e.g. the dosbox configure file gives:

Some influential environment variables:
  CC          C compiler command
  CFLAGS      C compiler flags
  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
              nonstandard directory <lib dir>
  CPPFLAGS    C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
              you have headers in a nonstandard directory <include dir>
  CPP         C preprocessor
  CXX         C++ compiler command
  CXXFLAGS    C++ compiler flags

Offline

#3 2008-04-12 21:28:46

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: Include file question [solved]

kakTuZ wrote:

Try running "configure --help". This gives some general hints.
You can pass additional include paths using environment variables. e.g. the dosbox configure file gives:

Some influential environment variables:
  CC          C compiler command
  CFLAGS      C compiler flags
  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
              nonstandard directory <lib dir>
  CPPFLAGS    C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
              you have headers in a nonstandard directory <include dir>
  CPP         C preprocessor
  CXX         C++ compiler command
  CXXFLAGS    C++ compiler flags

Thanks. I wrote this after trying standard flags to no avail. In particular I've used CPPFLAGS in other places to cope with FFmpeg's ever changing file structure. It's fine for swfdec, but failed miserably on gegl. The main difference though is that swfdec is looking for HEADER in the PATH. gegl is looking for DIRECTORY/HEADER. To isolate my question down a bit, if the compiler finds HEADER in the PATH somewhere, but not DIRECTORY/HEADER, will it use it?

Offline

#4 2008-04-13 01:00:51

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,491
Website

Re: Include file question [solved]

No, it won't use it.  You will pretty much have to edit the include line or create a symlink.

Offline

#5 2008-04-13 01:23:58

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: Include file question [solved]

Allan wrote:

No, it won't use it.  You will pretty much have to edit the include line or create a symlink.

Thanks Allan, that's along the lines of what I was thinking.

--edit--

I killed my other question just to try...

Last edited by skottish (2008-04-13 01:27:27)

Offline

#6 2008-04-13 01:45:53

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: Include file question [solved]

Bump to ask yet another question. Does this constitute one of the ugliest, most inefficient hacks in history?

build() {
  cd $startdir/src/$pkgname-$pkgver
  find . -type f | xargs perl -pi~ -e 's/<ffmpeg\/avformat.h>/<libavformat\/avformat.h>/g;'
  ./configure --prefix=/usr 

...

Last edited by skottish (2008-04-13 01:48:47)

Offline

#7 2008-04-13 02:33:49

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,491
Website

Re: Include file question [solved]

skottish wrote:

Bump to ask yet another question. Does this constitute one of the ugliest, most inefficient hacks in history?

Not quite...  I have used a combination of "grep -l" and "sed" before.  Now I just create a patch.

Offline

Board footer

Powered by FluxBB