diff --git a/doc/xml/release.xml b/doc/xml/release.xml
index 3eb38b467..586fb301a 100644
--- a/doc/xml/release.xml
+++ b/doc/xml/release.xml
@@ -59,6 +59,10 @@
Add ServiceError
for errors from a service that can be retried.
+
+ Conditional compilation of Perl logic in exit.c.
+
+
Remove extraneous use
/include
statements.
diff --git a/src/Makefile b/src/Makefile
index 8c79d3324..bb7114b02 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -21,7 +21,7 @@ CWARN = -Wfatal-errors -Wall -Wextra -Wwrite-strings -Wswitch-enum -Wconversion
-Wno-clobbered -Wno-missing-field-initializers -Wstrict-prototypes -Wpointer-arith -Wvla
# Automatically generate Perl compile options for the local system
-CPERL = `perl -MExtUtils::Embed -e ccopts`
+CPERL = `perl -MExtUtils::Embed -e ccopts` -DWITH_PERL
# Automatically generate xml compile options for the local system
CXML = `xml2-config --cflags`
@@ -201,7 +201,7 @@ common/exit.o: common/exit.c command/command.h common/debug.h common/error.auto.
common/fork.o: common/fork.c common/debug.h common/error.auto.h common/error.h common/log.h common/logLevel.h common/stackTrace.h common/type/convert.h
$(CC) $(CFLAGS) -c common/fork.c -o common/fork.o
-common/ini.o: common/ini.c common/debug.h common/error.auto.h common/error.h common/ini.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h storage/fileRead.h storage/fileWrite.h storage/helper.h storage/info.h storage/storage.h
+common/ini.o: common/ini.c common/debug.h common/error.auto.h common/error.h common/ini.h common/logLevel.h common/memContext.h common/stackTrace.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/string.h common/type/variant.h common/type/variantList.h
$(CC) $(CFLAGS) -c common/ini.c -o common/ini.o
common/io/bufferRead.o: common/io/bufferRead.c common/assert.h common/debug.h common/error.auto.h common/error.h common/io/bufferRead.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/read.intern.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/string.h common/type/variant.h common/type/variantList.h
diff --git a/src/common/exit.c b/src/common/exit.c
index e50e684d0..a1d04311e 100644
--- a/src/common/exit.c
+++ b/src/common/exit.c
@@ -11,7 +11,10 @@ Exit Routines
#include "common/lock.h"
#include "common/log.h"
#include "config/config.h"
-#include "perl/exec.h"
+
+#ifdef WITH_PERL
+ #include "perl/exec.h"
+#endif
/***********************************************************************************************************************************
Return signal names
@@ -98,8 +101,10 @@ exitSafe(int result, bool error, SignalType signalType)
if (error)
{
// Don't log the error if it has already been logged by Perl
+#ifdef WITH_PERL
if (strcmp(errorMessage(), PERL_EMBED_ERROR) != 0)
{
+#endif
LogLevel logLevel = errorCode() == errorTypeCode(&AssertError) ? logLevelAssert : logLevelError;
// Assert errors always output a stack trace
@@ -118,7 +123,9 @@ exitSafe(int result, bool error, SignalType signalType)
errorStackTrace());
}
}
+#ifdef WITH_PERL
}
+#endif
result = errorCode();
}
@@ -131,11 +138,13 @@ exitSafe(int result, bool error, SignalType signalType)
TRY_END();
// Free Perl but ignore errors
+#ifdef WITH_PERL
TRY_BEGIN()
{
perlFree(result);
}
TRY_END();
+#endif
// Log command end if a command is set
if (cfgCommand() != cfgCmdNone)
diff --git a/test/lib/pgBackRestTest/Common/JobTest.pm b/test/lib/pgBackRestTest/Common/JobTest.pm
index df889795c..d1c5e979a 100644
--- a/test/lib/pgBackRestTest/Common/JobTest.pm
+++ b/test/lib/pgBackRestTest/Common/JobTest.pm
@@ -383,8 +383,8 @@ sub run
# Flags that are common to all builds
my $strCommonFlags =
- '-I. -Itest -std=c99 -fPIC -g -Wno-clobbered `perl -MExtUtils::Embed -e ccopts` `xml2-config --cflags`'
- . ($self->{bProfile} ? " -pg" : '') .
+ '-I. -Itest -std=c99 -fPIC -g -Wno-clobbered `perl -MExtUtils::Embed -e ccopts` -DWITH_PERL' .
+ ' `xml2-config --cflags`' . ($self->{bProfile} ? " -pg" : '') .
($self->{oTest}->{&TEST_DEBUG_UNIT_SUPPRESS} ? '' : " -DDEBUG_UNIT") .
(vmWithBackTrace($self->{oTest}->{&TEST_VM}) && $self->{bBackTrace} ? ' -DWITH_BACKTRACE' : '') .
($self->{oTest}->{&TEST_CDEF} ? " $self->{oTest}->{&TEST_CDEF}" : '') .