-
Notifications
You must be signed in to change notification settings - Fork 0
/
libUniSet3.include
119 lines (92 loc) · 3.7 KB
/
libUniSet3.include
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#!/bin/sh
# Copyright (c) 2009 Free Software Foundation, Inc.
# Copyright (c) 2009 Vitaly Lipatov <[email protected]>
# exports flags and libs from2.pc file for build with library for source tree
# EXPORTPATH contains path to the project dir (../uniset f.i.)
# Usage example:
# TryExport()
# {
# EXPORTPATH=$(readlink -f $1)
# test -r $1/$2 && . $1/$2
# }
#
# TryExport ../uniset libUniSet.include
PCFILE=$EXPORTPATH/libUniSet3.pc
test -r "$PCFILE" || exit 1
# guess prefix in the first line of pkgconfig file
eval $(head -n1 $PCFILE)
test -d "$prefix" || exit 1
export PKG_CONFIG_PATH="$EXPORTPATH:\
$EXPORTPATH/extensions/DBServer-MySQL:\
$EXPORTPATH/extensions/DBServer-PostgreSQL:\
$EXPORTPATH/extensions/DBServer-SQLite:\
$EXPORTPATH/extensions/IOControl:\
$EXPORTPATH/extensions/LogicProcessor:\
$EXPORTPATH/extensions/ModbusMaster:\
$EXPORTPATH/extensions/ModbusSlave:\
$EXPORTPATH/extensions/MQTTPublisher:\
$EXPORTPATH/extensions/SharedMemory:\
$EXPORTPATH/extensions/UNetUDP:\
$EXPORTPATH/extensions/UniNetwork:\
$EXPORTPATH/extensions/UWebSocketGate:\
$EXPORTPATH/extensions:\
$PKG_CONFIG_PATH"
cflags()
{
pkg-config --cflags $1 | sed -e "s|-I$prefix/include/uniset3|-I$EXPORTPATH/include|g"
}
libs()
{
echo -n "-L$EXPORTPATH/lib "
pkg-config --libs $1 | sed -e "s|-L$prefix | |g"
}
export UNISET_CFLAGS="$( cflags $PCFILE )"
export UNISET_LIBS="$( libs $PCFILE )"
ext_cflags()
{
# FIXME: really use extensions/
echo -n "-I$1 "
cflags $1/$2
}
ext_libs()
{
echo -n "-L$1 "
libs $1/$2
}
EXFILE="$EXPORTPATH/extensions libUniSet3Extensions.pc"
export UNISET_EXT_CFLAGS="$( ext_cflags $EXFILE )"
export UNISET_EXT_LIBS="-L$EXPORTPATH/extensions/lib $( ext_libs $EXFILE )"
EXFILE="$EXPORTPATH/extensions/Backend-OpenTSDB libUniSet3BackendOpenTSDB.pc"
export UNISET_EXT_BACKENDOPENTSDB_CFLAGS="$( ext_cflags $EXFILE )"
export UNISET_EXT_BACKENDOPENTSDB_LIBS="$( ext_libs $EXFILE )"
EXFILE="$EXPORTPATH/extensions/IOControl libUniSet3IOControl.pc"
export UNISET_EXT_IO_CFLAGS="$( ext_cflags $EXFILE )"
export UNISET_EXT_IO_LIBS="$( ext_libs $EXFILE )"
EXFILE="$EXPORTPATH/extensions/SharedMemory libUniSet3SharedMemory.pc"
export UNISET_EXT_SM_CFLAGS="$( ext_cflags $EXFILE )"
export UNISET_EXT_SM_LIBS="$( ext_libs $EXFILE )"
EXFILE="$EXPORTPATH/extensions/ModbusSlave libUniSet3MBSlave.pc"
export UNISET_EXT_MBS_CFLAGS="$( ext_cflags $EXFILE )"
export UNISET_EXT_MBS_LIBS="$( ext_libs $EXFILE )"
EXFILE="$EXPORTPATH/extensions/ModbusMaster libUniSet3MBTCPMaster.pc"
export UNISET_EXT_MBM_CFLAGS="$( ext_cflags $EXFILE )"
export UNISET_EXT_MBM_LIBS="$( ext_libs $EXFILE )"
EXFILE="$EXPORTPATH/extensions/UniNetwork libUniSet3Network.pc"
export UNISET_EXT_NET_CFLAGS="$( ext_cflags $EXFILE )"
export UNISET_EXT_NET_LIBS="$( ext_libs $EXFILE )"
EXFILE="$EXPORTPATH/extensions/UNetUDP libUniSet3UNetUDP.pc"
export UNISET_EXT_UNETUDP_CFLAGS="$( ext_cflags $EXFILE )"
export UNISET_EXT_UNETUDP_LIBS="$( ext_libs $EXFILE )"
EXFILE="$EXPORTPATH/extensions/ModbusMaster libUniSet3RTU.pc"
export UNISET_EXT_RTU_CFLAGS="$( ext_cflags $EXFILE )"
export UNISET_EXT_RTU_LIBS="$( ext_libs $EXFILE )"
EXFILE="$EXPORTPATH/extensions/DBServer-MySQL libUniSet3MySQL.pc"
export UNISET_EXT_MYSQL_CFLAGS="$( ext_cflags $EXFILE )"
export UNISET_EXT_MYSQL_LIBS="$( ext_libs $EXFILE )"
EXFILE="$EXPORTPATH/extensions/LogicProcessor libUniSet3LogicProcessor.pc"
export UNISET_EXT_LP_CFLAGS="$( ext_cflags $EXFILE )"
export UNISET_EXT_LP_LIBS="$( ext_libs $EXFILE )"
EXFILE="$EXPORTPATH/extensions/MQTTPublisher libUniSet3MQTTPublisher.pc"
export UNISET_EXT_MQTTPUBLISHER_CFLAGS="$( ext_cflags $EXFILE )"
export UNISET_EXT_MQTTPUBLISHER_LIBS="$( ext_libs $EXFILE )"
export UNISET_CODEGEN="sh $EXPORTPATH/Utilities/codegen/uniset3-codegen --path $EXPORTPATH/Utilities/codegen"