diff --git a/Makefile.am b/Makefile.am index 8335c92..3a8e603 100644 --- a/Makefile.am +++ b/Makefile.am @@ -60,21 +60,25 @@ pkginclude_HEADERS += $(sort ${extern_hdrs}) libisal_la_SOURCES = ${lsrc} if CPU_X86_64 +ARCH=-Dx86_64 libisal_la_SOURCES += ${lsrc_x86_64} other_tests += ${other_tests_x86_64} endif if CPU_X86_32 +ARCH=-Dx86_32 libisal_la_SOURCES += ${lsrc_x86_32} other_tests += ${other_tests_x86_32} endif if CPU_AARCH64 +ARCH=-Daarch64 libisal_la_SOURCES += ${lsrc_aarch64} other_tests += ${other_tests_aarch64} endif if CPU_PPC64LE +ARCH=-Dppc64le libisal_la_SOURCES += ${lsrc_ppc64le} other_tests += ${other_tests_ppc64le} endif @@ -132,7 +136,7 @@ CCAS = $(as_filter) EXTRA_DIST += tools/yasm-filter.sh tools/nasm-filter.sh EXTRA_DIST += tools/yasm-cet-filter.sh tools/nasm-cet-filter.sh -AM_CFLAGS = ${my_CFLAGS} ${INCLUDE} $(src_include) ${D} +AM_CFLAGS = ${my_CFLAGS} ${INCLUDE} $(src_include) ${ARCH} ${D} if CPU_AARCH64 AM_CCASFLAGS = ${AM_CFLAGS} else diff --git a/make.inc b/make.inc index 16303bd..993cb9c 100644 --- a/make.inc +++ b/make.inc @@ -122,7 +122,7 @@ endif D := INCLUDE = $(patsubst %,-I%/,$(subst :, ,$(VPATH))) -CFLAGS = $(CFLAGS_$(arch)) $(CFLAGS_$(CC)) $(DEBUG) -O2 $(DEFINES) $(INCLUDE) +CFLAGS = $(CFLAGS_$(arch)) $(CFLAGS_$(CC)) $(DEBUG) -O2 $(DEFINES) $(INCLUDE) -D$(host_cpu) ASFLAGS = $(ASFLAGS_$(arch)) $(ASFLAGS_$(CC)) $(DEBUG_$(AS)) $(DEFINES) $(INCLUDE) ARFLAGS = $(ARFLAGS_$(arch)) DEFINES += $(addprefix -D , $D)