aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCem Keylan <cem@ckyln.com>2021-03-13 14:08:29 +0300
committerCem Keylan <cem@ckyln.com>2021-03-13 14:08:29 +0300
commit0ea3661a6ba0baaa39b95e836e8f2c87e2f4c20f (patch)
treeb4f26bf5b77a8818c972a36d01b29adb533a5c83
parentedf65a21574455989192e1a91453aa6f7dc90d53 (diff)
downloadotools-0ea3661a6ba0baaa39b95e836e8f2c87e2f4c20f.tar.gz
add configuration for fts, handle if it is available on system1.3.1
-rw-r--r--Makefile13
-rw-r--r--README.md33
-rw-r--r--config.mk8
-rw-r--r--lib/libutil/ohash.h4
4 files changed, 30 insertions, 28 deletions
diff --git a/Makefile b/Makefile
index d10f3e4..2194ac4 100644
--- a/Makefile
+++ b/Makefile
@@ -15,7 +15,6 @@ LIBOBJ = \
lib/libc/crypt/arc4random.o \
lib/libc/crypt/arc4random_uniform.o \
lib/libc/crypt/blowfish.o \
- lib/libc/gen/fts.o \
lib/libc/gen/getprogname.o \
lib/libc/gen/pwcache.o \
lib/libc/gen/readpassphrase.o \
@@ -48,6 +47,14 @@ LIBOBJ = \
lib/libutil/ohash.o \
lib/libutil/pidfile.o
+ifeq (${FTS}, 0)
+LIBOBJ += lib/libc/gen/fts.o
+else
+CFLAGS += -DHAVE_FTS
+ ifeq (${FTS}, 1)
+ LIBFTS = -lfts
+ endif
+endif
MAN = \
usr.bin/diff/diff.1 \
@@ -194,7 +201,7 @@ MANDOCOBJ = \
usr.bin/mandoc/tree.o
BINOBJ += ${MANDOCOBJ}
mandoc: ${MANDOCOBJ} ${LIB}
- ${CC} ${LDFLAGS} -o $@ ${MANDOCOBJ} ${LIB} ${ZLIB}
+ ${CC} ${LDFLAGS} -o $@ ${MANDOCOBJ} ${LIB} ${ZLIB} ${LIBFTS}
# ------------------------------------------------------------------------------
# md5
@@ -239,7 +246,7 @@ PAXOBJ = \
bin/pax/tty_subs.o
BINOBJ += ${PAXOBJ}
pax: ${PAXOBJ} ${LIB}
- ${CC} ${LDFLAGS} -o $@ ${PAXOBJ} ${LIB}
+ ${CC} ${LDFLAGS} -o $@ ${PAXOBJ} ${LIB} ${LIBFTS}
# ------------------------------------------------------------------------------
# patch
diff --git a/README.md b/README.md
index c6dc860..6a7554f 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,5 @@
otools
-------
+======
Some OpenBSD-6.8 userland utilities meant to be included in Carbs Linux base.
@@ -14,36 +14,19 @@ Currently includes the following software:
- pax
- signify
-You can build software individually by calling 'make <program>', and the
-program will be built to the root directory of the source. The Makefile
-is bsdmake compatible.
+You can build software individually by calling `make <program>`, and the
+program will be built to the root directory of the source. The build system is
+configured through `config.mk`
requirements
------------
-In order to build 'mandoc', you need to either have zlib installed, or edit
-config.mk to use the in-source zlib.
+In order to build `mandoc`, you need to either have zlib installed, or edit
+`config.mk` to use the in-source `zlib`.
-In order to build 'nc', you need to have a libtls implementation. Carbs Linux
-uses libtls-bearssl by default.
-
-
-notes
------
-
-If you want the manpager to have tags support (doesn't work on busybox less),
-you will need to do the following:
-
- echo CFLAGS += -DHAVE_LESS_T >> config.mk
-
-
-If you are unsure whether your less implementation includes tag support, run
-the following:
-
- :> testfile
- less -F -T testfile testfile && echo CFLAGS += -DHAVE_LESS_T >> config.mk
- rm testfile
+In order to build `nc`, you need to have a `libtls` implementation. Carbs Linux
+uses `libtls-bearssl` by default.
patch directory
diff --git a/config.mk b/config.mk
index be23125..c9c54bb 100644
--- a/config.mk
+++ b/config.mk
@@ -18,6 +18,10 @@ TLSLIB = -ltls -lbearssl
# in-source zlib.
ZLIB = -lz
+# If fts is available on your system, we need to disable building it here.
+# Change with 1 if you are using musl-fts, 2 if you are using glibc.
+FTS=0
+
CFLAGS += -Wall -Wno-pointer-sign -Wno-maybe-uninitialized \
-Wno-attributes -I${PWD}/includedir \
-D 'DEF_WEAK(n)=_Static_assert(1, "")' \
@@ -25,3 +29,7 @@ CFLAGS += -Wall -Wno-pointer-sign -Wno-maybe-uninitialized \
-idirafter ${PWD}/sys \
-idirafter ${PWD}/lib/libutil \
-idirafter ${PWD}/lib/libcrypto
+
+# If you are using a less implementation with tags support, uncomment
+# the following.
+# CFLAGS += -DHAVE_LESS_T
diff --git a/lib/libutil/ohash.h b/lib/libutil/ohash.h
index c5f81ec..3bc24b6 100644
--- a/lib/libutil/ohash.h
+++ b/lib/libutil/ohash.h
@@ -18,6 +18,10 @@
#ifndef OHASH_H
#define OHASH_H
+#ifdef HAVE_FTS
+ #include <sys/cdefs.h>
+#endif
+
/* Open hashing support.
* Open hashing was chosen because it is much lighter than other hash
* techniques, and more efficient in most cases.