summaryrefslogtreecommitdiff
path: root/Mk
diff options
context:
space:
mode:
authorRong-En Fan <rafan@FreeBSD.org>2007-07-23 09:36:51 +0000
committerRong-En Fan <rafan@FreeBSD.org>2007-07-23 09:36:51 +0000
commitf935a609c53c5c6031e6848db95c7debed127e27 (patch)
tree4c3cf6af6588247c0dd3f92f9601357c33c56217 /Mk
parent- Accept --infodir argument in configure script so it won't fail when we (diff)
- Set --mandir and --infodir in CONFIGURE_ARGS if the configure script
supports them. This is determined by running ``configure --help'' in do-configure target and set the shell variable _LATE_CONFIGURE_ARGS which is then passed to CONFIGURE_ARGS. - Remove --mandir and --infodir in ports' Makefile where applicable Few ports use REINPLACE_CMD to achieve the same effect, remove them too. - Correct some manual pages location from PREFIX/man to MANPREFIX/man - Define INFO_PATH where necessary - Document that .info files are installed in a subdirectory relative to PREFIX/INFO_PATH and slightly change add-plist-info to use INFO_PATH and subdirectory detection. PR: ports/111470 Approved by: portmgr Discussed with: stas (Mk/*), gerald (info related stuffs) Tested by: pointyhat exp run
Notes
Notes: svn path=/head/; revision=196111
Diffstat (limited to 'Mk')
-rw-r--r--Mk/bsd.gnome.mk3
-rw-r--r--Mk/bsd.port.mk40
-rw-r--r--Mk/bsd.xorg.mk2
3 files changed, 34 insertions, 11 deletions
diff --git a/Mk/bsd.gnome.mk b/Mk/bsd.gnome.mk
index c91fe8f767f2..5f9db8a0453a 100644
--- a/Mk/bsd.gnome.mk
+++ b/Mk/bsd.gnome.mk
@@ -116,8 +116,7 @@ gnomeprefix_CONFIGURE_ARGS=--localstatedir=${DESTDIR}${GNOME_LOCALSTATEDIR} \
--with-html-dir=${DESTDIR}${GNOME_HTML_DIR} \
--with-help-dir=${TARGETDIR}/share/gnome/help \
--disable-gtk-doc \
- --with-gconf-source=${GCONF_CONFIG_SOURCE} \
- --mandir=${PREFIX}/man
+ --with-gconf-source=${GCONF_CONFIG_SOURCE}
gnomeprefix_USE_GNOME_IMPL=gnomehier
.if !defined(WITHOUT_HACK)
gnomeprefix_PREFIX=${LOCALBASE}
diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk
index 647c161e8805..1024a448178f 100644
--- a/Mk/bsd.port.mk
+++ b/Mk/bsd.port.mk
@@ -659,7 +659,8 @@ FreeBSD_MAINTAINER= portmgr@FreeBSD.org
# Set the following to specify all .info files your port installs.
#
# INFO - A list of .info files (omitting the trailing ".info");
-# only one entry per document!
+# only one entry per document! These files are listed in
+# the path relative to ${INFO_PATH}.
# INFO_PATH - Path, where all .info files will be installed by your
# port, relative to ${PREFIX}
# Default: "share/info" if ${PREFIX} is equal to /usr
@@ -889,7 +890,8 @@ FreeBSD_MAINTAINER= portmgr@FreeBSD.org
# Default: ${ARCH}-portbld-freebsd${OSREL}
# CONFIGURE_ARGS
# - Pass these args to configure if ${HAS_CONFIGURE} is set.
-# Default: "--prefix=${PREFIX} ${CONFIGURE_TARGET}" if
+# Default: "--prefix=${PREFIX} --infodir=${PREFIX}/${INFO_PATH}
+# --mandir=${MANPREFIX}/man ${CONFIGURE_TARGET}" if
# GNU_CONFIGURE is set, "CC=${CC} CCFLAGS=${CFLAGS}
# PREFIX=${PREFIX} INSTALLPRIVLIB=${PREFIX}/lib
# INSTALLARCHLIB=${PREFIX}/lib" if PERL_CONFIGURE is set,
@@ -2977,9 +2979,18 @@ CONFIGURE_FAIL_MESSAGE?= "Please report the problem to ${MAINTAINER} [maintainer
.if !defined(CONFIGURE_MAX_CMD_LEN)
CONFIGURE_MAX_CMD_LEN!= ${SYSCTL} -n kern.argmax
.endif
-CONFIGURE_ARGS+= --prefix=${PREFIX} ${CONFIGURE_TARGET}
+CONFIGURE_ARGS+= --prefix=${PREFIX} $${_LATE_CONFIGURE_ARGS} ${CONFIGURE_TARGET}
CONFIGURE_ENV+= lt_cv_sys_max_cmd_len=${CONFIGURE_MAX_CMD_LEN}
HAS_CONFIGURE= yes
+
+SET_LATE_CONFIGURE_ARGS= \
+ _LATE_CONFIGURE_ARGS="" ; \
+ if [ ! -z "`./${CONFIGURE_SCRIPT} --help 2>&1 | ${GREP} -- '--mandir'`" ]; then \
+ _LATE_CONFIGURE_ARGS="$${_LATE_CONFIGURE_ARGS} --mandir=${MANPREFIX}/man" ; \
+ fi ; \
+ if [ ! -z "`./${CONFIGURE_SCRIPT} --help 2>&1 | ${GREP} -- '--infodir'`" ]; then \
+ _LATE_CONFIGURE_ARGS="$${_LATE_CONFIGURE_ARGS} --infodir=${PREFIX}/${INFO_PATH}/${INFO_SUBDIR}" ; \
+ fi ;
.endif
# Passed to most of script invocations
@@ -3109,6 +3120,20 @@ INFO_PATH?= share/info
INFO_PATH?= info
.endif
+.if defined(INFO)
+. for D in ${INFO:H}
+RD:= ${D}
+. if ${RD} != "."
+. if !defined(INFO_SUBDIR)
+INFO_SUBDIR:= ${RD}
+. elif ${INFO_SUBDIR} != ${RD}
+BROKEN= only one subdirectory in INFO is allowed
+. endif
+. endif
+.undef RD
+. endfor
+.endif
+
DOCSDIR_REL?= ${DOCSDIR:S,^${TARGETDIR}/,,}
EXAMPLESDIR_REL?= ${EXAMPLESDIR:S,^${TARGETDIR}/,,}
DATADIR_REL?= ${DATADIR:S,^${TARGETDIR}/,,}
@@ -3723,6 +3748,7 @@ do-configure:
.endif
.if defined(HAS_CONFIGURE)
@(cd ${CONFIGURE_WRKSRC} && \
+ ${SET_LATE_CONFIGURE_ARGS} \
if ! ${SETENV} CC="${CC}" CXX="${CXX}" \
CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" \
INSTALL="/usr/bin/install -c ${_BINOWNGRP}" \
@@ -5859,14 +5885,14 @@ add-plist-info:
@${LS} ${TARGETDIR}/${INFO_PATH}/$i.info* | ${SED} -e s:${TARGETDIR}/::g >> ${TMPPLIST}
@${ECHO_CMD} "@exec install-info --quiet %D/${INFO_PATH}/$i.info %D/${INFO_PATH}/dir" \
>> ${TMPPLIST}
- @if [ "`${DIRNAME} $i`" != "." ]; then \
- ${ECHO_CMD} "@unexec ${RMDIR} %D/info/`${DIRNAME} $i` 2> /dev/null || true" >> ${TMPPLIST}; \
- fi
.endfor
+.if defined(INFO_SUBDIR)
+ @${ECHO_CMD} "@unexec ${RMDIR} %D/${INFO_PATH}/${INFO_SUBDIR} 2> /dev/null || true" >> ${TMPPLIST}
+.endif
.if (${PREFIX} != "/usr")
@${ECHO_CMD} "@unexec if [ -f %D/${INFO_PATH}/dir ]; then if sed -e '1,/Menu:/d' %D/${INFO_PATH}/dir | grep -q '^[*] '; then true; else rm %D/${INFO_PATH}/dir; fi; fi" >> ${TMPPLIST}
.if (${PREFIX} != ${LOCALBASE_REL} && ${PREFIX} != ${X11BASE_REL} && ${PREFIX} != ${LINUXBASE_REL})
- @${ECHO_CMD} "@unexec rmdir %D/info 2> /dev/null || true" >> ${TMPPLIST}
+ @${ECHO_CMD} "@unexec rmdir %D/${INFO_PATH} 2>/dev/null || true" >> ${TMPPLIST}
.endif
.endif
.endif
diff --git a/Mk/bsd.xorg.mk b/Mk/bsd.xorg.mk
index 59ffc2bdb2db..eda8cb0c063d 100644
--- a/Mk/bsd.xorg.mk
+++ b/Mk/bsd.xorg.mk
@@ -42,8 +42,6 @@ DIST_SUBDIR= xorg/${XORG_CAT}
MASTER_SITES?= ${MASTER_SITE_XORG}
MASTER_SITE_SUBDIR?= individual/${XORG_CAT}
-CONFIGURE_ARGS+= --mandir="${PREFIX}/man/"
-
. if ${XORG_CAT} == "app"
USE_GNOME+= pkgconfig
. endif