aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2018-06-15 18:30:34 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2018-06-15 18:30:34 +0300
commitfe454142baf868492ac3423178bfeb337e80210e (patch)
treea1a54b7f24b3f3a66d9bba6485fb8889966de685
parent9a59eb3d2ab5ac0ff15953939447deff87c5f0e2 (diff)
Use built-in support for .def files
-rw-r--r--libpq/buildfile23
1 files changed, 5 insertions, 18 deletions
diff --git a/libpq/buildfile b/libpq/buildfile
index 7b5a2c0..b5fe3b9 100644
--- a/libpq/buildfile
+++ b/libpq/buildfile
@@ -12,7 +12,7 @@
h = version.h libpq-fe.h libpq-events.h \
postgresql/postgres_ext.h postgresql/pg_config_ext.h
-lib{pq}: c{*} h{$h} file{**.h -{$h}} file{win32/libpqdll.def} \
+lib{pq}: c{*} h{$h} file{**.h -{$h}} def{win32/libpqdll} \
file{pg_service.conf.sample}
tclass = $c.target.class
@@ -150,24 +150,8 @@ else
obj{fe-connect}: c.poptions += -DSYSCONFDIR="\"$sysconfdir\""
if ($tclass != "windows")
-{
c.libs += -lpthread
-}
else
-{
- def = $src_base/win32/libpqdll.def
-
- if ($c.target.system == "mingw32")
- {
- c.libs += -lsecur32 -lws2_32 -ladvapi32
- libs{pq}: c.libs =+ $def
- }
- else
- {
- c.libs += secur32.lib ws2_32.lib advapi32.lib
- libs{pq}: c.libs =+ "/DEF:$def"
- }
-
# The original package also adds the resource file to the library. The file
# contains only the version information. First, libpq.rc is produced from
# libpq.rc.in with the following command:
@@ -182,7 +166,10 @@ else
# Afterwards libpqrc.o is linked to the library.
#
# @@ Currently we don't have support for the first two steps.
-}
+ #
+ c.libs += $regex.apply(secur32 ws2_32 advapi32, \
+ '(.+)', \
+ $c.target.system == "mingw32" ? '-l\1' : '\1.lib')
lib{pq}: cc.export.poptions = "-I$src_base" "-I$src_base/postgresql"