Blob Blame History Raw
If CC supports the "-print-multi-os-directory" option, use it to determine
where to check for the existence libcrypt.  If it doesn't, then we get /usr/lib.

--- ppp-2.4.2/pppd/Makefile.linux	2003-11-27 16:55:19.000000000 -0500
+++ ppp-2.4.2/pppd/Makefile.linux	2004-03-10 17:44:04.000000000 -0500
@@ -7,6 +7,7 @@
 BINDIR = $(DESTDIR)/usr/sbin
 MANDIR = $(DESTDIR)/usr/man
 INCDIR = $(DESTDIR)/usr/include
+LIBDIR = $(DESTDIR)/usr/lib/$(shell gcc -print-multi-os-directory 2> /dev/null)
 
 TARGETS = pppd
 
@@ -31,7 +32,7 @@
 
 CC = gcc
 #
-COPTS = -Wall $(RPM_OPT_FLAGS)
+COPTS = -Wall $(RPM_OPT_FLAGS) -DLIBDIR=\""$(LIBDIR)"\"
 LIBS = -lutil
 
 # Uncomment the next 2 lines to include support for Microsoft's
@@ -119,7 +120,7 @@
 ifneq ($(wildcard /usr/include/crypt.h),)
 CFLAGS   += -DHAVE_CRYPT_H=1
 endif
-ifneq ($(wildcard /usr/lib/libcrypt.*),)
+ifneq ($(wildcard $(LIBDIR)/libcrypt.*),)
 LIBS	+= -lcrypt
 endif
 
--- ppp-2.4.2/pppd/plugins/Makefile.linux	2004-03-10 18:40:27.000000000 -0500
+++ ppp-2.4.2/pppd/plugins/Makefile.linux	2004-03-10 18:41:20.000000000 -0500
@@ -21,7 +21,7 @@
 	$(CC) -o $@ $(LDFLAGS) $(CFLAGS) $^
 
 VERSION = $(shell awk -F '"' '/VERSION/ { print $$2; }' ../patchlevel.h)
-LIBDIR	= $(DESTDIR)/usr/lib/pppd/$(VERSION)
+LIBDIR = $(DESTDIR)/usr/lib/$(shell $(CC) -print-multi-os-directory 2> /dev/null)/pppd/$(VERSION)
 
 install: $(PLUGINS)
 	$(INSTALL) -d $(LIBDIR)
--- ppp-2.4.2/pppd/pathnames.h	2004-03-10 18:52:15.000000000 -0500
+++ ppp-2.4.2/pppd/pathnames.h	2004-03-10 18:52:10.000000000 -0500
@@ -55,5 +55,5 @@
 #endif /* __STDC__ */
 
 #ifdef PLUGIN
-#define _PATH_PLUGIN	"/usr/lib/pppd/" VERSION
+#define _PATH_PLUGIN	LIBDIR "/pppd/" VERSION
 #endif /* PLUGIN */