From 9f35bf9a4a37b75680762abfd822ad61beb1d3ac Mon Sep 17 00:00:00 2001 From: Christian Wiese Date: Sun, 27 Apr 2014 23:19:30 +0200 Subject: [PATCH] procps: add tweaks to get procps build with musl --- base/musl/pkg/procps/procps.conf | 56 ++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 base/musl/pkg/procps/procps.conf diff --git a/base/musl/pkg/procps/procps.conf b/base/musl/pkg/procps/procps.conf new file mode 100644 index 000000000..0d0cf6a8c --- /dev/null +++ b/base/musl/pkg/procps/procps.conf @@ -0,0 +1,56 @@ +# --- SDE-COPYRIGHT-NOTE-BEGIN --- +# This copyright note is auto-generated by ./scripts/Create-CopyPatch. +# +# Filename: package/.../musl/pkg/procps/procps.conf +# Copyright (C) 2014 The OpenSDE Project +# +# More information can be found in the files COPYING and README. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. A copy of the +# GNU General Public License can be found in the file COPYING. +# --- SDE-COPYRIGHT-NOTE-END --- + +# approach taken from sabotage linux + +musl_procps_addmissing() { + # add minimal internal error.h + cat << EOF > include/error.h +#include +#include +#define PROGRAM_NAME "procps" + +#define error(status, errnum, ...) \ + do { fflush(stdout); \ + dprintf(2, PROGRAM_NAME ": "); \ + dprintf(2, __VA_ARGS__); \ + if(errnum) dprintf(2, ": %s", strerror(errnum)); \ + dprintf(2, "\n"); \ + if(status) exit(status); \ + } while(0) + +#define error_at_line(status, errnum, fn, line, ...) \ + do { fflush(stdout); \ + dprintf(2, PROGRAM_NAME ": %s:%d", fn, (int) line); \ + dprintf(2, __VA_ARGS__); \ + if(errnum) dprintf(2, ": %s", strerror(errnum)); \ + dprintf(2, "\n"); \ + if(status) exit(status); \ + } while(0) + + +EOF + + mkdir -p include/sys + # add minimal sys/dir.h + cat << EOF > include/sys/dir.h +#include +#define direct dirent +EOF +} +hook_add preconf 5 'musl_procps_addmissing' + +# sysctl.c: error: 'GLOB_TILDE' undeclared +#var_append CFLAGS ' ' '-DGLOB_TILDE=0' +var_append configprefix ' ' 'CFLAGS="-DGLOB_TILDE=0"'