Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit dcbf397

Browse files
committed
In mingw builds, make our own import library for libtcl, too.
Per buildfarm results.
1 parent 1ea081b commit dcbf397

File tree

1 file changed

+25
-3
lines changed

1 file changed

+25
-3
lines changed

src/pl/tcl/Makefile

+25-3
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,29 @@ endif
2929
endif
3030

3131

32-
SHLIB_LINK = $(TCL_LIB_SPEC)
3332
ifneq ($(PORTNAME), win32)
34-
SHLIB_LINK += $(TCL_LIBS) -lc
35-
endif
33+
34+
SHLIB_LINK = $(TCL_LIB_SPEC) $(TCL_LIBS) -lc
35+
36+
else # win32
37+
38+
# Tcl on win32 ships with import libraries only for Microsoft Visual C++,
39+
# which are not compatible with mingw gcc. Therefore we need to build a
40+
# new import library to link with.
41+
42+
tclwithver = $(subst -l,,$(filter -l%, $(TCL_LIB_SPEC)))
43+
TCLDLL = $(subst -L,,$(filter -L%, $(TCL_LIB_SPEC)))/$(tclwithver).dll
44+
45+
OBJS += lib$(tclwithver).a
46+
47+
lib$(tclwithver).a: $(tclwithver).def
48+
dlltool --dllname $(tclwithver).dll --def $(tclwithver).def --output-lib lib$(tclwithver).a
49+
50+
$(tclwithver).def: $(TCLDLL)
51+
pexports $^ > $@
52+
53+
endif # win32
54+
3655

3756
NAME = pltcl
3857

@@ -96,4 +115,7 @@ endif # TCL_SHARED_BUILD = 0
96115
clean distclean maintainer-clean: clean-lib
97116
rm -f $(OBJS)
98117
rm -rf $(pg_regress_clean_files)
118+
ifeq ($(PORTNAME), win32)
119+
rm -f $(tclwithver).def
120+
endif
99121
$(MAKE) -C modules $@

0 commit comments

Comments
 (0)