Today I tried the same thing and I could compile pcre in ILE using CRTCMOD.
In the pcre zip file, you can find a file called NON_AUTOTOOLS_BUILD (if I remember the name correctly) with all the information needed to compile it.
In fact, you only need:
- edit config.h to suit your environment (available features like memmove, features like pthreads, EBCDIC support and NewLine = 37 (x'25 '))
- compile dftables.c using CRTBNDC DEFINE (HAVE_CONFIG_H) ...
- CALL DFTABLES to generate character tables for EBCDIC (this step was a bit complicated because it wasn’t able to open the IFS file for output. So I put the output in the source element and used CPYTOSTMF to get it in IFS)
- compile all .c files that do not support CRTCMOD DEFINE (HAVE_CONFIG_H) ...
- create * SRVPGM from modules
- write prototypes for RPG
It works like a charm, except for a slight problem with CCSID. I created diagrams for CCSID 1141, but for some reason PCRE expects input to be CCSID 37.
Also note that if you are writing prototypes in RPGs, pcre_free is special. This feature is not implemented in PCRE (you can write your own and connect if you want) and is free by default. Your prototype should look like
Dpcre_free PR EXTPROC ('free')
D * value
* white spaces are inaccurate
Hope that helps
source share