fix build on musl, require automake 2.60

This commit is contained in:
Thomas Batten 2021-01-22 22:38:23 +10:30
parent fad566e010
commit 85e8af0e0d
3 changed files with 16 additions and 14 deletions

View File

@ -39,13 +39,15 @@
#endif
#include <sys/types.h>
#if defined(linux) && (!defined(__GNU_LIBRARY__) || __GNU_LIBRARY__ < 2)
/* libc4 does not define __GNU_LIBRARY__, libc5 defines __GNU_LIBRARY__ as 1 */
/* Linux libc4 and libc5 only (because glibc doesn't include kernel headers):
Linux 2.0.x and 2.2.x define SHMLBA as PAGE_SIZE, but forget to define
PAGE_SIZE. It is defined in <asm/page.h>. */
#include <asm/page.h>
#ifdef __linux__
# ifdef __GNU_LIBRARY__
# if __GNU_LIBRARY__ < 2 /* libc5 */
# include <asm/page.h>
# endif
# endif
#endif
#include <sys/ipc.h>
#include <sys/shm.h>
#include <sys/stat.h>

View File

@ -23,8 +23,10 @@ dnl Process this file with autoconf to create configure.
AC_PREREQ(2.57)
AC_INIT([tinyx], 1.3)
AC_PREREQ([2.60])
AC_CONFIG_SRCDIR([Makefile.am])
AC_CONFIG_MACRO_DIR([m4])
AC_USE_SYSTEM_EXTENSIONS
AM_INIT_AUTOMAKE([dist-bzip2 no-dist-gzip foreign -Wall])
dnl this gets generated by autoheader, and thus contains all the defines. we
@ -574,14 +576,6 @@ AM_CONDITIONAL(KDRIVEFBDEV, [test x"$ac_cv_header_linux_fb_h" = xyes])
dnl and the rest of these are generic, so they're in config.h
AC_DEFINE(XResExtension, 1, [Build XRes extension])
AC_TRY_COMPILE([
#include <features.h>
#ifndef __GLIBC__
#error not glibc
#endif
], [], [AC_DEFINE(_GNU_SOURCE, 1,
[ Enable GNU and other extensions to the C environment for glibc])])
dnl ---------- Compiler arguments
AX_CHECK_COMPILE_FLAG([-flto],

View File

@ -34,6 +34,12 @@
#include <X11/keysym.h>
#include <linux/apm_bios.h>
/* These symbols are not defined on musl */
#if !defined(__uid_t) && !defined(__gid_t)
#define __uid_t uid_t
#define __gid_t gid_t
#endif
static int vtno;
int LinuxConsoleFd;
static int LinuxApmFd;