gnu.port.mk 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. #-*- mode: Fundamental; tab-width: 4; -*-
  2. # ex:ts=4 sw=4 filetype=make:
  3. # $OpenBSD: gnu.port.mk,v 1.55 2016/04/26 10:56:59 sthen Exp $
  4. # Based on bsd.port.mk, originally by Jordan K. Hubbard.
  5. # This file is in the public domain.
  6. MODGNU_AUTOCONF_DEPENDS = devel/metaauto \
  7. devel/autoconf/${AUTOCONF_VERSION}
  8. MODGNU_AUTOMAKE_DEPENDS = devel/metaauto \
  9. devel/automake/${AUTOMAKE_VERSION}
  10. AUTOMAKE_VERSION ?= 1.4
  11. .if ${CONFIGURE_STYLE:L:Mautomake}
  12. BUILD_DEPENDS += ${MODGNU_AUTOMAKE_DEPENDS}
  13. MAKE_ENV += AUTOMAKE_VERSION=${AUTOMAKE_VERSION}
  14. . if ${CONFIGURE_STYLE:L:Mautoupdate}
  15. CONFIGURE_STYLE += autoconf
  16. . endif
  17. .endif
  18. .if ${CONFIGURE_STYLE:L:Mautoconf}
  19. AUTOCONF_VERSION ?= 2.13
  20. BUILD_DEPENDS += ${MODGNU_AUTOCONF_DEPENDS}
  21. AUTOCONF ?= autoconf
  22. AUTOUPDATE ?= autoupdate
  23. AUTOHEADER ?= autoheader
  24. AUTOCONF_DIR ?= ${WRKSRC}
  25. # missing ?= not an oversight
  26. AUTOCONF_ENV = PATH=${PORTPATH} AUTOCONF_VERSION=${AUTOCONF_VERSION}
  27. MAKE_ENV += AUTOCONF_VERSION=${AUTOCONF_VERSION}
  28. . if !${CONFIGURE_STYLE:L:Mno-autoheader}
  29. CONFIGURE_STYLE += autoheader
  30. . endif
  31. .endif
  32. CONFIG_SITE_LIST += config.site
  33. .for d name in \
  34. sysutils/ggrep ggrep \
  35. textproc/gsed gsed \
  36. archivers/gtar* gtar \
  37. lang/gawk gawk \
  38. sysutils/coreutils coreutils
  39. . if !defined(BUILD_DEPENDS) || !${BUILD_DEPENDS:M$d}
  40. CONFIG_SITE_LIST += config.no-${name}
  41. . endif
  42. .endfor
  43. _CONFIG_SITE = ${WRKDIR}/config.site
  44. CONFIGURE_ENV += CONFIG_SITE='${_CONFIG_SITE}'
  45. .if !defined(MODGNU_EMACS_YOURE_WEIRD)
  46. MAKE_ENV += CONFIG_SITE='${_CONFIG_SITE}'
  47. .endif
  48. MODGNU_CONFIG_GUESS_DIRS ?=${WRKSRC}
  49. MODGNU_SAVE_CACHE ?= No
  50. MODGNU_SAVE_CACHE_LOCATION =${PORTSDIR}/config
  51. MODGNU_configure = for d in ${MODGNU_CONFIG_GUESS_DIRS}; \
  52. do \
  53. cp -f ${PORTSDIR}/infrastructure/db/config.guess $$d; \
  54. chmod a+rx $$d/config.guess; \
  55. cp -f ${PORTSDIR}/infrastructure/db/config.sub $$d; \
  56. chmod a+rx $$d/config.sub; \
  57. done; ${MODSIMPLE_configure}
  58. .if ${MODGNU_SAVE_CACHE:L} == "yes"
  59. MODGNU_configure += ; mkdir -p ${MODGNU_SAVE_CACHE_LOCATION}; \
  60. cp ${WRKBUILD}/config.cache ${MODGNU_SAVE_CACHE_LOCATION}/${FULLPKGNAME} \
  61. || true
  62. .endif
  63. .if ${CONFIGURE_STYLE:L:Mgnu}
  64. CONFIGURE_ENV += MKDIR_P='mkdir -p'
  65. # XXX Older versions of glib-gettext.m4 and intltool.m4 used to set
  66. # DATADIRNAME to "lib" which resulted in locale files being installed
  67. # under the wrong directory.
  68. CONFIGURE_ENV += DATADIRNAME=share
  69. . if ${MODGNU_SAVE_CACHE:L} == "yes"
  70. CONFIGURE_ARGS += --cache-file=${WRKBUILD}/config.cache
  71. . endif
  72. . if ${CONFIGURE_STYLE:L:Mdest}
  73. CONFIGURE_ARGS += --prefix='$${${DESTDIRNAME}}${PREFIX}'
  74. . else
  75. CONFIGURE_ARGS += --prefix='${PREFIX}'
  76. . endif
  77. . if empty(CONFIGURE_STYLE:L:Mold)
  78. . if ${CONFIGURE_STYLE:L:Mdest}
  79. CONFIGURE_ARGS += --sysconfdir='$${${DESTDIRNAME}}${SYSCONFDIR}'
  80. CONFIGURE_ARGS += --mandir='$${${DESTDIRNAME}}${PREFIX}/man'
  81. CONFIGURE_ARGS += --infodir='$${${DESTDIRNAME}}${PREFIX}/info'
  82. CONFIGURE_ARGS += --localstatedir='$${${DESTDIRNAME}}${LOCALSTATEDIR}'
  83. . else
  84. CONFIGURE_ARGS += --sysconfdir='${SYSCONFDIR}'
  85. CONFIGURE_ARGS += --mandir='${PREFIX}/man'
  86. CONFIGURE_ARGS += --infodir='${PREFIX}/info'
  87. CONFIGURE_ARGS += --localstatedir='${LOCALSTATEDIR}'
  88. . endif
  89. . endif
  90. CONFIGURE_ARGS += --disable-silent-rules
  91. # Unless explicitely requested, disable gtk-doc by default.
  92. . if !defined(BUILD_DEPENDS) || !${BUILD_DEPENDS:Mtextproc/gtk-doc}
  93. # If one of these tools is found at configure stage, it might be used,
  94. # no matter whether we use --disable-gtk-doc or not.
  95. CONFIGURE_ARGS += --disable-gtk-doc
  96. CONFIGURE_ENV += ac_cv_path_GTKDOC_CHECK=""
  97. CONFIGURE_ENV += ac_cv_path_GTKDOC_REBASE=""
  98. CONFIGURE_ENV += ac_cv_path_GTKDOC_MKPDF=""
  99. . endif
  100. .endif
  101. TEST_TARGET ?= check
  102. # internal stuff to run on each directory.
  103. MODGNU_post-patch = for d in ${AUTOCONF_DIR}; do cd $$d; ${_MODGNU_loop} done;
  104. _MODGNU_loop =
  105. PATCH_CHECK_ONLY ?= No
  106. .if ${PATCH_CHECK_ONLY:L} != "yes"
  107. . if ${CONFIGURE_STYLE:L:Mautoupdate}
  108. _MODGNU_loop += echo "Running autoupdate-${AUTOCONF_VERSION} in $$d";
  109. _MODGNU_loop += ${SETENV} ${AUTOCONF_ENV} ${AUTOUPDATE};
  110. . endif
  111. . if ${CONFIGURE_STYLE:L:Mautoconf}
  112. _MODGNU_loop += if test -f $$d/configure; then \
  113. grep -iq 'Generated by.*autoconf.*${AUTOCONF_VERSION}' $$d/configure || { \
  114. echo ">>> Can't find autoconf ${AUTOCONF_VERSION} signature in $$d/configure:"; \
  115. grep -i 'Generated by.*autoconf' $$d/configure; }; \
  116. fi;
  117. _MODGNU_loop += echo "Running autoconf-${AUTOCONF_VERSION} in $$d";
  118. _MODGNU_loop += ${SETENV} ${AUTOCONF_ENV} ${AUTOCONF};
  119. . if ${CONFIGURE_STYLE:L:Mautoheader}
  120. _MODGNU_loop += echo "Running autoheader-${AUTOCONF_VERSION} in $$d";
  121. _MODGNU_loop += ${SETENV} ${AUTOCONF_ENV} ${AUTOHEADER};
  122. . endif
  123. . if !${CONFIGURE_STYLE:L:Mautomake}
  124. REORDER_DEPENDENCIES += ${PORTSDIR}/infrastructure/mk/automake.dep
  125. . endif
  126. . endif
  127. .endif
  128. MAKE_FLAGS += mkdir_p='mkdir -p --'
  129. # XXX to be killed
  130. MODGNU_SHARED_LIBS ?=
  131. .for _n _e in ${MODGNU_SHARED_LIBS}
  132. . if defined(LIB${_n}_ALIAS)
  133. MAKE_FLAGS += lib${LIB${_n}_ALIAS}_la_LDFLAGS='-version-info ${LIB${_n}_VERSION:S/./:/}:0 '${_e}
  134. . else
  135. MAKE_FLAGS += lib${_n}_la_LDFLAGS='-version-info ${LIB${_n}_VERSION:S/./:/}:0 '${_e}
  136. . endif
  137. .endfor