LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-29-2003, 04:48 PM   #1
deiussum
Member
 
Registered: Aug 2003
Location: Santa Clara, CA
Distribution: Slackware
Posts: 895

Rep: Reputation: 32
Questions about autoconf...


Not sure if this is the appropriate forum to post this, but maybe someone here knows the answer....

I'm starting to get into learning how to use the GNU build tools like automake, autoconf, etc. and I'm running into a little problem.

My configure.in file contains these lines:

AC_PATH_XTRA
AC_CHECK_LIB(X11, XOpenDisplay)
AC_CHECK_LIB(GL, glBegin)
AC_CHECK_LIB(GLU, gluLookAt)

I get the following results:

checking for XOpenDisplay in -lX11... no
checking for glBegin in -lGL... yes
checking for gluLookAt in -lGLU... no

I belive that it finds the GL library and not the others because there is a symbolic link in /usr/lib/ to the GL library in /usr/X11R6/lib, but not for the others.

Now... when I put the following line after AC_PATH_EXTRA:
CFLAGS="$CFLAGS -I$x_includes -L$x_libraries"

Then I get yes for both the X11 and GLU libraries. This seems to be sort of an ugly hack to get it to work to me, though. Plus, when I try and do the same thing in another project in which I'm trying to add OpenGL support, the CFLAGS trick isn't working for me.

Any thoughts, or suggestions on where I should go to try and find a solution to my problem? I'd really like to try and get a good understanding of the GNU build tools.
 
Old 11-30-2003, 07:46 PM   #2
deiussum
Member
 
Registered: Aug 2003
Location: Santa Clara, CA
Distribution: Slackware
Posts: 895

Original Poster
Rep: Reputation: 32
Ok... after a bit more reading in the autoconf manual I confirmed what I had already guessed. That is, CFLAGS is used by other autoconf macros to check the existence of C features. (e.g. it is used by AC_CHECK_LIB). (I also noted that LDFLAGS was used, which is probably a bit more appropriate place to put -L$x_libraries.)

But in the case of this other configure.in, it seems to be ignoring both CFLAGS and LDFLAGS. Are there other macros somewhere in there that could be causing it to do so? I added a line to echo the contents of $LDFLAGS and confirmed that it included the path to my GLU libraries, but still it says "no" when testing the existence of the GLU library.

Any thoughts or comments would be greatly appreciated...
 
Old 12-01-2003, 10:06 AM   #3
deiussum
Member
 
Registered: Aug 2003
Location: Santa Clara, CA
Distribution: Slackware
Posts: 895

Original Poster
Rep: Reputation: 32
Replying to my own message again... this can't be good.

I found some pre-built macros to check for GL and GLU at the gnu Autoconf Macro Archive index. These seem to work pretty well and checks for lots of variations of OpenGL/GLU installs, so I will just use them. If I had known this archive existed I would have checked it sooner and not have bothered posting this thread.

Still... if anyone knows why AC_CHECK_LIB didn't seem to work for me, I'd like to know for future reference.
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
No autoconf? lectraplayer SUSE / openSUSE 9 01-24-2005 09:23 PM
autoconf 2.54 need HELP !! Baldrick65 Linux - Software 1 08-21-2003 07:56 AM
autoconf 2.52 or 2.53 caleb Conectiva 14 10-08-2002 03:53 PM
Autoconf jISV Linux - Software 2 05-30-2002 01:45 AM
autoconf.h safrout Linux - Newbie 3 05-25-2002 04:48 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:53 AM.

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