Results 1 to 2 of 2

Thread: Compile IceE under Android NDK

  1. #1
    seva is offline Registered User
    Name: Seva Gacel
    Organization: Personal
    Project: Mobile GPS tracking
    Join Date
    Sep 2011
    Posts
    1

    Compile IceE under Android NDK

    Who's supposed to, post the make files to compile under android:

    Application.mk
    Code:
    APP_OPTIM := release
    APP_PLATFORM := android-8
    APP_STL := gnustl_static
    APP_CPPFLAGS += -frtti -fexceptions
    APP_ABI := armeabi
    APP_MODULES := IceE
    Android.mk
    Code:
    #
    # Compile with support for the Ice router facility.
    #
    HAS_ROUTER				:= yes
    
    #
    # Compile with support for the Ice locator facility.
    #
    HAS_LOCATOR				:= no
    
    #
    # Compile with support for batch invocations.
    #
    HAS_BATCH				:= no
    
    #
    # Compile with support for wstring and string conversion.
    #
    HAS_WSTRING				:= no
    
    #
    # Compile with support for opaque endpoints.
    #
    HAS_OPAQUE_ENDPOINTS	:= no
    
    #
    # Compile with support for asynchronous method invocation (AMI).
    #
    HAS_AMI					:= no
    
    #
    # Default Mutex protocol: one of PrioNone or PrioInherit.
    #
    DEFAULT_MUTEX_PROTOCOL	:= PrioNone 
    
    LOCAL_PATH := $(call my-dir)
    
    SLICE_DIR := slice/IceE
    $(shell $(LOCAL_PATH)/../cpp/bin/slice2cppe --ice -Islice --include-dir IceE --dll-export ICE_API --output-dir $(SLICE_DIR) $(SLICE_DIR)/*.ice)
    $(shell rm -f $(SLICE_DIR)/*F.cpp)
    $(shell mv $(SLICE_DIR)/*.h $(LOCAL_PATH)/../cppe/include/IceE)
    $(shell mv $(SLICE_DIR)/*.cpp $(LOCAL_PATH)/../cppe/src/IceE)
    
    $(shell $(LOCAL_PATH)/../cppe/config/features.sh $(LOCAL_PATH)/../cppe/include/IceE/Features.h \
    		HAS_ROUTER=$(HAS_ROUTER) \
    		HAS_LOCATOR=$(HAS_LOCATOR) \
    		HAS_BATCH=$(HAS_BATCH) \
    		HAS_WSTRING=$(HAS_WSTRING) \
    		HAS_OPAQUE_ENDPOINTS=$(HAS_OPAQUE_ENDPOINTS) \
    		HAS_AMI=$(HAS_AMI) \
    		DEFAULT_MUTEX_PROTOCOL=$(DEFAULT_MUTEX_PROTOCOL))
    
    include $(CLEAR_VARS)
    
    GLOBAL_C_INCLUDES := $(LOCAL_PATH)/../cppe/include $(LOCAL_PATH)/../cppe/src $(LOCAL_PATH)/../cppe/src/TcpTransport
    
    TRANSPORT_DIR	:= ../cppe/src/TcpTransport
    ICE_DIR			:= ../cppe/src/IceE
    
    TRANSPORT_SRCS	:= \
    				$(TRANSPORT_DIR)/Acceptor.cpp \
    				$(TRANSPORT_DIR)/Connector.cpp \
    				$(TRANSPORT_DIR)/EndpointFactory.cpp \
    				$(TRANSPORT_DIR)/TcpEndpoint.cpp \
    				$(TRANSPORT_DIR)/Transceiver.cpp
    
    ICE_SRCS		:= \
    				$(ICE_DIR)/Base64.cpp \
    				$(ICE_DIR)/BasicStream.cpp \
    				$(ICE_DIR)/Buffer.cpp \
    				$(ICE_DIR)/BuiltinSequences.cpp \
    				$(ICE_DIR)/Communicator.cpp \
    				$(ICE_DIR)/Cond.cpp \
    				$(ICE_DIR)/ConnectionI.cpp \
    				$(ICE_DIR)/ConnectRequestHandler.cpp \
    				$(ICE_DIR)/RequestHandler.cpp \
    				$(ICE_DIR)/ConvertUTF.cpp \
    				$(ICE_DIR)/Current.cpp \
    				$(ICE_DIR)/DefaultsAndOverrides.cpp \
    				$(ICE_DIR)/DispatchInterceptor.cpp \
    				$(ICE_DIR)/Endpoint.cpp \
    				$(ICE_DIR)/EventHandler.cpp \
    				$(ICE_DIR)/ExceptionBase.cpp \
    				$(ICE_DIR)/FactoryTable.cpp \
    				$(ICE_DIR)/FactoryTableDef.cpp \
    				$(ICE_DIR)/Identity.cpp \
    				$(ICE_DIR)/Incoming.cpp \
    				$(ICE_DIR)/IncomingConnectionFactory.cpp \
    				$(ICE_DIR)/Initialize.cpp \
    				$(ICE_DIR)/Instance.cpp \
    				$(ICE_DIR)/LocalException.cpp \
    				$(ICE_DIR)/Locator.cpp \
    				$(ICE_DIR)/LocatorInfo.cpp \
    				$(ICE_DIR)/Logger.cpp \
    				$(ICE_DIR)/LoggerI.cpp \
    				$(ICE_DIR)/LoggerUtil.cpp \
    				$(ICE_DIR)/MutexProtocol.cpp \
    				$(ICE_DIR)/Network.cpp \
    				$(ICE_DIR)/Object.cpp \
    				$(ICE_DIR)/ObjectAdapter.cpp \
    				$(ICE_DIR)/ObjectAdapterFactory.cpp \
    				$(ICE_DIR)/ObjectFactoryManager.cpp \
    				$(ICE_DIR)/ObjectFactoryManagerI.cpp \
    				$(ICE_DIR)/OperationMode.cpp \
    				$(ICE_DIR)/Outgoing.cpp \
    				$(ICE_DIR)/OutgoingAsync.cpp \
    				$(ICE_DIR)/OutgoingConnectionFactory.cpp \
    				$(ICE_DIR)/Properties.cpp \
    				$(ICE_DIR)/Protocol.cpp \
    				$(ICE_DIR)/Proxy.cpp \
    				$(ICE_DIR)/ProxyFactory.cpp \
    				$(ICE_DIR)/Random.cpp \
    				$(ICE_DIR)/RecMutex.cpp \
    				$(ICE_DIR)/Reference.cpp \
    				$(ICE_DIR)/ReferenceFactory.cpp \
    				$(ICE_DIR)/RetryQueue.cpp \
    				$(ICE_DIR)/Router.cpp \
    				$(ICE_DIR)/RouterInfo.cpp \
    				$(ICE_DIR)/SafeStdio.cpp \
    				$(ICE_DIR)/SelectorThread.cpp \
    				$(ICE_DIR)/ServantManager.cpp \
    				$(ICE_DIR)/Shared.cpp \
    				$(ICE_DIR)/StringConverter.cpp \
    				$(ICE_DIR)/StringUtil.cpp \
    				$(ICE_DIR)/Thread.cpp \
    				$(ICE_DIR)/ThreadException.cpp \
    				$(ICE_DIR)/ThreadPool.cpp \
    				$(ICE_DIR)/Time.cpp \
    				$(ICE_DIR)/Timer.cpp \
    				$(ICE_DIR)/TraceLevels.cpp \
    				$(ICE_DIR)/TraceUtil.cpp \
    				$(ICE_DIR)/UnknownEndpoint.cpp \
    				$(ICE_DIR)/Unicode.cpp \
    				$(ICE_DIR)/UUID.cpp
    				
    LOCAL_SRC_FILES := $(TRANSPORT_SRCS) $(ICE_SRCS)
    
    LOCAL_MODULE := IceE
    
    GLOBAL_CFLAGS  := -DICE_API_EXPORTS -D_REENTRANT -DNDEBUG  \
    		-DPAGE_SIZE=0x400 -ftemplate-depth-128 -Wall -Os \
    		-fdata-sections -ffunction-sections -isystem $(SYSROOT)/usr/include/
    
    LOCAL_CFLAGS := $(GLOBAL_CFLAGS)
    LOCAL_C_INCLUDES := $(GLOBAL_C_INCLUDES)
    
    include $(BUILD_STATIC_LIBRARY)
    You must also modify Thread.cpp:

    from:
    Code:
                throw ThreadSyscallException(__FILE__, __LINE__, rc);
            }
            pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED);
        }
        rc = pthread_create(&_thread, &attr, startHook, this);
    to:
    Code:
                throw ThreadSyscallException(__FILE__, __LINE__, rc);
            }
    #ifndef ANDROID
            pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED);
    #endif
        }
        rc = pthread_create(&_thread, &attr, startHook, this);
    All features work, except wstring support.

  2. #2
    bernard's Avatar
    bernard is offline ZeroC Staff
    Name: Bernard Normier
    Organization: ZeroC, Inc.
    Project: Ice
    Join Date
    Feb 2003
    Location
    Palm Beach Gardens, FL
    Posts
    1,294
    Hi Seva,

    Welcome to our forums, and thank you very much for sharing your port of Ice-E to Android NDK.

    Best regards,
    Bernard
    Bernard Normier
    ZeroC, Inc.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Android Server
    By Daniel_Kim in forum Help Center
    Replies: 1
    Last Post: 05-31-2011, 10:55 PM
  2. Replies: 5
    Last Post: 06-21-2010, 04:03 AM
  3. Servant on Android device
    By JoseLSegura in forum Help Center
    Replies: 8
    Last Post: 04-20-2010, 09:40 AM
  4. how to compile icee 1.1.0?
    By socketref in forum Help Center
    Replies: 1
    Last Post: 08-15-2009, 04:04 AM
  5. Replies: 2
    Last Post: 07-02-2006, 09:27 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •