mirror of
				https://gitlab.gnome.org/GNOME/glib.git
				synced 2025-10-24 22:12:16 +02:00 
			
		
		
		
	Rework the libelf configure checks one more time
It seems that there is quite a bit of variation out there, in terms of libelf versions and API. Make the checks more thorough, by not only checking for elf_begin, but also some of the shdr function that we need. Also, explicitly check for libelf.h. This should address bug 673132 and 673253.
This commit is contained in:
		
							
								
								
									
										18
									
								
								configure.ac
									
									
									
									
									
								
							
							
						
						
									
										18
									
								
								configure.ac
									
									
									
									
									
								
							| @@ -1799,12 +1799,22 @@ dnl ************************ | |||||||
| dnl *** check for libelf *** | dnl *** check for libelf *** | ||||||
| dnl ************************ | dnl ************************ | ||||||
|  |  | ||||||
| PKG_CHECK_MODULES([LIBELF], [libelf], [have_libelf=yes], [ | PKG_CHECK_MODULES([LIBELF], [libelf], [have_libelf=yes], [have_libelf=maybe]) | ||||||
|   AC_CHECK_LIB([elf], [elf_begin], have_libelf=yes, have_libelf=no) |  | ||||||
|   ]) | if test $have_libelf = maybe; then | ||||||
|  |   AC_CHECK_LIB([elf], [elf_begin], , [have_libelf=no]) | ||||||
|  |   AC_CHECK_LIB([elf], [elf_getshdrstrndx], , [have_libelf=no]) | ||||||
|  |   AC_CHECK_LIB([elf], [elf_getshdrnum], , [have_libelf=no]) | ||||||
|  |   AC_CHECK_HEADER([libelf.h], , [have_libelf=no]) | ||||||
|  |  | ||||||
|  |   if test $have_libelf != no; then | ||||||
|  |     LIBELF_LIBS=-lelf | ||||||
|  |     have_libelf = yes | ||||||
|  |   fi | ||||||
|  | fi | ||||||
|  |  | ||||||
| if test $have_libelf = yes; then | if test $have_libelf = yes; then | ||||||
|   AC_DEFINE(HAVE_LIBELF, 1, [Define if libelf is available]) |   AC_DEFINE(HAVE_LIBELF, 1, [Define if libelf is available]) | ||||||
|   LIBELF_LIBS=-lelf |  | ||||||
| fi | fi | ||||||
|  |  | ||||||
| dnl **************************************** | dnl **************************************** | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user