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

Cross-compiling gphoto2-2.1.4


I've been out in the field for a week and haven't had a chance to
resolve issues compiling gphoto2. I was able to compile libgphoto2 with
help from the mailing list. If anyone else wants to do this in the
future, I wrote this script:
export PATH=/usr/local/cris/cris-axis-linux-gnu/bin:$PATH
echo $PATH
./configure --host=cris-axis-linux-gnu --without-exif

Then did 'make'. The libraries were located in
~/libgphoto2-2.1.4/libgphoto2/.libs and
~/libgphoto2-2.1.4/libgphoto2_port/libgphoto2_port/.libs  .
I copied the everything and the symlinks to
/usr/local/cris/cris-axis-linux-gnu/lib . I verified they were axis libs
using /usr/local/cris/cris-axis-linux-gnu/bin/readelf | grep Axis .

Now I'm trying to cross-compile gphoto2. I have another script that I
run just like for cross-compiling libgphoto2:
#export PATH=/usr/local/cris/cris-axis-linux-gnu/bin:$PATH
export PATH=/usr/local/cris/bin/:$PATH
echo $PATH
./configure --host=cris-axis-linux-gnu --without-exif \
        --libdir=/usr/local/cris/cris-axis-linux-gnu/lib \
        --without-pkgconfig \

This completes fine, with output saying the compiler is
'cris-axis-linux-gnu-gcc'. However, 'make' then fails:
if cris-axis-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I. -I..
-DGPHOTO2_LOCALEDIR=\""/usr/local/share/locale"\" -I.. -I../intl
-I../gphoto2  -I/usr/include/gphoto2        -g -O2 -g -Wall
-Wmissing-declarations -Wmissing-prototypes -MT options.o -MD -MP -MF
".deps/options.Tpo" \
  -c -o options.o `test -f 'options.c' || echo './'`options.c; \
then mv -f ".deps/options.Tpo" ".deps/options.Po"; \
else rm -f ".deps/options.Tpo"; exit 1; \
In file included from actions.h:27,
                 from options.c:22:
gp-params.h:24:36: gphoto2/gphoto2-camera.h: No such file or directory
gp-params.h:25:44: gphoto2/gphoto2-abilities-list.h: No such file or
gp-params.h:26:37: gphoto2/gphoto2-context.h: No such file or directory
make[2]: *** [options.o] Error 1

Inside of gp-params.h is:
#include <gphoto2/gphoto2-camera.h>
#include <gphoto2/gphoto2-abilities-list.h>
#include <gphoto2/gphoto2-context.h>

The "-I/usr/include/gphoto2" should pick up those 3 files, which are all
located in /usr/include/gphoto2, however does <gphoto2/gphoto2-camera.h>
actually mean /usr/include/gphoto2/gphoto2/gphoto2-camera.h? Yes, that's
what it does mean, I just copied all the gphoto2 header files to
include/gphoto2/gphoto2/ and make got further, with these errors:
if cris-axis-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I. -I..
-DGPHOTO2_LOCALEDIR=\""/usr/local/share/locale"\" -I.. -I../intl
-I../gphoto2  -I/usr/include/gphoto2          -g -O2 -g -Wall
-Wmissing-declarations -Wmissing-prototypes -MT actions.o -MD -MP -MF
".deps/actions.Tpo" \
  -c -o actions.o `test -f 'actions.c' || echo './'`actions.c; \
then mv -f ".deps/actions.Tpo" ".deps/actions.Po"; \
else rm -f ".deps/actions.Tpo"; exit 1; \
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

Relevant lines from actions.c:
#ifdef OS2          //line 799
                        _("OS/2 port by Bart van Leeuwen\n")
#endif              //line 803

Obviously I'm not doing something right. With all that I've described
above maybe someone knows what's going on or something I can try? This
e-mail will also help me keep track of what I've done.