summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README1
-rw-r--r--configure.ac31
-rw-r--r--m4/guix.m415
3 files changed, 32 insertions, 15 deletions
diff --git a/README b/README
index df528222e90..f05a4b5615e 100644
--- a/README
+++ b/README
@@ -59,7 +59,6 @@ To do so:
59 guix environment guix 59 guix environment guix
60 60
61 - Re-run the 'configure' script passing it the option 61 - Re-run the 'configure' script passing it the option
62 '--with-libgcrypt-prefix=$HOME/.guix-profile/', as well as
63 '--localstatedir=/somewhere', where '/somewhere' is the 'localstatedir' 62 '--localstatedir=/somewhere', where '/somewhere' is the 'localstatedir'
64 value of the currently installed Guix (failing to do that would lead the 63 value of the currently installed Guix (failing to do that would lead the
65 new Guix to consider the store to be empty!). 64 new Guix to consider the store to be empty!).
diff --git a/configure.ac b/configure.ac
index 1cfe876232d..38e9ec56b7a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -132,23 +132,21 @@ else
132 AC_MSG_RESULT([not found]) 132 AC_MSG_RESULT([not found])
133fi 133fi
134 134
135LIBGCRYPT="libgcrypt"
136LIBGCRYPT_LIBDIR="no"
137LIBGCRYPT_PREFIX="no"
138
135AC_ARG_WITH([libgcrypt-prefix], 139AC_ARG_WITH([libgcrypt-prefix],
136 [AS_HELP_STRING([--with-libgcrypt-prefix=DIR], [search for GNU libgcrypt in DIR])], 140 [AS_HELP_STRING([--with-libgcrypt-prefix=DIR], [search for GNU libgcrypt in DIR])],
137 [case "$withval" in 141 [case "$withval" in
138 yes|no) 142 yes|no)
139 LIBGCRYPT="libgcrypt"
140 LIBGCRYPT_PREFIX="no"
141 LIBGCRYPT_LIBDIR="no"
142 ;; 143 ;;
143 *) 144 *)
144 LIBGCRYPT="$withval/lib/libgcrypt" 145 LIBGCRYPT="$withval/lib/libgcrypt"
145 LIBGCRYPT_PREFIX="$withval" 146 LIBGCRYPT_PREFIX="$withval"
146 LIBGCRYPT_LIBDIR="$withval/lib" 147 LIBGCRYPT_LIBDIR="$withval/lib"
147 ;; 148 ;;
148 esac], 149 esac])
149 [LIBGCRYPT="libgcrypt"
150 LIBGCRYPT_PREFIX="no"
151 LIBGCRYPT_LIBDIR="no"])
152 150
153AC_ARG_WITH([libgcrypt-libdir], 151AC_ARG_WITH([libgcrypt-libdir],
154 [AS_HELP_STRING([--with-libgcrypt-libdir=DIR], 152 [AS_HELP_STRING([--with-libgcrypt-libdir=DIR],
@@ -162,13 +160,18 @@ AC_ARG_WITH([libgcrypt-libdir],
162 LIBGCRYPT="$withval/libgcrypt" 160 LIBGCRYPT="$withval/libgcrypt"
163 LIBGCRYPT_LIBDIR="$withval" 161 LIBGCRYPT_LIBDIR="$withval"
164 ;; 162 ;;
165 esac], 163 esac])
166 [if test "x$LIBGCRYPT" = x; then 164
167 LIBGCRYPT="libgcrypt" 165dnl If none of the --with-libgcrypt-* options was used, try to determine the
168 fi 166dnl absolute file name of libgcrypt.so.
169 if test "x$LIBGCRYPT_LIBDIR" = x; then 167case "x$LIBGCRYPT_PREFIX$LIBGCRYPT_LIBDIR" in
170 LIBGCRYPT_LIBDIR="no" 168 xnono)
171 fi]) 169 GUIX_LIBGCRYPT_LIBDIR([LIBGCRYPT_LIBDIR])
170 if test "x$LIBGCRYPT_LIBDIR" != x; then
171 LIBGCRYPT="$LIBGCRYPT_LIBDIR/libgcrypt"
172 fi
173 ;;
174esac
172 175
173dnl Library name suitable for `dynamic-link'. 176dnl Library name suitable for `dynamic-link'.
174AC_MSG_CHECKING([for libgcrypt shared library name]) 177AC_MSG_CHECKING([for libgcrypt shared library name])
diff --git a/m4/guix.m4 b/m4/guix.m4
index 21133837700..d464a478ca7 100644
--- a/m4/guix.m4
+++ b/m4/guix.m4
@@ -270,3 +270,18 @@ AC_DEFUN([GUIX_CHECK_LIBC_MOUNT], [
270 guix_cv_libc_has_mount="no" 270 guix_cv_libc_has_mount="no"
271 fi]) 271 fi])
272]) 272])
273
274dnl GUIX_LIBGCRYPT_LIBDIR VAR
275dnl
276dnl Attempt to determine libgcrypt's LIBDIR; store the result in VAR.
277AC_DEFUN([GUIX_LIBGCRYPT_LIBDIR], [
278 AC_PATH_PROG([LIBGCRYPT_CONFIG], [libgcrypt-config])
279 AC_CACHE_CHECK([libgcrypt's library directory],
280 [guix_cv_libgcrypt_libdir],
281 [if test "x$LIBGCRYPT_CONFIG" != "x"; then
282 guix_cv_libgcrypt_libdir=`$LIBGCRYPT_CONFIG --libs | sed -e "s/.*-L\([[^ ]]\+\)[[[:blank:]]]\+-lgcrypt.*/\1/g"`
283 else
284 guix_cv_libgcrypt_libdir=""
285 fi])
286 $1="$guix_cv_libgcrypt_libdir"
287])