From: Bram Stolk (bram++at++sara.nl)
Date: 08/30/2000 05:16:35
Hello Performers,
Now that SGI's OpenGL|Performer is no longer bound to Irix, you may
want to support multiple platforms.
Ofcourse you can do this by maintaining two seperate Makefiles for
your application.
However, if you want to do the right thing (tm), you use GNU's famous
autoconf/automake packages. This way, your app will build without a hassle
as soon as SGI starts releasing Performer on exotic architectures like
BEOS on StrongARM processors or NetBSD on Transmeta processors e.g. :-)
Writing a configure.in for GNU autoconf is quite a challenge though, and
it took some hard labour to get anything usable. I think my current
configure.in has pretty much matured now. I thought I should share this
with the other Performer users, so that they don't have to go through the
same ordeal as I did.
I've attached the configure.in file. For those interested, I also have
snippets you can include if you use Performer in conjunction with VRCO's
cavelib. Mail me if you're need these.
You have to write your own accompanying Makefile.am, which could look
something like:
## Makefile.am
## Process this with automake to produce Makefile.in
bin_PROGRAMS = hello
hello_SOURCES = \
hello.C
In addition to this, edit line 15,16 of configure.in -- it needs
the name and version of your package here.
Greetings,
Bram
-- ------------------------------------------------------------------------------ Bram Stolk, VR Specialist. SARA Academic Computing Services Amsterdam, PO Box 94613, 1090 GP AMSTERDAM email: bram++at++sara.nl Phone +31-20-5923059 Fax +31-20-6683167"I heard if you play the NT-4.0-CD backwards, you get a satanic message." "Thats nothing, if you play it forward, it installs NT-4.0" ------------------------------------------------------------------------------
dnl dnl $Source: /cvs/cave/wrap/configure.in,v $ dnl $Author: bram $ dnl $Date: 2000/08/29 15:58:49 $ dnl
dnl Process this file with autoconf to produce a configure script.
dnl This is an example on how to use autoconf/automake for applications... dnl ...that use SGI's OpenGL|Performer. Has been tested on linux and irix dnl Suggestions to: bram++at++sara.nl
dnl init AC_INIT(wrap.C) AM_INIT_AUTOMAKE(wrap, 0.0.1)
dnl Checks for programs. AC_PROG_CC AC_PROG_CPP AC_PROG_CXX AC_PROG_CXXCPP AC_PROG_INSTALL AM_PROG_LIBTOOL
dnl Checks for libraries.
AC_CHECK_LIB(m, sin)
dnl Checks for X11 libraries.
AC_PATH_XTRA
LIBS="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $LIBS"
dnl Checks for additional X11 stuff
AC_CHECK_LIB(Xi, XOpenDevice)
dnl OpenGL stuff
AC_CHECK_LIB(GLcore, glScalef,,,)
AC_CHECK_LIB(GL, glNewList,,,) if test "x$ac_cv_lib_GL_glNewList" = "xno" ; then dnl if no GL, check for MesaGL AC_CHECK_LIB(MesaGL, glNewList,,,) fi
dnl if using mesa, check for xmesa.h if test "x$ac_cv_lib_MesaGL_glNewList" = "xyes" ; then AC_CHECK_HEADER(GL/xmesa.h) AM_CONDITIONAL(ENABLE_XMESA_FX, \ test "x$ac_cv_header_GL_xmesa_h" = "xyes") else dnl force a failed check AM_CONDITIONAL(ENABLE_XMESA_FX, test "no" = "yes") fi
AC_CHECK_LIB(GLU, gluLookAt,,,) if test "x$ac_cv_lib_GLU_gluLookAt" = "xno" ; then dnl if no GLU, check for MesaGLU AC_CHECK_LIB(MesaGLU, gluLookAt,,,) fi
dnl Check for SGI's image lib
AC_CHECK_LIB(image, iopen,,,)
dnl Check for SGI's OpenGL|Performer
AC_CHECK_LIB(pr, pfScale,,,-lpf)
AC_CHECK_LIB(pf, pfNewDCS,,,)
AC_CHECK_LIB(pfutil, pfuNewSmoke,,,-lpfdu)
AC_CHECK_LIB(pfdu, pfdNewCube,,,)
dnl this one is not needed for CAVE progs, only for desktop performer apps! AC_CHECK_LIB(pfui, pfiInit,,,)
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(GL/gl.h)
AC_OUTPUT(Makefile)
dnl $Log: configure.in,v $ dnl Revision 1.4 2000/08/29 15:58:49 bram dnl fixed automake dnl dnl Revision 1.3 2000/08/29 12:29:48 bram dnl added -lXi dnl dnl Revision 1.2 2000/08/29 12:22:55 bram dnl improved X11 portion of automake dnl dnl Revision 1.1 2000/08/29 11:12:49 bram dnl converted to automake dnl
This archive was generated by hypermail 2b29 : Wed Aug 30 2000 - 05:16:46 PDT