Patches build system. * Gentoo does not want pre-stripped files. * We do not want .exe files as the output * Gentoo packages curses, ncurses and ncursesw separately. Therefore we need to get curses from pkg-config and include the correct path. Bug: https://bugs.gentoo.org/878585 Signed-off-by: Pascal Jäger --- a/src/Makefile +++ b/src/Makefile @@ -45,12 +45,12 @@ CC ?= gcc STATIC = -STRIP = strip +STRIP = ENABLE_NLS = 1 PACKAGE = wcd -EXT = .exe +EXT = PROGRAM = $(PACKAGE)$(EXT) BIN = $(PROGRAM) @@ -328,9 +328,9 @@ # possible values: ncurses, curses, pdcurses, pdcursesw or ifdef UCS - CURSES = ncursesw + CURSES = $(shell ${PKG_CONFIG} --libs ncursesw) else - CURSES = ncurses + CURSES = $(shell ${PKG_CONFIG} --libs ncurses) endif @@ -360,7 +360,7 @@ ifneq (,$(CURSES)) DEFS_CURSES = -DWCD_USECURSES - LIB_CURSES = -l$(CURSES) + LIB_CURSES = $(CURSES) ifeq (os/2,$(OS)) LIB_CURSES += -ltinfo endif @@ -458,15 +458,15 @@ LDFLAGS_USER = LDFLAGS ?= -LDFLAGS += $(RPM_LD_FLAGS) \ +LIBS = $(RPM_LD_FLAGS) \ $(LDFLAGS_EXTRA) \ $(NLFLAG) \ $(LDFLAG_STATIC) \ $(LDFLAGS_USER) -LIBS = $(LIB_CURSES) \ - $(LIB_UNISTRING) \ - $(LIBS_EXTRA) +LIBS += $(LIB_CURSES) \ + $(LIB_UNISTRING) \ + $(LIBS_EXTRA) DEFS_USER = DEFS = $(DEF_UNIX) $(DEFS_CURSES) $(EXTRA_DEFS) $(DEFS_USER) @@ -523,7 +523,7 @@ $(BIN): $(OBJS1) $(MAKE) status - $(CC) $(OBJS1) $(LDFLAGS) $(LIBS) -o $@ + $(CC) $(LDFLAGS) $(OBJS1) -o $@ $(LIBS) %.o: %.c $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(DEFS) -c $< -o $@ --- a/src/Makefile +++ b/src/Makefile @@ -359,7 +359,7 @@ endif endif ifneq (,$(CURSES)) - DEFS_CURSES = -DWCD_USECURSES + DEFS_CURSES = -DWCD_USECURSES $(shell ${PKG_CONFIG} --cflags-only-other ncursesw) LIB_CURSES = $(CURSES) ifeq (os/2,$(OS)) LIB_CURSES += -ltinfo @@ -384,9 +384,7 @@ endif # Each ncurses variant has its own include directory # ncurses (normal)/ncursesw (wide char)/ncursest (threads) ifeq ($(findstring ncurses,$(CURSES)),ncurses) -ifneq ($(wildcard $(INCPREFIX)/include/$(CURSES)/curses.h),) - INCFLAGS = -I$(INCPREFIX)/include/$(CURSES) -I$(INCPREFIX)/include -endif + INCFLAGS = $(shell ${PKG_CONFIG} --cflags-only-I ncursesw) ifeq ($(NCURSES_DEBUG), 1) LIB_CURSES = -l$(CURSES)_g endif