tests: Use AM_LDFLAGS for -static flag to allow LDFLAGS override

Fixes the following warning from automake:

tests/Makefile.am:3: warning: 'LDFLAGS' is a user variable, you should not override it;
tests/Makefile.am:3: use 'AM_LDFLAGS' instead

Also, since stress_mt_LDFLAGS is set (even in a conditional), AM_LDFLAGS
will not be applied for stress_mt unless added explicitly.

Closes #1371

Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
This commit is contained in:
Tormod Volden
2023-12-10 14:15:37 +01:00
parent 43db4d97d7
commit 52bb0ede72
2 changed files with 4 additions and 3 deletions

View File

@@ -1 +1 @@
#define LIBUSB_NANO 11846
#define LIBUSB_NANO 11847

View File

@@ -1,6 +1,6 @@
AM_CPPFLAGS = -I$(top_srcdir)/libusb
LDADD = ../libusb/libusb-1.0.la
LDFLAGS = -static
AM_LDFLAGS = -static
stress_SOURCES = stress.c testlib.c
stress_mt_SOURCES = stress_mt.c
@@ -10,13 +10,14 @@ macos_SOURCES = macos.c testlib.c
stress_mt_CFLAGS = $(AM_CFLAGS) $(THREAD_CFLAGS)
stress_mt_LDADD = $(LDADD) $(THREAD_LIBS)
stress_mt_LDFLAGS = $(AM_LDFLAGS)
if OS_EMSCRIPTEN
# On the Web you can't block the main thread as this blocks the event loop itself,
# causing deadlocks when trying to use async APIs like WebUSB.
# We use the PROXY_TO_PTHREAD Emscripten's feature to move the main app to a separate thread
# where it can block safely.
stress_mt_LDFLAGS = ${AM_LDFLAGS} -s PROXY_TO_PTHREAD -s EXIT_RUNTIME
stress_mt_LDFLAGS += ${AM_LDFLAGS} -s PROXY_TO_PTHREAD -s EXIT_RUNTIME
endif
noinst_HEADERS = libusb_testlib.h