Use right macro to build for emulator
authorArron Wang <arron.wang@intel.com>
Fri, 18 Jan 2013 08:34:33 +0000 (16:34 +0800)
committerArron Wang <arron.wang@intel.com>
Tue, 5 Feb 2013 01:46:31 +0000 (09:46 +0800)
the build system export the emulator info by simulator macro

Change-Id: I534f1be557b19d75cce5d4558ec9347e4ac5575a

packaging/wifi-direct-manager.spec
plugin/wpasupplicant/CMakeLists.txt
src/CMakeLists.txt

index de8f6ff..3a60a97 100755 (executable)
@@ -29,15 +29,21 @@ wifi drect plugin for wpa supplicant
 %prep
 %setup -q
 
+%build
+
 %ifarch %{arm}
 export ARCH=arm
 %else
+
+%if 0%{?simulator}
+export ARCH=emul
+%else
 export ARCH=i586
 %endif
 
-%build
+%endif
 
-cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix}
+cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DARCHITECTURE=$ARCH
 make %{?jobs:-j%jobs}
 
 %install
index 0b0073b..2a3ddde 100755 (executable)
@@ -20,8 +20,9 @@ SET(CMAKE_C_FLAGS_RELEASE "-O2")
 ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"")
 
 
-EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH")
-IF("${ARCH}" MATCHES "^arm.*")
+#EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH")
+SET(ARCH "${ARCHITECTURE}")
+IF("${ARCH}" MATCHES "^arm.*|.*86.*")
 
        SET(SRCS 
                src/wifi-direct-plugin.c
index 06731bf..81f2df1 100644 (file)
@@ -26,8 +26,9 @@ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
 SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
 SET(CMAKE_C_FLAGS_RELEASE "-O2")
 
-FIND_PROGRAM(UNAME NAMES uname)
-EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH")
+#FIND_PROGRAM(UNAME NAMES uname)
+#EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH")
+SET(ARCH "${ARCHITECTURE}")
 IF("${ARCH}" STREQUAL "arm")
        ADD_DEFINITIONS("-DTARGET")
        MESSAGE("add -DTARGET")
@@ -39,8 +40,9 @@ ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
 #SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed")
 
 
-EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH")
-IF("${ARCH}" MATCHES "^arm.*")
+#EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH")
+message("${ARCH}")
+IF("${ARCH}" MATCHES "^arm.*|.*86.*")
        SET(SRCS
                 wifi-direct-main.c
                 wifi-direct-utils.c