From 4cefc0fb834eae8dfb7ae92324967efea1d9887b Mon Sep 17 00:00:00 2001 From: ShaRose Date: Sun, 15 Oct 2017 19:25:02 -0230 Subject: [PATCH] makefile: fixed DESTDIR Modified the Makefile so that it actually works. As it is now, symlinks will point to the fully qualified path of wherever your DESTDIR was: so one would end up with symlinks like: /usr/local/lib/libhttp_parser.so.2.7 pointing to: /tmp/http-parser-git/pkg/http-parser-git/usr/local/lib/libhttp_parser.so.2.7.1. This caused quite a bit of trouble when trying to package it, this patch makes it work. PR-URL: https://github.com/nodejs/http-parser/pull/391 Reviewed-By: James M Snell Reviewed-By: Fedor Indutny --- Makefile | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index 925cdc0..c332167 100644 --- a/Makefile +++ b/Makefile @@ -61,7 +61,7 @@ CFLAGS_LIB = $(CFLAGS_FAST) -fPIC LDFLAGS_LIB = $(LDFLAGS) -shared INSTALL ?= install -PREFIX ?= $(DESTDIR)/usr/local +PREFIX ?= /usr/local LIBDIR = $(PREFIX)/lib INCLUDEDIR = $(PREFIX)/include @@ -131,20 +131,20 @@ tags: http_parser.c http_parser.h test.c ctags $^ install: library - $(INSTALL) -D http_parser.h $(INCLUDEDIR)/http_parser.h - $(INSTALL) -D $(LIBNAME) $(LIBDIR)/$(LIBNAME) - ln -s $(LIBDIR)/$(LIBNAME) $(LIBDIR)/$(SONAME) - ln -s $(LIBDIR)/$(LIBNAME) $(LIBDIR)/$(SOLIBNAME).$(SOEXT) + $(INSTALL) -D http_parser.h $(DESTDIR)$(INCLUDEDIR)/http_parser.h + $(INSTALL) -D $(LIBNAME) $(DESTDIR)$(LIBDIR)/$(LIBNAME) + ln -s $(LIBDIR)/$(LIBNAME) $(DESTDIR)$(LIBDIR)/$(SONAME) + ln -s $(LIBDIR)/$(LIBNAME) $(DESTDIR)$(LIBDIR)/$(SOLIBNAME).$(SOEXT) install-strip: library - $(INSTALL) -D http_parser.h $(INCLUDEDIR)/http_parser.h - $(INSTALL) -D -s $(LIBNAME) $(LIBDIR)/$(LIBNAME) - ln -s $(LIBDIR)/$(LIBNAME) $(LIBDIR)/$(SONAME) - ln -s $(LIBDIR)/$(LIBNAME) $(LIBDIR)/$(SOLIBNAME).$(SOEXT) + $(INSTALL) -D http_parser.h $(DESTDIR)$(INCLUDEDIR)/http_parser.h + $(INSTALL) -D -s $(LIBNAME) $(DESTDIR)$(LIBDIR)/$(LIBNAME) + ln -s $(LIBDIR)/$(LIBNAME) $(DESTDIR)$(LIBDIR)/$(SONAME) + ln -s $(LIBDIR)/$(LIBNAME) $(DESTDIR)$(LIBDIR)/$(SOLIBNAME).$(SOEXT) uninstall: - rm $(INCLUDEDIR)/http_parser.h - rm $(LIBDIR)/$(SONAME) + rm $(DESTDIR)$(INCLUDEDIR)/http_parser.h + rm $(DESTDIR)$(LIBDIR)/$(SONAME) rm $(LIBDIR)/libhttp_parser.so clean: