fix and revise build
authorYoungjae Shin <yj99.shin@samsung.com>
Mon, 7 Oct 2013 07:13:57 +0000 (16:13 +0900)
committerYoungjae Shin <yj99.shin@samsung.com>
Mon, 7 Oct 2013 07:13:57 +0000 (16:13 +0900)
Change-Id: I1da4d293d941004b076bbd5f592af66688ba89f1

.gitignore [new file with mode: 0644]
CMakeLists.txt
common/net_nfc_util_ipc.c [deleted file]
common/net_nfc_util_ipc.h [deleted file]
daemon/CMakeLists.txt
daemon/net_nfc_server_handover_bss.c
packaging/nfc-manager.spec

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..82d1b67
--- /dev/null
@@ -0,0 +1 @@
+net_nfc_gdbus.*
index c5ff1a3..8d334f1 100644 (file)
@@ -9,16 +9,14 @@ SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fPIC -fvisibility=hidden")
 
 #SET(ARM_CFLAGS "-mabi=aapcs-linux -fno-common")
 
-FIND_PROGRAM(UNAME NAMES uname)
-EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH")
-IF("${ARCH}" MATCHES "^arm.*")
+IF(ARM_TARGET)
        ADD_DEFINITIONS("-DTARGET")
        MESSAGE("add -DTARGET")
        SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ARM_CFLAGS}")
-ENDIF("${ARCH}" MATCHES "^arm.*")
+ENDIF(ARM_TARGET)
 
 SET(CMAKE_SHARED_LINKER_FLAGS " -Wl,--as-needed -Wl,--rpath=${LIB_INSTALL_DIR}")
-SET(CMAKE_EXE_LINKER_FLAGS " -Wl,--as-needed -Wl,--rpath=${LIB_INSTALL_DIR}")
+SET(CMAKE_EXE_LINKER_FLAGS " -Wl,--as-needed -Wl,--hash-style=both")
 
 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
 
diff --git a/common/net_nfc_util_ipc.c b/common/net_nfc_util_ipc.c
deleted file mode 100644 (file)
index a0dfea4..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 2012, 2013 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Flora License, Version 1.1 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://floralicense.org/license/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stddef.h>
-#include <stdint.h>
-#include <stdbool.h>
-#include <stdarg.h>
-#include <string.h>
-#include <fcntl.h>
-
-#include "net_nfc_debug_internal.h"
-
-int net_nfc_util_get_va_list_length(va_list list)
-{
-       int length = 0;
-
-       while (va_arg(list, void *) != 0)
-       {
-               length += (sizeof(int) + va_arg(list, int));
-       }
-
-       return length;
-}
-
-int net_nfc_util_fill_va_list(uint8_t *buffer, int length, va_list list)
-{
-       uint8_t *data = NULL;
-       int len = 0;
-       int current = 0;
-
-       while (current < length && (data = va_arg(list, void *)) != NULL)
-       {
-               if ((len = va_arg(list, int)) > 0)
-               {
-                       memcpy(buffer + current, &len, sizeof(len));
-                       current += sizeof(len);
-
-                       memcpy(buffer + current, data, len);
-                       current += len;
-               }
-       }
-
-       return current;
-}
-
-void net_nfc_util_set_non_block_socket(int socket)
-{
-       NFC_DBG("set non block socket");
-
-       int flags = fcntl(socket, F_GETFL);
-       flags |= O_NONBLOCK;
-
-       if (fcntl(socket, F_SETFL, flags) < 0)
-       {
-               NFC_ERR("fcntl, executing nonblock error");
-       }
-}
diff --git a/common/net_nfc_util_ipc.h b/common/net_nfc_util_ipc.h
deleted file mode 100644 (file)
index 1000eee..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2012, 2013 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Flora License, Version 1.1 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://floralicense.org/license/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#ifndef __NET_NFC_UTIL_IPC_H__
-#define __NET_NFC_UTIL_IPC_H__
-
-#define NET_NFC_SERVER_ADDRESS                         "127.0.0.1"
-#define NET_NFC_SERVER_PORT                            3000
-#define NET_NFC_SERVER_DOMAIN                          "/tmp/nfc-manager-server-domain"
-
-#define NET_NFC_MAX_MESSAGE_LENGTH                     (1024 * 512)
-
-#define NET_NFC_FLAGS_SYNC_CALL                                (1 << 0)
-#define NET_NFC_FLAGS_NO_RESPONSE                      (1 << 1)
-
-#define NET_NFC_IS_FLAGS_SET(__var, __flag)            (((__var) & (__flag)) == (__flag))
-#define NET_NFC_SET_FLAGS(__var, __flag)               (__var) |= (__flag)
-#define NET_NFC_UNSET_FLAGS(__var, __flag)             (__var) &= ~(__flag)
-
-#define NET_NFC_FLAGS_SET_SYNC_CALL(__var)             NET_NFC_SET_FLAGS(__var, NET_NFC_FLAGS_SYNC_CALL)
-#define NET_NFC_FLAGS_UNSET_SYNC_CALL(__var)           NET_NFC_UNSET_FLAGS(__var, NET_NFC_FLAGS_SYNC_CALL)
-#define NET_NFC_FLAGS_IS_SYNC_CALL(__var)              NET_NFC_IS_FLAGS_SET(__var, NET_NFC_FLAGS_SYNC_CALL)
-
-#define NET_NFC_FLAGS_SET_NO_RESPONSE(__var)           NET_NFC_SET_FLAGS(__var, NET_NFC_FLAGS_NO_RESPONSE)
-#define NET_NFC_FLAGS_UNSET_NO_RESPONSE(__var)         NET_NFC_UNSET_FLAGS(__var, NET_NFC_FLAGS_NO_RESPONSE)
-#define NET_NFC_FLAGS_IS_NO_RESPONSE(__var)            NET_NFC_IS_FLAGS_SET(__var, NET_NFC_FLAGS_NO_RESPONSE)
-
-int net_nfc_util_get_va_list_length(va_list list);
-int net_nfc_util_fill_va_list(uint8_t *buffer, int length, va_list list);
-void net_nfc_util_set_non_block_socket(int socket);
-
-#endif //__NET_NFC_UTIL_IPC_H__
index fd38c83..2e32b15 100755 (executable)
@@ -6,15 +6,15 @@ SET(NFC_DAEMON "nfc-manager-daemon")
 
 FILE(GLOB DAEMON_SRCS *.c)
 
-IF("${ARCH}" MATCHES "^arm.*")
+IF(ARM_TARGET)
        pkg_check_modules(daemon_pkgs REQUIRED aul glib-2.0 gio-unix-2.0 security-server
                vconf dlog tapi appsvc libcurl bluetooth-api libssl svi capi-media-wav-player
-               pkgmgr pkgmgr-info capi-network-wifi wifi-direct ecore-x pmapi)
-ELSE()
+               pkgmgr pkgmgr-info capi-network-wifi ecore-x pmapi wifi-direct)
+ELSE(ARM_TARGET)
        pkg_check_modules(daemon_pkgs REQUIRED aul glib-2.0 gio-unix-2.0 security-server
                vconf dlog tapi appsvc libcurl bluetooth-api libssl svi capi-media-wav-player
                pkgmgr pkgmgr-info capi-network-wifi ecore-x pmapi)
-ENDIF()
+ENDIF(ARM_TARGET)
 
 FOREACH(flag ${daemon_pkgs_CFLAGS})
        SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
index e996cf8..c979fe6 100755 (executable)
@@ -720,8 +720,7 @@ static net_nfc_error_e _net_nfc_handover_bss_create_config_record(
                }
 
                pw_length = wifi_direct_get_passphrase(&password);
-
-               NFC_ERR("wifi_direct_get_passphrase[%s]", password);
+               NFC_DBG("wifi_direct_get_passphrase[%s]", password);
 
                net_nfc_util_add_carrier_config_group_property(
                                cred_config,
@@ -928,6 +927,7 @@ static int _net_nfc_handover_process_wifi_group_setup(
                return err;
        }
 
+       return err;
 }
 
 static gboolean _net_nfc_handover_bss_wfd_get_carrier_record(
index 0f8501a..55548d4 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       nfc-manager
 Summary:    NFC framework manager
-Version: 0.1.2
+Version:       0.1.3
 Release:    0
 Group:      Network & Connectivity/NFC
 License:    Flora
@@ -17,9 +17,6 @@ BuildRequires: pkgconfig(dlog)
 BuildRequires: pkgconfig(tapi)
 BuildRequires: pkgconfig(bluetooth-api)
 BuildRequires: pkgconfig(capi-network-wifi)
-%ifarch %arm
-BuildRequires: pkgconfig(wifi-direct)
-%endif
 BuildRequires: pkgconfig(mm-sound)
 BuildRequires: pkgconfig(appsvc)
 BuildRequires: pkgconfig(svi)
@@ -32,6 +29,11 @@ BuildRequires: pkgconfig(pmapi)
 BuildRequires: python
 BuildRequires: python-xml
 BuildRequires: gettext-tools
+%ifarch %arm
+BuildRequires: pkgconfig(wifi-direct)
+%global ARM_DEF "-DARM_TARGET=Y"
+%endif
+
 Requires(post):   /sbin/ldconfig
 Requires(post):   /usr/bin/vconftool
 Requires(postun): /sbin/ldconfig
@@ -88,7 +90,7 @@ NFC manager Client library for developing NFC client applications.
 
 %build
 MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
-%cmake . -DMAJORVER=${MAJORVER} -DFULLVER=%{version}
+%cmake . -DMAJORVER=${MAJORVER} -DFULLVER=%{version} %{?ARM_DEF}
 
 
 %install