summaryrefslogtreecommitdiff
blob: 3b351a124dab5f2119b7c5e349555b0ced680700 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
diff --git a/configure.ac b/configure.ac
index 6778105..ba6484d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -93,6 +93,13 @@ AC_ARG_ENABLE(
 )
 
 AC_ARG_WITH(
+	[gpgme-prefix],
+	[AC_HELP_STRING([--with-gpgme-prefix=PATH], [Specify the directory where gpgme install, default /usr])],
+	,
+	[with_gpgme_prefix="/usr"]
+)
+
+AC_ARG_WITH(
 	[pamdir],
 	[AC_HELP_STRING([--with-pamdir=PATH], [Specify the directory where PAM modules are stored])],
 	[pamdir="${withval}"],
@@ -233,15 +240,13 @@ if test "${enable_tspi}" = "yes" ; then
 fi
 
 if test "${enable_gpg}" = "yes" ; then
-	if test -z "${GPGME_LIBS}"; then
-		AC_ARG_VAR([GPGME_CFLAGS], [C compiler flags for gpg])
-		AC_ARG_VAR([GPGME_LIBS], [linker flags for gpg])
-		AC_CHECK_LIB(
-			[gpgme],
-			[gpgme_new],
-			[GPGME_LIBS="-lgpgme"],
-			[AC_MSG_ERROR([Cannot find gpgme])]
-		)
+	AC_MSG_CHECKING([for gpgme])
+	if ! test -x "${with_gpgme_prefix}/bin/gpgme-config"; then
+		AC_MSG_ERROR([Cannot locate gpgme])
+	else
+		AC_MSG_RESULT([found])
+		GPGME_CFLAGS="`\"${with_gpgme_prefix}/bin/gpgme-config\" --cflags`"
+		GPGME_LIBS="`\"${with_gpgme_prefix}/bin/gpgme-config\" --libs`"
 	fi
 fi
 
@@ -280,6 +285,8 @@ AC_SUBST([pamlibdir])
 AC_SUBST([pkgconfigdir])
 AC_SUBST([rootsbindir])
 AC_SUBST([ecryptfskeymoddir])
+AC_SUBST([GPGME_CFLAGS])
+AC_SUBST([GPGME_LIBS])
 AM_CONDITIONAL([BUILD_OPENSSL], [test "${enable_openssl}" = "yes"])
 AM_CONDITIONAL([BUILD_PKCS11_HELPER], [test "${enable_pkcs11_helper}" = "yes"])
 AM_CONDITIONAL([BUILD_TSPI], [test "${enable_tspi}" = "yes"])