They're all barfing along this line:
dlltool --export-all --output-def libpg_trgmdll.def trgm_op.o trgm_gist.o trgm_gin.o
dllwrap -o pg_trgm.dll --dllname pg_trgm.dll --def libpg_trgmdll.def trgm_op.o trgm_gist.o trgm_gin.o
-L../../src/backend-lpostgres -L../../src/port -L/mingw/lib
Info: resolving _pg_crc32_table by linking to __imp__pg_crc32_table (auto-import)
fu000001.o(.idata$3+0xc): undefined reference to `libpostgres_a_iname'
nmth000000.o(.idata$4+0x0): undefined reference to `_nm__pg_crc32_table'
c:\MinGW\bin\dllwrap.exe: c:\MinGW\bin\gcc exited with status 1
I suspect this might be a missing-PGDLLIMPORT issue, but not in a
position to fool with it right now.
regards, tom lane