summaryrefslogtreecommitdiff
path: root/libgphoto2_port/gphoto-m4
diff options
context:
space:
mode:
authorHans Ulrich Niedermann <hun@n-dimensional.de>2021-10-10 23:17:04 +0200
committerMarcus Meissner <meissner@suse.de>2021-10-11 09:35:56 +0200
commitdb4643d59e1333b0111e2d676970a34ac93813f4 (patch)
tree17fdc1a7cffb0fe11c70bd57a3aa11d431a2b867 /libgphoto2_port/gphoto-m4
parent4002477b54cff0f459abb157d5f70fe2c2a15d5f (diff)
downloadlibgphoto2-db4643d59e1333b0111e2d676970a34ac93813f4.tar.gz
Make CAMLIBS and IOLIBS fallbacks configurable
Make CAMLIBS and IOLIBS fallback locations (where libgphoto2 looks for camlibs at runtime if the CAMLIBS environment variable is not set, and where libgphoto2_port looks for iolibs at runtime if the IOLIBS environment variable is not set) configurable at configure time. The runtime lookup location DEFAULT_CAMLIBS and DEFAULT_IOLIBS can be set independently from the installation location camlibdir and iolibdir. This is to accommodate systems like Windows where it apparently makes sense to install files to a location at build time which is different to where the files will eventually end up being used from: ./configure \ --with-camlibdir='/path/to/camlibs' \ DEFAULT_CAMLIBS='./libgphoto2' \ --with-iolibdir='/path/to/camlibs' \ DEFAULT_IOLIBS='./libgphoto2_port' As this interface is a bit ugly mixing the variables with the --with-argument, we will improve that in the next commit.
Diffstat (limited to 'libgphoto2_port/gphoto-m4')
-rw-r--r--libgphoto2_port/gphoto-m4/gp-driverdir.m420
1 files changed, 15 insertions, 5 deletions
diff --git a/libgphoto2_port/gphoto-m4/gp-driverdir.m4 b/libgphoto2_port/gphoto-m4/gp-driverdir.m4
index 000a75935..8cf094cd5 100644
--- a/libgphoto2_port/gphoto-m4/gp-driverdir.m4
+++ b/libgphoto2_port/gphoto-m4/gp-driverdir.m4
@@ -9,18 +9,28 @@ dnl
dnl ###################################################################
dnl
AC_DEFUN([GP_DRIVERDIR], [dnl
-AC_MSG_CHECKING([where to install ][$3])
+AC_MSG_CHECKING([where to install ][$3][ ($1)])
AC_ARG_WITH([$1], [AS_HELP_STRING(
[--with-][$1][=<path>],
[install ][$3][ in directory <path>])dnl
-], [
+], [dnl
$1="$withval"
-], [
+ AC_MSG_RESULT([${$1} (from --with-$1)])
+], [dnl
$1="\${libdir}/${PACKAGE_TARNAME}/${PACKAGE_VERSION}"
+ AC_MSG_RESULT([${$1} (default)])
])
-AC_MSG_RESULT([${$1}])
AC_SUBST([$1])
-AM_CPPFLAGS="$AM_CPPFLAGS -D$2=\\\"${$1}\\\""
+
+AC_ARG_VAR([DEFAULT_][$2],
+ [default location to look for ][$3][ at runtime (using ${$1} if not given)])
+AS_VAR_IF([DEFAULT_][$2], [], [dnl
+ DEFAULT_$2="\${$1}"
+ AC_MSG_RESULT([value of camlibdir (default)])
+], [dnl
+ AC_MSG_RESULT([${DEFAULT_$2} (set explicitly)])
+])
+AM_CPPFLAGS="$AM_CPPFLAGS -D$2=\\\"${DEFAULT_$2}\\\""
])dnl
dnl
dnl