[Spread-cvs] commit: r497 - in libspreadutil/trunk: . src
jonathan at spread.org
jonathan at spread.org
Tue Mar 20 17:58:57 EDT 2012
Author: jonathan
Date: 2012-03-20 17:58:57 -0400 (Tue, 20 Mar 2012)
New Revision: 497
Modified:
libspreadutil/trunk/Changelog
libspreadutil/trunk/configure
libspreadutil/trunk/configure.in
libspreadutil/trunk/src/config.h.in
libspreadutil/trunk/src/events.c
Log:
Add configure option to disable the dladdr based function name lookups from the library build
Modified: libspreadutil/trunk/Changelog
===================================================================
--- libspreadutil/trunk/Changelog 2012-03-20 20:13:48 UTC (rev 496)
+++ libspreadutil/trunk/Changelog 2012-03-20 21:58:57 UTC (rev 497)
@@ -1,3 +1,8 @@
+Tue Mar 20 17:57:44 2012 Jonathan Stanton <jonathan at spreadconcepts.com>
+
+ * configure.in: Make use of dladdr in the function name lookup code a compile time option so
+ systems that don't have dladdr can build the library without needing it.
+
Mon Mar 5 23:50:52 2012 Jonathan Stanton <jonathan at spreadconcepts.com>
* include/spu_alarm_types.h (CONF_SYS): Change CONF alarm type which conflicted with OpenSSL
Modified: libspreadutil/trunk/configure
===================================================================
--- libspreadutil/trunk/configure 2012-03-20 20:13:48 UTC (rev 496)
+++ libspreadutil/trunk/configure 2012-03-20 21:58:57 UTC (rev 497)
@@ -725,6 +725,7 @@
with_catman
with_docdir
enable_threaded_alarm
+enable_function_name_lookup
'
ac_precious_vars='build_alias
host_alias
@@ -1362,6 +1363,8 @@
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--enable-threaded-alarm Turn on threaded Alarm call processing to move IO to
separate thread
+ --disable-function-name-lookup
+ Disable the dladdr based function name lookups
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
@@ -10144,14 +10147,30 @@
fi
+# control whether dladdr is used to lookup function names. Default is to use it.
+# Check whether --enable-function-name-lookup was given.
+if test "${enable_function_name_lookup+set}" = set; then
+ enableval=$enable_function_name_lookup;
+fi
+if test "x$enable_function_name_lookup" = "xno" ; then
+cat >>confdefs.h <<\_ACEOF
+#define DISABLE_FUNCTION_NAME_LOOKUP 1
+_ACEOF
+fi
+
+
+
+
+
+
LIBSPSO=none
case "$host" in
*-*-darwin*)
Modified: libspreadutil/trunk/configure.in
===================================================================
--- libspreadutil/trunk/configure.in 2012-03-20 20:13:48 UTC (rev 496)
+++ libspreadutil/trunk/configure.in 2012-03-20 21:58:57 UTC (rev 497)
@@ -692,6 +692,16 @@
AC_DEFINE(USE_THREADED_ALARM, 1, [Enable Threaded Alarm code to move IO to separate thread])
fi
+# control whether dladdr is used to lookup function names. Default is to use it.
+AC_ARG_ENABLE([function-name-lookup],
+ [AS_HELP_STRING([--disable-function-name-lookup], [Disable the dladdr based function name lookups]) ],
+)
+
+if test "x$enable_function_name_lookup" = "xno" ; then
+ AC_DEFINE(DISABLE_FUNCTION_NAME_LOOKUP, 1, [Disable lookups of function names using dladdr])
+fi
+
+
AH_TOP(
#ifndef _CONFIG_H
#define _CONFIG_H
Modified: libspreadutil/trunk/src/config.h.in
===================================================================
--- libspreadutil/trunk/src/config.h.in 2012-03-20 20:13:48 UTC (rev 496)
+++ libspreadutil/trunk/src/config.h.in 2012-03-20 21:58:57 UTC (rev 497)
@@ -19,6 +19,9 @@
/* Define if your snprintf is busted */
#undef BROKEN_SNPRINTF
+/* Disable lookups of function names using dladdr */
+#undef DISABLE_FUNCTION_NAME_LOOKUP
+
/* Define to 1 if you have the <arpa/inet.h> header file. */
#undef HAVE_ARPA_INET_H
Modified: libspreadutil/trunk/src/events.c
===================================================================
--- libspreadutil/trunk/src/events.c 2012-03-20 20:13:48 UTC (rev 496)
+++ libspreadutil/trunk/src/events.c 2012-03-20 21:58:57 UTC (rev 497)
@@ -463,8 +463,16 @@
}
+#ifdef DISABLE_FUNCTION_NAME_LOOKUP
void E_lookup_function_name( void* fptr, char *fname, int fname_len )
{
+ snprintf( fname, fname_len -1, "LOOKUP_FAIL_0x%p", fptr);
+ /* NOTE: snprintf is safe if fname is too short, the string will be truncated and null terminated */
+ return;
+}
+#else
+void E_lookup_function_name( void* fptr, char *fname, int fname_len )
+{
Dl_info dli;
int ret, len;
@@ -488,6 +496,7 @@
}
return;
}
+#endif
void E_time_events( sp_time start, sp_time stop, fd_event *fev, time_event *tev)
{
More information about the Spread-cvs
mailing list