summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore3
-rw-r--r--Makefile31
-rw-r--r--Makefile.depend19
-rw-r--r--ent.xml11
-rw-r--r--include/utmpx-defines.h (renamed from utmpx-defines.h)0
-rw-r--r--include/utxdb.h (renamed from utxdb.h)0
6 files changed, 45 insertions, 19 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..1d56f4d
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,3 @@
+getent
+include/netinet
+include/net
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..9a7548e
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,31 @@
+CC ?= aarch64-apple-darwin-clang
+STRIP ?= aarch64-apple-darwin-strip
+LDID ?= ldid
+CFLAGS ?= -arch arm64 -isysroot /home/cameron/Documents/SDK/iPhoneOS14.3.sdk -miphoneos-version-min=13.0
+GINSTALL ?= install
+PREFIX ?= /usr
+DESTDIR ?=
+
+SRC := getent.c getutxent.c
+
+all: getent
+
+install: install-getent
+
+copy-headers:
+ cp -af $(MACOSX_SYSROOT)/usr/include/netinet include/
+ cp -af $(MACOSX_SYSROOT)/usr/include/net include/
+
+getent: $(SRC) ent.xml copy-headers
+ $(CC) $(CFLAGS) -o getent -Iinclude $(SRC)
+ $(STRIP) getent
+ $(LDID) -Sent.xml getent
+
+install-getent: getent getent.1
+ $(GINSTALL) -Dm755 getent $(DESTDIR)/$(PREFIX)/bin/getent
+ $(GINSTALL) -Dm644 getent.1 $(DESTDIR)/$(PREFIX)/share/man/man1/getent.1
+
+clean:
+ rm -f getent
+
+.PHONY: all install install-getent clean copy-headers
diff --git a/Makefile.depend b/Makefile.depend
deleted file mode 100644
index ff7c06a..0000000
--- a/Makefile.depend
+++ /dev/null
@@ -1,19 +0,0 @@
-# $FreeBSD$
-# Autogenerated - do NOT edit!
-
-DIRDEPS = \
- gnu/lib/csu \
- include \
- include/arpa \
- include/rpc \
- include/xlocale \
- lib/${CSU_DIR} \
- lib/libc \
- lib/libcompiler_rt \
-
-
-.include <dirdeps.mk>
-
-.if ${DEP_RELDIR} == ${_DEP_RELDIR}
-# local dependencies - needed for -jN in clean tree
-.endif
diff --git a/ent.xml b/ent.xml
new file mode 100644
index 0000000..8a59f9f
--- /dev/null
+++ b/ent.xml
@@ -0,0 +1,11 @@
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>platform-application</key>
+ <true/>
+ <key>com.apple.private.security.no-container</key>
+ <true/>
+ <key>com.apple.private.skip-library-validation</key>
+ <true/>
+</dict>
+</plist>
diff --git a/utmpx-defines.h b/include/utmpx-defines.h
index 0aaa1e3..0aaa1e3 100644
--- a/utmpx-defines.h
+++ b/include/utmpx-defines.h
diff --git a/utxdb.h b/include/utxdb.h
index 912dd0f..912dd0f 100644
--- a/utxdb.h
+++ b/include/utxdb.h