Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compiling Oniguruma regex library to javascript using Emscripten

I'm trying to get a more powerful regex library into javascript. The only solution I found is to compile Oniguruma regex library to javascript using Emscripten

I've installed Emscripten and tested it with their small test scripts, also downloaded oniguruma source code, but still don't know what should be done next.

Anyone familiar with emscripten?

like image 779
Allen Bargi Avatar asked Dec 04 '25 16:12

Allen Bargi


1 Answers

When you utilize Emscripten, the general way of building/compiling from C/C++ stays similar. The steps which change, are that you don't use e.g. the gcc compiler but Emscripten compiler.

That said there is the general question of whether you are familiar with C/C++ and more specific with autotools (which seems like the build tool Oniguruma uses). If you are not, you will probably have a very hard time understanding what needs to be done and how.

Last I checked Emscripten did not have support for Libtool, so building, utilizing autotools, will probably fail. Feel free to ask at Emscripten IRC channel though, whether this is indeed not possible.

Another way I can think of is using autotools to generate Makefiles and then writing custom targets for Emscripten programs. Beware that this is for advanced users, familiar with the make cruft.

If these steps are to taxing for you perhaps you should see whether a Javascript library can be sufficient for you.

like image 150
abergmeier Avatar answered Dec 07 '25 06:12

abergmeier