build: add requirement for openssl to configure_ac

Add requirement for openssl to configure_ac so that configure will fail
when not found.

Tested: Verified OPENSSL_LIBS contained (-lssl -lcrypto).
Change-Id: I7cf3c671749801f089054be3828e9c3dea564157
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/Makefile.am b/Makefile.am
index 00947ff..b573cdb 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -17,9 +17,8 @@
 	$(SDBUSPLUS_LIBS) \
 	$(PHOSPHOR_DBUS_INTERFACES_LIBS) \
 	$(PHOSPHOR_LOGGING_LIBS) \
-	-lstdc++fs \
-	-lssl \
-	-lcrypto
+	$(OPENSSL_LIBS) \
+	-lstdc++fs
 
 phosphor_certificate_manager_CXXFLAGS = \
 	$(SYSTEMD_CFLAGS) \
diff --git a/configure.ac b/configure.ac
index da35058..6eec985 100644
--- a/configure.ac
+++ b/configure.ac
@@ -19,6 +19,7 @@
 AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS])
 
 # Check for libraries
+AX_CHECK_OPENSSL([], [AC_MSG_ERROR(["openssl required and not found"])])
 PKG_CHECK_MODULES([PHOSPHOR_DBUS_INTERFACES], [phosphor-dbus-interfaces],,\
     AC_MSG_ERROR(["Requires phosphor-dbus-interfaces package."]))
 PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus],,
diff --git a/test/Makefile.am b/test/Makefile.am
index f6d9e46..70b72c7 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -20,7 +20,7 @@
     $(SDBUSPLUS_LIBS) \
     $(PHOSPHOR_DBUS_INTERFACES_LIBS) \
     $(PHOSPHOR_LOGGING_LIBS) \
-    -lssl -lcrypto \
+    $(OPENSSL_LIBS) \
     -lgtest -lgtest_main -lgmock $(PTHREAD_CFLAGS) $(OESDK_TESTCASE_FLAGS)
 
 check_PROGRAMS =