Selecting the CPU and OS is better handled in configure.ac
, which has AC_CANONICAL_HOST
which parses the output from uname
and puts it in a standard format:
configure.ac
...
AC_CANONICAL_HOST
WRAPPER_CPPFLAGS=""
AS_CASE([$host_os],
[linux*],
[
WRAPPER_CPPFLAGS="$WRAPPER_CPPFLAGS -DLINUX"
AS_CASE([$host_cpu],
[x86_64],
[
WRAPPER_CPPFLAGS="$WRAPPER_CPPFLAGS -DAMD64 -I../../../external/xerces-c-3.1.1-x86_64-linux-gcc-3.4/include"
],
[i?86],
[
WRAPPER_CPPFLAGS="$WRAPPER_CPPFLAGS -I../../../external/xerces-c-3.1.1-x86-linux-gcc-3.4/include"
])
],
[darwin*],
[
WRAPPER_CPPFLAGS="$WRAPPER_CPPFLAGS -DOSX"
AS_CASE([$host_cpu],
[i?86],
[
WRAPPER_CPPFLAGS="$WRAPPER_CPPFLAGS -I../../../external/xerces-c-3.1.1-x86-macosx-gcc-3.4/include"
])
])
AC_SUBST([WRAPPER_CPPFLAGS])
Makefile.am
...
lib_xml_wrapper_la_CPPFLAGS = -I../.. $(WRAPPER_CPPFLAGS)