2012-09-04 13 views
23

Intento instalar udev. Y udev me da un error durante la ./configureLinux glib necesita pkg-config y pkg-config necesita glib?

--exists: command not found configure: error: 
pkg-config and "glib-2.0 >= 2.16" not found, please set GLIB_CFLAGS and GLIB_LIBS 
to the correct values or pass --with-internal-glib to configure 

Ok, pkg-config y simplista-2.0 se encuentra.

Al principio intenté instalar pkg-config. Recibí este mensaje:

checking whether to list both direct and indirect dependencies... no 
checking for Win32... no 
checking if internal glib should be used... no 
checking for pkg-config... no 
./configure: line 13557: --exists: command not found 
configure: error: pkg-config and "glib-2.0 >= 2.16" not found, 
please set GLIB_CFLAGS and GLIB_LIBS to the correct values or 
pass --with-internal-glib to configure 

Ok Interpreto, ese glib no falta.

Siguiente paso instalando Glib.

Y tengo este mensaje:

configure: error: in `/root/glib-2.33.3': 
configure: error: The pkg-config script could not be found or is too old. Make sure it 
is in your PATH or set the PKG_CONFIG environment variable to the full 
path to pkg-config. 

Alternatively, you may set the environment variables LIBFFI_CFLAGS 
and LIBFFI_LIBS to avoid the need to call pkg-config. 
See the pkg-config man page for more details. 

Pero estoy intrigado ahora. ¿Se necesitan el uno al otro? ¿Cuál es mi error?

Respuesta

25

Como ya has observado, existe una dependencia circular entre pkg-config y glib. Para romperlo, pkg-config's source code incluye una versión de glib, que es suficiente para compilarlo. Esto debería romper el ciclo de dependencia.

Intente configurar pkg-config con --with-internal-glib.

+0

Gracias por la respuesta. Eso funcionó, pero los mensajes de error de glib y udev seguían siendo – Peter

+1

@Peter ¿Has intentado compilar 'udev' con' ./configure --with-internal-glib'? – user1202136

+0

@Peter absolutamente intentar eso. No puedo dejar de insistir en lo importante que es leer los mensajes de error con cuidado y entender lo que significan. – ptomato

8

Ya está contenida en el mensaje de error simplista:

Alternatively, you may set the environment variables LIBFFI_CFLAGS and LIBFFI_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.

El Glib Creación de un script utiliza pkg-config para encontrar libffi. Pero también puede proporcionar la información manualmente, estableciendo variables de entorno. Entonces la llamada a pkg-config no es necesaria. Glib en sí mismo no necesita pkg-config en absoluto.

Otra solución al problema es provista por la gente de pkg-config. Una vez más, al final del mensaje de error:

please set GLIB_CFLAGS and GLIB_LIBS to the correct values or pass --with-internal-glib to configure

En este escenario, sí PKG-config está empaquetado con todo lo necesario para construir sin tener Glib en su sistema ya.

+1

Si no sabe cómo hacer la primera solución, hacer la segunda solución es una obviedad. – ypnos

+0

Gracias por la respuesta. Eso funcionó con la segunda manera, pero los mensajes de error de glib y udev aún permanecieron – Peter

1
export GLIB_CFLAGS="$(pkg-config --cflags glib-2.0)" 
export GLIB_LIBS="$(pkg-config --libs glib-2.0)" 
printf '# In the case of a RHEL6.5\n\tGLIB_CFLAGS=%s\n\tGLIB_LIBS=%s\n' "$GLIB_CFLAGS" "$GLIB_LIBS" 
# In the case of a RHEL6.5 
     GLIB_CFLAGS=-I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include 
     GLIB_LIBS=-lglib-2.0 

# _now_ it is a no-brainer. 
+3

¿Podría agregar alguna explicación? – Narendra

0

libudev ahora es parte de systemd y no depende de glib.

La mayoría de las distribuciones de Linux proporcionan binarios para pkg-config, libudev y glib. Probablemente ya estén instalados, pero si no, puede usar el administrador de paquetes para obtenerlos.

Si necesita compilar esto usted mismo, considere usar pkgconf, una implementación ligera de la configuración pkg-que no utiliza glib.