]> git.donarmstrong.com Git - lilypond.git/blobdiff - kpath-guile/kpath.c
(local-uninstall): remove
[lilypond.git] / kpath-guile / kpath.c
index 5b78340dcc6d3abe62e1e55179825a517a2d5fc5..64cdb187d921169796a82de363ac7afe3e858792 100644 (file)
 
 #include "guile-compatibility.hh"
 
+#if !HAVE_GETTEXT
+inline char *
+gettext (char const *s)
+{
+  return (char *)s;
+}
+#else
+#include <libintl.h>
+#endif
+
+#define _(x) gettext (x)
+
 #include <dlfcn.h>
 #include <stdio.h>
 #include <string.h>
@@ -48,7 +60,7 @@ static char *(*dl_kpse_var_expand) (char const*) = 0;
 static kpse_format_info_type (*dl_kpse_format_info)[kpse_last_format] = 0;
 
 kpse_file_format_type
-kpathsea_find_format (const char* name)
+kpathsea_find_format (char const* name)
 {
   int i;
   int len = strlen (name);
@@ -98,8 +110,12 @@ SCM ly_kpathsea_expand_variable (SCM var)
   return ret;
 }
 
+#ifndef DYNAMIC_OBJECT_EXTENSION
+#define DYNAMIC_OBJECT_EXTENSION ".so"
+#endif
+
 
-static char const* LIBKPATHSEA = "libkpathsea.so";
+static char const* LIBKPATHSEA = "libkpathsea" DYNAMIC_OBJECT_EXTENSION;
 
 int
 open_library ()
@@ -127,8 +143,8 @@ open_library ()
       /*
        todo i18n.
        */
-      fprintf (stderr, "can't dlopen: %s: %s", LIBKPATHSEA, dlerror ());
-      fprintf (stderr,"install package: %s or %s",
+      fprintf (stderr, _ ("can't dlopen: %s: %s"), LIBKPATHSEA, dlerror ());
+      fprintf (stderr, _ ("install package: %s or %s"),
               "libkpathsea3 (teTeX 2.x)",
               "libkpathsea4 (teTeX 3.x)");
 
@@ -141,9 +157,9 @@ open_library ()
       *symbols[i].func_pointer = dlsym (kpathsea_handle, symbols[i].name);
       if (!symbols[i].func_pointer)
        {
-         fprintf(stderr, "no such symbol: %s: %s",
-                 symbols[i].name,
-                 dlerror ());
+         fprintf (stderr, _ ("no such symbol: %s: %s"),
+                  symbols[i].name,
+                  dlerror ());
          return 1;
        }
     }
@@ -164,7 +180,8 @@ initialize_kpathsea ()
 {
   if (open_library ())
     {
-      fprintf (stderr, "Error opening kpathsea library. Aborting");
+      fprintf (stderr, _ ("error opening kpathsea library"));
+      fprintf (stderr, _ ("aborting"));
       exit (1);
     }