Fix for 64 bit compatibility.
authorJunfeng Dong <junfeng.dong@intel.com>
Fri, 29 Mar 2013 06:10:21 +0000 (14:10 +0800)
committerJunfeng Dong <junfeng.dong@intel.com>
Mon, 8 Apr 2013 06:01:32 +0000 (14:01 +0800)
- Fix hardcoding path.
- Use %cmake to set default paths.
- Fix type casting between pointer and int.

Change-Id: I5159910913c5ff582579bbc6982dd6d7f1166186

18 files changed:
CMakeLists.txt
framework/CMakeLists.txt
framework/main.cpp
framework/transaction-manager/MsgCmdHandlerTransport.cpp
include/common/MsgInternalTypes.h
include/utils/MsgMmsMessage.h
mapi/CMakeLists.txt
msg-service.pc.in
packaging/msg-service.spec
plugin/mms_plugin/CMakeLists.txt
plugin/mms_plugin/MmsPluginStorage.cpp
plugin/sms_plugin/CMakeLists.txt
proxy/CMakeLists.txt
proxy/MsgHandleTransport.cpp
utils/CMakeLists.txt
utils/MsgMmsMessage.cpp
utils/MsgUtilFunction.cpp
vobject-engine/CMakeLists.txt

index 1c1e1c1..0f89681 100755 (executable)
@@ -53,7 +53,7 @@ SET(RINGTONE-FILES
 INSTALL(FILES ${RINGTONE-FILES} DESTINATION /usr/share/media/)
 
 CONFIGURE_FILE(msg-service.pc.in msg-service.pc @ONLY)
-INSTALL(FILES ${CMAKE_BINARY_DIR}/msg-service.pc DESTINATION lib/pkgconfig)
+INSTALL(FILES ${CMAKE_BINARY_DIR}/msg-service.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
 
 SET(RC_LOCAL_SCRIPT msg-server)
 INSTALL(PROGRAMS ${RC_LOCAL_SCRIPT} DESTINATION /etc/rc.d/init.d)
index 15756dc..ef2ad7f 100755 (executable)
@@ -42,7 +42,7 @@ SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed")
 ADD_LIBRARY(${PLUGIN-MANAGER-LIB} SHARED ${PLUGIN-MANAGER-SRCS})
 TARGET_LINK_LIBRARIES(${PLUGIN-MANAGER-LIB} ${plugin_manager_pkgs_LDFLAGS} ${UTILS-LIB} dl)
 
-INSTALL(TARGETS ${PLUGIN-MANAGER-LIB} LIBRARY DESTINATION lib)
+INSTALL(TARGETS ${PLUGIN-MANAGER-LIB} LIBRARY DESTINATION ${LIB_INSTALL_DIR})
 
 ##########################################################
 # Define Messaging Framework Handler
@@ -85,7 +85,7 @@ SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed")
 ADD_LIBRARY(${FW-HANDLER-LIB} SHARED ${FW-HANDLER-SRCS})
 TARGET_LINK_LIBRARIES(${FW-HANDLER-LIB} ${fw_handler_pkgs_LDFLAGS} ${UTILS-LIB} ${PLUGIN-MANAGER-LIB})
 
-INSTALL(TARGETS ${FW-HANDLER-LIB} DESTINATION lib COMPONENT RuntimeLibraries)
+INSTALL(TARGETS ${FW-HANDLER-LIB} DESTINATION ${LIB_INSTALL_DIR} COMPONENT RuntimeLibraries)
 
 ##########################################################
 # Define Transaction Manager
@@ -122,7 +122,7 @@ SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed")
 ADD_LIBRARY(${TRANS-MANAGER-LIB} SHARED ${TRANS-MANAGER-SRCS})
 TARGET_LINK_LIBRARIES(${TRANS-MANAGER-LIB} ${trans_manager_pkgs_LDFLAGS} ${UTILS-LIB} ${FW-HANDLER-LIB})
 
-INSTALL(TARGETS ${TRANS-MANAGER-LIB} DESTINATION lib COMPONENT RuntimeLibraries)
+INSTALL(TARGETS ${TRANS-MANAGER-LIB} DESTINATION ${LIB_INSTALL_DIR} COMPONENT RuntimeLibraries)
 
 ##########################################################
 # Define Execute File
index b7f5340..7d3b85f 100755 (executable)
@@ -461,7 +461,9 @@ signal( SIGCHLD, SIG_IGN );
 
        mainloop = g_main_loop_new(NULL, FALSE);
 
-       g_type_init();
+#if !GLIB_CHECK_VERSION(2,35,0)
+       g_type_init ();
+#endif
 
        g_idle_add(InitThreadFunc, NULL);
 
index d137b14..3ca40ec 100755 (executable)
@@ -366,7 +366,11 @@ int MsgSentStatusHandler(const MSG_CMD_S *pCmd, char **ppEvent)
                return MsgMakeEvent(NULL, 0, MSG_EVENT_PLG_SENT_STATUS_CNF, MSG_SUCCESS, (void**)ppEvent);
        }
 
+#ifdef __x86_64__
+       uint64_t ret[3] = {0}; //3// reqid, status, object
+#else
        unsigned int ret[3] = {0}; //3// reqid, status, object
+#endif
 
        ret[0] = pStatus->reqId;
        ret[1] = pStatus->status;
@@ -550,7 +554,11 @@ __BYPASS_UPDATE:
                                return MsgMakeEvent(NULL, 0, MSG_EVENT_PLG_SENT_STATUS_CNF, MSG_SUCCESS, (void**)ppEvent);
                        }
 
+#ifdef __x86_64__
+                       uint64_t ret[3] = {0}; //3// reqid, status, object
+#else
                        unsigned int ret[3] = {0}; //3// reqid, status, object
+#endif
 
                        ret[0] = reqID;
                        ret[1] = msgInfo.networkStatus;
index 70bc190..e0031c7 100755 (executable)
@@ -27,7 +27,7 @@
                                          INCLUDE FILES
 ==================================================================================================*/
 #include "MsgMmsTypes.h"
-
+#include <inttypes.h>
 
 /*==================================================================================================
                                     DEFINES
@@ -345,10 +345,14 @@ typedef struct
 typedef struct
 {
        int                                             listenerFd;             /**< Rx fd for status cnf */
+#ifdef __x86_64__
+       uint64_t                                handleAddr;             /**< Handle address for status cnf */
+#else
        unsigned int                    handleAddr;             /**< Handle address for status cnf */
+#endif
        msg_message_id_t                sentMsgId;              /**< The ID of a sent message for updating message status */
-} MSG_PROXY_INFO_S;
 
+} MSG_PROXY_INFO_S;
 
 /**
  *     @brief  Aux data structure for MSG_CMD_REG_INCOMING_MSG_CB. \n
index 6c4a597..0f93202 100755 (executable)
@@ -52,7 +52,7 @@ msg_error_t   _MsgMmsReleaseAttachList(MMS_MESSAGE_DATA_S *pMsgData);
 msg_error_t _MsgMmsReleaseMetaList(MMS_MESSAGE_DATA_S *pMsgData);
 msg_error_t _MsgMmsReleaseTransitionList(MMS_MESSAGE_DATA_S *pMsgData);
 
-char *_MsgMmsSerializeMessageData(const MMS_MESSAGE_DATA_S *pMsgData, unsigned int *pSize);
+char *_MsgMmsSerializeMessageData(const MMS_MESSAGE_DATA_S *pMsgData, size_t *pSize);
 bool _MsgMmsDeserializeMessageData(MMS_MESSAGE_DATA_S *pBody, char *pFileData);
 bool _MsgMmsSetRootLayout(MMS_MESSAGE_DATA_S *pMmsMsg, MMS_SMIL_ROOTLAYOUT *pRootlayout);
 
index 6af422f..f43dfb5 100755 (executable)
@@ -53,5 +53,5 @@ TARGET_LINK_LIBRARIES(${MAPI-LIB} ${mapi_pkgs_LDFLAGS} ${UTILS-LIB} ${TRANS-PROX
 SET_TARGET_PROPERTIES(${MAPI-LIB} PROPERTIES SOVERSION ${VERSION_MAJOR})
 SET_TARGET_PROPERTIES(${MAPI-LIB} PROPERTIES VERSION ${VERSION})
 
-INSTALL(TARGETS ${MAPI-LIB} DESTINATION lib COMPONENT RuntimeLibraries)
+INSTALL(TARGETS ${MAPI-LIB} DESTINATION ${LIB_INSTALL_DIR} COMPONENT RuntimeLibraries)
 
index 5d04123..4e0c758 100755 (executable)
@@ -1,5 +1,5 @@
 prefix=/usr
-libdir=${prefix}/lib
+libdir=@LIB_INSTALL_DIR@
 includedir=${prefix}/include
 
 Name: MESSAGE-FRAMEWORK
index eb6d2b9..e19b737 100755 (executable)
@@ -98,7 +98,7 @@ Description: MMS plugin library
 
 
 %build
-cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix}
+%cmake .
 make %{?jobs:-j%jobs}
 
 %install
@@ -107,9 +107,9 @@ mkdir -p %{buildroot}/usr/share/license
 
 %make_install
 
-mkdir -p %{buildroot}%{_libdir}/systemd/user/tizen-middleware.target.wants
-install -m 0644 %SOURCE101 %{buildroot}%{_libdir}/systemd/user/
-ln -s ../msg-service.service %{buildroot}%{_libdir}/systemd/user/tizen-middleware.target.wants/msg-service.service
+mkdir -p %{buildroot}/usr/lib/systemd/user/tizen-middleware.target.wants
+install -m 0644 %SOURCE101 %{buildroot}/usr/lib/systemd/user/
+ln -s ../msg-service.service %{buildroot}/usr/lib/systemd/user/tizen-middleware.target.wants/msg-service.service
 
 mkdir -p  %{buildroot}%{_sysconfdir}/rc.d/rc3.d
 ln -s %{_sysconfdir}/rc.d/init.d/msg-server  %{buildroot}%{_sysconfdir}/rc.d/rc3.d/S70msg-server
@@ -524,8 +524,8 @@ fi
 %{_sysconfdir}/rc.d/init.d/msg-server
 %{_sysconfdir}/rc.d/rc3.d/S70msg-server
 %{_sysconfdir}/rc.d/rc5.d/S70msg-server
-%{_libdir}/systemd/user/msg-service.service
-%{_libdir}/systemd/user/tizen-middleware.target.wants/msg-service.service
+/usr/lib/systemd/user/msg-service.service
+/usr/lib/systemd/user/tizen-middleware.target.wants/msg-service.service
 /usr/share/license/msg-service/LICENSE.Flora
 
 %files -n sms-plugin
index a9a0742..ac6c675 100755 (executable)
@@ -8,7 +8,6 @@ IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
 ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")
 MESSAGE("Build type: ${CMAKE_BUILD_TYPE}")
 
-
 ##########################################################
 # Define MMS Plugin
 ##########################################################
@@ -64,5 +63,5 @@ SET(CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined")
 ADD_LIBRARY(${MMS-PLUGIN-LIB} SHARED ${MMS-PLUGIN-SRCS})
 TARGET_LINK_LIBRARIES(${MMS-PLUGIN-LIB} ${mms_plugin_pkgs_LDFLAGS} ${UTILS-LIB})
 
-INSTALL(TARGETS ${MMS-PLUGIN-LIB} LIBRARY DESTINATION lib)
+INSTALL(TARGETS ${MMS-PLUGIN-LIB} LIBRARY DESTINATION ${LIB_INSTALL_DIR})
 
index 14eadc9..582e608 100755 (executable)
@@ -457,7 +457,7 @@ msg_error_t MmsPluginStorage::plgGetMmsMessage(MSG_MESSAGE_INFO_S *pMsg, MSG_SEN
        msg_error_t     err = MSG_SUCCESS;
 
        int partCnt = 0;
-       unsigned int nSize = 0;
+       size_t nSize = 0;
 
        MsgType partHeader;
        MmsAttrib pMmsAttrib;
index e6a8f0d..09601e0 100755 (executable)
@@ -55,5 +55,5 @@ SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed")
 ADD_LIBRARY(${SMS-PLUGIN-LIB} SHARED ${SMS-PLUGIN-SRCS})
 TARGET_LINK_LIBRARIES(${SMS-PLUGIN-LIB} ${sms_plugin_pkgs_LDFLAGS} ${UTILS-LIB})
 
-INSTALL(TARGETS ${SMS-PLUGIN-LIB} LIBRARY DESTINATION lib)
+INSTALL(TARGETS ${SMS-PLUGIN-LIB} LIBRARY DESTINATION ${LIB_INSTALL_DIR})
 
index e0b7c59..0c3d397 100755 (executable)
@@ -47,5 +47,5 @@ SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed")
 ADD_LIBRARY(${TRANS-PROXY-LIB} SHARED ${TRANS-PROXY-SRCS})
 TARGET_LINK_LIBRARIES(${TRANS-PROXY-LIB} ${trans_proxy_pkgs_LDFLAGS} ${UTILS-LIB} ${FW-HANDLER-LIB})
 
-INSTALL(TARGETS ${TRANS-PROXY-LIB} DESTINATION lib COMPONENT RuntimeLibraries)
+INSTALL(TARGETS ${TRANS-PROXY-LIB} DESTINATION ${LIB_INSTALL_DIR} COMPONENT RuntimeLibraries)
 
index daf73f6..16039f3 100755 (executable)
@@ -115,7 +115,11 @@ msg_error_t MsgHandle::submitReq(MSG_REQUEST_S* pReq)
 
        chInfo.listenerFd = MsgProxyListener::instance()->getRemoteFd();
 
+#ifdef __x86_64__
+       chInfo.handleAddr = (uint64_t) this;
+#else
        chInfo.handleAddr = (unsigned int) this;
+#endif
 
        /* Allocate Memory to Command Data */
        int cmdSize = sizeof(MSG_CMD_S) + sizeof(MSG_REQUEST_INFO_S) + sizeof(MSG_PROXY_INFO_S);
index cb0cd43..3d59896 100755 (executable)
@@ -61,5 +61,5 @@ SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed")
 ADD_LIBRARY(${UTILS-LIB} SHARED ${UTILS-SRCS})
 TARGET_LINK_LIBRARIES(${UTILS-LIB} ${utils_pkgs_LDFLAGS} rt ${VOBJECT-LIB})
 
-INSTALL(TARGETS ${UTILS-LIB} DESTINATION lib COMPONENT RuntimeLibraries)
+INSTALL(TARGETS ${UTILS-LIB} DESTINATION ${LIB_INSTALL_DIR} COMPONENT RuntimeLibraries)
 
index ec0aeba..5109d96 100755 (executable)
@@ -277,7 +277,7 @@ msg_error_t _MsgMmsAddSmilDoc(char* pSmil, MMS_MESSAGE_DATA_S* pMsgData)
 }
 
 
-char* _MsgMmsSerializeMessageData(const MMS_MESSAGE_DATA_S* pMsgData, unsigned int *pSize)
+char* _MsgMmsSerializeMessageData(const MMS_MESSAGE_DATA_S* pMsgData, size_t *pSize)
 {
        MSG_DEBUG("MsgMmsSerializeMessageData");
 
index de54bb3..8dd1787 100755 (executable)
@@ -369,7 +369,7 @@ int MsgEncodeReportStatus(MSG_REPORT_STATUS_INFO_S* pReportStatus, int count, ch
 
        memcpy(p, &count, sizeof(int));
 
-       p = (void*)((int)p + sizeof(int));
+       p = (void*)(p + sizeof(int));
 
        memcpy(p, pReportStatus, sizeof(MSG_REPORT_STATUS_INFO_S)*count);
 
index 114a14b..03bccbf 100755 (executable)
@@ -37,4 +37,4 @@ SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed")
 ADD_LIBRARY(${VOBJECT-LIB} SHARED ${VOBJECT-SRCS})
 TARGET_LINK_LIBRARIES(${VOBJECT-LIB} ${vobject_pkgs_LDFLAGS})
 
-INSTALL(TARGETS ${VOBJECT-LIB} DESTINATION lib)
+INSTALL(TARGETS ${VOBJECT-LIB} DESTINATION ${LIB_INSTALL_DIR})