Skip to content

Commit 8387fc3

Browse files
Fix build with CCS disabled
1 parent 4ebf61d commit 8387fc3

File tree

2 files changed

+24
-15
lines changed

2 files changed

+24
-15
lines changed

src/scripts/configure.ac

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,21 @@ else
263263
AC_DEFINE_UNQUOTED(CMK_DRONE_MODE, 1, [enable drone mode])
264264
fi
265265

266+
AC_ARG_ENABLE([ccs],
267+
[AS_HELP_STRING([--enable-ccs],
268+
[enable CCS])], ,
269+
[enable_ccs=yes])
270+
271+
if test "$enable_ccs" = "no" -o "$CMK_CCS_AVAILABLE" = '0'
272+
then
273+
Echo "CCS is disabled"
274+
AC_DEFINE_UNQUOTED(CMK_CCS_AVAILABLE, 0, [disable ccs])
275+
CMK_CCS_AVAILABLE='0'
276+
else
277+
Echo "CCS is enabled"
278+
AC_DEFINE_UNQUOTED(CMK_CCS_AVAILABLE, 1, [enable ccs])
279+
fi
280+
266281
AC_ARG_ENABLE([charmdebug],
267282
[AS_HELP_STRING([--enable-charmdebug],
268283
[enable charmDebug])], ,
@@ -302,20 +317,6 @@ else
302317
fi
303318
fi
304319

305-
AC_ARG_ENABLE([ccs],
306-
[AS_HELP_STRING([--enable-ccs],
307-
[enable CCS])], ,
308-
[enable_ccs=yes])
309-
310-
if test "$enable_ccs" = "no" -o "$CMK_CCS_AVAILABLE" = '0'
311-
then
312-
Echo "CCS is disabled"
313-
AC_DEFINE_UNQUOTED(CMK_CCS_AVAILABLE, 0, [disable ccs])
314-
else
315-
Echo "CCS is enabled"
316-
AC_DEFINE_UNQUOTED(CMK_CCS_AVAILABLE, 1, [enable ccs])
317-
fi
318-
319320
AC_ARG_ENABLE([controlpoint],
320321
[AS_HELP_STRING([--enable-controlpoint],
321322
[enable control point])],

src/util/charmrun-src/charmrun.C

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1872,7 +1872,7 @@ static int req_ccs_reply_fw(ChMessage *msg, SOCKET srcFd)
18721872
}
18731873

18741874
#else
1875-
static int req_ccs_reply_fw(ChMessage *msg, SOCKET srcFd) {}
1875+
static inline void req_ccs_connect() { }
18761876
#endif /*CMK_CCS_AVAILABLE*/
18771877

18781878
/****************************************************************************
@@ -2158,23 +2158,29 @@ static int req_handle_print(ChMessage *msg, SOCKET fd)
21582158
{
21592159
checkPrintfError(printf("%s", msg->data));
21602160
checkPrintfError(fflush(stdout));
2161+
#if CMK_CCS_AVAILABLE
21612162
write_stdio_duplicate(msg->data);
2163+
#endif
21622164
return REQ_OK;
21632165
}
21642166

21652167
static int req_handle_printerr(ChMessage *msg, SOCKET fd)
21662168
{
21672169
fprintf(stderr, "%s", msg->data);
21682170
fflush(stderr);
2171+
#if CMK_CCS_AVAILABLE
21692172
write_stdio_duplicate(msg->data);
2173+
#endif
21702174
return REQ_OK;
21712175
}
21722176

21732177
static int req_handle_printsyn(ChMessage *msg, SOCKET fd)
21742178
{
21752179
checkPrintfError(printf("%s", msg->data));
21762180
checkPrintfError(fflush(stdout));
2181+
#if CMK_CCS_AVAILABLE
21772182
write_stdio_duplicate(msg->data);
2183+
#endif
21782184
#ifdef HSTART
21792185
if (arg_hierarchical_start)
21802186
req_reply_child(fd, "printdone", "", 1);
@@ -2188,7 +2194,9 @@ static int req_handle_printerrsyn(ChMessage *msg, SOCKET fd)
21882194
{
21892195
fprintf(stderr, "%s", msg->data);
21902196
fflush(stderr);
2197+
#if CMK_CCS_AVAILABLE
21912198
write_stdio_duplicate(msg->data);
2199+
#endif
21922200
#ifdef HSTART
21932201
if (arg_hierarchical_start)
21942202
req_reply_child(fd, "printdone", "", 1);

0 commit comments

Comments
 (0)