From 4196e8f4c9148d0f0ff6572d5cc0a814150d72eb Mon Sep 17 00:00:00 2001 From: Mikhail Romanko Date: Sat, 6 Sep 2025 16:19:50 +0300 Subject: Make MT flags configurable in configure script Remove hardcoded multithreading flags so that we can support exotic compilers/OSs --- configure | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/configure b/configure index a6e35a2..903cbf2 100755 --- a/configure +++ b/configure @@ -18,6 +18,9 @@ cflags=${CFLAGS} ldflags=${LDFLAGS} ldlibs=${LDLIBS} ldshared=${LDSHARED:--shared} +cflagsmt=${CFLAGSMT:--pthread} +ldflagsmt=${LDFLAGSMT:--pthread} +ldlibsmt=${LDLIBSMT} platform="" display_help="no" @@ -32,6 +35,9 @@ for option do --ldflags=*) ldflags="${option#--ldflags=}" ;; --ldlibs=*) ldlibs="${option#--ldlibs=}" ;; --ldshared=*) ldshared="${option#--ldshared=}" ;; + --cflagsmt=*) cflagsmt="${option#--cflagsmt=}" ;; + --ldflagsmt=*) ldflagsmt="${option#--ldflagsmt=}" ;; + --ldlibsmt=*) ldlibsmt="${option#--ldlibsmt=}" ;; --platform=*) platform="${option#--platform=}" ;; --prefix=*) prefix_path="${option#--prefix=}" ;; --enable-shared|--enable-shared=yes) enable_shared="yes" ;; @@ -65,8 +71,11 @@ Options: --arflags= Archiver flags --cflags= Compiler flags --ldflags= Linker flags - --ldlibs= Extra libraries + --ldlibs= Linker libraries --ldshared= Linker flags for shared libraries + --cflagsmt= Compiler flags for multithreading + --ldflagsmt= Linker flags for multithreading + --ldlibsmt= Linker libraries for multithreading --platform=[Posix|Win32|Dummy] Specify target platform --prefix= Install prefix --enable-shared[=yes|no] Make shared library @@ -124,8 +133,10 @@ if [ "$enable_pic" = "no" ] && [ "$enable_shared" = "yes" ]; then echo "configure: WARNING: expect build failure" fi -if [ "$enable_mt" = "yes" ] && [ "$platform" = "Posix" ]; then - ldlibs="$ldlibs -pthread" +if [ "$enable_mt" = "yes" ]; then + cflags="$cflags $cflagsmt" + ldflags="$ldflags $ldflagsmt" + ldlibs="$ldlibs $ldlibsmt" fi # Create directories -- cgit v1.2.3