summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Seifert <soap@gentoo.org>2019-04-07 15:19:20 +0200
committerDavid Seifert <soap@gentoo.org>2019-04-07 15:19:20 +0200
commit37a9949c0e16fe3356b3db68a5b7bf3d3cdf53ce (patch)
treeb2ff3188e759c5c0657af5f12b985a32ae45d40e
parentReplace `libexecdir` by `pkglibexecdir` (diff)
downloadufed-37a9949c0e16fe3356b3db68a5b7bf3d3cdf53ce.tar.gz
ufed-37a9949c0e16fe3356b3db68a5b7bf3d3cdf53ce.tar.bz2
ufed-37a9949c0e16fe3356b3db68a5b7bf3d3cdf53ce.zip
Modernize Autotools
Signed-off-by: David Seifert <soap@gentoo.org>
-rw-r--r--Makefile.am30
-rw-r--r--configure.ac22
2 files changed, 24 insertions, 28 deletions
diff --git a/Makefile.am b/Makefile.am
index 954f36b..f8f5999 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,6 +1,4 @@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PERL = @PERL@
-perldir = @datadir@/@PACKAGE@
+perldir = $(pkgdatadir)
E_PREFIX := $(shell portageq envvar EPREFIX 2>/dev/null)
sbin_SCRIPTS = ufed
@@ -26,21 +24,23 @@ noinst_HEADERS = \
dist_man_MANS = ufed.8
EXTRA_DIST = ufed.pl.in ufed.8.in
-ufed: ufed.pl.in
- rm -f $@.tmp
- sed \
+ufed: $(top_srcdir)/ufed.pl.in
+ cd $(top_srcdir) && \
+ rm -f ufed.tmp && \
+ $(SED) \
-e 's|XX_PACKAGE_VERSION[@]|$(PACKAGE_VERSION)|g' \
-e 's|XX_PERL[@]|$(PERL)|g' \
-e 's|XX_pkglibexecdir[@]|$(pkglibexecdir)|g' \
-e 's|XX_perldir[@]|$(perldir)|g' \
- $< >$@.tmp
- chmod +x $@.tmp
- mv $@.tmp $@
+ ufed.pl.in >ufed.tmp && \
+ chmod +x ufed.tmp && \
+ mv ufed.tmp ufed
-ufed.8: ufed.8.in
- rm -f $@.tmp
- sed \
+ufed.8: $(top_srcdir)/ufed.8.in
+ cd $(top_srcdir) && \
+ rm -f ufed.8.tmp && \
+ $(SED) \
-e 's|@GENTOO_PORTAGE_EPREFIX@|$(E_PREFIX)|g' \
- $< >$@.tmp
- chmod +x $@.tmp
- mv $@.tmp $@
+ ufed.8.in >ufed.8.tmp && \
+ chmod +x ufed.8.tmp && \
+ mv ufed.8.tmp ufed.8
diff --git a/configure.ac b/configure.ac
index a3308b9..736d06a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,23 +1,19 @@
-AC_PREREQ(2.68)
+AC_PREREQ([2.69])
AC_INIT([ufed],[git],[https://bugs.gentoo.org/])
-AM_INIT_AUTOMAKE([foreign])
+AM_INIT_AUTOMAKE([foreign subdir-objects])
AC_CONFIG_SRCDIR([ufed-curses.c])
AC_CONFIG_HEADERS([config.h])
AC_PROG_CC
AC_PROG_CC_C99
-if test "$ac_cv_prog_cc_c99" != no
-then
- CFLAGS="$CFLAGS -Wall -Wextra -pedantic"
- CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=600"
-else
- AC_PROG_CC_C89
- AC_C_INLINE
- CFLAGS="$CFLAGS -Wall -W"
- CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=500"
-fi
-CFLAGS="${CFLAGS} -Wmissing-prototypes -Wstrict-prototypes"
+AS_IF([test "x$ac_cv_prog_cc_c99" = "xno"], [
+ AC_MSG_ERROR([ufed requires a C99 capable compiler!])
+])
+
+CPPFLAGS="${CPPFLAGS} -D_XOPEN_SOURCE=600"
+CFLAGS="${CFLAGS} -Wall -Wextra -Wmissing-prototypes -Wstrict-prototypes -pedantic"
+AC_PROG_SED
PKG_PROG_PKG_CONFIG
AC_TYPE_SIZE_T