[BACK]Return to Makefile.in CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / pkgsrc / pkgtools / pkg_install / files / create

File: [cvs.NetBSD.org] / pkgsrc / pkgtools / pkg_install / files / create / Makefile.in (download)

Revision 1.30, Wed Oct 28 16:52:43 2020 UTC (18 months, 4 weeks ago) by maya
Branch: MAIN
CVS Tags: pkgsrc-2022Q1-base, pkgsrc-2022Q1, pkgsrc-2021Q4-base, pkgsrc-2021Q4, pkgsrc-2021Q3-base, pkgsrc-2021Q3, pkgsrc-2021Q2-base, pkgsrc-2021Q2, pkgsrc-2021Q1-base, pkgsrc-2021Q1, pkgsrc-2020Q4-base, pkgsrc-2020Q4, HEAD
Changes since 1.29: +2 -2 lines

Bootstrap: Fix bootstrap on FreeBSD 12.1, likely broken by an issue in lld.

It looks like lld doesn't want to statically link a libarchive without
resolving all of the symbols, even if only a few symbols are used.

In order to resolve all of the symbols, we need to also link with -lmd.
One generic way to do so is inspect Libs.private in the pkgconfig file.

While pkgsrc is likely not at fault here, having a dysfunctional bootstrap
is bad. We should check again in the future to see if this can be removed.

Actually fixes PR pkg/55400.

# $NetBSD: Makefile.in,v 1.30 2020/10/28 16:52:43 maya Exp $

srcdir=		@srcdir@

prefix=		@prefix@
exec_prefix=	@exec_prefix@
sbindir=	@sbindir@
mandir=		@mandir@
datarootdir=	@datarootdir@

man1dir=	$(mandir)/man1
cat1dir=	$(mandir)/cat1

BOOTSTRAP=	@bootstrap@

CC=		@CC@
CCLD=		$(CC)
DEFS=		@DEFS@
CFLAGS=		@CFLAGS@
LDFLAGS=	@LDFLAGS@ -L../lib

INSTALL=	@INSTALL@

PROG=		pkg_create

SSL_SUPPORT=	@ssl_support@
CPPFLAGS=	@CPPFLAGS@ -I. -I$(srcdir) -I../lib
OBJS=		main.o perform.o pl.o util.o build.o

.if empty(BOOTSTRAP)
LIBS=		-linstall -lnetpgpverify -larchive -lbz2 -lz -lfetch @LIBS@
.if !empty(SSL_SUPPORT)
LIBS+=		-lssl -lcrypto
.endif
.else
LIBS=		-linstall ${STATIC_LIBARCHIVE} ${STATIC_LIBARCHIVE_LDADD} @LIBS@
CPPFLAGS+=	-DBOOTSTRAP
.endif

all: $(PROG)

.c.o:
	$(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) -c $<

$(PROG): $(OBJS)
	$(CCLD) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)

clean:
	rm -f $(OBJS) $(PROG)

install:
	$(INSTALL) -m 755 -d ${DESTDIR}$(sbindir)
	$(INSTALL) -m 755 -d ${DESTDIR}$(man1dir)
	$(INSTALL) $(PROG) ${DESTDIR}$(sbindir)/$(PROG)
	$(INSTALL) -m 444 $(PROG).1 ${DESTDIR}$(man1dir)/$(PROG).1
.if defined(MANINSTALL) && !empty(MANINSTALL:Mcatinstall)
	$(INSTALL) -m 755 -d ${DESTDIR}$(cat1dir)
.  if defined(CATMAN_SECTION_SUFFIX) && !empty(CATMAN_SECTION_SUFFIX:M[Yy][Ee][Ss])
	$(INSTALL) -m 444 $(PROG).cat ${DESTDIR}$(cat1dir)/$(PROG).1
.  else
	$(INSTALL) -m 444 $(PROG).cat ${DESTDIR}$(cat1dir)/$(PROG).0
.  endif
.endif