LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   configure problem while building qt-x11-free-3.3.3 (BLFS) (http://www.linuxquestions.org/questions/linux-software-2/configure-problem-while-building-qt-x11-free-3-3-3-blfs-225630/)

jomen 09-02-2004 06:35 AM

configure problem while building qt-x11-free-3.3.3 (BLFS)
 
Hi all;

I have run into a small problem while trying to build qt on cvs-version of BLFS (qt-x11-free-3.3.3)
I suppose this is not only related to LFS so I post it here.

the book says to configure qt like this (just the configure stuff here...)

bash
export QTDIR=$PWD &&
export LD_LIBRARY_PATH=$PWD/lib:$LD_LIBRARY_PATH &&
export PATH=$PWD/bin:$PATH &&
./configure -prefix /opt/qt-3.3.3 -qt-gif -system-libpng \
-system-libmng -system-zlib -system-libjpeg -no-exceptions \
-thread -plugin-imgfmt-png

--> enter a subshell to isolate environment changes made here and then run the configure-script...

when I do this, I get the folowing error:

You don't seem to have 'make' or 'gmake' in your PATH.
Cannot proceed.

the code in the configure script, which causes this error, is here:


# find a make command
MAKE=
for mk in gmake make; do
if $WHICH $mk >/dev/null 2>&1; then
MAKE=`$WHICH $mk`
break
fi
done
if [ -z "$MAKE" ]; then
echo "You don't seem to have 'make' or 'gmake' in your PATH."
echo "Cannot proceed."
exit 1
fi


I got rid of this error by commenting out all those lines except the first one - which I changed to:


MAKE=/usr/bin/make


So I effectively disabled the search routine in the configure script and gave the location of my make



My question is:

is there something wrong with the configure-script, because it does not find my "make"
or could it be my fault - some misconfiguration of bash or something... - so that the script must fail for me?
I'm not good at scripting so I can't figure out if the configure script should work or if it is the script, which is wrong...

rjlee 09-02-2004 09:18 AM

Try this:
Code:

echo $PATH
If it lists /usr/bin in its output, then something is wrong.

The PATH environment variable contains the possible locations of the directories containing executable files. This script tries to find make by using the “which” command, that looks through each of the directories in $PATH.

If /usr/bin/ isn't on your path, then your system's configuration is likely to be quite broken but it would explain why it didn't find it. Also, try running
Code:

which
and seeing if you actually have which installed; if not, then the configure script won't work anyway.

Hope that helps,

— Robert J. Lee

jomen 09-02-2004 01:48 PM

Thanks for answering...

of course I have checked my $PATH - everything is o.k. with that

(since I have built the whole LFS-system and a lot of BLFS so far without problems, I'm quite sure that my setup is o.k.)

I also have which installed and if I do "which make" on the command-line it gives the proper result...

Jonathan:~$ which make
/usr/bin/make

that is why I think that the script is broken somehow.

The script does this - I think:

$WHICH $mk >/dev/null 2>&1

this expands to: which make >/dev/null 2>&1

if I do this on command-line, I get nothing - as is to be expected, since all output is directed to /dev/null and in addition to that any errors that command might give are suppressed - this cannot work - I think

But it is in the configure script and it is supposed to find the location of make (or gmake) and then use this value in the makefiles

Can this code in the configure script even work - for this purpose, that is...?

madluther 09-02-2004 02:06 PM

The instructions given in the book are correct, I installed QT-3.3.3 only a few days ago without error, It would pay to check your environment setup again.

Pay particular attention to bash startup files section of the book.

Mad.

jomen 09-02-2004 03:46 PM

issue solved! here is the explanation - and another question...

I did not doubt the instructions given in the book - just wondering how this could happen...

I was so sure that I have done everything right - I even did more than that and read the man-page for which...
(I installed the "which" program and not the script)

the man-page states this:


EXAMPLE
The recommended way to use this utility is by adding an alias (C shell) or shell function (Bourne shell) for
which like the following:

[ba]sh:

which ()
{
(alias; declare -f) | /usr/bin/which --tty-only --read-alias --read-functions --show-tilde --show-dot $@
}
export -f which

[t]csh:

alias which Žalias | /usr/bin/which --tty-only --read-alias --show-dot --show-tildeŽ

This will print the readable ~/ and ./ when starting which from your prompt, while still printing the full
path when used from a script:

> which q2
~/bin/q2
> echo `which q2`
/home/carlo/bin/q2



So I added the shell function to /etc/profile and everything seemed o.k. with that - until I tried to build qt...

I just commented out this function - and configuring qt works now as it should!

Thanks for insisting on checking my setup - but why does the man page for "which" recommend this if it obviously breaks some scripts?

Since we are at it (BLFS-wise) - I noticed as a quite annoying feature of the provided bash-startup files, that my bash-history is not there as I'm used to - it only gives me the last commands of the current session for a terminal - not all the last commands ever typed in - as I would like it...
Everytime I log out and back in - my history seems completely empty - but /root/.bash_history of course contains all commands ever typed - they are not available though by pressing "UP-ARROW" or "DOWN-ARROW"

This may only be true for root - I have not yet set up another (ordinary) user - since I'm still building the system and not yet using it...
Has it something to do with this line:

export HISTIGNORE="&:[bf]g:exit"

which is in /etc/profile ?

Where would I have to look to change that behaviour?

I just noticed, that for the subshell - created for building qt in - this is not true - the complete history is there!
the subshell is entered by giving the command:

bash

and that changes the history behaviour...

rjlee 09-02-2004 04:34 PM

Quote:

Originally posted by jomen
The script does this - I think:

$WHICH $mk >/dev/null 2>&1

this expands to: which make >/dev/null 2>&1

if I do this on command-line, I get nothing - as is to be expected, since all output is directed to /dev/null and in addition to that any errors that command might give are suppressed - this cannot work - I think

But it is in the configure script and it is supposed to find the location of make (or gmake) and then use this value in the makefiles

Can this code in the configure script even work - for this purpose, that is...?

The script isn't interested in what which says, only if it returns true or false. If make is on the path, which will return true, and the script can just use the command “make”. Otherwise it will return false and it will have to look harder to find the full path. The >/dev/null 2>&1 is just there to stop the user from seeing random stuff on the output of the configure script.

jomen 09-02-2004 05:56 PM

Thank you for explaining the script - I see it now...
It first checks if a "make" or "gmake" is there
if it has found one it uses the output of "which make" and assigns it to the variable MAKE

if it does not find eighter one the variable MAKE is still empty and the error occurs

the script did not work because of the shell function I had put into my /etc/profile - as I said above

jomen 09-03-2004 09:15 AM

thanks for all your help - and please forgive me my stupid questions!
I solved every question I had - my last one about my missing history when being root was caused by an entry in /etc/profile - done for security reasons, the BLFS-Book says...
here it is:

if [ $EUID -eq 0 ] ; then
pathappend /sbin:/usr/sbin
unset HISTFILE
fi


I uncommented the "unset HISTFILE" entry and all is like I want it.

I guess I was too tired to see it, when I asked...

This thread is closed now...!


All times are GMT -5. The time now is 09:36 PM.