From d130cacf5be53b4c15bb64787d82b1225b1485e7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
Date: Sat, 17 Apr 2021 13:10:34 +0200
Subject: [PATCH] Check for clock_gettime() only when linking statically

The extension module does not use clock_gettime() directly, so I presume
it is only necessary when linking statically to FreeTDS.
---
 setup.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/setup.py b/setup.py
index 3ac434e..0295d01 100644
--- a/setup.py
+++ b/setup.py
@@ -95,7 +95,7 @@ if not WINDOWS:
 print("setup.py: include_dirs =>", include_dirs)
 print("setup.py: library_dirs =>", library_dirs)
 
-if not WINDOWS:
+if LINK_FREETDS_STATICALLY and not WINDOWS:
     # check for clock_gettime, link with librt for glibc<2.17
     from dev import ccompiler
     compiler = ccompiler.new_compiler()
-- 
2.31.1

