- user_lib = '$${prefix}/lib'
-
-if user_prefix:
- pc_vars = {'\@PREFIX\@': user_prefix,
- '\@EXEC_PREFIX\@':user_prefix,
- '\@VERSION\@': '1.0.1',
- '\@LIB_INSTALL_DIR\@': user_lib,
- '\@ROUTING_DEFINE\@': routing_define
- }
-else:
- pc_vars = {'\@PREFIX\@': env.get('BUILD_DIR'),
- '\@EXEC_PREFIX\@': env.get('BUILD_DIR'),
- '\@VERSION\@': '1.0.1',
- '\@LIB_INSTALL_DIR\@': user_lib,
- '\@ROUTING_DEFINE\@': routing_define
- }
+ user_lib = '$${prefix}/lib'
+
+defines = []
+if env.get('LOGGING'):
+ defines.append('-DTB_LOG=1')
+
+if env.get('ROUTING') == 'GW':
+ defines.append('-DROUTING_GATEWAY=1')
+elif env.get('ROUTING') == 'EP':
+ defines.append('-DROUTING_EP=1')
+
+if env.get('WITH_TCP'):
+ defines.append('-DTCP_ADAPTER=1')
+ if env.get('SECURED') == '1':
+ defines.append('-D__WITH_TLS__=1')
+
+libs = []
+if env.get('SECURED') == '1':
+ defines.append('-D__WITH_DTLS__=1')
+ if env.get('EXC_PROV_SUPPORT') == '0':
+ libs.append('-locpmapi') # CAPI
+ libs.append('-locprovision') # C++API
+
+pc_vars = {
+ '\@VERSION\@': project_version,
+ '\@PREFIX\@': user_prefix,
+ '\@EXEC_PREFIX\@': user_prefix,
+ '\@LIB_INSTALL_DIR\@': user_lib,
+ '\@DEFINES\@': " ".join(defines),
+ '\@LIBS\@': " ".join(libs)
+}