Re: Standard macro for OpenGL check?

2000-03-11 Thread Morten Eriksen

"Braden N. McDaniel" <[EMAIL PROTECTED]> writes:

> Might there be any interest in having a standard macro to check for
> OpenGL packaged with autoconf? There's already such a thing for X;
> so I wonder, how about OpenGL?

Sounds like a good idea to me, as OpenGL is getting to be a pretty
common library these days with good coverage of the various platforms
out there.

One interesting tidbit, BTW: OpenGL is now a standard part of XFree86,
from release 4.0 (which was released just yesterday) and onwards.

> If there's interest in this, I have a macro that might serve as a
> starting point. Though I've hacked on it a bit, I am not its
> progenitor and I'm afraid I don't know who that is.

I've got an OpenGL detection macro written from scratch by myself
which seems to hold up pretty good. It has been tested and found to
work on various Linux platforms, FreeBSD, Solaris, IRIX, HP-UX and
BeOS, at least. Feel free to check it out, its part of the source
distribution of the Coin library: http://www.coin3d.org>.

I believe it could be a decent starting point for a macro to migrate
into the standard Autoconf distribution, if the maintainers feels this
is a good idea.

Regards,
Morten



Re: Standard macro for OpenGL check?

2000-03-11 Thread Matthew D. Langston

The macro MDL_HAVE_OPENGL is what you want.  It is in the Autoconf Macro
Archive at http://peti.cys.de/autoconf-archive/ in the file
mdl_have_opengl.m4.  It should do everything you want.  If it doesn't,
please let me know (or better yet, send me a patch) as I am the original
author if it.

FYI, I always write a "tracking package" for the Autoconf macros that I
write which demonstrates how to use the macro in a real world package.  The
tracking package for MDL_HAVE_OPENGL is at
ftp://ftp.slac.stanford.edu/users/langston/autoconf/ in the file
ac_opengl-0.0.3.tar.gz.

We were originally going to include this macro in the Autoconf package last
summer, but later decided that the Autoconf Macro Archive would be a better
place for it, as it is so specialized.  The Autoconf Macro Archive is a gold
mine of Autoconf macros for package authors, so you should definitely check
it out.  Peter Simons has done an excellent job on setting this up for the
community, and maintaining it.

Regards, Matt

- Original Message -
From: "Braden N. McDaniel" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, March 10, 2000 10:14 PM
Subject: Standard macro for OpenGL check?


> Might there be any interest in having a standard macro to check for OpenGL
> packaged with autoconf? There's already such a thing for X; so I wonder,
> how about OpenGL?
>
> In the absence of any such standard macro, I find that when I use more
> than one library that depends on OpenGL, each library tends to do its own
> check for OpenGL in its associated autoconf macro. So when creating my
> configure script I wind up with redundant checks and, worse, redundant
> command line options.
>
> If there's interest in this, I have a macro that might serve as a starting
> point. Though I've hacked on it a bit, I am not its progenitor and I'm
> afraid I don't know who that is. (The person I got it from didn't know the
> original author, and I've seen a few different macros around that appear
> to be fellow derivatives.)
>
> --
> Braden N. McDaniel
> [EMAIL PROTECTED]
> http://www.endoframe.com>
>
>



Re: Standard macro for OpenGL check?

2000-03-11 Thread Braden N. McDaniel

On Sat, 11 Mar 2000, Matthew D. Langston wrote:

> The macro MDL_HAVE_OPENGL is what you want.  It is in the Autoconf Macro
> Archive at http://peti.cys.de/autoconf-archive/ in the file
> mdl_have_opengl.m4.  It should do everything you want.  If it doesn't,
> please let me know (or better yet, send me a patch) as I am the original
> author if it.

Cool, this looks very handy. I wish I'd known about it sooner!

> We were originally going to include this macro in the Autoconf package last
> summer, but later decided that the Autoconf Macro Archive would be a better
> place for it, as it is so specialized.

However, the availability of this macro really doesn't solve the problem
I've presented... at least AFAICT.

Suppose I've got a library and I want to install an autoconf macro on the
user's system so that if the user is developing a library dependent on
mine, s/he can use this macro to check for the presence of my library. My 
library depends on OpenGL, so the macro I've installed needs to check for
OpenGL.

I can't just call MDL_HAVE_OPENGL to do this check, because I can't assume
it is installed on the system. I need to install MDL_HAVE_OPENGL as well
if I'm going to call it. But if I install it, I risk collision with
someone else who's decided to do the same. So I better rename it.

Now I'm installing and calling MY_MDL_HAVE_OPENGL. This works... until
someone else decides to do the same thing. Now I've got two identical
macros on the system under different names, MY_MDL_HAVE_OPENGL and
THEIR_MDL_HAVE_OPENGL. Now suppose this user creates a library that
depends both on "my" library and "their" library. The user's configure
script calls both HAVE_MY_LIB and HAVE_THEIR_LIB. HAVE_MY_LIB calls
MY_MDL_HAVE_OPENGL and HAVE_THEIR_LIB calls THEIR_MDL_HAVE_OPENGL. *The
same macro is being called twice because it exists under different names*.

Is there some way of addressing this problem other than having the macro
installed with autoconf? I really don't agree that an OpenGL detection
macro is too specialized to warrant such inclusion.

-- 
Braden N. McDaniel
[EMAIL PROTECTED]
http://www.endoframe.com>



Re: Standard macro for OpenGL check?

2000-03-11 Thread Matthew D. Langston

Hi Braden,

"Braden N. McDaniel" wrote:
> 
> Suppose I've got a library and I want to install an autoconf macro on
> the user's system so that if the user is developing a library
> dependent on mine, s/he can use this macro to check for the presence
> of my library. My library depends on OpenGL, so the macro I've
> installed needs to check for OpenGL.
> 
> [snip]
>
> Is there some way of addressing this problem other than having the
> macro installed with autoconf? I really don't agree that an OpenGL
> detection macro is too specialized to warrant such inclusion.

You should be using Libtool to create your libraries, so that you can
make use of Libtool's implicit handling of inter-library dependencies.
Briefly, if you create your library using Libtool, and your library
depends an OpenGL library, then the user automatically gets the OpenGL
library "for free" when they link against your library.  Therefore, your
user has no need of an OpenGL Autoconf macro.  I will refer you to the
Libtool documentation for more information (you can start at
http://www.gnu.org/software/libtool/libtool.html).

Regards, Matt

--
Matthew D. Langston
SLD, Stanford Linear Accelerator Center
[EMAIL PROTECTED]



Re: Standard macro for OpenGL check?

2000-03-11 Thread Braden N. McDaniel

On Sat, 11 Mar 2000, Matthew D. Langston wrote:

> Hi Braden,
> 
> "Braden N. McDaniel" wrote:
> > 
> > Suppose I've got a library and I want to install an autoconf macro on
> > the user's system so that if the user is developing a library
> > dependent on mine, s/he can use this macro to check for the presence
> > of my library. My library depends on OpenGL, so the macro I've
> > installed needs to check for OpenGL.
> > 
> > [snip]
> >
> > Is there some way of addressing this problem other than having the
> > macro installed with autoconf? I really don't agree that an OpenGL
> > detection macro is too specialized to warrant such inclusion.
> 
> You should be using Libtool to create your libraries, so that you can
> make use of Libtool's implicit handling of inter-library dependencies.

I do use libtool. Generally, however, an autoconf macro is needed so that
the user can specify the prefix under which a library has been installed
when a library is installed outside of the default search paths. I'm not
sure if this is necessary for libtool to find the library, but it is
needed for finding header files.

For OpenGL, however, this might not be an important issue. Your macro, at
least, assumes that OpenGL has been installed to a location the system
"knows" about. Perhaps that is a reasonable assumption in this case--I
don't really know.

-- 
Braden N. McDaniel
[EMAIL PROTECTED]
http://www.endoframe.com>