Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Sep 1996 22:26:38 -0700 (PDT)
From:      Jason Thorpe <thorpej@nas.nasa.gov>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   bin/1643: Support for NetBSD in bsd.port.mk
Message-ID:  <199609190526.WAA08592@nostromo.nas.nasa.gov>
Resent-Message-ID: <199609190540.WAA23999@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         1643
>Category:       bin
>Synopsis:       Support for NetBSD in bsd.port.mk
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Sep 18 22:40:01 PDT 1996
>Last-Modified:
>Originator:     Jason Thorpe
>Organization:
Numerical Aerodynamic Simulation Project - NASA Ames
>Release:        FreeBSD-current 960918, built on NetBSD/alpha
>Environment:
	
System: NetBSD nostromo 1.2A NetBSD 1.2A (NOSY) #14: Wed Sep 18 14:54:10 PDT 1996 thorpej@nostromo:/work/clean-current/src/sys/arch/alpha/compile/NOSY alpha


>Description:
	The bsd.port.mk and bsd.port.subdir.mk files are currently
	FreeBSD-specific (well, duh! :-).  The following patches
	add support for NetBSD to the Makefiles.  It is hoped that
	FreeBSD can pick these up, so that NetBSD doesn't have to
	maintain a set of differences, thus making everyone's
	life a little easier.

>How-To-Repeat:
	N/A.

>Fix:
	Attached below are the diffs ... Note that not all of the
	programs nor the Makefiles have actually been imported into
	the NetBSD tree.  They probably will be "soon".

	The Makefile dynamically determines the operating system
	at run-time.

 ----- snip -----
Index: bsd.port.mk
===================================================================
RCS file: /mastersrc/netbsd/src/share/mk/bsd.port.mk,v
retrieving revision 1.1.1.2
retrieving revision 1.4
diff -c -r1.1.1.2 -r1.4
*** bsd.port.mk	1996/09/19 04:46:10	1.1.1.2
--- bsd.port.mk	1996/09/19 04:58:49	1.4
***************
*** 1,9 ****
  #-*- mode: Fundamental; tab-width: 4; -*-
  #
  #	bsd.port.mk - 940820 Jordan K. Hubbard.
  #	This file is in the public domain.
  #
! # $Id: bsd.port.mk,v 1.1.1.2 1996/09/19 04:46:10 thorpej Exp $
  #
  # Please view me with 4 column tabs!
  
--- 1,11 ----
  #-*- mode: Fundamental; tab-width: 4; -*-
  #
+ #	$NetBSD: $
+ #
  #	bsd.port.mk - 940820 Jordan K. Hubbard.
  #	This file is in the public domain.
  #
! # from FreeBSD Id: bsd.port.mk,v 1.224 1996/08/25 21:07:38 wosch Exp 
  #
  # Please view me with 4 column tabs!
  
***************
*** 18,24 ****
  #
  # Variables that typically apply to all ports:
  # 
! # PORTSDIR		- The root of the ports tree (default: /usr/ports).
  # DISTDIR 		- Where to get gzip'd, tarballed copies of original sources
  #				  (default: ${PORTSDIR}/distfiles/${DIST_SUBDIR}).
  # PREFIX		- Where to install things in general (default: /usr/local).
--- 20,31 ----
  #
  # Variables that typically apply to all ports:
  # 
! # OPSYS			- Portability clause.  This is the operating system the
! #				  makefile is being used on.  Automatically set to
! #				  "FreeBSD" or "NetBSD" as appropriate.
! # PORTSDIR		- The root of the ports tree.  Defaults:
! #					FreeBSD: /usr/ports
! #					NetBSD: /usr/opt
  # DISTDIR 		- Where to get gzip'd, tarballed copies of original sources
  #				  (default: ${PORTSDIR}/distfiles/${DIST_SUBDIR}).
  # PREFIX		- Where to install things in general (default: /usr/local).
***************
*** 171,176 ****
--- 178,184 ----
  #
  # Variables to change if you want a special behavior:
  #
+ #
  # ECHO_MSG		- Used to print all the '===>' style prompts - override this
  #				  to turn them off (default: /bin/echo).
  # IS_DEPENDED_TARGET -
***************
*** 222,227 ****
--- 230,244 ----
  # NEVER override the "regular" targets unless you want to open
  # a major can of worms.
  
+ # Get the operating system type
+ OPSYS!=	uname -s
+ 
+ # If NetBSD, we need to include bsd.own.mk to get system make
+ # configuration options.
+ .if (${OPSYS} == "NetBSD")
+ .include <bsd.own.mk>
+ .endif
+ 
  .if exists(${.CURDIR}/../Makefile.inc)
  .include "${.CURDIR}/../Makefile.inc"
  .endif
***************
*** 229,236 ****
  
  # These need to be absolute since we don't know how deep in the ports
  # tree we are and thus can't go relative.  They can, of course, be overridden
! # by individual Makefiles.
  PORTSDIR?=		${DESTDIR}/usr/ports
  LOCALBASE?=		/usr/local
  X11BASE?=		/usr/X11R6
  DISTDIR?=		${PORTSDIR}/distfiles/${DIST_SUBDIR}
--- 246,257 ----
  
  # These need to be absolute since we don't know how deep in the ports
  # tree we are and thus can't go relative.  They can, of course, be overridden
! # by individual Makefiles or local system make configuration.
! .if (${OPSYS} == "NetBSD")
! PORTSDIR?=		${DESTDIR}/usr/opt
! .else
  PORTSDIR?=		${DESTDIR}/usr/ports
+ .endif
  LOCALBASE?=		/usr/local
  X11BASE?=		/usr/X11R6
  DISTDIR?=		${PORTSDIR}/distfiles/${DIST_SUBDIR}
***************
*** 284,290 ****
--- 305,315 ----
  # Miscellaneous overridable commands:
  GMAKE?=			gmake
  XMKMF?=			xmkmf -a
+ .if (${OPSYS} == "NetBSD")
+ MD5?=			/usr/bin/md5
+ .else
  MD5?=			/sbin/md5
+ .endif
  MD5_FILE?=		${FILESDIR}/md5
  
  MAKE_FLAGS?=	-f
***************
*** 685,691 ****
  				${ECHO_MSG} "===>   Perhaps you forgot the -P flag to cvs co or update?"; \
  			fi; \
  		else \
! 			${ECHO_MSG} "===>  Applying FreeBSD patches for ${PKGNAME}" ; \
  			for i in ${PATCHDIR}/patch-*; do \
  				case $$i in \
  					*.orig|*~) \
--- 710,716 ----
  				${ECHO_MSG} "===>   Perhaps you forgot the -P flag to cvs co or update?"; \
  			fi; \
  		else \
! 			${ECHO_MSG} "===>  Applying ${OPSYS} patches for ${PKGNAME}" ; \
  			for i in ${PATCHDIR}/patch-*; do \
  				case $$i in \
  					*.orig|*~) \
***************
*** 693,699 ****
  						;; \
  					*) \
  						if [ ${PATCH_DEBUG_TMP} = yes ]; then \
! 							${ECHO_MSG} "===>   Applying FreeBSD patch $$i" ; \
  						fi; \
  						${PATCH} ${PATCH_ARGS} < $$i; \
  						;; \
--- 718,724 ----
  						;; \
  					*) \
  						if [ ${PATCH_DEBUG_TMP} = yes ]; then \
! 							${ECHO_MSG} "===>   Applying ${OPSYS} patch $$i" ; \
  						fi; \
  						${PATCH} ${PATCH_ARGS} < $$i; \
  						;; \
***************
*** 1140,1146 ****
  				notfound=1; \
  			fi; \
  		else \
! 			if which -s "$$prog"; then \
  				${ECHO_MSG} "===>  ${PKGNAME} depends on executable: $$prog - found"; \
  				notfound=0; \
  			else \
--- 1165,1171 ----
  				notfound=1; \
  			fi; \
  		else \
! 			if which "$$prog" > /dev/null 2>&1 ; then \
  				${ECHO_MSG} "===>  ${PKGNAME} depends on executable: $$prog - found"; \
  				notfound=0; \
  			else \
***************
*** 1167,1172 ****
--- 1192,1198 ----
  build-depends:	_DEPENDS_USE
  run-depends:	_DEPENDS_USE
  
+ # XXXthorpej -- This needs lots of work for NetBSD!
  lib-depends:
  .if defined(LIB_DEPENDS)
  .if defined(NO_DEPENDS)
Index: bsd.port.subdir.mk
===================================================================
RCS file: /mastersrc/netbsd/src/share/mk/bsd.port.subdir.mk,v
retrieving revision 1.1.1.1
retrieving revision 1.3
diff -c -r1.1.1.1 -r1.3
*** bsd.port.subdir.mk	1996/06/20 01:51:43	1.1.1.1
--- bsd.port.subdir.mk	1996/09/19 04:58:51	1.3
***************
*** 1,5 ****
  #	from: @(#)bsd.subdir.mk	5.9 (Berkeley) 2/1/91
! #	$Id: bsd.port.subdir.mk,v 1.1.1.1 1996/06/20 01:51:43 thorpej Exp $
  
  .MAIN: all
  
--- 1,5 ----
  #	from: @(#)bsd.subdir.mk	5.9 (Berkeley) 2/1/91
! # from FreeBSD Id: bsd.port.subdir.mk,v 1.14 1996/04/09 22:54:13 wosch Exp
  
  .MAIN: all
  
***************
*** 7,12 ****
--- 7,15 ----
  STRIP?=	-s
  .endif
  
+ .if !defined(OPSYS)	# XXX !!
+ OPSYS!=	uname -s
+ .endif
  
  ECHO_MSG?=	echo
  
***************
*** 71,77 ****
--- 74,84 ----
  	@make README.html
  .endif
  
+ .if (${OPSYS} == "NetBSD")
+ PORTSDIR ?= /usr/opt
+ .else
  PORTSDIR ?= /usr/ports
+ .endif
  TEMPLATES ?= ${PORTSDIR}/templates
  .if defined(PORTSTOP)
  README=	${TEMPLATES}/README.top
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199609190526.WAA08592>