Commit eb203b01 authored by Anthony G. Basile's avatar Anthony G. Basile

Final step of revamping the build system

The structure of the source tree is basically correct and this is
about as far as we can go without hacking at the C code.
parent c47f33a4
This diff is collapsed.
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
#SUBDIRS = docs keymaps keymaps-force-release man rules src test
SUBDIRS = keymaps keymaps-force-release
if ENABLE_GTK_DOC
SUBDIRS += \
docs/libudev
endif
SUBDIRS = src docs keymaps keymaps-force-release man rules test
#!/bin/sh
set -e
if type -p gtkdocize > /dev/null; then
gtkdocize --docdir docs
gtkdocargs=--enable-gtk-doc
fi
aclocal && \
autoheader && \
autoconf && \
libtoolize --copy && \
gtkdocize --docdir docs && \
automake --add-missing --copy
......@@ -29,9 +29,14 @@ AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
GTK_DOC_CHECK([1.18],[--flavour no-tmpl])
AC_PATH_PROG([M4], [m4])
AC_PATH_PROG([XSLTPROC], [xsltproc])
GTK_DOC_CHECK([1.18],[--flavour no-tmpl])
AC_PATH_TOOL(GPERF, gperf)
if test -z "$GPERF" ; then
AC_MSG_ERROR([*** gperf not found])
fi
# TODO check this --- we don't want kmod necessarily
# PKG_CHECK_MODULES(KMOD, [libkmod >= 5])
......@@ -265,4 +270,5 @@ AC_CONFIG_FILES([Makefile
src/test/Makefile
src/udev/Makefile
test/Makefile])
AC_OUTPUT
if ENABLE_GUDEV
if ENABLE_GTK_DOC
SUBDIRS = \
libudev
if ENABLE_GTK_DOC
if ENABLE_GUDEV
SUBDIRS += \
gudev
endif
......
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
if ENABLE_KEYMAP
rootprefix=@rootprefix@
udevlibexecdir=$(rootprefix)/lib/udev
udevkeymapforcereldir = $(udevlibexecdir)/keymaps/force-release
if ENABLE_KEYMAP
dist_udevkeymapforcerel_DATA = \
dell-touchpad \
dell-xps \
......
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
if ENABLE_KEYMAP
rootprefix=@rootprefix@
udevlibexecdir=$(rootprefix)/lib/udev
udevkeymapdir = $(udevlibexecdir)/keymaps
if ENABLE_KEYMAP
dist_udevkeymap_DATA = \
acer \
acer-aspire_5720 \
......@@ -63,5 +66,6 @@ dist_udevkeymap_DATA = \
toshiba-satellite_a110 \
toshiba-satellite_m30x \
zepto-znote
endif
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
ACTION=="remove", GOTO="systemd_end"
SUBSYSTEM=="tty", KERNEL=="tty[a-zA-Z]*|hvc*|xvc*|hvsi*", TAG+="systemd"
KERNEL=="vport*", TAG+="systemd"
SUBSYSTEM=="block", KERNEL!="ram*|loop*", TAG+="systemd"
SUBSYSTEM=="block", KERNEL!="ram*|loop*", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=="1", ENV{SYSTEMD_READY}="0"
# Ignore encrypted devices with no identified superblock on it, since
# we are probably still calling mke2fs or mkswap on it.
SUBSYSTEM=="block", KERNEL!="ram*|loop*", ENV{DM_UUID}=="CRYPT-*", ENV{ID_PART_TABLE_TYPE}=="", ENV{ID_FS_USAGE}=="", ENV{SYSTEMD_READY}="0"
# Ignore raid devices that are not yet assembled and started
SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", KERNEL=="md*", TEST!="md/array_state", ENV{SYSTEMD_READY}="0"
SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", KERNEL=="md*", ATTR{md/array_state}=="|clear|inactive", ENV{SYSTEMD_READY}="0"
# Ignore nbd devices in the "add" event, with "change" the nbd is ready
ACTION=="add", SUBSYSTEM=="block", KERNEL=="nbd*", ENV{SYSTEMD_READY}="0"
# We need a hardware independent way to identify network devices. We
# use the /sys/subsystem path for this. Current vanilla kernels don't
# actually support that hierarchy right now, however upcoming kernels
# will. HAL and udev internally support /sys/subsystem already, hence
# it should be safe to use this here, too. This is mostly just an
# identification string for systemd, so whether the path actually is
# accessible or not does not matter as long as it is unique and in the
# filesystem namespace.
#
# http://cgit.freedesktop.org/systemd/systemd/tree/src/libudev/libudev-enumerate.c#n922
SUBSYSTEM=="net", KERNEL!="lo", TAG+="systemd", ENV{SYSTEMD_ALIAS}+="/sys/subsystem/net/devices/$name"
SUBSYSTEM=="bluetooth", TAG+="systemd", ENV{SYSTEMD_ALIAS}+="/sys/subsystem/bluetooth/devices/%k"
SUBSYSTEM=="bluetooth", TAG+="systemd", ENV{SYSTEMD_WANTS}+="bluetooth.target"
ENV{ID_SMARTCARD_READER}=="*?", TAG+="systemd", ENV{SYSTEMD_WANTS}+="smartcard.target"
SUBSYSTEM=="sound", KERNEL=="card*", TAG+="systemd", ENV{SYSTEMD_WANTS}+="sound.target"
SUBSYSTEM=="printer", TAG+="systemd", ENV{SYSTEMD_WANTS}+="printer.target"
SUBSYSTEM=="usb", KERNEL=="lp*", TAG+="systemd", ENV{SYSTEMD_WANTS}+="printer.target"
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ENV{ID_USB_INTERFACES}=="*:0701??:*", TAG+="systemd", ENV{SYSTEMD_WANTS}+="printer.target"
# Apply sysctl variables to network devices (and only to those) as they appear.
SUBSYSTEM=="net", KERNEL!="lo", RUN+="@rootlibexecdir@/systemd-sysctl --prefix=/proc/sys/net/ipv4/conf/$name --prefix=/proc/sys/net/ipv4/neigh/$name --prefix=/proc/sys/net/ipv6/conf/$name --prefix=/proc/sys/net/ipv6/neigh/$name"
# Asynchronously mount file systems implemented by these modules as
# soon as they are loaded.
SUBSYSTEM=="module", KERNEL=="fuse", ACTION=="add", TAG+="systemd", ENV{SYSTEMD_WANTS}+="sys-fs-fuse-connections.mount"
SUBSYSTEM=="module", KERNEL=="configfs", ACTION=="add", TAG+="systemd", ENV{SYSTEMD_WANTS}+="sys-kernel-config.mount"
LABEL="systemd_end"
......@@ -5,7 +5,6 @@ udevlibexecdir=$(rootprefix)/lib/udev
udevrulesdir = $(udevlibexecdir)/rules.d
dist_udevrules_DATA = \
99-systemd.rules \
42-usb-hid-pm.rules \
50-udev-default.rules \
60-cdrom_id.rules \
......@@ -26,6 +25,6 @@ dist_udevrules_DATA = \
if ENABLE_KEYMAP
dist_udevrules_DATA += \
95-keymap.rules \
95-keyboard-force-release.rules
95-keymap.rules \
95-keyboard-force-release.rules
endif
......@@ -4,6 +4,9 @@ LIBUDEV_CURRENT=3
LIBUDEV_REVISION=0
LIBUDEV_AGE=2
AM_CPPFLAGS = \
-I $(top_srcdir)/src/shared
lib_LTLIBRARIES = \
libudev.la
......@@ -28,17 +31,6 @@ libudev_la_LDFLAGS = \
-version-info $(LIBUDEV_CURRENT):$(LIBUDEV_REVISION):$(LIBUDEV_AGE) \
-Wl,--version-script=libudev.sym
pkgconfiglibdir=$(libdir)/pkgconfig
pkgconfiglib_DATA = \
libudev.pc
EXTRA_DIST = \
libudev.pc.in \
libudev.sym
CLEANFILES = \
libudev.pc
noinst_LTLIBRARIES = \
libudev-private.la
......@@ -51,3 +43,13 @@ libudev_private_la_CFLAGS = \
$(AM_CFLAGS) \
-fvisibility=default
pkgconfiglibdir=$(libdir)/pkgconfig
pkgconfiglib_DATA = \
libudev.pc
EXTRA_DIST = \
libudev.pc.in \
libudev.sym
CLEANFILES = \
libudev.pc
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
#pragma once
/***
This file is part of systemd.
Copyright 2010 Lennart Poettering
systemd is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
systemd is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#include <syslog.h>
#include <stdbool.h>
#include <stdarg.h>
#include <errno.h>
#include "macro.h"
typedef enum LogTarget{
LOG_TARGET_CONSOLE,
LOG_TARGET_KMSG,
LOG_TARGET_JOURNAL,
LOG_TARGET_JOURNAL_OR_KMSG,
LOG_TARGET_SYSLOG,
LOG_TARGET_SYSLOG_OR_KMSG,
LOG_TARGET_AUTO, /* console if stderr is tty, JOURNAL_OR_KMSG otherwise */
LOG_TARGET_SAFE, /* console if stderr is tty, KMSG otherwise */
LOG_TARGET_NULL,
_LOG_TARGET_MAX,
_LOG_TARGET_INVALID = -1
} LogTarget;
void log_set_target(LogTarget target);
void log_set_max_level(int level);
void log_set_facility(int facility);
int log_set_target_from_string(const char *e);
int log_set_max_level_from_string(const char *e);
void log_show_color(bool b);
void log_show_location(bool b);
int log_show_color_from_string(const char *e);
int log_show_location_from_string(const char *e);
LogTarget log_get_target(void);
int log_get_max_level(void);
int log_open(void);
void log_close(void);
void log_forget_fds(void);
void log_close_syslog(void);
void log_close_journal(void);
void log_close_kmsg(void);
void log_close_console(void);
void log_parse_environment(void);
int log_meta(
int level,
const char*file,
int line,
const char *func,
const char *format, ...) _printf_attr_(5,6);
int log_metav(
int level,
const char*file,
int line,
const char *func,
const char *format,
va_list ap);
int log_struct_internal(
int level,
const char *file,
int line,
const char *func,
const char *format, ...) _sentinel_;
int log_oom_internal(
const char *file,
int line,
const char *func);
/* This modifies the buffer passed! */
int log_dump_internal(
int level,
const char*file,
int line,
const char *func,
char *buffer);
_noreturn_ void log_assert_failed(
const char *text,
const char *file,
int line,
const char *func);
_noreturn_ void log_assert_failed_unreachable(
const char *text,
const char *file,
int line,
const char *func);
#define log_full(level, ...) log_meta(level, __FILE__, __LINE__, __func__, __VA_ARGS__)
#define log_debug(...) log_meta(LOG_DEBUG, __FILE__, __LINE__, __func__, __VA_ARGS__)
#define log_info(...) log_meta(LOG_INFO, __FILE__, __LINE__, __func__, __VA_ARGS__)
#define log_notice(...) log_meta(LOG_NOTICE, __FILE__, __LINE__, __func__, __VA_ARGS__)
#define log_warning(...) log_meta(LOG_WARNING, __FILE__, __LINE__, __func__, __VA_ARGS__)
#define log_error(...) log_meta(LOG_ERR, __FILE__, __LINE__, __func__, __VA_ARGS__)
#define log_struct(level, ...) log_struct_internal(level, __FILE__, __LINE__, __func__, __VA_ARGS__)
#define log_oom() log_oom_internal(__FILE__, __LINE__, __func__)
/* This modifies the buffer passed! */
#define log_dump(level, buffer) log_dump_internal(level, __FILE__, __LINE__, __func__, buffer)
bool log_on_console(void);
const char *log_target_to_string(LogTarget target);
LogTarget log_target_from_string(const char *s);
#define MESSAGE_ID(x) "MESSAGE_ID=" SD_ID128_FORMAT_STR, SD_ID128_FORMAT_VAL(x)
This diff is collapsed.
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
#pragma once
/***
This file is part of systemd.
Copyright 2010 Lennart Poettering
systemd is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
systemd is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
/* Missing glibc definitions to access certain kernel APIs */
#include <sys/resource.h>
#include <sys/syscall.h>
#include <fcntl.h>
#include <stdlib.h>
#include <unistd.h>
#include <linux/oom.h>
#ifdef HAVE_AUDIT
#include <libaudit.h>
#endif
#include "macro.h"
#ifdef ARCH_MIPS
#include <asm/sgidefs.h>
#endif
#ifndef RLIMIT_RTTIME
#define RLIMIT_RTTIME 15
#endif
#ifndef F_LINUX_SPECIFIC_BASE
#define F_LINUX_SPECIFIC_BASE 1024
#endif
#ifndef F_SETPIPE_SZ
#define F_SETPIPE_SZ (F_LINUX_SPECIFIC_BASE + 7)
#endif
#ifndef F_GETPIPE_SZ
#define F_GETPIPE_SZ (F_LINUX_SPECIFIC_BASE + 8)
#endif
#ifndef IP_FREEBIND
#define IP_FREEBIND 15
#endif
#ifndef OOM_SCORE_ADJ_MIN
#define OOM_SCORE_ADJ_MIN (-1000)
#endif
#ifndef OOM_SCORE_ADJ_MAX
#define OOM_SCORE_ADJ_MAX 1000
#endif
#ifndef AUDIT_SERVICE_START
#define AUDIT_SERVICE_START 1130 /* Service (daemon) start */
#endif
#ifndef AUDIT_SERVICE_STOP
#define AUDIT_SERVICE_STOP 1131 /* Service (daemon) stop */
#endif
#ifndef TIOCVHANGUP
#define TIOCVHANGUP 0x5437
#endif
#ifndef IP_TRANSPARENT
#define IP_TRANSPARENT 19
#endif
#if !HAVE_DECL_PIVOT_ROOT
static inline int pivot_root(const char *new_root, const char *put_old) {
return syscall(SYS_pivot_root, new_root, put_old);
}
#endif
#ifdef __x86_64__
# ifndef __NR_fanotify_init
# define __NR_fanotify_init 300
# endif
# ifndef __NR_fanotify_mark
# define __NR_fanotify_mark 301
# endif
#elif defined _MIPS_SIM
# if _MIPS_SIM == _MIPS_SIM_ABI32
# ifndef __NR_fanotify_init
# define __NR_fanotify_init 4336
# endif
# ifndef __NR_fanotify_mark
# define __NR_fanotify_mark 4337
# endif
# elif _MIPS_SIM == _MIPS_SIM_NABI32
# ifndef __NR_fanotify_init
# define __NR_fanotify_init 6300
# endif
# ifndef __NR_fanotify_mark
# define __NR_fanotify_mark 6301
# endif
# elif _MIPS_SIM == _MIPS_SIM_ABI64
# ifndef __NR_fanotify_init
# define __NR_fanotify_init 5295
# endif
# ifndef __NR_fanotify_mark
# define __NR_fanotify_mark 5296
# endif
# endif
#else
# ifndef __NR_fanotify_init
# define __NR_fanotify_init 338
# endif
# ifndef __NR_fanotify_mark
# define __NR_fanotify_mark 339
# endif
#endif
#ifndef HAVE_FANOTIFY_INIT
static inline int fanotify_init(unsigned int flags, unsigned int event_f_flags) {
return syscall(__NR_fanotify_init, flags, event_f_flags);
}
#endif
#ifndef HAVE_FANOTIFY_MARK
static inline int fanotify_mark(int fanotify_fd, unsigned int flags, uint64_t mask,
int dfd, const char *pathname) {
#if defined _MIPS_SIM && _MIPS_SIM == _MIPS_SIM_ABI32 || defined __powerpc__ && !defined __powerpc64__
union {
uint64_t _64;
uint32_t _32[2];
} _mask;
_mask._64 = mask;
return syscall(__NR_fanotify_mark, fanotify_fd, flags,
_mask._32[0], _mask._32[1], dfd, pathname);
#else
return syscall(__NR_fanotify_mark, fanotify_fd, flags, mask, dfd, pathname);
#endif
}
#endif
#ifndef BTRFS_IOCTL_MAGIC
#define BTRFS_IOCTL_MAGIC 0x94
#endif
#ifndef BTRFS_PATH_NAME_MAX
#define BTRFS_PATH_NAME_MAX 4087
#endif
struct btrfs_ioctl_vol_args {
int64_t fd;
char name[BTRFS_PATH_NAME_MAX + 1];
};
#ifndef BTRFS_IOC_DEFRAG
#define BTRFS_IOC_DEFRAG _IOW(BTRFS_IOCTL_MAGIC, 2, struct btrfs_ioctl_vol_args)
#endif
#ifndef BTRFS_SUPER_MAGIC
#define BTRFS_SUPER_MAGIC 0x9123683E
#endif
#ifndef MS_MOVE
#define MS_MOVE 8192
#endif
#ifndef MS_PRIVATE
#define MS_PRIVATE (1 << 18)
#endif
#if !HAVE_DECL_GETTID
static inline pid_t gettid(void) {
return (pid_t) syscall(SYS_gettid);
}
#endif
#ifndef SCM_SECURITY
#define SCM_SECURITY 0x03
#endif
#ifndef MS_STRICTATIME
#define MS_STRICTATIME (1<<24)
#endif
#ifndef PR_SET_NO_NEW_PRIVS
#define PR_SET_NO_NEW_PRIVS 38
#endif
#ifndef PR_SET_CHILD_SUBREAPER
#define PR_SET_CHILD_SUBREAPER 36
#endif
#ifndef MAX_HANDLE_SZ
#define MAX_HANDLE_SZ 128
#endif
#if defined __x86_64__
# ifndef __NR_name_to_handle_at
# define __NR_name_to_handle_at 303
# endif
#elif defined __i386__
# ifndef __NR_name_to_handle_at
# define __NR_name_to_handle_at 341
# endif
#elif defined __arm__
# ifndef __NR_name_to_handle_at
# define __NR_name_to_handle_at 370
# endif
#elif defined __powerpc__
# ifndef __NR_name_to_handle_at
# define __NR_name_to_handle_at 345
# endif
#else
# ifndef __NR_name_to_handle_at
# error __NR_name_to_handle_at is not defined
# endif
#endif
#if !HAVE_DECL_NAME_TO_HANDLE_AT
struct file_handle {
unsigned int handle_bytes;
int handle_type;
unsigned char f_handle[0];
};
static inline int name_to_handle_at(int fd, const char *name, struct file_handle *handle, int *mnt_id, int flags) {
return syscall(__NR_name_to_handle_at, fd, name, handle, mnt_id, flags);
}
#endif
#ifndef HAVE_SECURE_GETENV
# ifdef HAVE___SECURE_GETENV
# define secure_getenv __secure_getenv
# else
# error neither secure_getenv nor __secure_getenv are available
# endif
#endif
#ifndef CIFS_MAGIC_NUMBER
#define CIFS_MAGIC_NUMBER 0xFF534D42
#endif
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
#ifndef foomkdirhfoo
#define foomkdirhfoo
/***
This file is part of systemd.
Copyright 2010 Lennart Poettering
systemd is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
systemd is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
int mkdir_label(const char *path, mode_t mode);
int mkdir_safe(const char *path, mode_t mode, uid_t uid, gid_t gid);
int mkdir_safe_label(const char *path, mode_t mode, uid_t uid, gid_t gid);
int mkdir_parents(const char *path, mode_t mode);
int mkdir_parents_label(const char *path, mode_t mode);
int mkdir_p(const char *path, mode_t mode);
int mkdir_p_label(const char *path, mode_t mode);
#endif
This diff is collapsed.
......@@ -7,7 +7,7 @@ AM_CPPFLAGS = \
-DROOTPREFIX=\"$(rootprefix)\" \
-I $(top_srcdir)/src/libudev \
-I $(top_srcdir)/src/udev \
$(OUR_CPPFLAGS)
-I $(top_srcdir)/src/shared
sbin_PROGRAMS = \
udevd \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment