@@ -7,5 +7,5 @@ Name: libodp-linux
Description: The ODP packet processing engine
Version: @PKGCONFIG_VERSION@
Libs: -L${libdir} -lodp-linux
-Libs.private: -lcrypto -ldl -lpcap @PTHREAD_LIBS@ -lrt -lpthread @ATOMIC_LIBS@
+Libs.private: @OPENSSL_STATIC_LIBS@ -lpcap @PTHREAD_LIBS@ -lrt -lpthread @ATOMIC_LIBS@
Cflags: -I${includedir}
@@ -11,6 +11,8 @@ AM_CFLAGS += -I$(top_builddir)/include
AM_CFLAGS += -Iinclude
AM_CFLAGS += -D_ODP_PKTIO_IPC
+AM_CPPFLAGS += $(OPENSSL_CPPFLAGS)
+
include_HEADERS = \
$(top_srcdir)/include/odp.h \
$(top_srcdir)/include/odp_api.h
@@ -254,6 +256,7 @@ __LIB__libodp_linux_la_SOURCES += pktio/pcap.c
endif
__LIB__libodp_linux_la_LIBADD = $(ATOMIC_LIBS)
+__LIB__libodp_linux_la_LIBADD += $(OPENSSL_LIBS)
# Create symlink for ABI header files. Application does not need to use the arch
# specific include path for installed files.
@@ -5,8 +5,8 @@ AC_ARG_WITH([openssl-path],
AC_HELP_STRING([--with-openssl-path=DIR path to openssl libs and headers],
[(or in the default path if not specified).]),
[OPENSSL_PATH=$withval
- AM_CPPFLAGS="$AM_CPPFLAGS -I$OPENSSL_PATH/include"
- AM_LDFLAGS="$AM_LDFLAGS -L$OPENSSL_PATH/lib"
+ OPENSSL_CPPFLAGS="-I$OPENSSL_PATH/include"
+ OPENSSL_LIBS="-L$OPENSSL_PATH/lib"
],[])
##########################################################################
@@ -14,19 +14,24 @@ AC_HELP_STRING([--with-openssl-path=DIR path to openssl libs and headers],
##########################################################################
OLD_LDFLAGS=$LDFLAGS
OLD_CPPFLAGS=$CPPFLAGS
-LDFLAGS="$AM_LDFLAGS $LDFLAGS"
-CPPFLAGS="$AM_CPPFLAGS $CPPFLAGS"
+LIBS="$OPENSSL_LIBS $LIBS"
+CPPFLAGS="$OPENSSL_CPPFLAGS $CPPFLAGS"
##########################################################################
# Check for OpenSSL availability
##########################################################################
-AC_CHECK_LIB([crypto], [EVP_EncryptInit], [],
+AC_CHECK_LIB([crypto], [EVP_EncryptInit], [OPENSSL_LIBS="$OPENSSL_LIBS -lcrypto"
+ OPENSSL_STATIC_LIBS="$OPENSSL_LIBS -ldl"],
[AC_MSG_FAILURE([OpenSSL libraries required])])
AC_CHECK_HEADERS([openssl/des.h openssl/rand.h openssl/hmac.h openssl/evp.h], [],
[AC_MSG_ERROR([OpenSSL headers required])])
+AC_SUBST([OPENSSL_CPPFLAGS])
+AC_SUBST([OPENSSL_LIBS])
+AC_SUBST([OPENSSL_STATIC_LIBS])
+
##########################################################################
# Restore old saved variables
##########################################################################
-LDFLAGS=$OLD_LDFLAGS
+LIBS=$OLD_LIBS
CPPFLAGS=$OLD_CPPFLAGS