DaemonForums  

Go Back   DaemonForums > Miscellaneous > General software and network

General software and network General OS-independent software and network questions, X11, MTA, routing, etc.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 31st August 2014
spermwhale_warrior spermwhale_warrior is offline
Fdisk Soldier
 
Join Date: May 2013
Posts: 59
Default a ./configure script doesn't found 'locate'

I download Sparforte, a shell that permit writing script in somewhat a subset of Ada,
the strong statically typed language. I tried the version compiled for Freebsd. I guess there is a way to emulate it or run it directly, but I don't know yet.
Then I tried to compile the sources.
It said that it can't find 'glocate' or 'locate', despite it being here.
A clue ? Can I settle this by setting some variables to the exported environment ?
Sources : http://sparforte.com/downloads/sparf....5-src.tar.bz2
FreeBSD binary : http://sparforte.com/downloads/sparf...ebsd10.tar.bz2
Reply With Quote
  #2   (View Single Post)  
Old 31st August 2014
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,983
Default

I don't use your OS. I don't know anything about the software you are attempting to use with your OS. However, I did a quick examination of the tarball.
  • The INSTALL document states that for FreeBSD, glocate is a dependency.
  • You stated above that this is installed.
The configure shell script executes the following test, which is apparently failing for you. If you cannot determine why through reading the code, and perhaps making these tests manually, then run configure with tracing turned on, such as:

$ sh -x configure

Good luck!
Code:
LOCATE="glocate"
echo -n "checking for locate ($LOCATE)... "
"$LOCATE" --help >/dev/null 2>/dev/null
if [ $? -ne 0 ] ; then
  echo "no"
  LOCATE="locate"
  echo -n "checking for locate ($LOCATE)... "
  "$LOCATE" --help >/dev/null 2>/dev/null
  if [ $? -ne 0 ] ; then
     echo "no"
     # freebsd 8 has different parameters
     "$LOCATE" thisisafakepatternbecausefreebsdlocatehasnohelp >/dev/null 2>/dev/null
  else
     echo "yes"
  fi
else
  echo "yes"
fi
if [ $? -ne 0 ] ; then
   echo "Could not run locate"
   echo
   echo "Locate is used by this script to ensure you have all the required"
   echo "software to build SparForte."
   echo
   echo "Please install GNU locate and run updatedb (as root)."
   exit 1
fi
Reply With Quote
  #3   (View Single Post)  
Old 1st September 2014
spermwhale_warrior spermwhale_warrior is offline
Fdisk Soldier
 
Join Date: May 2013
Posts: 59
Default

the script is pretty simple, it does only seek for 'locate' or 'glocate'
Sorry but I don't know that much sh scripting, and when I type :
$ if [$? -ne 0]; then echo "non" else echo "yes" fi
it shows "bigger than" symbol, waiting other entries.
Sorry to ask such a thing, but what's the good syntax to enter the test manually ?
sh scripting is just so ugly, that's why I want to use Sparforte.
Reply With Quote
  #4   (View Single Post)  
Old 1st September 2014
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,983
Default

The $? environment variable contains the return code of the last executed command.

Test 1:

Start with manually issuing a glocate command:

$ glocate --help

There are several possible outcomes. If you get this:
Code:
sh: glocate: not found
you will know that glocate is not installed in any of the directories listed in $PATH.

If you get any other output, then glocate has executed, and you need Test 2:

$ echo $?

The value echoed will be the return code from glocate.
Quote:
sh scripting is just so ugly, that's why I want to use Sparforte.
You are attempting to port the application to NetBSD. Porting usually requires programming skills. In this case, you will need to understand why the locate test is failing, and make the applicable changes, either to the glocate installation configuration, or to this test.
Reply With Quote
  #5   (View Single Post)  
Old 1st September 2014
spermwhale_warrior spermwhale_warrior is offline
Fdisk Soldier
 
Join Date: May 2013
Posts: 59
Default

Ok, but, hey , I wasn't complaining, just saying why I want it, to learn and labour less hereafter .
First, 'locate --help', send 127 as a status message, I don't know how it is interpreted,
but I change the first ' $LOCATE --help ' into ' locate /usr/. > /dev/null 2>&1 '
Manualy, consequently $? become 1
I can't run it manualy, but [ $? -ne 0] should meant "only zero". Without change, the result was 127, and now the test become [ 1 -ne 0 ] but it still echoes "no".
Need the return code be 0 for the test being false ?
Reply With Quote
  #6   (View Single Post)  
Old 1st September 2014
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,983
Default

In the Bourne shell, a 127 return code means "command not found".
  • Did you try $ glocate --help as I'd recommended?
  • If so, what was the resulting output?
  • Where is your GNU locate command installed?
With my OS, OpenBSD, the GNU locate tool is packaged with the findutils package and is installed in /usr/local/bin/glocate. This is what I get when I install findutils on my OS and then test glocate:
Code:
$ glocate --help
Usage: glocate [-d path | --database=path] [-e | -E | --[non-]existing]
      [-i | --ignore-case] [-w | --wholename] [-b | --basename]
      [--limit=N | -l N] [-S | --statistics] [-0 | --null] [-c | --count]
      [-P | -H | --nofollow] [-L | --follow] [-m | --mmap] [-s | --stdio]
      [-A | --all] [-p | --print] [-r | --regex] [--regextype=TYPE]
      [--max-database-age D] [--version] [--help]
      pattern...

Report bugs to <bug-findutils@gnu.org>.
$ echo $?
0
$
I also checked the version.
Code:
$ glocate --version
locate (GNU findutils) 4.5.11
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Eric B. Decker, James Youngman, and Kevin Dalley.
$
Reply With Quote
Reply

Tags
netbsd/freebsd compatibility

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
X -configure ocicat OpenBSD General 3 19th July 2012 04:30 AM
need help to configure netstick. wlm2 OpenBSD General 5 30th September 2011 01:27 PM
configure command not found Stellar FreeBSD Installation and Upgrading 4 3rd October 2010 07:01 AM
Ath0 + wpa, how configure? nesca2in1 FreeBSD General 10 2nd July 2008 04:12 AM
Can't locate themes now anomie Feedback and Suggestions 10 5th May 2008 12:57 AM


All times are GMT. The time now is 11:52 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick