tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

PROGS for bootstrap-mk-files

It seems that the in bootstrap-mk-files does not support
PROGS (only PROG). This is causing multimedia/bsdav to fail, because
it sets USE_BSD_MAKEFILE and has a makefile that depends on PROGS.

This is not easily worked around, so it seems maybe it would be better
to add the feature to bootstrap-mk-files. Meanwhile, while we should
probably update all of bootstrap-mk-files from base NetBSD, because
there are other divergences (e.g. in WARNS handling) and some of them
are known to cause problems, that is a large undertaking.

So here's a patch that just provides PROGS support.


Index: files/
RCS file: /cvsroot/pkgsrc/pkgtools/bootstrap-mk-files/files/,v
retrieving revision
diff -u -r1.1.1.1
--- files/   14 Jul 2006 23:13:01 -0000
+++ files/   8 Dec 2013 02:02:45 -0000
@@ -52,48 +52,66 @@
 .if defined(PROG)
-SRCS?=         ${PROG}.c
+PROGS?=                ${PROG}
+.if defined(PROGNAME)
+.if defined(SRCS)
+.if defined(DPSRCS)
-DPSRCS+=       ${SRCS:M*.l:.l=.c} ${SRCS:M*.y:.y=.c}
+.if defined(PROGS)
+.for P in $(PROGS)
+SRCS.${P}?=    ${P}.c
+DPSRCS.${P}+=  ${SRCS.${P}:M*.l:.l=.c} ${SRCS.${P}:M*.y:.y=.c}
 .if defined(YHEADER)
-CLEANFILES+=   ${SRCS:M*.y:.y=.h}
+CLEANFILES+=   ${SRCS.${P}:M*.y:.y=.h}
-.if !empty(SRCS:N*.h:N*.sh:N*.fth)
-OBJS+=         ${SRCS:N*.h:N*.sh:N*.fth:R:S/$/.o/g}
-LOBJS+=                ${LSRCS:.c=.ln} ${SRCS:M*.c:.c=.ln}
+.if !empty(SRCS.${P}:N*.h:N*.sh:N*.fth)
+OBJS.${P}+=    ${SRCS.${P}:N*.h:N*.sh:N*.fth:R:S/$/.o/g}
+LOBJS.${P}+=   ${LSRCS.${P}:.c=.ln} ${SRCS.${P}:M*.c:.c=.ln}
-.if defined(OBJS) && !empty(OBJS)
+.if defined(OBJS.${P}) && !empty(OBJS.${P})
+.NOPATH: ${OBJS.${P}}
 .if defined(DESTDIR)
-.if !commands(${PROG})
-       ${CC} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} -nostdlib 
-Wl,-rpath-link,${DESTDIR}/usr/lib ${LIBCRT0} ${LIBCRTBEGIN} ${OBJS} ${LDADD} 
-L${DESTDIR}/usr/lib -lgcc -lc -lgcc ${LIBCRTEND}
+${P}: ${LIBCRT0} ${DPSRCS.${P}} ${OBJS.${P}} ${LIBC} ${LIBCRTBEGIN} 
+.if !commands(${PROG.${P}})
+       ${CC} ${LDFLAGS} ${LDFLAGS.${P}} ${LDSTATIC} ${LDSTATIC.${P}} -o 
${.TARGET} -nostdlib -Wl,-rpath-link,${DESTDIR}/usr/lib ${LIBCRT0} 
${LIBCRTBEGIN} ${OBJS.${P}} ${LDADD.${P}} ${LDADD} -L${DESTDIR}/usr/lib -lgcc 
-lc -lgcc ${LIBCRTEND}
+${P}: ${LIBCRT0} ${DPSRCS.${P}} ${OBJS.${P}} ${LIBC} ${LIBCRTBEGIN} 
 .if !commands(${PROG})
-       ${CC} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} ${OBJS} ${LDADD}
+       ${CC} ${LDFLAGS} ${LDFLAGS.${P}} ${LDSTATIC} ${LDSTATIC.${P}} -o 
${.TARGET} ${OBJS.${P}} ${LDADD.${P}} ${LDADD}
 .endif # defined(DESTDIR)
 .endif # defined(OBJS) && !empty(OBJS)
+.endfor        # P in PROGS
 .if !defined(MAN)
-MAN=   ${PROG}.1
+.for P in ${PROGS}
+MAN+=  ${P}.1
 .endif # !defined(MAN)
-.endif # defined(PROG)
+.endif # defined(PROGS)
-realall: ${PROG} ${SCRIPTS}
+realall: ${PROGS} ${SCRIPTS}
        rm -f a.out [Ee]rrs mklog core *.core \
-           ${PROG} ${OBJS} ${LOBJS} ${CLEANFILES}
+           ${PROGS} ${OBJS} ${LOBJS} ${CLEANFILES}
 .if defined(SRCS) && !target(afterdepend)
 afterdepend: .depend
@@ -103,23 +121,26 @@
            mv $$TMP .depend)
-.if defined(PROG) && !target(proginstall)
-proginstall:: ${DESTDIR}${BINDIR}/${PROGNAME}
-.if !defined(UPDATE)
+.if defined(PROGS) && !target(proginstall)
 __proginstall: .USE
            -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} ${.ALLSRC} ${.TARGET}
-.if !defined(BUILD) && !make(all) && !make(${PROG})
+.for P in ${PROGS}
+proginstall:: ${DESTDIR}${BINDIR}/${PROGNAME.${P}}
+.if !defined(UPDATE)
+.if !defined(BUILD) && !make(all) && !make(${P})
-${DESTDIR}${BINDIR}/${PROGNAME}: ${PROG} __proginstall
+${DESTDIR}${BINDIR}/${PROGNAME.${P}}: ${P} __proginstall
 .if !target(proginstall)

David A. Holland

Home | Main Index | Thread Index | Old Index