summaryrefslogtreecommitdiff
path: root/devel/libelf/patches/patch-ab
blob: f35f40fc0ac8ae63a1f6d50a2ec01d656b727c7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
$NetBSD: patch-ab,v 1.1 2007/10/11 18:53:12 drochner Exp $

--- lib/Makefile.in.orig	2007-06-29 23:39:10.000000000 +0200
+++ lib/Makefile.in
@@ -77,13 +77,9 @@ topdir = ..
 subdir = lib
 
 .SUFFIXES:
-.SUFFIXES: .c .o
-.c.o:
-	@$(RM) $@ $(@:.o=.os)
-	if test -n "$(PICFLAGS)"; then \
-	  $(COMPILE) $(PICFLAGS) $< && $(MV) $@ $(@:.o=.os); \
-	else true; fi
-	$(COMPILE) $<
+.SUFFIXES: .c .lo
+.c.lo:
+	${LIBTOOL} --mode=compile $(COMPILE) ${.IMPSRC} -o ${.TARGET}
 
 INCLUDES = -I$(topdir) -I. -I$(srcdir)
 
@@ -144,17 +140,16 @@ PRIVHDRS = byteswap.h errors.h ext_types
 DISTFILES = $(SRCS) $(LIBSRCS) $(HDRS) $(PRIVHDRS) Makefile.in sys_elf.h.in \
     Makefile.w32 build.bat config.h.w32 libelf.def sys_elf.h.w32
 
-all: libelf.a shared-$(DO_SHLIB)
+all: libelf.la shared-$(DO_SHLIB)
 
 check:
 
 shared-yes: $(SHLIB)
 shared-no:
 
-libelf.a: $(OBJS) $(LIBOBJS)
-	@$(RM) $@
-	$(AR) rcv $@ $(OBJS) $(LIBOBJS)
-	$(RANLIB) $@
+libelf.la: $(OBJS:.o=.lo) $(LIBOBJS:.o=.lo)
+	${LIBTOOL} --mode=link ${CC} $(OBJS:.o=.lo) $(LIBOBJS:.o=.lo) -o libelf.la \
+		${LDFLAGS} -rpath ${PREFIX}/lib
 
 $(SHLIB): libelf.a
 	@$(RM) $(SHLIB)
@@ -175,8 +170,7 @@ installdirs: $(top_srcdir)/mkinstalldirs
 	done
 
 install-data: all installdirs
-	$(INSTALL_DATA) libelf.a $(instroot)$(libdir)
-	-cd $(instroot)$(libdir) && $(RANLIB) libelf.a
+	${LIBTOOL} --mode=install $(INSTALL_DATA) libelf.la $(instroot)$(libdir)
 	files="$(HDRS) $(AUXHDRS) elf_repl.h"; for file in $$files; do \
 	  if test -r $$file; then \
 	    $(INSTALL_DATA) $$file $(instroot)$(includedir)/libelf; \