1
要看到什么,我试图做见下图:确定架构在Makefile.am用automake
我的问题是我怎么能有条件地设置我的Makefile.am内AM_CPPFLAGS或 my_lib_la_CPPFLAGS。这样,当配置 运行正确的CPPFLAGS设置?
目前我做的东西的影响:
lib_xml_wrapper_la_CPPFLAGS = -I../../
UNAME_S = $(shell uname -s)
UNAME_P = $(shell uname -p)
ifeq ($(UNAME_S),Linux)
lib_xml_wrapper_la_CPPFLAGS += -DLINUX
ifeq ($(UNAME_P),x86_64)
lib_xml_wrapper_la_CPPFLAGS += -D AMD64
endif
ifeq ($(UNAME_P),x86_64)
lib_xml_wrapper_la_CPPFLAGS += -I../../../external/xerces-c-3.1.1-x86_64-linux-gcc-3.4/include/
endif
ifneq ($(filter %86,$(UNAME_P)),)
lib_xml_wrapper_la_CPPFLAGS += -I../../../external/xerces-c-3.1.1-x86-linux-gcc-3.4/include/
endif
ifneq ($(filter arm%,$(UNAME_P)),)
lib_xml_wrapper_la_CPPFLAGS +=
endif
endif
ifeq ($(UNAME_S),Darwin)
lib_xml_wrapper_la_CPPFLAGS += -DOSX
ifneq ($(filter %86,$(UNAME_P)),)
lib_xml_wrapper_la_CPPFLAGS += -I../../../external/xerces-c-3.1.1-x86-macosx-gcc-3.4/include/
endif
ifneq ($(filter arm%,$(UNAME_P)),)
lib_xml_wrapper_la_CPPFLAGS +=
endif
endif
这似乎并不在Makefile.am工作。我收到以下错误:
xml_wrapper/Makefile.am:26: error: endif without if
xml_wrapper/Makefile.am:35: error: endif without if
automake: warnings are treated as errors
xml_wrapper/Makefile.am:10: warning: shell uname -s: non-POSIX variable name
xml_wrapper/Makefile.am:10: (probably a GNU make extension)
xml_wrapper/Makefile.am:11: warning: shell uname -p: non-POSIX variable name
xml_wrapper/Makefile.am:11: (probably a GNU make extension)
xml_wrapper/Makefile.am:20: warning: filter %86,$(UNAME_P: non-POSIX variable name
xml_wrapper/Makefile.am:20: (probably a GNU make extension)
xml_wrapper/Makefile.am:23: warning: filter arm%,$(UNAME_P: non-POSIX variable name
xml_wrapper/Makefile.am:23: (probably a GNU make extension)
xml_wrapper/Makefile.am:29: warning: filter %86,$(UNAME_P: non-POSIX variable name
xml_wrapper/Makefile.am:29: (probably a GNU make extension)
xml_wrapper/Makefile.am:32: warning: filter arm%,$(UNAME_P: non-POSIX variable name
xml_wrapper/Makefile.am:32: (probably a GNU make extension)
[Autoreconf可能以“非POSIX变量名”停止](http://stackoverflow.com/questions/15711824/autoreconf-stops-with-non-posix-variable-name) –
@MikeKinghan What我试过类似于那篇文章,但我所问的是不同的。 –