[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Cross-compiling gphoto2-2.1.4 - adding libs to Axis?



Hello,

Below I have the code for actions.c. I do not understand the semantics
they are using in printf. However, this copywright information does not
need to be formatted nicely for my use. So I stripped down the function
to just text, and to my surprise gphoto2 compiled. Now it complains
about not being able to load  libpthread.so.0. In
target/cris-axis-linux-gnu/lib I do have libpthreado.so, but it does not
seem to make it into the image file because it is not on the Axis. Where
do I tell the 'make images' which libraries to include from
target/cris-*/lib? I tried on my host to use cris-ld to see what libs
are required, but did not spend too much time trying to figure it out.
If I knew how to check which libs are required for executables, I might
be able to find where they are put into the images. Besides, I thought
one would use ldd (not ld) to figure out which libraries are required by
an executable (ldd works with my hello.c on my host). 

If anyone has time to comment, here is the original function in
actions.c that does not compile.

int
print_version_action (GPParams *p)
{
	int n;
	printf (_("gphoto2 %s\n"
		  "\n"
		  "Copyright (c) 2000-2003 Lutz Mueller and others\n"
		  "%s"
		  "\n"
		  "gphoto2 comes with NO WARRANTY, to the extent permitted by law. You
may\n"
		  "redistribute copies of gphoto2 under the terms of the GNU General
Public\n"
		  "License. For more information about these matters, see the files
named COPYING.\n"
		  "\n"
		  "This version of gphoto2 is using the following software versions
and options:\n"),

		VERSION,
#ifdef OS2                        //line 799
			_("OS/2 port by Bart van Leeuwen\n")
#else
			""
#endif                             // line 803
		);

	for (n = 0; module_versions[n].name != NULL; n++) {
	  int i;
	  const char **v = NULL;
	  char *name = module_versions[n].name;
	  GPVersionFunc func = module_versions[n].version_func;
	  CHECK_NULL (name);
	  CHECK_NULL (func);
	  v = func(GP_VERSION_SHORT);
	  CHECK_NULL (v);
	  CHECK_NULL (v[0]);
	  printf ("%-17s %-12s ", name, v[0]);
	  for (i = 1; v[i] != NULL; i++) {
		  if (v[i+1] != NULL) {
			  printf ("%s, ", v[i]);
		  } else {
			  printf ("%s", v[i]);
		  }
	  }
	  printf ("\n");
	}

	return (GP_OK);
}


----- Original Message -----
From: "Lars Viklund" <lars.viklund@xxxxxxx.com>
Date: Tuesday, August 17, 2004 2:18 am
Subject: RE: Cross-compiling gphoto2-2.1.4

> 
> > -----Original Message-----
> > From: owner-dev-etrax@xxxxxxx.com 
> > [mailto:owner-dev-etrax@xxxxxxx.com] On Behalf Of Nathan.Smith@xxxxxxx.gov
> > Sent: den 16 augusti 2004 18:13
> > To: dev-etrax
> > Subject: Cross-compiling gphoto2-2.1.4
> 
> > actions.c:799:1: directives may not be used inside a macro argument
> > actions.c:798:24: unterminated argument list invoking macro "printf"
> > actions.c: In function `print_version_action':
> > actions.c:802: parse error before string constant
> > make[2]: *** [actions.o] Error 1
> > </snip> 
> > 
> > Relevant lines from actions.c:
> > #ifdef OS2          //line 799
> >                         _("OS/2 port by Bart van Leeuwen\n")
> > #else
> >                         ""
> > #endif              //line 803
> 
> You have snipped too much for this provide any useful information.
> The problem seems to be the context the #ifdef appears in.
>