Opened 15 years ago
Closed 15 years ago
#405 closed defect (fixed)
xapian-config doesn't work with Solaris /bin/sh
Reported by: | Dagobert Michelsen | Owned by: | Olly Betts |
---|---|---|---|
Priority: | normal | Milestone: | 1.0.17 |
Component: | Build system | Version: | 1.0.11 |
Severity: | normal | Keywords: | |
Cc: | dam@… | Blocked By: | |
Blocking: | Operating System: | Solaris |
Description
xapian-config contains bash-specific code which fails on systems where sh != bash:
build8st# bash xapian-config --ltlibs /opt/csw/lib/libxapian.la build8st# sh xapian-config --ltlibs /opt/csw/lib/libxapian.la build8st# Usage: grep -hblcnsviw pattern file . . .
The expansion at eval-time doesn't seem to work in the classic bourne shell.
BTW, the usage of the libtool .la-file can be difficult when the distribution policy excludes libtool-files. A standalone-solution of xapian-config without utilization of libxapian.la would IMHO be more compatible.
Attachments (1)
Change History (6)
follow-ups: 2 3 comment:1 by , 15 years ago
Component: | other → Build system |
---|---|
Milestone: | → 1.1.3 |
Owner: | set to |
Status: | new → assigned |
Summary: | xapian-config contains bash-specific code → xapian-config doesn't work with Solaris /bin/sh |
comment:2 by , 15 years ago
Replying to olly:
I'm guessing the issue is with $1 and assigning that to a temporary variable might help. Can you try running the attached test script with Solaris /bin/sh?
This hangs on Solaris 8:
build8s% ./dlname-test Usage: grep -hblcnsviw pattern file . . . ^C build8s%
It recurses indefinitely:
build8s% ptree 3518 10336 /opt/csw/sbin/sshd 371 /opt/csw/sbin/sshd -R 373 /opt/csw/sbin/sshd -R 375 -zsh 2590 /bin/sh ./dlname-test 2591 /bin/sh ./dlname-test ...
When I change the line to extract_dlname "stuff"
and put dlname=abc
into stuff
the following files are stat'ed:
10000 17089 dlname-test -1 /usr/bin/"$lafile" 10000 17089 dlname-test -1 /bin/"$lafile" 10000 17089 dlname-test -1 /usr/sbin/"$lafile" 10000 17089 dlname-test -1 /sbin/"$lafile" 10000 17089 dlname-test -1 /opt/csw/bin/"$lafile" 10000 17089 dlname-test -1 /usr/ccs/bin/"$lafile" 10000 17089 dlname-test -1 /opt/csw/bin/"$lafile" 10000 17090 dlname-test -1 /usr/bin/stuff 10000 17090 dlname-test -1 /bin/stuff 10000 17090 dlname-test -1 /usr/sbin/stuff 10000 17090 dlname-test -1 /sbin/stuff 10000 17090 dlname-test -1 /opt/csw/bin/stuff 10000 17090 dlname-test -1 /usr/ccs/bin/stuff 10000 17090 dlname-test -1 /opt/csw/bin/stuff
I am not exactly sure what is happening here, but escaping the carret does the trick:
eval `grep \^dlname= "$lafile" 2>/dev/null`
comment:3 by , 15 years ago
We recommend installing the .la file, but if you don't xapian-config --ltlibs falls back to just giving -lxapian (preceded by a -L option if necessary) which works for dynamic linking on many platforms. If you wanted static linking to work, or your platform doesn't pull in dependent libraries automatically for dynamic libraries, then ... well, it's your policy to not install .la files, so you get to fix the resultant breakage!
I get the following output after removing the .la-file:
build8xt% xapian-config --cxxflags -I/opt/csw/include build8xt% xapian-config --libs Usage: grep -hblcnsviw pattern file . . . Usage: grep -hblcnsviw pattern file . . . -L/opt/csw/lib -lxapian build8xt% xapian-config --ltlibs Usage: grep -hblcnsviw pattern file . . . /opt/csw/bin/xapian-config: Can't find libxapian.la to link against. build8xt% xapian-config --swigflags -I/opt/csw/include
I'll retry compiling the bindings with this after fixing xapian-config.
comment:4 by , 15 years ago
The autoconf manual says:
`^' Always quote `^', otherwise traditional shells such as `/bin/sh' on Solaris 10 treat this like `|'.
I've committed a fix to trunk as r13540 and backported for 1.0 in r13541.
This will probably also fix the issue in comment:3 - there was a second occurrence of an unquoted in xapian-config.
comment:5 by , 15 years ago
Milestone: | 1.1.3 → 1.0.17 |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
Silly trac, that should be: "there was a second occurrence of an unquoted <caret> in xapian-config".
Marking as fixed, as I'm pretty certain it is. Please reopen if not.
It's definitely not bash-specific code (/bin/sh on my dev box isn't bash for starters, it's dash).
The problematic shell here is the Solaris one it seems. All the bourne shell implementations I found in Ubuntu jaunty handle it correctly (testing with trunk, but this code hasn't changed):
I'm guessing the issue is with $1 and assigning that to a temporary variable might help. Can you try running the attached test script with Solaris /bin/sh?
We recommend installing the .la file, but if you don't xapian-config --ltlibs falls back to just giving -lxapian (preceded by a -L option if necessary) which works for dynamic linking on many platforms. If you wanted static linking to work, or your platform doesn't pull in dependent libraries automatically for dynamic libraries, then ... well, it's your policy to not install .la files, so you get to fix the resultant breakage!
Marking for 1.1.3 for now, assuming we can find a workaround easily.