commit:     37a9949c0e16fe3356b3db68a5b7bf3d3cdf53ce
Author:     David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Sun Apr  7 13:19:20 2019 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Sun Apr  7 13:19:20 2019 +0000
URL:        https://gitweb.gentoo.org/proj/ufed.git/commit/?id=37a9949c

Modernize Autotools

Signed-off-by: David Seifert <soap <AT> gentoo.org>

 Makefile.am  | 30 +++++++++++++++---------------
 configure.ac | 22 +++++++++-------------
 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 [email protected]
-       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' \
-               $< >[email protected]
-       chmod +x [email protected]
-       mv [email protected] $@
+               ufed.pl.in >ufed.tmp && \
+       chmod +x ufed.tmp && \
+       mv ufed.tmp ufed
 
-ufed.8: ufed.8.in
-       rm -f [email protected]
-       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' \
-               $< >[email protected]
-       chmod +x [email protected]
-       mv [email protected] $@
+               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

Reply via email to