Skip to content

Commit

Permalink
Unicode: build tests with unicode.c instead of .o to fix builds witho…
Browse files Browse the repository at this point in the history
…ut openssl
  • Loading branch information
AlekseyCherepanov committed Sep 15, 2024
1 parent d575941 commit d9c9ee7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
5 changes: 4 additions & 1 deletion src/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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@

Expand Down
4 changes: 2 additions & 2 deletions src/Makefile.legacy
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 0 additions & 2 deletions src/tests/unit-tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit d9c9ee7

Please sign in to comment.