Hi
   I was successful in building ncurses as shared library instead of
using porecompiled static library. Following are the steps:

1. Downloaded the htop from
    http://sourceforge.net/projects/htop/


2. Downloaded the ncurses sources and copy into external/ncurses-5.7
    -Create Android.mk with just one line in external/ncurses-5.7 as
"include $(all-subdir-makefiles)"
    -Create Android.mk in external/ncurses-5.7/ncurses as

          # ========================================================
          # libncurses.so
          # ========================================================

          LOCAL_PATH:= $(call my-dir)
          include $(CLEAR_VARS)

          LOCAL_SRC_FILES := \
                    <Include all .c files in base, tty, tinfo...>

          LOCAL_C_INCLUDES += \
                          $(LOCAL_PATH)/../include \
                          $(LOCAL_PATH)

          LOCAL_CFLAGS += \
                         -DHAVE_CONFIG_H \
                         -DNDEBUG \
                         -DXTSTRINGDEFINES \
                         -fPIC

          LOCAL_MODULE:= libncurses
          LOCAL_PRELINK_MODULE := false
          LOCAL_SHARED_LIBRARIES := libdl

          include $(BUILD_SHARED_LIBRARY)

          # ========================================================
          include $(call all-makefiles-under,$(LOCAL_PATH))


5. Edit the Android.mk in htop as follows

 
#########################################################################
          # Build htop executable
 
#########################################################################
          LOCAL_PATH := $(call my-dir)
          LOCAL_MODULE_TAGS := eng
          include $(CLEAR_VARS)

          LOCAL_SRC_FILES :=  \
                        AvailableMetersPanel.c CategoriesPanel.c CheckItem.c \
                        ClockMeter.c ColorsPanel.c ColumnsPanel.c CPUMeter.c \
                        CRT.c DebugMemory.c DisplayOptionsPanel.c FunctionBar.c 
\
                        Hashtable.c Header.c htop.c ListItem.c 
LoadAverageMeter.c \
                        MemoryMeter.c Meter.c MetersPanel.c Object.c Panel.c \
                        BatteryMeter.c Process.c ProcessList.c RichString.c \
                        ScreenManager.c Settings.c SignalItem.c SignalsPanel.c \
                        String.c SwapMeter.c TasksMeter.c TraceScreen.c \
                        UptimeMeter.c UsersTable.c Vector.c 
AvailableColumnsPanel.c \
                        AffinityPanel.c HostnameMeter.c OpenFilesScreen.c

          LOCAL_C_INCLUDES := \
                        external/ncurses-5.7/include \
                        external/ncurses-5.7/ncurses \
                        $(LOCAL_PATH)/plpa-1.1/src \
                        $(LOCAL_PATH)

          LOCAL_CFLAGS := -std=c99 -DANDROID_CHANGES -DSYSCONFDIR=\"/
data\"

          LOCAL_MODULE := htopa

          LOCAL_SHARED_LIBRARIES := libc libcutils libncurses

          include $(BUILD_EXECUTABLE)


6. Build is successful and I got "htopa" created system/bin

7. But when I execute I get the following error

  # htopa
    htopa
    Error opening terminal: unknown.

Let me know if there any resolution

-- 
unsubscribe: [email protected]
website: http://groups.google.com/group/android-porting

Reply via email to