Skip to content

Instantly share code, notes, and snippets.

@jperras
Created January 3, 2012 18:24
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save jperras/1556181 to your computer and use it in GitHub Desktop.
STFL diff for OS X compatibility.
diff --git a/Makefile b/Makefile
index d481e68..0f8b4de 100644
--- a/Makefile
+++ b/Makefile
@@ -22,12 +22,12 @@ include Makefile.cfg
export CC = gcc -pthread
export CFLAGS += -I. -Wall -Os -ggdb -D_GNU_SOURCE -fPIC
-export LDLIBS += -lncursesw
+export LDLIBS += $(LDFLAGS) -lncurses -liconv
SONAME := libstfl.so.0
VERSION := 0.22
-all: libstfl.so.$(VERSION) libstfl.a example
+all: libstfl.$(VERSION).dylib libstfl.a example
example: libstfl.a example.o
@@ -37,9 +37,9 @@ libstfl.a: public.o base.o parser.o dump.o style.o binding.o iconv.o \
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) -shared -o $@ $^ $(LDLIBS)
clean:
rm -f libstfl.a example core core.* *.o Makefile.deps
@@ -63,8 +63,8 @@ install: all stfl.pc
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 644 libstfl.$(VERSION).dylib $(DESTDIR)$(prefix)/$(libdir)
+ ln -fs libstfl.$(VERSION).dylib $(DESTDIR)$(prefix)/$(libdir)/libstfl.so
stfl.pc: stfl.pc.in
sed 's,@VERSION@,$(VERSION),g' < $< | sed 's,@PREFIX@,$(prefix),g' > $@
@@ -73,17 +73,6 @@ ifeq ($(FOUND_SPL),1)
include spl/Makefile.snippet
endif
-ifeq ($(FOUND_SWIG)$(FOUND_PERL5),11)
-include perl5/Makefile.snippet
-endif
-
-ifeq ($(FOUND_SWIG)$(FOUND_PYTHON),11)
-include python/Makefile.snippet
-endif
-
-ifeq ($(FOUND_SWIG)$(FOUND_RUBY),11)
-include ruby/Makefile.snippet
-endif
.PHONY: all clean install install_spl
diff --git a/stfl_internals.h b/stfl_internals.h
index 3f9f45b..1559626 100644
--- a/stfl_internals.h
+++ b/stfl_internals.h
@@ -28,7 +28,7 @@ extern "C" {
#endif
#include "stfl.h"
-#include <ncursesw/ncurses.h>
+#include <ncurses.h>
#include <pthread.h>
struct stfl_widget_type;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment