Merge remote-tracking branch 'lp-anj7/expanded-rules' into 7.0

* lp-anj7/expanded-rules:
  Generate module version files with new RULES_EXPAND facilities
  Extend RULES_EXPAND to add more features
  More generator doc updates
  Document <library>_API = <stem> for Makefiles
  Convert epicsShareAPI to epicsStdCall in modules/ca
  Update generator script
  Modify rules to allow multiple API.h libraries to be built
  Convert modules/ca to use LIBCA_API instead of epicsShare
  Try out a representative sample of APIs from multiple libraries
  Add build rules to generate and install *API.h header files
  Add script to generate *API.h headers
This commit is contained in:
Michael Davidsaver
2020-04-30 11:34:34 -07:00
117 changed files with 882 additions and 1112 deletions

View File

@@ -16,8 +16,14 @@ include $(TOP)/configure/CONFIG
INC += valgrind/valgrind.h
EXPAND_COMMON = libComVersion.h@
EXPAND_ME += EPICS_LIBCOM_MAJOR_VERSION
EXPAND_ME += EPICS_LIBCOM_MINOR_VERSION
EXPAND_ME += EPICS_LIBCOM_MAINTENANCE_VERSION
EXPAND_ME += EPICS_LIBCOM_DEVELOPMENT_FLAG
INC += libComVersion.h
INC += libComVersionNum.h
include $(LIBCOM)/as/Makefile
include $(LIBCOM)/bucketLib/Makefile
@@ -45,6 +51,10 @@ include $(LIBCOM)/timer/Makefile
include $(LIBCOM)/yacc/Makefile
include $(LIBCOM)/yajl/Makefile
# Generate library API header file
API_HEADER = libComAPI.h
Com_API = libCom
# Library to build:
LIBRARY=Com
@@ -57,13 +67,6 @@ ifeq ($(T_A),$(EPICS_HOST_ARCH))
DELAY_INSTALL_LIBS = YES
endif
EXPANDVARS += EPICS_LIBCOM_MAJOR_VERSION
EXPANDVARS += EPICS_LIBCOM_MINOR_VERSION
EXPANDVARS += EPICS_LIBCOM_MAINTENANCE_VERSION
EXPANDVARS += EPICS_LIBCOM_DEVELOPMENT_FLAG
EXPANDFLAGS += $(foreach var,$(EXPANDVARS),-D$(var)="$(strip $($(var)))")
# shared library ABI version.
SHRLIB_VERSION = $(EPICS_LIBCOM_MAJOR_VERSION).$(EPICS_LIBCOM_MINOR_VERSION).$(EPICS_LIBCOM_MAINTENANCE_VERSION)
@@ -76,8 +79,3 @@ include $(LIBCOM)/flex/RULES
include $(LIBCOM)/misc/RULES
include $(LIBCOM)/osi/RULES
include $(LIBCOM)/yajl/RULES
# Can't use EXPAND as generated headers must appear
# in O.Common, but EXPAND emits rules for O.$(T_A)
../O.Common/libComVersionNum.h: ../libComVersionNum.h@
$(EXPAND_TOOL) $(EXPANDFLAGS) $($@_EXPANDFLAGS) $< $@

View File

@@ -5,24 +5,17 @@
* in file LICENSE that is included with this distribution.
\*************************************************************************/
#ifndef LIBCOMVERSION_H
#define LIBCOMVERSION_H
#ifndef INC_libComVersion_H
#define INC_libComVersion_H
#define EPICS_LIBCOM_MAJOR_VERSION @EPICS_LIBCOM_MAJOR_VERSION@
#define EPICS_LIBCOM_MINOR_VERSION @EPICS_LIBCOM_MINOR_VERSION@
#define EPICS_LIBCOM_MAINTENANCE_VERSION @EPICS_LIBCOM_MAINTENANCE_VERSION@
#define EPICS_LIBCOM_DEVELOPMENT_FLAG @EPICS_LIBCOM_DEVELOPMENT_FLAG@
#include <epicsVersion.h>
#include <shareLib.h>
#ifndef VERSION_INT
# define VERSION_INT(V,R,M,P) ( ((V)<<24) | ((R)<<16) | ((M)<<8) | (P))
#endif
#define LIBCOM_VERSION_INT VERSION_INT(EPICS_LIBCOM_MAJOR_VERSION, \
EPICS_LIBCOM_MINOR_VERSION, EPICS_LIBCOM_MAINTENANCE_VERSION, 0)
/* include generated headers with:
* EPICS_LIBCOM_MAJOR_VERSION
* EPICS_LIBCOM_MINOR_VERSION
* EPICS_LIBCOM_MAINTENANCE_VERSION
* EPICS_LIBCOM_DEVELOPMENT_FLAG
*/
#include "libComVersionNum.h"
#define LIBCOM_VERSION_INT VERSION_INT(EPICS_LIBCOM_MAJOR_VERSION, EPICS_LIBCOM_MINOR_VERSION, EPICS_LIBCOM_MAINTENANCE_VERSION, 0)
#endif // LIBCOMVERSION_H
#endif /* INC_libComVersion_H */

View File

@@ -1,7 +0,0 @@
#ifndef LIBCOMVERSION_H
# error include libComVersion.h, not this header
#endif
#define EPICS_LIBCOM_MAJOR_VERSION @EPICS_LIBCOM_MAJOR_VERSION@
#define EPICS_LIBCOM_MINOR_VERSION @EPICS_LIBCOM_MINOR_VERSION@
#define EPICS_LIBCOM_MAINTENANCE_VERSION @EPICS_LIBCOM_MAINTENANCE_VERSION@
#define EPICS_LIBCOM_DEVELOPMENT_FLAG @EPICS_LIBCOM_DEVELOPMENT_FLAG@

View File

@@ -19,7 +19,6 @@
#include <stdarg.h>
#include <assert.h>
#define epicsExportSharedSymbols
#include "yajl_parse.h"
#include "yajl_lex.h"
#include "yajl_parser.h"

View File

@@ -22,7 +22,6 @@
#include <stdlib.h>
#define epicsExportSharedSymbols
#include "yajl_alloc.h"
static void * yajl_internal_malloc(void *ctx, size_t sz)

View File

@@ -18,7 +18,6 @@
#include <stdlib.h>
#include <string.h>
#define epicsExportSharedSymbols
#include "yajl_buf.h"
#define YAJL_BUF_INIT_SIZE 2048

View File

@@ -18,7 +18,7 @@
#define __YAJL_COMMON_H__
#include <stddef.h>
#include <shareLib.h>
#include <libComAPI.h>
#include <epicsVersion.h>
@@ -42,7 +42,7 @@ extern "C" {
#define YAJL_MAX_DEPTH 128
#define YAJL_API epicsShareFunc
#define YAJL_API LIBCOM_API
/** pointer to a malloc function, supporting client overriding memory
* allocation routines */

View File

@@ -19,7 +19,6 @@
#include <string.h>
#include <stdio.h>
#define epicsExportSharedSymbols
#include "yajl_encode.h"
static void CharToHex(unsigned char c, char * hexBuf)

View File

@@ -19,7 +19,6 @@
#include <stdio.h>
#include <stdarg.h>
#define epicsExportSharedSymbols
#include "epicsMath.h"
#include "yajl_gen.h"
#include "yajl_buf.h"

View File

@@ -19,7 +19,6 @@
#include <assert.h>
#include <string.h>
#define epicsExportSharedSymbols
#include "yajl_lex.h"
#include "yajl_buf.h"

View File

@@ -23,7 +23,6 @@
#include <assert.h>
#include <math.h>
#define epicsExportSharedSymbols
#include "yajl_parse.h"
#include "yajl_lex.h"
#include "yajl_parser.h"