Skip to content

Commit

Permalink
add support for building with pkgconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
samuel40791765 committed Nov 16, 2023
1 parent b15b9d3 commit 7f56458
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 0 deletions.
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1112,3 +1112,11 @@ FILE(STRINGS "include/openssl/opensslv.h"
if(NOT ${BASE_VERSION_NUMBER} MATCHES ${OPENSSLV_VERSION_NUMBER})
message( FATAL_ERROR "OPENSSL_VERSION_NUMBER in base.h and opensslv.h should match.")
endif()

set(VERSION 1.1.1)
file(GLOB OPENSSL_PKGCONFIGS "pkgconfig/*.pc.in")
foreach(in_file ${OPENSSL_PKGCONFIGS})
string(REPLACE ".in" "" pc_file ${in_file})
configure_file(${in_file} ${CMAKE_CURRENT_BINARY_DIR}/${pc_file} @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${pc_file} DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
endforeach()
9 changes: 9 additions & 0 deletions pkgconfig/libcrypto.pc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
prefix=@CMAKE_INSTALL_PREFIX@
libdir=${prefix}/lib
includedir=${prefix}/include

Name: AWS-LC-libcrypto
Description: AWS-LC cryptography library
Version: @VERSION@
Libs: -L${libdir} -lcrypto
Cflags: -I${includedir}
10 changes: 10 additions & 0 deletions pkgconfig/libssl.pc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
prefix=@CMAKE_INSTALL_PREFIX@
libdir=${prefix}/lib
includedir=${prefix}/include

Name: AWS-LC-libssl
Description: AWS-LC (OpenSSL SHIM)
Version: @VERSION@
Requires.private: libcrypto
Libs: -L${libdir} -lssl
Cflags: -I${includedir}
8 changes: 8 additions & 0 deletions pkgconfig/openssl.pc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
prefix=@CMAKE_INSTALL_PREFIX@
libdir=${prefix}/lib
includedir=${prefix}/include

Name: AWS-LC
Description: AWS-LC (OpenSSL SHIM)
Version: @VERSION@
Requires: libssl libcrypto

0 comments on commit 7f56458

Please sign in to comment.