--- a/libraries/libapparmor/testsuite/test_multi.c
+++ b/libraries/libapparmor/testsuite/test_multi.c
@@ -1,5 +1,3 @@
-#define _GNU_SOURCE /* for glibc's basename version */
-
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -7,6 +5,11 @@
 
 #include <aalogparse.h>
 
+static const char *basename(const char *path)
+{
+	return strrchr(path, '/') ? strrchr(path, '/')+1 : path;
+}
+
 int print_results(aa_log_record *record);
 
 int main(int argc, char **argv)
