Date: Wed, 28 Mar 2018 16:17:29 +0000 From: Brooks Davis <brooks@freebsd.org> To: Daniel Braniss <danny@cs.huji.ac.il> Cc: Ian Lepore <ian@freebsd.org>, freebsd-hackers@freebsd.org Subject: Re: how to add local changes to buildworld? Message-ID: <20180328161729.GD88362@spindle.one-eyed-alien.net> In-Reply-To: <F6C16FA2-8E75-4C57-B764-1E2029ACDBD1@cs.huji.ac.il> References: <D8B09664-B9FF-4539-8D43-99E215D46E3D@cs.huji.ac.il> <1522169225.49673.36.camel@freebsd.org> <539E3F8D-8275-4904-8D19-8FB31C05787C@cs.huji.ac.il> <1522247949.49673.54.camel@freebsd.org> <F6C16FA2-8E75-4C57-B764-1E2029ACDBD1@cs.huji.ac.il>
next in thread | previous in thread | raw e-mail | index | archive | help
--V88s5gaDVPzZ0KCq Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Mar 28, 2018 at 07:05:03PM +0300, Daniel Braniss wrote: >=20 >=20 > > On 28 Mar 2018, at 17:39, Ian Lepore <ian@freebsd.org> wrote: > >=20 > > On Wed, 2018-03-28 at 08:50 +0300, Daniel Braniss wrote: > >>=20 > >>>=20 > >>> On 27 Mar 2018, at 19:47, Ian Lepore <ian@freebsd.org> wrote: > >>>=20 > >>> On Tue, 2018-03-27 at 19:20 +0300, Daniel Braniss wrote: > >>>>=20 > >>>> Hi, > >>>> I have some local additions which int the past, after making changes > >>>> to some Makefiles, etc, I got them compiled > >>>> but somehow, things stopped working after 11, so I???m now trying to= do > >>>> a fresh set of patches, > >>>> and was wondering if there is some docs around on how to to this > >>>> cleanly? trying to figure out the *.mk is becoming a bit complicated. > >>>> thanks, > >>>> danny > >>>>=20 > >>> If you're asking what I think (you want to add code of your own into > >>> the buildworld), just add LOCAL_DIRS=3D"path/to/dir1 path/to/dir2" to= the > >>> buildworld command line and it will visit your directories and run the > >>> same targets there as for standard freebsd dirs (so your makefiles ha= ve > >>> to have those targets, mostly easily accomplished by including the > >>> usual bsd..mk where foo=3Dprog|lib|subdir|whatever. > >>>=20 > >>> The local dir paths in LOCAL_DIRS must be relative to the top-level > >>> freebsd source dir, you can't use absolute paths (but you can use > >>> relative paths that take you outside the freebsd path, I think, like > >>> ../mysources/project1). > >>>=20 > >>> -- Ian > >>>=20 > >> I guess in my haste I was not clear enough :-) > >> my problem is the dependency, > >> in particular, it???s a pam module, that needs a local library. in the= past the library was compiled first, and then the module, > >> now it still happens, but the module does not find the library, which = has been compiled! there is a new piece of mail that > >> i???m missing :-(=20 > >> i???ll try again with LOCAL_DIRS. > >> thanks > >> danny > >=20 > > Oh yeah, libraries... there is also a LOCAL_LIB_DIRS you can set to > > list libraries. But looking at Makefile.inc1 it builds the local lib > > dirs after the other local dirs, which seems completely wrong and > > useless. I think the LOCAL_LIB_DIRS should be built along with the > > base system dirs; the attached patch would do that. > > > > -- Ian > > Index: Makefile.inc1 > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > --- Makefile.inc1 (revision 331499) > > +++ Makefile.inc1 (working copy) > > @@ -241,6 +241,17 @@ X${BINUTIL}?=3D ${${BINUTIL}} > > SUBDIR=3D ${SUBDIR_OVERRIDE} > > .else > > SUBDIR=3D lib libexec > > +# Add LOCAL_LIB_DIRS, but only if they will not be picked up as a SUBD= IR > > +# of a LOCAL_DIRS directory. This allows LOCAL_DIRS=3Dfoo and > > +# LOCAL_LIB_DIRS=3Dfoo/lib to behave as expected. > > +.for _DIR in ${LOCAL_DIRS:M*/} ${LOCAL_DIRS:N*/:S|$|/|} > > +_REDUNDANT_LIB_DIRS+=3D ${LOCAL_LIB_DIRS:M${_DIR}*} > > +.endfor > > +.for _DIR in ${LOCAL_LIB_DIRS} > > +.if ${_DIR} =3D=3D ".WAIT" || (empty(_REDUNDANT_LIB_DIRS:M${_DIR}) && = exists(${.CURDIR}/${_DIR}/Makefile)) > > +SUBDIR+=3D ${_DIR} > > +.endif > > +.endfor > > .if !defined(NO_ROOT) && (make(installworld) || make(install)) > > # Ensure libraries are installed before progressing. > > SUBDIR+=3D.WAIT > > @@ -282,17 +293,6 @@ SUBDIR+=3Dcontrib/ofed > > SUBDIR+=3D ${_DIR} > > .endif > > .endfor > > -# Add LOCAL_LIB_DIRS, but only if they will not be picked up as a SUBD= IR > > -# of a LOCAL_DIRS directory. This allows LOCAL_DIRS=3Dfoo and > > -# LOCAL_LIB_DIRS=3Dfoo/lib to behave as expected. > > -.for _DIR in ${LOCAL_DIRS:M*/} ${LOCAL_DIRS:N*/:S|$|/|} > > -_REDUNDANT_LIB_DIRS+=3D ${LOCAL_LIB_DIRS:M${_DIR}*} > > -.endfor > > -.for _DIR in ${LOCAL_LIB_DIRS} > > -.if ${_DIR} =3D=3D ".WAIT" || (empty(_REDUNDANT_LIB_DIRS:M${_DIR}) && = exists(${.CURDIR}/${_DIR}/Makefile)) > > -SUBDIR+=3D ${_DIR} > > -.endif > > -.endfor > >=20 > > # We must do etc/ last as it hooks into building the man whatis file > > # by calling 'makedb' in share/man. This is only relevant for >=20 >=20 > i also found LOCAL_LIB_DIRS, and the library was built, but then when I t= ried to use it with > LIBADD +=3D idng > it complained it didn???t know what I was talking, so I had to add it to = bsd.libnames.mk and bsd.own.mk > which is sort of messy. I thought I'd adding infrastructure for that in CheriBSD, but it looks like I'd hacked around it. In our tree, the odd things live under a ctsrd subtree and I have a ctsrd/ctsrd.libnames.mk the gets added for all things in the tree via Makefile.inc includes. That works for us because the only things that use those libraries lives in the tree. -- Brooks --V88s5gaDVPzZ0KCq Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJau8AYAAoJEKzQXbSebgfAwzQIAJ9Z1fHaFHQa5R5Pfge7lgzQ 8O8QEgJAdrsMt7Ds1kAvYs0xqSsK2RiXbcu9lzoplEqnPwlc/vJ7I1eqFWvvBBIs ABUgHdHLi+XZZqZff/9FEbucn4ghuJ/9afLbpJg6khhfW6ADYLlqusEDgu8aZydD CUjrrAGdzBlnhO6zbQBImXQiIhwnmPsXh/tSuoNlqtQvgbU4AHPP34jtf7tBGXYf KN/hn0uvgXWAnNUsYX2SZHqKeyOkdh8Kab3n78MJLoho793qShQ9B9lX6X8Sd+iW y/uYn3cnGN6N1EqLoG5SrunRkYMsfwXmaObNZp0DPsMeeqfbEd+zBGfmjflzivM= =QGFk -----END PGP SIGNATURE----- --V88s5gaDVPzZ0KCq--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20180328161729.GD88362>