Subject: | Algorithm-ConstructDFA-XS: support for clang++ |
(Sorry for misusing the wrong RT queue, but https://rt.cpan.org/Public/Dist/Display.html?Name=Algorithm-ConstructDFA-XS does not exist yet)
On a FreeBSD 10 system, which comes by default with clang instead of gcc, building Algorithm-ConstructDFA-XS fails:
$ make
g++ -std=c++0x -gdwarf-2 -c -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -O -DVERSION=\"0.03\" -DXS_VERSION=\"0.03\" -DPIC -fPIC "-I/usr/perl5.18.2/lib/5.18.2/i386-freebsd/CORE" ConstructDFA.c
g++: not found
This can be fixed by using "c++" instead of "g++", which should work for both gcc and clang.
However, this also fails, but looks like it can easily be fixed:
$ make "CC=c++ -std=c++0x -gdwarf-2" "LD=c++ -gdwarf-2"
c++ -std=c++0x -gdwarf-2 -c -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -O -DVERSION=\"0.03\" -DXS_VERSION=\"0.03\" -DPIC -fPIC "-I/usr/perl5.18.2/lib/5.18.2/i386-freebsd/CORE" ConstructDFA.c
c++: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated
In file included from ConstructDFA.xs:17:
In file included from /usr/perl5.18.2/lib/5.18.2/i386-freebsd/CORE/perl.h:3476:
/usr/perl5.18.2/lib/5.18.2/i386-freebsd/CORE/pad.h:323:17: error: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wreserved-user-defined-literal]
"Pad 0x%"UVxf"[0x%"UVxf"] set_cur depth=%d\n", \
^
/usr/perl5.18.2/lib/5.18.2/i386-freebsd/CORE/pad.h:323:27: error: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wreserved-user-defined-literal]
"Pad 0x%"UVxf"[0x%"UVxf"] set_cur depth=%d\n", \
^
/usr/perl5.18.2/lib/5.18.2/i386-freebsd/CORE/pad.h:341:17: error: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wreserved-user-defined-literal]
"Pad 0x%"UVxf"[0x%"UVxf"] save_local\n", \
^
/usr/perl5.18.2/lib/5.18.2/i386-freebsd/CORE/pad.h:341:27: error: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wreserved-user-defined-literal]
"Pad 0x%"UVxf"[0x%"UVxf"] save_local\n", \
^
/usr/perl5.18.2/lib/5.18.2/i386-freebsd/CORE/pad.h:349:17: error: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wreserved-user-defined-literal]
"Pad 0x%"UVxf"[0x%"UVxf"] restore_local\n", \
^
/usr/perl5.18.2/lib/5.18.2/i386-freebsd/CORE/pad.h:349:27: error: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wreserved-user-defined-literal]
"Pad 0x%"UVxf"[0x%"UVxf"] restore_local\n", \
^
In file included from ConstructDFA.xs:17:
/usr/perl5.18.2/lib/5.18.2/i386-freebsd/CORE/perl.h:4257:37: error: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wreserved-user-defined-literal]
INIT("Use of uninitialized value%"SVf"%s%s");
^
/usr/perl5.18.2/lib/5.18.2/i386-freebsd/CORE/perl.h:4277:75: error: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wreserved-user-defined-literal]
INIT("Modification of non-creatable hash value attempted, subscript \"%"SVf"\"");
^
ConstructDFA.c:614:1: warning: duplicate 'extern' declaration specifier [-Wduplicate-decl-specifier]
XS_EXTERNAL(boot_Algorithm__ConstructDFA__XS); /* prototype to pass -Wmissing-prototypes */
^
/usr/perl5.18.2/lib/5.18.2/i386-freebsd/CORE/XSUB.h:145:33: note: expanded from macro 'XS_EXTERNAL'
# define XS_EXTERNAL(name) extern "C" XSPROTO(name)
^
1 warning and 8 errors generated.
*** Error code 1
Stop.
Regards,
Slaven