]> git.donarmstrong.com Git - lilypond.git/commitdiff
(open_library): dlopen libkpathsea.so
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 6 Mar 2005 19:41:13 +0000 (19:41 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 6 Mar 2005 19:41:13 +0000 (19:41 +0000)
(open_library): alternative for static library.

ChangeLog
kpath-guile/kpath.c

index 115564af53f000d7d12d9bf2122893f0695a1b91..e56e84a8a46ecc74031e19d2a620b2ebbff2f3b6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
 2005-03-06  Han-Wen Nienhuys  <hanwen@xs4all.nl>
 
        * kpath-guile/kpath.c (open_library): dlopen libkpathsea.so
+       (open_library): alternative for static library.
 
 2005-03-06  Jan Nieuwenhuizen  <janneke@gnu.org>
 
index 01f340e4f8305302d37e838acd8b34efcd7ab991..2b4a48a774fe9907e918b8292277c2c6e38654f8 100644 (file)
@@ -33,20 +33,20 @@ I found a somewhat more elegant patch for this: Just #include
 
 #include <unistd.h>    
 
+#if !HAVE_DYNAMIC_LIBKPATHSEA
+
 #define popen REALLYUGLYKLUDGE
 #define pclose ANOTHERREALLYUGLYKLUDGE
 #define getopt YAKLUDGE
 
 #include <kpathsea/kpathsea.h>
 #include <kpathsea/tex-file.h>
-
-
-
+#endif
 
 static  void *kpathsea_handle = 0;
 static  char *(*dl_kpse_find_file) (char const*, kpse_file_format_type, boolean) = 0;
 static  void (*dl_kpse_maketex_option) (char const*, boolean) = 0;
-static  void (*dl_kpse_set_program_name) (char const*) = 0;
+static  void (*dl_kpse_set_program_name) (char const*, char const*) = 0;
 static  char const *(*dl_kpse_init_format) (kpse_file_format_type) = 0;
 static  char *(*dl_kpse_var_expand) (char const*) = 0;
 static  kpse_format_info_type (*dl_kpse_format_info)[kpse_last_format] = 0;
@@ -107,7 +107,7 @@ SCM ly_kpathsea_expand_variable(SCM var)
 static char const* LIBKPATHSEA = "libkpathsea.so";
 
 int
-open_dynamic_library ()
+open_library ()
 {
 #if HAVE_DYNAMIC_LIBKPATHSEA
   struct
@@ -152,21 +152,27 @@ open_dynamic_library ()
          return 1;
        }
     }
-
   return 0;
+#else
+  dl_kpse_find_file = &kpse_find_file;
+  dl_kpse_set_program_name = &kpse_set_program_name;
+  dl_kpse_format_info = &kpse_format_info;
+  dl_kpse_init_format = &kpse_init_format;
+  dl_kpse_maketex_option = &kpse_maketex_option;
+  dl_kpse_var_expand = &kpse_var_expand;
 #endif
 }
 
 void
 initialize_kpathsea ()
 {
-  if (open_dynamic_library ())
+  if (open_library ())
     {
       fprintf (stderr, "Error opening kpathsea library. Aborting");
       exit (1);
     }
 
-  (*dl_kpse_set_program_name) ("lilypond");
+  (*dl_kpse_set_program_name) ("lilypond", "lilypond");
   (*dl_kpse_maketex_option) ("tfm", TRUE);
   
   SCM find = scm_c_define_gsubr ("ly:kpathsea-find-file", 1, 0, 0, ly_kpathsea_find_file);