compile glib 2.48 does not recognize pcre with utf support
Asked Answered
T

8

9

I have compiled pcre 8.38 from 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 something else I should check to get the glib configure to pass?

Tyika answered 26/3, 2016 at 22:1 Comment(1)
See config.log for more verbose details.Tiptop
C
7

I just ran into his issue as well. Be sure you have $PCRE_INSTALL_DIR/lib in your LD_LIBRARY_PATH as well. That fixed the issue for me.

Clomp answered 1/4, 2016 at 18:10 Comment(0)
A
4

If internal glib pcre is acceptable option then you may use --with-pcre in configure.

Appeal answered 18/12, 2016 at 19:26 Comment(1)
It is works. Thanks. Debian 10, glib-2.52.3, pcre-8.39.Calendra
D
4

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
Derek answered 17/2, 2017 at 14:44 Comment(0)
P
3

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

Pry answered 7/5, 2016 at 18:59 Comment(0)
R
2

./configure tests UTF-8 support 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 that test program can't be compiled and run properly or it returns 1 for any reason then ./configure will say that there isn't UTF-8 support. Check that your operating system can find the shared libraries in your PCRE lib directory. You can do that by compiling the above test program and making sure it can run without crashing due to a missing shared library.

I had that problem but even when I fixed it Glib failed to detect UTF-8 support in PCRE. When that happens you could try editing ./configure to skip over that test but failing that test is hinting at there being some other problem so I wouldn't recommend that.

Resolvent answered 23/8, 2016 at 18:18 Comment(0)
K
2

I find following words in glib README, it works for me Notes about GLib 2.48 =====================

  • The system copy of PCRE is now used by default to implement GRegex. Configure with --with-pcre=internal if a system PCRE version is unavailable or undesired
Kyte answered 23/7, 2018 at 7:7 Comment(0)
B
1

PCRE_LIBS and PCRE_CFLAGS with just path is 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 a The system-supplied PCRE does not support Unicode properties or UTF-8 result. I followed the config.log, it post 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 flag content, become to this
PCRE_CFLAGS="-I/usr/local/include"
PCRE_LIBS="-L/usr/local/lib"
it tell me
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 that, make the final change
PCRE_CFLAGS="-I/usr/local/include"
PCRE_LIBS="-L/usr/local/lib -lpcre"
and it worked for me

Bronchitis answered 2/8, 2017 at 9:10 Comment(0)
T
0

I did even another thing to make glib 2.52.3 compile with pcre 8.39

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

where $PREFIX/lib is where libpcre.so lies.

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

modifying PCRE_CFLAGS or PCRE_LIBS did not help ...

Thing answered 25/8, 2017 at 8:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.