2002-06-12 Lutz M�ller <lutz@users.sourceforge.net>
* configure.in:
* libgphoto2/gphoto2-camera.c:
* libgphoto2/gphoto2-abilities-list.c: Fixes for HAVE_LTDL. Still
doesn't work.
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@4636 67ed7778-7388-44ab-90cf-0a291f65f57c
This commit is contained in:
@@ -1,3 +1,10 @@
|
||||
2002-06-12 Lutz Müller <lutz@users.sourceforge.net>
|
||||
|
||||
* configure.in:
|
||||
* libgphoto2/gphoto2-camera.c:
|
||||
* libgphoto2/gphoto2-abilities-list.c: Fixes for HAVE_LTDL. Still
|
||||
doesn't work.
|
||||
|
||||
2002-06-12 Christophe Barbé <christophe.barbe@ufies.org>
|
||||
|
||||
* libgphoto2_port/m4/documentation.m4: Added --with-doc-formats option and
|
||||
|
||||
40
configure.in
40
configure.in
@@ -113,26 +113,29 @@ dnl there running libtool-1.3. For those, we will need
|
||||
dnl dlopen. Note that on some systems (e.g. FreeBSD)
|
||||
dnl -ldl isn't needed.
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl Commented out for now because lt_dlforeachfile will not do anything if it
|
||||
dnl has already been called before.
|
||||
dnl
|
||||
AC_PROG_LIBTOOL
|
||||
no_libtool=true
|
||||
dnl AC_CHECK_LIB(ltdl, lt_dlforeachfile,
|
||||
dnl AC_CHECK_HEADER(ltdl.h,
|
||||
dnl AC_DEFINE(HAVE_LTDL,,[whether we use libltdl])
|
||||
dnl LTDL_LIBS="-lltdl"
|
||||
dnl no_libtool=false
|
||||
dnl )
|
||||
dnl )
|
||||
if $no_libtool; then
|
||||
AC_CHECK_FUNC(dlopen,,
|
||||
AC_CHECK_LIB(dl, dlopen,
|
||||
LTDL_LIBS="-ldl",
|
||||
AC_ERROR([
|
||||
have_ltdl=false
|
||||
ltdl_msg="no (default)"
|
||||
dnl For now, we don't use ltdl. It just doesn't work. If you want to fix it,
|
||||
dnl email <lutz@users.sourceforge.net>
|
||||
try_ltdl=false
|
||||
AC_ARG_WITH(ltdl, [ --without-ltdl Don't use ltdl],[
|
||||
if test x$withval = xno; then
|
||||
try_ltdl=false
|
||||
fi])
|
||||
if $try_ltdl; then
|
||||
AC_CHECK_LIB(ltdl, lt_dlforeachfile,[
|
||||
AC_CHECK_HEADER(ltdl.h,[
|
||||
AC_DEFINE(HAVE_LTDL,,[whether we use libltdl])
|
||||
LTDL_LIBS="-lltdl"
|
||||
ltdl_msg="yes"
|
||||
have_ltdl=true])])
|
||||
fi
|
||||
if test x$have_ltdl != "xtrue"; then
|
||||
AC_CHECK_FUNC(dlopen,,[
|
||||
AC_CHECK_LIB(dl, dlopen,[LTDL_LIBS="-ldl"],[AC_ERROR([
|
||||
*** Could not determine how to handle
|
||||
*** shared libraries!
|
||||
])))
|
||||
*** shared libraries!])])])
|
||||
fi
|
||||
AC_SUBST(LTDL_LIBS)
|
||||
|
||||
@@ -544,4 +547,5 @@ Configuration (libgphoto2):
|
||||
EXIF support: $exif_msg
|
||||
readline support: $rl_msg
|
||||
pthread support: $pthread_msg
|
||||
Use ltdl.h: $ltdl_msg
|
||||
"
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#include <string.h>
|
||||
|
||||
#ifdef HAVE_LTDL
|
||||
#include <ltdl.h>
|
||||
# include <ltdl.h>
|
||||
#endif
|
||||
|
||||
#include "gphoto2-result.h"
|
||||
@@ -95,7 +95,7 @@ gp_abilities_list_new (CameraAbilitiesList **list)
|
||||
CHECK_MEM (*list = malloc (sizeof (CameraAbilitiesList)));
|
||||
memset (*list, 0, sizeof (CameraAbilitiesList));
|
||||
|
||||
#if HAVE_LTDL
|
||||
#ifdef HAVE_LTDL
|
||||
lt_dlinit ();
|
||||
#endif
|
||||
|
||||
@@ -135,7 +135,11 @@ foreach_func (const char *filename, lt_ptr data)
|
||||
{
|
||||
CameraList *list = data;
|
||||
|
||||
return (gp_list_append (list, filename, NULL));
|
||||
gp_log (GP_LOG_DEBUG, "gphoto2-abilities-list",
|
||||
"Found '%s'.", filename);
|
||||
gp_list_append (list, filename, NULL);
|
||||
|
||||
return (0);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -147,29 +151,32 @@ gp_abilities_list_load_dir (CameraAbilitiesList *list, const char *dir,
|
||||
CameraLibraryAbilitiesFunc ab;
|
||||
CameraText text;
|
||||
int x, old_count, new_count;
|
||||
unsigned int i, n, p;
|
||||
unsigned int i;
|
||||
const char *filename;
|
||||
#ifdef HAVE_LTDL
|
||||
CameraList flist;
|
||||
int i, count;
|
||||
int count;
|
||||
lt_dlhandle lh;
|
||||
#else
|
||||
GP_SYSTEM_DIR d;
|
||||
GP_SYSTEM_DIRENT de;
|
||||
char buf[1024];
|
||||
void *lh;
|
||||
unsigned int n, p;
|
||||
#endif
|
||||
|
||||
CHECK_NULL (list && dir);
|
||||
|
||||
gp_log (GP_LOG_DEBUG, "gphoto2-abilities-list",
|
||||
"Loading camera libraries in '%s'...", dir);
|
||||
#ifndef HAVE_LTDL
|
||||
gp_log (GP_LOG_DEBUG, "gphoto2-abilities-list",
|
||||
"Note that failing to load *.a and *.la is NOT an error!");
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LTDL
|
||||
CHECK_RESULT (gp_list_reset (&flist));
|
||||
CHECK_RESULT (lt_dlforeachfile (dir, foreach_func, &flist));
|
||||
lt_dlforeachfile (dir, foreach_func, &flist);
|
||||
CHECK_RESULT (count = gp_list_count (&flist));
|
||||
for (i = 0; i < count; i++) {
|
||||
CHECK_RESULT (gp_list_get_name (&flist, i, &filename));
|
||||
|
||||
Reference in New Issue
Block a user