pax_global_header00006660000000000000000000000064121516564440014522gustar00rootroot0000000000000052 comment=60ed54171f74bc691eae13dcc21002afd973be6b glfw-legacy-2.7.9/000077500000000000000000000000001215165644400137425ustar00rootroot00000000000000glfw-legacy-2.7.9/COPYING.txt000066400000000000000000000016741215165644400156230ustar00rootroot00000000000000Copyright (c) 2002-2006 Marcus Geelnard Copyright (c) 2006-2010 Camilla Berglund This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. glfw-legacy-2.7.9/Makefile000066400000000000000000000172451215165644400154130ustar00rootroot00000000000000########################################################################### # GLFW top level Makefile # # This file works as a top level makefile for all supported systems and # compilers. It builds both the GLFW link library and the supplied example # programs. ########################################################################### ########################################################################### # If your make program does not set the $(MAKE) variable correctly, # uncomment the following line and make sure that the name of the make # tool is correct. ########################################################################### # MAKE = make ########################################################################### # If no system/compiler is specified, display a list of available options ########################################################################### default: @echo "This is the root makefile for the GLFW library." @echo "" @echo "Use one of the following commands:" @echo "-----------------------------------------------------------------------------" @echo " $(MAKE) win32-mingw to compile for Windows using MinGW" @echo " $(MAKE) mingw-clean to remove any files generated for this target" @echo "-----------------------------------------------------------------------------" @echo " $(MAKE) win32-msys to compile for Windows using MinGW and MSYS" @echo " $(MAKE) msys-clean to remove any files generated for this target" @echo " $(MAKE) msys-install to install the GLFW header and static library" @echo "-----------------------------------------------------------------------------" @echo " $(MAKE) win32-lcc to compile for Windows using LCC-Win32" @echo " $(MAKE) win32-ow to compile for Windows using OpenWatcom" @echo " $(MAKE) win32-clean to remove any files generated for this target" @echo "-----------------------------------------------------------------------------" @echo " $(MAKE) cross-mgw to compile for Windows using MinGW on Unix" @echo " $(MAKE) cross-mgw-clean to remove any files generated for this target" @echo " $(MAKE) cross-mgw-install to install the GLFW library and header" @echo "-----------------------------------------------------------------------------" @echo " $(MAKE) x11 to compile for X11 on Unix-like systems" @echo " $(MAKE) x11-clean to remove any files generated for this target" @echo " $(MAKE) x11-dist-clean to also removed the configuration files" @echo " $(MAKE) x11-install to install the GLFW header and static library" @echo " $(MAKE) x11-dist-install to also install the GLFW shared library" @echo "-----------------------------------------------------------------------------" @echo " $(MAKE) cocoa to compile GLFW for Cocoa on Mac OS X" @echo " $(MAKE) cocoa-clean to remove any files generated for this target" @echo " $(MAKE) cocoa-install to install the GLFW header and static library" @echo " $(MAKE) cocoa-dist-install to also install the GLFW dynamic library" @echo "-----------------------------------------------------------------------------" @echo " There are also Microsoft Visual C++ 2008, 2010 and 2012 project files " @echo " available in the support/msvc* and directories." @echo "-----------------------------------------------------------------------------" ########################################################################### # Bare MinGW on Windows ########################################################################### win32-mingw: @cmd /c compile.bat $(MAKE) mingw mingw-clean: @cmd /c compile.bat CLEAN ########################################################################### # Cygwin on Windows ########################################################################### CYGWIN=PREFIX=/bin TARGET=i686-pc-mingw32- cygwin-install: win32-cygwin cd lib/win32 && env $(CYGWIN) $(MAKE) -f Makefile.win32.cross-mgw install win32-cygwin: cd lib/win32 && env $(CYGWIN) $(MAKE) -f Makefile.win32.cross-mgw cd examples && env $(CYGWIN) $(MAKE) -f Makefile.win32.cross-mgw cd tests && env $(CYGWIN) $(MAKE) -f Makefile.win32.cross-mgw cygwin-clean: cd lib/win32 && env $(CYGWIN) $(MAKE) -f Makefile.win32.cross-mgw clean cd examples && env $(CYGWIN) $(MAKE) -f Makefile.win32.cross-mgw clean cd tests && env $(CYGWIN) $(MAKE) -f Makefile.win32.cross-mgw clean ########################################################################### # MSYS on Windows ########################################################################### msys-install: win32-msys cd lib/win32 && $(MAKE) -f Makefile.win32.msys install win32-msys: cd lib/win32 && $(MAKE) -f Makefile.win32.msys cd examples && $(MAKE) -f Makefile.win32.msys cd tests && $(MAKE) -f Makefile.win32.msys msys-clean: cd lib/win32 && $(MAKE) -f Makefile.win32.msys clean cd examples && $(MAKE) -f Makefile.win32.msys clean cd tests && $(MAKE) -f Makefile.win32.msys clean ########################################################################### # Various compilers on Windows ########################################################################### # Windows, LCC-Win32 win32-lcc: @.\\compile.bat $(MAKE) lcc # Windows, OpenWatcom win32-ow: @.\\compile.bat $(MAKE) ow # Cleanup for Windows win32-clean: @.\\compile.bat CLEAN ########################################################################### # MinGW cross-compile to Windows from Unix ########################################################################### cross-mgw-install: cross-mgw cd lib/win32 && $(MAKE) -f Makefile.win32.cross-mgw install cross-mgw: cd lib/win32 && $(MAKE) -f Makefile.win32.cross-mgw cd examples && $(MAKE) -f Makefile.win32.cross-mgw cd tests && $(MAKE) -f Makefile.win32.cross-mgw cross-mgw-clean: cd lib/win32 && $(MAKE) -f Makefile.win32.cross-mgw clean cd examples && $(MAKE) -f Makefile.win32.cross-mgw clean cd tests && $(MAKE) -f Makefile.win32.cross-mgw clean ########################################################################### # X11 on Unix-like systems ########################################################################### MAKEFILES_X11_IN = lib/x11/Makefile.x11.in examples/Makefile.x11.in \ tests/Makefile.x11.in MAKEFILES_X11 = lib/x11/Makefile.x11 examples/Makefile.x11 tests/Makefile.x11 # Cleanup for X11 (must be here due to generated makefile) x11-clean: $(MAKEFILES_X11) cd lib/x11 && $(MAKE) -f Makefile.x11 clean cd examples && $(MAKE) -f Makefile.x11 clean cd tests && $(MAKE) -f Makefile.x11 clean x11-dist-clean: x11-clean rm -f config.log rm -f $(MAKEFILES_X11) rm -f lib/x11/libglfw.pc.in # Auto configuration for X11 $(MAKEFILES_X11) : compile.sh $(MAKEFILES_X11_IN) @sh ./compile.sh # X11 x11: $(MAKEFILES_X11) cd lib/x11 && $(MAKE) -f Makefile.x11 cd examples && $(MAKE) -f Makefile.x11 cd tests && $(MAKE) -f Makefile.x11 # X11 install x11-install: x11 cd lib/x11 && $(MAKE) -f Makefile.x11 install # X11 dist install x11-dist-install: x11 cd lib/x11 && $(MAKE) -f Makefile.x11 dist-install ########################################################################### # Cocoa on Mac OS X ########################################################################### cocoa: cd lib/cocoa && $(MAKE) -f Makefile.cocoa cd examples && $(MAKE) -f Makefile.cocoa cd tests && $(MAKE) -f Makefile.cocoa cocoa-clean: cd lib/cocoa && $(MAKE) -f Makefile.cocoa clean cd examples && $(MAKE) -f Makefile.cocoa clean cd tests && $(MAKE) -f Makefile.cocoa clean cocoa-install: cocoa cd lib/cocoa && $(MAKE) -f Makefile.cocoa install cocoa-dist-install: cocoa cd lib/cocoa && $(MAKE) -f Makefile.cocoa dist-install glfw-legacy-2.7.9/compile.bat000066400000000000000000000314331215165644400160660ustar00rootroot00000000000000@echo off REM ********************************************************************** REM * compile.bat - MS Windows compilation batch file REM * REM * This is a "helper" script for the top-level Makefile for GLFW. REM * It was introduced to eliminate incompability issues between REM * Windows NT, 2000 and 9x (it's easier to make a script/makefile REM * run accross different unices from different vendors than to make REM * a script/makefile run across different Windows versions from REM * Microsoft!). REM * REM * This batch file has been tested under Windows 98, NT 4.0 and 2k. REM * REM * Usage 1: compile MAKEPROG SUFFIX REM * REM * MAKEPROG Name of make program (e.g. make or nmake) REM * SUFFIX Makefile suffix for a specific compiler (e.g. msvc) REM * REM * Usage 2: compile CLEAN REM ********************************************************************** REM ---------------------------------------------------------------------- REM Check input arguments REM ---------------------------------------------------------------------- IF %1 == CLEAN GOTO Cleanup IF %1 == "" GOTO Error1 IF "%2" == "" GOTO Error1 IF NOT EXIST .\lib\win32\Makefile.win32.%2 GOTO Error2 GOTO ArgsOK :Error1 echo ************************************************************************* echo *** NOTE: THIS PROGRAM IS USED BY THE TOP LEVEL MAKEFILE. *** echo *** PLEASE READ 'README.HTML' FOR INFORMATION ON HOW TO COMPILE GLFW! *** echo ************************************************************************* echo Usage 1: %0 MAKEPROG SUFFIX echo MAKEPROG - Name of make program (e.g. make or nmake) echo SUFFIX - Makefile suffix for a specific compiler (e.g. mgw or msvc) echo Usage 2: %0 CLEAN goto End :Error2 echo "%2" is not a vaild Makefile suffix goto End :ArgsOK REM ---------------------------------------------------------------------- REM Build GLFW library (both static and dynamic, where supported) REM ---------------------------------------------------------------------- cd .\lib\win32 %1 -f Makefile.win32.%2 REM ---------------------------------------------------------------------- REM Build example programs REM ---------------------------------------------------------------------- cd ..\..\examples %1 -f Makefile.win32.%2 REM ---------------------------------------------------------------------- REM Build test programs REM ---------------------------------------------------------------------- cd ..\tests %1 -f Makefile.win32.%2 REM ---------------------------------------------------------------------- REM Return to root directory REM ---------------------------------------------------------------------- cd .. GOTO End REM ---------------------------------------------------------------------- REM Clean up compiled files REM ---------------------------------------------------------------------- :Cleanup REM Library object files IF EXIST .\lib\win32\enable.o del .\lib\win32\enable.o IF EXIST .\lib\win32\fullscreen.o del .\lib\win32\fullscreen.o IF EXIST .\lib\win32\glext.o del .\lib\win32\glext.o IF EXIST .\lib\win32\image.o del .\lib\win32\image.o IF EXIST .\lib\win32\init.o del .\lib\win32\init.o IF EXIST .\lib\win32\input.o del .\lib\win32\input.o IF EXIST .\lib\win32\joystick.o del .\lib\win32\joystick.o IF EXIST .\lib\win32\stream.o del .\lib\win32\stream.o IF EXIST .\lib\win32\tga.o del .\lib\win32\tga.o IF EXIST .\lib\win32\thread.o del .\lib\win32\thread.o IF EXIST .\lib\win32\time.o del .\lib\win32\time.o IF EXIST .\lib\win32\window.o del .\lib\win32\window.o IF EXIST .\lib\win32\win32_enable.o del .\lib\win32\win32_enable.o IF EXIST .\lib\win32\win32_fullscreen.o del .\lib\win32\win32_fullscreen.o IF EXIST .\lib\win32\win32_glext.o del .\lib\win32\win32_glext.o IF EXIST .\lib\win32\win32_init.o del .\lib\win32\win32_init.o IF EXIST .\lib\win32\win32_joystick.o del .\lib\win32\win32_joystick.o IF EXIST .\lib\win32\win32_thread.o del .\lib\win32\win32_thread.o IF EXIST .\lib\win32\win32_time.o del .\lib\win32\win32_time.o IF EXIST .\lib\win32\win32_window.o del .\lib\win32\win32_window.o IF EXIST .\lib\win32\enable_dll.o del .\lib\win32\enable_dll.o IF EXIST .\lib\win32\fullscreen_dll.o del .\lib\win32\fullscreen_dll.o IF EXIST .\lib\win32\glext_dll.o del .\lib\win32\glext_dll.o IF EXIST .\lib\win32\image_dll.o del .\lib\win32\image_dll.o IF EXIST .\lib\win32\init_dll.o del .\lib\win32\init_dll.o IF EXIST .\lib\win32\input_dll.o del .\lib\win32\input_dll.o IF EXIST .\lib\win32\joystick_dll.o del .\lib\win32\joystick_dll.o IF EXIST .\lib\win32\stream_dll.o del .\lib\win32\stream_dll.o IF EXIST .\lib\win32\tga_dll.o del .\lib\win32\tga_dll.o IF EXIST .\lib\win32\thread_dll.o del .\lib\win32\thread_dll.o IF EXIST .\lib\win32\time_dll.o del .\lib\win32\time_dll.o IF EXIST .\lib\win32\window_dll.o del .\lib\win32\window_dll.o IF EXIST .\lib\win32\win32_dllmain_dll.o del .\lib\win32\win32_dllmain_dll.o IF EXIST .\lib\win32\win32_enable_dll.o del .\lib\win32\win32_enable_dll.o IF EXIST .\lib\win32\win32_fullscreen_dll.o del .\lib\win32\win32_fullscreen_dll.o IF EXIST .\lib\win32\win32_glext_dll.o del .\lib\win32\win32_glext_dll.o IF EXIST .\lib\win32\win32_init_dll.o del .\lib\win32\win32_init_dll.o IF EXIST .\lib\win32\win32_joystick_dll.o del .\lib\win32\win32_joystick_dll.o IF EXIST .\lib\win32\win32_thread_dll.o del .\lib\win32\win32_thread_dll.o IF EXIST .\lib\win32\win32_time_dll.o del .\lib\win32\win32_time_dll.o IF EXIST .\lib\win32\win32_window_dll.o del .\lib\win32\win32_window_dll.o IF EXIST .\lib\win32\enable.obj del .\lib\win32\enable.obj IF EXIST .\lib\win32\fullscreen.obj del .\lib\win32\fullscreen.obj IF EXIST .\lib\win32\glext.obj del .\lib\win32\glext.obj IF EXIST .\lib\win32\image.obj del .\lib\win32\image.obj IF EXIST .\lib\win32\init.obj del .\lib\win32\init.obj IF EXIST .\lib\win32\input.obj del .\lib\win32\input.obj IF EXIST .\lib\win32\joystick.obj del .\lib\win32\joystick.obj IF EXIST .\lib\win32\stream.obj del .\lib\win32\stream.obj IF EXIST .\lib\win32\tga.obj del .\lib\win32\tga.obj IF EXIST .\lib\win32\thread.obj del .\lib\win32\thread.obj IF EXIST .\lib\win32\time.obj del .\lib\win32\time.obj IF EXIST .\lib\win32\window.obj del .\lib\win32\window.obj IF EXIST .\lib\win32\win32_enable.obj del .\lib\win32\win32_enable.obj IF EXIST .\lib\win32\win32_fullscreen.obj del .\lib\win32\win32_fullscreen.obj IF EXIST .\lib\win32\win32_glext.obj del .\lib\win32\win32_glext.obj IF EXIST .\lib\win32\win32_init.obj del .\lib\win32\win32_init.obj IF EXIST .\lib\win32\win32_joystick.obj del .\lib\win32\win32_joystick.obj IF EXIST .\lib\win32\win32_thread.obj del .\lib\win32\win32_thread.obj IF EXIST .\lib\win32\win32_time.obj del .\lib\win32\win32_time.obj IF EXIST .\lib\win32\win32_window.obj del .\lib\win32\win32_window.obj IF EXIST .\lib\win32\enable_dll.obj del .\lib\win32\enable_dll.obj IF EXIST .\lib\win32\fullscreen_dll.obj del .\lib\win32\fullscreen_dll.obj IF EXIST .\lib\win32\glext_dll.obj del .\lib\win32\glext_dll.obj IF EXIST .\lib\win32\image_dll.obj del .\lib\win32\image_dll.obj IF EXIST .\lib\win32\init_dll.obj del .\lib\win32\init_dll.obj IF EXIST .\lib\win32\input_dll.obj del .\lib\win32\input_dll.obj IF EXIST .\lib\win32\joystick_dll.obj del .\lib\win32\joystick_dll.obj IF EXIST .\lib\win32\stream_dll.obj del .\lib\win32\stream_dll.obj IF EXIST .\lib\win32\tga_dll.obj del .\lib\win32\tga_dll.obj IF EXIST .\lib\win32\thread_dll.obj del .\lib\win32\thread_dll.obj IF EXIST .\lib\win32\time_dll.obj del .\lib\win32\time_dll.obj IF EXIST .\lib\win32\window_dll.obj del .\lib\win32\window_dll.obj IF EXIST .\lib\win32\win32_dllmain_dll.obj del .\lib\win32\win32_dllmain_dll.obj IF EXIST .\lib\win32\win32_enable_dll.obj del .\lib\win32\win32_enable_dll.obj IF EXIST .\lib\win32\win32_fullscreen_dll.obj del .\lib\win32\win32_fullscreen_dll.obj IF EXIST .\lib\win32\win32_glext_dll.obj del .\lib\win32\win32_glext_dll.obj IF EXIST .\lib\win32\win32_init_dll.obj del .\lib\win32\win32_init_dll.obj IF EXIST .\lib\win32\win32_joystick_dll.obj del .\lib\win32\win32_joystick_dll.obj IF EXIST .\lib\win32\win32_thread_dll.obj del .\lib\win32\win32_thread_dll.obj IF EXIST .\lib\win32\win32_time_dll.obj del .\lib\win32\win32_time_dll.obj IF EXIST .\lib\win32\win32_window_dll.obj del .\lib\win32\win32_window_dll.obj REM Library files IF EXIST .\lib\win32\libglfw.a del .\lib\win32\libglfw.a IF EXIST .\lib\win32\libglfwdll.a del .\lib\win32\libglfwdll.a IF EXIST .\lib\win32\glfw.exp del .\lib\win32\glfw.exp IF EXIST .\lib\win32\glfwdll.exp del .\lib\win32\glfwdll.exp IF EXIST .\lib\win32\glfw.lib del .\lib\win32\glfw.lib IF EXIST .\lib\win32\glfwdll.lib del .\lib\win32\glfwdll.lib IF EXIST .\lib\win32\glfw.dll del .\lib\win32\glfw.dll IF EXIST .\lib\win32\glfw.tds del .\lib\win32\glfw.tds IF EXIST .\lib\win32\init.tds del .\lib\win32\init.tds REM Executables and related files IF EXIST .\examples\boing.exe del .\examples\boing.exe IF EXIST .\examples\gears.exe del .\examples\gears.exe IF EXIST .\examples\heightmap.exe del .\examples\heightmap.exe IF EXIST .\examples\listmodes.exe del .\examples\listmodes.exe IF EXIST .\examples\mipmaps.exe del .\examples\mipmaps.exe IF EXIST .\examples\mtbench.exe del .\examples\mtbench.exe IF EXIST .\examples\mthello.exe del .\examples\mthello.exe IF EXIST .\examples\particles.exe del .\examples\particles.exe IF EXIST .\examples\pong3d.exe del .\examples\pong3d.exe IF EXIST .\examples\splitview.exe del .\examples\splitview.exe IF EXIST .\examples\triangle.exe del .\examples\triangle.exe IF EXIST .\examples\wave.exe del .\examples\wave.exe IF EXIST .\examples\boing.obj del .\examples\boing.obj IF EXIST .\examples\gears.obj del .\examples\gears.obj IF EXIST .\examples\heightmap.obj del .\examples\heightmap.obj IF EXIST .\examples\listmodes.obj del .\examples\listmodes.obj IF EXIST .\examples\mipmaps.obj del .\examples\mipmaps.obj IF EXIST .\examples\mtbench.obj del .\examples\mtbench.obj IF EXIST .\examples\mthello.obj del .\examples\mthello.obj IF EXIST .\examples\particles.obj del .\examples\particles.obj IF EXIST .\examples\pong3d.obj del .\examples\pong3d.obj IF EXIST .\examples\splitview.obj del .\examples\splitview.obj IF EXIST .\examples\triangle.obj del .\examples\triangle.obj IF EXIST .\examples\wave.obj del .\examples\wave.obj IF EXIST .\examples\boing.tds del .\examples\boing.tds IF EXIST .\examples\gears.tds del .\examples\gears.tds IF EXIST .\examples\heightmap.tds del .\examples\heightmap.tds IF EXIST .\examples\listmodes.tds del .\examples\listmodes.tds IF EXIST .\examples\mipmaps.tds del .\examples\mipmaps.tds IF EXIST .\examples\mtbench.tds del .\examples\mtbench.tds IF EXIST .\examples\mthello.tds del .\examples\mthello.tds IF EXIST .\examples\particles.tds del .\examples\particles.tds IF EXIST .\examples\pong3d.tds del .\examples\pong3d.tds IF EXIST .\examples\splitview.tds del .\examples\splitview.tds IF EXIST .\examples\triangle.tds del .\examples\triangle.tds IF EXIST .\examples\wave.tds del .\examples\wave.tds IF EXIST .\tests\accuracy.exe del .\tests\accuracy.exe IF EXIST .\tests\defaults.exe del .\tests\defaults.exe IF EXIST .\tests\dynamic.exe del .\tests\dynamic.exe IF EXIST .\tests\events.exe del .\tests\events.exe IF EXIST .\tests\fsaa.exe del .\tests\fsaa.exe IF EXIST .\tests\fsinput.exe del .\tests\fsinput.exe IF EXIST .\tests\iconify.exe del .\tests\iconify.exe IF EXIST .\tests\joysticks.exe del .\tests\joysticks.exe IF EXIST .\tests\peter.exe del .\tests\peter.exe IF EXIST .\tests\reopen.exe del .\tests\reopen.exe IF EXIST .\tests\tearing.exe del .\tests\tearing.exe IF EXIST .\tests\version.exe del .\tests\version.exe :End glfw-legacy-2.7.9/compile.sh000066400000000000000000000472321215165644400157360ustar00rootroot00000000000000#!/bin/sh ########################################################################## # compile.sh - Unix/X11 configuration script # $Date: 2007-09-20 23:16:57 $ # $Revision: 1.16 $ # # This is a minimalist configuration script for GLFW, which is used to # determine the availability of certain features. # # This script is not very nice at all (especially the Makefile generation # is very ugly and hardcoded). Hopefully it will be cleaned up in the # future, but for now it does a pretty good job. ########################################################################## ########################################################################## # Check arguments ########################################################################## silent=no for arg in "$@"; do { case "$arg" in # Silent? -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; esac; } done; ########################################################################## # Misc. ########################################################################## self=$0 # File descriptor usage: # 0 standard input # 1 file creation # 2 errors and warnings # 5 compiler messages saved in config.log # 6 checking for... messages and results exec 5>./config.log if [ "x$silent" = xyes ]; then exec 6>/dev/null else exec 6>&1 fi echo "\ This file contains any messages produced by compilers while running $self, to aid debugging if $self makes a mistake. " 1>&5 ########################################################################## # Default compiler settings ########################################################################## if [ "x$CC" = x ]; then CC=cc fi # These will contain flags needed by both the GLFW library and programs # They are also used by the compile and link tests below # Note that CFLAGS and LFLAGS remain unmodified and are checked again # before file generation GLFW_CFLAGS="$CFLAGS" GLFW_LFLAGS="$LFLAGS -lGL" # These will contain flags needed by the GLFW library GLFW_LIB_CFLAGS= GLFW_LIB_LFLAGS= # These will contain flags needed by programs using GLFW GLFW_BIN_CFLAGS= GLFW_BIN_LFLAGS= # This will contain flags needed by the GLFW shared library SOFLAGS= ########################################################################## # Add system-specific flags ########################################################################## echo -n "Checking what kind of system this is... " 1>&6 case "x`uname 2> /dev/null`" in xLinux) GLFW_LIB_CFLAGS="$GLFW_LIB_CFLAGS -D_GLFW_USE_LINUX_JOYSTICKS" SOFLAGS="-shared -Wl,-soname,libglfw.so" echo "Linux" 1>&6 ;; xDarwin) SOFLAGS="-flat_namespace -undefined suppress" echo "Mac OS X" 1>&6 ;; *) SOFLAGS="-shared -soname libglfw.so" echo "Generic Unix" 1>&6 ;; esac ########################################################################## # Check for X11 library directory ########################################################################## echo -n "Checking for X11 libraries location... " 1>&6 if [ -r "/usr/X11/lib" ]; then GLFW_LFLAGS="$GLFW_LFLAGS -L/usr/X11/lib" GLFW_CFLAGS="-I/usr/X11/include $GLFW_CFLAGS" echo "/usr/X11/lib" 1>&6 elif [ -r "/usr/X11R7/lib" ]; then GLFW_LFLAGS="$GLFW_LFLAGS -L/usr/X11R7/lib" GLFW_CFLAGS="-I/usr/X11R7/include $GLFW_CFLAGS" echo "/usr/X11R7/lib" 1>&6 elif [ -r "/usr/X11R6/lib" ]; then GLFW_LFLAGS="$GLFW_LFLAGS -L/usr/X11R6/lib" GLFW_CFLAGS="-I/usr/X11R6/include $GLFW_CFLAGS" echo "/usr/X11R6/lib" 1>&6 elif [ -r "/usr/X11R5/lib" ]; then GLFW_LFLAGS="$GLFW_LFLAGS -L/usr/X11R5/lib" GLFW_CFLAGS="-I/usr/X11R5/include $GLFW_CFLAGS" echo "/usr/X11R5/lib" 1>&6 elif [ -r "/opt/X11R6/lib" ]; then # This location is used on QNX GLFW_LFLAGS="$GLFW_LFLAGS -L/opt/X11R6/lib" GLFW_CFLAGS="-I/opt/X11R6/include $GLFW_CFLAGS" echo "/opt/X11R6/lib" 1>&6 elif [ -r "/usr/X/lib" ]; then GLFW_LFLAGS="$GLFW_LFLAGS -L/usr/X/lib" GLFW_CFLAGS="-I/usr/X/include $GLFW_CFLAGS" echo "/usr/X/lib" 1>&6 else # TODO: Detect and report X11R7 in /usr/lib echo "unknown (assuming linker will find them)" 1>&6 fi ########################################################################## # Compilation commands ########################################################################## compile='$CC -c $GLFW_CFLAGS conftest.c 1>&5' link='$CC -o conftest $GLFW_CFLAGS conftest.c $GLFW_LFLAGS 1>&5' ########################################################################## # Check if we are using GNU C (or something claiming it is) ########################################################################## echo -n "Checking whether we are using GNU C... " 1>&6 echo "$self: checking whether we are using GNU C" >&5 cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then use_gcc=yes else use_gcc=no fi rm -f conftest* echo "$use_gcc" 1>&6 ########################################################################## # Check for X11 RandR availability ########################################################################## echo -n "Checking for X11 RandR support... " 1>&6 echo "$self: Checking for X11 RandR support" >&5 has_xrandr=no cat > conftest.c < #include int main() {; return 0;} EOF if { (eval echo $self: \"$compile\") 1>&5; (eval $compile) 2>&5; }; then rm -rf conftest* has_xrandr=yes else echo "$self: failed program was:" >&5 cat conftest.c >&5 fi rm -f conftest* echo "$has_xrandr" 1>&6 if [ "x$has_xrandr" = xyes ]; then GLFW_LIB_CFLAGS="$GLFW_LIB_CFLAGS -D_GLFW_HAS_XRANDR" GLFW_LIB_LFLAGS="$GLFW_LIB_LFLAGS -lXrandr" fi ########################################################################## # Check for X11 VidMode availability ########################################################################## if [ "x$has_xrandr" = xno ]; then echo -n "Checking for X11 VidMode support... " 1>&6 echo "$self: Checking for X11 VidMode support" >&5 has_xf86vm=no cat > conftest.c < #include #if defined(__APPLE_CC__) #error Not supported under Mac OS X #endif int main() {; return 0;} EOF if { (eval echo $self: \"$compile\") 1>&5; (eval $compile) 2>&5; }; then rm -rf conftest* has_xf86vm=yes else echo "$self: failed program was:" >&5 cat conftest.c >&5 fi rm -f conftest* echo "$has_xf86vm" 1>&6 if [ "x$has_xf86vm" = xyes ]; then GLFW_LIB_CFLAGS="$GLFW_LIB_CFLAGS -D_GLFW_HAS_XF86VIDMODE" GLFW_LIB_LFLAGS="$GLFW_LIB_LFLAGS -lXxf86vm -lXext" fi fi ########################################################################## # Check for pthread support ########################################################################## echo -n "Checking for pthread support... " 1>&6 echo "$self: Checking for pthread support" >&5 has_pthread=no cat > conftest.c < int main() {pthread_t posixID; posixID=pthread_self(); return 0;} EOF # Save original values CFLAGS_OLD="$GLFW_CFLAGS" LFLAGS_OLD="$GLFW_LFLAGS" # These will contain the extra flags, if any CFLAGS_THREAD= LFLAGS_THREAD= # Try -pthread (most systems) if [ "x$has_pthread" = xno ]; then CFLAGS_THREAD="-pthread" LFLAGS_THREAD="-pthread" GLFW_CFLAGS="$CFLAGS_OLD $CFLAGS_THREAD" GLFW_LFLAGS="$LFLAGS_OLD $LFLAGS_THREAD" if { (eval echo $self: \"$link\") 1>&5; (eval $link) 2>&5; }; then rm -rf conftest* has_pthread=yes else echo "$self: failed program was:" >&5 cat conftest.c >&5 fi fi # Try -lpthread if [ "x$has_pthread" = xno ]; then CFLAGS_THREAD="-D_REENTRANT" LFLAGS_THREAD="-lpthread" GLFW_CFLAGS="$CFLAGS_OLD $CFLAGS_THREAD" GLFW_LFLAGS="$LFLAGS_OLD $LFLAGS_THREAD" if { (eval echo $self: \"$link\") 1>&5; (eval $link) 2>&5; }; then rm -rf conftest* has_pthread=yes else echo "$self: failed program was:" >&5 cat conftest.c >&5 fi fi # Try -lsocket (e.g. QNX) if [ "x$has_pthread" = xno ]; then CFLAGS_THREAD= LFLAGS_THREAD="-lsocket" GLFW_CFLAGS="$CFLAGS_OLD $CFLAGS_THREAD" GLFW_LFLAGS="$LFLAGS_OLD $LFLAGS_THREAD" if { (eval echo $self: \"$link\") 1>&5; (eval $link) 2>&5; }; then rm -rf conftest* has_pthread=yes else echo "$self: failed program was:" >&5 cat conftest.c >&5 fi fi # Restore original values GLFW_CFLAGS="$CFLAGS_OLD" GLFW_LFLAGS="$LFLAGS_OLD" echo "$has_pthread" 1>&6 if [ "x$has_pthread" = xyes ]; then GLFW_CFLAGS="$GLFW_CFLAGS $CFLAGS_THREAD" GLFW_LFLAGS="$GLFW_LFLAGS $LFLAGS_THREAD" GLFW_LIB_CFLAGS="$GLFW_LIB_CFLAGS -D_GLFW_HAS_PTHREAD" fi ########################################################################## # Check for sched_yield support ########################################################################## if [ "x$has_pthread" = xyes ]; then echo -n "Checking for sched_yield... " 1>&6 echo "$self: Checking for sched_yield" >&5 has_sched_yield=no LFLAGS_OLD="$GLFW_LFLAGS" LFLAGS_YIELD= cat > conftest.c < int main() {sched_yield(); return 0;} EOF if { (eval echo $self: \"$compile\") 1>&5; (eval $compile) 2>&5; }; then rm -f conftest* has_sched_yield=yes else echo "$self: failed program was:" >&5 cat conftest.c >&5 fi if [ "x$has_sched_yield" = xno ]; then LFLAGS_YIELD="-lrt" GLFW_LFLAGS="$LFLAGS_OLD $LFLAGS_YIELD" if { (eval echo $self: \"$link\") 1>&5; (eval $link) 2>&5; }; then rm -f conftest* has_sched_yield=yes else echo "$self: failed program was:" >&5 cat conftest.c >&5 fi fi GLFW_LFLAGS="$LFLAGS_OLD" echo "$has_sched_yield" 1>&6 if [ "x$has_sched_yield" = xyes ]; then GLFW_LIB_CFLAGS="$GLFW_LIB_CFLAGS -D_GLFW_HAS_SCHED_YIELD" GLFW_LIB_LFLAGS="$GLFW_LIB_LFLAGS $LFLAGS_YIELD" fi fi ########################################################################## # Check for clock_gettime support ########################################################################## echo -n "Checking for clock_gettime... " 1>&6 echo "$self: Checking for clock_gettime" >&5 has_clock_gettime=no LFLAGS_OLD="$GLFW_LFLAGS" LFLAGS_CLOCK= GLFW_LFLAGS="$LFLAGS_CLOCK" cat > conftest.c < #include int main() { #if defined( CLOCK_MONOTONIC ) clock_gettime(0, 0); #else #error "clock_gettime support not detected" #endif return 0;} EOF if { (eval echo $self: \"$link\") 1>&5; (eval $link) 2>&5; }; then rm -f conftest* has_clock_gettime=yes else echo "$self: failed program was:" >&5 cat conftest.c >&5 fi if [ "x$has_clock_gettime" = xno ]; then LFLAGS_CLOCK="-lrt" GLFW_LFLAGS="$LFLAGS_CLOCK" if { (eval echo $self: \"$link\") 1>&5; (eval $link) 2>&5; }; then rm -f conftest* has_clock_gettime=yes else echo "$self: failed program was:" >&5 cat conftest.c >&5 fi fi GLFW_LFLAGS="$LFLAGS_OLD" echo "$has_clock_gettime" 1>&6 if [ "x$has_clock_gettime" = xyes ]; then GLFW_LIB_LFLAGS="$GLFW_LIB_LFLAGS $LFLAGS_CLOCK" fi ########################################################################## # Check for glXGetProcAddressXXX availability ########################################################################## echo -n "Checking for glXGetProcAddress variants... " 1>&6 echo "$self: Checking for glXGetProcAddress variants" >&5 has_glXGetProcAddress=no if [ "x$has_glXGetProcAddress" = xno ]; then # Check for plain glXGetProcAddress cat > conftest.c < #include #include int main() {void *ptr=(void*)glXGetProcAddress("glFun"); return 0;} EOF if { (eval echo $self: \"$link\") 1>&5; (eval $link) 2>&5; }; then rm -rf conftest* has_glXGetProcAddress=yes else echo "$self: failed program was:" >&5 cat conftest.c >&5 fi rm -f conftest* if [ "x$has_glXGetProcAddress" = xyes ]; then echo "glXGetProcAddress" 1>&6 GLFW_LIB_CFLAGS="$GLFW_LIB_CFLAGS -D_GLFW_HAS_GLXGETPROCADDRESS" fi fi if [ "x$has_glXGetProcAddress" = xno ]; then # Check for glXGetProcAddressARB cat > conftest.c < #include #include int main() {void *ptr=(void*)glXGetProcAddressARB("glFun"); return 0;} EOF if { (eval echo $self: \"$link\") 1>&5; (eval $link) 2>&5; }; then rm -rf conftest* has_glXGetProcAddress=yes else echo "$self: failed program was:" >&5 cat conftest.c >&5 fi rm -f conftest* if [ "x$has_glXGetProcAddress" = xyes ]; then echo "glXGetProcAddressARB" 1>&6 GLFW_LIB_CFLAGS="$GLFW_LIB_CFLAGS -D_GLFW_HAS_GLXGETPROCADDRESSARB" fi fi if [ "x$has_glXGetProcAddress" = xno ]; then # Check for glXGetProcAddressEXT cat > conftest.c < #include #include int main() {void *ptr=(void*)glXGetProcAddressEXT("glFun"); return 0;} EOF if { (eval echo $self: \"$link\") 1>&5; (eval $link) 2>&5; }; then rm -rf conftest* has_glXGetProcAddress=yes else echo "$self: failed program was:" >&5 cat conftest.c >&5 fi rm -f conftest* if [ "x$has_glXGetProcAddress" = xyes ]; then echo "glXGetProcAddressEXT" 1>&6 GLFW_LIB_CFLAGS="$GLFW_LIB_CFLAGS -D_GLFW_HAS_GLXGETPROCADDRESSEXT" fi fi if [ "x$has_glXGetProcAddress" = xno ]; then echo "no" 1>&6 fi ########################################################################## # Check for dlopen support if necessary ########################################################################## if [ "x$has_glXGetProcAddress" = xno ]; then echo -n "Checking for dlopen... " 1>&6 echo "$self: Checking for dlopen" >&5 has_dlopen=no cat > conftest.c < int main() {void *l=dlopen("libGL.so",RTLD_LAZY|RTLD_GLOBAL); return 0;} EOF # First try without -ldl if { (eval echo $self: \"$link\") 1>&5; (eval $link) 2>&5; }; then rm -rf conftest* has_dlopen=yes else echo "$self: failed program was:" >&5 cat conftest.c >&5 fi # Now try with -ldl if the previous attempt failed if [ "x$has_dlopen" = xno ]; then LFLAGS_OLD="$GLFW_LFLAGS" GLFW_LFLAGS="$GLFW_LFLAGS -ldl" if { (eval echo $self: \"$link\") 1>&5; (eval $link) 2>&5; }; then rm -rf conftest* has_dlopen=yes else echo "$self: failed program was:" >&5 cat conftest.c >&5 fi GLFW_LFLAGS="$LFLAGS_OLD" if [ "x$has_dlopen" = xyes ]; then GLFW_LIB_LFLAGS="$GLFW_LIB_LFLAGS -ldl" fi fi rm -f conftest* echo "$has_dlopen" 1>&6 if [ "x$has_dlopen" = xyes ]; then GLFW_LIB_CFLAGS="$GLFW_LIB_CFLAGS -D_GLFW_HAS_DLOPEN" fi fi ########################################################################## # Check for sysconf support ########################################################################## echo -n "Checking for sysconf... " 1>&6 echo "$self: Checking for sysconf" >&5 has_sysconf=no cat > conftest.c < #ifndef _SC_NPROCESSORS_ONLN #ifndef _SC_NPROC_ONLN #error Neither _SC_NPROCESSORS_ONLN nor _SC_NPROC_ONLN available #endif #endif int main() {long x=sysconf(_SC_ARG_MAX); return 0; } EOF if { (eval echo $self: \"$link\") 1>&5; (eval $link) 2>&5; }; then rm -rf conftest* has_sysconf=yes else echo "$self: failed program was:" >&5 cat conftest.c >&5 fi rm -f conftest* echo "$has_sysconf" 1>&6 if [ "x$has_sysconf" = xyes ]; then GLFW_LIB_CFLAGS="$GLFW_LIB_CFLAGS -D_GLFW_HAS_SYSCONF" fi ########################################################################## # Check for sysctl support ########################################################################## echo -n "Checking for sysctl support... " 1>&6 echo "$self: Checking for sysctl support" >&5 has_sysctl=no cat > conftest.c < #include #ifdef CTL_HW #ifdef HW_NCPU yes; #endif #endif EOF if { ac_try='$CC -E conftest.c'; { (eval echo $self: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then has_sysctl=yes fi rm -f conftest* echo "$has_sysctl" 1>&6 if [ "x$has_sysctl" = xyes ]; then GLFW_LIB_CFLAGS="$GLFW_LIB_CFLAGS -D_GLFW_HAS_SYSCTL" fi ########################################################################## # Last chance to change the flags before file generation ########################################################################## GLFW_LIB_CFLAGS="-c -I. -I.. $GLFW_LIB_CFLAGS" GLFW_BIN_CFLAGS="-I../include $GLFW_BIN_CFLAGS" if [ "x$CFLAGS" = x ]; then if [ "x$use_gcc" = xyes ]; then GLFW_CFLAGS="$GLFW_CFLAGS -O2 -Wall" else GLFW_CFLAGS="$GLFW_CFLAGS -O" fi fi GLFW_LFLAGS="$GLFW_LFLAGS -lm" GLFW_LIB_LFLAGS="$GLFW_LIB_LFLAGS -lX11" GLFW_BIN_LFLAGS="-lGLU $GLFW_BIN_LFLAGS" ########################################################################## # Create makefiles and pkg-config template file ########################################################################## # --------------------------------------------------------------------- # Create Makefile for GLFW library # --------------------------------------------------------------------- MKNAME='./lib/x11/Makefile.x11' echo "Creating $MKNAME" 1>&6 echo "$self: Creating $MKNAME" >&5 cat > "$MKNAME" <>$MKNAME # --------------------------------------------------------------------- # Create Makefile for examples # --------------------------------------------------------------------- MKNAME='./examples/Makefile.x11' echo "Creating $MKNAME" 1>&6 echo "$self: Creating $MKNAME" >&5 cat > "$MKNAME" <>$MKNAME # --------------------------------------------------------------------- # Create Makefile for test programs # --------------------------------------------------------------------- MKNAME='./tests/Makefile.x11' echo "Creating $MKNAME" 1>&6 echo "$self: Creating $MKNAME" >&5 cat > "$MKNAME" <>$MKNAME # --------------------------------------------------------------------- # Create pkg-config template file (which is used to create libglfw.pc) # --------------------------------------------------------------------- MKNAME="./lib/x11/libglfw.pc.in" echo "Creating $MKNAME" 1>&6 echo "$self: Creating $MKNAME" >&5 if [ "x$has_xrandr" = xyes ]; then PKG_LIBS="${PKG_LIBS} xrandr" fi if [ "x$has_xf86vm" = xyes ]; then PKG_LIBS="${PKG_LIBS} xxf86vm" fi cat > "$MKNAME" <