--- Makefile.orig	2015-02-12 06:14:33.000000000 -0700
+++ Makefile	2020-05-17 09:23:03.000000000 -0700
@@ -21,13 +21,14 @@
 include Makefile.cfg
 
 export CC = gcc -pthread
-export CFLAGS += -I. -Wall -Os -ggdb -D_GNU_SOURCE -fPIC
-export LDLIBS += -lncursesw
+export CFLAGS += -I. -Wall -D_GNU_SOURCE -fPIC -pthread
+export LDLIBS += -lncursesw -liconv $(LDFLAGS) -pthread
 
-SONAME  := libstfl.so.0
+SOVER   := 0
+SONAME  := libstfl.$(SOVER).dylib
 VERSION := 0.24
 
-all: libstfl.so.$(VERSION) libstfl.a example
+all: libstfl.$(VERSION).dylib libstfl.a example
 
 example: libstfl.a example.o
 
@@ -37,9 +38,9 @@
 	ar qc $@ $^
 	ranlib $@
 
-libstfl.so.$(VERSION): public.o base.o parser.o dump.o style.o binding.o iconv.o \
+libstfl.$(VERSION).dylib: public.o base.o parser.o dump.o style.o binding.o iconv.o \
                        $(patsubst %.c,%.o,$(wildcard widgets/*.c))
-	$(CC) -shared -Wl,-soname,$(SONAME) -o $@ $(LDLIBS) $^
+	$(CC) -dynamiclib -install_name $(prefix)/$(libdir)/$(SONAME) -current_version $(VERSION) -compatibility_version $(SOVER) -o $@ $(LDLIBS) $^
 
 clean:
 	rm -f libstfl.a example core core.* *.o Makefile.deps
@@ -63,8 +64,9 @@
 	install -m 644 libstfl.a $(DESTDIR)$(prefix)/$(libdir)
 	install -m 644 stfl.h $(DESTDIR)$(prefix)/include/
 	install -m 644 stfl.pc $(DESTDIR)$(prefix)/$(libdir)/pkgconfig/
-	install -m 644 libstfl.so.$(VERSION) $(DESTDIR)$(prefix)/$(libdir)
-	ln -fs libstfl.so.$(VERSION) $(DESTDIR)$(prefix)/$(libdir)/libstfl.so
+	install -m 755 libstfl.$(VERSION).dylib $(DESTDIR)$(prefix)/$(libdir)
+	ln -fs libstfl.$(VERSION).dylib $(DESTDIR)$(prefix)/$(libdir)/$(SONAME)
+	ln -fs $(SONAME) $(DESTDIR)$(prefix)/$(libdir)/libstfl.dylib
 
 stfl.pc: stfl.pc.in
 	sed 's,@VERSION@,$(VERSION),g' < $< | sed 's,@PREFIX@,$(prefix),g' > $@
--- Makefile.cfg.orig	2009-05-31 11:20:39.000000000 -0700
+++ Makefile.cfg	2020-05-17 09:07:27.000000000 -0700
@@ -22,33 +22,8 @@
 export prefix ?= /usr/local
 export DESTDIR ?= /
 
-ifneq ($(shell spl-config --cflags 2>/dev/null),)
-FOUND_SPL = 1
-else
 FOUND_SPL = 0
-endif
-
-ifneq ($(shell swig -help 2>/dev/null),)
-FOUND_SWIG = 1
-else
 FOUND_SWIG = 0
-endif
-
-ifneq ($(shell perl -le 'print 1' 2>/dev/null),)
-FOUND_PERL5 = 1
-else
 FOUND_PERL5 = 0
-endif
-
-ifneq ($(shell python -c 'print 1' 2>/dev/null),)
-FOUND_PYTHON = 1
-else
 FOUND_PYTHON = 0
-endif
-
-ifneq ($(shell ruby -e 'puts 1' 2>/dev/null),)
-FOUND_RUBY = 1
-else
 FOUND_RUBY = 0
-endif
-
