Commit Graph

208 Commits

Author SHA1 Message Date
Baptiste Daroussin
e402155e1a ncurses: reinstantiate bsd specific code
This fixes ncurses 6.5 badly reading termcap
2024-06-20 20:27:15 +02:00
Baptiste Daroussin
21817992b3 ncurses: vendor import version 6.5 2024-06-20 13:26:22 +02:00
Kyle Evans
009db0d40c ncurses: serialize the tinfo build a little bit
Move ncurses_dll.h to GENHDRS to start with; it's been generated from
ncurses_dll.h.in for years, so it's not actually in a different category
than all of the other GENHDRS.  Slap an .ORDER on it to ensure that we
build ncurses_dll.h and curses.h before any *.c gets compiled.

This should sufficiently address a build race seen downstream where
ncurses_dll.h is present but not yet populated.

Reviewed by:	bapt
Sponsored by:	NetApp, Inc.
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D43540
2024-01-23 23:00:36 -06:00
Warner Losh
dc36d6f9bb lib: Remove ancient SCCS tags.
Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl script.

Sponsored by:		Netflix
2023-11-26 22:23:28 -07:00
Ka Ho Ng
d030761168 dirdeps: Update/fix Makefile.depend* for toolchain
This fixes make pseudo/toolchain.
2023-11-26 20:50:13 -05:00
Kyle Evans
c086d1cbc3 ncurses: avoid hardcoded assumptions about the layout of .OBJDIR
Abstract out the details of the FreeBSD build into a $TINFO_OBJDIR that
external builds can override if they orchestrate the build a bit
differently and have a different objdir layout as a result.  This makes
the ncurses build a little bit more flexible without requiring weird
backflips.

Reviewed by:	bapt, sjg
Sponsored by:	NetApp, Inc.
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D41834
2023-09-12 16:00:45 -05:00
Warner Losh
d0b2dbfa0e Remove $FreeBSD$: one-line sh pattern
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
2023-08-16 11:55:03 -06:00
Warner Losh
2a63c3be15 Remove $FreeBSD$: one-line .c comment pattern
Remove /^/[*/]\s*\$FreeBSD\$.*\n/
2023-08-16 11:54:29 -06:00
Warner Losh
42b388439b Remove $FreeBSD$: one-line .h pattern
Remove /^\s*\*+\s*\$FreeBSD\$.*$\n/
2023-08-16 11:54:23 -06:00
John Baldwin
235c8f6631 ncurses: Silence -Wunused-but-set-variable for various files.
Presumably these will be fixed upstream eventually.

Differential Revision:	https://reviews.freebsd.org/D40664
2023-06-27 10:19:32 -07:00
Simon J. Gerraty
8fe4f8f7a7 Fix building host tools for host
Several makefile depend on tools built for host.
At least when using DIRDEPS_BUILD we can build these for the
pseudo machine "host" to facilitate building on older host versions.

Ideally we would build these tools in their own directories to avoid
building more than needed.

For now, setting an appropriate default for BTOOLSPATH will suffice

Reviewed by:	stevek
Sponsored by:	Juniper Networks, Inc.
Differential Revision:	https://reviews.freebsd.org/D39708
2023-04-20 10:05:43 -07:00
Simon J. Gerraty
d9a4274795 Update/fix Makefile.depend for userland 2023-04-18 17:14:23 -07:00
Emmanuel Vadot
c9621d45a1 pkgbase: Put libpanelw and libform in FreeBSD-clibs
Put them with the others ncurses libs.

Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D38227
2023-02-08 08:49:59 +01:00
Alex Richardson
ac175bd33a Install working pkgconfig .pc files for compat libraries
The default ones are install them to /usr/libdata/pkgconfig, and we can't
use this path for compat libraries, so we use /usr/lib<suffix>/pkgconfigi here.

Test Plan:	grep -rn libdir= ./usr/lib32/pkgconfig/*.pc
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D34939
2022-08-11 23:18:34 +01:00
Brooks Davis
b0bcedef1a ncurses: add SRCHDRS (ncurses_dll.h) to tinfo SRCS
This avoids relying on the `includes` target to generate this header
which must be in .OBJDIR for the ncurses library to find it.

With an upcoming change libcompat build won't build a seperate
sysroot and will instead share with the 64-bit target which means the
`includes` target will not be called.

Sponsored by:	DARPA, AFRL

Reviewed by:	bapt
Differential Revision:	https://reviews.freebsd.org/D35510
2022-06-17 20:34:58 +01:00
Baptiste Daroussin
fde3fc69cd ncurses: to not create a libncursesw.a in the OBJDIR
It breaks intree partial builds for every library depending on ncurses
because ncursesw.a (built without PIC) will be the first the library
path for the linker to resolve -lncursesw
2021-11-24 11:02:22 +01:00
Baptiste Daroussin
c0cf36bc02 ncurses: rework static linker script generation
Rework the generation of the linker script to make it in par with
ldscript, this also forces the regeneration of the .aldscript in the obj
dir which might in the past have ended up empty.

Tested by:	manu
2021-10-26 15:57:29 +02:00
Baptiste Daroussin
9082bc4c3d ncurses: fix typo in makefile 2021-10-10 18:52:48 +02:00
Baptiste Daroussin
9294a2c719 ncurses: convert libncursesw.a into a static ldscript
Introduce the notion of static linker scripts to allow libncursesw.a to
track its dependency on libtinfow.a

this allows the build of older freebsd source tree to happen and make
static linking in part with dynamic linking which already provides a
ldscript

This fixes a bootstrapping FreeBSD 12 or 13 on recent FreeBSD 14

Reviewed by:		imp
Differential Revision:	https://reviews.freebsd.org/D32435
2021-10-10 07:51:00 +02:00
Baptiste Daroussin
27803b54db ncurses: fix path where to find curses.h at bootstrap
after the split, curses.h is now generated by tinfo Makefile, but
still used for a file generated in ncurses lib. Adjust the path to
make sure curses.h is always found
2021-10-04 12:31:23 +02:00
Baptiste Daroussin
396851c20a ncurses: split libtinfo from libncurses
many external program expects libncurses to not be provided as a single
library. Instead of fixing all ports, distribute ncurses the way
upstream distributes it

Turn libncursesw.so into a ldscript which will link automatically as
needed to libtinfow so so this change is seamless at compile time.

Differential Revision:	https://reviews.freebsd.org/D32098
2021-10-04 11:38:21 +02:00
Yuri Pankov
adec9669ff expand @TPUT@ in ncurses manpages
Reviewed by:	bapt
Differential Revision:	https://reviews.freebsd.org/D29761
2021-04-14 18:16:59 +03:00
Baptiste Daroussin
b75fb12b68 terminfo: add more path to lookup for the database
In preparation for the move of the database out of base, add one more
path to lookup
Now the default lookup path is

1. base
2. localbase
3. localbase special site for custom terminfo (for ports adding custom
terminfo and avoid potential collision with the general db)
4. termcap

The plan is to allow the terminfo-db to be installed by end users via
a package for people willing to have the support for features from
this database provides. And keep the fallback on termcap for people who
don't want to hear about the terminfo db or how to configure the terminal
if it uses by default the features proposed in the definitions
of the terminfo db.

the first look up path is a window open for a proposal made by glebius@
consisting on creating a tool where the user at install time will select
the feature it want for a given terminal and generate its configurations
based on that. I won't work on it, but it is now posssible and there is
a path where to store those definitions
2021-03-18 10:29:43 +01:00
Alex Richardson
79fbd48378 Fix ncurses bootstrap on macOS
Avoid including machine/console.h when bootstrapping on non-FreeBSD.
2021-03-01 13:22:15 +00:00
Baptiste Daroussin
d2eb5dbd7d ncurses: fix generation of term.h
All variable were not properly expanded

Submitted by:	cy (initial version)
2021-02-25 22:49:20 +01:00
Baptiste Daroussin
e6b8135227 ncurses: fix patch date
Submitted by:	cy
2021-02-25 22:47:44 +01:00
Baptiste Daroussin
304bc76605 ncurses: update configuration header after update 2021-02-25 19:28:31 +01:00
Baptiste Daroussin
705d726338 ncurses: ensure we prefer the generated ncurses_dll.h 2021-02-25 19:27:29 +01:00
Renato Botelho
220c6d922a ncurses: Silence MKuserdefs.sh call
Remove -x flag from sh used to execute MKuserdefs.sh during ncurses
build and stop polluting make -s output

Reviewed by:		bapt, manu
Approved by:		bapt
Differential Revision:	https://reviews.freebsd.org/D28885
2021-02-25 15:22:17 -03:00
Baptiste Daroussin
61f66a1f44 ncurses: Add support for terminfo database
Along with the termcap database, ncurses will now lookup for the
terminfo database, note that the terminfo database is being looked
up first and then it fallsback on the termcap one.

While here drop our custom reader for the termcap database, over the
time it is needed maintenance to be able to catchup with changes on ncurses
side.

Install the ncurses tools which are needed to deal with the terminfo
database: tic, infocmp, toe

Replace our termcap only aware tools with the ncurses counterpart:
tput, tabs, tset, clear and reset

In particular they can your the extra capabilities described in the
terminfo database, which does not exist in termcap

Note that to add a new terminfo information to the database from ports
the ports will just need to add their extra information into:
/usr/local/share/site-terminfo/<firstletteroftheterm>/<term>

Tested by:	jbeich, manu
2021-02-25 14:25:11 +01:00
John Baldwin
0b7f1af804 Bump shared library versions after ncurses bump in 13.
A few shared libraries in the base system link against ncurses.  An
upgrade from a 12.x host to 13 results in ABI breakage for existing
binaries since the newer versions of these libraries link against the
newer ncurses while the binary itself links against the older ncurses.
For example, dialog4ports built on 12.x sometimes crashes on 13 since
it depends on libdialog which links against ncurses internally.

MFC after:	3 days
Reviewed by:	kib, delphij
Differential Revision:	https://reviews.freebsd.org/D28448
2021-02-01 17:11:49 -08:00
Baptiste Daroussin
821aa63a09 ncurses: only keep the version with widechar support
Only keep the widechar version of ncurses as libncursesw.so.9

Keep the old name to avoid breaking the ABI compatibility (the non
widechar version libncurses.so.9 is not binary compatible with
libncursesw.so.9) since all ports and base are already only linking
against the widechar version we can simply remove libncurses.so.9

Since the .9 version only lived in the dev branch and never ended in a
release, it is simply removed and not added to any binary compat
package.

Add symlinks to keep build time compatibility for anyone linking against
-lncurses
2021-01-05 14:01:32 +01:00
John Baldwin
338b22234b Pass the full CFLAGS to cpp for MKlib_gen.sh.
GCC's cpp was exiting immediately when it failed to find requested
includes (<ncurses_cfg.h> and <ncurses_defs.h>).  clang-cpp emitted an
error for the missing header files but continued processing the file
(thus not honoring any macros defined in the missing headers).

Arguably, the awk script is buggy since it doesn't check the return
value of the command it executes.

Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D25731
2020-08-03 17:53:15 +00:00
Baptiste Daroussin
e0989ec919 ncurses: bump shlib number to version 9
ABI has change in between ncurses 5 or 6. While theorically ncurses 6 is buildable with
backward compatibility, I fail at building in a way where the application linked against
the previous version of ncurses are rendering properly.
Let's go on the new ABI which provides all the latest features.

A compat12x package is cooking for backward compatibility
2020-02-20 09:12:07 +00:00
Baptiste Daroussin
e18651243e Update to 6.2-20200215
While I didn't plan another upgrade, This version incorporate fixes from
kevans@ so let's upgrade to it
2020-02-19 17:09:08 +00:00
Baptiste Daroussin
9b61ffab6b lib_gen.c now also depends on ncurses_dll.h specify it to prevent some breakage
if ncurses_dll.h is already present in base while building
2020-02-19 14:09:15 +00:00
Baptiste Daroussin
aae38d10b4 Update ncurses to 20200118
Among the changes from before:
- Add support for extended colors on widechar version
- Enable ncurses extended functions
- Enable version 2 of the extended mouse support
- Enable SCREEN extensions

Modification that differs from upstream:
- _nc_delink_entries used to be exposed and was turn static,
  turn it back as dynamic to not break abi
- Adapt our old termcap.c to modern ncurses

MFC after:	3 weeks
2020-02-18 08:11:52 +00:00
Simon J. Gerraty
2c9a9dfc18 Update Makefile.depend files
Update a bunch of Makefile.depend files as
a result of adding Makefile.depend.options files

Reviewed by:	 bdrewery
MFC after:	1 week
Sponsored by:   Juniper Networks
Differential Revision:  https://reviews.freebsd.org/D22494
2019-12-11 17:37:53 +00:00
Bryan Drewery
c63c5ab001 Fix .depend files to work for build tools.
This is somewhat of a follow-up to r335746.

MFC after:	2 weeks
Sponsored by:	DellEMC
2019-06-15 17:08:13 +00:00
Alex Richardson
60b905ae2f Fix ncurses fallback.c build with a strict build shell
The script uses shift three times and when building with a strict /bin/sh
shifting without any arguments will cause the script to fail. In this case
the target will fail and we write an empty output file. When doing a
NO_CLEAN build after this will mean fallback.c is up to date and clang
will happily compile the empty input file which leads to strange build
errors later.

Fixed by passing three empty arguments to MkFallback.sh and only creating
fallback.c if MKfallback.sh succeeds.

Aproved By:	brooks (mentor)
Differential Revision: https://reviews.freebsd.org/D16867
2018-10-23 06:31:31 +00:00
Bryan Drewery
96a0acc4ce Don't use CCACHE for linking.
MFC after:	2 weeks
Sponsored by:	Dell EMC
2018-06-27 19:29:15 +00:00
Pedro F. Giffuni
8a16b7a18f General further adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 3-Clause license.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

Special thanks to Wind River for providing access to "The Duke of
Highlander" tool: an older (2014) run over FreeBSD tree was useful as a
starting point.
2017-11-20 19:49:47 +00:00
Bryan Drewery
ea825d0274 DIRDEPS_BUILD: Update dependencies.
Sponsored by:	Dell EMC Isilon
2017-10-31 00:07:04 +00:00
Enji Cooper
22dae9c629 Hide sccsid under #if 0, per example in style(9)
This fixes a -Wunused warning with gcc 6.3.0/7.0.0.

MFC after:	1 week
2017-08-12 22:20:08 +00:00
Warner Losh
fbbd9655e5 Renumber copyright clause 4
Renumber cluase 4 to 3, per what everybody else did when BSD granted
them permission to remove clause 3. My insistance on keeping the same
numbering for legal reasons is too pedantic, so give up on that point.

Submitted by:	Jan Schaumann <jschauma@stevens.edu>
Pull Request:	https://github.com/freebsd/freebsd/pull/96
2017-02-28 23:42:47 +00:00
Enji Cooper
5bde33db9d Use SRCTOP-relative paths and .CURDIR with :H instead of ".." specified paths
This implifies pathing in make/displayed output

MFC after:    3 weeks
Sponsored by: Dell EMC Isilon
2017-01-20 04:27:40 +00:00
Bryan Drewery
29df9f6b75 DIRDEPS_BUILD: Run the staged bootstrap-tools version of build-tools.
This avoids running target binaries.

Sponsored by:	EMC / Isilon Storage Division
2016-05-09 22:21:09 +00:00
Glen Barber
0edd2576c0 MFH
Sponsored by:	The FreeBSD Foundation
2016-04-16 02:32:12 +00:00
Bryan Drewery
d1dd034d07 META_MODE: Don't rebuild build-tools targets during normal build.
This avoids 'build command changed' due to CFLAGS/CC changes during the
normal build.  Without this the build-tools targets end up rebuilding
for the *target* rather than keeping the native versions built in
build-tools.

Sponsored by:	EMC / Isilon Storage Division
2016-04-14 21:06:10 +00:00
Glen Barber
d60840138f MFH
Sponsored by:	The FreeBSD Foundation
2016-04-04 23:55:32 +00:00