Opened 6 weeks ago

Closed 3 weeks ago

#851 closed defect (fixed)

"g++" not available on non-gcc systems

Reported by: eserte12 Owned by:
Priority: normal Milestone:
Component: Xapian-bindings (Perl) Version:
Severity: normal Keywords:
Cc: Blocked By:
Blocking: Operating System: All

Description

On systems where for example clang is the default C/C++ compiler (e.g. modern FreeBSD systems) "g++" is usually not available. Using "c++" instead of "g++" would probably be a better, more compatible choice (unless you insinst on GCC extensions).

Excerpt of a failing build log on a FreeBSD 14 system:

Running Mkbootstrap for Xapian ()
chmod 644 "Xapian.bs"
"/usr/local/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- Xapian.bs blib/arch/auto/Search/Xapian/Xapian.bs 644
touch Xapian.xs
"/usr/local/bin/perl" "/usr/local/lib/perl5/5.42/ExtUtils/xsubpp"  -typemap '/usr/local/lib/perl5/5.42/ExtUtils/typemap' -typemap '/home/cpansand/.cpan/build/2026040307/Search-Xapian-1.2.25.6-2/perlobject.map' -typemap '/home/cpansand/.cpan/build/2026040307/Search-Xapian-1.2.25.6-2/typemap-errorclasses' -typemap '/home/cpansand/.cpan/build/2026040307/Search-Xapian-1.2.25.6-2/typemap'  Xapian.xs > Xapian.xsc
mv Xapian.xsc Xapian.c
g++ -c  -I/usr/local/include  -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -DNO_POSIX_2008_LOCALE -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -O2 -pipe -fstack-protector-strong -fno-strict-aliasing    -DVERSION=\"1.2.25.6\"  -DXS_VERSION=\"1.2.25.6\" -DPIC -fPIC "-I/usr/local/lib/perl5/5.42/mach/CORE"   Xapian.c
/bin/sh: g++: not found
*** Error code 127

Change History (1)

comment:1 by Olly Betts, 3 weeks ago

Resolution: fixed
Status: newclosed

Thanks - I've pushed a fix: de9e20948f3d98796fa8e732717bcfa5a2ab6beb

I've gone for defaulting to c++ only if g++ is not installed, to avoid a behaviour change in a point release if both g++ and c++ are installed and are different compilers.

Note: See TracTickets for help on using tickets.