Keep NetBSD from mistakenly using curses.h in /usr/pkg/include/ncurses?.
authorDavid Griffith <dave@661.org>
Fri, 13 Sep 2019 03:52:52 +0000 (03:52 +0000)
committerDavid Griffith <dave@661.org>
Fri, 13 Sep 2019 04:11:06 +0000 (04:11 +0000)
If /usr/pkg/include/ncurses and/or /usr/pkg/include/ncursesw are passed
as arguments to the -I flag, the build process gets confused and will
abort with complaints about acs_map being undefined.

Makefile

index a2089622d7b4fc6be321b220a8117d7593a67a3f..be608bfec0da1b44c0bfe3c0e88997b3c09a190b 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -20,9 +20,9 @@ ifneq ($(OS),Windows_NT)
        MACOS = yes
     endif
     ifeq ($(UNAME_S),NetBSD)
+       NETBSD = yes
        CFLAGS += -D_NETBSD_SOURCE -I/usr/pkg/include
        LDFLAGS += -Wl,-R/usr/pkg/lib -L/usr/pkg/lib
-       CURSES_CFLAGS += -I/usr/pkg/include/ncurses -I/usr/pkg/include/ncursesw
        SDL_LDFLAGS += -lexecinfo
     endif
     ifeq ($(UNAME_S),FreeBSD)
@@ -178,6 +178,9 @@ else ifneq ($(findstring ncurses,$(CURSES)),)
   CURSES_LDFLAGS += $(or $(shell $(PKG_CONFIG) $(CURSES) --libs 2>/dev/null),-l$(CURSES))
   CURSES_CFLAGS += $(or $(shell $(PKG_CONFIG) $(CURSES) --cflags 2>/dev/null),-D_XOPEN_SOURCE_EXTENDED)
   CURSES_DEFINE = USE_NCURSES_H
+ifdef NETBSD
+  CURSES_CFLAGS += -I/usr/pkg/include/ncurses -I/usr/pkg/include/ncursesw
+endif
 endif
 
 ifeq ($(SOUND), ao)