Install symlinks to individual headers instead of symlinks to directories
in the SHARED=symlinks case. Symlinks to directories only work if all the the necessary headers are in 1 directory, but the necessary headers are scattered for at least ipfilter headers in <netinet>. This change also avoids polluting /usr/include with non-headers; the /usr/include hierarchy is now independent of the setting of SHARED. Submitted by: ru (edited to fix netgraph/bluetooth/include and machine/pc) PR: 44148
This commit is contained in:
parent
e5f8aed520
commit
a270eca53b
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=114731
@ -279,13 +279,9 @@ _worldtmp:
|
|||||||
mkdir -p ${WORLDTMP}/legacy/${_dir}
|
mkdir -p ${WORLDTMP}/legacy/${_dir}
|
||||||
.endfor
|
.endfor
|
||||||
.for _dir in \
|
.for _dir in \
|
||||||
usr/bin usr/lib/compat/aout usr/libdata/ldscripts usr/libexec usr/share/misc
|
usr/bin usr/include usr/lib/compat/aout usr/libdata/ldscripts \
|
||||||
|
usr/libexec usr/share/misc
|
||||||
mkdir -p ${WORLDTMP}/${_dir}
|
mkdir -p ${WORLDTMP}/${_dir}
|
||||||
.endfor
|
|
||||||
.for _dir in \
|
|
||||||
arpa dev fs g++/backward g++/bits g++/ext isc isofs libmilter \
|
|
||||||
objc openssl protocols readline rpc rpcsvc security ufs
|
|
||||||
mkdir -p ${WORLDTMP}/usr/include/${_dir}
|
|
||||||
.endfor
|
.endfor
|
||||||
ln -sf ${.CURDIR}/sys ${WORLDTMP}
|
ln -sf ${.CURDIR}/sys ${WORLDTMP}
|
||||||
_legacy:
|
_legacy:
|
||||||
|
106
include/Makefile
106
include/Makefile
@ -1,10 +1,7 @@
|
|||||||
# @(#)Makefile 8.2 (Berkeley) 1/4/94
|
# @(#)Makefile 8.2 (Berkeley) 1/4/94
|
||||||
# $FreeBSD$
|
# $FreeBSD$
|
||||||
#
|
#
|
||||||
# Doing a make install builds /usr/include
|
# Doing a "make install" builds /usr/include.
|
||||||
#
|
|
||||||
# The ``rm -rf''s used below are safe because rm doesn't follow symbolic
|
|
||||||
# links.
|
|
||||||
|
|
||||||
CLEANFILES= osreldate.h version vers.c
|
CLEANFILES= osreldate.h version vers.c
|
||||||
SUBDIR= arpa protocols rpcsvc rpc
|
SUBDIR= arpa protocols rpcsvc rpc
|
||||||
@ -39,13 +36,10 @@ LSUBDIRS= cam/scsi dev/an dev/ic dev/iicbus dev/firewire dev/ofw \
|
|||||||
fs/fdescfs fs/fifofs fs/msdosfs fs/ntfs fs/nullfs fs/nwfs fs/portalfs \
|
fs/fdescfs fs/fifofs fs/msdosfs fs/ntfs fs/nullfs fs/nwfs fs/portalfs \
|
||||||
fs/procfs fs/smbfs fs/umapfs fs/unionfs isofs/cd9660 \
|
fs/procfs fs/smbfs fs/umapfs fs/unionfs isofs/cd9660 \
|
||||||
netatm/ipatm netatm/sigpvc netatm/spans netatm/uni \
|
netatm/ipatm netatm/sigpvc netatm/spans netatm/uni \
|
||||||
netgraph/bluetooth/include \
|
|
||||||
security/mac_biba security/mac_bsdextended security/mac_lomac\
|
security/mac_biba security/mac_bsdextended security/mac_lomac\
|
||||||
security/mac_mls security/mac_partition ufs/ffs ufs/ufs
|
security/mac_mls security/mac_partition ufs/ffs ufs/ufs
|
||||||
|
|
||||||
# For SHARED=symlinks, cam, netatm, and netgraph are symlinks, so cam/scsi,
|
LSUBSUBDIRS= netgraph/bluetooth/include
|
||||||
# netatm/*, and netgraph/* are taken care of
|
|
||||||
LSYMSUBDIRS= ${LSUBDIRS:Ncam/scsi:Nnetatm/*:Nnetgraph/*}
|
|
||||||
|
|
||||||
# Define SHARED to indicate whether you want symbolic links to the system
|
# Define SHARED to indicate whether you want symbolic links to the system
|
||||||
# source (``symlinks''), or a separate copy (``copies''). ``symlinks'' is
|
# source (``symlinks''), or a separate copy (``copies''). ``symlinks'' is
|
||||||
@ -64,7 +58,7 @@ osreldate.h: ${.CURDIR}/../sys/conf/newvers.sh \
|
|||||||
. ${.CURDIR}/../sys/conf/newvers.sh; \
|
. ${.CURDIR}/../sys/conf/newvers.sh; \
|
||||||
echo "$$COPYRIGHT" > osreldate.h; \
|
echo "$$COPYRIGHT" > osreldate.h; \
|
||||||
echo "#ifdef _KERNEL" >> osreldate.h; \
|
echo "#ifdef _KERNEL" >> osreldate.h; \
|
||||||
echo '#error "/usr/include/osreldate.h cannot be used in the kernel, use sys/param.h"' >> osreldate.h; \
|
echo '#error "<osreldate.h> cannot be used in the kernel, use <sys/param.h>"' >> osreldate.h; \
|
||||||
echo "#else" >> osreldate.h; \
|
echo "#else" >> osreldate.h; \
|
||||||
echo \#'undef __FreeBSD_version' >> osreldate.h; \
|
echo \#'undef __FreeBSD_version' >> osreldate.h; \
|
||||||
echo \#'define __FreeBSD_version' $$RELDATE >> osreldate.h; \
|
echo \#'define __FreeBSD_version' $$RELDATE >> osreldate.h; \
|
||||||
@ -80,48 +74,82 @@ INCSLINKS+= machine/$i ${INCLUDEDIR}/$i
|
|||||||
INCSLINKS+= posix4/$i ${INCLUDEDIR}/$i
|
INCSLINKS+= posix4/$i ${INCLUDEDIR}/$i
|
||||||
.endfor
|
.endfor
|
||||||
|
|
||||||
copies:
|
.include <bsd.prog.mk>
|
||||||
.for i in ${LDIRS} ${LSYMSUBDIRS} machine crypto
|
|
||||||
if [ -L ${DESTDIR}/usr/include/$i ]; then \
|
installincludes: ${SHARED}
|
||||||
rm -f ${DESTDIR}/usr/include/$i; \
|
${SHARED}: compat
|
||||||
|
|
||||||
|
# Take care of stale directory-level symlinks.
|
||||||
|
compat:
|
||||||
|
.for i in ${LDIRS} ${LSUBDIRS} machine crypto
|
||||||
|
if [ -L ${DESTDIR}${INCLUDEDIR}/$i ]; then \
|
||||||
|
rm -f ${DESTDIR}${INCLUDEDIR}/$i; \
|
||||||
fi
|
fi
|
||||||
.endfor
|
.endfor
|
||||||
mtree -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/../etc/mtree/BSD.include.dist \
|
mtree -deU ${MTREE_FOLLOWS_SYMLINKS} \
|
||||||
-p ${DESTDIR}/usr/include
|
-f ${.CURDIR}/../etc/mtree/BSD.include.dist \
|
||||||
.for i in ${LDIRS} ${LSUBDIRS}
|
-p ${DESTDIR}${INCLUDEDIR}
|
||||||
|
|
||||||
|
copies:
|
||||||
|
.for i in ${LDIRS} ${LSUBDIRS} crypto machine machine/pc
|
||||||
|
.if exists(${DESTDIR}${INCLUDEDIR}/$i)
|
||||||
|
cd ${DESTDIR}${INCLUDEDIR}/$i; \
|
||||||
|
for h in *.h; do \
|
||||||
|
if [ -L $$h ]; then rm -f $$h; fi; \
|
||||||
|
done
|
||||||
|
.endif
|
||||||
|
.endfor
|
||||||
|
.for i in ${LDIRS} ${LSUBDIRS} ${LSUBSUBDIRS}
|
||||||
cd ${.CURDIR}/../sys; \
|
cd ${.CURDIR}/../sys; \
|
||||||
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 $i/*.h \
|
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 $i/*.h \
|
||||||
${DESTDIR}/usr/include/$i
|
${DESTDIR}${INCLUDEDIR}/$i
|
||||||
.endfor
|
.endfor
|
||||||
cd ${.CURDIR}/../sys; \
|
cd ${.CURDIR}/../sys; \
|
||||||
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 opencrypto/*.h \
|
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 opencrypto/*.h \
|
||||||
${DESTDIR}/usr/include/crypto
|
${DESTDIR}${INCLUDEDIR}/crypto
|
||||||
.if exists(${.CURDIR}/../sys/${MACHINE_ARCH}/include)
|
|
||||||
cd ${.CURDIR}/../sys/${MACHINE_ARCH}/include; \
|
cd ${.CURDIR}/../sys/${MACHINE_ARCH}/include; \
|
||||||
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
|
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
|
||||||
${DESTDIR}/usr/include/machine
|
${DESTDIR}${INCLUDEDIR}/machine
|
||||||
.if exists(${.CURDIR}/../sys/${MACHINE_ARCH}/include/pc)
|
.if exists(${.CURDIR}/../sys/${MACHINE_ARCH}/include/pc)
|
||||||
cd ${.CURDIR}/../sys/${MACHINE_ARCH}/include/pc; \
|
cd ${.CURDIR}/../sys/${MACHINE_ARCH}/include/pc; \
|
||||||
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
|
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
|
||||||
${DESTDIR}/usr/include/machine/pc
|
${DESTDIR}${INCLUDEDIR}/machine/pc
|
||||||
.endif
|
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
symlinks:
|
symlinks:
|
||||||
@${ECHO} "Setting up symlinks to kernel source tree..."
|
@${ECHO} "Setting up symlinks to kernel source tree..."
|
||||||
.for i in ${LDIRS}
|
.for i in ${LDIRS}
|
||||||
rm -rf ${DESTDIR}/usr/include/$i
|
cd ${.CURDIR}/../sys/$i; \
|
||||||
ln -s ../../sys/$i ${DESTDIR}/usr/include/$i
|
for h in *.h; do \
|
||||||
|
ln -fs ../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
|
||||||
|
done
|
||||||
.endfor
|
.endfor
|
||||||
rm -rf ${DESTDIR}/usr/include/crypto
|
.for i in ${LSUBDIRS}
|
||||||
ln -s ../../sys/opencrypto ${DESTDIR}/usr/include/crypto
|
cd ${.CURDIR}/../sys/$i; \
|
||||||
.for i in ${LSYMSUBDIRS}
|
for h in *.h; do \
|
||||||
rm -rf ${DESTDIR}/usr/include/$i
|
ln -fs ../../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
|
||||||
ln -s ../../../sys/$i ${DESTDIR}/usr/include/$i
|
done
|
||||||
.endfor
|
.endfor
|
||||||
rm -rf ${DESTDIR}/usr/include/machine
|
.for i in ${LSUBSUBDIRS}
|
||||||
ln -s ../../sys/${MACHINE_ARCH}/include ${DESTDIR}/usr/include/machine
|
cd ${.CURDIR}/../sys/$i; \
|
||||||
|
for h in *.h; do \
|
||||||
.include <bsd.prog.mk>
|
ln -fs ../../../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
|
||||||
|
done
|
||||||
installincludes: ${SHARED}
|
.endfor
|
||||||
|
cd ${.CURDIR}/../sys/opencrypto; \
|
||||||
|
for h in *.h; do \
|
||||||
|
ln -fs ../../../sys/opencrypto/$$h \
|
||||||
|
${DESTDIR}${INCLUDEDIR}/crypto; \
|
||||||
|
done
|
||||||
|
cd ${.CURDIR}/../sys/${MACHINE_ARCH}/include; \
|
||||||
|
for h in *.h; do \
|
||||||
|
ln -fs ../../../sys/${MACHINE_ARCH}/include/$$h \
|
||||||
|
${DESTDIR}${INCLUDEDIR}/machine; \
|
||||||
|
done
|
||||||
|
.if exists(${.CURDIR}/../sys/${MACHINE_ARCH}/include/pc)
|
||||||
|
cd ${.CURDIR}/../sys/${MACHINE_ARCH}/include/pc; \
|
||||||
|
for h in *.h; do \
|
||||||
|
ln -fs ../../../../sys/${MACHINE_ARCH}/include/pc/$$h \
|
||||||
|
${DESTDIR}${INCLUDEDIR}/machine/pc; \
|
||||||
|
done
|
||||||
|
.endif
|
||||||
|
Loading…
Reference in New Issue
Block a user