[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Help-glpk] Re: libglpk0: excessive install dependencies
From: |
glpk xypron |
Subject: |
[Help-glpk] Re: libglpk0: excessive install dependencies |
Date: |
Thu, 20 Mar 2008 12:39:15 +0100 |
Hello Andrew,
essentially the following functions are already wrappers.
glpmpl04.c:
DLMODULE load_library(const char *modulename)
void *load_symbol(DLMODULE module, const char *name)
void unload_library(DLMODULE module)
What is missing is considering the case that libdl shall be used instead of
libltdl, which would require changing configure.ac too.
In Your lists of functions xdlopen, xdlsym, xdlclose, xdlerror two functions
are missing: xdlinit, xdlexit. These functions will be needed to initialize and
release libraries libdl and libtddl. Xdlerror is not necessary, if error
handling is included in the other routines. Such failure should not lead to
abort(). Instead NULL should be returned by xdlopen and xdlsym in the case of
an error.
You are right that the code should be moved out of glpmpl04.c because using
shared libraries might in future also be used by other modules then MPL.
Please, consider moving the following code to new functions in glpsql.c (e.g.
sql_initialize, sql_terminate).
#if 1 /* dlopen */
/* find dynamic load libraries */
#ifdef WIN32
mpl->iodbc = load_library("odbc32");
mpl->mysql = load_library("libmysql");
#else
xassert(0 == lt_dlinit());
mpl->iodbc = load_library("libiodbc");
mpl->mysql = load_library("libmysqlclient");
#endif /* WIN32 */
#endif
#if 1 /* dlopen */
unload_library(mpl->iodbc);
unload_library(mpl->mysql);
#ifndef WIN32
xassert(0 == lt_dlexit());
#endif /*WIN32*/
Best regards
Xypron
-------- Original-Nachricht --------
> Datum: Thu, 20 Mar 2008 11:53:10 +0300
> Betreff: Re: libglpk0: excessive install dependencies
> Hi Xypron,
>
> I have looked through your code. Thank you for your efforts.
>
> Using dynamic libraries is a separate problem, and I think we need to
> consider it first and separately from implementing database interface.
>
> The main difficult is that using dynamic libraries is out of the ISO C
> standard. A solution could be using libltdl component of GNU Libtool,
> because it provides portability for many modern platforms. Nevertheless,
> for various reasons, I would prefer to implement wrapper routines which
> might be configured for the following four cases:
>
> 1) GNU Libtool (libltdl)
> (see http://www.gnu.org/software/libtool/manual.html )
>
> 2) The Open Group & IEEE standard (dlopen, etc.)
> (see http://www.opengroup.org/onlinepubs/009695399/nfindex.html )
>
> 3) MS Windows (LoadLibrary, etc.)
>
> 4) Null case, if none of the above is available.
>
> Wrapper routines follow the OG & IEEE standard:
>
> void *xdlopen(const char *file, int mode);
>
> void *xdlsym(void *handle, const char *name);
>
> int xdlclose(void *handle);
>
> const char *xdlerror(void);
>
> I plan to implement these routines for next several days.
>
> What do you think about that?
>
>
> Andrew Makhorin
>
--
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
[Help-glpk] Re: libglpk0: excessive install dependencies, Xypron, 2008/03/16