[netperf-dev] netperf4 commit notice r64 - in trunk: . src

raj at netperf.org raj at netperf.org
Thu Feb 23 12:37:30 PST 2006


Author: raj
Date: 2006-02-23 12:37:26 -0800 (Thu, 23 Feb 2006)
New Revision: 64

Modified:
   trunk/config.h.in
   trunk/configure
   trunk/configure.ac
   trunk/src/Makefile.am
   trunk/src/Makefile.in
   trunk/src/netlib.c
   trunk/src/netperf.c
Log:
Make sure that LIBDIR and NETPERFDIR are strings.
If no config or command file is given, first try default_mumble.xml in
cwd, and if that does not exist, try in NETPERFDIR (which happens to
default to /usr/local/share/netperf but that can be changed via configure.


Modified: trunk/config.h.in
===================================================================
--- trunk/config.h.in	2006-02-23 02:00:13 UTC (rev 63)
+++ trunk/config.h.in	2006-02-23 20:37:26 UTC (rev 64)
@@ -15,6 +15,9 @@
 /* Define to 1 if you have the <dlfcn.h> header file. */
 #undef HAVE_DLFCN_H
 
+/* Define to 1 if you have the `dlopen' function. */
+#undef HAVE_DLOPEN
+
 /* Define to 1 if you have the <errno.h> header file. */
 #undef HAVE_ERRNO_H
 

Modified: trunk/configure
===================================================================
--- trunk/configure	2006-02-23 02:00:13 UTC (rev 63)
+++ trunk/configure	2006-02-23 20:37:26 UTC (rev 64)
@@ -23426,7 +23426,8 @@
 
 
 
-for ac_func in gethostbyname gethrtime gettimeofday inet_ntoa memset memcpy socket sqrt strcasecmp strchr strstr strtoul uname
+
+for ac_func in dlopen gethostbyname gethrtime gettimeofday inet_ntoa memset memcpy socket sqrt strcasecmp strchr strstr strtoul uname
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5

Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac	2006-02-23 02:00:13 UTC (rev 63)
+++ trunk/configure.ac	2006-02-23 20:37:26 UTC (rev 64)
@@ -81,7 +81,7 @@
 # AC_FUNC_STAT
 # remove pstat_getdynamic (at least for now) since we don't do
 # anything conditional with the check anyway...
-AC_CHECK_FUNCS([gethostbyname gethrtime gettimeofday inet_ntoa memset memcpy socket sqrt strcasecmp strchr strstr strtoul uname])
+AC_CHECK_FUNCS([dlopen gethostbyname gethrtime gettimeofday inet_ntoa memset memcpy socket sqrt strcasecmp strchr strstr strtoul uname])
 
 #AC_CONFIG_SUBDIRS(src/missing)
 

Modified: trunk/src/Makefile.am
===================================================================
--- trunk/src/Makefile.am	2006-02-23 02:00:13 UTC (rev 63)
+++ trunk/src/Makefile.am	2006-02-23 20:37:26 UTC (rev 64)
@@ -3,7 +3,7 @@
 bin_PROGRAMS = netperf netserver
 
 AM_CFLAGS = $(NETPERF_CFLAGS)
-AM_CPPFLAGS = -DLIBDIR="$(libdir)" -DNETPERFDIR="$(netperfdir)"
+AM_CPPFLAGS = -DLIBDIR="\"$(libdir)\"" -DNETPERFDIR="\"$(netperfdir)\""
 
 # for now we will use "NETSYS_SOURCE" for both the netsysstats and
 # netlib platform-specific stuff

Modified: trunk/src/Makefile.in
===================================================================
--- trunk/src/Makefile.in	2006-02-23 02:00:13 UTC (rev 63)
+++ trunk/src/Makefile.in	2006-02-23 20:37:26 UTC (rev 64)
@@ -142,7 +142,7 @@
 bin_PROGRAMS = netperf netserver
 
 AM_CFLAGS = $(NETPERF_CFLAGS)
-AM_CPPFLAGS = -DLIBDIR="$(libdir)" -DNETPERFDIR="$(netperfdir)"
+AM_CPPFLAGS = -DLIBDIR="\"$(libdir)\"" -DNETPERFDIR="\"$(netperfdir)\""
 
 # for now we will use "NETSYS_SOURCE" for both the netsysstats and
 # netlib platform-specific stuff

Modified: trunk/src/netlib.c
===================================================================
--- trunk/src/netlib.c	2006-02-23 02:00:13 UTC (rev 63)
+++ trunk/src/netlib.c	2006-02-23 20:37:26 UTC (rev 64)
@@ -739,7 +739,7 @@
 	/* OK, there were no paths at all, lets do our own internal
 	   path, which one day really aught to be based on $(libdir)
 	   from the make environment. raj 2006-02-22 */
-	temp = ".:/usr/local/lib";
+	temp = ".:"LIBDIR;
       }
     }
   }

Modified: trunk/src/netperf.c
===================================================================
--- trunk/src/netperf.c	2006-02-23 02:00:13 UTC (rev 63)
+++ trunk/src/netperf.c	2006-02-23 20:37:26 UTC (rev 64)
@@ -47,6 +47,10 @@
 #include <sys/types.h>
 #endif
 
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+
 #ifdef HAVE_SYS_SOCKET_H
 #include <sys/socket.h>
 #endif
@@ -257,22 +261,41 @@
   xmlDocPtr  doc = NULL;
   xmlNodePtr root = NULL;
   xmlNsPtr   ns;
+  struct stat buf;
 
   if (debug) {
     if (fname) {
-      fprintf(where,"parse_xml_file called with fname %s\n",fname);
+      fprintf(where,"%s called with fname %s\n",__func__,fname);
     }
     else {
-      fprintf(where,"parse_xml_file called with null fname\n");
+      fprintf(where,"%s called with null fname\n",__func__);
+    }
     fflush(where);
-    }
   }
   if (fname == NULL) {
     if (!xmlStrcmp(doctype,(const xmlChar *)"netperf")) {
-      fname = "default_config.xml";
+      if (0 == stat("default_config.xml",&buf)) {
+	fname = "default_config.xml";
+      }
+      else if (0 == stat(NETPERFDIR NETPERF_PATH_SEP "default_config.xml",
+			 &buf)) {
+	fname = NETPERFDIR NETPERF_PATH_SEP "default_config.xml";
+      }
+      else {
+	fname = "missing config file";
+      }
     }
     if (!xmlStrcmp(doctype,(const xmlChar *)"commands")) {
-      fname = "default_commands.xml";
+      if (0 == stat("default_commands.xml",&buf)) {
+	fname = "default_commands.xml";
+      }
+      else if (0 == stat(NETPERFDIR NETPERF_PATH_SEP "default_commands.xml",
+			 &buf)) {
+	fname = NETPERFDIR NETPERF_PATH_SEP "default_commands.xml";
+      }
+      else {
+	fname = "missing commands file";
+      }
     }
   }
 



More information about the netperf-dev mailing list