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.

115 lines
3.6KB

  1. # ===========================================================================
  2. # https://www.gnu.org/software/autoconf-archive/ax_dist_msi.html
  3. # ===========================================================================
  4. #
  5. # SYNOPSIS
  6. #
  7. # AX_DIST_MSI([File])
  8. #
  9. # DESCRIPTION
  10. #
  11. # Adds support for a msi (Microsoft Installer) dist target.
  12. #
  13. # You must manually build the msi file yourself (probably from another
  14. # computer). But it will be added to the list of extra bin dists and
  15. # flagged for uploading (see ax_extra_dist.m4 and ax_upload.m4 for
  16. # details).
  17. #
  18. # LICENSE
  19. #
  20. # Copyright (c) 2009 Tom Howard <tomhoward@users.sf.net>
  21. #
  22. # Copying and distribution of this file, with or without modification, are
  23. # permitted in any medium without royalty provided the copyright notice
  24. # and this notice are preserved. This file is offered as-is, without any
  25. # warranty.
  26. #serial 15
  27. AC_DEFUN([AX_DIST_MSI],
  28. [
  29. AC_REQUIRE([AX_INSTALL_FILES])
  30. AC_MSG_NOTICE([adding dist-msi support])
  31. MSI_SETUP_FILE="$1"
  32. AC_SUBST(MSI_SETUP_FILE)
  33. if test "x$MSI_SETUP_FILE" != "x"; then
  34. AC_MSG_NOTICE([setting msi file... $MSI_SETUP_FILE])
  35. AC_SUBST(USING_DIST_MSI)
  36. AC_ARG_ENABLE(dist-msi,
  37. AS_HELP_STRING(--enable-dist-msi[=ARG],
  38. [enable support for msi (Microsoft Installer)
  39. dist target. ARG can be
  40. "yes" or "no". The default is "yes"]),
  41. if test "x$enableval" != "x"; then
  42. if test "x$enableval" = "xyes"; then
  43. USING_DIST_MSI=true
  44. AC_MSG_NOTICE([dist-msi support enabled])
  45. elif test "x$enableval" = "xno"; then
  46. USING_DIST_MSI=false
  47. AC_MSG_NOTICE([dist-msi support disabled])
  48. fi
  49. fi,
  50. USING_DIST_MSI=true
  51. AC_MSG_NOTICE([dist-msi support enabled]))
  52. else
  53. AC_MSG_NOTICE([setting msi file... not set])
  54. AC_MSG_ERROR([a file must be specified when addind msi support])
  55. fi
  56. AM_CONDITIONAL([ax_dist_msi_enabled],[test "x$USING_DIST_MSI" = "xtrue"])
  57. AX_ADD_AM_MACRO_STATIC([
  58. if ax_dist_msi_enabled
  59. msi dist-msi: \$(top_builddir)/\$(PACKAGE)-\$(VERSION).msi
  60. \$(top_builddir)/\$(PACKAGE)-\$(VERSION).msi: \$(top_builddir)/\$(MSI_SETUP_FILE)
  61. @cp -f \"\$(top_builddir)/\$(MSI_SETUP_FILE)\" \"${AX_DOLLAR}@\"
  62. ])
  63. AM_CONDITIONAL([ax_dist_msi_have_install_files],[test "x$AX_HAVE_INSTALL_FILES" = "xtrue"])
  64. AX_ADD_AM_MACRO_STATIC([
  65. if ax_dist_msi_have_install_files
  66. \$(top_builddir)/\$(MSI_SETUP_FILE): \$(top_builddir)/install_files
  67. @echo \"the msi file (\$(MSI_SETUP_FILE)) must be (re)created\"; \\
  68. echo \"by building it with VC++\"; \\
  69. exit -1
  70. else
  71. \$(top_builddir)/\$(MSI_SETUP_FILE): msi_up_to_date_notice
  72. @if test ! -f \"\$(top_builddir)/\$(MSI_SETUP_FILE)\"; then \\
  73. echo \"the msi file (\$(MSI_SETUP_FILE)) must be created\"; \\
  74. echo \"by building it with VC++\"; \\
  75. exit -1; \\
  76. fi
  77. msi_up_to_date_notice:
  78. @if test -f \"\$(top_builddir)/\$(MSI_SETUP_FILE)\"; then \\
  79. echo \"Warning: Dependency tracking cannot be enabled\"; \\
  80. echo \"Warning: the msi file (\$(MSI_SETUP_FILE))\"; \\
  81. echo \"Warning: Please make sure it is up to date.\"; \\
  82. exit -1; \\
  83. fi
  84. endif # ax_dist_msi_have_install_files
  85. ])
  86. AM_CONDITIONAL([ax_dist_msi_using_ax_extra_dist],[test "x$USING_AX_EXTRA_DIST" != "x"])
  87. AX_ADD_AM_MACRO_STATIC([
  88. if ax_dist_msi_using_ax_extra_dist
  89. EXTRA_BIN_DISTS += msi
  90. endif # ax_dist_msi_using_ax_extra_dist
  91. ])
  92. AM_CONDITIONAL([ax_dist_msi_using_ax_upload],[test "x$USING_AX_UPLOAD" != "x"])
  93. AX_ADD_AM_MACRO_STATIC([
  94. if ax_dist_msi_using_ax_upload
  95. UPLOAD_BIN += upload-msi
  96. UPLOAD_TARGETS += {msi=>\$(PACKAGE)-\$(VERSION).msi}
  97. endif # ax_dist_msi_using_ax_upload
  98. endif # ax_dist_msi_enabled
  99. ])
  100. ])