mirror of
				https://github.com/asterisk/asterisk.git
				synced 2025-11-03 20:38:59 +00:00 
			
		
		
		
	Merge "BuildSystem: Enable dladdr on non-Linux platforms like FreeBSD."
This commit is contained in:
		
							
								
								
									
										35
									
								
								configure
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										35
									
								
								configure
									
									
									
									
										vendored
									
									
								
							@@ -19463,6 +19463,41 @@ rm -f core conftest.err conftest.$ac_objext \
 | 
			
		||||
    conftest$ac_exeext conftest.$ac_ext
 | 
			
		||||
LIBS=${old_LIBS}
 | 
			
		||||
 | 
			
		||||
# re-check without -ldl
 | 
			
		||||
# Non-Linux platforms like FreeBSD and NetBSD do not need a library libdl.so.
 | 
			
		||||
if test "${PBX_DLADDR}" = "0"; then
 | 
			
		||||
	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dladdr in dlfcn.h without -ldl" >&5
 | 
			
		||||
$as_echo_n "checking for dladdr in dlfcn.h without -ldl... " >&6; }
 | 
			
		||||
	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 | 
			
		||||
/* end confdefs.h.  */
 | 
			
		||||
#define _GNU_SOURCE 1
 | 
			
		||||
#include <dlfcn.h>
 | 
			
		||||
int
 | 
			
		||||
main ()
 | 
			
		||||
{
 | 
			
		||||
dladdr((void *)0, (void *)0)
 | 
			
		||||
 | 
			
		||||
  ;
 | 
			
		||||
  return 0;
 | 
			
		||||
}
 | 
			
		||||
_ACEOF
 | 
			
		||||
if ac_fn_c_try_link "$LINENO"; then :
 | 
			
		||||
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 | 
			
		||||
$as_echo "yes" >&6; }
 | 
			
		||||
		PBX_DLADDR=1
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
$as_echo "#define HAVE_DLADDR 1" >>confdefs.h
 | 
			
		||||
 | 
			
		||||
else
 | 
			
		||||
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 | 
			
		||||
$as_echo "no" >&6; }
 | 
			
		||||
 | 
			
		||||
fi
 | 
			
		||||
rm -f core conftest.err conftest.$ac_objext \
 | 
			
		||||
    conftest$ac_exeext conftest.$ac_ext
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
# PKGCONFIG is used in later tests
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										17
									
								
								configure.ac
									
									
									
									
									
								
							
							
						
						
									
										17
									
								
								configure.ac
									
									
									
									
									
								
							@@ -1460,6 +1460,23 @@ AC_LINK_IFELSE(
 | 
			
		||||
)
 | 
			
		||||
LIBS=${old_LIBS}
 | 
			
		||||
 | 
			
		||||
# re-check without -ldl
 | 
			
		||||
# Non-Linux platforms like FreeBSD and NetBSD do not need a library libdl.so.
 | 
			
		||||
if test "${PBX_DLADDR}" = "0"; then
 | 
			
		||||
	AC_MSG_CHECKING(for dladdr in dlfcn.h without -ldl)
 | 
			
		||||
	AC_LINK_IFELSE(
 | 
			
		||||
		[AC_LANG_PROGRAM([#define _GNU_SOURCE 1
 | 
			
		||||
#include <dlfcn.h>],
 | 
			
		||||
			[dladdr((void *)0, (void *)0)]
 | 
			
		||||
		)],
 | 
			
		||||
		AC_MSG_RESULT(yes)
 | 
			
		||||
		PBX_DLADDR=1
 | 
			
		||||
		AC_SUBST([PBX_DLADDR])
 | 
			
		||||
		AC_DEFINE([HAVE_DLADDR], 1, [Define to 1 if your system has the dladdr() GNU extension]),
 | 
			
		||||
		AC_MSG_RESULT(no)
 | 
			
		||||
	)
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
# PKGCONFIG is used in later tests
 | 
			
		||||
PKG_PROG_PKG_CONFIG()
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user