# HG changeset patch # User Olaf Till # Date 1487769248 -3600 # Wed Feb 22 14:14:08 2017 +0100 # Node ID 8439d2c0d52a7205f28b42180818e6f598dcac7a # Parent 90d6c670380d2fa6aed152950f7a1a2671df6f79 Fix installation on multiarch systems. * src/configure.ac: Use AC_CANONICAL_TARGET to get architecture identifier. Pass it to CMAKE_FIND_PACKAGE. * src/m4/cmake.m4 (CMAKE_FIND_PACKAGE): Call cmake with variable CMAKE_LIBRARY_ARCHITECTURE set to architecture identifier. diff -r 90d6c670380d -r 8439d2c0d52a src/configure.ac --- a/src/configure.ac Sun Feb 12 13:22:23 2017 -0500 +++ b/src/configure.ac Wed Feb 22 14:14:08 2017 +0100 @@ -1,6 +1,8 @@ AC_PREREQ([2.67]) AC_INIT([Octave-Forge dicom package], [0.2.0]) AC_CANONICAL_HOST +AC_CANONICAL_TARGET +target_arch="${target_cpu}-${target_os}" AC_PROG_SED @@ -8,11 +10,13 @@ AC_LANG(C++) dnl -dnl GDCM headers are in a version specific path. They use CMake and provide -dnl a project.cmake config file which has the correct flags to use. The -dnl CMAKE_FIND_PACKAGE macro is provided by CMake. +dnl GDCM headers are in a version specific path. They use CMake and +dnl provide a project.cmake config file which has the correct flags to +dnl use. The CMAKE_FIND_PACKAGE macro is provided by CMake. It has +dnl been slightly changed to make cmake consider architecture +dnl dependent directories. dnl -CMAKE_FIND_PACKAGE([GDCM], [CXX]) +CMAKE_FIND_PACKAGE([GDCM], [CXX], , , , [target_arch]) ## Remove -rdynamics which mkoctfile does not handle. GDCM_LIBS=$(echo "$GDCM_LIBS" | $SED "s,-rdynamic,,") diff -r 90d6c670380d -r 8439d2c0d52a src/m4/cmake.m4 --- a/src/m4/cmake.m4 Sun Feb 12 13:22:23 2017 -0500 +++ b/src/m4/cmake.m4 Wed Feb 22 14:14:08 2017 +0100 @@ -34,10 +34,10 @@ failed=false AC_MSG_CHECKING([for $1]) if test -z "$1[]_$2[]FLAGS"; then - $1[]_$2[]FLAGS=`$CMAKE_BINARY --find-package "-DNAME=$1" "-DCOMPILER_ID=m4_default([$3], [GNU])" "-DLANGUAGE=$2" -DMODE=COMPILE $4` || failed=true + $1[]_$2[]FLAGS=`$CMAKE_BINARY --find-package "-DNAME=$1" "-DCOMPILER_ID=m4_default([$3], [GNU])" "-DLANGUAGE=$2" -DMODE=COMPILE $4 "-DCMAKE_LIBRARY_ARCHITECTURE=${$6}"` || failed=true fi if test -z "$1[]_LIBS"; then - $1[]_LIBS=`$CMAKE_BINARY --find-package "-DNAME=$1" "-DCOMPILER_ID=m4_default([$3], [GNU])" "-DLANGUAGE=$2" -DMODE=LINK $4` || failed=true + $1[]_LIBS=`$CMAKE_BINARY --find-package "-DNAME=$1" "-DCOMPILER_ID=m4_default([$3], [GNU])" "-DLANGUAGE=$2" -DMODE=LINK $4 "-DCMAKE_LIBRARY_ARCHITECTURE=${$6}"` || failed=true fi if $failed; then