source: m4/ax_check_glu.m4@ 715085

Action_Thermostats Add_AtomRandomPerturbation Add_FitFragmentPartialChargesAction Add_RotateAroundBondAction Add_SelectAtomByNameAction Added_ParseSaveFragmentResults AddingActions_SaveParseParticleParameters Adding_Graph_to_ChangeBondActions Adding_MD_integration_tests Adding_ParticleName_to_Atom Adding_StructOpt_integration_tests AtomFragments Automaking_mpqc_open AutomationFragmentation_failures Candidate_v1.5.4 Candidate_v1.6.0 Candidate_v1.6.1 ChangeBugEmailaddress ChangingTestPorts ChemicalSpaceEvaluator CombiningParticlePotentialParsing Combining_Subpackages Debian_Package_split Debian_package_split_molecuildergui_only Disabling_MemDebug Docu_Python_wait EmpiricalPotential_contain_HomologyGraph EmpiricalPotential_contain_HomologyGraph_documentation Enable_parallel_make_install Enhance_userguide Enhanced_StructuralOptimization Enhanced_StructuralOptimization_continued Example_ManyWaysToTranslateAtom Exclude_Hydrogens_annealWithBondGraph FitPartialCharges_GlobalError Fix_BoundInBox_CenterInBox_MoleculeActions Fix_ChargeSampling_PBC Fix_ChronosMutex Fix_FitPartialCharges Fix_FitPotential_needs_atomicnumbers Fix_ForceAnnealing Fix_IndependentFragmentGrids Fix_ParseParticles Fix_ParseParticles_split_forward_backward_Actions Fix_PopActions Fix_QtFragmentList_sorted_selection Fix_Restrictedkeyset_FragmentMolecule Fix_StatusMsg Fix_StepWorldTime_single_argument Fix_Verbose_Codepatterns Fix_fitting_potentials Fixes ForceAnnealing_goodresults ForceAnnealing_oldresults ForceAnnealing_tocheck ForceAnnealing_with_BondGraph ForceAnnealing_with_BondGraph_continued ForceAnnealing_with_BondGraph_continued_betteresults ForceAnnealing_with_BondGraph_contraction-expansion FragmentAction_writes_AtomFragments FragmentMolecule_checks_bonddegrees GeometryObjects Gui_Fixes Gui_displays_atomic_force_velocity ImplicitCharges IndependentFragmentGrids IndependentFragmentGrids_IndividualZeroInstances IndependentFragmentGrids_IntegrationTest IndependentFragmentGrids_Sole_NN_Calculation JobMarket_RobustOnKillsSegFaults JobMarket_StableWorkerPool JobMarket_unresolvable_hostname_fix MoreRobust_FragmentAutomation ODR_violation_mpqc_open PartialCharges_OrthogonalSummation PdbParser_setsAtomName PythonUI_with_named_parameters QtGui_reactivate_TimeChanged_changes Recreated_GuiChecks Rewrite_FitPartialCharges RotateToPrincipalAxisSystem_UndoRedo SaturateAtoms_findBestMatching SaturateAtoms_singleDegree StoppableMakroAction Subpackage_CodePatterns Subpackage_JobMarket Subpackage_LinearAlgebra Subpackage_levmar Subpackage_mpqc_open Subpackage_vmg Switchable_LogView ThirdParty_MPQC_rebuilt_buildsystem TrajectoryDependenant_MaxOrder TremoloParser_IncreasedPrecision TremoloParser_MultipleTimesteps TremoloParser_setsAtomName Ubuntu_1604_changes stable
Last change on this file since 715085 was b6dbff, checked in by Frederik Heber <heber@…>, 15 years ago

BUGFIX: ax_check_glu.m4 has a bracket closed to early.

  • It was the reason why CXXFLAGS was set to "" and debugging was impossible.
  • Property mode set to 100644
File size: 3.1 KB
Line 
1AC_DEFUN([AX_CHECK_GLU],
2[AC_REQUIRE([AX_CHECK_GL])dnl
3AC_REQUIRE([AC_PROG_CXX])dnl
4GLU_CFLAGS="${GL_CFLAGS}"
5GLU_CXXFLAGS="${GL_CXXFLAGS}"
6
7ax_save_CPPFLAGS="${CPPFLAGS}"
8CPPFLAGS="${GL_CFLAGS} ${CPPFLAGS}"
9CFLAGS="${GL_CXXFLAGS} ${CXXFLAGS}"
10AC_CHECK_HEADERS([GL/glu.h OpenGL/glu.h])
11CPPFLAGS="${ax_save_CPPFLAGS}"
12
13m4_define([AX_CHECK_GLU_PROGRAM],
14 [AC_LANG_PROGRAM([[
15# if defined(HAVE_WINDOWS_H) && defined(_WIN32)
16# include <windows.h>
17# endif
18# ifdef HAVE_GL_GLU_H
19# include <GL/glu.h>
20# elif defined(HAVE_OPENGL_GLU_H)
21# include <OpenGL/glu.h>
22# else
23# error no glu.h
24# endif]],
25 [[gluBeginCurve(0)]])])
26
27AC_CACHE_CHECK([for OpenGL Utility library], [ax_cv_check_glu_libglu],
28[ax_cv_check_glu_libglu="no"
29ax_save_CPPFLAGS="${CPPFLAGS}"
30CPPFLAGS="${GL_CFLAGS} ${CPPFLAGS}"
31CXXFLAGS="${GL_CXXFLAGS} ${CXXFLAGS}"
32ax_save_LIBS="${LIBS}"
33
34#
35# First, check for the possibility that everything we need is already in
36# GL_LIBS.
37#
38LIBS="${GL_LIBS} ${ax_save_LIBS}"
39#
40# libGLU typically links with libstdc++ on POSIX platforms.
41# However, setting the language to C++ means that test program
42# source is named "conftest.cc"; and Microsoft cl doesn't know what
43# to do with such a file.
44#
45AC_LANG_PUSH([C++])
46AS_IF([test X$ax_compiler_ms = Xyes],
47 [AC_LANG_PUSH([C])])
48AC_LINK_IFELSE(
49[AX_CHECK_GLU_PROGRAM],
50[ax_cv_check_glu_libglu=yes],
51[LIBS=""
52ax_check_libs="-lglu32 -lGLU"
53for ax_lib in ${ax_check_libs}; do
54 AS_IF([test X$ax_compiler_ms = Xyes],
55 [ax_try_lib=`echo $ax_lib | sed -e 's/^-l//' -e 's/$/.lib/'`],
56 [ax_try_lib="${ax_lib}"])
57 LIBS="${ax_try_lib} ${GL_LIBS} ${ax_save_LIBS}"
58 AC_LINK_IFELSE([AX_CHECK_GLU_PROGRAM],
59 [ax_cv_check_glu_libglu="${ax_try_lib}"; break])
60done
61])
62AS_IF([test X$ax_compiler_ms = Xyes],
63 [AC_LANG_POP([C])])
64AC_LANG_POP([C++])
65
66LIBS=${ax_save_LIBS}
67CPPFLAGS=${ax_save_CPPFLAGS}])
68AS_IF([test "X$ax_cv_check_glu_libglu" = Xno],
69 [no_glu=yes; GLU_CFLAGS=""; GLU_CXXFLAGS=""; GLU_LIBS=""],
70 [AS_IF([test "X$ax_cv_check_glu_libglu" = Xyes],
71 [GLU_LIBS="$GL_LIBS"],
72 [GLU_LIBS="${ax_cv_check_glu_libglu} ${GL_LIBS}"])])
73AC_SUBST([GLU_CFLAGS])
74AC_SUBST([GLU_CXXFLAGS])
75AC_SUBST([GLU_LIBS])
76
77#
78# Some versions of Mac OS X include a broken interpretation of the GLU
79# tesselation callback function signature.
80#
81AS_IF([test "X$ax_cv_check_glu_libglu" != Xno],
82[AC_CACHE_CHECK([for varargs GLU tesselator callback function type],
83 [ax_cv_varargs_glu_tesscb],
84[ax_cv_varargs_glu_tesscb=no
85ax_save_CFLAGS="${CFLAGS}"
86ax_save_CXXFLAGS="${CXXFLAGS}"
87CFLAGS="${GL_CFLAGS} ${CFLAGS}"
88CXXFLAGS="${GL_CXXFLAGS} ${CXXFLAGS}"
89AC_COMPILE_IFELSE(
90[AC_LANG_PROGRAM([[
91# ifdef HAVE_GL_GLU_H
92# include <GL/glu.h>
93# else
94# include <OpenGL/glu.h>
95# endif]],
96 [[GLvoid (*func)(...); gluTessCallback(0, 0, func)]])],
97[ax_cv_varargs_glu_tesscb=yes])
98CFLAGS="$ax_save_CFLAGS"]
99CXXFLAGS="$ax_save_CXXFLAGS"]))
100AS_IF([test X$ax_cv_varargs_glu_tesscb = Xyes],
101 [AC_DEFINE([HAVE_VARARGS_GLU_TESSCB], [1],
102 [Use nonstandard varargs form for the GLU tesselator callback])])
103])
104])
105
Note: See TracBrowser for help on using the repository browser.