all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH] build: Use `libgcrypt-config' to set the default value for LIBGCRYPT.
@ 2015-10-06 13:47 宋文武
  2015-10-06 21:54 ` Ludovic Courtès
  0 siblings, 1 reply; 2+ messages in thread
From: 宋文武 @ 2015-10-06 13:47 UTC (permalink / raw)
  To: guix-devel; +Cc: 宋文武

* configure.ac: Set LIBGCRYP_PREFIX, LIBGCRYPT_LIBDIR and LIBGCRYPT according
  to the output of `libgcrypt-config'.
---
 configure.ac | 31 +++++++++++++++----------------
 1 file changed, 15 insertions(+), 16 deletions(-)

diff --git a/configure.ac b/configure.ac
index 1cfe876..afffea1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -132,43 +132,42 @@ else
    AC_MSG_RESULT([not found])
 fi
 
+AC_MSG_CHECKING([for libgcrypt-config])
+AC_PATH_PROG([LIBGCRYPT_CONFIG], [libgcrypt-config])
+if test "x$LIBGCRYPT_CONFIG" != "x"; then
+   LIBGCRYPT_PREFIX=`$LIBGCRYPT_CONFIG --prefix`
+   LIBGCRYPT_LIBDIR=`$LIBGCRYPT_CONFIG --libs | sed -e "s/.*-L\([[^ ]]\+\)[[[:blank:]]]\+-lgcrypt.*/\1/g"`
+   LIBGCRYPT="$LIBGCRYPT_LIBDIR/libgcrypt"
+else
+   LIBGCRYPT_PREFIX="no"
+   LIBGCRYPT_LIBDIR="no"
+   LIBGCRYPT="libgcrypt"
+fi
+
 AC_ARG_WITH([libgcrypt-prefix],
   [AS_HELP_STRING([--with-libgcrypt-prefix=DIR], [search for GNU libgcrypt in DIR])],
   [case "$withval" in
     yes|no)
-      LIBGCRYPT="libgcrypt"
-      LIBGCRYPT_PREFIX="no"
-      LIBGCRYPT_LIBDIR="no"
       ;;
     *)
       LIBGCRYPT="$withval/lib/libgcrypt"
       LIBGCRYPT_PREFIX="$withval"
       LIBGCRYPT_LIBDIR="$withval/lib"
       ;;
-   esac],
-  [LIBGCRYPT="libgcrypt"
-   LIBGCRYPT_PREFIX="no"
-   LIBGCRYPT_LIBDIR="no"])
+   esac]])
 
 AC_ARG_WITH([libgcrypt-libdir],
   [AS_HELP_STRING([--with-libgcrypt-libdir=DIR],
      [search for GNU libgcrypt's shared library in DIR])],
   [case "$withval" in
     yes|no)
-      LIBGCRYPT="libgcrypt"
-      LIBGCRYPT_LIBDIR="no"
       ;;
     *)
       LIBGCRYPT="$withval/libgcrypt"
       LIBGCRYPT_LIBDIR="$withval"
       ;;
-   esac],
-  [if test "x$LIBGCRYPT" = x; then
-      LIBGCRYPT="libgcrypt"
-   fi
-   if test "x$LIBGCRYPT_LIBDIR" = x; then
-      LIBGCRYPT_LIBDIR="no"
-   fi])
+   esac]])
+
 
 dnl Library name suitable for `dynamic-link'.
 AC_MSG_CHECKING([for libgcrypt shared library name])
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] build: Use `libgcrypt-config' to set the default value for LIBGCRYPT.
  2015-10-06 13:47 [PATCH] build: Use `libgcrypt-config' to set the default value for LIBGCRYPT 宋文武
@ 2015-10-06 21:54 ` Ludovic Courtès
  0 siblings, 0 replies; 2+ messages in thread
From: Ludovic Courtès @ 2015-10-06 21:54 UTC (permalink / raw)
  To: 宋文武; +Cc: guix-devel

宋文武 <iyzsong@gmail.com> skribis:

> * configure.ac: Set LIBGCRYP_PREFIX, LIBGCRYPT_LIBDIR and LIBGCRYPT according
>   to the output of `libgcrypt-config'.

I ended up doing it a bit differently in dd01fec.

Thank you!

Ludo’.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-10-06 21:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-06 13:47 [PATCH] build: Use `libgcrypt-config' to set the default value for LIBGCRYPT 宋文武
2015-10-06 21:54 ` Ludovic Courtès

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.