head	1.11;
access;
symbols
	perseant-exfatfs-base-20250801:1.11
	perseant-exfatfs-base-20240630:1.11
	perseant-exfatfs:1.11.0.24
	perseant-exfatfs-base:1.11
	cjep_sun2x:1.11.0.22
	cjep_sun2x-base:1.11
	cjep_staticlib_x-base1:1.11
	cjep_staticlib_x:1.11.0.20
	cjep_staticlib_x-base:1.11
	phil-wifi-20200421:1.11
	phil-wifi-20200411:1.11
	phil-wifi-20200406:1.11
	pgoyette-compat-merge-20190127:1.11
	pgoyette-compat-20190127:1.11
	pgoyette-compat-20190118:1.11
	pgoyette-compat-1226:1.11
	pgoyette-compat-1126:1.11
	pgoyette-compat-1020:1.11
	pgoyette-compat-0930:1.11
	pgoyette-compat-0906:1.11
	pgoyette-compat-0728:1.11
	pgoyette-compat-0625:1.11
	pgoyette-compat-0521:1.11
	pgoyette-compat-0502:1.11
	pgoyette-compat-0422:1.11
	pgoyette-compat-0415:1.11
	pgoyette-compat-0407:1.11
	pgoyette-compat-0330:1.11
	pgoyette-compat-0322:1.11
	pgoyette-compat-0315:1.11
	pgoyette-compat:1.11.0.18
	pgoyette-compat-base:1.11
	perseant-stdc-iso10646:1.11.0.16
	perseant-stdc-iso10646-base:1.11
	prg-localcount2-base3:1.11
	prg-localcount2-base2:1.11
	prg-localcount2-base1:1.11
	prg-localcount2:1.11.0.14
	prg-localcount2-base:1.11
	pgoyette-localcount-20170426:1.11
	bouyer-socketcan-base1:1.11
	pgoyette-localcount-20170320:1.11
	bouyer-socketcan:1.11.0.12
	bouyer-socketcan-base:1.11
	pgoyette-localcount-20170107:1.11
	pgoyette-localcount-20161104:1.11
	localcount-20160914:1.11
	pgoyette-localcount-20160806:1.11
	pgoyette-localcount-20160726:1.11
	pgoyette-localcount:1.11.0.10
	pgoyette-localcount-base:1.11
	netbsd-5-2-3-RELEASE:1.4.2.1
	netbsd-5-1-5-RELEASE:1.4
	yamt-pagecache-base9:1.11
	yamt-pagecache-tag8:1.11
	tls-earlyentropy:1.11.0.6
	tls-earlyentropy-base:1.11
	riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.11
	riastradh-drm2-base3:1.11
	netbsd-5-2-2-RELEASE:1.4.2.1
	netbsd-5-1-4-RELEASE:1.4
	netbsd-5-2-1-RELEASE:1.4.2.1
	netbsd-5-1-3-RELEASE:1.4
	agc-symver:1.11.0.8
	agc-symver-base:1.11
	tls-maxphys-base:1.11
	yamt-pagecache-base8:1.11
	netbsd-5-2:1.4.2.1.0.2
	yamt-pagecache-base7:1.11
	netbsd-5-2-RELEASE:1.4.2.1
	netbsd-5-2-RC1:1.4.2.1
	yamt-pagecache-base6:1.11
	yamt-pagecache-base5:1.11
	yamt-pagecache-base4:1.11
	netbsd-5-1-2-RELEASE:1.4
	netbsd-5-1-1-RELEASE:1.4
	yamt-pagecache-base3:1.11
	yamt-pagecache-base2:1.11
	yamt-pagecache:1.11.0.4
	yamt-pagecache-base:1.11
	bouyer-quota2-nbase:1.11
	bouyer-quota2:1.11.0.2
	bouyer-quota2-base:1.11
	matt-nb5-pq3:1.4.0.10
	matt-nb5-pq3-base:1.4
	netbsd-5-1:1.4.0.8
	netbsd-5-1-RELEASE:1.4
	netbsd-5-1-RC4:1.4
	netbsd-5-1-RC3:1.4
	netbsd-5-1-RC2:1.4
	netbsd-5-1-RC1:1.4
	netbsd-5-0-2-RELEASE:1.4
	matt-nb5-mips64-premerge-20091211:1.4
	matt-premerge-20091211:1.10
	matt-nb5-mips64-u2-k2-k4-k7-k8-k9:1.4
	matt-nb4-mips64-k7-u2a-k9b:1.4
	matt-nb5-mips64-u1-k1-k5:1.4
	matt-nb5-mips64:1.4.0.6
	netbsd-5-0-1-RELEASE:1.4
	jym-xensuspend-nbase:1.5
	netbsd-5-0:1.4.0.4
	netbsd-5-0-RELEASE:1.4
	netbsd-5-0-RC4:1.4
	netbsd-5-0-RC3:1.4
	netbsd-5-0-RC2:1.4
	jym-xensuspend:1.5.0.2
	jym-xensuspend-base:1.5
	netbsd-5-0-RC1:1.4
	netbsd-5:1.4.0.2
	netbsd-5-base:1.4;
locks; strict;
comment	@# @;


1.11
date	2009.12.13.09.33.08;	author mrg;	state dead;
branches;
next	1.10;

1.10
date	2009.11.09.15.46.04;	author njoly;	state Exp;
branches;
next	1.9;

1.9
date	2009.11.02.10.13.19;	author plunky;	state Exp;
branches;
next	1.8;

1.8
date	2009.07.21.01.05.35;	author mrg;	state Exp;
branches;
next	1.7;

1.7
date	2009.07.21.00.23.02;	author mrg;	state Exp;
branches;
next	1.6;

1.6
date	2009.07.21.00.12.00;	author mrg;	state Exp;
branches;
next	1.5;

1.5
date	2009.01.19.07.16.38;	author jmmv;	state Exp;
branches;
next	1.4;

1.4
date	2008.10.27.07.17.05;	author mrg;	state Exp;
branches
	1.4.2.1
	1.4.6.1;
next	1.3;

1.3
date	2008.10.27.03.17.58;	author mrg;	state Exp;
branches;
next	1.2;

1.2
date	2008.10.26.12.58.38;	author mrg;	state Exp;
branches;
next	1.1;

1.1
date	2008.10.26.07.38.28;	author mrg;	state Exp;
branches;
next	;

1.4.2.1
date	2011.01.06.05.19.55;	author riz;	state dead;
branches;
next	;

1.4.6.1
date	2009.12.14.06.20.58;	author mrg;	state dead;
branches;
next	;


desc
@@


1.11
log
@these files are no longer used and may now rest and bitrot without
hurting anyone...
@
text
@#! /bin/sh

# generate src/compat/* Makefile's based on SUBDIR values in
# the main source tree

srcdir=/usr/src
rwsrcdir=/home/current/src
MAKE=${MAKE-make}

CHECK_SUBDIRS="gnu/lib gnu/lib/libgcc4 lib lib/csu lib/i18n_module external/bsd/atf/lib external/bsd/openldap/lib lib/libpam/modules external/bsd/bind/lib external/bsd/iscsi external/bsd/libevent external/gpl3/binutils/lib crypto/external/bsd/openssl/lib crypto/external/bsd/netpgp crypto/external/bsd/openssh"

# lib/csu is spsecial
# lib/libm needs to be special -- i387
# gnu/lib/libsupc++ -- fails to get NOPROFILE properly

tmpdir=`mktemp -d /var/tmp/build-makefiles-$$.XXXXXX` || exit 1

write_if_new() {
	_file="$1"
	_new="$2"
}

for _dir in ${CHECK_SUBDIRS}; do

	# set this to true if the needs to be no master subdir Makefile
	_need_no_subdir=false

	if [ ${_dir} = "lib/csu" ]; then
		_subdirs="i386_elf sparc_elf"
		_need_no_subdir=true
	else
		_subdirs=`cd ${srcdir}/${_dir}; ${MAKE} -V SUBDIR`
	fi

	echo "looking in: $_dir: subdirs $_subdirs"
	for _sd in $_subdirs; do
		# skip lib/csu --
		if [ "$_dir" = "lib" -a "$_sd" = "csu" ]; then
			continue
		fi

		# skip .WAIT --
		if [ "$_sd" = ".WAIT" ]; then
			continue
		fi

		# skip a bunch of non-lib subdirs --
		case "$_dir" in
		  external/bsd/fetch | \
		  external/bsd/file | \
		  external/bsd/iscsi | \
		  external/bsd/libarchive | \
		  crypto/external/bsd/netpgp | \
		  crypto/external/bsd/openssh )
			if [ "$_sd" != "lib" ]; then
				continue;
			fi
			_need_no_subdir=true
		esac

		_libdplibs="`cd ${srcdir}/${_dir}/${_sd}; ${MAKE} -V LIBDPLIBS | sed 's,\({NETBSDSRCDIR}\),\1/compat,g'`"
		echo "creating stuff for subdir: $_sd"
		echo " - libdplibs = ${_libdplibs}"
		mkdir -p ${rwsrcdir}/compat/${_dir}/${_sd}
		(
		 echo -n '#	$Net'
		 echo 'BSD$'
		 echo '#	Generated from: $NetBSD: build-makefiles,v 1.10 2009/11/09 15:46:04 njoly Exp $' | sed -e 's/\$//g'
		 cat <<'EOF'

NOLINT= # defined
NOMAN=	# defined
NONLS=	# defined
NOINFO=	# defined
NOSHARE=	# defined
EOF
		 # XXX various hacks
		 case "${_sd}" in
		 libbfd)
			echo "NOLINKLIB=	# defined"
			;;
		 libsupc++4)
			echo "NOPROFILE=	# defined"
			;;
		 libc)
			echo "# XXX"
			echo "nsparser.h: nsparser.c"
			;;
		 libpcap)
			echo "# XXX"
			echo "grammar.h: grammar.c"
			;;
		 libipsec)
			echo "# XXX"
			echo "policy_parse.h: policy_parse.c"
			;;
		 esac

		 if [ -n "${_libdplibs}" ]; then
			echo "LIBDPLIBS=	${_libdplibs}"
		 fi
		 cat <<'EOF'

NOCHECKVER=	# defined

.include <bsd.obj.mk>

# Resolve pathnames in variables.
_RESOLVE_VARS=  CFLAGS CPPFLAGS DPADD LDADD LIBDPLIBS LIB_ROOT_DIR
.for var in ${_RESOLVE_VARS}
${var}:=        ${${var}}
.endfor

.include <bsd.own.mk>

_CURDIR:= ${.CURDIR}

EOF
		 printf ".PATH: \${NETBSDSRCDIR}/${_dir}/${_sd}\n"
		 printf ".CURDIR:=\${NETBSDSRCDIR}/${_dir}/${_sd}\n\n"
		 cat <<'EOF'
.include "${NETBSDSRCDIR}/compat/Makefile.compat"
.include "${.CURDIR}/Makefile"

# Resolve pathnames from "real" Makefile, and switch .CURDIR back.
_RESOLVE_VARS=  CFLAGS CPPFLAGS DPADD LDADD ARCHDIR COMPATDIR COMPATARCHDIR LIBCDIR RPC_INCS RPC_XDIR LIBEDITDIR MODOBJDIR RUMPTOP
.for var in ${_RESOLVE_VARS}
${var}:=        ${${var}}
.endfor

.CURDIR:=       ${_CURDIR}
.undef          _CURDIR
EOF
		) > ${rwsrcdir}/compat/${_dir}/${_sd}/Makefile
	done

	if [ "${_need_no_subdir}" != "true" ]; then
		(printf '#	$'NetBSD'$\n\n'
		 printf ".include <bsd.own.mk>\n\n"
		 printf "_CURDIR:= \${.CURDIR}\n\n"
		 printf ".CURDIR:=\${NETBSDSRCDIR}/${_dir}\n\n"
		 printf ".include "'"'"\${.CURDIR}/Makefile"'"'"\n\n"
		 printf ".CURDIR:= \${_CURDIR}\n"
		) > ${rwsrcdir}/compat/${_dir}/Makefile

		if [ -f "${srcdir}/${_dir}/Makefile.inc" ]; then
			(printf '#	$'NetBSD'$\n\n'
			 printf ".include <bsd.own.mk>\n\n"
			 printf "_CURDIR:= \${.CURDIR}\n\n"
			 printf ".include "'"'"\${NETBSDSRCDIR}/${_dir}/Makefile.inc"'"'"\n\n"
			 printf ".CURDIR:= \${_CURDIR}\n"
			) > ${rwsrcdir}/compat/${_dir}/Makefile.inc
		fi
	fi

done
@


1.10
log
@- Add external/gpl3/binutils/lib to the directory list.
- libbfd require NOLINKLIB.
@
text
@d68 1
a68 1
		 echo '#	Generated from: $NetBSD: build-makefiles,v 1.9 2009/11/02 10:13:19 plunky Exp $' | sed -e 's/\$//g'
@


1.9
log
@switch build to use libevent-1.4.12-stable from external
@
text
@d10 1
a10 1
CHECK_SUBDIRS="gnu/lib gnu/lib/libgcc4 lib lib/csu lib/i18n_module external/bsd/atf/lib external/bsd/openldap/lib lib/libpam/modules external/bsd/bind/lib external/bsd/iscsi external/bsd/libevent crypto/external/bsd/openssl/lib crypto/external/bsd/netpgp crypto/external/bsd/openssh"
d68 1
a68 1
		 echo '#	Generated from: $NetBSD: build-makefiles,v 1.8 2009/07/21 01:05:35 mrg Exp $' | sed -e 's/\$//g'
d79 3
@


1.8
log
@do not need the postfix libraries.
@
text
@d10 1
a10 1
CHECK_SUBDIRS="gnu/lib gnu/lib/libgcc4 lib lib/csu lib/i18n_module external/bsd/atf/lib external/bsd/openldap/lib lib/libpam/modules external/bsd/bind/lib external/bsd/iscsi crypto/external/bsd/openssl/lib crypto/external/bsd/netpgp crypto/external/bsd/openssh"
d68 1
a68 1
		 echo '#	Generated from: $NetBSD: build-makefiles,v 1.7 2009/07/21 00:23:02 mrg Exp $' | sed -e 's/\$//g'
@


1.7
log
@fix the generated from id.
don't generate some subdir makefiles.
@
text
@d10 1
a10 1
CHECK_SUBDIRS="gnu/lib gnu/lib/libgcc4 lib lib/csu lib/i18n_module external/bsd/atf/lib external/bsd/openldap/lib lib/libpam/modules external/bsd/bind/lib external/ibm-public/postfix/lib external/bsd/iscsi crypto/external/bsd/openssl/lib crypto/external/bsd/netpgp crypto/external/bsd/openssh"
d68 1
a68 1
		 echo '#	Generated from: $NetBSD: build-makefiles,v 1.6 2009/07/21 00:12:00 mrg Exp $' | sed -e 's/\$//g'
@


1.6
log
@bring this much closer to reality:

- add many subdirs of libs missing
- output a literal $NetBSD$ as well as the expanded version of this script
- special case a bunch of the external subdirs, since some of the library
  subdirs exist in toplevel directory, not the "lib" directory
@
text
@d24 4
d30 1
d48 1
a48 1
		case "$_dir/$_sd" in
d58 1
d68 1
a68 1
		 echo '#	Generated from: $NetBSD: build-makefiles,v 1.4 2008/10/27 07:17:05 mrg Exp $' | sed -e 's/$//g'
d134 1
a134 1
	if [ "${_dir}" != "lib/csu" ]; then
@


1.5
log
@Generate compatibility Makefiles for the libraries provided by ATF.
@
text
@d10 2
a11 1
CHECK_SUBDIRS="gnu/lib gnu/lib/libgcc4 lib lib/csu lib/i18n_module external/bsd/atf/lib external/bsd/openldap/lib lib/libpam/modules"
d16 7
d36 1
d41 15
a55 1
		_libdplibs="`cd ${srcdir}/${_dir}/${_sd}; ${MAKE} -V LIBDPLIBS`"
d60 3
a63 1
#	$NetBSD: build-makefiles,v 1.4 2008/10/27 07:17:05 mrg Exp $
d105 2
d128 1
a128 1
	if [ "${_dir}" = "lib" -a "${_sd}" = "csu" ]; then
d130 1
d139 1
d146 1
@


1.4
log
@- add lib/libpam/modules
- fix ipsec special case
@
text
@d10 1
a10 1
CHECK_SUBDIRS="gnu/lib gnu/lib/libgcc4 lib lib/csu lib/i18n_module external/bsd/openldap/lib lib/libpam/modules"
d38 1
a38 1
#	$NetBSD: build-makefiles,v 1.3 2008/10/27 03:17:58 mrg Exp $
@


1.4.2.1
log
@Apply patch (requested by mrg in ticket #1499):

src/compat version 2.  this allows building any number of alternate
library / program target ABIs.  rather than duplicating the list of
subdirs and Makefiles to build, it re-traverses the necessary ones.
details:
- add support for MAKEDIRTARGETENV to share/mk
- renames LD32DIR to MLIBDIR
- fixes library builds for some subdirs (more was built than needed)
- fixes /bin & /sbin apps in compat mode
- reduces complexity in src/compat and the rest of the tree
- updates ldd netbsd32 support
@
text
@d38 1
a38 1
#	$NetBSD: build-makefiles,v 1.4 2008/10/27 07:17:05 mrg Exp $
@


1.4.6.1
log
@merge the new src/compat build into the place it was actually born.
this replaces the old src/compat with a method that re-traverses the
library directories with a different set of flags, and is capable of
building more than one compat ABI.
@
text
@d38 1
a38 1
#	$NetBSD: build-makefiles,v 1.4 2008/10/27 07:17:05 mrg Exp $
@


1.3
log
@parse LIBDPLIBS out of each subdir Makefile, and set it in the compat
Makefile if so.  force early eval of LIBDPLIBS.  now compat libs that
need to link against other libs will find them at build time.
@
text
@d10 1
a10 1
CHECK_SUBDIRS="gnu/lib gnu/lib/libgcc4 lib lib/csu lib/i18n_module external/bsd/openldap/lib"
d34 1
d38 1
a38 1
#	$NetBSD: build-makefiles,v 1.2 2008/10/26 12:58:38 mrg Exp $
d59 1
a59 1
		 libc)
d61 1
a61 1
			echo "policy_parser.h: policy_parse.c"
d75 1
a75 1
_RESOLVE_VARS=  CFLAGS CPPFLAGS DPADD LDADD LIBDPLIBS
@


1.2
log
@make this almost output almost identical to what is about to be checked in.
@
text
@d32 1
d37 1
a37 1
#	$NetBSD: build-makefiles,v 1.1 2008/10/26 07:38:28 mrg Exp $
d45 3
a47 1
		 if [ "${_sd}" = "libsupc++4" ]; then
d49 17
d74 1
a74 1
_RESOLVE_VARS=  CFLAGS CPPFLAGS DPADD LDADD
d100 1
a100 1
	if [ ${_dir} != "lib/csu" ]; then
a101 1
		 #printf ".include <bsd.obj.mk>\n\n"
@


1.1
log
@build 32 bit compat libraries and ld.elf_so for amd64 and sparc64 builds.

two issues remain:
- LIBDPLIBS isn't working correctly, requiring hand-holding builds
- libc, libipsec, and libpcap have yacc issues, also requiring hand holding


ideally this will be replaced with a better method that can handle more
than one compat target, but i can't get that working yet.  see the README
file for mroe details.
@
text
@a10 1
CHECK_SUBDIRS="lib/csu"
d36 1
a36 1
#	$NetBSD$
a50 9
# XXX
.if ${MACHINE_ARCH} == "sparc64"
ARCHSUBDIR=		sparc
COMMON_ARCHSUBDIR=	sparc
.elif ${MACHINE_ARCH} == "sparc64"
ARCHSUBDIR=		i386
COMMON_ARCHSUBDIR=	i386
.endif

d80 1
a80 9
	(printf '#	$'NetBSD'$\n\n'
	 #printf ".include <bsd.obj.mk>\n\n"
	 printf "_CURDIR:= \${.CURDIR}\n\n"
	 printf ".CURDIR:=\${NETBSDSRCDIR}/${_dir}\n\n"
	 printf ".include "'"'"\${.CURDIR}/Makefile"'"'"\n\n"
	 printf ".CURDIR:= \${_CURDIR}\n"
	) > ${rwsrcdir}/compat/${_dir}/Makefile

	if [ -f "${srcdir}/${_dir}/Makefile.inc" ]; then
d82 1
d84 2
a85 1
		 printf ".include "'"'"\${NETBSDSRCDIR}/${_dir}/Makefile.inc"'"'"\n\n"
d87 9
a95 1
		) > ${rwsrcdir}/compat/${_dir}/Makefile.inc
@

