Compile glib 2.48 does not recognize utre pcre

I compiled pcre 8.38 from a source with --enable-utf8 --enable-unicode-properties and a pcretest -C utf retuns 1 .

a which pcretest returns /home/mybin/bin/pcretest

However, when compiling glib 2.48 using PCRE_LIBS="/home/mybin/lib" PCRE_CFLAGS="/home/mybin/bin" I get a configure error from configure.log

 checking for PCRE... yes checking for Unicode support in PCRE... no configure: error: *** The system-supplied PCRE does not support Unicode properties or UTF-8. 

is there anything else i have to check to pass glib configure ?

+7
gcc pcre utf-8 glib
source share
7 answers

I just ran into his problem. Make sure you have $ PCRE_INSTALL_DIR / lib in your LD_LIBRARY_PATH. This fixed the problem for me.

+6
source share

First, make sure you enable Unicode during configuration:

 ./configure --enable-utf --enable-unicode-properties 

and then make . Later for installation use this:

 make pkgconfigdir=/usr/lib/pkgconfig install 
+3
source share

Run ldconfig after make install libpcre step. After that, try ./configure in glib.

+2
source share

If the internal glib pcre option is acceptable, you can use --with-pcre in the configuration.

+2
source share

./configure UTF-8 support tests by compiling a small test program (line 27618) and running it:

 #include <pcre.h> int main () { int support; pcre_config (PCRE_CONFIG_UTF8, &support); if (!support) return 1; pcre_config (PCRE_CONFIG_UNICODE_PROPERTIES, &support); if (!support) return 1; return 0; } 

If this test program cannot be compiled and launched properly, or for some reason returns 1, then. / configure will say that there is no UTF-8 support. Make sure your operating system can find shared libraries in your PCRE lib directory. You can do this by compiling the above test program and making sure that it can work without fail due to the lack of a shared library.

I had this problem, but even when I fixed it, Glib was unable to detect UTF-8 support in PCRE. When this happens, you can try editing. / configure to skip this test, but it’s not clear that this test hints at any other problem, so I would not recommend this.

+1
source share

PCRE_LIBS and PCRE_CFLAGS with a simple path are not enough.

In my case, compile glib-2.52.3 with pcre-8.38, I used PCRE_CFLAGS="/usr/local/include"
PCRE_LIBS="/usr/local/lib",
and get the result The system-supplied PCRE does not support Unicode properties or UTF-8 . I followed config.log, he posted this
configure:27740: checking for Unicode support in PCRE configure:27766: gcc -o conftest -g -O2 /usr/local/include -pthread conftest.c /usr/local/lib >&5 /usr/local/include: file not recognized: Is a directory collect2: ld returned 1 exit status configure:27766: $? = 1 configure: program exited with status 1

so I changed the contents of the flag to become this
PCRE_CFLAGS="-I/usr/local/include"
PCRE_LIBS="-L/usr/local/lib"
tell me this
configure:27740: checking for Unicode support in PCRE configure:27766: gcc -o conftest -g -O2 -I/usr/local/include -pthread conftest.c -L/usr/local/lib >&5 /tmp/cc8eu7d8.o: In function 'main': /data1/rugalzhang/glib-2.52.3/conftest.c:178: undefined reference to 'pcre_config' /data1/rugalzhang/glib-2.52.3/conftest.c:181: undefined reference to 'pcre_config' collect2: ld returned 1 exit status configure:27766: $? = 1 configure: program exited with status 1

with this, make the final change
PCRE_CFLAGS="-I/usr/local/include"
PCRE_LIBS="-L/usr/local/lib -lpcre"
and it worked for me

+1
source share

I did one more thing to make glib 2.52.3 compile with pcre 8.39

LD_LIBRARY_PATH=$PREFIX/lib ./configure <...>

where $PREFIX/lib is located libpcre.so.

Without setting LD_LIBRARY_PATH in config.log:

 ./conftest: error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory 

changing PCRE_CFLAGS or PCRE_LIBS did not help ...

0
source share

All Articles