#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>
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);
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 ()
/*
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)");
*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;
}
}
{
if (open_library ())
{
- fprintf (stderr, "Error opening kpathsea library. Aborting");
+ fprintf (stderr, _ ("error opening kpathsea library"));
+ fprintf (stderr, _ ("aborting"));
exit (1);
}