Import of pkgsrc-2015Q1

This commit is contained in:
2015-04-22 14:34:26 +02:00
committed by Lionel Sambuc
parent 9a8c06dafb
commit 4af1cdf7a9
25114 changed files with 870550 additions and 795435 deletions

View File

@@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.105 2013/08/15 11:12:05 marino Exp $
# $NetBSD: Makefile,v 1.107 2014/09/17 12:41:50 joerg Exp $
#
COMMENT= Tools for use in the packages collection
@@ -10,9 +10,11 @@ SUBDIR+= bootstrap-mk-files
SUBDIR+= cdpack
SUBDIR+= compat_headers
SUBDIR+= createbuildlink
SUBDIR+= cwrappers
SUBDIR+= dfdisk
SUBDIR+= digest
SUBDIR+= distbb
SUBDIR+= genpkgng
SUBDIR+= genrpm
SUBDIR+= gensolpkg
SUBDIR+= gnome-packagekit

View File

@@ -1,6 +1,6 @@
# $NetBSD: Makefile,v 1.41 2014/03/14 22:03:16 ryoon Exp $
# $NetBSD: Makefile,v 1.44 2014/11/22 16:32:13 bsiegert Exp $
PKGNAME= bootstrap-mk-files-20140314
PKGNAME= bootstrap-mk-files-20141122
CATEGORIES= pkgtools
CONFLICTS+= mk-files-[0-9]*

View File

@@ -1,4 +1,4 @@
# $NetBSD: Darwin.bsd.lib.mk,v 1.4 2013/10/25 13:53:03 jperkin Exp $
# $NetBSD: Darwin.bsd.lib.mk,v 1.5 2014/11/22 16:32:13 bsiegert Exp $
# @(#)bsd.lib.mk 8.3 (Berkeley) 4/22/94
.if !target(__initialized__)
@@ -370,6 +370,14 @@ lib${LIB}_p.a:: ${POBJS} __archivebuild
lib${LIB}_pic.a:: ${SOBJS} __archivebuild
@echo building shared object ${LIB} library
.if empty(MACHINE_PLATFORM:MDarwin-[0-8].*-*)
_OPSYS_WHOLE_ARCHIVE_FLAG= -Wl,-force_load
_OPSYS_NO_WHOLE_ARCHIVE_FLAG=
.else
_OPSYS_WHOLE_ARCHIVE_FLAG= --whole-archive
_OPSYS_NO_WHOLE_ARCHIVE_FLAG= --no-whole-archive
.endif
lib${LIB}.so.${SHLIB_FULLVERSION}: ${SOLIB} ${DPADD} \
${SHLIB_LDSTARTFILE} ${SHLIB_LDENDFILE}
@echo building shared ${LIB} library \(version ${SHLIB_FULLVERSION}\)
@@ -377,14 +385,15 @@ lib${LIB}.so.${SHLIB_FULLVERSION}: ${SOLIB} ${DPADD} \
.if defined(DESTDIR)
$(CC) -nostdlib -shared ${SHLIB_SHFLAGS} -o ${.TARGET} \
${SHLIB_LDSTARTFILE} \
--whole-archive ${SOLIB} \
--no-whole-archive ${LDADD} \
${_OPSYS_WHOLE_ARCHIVE_FLAG} ${SOLIB} \
${_OPSYS_NO_WHOLE_ARCHIVE_FLAG) ${LDADD} \
-L${DESTDIR}${LIBDIR} -R${LIBDIR} \
${SHLIB_LDENDFILE}
.else
$(CC) -shared ${SHLIB_SHFLAGS} -o ${.TARGET} \
${SHLIB_LDSTARTFILE} \
--whole-archive ${SOLIB} --no-whole-archive ${LDADD} \
${_OPSYS_WHOLE_ARCHIVE_FLAG} ${SOLIB} \
${_OPSYS_NO_WHOLE_ARCHIVE_FLAG} ${LDADD} \
${SHLIB_LDENDFILE}
.endif
.if ${OBJECT_FMT} == "ELF"

View File

@@ -0,0 +1,531 @@
# $NetBSD: OpenBSD.bsd.lib.mk,v 1.1 2014/05/16 13:13:22 ryoon Exp $
# @(#)bsd.lib.mk 8.3 (Berkeley) 4/22/94
.if !target(__initialized__)
__initialized__:
.if exists(${.CURDIR}/../Makefile.inc)
.include "${.CURDIR}/../Makefile.inc"
.endif
.include <bsd.own.mk>
.include <bsd.obj.mk>
.include <bsd.depall.mk>
.MAIN: all
.endif
.PHONY: checkver cleanlib libinstall
realinstall: checkver libinstall
clean cleandir: cleanlib
.if exists(${SHLIB_VERSION_FILE})
SHLIB_MAJOR != . ${SHLIB_VERSION_FILE} ; echo $$major
SHLIB_MINOR != . ${SHLIB_VERSION_FILE} ; echo $$minor
SHLIB_TEENY != . ${SHLIB_VERSION_FILE} ; echo $$teeny
# Check for higher installed library versions.
.if !defined(NOCHECKVER) && !defined(NOCHECKVER_${LIB}) && \
exists(${BSDSRCDIR}/lib/checkver)
checkver:
@(cd ${.CURDIR} && \
sh ${BSDSRCDIR}/lib/checkver -v ${SHLIB_VERSION_FILE} \
-d ${DESTDIR}${LIBDIR} ${LIB})
.endif
.endif
.if !target(checkver)
checkver:
.endif
print-shlib-major:
.if defined(SHLIB_MAJOR)
@echo ${SHLIB_MAJOR}
.else
@false
.endif
print-shlib-minor:
.if defined(SHLIB_MINOR)
@echo ${SHLIB_MINOR}
.else
@false
.endif
print-shlib-teeny:
.if defined(SHLIB_TEENY)
@echo ${SHLIB_TEENY}
.else
@false
.endif
.if defined(SHLIB_MAJOR) && !empty(SHLIB_MAJOR)
.if defined(SHLIB_MINOR) && !empty(SHLIB_MINOR)
.if defined(SHLIB_TEENY) && !empty(SHLIB_TEENY)
SHLIB_FULLVERSION=${SHLIB_MAJOR}.${SHLIB_MINOR}.${SHLIB_TEENY}
.else
SHLIB_FULLVERSION=${SHLIB_MAJOR}.${SHLIB_MINOR}
.endif
.else
SHLIB_FULLVERSION=${SHLIB_MAJOR}
.endif
.endif
# add additional suffixes not exported.
# .po is used for profiling object files.
# .so is used for PIC object files.
.SUFFIXES: .out .a .ln .so .po .o .s .S .c .cc .C .m .F .f .r .y .l .cl .p .h
.SUFFIXES: .sh .m4 .m
# Set PICFLAGS to cc flags for producing position-independent code,
# if not already set. Includes -DPIC, if required.
# Data-driven table using make variables to control how shared libraries
# are built for different platforms and object formats.
# OBJECT_FMT: currently either "ELF" or "a.out", from <bsd.own.mk>
# SHLIB_MAJOR, SHLIB_MINOR, SHLIB_TEENY: Major, minor, and teeny version
# numbers of shared library
# SHLIB_SOVERSION: version number to be compiled into a shared library
# via -soname. Usualy ${SHLIB_MAJOR} on ELF.
# NetBSD/pmax used to use ${SHLIB_MAJOR}[.${SHLIB_MINOR}
# [.${SHLIB_TEENY}]]
# SHLIB_SHFLAGS: Flags to tell ${LD} to emit shared library.
# with ELF, also set shared-lib version for ld.so.
# SHLIB_LDSTARTFILE: support .o file, call C++ file-level constructors
# SHLIB_LDENDFILE: support .o file, call C++ file-level destructors
# FPICFLAGS: flags for ${FC} to compile .[fF] files to .so objects.
# CPPPICFLAGS: flags for ${CPP} to preprocess .[sS] files for ${AS}
# CPICFLAGS: flags for ${CC} to compile .[cC] files to pic objects.
# CSHLIBFLAGS: flags for ${CC} to compile .[cC] files to .so objects.
# (usually includes ${CPICFLAGS})
# CAPICFLAGS: flags for ${CC} to compiling .[Ss] files
# (usually just ${CPPPICFLAGS} ${CPICFLAGS})
# APICFLAGS: flags for ${AS} to assemble .[sS] to .so objects.
.if ${MACHINE_ARCH} == "alpha"
# Alpha-specific shared library flags
FPICFLAGS ?= -fPIC
CPICFLAGS ?= -fPIC -DPIC
CPPPICFLAGS?= -DPIC
CAPICFLAGS?= ${CPPPICFLAGS} ${CPICFLAGS}
APICFLAGS ?=
.elif ${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb"
# mips-specific shared library flags
# On mips, all libs are compiled with ABIcalls, not just sharedlibs.
MKPICLIB= no
# so turn shlib PIC flags on for ${AS}.
AINC+=-DABICALLS
AFLAGS+= -fPIC
AS+= -KPIC
.elif ${MACHINE_ARCH} == "vax" && ${OBJECT_FMT} == "ELF"
# On the VAX, all object are PIC by default, not just sharedlibs.
MKPICLIB= no
.elif (${MACHINE_ARCH} == "sparc" || ${MACHINE_ARCH} == "sparc64") && \
${OBJECT_FMT} == "ELF"
FPICFLAGS ?= -fPIC
CPICFLAGS ?= -fPIC -DPIC
CPPPICFLAGS?= -DPIC
CAPICFLAGS?= ${CPPPICFLAGS} ${CPICFLAGS}
APICFLAGS ?= -KPIC
.else
# Platform-independent flags for NetBSD a.out shared libraries (and PowerPC)
SHLIB_LDSTARTFILE=
SHLIB_LDENDFILE=
SHLIB_SOVERSION=${SHLIB_FULLVERSION}
SHLIB_SHFLAGS=
FPICFLAGS ?= -fPIC
CPICFLAGS?= -fPIC -DPIC
CPPPICFLAGS?= -DPIC
CAPICFLAGS?= ${CPPPICFLAGS} ${CPICFLAGS}
APICFLAGS?= -k
.endif
MKPICLIB?= yes
# Platform-independent linker flags for ELF shared libraries
.if ${OBJECT_FMT} == "ELF"
SHLIB_SOVERSION= ${SHLIB_MAJOR}
SHLIB_SHFLAGS= -Wl,-soname,lib${LIB}.so.${SHLIB_SOVERSION}
SHLIB_LDSTARTFILE?= ${DESTDIR}/usr/lib/crtbeginS.o
SHLIB_LDENDFILE?= ${DESTDIR}/usr/lib/crtendS.o
.endif
CFLAGS+= ${COPTS}
FFLAGS+= ${FOPTS}
.c.o:
.if defined(COPTS) && !empty(COPTS:M*-g*)
${COMPILE.c} ${.IMPSRC}
.else
@echo ${COMPILE.c:Q} ${.IMPSRC}
@${COMPILE.c} ${.IMPSRC} -o ${.TARGET}.o
@${LD} -r ${.TARGET}.o -o ${.TARGET}
@rm -f ${.TARGET}.o
.endif
.c.po:
.if defined(COPTS) && !empty(COPTS:M*-g*)
${COMPILE.c} -pg ${.IMPSRC} -o ${.TARGET}
.else
@echo ${COMPILE.c:Q} -pg ${.IMPSRC} -o ${.TARGET}
@${COMPILE.c} -pg ${.IMPSRC} -o ${.TARGET}.o
@${LD} -r ${.TARGET}.o -o ${.TARGET}
@rm -f ${.TARGET}.o
.endif
.c.so:
.if defined(COPTS) && !empty(COPTS:M*-g*)
${COMPILE.c} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
.else
@echo ${COMPILE.c:Q} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
@${COMPILE.c} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}.o
@${LD} -r ${.TARGET}.o -o ${.TARGET}
@rm -f ${.TARGET}.o
.endif
.c.ln:
${LINT} ${LINTFLAGS} ${CPPFLAGS:M-[IDU]*} -i ${.IMPSRC}
.cc.o .C.o:
.if defined(COPTS) && !empty(COPTS:M*-g*)
${COMPILE.cc} ${.IMPSRC}
.else
@echo ${COMPILE.cc:Q} ${.IMPSRC}
@${COMPILE.cc} ${.IMPSRC} -o ${.TARGET}.o
@${LD} -r ${.TARGET}.o -o ${.TARGET}
@rm -f ${.TARGET}.o
.endif
.cc.po .C.po:
.if defined(COPTS) && !empty(COPTS:M*-g*)
${COMPILE.cc} -pg ${.IMPSRC} -o ${.TARGET}
.else
@echo ${COMPILE.cc:Q} -pg ${.IMPSRC} -o ${.TARGET}
@${COMPILE.cc} -pg ${.IMPSRC} -o ${.TARGET}.o
@${LD} -r ${.TARGET}.o -o ${.TARGET}
@rm -f ${.TARGET}.o
.endif
.cc.so .C.so:
.if defined(COPTS) && !empty(COPTS:M*-g*)
${COMPILE.cc} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
.else
@echo ${COMPILE.cc:Q} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
@${COMPILE.cc} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}.o
@${LD} -r ${.TARGET}.o -o ${.TARGET}
@rm -f ${.TARGET}.o
.endif
.f.o:
.if defined(FOPTS) && !empty(FOPTS:M*-g*)
${COMPILE.f} ${.IMPSRC}
.else
@echo ${COMPILE.f:Q} ${.IMPSRC}
@${COMPILE.f} ${.IMPSRC} -o ${.TARGET}.o
@${LD} -r ${.TARGET}.o -o ${.TARGET}
@rm -f ${.TARGET}.o
.endif
.f.po:
.if defined(FOPTS) && !empty(FOPTS:M*-g*)
${COMPILE.f} -pg ${.IMPSRC} -o ${.TARGET}
.else
@echo ${COMPILE.f:Q} -pg ${.IMPSRC} -o ${.TARGET}
@${COMPILE.f} -pg ${.IMPSRC} -o ${.TARGET}.o
@${LD} -r ${.TARGET}.o -o ${.TARGET}
@rm -f ${.TARGET}.o
.endif
.f.so:
.if defined(FOPTS) && !empty(FOPTS:M*-g*)
${COMPILE.f} ${FPICFLAGS} ${.IMPSRC} -o ${.TARGET}
.else
@echo ${COMPILE.f:Q} ${FPICFLAGS} ${.IMPSRC} -o ${.TARGET}
@${COMPILE.f} ${FPICFLAGS} ${.IMPSRC} -o ${.TARGET}.o
@${LD} -r ${.TARGET}.o -o ${.TARGET}
@rm -f ${.TARGET}.o
.endif
.f.ln:
${ECHO} Skipping lint for Fortran libraries.
.m.o:
.if defined(OBJCFLAGS) && !empty(OBJCFLAGS:M*-g*)
${COMPILE.m} ${.IMPSRC}
.else
@echo ${COMPILE.m:Q} ${.IMPSRC}
@${COMPILE.m} ${.IMPSRC} -o ${.TARGET}.o
@${LD} -r ${.TARGET}.o -o ${.TARGET}
@rm -f ${.TARGET}.o
.endif
.m.po:
.if defined(OBJCFLAGS) && !empty(OBJCFLAGS:M*-g*)
${COMPILE.m} -pg ${.IMPSRC} -o ${.TARGET}
.else
@echo ${COMPILE.m:Q} -pg ${.IMPSRC} -o ${.TARGET}
@${COMPILE.m} -pg ${.IMPSRC} -o ${.TARGET}.o
@${LD} -r ${.TARGET}.o -o ${.TARGET}
@rm -f ${.TARGET}.o
.endif
.m.so:
.if defined(OBJCFLAGS) && !empty(OBJCFLAGS:M*-g*)
${COMPILE.m} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
.else
@echo ${COMPILE.m:Q} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
@${COMPILE.m} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}.o
@${LD} -r ${.TARGET}.o -o ${.TARGET}
@rm -f ${.TARGET}.o
.endif
.S.o .s.o:
@echo ${COMPILE.S:Q} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC}
@${COMPILE.S} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}.o
@${LD} -r ${.TARGET}.o -o ${.TARGET}
@rm -f ${.TARGET}.o
.S.po .s.po:
@echo ${COMPILE.S:Q} -DGPROF -DPROF ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}
@${COMPILE.S} -DGPROF -DPROF ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}.o
@${LD} -r ${.TARGET}.o -o ${.TARGET}
@rm -f ${.TARGET}.o
.S.so .s.so:
@echo ${COMPILE.S:Q} ${CAPICFLAGS} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}
@${COMPILE.S} ${CAPICFLAGS} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}.o
@${LD} -r ${.TARGET}.o -o ${.TARGET}
@rm -f ${.TARGET}.o
.if ${MKPIC} == "no" || (defined(LDSTATIC) && ${LDSTATIC} != "") \
|| ${MKLINKLIB} != "no"
_LIBS=lib${LIB}.a
.else
_LIBS=
.endif
OBJS+=${SRCS:N*.h:N*.sh:R:S/$/.o/g}
.if ${MKPROFILE} != "no"
_LIBS+=lib${LIB}_p.a
POBJS+=${OBJS:.o=.po}
.endif
.if ${MKPIC} != "no"
.if ${MKPICLIB} == "no"
SOLIB=lib${LIB}.a
.else
SOLIB=lib${LIB}_pic.a
_LIBS+=${SOLIB}
SOBJS+=${OBJS:.o=.so}
.endif
.if defined(SHLIB_FULLVERSION)
_LIBS+=lib${LIB}.so.${SHLIB_FULLVERSION}
.endif
.endif
LOBJS+=${LSRCS:.c=.ln} ${SRCS:M*.c:.c=.ln}
.if ${MKLINT} != "no" && ${MKLINKLIB} != "no" && !empty(LOBJS)
_LIBS+=llib-l${LIB}.ln
.endif
.if ${MKPIC} == "no" || (defined(LDSTATIC) && ${LDSTATIC} != "") \
|| ${MKLINKLIB} != "no"
ALLOBJS=${OBJS} ${POBJS} ${SOBJS}
.else
ALLOBJS=${POBJS} ${SOBJS}
.endif
.if ${MKLINT} != "no" && ${MKLINKLIB} != "no" && !empty(LOBJS)
ALLOBJS+=${LOBJS}
.endif
.NOPATH: ${ALLOBJS} ${_LIBS}
realall: ${SRCS} ${ALLOBJS:O} ${_LIBS}
__archivebuild: .USE
@rm -f ${.TARGET}
${AR} cq ${.TARGET} `NM=${NM} ${LORDER} ${.ALLSRC:M*o} | ${TSORT}`
${RANLIB} ${.TARGET}
__archiveinstall: .USE
${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${INSTPRIV} -o ${LIBOWN} \
-g ${LIBGRP} -m 600 ${.ALLSRC} ${.TARGET}
${RANLIB} -t ${.TARGET}
chmod ${LIBMODE} ${.TARGET}
DPSRCS+= ${SRCS:M*.l:.l=.c} ${SRCS:M*.y:.y=.c}
CLEANFILES+= ${DPSRCS}
.if defined(YHEADER)
CLEANFILES+= ${SRCS:M*.y:.y=.h}
.endif
lib${LIB}.a:: ${OBJS} __archivebuild
@echo building standard ${LIB} library
lib${LIB}_p.a:: ${POBJS} __archivebuild
@echo building profiled ${LIB} library
lib${LIB}_pic.a:: ${SOBJS} __archivebuild
@echo building shared object ${LIB} library
lib${LIB}.so.${SHLIB_FULLVERSION}: ${SOLIB} ${DPADD} \
${SHLIB_LDSTARTFILE} ${SHLIB_LDENDFILE}
@echo building shared ${LIB} library \(version ${SHLIB_FULLVERSION}\)
@rm -f lib${LIB}.so.${SHLIB_FULLVERSION}
.if defined(DESTDIR)
$(CC) -nostdlib -shared ${SHLIB_SHFLAGS} -o ${.TARGET} \
${SHLIB_LDSTARTFILE} \
-Wl,--whole-archive,${SOLIB} \
-Wl,--no-whole-archive,${LDADD} \
-L${DESTDIR}${LIBDIR} ${RPATH_FLAG}${LIBDIR} \
${SHLIB_LDENDFILE}
.else
$(CC) -shared ${SHLIB_SHFLAGS} -o ${.TARGET} \
${SHLIB_LDSTARTFILE} \
-Wl,--whole-archive,${SOLIB} -Wl,--no-whole-archive,${LDADD} \
${SHLIB_LDENDFILE}
.endif
.if ${OBJECT_FMT} == "ELF"
.if defined(SHLIB_FULLVERSION) && defined(SHLIB_MAJOR) && \
"${SHLIB_FULLVERSION}" != "${SHLIB_MAJOR}"
ln -sf lib${LIB}.so.${SHLIB_FULLVERSION} lib${LIB}.so.${SHLIB_MAJOR}.tmp
mv -f lib${LIB}.so.${SHLIB_MAJOR}.tmp lib${LIB}.so.${SHLIB_MAJOR}
.endif
ln -sf lib${LIB}.so.${SHLIB_FULLVERSION} lib${LIB}.so.tmp
mv -f lib${LIB}.so.tmp lib${LIB}.so
.endif
.if !empty(LOBJS)
LLIBS?= -lc
llib-l${LIB}.ln: ${LOBJS}
@echo building llib-l${LIB}.ln
@rm -f llib-l${LIB}.ln
@${LINT} -C${LIB} ${.ALLSRC} ${LLIBS}
.endif
cleanlib:
rm -f a.out [Ee]rrs mklog core *.core ${CLEANFILES}
rm -f lib${LIB}.a ${OBJS}
rm -f lib${LIB}_p.a ${POBJS}
rm -f lib${LIB}_pic.a lib${LIB}.so.* lib${LIB}.so ${SOBJS}
rm -f llib-l${LIB}.ln ${LOBJS}
.if defined(SRCS)
afterdepend: .depend
@(TMP=/tmp/_depend$$$$; \
sed -e 's/^\([^\.]*\).o[ ]*:/\1.o \1.po \1.so \1.ln:/' \
< .depend > $$TMP; \
mv $$TMP .depend)
.endif
.if !target(libinstall)
# Make sure it gets defined, in case MKPIC==no && MKLINKLIB==no
libinstall::
.if ${MKLINKLIB} != "no"
libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}.a
.PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}.a
.if !defined(UPDATE)
.PHONY: ${DESTDIR}${LIBDIR}/lib${LIB}.a
.endif
.if !defined(BUILD) && !make(all) && !make(lib${LIB}.a)
${DESTDIR}${LIBDIR}/lib${LIB}.a: .MADE
.endif
${DESTDIR}${LIBDIR}/lib${LIB}.a: lib${LIB}.a __archiveinstall
.endif
.if ${MKPROFILE} != "no"
libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a
.PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a
.if !defined(UPDATE)
.PHONY: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a
.endif
.if !defined(BUILD) && !make(all) && !make(lib${LIB}_p.a)
${DESTDIR}${LIBDIR}/lib${LIB}_p.a: .MADE
.endif
${DESTDIR}${LIBDIR}/lib${LIB}_p.a: lib${LIB}_p.a __archiveinstall
.endif
.if ${MKPIC} != "no" && ${MKPICINSTALL} != "no"
libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
.PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
.if !defined(UPDATE)
.PHONY: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
.endif
.if !defined(BUILD) && !make(all) && !make(lib${LIB}_pic.a)
${DESTDIR}${LIBDIR}/lib${LIB}_pic.a: .MADE
.endif
.if ${MKPICLIB} == "no"
${DESTDIR}${LIBDIR}/lib${LIB}_pic.a:
rm -f ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
ln -s lib${LIB}.a ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
.else
${DESTDIR}${LIBDIR}/lib${LIB}_pic.a: lib${LIB}_pic.a __archiveinstall
.endif
.endif
.if ${MKPIC} != "no" && defined(SHLIB_FULLVERSION)
libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_FULLVERSION}
.PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_FULLVERSION}
.if !defined(UPDATE)
.PHONY: ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_FULLVERSION}
.endif
.if !defined(BUILD) && !make(all) && !make(lib${LIB}.so.${SHLIB_FULLVERSION})
${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_FULLVERSION}: .MADE
.endif
${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_FULLVERSION}: lib${LIB}.so.${SHLIB_FULLVERSION}
${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${INSTPRIV} -o ${LIBOWN} \
-g ${LIBGRP} -m ${LIBMODE} ${.ALLSRC} ${.TARGET}
.if ${OBJECT_FMT} == "a.out" && !defined(DESTDIR)
/sbin/ldconfig -m ${LIBDIR}
.endif
.if ${OBJECT_FMT} == "ELF"
ln -sf lib${LIB}.so.${SHLIB_FULLVERSION}\
${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_MAJOR}.tmp
mv -f ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_MAJOR}.tmp\
${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_MAJOR}
.if ${MKLINKLIB} != "no"
ln -sf lib${LIB}.so.${SHLIB_FULLVERSION}\
${DESTDIR}${LIBDIR}/lib${LIB}.so.tmp
mv -f ${DESTDIR}${LIBDIR}/lib${LIB}.so.tmp\
${DESTDIR}${LIBDIR}/lib${LIB}.so
.endif
.endif
.endif
.if ${MKLINT} != "no" && ${MKLINKLIB} != "no" && !empty(LOBJS)
libinstall:: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln
.PRECIOUS: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln
.if !defined(UPDATE)
.PHONY: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln
.endif
.if !defined(BUILD) && !make(all) && !make(llib-l${LIB}.ln)
${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln: .MADE
.endif
${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln: llib-l${LIB}.ln
${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${INSTPRIV} -o ${LIBOWN} \
-g ${LIBGRP} -m ${LIBMODE} ${.ALLSRC} ${DESTDIR}${LINTLIBDIR}
.endif
.endif
.include <bsd.man.mk>
.include <bsd.nls.mk>
.include <bsd.files.mk>
.include <bsd.inc.mk>
.include <bsd.links.mk>
.include <bsd.dep.mk>
.include <bsd.sys.mk>
# Make sure all of the standard targets are defined, even if they do nothing.
lint regress:

View File

@@ -1,4 +1,4 @@
# $NetBSD: OpenBSD.bsd.own.mk.in,v 1.3 2008/11/15 13:06:42 schwarz Exp $
# $NetBSD: OpenBSD.bsd.own.mk.in,v 1.4 2014/05/10 23:01:26 ryoon Exp $
.if !defined(_BSD_OWN_MK_)
_BSD_OWN_MK_=1
@@ -106,6 +106,7 @@ NOPIC?=1
.if ${MACHINE_ARCH} == "alpha" || \
${MACHINE_ARCH} == "powerpc" || \
${MACHINE_ARCH} == "sparc" || \
${OS_VERSION} >= 5.4 || \
( ${MACHINE_ARCH} == "i386" && ${OS_VERSION} >= 3.4 )
OBJECT_FMT?=ELF
.else

View File

@@ -1,4 +1,4 @@
# $NetBSD: bsd.own.mk.in,v 1.4 2012/03/05 07:26:37 sbd Exp $
# $NetBSD: bsd.own.mk.in,v 1.5 2015/02/14 04:46:50 riastradh Exp $
.if !defined(_BSD_OWN_MK_)
_BSD_OWN_MK_=1
@@ -118,6 +118,7 @@ NOPIC?=1
${MACHINE_ARCH} == "i386" || \
${MACHINE_ARCH} == "m68000" || \
${MACHINE_ARCH} == "arm" || \
!empty(MACHINE_ARCH:Mearm*) || \
${MACHINE} == "next68k" || \
${MACHINE} == "sun3" || \
${MACHINE} == "mvme68k" || \

View File

@@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.52 2014/03/03 03:41:12 obache Exp $
# $NetBSD: Makefile,v 1.53 2014/10/09 14:06:49 wiz Exp $
PKGNAME= createbuildlink-3.16
CATEGORIES= pkgtools sysutils
@@ -7,8 +7,6 @@ MAINTAINER= pkgsrc-users@NetBSD.org
COMMENT= Shell script to help creating buildlink3.mk files
LICENSE= original-bsd
PKG_INSTALLATION_TYPES= overwrite pkgviews
WRKSRC= ${WRKDIR}
USE_LANGUAGES= # empty
NO_BUILD= yes

4
pkgtools/cwrappers/DESCR Normal file
View File

@@ -0,0 +1,4 @@
The cwrappers package implements the compiler wrappers for pkgsrc.
They are the foundation of the buildlink framework. They also allow
various transformations of arguments to simplify
cross-platform portability.

View File

@@ -0,0 +1,34 @@
# $NetBSD: Makefile,v 1.9 2015/03/18 15:05:35 jperkin Exp $
PKGNAME= cwrappers-20150318
CATEGORIES= pkgtools sysutils
MAINTAINER= joerg@NetBSD.org
HOMEPAGE= http://www.NetBSD.org/
COMMENT= pkgsrc compiler wrappers
LICENSE= modified-bsd
USE_BSD_MAKEFILE= yes
USE_FEATURES= nbcompat
INSTALLATION_DIRS= libexec/cwrappers
.include "../../mk/bsd.prefs.mk"
USE_CWRAPPERS:= no
CHECK_PERMS= no
.if ${OPSYS} != "NetBSD" || !empty(MACHINE_PLATFORM:MNetBSD-[0-5].*)
MAKE_ENV+= NEED_MI_VECTOR_HASH=1
.endif
.if !empty(MACHINE_PLATFORM:MDarwin-9.*) || !empty(MACHINE_PLATFORM:MDarwin-10.*)
MAKE_ENV+= NEED_GETLINE=1
.endif
CFLAGS.FreeBSD+= -D_WITH_GETLINE
CFLAGS.Linux+= -D_GNU_SOURCE=1
do-extract:
${CP} -R ${FILESDIR}/bin ${WRKSRC}
.include "../../mk/bsd.pkg.mk"

10
pkgtools/cwrappers/PLIST Normal file
View File

@@ -0,0 +1,10 @@
@comment $NetBSD: PLIST,v 1.1 2014/09/17 12:40:56 joerg Exp $
libexec/cwrappers/as-wrapper
libexec/cwrappers/c++-wrapper
libexec/cwrappers/cc-wrapper
libexec/cwrappers/cpp-wrapper
libexec/cwrappers/f77-wrapper
libexec/cwrappers/imake-wrapper
libexec/cwrappers/ld-wrapper
libexec/cwrappers/libtool-wrapper
libexec/cwrappers/shlibtool-wrapper

View File

@@ -0,0 +1,49 @@
# $NetBSD: Makefile,v 1.2 2014/09/18 19:31:47 joerg Exp $
#
PROGS= as-wrapper cc-wrapper c++-wrapper cpp-wrapper f77-wrapper \
imake-wrapper ld-wrapper libtool-wrapper shlibtool-wrapper
BINDIR= ${PREFIX}/libexec/cwrappers
LIB_SRCS= alloc.c cleanup-cc.c common.c reorder-cc.c
.ifdef NEED_MI_VECTOR_HASH
LIB_SRCS+= mi_vector_hash.c
CPPFLAGS+= -DNEED_MI_VECTOR_HASH
.endif
.ifdef NEED_GETLINE
LIB_SRCS+= getline.c
CPPFLAGS+= -DNEED_GETLINE
.endif
LDADD+= -lnbcompat
CC_SRCS= ${LIB_SRCS} generic-transform-cc.c normalise-cc.c
SRCS.as-wrapper= ${CC_SRCS} as-wrapper.c
SRCS.cc-wrapper= ${CC_SRCS} cc-wrapper.c transform-cc.c
SRCS.c++-wrapper= ${CC_SRCS} c++-wrapper.c transform-cc.c
SRCS.cpp-wrapper= ${CC_SRCS} cpp-wrapper.c
SRCS.f77-wrapper= ${CC_SRCS} f77-wrapper.c
SRCS.imake-wrapper= ${CC_SRCS} imake-wrapper.c
SRCS.ld-wrapper= ${LIB_SRCS} generic-transform-ld.c \
normalise-ld.c ld-wrapper.c
SRCS.libtool-wrapper= ${LIB_SRCS} generic-transform-libtool.c \
normalise-cc.c libtool-wrapper.c fixup-libtool.c
SRCS.shlibtool-wrapper= ${LIB_SRCS} generic-transform-libtool.c \
normalise-cc.c shlibtool-wrapper.c fixup-libtool.c
WARNS= 4
NOMAN=
CLEANFILES+= .work-new.log \
transform-gcc-rules-fixed.map \
transform-gcc-rules-fixed1.c \
transform-gcc-rules-fixed2.c
transform-cc.c: transform-gcc.c
transform-gcc.c: transform-gcc-rules rules2src.awk
awk -v output=transform-gcc.c -f rules2src.awk transform-gcc-rules
.include <bsd.prog.mk>

View File

@@ -0,0 +1,95 @@
/* $NetBSD: alloc.c,v 1.1 2014/09/17 12:40:56 joerg Exp $ */
/*-
* Copyright (c) 2007 Joerg Sonnenberger <joerg@NetBSD.org>.
* All rights reserved.
*
* This code was developed as part of Google's Summer of Code 2007 program.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <err.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "common.h"
char *
xasprintf(const char *fmt, ...)
{
va_list ap;
char *buf;
va_start(ap, fmt);
if (vasprintf(&buf, fmt, ap) == -1)
err(1, "asprintf failed");
va_end(ap);
return buf;
}
void *
xmalloc(size_t len)
{
void *ptr;
if ((ptr = malloc(len)) == NULL)
err(1, "malloc failed");
return ptr;
}
void *
xrealloc(void *buf, size_t len)
{
void *ptr;
if ((ptr = realloc(buf, len)) == NULL)
err(1, "realloc failed");
return ptr;
}
char *
xstrdup(const char *str)
{
char *buf;
if ((buf = strdup(str)) == NULL)
err(1, "strdup failed");
return buf;
}
char *
xstrndup(const char *str, size_t len)
{
char *buf;
buf = xmalloc(len + 1);
strncpy(buf, str, len);
buf[len] = '\0';
return buf;
}

View File

@@ -0,0 +1,4 @@
#define WRAPPER_AS
#define WRAPPER_NAME "as"
#include "base-wrapper.c"

View File

@@ -0,0 +1,179 @@
/* $NetBSD: base-wrapper.c,v 1.1 2014/09/17 12:40:56 joerg Exp $ */
/*-
* Copyright (c) 2007 Joerg Sonnenberger <joerg@NetBSD.org>.
* All rights reserved.
*
* This code was developed as part of Google's Summer of Code 2007 program.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <sys/wait.h>
#include <err.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "common.h"
static const char wrapper_name[] = WRAPPER_NAME;
#if !defined(WRAPPER_LIBTOOL) && !defined(WRAPPER_SHLIBTOOL)
void
register_unwrap(const char *rule)
{
}
#endif
#if defined(WRAPPER_LIBTOOL) || defined(WRAPPER_SHLIBTOOL)
static int
libtool_mode(struct arglist *args)
{
struct argument *arg;
const char *mode = NULL;
mode = NULL;
TAILQ_FOREACH(arg, args, link) {
if (arg->val[0] != '-') {
prepend_after = arg;
break;
}
if (strncmp(arg->val, "--mode=", 7) == 0) {
mode = arg->val + 7;
continue;
}
if (strcmp(arg->val, "--mode") == 0) {
arg = TAILQ_NEXT(arg, link);
if (arg == NULL || *arg->val == '-')
errx(255, "Misssing --mode argument");
mode = arg->val;
continue;
}
if (strcmp(arg->val, "--finish") == 0) {
mode = arg->val + 2;
continue;
}
if (strcmp(arg->val, "--tag") == 0) {
arg = TAILQ_NEXT(arg, link);
if (arg == NULL || *arg->val == '-')
errx(255, "Misssing --tag argument");
continue;
}
}
if (arg == NULL)
return 1;
if (mode == NULL)
errx(255, "Misssing --mode=XXX");
if (strcmp(mode, "compile") == 0 ||
strcmp(mode, "link") == 0)
return 0;
else
return 1;
}
#endif
int
main(int argc, char **argv)
{
int do_fork, rv;
FILE *fp;
struct arglist args;
struct argument *arg;
char **argv2;
init_generic_transform();
parse_config(wrapper_name);
if (argc == 2 && strcmp(argv[1], "--wrappee-name") == 0) {
puts(exec_name);
return 0;
}
arglist_from_argc(&args, argc, argv);
fp = worklog_open();
worklog_cmd(fp, "[*]", wrapper_name, &args);
#if defined(WRAPPER_LIBTOOL) || defined(WRAPPER_SHLIBTOOL)
if (libtool_mode(&args))
goto skip_transforms;
#endif
arglist_apply_config(&args);
#if defined(WRAPPER_LD)
normalise_ld(&args);
#else
normalise_cc(&args);
#endif
cleanup_cc(&args);
#if defined(WRAPPER_LD)
generic_transform_ld(&args);
#else
generic_transform_cc(&args);
#endif
reorder_cc(&args);
#if defined(WRAPPER_CC) || defined(WRAPPER_CXX)
transform_cc(&args);
#endif
cleanup_cc(&args);
#if defined(WRAPPER_LIBTOOL) || defined(WRAPPER_SHLIBTOOL)
skip_transforms:
#endif
argc = 1;
TAILQ_FOREACH(arg, &args, link)
++argc;
argv2 = xmalloc(sizeof(void *) * argc);
argv2[0] = exec_name;
argv = argv2 + 1;
TAILQ_FOREACH(arg, &args, link)
*argv++ = arg->val;
worklog_cmd(fp, "<.>", exec_name, &args);
fclose(fp);
#if defined(WRAPPER_LIBTOOL) || defined(WRAPPER_SHLIBTOOL)
do_fork = 1;
#else
do_fork = 0;
#endif
rv = command_exec(&args, do_fork);
#if defined(WRAPPER_LIBTOOL) || defined(WRAPPER_SHLIBTOOL)
if (rv == 0)
fixup_libtool(&args);
#endif
return rv;
}

View File

@@ -0,0 +1,4 @@
#define WRAPPER_CXX
#define WRAPPER_NAME "c++"
#include "base-wrapper.c"

View File

@@ -0,0 +1,4 @@
#define WRAPPER_CC
#define WRAPPER_NAME "cc"
#include "base-wrapper.c"

View File

@@ -0,0 +1,80 @@
/* $NetBSD: cleanup-cc.c,v 1.1 2014/09/17 12:40:56 joerg Exp $ */
/*-
* Copyright (c) 2009 Joerg Sonnenberger <joerg@NetBSD.org>.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <err.h>
#include <stdlib.h>
#include <string.h>
#include "common.h"
#define CLEANUP_HASH 256
void
cleanup_cc(struct arglist *args)
{
struct argument *arg, *arg2, *arg3;
struct arglist hashtab[CLEANUP_HASH];
size_t i;
for (i = 0; i < CLEANUP_HASH; ++i)
TAILQ_INIT(hashtab + i);
TAILQ_FOREACH_SAFE(arg, args, link, arg2) {
if (arg->val[0] != '-')
continue;
if (strncmp(arg->val, "-Wl,-rpath,", 11) == 0) {
if (arg->val[11] == '/')
continue;
argument_unlink(args, &arg);
continue;
}
if (arg2 != NULL && strncmp(arg->val, "-l", 2) == 0 &&
strcmp(arg->val, arg2->val) == 0) {
argument_unlink(args, &arg);
continue;
}
if (strncmp(arg->val, "-I", 2) == 0 ||
strncmp(arg->val, "-L", 2) == 0 ||
strncmp(arg->val, "-Wl,-rpath,", 11) == 0 ||
strncmp(arg->val, "-Wl,-rpath-link,", 15) == 0) {
i = wrapper_hash(arg->val) & (CLEANUP_HASH - 1);
TAILQ_FOREACH(arg3, hashtab + i, tmp_link) {
if (strcmp(arg->val, arg3->val) == 0) {
argument_unlink(args, &arg);
break;
}
}
if (arg3 == NULL)
TAILQ_INSERT_TAIL(hashtab + i, arg, tmp_link);
continue;
}
}
}

View File

@@ -0,0 +1,367 @@
/* $NetBSD: common.c,v 1.3 2014/11/29 22:19:55 joerg Exp $ */
/*-
* Copyright (c) 2009 Joerg Sonnenberger <joerg@NetBSD.org>.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <nbcompat.h>
#include <sys/wait.h>
#include <nbcompat/err.h>
#include <nbcompat/stdlib.h>
#include <string.h>
#include <unistd.h>
#include "common.h"
static char *worklog_path;
static char *real_path;
char *exec_path;
char *exec_name;
char *wrksrc;
int debug;
static struct arglist prepend_args = TAILQ_HEAD_INITIALIZER(prepend_args);
static struct arglist append_args = TAILQ_HEAD_INITIALIZER(append_args);
struct argument *prepend_after;
const char library_name_chars[] =
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
"01234567890-_";
char *
concat(const char *s1, const char *s2)
{
size_t len1, len2;
char *output;
len1 = strlen(s1);
len2 = strlen(s2);
output = xmalloc(len1 + len2 + 1);
memcpy(output, s1, len1);
memcpy(output + len1, s2, len2);
output[len1 + len2] = '\0';
return output;
}
char *
concat2(const char *s1, const char *s2, size_t len2)
{
size_t len1;
char *output;
len1 = strlen(s1);
output = xmalloc(len1 + len2 + 1);
memcpy(output, s1, len1);
memcpy(output + len1, s2, len2);
output[len1 + len2] = '\0';
return output;
}
struct argument *
argument_new(char *str)
{
struct argument *arg;
arg = xmalloc(sizeof(*arg));
arg->val = str;
return arg;
}
struct argument *
argument_copy(const char *str)
{
struct argument *arg;
arg = xmalloc(sizeof(*arg));
arg->val = xstrdup(str);
return arg;
}
void
argument_update(struct argument *arg, char *str)
{
free(arg->val);
arg->val = str;
}
void
arglist_from_argc(struct arglist *args, int argc, char **argv)
{
struct argument *arg;
TAILQ_INIT(args);
for (--argc, ++argv; argc; --argc, ++argv) {
if (**argv == '\0')
continue;
arg = argument_copy(*argv);
TAILQ_INSERT_TAIL(args, arg, link);
}
}
void
arglist_apply_config(struct arglist *args)
{
struct argument *arg, *arg2;
if (prepend_after) {
TAILQ_FOREACH(arg, &prepend_args, link) {
arg2 = argument_copy(arg->val);
TAILQ_INSERT_AFTER(args, prepend_after, arg2, link);
}
} else {
TAILQ_FOREACH_REVERSE(arg, &prepend_args, arglist, link) {
arg2 = argument_copy(arg->val);
TAILQ_INSERT_HEAD(args, arg2, link);
}
}
TAILQ_FOREACH(arg, &append_args, link) {
arg2 = argument_copy(arg->val);
TAILQ_INSERT_TAIL(args, arg2, link);
}
}
void
argument_unlink(struct arglist *args, struct argument **argp)
{
struct argument *arg;
arg = *argp;
*argp = TAILQ_NEXT(arg, link);
TAILQ_REMOVE(args, arg, link);
free(arg->val);
free(arg);
}
void
parse_config(const char *wrapper)
{
const char *config_dir;
char *config_file, *line;
size_t len;
ssize_t llen;
FILE *fp;
config_dir = getenv("CWRAPPERS_CONFIG_DIR");
if (config_dir == NULL)
errx(255, "CWRAPPERS_CONFIG_DIR is missing from environment");
config_file = xasprintf("%s/%s", config_dir, wrapper);
fp = fopen(config_file, "r");
if (fp == NULL)
errx(255, "Failed to open wrapper config file `%s'",
config_file);
for (len = 0, line = NULL; (llen = getline(&line, &len, fp)) > 0;
free(line), line = NULL, len = 0) {
if (line[llen - 1] == '\n') {
line[llen - 1] = '\0';
--llen;
}
if (strncmp(line, "worklog=", 8) == 0) {
free(worklog_path);
worklog_path = xstrdup(line + 8);
continue;
}
if (strncmp(line, "path=", 5) == 0) {
free(real_path);
real_path = xstrdup(line + 5);
continue;
}
if (strncmp(line, "exec_path=", 10) == 0) {
free(exec_path);
exec_path = xstrdup(line + 10);
continue;
}
if (strncmp(line, "exec=", 5) == 0) {
free(exec_name);
exec_name = xstrdup(line + 5);
continue;
}
if (strncmp(line, "reorder=", 8) == 0) {
register_reorder(line + 8);
continue;
}
if (strncmp(line, "transform=", 10) == 0) {
register_generic_transform(line + 10);
continue;
}
if (strncmp(line, "prepend=", 8) == 0) {
struct argument *arg;
arg = argument_copy(line + 8);
TAILQ_INSERT_TAIL(&prepend_args, arg, link);
}
if (strncmp(line, "append=", 7) == 0) {
struct argument *arg;
arg = argument_copy(line + 7);
TAILQ_INSERT_TAIL(&append_args, arg, link);
}
if (strncmp(line, "wrksrc=", 7) == 0) {
free(wrksrc);
wrksrc = xstrdup(line + 7);
continue;
}
if (strncmp(line, "unwrap=", 7) == 0) {
register_unwrap(line + 7);
continue;
}
if (strncmp(line, "debug=", 6) == 0) {
debug = atoi(line + 6);
continue;
}
}
fclose(fp);
if (worklog_path == NULL)
errx(255, "worklog path has not been set");
if (exec_name == NULL)
errx(255, "executable name has not been set");
if (exec_path == NULL)
errx(255, "executable path has not been set");
}
FILE *
worklog_open(void)
{
FILE *fp;
fp = fopen(worklog_path, "a");
if (fp == NULL)
err(255, "Could not open %s", worklog_path);
return fp;
}
void
worklog_cmd(FILE *worklog, const char *prefix, const char *cmd,
struct arglist *args)
{
static const char safe_chars[] =
"abcdefghijklmnopqrstuvwxyz"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"01234567890-_/:.,+=";
struct argument *arg;
size_t len, buflen;
char *buf;
fprintf(worklog, "%s %s", prefix, cmd);
buf = NULL;
buflen = 0;
TAILQ_FOREACH(arg, args, link) {
len = strlen(arg->val);
if (len == 0) {
fputs(" ''", worklog);
continue;
}
if (strspn(arg->val, safe_chars) == len) {
fputc(' ', worklog);
fputs(arg->val, worklog);
continue;
}
len = shquote(arg->val, buf, buflen);
if (len >= buflen) {
buflen = len + 1;
free(buf);
buf = xmalloc(buflen);
shquote(arg->val, buf, buflen);
}
fputc(' ', worklog);
fputs(buf, worklog);
}
fputc('\n', worklog);
if (buf)
free(buf);
}
int
command_exec(struct arglist *args, int do_fork)
{
struct argument *arg;
static const char failed_exec_msg[] = "exec failed\n";
char **argv, **argv2;
int argc, status;
pid_t child;
argc = 2;
TAILQ_FOREACH(arg, args, link)
++argc;
argv2 = xmalloc(sizeof(void *) * argc);
argv2[0] = exec_name;
argv = argv2 + 1;
TAILQ_FOREACH(arg, args, link)
*argv++ = arg->val;
*argv = NULL;
if (real_path)
setenv("PATH", real_path, 1);
if (do_fork)
child = vfork();
else
child = 0;
switch (child) {
case 0:
execvp(exec_name, argv2);
status = write(STDERR_FILENO, failed_exec_msg,
sizeof(failed_exec_msg) - 1);
_exit(255 | status);
case -1:
err(255, "fork failed");
default:
waitpid(child, &status, 0);
return WEXITSTATUS(status);
}
}
size_t
wrapper_hash(const char *str)
{
return wrapper_hash2(str, strlen(str));
}
size_t
wrapper_hash2(const char *str, size_t len)
{
uint32_t hashes[3];
mi_vector_hash(str, len, 0xdeadbeef, hashes);
return hashes[0];
}

View File

@@ -0,0 +1,111 @@
/* $NetBSD: common.h,v 1.3 2015/02/13 22:18:38 jperkin Exp $ */
/*-
* Copyright (c) 2009 Joerg Sonnenberger <joerg@NetBSD.org>.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifndef COMMON_H
#define COMMON_H
#include <nbcompat/types.h>
#include <nbcompat/queue.h>
#include <inttypes.h>
#include <stdio.h>
#include <unistd.h>
extern const char library_name_chars[];
extern char *exec_path;
extern char *exec_name;
extern char *wrksrc;
extern int debug;
TAILQ_HEAD(arglist, argument);
struct argument {
TAILQ_ENTRY(argument) link;
TAILQ_ENTRY(argument) tmp_link;
char *val;
};
extern struct argument *prepend_after;
char *concat(const char *, const char *);
char *concat2(const char *, const char *, size_t);
void arglist_from_argc(struct arglist *, int, char **);
void arglist_apply_config(struct arglist *);
int command_exec(struct arglist *, int);
size_t wrapper_hash(const char *);
size_t wrapper_hash2(const char *, size_t);
void argument_unlink(struct arglist *, struct argument **);
struct argument *argument_new(char *);
struct argument *argument_copy(const char *);
void argument_update(struct argument *, char *);
void parse_config(const char *);
FILE *worklog_open(void);
void worklog_cmd(FILE *, const char *, const char *, struct arglist *);
#if defined(__GNUC__) && __GNUC__ >= 2
char *xasprintf(const char *, ...)
__attribute__((__format__(__printf__, 1, 2)));
#else
char *xasprintf(const char *, ...);
#endif
void *xmalloc(size_t);
void *xrealloc(void *, size_t);
char *xstrdup(const char *);
char *xstrndup(const char *, size_t);
void normalise_cc(struct arglist *);
void cleanup_cc(struct arglist *args);
void transform_cc(struct arglist *args);
void register_reorder(const char *);
void reorder_cc(struct arglist *);
void init_generic_transform(void);
void register_generic_transform(const char *);
void generic_transform_cc(struct arglist *);
void normalise_ld(struct arglist *);
void generic_transform_ld(struct arglist *);
void register_unwrap(const char *);
void fixup_libtool(struct arglist *);
#ifdef NEED_MI_VECTOR_HASH
void mi_vector_hash(const void *, size_t, uint32_t, uint32_t[3]);
#endif
#ifdef NEED_GETLINE
ssize_t getline(char **, size_t *, FILE *);
#endif
#endif

View File

@@ -0,0 +1,4 @@
#define WRAPPER_CPP
#define WRAPPER_NAME "cpp"
#include "base-wrapper.c"

View File

@@ -0,0 +1,4 @@
#define WRAPPER_F77
#define WRAPPER_NAME "f77"
#include "base-wrapper.c"

View File

@@ -0,0 +1,435 @@
/* $NetBSD: fixup-libtool.c,v 1.5 2015/03/18 15:05:36 jperkin Exp $ */
/*-
* Copyright (c) 2009 Joerg Sonnenberger <joerg@NetBSD.org>.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <sys/stat.h>
#include <err.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "common.h"
#define LIBPATH_HASH 256
struct unwrap_rule {
TAILQ_ENTRY(unwrap_rule) link;
char *src;
char *dst;
size_t src_len;
};
TAILQ_HEAD(unwrap_ruleset, unwrap_rule);
static struct unwrap_ruleset unwrap_rules =
TAILQ_HEAD_INITIALIZER(unwrap_rules);
void
register_unwrap(const char *rule)
{
const char *sep;
struct unwrap_rule *r;
sep = strchr(rule, ':');
if (sep == NULL)
goto failure;
if (strchr(sep + 1, ':') != NULL)
goto failure;
r = xmalloc(sizeof(*r));
r->src = xstrndup(rule, sep - rule);
if (sep[1])
r->dst = xstrdup(sep + 1);
else
r->dst = NULL;
r->src_len = sep - rule;
TAILQ_INSERT_TAIL(&unwrap_rules, r, link);
return;
failure:
errx(255, "Invalid transform rule: %s", rule);
}
struct processing_option {
FILE *output;
const char *lafile;
struct arglist hashtab[LIBPATH_HASH];
int first;
int in_lai;
int in_relink;
const char *last_opt;
size_t last_len;
};
static void
process_option(struct processing_option *opt, const char *line, size_t len,
int in_relink)
{
struct unwrap_rule *r;
struct argument *arg;
char *tmp;
const char *eol;
size_t i, wlen;
if (opt->in_lai && opt->last_opt && opt->last_len == len &&
strncmp(opt->last_opt, line, len) == 0)
return;
if (len >= 11 && strncmp(line, "-Wl,-rpath,", 11) == 0) {
if (in_relink)
goto print_option;
return;
}
if (len >= 15 && strncmp(line, "-Wl,-rpath-link,", 15) == 0) {
if (in_relink)
goto print_option;
return;
}
if (len > 2 && strncmp(line, "-D", 2) == 0)
return; /* No preprocessor options */
if (len > 2 && strncmp(line, "-I", 2) == 0)
return; /* No preprocessor options */
if (len >= 2 && strncmp(line, "-L", 2) == 0) {
if (opt->in_lai) {
TAILQ_FOREACH(r, &unwrap_rules, link) {
if (len - 2 < r->src_len)
continue;
if (strncmp(line + 2, r->src, r->src_len))
continue;
if (line[r->src_len + 2] != '/' &&
len != r->src_len + 2)
continue;
line += r->src_len + 2;
len -= r->src_len + 2;
tmp = xasprintf("-L%s%*.*s", r->dst,
(int)len, (int)len, line);
process_option(opt, tmp, strlen(tmp),
in_relink);
free(tmp);
return;
}
if (wrksrc) {
wlen = strlen(wrksrc);
if (wlen <= len - 2 &&
strncmp(line + 2, wrksrc, wlen) == 0 &&
(line[wlen + 2] == '/' || wlen + 2 == len))
return;
}
}
i = wrapper_hash2(line, len) & (LIBPATH_HASH - 1);
TAILQ_FOREACH(arg, opt->hashtab + i, link) {
if (strncmp(arg->val, line, len) == 0 &&
arg->val[len] == '\0')
break;
}
if (arg != NULL)
return;
arg = argument_new(xstrndup(line, len));
TAILQ_INSERT_TAIL(opt->hashtab + i, arg, link);
goto print_option;
}
opt->last_opt = line;
opt->last_len = len;
if (len < 3 || strncmp(line + len - 3, ".la", 3))
goto print_option;
for (eol = line + len - 3; eol > line; --eol) {
if (*eol == '/')
break;
}
if (opt->in_lai && *eol == '/') {
TAILQ_FOREACH(r, &unwrap_rules, link) {
if (eol < line + r->src_len)
continue;
if (strncmp(line, r->src, r->src_len))
continue;
if (line[r->src_len] != '/')
continue;
line += r->src_len;
len -= r->src_len;
if (strncmp(eol + 1, "lib", 3) == 0) {
tmp = xasprintf("-L%s%*.*s", r->dst,
(int)(eol - line), (int)(eol - line), line);
process_option(opt, tmp, strlen(tmp),
in_relink);
free(tmp);
eol += 4;
len = line + len - eol - 3;
fprintf(opt->output, " -l%*.*s", (int)len,
(int)len, eol);
} else {
tmp = xasprintf("%s%*.*s", r->dst,
(int)len, (int)len, line);
process_option(opt, tmp, strlen(tmp),
in_relink);
free(tmp);
}
return;
}
}
if (!opt->in_relink)
goto print_option;
if (opt->lafile && strncmp(opt->lafile, line, len) == 0 &&
len == strlen(opt->lafile))
goto print_option;
if (*line != '/' && line == eol) {
process_option(opt, "-L./.libs", 9, in_relink);
goto print_option;
}
if (*line != '/') {
tmp = xasprintf("-L%*.*s/.libs", (int)(eol - line),
(int)(eol - line), line);
process_option(opt, tmp, strlen(tmp), in_relink);
free(tmp);
goto print_option;
}
if (wrksrc == NULL)
goto print_option;
wlen = strlen(wrksrc);
if (wlen > len ||
(wlen != len && line[wlen] != '/') ||
strncmp(wrksrc, line, wlen))
goto print_option;
tmp = xasprintf("-L%*.*s/.libs", (int)(eol - line),
(int)(eol - line), line);
process_option(opt, tmp, strlen(tmp), in_relink);
free(tmp);
print_option:
if (opt->first)
opt->first = 0;
else
putc(' ', opt->output);
fwrite(line, len, 1, opt->output);
}
static void
process_variable(FILE *output, const char *lafile, const char *line,
int in_lai, int in_relink)
{
struct processing_option opt;
size_t len, len2;
struct argument *arg;
size_t i;
const char *command;
for (i = 0; i < LIBPATH_HASH; ++i)
TAILQ_INIT(opt.hashtab + i);
opt.output = output;
opt.lafile = lafile;
opt.in_lai = in_lai;
opt.in_relink = in_relink;
opt.last_opt = NULL;
opt.last_len = 0;
if (in_relink) {
command = strchr(line, ';');
if (command == NULL)
errx(255, "Unrecognizable relink format");
++command;
fwrite(line, command - line, 1, output);
fprintf(output, " %s", exec_path);
/* XXX document this logic */
line = command + 1;
len = strspn(line, " \t");
line += len;
len2 = len = strcspn(line, " \t");
command = line;
if (len == 0)
errx(255, "Unrecognizable relink format");
line += len;
len = strspn(line, " \t");
line += len;
if (len2 != 7 || strncmp(command, "libtool", 7)) {
len = strcspn(line, " \t");
if (len == 0)
errx(255, "Unrecognizable relink format");
line += len;
len = strspn(line, " \t");
line += len;
}
}
for (opt.first = !in_relink; *line ; line += len) {
len = strspn(line, " \t");
line += len;
len = strcspn(line, " \t");
if (len == 0)
break;
process_option(&opt, line, len, in_relink);
}
for (i = 0; i < LIBPATH_HASH; ++i) {
while ((arg = TAILQ_FIRST(opt.hashtab + i)) != NULL)
argument_unlink(opt.hashtab + i, &arg);
}
}
static void
fixup_libtool_la(const char *lafile, int in_lai)
{
static const char dep_lib[] = "dependency_libs='";
static const char relink_cmd[] = "relink_command=\"";
static const char relink_marker_cmd[] = "# buildlink modification\n";
struct stat st;
FILE *fp, *output;
char *line, *opt_start, *tmp_name;
const char *pass_lafile, *cur_option;
int in_relink, ignore_relink = 0;
char delimiter;
size_t len;
ssize_t cur;
fp = fopen(lafile, "r");
if (fp == NULL)
return;
if (fstat(fileno(fp), &st))
err(255, "fstat('%s') failed", lafile);
if ((st.st_mode & S_IFMT) != S_IFREG) {
fclose(fp);
return;
}
tmp_name = concat(lafile, ".tmp");
output = fopen(tmp_name, "w");
if (output == NULL)
err(255, "fopen('%s') failed", tmp_name);
line = NULL;
len = 0;
while ((cur = getline(&line, &len, fp)) > 0) {
if (strcmp(line, relink_marker_cmd) == 0) {
fwrite(line, 1, cur, output);
ignore_relink = 1;
continue;
}
if (strncmp(line, relink_cmd, sizeof(relink_cmd) - 1) == 0) {
if (ignore_relink) {
fwrite(line, 1, cur, output);
ignore_relink = 0;
continue;
}
cur_option = relink_cmd;
opt_start = line + sizeof(relink_cmd) - 1;
pass_lafile = lafile;
delimiter='\"';
in_relink = 1;
ignore_relink = 0;
} else if (strncmp(line, dep_lib, sizeof(dep_lib) - 1) == 0) {
cur_option = dep_lib;
opt_start = line + sizeof(dep_lib) - 1;
pass_lafile = NULL;
delimiter='\'';
in_relink = 0;
ignore_relink = 0;
} else {
fwrite(line, 1, cur, output);
ignore_relink = 0;
continue;
}
if (line[cur - 2] != delimiter || line[cur - 1] != '\n')
errx(255, "corrupted libtool archive '%s'", lafile);
if (debug) {
fputs("# buildlink modification, original:\n# ",
output);
fwrite(line, 1, cur, output);
} else {
fputs(relink_marker_cmd, output);
}
fputs(cur_option, output);
line[cur - 2] = '\0';
process_variable(output, pass_lafile, opt_start, in_lai,
in_relink);
fprintf(output, "%c\n", delimiter);
}
free(line);
if (ferror(fp) || fclose(fp) ||
ferror(output) || fclose(output) ||
rename(tmp_name, lafile)) {
unlink(tmp_name);
err(255, "output processing failed");
}
}
void
fixup_libtool(struct arglist *args)
{
struct argument *arg, *arg2;
const char *slash;
char *laifile;
size_t len;
TAILQ_FOREACH(arg, args, link) {
if (strcmp(arg->val, "-o"))
continue;
arg2 = TAILQ_NEXT(arg, link);
if (arg2 == NULL || arg2->val[0] == '-')
errx(255, "Missing argument for option -o");
arg = arg2;
len = strlen(arg->val);
if (len < 3)
continue;
if (strcmp(arg->val + len - 3, ".la") == 0)
break;
}
if (arg == NULL)
return;
fixup_libtool_la(arg->val, 0);
slash = strrchr(arg->val, '/');
if (slash == NULL)
laifile = xasprintf("./.libs/%si", arg->val);
else
laifile = xasprintf("%*.*s/.libs/%si",
(int)(slash - arg->val), (int)(slash - arg->val),
arg->val, slash + 1);
fixup_libtool_la(laifile, 1);
free(laifile);
}

View File

@@ -0,0 +1,461 @@
/* $NetBSD: generic-transform-cc.c,v 1.2 2015/03/15 19:16:45 joerg Exp $ */
/*-
* Copyright (c) 2009 Joerg Sonnenberger <joerg@NetBSD.org>.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#if defined(WRAPPER_LIBTOOL)
#include <sys/stat.h>
#endif
#include <err.h>
#include <stdlib.h>
#include <string.h>
#include "common.h"
#if defined(WRAPPER_LD)
#define generic_transform_cc generic_transform_ld
#endif
#define OPT_HASH 256
struct transform_rule {
TAILQ_ENTRY(transform_rule) link;
char *src;
char *dst;
size_t src_len;
};
struct lib_transform_rule {
TAILQ_ENTRY(lib_transform_rule) link;
char *src;
char **dst;
size_t src_len;
};
TAILQ_HEAD(transform_ruleset, transform_rule);
TAILQ_HEAD(lib_transform_ruleset, lib_transform_rule);
static struct transform_ruleset opt_rules[OPT_HASH];
#if !defined(WRAPPER_LD)
static struct transform_ruleset include_rules =
TAILQ_HEAD_INITIALIZER(include_rules);
#endif
static struct transform_ruleset lib_rules =
TAILQ_HEAD_INITIALIZER(lib_rules);
static struct transform_ruleset rpath_rules =
TAILQ_HEAD_INITIALIZER(rpath_rules);
#if defined(WRAPPER_LIBTOOL)
static struct transform_ruleset libpath_rules =
TAILQ_HEAD_INITIALIZER(libpath_rules);
#endif
static struct lib_transform_ruleset libname_rules =
TAILQ_HEAD_INITIALIZER(libname_rules);
void
init_generic_transform(void)
{
size_t i;
for (i = 0; i < OPT_HASH; ++i)
TAILQ_INIT(opt_rules + i);
}
static void
register_generic_transform_path(const char *orig_rule, const char *rule,
struct transform_ruleset *ruleset)
{
const char *sep;
struct transform_rule *r;
sep = strchr(rule, ':');
if (sep == NULL)
goto failure;
if (strchr(sep + 1, ':') != NULL)
goto failure;
r = xmalloc(sizeof(*r));
r->src = xstrndup(rule, sep - rule);
if (sep[1])
r->dst = xstrdup(sep + 1);
else
r->dst = NULL;
r->src_len = sep - rule;
TAILQ_INSERT_TAIL(ruleset, r, link);
return;
failure:
errx(255, "Invalid transform rule: %s", orig_rule);
}
static void
register_generic_transform_lib(const char *orig_rule, const char *rule)
{
struct lib_transform_rule *r;
const char *sep;
size_t count;
sep = strchr(rule, ':');
if (sep == NULL)
goto failure;
r = xmalloc(sizeof(*r));
r->src = concat2("-l", rule, sep - rule);
r->src_len = sep - rule + 2;
rule = sep;
for (count = 0; sep != NULL; ++count)
sep = strchr(sep + 1, ':');
r->dst = xmalloc(sizeof(char *) * (count + 1));
for (count = 0; rule != NULL; ++count, rule = sep) {
++rule;
sep = strchr(rule, ':');
if (sep == rule || *rule == '\0')
goto failure;
if (sep)
r->dst[count] = concat2("-l", rule, sep - rule);
else
r->dst[count] = concat("-l", rule);
}
r->dst[count] = NULL;
TAILQ_INSERT_TAIL(&libname_rules, r, link);
return;
failure:
errx(255, "Invalid transform rule: %s", orig_rule);
}
static void
register_opt_transform(const char *orig_rule, const char *rule)
{
const char *sep;
struct transform_rule *r;
size_t i;
sep = strchr(rule, ':');
if (sep == NULL)
goto failure;
if (strchr(sep + 1, ':') != NULL)
goto failure;
r = xmalloc(sizeof(*r));
r->src = xstrndup(rule, sep - rule);
if (sep[1])
r->dst = xstrdup(sep + 1);
else
r->dst = NULL;
r->src_len = sep - rule;
i = wrapper_hash(r->src) & (OPT_HASH - 1);
TAILQ_INSERT_TAIL(opt_rules + i, r, link);
return;
failure:
errx(255, "Invalid transform rule: %s", orig_rule);
}
static void
register_rm_transform(const char *orig_rule, const char *rule)
{
struct transform_rule *r;
size_t i;
if (strchr(rule, ':') != NULL)
goto failure;
r = xmalloc(sizeof(*r));
r->src = xstrdup(rule);
r->dst = NULL;
r->src_len = strlen(r->src);
i = wrapper_hash(r->src) & (OPT_HASH - 1);
TAILQ_INSERT_TAIL(opt_rules + i, r, link);
return;
failure:
errx(255, "Invalid transform rule: %s", orig_rule);
}
void
register_generic_transform(const char *rule)
{
if (strncmp(rule, "I:", 2) == 0) {
#if !defined(WRAPPER_LD)
register_generic_transform_path(rule, rule + 2,
&include_rules);
#endif
} else if (strncmp(rule, "L:", 2) == 0) {
register_generic_transform_path(rule, rule + 2,
&lib_rules);
} else if (strncmp(rule, "R:", 2) == 0) {
register_generic_transform_path(rule, rule + 2,
&rpath_rules);
} else if (strncmp(rule, "l:", 2) == 0) {
register_generic_transform_lib(rule, rule + 2);
} else if (strncmp(rule, "P:", 2) == 0) {
#if defined(WRAPPER_LIBTOOL)
register_generic_transform_path(rule, rule + 2,
&libpath_rules);
#endif
} else if (strncmp(rule, "opt:", 4) == 0) {
register_opt_transform(rule, rule + 4);
} else if (strncmp(rule, "rm:", 3) == 0) {
register_rm_transform(rule, rule + 3);
} else
errx(255, "Unknown transform rule: %s", rule);
}
#if defined(WRAPPER_LIBTOOL)
static void
generic_transform_cc_absolute(struct arglist *args, struct argument *arg)
{
struct transform_rule *rule;
const char *fname, *iter;
size_t len;
fname = strrchr(arg->val, '/');
if (strncmp(fname + 1, "lib", 3))
return;
iter = fname + 4;
len = strspn(iter, library_name_chars);
if (len == 0)
return;
iter += len;
if (strcmp(iter, ".la") && strcmp(iter, ".a"))
return;
len = fname - arg->val;
TAILQ_FOREACH(rule, &libpath_rules, link) {
if (rule->src_len > len)
continue;
if (arg->val[rule->src_len] != '/')
continue;
if (strncmp(arg->val, rule->src, rule->src_len))
continue;
argument_update(arg, concat(rule->dst, arg->val + rule->src_len));
break;
}
}
static int
generic_transform_libtool_lib(struct arglist *args, struct argument *arg)
{
struct argument *arg2;
struct stat sb;
char *fname;
int rv;
size_t len;
TAILQ_FOREACH(arg2, args, link) {
if (arg == arg2)
break;
if (strncmp(arg2->val, "-L", 2))
continue;
len = strlen(arg2->val);
if (len >= 6 && strcmp(arg2->val + len - 6, "/.libs") == 0)
continue;
fname = xasprintf("%s/lib%s.la", arg2->val + 2, arg->val + 2);
rv = stat(fname, &sb);
if (rv == -1 ||
!(S_ISREG(sb.st_mode) || S_ISLNK(sb.st_mode))) {
free(fname);
continue;
}
if (arg2->val[2] == '/') {
if (wrksrc == NULL)
return 0;
if (strncmp(arg2->val + 2, wrksrc, len))
return 0;
}
argument_update(arg, fname);
return 1;
}
return 0;
}
#endif
void
generic_transform_cc(struct arglist *args)
{
struct argument *arg, *arg2, *opt_arg;
struct transform_rule *rule;
struct transform_ruleset *ruleset;
struct lib_transform_rule *lib_rule;
const char *path, *prefix;
char *transformed;
int rpath_mode;
size_t i, len;
TAILQ_FOREACH_SAFE(arg, args, link, arg2) {
len = strlen(arg->val);
i = wrapper_hash2(arg->val, len) & (OPT_HASH - 1);
rpath_mode = 0;
TAILQ_FOREACH(rule, opt_rules + i, link) {
if (rule->src_len == len &&
strcmp(rule->src, arg->val) == 0)
break;
}
if (rule != NULL) {
if (rule->dst == NULL) {
argument_unlink(args, &arg);
continue;
}
argument_update(arg, xstrdup(rule->dst));
len = strlen(rule->dst);
}
#if defined(WRAPPER_LIBTOOL)
if (strncmp(arg->val, "-l", 2) == 0 &&
generic_transform_libtool_lib(args, arg))
continue;
#endif
if (arg->val[0] == '/') {
#if defined(WRAPPER_LIBTOOL)
generic_transform_cc_absolute(args, arg);
#endif
continue;
}
#if !defined(WRAPPER_LD)
else if (strncmp(arg->val, "-I", 2) == 0) {
len -= 2;
prefix = "-I";
path = arg->val + 2;
ruleset = &include_rules;
opt_arg = NULL;
}
#endif
else if (strncmp(arg->val, "-L", 2) == 0) {
len -= 2;
prefix = "-L";
path = arg->val + 2;
ruleset = &lib_rules;
opt_arg = NULL;
}
#if !defined(WRAPPER_LD)
else if (strncmp(arg->val, "-Wl,-rpath,", 11) == 0) {
len -= 11;
prefix = "-Wl,-rpath,";
path = arg->val + 11;
ruleset = &rpath_rules;
opt_arg = NULL;
rpath_mode = 1;
} else if (strncmp(arg->val, "-Wl,-rpath-link,", 15) == 0) {
len -= 15;
prefix = "-Wl,-rpath-link,";
path = arg->val + 15;
ruleset = &rpath_rules;
opt_arg = NULL;
rpath_mode = 1;
}
#else
else if (strcmp(arg->val, "-rpath") == 0 ||
strcmp(arg->val, "-rpath-link") == 0) {
opt_arg = arg;
arg = arg2;
if (arg == NULL || arg->val[0] == '-') {
errx(255, "Missing argument for %s",
opt_arg->val);
}
ruleset = &rpath_rules;
arg2 = TAILQ_NEXT(arg, link);
len = strlen(arg->val);
prefix = "";
path = arg->val;
rpath_mode = 1;
}
#endif
else if (strncmp(arg->val, "-l", 2) == 0) {
TAILQ_FOREACH(lib_rule, &libname_rules, link) {
if (lib_rule->src_len != len)
continue;
if (strcmp(lib_rule->src, arg->val) == 0)
break;
}
if (lib_rule == NULL)
continue;
argument_unlink(args, &arg);
for (i = 0; lib_rule->dst[i] != NULL; ++i) {
arg = argument_copy(lib_rule->dst[i]);
if (arg2 == NULL)
TAILQ_INSERT_TAIL(args, arg, link);
else
TAILQ_INSERT_BEFORE(arg2, arg, link);
}
continue;
} else
continue;
if (*path != '/')
continue;
while (len > 1 && path[len - 1] == '/')
--len;
TAILQ_FOREACH(rule, ruleset, link) {
if (rule->src[rule->src_len - 1] == '/') {
if (rule->src_len - 1 != len)
continue;
if (memcmp(path, rule->src, len) != 0)
continue;
break;
}
if (rule->src_len > len)
continue;
if (path[rule->src_len] != '\0' &&
path[rule->src_len] != '/')
continue;
if (strncmp(path, rule->src, rule->src_len) == 0)
break;
}
if (rule == NULL || rule->dst == NULL) {
if (rpath_mode) {
if (len >= 6 &&
strcmp(path + len - 6, "/.libs") == 0)
continue;
}
if (opt_arg)
argument_unlink(args, &opt_arg);
argument_unlink(args, &arg);
continue;
}
transformed = xasprintf("%s%s%s", prefix, rule->dst,
path + rule->src_len);
argument_update(arg, transformed);
}
}

View File

@@ -0,0 +1,3 @@
#define WRAPPER_LD
#include "generic-transform-cc.c"

View File

@@ -0,0 +1,3 @@
#define WRAPPER_LIBTOOL
#include "generic-transform-cc.c"

View File

@@ -0,0 +1,52 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "common.h"
ssize_t
getline(char **lineptr, size_t *len, FILE *fp)
{
char *iter, *eos;
int ch;
if (*len == 1) {
free(*lineptr);
*len = 0;
}
if (*len == 0) {
*lineptr = malloc(128);
if (*lineptr == NULL)
return -1;
*len = 128;
}
iter = *lineptr;
for (;;) {
eos = *lineptr + *len - 1;
while (iter < eos) {
ch = getc_unlocked(fp);
if (ch == -1)
break;
*iter++ = ch;
if (ch == '\n') {
*iter = '\0';
return iter - *lineptr;
}
}
if (iter == *lineptr)
return -1;
if (iter < eos) {
*iter = '\0';
return iter - *lineptr;
}
iter = realloc(*lineptr, *len * 2);
if (iter == NULL)
return -1;
*lineptr = iter;
iter += *len - 1;
*len *= 2;
}
}

View File

@@ -0,0 +1,4 @@
#define WRAPPER_IMAKE
#define WRAPPER_NAME "imake"
#include "base-wrapper.c"

View File

@@ -0,0 +1,4 @@
#define WRAPPER_LD
#define WRAPPER_NAME "ld"
#include "base-wrapper.c"

View File

@@ -0,0 +1,4 @@
#define WRAPPER_LIBTOOL
#define WRAPPER_NAME "libtool"
#include "base-wrapper.c"

View File

@@ -0,0 +1,187 @@
/* $NetBSD: mi_vector_hash.c,v 1.2 2014/10/06 14:57:53 joerg Exp $ */
/*-
* Copyright (c) 2009 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Joerg Sonnenberger.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* See http://burtleburtle.net/bob/hash/doobs.html for the full description
* and the original version of the code. This version differs by exposing
* the full internal state and avoiding byte operations in the inner loop
* if the key is aligned correctly.
*/
#include <nbcompat.h>
#include <nbcompat/cdefs.h>
__RCSID("$NetBSD: mi_vector_hash.c,v 1.2 2014/10/06 14:57:53 joerg Exp $");
#include <nbcompat/endian.h>
#include <stdint.h>
#include <stdlib.h>
#include "common.h"
static uint16_t
my_le16dec(const void *buf)
{
const uint8_t *p = (const uint8_t *)buf;
return (p[0] | ((uint16_t)p[1] << 8));
}
static uint32_t
my_le32dec(const void *buf)
{
const uint8_t *p = (const uint8_t *)buf;
return (my_le16dec(p) | ((uint32_t)my_le16dec(p + 2) << 16));
}
static uint32_t
my_le32toh(uint32_t val)
{
uint8_t buf[4];
memcpy(buf, &val, sizeof(buf));
return my_le32dec(buf);
}
#define mix(a, b, c) do { \
a -= b; a -= c; a ^= (c >> 13); \
b -= c; b -= a; b ^= (a << 8); \
c -= a; c -= b; c ^= (b >> 13); \
a -= b; a -= c; a ^= (c >> 12); \
b -= c; b -= a; b ^= (a << 16); \
c -= a; c -= b; c ^= (b >> 5); \
a -= b; a -= c; a ^= (c >> 3); \
b -= c; b -= a; b ^= (a << 10); \
c -= a; c -= b; c ^= (b >> 15); \
} while (/* CONSTCOND */0)
#define FIXED_SEED 0x9e3779b9 /* Golden ratio, arbitrary constant */
void
mi_vector_hash(const void *key, size_t len, uint32_t seed, uint32_t hashes[3])
{
static const uint32_t mask[4] = {
0x000000ff, 0x0000ffff, 0x00ffffff, 0xffffffff
};
uint32_t orig_len, a, b, c;
const uint8_t *k;
orig_len = (uint32_t)len;
a = b = FIXED_SEED;
c = seed;
if ((uintptr_t)key & 3) {
k = key;
while (len >= 12) {
a += my_le32dec(k);
b += my_le32dec(k + 4);
c += my_le32dec(k + 8);
mix(a, b, c);
k += 12;
len -= 12;
}
c += orig_len;
if (len > 8) {
switch (len) {
case 11:
c += (uint32_t)k[10] << 24;
/* FALLTHROUGH */
case 10:
c += (uint32_t)k[9] << 16;
/* FALLTHROUGH */
case 9:
c += (uint32_t)k[8] << 8;
/* FALLTHROUGH */
}
b += my_le32dec(k + 4);
a += my_le32dec(k);
} else if (len > 4) {
switch (len) {
case 8:
b += (uint32_t)k[7] << 24;
/* FALLTHROUGH */
case 7:
b += (uint32_t)k[6] << 16;
/* FALLTHROUGH */
case 6:
b += (uint32_t)k[5] << 8;
/* FALLTHROUGH */
case 5:
b += k[4];
/* FALLTHROUGH */
}
a += my_le32dec(k);
} else if (len) {
switch (len) {
case 4:
a += (uint32_t)k[3] << 24;
/* FALLTHROUGH */
case 3:
a += (uint32_t)k[2] << 16;
/* FALLTHROUGH */
case 2:
a += (uint32_t)k[1] << 8;
/* FALLTHROUGH */
case 1:
a += k[0];
/* FALLTHROUGH */
}
}
} else {
const uint32_t *key32 = key;
while (len >= 12) {
a += my_le32toh(key32[0]);
b += my_le32toh(key32[1]);
c += my_le32toh(key32[2]);
mix(a, b, c);
key32 += 3;
len -= 12;
}
c += orig_len;
if (len > 8) {
c += (my_le32toh(key32[2]) & mask[len - 9]) << 8;
b += my_le32toh(key32[1]);
a += my_le32toh(key32[0]);
} else if (len > 4) {
b += my_le32toh(key32[1]) & mask[len - 5];
a += my_le32toh(key32[0]);
} else if (len)
a += my_le32toh(key32[0]) & mask[len - 1];
}
mix(a, b, c);
hashes[0] = a;
hashes[1] = b;
hashes[2] = c;
}

View File

@@ -0,0 +1,204 @@
/* $NetBSD: normalise-cc.c,v 1.1 2014/09/17 12:40:56 joerg Exp $ */
/*-
* Copyright (c) 2009 Joerg Sonnenberger <joerg@NetBSD.org>.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <err.h>
#include <stdlib.h>
#include <string.h>
#include "common.h"
static void
normalise_path_list(struct arglist *args, struct argument *arg,
const char *prefix, const char *val, int strip_relative)
{
const char *sep;
struct argument *arg2;
while ((sep = strchr(val, ':')) != NULL) {
if (sep == val || (strip_relative && val[0] != '/')) {
val = sep + 1;
continue;
}
arg2 = argument_new(concat2(prefix, val, sep - val));
TAILQ_INSERT_AFTER(args, arg, arg2, link);
arg = arg2;
val = sep + 1;
}
if (val[0] == '\0' || (strip_relative && val[0] != '/'))
return;
arg2 = argument_new(concat(prefix, val));
TAILQ_INSERT_AFTER(args, arg, arg2, link);
arg = arg2;
}
void
normalise_cc(struct arglist *args)
{
struct argument *arg, *arg2, *arg3;
const char *next, *last;
size_t len;
TAILQ_FOREACH_SAFE(arg, args, link, arg2) {
if (arg->val[0] != '-')
continue;
if (strcmp(arg->val, "-Xlinker") == 0) {
if (arg2 == NULL)
errx(255, "Missing argument for %s", arg->val);
if (strncmp(arg2->val, "-Wl,", 4) == 0) {
argument_unlink(args, &arg);
continue;
}
argument_update(arg2, concat("-Wl,", arg2->val));
argument_unlink(args, &arg);
continue;
}
if (strncmp(arg->val, "-Wl,", 4) == 0 &&
(next = strchr(arg->val + 4, ',')) != NULL) {
last = arg->val + 4;
do {
arg3 = argument_new(concat2("-Wl,", last,
next - last));
if (arg2 != NULL)
TAILQ_INSERT_BEFORE(arg2, arg3, link);
else
TAILQ_INSERT_TAIL(args, arg3, link);
last = next + 1;
} while ((next = strchr(last, ',')) != NULL);
arg3 = argument_new(concat("-Wl,", last));
if (arg2 != NULL)
TAILQ_INSERT_BEFORE(arg2, arg3, link);
else
TAILQ_INSERT_TAIL(args, arg3, link);
argument_unlink(args, &arg);
continue;
}
}
TAILQ_FOREACH_SAFE(arg, args, link, arg2) {
if (strcmp(arg->val, "-o") == 0 ||
strcmp(arg->val, "--dynamic-linker") == 0) {
if (arg2 == NULL || arg2->val[0] == '-')
errx(255, "Missing argument for %s", arg->val);
arg2 = TAILQ_NEXT(arg2, link);
continue;
}
if (arg->val[0] == '/') {
next = strrchr(arg->val, '/');
++next;
if (strncmp(next, "lib", 3))
continue;
next += 3;
len = strspn(next, library_name_chars);
if (len == 0)
continue;
last = next + len;
if (strncmp(last, ".so", 3) &&
strncmp(last, ".sl", 3))
continue;
if (last[3] &&
(last[3] != '.' || last[4] < '0' || last[4] > '9'))
continue;
arg3 = argument_new(xasprintf("-l%*.*s", (int)len,
(int)len, next));
next = strrchr(arg->val, '/');
len = next - arg->val;
argument_update(arg, xasprintf("-L%*.*s", (int)len,
(int)len, arg->val));
TAILQ_INSERT_AFTER(args, arg, arg3, link);
continue;
}
if (arg->val[0] != '-')
continue;
if (strcmp(arg->val, "-I") == 0 ||
strcmp(arg->val, "-D") == 0 ||
strcmp(arg->val, "-L") == 0) {
if (arg2 == NULL || arg2->val[0] == '-')
errx(255, "Missing argument for %s", arg->val);
argument_update(arg, concat(arg->val, arg2->val));
argument_unlink(args, &arg2);
continue;
}
if (strcmp(arg->val, "-Wl,-L") == 0) {
if (arg2 == NULL || strncmp(arg2->val, "-Wl,", 4))
errx(255, "Missing argument for %s", arg->val);
argument_update(arg, concat("-L", arg2->val + 4));
argument_unlink(args, &arg2);
continue;
}
if (strcmp(arg->val, "-Wl,-rpath-link") == 0) {
if (arg2 == NULL || strncmp(arg2->val, "-Wl,", 4))
errx(255, "Missing argument for %s", arg->val);
normalise_path_list(args, arg, "-Wl,-rpath-link,",
arg2->val + 4, 0);
argument_unlink(args, &arg);
argument_unlink(args, &arg2);
continue;
}
if (strcmp(arg->val, "-R") == 0) {
if (arg2 == NULL || arg2->val[0] == '-')
errx(255, "Missing argument for %s", arg->val);
normalise_path_list(args, arg, "-Wl,-rpath,",
arg2->val, 1);
argument_unlink(args, &arg);
argument_unlink(args, &arg2);
continue;
}
if (strcmp(arg->val, "-Wl,-R") == 0 ||
strcmp(arg->val, "-Wl,-rpath") == 0 ||
strcmp(arg->val, "-Wl,--rpath") == 0) {
if (arg2 == NULL || strncmp(arg2->val, "-Wl,", 4))
errx(255, "Missing argument for %s", arg->val);
normalise_path_list(args, arg, "-Wl,-rpath,",
arg2->val + 4, 1);
argument_unlink(args, &arg);
argument_unlink(args, &arg2);
continue;
}
if (strncmp(arg->val, "-Wl,-R", 6) == 0) {
normalise_path_list(args, arg, "-Wl,-rpath,",
arg->val + 6, 1);
argument_unlink(args, &arg);
continue;
}
if (strncmp(arg->val, "-R", 2) == 0) {
normalise_path_list(args, arg, "-Wl,-rpath,",
arg->val + 2, 1);
argument_unlink(args, &arg);
continue;
}
if (strncmp(arg->val, "-Wl,-rpath,", 10) == 0) {
normalise_path_list(args, arg, "-Wl,-rpath,",
arg->val + 10, 1);
argument_unlink(args, &arg);
continue;
}
}
}

View File

@@ -0,0 +1,68 @@
/* $NetBSD: normalise-ld.c,v 1.1 2014/09/17 12:40:56 joerg Exp $ */
/*-
* Copyright (c) 2009 Joerg Sonnenberger <joerg@NetBSD.org>.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <err.h>
#include <stdlib.h>
#include <string.h>
#include "common.h"
void
normalise_ld(struct arglist *args)
{
struct argument *arg, *arg2, *arg3;
TAILQ_FOREACH_SAFE(arg, args, link, arg2) {
if (arg->val[0] != '-')
continue;
if (strncmp(arg->val, "-Wl,", 4) == 0)
argument_update(arg, xstrdup(arg->val + 4));
if (strcmp(arg->val, "-L") == 0) {
if (arg2 == NULL || arg2->val[0] == '-')
errx(255, "Missing argument for %s", arg->val);
argument_update(arg, concat(arg->val, arg2->val));
continue;
}
if (strcmp(arg->val, "-R") == 0 ||
strcmp(arg->val, "--rpath") == 0) {
if (arg2 == NULL || arg2->val[0] == '-')
errx(255, "Missing argument for %s", arg->val);
argument_update(arg, xstrdup("-rpath"));
continue;
}
if (strncmp(arg->val, "-R", 2) == 0) {
argument_update(arg, xstrdup(arg->val + 2));
arg3 = argument_copy("-rpath");
TAILQ_INSERT_BEFORE(arg, arg3, link);
continue;
}
}
}

View File

@@ -0,0 +1,108 @@
/* $NetBSD: reorder-cc.c,v 1.1 2014/09/17 12:40:56 joerg Exp $ */
/*-
* Copyright (c) 2009 Joerg Sonnenberger <joerg@NetBSD.org>.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <err.h>
#include <stdlib.h>
#include <string.h>
#include "common.h"
struct reorder_rule {
TAILQ_ENTRY(reorder_rule) link;
char *lib;
char *lib2;
};
static TAILQ_HEAD(, reorder_rule) reorder_rules =
TAILQ_HEAD_INITIALIZER(reorder_rules);
void
register_reorder(const char *rule)
{
struct reorder_rule *r;
const char *orig_rule = rule;
size_t len;
if (strncmp(rule, "l:", 2))
goto failed;
rule += 2;
r = xmalloc(sizeof(*r));
len = strspn(rule, library_name_chars);
if (len == 0)
goto failed;
r->lib = concat2("-l", rule, len);
rule +=len;
if (*rule != ':')
goto failed;
++rule;
len = strspn(rule, library_name_chars);
if (len == 0 || rule[len] != '\0')
goto failed;
r->lib2 = concat2("-l", rule, len);
TAILQ_INSERT_TAIL(&reorder_rules, r, link);
return;
failed:
errx(255, "Invalid reorder rule: %s", orig_rule);
}
void
reorder_cc(struct arglist *args)
{
struct reorder_rule *rule;
struct argument *arg, *arg2, *arg3;
struct arglist matches;
TAILQ_FOREACH(rule, &reorder_rules, link) {
TAILQ_INIT(&matches);
TAILQ_FOREACH(arg, args, link) {
if (strcmp(arg->val, rule->lib2) == 0)
break;
if (strcmp(arg->val, rule->lib) == 0)
TAILQ_INSERT_TAIL(&matches, arg, tmp_link);
}
if (arg == NULL || (arg3 = TAILQ_FIRST(&matches)) == NULL)
continue;
TAILQ_REMOVE(args, arg3, link);
TAILQ_INSERT_AFTER(args, arg, arg3, link);
TAILQ_REMOVE(&matches, arg3, tmp_link);
TAILQ_FOREACH_SAFE(arg, &matches, tmp_link, arg2)
argument_unlink(args, &arg);
}
}

View File

@@ -0,0 +1,94 @@
#!/usr/bin/awk -f
BEGIN {
cur_fixed = 0
cur_variable = 0
}
/^#/ { next }
/^[[:space:]]*$/ { next }
{
if ($2 == "") {
f = "transform_pass"
a = "NULL"
if (NF > 1) {
print "Too many fields for pass rule"
exit 1
}
} else if ($2 == "==>") {
f = "transform_replace"
a = "\"" $3 "\""
if (a == "") {
print "Missing argument in line ", FNR
exit 1
}
if (NF > 3) {
print "Too many fields for replace rule"
exit 1
}
} else if ($2 == "==!") {
f = "transform_pass_with_warning"
a = "NULL"
if (NF > 2) {
print "Too many fields for warning rule"
exit 1
}
} else if ($2 == "==|") {
f = "transform_discard"
a = "NULL"
if (NF > 2) {
print "Too many fields for discard rule"
exit 1
}
} else {
print "Unsupported transformation type"
exit 1
}
if ($1 ~ /\*$/) {
$1 = substr($1, 1, length($1) - 1)
variable_transforms[cur_variable++] = \
sprintf("{ \"%s\", %d, %s, %s }", $1, length($1), f, a)
} else {
fixed_transforms[cur_fixed] = \
sprintf("{ \"%s\", %d, %s, %s }", $1, length($1), f, a)
fixed_keys[cur_fixed++] = $1
}
}
END {
print ARGV[1]
ruleset = ARGV[1]
fname = "transform_cc_fixed"
output_c1 = ruleset "-fixed1.c"
output_c2 = ruleset "-fixed2.c"
output_c = ruleset "-fixed.c"
output_map = ruleset "-fixed.map"
nbperf = sprintf("nbperf -s -n %s -a chm -o %s -m %s",
fname, output_c1, output_map)
for (i = 0; i < cur_fixed; ++i)
print fixed_keys[i] | nbperf
close(nbperf)
for (i = 0; i < cur_fixed; ++i) {
getline out < output_map
fixed_order[out] = i
}
close(output_map)
print "" > output_c2
print "static struct transformation fixed_transforms[] = {" > output_c2
for (i = 0; i < cur_fixed; ++i) {
j = fixed_order[i]
print "\t" fixed_transforms[j] "," > output_c2
}
print "};" > output_c2
print "" > output_c2
print "static struct transformation var_transforms[] = {" > output_c2
for (i = 0; i < cur_variable; ++i) {
print "\t" variable_transforms[i] "," > output_c2
}
print "\t{ NULL, 0, NULL, NULL }," > output_c2
print "};" > output_c2
close(output_c2)
system(sprintf("cat %s %s > %s", output_c1, output_c2, output))
}

View File

@@ -0,0 +1,4 @@
#define WRAPPER_SHLIBTOOL
#define WRAPPER_NAME "shlibtool"
#include "base-wrapper.c"

View File

@@ -0,0 +1,112 @@
/* $NetBSD: transform-cc.c,v 1.1 2014/09/17 12:40:56 joerg Exp $ */
/*-
* Copyright (c) 2009 Joerg Sonnenberger <joerg@NetBSD.org>.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <err.h>
#include <string.h>
#include "common.h"
struct transformation {
const char *pattern;
size_t len;
struct argument *(*transform)(struct arglist *, struct argument *,
const char *);
const char *opt;
};
static struct argument *transform_pass(struct arglist *,
struct argument *, const char *);
static struct argument *transform_pass_with_warning(struct arglist *,
struct argument *, const char *);
static struct argument *transform_discard(struct arglist *,
struct argument *, const char *);
static struct argument *transform_replace(struct arglist *,
struct argument *, const char *);
#include "transform-gcc.c"
static struct argument *
transform_pass(struct arglist *args, struct argument *arg, const char *opt)
{
return TAILQ_NEXT(arg, link);
}
static struct argument *
transform_pass_with_warning(struct arglist *args, struct argument *arg,
const char *opt)
{
warnx("Unsupported option: %s", arg->val);
return TAILQ_NEXT(arg, link);
}
static struct argument *
transform_discard(struct arglist *args, struct argument *arg, const char *opt)
{
argument_unlink(args, &arg);
return arg;
}
static struct argument *
transform_replace(struct arglist *args, struct argument *arg, const char *opt)
{
argument_update(arg, xstrdup(opt));
return TAILQ_NEXT(arg, link);
}
void
transform_cc(struct arglist *args)
{
struct argument *arg, *arg2;
size_t len;
struct transformation *t;
TAILQ_FOREACH_SAFE(arg, args, link, arg2) {
if (arg->val[0] != '-')
continue;
len = strlen(arg->val);
t = fixed_transforms + transform_cc_fixed(arg->val, len);
if (t->len == len && strcmp(t->pattern, arg->val) == 0) {
arg2 = (*t->transform)(args, arg, t->opt);
continue;
}
for (t = var_transforms; t->pattern != NULL; ++t) {
if (t->len > len &&
strncmp(t->pattern, arg->val, t->len) == 0)
break;
}
if (t->pattern != NULL) {
arg2 = (*t->transform)(args, arg, t->opt);
continue;
}
}
}

View File

@@ -0,0 +1,173 @@
# $NetBSD: transform-gcc-rules,v 1.3 2015/03/18 15:01:21 joerg Exp $
#
# Copyright (c) 2009 Joerg Sonnenberger <joerg@NetBSD.org>.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
# Lines starting with # are comments.
# Single word options are options to pass.
# "foo ==|" means that option "foo" should be discarded.
# "foo ==!" means that option "foo" should be passed, but give a warning.
# "foo ==> bar" means that "foo" should be translated into "bar".
#
# Common compiler options
-D*
-E
-I*
-L*
-O
-O0
-O1
-U*
-c
-g
-o
-s
# Used by GNU configure scripts
-V
-v
--version
# GCC extensions
-
-dynamic
-export-dynamic
-falign-functions=*
-falign-loops=*
-falign-jumps=*
-fexpensive-options
-ffast-math
-ffloat-store
-finline-functions
-fno-builtin
-fno-builtin-*
-fno-common
-fno-implicit-templates
-fno-inline-functions
-fno-strict-aliasing
-fomit-frame-pointer
-fPIC
-fpic
-fpcc-struct-return
-freg-struct-return
-fsigned-char
-funroll-loops
-funsigned-char
-ggdb
-M
-MD
-MF
-MM
-MMD
-MP
-MT
-m32
-m64
-mabi=*
-march=*
-mcpu=*
-mieee-fp
-O2
-O3
-Os
-pedantic
-pedantic-errors
-pipe
-pthread
-print-prog-name=*
-print-search-dirs
-S
-shared
-static
-std=c99
-std=gnu89
-std=gnu99
-W
-WL,*
-WS,*
-Wall
-Wc,*
-Wcast-align
-Wcast-qual
-Wchar-subscripts
-Wconversion
-Wextra
-Werror
-Werror-implicit-function-declaration
-Wformat=0
-Wformat=1
-Wformat=2
-Wl,*
-Wmissing-declarations
-Wmissing-format-attribute
-Wmissing-prototypes
-Wnested-externs
-Wno-error
-Wno-format-y2k
-Wno-format-zero-length
-Wno-implicit-int
-Wno-import
-Wno-inline
-Wno-long-long
-Wno-sign-compare
-Wno-traditional
-Wno-undef
-Wno-uninitialized
-Wno-unused
-Wno-unused-parameter
-Wno-write-strings
-Wparentheses
-Wpointer-arith
-Wreturn-type
-Wshadow
-Wsign-compare
-Wstrict-aliasing
-Wstrict-prototypes
-Wswitch
-Wunused
-Wundef
-Wwrite-strings
# Do not suppress warnings
-w ==|
# Options specific to g++
-fexceptions
-fmessage-length=*
-fno-check-new
-fno-exceptions
-fno-rtti
-ftemplate-depth=*
-Wno-non-virtual-dtor
# Options specific to Objective C
-fconstant-string-class=*
-fgnu-runtime
# Solaris compilers used this for threading
-mt ==|
# Compatibility with other compilers
-Kpic ==> -fPIC
-kpic ==> -fPIC
-KPIC ==> -fPIC
-kPIC ==> -fPIC
-64 ==> -m64
-* ==!

View File

@@ -0,0 +1,172 @@
#include <stdlib.h>
static uint32_t
transform_cc_fixed(const void * __restrict key, size_t keylen)
{
static const uint8_t g[221] = {
0x00, 0x28, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05,
0x60, 0x29, 0x63, 0x10, 0x00, 0x2c, 0x57, 0x0e, 0x26, 0x00,
0x2c, 0x00, 0x2a, 0x00, 0x2d, 0x00, 0x00, 0x67, 0x2e, 0x00,
0x00, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x1b, 0x4e, 0x00,
0x00, 0x00, 0x00, 0x1c, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00,
0x21, 0x55, 0x0b, 0x20, 0x00, 0x46, 0x00, 0x00, 0x4d, 0x3e,
0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4c, 0x5f, 0x22, 0x00,
0x42, 0x58, 0x14, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x41, 0x07,
0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x00, 0x55, 0x00,
0x42, 0x00, 0x00, 0x40, 0x04, 0x4e, 0x09, 0x00, 0x00, 0x00,
0x42, 0x67, 0x00, 0x20, 0x34, 0x68, 0x39, 0x00, 0x69, 0x00,
0x00, 0x00, 0x00, 0x21, 0x00, 0x31, 0x17, 0x00, 0x00, 0x3d,
0x38, 0x5b, 0x00, 0x61, 0x00, 0x55, 0x00, 0x00, 0x3b, 0x4b,
0x55, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0x44,
0x00, 0x6d, 0x00, 0x5c, 0x06, 0x3e, 0x00, 0x4d, 0x45, 0x59,
0x39, 0x2c, 0x00, 0x45, 0x00, 0x00, 0x6d, 0x00, 0x0b, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x63,
0x00, 0x34, 0x00, 0x00, 0x00, 0x00, 0x1d, 0x00, 0x1a, 0x5f,
0x1e, 0x00, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x57, 0x2a,
0x5f, 0x38, 0x5a, 0x00, 0x08, 0x2f, 0x30, 0x00, 0x00, 0x64,
0x18, 0x00, 0x51, 0x20, 0x00, 0x0d, 0x00, 0x55, 0x18, 0x15,
0x48, 0x00, 0x00, 0x4f, 0x37, 0x58, 0x00, 0x62, 0x1d, 0x00,
0x05,
};
uint32_t h[3];
mi_vector_hash(key, keylen, 0x327b23c6U, h);
return (g[h[0] % 221] + g[h[1] % 221]) % 110;
}
static struct transformation fixed_transforms[] = {
{ "-E", 2, transform_pass, NULL },
{ "-O", 2, transform_pass, NULL },
{ "-O0", 3, transform_pass, NULL },
{ "-O1", 3, transform_pass, NULL },
{ "-c", 2, transform_pass, NULL },
{ "-g", 2, transform_pass, NULL },
{ "-o", 2, transform_pass, NULL },
{ "-s", 2, transform_pass, NULL },
{ "-V", 2, transform_pass, NULL },
{ "-v", 2, transform_pass, NULL },
{ "--version", 9, transform_pass, NULL },
{ "-", 1, transform_pass, NULL },
{ "-dynamic", 8, transform_pass, NULL },
{ "-export-dynamic", 15, transform_pass, NULL },
{ "-fexpensive-options", 19, transform_pass, NULL },
{ "-ffast-math", 11, transform_pass, NULL },
{ "-ffloat-store", 13, transform_pass, NULL },
{ "-finline-functions", 18, transform_pass, NULL },
{ "-fno-builtin", 12, transform_pass, NULL },
{ "-fno-common", 11, transform_pass, NULL },
{ "-fno-implicit-templates", 23, transform_pass, NULL },
{ "-fno-inline-functions", 21, transform_pass, NULL },
{ "-fno-strict-aliasing", 20, transform_pass, NULL },
{ "-fomit-frame-pointer", 20, transform_pass, NULL },
{ "-fPIC", 5, transform_pass, NULL },
{ "-fpic", 5, transform_pass, NULL },
{ "-fpcc-struct-return", 19, transform_pass, NULL },
{ "-freg-struct-return", 19, transform_pass, NULL },
{ "-fsigned-char", 13, transform_pass, NULL },
{ "-funroll-loops", 14, transform_pass, NULL },
{ "-funsigned-char", 15, transform_pass, NULL },
{ "-ggdb", 5, transform_pass, NULL },
{ "-M", 2, transform_pass, NULL },
{ "-MD", 3, transform_pass, NULL },
{ "-MF", 3, transform_pass, NULL },
{ "-MM", 3, transform_pass, NULL },
{ "-MMD", 4, transform_pass, NULL },
{ "-MP", 3, transform_pass, NULL },
{ "-MT", 3, transform_pass, NULL },
{ "-m32", 4, transform_pass, NULL },
{ "-m64", 4, transform_pass, NULL },
{ "-mieee-fp", 9, transform_pass, NULL },
{ "-O2", 3, transform_pass, NULL },
{ "-O3", 3, transform_pass, NULL },
{ "-Os", 3, transform_pass, NULL },
{ "-pedantic", 9, transform_pass, NULL },
{ "-pedantic-errors", 16, transform_pass, NULL },
{ "-pipe", 5, transform_pass, NULL },
{ "-pthread", 8, transform_pass, NULL },
{ "-print-search-dirs", 18, transform_pass, NULL },
{ "-S", 2, transform_pass, NULL },
{ "-shared", 7, transform_pass, NULL },
{ "-static", 7, transform_pass, NULL },
{ "-std=c99", 8, transform_pass, NULL },
{ "-std=gnu89", 10, transform_pass, NULL },
{ "-std=gnu99", 10, transform_pass, NULL },
{ "-W", 2, transform_pass, NULL },
{ "-Wall", 5, transform_pass, NULL },
{ "-Wcast-align", 12, transform_pass, NULL },
{ "-Wcast-qual", 11, transform_pass, NULL },
{ "-Wchar-subscripts", 17, transform_pass, NULL },
{ "-Wconversion", 12, transform_pass, NULL },
{ "-Wextra", 7, transform_pass, NULL },
{ "-Werror", 7, transform_pass, NULL },
{ "-Werror-implicit-function-declaration", 37, transform_pass, NULL },
{ "-Wformat=0", 10, transform_pass, NULL },
{ "-Wformat=1", 10, transform_pass, NULL },
{ "-Wformat=2", 10, transform_pass, NULL },
{ "-Wmissing-declarations", 22, transform_pass, NULL },
{ "-Wmissing-format-attribute", 26, transform_pass, NULL },
{ "-Wmissing-prototypes", 20, transform_pass, NULL },
{ "-Wnested-externs", 16, transform_pass, NULL },
{ "-Wno-error", 10, transform_pass, NULL },
{ "-Wno-format-y2k", 15, transform_pass, NULL },
{ "-Wno-format-zero-length", 23, transform_pass, NULL },
{ "-Wno-implicit-int", 17, transform_pass, NULL },
{ "-Wno-import", 11, transform_pass, NULL },
{ "-Wno-inline", 11, transform_pass, NULL },
{ "-Wno-long-long", 14, transform_pass, NULL },
{ "-Wno-sign-compare", 17, transform_pass, NULL },
{ "-Wno-traditional", 16, transform_pass, NULL },
{ "-Wno-undef", 10, transform_pass, NULL },
{ "-Wno-uninitialized", 18, transform_pass, NULL },
{ "-Wno-unused", 11, transform_pass, NULL },
{ "-Wno-unused-parameter", 21, transform_pass, NULL },
{ "-Wno-write-strings", 18, transform_pass, NULL },
{ "-Wparentheses", 13, transform_pass, NULL },
{ "-Wpointer-arith", 15, transform_pass, NULL },
{ "-Wreturn-type", 13, transform_pass, NULL },
{ "-Wshadow", 8, transform_pass, NULL },
{ "-Wsign-compare", 14, transform_pass, NULL },
{ "-Wstrict-aliasing", 17, transform_pass, NULL },
{ "-Wstrict-prototypes", 19, transform_pass, NULL },
{ "-Wswitch", 8, transform_pass, NULL },
{ "-Wunused", 8, transform_pass, NULL },
{ "-Wundef", 7, transform_pass, NULL },
{ "-Wwrite-strings", 15, transform_pass, NULL },
{ "-w", 2, transform_discard, NULL },
{ "-fexceptions", 12, transform_pass, NULL },
{ "-fno-check-new", 14, transform_pass, NULL },
{ "-fno-exceptions", 15, transform_pass, NULL },
{ "-fno-rtti", 9, transform_pass, NULL },
{ "-Wno-non-virtual-dtor", 21, transform_pass, NULL },
{ "-fgnu-runtime", 13, transform_pass, NULL },
{ "-mt", 3, transform_discard, NULL },
{ "-Kpic", 5, transform_replace, "-fPIC" },
{ "-kpic", 5, transform_replace, "-fPIC" },
{ "-KPIC", 5, transform_replace, "-fPIC" },
{ "-kPIC", 5, transform_replace, "-fPIC" },
{ "-64", 3, transform_replace, "-m64" },
};
static struct transformation var_transforms[] = {
{ "-D", 2, transform_pass, NULL },
{ "-I", 2, transform_pass, NULL },
{ "-L", 2, transform_pass, NULL },
{ "-U", 2, transform_pass, NULL },
{ "-falign-functions=", 18, transform_pass, NULL },
{ "-falign-loops=", 14, transform_pass, NULL },
{ "-falign-jumps=", 14, transform_pass, NULL },
{ "-fno-builtin-", 13, transform_pass, NULL },
{ "-mabi=", 6, transform_pass, NULL },
{ "-march=", 7, transform_pass, NULL },
{ "-mcpu=", 6, transform_pass, NULL },
{ "-print-prog-name=", 17, transform_pass, NULL },
{ "-WL,", 4, transform_pass, NULL },
{ "-WS,", 4, transform_pass, NULL },
{ "-Wc,", 4, transform_pass, NULL },
{ "-Wl,", 4, transform_pass, NULL },
{ "-fmessage-length=", 17, transform_pass, NULL },
{ "-ftemplate-depth=", 17, transform_pass, NULL },
{ "-fconstant-string-class=", 24, transform_pass, NULL },
{ "-", 1, transform_pass_with_warning, NULL },
{ NULL, 0, NULL, NULL },
};

View File

@@ -0,0 +1,16 @@
$NetBSD: cleanup.txt,v 1.1 2014/09/17 12:40:56 joerg Exp $
The second phase of wrapper processing for cc-ish wrappers is removal of
broken or redundant arguments. This helps platforms with small argv
limit. The cleanup phase is repeated after all other transformations
are done.
Transformations done in this phase:
1. Remove rpath options with relative path. This is just a bug and they
should never end up in the final binary. -Wl,-rpath-link is not dropped
as it only affects the linker.
2. Unify consecutive identical -l options.
3. Drop duplicate -I, -L, -Wl,-rpath and -Wl,-rpath-link.

View File

@@ -0,0 +1,28 @@
$NetBSD: configuration.txt,v 1.2 2014/11/27 20:36:43 joerg Exp $
The configuration of the wrapper framework depends on two variables.
The environment variable CWRAPPERS_CONFIG_DIR points to a directory
with one configuration file per wrapper.
The configuration file consists of simple key=value pairs. It is
case-sensitive and all spaces are considered part of the value.
Lists of keys:
worklog: Name of logfile to append to.
exec: Name of the target command to exec(2).
path: Override current value of the environmental variable PATH before
calling the wrappee.
reorder: Specify a reorder rule. See reorder.txt for the details.
transform: Specify a transformation rule. See generic-transform.txt for
the details.
prepend: Prepend an option directly after logging the original command.
The options are inserted in the order of the config file.
append: Append an option directly after logging the original command.
The options are inserted in the order of the config file.

View File

@@ -0,0 +1 @@
XXX libtool-fix-la

View File

@@ -0,0 +1,6 @@
Like generic-transform.txt with the following changes:
1. No processing of -I.
2. Instead of "-Wl,-rpath,foo" and "-Wl,-rpath-link,foo", "-rpath foo"
and "-rpath-link foo" are used.

View File

@@ -0,0 +1,40 @@
$NetBSD: generic-transform.txt,v 1.2 2015/03/15 19:16:45 joerg Exp $
The third phase of the wrapper processing is the general transformation
phase. This phase is the core of the wrapper framework and implements
the visibility transformations.
Transformations done in this phase:
1. All opt:src:dst and rm:src rules are matched against the argument. If
there is a match and it was a rm:src rule or a opt:src: rule without
dst, it is removed. Otherwise it is replaced with dst. The order in which
rules are matched is unspecified.
2. -I, -Wl,-rpath and -L options with a relative path are skipped.
3. For the remaining -I, -Wl,-rpath and -L options a corresponding
transform rule (transform=I:src:dst, transform=R:src:dst,
transform=L:src:dst) rule is searched for, so that the path is equal to
or below src. Trailing '/' are ignored for this search. If src ends
with a '/', path must be equal to src. If this is a -Wl,-rpath option
and the path ends in /.libs, it is assume be to handled by libtool
internally and implicitly allowed. If no such rule is found or dst is
empty, the argument is dropped. Otherwise the src part of the path name
is replaced with dst. No further transformation is done for this
argument in this phase.
4. libtool/shlibtool wrapper only:
For -l options search for the matching libtool archive, e.g. for -ldst
look for libdst.la in the include search path.
5. For -l options a corresponding transform rule
(transform=l:src:dst[:dst2...]) is searched for. If such a rule exists
(e.g. the option is -lsrc), it will be replaced with -ldst [-ldst2...].
No further transformation is done for this argument in this phase.
6. libtool/shlibtool wrapper only:
For absolute path names as options search for a corresponding
transform rule (transform=P:src:dst) to translate libfoo.a and libfoo.la
below the directory src into a path with src replaced by dst.
No further transformation is done for this argument in this phase.

View File

@@ -0,0 +1,21 @@
$NetBSD: normalise-ld.txt,v 1.1 2014/09/17 12:40:56 joerg Exp $
The first phase of wrapper processing for ld-ish wrappers is argument
normalisation. This simplifies processing in latter steps.
Transformations done in this phase:
1. Empty arguments are suppressed.
2. Arguments of the "-Wl,foo" are converted to "foo".
3. Arguments of the form "-L foo" are converted to the single argument
form "-Lfoo".
7. Arguments of the form "-Rfoo", "-R foo" or "--rpath foo" are converted
to the form "-rpath foo".
8. Full path names that end up in
"/lib([a-zA-Z0-9_-])*\.s[ol](\.[0-9][^/]*)$ are replaced by "-Ldir -l\1"
with "dir" being the base name of the argument. This is not done for
arguments to -o, --dynamic-linker or -Wl,--dynamic-linker.

View File

@@ -0,0 +1,32 @@
$NetBSD: normalise.txt,v 1.1 2014/09/17 12:40:56 joerg Exp $
The first phase of wrapper processing for cc-ish wrappers is argument
normalisation. This simplifies processing in latter steps.
Transformations done in this phase:
1. Empty arguments are suppressed.
2. Arguments of the form "-Xlinker -Wl,foo" are converted to "-Wl,foo".
All other arguments of the form "-Xlinker foo" are converted to "-Wl,foo".
3. Arguments of the form "-Wl,*,*" are split into separate -Wl options.
4. Arguments of the form "-I foo", "-D foo", "-L foo" or
"-Wl,-L -Wl,foo" are converted to the single argument form "-Ifoo",
"-Dfoo", "-Lfoo" and "-Wl,-Lfoo" respectively.
5. Arguments of the form "-Wl,-L,foo" are converted to "-Lfoo".
6. Arguments of the form "-Wl,-rpath-link -Wl,foo" are converted to
the single argument form "-Wl,-rpath-link,foo".
7. Arguments of the form "-Rfoo", "-R foo", "-Wl,-Rfoo", "-Wl,-R -Wl,foo",
"-Wl,-rpath -Wl,foo" or "--Wl,-rpath -Wl,foo" are converted to the single
canonical argument form "-Wl,-rpath,foo". All -Wl,-rpath options with relative
path (e.g. not starting with /) are dropped.
8. Full path names that end up in
"/lib([a-zA-Z0-9_-])*\.s[ol](\.[0-9][^/]*)$ are replaced by "-Ldir -l\1"
with "dir" being the base name of the argument. This is not done for
arguments to -o, --dynamic-linker or -Wl,--dynamic-linker.

View File

@@ -0,0 +1,13 @@
$NetBSD: reorder.txt,v 1.1 2014/09/17 12:40:56 joerg Exp $
The fourth phase of the wrapper processing can reorder libraries
according to platform specific dependencies. Each rule has the
form "l:lib1:lib2". It ensures that all -llib1 options before -llib2
are moved directly after the latter.
The rules are processed in order to all arguments at once. Cycle
reorder rules effectively result in the last rule winning.
The reorder rules may interact badly with -Wl,-Bdynamic and
-Wl,-Bstatic. If this options are in use, the correct ordering
should be used without depending on the wrapper.

View File

@@ -0,0 +1,13 @@
$NetBSD: transform.txt,v 1.1 2014/09/17 12:40:56 joerg Exp $
The fifth phase of the wrapper processing is the platform
transformation support. The aim here is to translate GCC
options (and some other compiler frontends) into the options
of the target compiler.
Translations for GCC are:
- Drop "-w"
- Translate "-mt" to "-threads", "-64" to "-m64" and
"-Kpic", "-kpic", "-KPIC" and "-kPIC" to "-fPIC".
It can warn about options during translation as well.

View File

@@ -0,0 +1,42 @@
Mode detection:
-E preprocess-only
-S assembly-only
-c compile-only
--> Consider to drop the various linker options
Cleanup:
- Remove redundant -D options. Should keep -U in mind.
Library path resorting:
- Reorder -l to be after all -L options, duplicate -Wl,-dynamic / -Wl,-static
options in the library list. Should this also take -Wl,-rpath-link into
account?
Scan:
- Append extra_args only if -v is not used
Scan for ld:
- Strip -Wl,
- Silently drop -pthread
Platform specific processing:
- All platforms but Darwin have _USE_RPATH=yes. Shouldn't Darwin just
filter out the rpath rules in a platform specific transformation phase?
Transform:
- opt:foo:bar: Replace all options matching foo with bar. foo might be
fnmatch expression. Earlier than other transformations. If bar is empty,
option is dropped.
Libtool:
- Drop -L, -l, -Wl,* if not in link mode
-> see first point

View File

@@ -0,0 +1,29 @@
# $NetBSD: Makefile,v 1.1 2014/09/17 12:40:56 joerg Exp $
#
.SUFFIXES: .sh .atf
.sh.atf: setup_common.sh
atf-compile -o ${.TARGET} ${.IMPSRC}
TESTS!= echo test-*.sh
TESTFILES= ${TESTS:S/.sh$/.atf/g}
ALLFILES= Atffile ${TESTFILES}
ATF_REPORT?= atf-report
all: ${ALLFILES}
test: all
atf-run | ${ATF_REPORT}
clean:
rm -f ${ALLFILES}
Atffile:
@echo 'Content-Type: application/X-atf-atffile; version="1"' > Atffile
@echo >> Atffile
@echo 'prop: test-suite = "regress-buildlink-transform"' >> Atffile
@echo >> Atffile
. for i in ${TESTFILES}
@echo "tp: ${i}" >> Atffile
. endfor

View File

@@ -0,0 +1,5 @@
* Set CWRAPPERS_CONFIG_DIR to a test location, then look at work.log.
* Hook in these old GSoC pkgsrc/pkgtools/wrapper tests.
* Convert them to atf-c-api(3).
* Add more tests for the rules described in doc/{cleanup,normalise}.txt.
* When implementing new behaviors, write accompanying tests -- ideally, first!

View File

@@ -0,0 +1,25 @@
wrapper_test_setup() {
local _wrappee
_wrappee=$1; shift
# variables available to tests
WRAPPER="$(atf_get_srcdir)/../bin/${_wrappee}-wrapper"
CWRAPPERS_CONFIG_DIR=wrapperconfig; export CWRAPPERS_CONFIG_DIR
mkdir ${CWRAPPERS_CONFIG_DIR}
LOCALBASE=/local/base
BUILDLINK_DIR=/wrksrc/build/link
COMPILER_RPATH_FLAG="-Wl,-R" # or -L on Darwin, or...
# minimal config file for test purposes
cat > ${CWRAPPERS_CONFIG_DIR}/${_wrappee} << EOF
worklog=/dev/null
exec=echo
transform=I:${LOCALBASE}:${BUILDLINK_DIR}
EOF
# plus any requested transforms
while [ $# -gt 0 ]; do
echo "transform=$1" >> ${CWRAPPERS_CONFIG_DIR}/${_wrappee}
shift
done
}

View File

@@ -0,0 +1,45 @@
# $NetBSD: test-include_pkgdir.sh,v 1.1 2014/09/17 12:40:56 joerg Exp $
#
atf_test_case include_pkgdir
include_pkgdir_head() {
atf_set 'descr' 'XXX autoconverted from include-pkgdir.mk'
}
include_pkgdir_body() {
wrapper_test_setup cc
input="-I${LOCALBASE}/include"
echo "-I${BUILDLINK_DIR}/include" > expout
atf-check -s eq:0 -o file:expout -e ignore ${WRAPPER} ${input} \
|| atf_fail 'XXX no reason'
}
atf_test_case include_pkgdir_slashdot
include_pkgdir_slashdot_head() {
atf_set 'descr' 'Checks that trailing /. is elided from includes'
}
include_pkgdir_slashdot_body() {
wrapper_test_setup cc
input="-I${LOCALBASE}/include/."
echo "-I${BUILDLINK_DIR}/include" > expout
atf-check -s eq:0 -o file:expout -e ignore ${WRAPPER} ${input} \
|| atf_fail 'XXX no reason'
}
atf_test_case include_pkgsubdir
include_pkgsubdir_head() {
atf_set 'descr' 'XXX autoconverted from include-pkgsubdir.mk'
}
include_pkgsubdir_body() {
wrapper_test_setup cc
input="-I${LOCALBASE}/include/krb5"
echo "-I${BUILDLINK_DIR}/include/krb5" > expout
atf-check -s eq:0 -o file:expout -e ignore ${WRAPPER} ${input} \
|| atf_fail 'XXX no reason'
}
atf_init_test_cases() {
. $(atf_get_srcdir)/setup_common.sh
atf_add_test_case include_pkgdir
atf_add_test_case include_pkgdir_slashdot
atf_add_test_case include_pkgsubdir
}

View File

@@ -0,0 +1,45 @@
# $NetBSD: test-include_usr_include.sh,v 1.1 2014/09/17 12:40:56 joerg Exp $
#
atf_test_case include_usr_include
include_usr_include_head() {
atf_set 'descr' 'XXX autoconverted from include-usr-include.mk'
}
include_usr_include_body() {
wrapper_test_setup cc
input="-I/usr/include"
echo > expout
atf-check -s eq:0 -o file:expout -e ignore ${WRAPPER} ${input} \
|| atf_fail 'XXX no reason'
}
atf_test_case include_usr_include_slashdot
include_usr_include_slashdot_head() {
atf_set 'descr' 'XXX autoconverted from include-usr-include-slashdot.mk'
}
include_usr_include_slashdot_body() {
wrapper_test_setup cc
input="-I/usr/include/."
echo > expout
atf-check -s eq:0 -o file:expout -e ignore ${WRAPPER} ${input} \
|| atf_fail 'XXX no reason'
}
atf_test_case include_usr_include_subdir
include_usr_include_subdir_head() {
atf_set 'descr' 'XXX autoconverted from include-usr-include-subdir.mk'
}
include_usr_include_subdir_body() {
wrapper_test_setup cc
input="-I/usr/include/krb5"
echo "-I/usr/include/krb5" > expout
atf-check -s eq:0 -o file:expout -e ignore ${WRAPPER} ${input} \
|| atf_fail 'XXX no reason'
}
atf_init_test_cases() {
. $(atf_get_srcdir)/setup_common.sh
atf_add_test_case include_usr_include
atf_add_test_case include_usr_include_slashdot
atf_add_test_case include_usr_include_subdir
}

View File

@@ -0,0 +1,20 @@
# $NetBSD: test-lib_expand.sh,v 1.1 2014/09/17 12:40:56 joerg Exp $
#
atf_test_case lib_expand
lib_expand_head() {
atf_set 'descr' 'Checks that one -llib can be expanded into several'
}
lib_expand_body() {
wrapper_test_setup cc \
l:readline:edit:termcap:m
input="-lreadline -lreadline"
echo "-ledit -ltermcap -lm" > expout
atf-check -s eq:0 -o file:expout -e ignore ${WRAPPER} ${input} \
|| atf_fail 'XXX no reason'
}
atf_init_test_cases() {
. $(atf_get_srcdir)/setup_common.sh
atf_add_test_case lib_expand
}

View File

@@ -0,0 +1,45 @@
# $NetBSD: test-libdir_pkgdir.sh,v 1.1 2014/09/17 12:40:56 joerg Exp $
#
atf_test_case libdir_pkgdir
libdir_pkgdir_head() {
atf_set 'descr' 'XXX autoconverted from libdir-pkgdir.mk'
}
libdir_pkgdir_body() {
wrapper_test_setup cc
input="-L${LOCALBASE}/lib"
echo "-L${BUILDLINK_DIR}/lib" > expout
atf-check -s eq:0 -o file:expout -e ignore ${WRAPPER} ${input} \
|| atf_fail 'XXX no reason'
}
atf_test_case libdir_pkgdir_slashdot
libdir_pkgdir_slashdot_head() {
atf_set 'descr' 'XXX autoconverted from libdir-pkgdir-slashdot.mk'
}
libdir_pkgdir_slashdot_body() {
wrapper_test_setup cc
input="-L${LOCALBASE}/lib/."
echo "-L${BUILDLINK_DIR}/lib" > expout
atf-check -s eq:0 -o file:expout -e ignore ${WRAPPER} ${input} \
|| atf_fail 'XXX no reason'
}
atf_test_case libdir_pkgsubdir
libdir_pkgsubdir_head() {
atf_set 'descr' 'XXX autoconverted from libdir-pkgsubdir.mk'
}
libdir_pkgsubdir_body() {
wrapper_test_setup cc
input="-L${LOCALBASE}/lib/mysql"
echo "-L${BUILDLINK_DIR}/lib/mysql" > expout
atf-check -s eq:0 -o file:expout -e ignore ${WRAPPER} ${input} \
|| atf_fail 'XXX no reason'
}
atf_init_test_cases() {
. $(atf_get_srcdir)/setup_common.sh
atf_add_test_case libdir_pkgdir
atf_add_test_case libdir_pkgdir_slashdot
atf_add_test_case libdir_pkgsubdir
}

View File

@@ -0,0 +1,45 @@
# $NetBSD: test-libdir_usr_lib.sh,v 1.1 2014/09/17 12:40:56 joerg Exp $
#
atf_test_case libdir_usr_lib
libdir_usr_lib_head() {
atf_set 'descr' 'XXX autoconverted from libdir-usr-lib.mk'
}
libdir_usr_lib_body() {
wrapper_test_setup cc
input="-L/usr/lib"
echo > expout
atf-check -s eq:0 -o file:expout -e ignore ${WRAPPER} ${input} \
|| atf_fail 'XXX no reason'
}
atf_test_case libdir_usr_lib_slashdot
libdir_usr_lib_slashdot_head() {
atf_set 'descr' 'XXX autoconverted from libdir-usr-lib-slashdot.mk'
}
libdir_usr_lib_slashdot_body() {
wrapper_test_setup cc
input="-L/usr/lib/."
echo > expout
atf-check -s eq:0 -o file:expout -e ignore ${WRAPPER} ${input} \
|| atf_fail 'XXX no reason'
}
atf_test_case libdir_usr_lib_subdir
libdir_usr_lib_subdir_head() {
atf_set 'descr' 'XXX autoconverted from libdir-usr-lib-subdir.mk'
}
libdir_usr_lib_subdir_body() {
wrapper_test_setup cc
input="-L/usr/lib/i18n"
echo "-L/usr/lib/i18n" > expout
atf-check -s eq:0 -o file:expout -e ignore ${WRAPPER} ${input} \
|| atf_fail 'XXX no reason'
}
atf_init_test_cases() {
. $(atf_get_srcdir)/setup_common.sh
atf_add_test_case libdir_usr_lib
atf_add_test_case libdir_usr_lib_slashdot
atf_add_test_case libdir_usr_lib_subdir
}

View File

@@ -0,0 +1,58 @@
# $NetBSD: test-libpath.sh,v 1.1 2014/09/17 12:40:56 joerg Exp $
#
atf_test_case libpath
libpath_head() {
atf_set 'descr' 'XXX autoconverted from libpath.mk'
}
libpath_body() {
wrapper_test_setup cc
input="${LOCALBASE}/lib/libfoo.la"
echo "${BUILDLINK_DIR}/lib/libfoo.la" > expout
atf-check -s eq:0 -o file:expout -e ignore ${WRAPPER} ${input} \
|| atf_fail 'XXX no reason'
}
atf_test_case libpath_in_define
libpath_in_define_head() {
atf_set 'descr' 'XXX autoconverted from libpath-in-define.mk'
}
libpath_in_define_body() {
wrapper_test_setup cc
input="-DFOO=\"${LOCALBASE}/lib/libfoo.la\""
echo "-DFOO=\"${LOCALBASE}/lib/libfoo.la\"" > expout
atf-check -s eq:0 -o file:expout -e ignore ${WRAPPER} ${input} \
|| atf_fail 'XXX no reason'
}
atf_test_case libpath_shlib
libpath_shlib_head() {
atf_set 'descr' 'XXX autoconverted from libpath-shlib.mk'
}
libpath_shlib_body() {
wrapper_test_setup cc
input="${LOCALBASE}/lib/libfoo.so"
echo "-L${BUILDLINK_DIR}/lib -lfoo" > expout
atf-check -s eq:0 -o file:expout -e ignore ${WRAPPER} ${input} \
|| atf_fail 'XXX no reason'
}
atf_test_case libpath_shmod
libpath_shmod_head() {
atf_set 'descr' 'XXX autoconverted from libpath-shmod.mk'
}
libpath_shmod_body() {
wrapper_test_setup cc
input="${LOCALBASE}/lib/module/foo.so"
echo "${LOCALBASE}/lib/module/foo.so" > expout
atf-check -s eq:0 -o file:expout -e ignore ${WRAPPER} ${input} \
|| atf_fail 'XXX no reason'
}
atf_init_test_cases() {
. $(atf_get_srcdir)/setup_common.sh
atf_add_test_case libpath
atf_add_test_case libpath_in_define
atf_add_test_case libpath_shlib
atf_add_test_case libpath_shmod
}

View File

@@ -0,0 +1,19 @@
# $NetBSD: test-no_abspath.sh,v 1.1 2014/09/17 12:40:56 joerg Exp $
#
atf_test_case no_abspath
no_abspath_head() {
atf_set 'descr' 'XXX autoconverted from no-abspath.mk'
}
no_abspath_body() {
wrapper_test_setup cc
input="-L/bad/path/lib -I/bad/path/include ${COMPILER_RPATH_FLAG}/bad/path/lib"
echo > expout
atf-check -s eq:0 -o file:expout -e ignore ${WRAPPER} ${input} \
|| atf_fail 'XXX no reason'
}
atf_init_test_cases() {
. $(atf_get_srcdir)/setup_common.sh
atf_add_test_case no_abspath
}

View File

@@ -0,0 +1,32 @@
# $NetBSD: test-option.sh,v 1.1 2014/09/17 12:40:56 joerg Exp $
#
atf_test_case preserve_option
preserve_option_head() {
atf_set 'descr' 'XXX autoconverted from preserve-option.mk'
}
preserve_option_body() {
wrapper_test_setup cc
input="-O2ABC"
echo "-O2ABC" > expout
atf-check -s eq:0 -o file:expout -e ignore ${WRAPPER} ${input} \
|| atf_fail 'XXX no reason'
}
atf_test_case remove_option
remove_option_head() {
atf_set 'descr' 'XXX autoconverted from remove-option.mk'
}
remove_option_body() {
wrapper_test_setup cc
input="-O2 -O5 -O9"
echo > expout
atf-check -s eq:0 -o file:expout -e ignore ${WRAPPER} ${input} \
|| atf_fail 'XXX no reason'
}
atf_init_test_cases() {
. $(atf_get_srcdir)/setup_common.sh
atf_add_test_case preserve_option
atf_add_test_case remove_option
}

View File

@@ -0,0 +1,19 @@
# $NetBSD: test-quoted_arg.sh,v 1.1 2014/09/17 12:40:56 joerg Exp $
#
atf_test_case quoted_arg
quoted_arg_head() {
atf_set 'descr' 'Checks that quoted arguments pass unmolested'
}
quoted_arg_body() {
wrapper_test_setup cc
input='-D"DEFAULT_MODULE_PATH=\"${LOCALBASE}/lib/security/\""'
echo "${input}" > expout
atf-check -s eq:0 -o file:expout -e ignore ${WRAPPER} ${input} \
|| atf_fail 'XXX no reason'
}
atf_init_test_cases() {
. $(atf_get_srcdir)/setup_common.sh
atf_add_test_case quoted_arg
}

View File

@@ -0,0 +1,19 @@
# $NetBSD: test-remove_dir.sh,v 1.1 2014/09/17 12:40:56 joerg Exp $
#
atf_test_case remove_dir
remove_dir_head() {
atf_set 'descr' 'Checks that undesirable link/include dirs are removed'
}
remove_dir_body() {
wrapper_test_setup cc
input="-L/opt/schily/lib -I/opt/schily/include"
echo > expout
atf-check -s eq:0 -o file:expout -e ignore ${WRAPPER} ${input} \
|| atf_fail 'XXX no reason'
}
atf_init_test_cases() {
. $(atf_get_srcdir)/setup_common.sh
atf_add_test_case remove_dir
}

View File

@@ -0,0 +1,19 @@
# $NetBSD: test-repeated_arg.sh,v 1.1 2014/09/17 12:40:56 joerg Exp $
#
atf_test_case repeated_arg
repeated_arg_head() {
atf_set 'descr' 'XXX autoconverted from repeated-arg.mk'
}
repeated_arg_body() {
wrapper_test_setup cc
input="-L${LOCALBASE}/lib -L${LOCALBASE}/lib"
echo "-L${BUILDLINK_DIR}/lib" > expout
atf-check -s eq:0 -o file:expout -e ignore ${WRAPPER} ${input} \
|| atf_fail 'XXX no reason'
}
atf_init_test_cases() {
. $(atf_get_srcdir)/setup_common.sh
atf_add_test_case repeated_arg
}

View File

@@ -0,0 +1,26 @@
# $NetBSD: test-rpath_merge.sh,v 1.1 2014/09/17 12:40:56 joerg Exp $
#
atf_test_case rpath_merge
rpath_merge_head() {
atf_set 'descr' 'XXX autoconverted from rpath-merge.mk'
}
rpath_merge_body() {
wrapper_test_setup cc
input="${COMPILER_RPATH_FLAG:S/,$//} -Wl,${LOCALBASE}/lib:${LOCALBASE}/lib/foo"
case "${_USE_RPATH}" in
[yY][eE][sS])
echo "${COMPILER_RPATH_FLAG}${LOCALBASE}/lib ${COMPILER_RPATH_FLAG}${LOCALBASE}/lib/foo" > expout
;;
*)
echo > expout
;;
esac
atf-check -s eq:0 -o file:expout -e ignore ${WRAPPER} ${input} \
|| atf_fail 'XXX no reason'
}
atf_init_test_cases() {
. $(atf_get_srcdir)/setup_common.sh
atf_add_test_case rpath_merge
}

View File

@@ -0,0 +1,66 @@
# $NetBSD: test-rpath_pkgdir.sh,v 1.1 2014/09/17 12:40:56 joerg Exp $
#
atf_test_case rpath_pkgdir
rpath_pkgdir_head() {
atf_set 'descr' 'XXX autoconverted from rpath-pkgdir.mk'
}
rpath_pkgdir_body() {
wrapper_test_setup cc
input="${COMPILER_RPATH_FLAG}${LOCALBASE}/lib"
case "${_USE_RPATH}" in
[yY][eE][sS])
echo "${COMPILER_RPATH_FLAG}${LOCALBASE}/lib" > expout
;;
*)
echo > expout
;;
esac
atf-check -s eq:0 -o file:expout -e ignore ${WRAPPER} ${input} \
|| atf_fail 'XXX no reason'
}
atf_test_case rpath_pkgdir_slashdot
rpath_pkgdir_slashdot_head() {
atf_set 'descr' 'XXX autoconverted from rpath-pkgdir-slashdot.mk'
}
rpath_pkgdir_slashdot_body() {
wrapper_test_setup cc
input="${COMPILER_RPATH_FLAG}${LOCALBASE}/lib/."
case "${_USE_RPATH}" in
[yY][eE][sS])
echo "${COMPILER_RPATH_FLAG}${LOCALBASE}/lib" > expout
;;
*)
echo > expout
;;
esac
atf-check -s eq:0 -o file:expout -e ignore ${WRAPPER} ${input} \
|| atf_fail 'XXX no reason'
}
atf_test_case rpath_pkgsubdir
rpath_pkgsubdir_head() {
atf_set 'descr' 'XXX autoconverted from rpath-pkgsubdir.mk'
}
rpath_pkgsubdir_body() {
wrapper_test_setup cc
input="${COMPILER_RPATH_FLAG}${LOCALBASE}/lib/mysql"
case "${_USE_RPATH}" in
[yY][eE][sS])
echo "${COMPILER_RPATH_FLAG}${LOCALBASE}/lib/mysql" > expout
;;
*)
echo > expout
;;
esac
atf-check -s eq:0 -o file:expout -e ignore ${WRAPPER} ${input} \
|| atf_fail 'XXX no reason'
}
atf_init_test_cases() {
. $(atf_get_srcdir)/setup_common.sh
atf_add_test_case rpath_pkgdir
atf_add_test_case rpath_pkgdir_slashdot
atf_add_test_case rpath_pkgsubdir
}

View File

@@ -0,0 +1,26 @@
# $NetBSD: test-rpath_split.sh,v 1.1 2014/09/17 12:40:56 joerg Exp $
#
atf_test_case rpath_split
rpath_split_head() {
atf_set 'descr' 'XXX autoconverted from rpath-split.mk'
}
rpath_split_body() {
wrapper_test_setup cc
input="${COMPILER_RPATH_FLAG}${LOCALBASE}/lib:${LOCALBASE}/lib/foo"
case "${_USE_RPATH}" in
[yY][eE][sS])
echo "${COMPILER_RPATH_FLAG}${LOCALBASE}/lib ${COMPILER_RPATH_FLAG}${LOCALBASE}/lib/foo" > expout
;;
*)
echo > expout
;;
esac
atf-check -s eq:0 -o file:expout -e ignore ${WRAPPER} ${input} \
|| atf_fail 'XXX no reason'
}
atf_init_test_cases() {
. $(atf_get_srcdir)/setup_common.sh
atf_add_test_case rpath_split
}

View File

@@ -0,0 +1,52 @@
# $NetBSD: test-rpath_usr_lib.sh,v 1.1 2014/09/17 12:40:56 joerg Exp $
#
atf_test_case rpath_usr_lib
rpath_usr_lib_head() {
atf_set 'descr' 'XXX autoconverted from rpath-usr-lib.mk'
}
rpath_usr_lib_body() {
wrapper_test_setup cc
input="${COMPILER_RPATH_FLAG}/usr/lib"
echo > expout
atf-check -s eq:0 -o file:expout -e ignore ${WRAPPER} ${input} \
|| atf_fail 'XXX no reason'
}
atf_test_case rpath_usr_lib_slashdot
rpath_usr_lib_slashdot_head() {
atf_set 'descr' 'XXX autoconverted from rpath-usr-lib-slashdot.mk'
}
rpath_usr_lib_slashdot_body() {
wrapper_test_setup cc
input="${COMPILER_RPATH_FLAG}/usr/lib/."
echo > expout
atf-check -s eq:0 -o file:expout -e ignore ${WRAPPER} ${input} \
|| atf_fail 'XXX no reason'
}
atf_test_case rpath_usr_lib_subdir
rpath_usr_lib_subdir_head() {
atf_set 'descr' 'XXX autoconverted from rpath-usr-lib-subdir.mk'
}
rpath_usr_lib_subdir_body() {
wrapper_test_setup cc
input="${COMPILER_RPATH_FLAG}/usr/lib/i18n"
case "${_USE_RPATH}" in # XXX do we want this?
[yY][eE][sS])
echo "${COMPILER_RPATH_FLAG}/usr/lib/i18n" > expout
;;
*)
echo > expout
;;
esac
atf-check -s eq:0 -o file:expout -e ignore ${WRAPPER} ${input} \
|| atf_fail 'XXX no reason'
}
atf_init_test_cases() {
. $(atf_get_srcdir)/setup_common.sh
atf_add_test_case rpath_usr_lib
atf_add_test_case rpath_usr_lib_slashdot
atf_add_test_case rpath_usr_lib_subdir
}

View File

@@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.60 2014/03/03 03:30:53 obache Exp $
# $NetBSD: Makefile,v 1.61 2014/10/09 14:06:49 wiz Exp $
#
# When adding new digest algorithms, please use rmd160 as the template,
# and bump the VERSION definition.
@@ -11,8 +11,6 @@ HOMEPAGE?= http://www.NetBSD.org/docs/software/packages.html
COMMENT?= Message digest wrapper utility
LICENSE= original-bsd
PKG_INSTALLATION_TYPES= overwrite pkgviews
CHECK_PERMS= no
GNU_CONFIGURE= yes

View File

@@ -1,8 +1,7 @@
# $NetBSD: Makefile,v 1.18 2013/05/16 01:26:08 cheusov Exp $
# $NetBSD: Makefile,v 1.20 2014/08/30 11:15:31 cheusov Exp $
#
DISTNAME= distbb-0.46.0
PKGREVISION= 1
DISTNAME= distbb-0.47.1
CATEGORIES= pkgtools
MASTER_SITES= ftp://ftp.NetBSD.org/pub/NetBSD/misc/cheusov/distbb/ \
http://mova.org/~cheusov/pub/distbb/
@@ -12,7 +11,7 @@ HOMEPAGE= http://mova.org/~cheusov/pub/distbb/
COMMENT= DISTributed Bulk Build tool for pkgsrc
LICENSE= 2-clause-bsd
DEPENDS+= pkg_summary-utils>=0.62.0:../../pkgtools/pkg_summary-utils
DEPENDS+= pkg_summary-utils>=0.65.1:../../pkgtools/pkg_summary-utils
DEPENDS+= paexec>=0.17.0:../../parallel/paexec
DEPENDS+= runawk>=1.1.0:../../lang/runawk
DEPENDS+= pipestatus>=0.6.0:../../devel/pipestatus

View File

@@ -1,6 +1,5 @@
$NetBSD: distinfo,v 1.13 2013/05/16 01:26:08 cheusov Exp $
$NetBSD: distinfo,v 1.15 2014/08/30 11:15:31 cheusov Exp $
SHA1 (distbb-0.46.0.tar.gz) = c11b0c8d0126241361dc596d0f0a314e6ee9c579
RMD160 (distbb-0.46.0.tar.gz) = 32b72085671fadbb50f5da44df9e1f1c0ceae508
Size (distbb-0.46.0.tar.gz) = 51819 bytes
SHA1 (patch-distbb.default.conf.in) = bad9e11ebb3549b6b580ce8236e9a4d1bc321923
SHA1 (distbb-0.47.1.tar.gz) = a444cdd6e93b88fbb00389417c947b1fc5e43097
RMD160 (distbb-0.47.1.tar.gz) = 3f008a80fcf5bc7e6719dcace116e9ce4e648748
Size (distbb-0.47.1.tar.gz) = 52433 bytes

View File

@@ -1,22 +0,0 @@
$NetBSD: patch-distbb.default.conf.in,v 1.1 2013/05/16 01:26:08 cheusov Exp $
--- distbb.default.conf.in.orig 2013-02-02 11:07:48.000000000 +0000
+++ distbb.default.conf.in
@@ -103,7 +103,7 @@ assign PKG_SRC_SUMMARY "$PACKAGES/All/pk
#
# If you want to build short version of src_summary, uncomment the following
# (see pkg_src_summary(1))
-assign PSS_FIELDS 'PKGNAME PKGPATH DEPENDS TARGET_BUILD_DEPENDS BUILD_DEPENDS MAINTAINER HOMEPAGE DESCRIPTION NO_BIN_ON_FTP NO_BIN_ON_CDROM USE_LANGUAGES ALLDISTFILES PKG_FAIL_REASON'
+assign PSS_FIELDS 'PKGNAME PKGPATH DEPENDS TOOL_DEPENDS BUILD_DEPENDS MAINTAINER HOMEPAGE DESCRIPTION NO_BIN_ON_FTP NO_BIN_ON_CDROM USE_LANGUAGES ALLDISTFILES PKG_FAIL_REASON'
#
# For generating an "expanded" PLIST.
# It is useless for distbb but looks very nice ;-)
@@ -128,7 +128,7 @@ assign PSS_FIELDS 'PKGNAME PKGPATH DEPEN
# (-m option is for building multi-variant packages, see pkg_src_summary(1),
# NOTE: -m currently doesn't work when entire pkgsrc tree is built,
# because lots of multi-variant packages have constant PKGBASE )
-assign PKG_UPDATE_SRC_SUMMARY_CMD "@bindir@/pkg_src_summary -bm -A > \"$PKG_SRC_SUMMARY\""
+assign PKG_UPDATE_SRC_SUMMARY_CMD "@bindir@/pkg_src_summary -btm -A > \"$PKG_SRC_SUMMARY\""
# program for comparing pkg_summary(5) for available binaries and
# pkg_src_summary collected from pkgsrc source tree

12
pkgtools/genpkgng/DESCR Normal file
View File

@@ -0,0 +1,12 @@
This is a small utility to generate a FreeBSD pkg binary package
from a pkgsrc binary package. It is invoked simply, using a command
like:
genpkgng ssam-1.9nb1.tgz
and it will convert the pkgsrc binary package to a pkg one:
% ./genpkgng.sh perl-5.18.1nb2.tgz
Converting perl-5.18.1nb2.tgz
-rw-r--r-- 1 agc users 16597860 Apr 24 19:01 perl-5.18.1nb2.txz
%

View File

@@ -0,0 +1,29 @@
# $NetBSD: Makefile,v 1.1.1.1 2014/04/27 00:10:34 agc Exp $
DISTNAME= genpkgng-20140425
CATEGORIES= pkgtools
MASTER_SITES= # empty
DISTFILES= # empty
MAINTAINER= agc@NetBSD.org
HOMEPAGE= http://www.NetBSD.org/
COMMENT= Convert a pkgsrc binary package to a FreeBSD pkg
LICENSE= modified-bsd
AUTO_MKDIRS= yes
SUBST_CLASSES+= mtree
SUBST_STAGE.mtree= pre-configure
SUBST_MESSAGE.mtree= Fix location of MTREE_DIRS file
SUBST_FILES.mtree= genpkgng.sh
SUBST_SED.mtree= -e 's|@MTREE_DIR_DIR@|${PREFIX}/libdata/genpkgng|'
do-extract:
${CP} -R ${FILESDIR} ${WRKSRC}
do-install:
${INSTALL_SCRIPT} ${WRKSRC}/genpkgng ${DESTDIR}${PREFIX}/bin
${INSTALL_DATA} ${WRKSRC}/MTREE_DIRS ${DESTDIR}${PREFIX}/libdata/genpkgng/
${INSTALL_MAN} ${WRKSRC}/genpkgng.1 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1/
.include "../../mk/bsd.pkg.mk"

4
pkgtools/genpkgng/PLIST Normal file
View File

@@ -0,0 +1,4 @@
@comment $NetBSD: PLIST,v 1.1.1.1 2014/04/27 00:10:34 agc Exp $
bin/genpkgng
libdata/genpkgng/MTREE_DIRS
man/man1/genpkgng.1

View File

@@ -0,0 +1 @@
$NetBSD: distinfo,v 1.1.1.1 2014/04/27 00:10:34 agc Exp $

View File

@@ -0,0 +1,961 @@
#mtree
# $FreeBSD: /tmp/pcvs/ports/Templates/BSD.local.dist,v 1.3 2010-11-12 20:57:14 pav Exp $
#
# Please see the file src/etc/mtree/README before making changes to this file.
#
/set type=dir uname=root gname=wheel mode=0755
.
bin
..
etc
devd
..
man.d
..
pam.d
..
rc.d
..
..
include
X11
..
..
info
..
lib
X11
app-defaults
..
fonts
local
..
..
..
..
libdata
ldconfig
..
ldconfig32
..
pkgconfig
..
..
libexec
..
man
/set uname=man
cat1
..
cat2
..
cat3
..
cat4
..
cat5
..
cat6
..
cat7
..
cat8
..
cat9
..
catl
..
catn
..
de.ISO8859-1 uname=root
cat1
..
cat2
..
cat3
..
cat4
..
cat5
..
cat6
..
cat7
..
cat8
..
cat9
..
catl
..
catn
..
/set uname=root
man1
..
man2
..
man3
..
man4
..
man5
..
man6
..
man7
..
man8
..
man9
..
manl
..
mann
..
..
en.ISO8859-1
/set uname=man
cat1
..
cat1aout
..
cat2
..
cat3
..
cat4
i386
..
..
cat5
..
cat6
..
cat7
..
cat8
i386
..
..
cat9
i386
..
..
catn
..
..
ja uname=root
cat1
..
cat2
..
cat3
..
cat4
..
cat5
..
cat6
..
cat7
..
cat8
..
cat9
..
catl
..
catn
..
/set uname=root
man1
..
man2
..
man3
..
man4
..
man5
..
man6
..
man7
..
man8
..
man9
..
manl
..
mann
..
..
man1
..
man2
..
man3
..
man4
..
man5
..
man6
..
man7
..
man8
..
man9
..
manl
..
mann
..
ru.KOI8-R
/set uname=man
cat1
..
cat2
..
cat3
..
cat4
..
cat5
..
cat6
..
cat7
..
cat8
..
cat9
..
catl
..
catn
..
/set uname=root
man1
..
man2
..
man3
..
man4
..
man5
..
man6
..
man7
..
man8
..
man9
..
manl
..
mann
..
..
..
sbin
..
share
aclocal
..
applications
..
dict
..
doc
ja
..
..
emacs
site-lisp
..
..
examples
..
java
classes
..
..
locale
af
LC_MESSAGES
..
..
am
LC_MESSAGES
..
..
ar
LC_MESSAGES
..
..
az
LC_MESSAGES
..
..
be
LC_MESSAGES
..
..
bg
LC_MESSAGES
..
..
bn
LC_MESSAGES
..
..
br
LC_MESSAGES
..
..
bs
LC_MESSAGES
..
..
ca
LC_MESSAGES
..
..
cs
LC_MESSAGES
..
..
cy
LC_MESSAGES
..
..
da
LC_MESSAGES
..
..
de
LC_MESSAGES
..
..
de_AT
LC_MESSAGES
..
..
dk
LC_MESSAGES
..
..
ee
LC_MESSAGES
..
..
el
LC_MESSAGES
..
..
en
LC_MESSAGES
..
..
en_AU
LC_MESSAGES
..
..
en_CA
LC_MESSAGES
..
..
en_GB
LC_MESSAGES
..
..
eo
LC_MESSAGES
..
..
es
LC_MESSAGES
..
..
es_ES
LC_MESSAGES
..
..
es_MX
LC_MESSAGES
..
..
et
LC_MESSAGES
..
..
eu
LC_MESSAGES
..
..
fa
LC_MESSAGES
..
..
fa_IR
LC_MESSAGES
..
..
fi
LC_MESSAGES
..
..
fr
LC_MESSAGES
..
..
fr_FR
LC_MESSAGES
..
..
ga
LC_MESSAGES
..
..
gl
LC_MESSAGES
..
..
gu
LC_MESSAGES
..
..
he
LC_MESSAGES
..
..
hi
LC_MESSAGES
..
..
hr
LC_MESSAGES
..
..
hu
LC_MESSAGES
..
..
id
LC_MESSAGES
..
..
is
LC_MESSAGES
..
..
it
LC_MESSAGES
..
..
ja
LC_MESSAGES
..
..
ka
LC_MESSAGES
..
..
kn
LC_MESSAGES
..
..
ko
LC_MESSAGES
..
..
li
LC_MESSAGES
..
..
lt
LC_MESSAGES
..
..
lv
LC_MESSAGES
..
..
mk
LC_MESSAGES
..
..
ml
LC_MESSAGES
..
..
mn
LC_MESSAGES
..
..
ms
LC_MESSAGES
..
..
mt
LC_MESSAGES
..
..
nb
LC_MESSAGES
..
..
ne
LC_MESSAGES
..
..
nl
LC_MESSAGES
..
..
nn
LC_MESSAGES
..
..
no
LC_MESSAGES
..
..
or
LC_MESSAGES
..
..
pa
LC_MESSAGES
..
..
pl
LC_MESSAGES
..
..
pt
LC_MESSAGES
..
..
pt_BR
LC_MESSAGES
..
..
pt_PT
LC_MESSAGES
..
..
ro
LC_MESSAGES
..
..
ru
LC_MESSAGES
..
..
sk
LC_MESSAGES
..
..
sl
LC_MESSAGES
..
..
sq
LC_MESSAGES
..
..
sr
LC_MESSAGES
..
..
sr@Latn
LC_MESSAGES
..
..
sv
LC_MESSAGES
..
..
ta
LC_MESSAGES
..
..
tg
LC_MESSAGES
..
..
th
LC_MESSAGES
..
..
tk
LC_MESSAGES
..
..
tr
LC_MESSAGES
..
..
uk
LC_MESSAGES
..
..
uz
LC_MESSAGES
..
..
vi
LC_MESSAGES
..
..
wa
LC_MESSAGES
..
..
zh
LC_MESSAGES
..
..
zh_CN
LC_MESSAGES
..
..
zh_CN.GB2312
LC_MESSAGES
..
..
zh_TW
LC_MESSAGES
..
..
zh_TW.Big5
LC_MESSAGES
..
..
..
misc
..
nls
C
..
af_ZA.ISO8859-1
..
af_ZA.ISO8859-15
..
af_ZA.UTF-8
..
am_ET.UTF-8
..
be_BY.CP1131
..
be_BY.CP1251
..
be_BY.ISO8859-5
..
be_BY.UTF-8
..
bg_BG.CP1251
..
bg_BG.UTF-8
..
ca_ES.ISO8859-1
..
ca_ES.ISO8859-15
..
ca_ES.UTF-8
..
cs_CZ.ISO8859-2
..
cs_CZ.UTF-8
..
da_DK.ISO8859-1
..
da_DK.ISO8859-15
..
da_DK.UTF-8
..
de_AT.ISO8859-1
..
de_AT.ISO8859-15
..
de_AT.UTF-8
..
de_CH.ISO8859-1
..
de_CH.ISO8859-15
..
de_CH.UTF-8
..
de_DE.ISO8859-1
..
de_DE.ISO8859-15
..
de_DE.UTF-8
..
el_GR.ISO8859-7
..
el_GR.UTF-8
..
en_AU.ISO8859-1
..
en_AU.ISO8859-15
..
en_AU.US-ASCII
..
en_AU.UTF-8
..
en_CA.ISO8859-1
..
en_CA.ISO8859-15
..
en_CA.US-ASCII
..
en_CA.UTF-8
..
en_GB.ISO8859-1
..
en_GB.ISO8859-15
..
en_GB.US-ASCII
..
en_GB.UTF-8
..
en_IE.UTF-8
..
en_NZ.ISO8859-1
..
en_NZ.ISO8859-15
..
en_NZ.US-ASCII
..
en_NZ.UTF-8
..
en_US.ISO8859-1
..
en_US.ISO8859-15
..
en_US.UTF-8
..
es_ES.ISO8859-1
..
es_ES.ISO8859-15
..
es_ES.UTF-8
..
et_EE.ISO8859-15
..
et_EE.UTF-8
..
fi_FI.ISO8859-1
..
fi_FI.ISO8859-15
..
fi_FI.UTF-8
..
fr_BE.ISO8859-1
..
fr_BE.ISO8859-15
..
fr_BE.UTF-8
..
fr_CA.ISO8859-1
..
fr_CA.ISO8859-15
..
fr_CA.UTF-8
..
fr_CH.ISO8859-1
..
fr_CH.ISO8859-15
..
fr_CH.UTF-8
..
fr_FR.ISO8859-1
..
fr_FR.ISO8859-15
..
fr_FR.UTF-8
..
he_IL.UTF-8
..
hi_IN.ISCII-DEV
..
hr_HR.ISO8859-2
..
hr_HR.UTF-8
..
hu_HU.ISO8859-2
..
hu_HU.UTF-8
..
hy_AM.ARMSCII-8
..
hy_AM.UTF-8
..
is_IS.ISO8859-1
..
is_IS.ISO8859-15
..
is_IS.UTF-8
..
it_CH.ISO8859-1
..
it_CH.ISO8859-15
..
it_CH.UTF-8
..
it_IT.ISO8859-1
..
it_IT.ISO8859-15
..
it_IT.UTF-8
..
ja_JP.SJIS
..
ja_JP.UTF-8
..
ja_JP.eucJP
..
kk_KZ.PT154
..
kk_KZ.UTF-8
..
ko_KR.CP949
..
ko_KR.UTF-8
..
ko_KR.eucKR
..
la_LN.ISO8859-1
..
la_LN.ISO8859-15
..
la_LN.ISO8859-2
..
la_LN.ISO8859-4
..
la_LN.US-ASCII
..
lt_LT.ISO8859-13
..
lt_LT.ISO8859-4
..
lt_LT.UTF-8
..
nl_BE.ISO8859-1
..
nl_BE.ISO8859-15
..
nl_BE.UTF-8
..
nl_NL.ISO8859-1
..
nl_NL.ISO8859-15
..
nl_NL.UTF-8
..
no_NO.ISO8859-1
..
no_NO.ISO8859-15
..
no_NO.UTF-8
..
pl_PL.ISO8859-2
..
pl_PL.UTF-8
..
pt_BR.ISO8859-1
..
pt_BR.UTF-8
..
pt_PT.ISO8859-1
..
pt_PT.ISO8859-15
..
pt_PT.UTF-8
..
ro_RO.ISO8859-2
..
ro_RO.UTF-8
..
ru_RU.CP1251
..
ru_RU.CP866
..
ru_RU.ISO8859-5
..
ru_RU.KOI8-R
..
ru_RU.UTF-8
..
sk_SK.ISO8859-2
..
sk_SK.UTF-8
..
sl_SI.ISO8859-2
..
sl_SI.UTF-8
..
sr_YU.ISO8859-2
..
sr_YU.ISO8859-5
..
sr_YU.UTF-8
..
sv_SE.ISO8859-1
..
sv_SE.ISO8859-15
..
sv_SE.UTF-8
..
tr_TR.ISO8859-9
..
tr_TR.UTF-8
..
uk_UA.ISO8859-5
..
uk_UA.KOI8-U
..
uk_UA.UTF-8
..
zh_CN.GB18030
..
zh_CN.GB2312
..
zh_CN.GBK
..
zh_CN.UTF-8
..
zh_CN.eucCN
..
zh_HK.Big5HKSCS
..
zh_HK.UTF-8
..
zh_TW.Big5
..
zh_TW.UTF-8
..
..
pixmaps
..
sgml
..
skel
..
xml
..
..
tests
..
www
..
..

View File

@@ -0,0 +1,9 @@
# $NetBSD: Makefile,v 1.1.1.1 2014/04/27 00:10:34 agc Exp $
SCRIPTS=genpkgng
all: genpkgng
genpkgng: genpkgng.sh
cp genpkgng.sh genpkgng
chmod 755 genpkgng

View File

@@ -0,0 +1,77 @@
.\" $NetBSD: genpkgng.1,v 1.1.1.1 2014/04/27 00:10:34 agc Exp $
.\"
.\" Copyright (c) 2014 Alistair Crooks <agc@NetBSD.org>
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd April 25, 2014
.Dt GENPKGNG 1
.Os
.Sh NAME
.Nm genraidconf
.Nd utility to configure RAID sets
.Sh SYNOPSIS
.Nm
.Fl nv
.Op Fl v
.Ar binpkg ...
.Sh DESCRIPTION
The
.Nm
command converts from a binary package
generated from the pkgsrc infratsructure to a binary
package which can be installed using the
.Fx
pkg packaging tool.
.Pp
It generates
.Dq +MANIFEST
and
.Dq +COMPACT_MANIFEST
metadata files, and also preserves the
.Dq build information
and
.Dq build versions
pkgsrc metadata, placing entries in the file system.
.Sh RETURN VALUES
The
.Nm
utility will return 0 for success,
and non-zero for failure.
.Sh EXAMPLES
.Bd -literal
% cp /usr/pkgsrc/packages/All/nettle-2.7.1nb1.tgz .
% genpkgng nettle-2.7.1nb1.tgz
Converting nettle-2.7.1nb1.tgz
-rw-r--r-- 1 agc agc 3962779 Apr 25 16:25 nettle-2.7.1nb1.txz
%
.Ed
.Sh SEE ALSO
.Xr pkg_info 1
.Sh HISTORY
The
.Nm
command first appeared in
.Nx 7.0 .
.Sh AUTHORS
.An -nosplit
.An Alistair Crooks Aq Mt agc@NetBSD.org

View File

@@ -0,0 +1,130 @@
#! /bin/sh
# $NetBSD: genpkgng.sh,v 1.1.1.1 2014/04/27 00:10:34 agc Exp $
# Copyright (c) 2014 Alistair Crooks <agc@NetBSD.org>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# script to convert from a pkgsrc package to a pkgng one
# usage: genpkgng [-v] binpkg...
# small function to get information from build info
getvar() {
echo "$1" | awk '/^'$2'=/ { sub("'$2'=", ""); print }'
}
# process command line args
while [ $# -gt 0 ]; do
case "$1" in
-v) set -x ;;
*) break ;;
esac
shift
done
here=$(pwd)
while [ $# -gt 0 ]; do
binpkg=$1
echo "Converting ${binpkg}"
# get the package metadata from the pkgsrc binary package
pkgname=${binpkg%.tgz}
buildinfo=$(pkg_info -B ${binpkg})
name=${binpkg%-*}
name=${name##*/}
origin=$(getvar "${buildinfo}" PKGPATH)
version=${binpkg##*-}
version=${version%.tgz}
comment=$(pkg_info -qc ${binpkg})
os=$(getvar "${buildinfo}" OPSYS)
os_version=$(getvar "${buildinfo}" OS_VERSION)
os_version=${os_version%%.*}
machine_arch=$(getvar "${buildinfo}" MACHINE_ARCH | awk '{ sub("_", ":"); print }')
arch="${os}:${os_version}:${machine_arch}"
maintainer=$(getvar "${buildinfo}" MAINTAINER)
prefix=$(getvar "${buildinfo}" LOCALBASE)
www=$(getvar "${buildinfo}" HOMEPAGE)
licenselogic="single"
flatsize="$(pkg_info -qs ${binpkg})"
desc="$(pkg_info -qd ${binpkg} | awk '{ gsub("\"", "\\\""); printf("%s\\\\n", $0) }')"
categories=$(getvar "${buildinfo}" CATEGORIES)
categories=$(echo "${categories}" | awk 'NF == 1 { printf("\"%s\"", $0) } NF > 1 { gsub("[ ]+", "\",\""); printf("\"%s\"", $0) }' )
# make the temp dir
newpkgdir=$(mktemp -d -t genpkgng)
mkdir ${newpkgdir}/metadata ${newpkgdir}/archive
# create the basis for the compact and large manifests
(cd ${newpkgdir} && tar -s'|^[a-z]|archive/usr/pkg/&|' -s'|^\+|metadata/&|' -xzf ${here}/${binpkg})
awk -v name="${name}" -v origin="${origin}" -v version="${version}" -v arch="${arch}" \
-v comment="${comment}" -v arch="${arch}" -v maintainer="${maintainer}" \
-v prefix="${prefix}" -v www="${www}" -v licenselogic="${licenselogic}" \
-v flatsize="${flatsize}" -v desc="${desc}" -v categories="${categories}" \
'BEGIN {
printf("{\"name\":\"%s\",\"origin\":\"%s\",\"version\":\"%s\",\"comment\":\"%s\",\"arch\":\"%s\",\"maintainer\":\"%s\",\"prefix\":\"%s\",\"www\":\"%s\",\"licenselogic\":\"%s\",\"flatsize\":%s,\"desc\":\"%s\",\"categories\":[%s]",
name, origin, version, comment, arch, maintainer, prefix, www, licenselogic, flatsize, desc, categories)
}' > ${newpkgdir}/archive/+COMPACT_MANIFEST
cp ${newpkgdir}/archive/+COMPACT_MANIFEST ${newpkgdir}/archive/+MANIFEST
echo -n '}' >> ${newpkgdir}/archive/+COMPACT_MANIFEST
# copy metadata information
mkdir -p ${newpkgdir}/archive/${prefix}/etc/metadata/${pkgname}
cp ${newpkgdir}/metadata/+BUILD_VERSION ${newpkgdir}/archive/${prefix}/etc/metadata/${pkgname}/build_version
cp ${newpkgdir}/metadata/+BUILD_INFO ${newpkgdir}/archive/${prefix}/etc/metadata/${pkgname}/build_info
# add the files and digests to the manifest
echo -n ',"files":{' >> ${newpkgdir}/archive/+MANIFEST
sep=""
for f in $(pkg_info -qL ${binpkg}) ${prefix}/etc/metadata/${pkgname}/build_version ${prefix}/etc/metadata/${pkgname}/build_info; do
if [ -f ${newpkgdir}/archive/${f} ]; then
# redirect digest input so that filenames are omitted
echo -n "${sep}\"${f}\":\"$(digest sha256 < ${newpkgdir}/archive/${f})\"" >> ${newpkgdir}/archive/+MANIFEST
fi
sep=","
done
echo -n '},"directories":{' >> ${newpkgdir}/archive/+MANIFEST
directories="$(awk '/^[^+@]/ { match($0, ".*/"); a[substr($0, 1, RLENGTH-1)] = 1 } END { for (i in a) print i }' ${newpkgdir}/metadata/+CONTENTS)"
sep=""
for d in ${directories} etc/metadata etc/metadata/${pkgname}; do
if [ -d ${newpkgdir}/archive/${prefix}/${d} ]; then
echo -n "${sep}\"${prefix}/${d}\":\"n\"" >> ${newpkgdir}/archive/+MANIFEST
fi
sep=","
done
echo -n '}' >> ${newpkgdir}/archive/+MANIFEST
if [ -f ${newpkgdir}/metadata/+INSTALL ]; then
echo -n ",\"scripts\":{\"pre-install\":\"cd ${prefix}\",\"post-install\":\"cd ${prefix}\",\"pre-install\":\"cd ${prefix}\",\"post-install\":\"cd ${prefix}\"}" >> ${newpkgdir}/archive/+MANIFEST
fi
echo -n '}' >> ${newpkgdir}/archive/+MANIFEST
# now make the pkgng binary package
cp @MTREE_DIR_DIR@/MTREE_DIRS ${newpkgdir}/archive/+MTREE_DIRS
(cd ${newpkgdir}/archive && tar -czf ${here}/${pkgname}.txz *)
ls -l ${pkgname}.txz
rm -rf ${newpkgdir}
shift
done
exit 0

View File

@@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.11 2014/03/03 03:43:39 obache Exp $
# $NetBSD: Makefile,v 1.12 2014/10/09 14:06:49 wiz Exp $
PKGNAME= genrpm-1.2
CATEGORIES= pkgtools
@@ -11,8 +11,6 @@ LICENSE= modified-bsd
DEPENDS+= pkg_tarup-[0-9]*:../../pkgtools/pkg_tarup
DEPENDS+= rpm-[0-9]*:../../misc/rpm
PKG_INSTALLATION_TYPES= overwrite pkgviews
WRKSRC= ${WRKDIR}
INSTALLATION_DIRS= ${PKGMANDIR}/man8 sbin

View File

@@ -1,7 +1,7 @@
# $NetBSD: Makefile,v 1.42 2014/03/03 04:26:38 obache Exp $
# $NetBSD: Makefile,v 1.47 2014/10/07 16:47:34 adam Exp $
DISTNAME= gnome-packagekit-0.4.0
PKGREVISION= 32
PKGREVISION= 36
CATEGORIES= pkgtools gnome
MASTER_SITES= http://www.packagekit.org/releases/
@@ -18,7 +18,7 @@ USE_PKGLOCALEDIR= yes
GCONF_SCHEMAS+= gnome-packagekit.schemas
PY_PATCHPLIST= yes
PYTHON_VERSIONS_INCOMPATIBLE= 33 # not yet ported as of 0.4.0
PYTHON_VERSIONS_INCOMPATIBLE= 33 34 # not yet ported as of 0.4.0
# needed for gnome-packagekit-0.4 and gtk2-2.20 -- remove on next update
BUILDLINK_TRANSFORM+= rm:-DG_DISABLE_DEPRECATED

View File

@@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.35 2014/03/03 03:30:53 obache Exp $
# $NetBSD: Makefile,v 1.36 2014/10/09 14:06:49 wiz Exp $
PKGNAME= libkver-${VERSION}
CATEGORIES= pkgtools
@@ -7,8 +7,6 @@ MAINTAINER= seb@NetBSD.org
#HOMEPAGE=
COMMENT= Shared library and sysctl(1) replacement to override system version
PKG_INSTALLATION_TYPES= overwrite pkgviews
.include "../../mk/bsd.prefs.mk"
CHECK_PERMS= no

View File

@@ -1,11 +1,11 @@
# $NetBSD: Makefile,v 1.80 2014/03/03 03:30:53 obache Exp $
# $NetBSD: Makefile,v 1.81 2014/07/25 13:26:24 jperkin Exp $
#
# NOTE: If you update this package, it is *mandatory* that you update
# pkgsrc/pkgtools/libnbcompat/files/README to reflect the actual
# list of tested and supported platforms.
#
PKGNAME= libnbcompat-20130908
PKGNAME= libnbcompat-20140725
CATEGORIES= pkgtools devel
MAINTAINER= joerg@NetBSD.org

View File

@@ -1,4 +1,4 @@
$NetBSD: README,v 1.19 2013/09/08 16:24:43 ryoon Exp $
$NetBSD: README,v 1.20 2014/07/25 13:26:24 jperkin Exp $
0 Introduction
==============
@@ -91,6 +91,11 @@ on the following operating systems:
DragonFly/amd64 3.4.1 <ryoon@NetBSD.org>
Debian GNU/Linux/amd64 7.1 <ryoon@NetBSD.org>
libnbcompat-20140725 has been tested to build and install correctly
on the following operating systems:
Ubuntu GNU/Linux/amd64 12.04 <jperkin@joyent.com>
3 Usage
=======

View File

@@ -125,7 +125,7 @@ esac
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
kopensolaris*-gnu* | \
storm-chaos* | os2-emx* | rtmk-nova*)
os=-$maybe_os

View File

@@ -4383,9 +4383,9 @@ $as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h
fi
for ac_header in alloca.h assert.h ctype.h dirent.h endian.h err.h errno.h \
fcntl.h fnmatch.h fts.h grp.h inttypes.h libutil.h limits.h \
machine/endian.h ndir.h netdb.h paths.h pwd.h signal.h \
for ac_header in alloca.h assert.h bsd/libutil.h ctype.h dirent.h endian.h \
err.h errno.h fcntl.h fnmatch.h fts.h grp.h inttypes.h libutil.h \
limits.h machine/endian.h ndir.h netdb.h paths.h pwd.h signal.h \
stdarg.h stddef.h stdint.h stdio.h \
stdlib.h string.h sys/byteorder.h sys/cdefs.h sys/dir.h sys/endian.h \
sys/file.h sys/mkdev.h sys/ndir.h sys/param.h sys/socket.h sys/stat.h \

View File

@@ -1,4 +1,4 @@
dnl $NetBSD: configure.ac,v 1.82 2014/03/14 22:08:17 ryoon Exp $
dnl $NetBSD: configure.ac,v 1.83 2014/07/25 13:26:24 jperkin Exp $
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.52)
@@ -33,9 +33,9 @@ AC_HEADER_STDC
AC_HEADER_TIME
AC_HEADER_STDBOOL
AC_CHECK_HEADERS([alloca.h assert.h ctype.h dirent.h endian.h err.h errno.h \
fcntl.h fnmatch.h fts.h grp.h inttypes.h libutil.h limits.h \
machine/endian.h ndir.h netdb.h paths.h pwd.h signal.h \
AC_CHECK_HEADERS([alloca.h assert.h bsd/libutil.h ctype.h dirent.h endian.h \
err.h errno.h fcntl.h fnmatch.h fts.h grp.h inttypes.h libutil.h \
limits.h machine/endian.h ndir.h netdb.h paths.h pwd.h signal.h \
stdarg.h stddef.h stdint.h stdio.h \
stdlib.h string.h sys/byteorder.h sys/cdefs.h sys/dir.h sys/endian.h \
sys/file.h sys/mkdev.h sys/ndir.h sys/param.h sys/socket.h sys/stat.h \

View File

@@ -174,6 +174,9 @@
/* Define to 1 if you have the `util' library (-lutil). */
#undef HAVE_LIBUTIL
/* Define to 1 if you have the <bsd/libutil.h> header file. */
#undef HAVE_BSD_LIBUTIL_H
/* Define to 1 if you have the <libutil.h> header file. */
#undef HAVE_LIBUTIL_H

View File

@@ -1,4 +1,4 @@
/* $NetBSD: stdio.h,v 1.4 2008/04/29 05:46:08 martin Exp $ */
/* $NetBSD: stdio.h,v 1.5 2014/06/07 19:17:42 cheusov Exp $ */
/*-
* Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@ int snprintf(char *, size_t, const char *, ...);
int vsnprintf(char *, size_t, const char *, va_list);
#endif
#if !HAVE_DECL_ASPRINTF
#if !HAVE_DECL_VASPRINTF
int asprintf(char **, const char *, ...);
int vasprintf(char **, const char *, va_list);
#endif

View File

@@ -1,4 +1,4 @@
/* $NetBSD: util.h,v 1.2 2008/04/29 05:46:08 martin Exp $ */
/* $NetBSD: util.h,v 1.3 2014/07/25 13:26:24 jperkin Exp $ */
/*-
* Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -35,7 +35,9 @@
#if HAVE_UTIL_H
# include <util.h>
#endif
#if HAVE_LIBUTIL_H
#if HAVE_BSD_LIBUTIL_H
# include <bsd/libutil.h>
#elif HAVE_LIBUTIL_H
# include <libutil.h>
#endif

View File

@@ -1,4 +1,4 @@
# $NetBSD: inplace.mk,v 1.10 2011/08/20 16:13:05 cheusov Exp $
# $NetBSD: inplace.mk,v 1.11 2014/09/03 10:03:31 jperkin Exp $
#
# This file should not be included directly. Use USE_FEATURES instead.
#
@@ -47,7 +47,7 @@ libnbcompat-build:
CPPFLAGS=${CPPFLAGS:M*:Q} \
${CONFIGURE_ENV:NLIBS=*} ${CONFIG_SHELL} \
${CONFIGURE_SCRIPT} ${NBCOMPAT_CONFIGURE_ARGS} && \
${SETENV} ${MAKE_ENV} ${MAKE}
${SETENV} ${MAKE_ENV} ${MAKE} -j${MAKE_JOBS:U1:Q}
.if !empty(LIBNBCOMPAT_USE_PIC:M[Yy][Ee][Ss])
@${STEP_MSG} "Configuring and building libnbcompat (PIC version)"
${RUN} ${_ULIMIT_CMD} \
@@ -55,5 +55,5 @@ libnbcompat-build:
${CONFIGURE_ENV:NLIBS=*} CFLAGS=${CFLAGS:Q}" -fPIC" \
${CONFIG_SHELL} \
${CONFIGURE_SCRIPT} ${NBCOMPAT_CONFIGURE_ARGS} && \
${SETENV} ${MAKE_ENV} ${MAKE}
${SETENV} ${MAKE_ENV} ${MAKE} -j${MAKE_JOBS:U1:Q}
.endif

View File

@@ -1,7 +1,6 @@
# $NetBSD: Makefile,v 1.15 2014/03/03 03:30:53 obache Exp $
# $NetBSD: Makefile,v 1.19 2015/01/10 20:12:24 wiz Exp $
PKGNAME= lintpkgsrc-4.86
PKGREVISION= 1
PKGNAME= lintpkgsrc-4.88
CATEGORIES= pkgtools
MAINTAINER= pkgsrc-users@NetBSD.org
@@ -11,8 +10,6 @@ COMMENT= Sanity checks on the complete pkgsrc tree
DEPENDS+= digest>=20010101:../../pkgtools/digest
CONFLICTS+= pkglint<4.82
PKG_INSTALLATION_TYPES= overwrite pkgviews
USE_TOOLS+= perl:run
WRKSRC= ${WRKDIR}

View File

@@ -1,17 +1,17 @@
LINTPKGSRC(1) NetBSD General Commands Manual LINTPKGSRC(1)
LINTPKGSRC(1) General Commands Manual LINTPKGSRC(1)
NNAAMMEE
lliinnttppkkggssrrcc -- verifier for the pkgsrc tree
SSYYNNOOPPSSIISS
lliinnttppkkggssrrcc [--BBDDLLOORRSSVVddhhiillmmoopprruu] [--EE _f_i_l_e] [--gg _p_k_g_s_r_c_m_a_p] [--II _f_i_l_e]
lliinnttppkkggssrrcc [--BBDDddLLllmmOOooppRRrrSSuuVVyyzz] [--EE _f_i_l_e] [--gg _p_k_g_s_r_c_m_a_p] [--II _f_i_l_e]
[--KK _P_A_C_K_A_G_E_S] [--MM _D_I_S_T_D_I_R] [--PP _P_K_G_S_R_C_D_I_R] [_m_a_k_e_f_i_l_e _._._.]
DDEESSCCRRIIPPTTIIOONN
lliinnttppkkggssrrcc tries to verify the entire contents of the pkgsrc tree.
lliinnttppkkggssrrcc uses simple regular-expression matching for verifying files
that make up a pkgsrc directory. Note that it does NOT implement com-
plete Makefile parser.
that make up a pkgsrc directory. Note that it does NOT implement a
complete Makefile parser.
OOppttiioonnss
--BB List packages marked as BROKEN.
@@ -31,17 +31,17 @@ DDEESSCCRRIIPPTTIIOONN
a set of similarly configured machines (in the absence of
extra copies of the pkgsrc tree) both quick and possible.
--gg _p_k_g_s_r_c_m_a_p Generate pkgsrcmap file containing an entry for each pack-
age of `pkgname pkgdir pkgver'.
--gg _p_k_g_s_r_c_m_a_p Generate pkgsrcmap file containing an entry for each
package of `pkgname pkgdir pkgver'.
--hh Basic help and usage.
--II _f_i_l_e Imports the data to construct the internal database for
checking the installed versions of packages, among other
things, against the current version found in pkgsrc. This
database provides most or all of the data required for run-
ning lliinnttppkkggssrrcc with any combination of --BB, --OO, --RR, --SS, --VV,
--dd, --gg, --ii, --pp, or --uu.
database provides most or all of the data required for
running lliinnttppkkggssrrcc with any combination of --BB, --OO, --RR, --SS,
--VV, --dd, --gg, --ii, --pp, or --uu.
--ii Check the version of each installed package against the
current version in pkgsrc.
@@ -50,7 +50,7 @@ DDEESSCCRRIIPPTTIIOONN
_/_e_t_c_/_m_k_._c_o_n_f or defaulted to _$_{_P_K_G_S_R_C_D_I_R_}_/_p_a_c_k_a_g_e_s.
Note: lintpkgsrc treats _P_A_C_K_A_G_E_S slightly differently to
the pkgsrc build system. --pp, --RR and --VV check for binary
the pkgsrc build system. --pp, --RR, and --VV check for binary
packages in any depth of PACKAGES subdirs - this allows
packages for all architectures/OS versions to be checked
simultaneously with an _/_e_t_c_/_m_k_._c_o_n_f construct of the form:
@@ -70,7 +70,7 @@ DDEESSCCRRIIPPTTIIOONN
_$_{_P_K_G_S_R_C_D_I_R_}_/_d_i_s_t_f_i_l_e_s.
--mm For each current distfile, verify its checksum against the
appropriate package's distinfo file. Also report if any
appropriate package's distinfo file. Also report if any
package's distinfo file references the same distfile with a
different distinfo checksum.
@@ -92,11 +92,11 @@ DDEESSCCRRIIPPTTIIOONN
This is intended to help those making binary packages
available for ftp.
--rr Remove distfiles which are not referenced from any pack-
age's distinfo file, or have an incorrect checksum (usually
due to an interrupted download), and any old binary pack-
ages. To remove any given type, additionally specify the
--oo, --mm, or --pp flags respectively.
--rr Remove distfiles which are not referenced from any
package's distinfo file, or have an incorrect checksum
(usually due to an interrupted download), and any old
binary packages. To remove any given type, additionally
specify the --oo, --mm, or --pp flags respectively.
--SS List packages missing from category _S_U_B_D_I_R lists.
@@ -111,21 +111,27 @@ DDEESSCCRRIIPPTTIIOONN
known vulnerabilities, based on the data in
_$_{_P_K_G_S_R_C_D_I_R_}_/_d_i_s_t_f_i_l_e_s_/_p_k_g_-_v_u_l_n_e_r_a_b_i_l_i_t_i_e_s.
--yy Remove orphaned distfiles, i.e., those that do not belong
to any currently installed package.
--zz Remove distfiles for currently installed packages.
AAUUTTHHOORRSS
David Brownlee <abs@netbsd.org>
David Brownlee <_a_b_s_@_n_e_t_b_s_d_._o_r_g>
BBUUGGSS
The --RR, --VV, and --pp options default to using _P_A_C_K_A_G_E_S as the base direc-
tory from which to search for binary packages. If this includes OS or
architecture information then packages for other OS/architecture combina-
tions will be missed. In this case _P_A_C_K_A_G_E_S can be overridden with --KK or
set conditionally in _/_e_t_c_/_m_k_._c_o_n_f based on the value of _L_I_N_T_P_K_G_S_R_C.
The --RR, --VV, and --pp options default to using _P_A_C_K_A_G_E_S as the base
directory from which to search for binary packages. If this includes OS
or architecture information then packages for other OS/architecture
combinations will be missed. In this case _P_A_C_K_A_G_E_S can be overridden
with --KK or set conditionally in _/_e_t_c_/_m_k_._c_o_n_f based on the value of
_L_I_N_T_P_K_G_S_R_C.
The `Makefile parsing' algorithm used to obtain package versions and
DEPENDS information is geared towards speed rather than perfection,
though it has got somewhat better over time, it only parses the simplest
Makefile conditionals. (a == b, no && etc).
Makefile conditionals. (a == b, no && etc).
Potentially others, but non serious to date.
pkgsrc November 8, 2005 pkgsrc
LOCAL November 24, 2014 LOCAL

View File

@@ -1,16 +1,16 @@
.\" $NetBSD: lintpkgsrc.1,v 1.2 2013/07/20 21:50:53 wiz Exp $
.\" $NetBSD: lintpkgsrc.1,v 1.4 2014/11/24 09:50:34 wiz Exp $
.\"
.\" Copyright (c) 1999 by David Brownlee (abs@netbsd.org)
.\" Absolutely no warranty.
.\"
.Dd November 8, 2005
.Dd November 24, 2014
.Dt LINTPKGSRC 1
.Sh NAME
.Nm lintpkgsrc
.Nd verifier for the pkgsrc tree
.Sh SYNOPSIS
.Nm
.Op Fl BDLORSVdhilmopru
.Op Fl BDdLlmOopRrSuVyz
.Op Fl E Ar file
.Op Fl g Ar pkgsrcmap
.Op Fl I Ar file
@@ -24,7 +24,7 @@ tries to verify the entire contents of the pkgsrc tree.
.Nm
uses simple regular-expression matching for verifying
files that make up a pkgsrc directory.
Note that it does NOT implement complete Makefile parser.
Note that it does NOT implement a complete Makefile parser.
.Ss Options
.Bl -tag -width xxxxxxxxxxxx
.It Fl B
@@ -82,7 +82,7 @@ Note: lintpkgsrc treats
.Em PACKAGES
slightly differently to the pkgsrc build system.
.Fl p ,
.Fl R
.Fl R ,
and
.Fl V
check for
@@ -107,7 +107,8 @@ Set directory for distfiles, defaults to
.Pa ${PKGSRCDIR}/distfiles .
.It Fl m
For each current distfile, verify its checksum against the appropriate
package's distinfo file. Also report if any package's distinfo file references
package's distinfo file.
Also report if any package's distinfo file references
the same distfile with a different distinfo checksum.
.It Fl O
Report any binary packages in any subdirs of
@@ -136,8 +137,8 @@ This is intended to help those making binary packages available for ftp.
.It Fl r
Remove distfiles which are not referenced from any package's distinfo file,
or have an incorrect checksum (usually due to an interrupted download),
and any old binary packages. To remove any given type, additionally
specify the
and any old binary packages.
To remove any given type, additionally specify the
.Fl o ,
.Fl m ,
or
@@ -161,6 +162,11 @@ List any prebuilt packages in any subdirs of
.Em PACKAGES
with known vulnerabilities, based on the data in
.Pa ${PKGSRCDIR}/distfiles/pkg-vulnerabilities .
.It Fl y
Remove orphaned distfiles, i.e., those that do not belong to any
currently installed package.
.It Fl z
Remove distfiles for currently installed packages.
.El
.Sh AUTHORS
.An David Brownlee Aq Mt abs@netbsd.org
@@ -173,7 +179,8 @@ and
options default to using
.Em PACKAGES
as the base directory from which to
search for binary packages. If this includes OS or architecture information
search for binary packages.
If this includes OS or architecture information
then packages for other OS/architecture combinations will be missed.
In this case
.Em PACKAGES
@@ -189,6 +196,7 @@ The
algorithm used to obtain package versions
and DEPENDS information is geared towards speed rather than
perfection, though it has got somewhat better over time, it only
parses the simplest Makefile conditionals. (a == b, no \*[Am]\*[Am] etc).
parses the simplest Makefile conditionals.
(a == b, no \*[Am]\*[Am] etc).
.Pp
Potentially others, but non serious to date.

View File

@@ -1,6 +1,6 @@
#! @PERL@
# $NetBSD: lintpkgsrc.pl,v 1.3 2013/02/09 18:51:56 mspo Exp $
# $NetBSD: lintpkgsrc.pl,v 1.5 2015/01/10 20:12:24 wiz Exp $
# Written by David Brownlee <abs@netbsd.org>.
#
@@ -42,7 +42,7 @@ $ENV{PATH} .=
":/bin:/usr/bin:/sbin:/usr/sbin:${conf_prefix}/sbin:${conf_prefix}/bin";
if (
!getopts( 'BDE:I:K:LM:OP:RSVdg:himopru', \%opt )
!getopts( 'BDE:I:K:LM:OP:RSVdg:himopruyz', \%opt )
|| $opt{h}
|| !(
defined $opt{d}
@@ -60,6 +60,8 @@ if (
|| defined $opt{S}
|| defined $opt{V}
|| defined $opt{E}
|| defined $opt{y}
|| defined $opt{z}
)
)
{
@@ -119,6 +121,127 @@ sub main() {
}
}
# Remove all distfiles that are / are not part of an installed package
if ($opt{y} || $opt{z})
{
my(@pkgs, @installed, %distfiles, @pkgdistfiles, @dldistfiles);
my(@tmpdistfiles, @orphan, $found, @parent);
@pkgs = list_installed_packages();
scan_pkgsrc_makefiles($pkgsrcdir);
# list the installed packages and the directory they live in
foreach my $pkgname (sort @pkgs)
{
if ($pkgname =~ /^([^*?[]+)-([\d*?[].*)/)
{
foreach my $pkgver ($pkglist->pkgver($1))
{
$pkgver->var('dir') =~ /-current/ && next;
push(@installed, $pkgver);
last;
}
}
}
# distfiles belonging to the currently installed packages
foreach my $pkgver (sort @installed)
{
if (open(DISTINFO, "$pkgsrcdir/" .$pkgver->var('dir'). "/distinfo"))
{
while( <DISTINFO> )
{
if (m/^(\w+) ?\(([^\)]+)\) = (\S+)/)
{
my($dn);
if ($2 =~ /^patch-[a-z0-9]+$/)
{ next; }
$dn = $2;
# Strip leading ./ which sometimes gets added
# because of DISTSUBDIR=.
$dn =~ s/^(\.\/)*//;
if (!defined $distfiles{$dn})
{
$distfiles{$dn}{name} = $dn;
push (@pkgdistfiles, $dn);
}
}
}
close(DISTINFO);
}
}
# distfiles downloaded on the current system
@tmpdistfiles = listdir("$pkgdistdir");
foreach my $tmppkg (@tmpdistfiles)
{
if ($tmppkg ne "pkg-vulnerabilities")
{ push (@dldistfiles, $tmppkg); }
}
# sort the two arrays to make searching a bit faster
@dldistfiles = sort { $a cmp $b } @dldistfiles;
@pkgdistfiles = sort { $a cmp $b } @pkgdistfiles;
if ($opt{y})
{
# looking for files that are downloaded on the current system
# but do not belong to any currently installed package i.e. orphaned
$found = 0;
foreach my $dldf (@dldistfiles)
{
foreach my $pkgdf (@pkgdistfiles)
{
if ($dldf eq $pkgdf)
{ $found = 1; }
}
if ($found != 1)
{
push (@orphan, $dldf);
print "Orphaned file: $dldf\n";
}
$found = 0;
}
if ($opt{r})
{
safe_chdir("$pkgdistdir");
verbose("Unlinking 'orphaned' distfiles\n");
foreach my $distfile (@orphan)
{ unlink($distfile) }
}
}
if ($opt{z})
{
# looking for files that are downloaded on the current system
# but belong to a currently installed package i.e. parented
$found = 0;
foreach my $pkgdf (@pkgdistfiles)
{
foreach my $dldf (@dldistfiles)
{
if ($pkgdf eq $dldf)
{ $found = 1; }
}
if ($found == 1)
{
push (@parent, $pkgdf);
print "Parented file: $pkgdf\n";
}
$found = 0;
}
}
if ($opt{r})
{
safe_chdir("$pkgdistdir");
verbose("Unlinking 'parented' distfiles\n");
foreach my $distfile (@parent)
{ unlink($distfile) }
}
}
# List BROKEN packages
if ( $opt{B} ) {
scan_pkgsrc_makefiles($pkgsrcdir);
@@ -1067,6 +1190,7 @@ sub parse_makefile_vars($$) {
# fully expand
if ( $incfile =~ m#/mk/bsd#
|| $incfile =~ /$magic_undefined/
|| $incfile =~ /\${/
|| ( !$opt{d} && $incfile =~ m#/(buildlink[^/]*\.mk)# ) )
{
debug("$file: .include \"$incfile\" skipped\n");
@@ -1608,6 +1732,8 @@ opts:
Installed package options: Distfile options:
-i : Check version against pkgsrc -m : List distinfo mismatches
-u : As -i + fetch dist (may change) -o : List obsolete (no distinfo)
-y : Remove orphan distfiles
-z : Remove installed distfiles
Prebuilt package options: Makefile options:
-p : List old/obsolete -B : List packages marked as 'BROKEN'

View File

@@ -1,6 +1,6 @@
# $NetBSD: Makefile,v 1.20 2014/01/14 01:16:28 cheusov Exp $
# $NetBSD: Makefile,v 1.21 2014/11/30 01:10:12 cheusov Exp $
DISTNAME= pkgnih-0.12.0
DISTNAME= pkgnih-0.13.0
PKGNAME= ${DISTNAME:S/pkgnih/nih/}
CATEGORIES= pkgtools
MASTER_SITES= ftp://ftp.NetBSD.org/pub/NetBSD/misc/cheusov/nih/ \

View File

@@ -1,5 +1,5 @@
$NetBSD: distinfo,v 1.10 2014/01/14 01:16:28 cheusov Exp $
$NetBSD: distinfo,v 1.11 2014/11/30 01:10:12 cheusov Exp $
SHA1 (pkgnih-0.12.0.tar.gz) = 960bccb2150603041b64103dcde53778c80798f1
RMD160 (pkgnih-0.12.0.tar.gz) = 99331f162ce11008e854df504157b6984c705c0a
Size (pkgnih-0.12.0.tar.gz) = 49597 bytes
SHA1 (pkgnih-0.13.0.tar.gz) = 68fd6e02da90589cfed77cc9901d5679b5ab8f32
RMD160 (pkgnih-0.13.0.tar.gz) = db9c836be6f6d5ead9762d8c36661d77131508c2
Size (pkgnih-0.13.0.tar.gz) = 50607 bytes

View File

@@ -1,8 +1,14 @@
# $NetBSD: INSTALL,v 1.3 2013/02/23 05:47:59 obache Exp $
# $NetBSD: INSTALL,v 1.4 2014/10/28 02:08:38 cheusov Exp $
UNAME="@UNAME@"
PKG_ADMIN="@PKG_ADMIN@"
case ${STAGE} in
PRE-INSTALL)
if ${TEST} no = "$($PKG_ADMIN config-var CHECK_OSABI)"; then
exit 0
fi
OS_VERSION=`${UNAME} -r`
PKG_VERSION="${PKGNAME##*-}"
case `${UNAME} -s` in

View File

@@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.2 2014/03/03 03:30:53 obache Exp $
# $NetBSD: Makefile,v 1.3 2014/10/28 02:08:38 cheusov Exp $
#
PKGNAME= osabi-${OPSYS}-${OS_VERSION}
@@ -9,6 +9,6 @@ HOMEPAGE= http://www.pkgsrc.org/
COMMENT= Operating System version dummy-package
META_PACKAGE= yes
FILES_SUBST+= UNAME=${UNAME:Q}
FILES_SUBST+= UNAME=${UNAME:Q} PKG_ADMIN=${PKG_ADMIN:Q}
.include "../../mk/bsd.pkg.mk"

View File

@@ -1,7 +1,7 @@
# $NetBSD: Makefile,v 1.23 2014/03/03 03:30:53 obache Exp $
# $NetBSD: Makefile,v 1.25 2014/10/09 14:06:49 wiz Exp $
PKGNAME= p5-pkgsrc-Dewey-1.1
PKGREVISION= 4
PKGREVISION= 5
CATEGORIES= pkgtools perl5
MAINTAINER= wiz@NetBSD.org
@@ -9,8 +9,6 @@ HOMEPAGE= http://www.NetBSD.org/docs/pkgsrc/
COMMENT= Perl module to compare pkgsrc Dewey numbers
LICENSE= ${PERL5_LICENSE} OR 2-clause-bsd
PKG_INSTALLATION_TYPES= overwrite pkgviews
CPPFLAGS+= -DHAVE_CTYPE_H -DHAVE_STDLIB_H -DHAVE_STRING_H
CPPFLAGS.NetBSD+= -DHAVE_ERR_H

View File

@@ -1,13 +1,13 @@
# $NetBSD: Makefile,v 1.40 2014/03/03 04:34:53 obache Exp $
# $NetBSD: Makefile,v 1.45 2015/01/17 04:47:17 obache Exp $
DISTNAME= PackageKit-0.4.0
PKGREVISION= 30
PKGREVISION= 33
PKGNAME= ${DISTNAME:S/PackageKit/packagekit/}
CATEGORIES= pkgtools
MASTER_SITES= http://www.packagekit.org/releases/
MASTER_SITES= http://www.freedesktop.org/software/PackageKit/releases/
MAINTAINER= pkgsrc-users@NetBSD.org
HOMEPAGE= http://www.packagekit.org/
HOMEPAGE= http://www.freedesktop.org/software/PackageKit/
COMMENT= System activated daemon for managing software updates
LICENSE= gnu-gpl-v2
@@ -48,7 +48,7 @@ PKGCONFIG_OVERRIDE+= data/packagekit-qt.pc.in
PKGCONFIG_OVERRIDE+= data/packagekit-glib.pc.in
PY_PATCHPLIST= yes
PYTHON_VERSIONS_INCOMPATIBLE= 33 # not yet ported as of 0.4.0
PYTHON_VERSIONS_INCOMPATIBLE= 33 34 # not yet ported as of 0.4.0
REPLACE_PYTHON= backends/test/helpers/PackageKitDbusTest.py \
lib/python/packagekit/client.py \

Some files were not shown because too many files have changed in this diff Show More