Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/rofl0r/proxychains-ng.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrofl0r <rofl0r@users.noreply.github.com>2021-04-30 18:15:30 +0300
committerrofl0r <rofl0r@users.noreply.github.com>2021-04-30 18:15:30 +0300
commit6af2686a52e0e2272f8167cc170e9c572157e7b3 (patch)
tree474ee4a92a4bfa2165763da17275d65cc74087f7
parent918855deed4684eccc93a95c82fec840569fb334 (diff)
configure: check for -pthread vs -lpthread (#379)
-rw-r--r--Makefile2
-rwxr-xr-xconfigure9
2 files changed, 10 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index d124ac9..7f3f4fa 100644
--- a/Makefile
+++ b/Makefile
@@ -30,7 +30,7 @@ GENH = src/version.h
CFLAGS += -Wall -O0 -g -std=c99 -D_GNU_SOURCE -pipe
NO_AS_NEEDED = -Wl,--no-as-needed
LIBDL = -ldl
-LDFLAGS = -fPIC $(NO_AS_NEEDED) $(LIBDL) -lpthread
+LDFLAGS = -fPIC $(NO_AS_NEEDED) $(LIBDL) $(PTHREAD)
INC =
PIC = -fPIC
AR = $(CROSS_COMPILE)ar
diff --git a/configure b/configure
index 7157484..1e9ca3f 100755
--- a/configure
+++ b/configure
@@ -208,6 +208,15 @@ fi
echo "$LD_SONAME_FLAG"
echo "LD_SET_SONAME = -Wl,$LD_SONAME_FLAG," >> config.mak
+if check_link "checking whether we can use -lpthread" "-lpthread" \
+"int main(){return 0;}" ; then
+echo "PTHREAD = -lpthread" >> config.mak
+else
+check_link "checking whether we can use -pthread" "-pthread" \
+"int main(){return 0;}" || fail "no pthread support detected"
+echo "PTHREAD = -pthread" >> config.mak
+fi
+
make_cmd=make
if ismac ; then
echo LDSO_SUFFIX=dylib>>config.mak