Permalink
Browse files

autotools: add --enable-arch and --enable-alinker

this controls which target architecture will be built (arm or x86)
and which linker version should be compiled.

ex: --enable-arch=arm --enable-alinker=gb # compile for ARM using the gingerbread linker
Signed-off-by: Adrian Marius Negreanu <adrian.m.negreanu@intel.com>
  • Loading branch information...
groleo committed Apr 1, 2013
1 parent d101f47 commit 84f888d15cc5ceec941ff30ebd9d69481bd08dd1
Showing with 76 additions and 8 deletions.
  1. +27 −8 common/Makefile.am
  2. +49 −0 configure.ac
View
@@ -1,24 +1,43 @@
lib_LTLIBRARIES = \
libhybris-common.la
-# FIXME this has to be detected at configuration phase
+if WANT_ARCH_ARM
ARCHFLAGS = -DHAVE_ARM_TLS_REGISTER -DANDROID_ARM_LINKER
-# ARCHFLAGS = -DANDROID_X86_LINKER
+endif
+
+if WANT_ARCH_X86
+ARCHFLAGS = -DANDROID_X86_LINKER
+endif
+
+if WANT_GB
+LNKR = gingerbread
+endif
+
+if WANT_ICS
+LNKR = ics
+endif
+
+if WANT_JB
+LNKR = jb
+endif
+
+
+
libhybris_common_la_SOURCES = \
hooks.c \
properties.c \
strlcpy.c
libhybris_common_la_SOURCES += \
- gingerbread/dlfcn.c \
- gingerbread/linker.c \
- gingerbread/linker_environ.c \
- gingerbread/linker_format.c \
- gingerbread/rt.c
+ $(LNKR)/dlfcn.c \
+ $(LNKR)/linker.c \
+ $(LNKR)/linker_environ.c \
+ $(LNKR)/linker_format.c \
+ $(LNKR)/rt.c
libhybris_common_la_CFLAGS = \
-I$(top_srcdir)/include \
-I$(top_srcdir)/common \
- -I$(top_srcdir)/common/gingerbread \
+ -I$(top_srcdir)/common/$(LNKR) \
-DLINKER_DEBUG=1 \
-DLINKER_TEXT_BASE=0xB0000100 \
-DLINKER_AREA_SIZE=0x01000000 \
View
@@ -47,6 +47,51 @@ AC_ARG_ENABLE(mesa,
[mesa="no"])
AM_CONDITIONAL( [WANT_MESA], [test x"$mesa" = x"yes"])
+AC_ARG_ENABLE(arch,
+ [ --enable-arch[=arch] Compile specific CPU target(default=arm)
+ arm: compile for ARM
+ x86: Compile for x86],
+ [ if test "x$enableval" = "xarm" ; then
+ arch="arm"
+ elif test "x$enableval" = "xx86" ; then
+ arch="x86"
+ else
+ echo
+ echo "Error!"
+ echo "Unknown architecture' type"
+ exit -1
+ fi
+ ],
+ [arch="arm"]
+ )
+AM_CONDITIONAL([WANT_ARCH_ARM], [test x$arch = xarm])
+AM_CONDITIONAL([WANT_ARCH_X86], [test x$arch = xx86])
+
+AC_ARG_ENABLE(alinker,
+ [ --enable-alinker[=linker] Compile specific Android Linker (default=gingerbread)
+ gb: gingerbread
+ ics: Ice Cream sandwich
+ jb: Jelly Bean],
+ [ if test "x$enableval" = "xgb" ; then
+ alinker="gb"
+ elif test "x$enableval" = "xics" ; then
+ alinker="ics"
+ elif test "x$enableval" = "xjb" ; then
+ alinker="jb"
+ else
+ echo
+ echo "Error!"
+ echo "Unknown android version"
+ exit -1
+ fi
+ ],
+ [alinker="gingerbread"]
+ )
+AM_CONDITIONAL([WANT_GB], [test x$alinker = xbg])
+AM_CONDITIONAL([WANT_ICS], [test x$alinker = xics])
+AM_CONDITIONAL([WANT_JB], [test x$alinker = xjb])
+
+
AC_CONFIG_FILES([
Makefile
common/Makefile
@@ -69,6 +114,10 @@ echo " debug build.............: $debug"
echo
echo " prefix..................: $prefix"
echo
+echo " arch ..................: $arch"
+echo
+echo " linker..................: $alinker"
+echo
echo "------------------------------------------------------------------------"
echo
echo "Now type 'make' to compile and 'make install' to install this package."

0 comments on commit 84f888d

Please sign in to comment.