Skip to content

Commit

Permalink
amd64: add an i386 include directory
Browse files Browse the repository at this point in the history
This directory will hold i386-specific headers that are needed for
-m32 support on amd64 and where the amd64 and i386 cases have too
little in common for combining them to make sense.  Files to be
installed will come in later commits.

With the currently required set of files, this could be done with
another INCGROUP in include/Makefile, but at least one file that
might want -m32 support (ieeefp.h) conflicts with a files installed
in /usr/include.

Reviewed by:	jhb, imp
  • Loading branch information
brooksdavis committed Jun 13, 2022
1 parent 43c72c4 commit a09ea2b
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Makefile.inc1
Original file line number Diff line number Diff line change
Expand Up @@ -1062,6 +1062,9 @@ _bootstrap-tools:
-p ${WORLDTMP}/usr >/dev/null
${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.include.dist \
-p ${WORLDTMP}/usr/include >/dev/null
.if ${TARGET_ARCH} == "amd64"
mkdir -p ${WORLDTMP}/usr/include/i386
.endif
ln -sf ${.CURDIR}/sys ${WORLDTMP}
.if ${MK_DEBUG_FILES} != "no"
${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.debug.dist \
Expand Down Expand Up @@ -1395,6 +1398,9 @@ distributeworld installworld stageworld: _installcheck_world .PHONY
-p ${DESTDIR}/${DISTDIR}/${dist}/usr >/dev/null
${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.include.dist \
-p ${DESTDIR}/${DISTDIR}/${dist}/usr/include >/dev/null
.if ${TARGET_ARCH} == "amd64"
-mkdir ${DESTDIR}/${DISTDIR}/usr/include/i386
.endif
.if ${MK_DEBUG_FILES} != "no"
${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.debug.dist \
-p ${DESTDIR}/${DISTDIR}/${dist}/usr/lib >/dev/null
Expand Down Expand Up @@ -1423,6 +1429,9 @@ distributeworld installworld stageworld: _installcheck_world .PHONY
sed -e 's#^\./#./${dist}/usr/#' >> ${METALOG}
${IMAKEENV} ${DISTR_MTREE} -C -f ${.CURDIR}/etc/mtree/BSD.include.dist | \
sed -e 's#^\./#./${dist}/usr/include/#' >> ${METALOG}
.if ${TARGET_ARCH} == "amd64"
echo "./${dist}/usr/include/i386 type=dir uname=root gname=wheel mode=0755" >> ${METALOG}
.endif
.if defined(_LIBCOMPAT)
${IMAKEENV} ${DISTR_MTREE} -C -f ${.CURDIR}/etc/mtree/BSD.lib${libcompat}.dist | \
sed -e 's#^\./#./${dist}/usr/#' >> ${METALOG}
Expand Down Expand Up @@ -2852,6 +2861,9 @@ native-xtools-install: .PHONY
-p ${NXBDESTDIR}/usr >/dev/null
${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.include.dist \
-p ${NXBDESTDIR}/usr/include >/dev/null
.if ${TARGET_ARCH} == "amd64"
mkdir -p ${NXBDESTDIR}/usr/include/i386
.endif
${_+_}cd ${.CURDIR}; ${NXBMAKE} \
DESTDIR=${NXBDESTDIR} \
-DNO_ROOT \
Expand Down Expand Up @@ -3545,6 +3557,9 @@ _xi-mtree: .PHONY
-p ${XDDESTDIR}/usr >/dev/null
${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.include.dist \
-p ${XDDESTDIR}/usr/include >/dev/null
.if ${TARGET_ARCH} == "amd64"
mkdir -p ${XDDESTDIR}/usr/include/i386
.endif
.if defined(_LIBCOMPAT)
${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.lib${libcompat}.dist \
-p ${XDDESTDIR}/usr >/dev/null
Expand Down
7 changes: 7 additions & 0 deletions include/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
PACKAGE=runtime
CLEANFILES= osreldate.h version
SUBDIR= arpa protocols rpcsvc rpc xlocale
.if ${MACHINE_CPUARCH} == "amd64"
SUBDIR+= i386
.endif
SUBDIR_PARALLEL=
INCS= a.out.h ar.h assert.h bitstring.h complex.h cpio.h _ctype.h ctype.h \
db.h \
Expand Down Expand Up @@ -338,6 +341,10 @@ compat:
mtree -deU ${NO_ROOT:D-W} ${MTREE_FOLLOWS_SYMLINKS} \
-f ${SRCTOP}/etc/mtree/BSD.include.dist \
-p ${SDESTDIR}${INCLUDEDIR} > /dev/null
.if ${MACHINE_CPUARCH} == "amd64"
${INSTALL} -d ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 755 \
${SDESTDIR}${INCLUDEDIR}/i386
.endif

copies: .PHONY .META
cd ${SDESTDIR}${INCLUDEDIR}; find ${LDIRS} ${LSUBDIRS} ${LSUBSUBDIRS} crypto \
Expand Down
7 changes: 7 additions & 0 deletions include/i386/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# i386 headers installed on amd64

.PATH: ${SRCTOP}/sys/i386/include
INCS=
INCSDIR= ${INCLUDEDIR}/i386

.include <bsd.prog.mk>

0 comments on commit a09ea2b

Please sign in to comment.