Commit 20e581db authored by Pavel Vainerman's avatar Pavel Vainerman

Исправил сборку для 64bit-ных систем. Вынес важные константы в отдельный

файл.
parent 797de25f
...@@ -7,7 +7,7 @@ CCDIR=$(top_builddir)/src/ObjectRepository ...@@ -7,7 +7,7 @@ CCDIR=$(top_builddir)/src/ObjectRepository
HHDIR=$(top_builddir)/include HHDIR=$(top_builddir)/include
# Исходные файлы IDL # Исходные файлы IDL
IDLFILES=UniSetTypes_i.idl UniSetObject_i.idl UniSetManager_i.idl IDLFILES=UniSetBaseConstants.idl UniSetTypes_i.idl UniSetObject_i.idl UniSetManager_i.idl
include $(top_builddir)/IDL/idl.mk include $(top_builddir)/IDL/idl.mk
......
/*
* Copyright (c) 2015 Pavel Vainerman.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, version 2.1.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Lesser Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// --------------------------------------------------------------------------
/*! \file
* \author Pavel Vainerman
*/
// --------------------------------------------------------------------------
#ifndef UniSetBaseConstants_IDL_
#define UniSetBaseConstants_IDL_
// --------------------------------------------------------------------------
//module UniSet
//{
module UniSetTypes
{
const unsigned short SizeOfTransportMessage=@SIZE_OF_TRANSPORT_MESSAGE@;
const unsigned short SizeOfObjectType=30;
};
//}; // end of module UniSet
// --------------------------------------------------------------------------------------------------------------
#endif // of UniSetBaseConstants_IDL
...@@ -21,6 +21,8 @@ ...@@ -21,6 +21,8 @@
#ifndef UniSetTypes_i_IDL_ #ifndef UniSetTypes_i_IDL_
#define UniSetTypes_i_IDL_ #define UniSetTypes_i_IDL_
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
#include "UniSetBaseConstants.idl"
// --------------------------------------------------------------------------
//module UniSet //module UniSet
//{ //{
module UniSetTypes module UniSetTypes
...@@ -28,9 +30,7 @@ ...@@ -28,9 +30,7 @@
typedef long ObjectId; /*!< идентификатор объекта */ typedef long ObjectId; /*!< идентификатор объекта */
typedef long ThresholdId; /*!< идентификатор порога */ typedef long ThresholdId; /*!< идентификатор порога */
typedef long TimerId; /*!< идентификатор таймера */ typedef long TimerId; /*!< идентификатор таймера */
typedef string<30> ObjectType; /*!< тип объекта */ typedef string<SizeOfObjectType> ObjectType; /*!< тип объекта */
const unsigned short SizeOfTransportMessage=85;
typedef octet ByteOfMessage; /*!< тип для одного байта сообщения */ typedef octet ByteOfMessage; /*!< тип для одного байта сообщения */
typedef ByteOfMessage RawDataOfTransportMessage[SizeOfTransportMessage]; /*!< данные в сообщении */ typedef ByteOfMessage RawDataOfTransportMessage[SizeOfTransportMessage]; /*!< данные в сообщении */
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
Name: libuniset2 Name: libuniset2
Version: 2.3 Version: 2.3
Release: alt2 Release: alt3
Summary: UniSet - library for building distributed industrial control systems Summary: UniSet - library for building distributed industrial control systems
License: LGPL License: LGPL
...@@ -486,6 +486,9 @@ mv -f %buildroot%python_sitelibdir_noarch/* %buildroot%python_sitelibdir/%oname ...@@ -486,6 +486,9 @@ mv -f %buildroot%python_sitelibdir_noarch/* %buildroot%python_sitelibdir/%oname
# .. # ..
%changelog %changelog
* Wed Apr 27 2016 Pavel Vainerman <pv@altlinux.ru> 2.3-alt3
- fixed build for 64-bit
* Wed Apr 20 2016 Pavel Vainerman <pv@altlinux.ru> 2.3-alt2 * Wed Apr 20 2016 Pavel Vainerman <pv@altlinux.ru> 2.3-alt2
- (LogSession): disable "keep alive message" - (LogSession): disable "keep alive message"
......
...@@ -310,6 +310,17 @@ CXXFLAGS="$CXXFLAGS -funsigned-char -std=c++11 -g -D_GNU_SOURCE ${OMNI_CFLAGS} $ ...@@ -310,6 +310,17 @@ CXXFLAGS="$CXXFLAGS -funsigned-char -std=c++11 -g -D_GNU_SOURCE ${OMNI_CFLAGS} $
AC_SUBST(LDFLAGS) AC_SUBST(LDFLAGS)
AC_SUBST(CXXFLAGS) AC_SUBST(CXXFLAGS)
# check of platform (32bit or 64 bit)
SIZE_OF_TRANSPORT_MESSAGE=85
AC_MSG_CHECKING([test 64-bit OS])
AC_TRY_COMPILE([],[int assert[(sizeof(long) == 8) ? 1: -1]], result="yes", result="no")
AC_MSG_RESULT($result)
if test "$result" = "yes"; then
SIZE_OF_TRANSPORT_MESSAGE=160
fi
AC_SUBST(SIZE_OF_TRANSPORT_MESSAGE)
# Checks for header files. # Checks for header files.
AC_HEADER_DIRENT AC_HEADER_DIRENT
AC_HEADER_STDC AC_HEADER_STDC
...@@ -337,6 +348,7 @@ AC_CONFIG_FILES([Makefile ...@@ -337,6 +348,7 @@ AC_CONFIG_FILES([Makefile
lib/Makefile lib/Makefile
IDL/Makefile IDL/Makefile
IDL/UniSetTypes/Makefile IDL/UniSetTypes/Makefile
IDL/UniSetTypes/UniSetBaseConstants.idl
IDL/Processes/Makefile IDL/Processes/Makefile
src/Communications/Makefile src/Communications/Makefile
src/Communications/Modbus/Makefile src/Communications/Modbus/Makefile
......
...@@ -242,6 +242,7 @@ extensions/Makefile.am ...@@ -242,6 +242,7 @@ extensions/Makefile.am
IDL/Processes/Makefile.am IDL/Processes/Makefile.am
IDL/Processes/IOController_i.idl IDL/Processes/IOController_i.idl
IDL/UniSetTypes/Makefile.am IDL/UniSetTypes/Makefile.am
IDL/UniSetTypes/UniSetBaseConstants.idl
IDL/UniSetTypes/UniSetTypes_i.idl IDL/UniSetTypes/UniSetTypes_i.idl
IDL/UniSetTypes/UniSetObject_i.idl IDL/UniSetTypes/UniSetObject_i.idl
IDL/UniSetTypes/UniSetManager_i.idl IDL/UniSetTypes/UniSetManager_i.idl
...@@ -523,3 +524,5 @@ Utilities/Makefile.am ...@@ -523,3 +524,5 @@ Utilities/Makefile.am
libUniSet2.pc.in libUniSet2.pc.in
Makefile.am Makefile.am
uniset-config.h uniset-config.h
configure.ac
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment