【发布时间】:2014-12-22 21:53:09
【问题描述】:
我需要在我的 makefile 中设置几个只需要特定于 Windows 的标志,即,我不希望它们在其他操作系统上被“看到”。我正在使用 MinGW 来构建我的项目。这些是我只想为 Windows 设置的标志:
AM_LDFLAGS += -lws2_32
AM_LDFLAGS += -Xlinker --allow-multiple-definition
这就是我在 makefile.am 中所做的:
SYS := $(shell gcc -dumpmachine)
ifneq (, $(findstring mingw, $(SYS)))
AM_LDFLAGS += -lws2_32
AM_LDFLAGS += -Xlinker --allow-multiple-definition
endif
当我执行autoreconf -isf 时,它失败并显示以下消息:
Makefile.am:34: endif without if
Makefile.am:30: `:='-style assignments are not portable
Makefile.am:30: shell gcc -dumpmachine: non-POSIX variable name
Makefile.am:30: (probably a GNU make extension)
Makefile.am:31: findstring mingw, $(SYS: non-POSIX variable name
Makefile.am:31: (probably a GNU make extension)
aminclude.mk:162: .PHONY was already defined in condition TRUE, which includes condition DX_COND_doc ...
Makefile.am:80: `aminclude.mk' included from here
core/Makefile.mk:169: ... `.PHONY' previously defined here
Makefile.am:56: `core/Makefile.mk' included from here
Makefile.am:271: <D: non-POSIX variable name
Makefile.am:230: user variable `distdir' defined here...
/mingw/share/automake-1.11/am/distdir.am: ... overrides Automake variable `distdir' defined here
autoreconf-2.68: automake failed with exit status: 1
对如何处理有什么建议吗?
【问题讨论】:
标签: linux windows makefile mingw autotools