summaryrefslogtreecommitdiff
path: root/libgphoto2_port
diff options
context:
space:
mode:
authorHans Ulrich Niedermann <hun@n-dimensional.de>2021-10-10 23:12:35 +0200
committerMarcus Meissner <meissner@suse.de>2021-10-11 09:35:56 +0200
commite7d64cb29ec8c28c3bbbf5a066ad3d6da31085a6 (patch)
tree153caddf91cb2a2a20620c4d3780daa552ad4bb2 /libgphoto2_port
parentdb4643d59e1333b0111e2d676970a34ac93813f4 (diff)
downloadlibgphoto2-e7d64cb29ec8c28c3bbbf5a066ad3d6da31085a6.tar.gz
Replace --with-foodir= argument by foodir= variable
This improves the definition of the camlib and iolib compile time install location and the runtime lookup location to use the same mechanism of using variables. Example uses for Windows builds using the default install location: ./configure \ DEFAULT_CAMLIBS='./libgphoto2' \ DEFAULT_IOLIBS='./libgphoto2_port' Or example use for explicitly defining the install location as well: ./configure \ camlibdir='/path/to/camlibs' \ DEFAULT_CAMLIBS='./libgphoto2' \ iolibdir='/path/to/iolibs' \ DEFAULT_IOLIBS='./libgphoto2_port'
Diffstat (limited to 'libgphoto2_port')
-rw-r--r--libgphoto2_port/gphoto-m4/gp-driverdir.m449
1 files changed, 43 insertions, 6 deletions
diff --git a/libgphoto2_port/gphoto-m4/gp-driverdir.m4 b/libgphoto2_port/gphoto-m4/gp-driverdir.m4
index 8cf094cd5..a706e3796 100644
--- a/libgphoto2_port/gphoto-m4/gp-driverdir.m4
+++ b/libgphoto2_port/gphoto-m4/gp-driverdir.m4
@@ -10,20 +10,57 @@ dnl ###################################################################
dnl
AC_DEFUN([GP_DRIVERDIR], [dnl
AC_MSG_CHECKING([where to install ][$3][ ($1)])
+AC_ARG_VAR([$1],
+ [where to install ][$3][ (default: ${libdir}/${PACKAGE_TARNAME}/${PACKAGE_VERSION})])
+AS_VAR_IF([$1], [], [dnl
+ $1="\${libdir}/${PACKAGE_TARNAME}/${PACKAGE_VERSION}"
+ AC_MSG_RESULT([${$1} (default)])
+], [dnl
+ AC_MSG_RESULT([${$1} (set explictly)])
+])
+
+dnl If you see this after 2022-12-31, please remove the following
+dnl section, uncomment the one after, and send a pull request.
+AC_MSG_CHECKING([for deprecated --with-$1 argument])
AC_ARG_WITH([$1], [AS_HELP_STRING(
[--with-][$1][=<path>],
- [install ][$3][ in directory <path>])dnl
+ [deprecated (use ][$1][= variable instead)])dnl
], [dnl
- $1="$withval"
- AC_MSG_RESULT([${$1} (from --with-$1)])
+ AS_VAR_IF([$1], [], [dnl
+ $1="$withval"
+ AC_MSG_RESULT([${$1} (from DEPRECATED --with-$1)])
+ ], [dnl
+ AS_VAR_IF([$1], ["$withval"], [dnl
+ # Nothing to do, $1 has already been set to this value.
+ ], [dnl
+ AC_MSG_RESULT([${withval} (differs from $1 value)])
+ AC_MSG_ERROR([
+If both the $1= variable and the DEPRECATED --with-$1= argument
+are used, their value MUST be the same.
+])
+ ])
+ ])
], [dnl
- $1="\${libdir}/${PACKAGE_TARNAME}/${PACKAGE_VERSION}"
- AC_MSG_RESULT([${$1} (default)])
+ AC_MSG_RESULT([not used (very good)])
])
+
+dnl If you see this after 2022-12-31, please uncomment the following
+dnl section, remove the previous one, and send a pull request.
+dnl
+dnl AC_ARG_WITH([$1], [AS_HELP_STRING([--with-][$1][=<path>],
+dnl [DEPRECATED (use camlibdir= variable instead)])dnl
+dnl ], [dnl
+dnl AC_MSG_ERROR([
+dnl The --with-$1= argument is DEPRECATED.
+dnl
+dnl Use the $1= variable instead.
+dnl ])
+dnl ])
+
AC_SUBST([$1])
AC_ARG_VAR([DEFAULT_][$2],
- [default location to look for ][$3][ at runtime (using ${$1} if not given)])
+ [default location to look for ][$3][ at runtime (if not given, use ${$1})])
AS_VAR_IF([DEFAULT_][$2], [], [dnl
DEFAULT_$2="\${$1}"
AC_MSG_RESULT([value of camlibdir (default)])