freebsd-ports/misc/getopt/files/patch-Makefile
Po-Chuan Hsieh 4ddfd281f8
misc/getopt: Re-add getopt 1.1.6
PR:		281625
2024-11-03 19:34:23 +08:00

49 lines
1.6 KiB
Text

--- Makefile.orig 2014-11-24 12:33:39 UTC
+++ Makefile
@@ -1,9 +1,9 @@ DESTDIR=
.SUFFIXES:
DESTDIR=
-prefix=/usr/local
+prefix=$(PREFIX)
bindir=$(prefix)/bin
-mandir=$(prefix)/man
+mandir=$(prefix)/share/man
man1dir=$(mandir)/man1
sharedir=$(prefix)/share
getoptdir=$(sharedir)/getopt
@@ -32,18 +32,15 @@ MOFILES:=$(patsubst %,po/%.mo,$(LANGUAGES))
LANGUAGES = ca cs da de es et eu fi fr gl hr hu id it ja nl pl pt_BR ru sl sv tr uk vi zh_CN zh_TW
MOFILES:=$(patsubst %,po/%.mo,$(LANGUAGES))
-CPPFLAGS=-DLIBCGETOPT=$(LIBCGETOPT) -DWITHOUT_GETTEXT=$(WITHOUT_GETTEXT) -DLOCALEDIR=\"$(localedir)\" -DNOT_UTIL_LINUX -Dprogram_invocation_short_name=\"$(PACKAGE)\" -Dprogram_version=\"$(VERSION)\"
+CPPFLAGS+=-DLIBCGETOPT=$(LIBCGETOPT) -DWITHOUT_GETTEXT=$(WITHOUT_GETTEXT) -DLOCALEDIR=\"$(localedir)\" -DNOT_UTIL_LINUX -Dprogram_invocation_short_name=\"$(PACKAGE)\" -Dprogram_version=\"$(VERSION)\"
ifeq ($(LIBCGETOPT),0)
-CPPFLAGS+=-I./gnu
+CPPFLAGS+=-I./gnu
endif
WARNINGS=-Wall \
-W -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual \
-Wcast-align -Wmissing-declarations \
-Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes \
-Wnested-externs -Winline
-OPTIMIZE=-O3 -fno-strength-reduce
-CFLAGS=$(WARNINGS) $(OPTIMIZE)
-LDFLAGS=
sources=getopt.c
ifeq ($(LIBCGETOPT),0)
@@ -54,11 +51,11 @@ binaries=getopt
binaries=getopt
-.PHONY: all clean realclean
+.PHONY: all clean realclean
all: $(binaries) all_po
clean: clean_po
- -$(RM) $(objects) $(binaries)
+ -$(RM) $(objects) $(binaries)
getopt: $(objects)
$(CC) $(LDFLAGS) -o $@ $(objects)