From 250bb610258fe762871aa2c479a1e5f485e88b89 Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Sun, 15 Jan 2017 00:42:35 -0800 Subject: [PATCH] Check for openssl binary in configure, don't fail if not found Prefer openssl binary from the same location as the openssl library. Make it possible to suppress certificate generation during install by passing OPENSSL=: to make. --- configure.ac | 4 ++++ keygen/Makefile.am | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index d99e7b2c..67531b2a 100644 --- a/configure.ac +++ b/configure.ac @@ -140,6 +140,10 @@ AC_SUBST(DLOPEN_LIBS) PKG_CHECK_MODULES([OPENSSL], [openssl >= 0], [], [AC_MSG_ERROR([please install libssl-dev or openssl-devel])]) +# look for openssl binary +OPENSSL_BIN=`$PKG_CONFIG --variable=exec_prefix openssl`/bin +AC_PATH_PROGS([OPENSSL], [openssl], [:], [$OPENSSL_BIN:$PATH]) + # checking for pam variation # Linux-PAM is used in Linux systems # OpenPAM is used by FreeBSD, NetBSD, DragonFly BSD and OS X diff --git a/keygen/Makefile.am b/keygen/Makefile.am index 014e8df9..2422196a 100644 --- a/keygen/Makefile.am +++ b/keygen/Makefile.am @@ -23,7 +23,7 @@ install-data-hook: ./xrdp-keygen xrdp $(DESTDIR)$(xrdpsysconfdir)/rsakeys.ini; \ fi && \ if [ ! -f $(DESTDIR)$(xrdpsysconfdir)/cert.pem ]; then \ - openssl req -x509 -newkey rsa:2048 -sha256 -nodes \ + $(OPENSSL) req -x509 -newkey rsa:2048 -sha256 -nodes \ -keyout $(DESTDIR)$(xrdpsysconfdir)/key.pem -out \ $(DESTDIR)$(xrdpsysconfdir)/cert.pem -days 365 \ -subj /C=US/ST=CA/L=Sunnyvale/O=xrdp/CN=www.xrdp.org \