diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2015-10-06 22:09:40 +0200 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2015-10-06 23:51:04 +0200 |
| commit | dd01fecd23a4ded46b99a51dc08ac5d964dbcd53 (patch) | |
| tree | 7935564290df6b3a828d1e8a7f4eecb7c58392f8 | |
| parent | 04d1ab3bf5394ae229161669e9717d76d483e7aa (diff) | |
build: Automatically determine libgcrypt's file name.
* m4/guix.m4 (GUIX_LIBGCRYPT_LIBDIR): New macro.
* configure.ac: Use it when no --with-libgcrypt-* option was passed.
* README: Do not recommend --with-libgcrypt-prefix.
Co-authored-by: 宋文武 <iyzsong@gmail.com>
| -rw-r--r-- | README | 1 | ||||
| -rw-r--r-- | configure.ac | 31 | ||||
| -rw-r--r-- | m4/guix.m4 | 15 |
3 files changed, 32 insertions, 15 deletions
| @@ -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]) |
| 133 | fi | 133 | fi |
| 134 | 134 | ||
| 135 | LIBGCRYPT="libgcrypt" | ||
| 136 | LIBGCRYPT_LIBDIR="no" | ||
| 137 | LIBGCRYPT_PREFIX="no" | ||
| 138 | |||
| 135 | AC_ARG_WITH([libgcrypt-prefix], | 139 | AC_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 | ||
| 153 | AC_ARG_WITH([libgcrypt-libdir], | 151 | AC_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" | 165 | dnl If none of the --with-libgcrypt-* options was used, try to determine the |
| 168 | fi | 166 | dnl absolute file name of libgcrypt.so. |
| 169 | if test "x$LIBGCRYPT_LIBDIR" = x; then | 167 | case "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 | ;; | ||
| 174 | esac | ||
| 172 | 175 | ||
| 173 | dnl Library name suitable for `dynamic-link'. | 176 | dnl Library name suitable for `dynamic-link'. |
| 174 | AC_MSG_CHECKING([for libgcrypt shared library name]) | 177 | AC_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 | |||
| 274 | dnl GUIX_LIBGCRYPT_LIBDIR VAR | ||
| 275 | dnl | ||
| 276 | dnl Attempt to determine libgcrypt's LIBDIR; store the result in VAR. | ||
| 277 | AC_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 | ]) | ||
