openbsd-ports/misc/gnugetopt/patches/patch-Makefile
2009-03-25 14:28:38 +00:00

61 lines
1.6 KiB
Plaintext

$OpenBSD: patch-Makefile,v 1.3 2009/03/25 14:32:22 naddy Exp $
--- Makefile.orig Mon Nov 7 23:32:46 2005
+++ Makefile Wed Mar 25 15:31:06 2009
@@ -1,17 +1,17 @@
.SUFFIXES:
DESTDIR=
-prefix=/usr/local
+prefix=$(PREFIX)
bindir=$(prefix)/bin
mandir=$(prefix)/man
man1dir=$(mandir)/man1
libdir=$(prefix)/lib
sharedir=$(prefix)/share
-getoptdir=$(libdir)/getopt
+getoptdir=$(sharedir)/examples/getopt
localedir=$(sharedir)/locale
# Define this to 0 to use the getopt(3) routines in this package.
-LIBCGETOPT=1
+LIBCGETOPT=0
# Define this to 1 if you do not have the gettext routines
WITHOUT_GETTEXT=0
@@ -24,7 +24,7 @@ UNLIKELYNAME=a8vwjfd92
SHELL=/bin/sh
-CC=gcc
+CC?=gcc
LD=ld
RM=rm -f
INSTALL=install
@@ -33,7 +33,7 @@ MSGFMT=msgfmt
LANGUAGES = cs de es fr it ja nl pt_BR
MOFILES:=$(patsubst %,po/%.mo,$(LANGUAGES))
-CPPFLAGS=-DLIBCGETOPT=$(LIBCGETOPT) -DWITH_GETTEXT=$(WITH_GETTEXT) -DLOCALEDIR=\"$(localedir)\" -DNOT_UTIL_LINUX
+CPPFLAGS+=-DLIBCGETOPT=$(LIBCGETOPT) -DWITH_GETTEXT=$(WITH_GETTEXT) -DLOCALEDIR=\"$(localedir)\" -DNOT_UTIL_LINUX
ifeq ($(LIBCGETOPT),0)
CPPFLAGS+=-I./gnu
endif
@@ -43,8 +43,6 @@ WARNINGS=-Wall \
-Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes \
-Wnested-externs -Winline
OPTIMIZE=-O3 -fno-strength-reduce
-CFLAGS=$(WARNINGS) $(OPTIMIZE)
-LDFLAGS=
sources=getopt.c
ifeq ($(LIBCGETOPT),0)
@@ -62,7 +60,7 @@ clean: clean_po
-$(RM) $(objects) $(binaries)
getopt: $(objects)
- $(CC) $(LDFLAGS) -o $@ $(objects)
+ $(CC) $(LDFLAGS) -o $@ $(objects) $(LIBS)
install: getopt install_po
$(INSTALL) -m 755 -d $(DESTDIR)$(bindir) $(DESTDIR)$(man1dir)