Commit Briefs

Thomas Adam

portable: OpenBSD compilation fixes (ta/configh)


Thomas Adam

portable: curses: improve detection

When checking for ncurses, don't clobber previous checks for libpanel.


Thomas Adam

portable: improve b64_ntop detection

When looking for base64 functions, check -lresolv and/or -lnetwork, and only build those in compat if required. Some of the detection code was modified from tmux's configure.ac script.


Thomas Adam

portable: add missing header checks

Some code in compat/ has #defines which were not being checked for in configure.ac, which could have lead to compilation failures were those files to be included on systems which needed them. In doing so, we can now remove libmd and libcrypto as these are no longer needed.


Thomas Adam

portable: configure: use SHA_2{,56}_H

Don't use a custom variable when the header checks for these are already available. From Christian "naddy" Weisgerber.


Thomas Adam

portable: configure: flatten LIBS

Set LIBS to the empty string so that only the specific dependencies are included where needed, rather than relying on autotools to do this for us. This will make splitting out got into different subprojects easier, as well as allow for multi-packing on those systems which support it.


Thomas Adam

portable: configure: split out dependencies

Rather than assume all dependencies are required for all programs, split them out. This will make packaging easier, as well as splitting the code to use subprojects. Note that due to the use of config.h semantics, in most cases the got_compat.h header file is now at the top of the .c file it is included in, so that it can handle the system header inclusion properly.


Thomas Adam

portable: configure: use config.h

So that the command-line flags to CC don't get drowned out with copious -D flags, move this detection to config.h instead. Note that to reduce the code churn, the existing include/got_compat.h header file has been renamed, and the generated file replaces it, but with the contents of the original header file included. Eventually, we might want to move some od the logic in include/got_compat2.h into AH_VERBATIM() blocks, but for now, this is a good compromise.


Thomas Adam

portable: configure: remove unused variable

found_libbsd isn't used any more.


Thomas Adam

portable: update PLATFORM display

Fixes openbsd.



Thomas Adam

portable: improve SHA detection

Original patch from Omar Polo. Tweak by me.


Thomas Adam

portable: compat: sha2

Add compatability support for sha2 for systems which don't natively have it. This has been stolen from OpenBSD. Thanks!


Thomas Adam

portable: tweak SHA1 detection/libbsd

Don't rely on AC_RUN_IFELSE as this breaks cross-compilation (voidlinux). Although this is better replaced with AC_CHECK_DECL. In template/ include checking for libbsd.


Thomas Adam

portable: rework SHA detection

Simply the SHA detection by not predicating on libcrypto, but instead checking individual header files.


Thomas Adam

portable: make bison's location configurable

Some systems have bison (yacc) in a non-standard location. Since Autotolls is setting the YACC environment variable based on the AC_PROG_YACC macro, let the user override this if YACC is set in the environment already. This issue was found by a user of MacPorts. I did not get any feedback from them as to whether this worked, but my own testing indicates this should work.


Thomas Adam

portable: template: use as a subproject

Move template into its own subproject as it's only needed at compile-time and shouldn't be installed. This needs compiling with the host compiler which is configurable via HOSTCC and HOSTCLFAG environment variables. This diff largely from op@ but additional tweaking from myself.


Thomas Adam

portable: OpenBSD support (ta/portable-openbsd)

Despite -portable existing to make the codebase compile on platforms other than OpenBSD, there's nothing wrong with making -portable still compile on that platform as well.


Thomas Adam

portable: configure.ac: fix libpanelw detection

When not using pkg-config on those systems where it isn't installed, libpanelw should be checked within ncursesw as well -- such is the case on OpenBSD for example.


Thomas Adam

portable: gotwebd: use template

This updates -portable's gotwebd instance to make use of the new templating engine.


Thomas Adam

portable: reorder system_extensions

Cosmetic change only. No functional changes expected. Via Anna (cybertailor) Vyalkova


Thomas Adam

portable: add AM_PROG_AR

Needed for stringent checks on Gentoo. Bug 879825. Via Anna (cybertailor) Vyalkova.


Thomas Adam

portable: check for sys/tree.h more fully

When checking for sys/tree.h on non-BSD systems, either it will be in the standard include path (such as on MacOS), or it won't be found, until libbsd is overlayed. In cases where we want to find sys/tree.h via libbsd, perform a AC_CHECK_DECL for a known #define in sys/tree.h -- which will still find sys/tree.h in either location, or uses compat/tree.h in all other cases.


Thomas Adam

portable: remove sys/tree.h compat inclusion

libbsd as a library was created some years back to pull together BSD-specific functionality to be used on non-BSD systems. When it was in its infancy, and not being widely adopted across non-BSD systems, there was often a need to carry around compat versions of sys/{queue,tree}.h This is no longer the case -- and the compat code for this has never worked on systems which lacked a compatible sys/tree.h header anyway, so remove this, and let the user know that libbsd is needed. A few people have mentioned this to me.


Thomas Adam

portable: macos: look for gnu bison harder

When checking for GNU Bison (and presumably other) toolchain commands on MacOS, ther's two main systems most users use. Brew, and Ports. Both of these take different approaches when building software, and although a Portsfile exists for -portable now, those users who don't use that directly, or use brew, and try and build -portable from git directly, will likely be at the mercy of ./configure being able to go off and find the appropriate tools. Therefore, ./configure *tries* to be smart about handling this, and will go and check if brew(1) is installed and try and use that to determine the likely path for where it puts its software. Indeed, for MacPorts, the story is very different, and although some users might therfore use --prefix to ./configure to determine this path, there is an overloaded assumption between --prefix meaning where the binaries are to be installed, and --prefix meaning "go and look elsewhere for other applications". At some point, a dedicated configure option might be required. Reported by grey and jamsek.