LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Makefile includedir problem (https://www.linuxquestions.org/questions/programming-9/makefile-includedir-problem-604226/)

Aegon 12-03-2007 04:00 PM

Makefile includedir problem
 
I'm trying to build a game called "Crack Attack!". My GL library, however, isn't in the standard location. So I configure with --prefix=/'location to my stuff'

Then I run make and it barfs. It doesn't know where to look for include files. Turns out that the makefile generated in the src directory doesn't inherit includedir from the parent directory, so I modify src/Makefile.in to:
Code:

INCLUDES = -DNDEBUG -DDATA_DIRECTORY='"${pkgdatadir}/"' -I$(includedir)
The Blue stuff is what I added.

It definitely changes the output, but the problem is now this:

Code:

In file included from <include dir>/GL/glut.h:17,
                from Attack.cxx:26:
<include dir>/GL/freeglut_std.h:114:19: error: GL/gl.h: No such file or directory

So the problem is that glut.h doesn't know to look for gl.h in its own directory.

Any pointers?

David1357 12-03-2007 05:52 PM

Quote:

Originally Posted by Aegon (Post 2978926)
I'm trying to build a game called "Crack Attack!". My GL library, however, isn't in the standard location. So I configure with --prefix=/'location to my stuff'

Then I run make and it barfs.

The "--prefix" option is used to tell the install target where to put the files during installation. The default is "/usr/local". If you want to put them in "/opt" or even "/usr", you use the "--prefix" option.

Quote:

Originally Posted by Aegon (Post 2978926)
It doesn't know where to look for include files. Turns out that the makefile generated in the src directory doesn't inherit includedir from the parent directory, so I modify src/Makefile.in to:
Code:

INCLUDES = -DNDEBUG -DDATA_DIRECTORY='"${pkgdatadir}/"' -I$(includedir)
The Blue stuff is what I added.

It definitely changes the output, but the problem is now this:

Code:

In file included from <include dir>/GL/glut.h:17,
                from Attack.cxx:26:
<include dir>/GL/freeglut_std.h:114:19: error: GL/gl.h: No such file or directory

So the problem is that glut.h doesn't know to look for gl.h in its own directory.

Any pointers?

Undo all your changes. If I were you, I would just delete the directory and untar the tarball again. Then do the following
# COPTS=-I/path-to-GL-headers ./configure
That will tell the configure script to add the path to your GL headers to its include file search path. That should fix your problem.

Aegon 12-03-2007 06:32 PM

Thanks for the reply, David1357. I tried your suggestion, unfortunately it had no effect.

The additional variable makes no effect on either Makefile or src/Makefile following the configure step. So it does not affect the make process and it produces output as if I never entered the variable at all.

Perhaps the make system employed by the fine people at Crack Attack! isn't aware of the usual variables, and overwrites or ignores them.


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