From: Ole Streicher <olebole@debian.org>
Date: Sat, 30 Jul 2016 09:23:19 +0200
Subject: Use standard path and name for cpl

---
 m4/cpl.m4 | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/m4/cpl.m4 b/m4/cpl.m4
index daf0356..fdeb8d2 100644
--- a/m4/cpl.m4
+++ b/m4/cpl.m4
@@ -9,7 +9,7 @@ AC_DEFUN([CPL_CHECK_CFITSIO],
         
     cpl_cfitsio_check_version="$1"
     cpl_cfitsio_check_header="fitsio.h"
-    cpl_cfitsio_check_lib="libcfitsio.a"
+    cpl_cfitsio_check_lib="libcfitsio.so"
 
     cpl_cfitsio_incdirs=""
     cpl_cfitsio_libdirs=""
@@ -110,7 +110,7 @@ AC_DEFUN([CPL_CHECK_CFITSIO],
                 cpl_cfitsio_libdirs="$cpl_cfitsio_libdirs /usr/lib64"
                 cpl_cfitsio_libdirs="$cpl_cfitsio_libdirs /usr/lib"
                 cpl_cfitsio_libdirs="$cpl_cfitsio_libdirs /usr/lib32"
-
+                cpl_cfitsio_libdirs="$cpl_cfitsio_libdirs /usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)"
                 test -n "$CFITSIODIR" && \
                     cpl_cfitsio_libdirs="$CFITSIODIR/lib64 $CFITSIODIR/lib \
                                          $CFITSIODIR/lib32 $cpl_cfitsio_libdirs"
@@ -495,6 +495,7 @@ AC_DEFUN([CPL_CHECK_CEXT],
                 	cpl_cext_libdirs="$cpl_cext_libdirs /usr/lib64"
                 	cpl_cext_libdirs="$cpl_cext_libdirs /usr/lib"
                 	cpl_cext_libdirs="$cpl_cext_libdirs /usr/lib32"
+			cpl_cext_libdirs="$cpl_cext_libdirs /usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)"
 
                 	test -n "$CPLDIR" && \
                     	cpl_cext_libdirs="$CPLDIR/lib64 \
@@ -1262,7 +1263,7 @@ AC_DEFUN([CPL_CHECK_LIBS],
     AC_MSG_CHECKING([for CPL])
 
     cpl_check_cpl_header="cpl.h"
-    cpl_check_cpl_lib="libcplcore.a"
+    cpl_check_cpl_lib="libcplcore.so"
 
     cpl_incdirs=""
     cpl_libdirs=""
@@ -1339,6 +1340,7 @@ AC_DEFUN([CPL_CHECK_LIBS],
                 cpl_libdirs="$cpl_libdirs /usr/lib64"
                 cpl_libdirs="$cpl_libdirs /usr/lib"
                 cpl_libdirs="$cpl_libdirs /usr/lib32"
+                cpl_libdirs="$cpl_libdirs /usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)"
 
                 test -n "$CPLDIR" && \
                     cpl_libdirs="$CPLDIR/lib64 $CPLDIR/lib $CPLDIR/lib32 \
