M.Canales.es wrote:
El Lunes, 21 de Noviembre de 2005 22:22, Matthew Burgess escribió:


3) Change the Makefile to do the following test instead:

if [ "$(prefix)" = / -o "$(prefix)" = "" ];


Try this:

if [ x$(prefix) = x/ ]

That is recommended way to test varaibles when you aren't sure that it allways have an asigned value.

Yes, but we also have to test for "x$(prefix) = x" otherwise mandir isn't set correctly. Here's the full decision tree with $(prefix) expanded:

if [ ""/man = ""/man ]; then
  if [ "" = / ]; then
    echo /usr/share/man;
  else
    echo ""/share/man;
  fi;
else
  echo ""/man;
fi;

Note that we fail the second test, hence setting mandir=/share/man. If we change the second test to:

if [ "" = / -o "" = "" ];

we end up setting $(mandir) to "/usr/share/man" whether prefix is "" or "/" on the command line.

Regards,

Matt.
--
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to