Collection of DPF-based plugins for packaging
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

90 lines
2.7KB

  1. # ===========================================================================
  2. # https://www.gnu.org/software/autoconf-archive/ax_install_files.html
  3. # ===========================================================================
  4. #
  5. # SYNOPSIS
  6. #
  7. # AX_INSTALL_FILES
  8. #
  9. # DESCRIPTION
  10. #
  11. # Adds target for creating a install_files file, which contains the list
  12. # of files that will be installed.
  13. #
  14. # LICENSE
  15. #
  16. # Copyright (c) 2009 Tom Howard <tomhoward@users.sf.net>
  17. #
  18. # Copying and distribution of this file, with or without modification, are
  19. # permitted in any medium without royalty provided the copyright notice
  20. # and this notice are preserved. This file is offered as-is, without any
  21. # warranty.
  22. #serial 14
  23. AC_DEFUN([AX_INSTALL_FILES],
  24. [
  25. AC_MSG_NOTICE([adding install_files support])
  26. AC_ARG_VAR(GAWK, [gawk executable to use])
  27. if test "x$GAWK" = "x"; then
  28. AC_CHECK_PROGS(GAWK,[gawk])
  29. fi
  30. AC_SUBST(GAWK)
  31. if test "x$GAWK" != "x"; then
  32. AC_MSG_NOTICE([install_files support enabled])
  33. AX_HAVE_INSTALL_FILES=true
  34. else
  35. AX_HAVE_INSTALL_FILES=false;
  36. AC_MSG_WARN([install_files support disable... gawk not found])
  37. fi
  38. AM_CONDITIONAL([ax_install_files_enabled],
  39. [test "x$AX_HAVE_INSTALL_FILES" = "xtrue"])
  40. AX_ADD_AM_MACRO_STATIC([
  41. if ax_install_files_enabled
  42. AX_INSTALL_FILES_CLEANFILES = \\
  43. \$(top_builddir)/install_files
  44. \$(top_builddir)/install_files: do-mfstamp-recursive
  45. @if test \"\$(top_builddir)/mfstamp\" -nt \"\$(top_builddir)/install_files\"; then \\
  46. cd \$(top_builddir) && STAGING=\"\$(PWD)/staging\"; \\
  47. \$(MAKE) \$(AM_MAKEFLAGS) DESTDIR=\"\$\$STAGING\" install; \\
  48. cd \"\$\$STAGING\" && find "." ! -type d -print | \\
  49. \$(GAWK) ' \\
  50. /^\\.\\/usr\\/local\\/lib/ { \\
  51. sub( /\\.\\/usr\\/local\\/lib/, \"%%{_libdir}\" ); } \\
  52. /^\\.\\/usr\\/local\\/bin/ { \\
  53. sub( /\\.\\/usr\\/local\\/bin/, \"%%{_bindir}\" ); } \\
  54. /^\\.\\/usr\\/local\\/include/ { \\
  55. sub( /\\.\\/usr\\/local\\/include/, \"%%{_includedir}\" ); } \\
  56. /^\\.\\/usr\\/local\\/share/ { \\
  57. sub( /\\.\\/usr\\/local\\/share/, \"%%{_datadir}\" ); } \\
  58. /^\\.\\/usr\\/local/ { \\
  59. sub( /\\.\\/usr\\/local/, \"%%{_prefix}\" ); } \\
  60. /^\\./ { sub( /\\./, \"\" ); } \\
  61. /./ { print; }' > ../install_files; \\
  62. rm -rf \"\$\$STAGING\"; \\
  63. else \\
  64. echo \"\\\`\$(top_builddir)/install_files\' is up to date.\"; \\
  65. fi
  66. ])
  67. AX_ADD_RECURSIVE_AM_MACRO_STATIC([do-mfstamp],[
  68. \$(top_builddir)/mfstamp: do-mfstamp-recursive
  69. do-mfstamp-am do-mfstamp: Makefile.in
  70. @echo \"timestamp for all Makefile.in files\" > \$(top_builddir)/mfstamp
  71. @touch ${AX_DOLLAR}@
  72. ])
  73. AX_ADD_AM_MACRO_STATIC([
  74. endif # ax_install_files_enabled
  75. clean-local: clean-ax-install-files
  76. clean-ax-install-files:
  77. -test -z \"\$(AX_INSTALL_FILES)\" || rm -f \$(AX_INSTALL_FILES)
  78. ])
  79. ])# AX_INSTALL_FILES