From: Ole Streicher <olebole@debian.org>
Date: Sat, 1 Jul 2017 20:53:20 +0200
Subject: Use the qfits library provided by Debian instead of the convienience
 copy.

---
 Makefile.am            | 4 +---
 acinclude.m4           | 2 +-
 configure.ac           | 1 -
 flames/Makefile.am     | 4 ++--
 uves/Makefile.am       | 4 ++--
 uves/tests/Makefile.am | 2 +-
 6 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index a8f7eed..a940693 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -19,11 +19,10 @@
 
 AUTOMAKE_OPTIONS = 1.8 foreign
 
-ACLOCAL_AMFLAGS = -I m4macros -I libqfits/m4macros
+ACLOCAL_AMFLAGS = -I m4macros
 
 DISTCLEANFILES = *~
 
-COMPILE_FIRST = libqfits
 
 TOPSUBDIRS = irplib uves flames recipes regtests reflex
 #TOPSUBDIRS = irplib uves recipes
@@ -31,7 +30,6 @@ TOPSUBDIRS = irplib uves flames recipes regtests reflex
 COMPILE_LAST =
 
 
-DOXYGEN_SUBDIRS =  libqfits
 
 SUBDIRS = $(COMPILE_FIRST) $(TOPSUBDIRS) $(COMPILE_LAST)
 
diff --git a/acinclude.m4 b/acinclude.m4
index 75b8c80..207d1fb 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -278,7 +278,7 @@ AC_DEFUN([UVES_CREATE_SYMBOLS],
     IRPLIB_INCLUDES='-I$(top_srcdir)/irplib'
     # No -L for IRPLIB which is statically linked
 
-    QF_INCLUDES='-I$(top_srcdir)/libqfits -I$(top_srcdir)/libqfits/src'
+    QF_INCLUDES=''
     QF_LDFLAGS=""
 
 
diff --git a/configure.ac b/configure.ac
index a6916fb..deee6f7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -112,7 +112,6 @@ AM_WITH_DMALLOC
 #                uves/tests/Makefile
 #                recipes/Makefile)
 
-AC_CONFIG_SUBDIRS(libqfits)
 
 AC_CONFIG_FILES(Makefile
                 Makefile.purify
diff --git a/flames/Makefile.am b/flames/Makefile.am
index d3464ca..eb58111 100644
--- a/flames/Makefile.am
+++ b/flames/Makefile.am
@@ -23,8 +23,8 @@ DISTCLEANFILES = *~
 
 SUBDIRS = . tests
 
-LIBQFITS=$(top_builddir)/libqfits/src/libqfits.la
-QFITS_INCLUDES = -I$(top_srcdir)/libqfits/src/
+LIBQFITS= -lqfits
+QFITS_INCLUDES =
 
 
 if MAINTAINER_MODE
diff --git a/uves/Makefile.am b/uves/Makefile.am
index 7bb62d8..70d1383 100644
--- a/uves/Makefile.am
+++ b/uves/Makefile.am
@@ -23,8 +23,8 @@ DISTCLEANFILES = *~
 
 SUBDIRS = . tests
 
-LIBQFITS=$(top_builddir)/libqfits/src/libqfits.la
-QFITS_INCLUDES = -I$(top_srcdir)/libqfits/src/
+LIBQFITS=-lqfits
+QFITS_INCLUDES =
 
 
 if MAINTAINER_MODE
diff --git a/uves/tests/Makefile.am b/uves/tests/Makefile.am
index e5e41c3..228f094 100644
--- a/uves/tests/Makefile.am
+++ b/uves/tests/Makefile.am
@@ -30,7 +30,7 @@ endif
 
 AM_CPPFLAGS = $(all_includes)
 
-LDADD = $(LIBUVES) $(LIBFLAMES) $(LIBCPLUI) $(LIBCPLCORE) $(LIBCEXT) $(LIBCFITSIO)
+LDADD = $(LIBUVES) $(LIBFLAMES) $(LIBCPLUI) $(LIBCPLCORE) $(LIBCEXT) $(LIBCFITSIO) -lqfits
 LDFLAGS = $(CPL_LDFLAGS)
 
 pkginclude_HEADERS =
