]> Zhao Yanbai Git Server - minix.git/commitdiff
add pkgsrc hooks for building pkgs w/nbsd_libc
authorThomas Cort <tcort@minix3.org>
Mon, 27 Jun 2011 03:16:29 +0000 (03:16 +0000)
committerBen Gras <ben@minix3.org>
Mon, 27 Jun 2011 13:10:34 +0000 (15:10 +0200)
Add two makefiles to manage compiling packages with NetBSD libc.

  *  minix.libc.mk contains the proper CFLAGS/LDFLAGS
  *  pkgsrchooks.mk contains the logic for setting the flags.
  *  update bmake

Several pkg-config files were added to help pkgsrc learn about
the c, minlib, and compat_minix libraries.

13 files changed:
lib/nbsd_libc/Makefile
lib/nbsd_libc/pkgconfig/Makefile [new file with mode: 0644]
lib/nbsd_libc/pkgconfig/libc.pc [new file with mode: 0644]
lib/nbsd_libcompat_minix/Makefile
lib/nbsd_libcompat_minix/pkgconfig/Makefile [new file with mode: 0644]
lib/nbsd_libcompat_minix/pkgconfig/compat_minix.pc [new file with mode: 0644]
lib/nbsd_libminlib/Makefile
lib/nbsd_libminlib/pkgconfig/Makefile [new file with mode: 0644]
lib/nbsd_libminlib/pkgconfig/minlib.pc [new file with mode: 0644]
share/mk/Makefile
share/mk/minix.libc.mk [new file with mode: 0644]
share/mk/pkgsrchooks.mk [new file with mode: 0644]
tools/release.sh

index f0f530d456b86d9d08cf0d480434b1567d664bf9..4b124caf862add75c45da4f549cbf2bfd239623a 100644 (file)
@@ -172,3 +172,7 @@ CSHLIBFLAGS+=       -D_I18N_DYNAMIC
 # force the dynamic linker to initialize libc first
 SHLIB_SHFLAGS+=        -Wl,-z,initfirst
 
+.include <bsd.own.mk>
+SUBDIR+= pkgconfig
+.include <bsd.subdir.mk>
+
diff --git a/lib/nbsd_libc/pkgconfig/Makefile b/lib/nbsd_libc/pkgconfig/Makefile
new file mode 100644 (file)
index 0000000..4c2c4c9
--- /dev/null
@@ -0,0 +1,9 @@
+NOOBJ=  # defined
+
+.include <bsd.own.mk>
+
+FILES=libc.pc
+FILESDIR=/usr/netbsd/lib
+FILESMODE=444
+
+.include <bsd.prog.mk>
diff --git a/lib/nbsd_libc/pkgconfig/libc.pc b/lib/nbsd_libc/pkgconfig/libc.pc
new file mode 100644 (file)
index 0000000..828a9df
--- /dev/null
@@ -0,0 +1,5 @@
+Name: c
+Description: NetBSD C Library
+Version: 1.0
+Libs: -nostdlib /usr/netbsd/lib/crt1.o /usr/netbsd/lib/crti.o /usr/netbsd/lib/crtn.o -L/usr/netbsd/lib -lc -L/usr/pkg/lib -lgcc -L/usr/netbsd/lib -lminlib -lcompat_minix
+Cflags: -nostdinc -D__NBSD_LIBC -isystem /usr/netbsd/include
index 21ec3686660f78c71d6d83e1e3daa31e6e0e7432..710ede97982e136b16f4520e187e9530b93b5278 100644 (file)
@@ -44,4 +44,8 @@ SRCS+= cuserid.c
 
 .include "include/Makefile.inc"
 
+.include <bsd.own.mk>
+SUBDIR+= pkgconfig
+.include <bsd.subdir.mk>
+
 .include <bsd.lib.mk>
diff --git a/lib/nbsd_libcompat_minix/pkgconfig/Makefile b/lib/nbsd_libcompat_minix/pkgconfig/Makefile
new file mode 100644 (file)
index 0000000..73a654d
--- /dev/null
@@ -0,0 +1,9 @@
+NOOBJ=  # defined
+
+.include <bsd.own.mk>
+
+FILES=compat_minix.pc
+FILESDIR=/usr/netbsd/lib
+FILESMODE=444
+
+.include <bsd.prog.mk>
diff --git a/lib/nbsd_libcompat_minix/pkgconfig/compat_minix.pc b/lib/nbsd_libcompat_minix/pkgconfig/compat_minix.pc
new file mode 100644 (file)
index 0000000..f763fd8
--- /dev/null
@@ -0,0 +1,5 @@
+Name: compat_minix
+Description: Minix Compatibility Library
+Version: 1.0
+Libs: -L/usr/netbsd/lib -lcompat_minix
+Cflags: -I/usr/netbsd/include
index e049137d202b4e3125c8c3ab7b5bf7426152c26f..76062b65e5c17833f93963dd472a6c6200a23e0c 100644 (file)
@@ -35,4 +35,8 @@ INCS+= tools.h
 
 .include "${MACHINE}/Makefile.inc"
 
+.include <bsd.own.mk>
+SUBDIR+= pkgconfig
+.include <bsd.subdir.mk>
+
 .include <bsd.lib.mk>
diff --git a/lib/nbsd_libminlib/pkgconfig/Makefile b/lib/nbsd_libminlib/pkgconfig/Makefile
new file mode 100644 (file)
index 0000000..b70ad99
--- /dev/null
@@ -0,0 +1,9 @@
+NOOBJ=  # defined
+
+.include <bsd.own.mk>
+
+FILES=minlib.pc
+FILESDIR=/usr/netbsd/lib
+FILESMODE=444
+
+.include <bsd.prog.mk>
diff --git a/lib/nbsd_libminlib/pkgconfig/minlib.pc b/lib/nbsd_libminlib/pkgconfig/minlib.pc
new file mode 100644 (file)
index 0000000..9fb06b6
--- /dev/null
@@ -0,0 +1,6 @@
+Name: minlib
+Description: Minix Compatibility Library
+Version: 1.0
+Libs: -L/usr/netbsd/lib -lminlib
+Cflags: -I/usr/netbsd/include
+
index 740bc5ba070d649f77833bb83e0817871efec45b..4eff2fc36d4df3afa12d97b538f69f7aa211c61e 100644 (file)
@@ -5,10 +5,10 @@ NOOBJ=        # defined
 .if ${MKSHARE} != "no"
 FILES= bsd.ack.mk bsd.dep.mk bsd.files.mk \
        bsd.gcc.mk bsd.inc.mk \
-       bsd.init.mk bsd.kinc.mk bsd.klinks.mk \
-       bsd.lib.mk bsd.links.mk bsd.man.mk bsd.obj.mk bsd.own.mk \
+       bsd.init.mk bsd.kinc.mk bsd.klinks.mk bsd.lib.mk \
+       bsd.links.mk bsd.man.mk bsd.obj.mk bsd.own.mk \
        bsd.prog.mk bsd.subdir.mk bsd.sys.mk bsd.gcov.mk \
-       sys.mk
+       minix.libc.mk pkgsrchooks.mk sys.mk
 
 # MINIX-specific files
 FILES+= minix.bootprog.mk
diff --git a/share/mk/minix.libc.mk b/share/mk/minix.libc.mk
new file mode 100644 (file)
index 0000000..8d1864c
--- /dev/null
@@ -0,0 +1,7 @@
+# NetBSD libc flags go here
+NETBSD_LIBC_CPPFLAGS=-nostdinc -D__NBSD_LIBC -isystem /usr/netbsd/include
+NETBSD_LIBC_LDFLAGS=-nostdlib /usr/netbsd/lib/crt1.o /usr/netbsd/lib/crti.o /usr/netbsd/lib/crtn.o -L/usr/netbsd/lib -lc -L/usr/pkg/lib -lgcc -L/usr/netbsd/lib -lminlib -lcompat_minix
+
+# Minix libc flags go here
+MINIX_LIBC_CPPFLAGS=
+MINIX_LIBC_LDFLAGS=
diff --git a/share/mk/pkgsrchooks.mk b/share/mk/pkgsrchooks.mk
new file mode 100644 (file)
index 0000000..8e61f9f
--- /dev/null
@@ -0,0 +1,36 @@
+#
+
+.if !defined(_MINIX_PKGSRC_HOOKS_)
+_MINIX_PKGSRC_HOOKS_=1
+
+# Get PKGS_REQUIRING_MINIX_LIBC
+.include "/usr/pkgsrc/minix/pkgs_requiring_minix_libc.mk"
+
+# Get MINIX_LIBC_* and NETBSD_LIBC_*
+.include "/usr/share/mk/minix.libc.mk"
+
+# Build everything not in PKGS_REQUIRING_MINIX_LIBC with NetBSD libc
+PKG_REQUIRES_MINIX_LIBC=no
+
+# Search PKGS_REQUIRING_MINIX_LIBC to see if it needs Minix libc
+.for PKG_REQUIRING_MINIX_LIBC in ${PKGS_REQUIRING_MINIX_LIBC}
+.if "${PKG_REQUIRING_MINIX_LIBC}" == "${CATEGORIES}/${PKGBASE}"
+PKG_REQUIRES_MINIX_LIBC=yes
+.endif
+.endfor
+
+# Set the proper compilation flags
+.if ${PKG_REQUIRES_MINIX_LIBC} == yes
+CPPFLAGS+=     ${MINIX_LIBC_CPPFLAGS}
+LDFLAGS+=      ${MINIX_LIBC_LDFLAGS}
+.else
+SED=/bin/sed
+.include "/usr/pkgsrc/mk/nbsd_libc.buildlink3.mk"
+PREFER_NATIVE+=minlib
+PREFER_NATIVE+=compat_minix
+PREFER_NATIVE+=nbsd_libc
+CPPFLAGS+=     ${NETBSD_LIBC_CPPFLAGS}
+LDFLAGS+=      ${NETBSD_LIBC_LDFLAGS}
+.endif
+
+.endif  # !defined(_MINIX_PKGSRC_HOOKS_)
index 361ea3979b51ea32a2a2fdb645c36cd9915da9ad..cba55f2dd51ba0fc4f18e63ca91d8efd47f1f506 100755 (executable)
@@ -30,7 +30,7 @@ PACKAGEURL=ftp://ftp.minix3.org/pub/minix/packages/$version_pretty/`uname -m`/Al
 PREINSTALLED_PACKAGES="
        pkgin-0.4.1
        pkg_install-20101212
-       bmake-20100808
+       bmake-20110606
        binutils-2.17nb3
        clang-2.9nb2
        compiler-rt-r123836nb3