Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 6 Feb 2005 00:36:07 -0800
From:      "Ted Mittelstaedt" <tedm@toybox.placo.com>
To:        "Brian John" <brianjohn@fusemail.com>, <freebsd-questions@freebsd.org>
Subject:   RE: How to compile linux apps?
Message-ID:  <LOBBIFDAGNMAMLGJJCKNCEEEFAAA.tedm@toybox.placo.com>
In-Reply-To: <4205B299.9080403@fusemail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

Brian,

  This package does some unportable stuff, one of the biggies
is making assumptions about the system getopt.  Your going to have
to make some mods to it and no guarentees it will work even once you
get it installed.  Let us know, though.  Anyway here's the list:

1) CD to /usr/ports/devel/libgnugetopt
make  DON'T DO MAKE INSTALL!!!!
cd ./work/libgnugetopt-1.2
cp getopt1.c /usr/home/brian/allin1-0.5.0/src
cp getopt.h /usr/home/brian/allin1-0.5.0/src
cp getopt.c /usr/home/brian/allin1-0.5.0/src

cd /usr/home/brian/allin1-0.5.0/src

using your favorite text editor, open the Makefile located in
the src directory in the distribution and make the following changes:

CFLAGS = -ggdb -Wall -O2 -I /usr/X11R6/include

MODULES = allin1.o dockhelper.o memory.o battery.o cpu.o \
          network.o filesys.o confparse.o seti.o getopt.o getopt1.o
INCLUDES = dockhelper.h memory.h battery.h cpu.h network.h filesys.h
seti.h \
            confparse.h getopt.h

Now, in the allin1.c program, use a text editor and make the following
changes:

#include <getopt.h>  needs to be #include "getopt.h"

add in

#include <sys/time.h>

line 215 of the program lists:

strcpy(eth.intf_name,"eth");

change this to your network adapter interface, for example if it's
"tl0" change this to:

strcpy(eth.intf_name,"tl");

(this may need to be changed elsewhere in addition to this place, I
did not bother looking over the code that well)

Now, in the filesys.c program, use a text editor and make the following
changes:

get rid of the line  #include <sys/vfs.h>  and replace it with

#include <sys/param.h>
#include <sys/mount.h>


Now you can do "make" and you will get a binary.  copy the
allin1.conf.example
to your home directory and edit it, then try running the binary on an
Xterm
and see what happens.  It does appear to want to run best in Fluxbox I
hope
you have it installed.

If it doesen't work, then e-mail the author of the program

http://ilpettegolo.altervista.org/linux_allin1.en.shtml

with the changes you have done, and he may go ahead and add in some
ifdefs to the program to allow it to compile on FreeBSD out of the
box, as well as fix whatever else on it doesen't work.

Ted

> -----Original Message-----
> From: owner-freebsd-questions@freebsd.org
> [mailto:owner-freebsd-questions@freebsd.org]On Behalf Of Brian John
> Sent: Saturday, February 05, 2005 10:01 PM
> To: freebsd-questions@freebsd.org
> Subject: How to compile linux apps?
>
>
> Hello, I'm trying to compile the 'allin1' dockapp for fluxbox.  When I
> type 'make', I get the following errors:
> n# make
> gcc -ggdb -Wall -O2 -c allin1.c
> allin1.c:32:22: X11/Xlib.h: No such file or directory
> In file included from allin1.c:34:
> dockhelper.h:86: error: syntax error before '*' token
> dockhelper.h:89: error: syntax error before "p"
> dockhelper.h:92: error: syntax error before '*' token
> dockhelper.h:95: error: syntax error before "src"
> dockhelper.h:98: error: syntax error before '*' token
> dockhelper.h:98: warning: type defaults to `int' in declaration of
> `dh_display'
> dockhelper.h:98: warning: data definition has no type or storage class
> In file included from allin1.c:37:
> cpu.h:54: error: syntax error before "Pixmap"
> allin1.c: In function `main':
> allin1.c:174: error: syntax error before "event"
> allin1.c:414: warning: implicit declaration of function `XPending'
> allin1.c:415: warning: implicit declaration of function `XNextEvent'
> allin1.c:415: error: `event' undeclared (first use in this function)
> allin1.c:415: error: (Each undeclared identifier is reported only once
> allin1.c:415: error: for each function it appears in.)
> allin1.c:417: error: `Expose' undeclared (first use in this function)
> allin1.c:418: warning: implicit declaration of function
> `XCheckTypedEvent'
> allin1.c:421: error: `DestroyNotify' undeclared (first use in
> this function)
> allin1.c:422: warning: implicit declaration of function `XCloseDisplay'
> *** Error code 1
>
> Stop in /usr/home/brian/allin1-0.5.0/src.
>
>
> Any clue how I can compile this?
>
> Thanks
>
> /Brian
> _______________________________________________
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to
> "freebsd-questions-unsubscribe@freebsd.org"
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?LOBBIFDAGNMAMLGJJCKNCEEEFAAA.tedm>