summaryrefslogtreecommitdiff
path: root/lcmodule
diff options
context:
space:
mode:
authorZoranAleksov <Zoran.Aleksov@seavus.com>2012-02-07 15:33:42 +0100
committerViktor Mladenovski <viktor.mladenovski@seavus.com>2012-05-25 14:43:32 +0200
commit828be7d08c886347641d8bba675993caf5a13d1a (patch)
tree17e986bd43df9a9ebbe419bd4539bc6b1860d65c /lcmodule
parent10184ae5b432f3dd7e014afb9a8f0ea0cd880e26 (diff)
Delivery must be compliant with Mac OS Lion
Porting of loader communication to Mac OS Lion ST-Ericsson ID: 358802 ST-Ericsson FOSS-OUT ID: NA Change-Id: I2aee1b2519cb9bfd07940bdf5a9fc55d78bba7da Depends-On: Ic1d148824eed95ed65259fc694e52f0729045208 Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/44893 Reviewed-by: QABUILD Tested-by: Cvetko MLADENOVSKI <cvetko.mladenovski@seavus.com> Reviewed-by: Viktor MLADENOVSKI <viktor.mladenovski@stericsson.com>
Diffstat (limited to 'lcmodule')
-rw-r--r--lcmodule/Makefile47
-rw-r--r--lcmodule/source/LCM.rc6
-rw-r--r--lcmodule/source/cnh1605204_ldr_transport_layer/include/r_a2_protocol.h2
-rwxr-xr-xlcmodule/source/cnh1605204_ldr_transport_layer/include/r_a2_speedflash.h2
-rw-r--r--lcmodule/source/cnh1605204_ldr_transport_layer/include/r_bulk_protocol.h2
-rw-r--r--lcmodule/source/cnh1605204_ldr_transport_layer/include/r_command_protocol.h2
-rw-r--r--lcmodule/source/cnh1605205_ldr_network_layer/include/t_r15_header.h4
-rw-r--r--lcmodule/source/cnh1605551_ldr_utilities/include/r_debug_macro.h2
-rw-r--r--lcmodule/source/cnh1606344_ldr_communication_module/include/r_communication_service.h2
-rw-r--r--lcmodule/source/cnh1606344_ldr_communication_module/source/lcm_version.c2
-rw-r--r--lcmodule/source/legacy_compatibility/c_compiler.h2
-rw-r--r--lcmodule/source/serialization.c1
12 files changed, 42 insertions, 32 deletions
diff --git a/lcmodule/Makefile b/lcmodule/Makefile
index a664c0e..ede3f3f 100644
--- a/lcmodule/Makefile
+++ b/lcmodule/Makefile
@@ -19,6 +19,13 @@ LCM_CUST_CONFIG:=$(LCM_PATH)/customer_config
SUPPORTED_CMDS_PATH:=$(LOADER_DIR)/src/platform_support/stn8500/config/supported_commands.xml
WIN_BINARIES=./win_binaries/
+OS_NAME := $(shell uname)
+ifeq ($(OS_NAME), Linux)
+LIB_EXTENSION := so.1
+else
+LIB_EXTENSION := dylib
+endif
+
AUTOGEN_FILES := $(AUTO_DIR_LIB)/commands.h\
$(AUTO_DIR_LIB)/command_ids.h\
$(AUTO_DIR_LIB)/error_codes.h\
@@ -81,7 +88,7 @@ INCLUDES := -I. \
-I ${UTILITIES_PATH}/communication_abstraction/\
-I ${BUFFERS_PATH}/include/\
-I ${SECURITY_ALGORITHMS_PATH}/include/\
- -I ${LCM_PATH}/source/legacy_compatibility/
+ -I ${LCM_PATH}/source/legacy_compatibility/\
# C compiler flags (-g -O2 -Wall)
CFLAGS := -g -O2 -Wall -fPIC -fvisibility=hidden -DUINT64_SUPPORTED -DSINT64_SUPPORTED -DINT64_BASE_TYPE="long long" -DCFG_ENABLE_A2_FAMILY -DLCM_EXPORTS
@@ -100,10 +107,10 @@ build: configfile setup_folders $(LIB_x32)
endif
$(LIB_x32): $(LIBOBJ_x32)
- $(CC) -shared -m32 -Wl,-soname,$(LIB_x32) -o $(LIB_x32) -lc $(addprefix $(BUILDFOLDER)/$(LIB_x32_OBJ_DIR)/, $(^F))
+ $(CC) -shared -m32 -Wl -o $(LIB_x32) -lc $(addprefix $(BUILDFOLDER)/$(LIB_x32_OBJ_DIR)/, $(^F))
$(LIB_x64): $(LIBOBJ_x64)
- $(CC) -shared -Wl,-soname,$(LIB_x64) -o $(LIB_x64) -lc $(addprefix $(BUILDFOLDER)/$(LIB_x64_OBJ_DIR)/, $(^F))
+ $(CC) -shared -Wl -o $(LIB_x64) -lc $(addprefix $(BUILDFOLDER)/$(LIB_x64_OBJ_DIR)/, $(^F))
$(BUILDFOLDER)/$(LIB_x32_OBJ_DIR)/%.o: ${TRANSPORT_PATH}/source/%.c $(AUTOGEN_FILES)
@mkdir -p $(dir $@)
@@ -276,8 +283,8 @@ config: BUILDFOLDER := $(LCM_PATH)/out
config: LCM_AUTO_DIR:=$(BUILDFOLDER)/autogen
config: AUTO_DIR_LIB:=$(LCM_AUTO_DIR)/lib
config: AUTO_DIR_LOADER:=$(LCM_AUTO_DIR)/loader
-config: LIB_x32 := $(BUILDFOLDER)/liblcm.so.1
-config: LIB_x64 := $(BUILDFOLDER)/liblcm_x64.so.1
+config: LIB_x32 := $(BUILDFOLDER)/liblcm.$(LIB_EXTENSION)
+config: LIB_x64 := $(BUILDFOLDER)/liblcm_x64.$(LIB_EXTENSION)
config: LCMLIB_INSTALLDIR := /tmp/
config: LCMLDR_INSTALLDIR := /tmp/
config: LIB_x32_OBJ_DIR := x32
@@ -316,30 +323,30 @@ config:
@echo CONFIG_DIR : $(CONFIG_DIR)
install: build
- install -p -m 0755 -t ${LCMLIB_INSTALLDIR} ${BUILDFOLDER}/liblcm.so.*
+ install -p -m 0755 ${BUILDFOLDER}/liblcm.$(LIB_EXTENSION) ${LCMLIB_INSTALLDIR}
ifeq ($(LBITS),64)
- install -p -m 0755 -t ${LCMLIB_INSTALLDIR} ${BUILDFOLDER}/liblcm_x64.so.*
+ install -p -m 0755 ${BUILDFOLDER}/liblcm_x64.$(LIB_EXTENSION) ${LCMLIB_INSTALLDIR}
endif
- install -p -m 0755 -t $(LCMLIB_INSTALLDIR) $(WIN_BINARIES)/*.dll
- install -p -m 0555 -t ${LCMLDR_INSTALLDIR} ${AUTO_DIR_LOADER}/*
- install -p -m 0555 -t ${LCMLDR_INSTALLDIR} ${TRANSPORT_PATH}/source/*.c
- install -p -m 0555 -t ${LCMLDR_INSTALLDIR} ${NETWORK_PATH}/source/*.c
- install -p -m 0555 -t ${LCMLDR_INSTALLDIR} ${LCM_CNH_PATH}/source/*.c
- install -p -m 0555 -t ${LCMLDR_INSTALLDIR} ${TRANSPORT_PATH}/include/*.h
- install -p -m 0555 -t ${LCMLDR_INSTALLDIR} ${NETWORK_PATH}/include/*.h
- install -p -m 0555 -t ${LCMLDR_INSTALLDIR} ${LCM_CNH_PATH}/include/*.h
- install -p -m 0555 -t ${LCMLDR_INSTALLDIR} ${LCM_PATH}/source/serialization.c
+ install -p -m 0755 $(WIN_BINARIES)/*.dll ${LCMLIB_INSTALLDIR}
+ install -p -m 0555 ${AUTO_DIR_LOADER}/* ${LCMLDR_INSTALLDIR}
+ install -p -m 0555 ${TRANSPORT_PATH}/source/*.c ${LCMLDR_INSTALLDIR}
+ install -p -m 0555 ${NETWORK_PATH}/source/*.c ${LCMLDR_INSTALLDIR}
+ install -p -m 0555 ${LCM_CNH_PATH}/source/*.c ${LCMLDR_INSTALLDIR}
+ install -p -m 0555 ${TRANSPORT_PATH}/include/*.h ${LCMLDR_INSTALLDIR}
+ install -p -m 0555 ${NETWORK_PATH}/include/*.h ${LCMLDR_INSTALLDIR}
+ install -p -m 0555 ${LCM_CNH_PATH}/include/*.h ${LCMLDR_INSTALLDIR}
+ install -p -m 0555 ${LCM_PATH}/source/serialization.c ${LCMLDR_INSTALLDIR}
clean:
$(if ${BUILDFOLDER}, \
$(if ${LIB_x32_OBJ_DIR}, \
- @rm -f ${BUILDFOLDER}/${LIB_x32_OBJ_DIR}/*.o \
+ @rm -rf ${BUILDFOLDER}/${LIB_x32_OBJ_DIR}/*.o \
@rm -rf ${BUILDFOLDER}/${LIB_x32_OBJ_DIR} \
@rm -rf ${BUILDFOLDER},),)
ifeq ($(LBITS),64)
$(if ${BUILDFOLDER}, \
$(if ${LIB_x64_OBJ_DIR}, \
- @rm -f ${BUILDFOLDER}/${LIB_x64_OBJ_DIR}/*.o \
+ @rm -rf ${BUILDFOLDER}/${LIB_x64_OBJ_DIR}/*.o \
@rm -rf ${BUILDFOLDER}/${LIB_x64_OBJ_DIR} \
@rm -rf ${BUILDFOLDER},),)
endif
@@ -441,10 +448,10 @@ distclean: clean
@rm -f ${LCMLDR_INSTALLDIR}/z_transport.c \
@rm -f ${LCMLDR_INSTALLDIR}/r15_transport_layer.c \
@rm -f ${LCMLDR_INSTALLDIR}/t_a2_network.h \
- @rm -f ${LCMLIB_INSTALLDIR}/liblcm.so.*,)
+ @rm -f ${LCMLIB_INSTALLDIR}/liblcm.$(LIB_EXTENSION),)
ifeq ($(LBITS),64)
$(if ${LCMLDR_INSTALLDIR}, \
- @rm -f ${LCMLIB_INSTALLDIR}/liblcm_x64.so.*,)
+ @rm -f ${LCMLIB_INSTALLDIR}/liblcm_x64.$(LIB_EXTENSION),)
endif
$(if ${LCM_AUTO_DIR}, \
@rm -rf ${LCM_AUTO_DIR},)
diff --git a/lcmodule/source/LCM.rc b/lcmodule/source/LCM.rc
index f943863..0993ba4 100644
--- a/lcmodule/source/LCM.rc
+++ b/lcmodule/source/LCM.rc
@@ -69,15 +69,15 @@ BEGIN
BEGIN
BLOCK "040904b0"
BEGIN
- VALUE "Comments", "Build date: 2012-01-25"
+ VALUE "Comments", "Build date: 2012-02-07"
VALUE "CompanyName", "STEricsson AB"
VALUE "FileDescription", "LCM Dynamic Link Library"
VALUE "FileVersion", "1, 0, 0, 1"
VALUE "InternalName", "Loader Communication Module"
- VALUE "LegalCopyright", "Copyright (C) STEricsson AB 2011"
+ VALUE "LegalCopyright", "Copyright (C) STEricsson AB 2012"
VALUE "PrivateBuild", "Change-Id: I70835353a592d1f1ad40743640a1d0827e56fd2e"
VALUE "ProductName", "CXA1104507 Loader Communication Module"
- VALUE "ProductVersion", "P2Y"
+ VALUE "ProductVersion", "P3Y"
END
END
BLOCK "VarFileInfo"
diff --git a/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_a2_protocol.h b/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_a2_protocol.h
index fc453c2..df59efd 100644
--- a/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_a2_protocol.h
+++ b/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_a2_protocol.h
@@ -31,7 +31,7 @@
#define LCM_API __declspec(dllimport) // import DLL information
#endif // LCM_EXPORTS
-#elif defined(__linux__)
+#elif (defined(__linux__) || defined(__APPLE__))
#ifdef LCM_EXPORTS
#define LCM_API __attribute__((visibility("default")))
diff --git a/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_a2_speedflash.h b/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_a2_speedflash.h
index b36b5f0..525232f 100755
--- a/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_a2_speedflash.h
+++ b/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_a2_speedflash.h
@@ -29,7 +29,7 @@
#define LCM_API __declspec(dllimport) // import DLL information
#endif // LCM_EXPORTS
-#elif defined(__linux__)
+#elif (defined(__linux__) || defined(__APPLE__))
#ifdef LCM_EXPORTS
#define LCM_API __attribute__((visibility("default")))
diff --git a/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_bulk_protocol.h b/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_bulk_protocol.h
index 303161d..fa3f4ee 100644
--- a/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_bulk_protocol.h
+++ b/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_bulk_protocol.h
@@ -37,7 +37,7 @@
#define LCM_API __declspec(dllimport) // import DLL information
#endif // LCM_EXPORTS
-#elif defined(__linux__)
+#elif (defined(__linux__) || defined(__APPLE__))
#ifdef LCM_EXPORTS
#define LCM_API __attribute__((visibility("default")))
diff --git a/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_command_protocol.h b/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_command_protocol.h
index dce0711..d93fb9e 100644
--- a/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_command_protocol.h
+++ b/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_command_protocol.h
@@ -32,7 +32,7 @@
#define LCM_API __declspec(dllimport) // import DLL information
#endif // LCM_EXPORTS
-#elif defined(__linux__)
+#elif (defined(__linux__) || defined(__APPLE__))
#ifdef LCM_EXPORTS
#define LCM_API __attribute__((visibility("default")))
diff --git a/lcmodule/source/cnh1605205_ldr_network_layer/include/t_r15_header.h b/lcmodule/source/cnh1605205_ldr_network_layer/include/t_r15_header.h
index f102912..e31ca8c 100644
--- a/lcmodule/source/cnh1605205_ldr_network_layer/include/t_r15_header.h
+++ b/lcmodule/source/cnh1605205_ldr_network_layer/include/t_r15_header.h
@@ -41,7 +41,11 @@
/** The length of the bulk extended header. */
#define BULK_EXTENDED_HEADER_LENGTH 20
/** Offset of the header in the buffer. */
+#ifndef CFG_ENABLE_LOADER_TYPE
+#define HEADER_OFFSET_IN_BUFFER 0
+#else
#define HEADER_OFFSET_IN_BUFFER 8
+#endif
#define ALIGNED_HEADER_LENGTH ALIGN_SIZE
#define ALIGNED_COMMAND_EXTENDED_HEADER_LENGTH ALIGN_SIZE
diff --git a/lcmodule/source/cnh1605551_ldr_utilities/include/r_debug_macro.h b/lcmodule/source/cnh1605551_ldr_utilities/include/r_debug_macro.h
index 4faf681..adbcad3 100644
--- a/lcmodule/source/cnh1605551_ldr_utilities/include/r_debug_macro.h
+++ b/lcmodule/source/cnh1605551_ldr_utilities/include/r_debug_macro.h
@@ -36,7 +36,7 @@
/*******************************************************************************
* Macro for disabling ARM interrupts. Do nothing for Windows and LINT target.
******************************************************************************/
-#if (defined(WIN32) || defined(CFG_ENABLE_LINT_TARGET_BUILD) || defined(__linux__) || defined(__CYGWIN__))
+#if (defined(WIN32) || defined(CFG_ENABLE_LINT_TARGET_BUILD) || defined(__linux__) || defined(__APPLE__) || defined(__CYGWIN__))
#define INT_DISABLE()
#else
#ifdef MACH_TYPE_DB5700
diff --git a/lcmodule/source/cnh1606344_ldr_communication_module/include/r_communication_service.h b/lcmodule/source/cnh1606344_ldr_communication_module/include/r_communication_service.h
index 6d88855..643e067 100644
--- a/lcmodule/source/cnh1606344_ldr_communication_module/include/r_communication_service.h
+++ b/lcmodule/source/cnh1606344_ldr_communication_module/include/r_communication_service.h
@@ -31,7 +31,7 @@
#define LCM_API __declspec(dllimport) // import DLL information
#endif // LCM_EXPORTS
-#elif defined(__linux__)
+#elif (defined(__linux__) || defined(__APPLE__))
#ifdef LCM_EXPORTS
#define LCM_API __attribute__((visibility("default")))
diff --git a/lcmodule/source/cnh1606344_ldr_communication_module/source/lcm_version.c b/lcmodule/source/cnh1606344_ldr_communication_module/source/lcm_version.c
index d1243f6..ef324cf 100644
--- a/lcmodule/source/cnh1606344_ldr_communication_module/source/lcm_version.c
+++ b/lcmodule/source/cnh1606344_ldr_communication_module/source/lcm_version.c
@@ -13,6 +13,6 @@
* LCD_LCM_CompatibilityList in file LcdVersion.cpp in LCD code.
*/
-char LCM_CurrentVersion[] = "P2Y";
+char LCM_CurrentVersion[] = "P3Y";
/** @} */
diff --git a/lcmodule/source/legacy_compatibility/c_compiler.h b/lcmodule/source/legacy_compatibility/c_compiler.h
index 90799b1..cac45da 100644
--- a/lcmodule/source/legacy_compatibility/c_compiler.h
+++ b/lcmodule/source/legacy_compatibility/c_compiler.h
@@ -84,7 +84,7 @@
#elif defined(__GNUC__)
#ifdef __arm__
#define COMPILER_GCC_ARM
-#elif defined(__linux__)
+#elif (defined(__linux__) || defined(__APPLE__))
/* TARGET IS LINUX */
#define COMPILER_GCC
#endif
diff --git a/lcmodule/source/serialization.c b/lcmodule/source/serialization.c
index 717f847..59725db 100644
--- a/lcmodule/source/serialization.c
+++ b/lcmodule/source/serialization.c
@@ -16,7 +16,6 @@
#include <string.h>
#include <stdlib.h>
#include "r_debug_macro.h"
-
/*******************************************************************************
* Definition of external functions
******************************************************************************/