Permalink
Browse files

Reenable oprofile host build.

Now taking into account differences in the library dependencies of
libintl on darwin vs. linux.  On darwin, we need to link with libiconv
which is provided as a shared library on the platform.  On linux,
iconv is included in libc so we don't need anything special.

Change-Id: Ide89061cce0352c83b7401d9f5d594e9625b1868
  • Loading branch information...
1 parent f06448b commit 6e67eb0359ee670a3eccd17dcc7eb0ffa3531d7b @j9brown j9brown committed Apr 8, 2011
Showing with 59 additions and 55 deletions.
  1. +11 −10 common.mk
  2. +6 −1 daemon/Android.mk
  3. +10 −6 libabi/Android.mk
  4. +2 −3 libdb/Android.mk
  5. +2 −3 libop/Android.mk
  6. +1 −2 libopt++/Android.mk
  7. +2 −3 libpopt/Android.mk
  8. +2 −3 libpp/Android.mk
  9. +1 −2 libregex/Android.mk
  10. +2 −3 libutil++/Android.mk
  11. +2 −3 libutil/Android.mk
  12. +5 −1 opcontrol/Android.mk
  13. +13 −15 pp/Android.mk
View
@@ -32,21 +32,22 @@ common_target_c_includes := $(common_c_includes)
common_target_cflags := $(common_cflags)
# Common host flags
-# FIXME: Temporarily disabled until we get libiconv.a in the prebuilts.
-#ifeq ($(strip $(TARGET_ARCH)),arm)
-#toolchain := prebuilt/$(HOST_PREBUILT_TAG)/toolchain/arm-linux-androideabi-4.4.x
-#HAVE_LIBBFD := true
-#else
HAVE_LIBBFD := false
-#endif
-ifeq ($(HAVE_LIBBFD),true)
+ifeq ($(TARGET_ARCH),arm)
+toolchain := prebuilt/$(HOST_PREBUILT_TAG)/toolchain/arm-linux-androideabi-4.4.x
common_host_c_includes := $(common_c_includes) $(toolchain)/include
+common_host_cflags := $(common_cflags) -fexceptions -DANDROID_HOST -DHAVE_XCALLOC
+common_host_ldlibs_libiconv :=
-common_host_cflags = $(common_cflags) -fexceptions -DANDROID_HOST -DHAVE_XCALLOC
-ifneq ($(HOST_OS),linux)
+ifeq ($(HOST_OS)-$(HOST_ARCH),darwin-x86)
+HAVE_LIBBFD := true
common_host_cflags += -DMISSING_MREMAP
+common_host_ldlibs_libiconv := -liconv
+else
+ifeq ($(HOST_OS)-$(HOST_ARCH),linux-x86)
+HAVE_LIBBFD := true
+endif
endif
-common_host_ldflags := -L$(toolchain)/lib
endif
View
@@ -36,7 +36,12 @@ LOCAL_SRC_FILES:= \
opd_trans.c \
oprofiled.c
-LOCAL_STATIC_LIBRARIES := libpopt libutil libdb libabi libop
+LOCAL_STATIC_LIBRARIES := \
+ liboprofile_popt \
+ liboprofile_util \
+ liboprofile_db \
+ liboprofile_abi \
+ liboprofile_op
LOCAL_C_INCLUDES := $(common_target_c_includes)
LOCAL_CFLAGS := $(common_target_cflags)
View
@@ -25,7 +25,7 @@ LOCAL_SRC_FILES:= $(libabi_common_src)
LOCAL_C_INCLUDES := $(common_target_c_includes)
LOCAL_CFLAGS := $(common_target_cflags)
LOCAL_MODULE_TAGS := optional
-LOCAL_MODULE := libabi
+LOCAL_MODULE := liboprofile_abi
include $(BUILD_STATIC_LIBRARY)
@@ -39,9 +39,8 @@ LOCAL_SRC_FILES:= \
LOCAL_C_INCLUDES := $(common_host_c_includes)
LOCAL_CFLAGS := $(common_host_cflags)
-LOCAL_LDFLAGS := $(common_host_ldflags)
LOCAL_MODULE_TAGS := optional
-LOCAL_MODULE := libabi
+LOCAL_MODULE := liboprofile_abi
include $(BUILD_HOST_STATIC_LIBRARY)
endif
@@ -53,9 +52,14 @@ include $(CLEAR_VARS)
LOCAL_SRC_FILES:= opimport.cpp
LOCAL_C_INCLUDES := $(common_host_c_includes)
LOCAL_CFLAGS := $(common_host_cflags)
-LOCAL_LDFLAGS := $(common_host_ldflags)
-LOCAL_STATIC_LIBRARIES := libabi libdb libopt++ libutil libutil++ libpopt
-LOCAL_LDLIBS := -liberty
+LOCAL_STATIC_LIBRARIES := \
+ liboprofile_abi \
+ liboprofile_db \
+ liboprofile_opt++ \
+ liboprofile_util \
+ liboprofile_util++ \
+ liboprofile_popt \
+ libiberty
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE := opimport
View
@@ -29,7 +29,7 @@ LOCAL_SRC_FILES:= $(common_src)
LOCAL_C_INCLUDES := $(common_target_c_includes)
LOCAL_CFLAGS := $(common_target_cflags)
LOCAL_MODULE_TAGS := optional
-LOCAL_MODULE := libdb
+LOCAL_MODULE := liboprofile_db
include $(BUILD_STATIC_LIBRARY)
@@ -40,10 +40,9 @@ include $(CLEAR_VARS)
LOCAL_SRC_FILES:= $(common_src)
LOCAL_C_INCLUDES := $(common_host_c_includes)
LOCAL_CFLAGS := $(common_host_cflags)
-LOCAL_LDFLAGS := $(common_host_ldflags)
LOCAL_MODULE_TAGS := optional
-LOCAL_MODULE := libdb
+LOCAL_MODULE := liboprofile_db
include $(BUILD_HOST_STATIC_LIBRARY)
endif
View
@@ -33,7 +33,7 @@ LOCAL_SRC_FILES:= $(common_src)
LOCAL_C_INCLUDES := $(common_target_c_includes)
LOCAL_CFLAGS := $(common_target_cflags)
LOCAL_MODULE_TAGS := optional
-LOCAL_MODULE := libop
+LOCAL_MODULE := liboprofile_op
include $(BUILD_STATIC_LIBRARY)
@@ -44,9 +44,8 @@ include $(CLEAR_VARS)
LOCAL_SRC_FILES:= $(common_src)
LOCAL_C_INCLUDES := $(common_host_c_includes)
LOCAL_CFLAGS := $(common_host_cflags)
-LOCAL_LDFLAGS := $(common_host_ldflags)
LOCAL_MODULE_TAGS := optional
-LOCAL_MODULE := libop
+LOCAL_MODULE := liboprofile_op
include $(BUILD_HOST_STATIC_LIBRARY)
endif
View
@@ -22,9 +22,8 @@ include $(CLEAR_VARS)
LOCAL_SRC_FILES:= popt_options.cpp
LOCAL_C_INCLUDES := $(common_host_c_includes)
LOCAL_CFLAGS := $(common_host_cflags)
-LOCAL_LDFLAGS := $(common_host_ldflags)
LOCAL_MODULE_TAGS := optional
-LOCAL_MODULE := libopt++
+LOCAL_MODULE := liboprofile_opt++
include $(BUILD_HOST_STATIC_LIBRARY)
endif
View
@@ -29,7 +29,7 @@ LOCAL_SRC_FILES:= $(common_src)
LOCAL_C_INCLUDES := $(common_target_c_includes)
LOCAL_CFLAGS := $(common_target_cflags)
LOCAL_MODULE_TAGS := optional
-LOCAL_MODULE := libpopt
+LOCAL_MODULE := liboprofile_popt
include $(BUILD_STATIC_LIBRARY)
@@ -40,9 +40,8 @@ include $(CLEAR_VARS)
LOCAL_SRC_FILES:= $(common_src)
LOCAL_C_INCLUDES := $(common_host_c_includes)
LOCAL_CFLAGS := $(common_host_cflags)
-LOCAL_LDFLAGS := $(common_host_ldflags)
LOCAL_MODULE_TAGS := optional
-LOCAL_MODULE := libpopt
+LOCAL_MODULE := liboprofile_popt
include $(BUILD_HOST_STATIC_LIBRARY)
endif
View
@@ -44,9 +44,8 @@ LOCAL_SRC_FILES:= \
LOCAL_C_INCLUDES := $(common_host_c_includes)
LOCAL_CFLAGS := $(common_host_cflags)
-LOCAL_LDFLAGS := $(common_host_ldflags)
LOCAL_MODULE_TAGS := optional
-LOCAL_MODULE := libpp
+LOCAL_MODULE := liboprofile_pp
include $(BUILD_HOST_STATIC_LIBRARY)
-endif
+endif
View
@@ -26,9 +26,8 @@ LOCAL_SRC_FILES:= \
LOCAL_C_INCLUDES := $(common_host_c_includes)
LOCAL_CFLAGS := $(common_host_cflags)
-LOCAL_LDFLAGS := $(common_host_ldflags)
LOCAL_MODULE_TAGS := optional
-LOCAL_MODULE := libop_regex
+LOCAL_MODULE := liboprofile_op_regex
include $(BUILD_HOST_STATIC_LIBRARY)
endif
View
@@ -37,9 +37,8 @@ LOCAL_SRC_FILES:= \
LOCAL_C_INCLUDES := $(common_host_c_includes)
LOCAL_CFLAGS := $(common_host_cflags)
-LOCAL_LDFLAGS := $(common_host_ldflags)
LOCAL_MODULE_TAGS := optional
-LOCAL_MODULE := libutil++
+LOCAL_MODULE := liboprofile_util++
include $(BUILD_HOST_STATIC_LIBRARY)
-endif
+endif
View
@@ -35,7 +35,7 @@ LOCAL_SRC_FILES:= $(common_src)
LOCAL_C_INCLUDES := $(common_target_c_includes)
LOCAL_CFLAGS := $(common_target_cflags)
LOCAL_MODULE_TAGS := optional
-LOCAL_MODULE := libutil
+LOCAL_MODULE := liboprofile_util
include $(BUILD_STATIC_LIBRARY)
@@ -46,9 +46,8 @@ include $(CLEAR_VARS)
LOCAL_SRC_FILES:= $(common_src)
LOCAL_C_INCLUDES := $(common_host_c_includes)
LOCAL_CFLAGS := $(common_host_cflags)
-LOCAL_LDFLAGS := $(common_host_ldflags)
LOCAL_MODULE_TAGS := optional
-LOCAL_MODULE := libutil
+LOCAL_MODULE := liboprofile_util
include $(BUILD_HOST_STATIC_LIBRARY)
endif
View
@@ -26,7 +26,11 @@ LOCAL_SRC_FILES:= \
opcontrol.cpp
LOCAL_STATIC_LIBRARIES := \
- libpopt libutil libdb libabi libop
+ liboprofile_popt \
+ liboprofile_util \
+ liboprofile_db \
+ liboprofile_abi \
+ liboprofile_op
LOCAL_C_INCLUDES := $(common_target_c_includes)
LOCAL_CFLAGS := $(common_target_cflags)
View
@@ -19,17 +19,19 @@ include $(LOCAL_PATH)/../common.mk
common_src := common_option.cpp
common_libs := \
- libpp \
- libop \
- libutil \
- libdb \
- libop_regex \
- libopt++ \
- libutil++ \
- libpopt \
- libz
-
-common_ldlibs := -lbfd -liberty -lintl -liconv
+ liboprofile_pp \
+ liboprofile_db \
+ liboprofile_op_regex \
+ liboprofile_opt++ \
+ liboprofile_util++ \
+ liboprofile_popt \
+ liboprofile_op \
+ liboprofile_util \
+ libbfd \
+ libiberty \
+ libintl
+
+common_ldlibs := -lz $(common_host_ldlibs_libiconv)
ifeq ($(HAVE_LIBBFD),true)
@@ -44,7 +46,6 @@ LOCAL_SRC_FILES:= \
LOCAL_STATIC_LIBRARIES := $(common_libs)
LOCAL_C_INCLUDES := $(common_host_c_includes)
LOCAL_CFLAGS := $(common_host_cflags)
-LOCAL_LDFLAGS := $(common_host_ldflags)
LOCAL_LDLIBS := $(common_ldlibs)
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE:= opreport
@@ -62,7 +63,6 @@ LOCAL_SRC_FILES:= \
LOCAL_STATIC_LIBRARIES := $(common_libs)
LOCAL_C_INCLUDES := $(common_host_c_includes)
LOCAL_CFLAGS := $(common_host_cflags)
-LOCAL_LDFLAGS := $(common_host_ldflags)
LOCAL_LDLIBS := $(common_ldlibs)
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE:= opannotate
@@ -80,7 +80,6 @@ LOCAL_SRC_FILES:= \
LOCAL_STATIC_LIBRARIES := $(common_libs)
LOCAL_C_INCLUDES := $(common_host_c_includes)
LOCAL_CFLAGS := $(common_host_cflags)
-LOCAL_LDFLAGS := $(common_host_ldflags)
LOCAL_LDLIBS := $(common_ldlibs)
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE:= opgprof
@@ -98,7 +97,6 @@ LOCAL_SRC_FILES:= \
LOCAL_STATIC_LIBRARIES := $(common_libs)
LOCAL_C_INCLUDES := $(common_host_c_includes)
LOCAL_CFLAGS := $(common_host_cflags)
-LOCAL_LDFLAGS := $(common_host_ldflags)
LOCAL_LDLIBS := $(common_ldlibs)
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE:= oparchive

0 comments on commit 6e67eb0

Please sign in to comment.