From 50f4146604ebab2a5abac898b98b2f267093b435 Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Wed, 12 Feb 2003 16:37:29 +0000
Subject: [PATCH] Add a hack so that --with-fltk-prefix works even if fltk is
 NOT installed (just compiled)

---
 configure    |  6 ++++--
 configure.in | 10 +++++++---
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/configure b/configure
index 61c3a64f61..cdd2e64f6b 100755
--- a/configure
+++ b/configure
@@ -2715,6 +2715,8 @@ else
 echo "${ECHO_T}no" >&6
 fi
 
+            GUI_LIBS="-L${FLTK_PREFIX}/lib"
+    GUI_INCLUDE="-I${FLTK_PREFIX}"
   else
     # Extract the first word of "fltk-config", so it can be a program name with args.
 set dummy fltk-config; ac_word=$2
@@ -2761,8 +2763,8 @@ fi
 echo "$as_me: error: Could not find fltk-config. Try --with-fltk-prefix?" >&2;}
    { (exit 1); exit 1; }; }
   fi
-  GUI_LIBS="`$FLTKCONFIG --use-gl --use-images --ldstaticflags`"
-  GUI_INCLUDE="`$FLTKCONFIG --use-gl --use-images --cxxflags`"
+  GUI_LIBS="${GUI_LIBS} `$FLTKCONFIG --use-gl --use-images --ldflags`"
+  GUI_INCLUDE="${GUI_INCLUDE} `$FLTKCONFIG --use-gl --use-images --cxxflags`"
 
     ac_ext=cc
 ac_cpp='$CXXCPP $CPPFLAGS'
diff --git a/configure.in b/configure.in
index f4b370b0e7..7057704a91 100644
--- a/configure.in
+++ b/configure.in
@@ -1,4 +1,4 @@
-dnl "$Id: configure.in,v 1.10 2003-02-12 16:23:12 geuzaine Exp $"
+dnl "$Id: configure.in,v 1.11 2003-02-12 16:37:29 geuzaine Exp $"
 dnl
 dnl Machine independent configuration script for Gmsh.
 dnl
@@ -90,14 +90,18 @@ if test "x$enable_gui" != "xno"; then
 
   if test "x${FLTK_PREFIX}" != "x" ; then
     AC_PATH_PROG(FLTKCONFIG,fltk-config,"",${FLTK_PREFIX})
+    dnl This is a hack, so that it still works for people who compiled fltk,
+    dnl but didn't install it properly...
+    GUI_LIBS="-L${FLTK_PREFIX}/lib"
+    GUI_INCLUDE="-I${FLTK_PREFIX}"
   else
     AC_PATH_PROG(FLTKCONFIG,fltk-config)
   fi
   if test "x$FLTKCONFIG" = "x"; then
     AC_MSG_ERROR(Could not find fltk-config. Try --with-fltk-prefix?)
   fi
-  GUI_LIBS="`$FLTKCONFIG --use-gl --use-images --ldstaticflags`"
-  GUI_INCLUDE="`$FLTKCONFIG --use-gl --use-images --cxxflags`"
+  GUI_LIBS="${GUI_LIBS} `$FLTKCONFIG --use-gl --use-images --ldflags`"
+  GUI_INCLUDE="${GUI_INCLUDE} `$FLTKCONFIG --use-gl --use-images --cxxflags`"
 
   dnl Check if libjpeg is available (in case fltk didn't find it) to enable/disable gl2jpg
   AC_CHECK_HEADER(jpeglib.h,
-- 
GitLab