debian/0000775000000000000000000000000012261263750007174 5ustar debian/source/0000775000000000000000000000000012145050547010473 5ustar debian/source/format0000664000000000000000000000001412145050100011662 0ustar 3.0 (quilt) debian/copyright0000664000000000000000000002325712145050100011120 0ustar This work was packaged for Debian by: Francois Marier on Wed, 16 Sep 2009 23:25:34 +1200 It was downloaded from: http://code.google.com/p/gource/ Upstream Author: Andrew Caudwell Copyright: Copyright (C) 2009, 2010 Andrew Caudwell License: This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . On Debian systems, the complete text of the GNU General Public License version 3 can be found in `/usr/share/common-licenses/GPL-3'. The Debian packaging is: Copyright (C) 2009, 2010 Francois Marier and is licensed under the GPL version 3 or later, see above. The files under src/core are from the same author but licensed under the revised BSD license: Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. src/ppm.*: Copyright (C) 2009 Johannes Schindelin (johannes.schindelin@gmx.de) Licensed under the GNU General Public License, version 3 or later. src/tinyxml/: Copyright: 2000-2007, Lee Thomason 2002-2004, Yves Berquin 2005, Tyge Lovset 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. data/fonts/FreeSans.ttf: Copyright (C) 2002 Free Software Foundation. Primoz Peterlin Licensed under the GNU General Public License, version 2 or later. src/core/utf8/: Copyright (C) 2006 Nemanja Trifunovic Permission is hereby granted, free of charge, to any person or organization obtaining a copy of the software and accompanying documentation covered by this license (the "Software") to use, reproduce, display, distribute, execute, and transmit the Software, and to prepare derivative works of the Software, and to permit third-parties to whom the Software is furnished to do so, all subject to the following: The copyright notices in the Software and this entire statement, including the above license grant, this restriction and the following disclaimer, must be included in all copies of the Software, in whole or in part, and all derivative works of the Software, unless such copies or derivative works are solely in the form of machine-executable object code generated by a source language processor. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. src/core/fxfont.cpp: Copyright (c) 2009 Andrew Caudwell (acaudwell@gmail.com) All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Portions of this code are derivived from FTGL (FTTextureFont.cpp) FTGL - OpenGL font library Copyright (c) 2001-2004 Henry Maddocks Copyright (c) 2008 Sam Hocevar Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. src/core/ftgl/FTUnicode.h: Copyright (c) 2008 Daniel Remenak Portions derived from ConvertUTF.c Copyright (C) 2001-2004 Unicode, Inc Unicode, Inc. hereby grants the right to freely use the information supplied in this file in the creation of products supporting the Unicode Standard, and to make copies of this file in any form for internal or external distribution as long as this notice remains attached. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. debian/changelog0000664000000000000000000001341412261263750011051 0ustar gource (0.40-1ubuntu4) trusty; urgency=medium * No change rebuild against glew 1.10. -- Dimitri John Ledkov Thu, 02 Jan 2014 13:21:44 +0000 gource (0.40-1ubuntu3) trusty; urgency=low * Specify multiarch boost lib location. * Upload gl detection autoconf macros. * Fix glm.hpp autoconf check. -- Dmitrijs Ledkovs Sun, 27 Oct 2013 01:17:59 +0000 gource (0.40-1ubuntu2) trusty; urgency=low * No change rebuild for Boost 1.54 transition. -- Dmitrijs Ledkovs Tue, 22 Oct 2013 18:08:38 +0100 gource (0.40-1ubuntu1) saucy; urgency=low * Merge from Debian unstable. Remaining changes: - Change build dependency to libglew-dev to make sure we're building with libglew1.8. -- Logan Rosen Wed, 15 May 2013 23:21:56 -0400 gource (0.40-1) unstable; urgency=low * New upstream release. * Added dpkg-buildflags. -- Andrew Caudwell Mon, 13 May 2013 09:58:33 +1200 gource (0.39-1) unstable; urgency=low * New upstream release. -- Andrew Caudwell Fri, 11 Jan 2013 12:28:21 +1300 gource (0.38-1ubuntu2) quantal; urgency=low * No change rebuild with the new glew -- Sebastien Bacher Fri, 10 Aug 2012 17:13:18 +0200 gource (0.38-1ubuntu1) quantal; urgency=low * Change build dependency to libglew-dev to make sure we're building with libglew1.7. -- Ilya Barygin Mon, 28 May 2012 23:05:26 +0400 gource (0.38-1build1) quantal; urgency=low * No-change rebuild for libglew1.6 -> libglew1.7 transition. -- Ilya Barygin Sun, 27 May 2012 19:50:02 +0400 gource (0.38-1) unstable; urgency=low * New upstream release (closes: #667189) * New build dependencies on libglm-dev and libboost-filesystem-dev. -- Andrew Caudwell Tue, 24 Apr 2012 11:25:45 +1200 gource (0.37-2) unstable; urgency=low * No source changes, rebuild using libglew1.6-dev (closes: #643001) -- Francois Marier Tue, 27 Sep 2011 12:59:24 +1300 gource (0.37-1) unstable; urgency=low * New upstream release. * Fixed libglew-dev dependency. -- Andrew Caudwell Thu, 22 Sep 2011 15:51:29 +1200 gource (0.35-1) unstable; urgency=low * New upstream release -- Andrew Caudwell Mon, 04 Jul 2011 10:46:01 +1200 gource (0.34-1) unstable; urgency=low * New upstream release * Changed build dependency from FTGL to Freetype 2 * Updated debian/copyright * Bump Standards-Version to 3.9.2 -- Andrew Caudwell Mon, 16 May 2011 11:30:00 +1200 gource (0.32-1) unstable; urgency=low * New upstream release. -- Andrew Caudwell Thu, 03 Mar 2011 12:55:31 +1300 gource (0.31-1) unstable; urgency=low * New upstream release. * Updated debian/copyright with license for TinyXML. * Added --with-tinyxml configure option to use TinyXML system library. -- Andrew Caudwell Thu, 17 Feb 2011 16:29:29 +1300 gource (0.28-1) unstable; urgency=low [ Andrew Caudwell ] * New upstream release (LP: #570280) [ Francois Marier ] * Bump debhelper compatibility to 8 -- Francois Marier Wed, 22 Dec 2010 14:38:23 +1300 gource (0.27-1) unstable; urgency=low [ Andrew Caudwell ] * New upstream release * Added libglew1.5-dev to build dependencies [ Francois Marier ] * Fix watch file due to change on the Google Code site (see #581622) * Bump Standards-Version to 3.9.1 * Remove reference to deprecated BSD license in debian/copyright -- Francois Marier Tue, 27 Jul 2010 15:18:08 +1200 gource (0.26-2) unstable; urgency=high * Use mkstemp to create temp file (Closes: #577958) -- Andrew Caudwell Fri, 16 Apr 2010 11:29:10 +1200 gource (0.26-1) unstable; urgency=low * New upstream release -- Andrew Caudwell Wed, 10 Mar 2010 14:40:14 +1300 gource (0.24-2) unstable; urgency=low * Bump Standards-Version to 3.8.4 * Switch to 3.0 (quilt) source package format -- Francois Marier Tue, 02 Feb 2010 13:32:27 +1300 gource (0.24-1) unstable; urgency=low * New upstream release -- Andrew Caudwell Tue, 02 Feb 2010 11:45:17 +1300 gource (0.23-1) unstable; urgency=low * New upstream release -- Andrew Caudwell Tue, 22 Dec 2009 15:52:31 +1300 gource (0.22-1) unstable; urgency=low * New upstream release -- Andrew Caudwell Sun, 13 Dec 2009 08:57:02 +1300 gource (0.21-1) unstable; urgency=low * New upstream release -- Andrew Caudwell Sat, 12 Dec 2009 16:13:11 +1300 gource (0.20-1) unstable; urgency=low * New upstream release -- Andrew Caudwell Sat, 12 Dec 2009 15:47:07 +1300 gource (0.17-1) unstable; urgency=low * New upstream release -- Andrew Caudwell Wed, 25 Nov 2009 15:41:13 +1300 gource (0.16-1) unstable; urgency=low * New upstream release -- Andrew Caudwell Mon, 16 Nov 2009 10:36:06 +1300 gource (0.15-2) unstable; urgency=low * Added pkg-config build dependency (Closes: #552051) -- Andrew Caudwell Fri, 23 Oct 2009 15:06:31 +1300 gource (0.15-1) unstable; urgency=low * New upstream release * Link to cvs-exp homepage (Closes: #548318) -- Andrew Caudwell Wed, 21 Oct 2009 16:11:26 +1300 gource (0.14-1) unstable; urgency=low * New upstream release -- Francois Marier Thu, 24 Sep 2009 22:29:15 +1200 gource (0.12-1) unstable; urgency=low * Initial release (Closes: #547274) -- Francois Marier Tue, 22 Sep 2009 21:49:22 +1200 debian/control0000664000000000000000000000210612233063252010570 0ustar Source: gource Section: vcs Priority: extra Maintainer: Ubuntu Developers XSBC-Original-Maintainer: Andrew Caudwell Uploaders: Francois Marier Build-Depends: debhelper (>= 8), dh-autoreconf, autotools-dev, libsdl1.2-dev, libsdl-image1.2-dev, libpcre3-dev, libfreetype6-dev, libglew-dev, libglm-dev, libboost-filesystem-dev, libtinyxml-dev, pkg-config Standards-Version: 3.9.3 Homepage: http://code.google.com/p/gource/ Vcs-Git: git://git.debian.org/git/collab-maint/gource.git Vcs-Browser: http://git.debian.org/?p=collab-maint/gource.git;a=summary Package: gource Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, ttf-freefont Description: graphical source control visualisation OpenGL-based 3D visualisation tool for source control repositories. . The repository is displayed as a tree where the root of the repository is the centre, directories are branches and files are leaves. Contributors to the source code appear and disappear as they contribute to specific files and directories. debian/rules0000775000000000000000000000151012233063371010245 0ustar #!/usr/bin/make -f # -*- makefile -*- # Sample debian/rules that uses debhelper. # This file was originally written by Joey Hess and Craig Small. # As a special exception, when this file is copied by dh-make into a # dh-make output file, you may use that output file without restriction. # This special exception was added by Craig Small in version 0.37 of dh-make. # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 include /usr/share/dpkg/default.mk %: dh $@ --with autoreconf override_dh_auto_configure: dh_auto_configure -- \ --with-boost-libdir=/usr/lib/$(DEB_HOST_MULTIARCH) \ --with-tinyxml \ --enable-ttf-font-dir=/usr/share/fonts/truetype/freefont \ $(shell dpkg-buildflags --export=configure) override_dh_install: rm -rf $(CURDIR)/debian/gource/usr/share/gource/fonts/ debian/watch0000664000000000000000000000037512145050100010212 0ustar version=3 opts=downloadurlmangle=s#.*(gource-([\d.]+)\.tar\.gz).*#http://gource.googlecode.com/files/$1#,filenamemangle=s#.*(gource-([\d.]+)\.tar\.gz).*#$1# \ http://code.google.com/p/gource/downloads/list ^.*detail\?name=gource-([\d.]+)\.tar\.gz.* debian/patches/0000775000000000000000000000000012233064700010614 5ustar debian/patches/update-ax-gl.patch0000664000000000000000000015063612233063311014135 0ustar Description: update ax_check_gl*.m4 macros Author: Dmitrijs Ledkovs --- gource-0.40.orig/m4/ax_check_glut.m4 +++ gource-0.40/m4/ax_check_glut.m4 @@ -1,50 +1,100 @@ -# -*- mode: autoconf -*- -# -# AX_CHECK_GLUT -# -# Check for GLUT. If GLUT is found, the required compiler and linker flags -# are included in the output variables "GLUT_CFLAGS" and "GLUT_LIBS", -# respectively. If GLUT is not found, "no_glut" is set to "yes". -# -# If the header "GL/glut.h" is found, "HAVE_GL_GLUT_H" is defined. If the -# header "GLUT/glut.h" is found, HAVE_GLUT_GLUT_H is defined. These -# preprocessor definitions may not be mutually exclusive. -# -# version: 2.2 -# author: Braden McDaniel -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -# 02110-1301, USA. -# -# As a special exception, the you may copy, distribute and modify the -# configure scripts that are the output of Autoconf when processing -# the Macro. You need not follow the terms of the GNU General Public -# License when using or distributing such scripts. -# -AC_DEFUN([AX_CHECK_GLUT], -[AC_REQUIRE([AX_CHECK_GLU])dnl -AC_REQUIRE([AC_PATH_XTRA])dnl +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_check_glut.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_CHECK_GLUT +# +# DESCRIPTION +# +# Check for GLUT. If GLUT is found, the required compiler and linker flags +# are included in the output variables "GLUT_CFLAGS" and "GLUT_LIBS", +# respectively. If GLUT is not found, "no_glut" is set to "yes". +# +# If the header "GL/glut.h" is found, "HAVE_GL_GLUT_H" is defined. If the +# header "GLUT/glut.h" is found, HAVE_GLUT_GLUT_H is defined. These +# preprocessor definitions may not be mutually exclusive. +# +# You should use something like this in your headers: +# +# # if HAVE_WINDOWS_H && defined(_WIN32) +# # include +# # endif +# # if defined(HAVE_GL_GLUT_H) +# # include +# # elif defined(HAVE_GLUT_GLUT_H) +# # include +# # else +# # error no glut.h +# # endif +# +# LICENSE +# +# Copyright (c) 2009 Braden McDaniel +# Copyright (c) 2013 Bastien Roucaries +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation; either version 2 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see . +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. -ax_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$GLU_CFLAGS $CPPFLAGS" -AC_CHECK_HEADERS([GL/glut.h GLUT/glut.h]) -CPPFLAGS=$ax_save_CPPFLAGS +#serial 13 -GLUT_CFLAGS=$GLU_CFLAGS +dnl local save flags +AC_DEFUN([_AX_CHECK_GLUT_SAVE_FLAGS], +[dnl +ax_check_glut_saved_libs="${LIBS}" +ax_check_glut_saved_cflags="${CFLAGS}" +ax_check_glut_saved_cppflags="${CPPFLAGS}" +ax_check_glut_saved_ldflags="${LDFLAGS}" +]) -m4_define([AX_CHECK_GLUT_PROGRAM], + +dnl local restore flags +AC_DEFUN([_AX_CHECK_GLUT_RESTORE_FLAGS], +[dnl +LIBS="${ax_check_glut_saved_libs}" +CFLAGS="${ax_check_glut_saved_cflags}" +CPPFLAGS="${ax_check_glut_saved_cppflags}" +LDFLAGS="${ax_check_glut_saved_ldflags}" +]) + +dnl Default include : add windows.h +dnl see http://www.opengl.org/wiki/Platform_specifics:_Windows +dnl (acceded 20120801) +AC_DEFUN([_AX_CHECK_GLUT_INCLUDES_DEFAULT],dnl +[ + AC_INCLUDES_DEFAULT + [ + # if defined(HAVE_WINDOWS_H) && defined(_WIN32) + # include + # endif + ] +]) + +m4_define([_AX_CHECK_GLUT_PROGRAM], [AC_LANG_PROGRAM([[ # if HAVE_WINDOWS_H && defined(_WIN32) # include @@ -56,45 +106,163 @@ m4_define([AX_CHECK_GLUT_PROGRAM], # else # error no glut.h # endif]], - [[glutMainLoop()]])]) +[[glutMainLoop()]])]) -AC_CACHE_CHECK([for GLUT library], [ax_cv_check_glut_libglut], -[ax_cv_check_glut_libglut=no -# -# If X is present, assume GLUT depends on it. -# -AC_LANG_PUSH(C) -ax_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$GLUT_CFLAGS $CPPFLAGS" -ax_save_LDFLAGS=$LDFLAGS -ax_save_LIBS=$LIBS -LIBS="" -AS_IF([test X$no_x != Xyes], - [ax_check_glut_x_libs="$X_PRE_LIBS -lXmu -lXi $X_EXTRA_LIBS"]) -ax_check_libs="-lglut32 -lglut" -for ax_lib in $ax_check_libs; do - AS_IF([test X$ax_compiler_ms = Xyes], - [ax_try_lib=`echo $ax_lib | $SED -e 's/^-l//' -e 's/$/.lib/'`], - [ax_try_lib=$ax_lib]) - LIBS="$ax_try_lib $GLUT_LIBS $ax_check_glut_x_libs $ax_save_LIBS" - AC_LINK_IFELSE([AX_CHECK_GLUT_PROGRAM], - [ax_cv_check_glut_libglut=$ax_try_lib; break]) -done - -LIBS=$ax_save_LIBS -AS_IF([test "X$ax_cv_check_glut_libglut" = Xno -a X$no_x = Xyes], - [LDFLAGS="$ax_save_LDFLAGS -framework GLUT" - AC_LINK_IFELSE([AX_CHECK_GLUT_PROGRAM], - [ax_cv_check_glut_libglut='-framework GLUT'])]) - -LDFLAGS=$ax_save_LDFLAGS -CPPFLAGS=$ax_save_CPPFLAGS -AC_LANG_POP(C)]) - -AS_IF([test "X$ax_cv_check_glut_libglut" = Xno], - [no_glut=yes; GLUT_CFLAGS=""; GLUT_LIBS=""], - [GLUT_LIBS="$ax_cv_check_glut_libglut"]) - -AC_SUBST([GLUT_CFLAGS]) -AC_SUBST([GLUT_LIBS]) -])dnl + +dnl Check headers manually (default case) +AC_DEFUN([_AX_CHECK_GLUT_HEADERS], +[AC_LANG_PUSH([C]) + _AX_CHECK_GLUT_SAVE_FLAGS() + CFLAGS="${GLUT_CFLAGS} ${CFLAGS}" + # see comment in _AX_CHECK_GL_INCLUDES_DEFAULT + AC_CHECK_HEADERS([windows.h],[],[],[AC_INCLUDES_DEFAULT]) + AC_CHECK_HEADERS([GL/glut.h OpenGL/glut.h], + [ax_check_glut_have_headers="yes";break], + [ax_check_glut_have_headers_headers="no"], + [_AX_CHECK_GLUT_INCLUDES_DEFAULT()]) + # do not try darwin specific OpenGl/gl.h + _AX_CHECK_GLUT_RESTORE_FLAGS() + AC_LANG_POP([C]) +]) + +# dnl try to found library (generic case) +# dnl $1 is set to the library to found +AC_DEFUN([_AX_CHECK_GLUT_MANUAL_LIBS_GENERIC], +[dnl + ax_check_glut_manual_libs_generic_extra_libs="$1" + AS_IF([test "X$ax_check_glut_manual_libs_generic_extra_libs" = "X"], + [AC_MSG_ERROR([AX_CHECK_GLUT_MANUAL_LIBS_GENERIC argument must no be empty])]) + + AC_LANG_PUSH([C]) + _AX_CHECK_GLUT_SAVE_FLAGS() + CFLAGS="${GLUT_CFLAGS} ${CFLAGS}" + LIBS="${GLUT_LIBS} ${LIBS}" + AC_SEARCH_LIBS([glutMainLoop],[$ax_check_glut_manual_libs_generic_extra_libs], + [ax_check_glut_lib_opengl="yes"], + [ax_check_glut_lib_opengl="no"]) + AS_CASE([$ac_cv_search_glutMainLoop], + ["none required"],[], + [no],[], + [GLUT_LIBS="${ac_cv_search_glutMainLoop} ${GLU_LIBS}"]) + _AX_CHECK_GLUT_RESTORE_FLAGS() + AC_LANG_PUSH([C]) +]) + + +dnl Check library manually: subroutine must set +dnl $ax_check_glut_lib_opengl={yes,no} +dnl for windows part see +dnl - http://www.transmissionzero.co.uk/computing/using-glut-with-mingw/ +dnl - http://user.xmission.com/~nate/glut.html +AC_DEFUN([_AX_CHECK_GLUT_MANUAL_LIBS], +[AC_REQUIRE([AC_CANONICAL_HOST]) + GLUT_LIBS="${GLUT_LIBS} ${GLU_LIBS}" + AS_CASE([${host}], + # try first cygwin version + [*-cygwin*],[_AX_CHECK_GLUT_MANUAL_LIBS_GENERIC([GLUT glut MesaGLUT freeglut freeglut32 glut32])], + # try first native + [*-mingw*],[_AX_CHECK_GLUT_MANUAL_LIBS_GENERIC([glut32 GLUT glut MesaGLUT freeglut freeglut32])], + [_AX_CHECK_GLUT_MANUAL_LIBS_GENERIC([GLUT glut freeglut MesaGLUT])]) + + AC_CACHE_CHECK([for OpenGL Utility Toolkit (GLUT) libraries],[ax_cv_check_glut_lib_opengl], + [ax_cv_check_glut_lib_opengl="${ax_check_glut_lib_opengl}"]) + ax_check_glut_lib_opengl="${ax_cv_check_glut_lib_opengl}" +]) + +# compile the example program +AC_DEFUN([_AX_CHECK_GLUT_COMPILE], +[dnl + AC_LANG_PUSH([C]) + _AX_CHECK_GLUT_SAVE_FLAGS() + CFLAGS="${GLUT_CFLAGS} ${CFLAGS}" + AC_COMPILE_IFELSE([_AX_CHECK_GLUT_PROGRAM], + [ax_check_glut_compile_opengl="yes"], + [ax_check_glut_compile_opengl="no"]) + _AX_CHECK_GLUT_RESTORE_FLAGS() + AC_LANG_POP([C]) +]) + +# compile the example program (cache) +AC_DEFUN([_AX_CHECK_GLUT_COMPILE_CV], +[dnl + AC_CACHE_CHECK([for compiling a minimal OpenGL Utility Toolkit (GLUT) program],[ax_cv_check_glut_compile_opengl], + [_AX_CHECK_GLUT_COMPILE() + ax_cv_check_glut_compile_opengl="${ax_check_glut_compile_opengl}"]) + ax_check_glut_compile_opengl="${ax_cv_check_glut_compile_opengl}" +]) + +# link the example program +AC_DEFUN([_AX_CHECK_GLUT_LINK], +[dnl + AC_LANG_PUSH([C]) + _AX_CHECK_GLUT_SAVE_FLAGS() + CFLAGS="${GLUT_CFLAGS} ${CFLAGS}" + LIBS="${GLUT_LIBS} ${LIBS}" + LDFLAGS="${GLUT_LDFLAGS} ${LDFLAGS}" + AC_LINK_IFELSE([_AX_CHECK_GLUT_PROGRAM], + [ax_check_glut_link_opengl="yes"], + [ax_check_glut_link_opengl="no"]) + _AX_CHECK_GLUT_RESTORE_FLAGS() + AC_LANG_POP([C]) +]) + +# link the example program (cache) +AC_DEFUN([_AX_CHECK_GLUT_LINK_CV], +[dnl + AC_CACHE_CHECK([for linking a minimal OpenGL Utility Toolkit (GLUT) program],[ax_cv_check_glut_link_opengl], + [_AX_CHECK_GLUT_LINK() + ax_cv_check_glut_link_opengl="${ax_check_glut_link_opengl}"]) + ax_check_glut_link_opengl="${ax_cv_check_glut_link_opengl}" +]) + + +# manually check GLUT +AC_DEFUN([_AX_CHECK_GLUT_MANUAL],dnl +[ +GLUT_CFLAGS="${GLUT_CFLAGS} ${GLU_CFLAGS}" +_AX_CHECK_GLUT_HEADERS + +AS_IF([test "X$ax_check_glut_have_headers" = "Xyes"], + [_AX_CHECK_GLUT_MANUAL_LIBS], + [ax_check_glut_lib="no"]) + +AS_IF([test "X$ax_check_glut_lib_opengl" = "Xyes"], + [_AX_CHECK_GLUT_COMPILE_CV()], + [ax_cv_check_glut_compile_opengl="no"]) + +AS_IF([test "X$ax_cv_check_glut_compile_opengl" = "Xyes"], + [_AX_CHECK_GLUT_LINK_CV()], + [ax_cv_check_glut_link_opengl="no"]) + +AS_IF([test "X$ax_cv_check_glut_link_opengl" = "Xyes"], + [no_glut="no"], + [no_glut="yes"]) +]) + + +# main entry point +AC_DEFUN([AX_CHECK_GLUT], +[dnl + AC_REQUIRE([AX_CHECK_GL])dnl + AC_REQUIRE([AX_CHECK_GLU])dnl + + _AX_CHECK_GLUT_MANUAL + + AC_MSG_CHECKING([for a working OpenGL Utility Toolkit (GLUT) implementation]) + AS_IF([test "X$no_glut" = "Xno"], + [AC_MSG_RESULT([yes]) + AC_MSG_CHECKING([for CFLAGS needed for OpenGL Utility Toolkit (GLUT)]) + AC_MSG_RESULT(["${GLUT_CFLAGS}"]) + AC_MSG_CHECKING([for LIBS needed for OpenGL Utility Toolkit (GLUT)]) + AC_MSG_RESULT(["${GLUT_LIBS}"]) + AC_MSG_CHECKING([for LDFLAGS needed for OpenGL Utility Toolkit (GLUT)]) + AC_MSG_RESULT(["${GLUT_LDFLAGS}"])], + [AC_MSG_RESULT([no]) + GLUT_CFLAGS="" + GLUT_LIBS="" + GLUT_LDFLAGS=""]) + + AC_SUBST([GLUT_CFLAGS]) + AC_SUBST([GLUT_LIBS]) + AC_SUBST([GLUT_LDFLAGS]) +]) --- gource-0.40.orig/m4/ax_check_glu.m4 +++ gource-0.40/m4/ax_check_glu.m4 @@ -1,59 +1,187 @@ -# -*- mode: autoconf -*- -# -# AX_CHECK_GLU -# -# Check for GLU. If GLU is found, the required preprocessor and linker flags -# are included in the output variables "GLU_CFLAGS" and "GLU_LIBS", -# respectively. If no GLU implementation is found, "no_glu" is set to "yes". -# -# If the header "GL/glu.h" is found, "HAVE_GL_GLU_H" is defined. If the -# header "OpenGL/glu.h" is found, HAVE_OPENGL_GLU_H is defined. These -# preprocessor definitions may not be mutually exclusive. -# -# Some implementations (in particular, some versions of Mac OS X) are known -# to treat the GLU tesselator callback function type as "GLvoid (*)(...)" -# rather than the standard "GLvoid (*)()". If the former condition is -# detected, this macro defines "HAVE_VARARGS_GLU_TESSCB". -# -# version: 2.4 -# author: Braden McDaniel -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -# 02110-1301, USA. -# -# As a special exception, the you may copy, distribute and modify the -# configure scripts that are the output of Autoconf when processing -# the Macro. You need not follow the terms of the GNU General Public -# License when using or distributing such scripts. -# -AC_DEFUN([AX_CHECK_GLU], -[AC_REQUIRE([AX_CHECK_GL])dnl -AC_REQUIRE([AC_PROG_CXX])dnl -GLU_CFLAGS=$GL_CFLAGS - -ax_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$GL_CFLAGS $CPPFLAGS" -AC_CHECK_HEADERS([GL/glu.h OpenGL/glu.h], , , [ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_check_glu.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_CHECK_GLU +# +# DESCRIPTION +# +# Check for GLU. If GLU is found, the required preprocessor and linker +# flags are included in the output variables "GLU_CFLAGS" and "GLU_LIBS", +# respectively. If no GLU implementation is found, "no_glu" is set to +# "yes". +# +# If the header "GL/glu.h" is found, "HAVE_GL_GLU_H" is defined. If the +# header "OpenGL/glu.h" is found, HAVE_OPENGL_GLU_H is defined. These +# preprocessor definitions may not be mutually exclusive. +# +# You should use something like this in your headers: +# +# # if defined(HAVE_WINDOWS_H) && defined(_WIN32) +# # include +# # endif +# # if defined(HAVE_GL_GLU_H) +# # include +# # elif defined(HAVE_OPENGL_GLU_H) +# # include +# # else +# # error no glu.h +# # endif +# +# Some implementations (in particular, some versions of Mac OS X) are +# known to treat the GLU tesselator callback function type as "GLvoid +# (*)(...)" rather than the standard "GLvoid (*)()". If the former +# condition is detected, this macro defines "HAVE_VARARGS_GLU_TESSCB". +# +# LICENSE +# +# Copyright (c) 2009 Braden McDaniel +# Copyright (c) 2013 Bastien Roucaries +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation; either version 2 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see . +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +#serial 16 + +# exemple program +m4_define([_AX_CHECK_GLU_PROGRAM], + [AC_LANG_PROGRAM([[ # if defined(HAVE_WINDOWS_H) && defined(_WIN32) # include # endif +# ifdef HAVE_GL_GLU_H +# include +# elif defined(HAVE_OPENGL_GLU_H) +# include +# else +# error no glu.h +# endif +]],[[gluBeginCurve(0)]])]) + + +dnl Default include : add windows.h +dnl see http://www.opengl.org/wiki/Platform_specifics:_Windows +dnl (acceded 20120801) +AC_DEFUN([_AX_CHECK_GLU_INCLUDES_DEFAULT],dnl +[ + AC_INCLUDES_DEFAULT + [ + # if defined(HAVE_WINDOWS_H) && defined(_WIN32) + # include + # endif + ] ]) -CPPFLAGS=$ax_save_CPPFLAGS -m4_define([AX_CHECK_GLU_PROGRAM], - [AC_LANG_PROGRAM([[ +dnl local save flags +AC_DEFUN([_AX_CHECK_GLU_SAVE_FLAGS], +[dnl +ax_check_glu_saved_libs="${LIBS}" +ax_check_glu_saved_cflags="${CFLAGS}" +ax_check_glu_saved_cppflags="${CPPFLAGS}" +ax_check_glu_saved_ldflags="${LDFLAGS}" +]) + + +dnl local restore flags +AC_DEFUN([_AX_CHECK_GLU_RESTORE_FLAGS], +[dnl +LIBS="${ax_check_glu_saved_libs}" +CFLAGS="${ax_check_glu_saved_cflags}" +CPPFLAGS="${ax_check_glu_saved_cppflags}" +LDFLAGS="${ax_check_glu_saved_ldflags}" +]) + + +# compile the example program +AC_DEFUN([_AX_CHECK_GLU_COMPILE], +[dnl + AC_LANG_PUSH([C]) + _AX_CHECK_GLU_SAVE_FLAGS() + CFLAGS="${GLU_CFLAGS} ${CFLAGS}" + AC_COMPILE_IFELSE([_AX_CHECK_GLU_PROGRAM], + [ax_check_glu_compile_opengl="yes"], + [ax_check_glu_compile_opengl="no"]) + _AX_CHECK_GLU_RESTORE_FLAGS() + AC_LANG_POP([C]) +]) + +# compile the example program (cache) +AC_DEFUN([_AX_CHECK_GLU_COMPILE_CV], +[dnl + AC_CACHE_CHECK([for compiling a minimal OpenGL Utility (GLU) program],[ax_cv_check_glu_compile_opengl], + [_AX_CHECK_GLU_COMPILE() + ax_cv_check_glu_compile_opengl="${ax_check_glu_compile_opengl}"]) + ax_check_glu_compile_opengl="${ax_cv_check_glu_compile_opengl}" +]) + +# link the example program +AC_DEFUN([_AX_CHECK_GLU_LINK], +[dnl + AC_LANG_PUSH([C]) + _AX_CHECK_GLU_SAVE_FLAGS() + CFLAGS="${GLU_CFLAGS} ${CFLAGS}" + LIBS="${GLU_LIBS} ${LIBS}" + LDFLAGS="${GLU_LDFLAGS} ${LDFLAGS}" + AC_LINK_IFELSE([_AX_CHECK_GLU_PROGRAM], + [ax_check_glu_link_opengl="yes"], + [ax_check_glu_link_opengl="no"]) + _AX_CHECK_GLU_RESTORE_FLAGS() + AC_LANG_POP([C]) +]) + +# link the example program (cache) +AC_DEFUN([_AX_CHECK_GLU_LINK_CV], +[dnl + AC_CACHE_CHECK([for linking a minimal OpenGL Utility (GLU) program],[ax_cv_check_glu_link_opengl], + [_AX_CHECK_GLU_LINK() + ax_cv_check_glu_link_opengl="${ax_check_glu_link_opengl}"]) + ax_check_glu_link_opengl="${ax_cv_check_glu_link_opengl}" +]) + +dnl Check headers manually (default case) +AC_DEFUN([_AX_CHECK_GLU_HEADERS], +[AC_LANG_PUSH([C]) + _AX_CHECK_GLU_SAVE_FLAGS() + CFLAGS="${GLU_CFLAGS} ${CFLAGS}" + # see comment in _AX_CHECK_GL_INCLUDES_DEFAULT + AC_CHECK_HEADERS([windows.h],[],[],[AC_INCLUDES_DEFAULT]) + AC_CHECK_HEADERS([GL/glu.h OpenGL/glu.h], + [ax_check_glu_have_headers="yes";break], + [ax_check_glu_have_headers_headers="no"], + [_AX_CHECK_GLU_INCLUDES_DEFAULT()]) + # do not try darwin specific OpenGl/gl.h + _AX_CHECK_GLU_RESTORE_FLAGS() + AC_LANG_POP([C]) +]) + +# check tesselation callback function signature. +m4_define([_AX_CHECK_GLU_VARARGS_TESSVB_PROGRAM], +[AC_LANG_PROGRAM([[ # if defined(HAVE_WINDOWS_H) && defined(_WIN32) # include # endif @@ -63,79 +191,192 @@ m4_define([AX_CHECK_GLU_PROGRAM], # include # else # error no glu.h -# endif]], - [[gluBeginCurve(0)]])]) +# endif +]], +[[GLvoid (*func)(...); gluTessCallback(0, 0, func)]]) +]) + +# compile the tesselation callback function program +# test with c++ +AC_DEFUN([_AX_CHECK_GLU_COMPILE_VARARGS_TESSVB_PROGRAM], +[AC_REQUIRE([AC_PROG_CXX])dnl + + AC_LANG_PUSH([C++]) + _AX_CHECK_GLU_SAVE_FLAGS() + CFLAGS="${GLU_CFLAGS} ${CFLAGS}" + AC_COMPILE_IFELSE([_AX_CHECK_GLU_VARARGS_TESSVB_PROGRAM], + [ax_check_glu_compile_varargs_tessvb_program="yes"], + [ax_check_glu_compile_varargs_tessvb_program="no"]) + _AX_CHECK_GLU_RESTORE_FLAGS() + AC_LANG_POP([C++]) +]) -AC_CACHE_CHECK([for OpenGL Utility library], [ax_cv_check_glu_libglu], -[ax_cv_check_glu_libglu=no -ax_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$GL_CFLAGS $CPPFLAGS" -ax_save_LDFLAGS=$LDFLAGS -ax_save_LIBS=$LIBS - -# -# First, check for the possibility that everything we need is already in -# GL_LIBS. -# -LDFLAGS="$ax_save_LDFLAGS $GL_LIBS" -# -# libGLU typically links with libstdc++ on POSIX platforms. -# However, setting the language to C++ means that test program -# source is named "conftest.cc"; and Microsoft cl doesn't know what -# to do with such a file. -# -AC_LANG_PUSH([C++]) -AS_IF([test X$ax_compiler_ms = Xyes], - [AC_LANG_PUSH([C])]) -AC_LINK_IFELSE([AX_CHECK_GLU_PROGRAM], - [ax_cv_check_glu_libglu=yes], - [LIBS="" - ax_check_libs="-lglu32 -lGLU" - for ax_lib in ${ax_check_libs}; do - AS_IF([test X$ax_compiler_ms = Xyes], - [ax_try_lib=`echo $ax_lib | $SED -e 's/^-l//' -e 's/$/.lib/'`], - [ax_try_lib=$ax_lib]) - LIBS="$ax_try_lib $ax_save_LIBS" - AC_LINK_IFELSE([AX_CHECK_GLU_PROGRAM], - [ax_cv_check_glu_libglu=$ax_try_lib; break]) - done]) -AS_IF([test X$ax_compiler_ms = Xyes], - [AC_LANG_POP([C])]) -AC_LANG_POP([C++]) - -LIBS=$ax_save_LIBS -LDFLAGS=$ax_save_LDFLAGS -CPPFLAGS=$ax_save_CPPFLAGS]) -AS_IF([test "X$ax_cv_check_glu_libglu" = Xno], - [no_glu=yes; GLU_CFLAGS=""; GLU_LIBS=""], - [AS_IF([test "X$ax_cv_check_glu_libglu" = Xyes], - [GLU_LIBS=""], - [GLU_LIBS="$ax_cv_check_glu_libglu"])]) -AC_SUBST([GLU_CFLAGS]) -AC_SUBST([GLU_LIBS]) # # Some versions of Mac OS X include a broken interpretation of the GLU -# tesselation callback function signature when using the C++ compiler. +# tesselation callback function signature. # -AS_IF([test "X$ax_cv_check_glu_libglu" != Xno], - [AC_CACHE_CHECK([for varargs GLU tesselator callback function type], - [ax_cv_varargs_glu_tesscb], - [AC_LANG_PUSH([C++]) - ax_cv_varargs_glu_tesscb=no - ax_save_CXXFLAGS=$CXXFLAGS - CXXFLAGS="$GL_CFLAGS $CXXFLAGS" - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ -# ifdef HAVE_GL_GLU_H -# include -# else -# include -# endif]], - [[GLvoid (*func)(...); gluTessCallback(0, 0, func)]])], - [ax_cv_varargs_glu_tesscb=yes]) - CXXFLAGS=$ax_save_CXXFLAGS - AC_LANG_POP([C++])]) - AS_IF([test X$ax_cv_varargs_glu_tesscb = Xyes], - [AC_DEFINE([HAVE_VARARGS_GLU_TESSCB], [1], - [Use nonstandard varargs form for the GLU tesselator callback])])]) +AC_DEFUN([_AX_CHECK_GLU_VARARGS_TESSVB], +[ +AC_CACHE_CHECK([for varargs OpenGL Utility (GLU) tesselator callback function type], + [ax_cv_varargs_glu_tesscb], + [_AX_CHECK_GLU_COMPILE_VARARGS_TESSVB_PROGRAM + ax_cv_varargs_glu_tesscb="${ax_check_glu_compile_varargs_tessvb_program}"]) +ax_check_glu_compile_varargs_tessvb_program="${ax_cv_varargs_glu_tesscb}" + +AS_IF([test X$ax_cv_varargs_glu_tesscb = Xyes], + [AC_DEFINE([HAVE_VARARGS_GLU_TESSCB], [1], + [Use nonstandard varargs form for the GLU tesselator callback])]) +]) + + +# dnl try to found library (generic case) +# dnl $1 is set to the library to found +AC_DEFUN([_AX_CHECK_GLU_MANUAL_LIBS_GENERIC], +[dnl + ax_check_glu_manual_libs_generic_extra_libs="$1" + AS_IF([test "X$ax_check_glu_manual_libs_generic_extra_libs" = "X"], + [AC_MSG_ERROR([AX_CHECK_GLU_MANUAL_LIBS_GENERIC argument must no be empty])]) + + AC_LANG_PUSH([C]) + _AX_CHECK_GLU_SAVE_FLAGS() + CFLAGS="${GLU_CFLAGS} ${CFLAGS}" + LIBS="${GLU_LIBS} ${LIBS}" + AC_SEARCH_LIBS([gluBeginCurve],[$ax_check_glu_manual_libs_generic_extra_libs], + [ax_check_glu_lib_opengl="yes"], + [ax_check_glu_lib_opengl="no"]) + AS_CASE([$ac_cv_search_gluBeginCurve], + ["none required"],[], + [no],[], + [GLU_LIBS="${ac_cv_search_gluBeginCurve} ${GLU_LIBS}"]) + _AX_CHECK_GLU_RESTORE_FLAGS() + AC_LANG_PUSH([C]) +]) + + +dnl Check library manually: subroutine must set +dnl $ax_check_gl_lib_opengl={yes,no} +AC_DEFUN([_AX_CHECK_GLU_MANUAL_LIBS], +[AC_REQUIRE([AC_CANONICAL_HOST]) + GLU_LIBS="${GLU_LIBS} ${GL_LIBS}" + AS_CASE([${host}], + # try first cygwin version + [*-cygwin*],[_AX_CHECK_GLU_MANUAL_LIBS_GENERIC([GLU glu MesaGLU glu32])], + # try first native + [*-mingw*],[_AX_CHECK_GLU_MANUAL_LIBS_GENERIC([glu32 GLU glu MesaGLU])], + [_AX_CHECK_GLU_MANUAL_LIBS_GENERIC([GLU glu MesaGLU])]) + + AC_CACHE_CHECK([for OpenGL Utility (GLU) libraries],[ax_cv_check_glu_lib_opengl], + [ax_cv_check_glu_lib_opengl="${ax_check_glu_lib_opengl}"]) + ax_check_glu_lib_opengl="${ax_cv_check_glu_lib_opengl}" +]) + + +dnl Manual way to detect GLU +AC_DEFUN([_AX_CHECK_GLU_MANUAL], +[dnl + +# inherit cflags +GLU_CFLAGS="${GLU_CFLAGS} ${GL_CFLAGS}" + +# check headers +_AX_CHECK_GLU_HEADERS + +AS_IF([test "X$ax_check_glu_have_headers" = "Xyes"], + [_AX_CHECK_GLU_MANUAL_LIBS], + [ax_check_glu_lib_opengl="no"]) + +AS_IF([test "X$ax_check_glu_lib_opengl" = "Xyes"], + [_AX_CHECK_GLU_COMPILE_CV()], + [ax_cv_check_glu_compile_opengl="no"]) + +AS_IF([test "X$ax_cv_check_glu_compile_opengl" = "Xyes"], + [_AX_CHECK_GLU_LINK_CV()], + [ax_cv_check_glu_link_opengl="no"]) + +AS_IF([test "X$ax_cv_check_glu_link_opengl" = "Xyes"], + [no_glu="no"], + [no_glu="yes"]) +]) + +# detect using pkgconfig +AC_DEFUN([_AX_CHECK_GLU_PKG_CONFIG], +[ + AC_REQUIRE([PKG_PROG_PKG_CONFIG]) + + PKG_CHECK_MODULES([GLU],[glu],[ax_check_glu_pkg_config=yes],[ax_check_glu_pkg_config=no]) + + AS_IF([test "X$ax_check_glu_pkg_config" = "Xyes"],[ + # check headers + AC_LANG_PUSH([C]) + _AX_CHECK_GLU_SAVE_FLAGS() + CFLAGS="${GLU_CFLAGS} ${CFLAGS}" + AC_CHECK_HEADERS([windows.h],[],[],[AC_INCLUDES_DEFAULT]) + AC_CHECK_HEADERS([GL/glu.h OpenGL/glu.h], + [ax_check_glu_have_headers="yes";break], + [ax_check_glu_have_headers_headers="no"], + [_AX_CHECK_GLU_INCLUDES_DEFAULT()]) + _AX_CHECK_GL_RESTORE_FLAGS() + AC_LANG_POP([C]) + AC_CACHE_CHECK([for OpenGL Utility (GLU) headers],[ax_cv_check_glu_have_headers], + [ax_cv_check_glu_have_headers="${ax_check_glu_have_headers}"]) + + # pkgconfig library are suposed to work ... + AS_IF([test "X$ax_cv_check_glu_have_headers" = "Xno"], + [AC_MSG_ERROR("Pkgconfig detected OpenGL Utility (GLU) library has no headers!")]) + + _AX_CHECK_GLU_COMPILE_CV() + AS_IF([test "X$ax_cv_check_glu_compile_opengl" = "Xno"], + [AC_MSG_ERROR("Pkgconfig detected OpenGL Utility (GLU) library could not be used for compiling minimal program!")]) + + _AX_CHECK_GLU_LINK_CV() + AS_IF([test "X$ax_cv_check_glu_link_opengl" = "Xno"], + [AC_MSG_ERROR("Pkgconfig detected OpenGL Utility (GLU) library could not be used for linking minimal program!")]) + ]) +]) + +# entry point +AC_DEFUN([AX_CHECK_GLU],dnl +[ + AC_REQUIRE([AX_CHECK_GL]) + AC_REQUIRE([PKG_PROG_PKG_CONFIG]) + + # set flags + no_glu="yes" + + AC_MSG_CHECKING([for a working OpenGL Utility (GLU) implementation by pkg-config]) + # try first pkgconfig + AS_IF([test "X${PKG_CONFIG}" = "X"], + [AC_MSG_RESULT([no]) + ax_check_glu_pkg_config=no], + [AC_MSG_RESULT([yes]) + _AX_CHECK_GLU_PKG_CONFIG()]) + + # if no pkg-config or pkg-config fail try manual way + AS_IF([test "X$ax_check_glu_pkg_config" = "Xno"], + [_AX_CHECK_GLU_MANUAL()], + [no_glu=no]) + + # check broken implementation + AS_IF([test "X$no_glu" = "Xno"], + [_AX_CHECK_GLU_VARARGS_TESSVB],[]) + + AC_MSG_CHECKING([for a working OpenGL Utility (GLU) implementation]) + AS_IF([test "X$no_glu" = "Xno"], + [AC_MSG_RESULT([yes]) + AC_MSG_CHECKING([for CFLAGS needed for OpenGL Utility (GLU)]) + AC_MSG_RESULT(["${GLU_CFLAGS}"]) + AC_MSG_CHECKING([for LIBS needed for OpenGL Utility (GLU)]) + AC_MSG_RESULT(["${GLU_LIBS}"]) + AC_MSG_CHECKING([for LDFLAGS needed for OpenGL Utility (GLU)]) + AC_MSG_RESULT(["${GLU_LDFLAGS}"])], + [AC_MSG_RESULT([no]) + GLU_CFLAGS="" + GLU_LIBS="" + GLU_LDFLAGS=""]) + + AC_SUBST([GLU_CFLAGS]) + AC_SUBST([GLU_LIBS]) + AC_SUBST([GLU_LDFLAGS]) + ]) --- gource-0.40.orig/m4/ax_check_gl.m4 +++ gource-0.40/m4/ax_check_gl.m4 @@ -1,69 +1,78 @@ -# -*- mode: autoconf -*- +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_check_gl.html +# =========================================================================== # -# AX_CHECK_GL +# SYNOPSIS # -# Check for an OpenGL implementation. If GL is found, the required compiler -# and linker flags are included in the output variables "GL_CFLAGS" and -# "GL_LIBS", respectively. If no usable GL implementation is found, "no_gl" -# is set to "yes". -# -# If the header "GL/gl.h" is found, "HAVE_GL_GL_H" is defined. If the header -# "OpenGL/gl.h" is found, HAVE_OPENGL_GL_H is defined. These preprocessor -# definitions may not be mutually exclusive. -# -# version: 2.6 -# author: Braden McDaniel -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -# 02110-1301, USA. -# -# As a special exception, the you may copy, distribute and modify the -# configure scripts that are the output of Autoconf when processing -# the Macro. You need not follow the terms of the GNU General Public -# License when using or distributing such scripts. +# AX_CHECK_GL # -AC_DEFUN([AX_CHECK_GL], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_PATH_X])dnl -AC_REQUIRE([AC_PROG_SED])dnl -AC_REQUIRE([AX_PTHREAD])dnl - -AC_LANG_PUSH([C]) -AX_LANG_COMPILER_MS -AS_IF([test X$ax_compiler_ms = Xno], - [GL_CFLAGS="${PTHREAD_CFLAGS}"; GL_LIBS="${PTHREAD_LIBS}"]) - +# DESCRIPTION +# +# Check for an OpenGL implementation. If GL is found, the required +# compiler and linker flags are included in the output variables +# "GL_CFLAGS", "GL_LIBS", "GL_LDFLAGS", respectively. If no usable GL +# implementation is found, "no_gl" is set to "yes". +# +# You could disable OpenGL using --with-gl=no +# +# You could choose a specific OpenGL libs using --with-gl=lib_name +# +# Under darwin, cygwin and mingw target you could prefer the OpenGL +# implementation that link with X setting --with-gl=x or without X support +# with --with-gl=nox. Notes that this script try to guess the right +# implementation. +# +# If the header "GL/gl.h" is found, "HAVE_GL_GL_H" is defined. If the +# header "OpenGL/gl.h" is found, HAVE_OPENGL_GL_H is defined. These +# preprocessor definitions may not be mutually exclusive. +# +# You should use something like this in your headers: # -# Use x_includes and x_libraries if they have been set (presumably by -# AC_PATH_X). +# #if defined(HAVE_WINDOWS_H) && defined(_WIN32) +# # include +# #endif +# #ifdef HAVE_GL_GL_H +# # include +# #elif defined(HAVE_OPENGL_GL_H) +# # include +# #else +# # error no gl.h +# #endif # -AS_IF([test X$no_x != Xyes -a -n "$x_includes"], - [GL_CFLAGS="-I$x_includes $GL_CFLAGS"]) +# LICENSE +# +# Copyright (c) 2009 Braden McDaniel +# Copyright (c) 2012 Bastien Roucaries +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation; either version 2 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see . +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. -AC_CHECK_HEADERS([windows.h]) +#serial 15 -ax_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$GL_CFLAGS $CPPFLAGS" -AC_CHECK_HEADERS([GL/gl.h OpenGL/gl.h], , , [ -# if defined(HAVE_WINDOWS_H) && defined(_WIN32) -# include -# endif -]) -CPPFLAGS=$ax_save_CPPFLAGS - -m4_define([AX_CHECK_GL_PROGRAM], +m4_define([_AX_CHECK_GL_PROGRAM], [AC_LANG_PROGRAM([[ # if defined(HAVE_WINDOWS_H) && defined(_WIN32) # include @@ -74,82 +83,400 @@ m4_define([AX_CHECK_GL_PROGRAM], # include # else # error no gl.h -# endif]], - [[glBegin(0)]])]) - -m4_define([AX_CHECK_GL_GLX_PROGRAM], - [AC_LANG_PROGRAM([[ -# if defined(HAVE_WINDOWS_H) && defined(_WIN32) -# include # endif -# ifdef HAVE_GL_GL_H -# include -# elif defined(HAVE_OPENGL_GL_H) -# include -# else -# error no gl.h -# endif]], - [[glXQueryVersion(0, 0, 0)]])]) +]],[[glBegin(0)]])]) + +dnl Default include : add windows.h +dnl see http://www.opengl.org/wiki/Platform_specifics:_Windows +dnl (acceded 20120801) +AC_DEFUN([_AX_CHECK_GL_INCLUDES_DEFAULT],dnl +[ + AC_INCLUDES_DEFAULT + [ + # if defined(HAVE_WINDOWS_H) && defined(_WIN32) + # include + # endif + ] +]) + +dnl local save flags +AC_DEFUN([_AX_CHECK_GL_SAVE_FLAGS], +[dnl +ax_check_gl_saved_libs="${LIBS}" +ax_check_gl_saved_cflags="${CFLAGS}" +ax_check_gl_saved_cppflags="${CPPFLAGS}" +ax_check_gl_saved_ldflags="${LDFLAGS}" +]) + +dnl local restore flags +AC_DEFUN([_AX_CHECK_GL_RESTORE_FLAGS], +[dnl +LIBS="${ax_check_gl_saved_libs}" +CFLAGS="${ax_check_gl_saved_cflags}" +CPPFLAGS="${ax_check_gl_saved_cppflags}" +LDFLAGS="${ax_check_gl_saved_ldflags}" +]) -AC_CACHE_CHECK([for OpenGL library], [ax_cv_check_gl_libgl], -[ax_cv_check_gl_libgl=no -case $host_cpu in - x86_64) ax_check_gl_libdir=lib64 ;; - *) ax_check_gl_libdir=lib ;; -esac -ax_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $GL_CFLAGS" -ax_save_LDFLAGS=$LDFLAGS -AS_IF([test X$no_x != Xyes -a -n "$x_libraries"], - [LDFLAGS="$LDFLAGS -L$x_libraries"]) -ax_save_LIBS=$LIBS -ax_check_libs="-lopengl32 -lGL" -for ax_lib in $ax_check_libs; do - AS_IF([test X$ax_compiler_ms = Xyes], - [ax_try_lib=`echo $ax_lib | $SED -e 's/^-l//' -e 's/$/.lib/'`], - [ax_try_lib=$ax_lib]) - LDFLAGS="$ax_save_LDFLAGS $GL_LIBS" - LIBS="$ax_try_lib $ax_save_LIBS" -AC_LINK_IFELSE([AX_CHECK_GL_PROGRAM], - [ax_cv_check_gl_libgl=$ax_try_lib; break], - [ax_check_gl_nvidia_flags="-L/usr/$ax_check_gl_libdir/nvidia" - LDFLAGS="$ax_save_LDFLAGS $GL_LIBS $ax_check_gl_nvidia_flags" - AC_LINK_IFELSE([AX_CHECK_GL_PROGRAM], - [ax_cv_check_gl_libgl="$ax_check_gl_nvidia_flags $ax_try_lib"; break], - [ax_check_gl_dylib_flag='-dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib' - LDFLAGS="$ax_save_LDFLAGS $GL_LIBS $ax_check_gl_dylib_flag" - AC_LINK_IFELSE([AX_CHECK_GL_PROGRAM], - [ax_cv_check_gl_libgl="$ax_check_gl_dylib_flag $ax_try_lib"; break])])]) -done - -# -# If no_x is "yes", we don't want to wind up using a libGL that is -# linked with X11. Test to see if the found libGL includes GLX -# functions. If it does and no_x is "yes", we want to reset -# ax_cv_check_gl_libgl back to "no". -# -# Note that LDFLAGS and LIBS should still have whatever values they -# had when we broke out of the test loop above; use that. -# -AS_IF([test "X$ax_cv_check_gl_libgl" != Xno], - [AC_LINK_IFELSE([AX_CHECK_GL_GLX_PROGRAM], - [AS_IF([test X$no_x = Xyes], - [ax_cv_check_gl_libgl=no])])]) - -LIBS=$ax_save_LIBS -AS_IF([test "X$ax_cv_check_gl_libgl" = Xno -a X$no_x = Xyes], - [LDFLAGS="$ax_save_LDFLAGS -framework OpenGL" - AC_LINK_IFELSE([AX_CHECK_GL_PROGRAM], - [ax_cv_check_gl_libgl='-framework OpenGL'])]) - -LDFLAGS=$ax_save_LDFLAGS -CPPFLAGS=$ax_save_CPPFLAGS]) - -AS_IF([test "X$ax_cv_check_gl_libgl" = Xno], - [no_gl=yes; GL_CFLAGS=""; GL_LIBS=""], - [GL_LIBS="$ax_cv_check_gl_libgl $GL_LIBS"]) -AC_LANG_POP([C]) +# set the varible ax_check_gl_need_x +# this variable determine if we need opengl that link with X +# value are default aka try the first library wether if it link or not with x +# yes that means we need a opengl with x +# no that means we do not need an opengl with x +AC_DEFUN([_AX_CHECK_GL_NEED_X], +[dnl + # do not check if empty : allow a subroutine to modify the choice + AS_IF([test "X$ax_check_gl_need_x" = "X"], + [ax_check_gl_need_x="default" + AS_IF([test "X$no_x" = "Xyes"],[ax_check_gl_need_x="no"]) + AS_IF([test "X$ax_check_gl_want_gl" = "Xnox"],[ax_check_gl_need_x="no"]) + AS_IF([test "X$ax_check_gl_want_gl" = "Xx"],[ax_check_gl_need_x="yes"])]) +]) + +# compile the example program +AC_DEFUN([_AX_CHECK_GL_COMPILE], +[dnl + AC_LANG_PUSH([C]) + _AX_CHECK_GL_SAVE_FLAGS() + CFLAGS="${GL_CFLAGS} ${CFLAGS}" + AC_COMPILE_IFELSE([_AX_CHECK_GL_PROGRAM], + [ax_check_gl_compile_opengl="yes"], + [ax_check_gl_compile_opengl="no"]) + _AX_CHECK_GL_RESTORE_FLAGS() + AC_LANG_POP([C]) +]) + +# compile the example program (cache) +AC_DEFUN([_AX_CHECK_GL_COMPILE_CV], +[dnl + AC_CACHE_CHECK([for compiling a minimal OpenGL program],[ax_cv_check_gl_compile_opengl], + [_AX_CHECK_GL_COMPILE() + ax_cv_check_gl_compile_opengl="${ax_check_gl_compile_opengl}"]) + ax_check_gl_compile_opengl="${ax_cv_check_gl_compile_opengl}" +]) + +# link the example program +AC_DEFUN([_AX_CHECK_GL_LINK], +[dnl + AC_LANG_PUSH([C]) + _AX_CHECK_GL_SAVE_FLAGS() + CFLAGS="${GL_CFLAGS} ${CFLAGS}" + LIBS="${GL_LIBS} ${LIBS}" + LDFLAGS="${GL_LDFLAGS} ${LDFLAGS}" + AC_LINK_IFELSE([_AX_CHECK_GL_PROGRAM], + [ax_check_gl_link_opengl="yes"], + [ax_check_gl_link_opengl="no"]) + _AX_CHECK_GL_RESTORE_FLAGS() + AC_LANG_POP([C]) +]) + +# link the example program (cache) +AC_DEFUN([_AX_CHECK_GL_LINK_CV], +[dnl + AC_CACHE_CHECK([for linking a minimal OpenGL program],[ax_cv_check_gl_link_opengl], + [_AX_CHECK_GL_LINK() + ax_cv_check_gl_link_opengl="${ax_check_gl_link_opengl}"]) + ax_check_gl_link_opengl="${ax_cv_check_gl_link_opengl}" +]) + +dnl Check headers manually (default case) +AC_DEFUN([_AX_CHECK_GL_MANUAL_HEADERS_DEFAULT], +[AC_REQUIRE([AC_PATH_XTRA]) + AC_LANG_PUSH([C]) + _AX_CHECK_GL_SAVE_FLAGS() + CFLAGS="${GL_CFLAGS} ${CFLAGS}" + # see comment in _AX_CHECK_GL_INCLUDES_DEFAULT + AC_CHECK_HEADERS([windows.h],[],[],[AC_INCLUDES_DEFAULT]) + # FIXME: use extra cflags + AC_CHECK_HEADERS([GL/gl.h],[ax_check_gl_have_headers="yes"], + [ax_check_gl_have_headers_headers="no"], + [_AX_CHECK_GL_INCLUDES_DEFAULT()]) + # do not try darwin specific OpenGl/gl.h + _AX_CHECK_GL_RESTORE_FLAGS() + AC_LANG_POP([C]) +]) + +# darwin headers without X +AC_DEFUN([_AX_CHECK_GL_MANUAL_HEADERS_DARWIN_NOX],[ + AC_LANG_PUSH([C]) + _AX_CHECK_GL_SAVE_FLAGS() + # FIXME: use -framework opengl as an extra cflags + CFLAGS="-framework opengl ${GL_CFLAGS} ${CFLAGS}" + AC_CHECK_HEADERS([OpenGL/gl.h],[ax_check_gl_have_headers="yes"], + [ax_check_gl_have_headers_headers="no"], + [_AX_CHECK_GL_INCLUDES_DEFAULT()]) + AS_IF([test "X$ax_check_gl_have_headers" = "yes"], + [GL_CFLAGS="-framework opengl ${GL_CFLAGS}"]) + _AX_CHECK_GL_SAVE_FLAGS() + AC_LANG_POP([C]) +]) + +# check header for darwin +AC_DEFUN([_AX_CHECK_GL_MANUAL_HEADERS_DARWIN], +[AC_REQUIRE([_AX_CHECK_GL_NEED_X])dnl + AS_CASE([$ax_check_gl_need_x], + # try to get X libs if possible do not use framework + [yes],[_AX_CHECK_GL_MANUAL_HEADERS_DEFAULT()] + [no],[_AX_CHECK_GL_MANUAL_HEADERS_DARWIN_NOX()] + # per default use framework that will select if possible no_x version + [_AX_CHECK_GL_MANUAL_HEADERS_DARWIN_NOX() + # if not found set that we need x in order to found the good library + AS_IF([test "X$ax_check_gl_have_headers" = "yes"], + [ax_check_gl_need_x="no"], + [ax_check_gl_need_x="yes" + # retry with general test + _AX_CHECK_GL_MANUAL_HEADERS_DEFAULT()]) + ]) +]) + +dnl Check headers manually: subroutine must set ax_check_gl_have_headers={yes,no} +AC_DEFUN([_AX_CHECK_GL_MANUAL_HEADERS], +[AC_REQUIRE([AC_CANONICAL_HOST]) + AS_CASE([${host}], + [*-darwin*],[_AX_CHECK_GL_MANUAL_HEADERS_DARWIN], + [_AX_CHECK_GL_MANUAL_HEADERS_DEFAULT()]) + AC_CACHE_CHECK([for OpenGL headers],[ax_cv_check_gl_have_headers], + [ax_cv_check_gl_have_headers="${ax_check_gl_have_headers}"]) +]) + +# dnl try to found library (generic case) +# dnl $1 is set to the library to found +AC_DEFUN([_AX_CHECK_GL_MANUAL_LIBS_GENERIC], +[dnl + ax_check_gl_manual_libs_generic_extra_libs="$1" + AS_IF([test "X$ax_check_gl_manual_libs_generic_extra_libs" = "X"], + [AC_MSG_ERROR([AX_CHECK_GL_MANUAL_LIBS_GENERIC argument must no be empty])]) + + AC_LANG_PUSH([C]) + _AX_CHECK_GL_SAVE_FLAGS() + CFLAGS="${GL_CFLAGS} ${CFLAGS}" + LIBS="${GL_LIBS} ${LIBS}" + AC_SEARCH_LIBS([glBegin],[$ax_check_gl_manual_libs_generic_extra_libs], + [ax_check_gl_lib_opengl="yes"], + [ax_check_gl_lib_opengl="no"]) + AS_CASE([$ac_cv_search_glBegin], + ["none required"],[], + [no],[], + [GL_LIBS="${ac_cv_search_glBegin} ${GL_LIBS}"]) + _AX_CHECK_GL_RESTORE_FLAGS() + AC_LANG_PUSH([C]) +]) -AC_SUBST([GL_CFLAGS]) -AC_SUBST([GL_LIBS]) +# dnl try to found lib under darwin +# darwin opengl hack +# see http://web.archive.org/web/20090410052741/http://developer.apple.com/qa/qa2007/qa1567.html +# and http://web.eecs.umich.edu/~sugih/courses/eecs487/glut-howto/ +AC_DEFUN([_AX_CHECK_GL_MANUAL_LIBS_DARWIN], +[# ldhack list + ldhack1 = "-Wl,-framework,OpenGL" + ldhack2 = "-Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib" + ldhack3 = "$ldhack1,$ldhack2" + + # select hack + AS_IF([test "X$ax_check_gl_need_x" = "Xyes"], + [# libs already set by -framework cflag + darwinlibs="" + ldhacks="$ldhack1 $ldhack2 $ldhack3"], + [# do not use framework ldflags in case of x version + darwinlibs="GL gl MesaGL" + ldhack="$ldhack2"]) + + ax_check_gl_link_opengl="no" + for extralibs in " " $darwinlibs; do + for extraldflags in " " ldhacks; do + AC_LANG_PUSH([C]) + _AX_CHECK_GL_SAVE_FLAGS() + CFLAGS="${GL_CFLAGS} ${CFLAGS}" + LIBS="$extralibs ${GL_LIBS} ${LIBS}" + LDFLAGS="$extraldflags ${GL_LDFLAGS} ${LDFLAGS}" + AC_LINK_IFELSE([_AX_CHECK_GL_PROGRAM], + [ax_check_gl_link_opengl="yes"], + [ax_check_gl_link_opengl="no"]) + _AX_CHECK_GL_RESTORE_FLAGS() + AC_LANG_POP([C]) + AS_IF([test "X$ax_check_gl_link_opengl" = "Xyes"],[break]) + done; + AS_IF([test "X$ax_check_gl_link_opengl" = "Xyes"],[break]) + done; + GL_LIBS="$extralibs ${GL_LIBS}" + GL_LDFLAGS="$extraldflags ${GL_LDFLAGS}" +]) + +dnl Check library manually: subroutine must set +dnl $ax_check_gl_lib_opengl={yes,no} +AC_DEFUN([_AX_CHECK_GL_MANUAL_LIBS], +[AC_REQUIRE([AC_CANONICAL_HOST]) + AS_CASE([${host}], + [*-darwin*],[_AX_CHECK_GL_MANUAL_LIBS_DARWIN()], + # try first cygwin version + [*-cygwin*],[_AX_CHECK_GL_MANUAL_LIBS_GENERIC([GL gl MesaGL opengl32])], + # try first native + [*-mingw*],[_AX_CHECK_GL_MANUAL_LIBS_GENERIC([opengl32 GL gl MesaGL])], + [_AX_CHECK_GL_MANUAL_LIBS_GENERIC([GL gl MesaGL])]) + + AC_CACHE_CHECK([for OpenGL libraries],[ax_cv_check_gl_lib_opengl], + [ax_cv_check_gl_lib_opengl="${ax_check_gl_lib_opengl}"]) + ax_check_gl_lib_opengl="${ax_cv_check_gl_lib_opengl}" +]) + +# manually check aka old way +AC_DEFUN([_AX_CHECK_GL_MANUAL], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl + AC_REQUIRE([AC_PATH_XTRA])dnl + + no_gl="yes" + + _AX_CHECK_GL_MANUAL_HEADERS() + AS_IF([test "X$ax_check_gl_have_headers" = "Xyes"], + [_AX_CHECK_GL_COMPILE_CV()], + [ax_check_gl_compile_opengl=no]) + + AS_IF([test "X$ax_check_gl_compile_opengl" = "Xyes"], + [_AX_CHECK_GL_MANUAL_LIBS], + [ax_check_gl_lib_opengl=no]) + + AS_IF([test "X$ax_check_gl_lib_opengl" = "Xyes"], + [_AX_CHECK_GL_LINK_CV()], + [ax_check_gl_link_opengl=no]) + + AS_IF([test "X$ax_check_gl_link_opengl" = "Xyes"], + [no_gl="no"], + [no_gl="yes"]) ])dnl + + +# try to test using pkgconfig: set ax_check_gl_pkg_config=no if not found +AC_DEFUN([_AX_CHECK_GL_PKG_CONFIG],dnl +[dnl + AC_REQUIRE([PKG_PROG_PKG_CONFIG]) + + PKG_CHECK_MODULES([GL],[gl],[ax_check_gl_pkg_config=yes],[ax_check_gl_pkg_config=no]) + AS_IF([test "X$ax_check_gl_pkg_config" = "Xyes"],[ + # check headers + AC_LANG_PUSH([C]) + _AX_CHECK_GL_SAVE_FLAGS() + CFLAGS="${GL_CFLAGS} ${CFLAGS}" + AC_CHECK_HEADERS([windows.h],[],[],[AC_INCLUDES_DEFAULT]) + AC_CHECK_HEADERS([GL/gl.h OpenGL/gl.h], + [ax_check_gl_have_headers="yes";break], + [ax_check_gl_have_headers_headers="no"], + [_AX_CHECK_GL_INCLUDES_DEFAULT()]) + _AX_CHECK_GL_RESTORE_FLAGS() + AC_LANG_POP([C]) + AC_CACHE_CHECK([for OpenGL headers],[ax_cv_check_gl_have_headers], + [ax_cv_check_gl_have_headers="${ax_check_gl_have_headers}"]) + + # pkgconfig library are suposed to work ... + AS_IF([test "X$ax_cv_check_gl_have_headers" = "Xno"], + [AC_MSG_ERROR("Pkgconfig detected OpenGL library has no headers!")]) + + _AX_CHECK_GL_COMPILE_CV() + AS_IF([test "X$ax_cv_check_gl_compile_opengl" = "Xno"], + [AC_MSG_ERROR("Pkgconfig detected opengl library could not be used for compiling minimal program!")]) + + _AX_CHECK_GL_LINK_CV() + AS_IF([test "X$ax_cv_check_gl_link_opengl" = "Xno"], + [AC_MSG_ERROR("Pkgconfig detected opengl library could not be used for linking minimal program!")]) + ]) +]) + +# test if gl link with X +AC_DEFUN([_AX_CHECK_GL_WITH_X], +[ + # try if opengl need X + AC_LANG_PUSH([C]) + _AX_CHECK_GL_SAVE_FLAGS() + CFLAGS="${GL_CFLAGS} ${CFLAGS}" + LIBS="${GL_LIBS} ${LIBS}" + LDFLAGS="${GL_LDFLAGS} ${LDFLAGS}" + AC_LINK_IFELSE([AC_LANG_CALL([], [glXQueryVersion])], + [ax_check_gl_link_implicitly_with_x="yes"], + [ax_check_gl_link_implicitly_with_x="no"]) + _AX_CHECK_GL_RESTORE_FLAGS() + AC_LANG_POP([C]) +]) + +# internal routine: entry point if gl not disable +AC_DEFUN([_AX_CHECK_GL],[dnl + AC_REQUIRE([PKG_PROG_PKG_CONFIG]) + AC_REQUIRE([AC_PATH_X])dnl + + # does we need X or not + _AX_CHECK_GL_NEED_X() + + # try first pkgconfig + AC_MSG_CHECKING([for a working OpenGL implementation by pkg-config]) + AS_IF([test "X${PKG_CONFIG}" = "X"], + [ AC_MSG_RESULT([no]) + ax_check_gl_pkg_config=no], + [ AC_MSG_RESULT([yes]) + _AX_CHECK_GL_PKG_CONFIG()]) + + # if no pkgconfig or pkgconfig fail try manual way + AS_IF([test "X$ax_check_gl_pkg_config" = "Xno"], + [_AX_CHECK_GL_MANUAL()], + [no_gl=no]) + + + # test if need to test X compatibility + AS_IF([test $no_gl = no], + [# test X compatibility + AS_IF([test X$ax_check_gl_need_x != "Xdefault"], + [AC_CACHE_CHECK([wether OpenGL link implictly with X],[ax_cv_check_gl_link_with_x], + [_AX_CHECK_GL_WITH_X() + ax_cv_check_gl_link_with_x="${ax_check_gl_link_implicitly_with_x}"]) + AS_IF([test "X${ax_cv_check_gl_link_with_x}" = "X${ax_check_gl_need_x}"], + [no_gl="no"], + [no_gl=yes])]) + ]) +]) + +# ax_check_gl entry point +AC_DEFUN([AX_CHECK_GL], +[AC_REQUIRE([AC_PATH_X])dnl + + AC_ARG_WITH([gl], + [AS_HELP_STRING([--with-gl@<:@=ARG@:>@], + [use opengl (ARG=yes), + using the specific lib (ARG=), + using the OpenGL lib that link with X (ARG=x), + using the OpenGL lib that link without X (ARG=nox), + or disable it (ARG=no) + @<:@ARG=yes@:>@ ])], + [ + AS_CASE(["$withval"], + ["no"|"NO"],[ax_check_gl_want_gl="no"], + ["yes"|"YES"],[ax_check_gl_want_gl="yes"], + [ax_check_gl_want_gl="$withval"]) + ], + [ax_check_gl_want_gl="yes"]) + + # check consistency of parameters + AS_IF([test "X$have_x" = "Xdisabled"], + [AS_IF([test X$ax_check_gl_want_gl = "Xx"], + [AC_MSG_ERROR([You prefer OpenGL with X and asked for no X support])])]) + + # set flags + no_gl="yes" + + # now do the real testing + AS_IF([test X$ax_check_gl_want_gl != "Xno"], + [_AX_CHECK_GL()]) + + AC_MSG_CHECKING([for a working OpenGL implementation]) + AS_IF([test "X$no_gl" = "Xno"], + [AC_MSG_RESULT([yes]) + AC_MSG_CHECKING([for CFLAGS needed for OpenGL]) + AC_MSG_RESULT(["${GL_CFLAGS}"]) + AC_MSG_CHECKING([for LIBS needed for OpenGL]) + AC_MSG_RESULT(["${GL_LIBS}"]) + AC_MSG_CHECKING([for LDFLAGS needed for OpenGL]) + AC_MSG_RESULT(["${GL_LDFLAGS}"])], + [AC_MSG_RESULT([no]) + GL_CFLAGS="" + GL_LIBS="" + GL_LDFLAGS=""]) + + AC_SUBST([GL_CFLAGS]) + AC_SUBST([GL_LIBS]) + AC_SUBST([GL_LDFLAGS]) +]) debian/patches/correct-autoconf.patch0000664000000000000000000000113512233064700015112 0ustar Description: fix failing glm check. Author: Dmitrijs Ledkovs --- gource-0.40.orig/configure.ac +++ gource-0.40/configure.ac @@ -52,7 +52,9 @@ CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" LIBS="$LIBS $BOOST_SYSTEM_LIB $BOOST_FILESYSTEM_LIB" #GLM +AC_LANG_PUSH([C++]) AC_CHECK_HEADER([glm/glm.hpp],, AC_MSG_ERROR(GLM headers are required. Please see INSTALL)) +AC_LANG_POP([C++]) #see if ttf-font-dir option is enabled AC_ARG_ENABLE(ttf-font-dir,[AS_HELP_STRING([--enable-ttf-font-dir=DIR],[directory containing GNU FreeFont TTF fonts])],[gourcefontdir="$enableval"],[gourcefontdir=""]) debian/patches/series0000664000000000000000000000005212233064663012036 0ustar update-ax-gl.patch correct-autoconf.patch debian/docs0000664000000000000000000000000712145050100010024 0ustar README debian/compat0000664000000000000000000000000212145050100010352 0ustar 8