summaryrefslogtreecommitdiff
path: root/make/unit-cc.pl
diff options
context:
space:
mode:
Diffstat (limited to 'make/unit-cc.pl')
-rwxr-xr-xmake/unit-cc.pl4
1 files changed, 4 insertions, 0 deletions
diff --git a/make/unit-cc.pl b/make/unit-cc.pl
index e64053b66..aefefa4ac 100755
--- a/make/unit-cc.pl
+++ b/make/unit-cc.pl
@@ -29,6 +29,10 @@ my $cflags = $ENV{CXXFLAGS};
$cflags =~ s/ -pedantic// if nopedantic($file);
$cflags .= ' ' . getcompilerflags($file);
+if ($file =~ m#(?:^|/)((?:m|cmd)_[^/. ]+)(?:\.cpp|/.*\.cpp)$#) {
+ $cflags .= ' -DMODNAME='.$1.'.so';
+}
+
my $flags;
if ($out =~ /\.so$/) {
$flags = join ' ', $cflags, $ENV{PICLDFLAGS}, getlinkerflags($file);