From 2bf063c49a4c8b867f889f69efa44dd3e1cbe44e Mon Sep 17 00:00:00 2001 From: Thimo Neubauer <thimo@dune-project.org> Date: Wed, 20 Oct 2004 16:25:19 +0000 Subject: [PATCH] bugfix: libGL needs pthread linker flag as well as compiler flag [[Imported from SVN: r950]] --- m4/grape.m4 | 14 +++++--------- m4/opengl.m4 | 8 ++++++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/m4/grape.m4 b/m4/grape.m4 index eda2fa075..8165b248e 100644 --- a/m4/grape.m4 +++ b/m4/grape.m4 @@ -24,7 +24,6 @@ AC_DEFUN([DUNE_PATH_GRAPE],[ # store old values ac_save_LDFLAGS="$LDFLAGS" -ac_save_CXXFLAGS="$CXXFLAGS" ac_save_CPPFLAGS="$CPPFLAGS" ac_save_LIBS="$LIBS" @@ -62,14 +61,14 @@ if test "x$X_LIBS" != x && test x$with_grape != xno ; then # if GL was found, add it implicitly... # This is not the best choice, but testing without GL first and # then trying again fails due to caching... - CXXFLAGS="$CXXFLAGS $GL_CFLAGS" - # !!! -lXext is somehow needed for libGL ?! + CPPFLAGS="$GRAPE_CPPFLAGS $GL_CFLAGS" LIBS="$LIBS $GL_LIBS -lXext" + LDFLAGS="$LDFLAGS $GL_LDFLAGS" AC_CHECK_LIB(gr, grape, - [GRAPE_LDFLAGS="-L$GRAPEROOT" - GRAPE_CXXFLAGS="$GL_CFLAGS" - GRAPE_LIBS="-lgr $GL_LIBS"], + [GRAPE_LDFLAGS="-L$GRAPEROOT $GL_LDFLAGS" + GRAPE_CPPFLAGS="$CPPFLAGS" + GRAPE_LIBS="-lgr $GL_LIBS -lXext"], [HAVE_GRAPE="0"]) fi @@ -78,14 +77,12 @@ if test "x$X_LIBS" != x && test x$with_grape != xno ; then AC_SUBST(GRAPE_LIBS, $GRAPE_LIBS) AC_SUBST(GRAPE_LDFLAGS, $GRAPE_LDFLAGS) AC_SUBST(GRAPE_CPPFLAGS, $GRAPE_CPPFLAGS) - AC_SUBST(GRAPE_CXXFLAGS, $GRAPE_CXXFLAGS) AC_DEFINE(HAVE_GRAPE, 1, [Define to 1 if grape-library is found]) # add to global list DUNE_PKG_LDFLAGS="$DUNE_PKG_LDFLAGS $GRAPE_LDFLAGS" DUNE_PKG_LIBS="$DUNE_PKG_LIBS $GRAPE_LIBS" DUNE_PKG_CPPFLAGS="$DUNE_PKG_CPPFLAGS $GRAPE_CPPFLAGS" - DUNE_PKG_CXXFLAGS="$DUNE_PKG_CXXFLAGS $GRAPE_CXXFLAGS" fi fi @@ -101,7 +98,6 @@ AM_CONDITIONAL(GRAPE, test x$HAVE_GRAPE = x1) # reset old values LIBS="$ac_save_LIBS" -CXXFLAGS="$ac_save_CXXFLAGS" CPPFLAGS="$ac_save_CPPFLAGS" LDFLAGS="$ac_save_LDFLAGS" diff --git a/m4/opengl.m4 b/m4/opengl.m4 index 585e006cf..162f2cd49 100644 --- a/m4/opengl.m4 +++ b/m4/opengl.m4 @@ -5,11 +5,15 @@ AC_DEFUN([DUNE_PATH_OPENGL],[ dnl use test from autoconf-archive AC_REQUIRE([AX_CHECK_GL]) - # now GL_LIBS and GL_CFLAGS is set, just as we want it :) + # GL_LIBS and GL_CFLAGS already set correctly, they implicitly + # contain pthread support! - # set variable for summary + # variable for summary with_opengl="no" if test "$no_gl" != "yes" ; then with_opengl="yes" + + # need pthreads-stuff in linker commandline as well + AC_SUBST(GL_LDFLAGS, $PTHREAD_CFLAGS) fi ]) -- GitLab