g_type_init has been deprecated from glib since version 2.35.
authorJunfeng Dong <junfeng.dong@intel.com>
Fri, 1 Feb 2013 13:28:06 +0000 (21:28 +0800)
committerJunfeng Dong <junfeng.dong@intel.com>
Fri, 1 Feb 2013 13:41:56 +0000 (21:41 +0800)
Fix build on x86_64

Change-Id: I5a89451f1bef86e4e7159d2970d4714d4e270c91

CMakeLists.txt
packaging/capi-network-tethering.spec
src/tethering.c
test/tethering_test.c

index a5e6c0de0f4a05b2eec6fd4ed2ba547a63b02b50..187d1b3b9b99b7260881f179af4a8c5f6ddd29be 100644 (file)
@@ -27,7 +27,7 @@ ENDIF("${ARCH}" STREQUAL "arm")
 ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
 ADD_DEFINITIONS("-DTIZEN_DEBUG")
 
-SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=/usr/lib")
+SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=%{_libdir}")
 
 FIND_PROGRAM(MARSHALTOOL NAMES glib-genmarshal)
 EXEC_PROGRAM("${MARSHALTOOL}" ARGS "--prefix=marshal ${INC_DIR}/marshal.list --header > ${INC_DIR}/marshal.h")
@@ -43,7 +43,7 @@ TARGET_LINK_LIBRARIES(${fw_name} ${${fw_name}_LDFLAGS})
 
 SET_TARGET_PROPERTIES(${fw_name} PROPERTIES SOVERSION 0.1.0)
 
-INSTALL(TARGETS ${fw_name} DESTINATION lib)
+INSTALL(TARGETS ${fw_name} DESTINATION ${LIB_INSTALL_DIR})
 INSTALL(
         DIRECTORY ${INC_DIR}/ DESTINATION include/network
         FILES_MATCHING
@@ -63,7 +63,7 @@ CONFIGURE_FILE(
     ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc
     @ONLY
 )
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc DESTINATION lib/pkgconfig)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
 
 ADD_SUBDIRECTORY(test)
 
index dbe0c77e03ddac10e80468bba3767eb98cc902cf..9d86894221c42236cf7d2bd03d0026a1b8a8e60c 100644 (file)
@@ -3,7 +3,7 @@ Summary:    Tethering Framework
 Version:    0.0.11
 Release:    1
 Group:      TO_BE/FILLED_IN
-License:    Apache License Version 2.0
+License:    Apache-2.0
 Source0:    %{name}-%{version}.tar.gz
 Requires(post):   /sbin/ldconfig
 Requires(postun): /sbin/ldconfig
@@ -29,12 +29,10 @@ Development package for Tethering framework library
 %setup -q
 
 %build
-cmake . -DCMAKE_INSTALL_PREFIX=/usr
-
+%cmake .
 make %{?jobs:-j%jobs}
 
 %install
-rm -rf %{buildroot}
 %make_install
 
 %post -p /sbin/ldconfig
index d0b658bc6bd3c5dc051b32d7b995d31d5031b9ae..83768dc548f7093098ead746c877321c942a791c 100644 (file)
@@ -838,7 +838,9 @@ API int tethering_create(tethering_h *tethering)
                        "malloc is failed\n");
        memset(th, 0x00, sizeof(__tethering_h));
 
+#if !GLIB_CHECK_VERSION(2,35,0)
        g_type_init();
+#endif
        th->client_bus = dbus_g_bus_get(DBUS_BUS_SYSTEM, &error);
        if (error) {
                ERR("Couldn't connect to the System bus[%s]", error->message);
index a79651d0bc412e15823b8badfb508748a7c1ef7f..59674f82a5e43945bfb5ac139da13bfb1dc7d9a2 100644 (file)
@@ -671,7 +671,9 @@ int main(int argc, char *argv[])
                __connection_state_changed_cb, __security_type_changed_cb,
                __ssid_visibility_changed_cb, __passphrase_changed_cb};
 
+#if !GLIB_CHECK_VERSION(2,35,0)
        g_type_init();
+#endif
 
        /* Create tethering handle */
        ret = tethering_create(&th);