Index: configure
===================================================================
--- configure	(revision 5293)
+++ configure	(revision 5353)
@@ -672,5 +672,8 @@
  _have_libs=false
  _have_headers=false
+ _defs=''
  echo > $TF_C
+
+ $NEED_GNU_SOURCE && _defs="$_defs -D_GNU_SOURCE"
 
  name="$1"
@@ -690,4 +693,5 @@
  while [ "$1" != '--' ]
  do
+  echo "LIB($name) HAS LIB INFO: $1" >&5
   case "$1" in
    'c'|'-lc')
@@ -742,5 +746,5 @@
  echo "LIB($name) HAS COMPILER/LINKER OUTPUT:" >&5
  echo "--- BEGIN OF CHILD OUTPUT BLOCK ---" >&5
- $CCTF $LIBS >&5 2>&5;
+ $CCTF $_defs $LIBS >&5 2>&5;
  R=$?
  echo "--- END OF CHILD OUTPUT BLOCK ---" >&5
@@ -894,4 +898,5 @@
 
 test_func_defmake () {
+ _defs=''
  DEF="$1"
  NAME="$2"
@@ -902,4 +907,6 @@
  CALL="$1"
  shift;
+
+ $NEED_GNU_SOURCE && _defs="$_defs -D_GNU_SOURCE"
 
  if [ "$infotext" = '' ]
@@ -963,5 +970,5 @@
  echo "FUNCTION($NAME) HAS COMPILER/LINKER OUTPUT:" >&5
  echo "--- BEGIN OF CHILD OUTPUT BLOCK ---" >&5
- $CCTF $LIBS >&5 2>&5;
+ $CCTF $_defs $LIBS >&5 2>&5;
  R=$?
  echo "--- END OF CHILD OUTPUT BLOCK ---" >&5
@@ -1822,4 +1829,17 @@
 test_func_defmake ROAR_HAVE_AO_APPEND_GLOBAL_OPTION ao_append_global_option 'ao_append_global_option("","")' ao -- ao/ao.h
 
+test_func_defmake ROAR_HAVE_DLADDR    dladdr    'dladdr((void*)0, (Dl_info*)0)' dl -- dlfcn.h
+echo "STATE: funcname_dladdr=$funcname_dladdr" >&5
+
+if [ "$funcname_dladdr" = 'false' ]
+then
+ infotext='retested with _GNU_SOURCE'
+ _old="$NEED_GNU_SOURCE"
+ NEED_GNU_SOURCE=true
+ test_func_defmake ROAR_HAVE_DLADDR    dladdr    'dladdr((void*)0, (Dl_info*)0)' dl -- dlfcn.h
+ [ "$funcname_dladdr" = 'false' ] && NEED_GNU_SOURCE="$_old"
+ infotext=''
+fi
+
 test_func_defmake ROAR_HAVE_CLOCK_GETRES  clock_getres  'struct timespec ts; clock_getres((clockid_t)0, &ts)'  -- time.h
 test_func_defmake ROAR_HAVE_CLOCK_GETTIME clock_gettime 'struct timespec ts; clock_gettime((clockid_t)0, &ts)' -- time.h
Index: include/libroar/roardl.h
===================================================================
--- include/libroar/roardl.h	(revision 5347)
+++ include/libroar/roardl.h	(revision 5353)
@@ -102,5 +102,9 @@
 // general stuff:
 #define ROAR_DL_PLUGIN_ABORT_LOADING(err) roar_err_set((err)); return NULL
-#define ROAR_DL_PLUGIN_CHECK_VERSIONS(app,abi) if ( roar_dl_para_check_version(para, (app), (abi)) == -1 ) return NULL
+#define ROAR_DL_PLUGIN_CHECK_VERSIONS(app,abi) ((lib.host_appname = (app))    != NULL || \
+                                                (lib.host_abiversion = (abi)) != NULL )
+// should we keep this macro at all? Is it helpfull at all?
+// if a plugin can handle multiple hosts it needs to call roar_dl_para_check_version() itself anyway.
+#define ROAR_DL_PLUGIN_CHECK_VERSIONS_NOW(app,abi) if ( roar_dl_para_check_version(para, (app), (abi)) == -1 ) return NULL
 
 // register stuff:
@@ -111,7 +115,7 @@
                                                  lib.global_data_init = &(init);       \
                                                  lib.global_data_pointer = (void*)&(ptr)
-#define ROAR_DL_PLUGIN_REG_LIBDEP(deps) (((lib.libdep = deps) == NULL) ? \
+#define ROAR_DL_PLUGIN_REG_LIBDEP(deps) (((lib.libdep = (deps)) == NULL) ? \
                                            (ssize_t)-1 : \
-                                           (ssize_t)(lib.libdep_len = sizeof(deps)/sizeof(struct roar_dl_librarydep)))
+                                           (ssize_t)(lib.libdep_len = sizeof((deps))/sizeof(struct roar_dl_librarydep)))
 
 // meta data stuff:
@@ -223,4 +227,6 @@
  size_t libdep_len;
  struct roar_dl_appsched * appsched;
+ const char * host_appname;
+ const char * host_abiversion;
 };
 
Index: libroar/plugincontainer.c
===================================================================
--- libroar/plugincontainer.c	(revision 5320)
+++ libroar/plugincontainer.c	(revision 5353)
@@ -44,5 +44,4 @@
  size_t deprefc[MAX_PLUGINS];
  size_t numhandles;
- // TODO: add a depref counter so we do not unload libs we depend on.
 };
 
@@ -127,4 +126,6 @@
 
    roar_dl_close(cont->handle[i]);
+   cont->handle[i] = NULL;
+   cont->numhandles--;
   }
  }
Index: libroar/roardl.c
===================================================================
--- libroar/roardl.c	(revision 5347)
+++ libroar/roardl.c	(revision 5353)
@@ -391,4 +391,14 @@
   return -1;
 
+ if ( lib->host_appname != NULL || lib->host_abiversion != NULL ) {
+  // check for correct host.
+  if ( para == NULL ) {
+   roar_err_set(ROAR_ERROR_INVAL);
+   return -1;
+  }
+  if ( roar_dl_para_check_version(para, lib->host_appname, lib->host_abiversion) == -1 )
+   return -1;
+ }
+
  if ( (lib->libdep == NULL && lib->libdep_len) || (lib->libdep != NULL && !lib->libdep_len) ) {
   roar_err_set(ROAR_ERROR_BADLIB);
Index: plugins/universal/plugin-info.c
===================================================================
--- plugins/universal/plugin-info.c	(revision 5342)
+++ plugins/universal/plugin-info.c	(revision 5353)
@@ -99,7 +99,16 @@
 }
 
+static void print_env(void) {
+ const char * server = roar_libroar_get_server();
+ roar_vio_printf(roar_stdout, "Default server: %s%s%s\n",
+                              server == NULL ? "" : "\"",
+                              server == NULL ? "<not set>" : server,
+                              server == NULL ? "" : "\"");
+}
+
 static int init  (struct roar_dl_librarypara * para) {
  print_parameter(para);
  print_notifycore(para);
+ print_env();
  print_counter();
  return 0;
Index: roarclients/roarpluginrunner.c
===================================================================
--- roarclients/roarpluginrunner.c	(revision 5347)
+++ roarclients/roarpluginrunner.c	(revision 5353)
@@ -41,8 +41,13 @@
  fprintf(stderr, "\nOptions:\n\n");
 
- fprintf(stderr, " -h --help         - This help.\n"
-                 "    --verbose      - Be verbose. Can be used multiple times.\n"
-                 "    --run          - Run plugin.\n"
-                 "    --explain      - Explain plugin.\n");
+ fprintf(stderr, " -h --help            - This help.\n"
+                 "    --verbose         - Be verbose. Can be used multiple times.\n"
+                 "    --server SERVER   - Set default server to SERVER.\n"
+                 "    --run             - Run plugin.\n"
+                 "    --explain         - Explain plugin.\n"
+                 "    --appname NAME    - Sets the appname.\n"
+                 "    --abiversion ABI  - Set the ABI version.\n"
+                 "    --args ARGS       - Set plugin arguments.\n"
+        );
 }
 
@@ -66,9 +71,23 @@
 
 static const char * _ptr2str(const void * p) {
+#ifdef ROAR_HAVE_DLADDR
+ static char buf[80];
+ Dl_info info;
+#else
  static char buf[24];
+#endif
 
  if ( p == NULL )
   return "<not set>";
 
+#ifdef ROAR_HAVE_DLADDR
+ if ( dladdr(p, &info) != 0 ) {
+  if ( p == info.dli_saddr ) {
+   snprintf(buf, sizeof(buf), "%p <%s in \"%s\">", p, info.dli_sname, info.dli_fname);
+   return buf;
+  }
+ }
+#endif
+
  snprintf(buf, sizeof(buf), "%p", p);
 
@@ -77,5 +96,5 @@
 
 static const char * _ptrrange2str(const void * p, size_t len) {
- static char buf[48];
+ static char buf[80];
 
  if ( p == NULL )
@@ -112,5 +131,5 @@
  lib = func(g_para);
  if ( lib == NULL ) {
-  fprintf(stderr, "Warning: Can not RA init: %s\n", name);
+  fprintf(stderr, "Warning: Can not RA init: %s: %s\n", name, roar_error2str(roar_error));
   roar_dl_unref(lhandle);
   return 0;
@@ -122,9 +141,12 @@
 
  printf("lib                     = %s\n", _ptr2str(lib));
- printf("|-> version             = %i (%smatch)\n", lib->version, lib->version == ROAR_DL_LIBINST_VERSION ? "" : "no ");
- printf("%c-> len                 = %zu (%smatch)\n", libok ? '|' : '\\', lib->len, lib->len == sizeof(*lib) ? "" : "no ");
+ if ( g_verbose || !libok ) {
+  printf("|-> version             = %i (%smatch)\n", lib->version, lib->version == ROAR_DL_LIBINST_VERSION ? "" : "no ");
+  printf("%c-> len                 = %zu (%smatch)\n", libok ? '|' : '\\', lib->len, lib->len == sizeof(*lib) ? "" : "no ");
+ }
 
  if ( libok ) {
-  printf("|-> unload              = %s\n", _ptr2str(lib->unload));
+  if ( g_verbose || lib->unload != NULL )
+   printf("|-> unload              = %s\n", _ptr2str(lib->unload));
   printf("|-> func                = {");
   i = 0;
@@ -151,11 +173,15 @@
     libnameok = 1;
    }
-   printf("|   |-> version         = %i (%smatch)\n", lib->libname->version,
-                                                      lib->libname->version == ROAR_DL_LIBNAME_VERSION ? "" : "no ");
-   printf("|   %c-> len             = %zu (%smatch)\n", libnameok ? '|' : '\\', lib->libname->len,
-                                                      lib->libname->len == sizeof(*(lib->libname)) ? "" : "no ");
+   if ( g_verbose || !libnameok ) {
+    printf("|   |-> version         = %i (%smatch)\n", lib->libname->version,
+                                                       lib->libname->version == ROAR_DL_LIBNAME_VERSION ? "" : "no ");
+    printf("|   %c-> len             = %zu (%smatch)\n", libnameok ? '|' : '\\', lib->libname->len,
+                                                         lib->libname->len == sizeof(*(lib->libname)) ? "" : "no ");
+   }
+
    if ( libnameok ) {
 #define _ps(k,name) \
     tmp = (lib->libname->name) != NULL; \
+    if ( tmp || g_verbose || (k) == '\\' ) \
     printf("|   %c-> %-15s = %s%s%s\n", (k), #name, tmp ? "\"" : "", \
                                     tmp ? (lib->libname->name) : "<not set>", tmp ? "\"" : "");
@@ -172,7 +198,11 @@
    }
   }
-  printf("|-> global_data_len     = %zu\n", lib->global_data_len);
-  printf("|-> global_data_init    = %s\n", _ptrrange2str(lib->global_data_init, lib->global_data_len));
-  printf("|-> global_data_pointer = %s\n", _ptr2str(lib->global_data_pointer));
+  if ( g_verbose || lib->global_data_pointer != NULL )
+   printf("|-> global_data_len     = %zu\n", lib->global_data_len);
+  if ( g_verbose || lib->global_data_init != NULL )
+   printf("|-> global_data_init    = %s\n", _ptrrange2str(lib->global_data_init, lib->global_data_len));
+  if ( g_verbose || lib->global_data_pointer != NULL )
+   printf("|-> global_data_pointer = %s\n", _ptr2str(lib->global_data_pointer));
+
   if ( lib->libdep != NULL && lib->libdep_len ) {
    printf("|-> libdep              = %s\n", _ptr2str(lib->libdep));
@@ -186,14 +216,18 @@
      libdepok = 0;
     }
-    printf("|   %c   |-> version     = %i (%smatch)\n", c, lib->libdep[iter].version,
-                                                        lib->libdep[iter].version == ROAR_DL_LIBDEP_VERSION ? "" : "no ");
-    printf("|   %c   %c-> len         = %zu (%smatch)\n", c, libdepok ? '|' : '\\',
-                                                       lib->libdep[iter].len,
-                                                       lib->libdep[iter].len == sizeof(struct roar_dl_librarydep) ?
-                                                       "" : "no ");
+    if ( g_verbose || !libdepok ) {
+     printf("|   %c   |-> version     = %i (%smatch)\n", c, lib->libdep[iter].version,
+                                                         lib->libdep[iter].version == ROAR_DL_LIBDEP_VERSION ? "" : "no ");
+     printf("|   %c   %c-> len         = %zu (%smatch)\n", c, libdepok ? '|' : '\\',
+                                                        lib->libdep[iter].len,
+                                                        lib->libdep[iter].len == sizeof(struct roar_dl_librarydep) ?
+                                                        "" : "no ");
+    }
+
     if ( libdepok ) {
      printf("|   %c   |-> flags       = 0x%.8lX\n", c, (unsigned long int)lib->libdep[iter].flags);
 #define _ps(k,name) \
     tmp = (lib->libdep[iter].name) != NULL; \
+    if ( tmp || g_verbose || (k) == '\\' ) \
     printf("|   %c   %c-> %-11s = %s%s%s\n", c, (k), #name, tmp ? "\"" : "", \
                                     tmp ? (lib->libdep[iter].name) : "<not set>", tmp ? "\"" : "");
@@ -209,12 +243,26 @@
    printf("|-> libdep_len          = %zu (invalid)\n", lib->libdep_len);
   }
-  printf("\\-> appsched            = %s\n", _ptr2str(lib->appsched));
-  if ( lib->appsched != NULL ) {
-   printf("    |-> init            = %s\n", _ptr2str(lib->appsched->init));
-   printf("    |-> free            = %s\n", _ptr2str(lib->appsched->free));
-   printf("    |-> update          = %s\n", _ptr2str(lib->appsched->update));
-   printf("    |-> tick            = %s\n", _ptr2str(lib->appsched->tick));
-   printf("    \\-> wait            = %s\n", _ptr2str(lib->appsched->wait));
-  }
+  if ( g_verbose || lib->appsched != NULL ) {
+   printf("|-> appsched            = %s\n", _ptr2str(lib->appsched));
+   if ( lib->appsched != NULL ) {
+    if ( lib->appsched->init != NULL )
+     printf("|   |-> init            = %s\n", _ptr2str(lib->appsched->init));
+    if ( lib->appsched->free != NULL )
+     printf("|   |-> free            = %s\n", _ptr2str(lib->appsched->free));
+    if ( lib->appsched->update != NULL )
+     printf("|   |-> update          = %s\n", _ptr2str(lib->appsched->update));
+    if ( lib->appsched->tick != NULL )
+     printf("|   |-> tick            = %s\n", _ptr2str(lib->appsched->tick));
+    printf("|   \\-> wait            = %s\n", _ptr2str(lib->appsched->wait));
+   }
+  }
+#define _ps(k,name) \
+    tmp = (lib->name) != NULL; \
+    if ( tmp || g_verbose || (k) == '\\' ) \
+    printf("%c-> %-19s = %s%s%s\n", (k), #name, tmp ? "\"" : "", \
+                                    tmp ? (lib->name) : "<not set>", tmp ? "\"" : "");
+  _ps('|', host_appname);
+  _ps('\\', host_abiversion);
+#undef _ps
  }
 
@@ -247,6 +295,6 @@
 
 int main (int argc, char * argv[]) {
- const char * appname    = "roarpluginrunner";
- const char * abiversion = NULL;
+ const char * appname    = "roarpluginrunner " ROAR_VSTR_ROARAUDIO;
+ const char * abiversion = "1.0beta0";
  const char * pluginargs = NULL;
  enum action action = RUN;
@@ -267,4 +315,6 @@
   } else if ( !strcmp(k, "--verbose") ) {
    g_verbose++;
+  } else if ( !strcmp(k, "--server") ) {
+   roar_libroar_set_server(argv[++i]);
   } else if ( !strcmp(k, "--appname") ) {
    appname = argv[++i];
Index: roard/include/plugins.h
===================================================================
--- roard/include/plugins.h	(revision 5275)
+++ roard/include/plugins.h	(revision 5353)
@@ -29,5 +29,5 @@
 #include <roaraudio.h>
 
-#define ROARD_DL_APPNAME    "roard <0/RoarAudio>"
+#define ROARD_DL_APPNAME    "roard " ROAR_VSTR_ROARAUDIO
 #define ROARD_DL_ABIVERSION NULL
 
