pkgsrc/graphics/lib3ds/patches/patch-ae
jmmv 03aa455434 libtoolize this package so that it builds under Mac OS X; building the
shared library by hand (as happened before) was not portable.

Bump PKGREVISION to 5.
2006-04-11 14:47:06 +00:00

107 lines
2.9 KiB
Text

$NetBSD: patch-ae,v 1.1 2006/04/11 14:47:06 jmmv Exp $
--- /dev/null 2006-04-11 16:18:52.000000000 +0200
+++ acinclude.m4 2006-04-11 16:20:57.000000000 +0200
@@ -0,0 +1,102 @@
+#
+# CONFIGURE_GLUT([ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]])
+#
+AC_DEFUN(CONFIGURE_GLUT,
+[
+ GL_HEADER_DIR="GL"
+ GLU_HEADER_DIR="GL"
+ GLUT_HEADER_DIR="GL"
+
+ GLUT_CFLAGS="-I/usr/X11R6/include"
+ GLUT_LIBS_FRAMEWORKS="-lobjc -framework GLUT -framework OpenGL"
+ GLUT_LIBS_WIN32="-lglut32 -lopengl32 -lglu32"
+ GLUT_LIBS_UNIX="-lglut -lGLU -lGL"
+
+ AC_ARG_WITH(glut-cflags,
+ [ --with-glut-cflags=FLGS GL/GLU/glut compiler flags],
+ [
+ GLUT_CFLAGS="$withval"
+ ])
+
+ AC_ARG_WITH(glut-libs,
+ [ --with-glut-libs=LIBS GL/GLU/glut linker flags],
+ [
+ GLUT_LIBS="$withval"
+ GLUT_FRAMEWORKS="$withval"
+ ])
+
+ saved_CFLAGS="$CFLAGS"
+ saved_LIBS="$LIBS"
+ AC_LANG_SAVE
+ AC_LANG_C
+
+ have_GLUT="yes"
+ CFLAGS="$saved_CFLAGS $GLUT_CFLAGS"
+ AC_CHECK_HEADER(GL/gl.h,, have_GLUT=no)
+ AC_CHECK_HEADER(GL/glu.h,, have_GLUT=no)
+ AC_CHECK_HEADER(GL/glut.h,, have_GLUT=no)
+
+ if test "$have_GLUT" = "no"; then
+ have_GLUT="yes"
+ CFLAGS="$saved_CFLAGS $GLUT_CFLAGS"
+ AC_CHECK_HEADER(OpenGL/gl.h,, have_GLUT=no)
+ AC_CHECK_HEADER(OpenGL/glu.h,, have_GLUT=no)
+ AC_CHECK_HEADER(GLUT/glut.h,, have_GLUT=no)
+ if test "$have_GLUT" = "yes"; then
+ GL_HEADER_DIR="OpenGL"
+ GLU_HEADER_DIR="OpenGL"
+ GLUT_HEADER_DIR="GLUT"
+ fi
+ fi
+
+ if test "$have_GLUT" = "yes"; then
+ CFLAGS="$saved_CFLAGS $GLUT_CFLAGS"
+
+ if test "$have_GLUT" = "yes"; then
+ AC_MSG_CHECKING([if GL/GLU/glut frameworks exist])
+ GLUT_LIBS="$GLUT_LIBS_FRAMEWORKS"
+ LIBS="$saved_LIBS $GLUT_LIBS"
+ AC_TRY_LINK(, [ char glBegin(); void glutSwapBuffers();],
+ , have_GLUT=no)
+ AC_MSG_RESULT($have_GLUT)
+ fi
+
+ if test "$have_GLUT" = "no"; then
+ have_GLUT=yes
+ AC_MSG_CHECKING([for GL/GLU/glut win32 libs])
+ GLUT_LIBS="$GLUT_LIBS_WIN32"
+ LIBS="$saved_LIBS $GLUT_LIBS"
+ AC_TRY_LINK(, [ char glBegin(); void glutSwapBuffers();],
+ , have_GLUT=no)
+ AC_MSG_RESULT($have_GLUT)
+ fi
+
+ if test "$have_GLUT" = "no"; then
+ have_GLUT=yes
+ AC_MSG_CHECKING([for GL/GLU/glut unix libs])
+ GLUT_LIBS="$GLUT_LIBS_UNIX"
+ LIBS="$saved_LIBS $GLUT_LIBS"
+ AC_TRY_LINK(, [ char glBegin(); void glutSwapBuffers();],
+ , have_GLUT=no)
+ AC_MSG_RESULT($have_GLUT)
+ fi
+ fi
+
+ LIBS="$saved_LIBS"
+ CFLAGS="$saved_CFLAGS"
+ AC_LANG_RESTORE
+
+ AM_CONDITIONAL(GLUT_CHECK, test "$have_GLUT" = "yes")
+ if test "$have_GLUT" = "yes"; then
+ ifelse([$1], , :, [$1])
+ else
+ GLUT_CFLAGS=""
+ GLUT_LIBS=""
+ ifelse([$2], , :, [$2])
+ fi
+ AC_SUBST(GL_HEADER_DIR)
+ AC_SUBST(GLU_HEADER_DIR)
+ AC_SUBST(GLUT_HEADER_DIR)
+ AC_SUBST(GLUT_CFLAGS)
+ AC_SUBST(GLUT_LIBS)
+])