ports/63702: [NEW PORT] graphics/glfw: A free, open source, portable framework for OpenGL application development

Michael Neumann mneumann at ntecs.de
Wed Mar 3 17:40:20 UTC 2004


>Number:         63702
>Category:       ports
>Synopsis:       [NEW PORT] graphics/glfw: A free, open source, portable framework for OpenGL application development
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Mar 03 09:40:19 PST 2004
>Closed-Date:
>Last-Modified:
>Originator:     Michael Neumann
>Release:        FreeBSD 5.2.1-RELEASE i386
>Organization:
>Environment:
System: FreeBSD miya.intranet.ntecs.de 5.2.1-RELEASE FreeBSD 5.2.1-RELEASE #0: Tue Mar  2 12:56:00 CET
>Description:
GLFW is a free, open source, portable framework for OpenGL application
development. In short, it is a link library that constitutes a powerful API for
handling operating system specific tasks, such as opening an OpenGL window and
reading keyboard, mouse and joystick input. 

It also provides functions for reading a high precision timer, using OpenGL
extensions, creating and synchronizing threads, reading textures from files and
more... 

WWW: http://glfw.sourceforge.net/

Generated with FreeBSD Port Tools 0.50
>How-To-Repeat:
>Fix:

--- glfw-2.4.1.shar begins here ---
# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	glfw
#	glfw/pkg-plist
#	glfw/distinfo
#	glfw/Makefile
#	glfw/pkg-descr
#	glfw/files
#	glfw/files/patch-aa
#	glfw/files/patch-ab
#
echo c - glfw
mkdir -p glfw > /dev/null 2>&1
echo x - glfw/pkg-plist
sed 's/^X//' >glfw/pkg-plist << 'END-of-glfw/pkg-plist'
Xlib/libglfw.a
Xinclude/GL/glfw.h
X at dirrm include/GL
END-of-glfw/pkg-plist
echo x - glfw/distinfo
sed 's/^X//' >glfw/distinfo << 'END-of-glfw/distinfo'
XMD5 (glfw-2.4.1.tar.gz) = 3c2fefcb74ec4c580621243c2fd41a0c
END-of-glfw/distinfo
echo x - glfw/Makefile
sed 's/^X//' >glfw/Makefile << 'END-of-glfw/Makefile'
X# New ports collection makefile for:    glfw
X# Date created:         3 March 2003
X# Whom:                 Michael Neumann <mneumann at ntecs.de>
X#
X# $FreeBSD$
X#
X
XPORTNAME=	glfw
XPORTVERSION=	2.4.1
XCATEGORIES=	graphics devel
XMASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
XMASTER_SITE_SUBDIR=	${PORTNAME}
X
XMAINTAINER=	mneumann at ntecs.de
XCOMMENT=	A free, open source, portable framework for OpenGL application development
X
XALL_TARGET=	x11
X
XUSE_GMAKE=	yes
XUSE_GL=		yes
XUSE_XLIB=	yes
X
Xdo-install:
X	${INSTALL_DATA} ${WRKSRC}/lib/x11/libglfw.a ${PREFIX}/lib
X	@${MKDIR} ${PREFIX}/include/GL
X	${INSTALL_DATA} ${WRKSRC}/include/GL/glfw.h ${PREFIX}/include/GL
X
X.include <bsd.port.mk>
END-of-glfw/Makefile
echo x - glfw/pkg-descr
sed 's/^X//' >glfw/pkg-descr << 'END-of-glfw/pkg-descr'
XGLFW is a free, open source, portable framework for OpenGL application
Xdevelopment. In short, it is a link library that constitutes a powerful API for
Xhandling operating system specific tasks, such as opening an OpenGL window and
Xreading keyboard, mouse and joystick input. 
X
XIt also provides functions for reading a high precision timer, using OpenGL
Xextensions, creating and synchronizing threads, reading textures from files and
Xmore... 
X
XWWW: http://glfw.sourceforge.net/
END-of-glfw/pkg-descr
echo c - glfw/files
mkdir -p glfw/files > /dev/null 2>&1
echo x - glfw/files/patch-aa
sed 's/^X//' >glfw/files/patch-aa << 'END-of-glfw/files/patch-aa'
X--- compile.sh.orig	Sat Mar  8 13:45:02 2003
X+++ compile.sh	Wed Mar  3 13:25:45 2004
X@@ -1,413 +1,413 @@
X-#!/bin/sh
X-
X-##########################################################################
X-# compile.sh - Unix/X11 configuration script
X-# $Date: 2003/02/03 00:19:22 $
X-# $Revision: 1.5 $
X-#
X-# This is a minimalist configuration script for GLFW, which is used to
X-# determine the availability of certain features.
X-#
X-# This script is not very nice at all (especially the Makefile generation
X-# is very ugly and hardcoded). Hopefully it will be cleaned up in the
X-# future, but for now it does a pretty good job (much better than the
X-# three separate Makefiles in the earlier distributions anyway).
X-##########################################################################
X-
X-##########################################################################
X-# Check arguments
X-##########################################################################
X-force_gcc=no
X-silent=no
X-for arg in "$@"; do
X-{
X-  case "$arg" in
X-    # Force gcc?
X-    -gcc | -force-gcc | --gcc | --force-gcc | -gnuc | -gnu-c)
X-      force_gcc=yes ;;
X-
X-    # Silent?
X-    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
X-    | -silent | --silent | --silen | --sile | --sil)
X-      silent=yes ;;
X-  esac;
X-}
X-done;
X-
X-
X-##########################################################################
X-# Misc.
X-##########################################################################
X-
X-config_script=$0
X-
X-# File descriptor usage:
X-# 0 standard input
X-# 1 file creation
X-# 2 errors and warnings
X-# 3 some systems may open it to /dev/tty
X-# 4 used on the Kubota Titan
X-# 5 compiler messages saved in config.log
X-# 6 checking for... messages and results
X-exec 5>./config.log
X-if [ "x$silent" = xyes ]; then
X-  exec 6>/dev/null
X-else
X-  exec 6>&1
X-fi
X-
X-echo "\
X-This file contains any messages produced by compilers while
X-running $config_script, to aid debugging if $config_script makes a mistake.
X-" 1>&5
X-
X-# Add .gcc to the file name of the generated makefiles if GCC was forced
X-makefile_ext=
X-if [ "x$force_gcc" = "xyes" ]; then
X-  makefile_ext=".gcc"
X-fi
X-
X-
X-##########################################################################
X-# Default compiler settings
X-##########################################################################
X-if [ "x$force_gcc" = xyes ]; then
X-  CC=gcc
X-else
X-  CC=${CC-cc}
X-fi
X-CFLAGS=
X-LFLAGS=
X-LIBS="-lGL -lX11"
X-
X-
X-##########################################################################
X-# Compilation commands
X-##########################################################################
X-compile='$CC -c $CFLAGS conftest.c 1>&5'
X-link='$CC -o conftest $CFLAGS $LFLAGS conftest.c $LIBS 1>&5'
X-
X-
X-##########################################################################
X-# Check for X11 libs directory
X-##########################################################################
X-echo "Checking for X11 libraries location... " 1>&6
X-
X-# X11R6 in /usr/X11R6/lib ?
X-if [ -r "/usr/X11R6/lib/libX11.so" ]; then
X-
X- LFLAGS="$LFLAGS -L/usr/X11R6/lib"
X- echo " X11 libraries location: /usr/X11R6/lib" 1>&6
X-
X-# X11R5 in /usr/X11R5/lib ?
X-elif [ -r "/usr/X11R5/lib/libX11.so" ]; then
X-
X- LFLAGS="$LFLAGS -L/usr/X11R5/lib"
X- echo " X11 libraries location: /usr/X11R5/lib" 1>&6
X-
X-# Mac OS X: X11R6 in /usr/X11R6/lib, uses .dylib instead of .so
X-elif [ -r "/usr/X11R6/lib/libX11.dylib" ]; then
X-
X- LFLAGS="$LFLAGS -L/usr/X11R6/lib"
X- CFLAGS="$CFLAGS -I/usr/X11R6/include"
X- echo " X11 libraries location: /usr/X11R6/lib" 1>&6
X-
X-else
X-
X- echo " X11 libraries location: Unknown (assuming linker will find them)" 1>&6
X-
X-fi
X-echo " " 1>&6
X-
X-
X-##########################################################################
X-# Check if we are using GNU C
X-##########################################################################
X-echo "Checking whether we are using GNU C... " 1>&6
X-echo "$config_script: checking whether we are using GNU C" >&5
X-
X-cat > conftest.c <<EOF
X-#ifdef __GNUC__
X-  yes;
X-#endif
X-EOF
X-
X-if { ac_try='$CC -E conftest.c'; { (eval echo $config_script: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
X-  use_gcc=yes
X-else
X-  use_gcc=no
X-fi
X-rm -f conftest*
X-
X-echo " Using GNU C: ""$use_gcc" 1>&6
X-if [ "x$use_gcc" = xyes ]; then
X-  CC=gcc
X-fi
X-echo " " 1>&6
X-
X-
X-##########################################################################
X-# Check for XFree86 VidMode availability
X-##########################################################################
X-echo "Checking for XFree86 VidMode 1.0 support... " 1>&6
X-echo "$config_script: Checking for XFree86 VidMode 1.0 support" >&5
X-has_xf86vm=no
X-
X-cat > conftest.c <<EOF
X-#include <X11/Xlib.h>
X-#include <X11/extensions/xf86vmode.h>
X-
X-#if defined(__APPLE_CC__)
X-#error Not supported under Mac OS X
X-#endif
X-
X-int main() {; return 0;}
X-EOF
X-
X-if { (eval echo $config_script: \"$compile\") 1>&5; (eval $compile) 2>&5; }; then
X-  rm -rf conftest*
X-  has_xf86vm=yes
X-else
X-  echo "$config_script: failed program was:" >&5
X-  cat conftest.c >&5
X-fi
X-rm -f conftest*
X-
X-echo " XFree86 VidMode extension: ""$has_xf86vm" 1>&6
X-if [ "x$has_xf86vm" = xyes ]; then
X-   CFLAGS="$CFLAGS -D_GLFW_HAS_XF86VIDMODE"
X-   LIBS="$LIBS -lXxf86vm -lXext"
X-fi
X-echo " " 1>&6
X-
X-
X-##########################################################################
X-# Check for glXGetProcAddressXXX availability
X-##########################################################################
X-echo "Checking for glXGetProcAddress support... " 1>&6
X-echo "$config_script: Checking for glXGetProcAddress support" >&5
X-has_glXGetProcAddress=no
X-has_glXGetProcAddressARB=no
X-has_glXGetProcAddressEXT=no
X-
X-# glXGetProcAddress check
X-cat > conftest.c <<EOF
X-#include <X11/Xlib.h>
X-#include <GL/glx.h>
X-#include <GL/gl.h>
X-int main() {void *ptr=(void*)glXGetProcAddress("glFun"); return 0;}
X-EOF
X-
X-if { (eval echo $config_script: \"$link\") 1>&5; (eval $link) 2>&5; }; then
X-  rm -rf conftest*
X-  has_glXGetProcAddress=yes
X-else
X-  echo "$config_script: failed program was:" >&5
X-  cat conftest.c >&5
X-fi
X-rm -f conftest*
X-
X-# glXGetProcAddressARB check
X-cat > conftest.c <<EOF
X-#include <X11/Xlib.h>
X-#include <GL/glx.h>
X-#include <GL/gl.h>
X-int main() {void *ptr=(void*)glXGetProcAddressARB("glFun"); return 0;}
X-EOF
X-
X-if { (eval echo $config_script: \"$link\") 1>&5; (eval $link) 2>&5; }; then
X-  rm -rf conftest*
X-  has_glXGetProcAddressARB=yes
X-else
X-  echo "$config_script: failed program was:" >&5
X-  cat conftest.c >&5
X-fi
X-rm -f conftest*
X-
X-# glXGetProcAddressEXT check
X-cat > conftest.c <<EOF
X-#include <X11/Xlib.h>
X-#include <GL/glx.h>
X-#include <GL/gl.h>
X-int main() {void *ptr=(void*)glXGetProcAddressEXT("glFun"); return 0;}
X-EOF
X-
X-if { (eval echo $config_script: \"$link\") 1>&5; (eval $link) 2>&5; }; then
X-  rm -rf conftest*
X-  has_glXGetProcAddressEXT=yes
X-else
X-  echo "$config_script: failed program was:" >&5
X-  cat conftest.c >&5
X-fi
X-rm -f conftest*
X-
X-echo " glXGetProcAddress extension:    ""$has_glXGetProcAddress" 1>&6
X-echo " glXGetProcAddressARB extension: ""$has_glXGetProcAddressARB" 1>&6
X-echo " glXGetProcAddressEXT extension: ""$has_glXGetProcAddressEXT" 1>&6
X-if [ "x$has_glXGetProcAddress" = xyes ]; then
X-   CFLAGS="$CFLAGS -D_GLFW_HAS_GLXGETPROCADDRESS"
X-fi
X-if [ "x$has_glXGetProcAddressARB" = xyes ]; then
X-   CFLAGS="$CFLAGS -D_GLFW_HAS_GLXGETPROCADDRESSARB"
X-fi
X-if [ "x$has_glXGetProcAddressEXT" = xyes ]; then
X-   CFLAGS="$CFLAGS -D_GLFW_HAS_GLXGETPROCADDRESSEXT"
X-fi
X-echo " " 1>&6
X-
X-
X-##########################################################################
X-# Check for dlopen support
X-##########################################################################
X-echo "Checking for dlopen support... " 1>&6
X-echo "$config_script: Checking for dlopen support" >&5
X-has_dlopen=no
X-
X-cat > conftest.c <<EOF
X-#include <dlfcn.h>
X-int main() {void *l=dlopen("libGL.so",RTLD_LAZY|RTLD_GLOBAL); return 0;}
X-EOF
X-
X-# First try without -ldl
X-if { (eval echo $config_script: \"$link\") 1>&5; (eval $link) 2>&5; }; then
X-  rm -rf conftest*
X-  has_dlopen=yes
X-else
X-  echo "$config_script: failed program was:" >&5
X-  cat conftest.c >&5
X-fi
X-
X-# Now try with -ldl if the previous attempt failed
X-if [ "x$has_dlopen" = xno ]; then
X-  LIBS_OLD="$LIBS"
X-  LIBS="$LIBS -ldl"
X-  if { (eval echo $config_script: \"$link\") 1>&5; (eval $link) 2>&5; }; then
X-    rm -rf conftest*
X-    has_dlopen=yes
X-  else
X-    echo "$config_script: failed program was:" >&5
X-    cat conftest.c >&5
X-  fi
X-  if [ "x$has_dlopen" = xno ]; then
X-    LIBS="$LIBS_OLD"
X-  fi
X-fi
X-rm -f conftest*
X-
X-echo " dlopen support: ""$has_dlopen" 1>&6
X-if [ "x$has_dlopen" = xyes ]; then
X-   CFLAGS="$CFLAGS -D_GLFW_HAS_DLOPEN"
X-fi
X-echo " " 1>&6
X-
X-
X-##########################################################################
X-# Check for sysconf support
X-##########################################################################
X-echo "Checking for sysconf support... " 1>&6
X-echo "$config_script: Checking for sysconf support" >&5
X-has_sysconf=no
X-
X-cat > conftest.c <<EOF
X-#include <unistd.h>
X-#ifndef _SC_NPROCESSORS_ONLN
X-#ifndef _SC_NPROC_ONLN
X-#error Neither _SC_NPROCESSORS_ONLN nor _SC_NPROC_ONLN available
X-#endif
X-#endif
X-int main() {long x=sysconf(_SC_ARG_MAX); return 0; }
X-EOF
X-
X-if { (eval echo $config_script: \"$link\") 1>&5; (eval $link) 2>&5; }; then
X-  rm -rf conftest*
X-  has_sysconf=yes
X-else
X-  echo "$config_script: failed program was:" >&5
X-  cat conftest.c >&5
X-fi
X-rm -f conftest*
X-
X-echo " sysconf support: ""$has_sysconf" 1>&6
X-if [ "x$has_sysconf" = xyes ]; then
X-   CFLAGS="$CFLAGS -D_GLFW_HAS_SYSCONF"
X-fi
X-echo " " 1>&6
X-
X-
X-##########################################################################
X-# Check for sysctl support
X-##########################################################################
X-echo "Checking for sysctl support... " 1>&6
X-echo "$config_script: Checking for sysctl support" >&5
X-has_sysctl=no
X-
X-cat > conftest.c <<EOF
X-#include <sys/types.h>
X-#include <sys/sysctl.h>
X-#ifdef CTL_HW
X-#ifdef HW_NCPU
X-  yes;
X-#endif
X-#endif
X-EOF
X-
X-if { ac_try='$CC -E conftest.c'; { (eval echo $config_script: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
X-  has_sysctl=yes
X-fi
X-rm -f conftest*
X-
X-echo " sysctl support: ""$has_sysctl" 1>&6
X-if [ "x$has_sysctl" = xyes ]; then
X-   CFLAGS="$CFLAGS -D_GLFW_HAS_SYSCTL"
X-fi
X-echo " " 1>&6
X-
X-
X-
X-##########################################################################
X-# Post fixups
X-##########################################################################
X-if [ "x$CC" = xgcc ]; then
X-  CFLAGS_SPEED="-c -I. -I.. $CFLAGS -O3 -ffast-math -Wall"
X-  CFLAGS="-c -I. -I.. $CFLAGS -Os -Wall"
X-  CFLAGS_LINK="-O3 -ffast-math -Wall"
X-else
X-  CFLAGS_SPEED="-c -I. -I.. $CFLAGS -O"
X-  CFLAGS="-c -I. -I.. $CFLAGS -O"
X-  CFLAGS_LINK="-O"
X-fi
X-CFLAGS_LINK="-I../include $CFLAGS_LINK"
X-LFLAGS="$LFLAGS -L../lib/x11 -lglfw -lGLU $LIBS -lpthread -lm"
X-
X-
X-##########################################################################
X-# Create Makefiles
X-##########################################################################
X-
X-# ./lib/x11/Makefile.x11
X-MKNAME="./lib/x11/Makefile.x11""$makefile_ext"
X-echo "Creating ""$MKNAME""..." 1>&6
X-echo " " 1>&6
X-echo "$config_script: Creating ""$MKNAME""..." >&5
X-echo "##########################################################################" >$MKNAME
X-echo "# Automatically generated Makefile for GLFW" >>$MKNAME
X-echo "##########################################################################" >>$MKNAME
X-echo "CC           = $CC" >>$MKNAME
X-echo "CFLAGS       = $CFLAGS" >>$MKNAME
X-echo "CFLAGS_SPEED = $CFLAGS_SPEED" >>$MKNAME
X-echo " " >>$MKNAME
X-cat ./lib/x11/Makefile.x11.in >>$MKNAME
X-
X-# ./examples/Makefile.x11
X-MKNAME="./examples/Makefile.x11""$makefile_ext"
X-echo "Creating ""$MKNAME""..." 1>&6
X-echo " " 1>&6
X-echo "$config_script: Creating ""$MKNAME""..." >&5
X-echo "##########################################################################" >$MKNAME
X-echo "# Automatically generated Makefile for GLFW" >>$MKNAME
X-echo "##########################################################################" >>$MKNAME
X-echo "CC     = $CC" >>$MKNAME
X-echo "CFLAGS = $CFLAGS_LINK" >>$MKNAME
X-echo "LFLAGS =$LFLAGS" >>$MKNAME
X-echo " " >>$MKNAME
X-cat ./examples/Makefile.x11.in >>$MKNAME
X+#!/bin/sh
X+
X+##########################################################################
X+# compile.sh - Unix/X11 configuration script
X+# $Date: 2003/02/03 00:19:22 $
X+# $Revision: 1.5 $
X+#
X+# This is a minimalist configuration script for GLFW, which is used to
X+# determine the availability of certain features.
X+#
X+# This script is not very nice at all (especially the Makefile generation
X+# is very ugly and hardcoded). Hopefully it will be cleaned up in the
X+# future, but for now it does a pretty good job (much better than the
X+# three separate Makefiles in the earlier distributions anyway).
X+##########################################################################
X+
X+##########################################################################
X+# Check arguments
X+##########################################################################
X+force_gcc=no
X+silent=no
X+for arg in "$@"; do
X+{
X+  case "$arg" in
X+    # Force gcc?
X+    -gcc | -force-gcc | --gcc | --force-gcc | -gnuc | -gnu-c)
X+      force_gcc=yes ;;
X+
X+    # Silent?
X+    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
X+    | -silent | --silent | --silen | --sile | --sil)
X+      silent=yes ;;
X+  esac;
X+}
X+done;
X+
X+
X+##########################################################################
X+# Misc.
X+##########################################################################
X+
X+config_script=$0
X+
X+# File descriptor usage:
X+# 0 standard input
X+# 1 file creation
X+# 2 errors and warnings
X+# 3 some systems may open it to /dev/tty
X+# 4 used on the Kubota Titan
X+# 5 compiler messages saved in config.log
X+# 6 checking for... messages and results
X+exec 5>./config.log
X+if [ "x$silent" = xyes ]; then
X+  exec 6>/dev/null
X+else
X+  exec 6>&1
X+fi
X+
X+echo "\
X+This file contains any messages produced by compilers while
X+running $config_script, to aid debugging if $config_script makes a mistake.
X+" 1>&5
X+
X+# Add .gcc to the file name of the generated makefiles if GCC was forced
X+makefile_ext=
X+if [ "x$force_gcc" = "xyes" ]; then
X+  makefile_ext=".gcc"
X+fi
X+
X+
X+##########################################################################
X+# Default compiler settings
X+##########################################################################
X+if [ "x$force_gcc" = xyes ]; then
X+  CC=gcc
X+else
X+  CC=${CC-cc}
X+fi
X+CFLAGS="-I/usr/X11R6/include -I`pwd`/include"
X+LFLAGS=
X+LIBS="-lGL -lX11"
X+
X+
X+##########################################################################
X+# Compilation commands
X+##########################################################################
X+compile='$CC -c $CFLAGS conftest.c 1>&5'
X+link='$CC -o conftest $CFLAGS $LFLAGS conftest.c $LIBS 1>&5'
X+
X+
X+##########################################################################
X+# Check for X11 libs directory
X+##########################################################################
X+echo "Checking for X11 libraries location... " 1>&6
X+
X+# X11R6 in /usr/X11R6/lib ?
X+if [ -r "/usr/X11R6/lib/libX11.so" ]; then
X+
X+ LFLAGS="$LFLAGS -L/usr/X11R6/lib"
X+ echo " X11 libraries location: /usr/X11R6/lib" 1>&6
X+
X+# X11R5 in /usr/X11R5/lib ?
X+elif [ -r "/usr/X11R5/lib/libX11.so" ]; then
X+
X+ LFLAGS="$LFLAGS -L/usr/X11R5/lib"
X+ echo " X11 libraries location: /usr/X11R5/lib" 1>&6
X+
X+# Mac OS X: X11R6 in /usr/X11R6/lib, uses .dylib instead of .so
X+elif [ -r "/usr/X11R6/lib/libX11.dylib" ]; then
X+
X+ LFLAGS="$LFLAGS -L/usr/X11R6/lib"
X+ CFLAGS="$CFLAGS -I/usr/X11R6/include"
X+ echo " X11 libraries location: /usr/X11R6/lib" 1>&6
X+
X+else
X+
X+ echo " X11 libraries location: Unknown (assuming linker will find them)" 1>&6
X+
X+fi
X+echo " " 1>&6
X+
X+
X+##########################################################################
X+# Check if we are using GNU C
X+##########################################################################
X+echo "Checking whether we are using GNU C... " 1>&6
X+echo "$config_script: checking whether we are using GNU C" >&5
X+
X+cat > conftest.c <<EOF
X+#ifdef __GNUC__
X+  yes;
X+#endif
X+EOF
X+
X+if { ac_try='$CC -E conftest.c'; { (eval echo $config_script: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
X+  use_gcc=yes
X+else
X+  use_gcc=no
X+fi
X+rm -f conftest*
X+
X+echo " Using GNU C: ""$use_gcc" 1>&6
X+if [ "x$use_gcc" = xyes ]; then
X+  CC=gcc
X+fi
X+echo " " 1>&6
X+
X+
X+##########################################################################
X+# Check for XFree86 VidMode availability
X+##########################################################################
X+echo "Checking for XFree86 VidMode 1.0 support... " 1>&6
X+echo "$config_script: Checking for XFree86 VidMode 1.0 support" >&5
X+has_xf86vm=no
X+
X+cat > conftest.c <<EOF
X+#include <X11/Xlib.h>
X+#include <X11/extensions/xf86vmode.h>
X+
X+#if defined(__APPLE_CC__)
X+#error Not supported under Mac OS X
X+#endif
X+
X+int main() {; return 0;}
X+EOF
X+
X+if { (eval echo $config_script: \"$compile\") 1>&5; (eval $compile) 2>&5; }; then
X+  rm -rf conftest*
X+  has_xf86vm=yes
X+else
X+  echo "$config_script: failed program was:" >&5
X+  cat conftest.c >&5
X+fi
X+rm -f conftest*
X+
X+echo " XFree86 VidMode extension: ""$has_xf86vm" 1>&6
X+if [ "x$has_xf86vm" = xyes ]; then
X+   CFLAGS="$CFLAGS -D_GLFW_HAS_XF86VIDMODE"
X+   LIBS="$LIBS -lXxf86vm -lXext"
X+fi
X+echo " " 1>&6
X+
X+
X+##########################################################################
X+# Check for glXGetProcAddressXXX availability
X+##########################################################################
X+echo "Checking for glXGetProcAddress support... " 1>&6
X+echo "$config_script: Checking for glXGetProcAddress support" >&5
X+has_glXGetProcAddress=no
X+has_glXGetProcAddressARB=no
X+has_glXGetProcAddressEXT=no
X+
X+# glXGetProcAddress check
X+cat > conftest.c <<EOF
X+#include <X11/Xlib.h>
X+#include <GL/glx.h>
X+#include <GL/gl.h>
X+int main() {void *ptr=(void*)glXGetProcAddress("glFun"); return 0;}
X+EOF
X+
X+if { (eval echo $config_script: \"$link\") 1>&5; (eval $link) 2>&5; }; then
X+  rm -rf conftest*
X+  has_glXGetProcAddress=yes
X+else
X+  echo "$config_script: failed program was:" >&5
X+  cat conftest.c >&5
X+fi
X+rm -f conftest*
X+
X+# glXGetProcAddressARB check
X+cat > conftest.c <<EOF
X+#include <X11/Xlib.h>
X+#include <GL/glx.h>
X+#include <GL/gl.h>
X+int main() {void *ptr=(void*)glXGetProcAddressARB("glFun"); return 0;}
X+EOF
X+
X+if { (eval echo $config_script: \"$link\") 1>&5; (eval $link) 2>&5; }; then
X+  rm -rf conftest*
X+  has_glXGetProcAddressARB=yes
X+else
X+  echo "$config_script: failed program was:" >&5
X+  cat conftest.c >&5
X+fi
X+rm -f conftest*
X+
X+# glXGetProcAddressEXT check
X+cat > conftest.c <<EOF
X+#include <X11/Xlib.h>
X+#include <GL/glx.h>
X+#include <GL/gl.h>
X+int main() {void *ptr=(void*)glXGetProcAddressEXT("glFun"); return 0;}
X+EOF
X+
X+if { (eval echo $config_script: \"$link\") 1>&5; (eval $link) 2>&5; }; then
X+  rm -rf conftest*
X+  has_glXGetProcAddressEXT=yes
X+else
X+  echo "$config_script: failed program was:" >&5
X+  cat conftest.c >&5
X+fi
X+rm -f conftest*
X+
X+echo " glXGetProcAddress extension:    ""$has_glXGetProcAddress" 1>&6
X+echo " glXGetProcAddressARB extension: ""$has_glXGetProcAddressARB" 1>&6
X+echo " glXGetProcAddressEXT extension: ""$has_glXGetProcAddressEXT" 1>&6
X+if [ "x$has_glXGetProcAddress" = xyes ]; then
X+   CFLAGS="$CFLAGS -D_GLFW_HAS_GLXGETPROCADDRESS"
X+fi
X+if [ "x$has_glXGetProcAddressARB" = xyes ]; then
X+   CFLAGS="$CFLAGS -D_GLFW_HAS_GLXGETPROCADDRESSARB"
X+fi
X+if [ "x$has_glXGetProcAddressEXT" = xyes ]; then
X+   CFLAGS="$CFLAGS -D_GLFW_HAS_GLXGETPROCADDRESSEXT"
X+fi
X+echo " " 1>&6
X+
X+
X+##########################################################################
X+# Check for dlopen support
X+##########################################################################
X+echo "Checking for dlopen support... " 1>&6
X+echo "$config_script: Checking for dlopen support" >&5
X+has_dlopen=no
X+
X+cat > conftest.c <<EOF
X+#include <dlfcn.h>
X+int main() {void *l=dlopen("libGL.so",RTLD_LAZY|RTLD_GLOBAL); return 0;}
X+EOF
X+
X+# First try without -ldl
X+if { (eval echo $config_script: \"$link\") 1>&5; (eval $link) 2>&5; }; then
X+  rm -rf conftest*
X+  has_dlopen=yes
X+else
X+  echo "$config_script: failed program was:" >&5
X+  cat conftest.c >&5
X+fi
X+
X+# Now try with -ldl if the previous attempt failed
X+if [ "x$has_dlopen" = xno ]; then
X+  LIBS_OLD="$LIBS"
X+  LIBS="$LIBS -ldl"
X+  if { (eval echo $config_script: \"$link\") 1>&5; (eval $link) 2>&5; }; then
X+    rm -rf conftest*
X+    has_dlopen=yes
X+  else
X+    echo "$config_script: failed program was:" >&5
X+    cat conftest.c >&5
X+  fi
X+  if [ "x$has_dlopen" = xno ]; then
X+    LIBS="$LIBS_OLD"
X+  fi
X+fi
X+rm -f conftest*
X+
X+echo " dlopen support: ""$has_dlopen" 1>&6
X+if [ "x$has_dlopen" = xyes ]; then
X+   CFLAGS="$CFLAGS -D_GLFW_HAS_DLOPEN"
X+fi
X+echo " " 1>&6
X+
X+
X+##########################################################################
X+# Check for sysconf support
X+##########################################################################
X+echo "Checking for sysconf support... " 1>&6
X+echo "$config_script: Checking for sysconf support" >&5
X+has_sysconf=no
X+
X+cat > conftest.c <<EOF
X+#include <unistd.h>
X+#ifndef _SC_NPROCESSORS_ONLN
X+#ifndef _SC_NPROC_ONLN
X+#error Neither _SC_NPROCESSORS_ONLN nor _SC_NPROC_ONLN available
X+#endif
X+#endif
X+int main() {long x=sysconf(_SC_ARG_MAX); return 0; }
X+EOF
X+
X+if { (eval echo $config_script: \"$link\") 1>&5; (eval $link) 2>&5; }; then
X+  rm -rf conftest*
X+  has_sysconf=yes
X+else
X+  echo "$config_script: failed program was:" >&5
X+  cat conftest.c >&5
X+fi
X+rm -f conftest*
X+
X+echo " sysconf support: ""$has_sysconf" 1>&6
X+if [ "x$has_sysconf" = xyes ]; then
X+   CFLAGS="$CFLAGS -D_GLFW_HAS_SYSCONF"
X+fi
X+echo " " 1>&6
X+
X+
X+##########################################################################
X+# Check for sysctl support
X+##########################################################################
X+echo "Checking for sysctl support... " 1>&6
X+echo "$config_script: Checking for sysctl support" >&5
X+has_sysctl=no
X+
X+cat > conftest.c <<EOF
X+#include <sys/types.h>
X+#include <sys/sysctl.h>
X+#ifdef CTL_HW
X+#ifdef HW_NCPU
X+  yes;
X+#endif
X+#endif
X+EOF
X+
X+if { ac_try='$CC -E conftest.c'; { (eval echo $config_script: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
X+  has_sysctl=yes
X+fi
X+rm -f conftest*
X+
X+echo " sysctl support: ""$has_sysctl" 1>&6
X+if [ "x$has_sysctl" = xyes ]; then
X+   CFLAGS="$CFLAGS -D_GLFW_HAS_SYSCTL"
X+fi
X+echo " " 1>&6
X+
X+
X+
X+##########################################################################
X+# Post fixups
X+##########################################################################
X+if [ "x$CC" = xgcc ]; then
X+  CFLAGS_SPEED="-c -I. -I.. $CFLAGS -O3 -ffast-math -Wall"
X+  CFLAGS="-c -I. -I.. $CFLAGS -Os -Wall"
X+  CFLAGS_LINK="-O3 -ffast-math -Wall"
X+else
X+  CFLAGS_SPEED="-c -I. -I.. $CFLAGS -O"
X+  CFLAGS="-c -I. -I.. $CFLAGS -O"
X+  CFLAGS_LINK="-O"
X+fi
X+CFLAGS_LINK="-I../include $CFLAGS_LINK"
X+LFLAGS="$LFLAGS -L../lib/x11 -lglfw -lGLU $LIBS -lpthread -lm"
X+
X+
X+##########################################################################
X+# Create Makefiles
X+##########################################################################
X+
X+# ./lib/x11/Makefile.x11
X+MKNAME="./lib/x11/Makefile.x11""$makefile_ext"
X+echo "Creating ""$MKNAME""..." 1>&6
X+echo " " 1>&6
X+echo "$config_script: Creating ""$MKNAME""..." >&5
X+echo "##########################################################################" >$MKNAME
X+echo "# Automatically generated Makefile for GLFW" >>$MKNAME
X+echo "##########################################################################" >>$MKNAME
X+echo "CC           = $CC" >>$MKNAME
X+echo "CFLAGS       = $CFLAGS" >>$MKNAME
X+echo "CFLAGS_SPEED = $CFLAGS_SPEED" >>$MKNAME
X+echo " " >>$MKNAME
X+cat ./lib/x11/Makefile.x11.in >>$MKNAME
X+
X+# ./examples/Makefile.x11
X+MKNAME="./examples/Makefile.x11""$makefile_ext"
X+echo "Creating ""$MKNAME""..." 1>&6
X+echo " " 1>&6
X+echo "$config_script: Creating ""$MKNAME""..." >&5
X+echo "##########################################################################" >$MKNAME
X+echo "# Automatically generated Makefile for GLFW" >>$MKNAME
X+echo "##########################################################################" >>$MKNAME
X+echo "CC     = $CC" >>$MKNAME
X+echo "CFLAGS = $CFLAGS $CFLAGS_LINK" >>$MKNAME
X+echo "LFLAGS =$LFLAGS" >>$MKNAME
X+echo " " >>$MKNAME
X+cat ./examples/Makefile.x11.in >>$MKNAME
END-of-glfw/files/patch-aa
echo x - glfw/files/patch-ab
sed 's/^X//' >glfw/files/patch-ab << 'END-of-glfw/files/patch-ab'
X--- Makefile.orig	Wed Mar  3 13:35:48 2004
X+++ Makefile	Wed Mar  3 13:36:01 2004
X@@ -138,7 +138,7 @@
X # X11
X x11: $(MAKEFILES_X11)
X 	@cd lib/x11;  $(MAKE) -f Makefile.x11
X-	@cd examples; $(MAKE) -f Makefile.x11
X+#	@cd examples; $(MAKE) -f Makefile.x11
X 
X 
X # X11, GCC
END-of-glfw/files/patch-ab
exit
--- glfw-2.4.1.shar ends here ---

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list