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 1c1e1c18737f39195aca724052e1db6d77efb061..0f8968144595e3ed3462a857bf5db29789eebad1 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 15756dccee7191c48edb1deccb59a9c2d9191870..ef2ad7f76177bd1ff4f22502e5177bd0336123b5 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 b7f5340b069604db4eb15e6ae7a4620cbf0f5969..7d3b85f6a5c65da4990f05f6896f807ea64ded3c 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 d137b147f04c73f4295de7132321284b98bd9dff..3ca40ec59a1036c10a7b69b0907fa12f77d3cb3a 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 70bc190fe9460354b2a0838abe1cdacfe8766318..e0031c73c9b7c14e5bd5e9ed10476b15c0bcde0d 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 6c4a597c8d870f28b7a2f1b22aea40f56d65b104..0f932026573bc21b9b28fee9b13d854126ff81e6 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 6af422f2fd158cca3120823c1bfbc28909d67ffb..f43dfb51f7dcd3b32313d6328c63c7d255b2f065 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 5d04123da392457de2139acaeb524dbe808c2ceb..4e0c7580ea0f53bdbab3d76aa6027634f38812c3 100755 (executable)
@@ -1,5 +1,5 @@
 prefix=/usr
-libdir=${prefix}/lib
+libdir=@LIB_INSTALL_DIR@
 includedir=${prefix}/include
 
 Name: MESSAGE-FRAMEWORK
index eb6d2b989a83af2ecbab92ae98c9506609f2cf53..e19b737334b26fd4a44da6a10455593178ebab5f 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 a9a074210b256bcc2fd1c4b28104dbdebe74aef0..ac6c67544d3c615b030c5d3f382b3dd5885e9948 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 14eadc9a7ff7d50a57ebbb259f289c9691f13e43..582e6086ca13b6f7da232b3aef3d5696d0af703d 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 e6a8f0d8ee8191532c40cde8fa50db55970b1c27..09601e00c4529bae7658e085fe154b9fe10360ed 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 e0b7c593560d8433a21815952042ddca042fc85b..0c3d397dc8c61cfa768d0db678892f508ae00a4e 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 daf73f68420660688e20d3047b02d6940af9e2aa..16039f34e5b7225b1a404243e4566e9d7228eedf 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 cb0cd43cb676ce50cee118306873c4e5cb14fd4b..3d598963f531fab782b6a35c54dcc1c1bcb3a38f 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 ec0aebab4c80eb8dee87eabfa184a420a84f6110..5109d969b369609fb976729a277da2cdd534f929 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 de54bb365f9385cd68ce121e833af8b3e9e73cf9..8dd1787addbc8ffa3cddb461a6e3cbaeae4d1366 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 114a14b1b7fc9fed87b3e72858fd56a7c79fb5fe..03bccbf8ffe1cb555cda70e5080ae4392cd35a18 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})