Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makefile: don't build component if no libz or libcrypto #508

Merged
merged 1 commit into from
Oct 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ AC_CHECK_LIB(z, zlibVersion,
[ have_zlib=false ])
AM_CONDITIONAL([HAVE_ZLIB], [test "x$have_zlib" = "xtrue"])

AC_CHECK_LIB(crypto, DH_new,
[ AC_DEFINE(HAVE_CRYPTO, 1, [Have crypto])
have_crypto=true ],
[ have_crypto=false ])
AM_CONDITIONAL([HAVE_CRYPTO], [test "x$have_crypto" = "xtrue"])

AC_ARG_WITH(log_file,
AS_HELP_STRING([--with-log_file], [File to write log]),
WITH_LOG_FILE=$withvar, WITH_LOG_FILE=)
Expand Down
11 changes: 10 additions & 1 deletion test/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,13 @@ wd_mempool_test_LDADD=-L../.libs -l:libwd.so.2 -l:libwd_crypto.so.2 -lnuma
endif
wd_mempool_test_LDFLAGS=-Wl,-rpath,'/usr/local/lib'

SUBDIRS=. hisi_hpre_test hisi_sec_test hisi_zip_test
SUBDIRS=. hisi_sec_test

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are the test tools of the SEC module enabled by default?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, sec has no requirement of libz or libcrypto(openssl)

if HAVE_CRYPTO
SUBDIRS += hisi_hpre_test

if HAVE_ZLIB
SUBDIRS += hisi_zip_test
endif

endif
5 changes: 1 addition & 4 deletions test/hisi_hpre_test/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,4 @@ test_hisi_hpre_LDADD=-L../../.libs -l:libwd.so.2 -l:libwd_crypto.so.2 \
-lnuma
endif
test_hisi_hpre_LDFLAGS=-Wl,-rpath,'/usr/local/lib'
if WITH_OPENSSL_DIR
AM_CFLAGS+= -DWITH_OPENSSL_DIR
test_hisi_hpre_LDADD+= $(with_openssl_dir)/libcrypto_wd.so
endif
test_hisi_hpre_LDADD+= -lcrypto
12 changes: 2 additions & 10 deletions uadk_tool/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,7 @@ AM_CFLAGS += -DZLIB_FSE
uadk_tool_LDADD+= $(with_zlib_fse_dir)/libfse.a
endif

if WITH_OPENSSL_DIR
AM_CFLAGS+= -DWITH_OPENSSL_DIR -I$(with_openssl_dir)/include

if HAVE_CRYPTO
uadk_tool_SOURCES+=benchmark/sec_soft_benchmark.c benchmark/sec_soft_benchmark.h

if WD_STATIC_DRV
uadk_tool_LDADD+= $(with_openssl_dir)/libcrypto.a
else
uadk_tool_LDADD+= $(with_openssl_dir)/libcrypto.so.1.1
endif

uadk_tool_LDADD+=-lcrypto
endif
9 changes: 6 additions & 3 deletions v1/test/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@ AM_CFLAGS=-Wall -O0 -fno-strict-aliasing -I$(top_srcdir)/v1/internal -I$(top_src

SUBDIRS=. test_mm bmm_test

if HAVE_ZLIB
SUBDIRS+=hisi_zip_test
endif

SUBDIRS+=hisi_zip_test_sgl
SUBDIRS+=hisi_sec_test_sgl
SUBDIRS+=hisi_trng_test

if WITH_OPENSSL_DIR
if HAVE_CRYPTO
SUBDIRS+=hisi_hpre_test
SUBDIRS+=hisi_trng_test
SUBDIRS+=hisi_sec_test
SUBDIRS+=hisi_sec_test_sgl
endif