automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v2 2/3] AX_DIST_RPM (and dependent macros) Modified to use AX_ADD


From: Allan Caffee
Subject: [PATCH v2 2/3] AX_DIST_RPM (and dependent macros) Modified to use AX_ADD_AM_MACRO_STATIC.
Date: Wed, 4 Mar 2009 21:40:46 -0500
User-agent: Mutt/1.5.17+20080114 (2008-01-14)

The macros AX_UPLOAD, AX_INSTALL_FILES, and AX_EXTRA_DIST which are often used
in conjunction with AX_DIST_RPM were also updated to use
AX_ADD_AM_MACRO_STATIC.

Thanks go to Ralf Wildenhues for the idea of adding local cleanup and
distribution targets as prerequisites the *-local/*-hook targets.
---
 ax_dist_rpm.m4      |  198 ++++++++++++++++++++++++++-------------------------
 ax_extra_dist.m4    |    4 +-
 ax_install_files.m4 |   37 +++++++---
 ax_upload.m4        |    6 +-
 4 files changed, 131 insertions(+), 114 deletions(-)

diff --git a/ax_dist_rpm.m4 b/ax_dist_rpm.m4
index 0d4f799..d962bd6 100644
--- a/ax_dist_rpm.m4
+++ b/ax_dist_rpm.m4
@@ -54,7 +54,7 @@
 #
 # LAST MODIFICATION
 #
-#   2008-04-12
+#   2009-02-03
 #
 # COPYLEFT
 #
@@ -68,13 +68,54 @@ AC_DEFUN([AX_DIST_RPM],
 [
 AC_REQUIRE([AX_INSTALL_FILES])
 AC_MSG_NOTICE([adding rpm support])
+AM_CONDITIONAL([ax_dist_rpm_enable_upload],[test "x$USING_AX_UPLOAD" != "x"])
+AM_CONDITIONAL([ax_dist_rpm_using_ax_extra_dist],[test "x$USING_AX_EXTRA_DIST" 
!= "x"])
+ax_dist_rpm_enabled=false
 if test "x$AX_HAVE_INSTALL_FILES" = "xtrue"; then
-    AX_ADD_AM_MACRO([[
+    AC_MSG_CHECKING([rpm spec template])
+    if test -f "$1.in"; then
+        AC_MSG_RESULT([$1.in])
+        AX_RPM_SPEC_FILE="$1";
+       AC_SUBST(AX_RPM_SPEC_FILE)
+       AC_CONFIG_FILES([spec.tmpl])
+       AC_ARG_VAR(EDITOR, [default text editor])
+       if test "x$EDITOR" = "x"; then
+           AC_CHECK_PROGS(EDITOR,[vim vi emacs])
+       fi
+       AC_ARG_VAR(RPM, [rpm executable to use])
+       if test "x$RPM" = "x"; then
+           AC_CHECK_PROGS(RPM,[rpmbuild rpm echo])
+       fi
+       if test "x$RPM" != "x"; then
+           AC_ARG_VAR(PLATFORM_SUFFIX, [A short name for your platform that 
will be added to the name of the the binary RPMs you may choose to create (by 
running make rpm).  e.g. rh71 for RedHat 7.1, lsb1.3 for a LSB 1.3 compliant 
system (SuSE 8.2 or RedHat 9), osx103 for OS X 10.3.x, etc])
+           AC_MSG_CHECKING([rpm platform suffix])
+            if test "x$PLATFORM_SUFFIX" != "x"; then
+               AC_MSG_RESULT([$PLATFORM_SUFFIX])
+               AC_SUBST([PLATFORM_SUFFIX])
+               ax_dist_rpm_enabled=true
+            else
+               AC_MSG_RESULT([$PLATFORM_SUFFIX])
+               AC_MSG_WARN([rpm support disabled... PLATFORM_SUFFIX not set])
+           fi
+        else
+           AC_MSG_NOTICE([rpm support disabled... neither rpmbuild or rpm was 
found])
+       fi
+    else
+        AC_MSG_RESULT([not found])
+        AC_MSG_ERROR([rpm spec template "$1.in" could not be found])
+    fi
+else
+    AC_MSG_NOTICE([rpm support disabled... install_files not available])
+fi
+AM_CONDITIONAL([ax_dist_rpm_enabled], [test x"$ax_dist_rpm_enabled" = x"true"])
+
+AX_ADD_AM_MACRO_STATIC([
+if ax_dist_rpm_enabled
 
-CLEAN_FILES += \$(top_builddir)/RPMChangeLog
+AX_DIST_RPM_CLEANFILES = \$(top_builddir)/RPMChangeLog 
\$(AX_INSTALL_FILES_CLEANFILES)
 
 \$(top_builddir)/RPMChangeLog: \$(top_srcdir)/ChangeLog
-       $GAWK \'/^[^0-9]/ { \\
+       \$(GAWK) '/^[^0-9]/ { \\
                     if( \$${AX_DOLLAR}1 == \"*\" ) \$${AX_DOLLAR}1 = \"-\"; 
print; } \\
                 /^\$\$/ { \\
                     print; } \\
@@ -84,54 +125,29 @@ CLEAN_FILES += \$(top_builddir)/RPMChangeLog
                    \$${AX_DOLLAR}1 = strftime( \"%%a %%b %%d %%Y\", \\
                                    mktime( date[ 1 ] \" \" date[ 2 ] \" \" 
date [ 3 ] \" 00 00 00\" ) ); \\
                     print \"* \" \$${AX_DOLLAR}0; } \\
-               /Released $PACKAGE-/ { \\
-                   gsub( /$PACKAGE-/, \"\", \$${AX_DOLLAR}2 ); \\
+               /Released \$(PACKAGE)-/ { \\
+                   gsub( /\$(PACKAGE)-/, \"\", \$${AX_DOLLAR}2 ); \\
                    split( \$${AX_DOLLAR}2, ver, \".\" ); \\
-                   split( "$VERSION", curr_ver, \".\" ); \\
+                   split( \"\$(VERSION)\", curr_ver, \".\" ); \\
                    if( ver[ 1 ] != curr_ver[ 1 ] || ver[ 2 ] != curr_ver[ 2 ] 
) stop = 1; } \\
                END { \\
-                   print \"[Please see the ChangeLog file for older changes] - 
Ed.\"; }\' \\
+                   print \"[Please see the ChangeLog file for older changes] - 
Ed.\"; }' \\
                \$(top_srcdir)/ChangeLog > \$(top_builddir)/RPMChangeLog
 
-]])
-    AC_MSG_CHECKING([rpm spec template])
-    if test -f "$1.in"; then
-        AC_MSG_RESULT([$1.in])
-        AX_RPM_SPEC_FILE="$1";
-       AC_SUBST(AX_RPM_SPEC_FILE)
-       AC_CONFIG_FILES([spec.tmpl])
-       AX_ADD_AM_MACRO([[
-
-CLEAN_FILES += \$(top_builddir)/$PACKAGE-$VERSION.spec
-EXTRA_DIST += \$(top_builddir)/$PACKAGE-$VERSION.spec 
\$(top_builddir)/$AX_RPM_SPEC_FILE.in
+AX_DIST_RPM_CLEANFILES += \$(top_builddir)/\$(PACKAGE)-\$(VERSION).spec
+AX_DIST_RPM_EXTRA_DIST = \$(top_builddir)/\$(PACKAGE)-\$(VERSION).spec 
\$(top_builddir)/\$(AX_RPM_SPEC_FILE).in
 
-spec: \$(top_builddir)/$PACKAGE-$VERSION.spec
+spec: \$(top_builddir)/\$(PACKAGE)-\$(VERSION).spec
 
-\$(top_builddir)/$PACKAGE-$VERSION.spec:       
\$(top_builddir)/$AX_RPM_SPEC_FILE \$(top_builddir)/install_files 
\$(top_builddir)/RPMChangeLog
-       @cat \"\$(top_builddir)/$AX_RPM_SPEC_FILE\" \\
-       | $GAWK -v files=\"\$\$files\" \\
-           \'{ print; } \\
-           /%%defattr/ { while((getline < \"install_files\" ) > 0 ) { print; } 
}\' \\
-           > \"\$(top_builddir)/$PACKAGE-$VERSION.spec\"
-       @cat \"\$(top_builddir)/RPMChangeLog\" >> 
\"\$(top_builddir)/$PACKAGE-$VERSION.spec\"
+\$(top_builddir)/\$(PACKAGE)-\$(VERSION).spec: 
\$(top_builddir)/\$(AX_RPM_SPEC_FILE) \$(top_builddir)/install_files 
\$(top_builddir)/RPMChangeLog
+       @cat \"\$(top_builddir)/\$(AX_RPM_SPEC_FILE)\" \\
+       | \$(GAWK) -v files=\"\$\$files\" \\
+           '{ print; } \\
+           /%%defattr/ { while((getline < \"install_files\" ) > 0 ) { print; } 
}' \\
+           > \"\$(top_builddir)/\$(PACKAGE)-\$(VERSION).spec\"
+       @cat \"\$(top_builddir)/RPMChangeLog\" >> 
\"\$(top_builddir)/\$(PACKAGE)-\$(VERSION).spec\"
 
-]])
-
-       AC_ARG_VAR(EDITOR, [default text editor])
-       if test "x$EDITOR" = "x"; then
-           AC_CHECK_PROGS(EDITOR,[vim vi emacs])
-       fi
-       AC_ARG_VAR(RPM, [rpm executable to use])
-       if test "x$RPM" = "x"; then
-           AC_CHECK_PROGS(RPM,[rpmbuild rpm echo])
-       fi
-       if test "x$RPM" != "x"; then
-           AC_ARG_VAR(PLATFORM_SUFFIX, [A short name for your platform that 
will be added to the name of the the binary RPMs you may choose to create (by 
running make rpm).  e.g. rh71 for RedHat 7.1, lsb1.3 for a LSB 1.3 compliant 
system (SuSE 8.2 or RedHat 9), osx103 for OS X 10.3.x, etc])
-           AC_MSG_CHECKING([rpm platform suffix])
-            if test "x$PLATFORM_SUFFIX" != "x"; then
-               AC_MSG_RESULT([$PLATFORM_SUFFIX])
-                AX_ADD_AM_MACRO([[
-CLEANFILES += \\
+AX_DIST_RPM_CLEANFILES += \\
 \$(top_builddir)/*.rpm \\
 \$(top_builddir)/rpmmacros
 
@@ -158,7 +174,7 @@ CLEANFILES += \\
        echo \"RedHat Linux 7.1). and <YOUR_ORGANISATION> is the 
organisation\"; \\
        echo \"you are associated with.\"; \\
        echo \"\"; \\
-       echo \"Running \'make create-rpmmacros\' will create a ~/.rpmmacros 
file\"; \\
+       echo \"Running 'make create-rpmmacros' will create a ~/.rpmmacros 
file\"; \\
        echo \"for you and try to open it in an editor\"; \\
        exit -1
 
@@ -198,25 +214,25 @@ rpmmacros: ~/.rpmmacros
 dist-rpm: rpm
 dist-srpm: srpm
 
-rpm: $PACKAGE-$VERSION-0.i*.$PLATFORM_SUFFIX.rpm
-srpm: $PACKAGE-$VERSION-0.src.rpm
+rpm: \$(PACKAGE)-\$(VERSION)-0.i*.$PLATFORM_SUFFIX.rpm
+srpm: \$(PACKAGE)-\$(VERSION)-0.src.rpm
 
-\$(top_builddir)/$PACKAGE-$VERSION-0.i*.$PLATFORM_SUFFIX.rpm:  
\$(top_builddir)/rpmmacros \$(top_builddir)/$PACKAGE-$VERSION.tar.gz
-       @$RPM -tb \$(top_builddir)/$PACKAGE-$VERSION.tar.gz
-       @RPMDIR=\`cat \$(top_builddir)/rpmmacros | $GAWK \'/%%_rpmdir/ { print 
\$${AX_DOLLAR}2; }\'\`; \\
-       echo \"\$\$RPMDIR\" | $EGREP \"%%{.*}\" > /dev/null 2>&1; \\
+\$(top_builddir)/\$(PACKAGE)-\$(VERSION)-0.i*.$PLATFORM_SUFFIX.rpm:    
\$(top_builddir)/rpmmacros \$(top_builddir)/\$(PACKAGE)-\$(VERSION).tar.gz
+       @\$(RPM) -tb \$(top_builddir)/\$(PACKAGE)-\$(VERSION).tar.gz
+       @RPMDIR=\`cat \$(top_builddir)/rpmmacros | \$(GAWK) '/%%_rpmdir/ { 
print \$${AX_DOLLAR}2; }'\`; \\
+       echo \"\$\$RPMDIR\" | \$(EGREP) \"%%{.*}\" > /dev/null 2>&1; \\
        EXIT=\$\$?; \\
        while test \"\$\$EXIT\" == \"0\"; do \\
-               RPMDIR=\`echo \"\$\$RPMDIR\" | $GAWK \'/%%{.*}/ \\
+               RPMDIR=\`echo \"\$\$RPMDIR\" | \$(GAWK) '/%%{.*}/ \\
                { match( \$${AX_DOLLAR}0, /%%{.*}/, macro ); \\
                  suffix = substr( \$${AX_DOLLAR}0, RSTART + RLENGTH ); \\
                  gsub( /{|}/, \"\", macro[ 0 ] ); \\
                  while( ( getline < \"\$(top_builddir)/rpmmacros\" ) > 0 ) \\
                  { if( \$${AX_DOLLAR}1 == macro[ 0 ] ) { print \$${AX_DOLLAR}2 
suffix; exit; } } \\
                  exit 1; \\
-               }\'\`; \\
+               }'\`; \\
                if test \"\$${AX_DOLLAR}?\" == \"0\"; then \\
-                       echo \"\$\$RPMDIR\" | $EGREP \"%%{.*}\" > /dev/null 
2>&1; \\
+                       echo \"\$\$RPMDIR\" | \$(EGREP) \"%%{.*}\" > /dev/null 
2>&1; \\
                        EXIT=\"\$${AX_DOLLAR}?\"; \\
                else \\
                        EXIT=\"1\"; \\
@@ -224,9 +240,9 @@ srpm: $PACKAGE-$VERSION-0.src.rpm
        done; \\
        if test -d \"\$\$RPMDIR\"; then \\
            for dir in \`ls \"\$\$RPMDIR\"\`; do \\
-               ls \"\$\${RPMDIR}\$\${dir}/$PACKAGE-$VERSION-0.\$\${dir}.rpm\" 
> /dev/null 2>&1; \\
+               ls 
\"\$\${RPMDIR}\$\${dir}/\$(PACKAGE)-\$(VERSION)-0.\$\${dir}.rpm\" > /dev/null 
2>&1; \\
                if test \"\$${AX_DOLLAR}?\" == \"0\"; then \\
-                   cp 
\"\$\${RPMDIR}\$\${dir}/$PACKAGE-$VERSION-0.\$\${dir}.rpm\" 
\"\$(top_builddir)/$PACKAGE-$VERSION-0.\$\${dir}.$PLATFORM_SUFFIX.rpm\"; \\
+                   cp 
\"\$\${RPMDIR}\$\${dir}/\$(PACKAGE)-\$(VERSION)-0.\$\${dir}.rpm\" 
\"\$(top_builddir)/\$(PACKAGE)-\$(VERSION)-0.\$\${dir}.$PLATFORM_SUFFIX.rpm\"; 
\\
                    found=true; \\
                fi; \\
            done; \\
@@ -241,37 +257,37 @@ srpm: $PACKAGE-$VERSION-0.src.rpm
            exit 1; \\
        fi;
 
-\$(top_builddir)/$PACKAGE-$VERSION.tar.gz: \$(top_builddir)/install_files
+\$(top_builddir)/\$(PACKAGE)-\$(VERSION).tar.gz: \$(top_builddir)/install_files
        cd \"\$(top_builddir)\" && \$(MAKE) \$(AM_MAKEFLAGS) dist-gzip
 
 
 
 
-$PACKAGE-$VERSION-0.src.rpm:   \$(top_builddir)/rpmmacros 
\$(top_builddir)/$PACKAGE-$VERSION.tar.gz
-       @$RPM -ts \$(top_builddir)/$PACKAGE-$VERSION.tar.gz
-       @SRPMDIR=\`cat rpmmacros | $GAWK \'/%%_srcrpmdir/ { print 
${AX_DOLLAR}${AX_DOLLAR}2; }\'\`; \\
-       echo \"${AX_DOLLAR}${AX_DOLLAR}SRPMDIR\" | $EGREP \"%%{.*}\" > 
/dev/null 2>&1; \\
+\$(PACKAGE)-\$(VERSION)-0.src.rpm:     \$(top_builddir)/rpmmacros 
\$(top_builddir)/\$(PACKAGE)-\$(VERSION).tar.gz
+       @\$(RPM) -ts \$(top_builddir)/\$(PACKAGE)-\$(VERSION).tar.gz
+       @SRPMDIR=\`cat rpmmacros | \$(GAWK) '/%%_srcrpmdir/ { print 
${AX_DOLLAR}${AX_DOLLAR}2; }'\`; \\
+       echo \"${AX_DOLLAR}${AX_DOLLAR}SRPMDIR\" | \$(EGREP) \"%%{.*}\" > 
/dev/null 2>&1; \\
        EXIT=${AX_DOLLAR}${AX_DOLLAR}?; \\
        while test \"${AX_DOLLAR}${AX_DOLLAR}EXIT\" == \"0\"; do \\
-           SRPMDIR=\`echo \"${AX_DOLLAR}${AX_DOLLAR}SRPMDIR\" | $GAWK 
\'/%%{.*}/ \\
+           SRPMDIR=\`echo \"${AX_DOLLAR}${AX_DOLLAR}SRPMDIR\" | \$(GAWK) 
'/%%{.*}/ \\
                { match( ${AX_DOLLAR}${AX_DOLLAR}0, /%%{.*}/, macro ); \\
                  suffix = substr( ${AX_DOLLAR}${AX_DOLLAR}0, RSTART + RLENGTH 
); \\
                  gsub( /{|}/, \"\", macro[ 0 ] ); \\
                  while( ( getline < \"rpmmacros\" ) > 0 ) \\
                  { if( ${AX_DOLLAR}${AX_DOLLAR}1 == macro[ 0 ] ) { print 
${AX_DOLLAR}${AX_DOLLAR}2 suffix; exit; } } \\
                  exit 1; \\
-               }\'\`; \\
+               }'\`; \\
                if test \"${AX_DOLLAR}${AX_DOLLAR}?\" == \"0\"; then \\
-                       echo \"${AX_DOLLAR}${AX_DOLLAR}SRPMDIR\" | $EGREP 
\"%%{.*}\" > /dev/null 2>&1; \\
+                       echo \"${AX_DOLLAR}${AX_DOLLAR}SRPMDIR\" | \$(EGREP) 
\"%%{.*}\" > /dev/null 2>&1; \\
                        EXIT=\"${AX_DOLLAR}${AX_DOLLAR}?\"; \\
                else \\
                        EXIT=\"1\"; \\
                fi; \\
        done; \\
        if test -d \"${AX_DOLLAR}${AX_DOLLAR}SRPMDIR\"; then \\
-           ls 
\"${AX_DOLLAR}${AX_DOLLAR}{SRPMDIR}/$PACKAGE-$VERSION-0.src.rpm\" > /dev/null 
2>&1; \\
+           ls 
\"${AX_DOLLAR}${AX_DOLLAR}{SRPMDIR}/\$(PACKAGE)-\$(VERSION)-0.src.rpm\" > 
/dev/null 2>&1; \\
            if test \"${AX_DOLLAR}${AX_DOLLAR}?\" == \"0\"; then \\
-               cp \"\$${AX_DOLLAR}{SRPMDIR}/$PACKAGE-$VERSION-0.src.rpm\" 
\"${AX_DOLLAR}(top_builddir)/.\"; \\
+               cp 
\"\$${AX_DOLLAR}{SRPMDIR}/\$(PACKAGE)-\$(VERSION)-0.src.rpm\" 
\"${AX_DOLLAR}(top_builddir)/.\"; \\
                found=true; \\
            fi; \\
            if ! ${AX_DOLLAR}${AX_DOLLAR}found; then \\
@@ -286,41 +302,29 @@ $PACKAGE-$VERSION-0.src.rpm:      
\$(top_builddir)/rpmmacros \$(top_builddir)/$PACKAG
        fi;
 
 
-]])
+AX_DIST_RPM_EXTRA_BIN_DISTS = rpm
+AX_DIST_RPM_EXTRA_SRC_DISTS = srpm
 
-               if test "x$USING_AX_EXTRA_DIST" != "x"; then
-                   AX_ADD_AM_MACRO([[
+if ax_dist_rpm_enable_upload
+AX_DIST_RPM_UPLOAD_BIN = upload-rpm
+AX_DIST_RPM_UPLOAD_SRC = upload-srpm
 
-EXTRA_BIN_DISTS += rpm
-EXTRA_SRC_DISTS += srpm
-
-]])
-               fi
+AX_DIST_RPM_UPLOAD_TARGETS = \\
+{rpm=>$PACKAGE-$VERSION-0.i*.$PLATFORM_SUFFIX.rpm} \\
+{srpm=>$PACKAGE-$VERSION-0.src.rpm}
+endif # ax_dist_rpm_enable_upload
 
-               if test "x$USING_AX_UPLOAD" != "x"; then
-                   AX_ADD_AM_MACRO([[
+endif # ax_dist_rpm_enabled
 
-UPLOAD_BIN += upload-rpm
-UPLOAD_SRC += upload-srpm
+# These rules are included unconditionally since we cannot conditionally add
+# dependencies.
+clean-local: clean-ax-dist-rpm
+clean-ax-dist-rpm:
+       -test -z \"\$(AX_DIST_RPM_CLEANFILES)\" || rm -f 
\$(AX_DIST_RPM_CLEANFILES)
 
-UPLOAD_TARGETS += \\
-{rpm=>$PACKAGE-$VERSION-0.i*.$PLATFORM_SUFFIX.rpm} \\
-{srpm=>$PACKAGE-$VERSION-0.src.rpm}
+dist-hook: dist-hook-ax-dist-rpm
+dist-hook-ax-dist-rpm: \$(AX_DIST_RPM_EXTRA_DIST)
+       -test -z \"\$(AX_DIST_RPM_EXTRA_DIST)\" || cp 
\$(AX_DIST_RPM_EXTRA_DIST) \$(distdir)
 
-]])
-               fi
-            else
-               AC_MSG_RESULT([$PLATFORM_SUFFIX])
-               AC_MSG_WARN([rpm support disabled... PLATFORM_SUFFIX not set])
-           fi
-        else
-           AC_MSG_NOTICE([rpm support disabled... neither rpmbuild or rpm was 
found])
-       fi
-    else
-        AC_MSG_RESULT([not found])
-        AC_MSG_ERROR([rpm spec template "$1.in" could not be found])
-    fi
-else
-    AC_MSG_NOTICE([rpm support disabled... install_files not available])
-fi
+])
 ])
diff --git a/ax_extra_dist.m4 b/ax_extra_dist.m4
index 42f4706..4966dab 100644
--- a/ax_extra_dist.m4
+++ b/ax_extra_dist.m4
@@ -47,7 +47,7 @@ AC_DEFUN([AX_EXTRA_DIST],
 [
 AC_MSG_NOTICE([adding custom dist support])
 AM_CONDITIONAL(USING_AX_EXTRA_DIST, [true])
-AX_ADD_AM_MACRO([[
+AX_ADD_AM_MACRO_STATIC([
 EXTRA_SRC_DISTS =
 EXTRA_BIN_DISTS =
 dist-src-extra:
@@ -72,5 +72,5 @@ dist-bin:
 all-dist dist2 dist-all2: dist-src dist-bin
 
 all-dist-check dist2-check dist-all-check: dist-check dist-src-extra dist-bin
-]])
+])
 ])# AX_EXTRA_DIST
diff --git a/ax_install_files.m4 b/ax_install_files.m4
index 2a1903a..310acf3 100644
--- a/ax_install_files.m4
+++ b/ax_install_files.m4
@@ -13,7 +13,7 @@
 #
 # LAST MODIFICATION
 #
-#   2008-04-12
+#   2009-02-03
 #
 # COPYLEFT
 #
@@ -30,12 +30,22 @@ AC_ARG_VAR(GAWK, [gawk executable to use])
 if test "x$GAWK" = "x"; then
    AC_CHECK_PROGS(GAWK,[gawk])
 fi
+AC_SUBST(GAWK)
 
 if test "x$GAWK" != "x"; then
    AC_MSG_NOTICE([install_files support enabled])
    AX_HAVE_INSTALL_FILES=true
-   AX_ADD_AM_MACRO([[
-CLEANFILES += \\
+else
+    AX_HAVE_INSTALL_FILES=false;
+    AC_MSG_WARN([install_files support disable... gawk not found])
+fi
+AM_CONDITIONAL([ax_install_files_enabled],
+               [test "x$AX_HAVE_INSTALL_FILES" = "xtrue"])
+
+AX_ADD_AM_MACRO_STATIC([
+
+if ax_install_files_enabled
+AX_INSTALL_FILES_CLEANFILES = \\
 \$(top_builddir)/install_files
 
 \$(top_builddir)/install_files: do-mfstamp-recursive
@@ -43,7 +53,7 @@ CLEANFILES += \\
        cd \$(top_builddir) && STAGING=\"\$(PWD)/staging\"; \\
        \$(MAKE) \$(AM_MAKEFLAGS) DESTDIR=\"\$\$STAGING\" install; \\
        cd \"\$\$STAGING\" && find "." ! -type d -print | \\
-       $GAWK \' \\
+       \$(GAWK) ' \\
            /^\\.\\/usr\\/local\\/lib/ { \\
                sub( /\\.\\/usr\\/local\\/lib/, \"%%{_libdir}\" ); } \\
            /^\\.\\/usr\\/local\\/bin/ { \\
@@ -55,23 +65,26 @@ CLEANFILES += \\
            /^\\.\\/usr\\/local/ { \\
                sub( /\\.\\/usr\\/local/, \"%%{_prefix}\" ); } \\
            /^\\./ { sub( /\\./, \"\" ); } \\
-           /./ { print; }\' > ../install_files; \\
+           /./ { print; }' > ../install_files; \\
        rm -rf \"\$\$STAGING\"; \\
        else \\
            echo \"\\\`\$(top_builddir)/install_files\' is up to date.\"; \\
        fi
 
-]])
-    AX_ADD_RECURSIVE_AM_MACRO([do-mfstamp],[[
+])
+AX_ADD_RECURSIVE_AM_MACRO_STATIC([do-mfstamp],[
 \$(top_builddir)/mfstamp:  do-mfstamp-recursive
 
 do-mfstamp-am do-mfstamp: Makefile.in
        @echo \"timestamp for all Makefile.in files\" > \$(top_builddir)/mfstamp
        @touch ${AX_DOLLAR}@
 
-]])
-else
-    AX_HAVE_INSTALL_FILES=false;
-    AC_MSG_WARN([install_files support disable... gawk not found])
-fi
+])
+AX_ADD_AM_MACRO_STATIC([
+endif # ax_install_files_enabled
+
+clean-local: clean-ax-install-files
+clean-ax-install-files:
+       -test -z "\$(AX_INSTALL_FILES)" || rm -f \$(AX_INSTALL_FILES)
+])
 ])# AX_INSTALL_FILES
diff --git a/ax_upload.m4 b/ax_upload.m4
index 44ad7a9..4b807cd 100644
--- a/ax_upload.m4
+++ b/ax_upload.m4
@@ -35,7 +35,7 @@
 #
 # LAST MODIFICATION
 #
-#   2008-04-12
+#   2009-02-10
 #
 # COPYLEFT
 #
@@ -50,7 +50,7 @@ AC_DEFUN([AX_UPLOAD],
 AC_MSG_NOTICE([adding upload support])
 AM_CONDITIONAL(USING_AX_UPLOAD, [true])
 AC_MSG_NOTICE([setting upload command... \`$1\`])
-AX_ADD_AM_MACRO([[
+AX_ADD_AM_MACRO_STATIC([
 UPLOAD_BIN =
 UPLOAD_SRC = upload-gzip upload-bzip2 upload-zip
 UPLOAD_TARGETS = \\
@@ -79,5 +79,5 @@ upload-src: \$(UPLOAD_SRC)
 upload-bin: \$(UPLOAD_BIN)
 
 upload upload-all all-upload: upload-src upload-bin
-]])
+])
 ])
-- 
1.5.4.3





reply via email to

[Prev in Thread] Current Thread [Next in Thread]