Commit Graph

116 Commits

Author SHA1 Message Date
Darryl L. Miles 15faa19346 configure: autoconf regen (2.69) --enable-readline-bundled GR_SRCS 2025-10-04 20:50:31 -04:00
Darryl L. Miles af7b6bf119 graphics: minor change to Makefile and configure
This splits and groups DEPSRCS better so errors are not seen trying to
include files that are not present with no intention to build that
source file.
2025-10-04 20:50:31 -04:00
Darryl L. Miles 8b0616eaf5 readline: add configure --enable-readline-bundled option
Cleanup autoconf handling, should always work as expected.
Use of --enable-readline-bundled when readline is needed will use
copy in subdir.
2025-10-04 20:50:31 -04:00
Darryl L. Miles 92b4d6a1f7 configure: autoconf regen (2.69) AC_CHECK_HEADERS sys/ioctl_compat.h sgtty.h 2025-07-29 10:50:32 -04:00
Darryl L. Miles 730d327702 configure.in: AC_CHECK_HEADERS sys/ioctl_compat.h sgtty.h 2025-07-29 10:50:32 -04:00
Darryl L. Miles c3054f265b configure: autoconf regen (2.69) LIBS 2025-07-29 10:50:32 -04:00
Darryl L. Miles a8f5291bd7 defs.mak.in: restore autoconf LIBS functionality
This is a standard autoconf variable, it was probably disabled due to
how the graphics/Makefile works and the more complex detection taking
place there.

Needed to use it to add -lpthread to some platforms (freebsd/openbsd)
to make it build out the box.
2025-07-29 10:50:32 -04:00
Darryl L. Miles aaa477e44a configure: autoconf regen (2.69) AC_STRUCT_DIRENT_D_TYPE 2025-07-29 10:50:32 -04:00
Darryl L. Miles f45aeb6cee configure.in: AC_STRUCT_DIRENT_D_TYPE 2025-07-29 10:50:32 -04:00
Darryl L. Miles 9f0f5f5b4e configure: autoconf regen (2.69) AC_PATH_PROG(PERL,) AC_SUBST(PERL) 2025-07-29 10:50:32 -04:00
Darryl L. Miles ec7d0fc79a configure.in: AC_PROG_PERL 2025-07-29 10:50:32 -04:00
Darryl L. Miles d2449dc971 configure: autoconf regen (2.69) AC_PROG_SED 2025-07-29 10:50:32 -04:00
Darryl L. Miles e51189911b configure.in: AC_PROG_SED (looking for GNU sed) 2025-07-29 10:50:32 -04:00
Darryl L. Miles 412d0570e2 configure: autoconf regen (2.69) ALLOCA NDEBUG DEBUG
also --enable-assertions --enable-debug
also termio.h termios.h sys/ioctl.h
2025-07-29 10:50:32 -04:00
Darryl L. Miles 9f1398dfcb utils/magsgtty.h: detect termio/ioctl headers
Linux is not based on BSD and this file appears to exist to manage
historic BSD conventions concerning termios.
2025-07-29 10:50:32 -04:00
Darryl L. Miles c5ebd7d3c0 makedbh.in _DATABASE_H => _MAGIC__DATABASE__DATABASE_H 2025-07-29 10:50:32 -04:00
Darryl L. Miles b6e70f9632 utils/magic_alloca.h: with autoconf AC_FUNC_ALLOCA
Unclear what the correct Copyright header should be on this one,
given most of the lines in the file are from the autoconf
documentation.
2025-07-29 10:50:32 -04:00
Darryl L. Miles 4d2def46f4 configure.in: whitespace cleanup align --help columns 2025-07-29 10:50:32 -04:00
Darryl L. Miles 49caa3267b configure: --enable-debug make this a user accessible config
This should help with automated CI testing as well, where a suite
can be run and debug enabled and checked, just via a specific
CI setup.
2025-07-29 10:50:32 -04:00
Darryl L. Miles dd49ca21d2 configure: --enable-assertions make this a user accessible config
This should help with automated CI testing as well, where a suite
can be run and assertions enabled and checked, just via a specific
CI setup.
2025-07-29 10:50:32 -04:00
Darryl L. Miles 2a78de8cb9 magic/Makefile: MAGIC_BUILDDATE and inherit values when possible
Went the whole way and make it inherit from toplevel Makefile.
2025-07-29 10:50:32 -04:00
Darryl L. Miles 4e7396162d scripts/configure: autoconf regen (2.69) MAKE_xxxxx generation 2025-07-29 10:50:32 -04:00
Darryl L. Miles d13fa6872e MAKE_xxxxx: to skip building OBJs part of configure 2025-07-29 10:50:32 -04:00
Darryl L. Miles ebf2db91b1 defs.mak.in: DFLAGS_MAGICVERSION
This seems needed in multiple places so made a variable on its own.
2025-07-29 10:50:31 -04:00
Darryl L. Miles 4b094e4632 defs.mak.in: OBJS split into C_OBJS CXX_OBJS
This split has the effect (with modified .o.c Makefile rule of
correctly using the $CC for .c files and not try to build .cpp
with C compiler, which fails in oa/** for example.
2025-07-29 10:50:31 -04:00
Darryl L. Miles 73a6ac1650 defs.mak.in: Remove -I. from default compiler options
This can only cause trouble being a global default setting.

All project include files are qualified with a path prefix to help
disambiguate duplication of header file names to effectively provide
a namespace.

When removing it nothing seemed break.  Maybe more configurations
should be tested.  They were all ok.
2025-07-29 10:50:31 -04:00
Darryl L. Miles 271aef82bd defs.mak.in: replace backtick with $(shell ...)
Previously the variable resolution was passed to compiler command line
when ideally this only needs to be resolved once per build and the
entrie build uses the same value.

Compiler command line is computed at least once per file (plus Depends
pass), so this is forking at least 5 extra times during the build.

This improves things somewhat so resolution is performed less.

This may have the effect of making the build appear faster when
ccache is working.  As the command line options maybe seen as a
constant.
2025-07-29 10:50:31 -04:00
Darryl L. Miles 0dccf5826d defs.mak.in: ARFLAGS = cr (removed 'v') 2025-07-29 10:50:31 -04:00
Darryl L. Miles f15e7675cd defs.mak.in: Add RMDIR MKDIR MV LN SED common tools 2025-07-29 10:50:31 -04:00
Darryl L. Miles 957904a389 configure: autoconf regen (2.69) AC_HEADER_TIME 2025-07-27 12:43:04 -04:00
Darryl L. Miles c695980145 configure.in: Add AC_HEADER_TIME 2025-07-27 12:43:04 -04:00
Darryl L. Miles 1eb2231bbf configure: autoconf regen (2.69) AC_C_INLINE AC_C_RESTRICT 2025-07-27 12:42:05 -04:00
Darryl L. Miles 52d3feac73 configure.in: AC_C_INLINE AC_C_RESTRICT 2025-07-27 12:42:05 -04:00
Darryl L. Miles 7029971c33 configure: autoconf regen (2.69) AC_HEADER_STDBOOL 2025-07-26 17:44:45 -04:00
Darryl L. Miles bfbdf45b88 C23: use AC_HEADER_STDBOOL #include <stdbool.h> 2025-07-26 17:44:45 -04:00
Darryl L. Miles f5f59846da configure: autoconf regen (2.69) getrlimit setrlimit sys/resource.h 2025-04-09 15:19:25 -04:00
Darryl L. Miles c676c6b1d3 configure.in: getrlimit setrlimit sys/resource.h 2025-04-09 15:19:25 -04:00
Tim Edwards 1cec414618 Added the contents of the "readline" module back. This is
generally unused, as it is incompatible with the Tcl/Tk build of
magic.  However, I had not intended to remove it, only move the
name from "readline-4.3" to "readline".  But "readline/readline"
was in .gitignore, which caused the contents to be removed from
the repository.  This commit restores those files, and also
prevents the readline directory Makefile from making a symbolic
link called "readline" to itself, which was causing compile-time
issues.  The readline code is only kept for backwards compatibility
with ancient versions of magic not using the Tcl/Tk interpreter.
2025-01-10 09:58:57 -05:00
Darryl L. Miles 46eb71491c GHA: MacOS maintenance update
GHA obsoleted macos-12 so we move to macos-13 for Intel.  Building with oldest
Intel image to provide feedback of continued expected support on that platform,
while ARM64 builds with latest to check the other end of their SDKs.

Lock the TCL version via brew to 8.6+ (currently the project is not expected to
build on TCL9 until other work is completed) so this is causing build failure.

Added additional diagnostics to show the location of executables/DSOs if they
got built from the tree.

Introduced GHA timeout clamping (MacOS default shell seems not to behave under
CI as well as Linux does, re signal/pipe handling)

'brew install tcl-tk@8' appears to append the @8 to the installed path such as
/usr/local/opt/tcl-tk@8 which configure needs to know.  configure_mac updated
to detect this now TCL9 is the default version that maybe installed at the old
location.  Then there is the issue of both TCL versions being installed
side-by-side on the same system causing more issues over selection.
2025-01-04 11:23:39 -05:00
Darryl L. Miles e54111cf6f configure.in: X11 detection and option order
The -L option needs to be placed before the -l it needs to affect.
This maybe important on MacOSX where a nonstandard/optional package
provides X11 support so the locations are not in system locations.
2024-12-26 12:52:25 -05:00
Darryl L. Miles dc79b14739 scripts/configure_mac --x-includes=... --x-libraries=... 2024-12-26 12:52:25 -05:00
Darryl L. Miles 7696f673df configure: autoconf regen (2.69) to add HAVE_SYS_TIME_H 2024-12-26 12:44:50 -05:00
Darryl L. Miles cd63fa3c14 K&R calma: remove system header time() K&R style prototype
time.h has existed since C89 so is a standard header expected
to always be available.

sys/time.h was an optional header that historically only some
platforms provided.

If there is a conflict on specific platforms it is better to
'#if !defined()' that specific niche platform with the problem
if both headers are included in the same compile unit.  But I
don't think this is a problem in modern times.

So this results in a resolution that removes #ifdef around
time.h and the detection by configure for the availabiltiy
of sys/time.h.

K&R obsolete syntax removal for C23 compatibility series
2024-12-26 12:44:50 -05:00
Ryan Carsten Schmidt 8a93d6136b
Use raw strings in preproc.py
Avoids "SyntaxWarning: invalid escape sequence" with Python 3.12.
2024-01-23 09:38:23 -06:00
Tim Edwards df6333bb7b Modified the "makedbh.in" script ("makedbh", after running
configure) so that it does not use python-3.6-style f-strings,
and so is backwardly compatible with any python-3 revision.
2023-10-28 12:14:26 -04:00
Donn 86630fcc02 Allow Python 3 to not be in PATH, Fix `clean` re-building dependencies
* Adds Python 3 to macOS requirements
* Gate include of `DEPEND_FILE` in `rules.mak` on whether the target is `clean` or not (the include isn't pre-processed; it will attempt to build everything in the include otherwise)
* Make `makedbh` a configurable file- the shebang now uses the discovered path for Python3
2023-08-29 22:43:11 +03:00
Tim Edwards 8e25303db4 Corrected what looks like a very long-standing error in the DRC
engine.  Rule checks of triggering rules are not subject to
clipping to the clip area.  However, they *must* be clipped to
the (larger) overall DRC check area, because no layout is valid
outside of that area.  This clipping was missed, allowing
triggering rules to trigger on areas outside the valid layout,
resulting in mysterious false-positive DRC errors.  This has
been fixed.
2023-08-27 14:21:02 -04:00
Donn 02e16b8bce Build Updates
This is a series of updates to make building magic far less of a headache:

* Drop `csh`/`tcsh` dependency and detection from `./configure`.
* Rewrite makedbh in Python.
* Rewrite printmans in POSIX sh.
* Stop deleting Depend before every compile (which causes some files to recompile and thus increases recompile times significantly)
* Add Depend to CLEANS in scripts/defs.mak.in
* Turn POSIX suffix rule in magic/rules.mak to a pattern rule with proper prerequisites
2023-08-25 12:24:14 -04:00
Johan Euphrosine e249e7a0e3 configure: cleanup diff 2023-07-12 05:04:18 +09:00
Johan Euphrosine f5793bbefb configure: add asmjs-unknown-emscripten target 2023-07-12 04:44:37 +09:00