tech-pkg archive

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

PKGSRC_PHASE



It is sometimes useful to know from what "phase" (configure/build/install)
a given command is executed.  For example cc wrappers can behave differently
depending on the phase.

I believe this change is harmless to anyone.
diff --git a/mk/build/build.mk b/mk/build/build.mk
index 29073b4..21199f2 100644
--- a/mk/build/build.mk
+++ b/mk/build/build.mk
@@ -47,6 +47,7 @@ BUILD_TARGET?=                all
 
 BUILD_MAKE_CMD= \
        ${PKGSRC_SETENV} ${MAKE_ENV}                                    \
+               PKGSRC_PHASE=build                                      \
                ${MAKE_PROGRAM} ${_MAKE_JOBS}                           \
                        ${MAKE_FLAGS} ${BUILD_MAKE_FLAGS}               \
                        -f ${MAKE_FILE}
@@ -183,7 +184,9 @@ BUILD_ENV_SHELL?=   ${SH}
 build-env: .PHONY configure
        @${STEP_MSG} "Entering the build environment for ${PKGNAME}"
        ${RUN}${_ULIMIT_CMD}                                            \
-       cd ${WRKSRC} && ${PKGSRC_SETENV} ${MAKE_ENV} ${BUILD_ENV_SHELL}
+       cd ${WRKSRC} &&                                                 \
+       ${PKGSRC_SETENV} ${MAKE_ENV} PKGSRC_PHASE=build                 \
+               ${BUILD_ENV_SHELL}
 .else
 build-env: barrier
 .endif
diff --git a/mk/build/test.mk b/mk/build/test.mk
index 55935f3..94594b8 100644
--- a/mk/build/test.mk
+++ b/mk/build/test.mk
@@ -48,6 +48,7 @@ TEST_MAKE_FLAGS?=     # none
 
 TEST_MAKE_CMD= \
        ${PKGSRC_SETENV} ${TEST_ENV}                                    \
+               PKGSRC_PHASE=build                                      \
                ${MAKE_PROGRAM} ${MAKE_FLAGS} ${TEST_MAKE_FLAGS}        \
                        -f ${MAKE_FILE}
 
diff --git a/mk/configure/configure.mk b/mk/configure/configure.mk
index d56bfbc..4303429 100644
--- a/mk/configure/configure.mk
+++ b/mk/configure/configure.mk
@@ -206,6 +206,7 @@ do-configure-script:
        ${RUN}${_ULIMIT_CMD}                                            \
        cd ${WRKSRC} && cd ${_dir_} &&                                  \
        ${PKGSRC_SETENV} ${_CONFIGURE_SCRIPT_ENV}                       \
+               PKGSRC_PHASE=configure                                  \
                ${CONFIG_SHELL} ${CONFIG_SHELL_FLAGS}                   \
                        ${CONFIGURE_SCRIPT} ${CONFIGURE_ARGS}
 .endfor
@@ -224,7 +225,8 @@ do-configure-imake:
 .for _dir_ in ${CONFIGURE_DIRS}
        ${RUN}                                                          \
        cd ${WRKSRC} && cd ${_dir_} &&                                  \
-       ${PKGSRC_SETENV} ${_CONFIGURE_IMAKE_ENV} ${XMKMF}
+       ${PKGSRC_SETENV} ${_CONFIGURE_IMAKE_ENV} PKGSRC_PHASE=configure \
+               ${XMKMF}
 .endfor
 
 ######################################################################
@@ -243,6 +245,7 @@ do-configure-cmake:
        ${RUN}${_ULIMIT_CMD}                                            \
        cd ${WRKSRC} && cd ${_dir_} &&                                  \
        ${PKGSRC_SETENV} ${_CONFIGURE_CMAKE_ENV}                        \
+               PKGSRC_PHASE=configure                                  \
                cmake ${CMAKE_ARGS} ${CMAKE_ARG_PATH}
 .endfor
 
@@ -280,5 +283,7 @@ post-configure:
 #
 configure-help:
 .for d in ${CONFIGURE_DIRS}
-       ${RUN} cd ${WRKSRC} && cd ${d} && ${PKGSRC_SETENV} 
${_CONFIGURE_SCRIPT_ENV} ${CONFIG_SHELL} ${CONFIGURE_SCRIPT} --help
+       ${RUN} cd ${WRKSRC} && cd ${d} &&                               \
+       ${PKGSRC_SETENV} ${_CONFIGURE_SCRIPT_ENV} PKGSRC_PHASE=configure \
+               ${CONFIG_SHELL} ${CONFIGURE_SCRIPT} --help
 .endfor
diff --git a/mk/install/install.mk b/mk/install/install.mk
index c753d2e..8da764e 100644
--- a/mk/install/install.mk
+++ b/mk/install/install.mk
@@ -326,6 +326,7 @@ do-install:
        ${RUN} ${_ULIMIT_CMD}                                           \
        cd ${WRKSRC} && cd ${_dir_} &&                                  \
        ${PKGSRC_SETENV} ${INSTALL_ENV} ${MAKE_ENV}                     \
+               PKGSRC_PHASE=install                                    \
                ${MAKE_PROGRAM} ${MAKE_FLAGS} ${INSTALL_MAKE_FLAGS}     \
                        -f ${MAKE_FILE} ${INSTALL_TARGET}
 .  endfor
@@ -377,6 +378,7 @@ _DOC_COMPRESS=                                              
                \
                MANZ=${_MANZ}                                           \
                PKG_VERBOSE=${PKG_VERBOSE}                              \
                TEST=${TOOLS_TEST:Q}                                    \
+               PKGSRC_PHASE=install                                    \
        ${SH} ${PKGSRCDIR}/mk/plist/doc-compress ${DESTDIR}${PREFIX}
 
 .PHONY: install-doc-handling


Home | Main Index | Thread Index | Old Index