autoconf help.

Started by DCoder, June 25, 2003, 12:55:40

Previous topic - Next topic

DCoder

Okay, so I've pulled down CVS and I'm trying to build LWJGL on my linux box (RH 7.3), and after doing "sh ./autogen.sh; ./configure; make", I get:

[dhedrick]$ make
Making all in common
Making all in callbacks
mkdir .libs
c++ -DHAVE_CONFIG_H -I. -I. -I../.. -I../ -fno-rtti -fno-exceptions -pthread -D_X11 -Wall -I/opt/java/include -I/opt/java/include/linux -g -O2 -c GLUQuadricCallbacks.cpp  -fPIC -DPIC -o .libs/GLUQuadricCallbacks.lo
c++ -DHAVE_CONFIG_H -I. -I. -I../.. -I../ -fno-rtti -fno-exceptions -pthread -D_X11 -Wall -I/opt/java/include -I/opt/java/include/linux -g -O2 -c GLUQuadricCallbacks.cpp -o GLUQuadricCallbacks.o >/dev/null 2>&1
mv -f .libs/GLUQuadricCallbacks.lo GLUQuadricCallbacks.lo
rm -fr .libs/libcallbacks.la .libs/libcallbacks.* .libs/libcallbacks.*
ar cru .libs/libcallbacks.al GLUQuadricCallbacks.lo
ranlib .libs/libcallbacks.al
creating libcallbacks.la
(cd .libs && rm -f libcallbacks.la && ln -s ../libcallbacks.la libcallbacks.la)
mkdir .libs
c++ -DHAVE_CONFIG_H -I. -I. -I.. -fno-rtti -fno-exceptions -pthread -D_X11 -Wall -I/opt/java/include -I/opt/java/include/linux -g -O2 -c extal.cpp  -fPIC -DPIC -o .libs/extal.lo
In file included from extal.cpp:35:
extal.h:39:24: AL/altypes.h: No such file or directory
extal.h:40:25: AL/alctypes.h: No such file or directory
make[3]: *** [extal.lo] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive-am] Error 2
[dhedrick]$

Which obviously means that I don't have OpenAL installed.

So, how do I modify the autoconf system to require OpenAL? Ideally, I'd like to include something like "--with-openal=/path/to/openal" in the ./configure script.

-daniel
here are 10 types of people in this world...
Those who understand binary, and those who don't.

Matzon

Alternatively, try stripping the AL/ prefix. There has been some issues with that, depending on platform... regarding an option - I wouldn't know, since I am on windows...

DCoder

Quote from: "Matzon"Alternatively, try stripping the AL/ prefix. There has been some issues with that, depending on platform... regarding an option - I wouldn't know, since I am on windows...

Naw, I figured it out (by grokking the graphviz configure.in). I'll post a patch to this thread once I've got it all worked out.

At the moment, I'm getting compiler errors about round() not being declared -- eventhough math.h is included (in org_lwjgl_Display.cpp)... more on that later, I think.

-daniel
here are 10 types of people in this world...
Those who understand binary, and those who don't.

DCoder

So, new problem.. I got autoconf to check for (and allow specification of) the openal lib and include directories.

However, gcc does not (by default) support C99, so using the round() function in math.h causes the compiler to barf unless -D_ISOC99_SOURCE is specified as a parameter to gcc. I'm not sure what other compilers do the same...

Now I will go out into the world and see if I can't figure out how to pass "-D_ISOC99_SOURCE" to gcc, using the autoconf system. Should be fun.

Woohoo.

-daniel
here are 10 types of people in this world...
Those who understand binary, and those who don't.

DCoder

[dhedrick]$ diff -du LWJGL-orig/src/native/configure.in LWJGL-local/src/native/configure.in 
--- LWJGL-orig/src/native/configure.in  Sat Jun  7 08:56:05 2003
+++ LWJGL-local/src/native/configure.in Wed Jun 25 10:22:13 2003
@@ -66,6 +66,41 @@
 AC_CHECK_LIB(Xxf86vm, main,, AC_MSG_ERROR(Xxf86vm is required))
 dnl Replace `main' with a function in -tpthread:
 AC_CHECK_LIB(pthread, main,, AC_MSG_ERROR(pthread is required))
+dnl -----------------------------------
+dnl INCLUDES and LIBS for OpenAL
+dnl (shamelessly lifted [with tweaks] from the graphvis configure.in...)
+save_CPPFLAGS=$CPPFLAGS
+save_LDFLAGS=$LDFLAGS
+AC_ARG_WITH(openalincludedir,
+                   [  --with-openalincludedir=DIR  use OPENAL includes from DIR],
+                   [OPENAL_INCLUDES="-I$withval"
+                   CPPFLAGS="$CPPFLAGS -I$withval"])
+AC_ARG_WITH(openallibdir,
+                   [  --with-openallibdir=DIR      use OPENAL libraries from DIR],
+                   [OPENAL_LIBS="-L$withval"
+                    LDFLAGS="$LDFLAGS -L$withval"])
+AC_CHECK_HEADER([AL/al.h],
+                           AC_CHECK_LIB(openal, alGenBuffers,
+                                                [OPENAL_LIBS="$OPENAL_LIBS -lopenal"
+                                                 AC_DEFINE_UNQUOTED(HAVE_LIBOPENAL,1,[Define if you have the OPENAL library])],
+                                            AC_MSG_ERROR(Required OpenAL library not available)),
+                     AC_MSG_ERROR(Required OpenAL library not available - no al.h))
+LDFLAGS=$save_LDFLAGS
+CPPFLAGS=$save_CPPFLAGS
+AC_SUBST(OPENAL_INCLUDES)
+AC_SUBST(OPENAL_LIBS)
+dnl -----------------------------------
+dnl Support for generic "extra" search paths for includes and libraries
+dnl (shamelessly lifted from the graphvis configure.in...)
+AC_ARG_WITH(extraincludedir,
+                         [  --with-extraincludedir=DIR use extra includes from DIR],
+                           [EXTRAINCLUDEDIR=$withval
+                                   CPPFLAGS="$CPPFLAGS -I$withval"],)
+
+AC_ARG_WITH(extralibdir,
+                         [  --with-extralibdir=DIR  use extra libraries from DIR],
+                           LDFLAGS="$LDFLAGS -L$withval",)
+dnl -----------------------------------
 
 dnl Checks for header files.
 
[dhedrick]$


:lol:

-daniel
here are 10 types of people in this world...
Those who understand binary, and those who don't.

elias

I'm on the Faroe Islands right now for two weeks so I'm not able to apply the patch. Still I'm far from an autoconf expert, so it's great you want to do the patches. I have never had any problems with round() - what compiler version are you using? I use gcc 3.3 I believe.

- elias

DCoder

Quote from: "elias"I'm on the Faroe Islands right now for two weeks so I'm not able to apply the patch.

Well you sorry sack! :D I hope you're having lots of fun. Enjoy. Thanks for the follow-up. 'Sokay with me if you don't post again 'til you're back.

Quote from: "elias"Still I'm far from an autoconf expert, so it's great you want to do the patches. I have never had any problems with round() - what compiler version are you using? I use gcc 3.3 I believe.

Ah-HAH! You kids these days with your modern compilers and your latest versions of RedHat! Since I'm using RH7.3, I'm still using 2.96, which requires the -D_ISOC99_SOURCE flag.

-daniel
here are 10 types of people in this world...
Those who understand binary, and those who don't.

elias

Well if you want, Brian or Cas could probably give you CVS access to apply the patch yourself. The autoconf system haven't been updated for ages really, since Alterself left me with it *snifl* :-)

- elias