pkgsrc/devel/st/patches/patch-aa
dholland bbfd9658a6 Fix "libtool: compile: unable to infer tagged configuration" by not
overwriting pkgsrc's setting of $(CC).

Also, make it build on amd64 netbsd (by cribbing two lines from the
existing openbsd support) and add that to the list of PLATFORMs the
package is ONLY_FOR.

XXX: Why is this limited to netbsd PLATFORMs when it supports at least
XXX: some other stuff internally?
2012-12-17 01:58:55 +00:00

86 lines
2.4 KiB
Text

$NetBSD: patch-aa,v 1.5 2012/12/17 01:58:55 dholland Exp $
- honor pkgsrc CC, AR, LD, RANLIB (CC matters for libtool, the others less so)
- use libtool
- other previously uncommented stuff (XXX)
--- Makefile.orig 2007-03-14 02:34:20.000000000 +0000
+++ Makefile
@@ -56,10 +56,10 @@ VERSION = 1.8
# possible compilation options.
##########################
-CC = cc
-AR = ar
-LD = ld
-RANLIB = ranlib
+#CC = cc
+#AR = ar
+#LD = ld
+#RANLIB = ranlib
LN = ln
SHELL = /bin/sh
@@ -184,6 +184,13 @@ LDFLAGS = -shared -soname=$(SONAME)
OTHER_FLAGS = -Wall
endif
+ifeq ($(OS), NETBSD)
+OTHER_FLAGS = -Wall
+TARGETDIR = .
+# The following is a lie; we do build dynamic libraries
+STATIC_ONLY = yes
+endif
+
ifeq ($(OS), OPENBSD)
SFLAGS = -fPIC
LDFLAGS = -shared -soname=$(SONAME) -lc
@@ -273,15 +280,15 @@ endif
CFLAGS += $(DEFINES) $(OTHER_FLAGS) $(EXTRA_CFLAGS)
-OBJS = $(TARGETDIR)/sched.o \
- $(TARGETDIR)/stk.o \
- $(TARGETDIR)/sync.o \
- $(TARGETDIR)/key.o \
- $(TARGETDIR)/io.o \
- $(TARGETDIR)/event.o
+OBJS = $(TARGETDIR)/sched.lo \
+ $(TARGETDIR)/stk.lo \
+ $(TARGETDIR)/sync.lo \
+ $(TARGETDIR)/key.lo \
+ $(TARGETDIR)/io.lo \
+ $(TARGETDIR)/event.lo
OBJS += $(EXTRA_OBJS)
HEADER = $(TARGETDIR)/st.h
-SLIBRARY = $(TARGETDIR)/libst.a
+SLIBRARY = $(TARGETDIR)/libst.la
DLIBRARY = $(TARGETDIR)/libst.$(DSO_SUFFIX).$(VERSION)
EXAMPLES = examples
@@ -332,8 +339,7 @@ $(TARGETDIR):
if [ ! -d $(TARGETDIR) ]; then mkdir $(TARGETDIR); fi
$(SLIBRARY): $(OBJS)
- $(AR) $(ARFLAGS) $@ $(OBJS)
- $(RANLIB) $@
+ ${LIBTOOL} --mode=link ${CC} -o $@ ${OBJS} -rpath ${PREFIX}/lib -version-info 1:4
rm -f obj; $(LN) $(LNFLAGS) $(TARGETDIR) obj
$(DLIBRARY): $(OBJS:%.o=%-pic.o)
@@ -349,11 +355,11 @@ $(HEADER): public.h
rm -f $@
cp public.h $@
-$(TARGETDIR)/md.o: md.S
- $(CC) $(CFLAGS) -c $< -o $@
+$(TARGETDIR)/md.lo: md.S
+ $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c $< -o $@
-$(TARGETDIR)/%.o: %.c common.h md.h
- $(CC) $(CFLAGS) -c $< -o $@
+$(TARGETDIR)/%.lo: %.c common.h md.h
+ $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c $< -o $@
examples::
@cd $@; $(MAKE) CC="$(CC)" CFLAGS="$(CFLAGS)" OS="$(OS)" TARGETDIR="$(TARGETDIR)"