[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gpsd-dev
Subject:    [Gpsd-dev] request for help
From:       robin () spade-men ! com (Robin L Darroch)
Date:       2006-04-06 5:39:51
Message-ID: p06230927c05a57390559 () [192 ! 168 ! 11 ! 10]
[Download RAW message or body]

OK, now here comes the one thing that really puzzled me during my debugging session \
today (although it doesn't affect the patches I just posted): gpstoge doesn't seem to \
use my updated libgps unless I build it like other programs in the gpsd package (I \
actually had to modify the Makefile of gpsd and incorporate it into the make process \
to get it to use the updated libgps).  Now, it's quite possible that incorporating it \
into the gpsd working directory and Makefile was overkill, but the way I used to \
compile it seemed to take its behaviour from the old libgps, although I had already \
make'd & sudo make install'ed the updated gpsd.

Here's how I used to compile gpstoge:

13:09 [~] robin> cc -o bin/gpstoge src/gpstoge.c -lgps

However, every time I do it that way, I seem to get a gpstoge based on the old \
libgps.

Here's what "make" does.  Obviously a lot more complicated, but can someone more \
experienced with the intricacies of linkers (i.e. almost anyone) help me with which \
is the key part that means it builds using new libgps functions rather than old ones?

12:05 [~/src/gpsd-trunk] robin> make
make  all-am
source='gpstoge.c' object='gpstoge.o' libtool=no \
depfile='.deps/gpstoge.Po' tmpdepfile='.deps/gpstoge.TPo' \
depmode=gcc3 /bin/sh ./depcomp \
gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2 -Wall -Wcast-align -Wmissing-declarations \
-Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith -Wreturn-type -D_GNU_SOURCE  \
-c `test -f 'gpstoge.c' || echo './'`gpstoge.c gpstoge.c:72: warning: no previous \
                prototype for 'usage'
gpstoge.c: In function 'main':
gpstoge.c:166: warning: implicit declaration of function 'isprint'
gpstoge.c:92: warning: unused variable 'i'
gpstoge.c:97: warning: 'uspd' may be used uninitialized in this function
gpstoge.c:96: warning: 'ftime' may be used uninitialized in this function
/bin/sh ./libtool --mode=link gcc  -g -O2 -Wall -Wcast-align -Wmissing-declarations \
-Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith -Wreturn-type -D_GNU_SOURCE  \
-L/usr/X11R6/lib -o gpstoge  gpstoge.o -lm -lc   libgps.la -lm -lpthread  gcc -g -O2 \
-Wall -Wcast-align -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes \
-Wpointer-arith -Wreturn-type -D_GNU_SOURCE -o .libs/gpstoge gpstoge.o  \
-L/usr/X11R6/lib ./.libs/libgps.15.0.0 -lc -lm -lpthread creating gpstoge
12:34 [~/src/gpsd-trunk] robin> sudo make install
true man rtcmdecode.xml
/bin/sh ./mkinstalldirs /usr/lib
 /bin/sh ./libtool --mode=install /usr/bin/install -c  libgps.la /usr/lib/libgps.la
/usr/bin/install -c .libs/libgps.15 /usr/lib/libgps.15
(cd /usr/lib && { ln -s -f libgps.15 libgps || { rm -f libgps && ln -s libgps.15 \
libgps; }; }) (cd /usr/lib && { ln -s -f libgps.15 libgps.15.0.0 || { rm -f \
                libgps.15.0.0 && ln -s libgps.15 libgps.15.0.0; }; })
/usr/bin/install -c .libs/libgps.lai /usr/lib/libgps.la
/usr/bin/install -c .libs/libgps.a /usr/lib/libgps.a
ranlib /usr/lib/libgps.a
chmod 644 /usr/lib/libgps.a
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `DYLD_LIBRARY_PATH' environment variable
     during execution

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
/bin/sh ./mkinstalldirs /usr/bin
  /bin/sh ./libtool --mode=install /usr/bin/install -c xgps /usr/bin/xgps
/usr/bin/install -c .libs/xgps /usr/bin/xgps
  /bin/sh ./libtool --mode=install /usr/bin/install -c xgpsspeed /usr/bin/xgpsspeed
/usr/bin/install -c .libs/xgpsspeed /usr/bin/xgpsspeed
  /bin/sh ./libtool --mode=install /usr/bin/install -c rtcmdecode /usr/bin/rtcmdecode
/usr/bin/install -c .libs/rtcmdecode /usr/bin/rtcmdecode
  /bin/sh ./libtool --mode=install /usr/bin/install -c sirfmon /usr/bin/sirfmon
/usr/bin/install -c .libs/sirfmon /usr/bin/sirfmon
  /bin/sh ./libtool --mode=install /usr/bin/install -c gpspipe /usr/bin/gpspipe
/usr/bin/install -c .libs/gpspipe /usr/bin/gpspipe
  /bin/sh ./libtool --mode=install /usr/bin/install -c gpsflash /usr/bin/gpsflash
/usr/bin/install -c .libs/gpsflash /usr/bin/gpsflash
  /bin/sh ./libtool --mode=install /usr/bin/install -c gpstoge /usr/bin/gpstoge
/usr/bin/install -c .libs/gpstoge /usr/bin/gpstoge
  /bin/sh ./libtool --mode=install /usr/bin/install -c cgps /usr/bin/cgps
/usr/bin/install -c .libs/cgps /usr/bin/cgps
  /bin/sh ./libtool --mode=install /usr/bin/install -c cgpxlogger /usr/bin/cgpxlogger
/usr/bin/install -c cgpxlogger /usr/bin/cgpxlogger
/bin/sh ./mkinstalldirs /usr/bin
 /usr/bin/install -c gpsprof /usr/bin/gpsprof
 /usr/bin/install -c gpsfake /usr/bin/gpsfake
/bin/sh ./mkinstalldirs /usr/sbin
  /bin/sh ./libtool --mode=install /usr/bin/install -c gpsd /usr/sbin/gpsd
/usr/bin/install -c .libs/gpsd /usr/sbin/gpsd
/bin/sh ./mkinstalldirs /usr/include
 /usr/bin/install -c -m 644 gps.h /usr/include/gps.h
 /usr/bin/install -c -m 644 gpsd.h /usr/include/gpsd.h
 /usr/bin/install -c -m 644 libgpsmm.h /usr/include/libgpsmm.h
true man rtcmdecode.xml
/bin/sh ./mkinstalldirs /usr/man/man1
 /usr/bin/install -c -m 644 ./gps.1 /usr/man/man1/gps.1
 /usr/bin/install -c -m 644 ./xgps.1 /usr/man/man1/xgps.1
 /usr/bin/install -c -m 644 ./xgpsspeed.1 /usr/man/man1/xgpsspeed.1
 /usr/bin/install -c -m 644 ./cgps.1 /usr/man/man1/cgps.1
 /usr/bin/install -c -m 644 ./cgpxlogger.1 /usr/man/man1/cgpxlogger.1
 /usr/bin/install -c -m 644 ./gpsprof.1 /usr/man/man1/gpsprof.1
 /usr/bin/install -c -m 644 ./gpsfake.1 /usr/man/man1/gpsfake.1
 /usr/bin/install -c -m 644 ./sirfmon.1 /usr/man/man1/sirfmon.1
 /usr/bin/install -c -m 644 ./rtcmdecode.1 /usr/man/man1/rtcmdecode.1
 /usr/bin/install -c -m 644 ./gpspipe.1 /usr/man/man1/gpspipe.1
 /usr/bin/install -c -m 644 ./gpsflash.1 /usr/man/man1/gpsflash.1
/bin/sh ./mkinstalldirs /usr/man/man3
 /usr/bin/install -c -m 644 ./libgps.3 /usr/man/man3/libgps.3
 /usr/bin/install -c -m 644 ./libgpsmm.3 /usr/man/man3/libgpsmm.3
 /usr/bin/install -c -m 644 ./libgpsd.3 /usr/man/man3/libgpsd.3
/bin/sh ./mkinstalldirs /usr/man/man5
 /usr/bin/install -c -m 644 ./rtcm-104.5 /usr/man/man5/rtcm-104.5
 /usr/bin/install -c -m 644 ./srec.5 /usr/man/man5/srec.5
/bin/sh ./mkinstalldirs /usr/man/man8
 /usr/bin/install -c -m 644 ./gpsd.8 /usr/man/man8/gpsd.8


Incidentally, I know the install location is different, but that's not the issue - I \
only allowed one binary copy to remain on the system at any given time, and used the \
"which" command to double-check.  Any help would be most welcome!

Cheers,
Robin
-- 

-------------------------------------------------------------------------
 Robin L. Darroch - PO Box 2715, South Hedland WA 6722 - +61 421 503 966
      robin@darroch.id.au - robin@nyca.org.au - robin@spade-men.com
     


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic