From 05cf58cd46b3c92e868d856931b0ee5d2bfc7d72 Mon Sep 17 00:00:00 2001 From: whoisxxx Date: Tue, 10 Nov 2020 02:47:11 +0000 Subject: [PATCH] Set LIBDIR for riscv The LIBDIR is given by "$(CC) -print-os-multi-directory", which result in "../lib64" on X86/aarch64 host, and "./" on an openEuler RISC-V host. Here is a temproray apporach by hardcore it for an RISC-V host. Signed-off-by: whoisxxx --- rebased-by: laokz diff --git a/pppd/Makefile.linux b/pppd/Makefile.linux index 07df6a7..7dd3a1b 100644 --- a/pppd/Makefile.linux +++ b/pppd/Makefile.linux @@ -12,7 +12,11 @@ DESTDIR = $(INSTROOT)@DESTDIR@ BINDIR = $(DESTDIR)/sbin MANDIR = $(DESTDIR)/share/man/man8 INCDIR = $(DESTDIR)/include +ifeq ($(filter riscv64%,$(MAKE_HOST)),) LIBDIR = $(DESTDIR)/lib/$(shell gcc -print-multi-os-directory 2> /dev/null) +else +LIBDIR = $(DESTDIR)/lib64 +endif TARGETS = pppd diff --git a/pppd/plugins/Makefile.linux b/pppd/plugins/Makefile.linux index f42d18c..958923f 100644 --- a/pppd/plugins/Makefile.linux +++ b/pppd/plugins/Makefile.linux @@ -5,7 +5,11 @@ COPTS=@CFLAGS@ DESTDIR = $(INSTROOT)@DESTDIR@ BINDIR = $(DESTDIR)/sbin MANDIR = $(DESTDIR)/share/man/man8 +ifeq ($(filter riscv64%,$(MAKE_HOST)),) LIBDIR = $(DESTDIR)/lib/$(shell gcc -print-multi-os-directory 2> /dev/null)/pppd/$(VERSION) +else +LIBDIR = $(DESTDIR)/lib64/pppd/$(VERSION) +endif CFLAGS = $(COPTS) -I.. -I../../include -fPIC LDFLAGS_SHARED = -shared diff --git a/pppd/plugins/pppoatm/Makefile.linux b/pppd/plugins/pppoatm/Makefile.linux index 6387970..daaaa4e 100644 --- a/pppd/plugins/pppoatm/Makefile.linux +++ b/pppd/plugins/pppoatm/Makefile.linux @@ -4,7 +4,11 @@ CC=$(CROSS_COMPILE)@CC@ COPTS=@CFLAGS@ DESTDIR = $(INSTROOT)@DESTDIR@ +ifeq ($(filter riscv64%,$(MAKE_HOST)),) LIBDIR = $(DESTDIR)/lib/$(shell gcc -print-multi-os-directory 2> /dev/null)/pppd/$(VERSION) +else +LIBDIR = $(DESTDIR)/lib64/pppd/$(VERSION) +endif VERSION = $(shell awk -F '"' '/VERSION/ { print $$2; }' ../../patchlevel.h) diff --git a/pppd/plugins/pppoe/Makefile.linux b/pppd/plugins/pppoe/Makefile.linux index 6cb8397..af5f9fb 100644 --- a/pppd/plugins/pppoe/Makefile.linux +++ b/pppd/plugins/pppoe/Makefile.linux @@ -19,7 +19,11 @@ COPTS=@CFLAGS@ DESTDIR = $(INSTROOT)@DESTDIR@ BINDIR = $(DESTDIR)/sbin MANDIR = $(DESTDIR)/share/man/man8 +ifeq ($(filter riscv64%,$(MAKE_HOST)),) LIBDIR = $(DESTDIR)/lib/$(shell gcc -print-multi-os-directory 2> /dev/null)/pppd/$(PPPDVERSION) +else +LIBDIR = $(DESTDIR)/lib64/pppd/$(PPPDVERSION) +endif PPPDVERSION = $(shell awk -F '"' '/VERSION/ { print $$2; }' ../../patchlevel.h) diff --git a/pppd/plugins/pppol2tp/Makefile.linux b/pppd/plugins/pppol2tp/Makefile.linux index e4442f9..d9ae2ca 100644 --- a/pppd/plugins/pppol2tp/Makefile.linux +++ b/pppd/plugins/pppol2tp/Makefile.linux @@ -4,7 +4,11 @@ CC=$(CROSS_COMPILE)@CC@ COPTS=@CFLAGS@ DESTDIR = $(INSTROOT)/@DESTDIR@ +ifeq ($(filter riscv64%,$(MAKE_HOST)),) LIBDIR = $(DESTDIR)/lib/$(shell gcc -print-multi-os-directory 2> /dev/null)/pppd/$(VERSION) +else +LIBDIR = $(DESTDIR)/lib64/pppd/$(VERSION) +endif VERSION = $(shell awk -F '"' '/VERSION/ { print $$2; }' ../../patchlevel.h) diff --git a/pppd/plugins/radius/Makefile.linux b/pppd/plugins/radius/Makefile.linux index d2ef044..1ccc171 100644 --- a/pppd/plugins/radius/Makefile.linux +++ b/pppd/plugins/radius/Makefile.linux @@ -9,7 +9,11 @@ COPTS=@CFLAGS@ DESTDIR = $(INSTROOT)@DESTDIR@ MANDIR = $(DESTDIR)/share/man/man8 +ifeq ($(filter riscv64%,$(MAKE_HOST)),) LIBDIR = $(DESTDIR)/lib/$(shell gcc -print-multi-os-directory 2> /dev/null)/pppd/$(VERSION) +else +LIBDIR = $(DESTDIR)/lib64/pppd/$(VERSION) +endif VERSION = $(shell awk -F '"' '/VERSION/ { print $$2; }' ../../patchlevel.h)