add 'toolsdir' to the pc files add our first plugin test, which involves simply runni...
authorAndy Wingo <wingo@pobox.com>
Sat, 16 Feb 2002 17:53:58 +0000 (17:53 +0000)
committerAndy Wingo <wingo@pobox.com>
Sat, 16 Feb 2002 17:53:58 +0000 (17:53 +0000)
Original commit message from CVS:
* add 'toolsdir' to the pc files
* add our first plugin test, which involves simply running gst-compprep,
which in the course of creating the completion registry instantiates every
plugin. gst-register is run first.

gstreamer-uninstalled.pc.in
gstreamer.pc.in
tools/gst-complete.c

index 0f62bd7..30f674b 100644 (file)
@@ -1,7 +1,9 @@
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-libdir=@libdir@
-includedir=@includedir@
+# the standard variables don't make sense for an uninstalled copy
+prefix=
+exec_prefix=
+libdir=
+includedir=
+toolsdir=${pcfiledir}/tools
 
 Name: GStreamer Uninstalled
 Description: Streaming-media framework, Not Installed
index b31d9c5..5f01362 100644 (file)
@@ -2,6 +2,7 @@ prefix=@prefix@
 exec_prefix=@exec_prefix@
 libdir=@libdir@
 includedir=@includedir@
+toolsdir=${exec_prefix}/bin
 
 Name: GStreamer
 Description: Streaming-media framework
index fbae271..a21a3bc 100644 (file)
@@ -1,5 +1,6 @@
 #include <stdio.h>
 #include <string.h>
+#include <sys/stat.h>
 
 #include <gst/gstconfig.h>
 
@@ -58,7 +59,7 @@ int main(int argc,char *argv[]) {
 
   gchar *prev_word = argv[3];
   gchar *partial_word = argv[2];
-  int partial_len = strlen(partial_word);
+  int partial_len;
   GList *elements;
   GSList *pads;
   int num_pads;
@@ -66,9 +67,17 @@ int main(int argc,char *argv[]) {
   gchar *word;
   GSList *words = NULL;
 
+  struct stat stat_buf;
+  
+  partial_len = strlen(partial_word);
+
   /***** Loading the completion information from the registry *****/
 
-  doc = xmlParseFile (GST_CONFIG_DIR "/compreg.xml");
+  if (stat (GST_CONFIG_DIR"/compreg.xml", &stat_buf) == 0) {
+    doc = xmlParseFile (GST_CONFIG_DIR"/compreg.xml");
+  } else {
+    exit (1);
+  }
   rootnode = doc->xmlRootNode;
 
   elementnode = rootnode->xmlChildrenNode;