Skip to content

Commit cb504a4

Browse files
committed
Change build of regress.so to use Makefile.shlib instead of depending
on the not-very-good .so pattern rules in the port-specific Makefiles. (This leaves only pgxs' MODULES case needing those rules.) Also, compile pgsleep.c locally and add it to regress.so to avoid failure on AIX.
1 parent ac65246 commit cb504a4

File tree

1 file changed

+28
-18
lines changed

1 file changed

+28
-18
lines changed

src/test/regress/GNUmakefile

Lines changed: 28 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
#-------------------------------------------------------------------------
22
#
33
# GNUmakefile--
4-
# Makefile for regress (the regression tests)
4+
# Makefile for src/test/regress (the regression tests)
55
#
6-
# Copyright (c) 1994, Regents of the University of California
6+
# Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
7+
# Portions Copyright (c) 1994, Regents of the University of California
78
#
8-
#
9-
# IDENTIFICATION
10-
# $PostgreSQL: pgsql/src/test/regress/GNUmakefile,v 1.50 2005/07/17 18:28:45 tgl Exp $
9+
# $PostgreSQL: pgsql/src/test/regress/GNUmakefile,v 1.51 2005/07/25 00:58:27 tgl Exp $
1110
#
1211
#-------------------------------------------------------------------------
1312

@@ -17,11 +16,6 @@ include $(top_builddir)/src/Makefile.global
1716

1817
contribdir := $(top_builddir)/contrib
1918

20-
override CPPFLAGS := -I$(libpq_srcdir) $(CPPFLAGS)
21-
override CFLAGS += $(CFLAGS_SL)
22-
23-
SHLIB_LINK = $(BE_DLLLIBS)
24-
2519
# port number for temp-installation test postmaster
2620
TEMP_PORT = 5$(DEF_PGPORT)
2721

@@ -59,13 +53,28 @@ pg_regress: pg_regress.sh GNUmakefile $(top_builddir)/src/Makefile.global
5953

6054
# Build dynamically-loaded object file for CREATE FUNCTION ... LANGUAGE 'C'.
6155

62-
DLOBJS := regress$(DLSUFFIX)
63-
# This is for some platforms
64-
ifdef EXPSUFF
65-
DLOBJS += regress$(EXPSUFF)
66-
endif
56+
NAME = regress
57+
SO_MAJOR_VERSION= 0
58+
SO_MINOR_VERSION= 0
59+
OBJS = regress.o pgsleep.o
60+
SHLIB_LINK = $(BE_DLLLIBS)
61+
62+
include $(top_srcdir)/src/Makefile.shlib
63+
64+
all: $(NAME)$(DLSUFFIX)
65+
66+
$(NAME)$(DLSUFFIX): $(shlib)
67+
rm -f $(NAME)$(DLSUFFIX)
68+
$(LN_S) $(shlib) $(NAME)$(DLSUFFIX)
69+
70+
# regress.so needs pg_usleep, which on some platforms can't be linked
71+
# from the main backend (though I'd sure like to know why not).
72+
# We can't incorporate libpgport directly either, since it's not built
73+
# with appropriate options to build a shared lib. Instead,
74+
# symlink the source file in here and build our own object file.
6775

68-
all: $(DLOBJS)
76+
pgsleep.c: % : $(top_srcdir)/src/port/%
77+
rm -f $@ && $(LN_S) $< .
6978

7079

7180
# Build test input and expected files
@@ -163,10 +172,11 @@ bigcheck:
163172
## Clean up
164173
##
165174

166-
clean distclean maintainer-clean:
175+
clean distclean maintainer-clean: clean-lib
167176
# things built by `all' target
177+
rm -f $(NAME)$(DLSUFFIX) $(OBJS) pgsleep.c
168178
$(MAKE) -C $(contribdir)/spi clean
169-
rm -f $(output_files) $(input_files) $(DLOBJS) regress.o pg_regress
179+
rm -f $(output_files) $(input_files) pg_regress
170180
# things created by various check targets
171181
rm -rf testtablespace
172182
rm -rf results tmp_check log

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy