Skip to contentSkip to conversation

autotools_preconfigure not removing separate B

DISCUSSION Martin Jansa 2 participants 2 messages May 9, 2013

lore
Share & tools
lore
#0 lore raw

Do we really need -e "${CONFIGURESTAMPFILE}" check in autotools_preconfigure?

In some cases when do_configure is failing (but after creating e.g. .qmake.cache) it would be better to start with clean B on 2nd attempt to configure it, but CONFIGURESTAMPFILE wasn't created yet.

Does someone remember why we need to test CONFIGURESTAMPFILE existence first (was it only to prevent cat ${CONFIGURESTAMPFILE} to fail?)

autotools_preconfigure() {
        if [ -n "${CONFIGURESTAMPFILE}" -a -e "${CONFIGURESTAMPFILE}" ]; then
                if [ "`cat ${CONFIGURESTAMPFILE}`" != "${BB_TASKHASH}" -a "${S}" != "${B}" ]; then
                        echo "Previously configured separate build directory detected, cleaning ${B}"
#1 lore raw
Quoted 8 lines · Martin Jansa

Do we really need -e "${CONFIGURESTAMPFILE}" check in autotools_preconfigure?

In some cases when do_configure is failing (but after creating e.g. .qmake.cache) it would be better to start with clean B on 2nd attempt to configure it, but CONFIGURESTAMPFILE wasn't created yet.

Does someone remember why we need to test CONFIGURESTAMPFILE existence first (was it only to prevent cat ${CONFIGURESTAMPFILE} to fail?)

I suspect so. I think the logical here also assumed we were going to try and do something like a "make distclean" originally too so it was rather specific about the conditions.

With the better support for separate ${B} looking like the right direction to go (roughly well supported by recipes), we might be able to justify unconditionally wiping ${B} at the start of do_configure.

Quoted 4 lines
autotools_preconfigure() {
        if [ -n "${CONFIGURESTAMPFILE}" -a -e "${CONFIGURESTAMPFILE}" ]; then
                if [ "`cat ${CONFIGURESTAMPFILE}`" != "${BB_TASKHASH}" -a "${S}" != "${B}" ]; then
                        echo "Previously configured separate build directory detected, cleaning ${B}"

i.e. this just becomes:

         if [ "${S}" != "${B}" ]; then
                echo "Separate build directory detected, cleaning ${B}"

We still need a plan to deal with that horrible monster include file. Its fine for proof of concept but we need to move somewhere from here.

Cheers,

Richard