WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: building torsmo  (Read 4104 times)

Offline dentonlt

  • Sr. Member
  • ****
  • Posts: 318
    • the trombone analog
building torsmo
« on: January 26, 2009, 06:24:49 AM »
Would be nice to have torsmo. I've downloaded the source and tried compiling, but can't get anywhere ...

Basically, having trouble locating the x libraries. I've tried using the varies dev extensions (X.org, gtk, glib, etc.) I've even downloaded/installed all of X binaries, but it's not working out. I'm lost.

Can I define the location of the libs using ./configure --x-libraries= ... ? I just don't know exactly what directory to point to.

Make crashes out b/c it can't find an X functions (XFreeFont, XLoadQueryFont, etc.). configure doesn't seem to find the X headers (?). Some logs:

configure:
Code: [Select]
creating cache ./config.cache
checking for a BSD compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking whether make sets ${MAKE}... yes
checking for working aclocal-1.4... missing
checking for working autoconf... missing
checking for working automake-1.4... missing
checking for working autoheader... missing
checking for working makeinfo... missing
checking for gcc... gcc
checking whether the C compiler (gcc -march=i486 -mtune=i686 -Os -pipe ) works... yes
checking whether the C compiler (gcc -march=i486 -mtune=i686 -Os -pipe ) is a cross-compiler... no
checking whether we are using GNU C... yes
checking whether gcc accepts -g... yes
checking how to run the C preprocessor... gcc -E
checking for X... libraries , headers /usr/X11R6/include
checking for XOpenDisplay in -lX11... no
checking for XdbeQueryExtension in -lXext... no
checking for signal.h... yes
checking for unistd.h... yes
checking for X11/Xlib.h... no
checking for sys/utsname.h... yes
checking for sys/stat.h... yes
checking for linux/soundcard.h... yes
checking for dirent.h... yes
checking for sys/statfs.h... yes
checking for sys/param.h... yes
checking for sys/mount.h... yes
checking for X11/extensions/Xdbe.h... no
checking for help2man... no
checking for sysinfo... yes
checking for getloadavg... yes
checking for popen... yes
updating cache ./config.cache
creating ./config.status
creating Makefile
creating config.h

The first chunk of the make errors:
Code: [Select]
torsmo.o: In function `load_font':
torsmo.c:(.text+0xca7): undefined reference to `XFreeFont'
torsmo.c:(.text+0xcbd): undefined reference to `XLoadQueryFont'
torsmo.c:(.text+0xcf2): undefined reference to `XLoadQueryFont'
torsmo.o: In function `get_string_width':
torsmo.c:(.text+0x2890): undefined reference to `XTextWidth'
torsmo.o: In function `set_font':
torsmo.c:(.text+0x2934): undefined reference to `XSetFont'
torsmo.o: In function `set_foreground_color':
torsmo.c:(.text+0x2956): undefined reference to `XSetForeground'
torsmo.o: In function `draw_text':
torsmo.c:(.text+0x29b6): undefined reference to `XSetLineAttributes'
torsmo.c:(.text+0x29d2): undefined reference to `XSetDashes'
torsmo.c:(.text+0x29ee): undefined reference to `XSetLineAttributes'
torsmo.c:(.text+0x2a3e): undefined reference to `XDrawRectangle'
torsmo.o: In function `draw_string':
torsmo.c:(.text+0x2b5c): undefined reference to `XDrawString'
torsmo.o: In function `draw_line':
torsmo.c:(.text+0x2c39): undefined reference to `XSetLineAttributes'
torsmo.c:(.text+0x2c97): undefined reference to `XSetLineAttributes'
torsmo.c:(.text+0x2cb3): undefined reference to `XSetDashes'
torsmo.c:(.text+0x2ce2): undefined reference to `XDrawLine'
torsmo.c:(.text+0x2d61): undefined reference to `XSetLineAttributes'
torsmo.c:(.text+0x2d84): undefined reference to `XDrawRectangle'
torsmo.c:(.text+0x2db7): undefined reference to `XFillRectangle'

gcc seems to run fine:
Code: [Select]
gcc -DHAVE_CONFIG_H -I. -I. -I.     -march=i486 -mtune=i686 -Os -pipe -Wall -I/usr/X11R6/include -Wall -W -c common.c
gcc -DHAVE_CONFIG_H -I. -I. -I.     -march=i486 -mtune=i686 -Os -pipe -Wall -I/usr/X11R6/include -Wall -W -c fs.c
gcc -DHAVE_CONFIG_H -I. -I. -I.     -march=i486 -mtune=i686 -Os -pipe -Wall -I/usr/X11R6/include -Wall -W -c linux.c
gcc -DHAVE_CONFIG_H -I. -I. -I.     -march=i486 -mtune=i686 -Os -pipe -Wall -I/usr/X11R6/include -Wall -W -c mail.c
gcc -DHAVE_CONFIG_H -I. -I. -I.     -march=i486 -mtune=i686 -Os -pipe -Wall -I/usr/X11R6/include -Wall -W -c mixer.c
gcc -DHAVE_CONFIG_H -I. -I. -I.     -march=i486 -mtune=i686 -Os -pipe -Wall -I/usr/X11R6/include -Wall -W -c torsmo.c
gcc -DHAVE_CONFIG_H -I. -I. -I.     -march=i486 -mtune=i686 -Os -pipe -Wall -I/usr/X11R6/include -Wall -W -c x11.c
gcc  -march=i486 -mtune=i686 -Os -pipe -Wall -I/usr/X11R6/include -Wall -W  -o torsmo   common.o fs.o linux.o mail.o mixer.o torsmo.o x11.o 

TIA.

Offline dentonlt

  • Sr. Member
  • ****
  • Posts: 318
    • the trombone analog
Re: building torsmo
« Reply #1 on: January 26, 2009, 06:35:59 AM »
Conveniently got somewhere with

./configure --x-libraries=/usr/X11R6/lib ...

But now I've got a run error:
    torsmo: scandir for /sys/bus/i2c/devices/: No such file or directory

I'll work it out, but help still welcome. I think someone was running torsmo on TC < 1.0 ?

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14788
Re: building torsmo
« Reply #2 on: January 26, 2009, 06:59:19 AM »
...and you'd rather use torsmo than the conky extension  :)

For me, if you've got pkgconfig pointing to the right place and have loaded Xorg-7.4-dev-light.tce, things should work.

is there a ./configure -- switch to disable i2c?

Edit: I just tried torsmo-0.17 with the compiletc and Xorg-7.4-dev-light extensions loaded:
Code: [Select]
$ export CFLAGS="-march=i486 -mtune=i686 -Os -pipe"
$ export CXXFLAGS="-march=i486 -mtune=i686 -Os -pipe -fno-exceptions -fno-rtti"
$ export PKG_CONFIG_PATH=/usr/lib/pkgconfig:/usr/local/lib/pkgconfig

$ ./configure --prefix=/usr/local

Edit Makefile
X11_LIBS = -lX11

$ make
$ sudo make install-strip

$ torsmo &
torsmo: can't allocate X color 'grey'
torsmo: scandir for /sys/bus/i2c/devices/: No such file or directory
torsmo: drawing to root window

I don't think pkgconfig is used - torsmo seems to work OK, maybe you could try the same thing?
« Last Edit: January 26, 2009, 08:17:37 AM by Juanito »

Offline dentonlt

  • Sr. Member
  • ****
  • Posts: 318
    • the trombone analog
Re: building torsmo
« Reply #3 on: January 26, 2009, 03:57:11 PM »
-There's- conky.tcel! After reading the conky/torsmo thread, I couldn't find it =\ Must not have let the page load or ... I'm just blind.

EDIT:
Yep, your build requirements work just as stated. Thanks again for the Makefile edit (X11_LIBS = -lX11)

torsmo looks for the lm_sensors directories - I'll get that setup and make a tutorial of it or something.

EDIT:

Yep. Setting up lm_sensors and what not will be a royal pain. I'll leave that ... and recommend conky for basic use. =)
« Last Edit: January 27, 2009, 03:53:56 AM by dentonlt »