From d9c9ee7db3300fab0d3918192d1b1b42d8fead3b Mon Sep 17 00:00:00 2001 From: Aleksey Cherepanov Date: Mon, 16 Sep 2024 02:17:57 +0300 Subject: [PATCH] Unicode: build tests with unicode.c instead of .o to fix builds without openssl --- src/Makefile.in | 5 ++++- src/Makefile.legacy | 4 ++-- src/tests/unit-tests.c | 2 -- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Makefile.in b/src/Makefile.in index 4bf7378223..40a9b01b7d 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -803,7 +803,7 @@ testfiles: ############################################################################### UNIT_TEST_OBJS = \ - tests/unit-tests.o tests/misc.o tests/common.o tests/memory.o tests/sha2.o unicode.o + tests/unit-tests.o tests/misc.o tests/common.o tests/memory.o tests/sha2.o tests/unicode.o UNIT_TEST_INCLUDED_PIECES = \ tests/test_valid_utf8.c @@ -823,6 +823,9 @@ tests/common.o: common.c arch.h common.h memory.h os.h os-autoconf.h autoconfig. tests/memory.o: memory.c arch.h misc.h jumbo.h autoconfig.h memory.h common.h johnswap.h os.h os-autoconf.h $(CC) -o tests/memory.o $(CFLAGS) -D_JOHN_MISC_NO_LOG memory.c +tests/unicode.o: unicode.o # just to have all the same deps + $(CC) -o tests/unicode.o $(CFLAGS) -DUNICODE_NO_OPTIONS -DNOT_JOHN unicode.c + # keep the 'easy name' build target of unit-tests The 'real' target is ../run/unit-tests[.exe] unit-tests: ../run/unit-tests@EXE_EXT@ diff --git a/src/Makefile.legacy b/src/Makefile.legacy index 11e3ffccb5..9eddff3349 100644 --- a/src/Makefile.legacy +++ b/src/Makefile.legacy @@ -337,8 +337,8 @@ default: @echo "beos-x86-any BeOS, x86" @echo "generic Any other Unix-like system with gcc" -unit-tests: unicode.o - $(CC) -o ../run/unit-tests -Wall -O2 -fomit-frame-pointer -DFORCE_GENERIC_SHA2 -D_JOHN_MISC_NO_LOG tests/unit-tests.c misc.c common.c memory.c sha2.c unicode.o -lcrypto +unit-tests: + $(CC) -o ../run/unit-tests -Wall -O2 -fomit-frame-pointer -DFORCE_GENERIC_SHA2 -D_JOHN_MISC_NO_LOG -DUNICODE_NO_OPTIONS -DNOT_JOHN tests/unit-tests.c misc.c common.c memory.c sha2.c unicode.c ../run/unit-tests linux-x86-64-avx512: diff --git a/src/tests/unit-tests.c b/src/tests/unit-tests.c index 9494b34295..fa145aa6cb 100644 --- a/src/tests/unit-tests.c +++ b/src/tests/unit-tests.c @@ -45,8 +45,6 @@ #include "../sha2.h" -struct options_main options; /* fake symbol to compile with unicode.o */ - char *_fgetl_pad = NULL; #ifdef __sun /* Solaris fprintf() seems to get confused at around 16384 */