summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordata-man <dataman@tutanota.com>2022-01-24 20:38:00 +0500
committerdata-man <dataman@tutanota.com>2022-01-24 20:38:00 +0500
commit3cdf67e77da64ba1235265836f29b228deca3642 (patch)
treef799fcd92f2b52cd3a098d9f39200b8a89b15d80
parent09124f64f6eb332e49b4d13c4975fc36260f7f2b (diff)
downloadbfs-3cdf67e77da64ba1235265836f29b228deca3642.tar.xz
Apply suggestions from code review
-rw-r--r--Makefile15
-rw-r--r--regexp.h5
2 files changed, 8 insertions, 12 deletions
diff --git a/Makefile b/Makefile
index 77de641..8af4a99 100644
--- a/Makefile
+++ b/Makefile
@@ -72,11 +72,6 @@ ifeq ($(OS),Linux)
LOCAL_LDFLAGS += -Wl,--as-needed
LOCAL_LDLIBS += -lacl -lcap -lattr -lrt
-ifdef USE_ONIGURUMA
-LOCAL_LDLIBS += -lonig
-LOCAL_CFLAGS += -DUSE_ONIGURUMA
-endif
-
# These libraries are not built with msan, so disable them
MSAN_CFLAGS += -DBFS_HAS_SYS_ACL=0 -DBFS_HAS_SYS_CAPABILITY=0 -DBFS_HAS_SYS_XATTR=0
@@ -87,11 +82,6 @@ endif
ifeq ($(OS),NetBSD)
LOCAL_LDLIBS += -lutil
-
-ifdef USE_ONIGURUMA
-LOCAL_LDLIBS += -lonig
-LOCAL_CFLAGS += -DUSE_ONIGURUMA
-endif
endif
ifneq ($(filter asan,$(MAKECMDGOALS)),)
@@ -121,6 +111,11 @@ ifneq ($(filter release,$(MAKECMDGOALS)),)
CFLAGS := $(DEFAULT_CFLAGS) -O3 -flto -DNDEBUG
endif
+ifeq ($(USE_ONIGURUMA),1)
+LOCAL_LDLIBS += -lonig
+LOCAL_CFLAGS += -DBFS_USE_ONIGURUMA=1
+endif
+
ALL_CPPFLAGS = $(LOCAL_CPPFLAGS) $(CPPFLAGS)
ALL_CFLAGS = $(ALL_CPPFLAGS) $(LOCAL_CFLAGS) $(CFLAGS) $(DEPFLAGS)
ALL_LDFLAGS = $(ALL_CFLAGS) $(LOCAL_LDFLAGS) $(LDFLAGS)
diff --git a/regexp.h b/regexp.h
index 14da4d5..8654b58 100644
--- a/regexp.h
+++ b/regexp.h
@@ -1,6 +1,7 @@
/****************************************************************************
* bfs *
- * Copyright (C) 2016-2022 Tavian Barnes <tavianator@tavianator.com> *
+ * Copyright (C) 2022 Tavian Barnes <tavianator@tavianator.com> and *
+ * BFS contributors *
* *
* Permission to use, copy, modify, and/or distribute this software for any *
* purpose with or without fee is hereby granted. *
@@ -17,7 +18,7 @@
#ifndef BFS_REGEXP_H
#define BFS_REGEXP_H
-#ifdef USE_ONIGURUMA
+#if BFS_USE_ONIGURUMA == 1
#include <onigposix.h>
#else
#include <regex.h>