Skip to content

Commit

Permalink
Merge pull request #113 from garlick/autocleanup
Browse files Browse the repository at this point in the history
configure: minor cleanup
  • Loading branch information
mergify[bot] authored Dec 31, 2024
2 parents 31f7656 + 7a5671b commit 963213f
Show file tree
Hide file tree
Showing 9 changed files with 65 additions and 590 deletions.
1 change: 0 additions & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ SUBDIRS = \
libdiod \
diod \
utils \
scripts \
etc

if ENABLE_TESTS
Expand Down
19 changes: 3 additions & 16 deletions autogen.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,4 @@
#!/bin/sh

echo "Running aclocal ... "
aclocal -I config
#echo "Running libtoolize ... "
#libtoolize --automake --copy
echo "Running autoheader ... "
autoheader
echo "Running automake ... "
automake --copy --add-missing
echo "Running autoconf ... "
autoconf
echo "Cleaning up ..."
mv aclocal.m4 config/
rm -rf autom4te.cache
echo "Now run ./configure to configure diod for your environment."

echo "Running autoreconf --force --verbose --install"
autoreconf --force --verbose --install || exit
echo "Now run ./configure."
47 changes: 47 additions & 0 deletions config/systemd.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
dnl Probe for systemd libraries and installation paths.
dnl
dnl Provides the RRA_WITH_SYSTEMD_UNITDIR macro, which adds the
dnl --with-systemdsystemunitdir configure flag, sets the systemdsystemunitdir
dnl substitution variable, and provides the HAVE_SYSTEMD Automake conditional
dnl to use to control whether to install unit files.
dnl
dnl Provides the RRA_LIB_SYSTEMD_DAEMON_OPTIONAL macro, which sets
dnl SYSTEMD_CFLAGS and SYSTEMD_LIBS substitution variables if
dnl libsystemd-daemon is available and defines HAVE_SD_NOTIFY. pkg-config
dnl support for libsystemd-daemon is required for it to be detected.
dnl
dnl Depends on the Autoconf macros that come with pkg-config.
dnl
dnl The canonical version of this file is maintained in the rra-c-util
dnl package, available at <http://www.eyrie.org/~eagle/software/rra-c-util/>.
dnl
dnl Written by Russ Allbery <[email protected]>
dnl Copyright 2013, 2014
dnl The Board of Trustees of the Leland Stanford Junior University
dnl
dnl This file is free software; the authors give unlimited permission to copy
dnl and/or distribute it, with or without modifications, as long as this
dnl notice is preserved.

dnl Determine the systemd system unit directory, along with a configure flag
dnl to override, and sets @systemdsystemunitdir@. Provides the Automake
dnl HAVE_SYSTEMD Automake conditional.
AC_DEFUN([RRA_WITH_SYSTEMD_UNITDIR],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
AS_IF([test x"$PKG_CONFIG" = x], [PKG_CONFIG=false])
AC_ARG_WITH([systemdsystemunitdir],
[AS_HELP_STRING([--with-systemdsystemunitdir=DIR],
[Directory for systemd service files])],
[],
[with_systemdsystemunitdir=\${prefix}$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
AS_IF([test x"$with_systemdsystemunitdir" != xno],
[AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])])
AM_CONDITIONAL([HAVE_SYSTEMD],
[test -n "$with_systemdsystemunitdir" -a x"$with_systemdsystemunitdir" != xno])])

dnl Check for libsystemd-daemon and define SYSTEMD_DAEMON_{CFLAGS,LIBS} if it
dnl is available.
AC_DEFUN([RRA_LIB_SYSTEMD_DAEMON_OPTIONAL],
[PKG_CHECK_EXISTS([libsystemd-daemon],
[PKG_CHECK_MODULES([SYSTEMD_DAEMON], [libsystemd-daemon])
AC_DEFINE([HAVE_SD_NOTIFY], 1, [Define if sd_notify is available.])])])
14 changes: 8 additions & 6 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ AM_INIT_AUTOMAKE([subdir-objects foreign]
*) echo serial-tests;;
esac]))
AM_SILENT_RULES([yes])
AM_CONFIG_HEADER([config/config.h])
AC_CONFIG_HEADERS([config/config.h])
AM_MAINTAINER_MODE([enable])

AC_DEFINE([_GNU_SOURCE], 1,
Expand Down Expand Up @@ -56,7 +56,6 @@ PKG_CHECK_MODULES([ncurses], [ncurses])
##
# Checks for header files.
##
AC_HEADER_STDC
AC_CHECK_HEADERS( \
getopt.h \
pthread.h \
Expand Down Expand Up @@ -207,6 +206,11 @@ if test "x${enable_impersonation}" = "xganesha"; then
AC_DEFINE([USE_IMPERSONATION_GANESHA], [1], [Use nfs-ganesha-kmod syscalls])
fi

##
# Check for systemd
##
RRA_WITH_SYSTEMD_UNITDIR

##
# Epilogue
##
Expand All @@ -226,10 +230,8 @@ AC_CONFIG_FILES( \
utils/diodshowmount.8 \
utils/dioddate.8 \
etc/diod.conf.5 \
scripts/Makefile \
scripts/diod.init \
scripts/auto.diod \
scripts/diod.service \
etc/diod.service \
etc/auto.diod \
diod/Makefile \
utils/Makefile \
tests/Makefile \
Expand Down
14 changes: 7 additions & 7 deletions etc/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
systemdsystemunit_DATA = \
diod.service

man5_MANS = \
diod.conf.5

install-data-local:
$(top_srcdir)/config/install-sh -m 644 $(srcdir)/diod.conf \
$(DESTDIR)$(sysconfdir)/diod.conf

uninstall-local:
$(RM) $(DESTDIR)$(sysconfdir)/diod.conf
sysconf_DATA = \
diod.conf \
auto.diod

EXTRA_DIST = diod.conf $(man5_MANS)
EXTRA_DIST = diod.conf
File renamed without changes.
File renamed without changes.
8 changes: 0 additions & 8 deletions scripts/Makefile.am

This file was deleted.

Loading

0 comments on commit 963213f

Please sign in to comment.