LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Solaris / OpenSolaris (http://www.linuxquestions.org/questions/solaris-opensolaris-20/)
-   -   How to compile tun driver (http://www.linuxquestions.org/questions/solaris-opensolaris-20/how-to-compile-tun-driver-821529/)

eantoranz 07-22-2010 11:44 AM

How to compile tun driver
 
Hi!

I'm trying to compile tun driver for Solaris 5.10 (http://vtun.sourceforge.net/tun/tun-1.1.tar.gz)

I'm getting a ton of errors, but this error is being repeated hundreds of times so I think If I solve it I'll correct most of them so I can see what's left to solve:

Code:

tun.c: At top level:
tun.c:922: error: parse error before '*' token
tun.c: In function `tun_dlpi':
tun.c:924: error: `mp' undeclared (first use in this function)
tun.c:929: error: `wq' undeclared (first use in this function)
tun.c: At top level:
tun.c:968: error: parse error before '*' token
tun.c: In function `tunwput':
tun.c:978: error: `mp' undeclared (first use in this function)
tun.c:980: error: `wq' undeclared (first use in this function)
tun.c: At top level:
tun.c:1023: error: parse error before '*' token
tun.c: In function `tunwsrv':
tun.c:1025: error: `mp' undeclared (first use in this function)
tun.c:1032: error: `wq' undeclared (first use in this function)
tun.c: At top level:/usr/include/vm/page.h:822: warning: array `hw_page_array' assumed to have one element
tun.c:54: error: storage size of `tunminfo' isn't known

How can I solve it?

eantoranz 07-22-2010 02:51 PM

I came into the solaris directory and tried to compile whatever is in there.... here's the first error:

Code:

gcc -DTUN_VER=\"\"  -O2 -Wall -D_KERNEL -I. -c tun.c
In file included from /usr/include/sys/signal.h:34,
                from /usr/include/sys/klwp.h:14,
                from /usr/include/sys/thread.h:13,
                from /usr/include/sys/semaphore.h:18,
                from /usr/include/sys/t_lock.h:22,
                from /usr/include/sys/conf.h:21,
                from tun.c:22:
/usr/include/sys/siginfo.h:259: error: parse error before "ctid_t"
/usr/include/sys/siginfo.h:292: error: parse error before '}' token
/usr/include/sys/siginfo.h:294: error: parse error before '}' token
/usr/include/sys/siginfo.h:390: error: parse error before "ctid_t"
/usr/include/sys/siginfo.h:398: error: conflicting types for `__fault'
/usr/include/sys/siginfo.h:267: error: previous declaration of `__fault'
/usr/include/sys/siginfo.h:404: error: conflicting types for `__file'
/usr/include/sys/siginfo.h:273: error: previous declaration of `__file'
/usr/include/sys/siginfo.h:420: error: conflicting types for `__prof'
/usr/include/sys/siginfo.h:287: error: previous declaration of `__prof'
/usr/include/sys/siginfo.h:424: error: conflicting types for `__rctl'
/usr/include/sys/siginfo.h:291: error: previous declaration of `__rctl'
/usr/include/sys/siginfo.h:426: error: parse error before '}' token
/usr/include/sys/siginfo.h:428: error: parse error before '}' token
/usr/include/sys/siginfo.h:432: error: parse error before "k_siginfo_t"
/usr/include/sys/siginfo.h:437: error: parse error before '}' token

What's going on?

eantoranz 07-22-2010 02:53 PM

Code:

# gcc --version
gcc (GCC) 3.3.2
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


jlliagre 07-22-2010 08:13 PM

This code just compiles just fine here with both Solaris 10 update 8 and OpenSolaris.
Code:

s10u8:/tmp # gunzip tun-1.1.tar.gz
s10u8:/tmp # tar xf tun-1.1.tar
s10u8:/tmp # cd tun-1.1
s10u8:/tmp/tun-1.1 # ./configure
creating cache ./config.cache
checking host system type... i386-pc-solaris2.10
checking host system type... i386-pc-solaris2.10
checking target system type... i386-pc-solaris2.10
checking build system type... i386-pc-solaris2.10
checking for gcc... gcc
checking whether the C compiler (gcc  ) works... yes
checking whether the C compiler (gcc  ) is a cross-compiler... no
checking whether we are using GNU C... yes
checking whether gcc accepts -g... yes
checking for gawk... no
checking for mawk... no
checking for nawk... nawk
checking for a BSD compatible install... ./install-sh -c
updating cache ./config.cache
creating ./config.status
creating Makefile
configuring in solaris
running /bin/sh ./configure  --cache-file=.././config.cache --srcdir=.
loading cache .././config.cache
checking for a BSD compatible install... ./../install-sh -c
creating ./config.status
creating Makefile
s10u8:/tmp/tun-1.1 # gcc --version
gcc (GCC) 3.4.3 (csl-sol210-3_4-branch+sol_rpath)
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

s10u8:/tmp/tun-1.1 # make
cd solaris; make all
gcc -DTUN_VER=\"1.1\ 07/23/2010\" -O2 -Wall -D_KERNEL -I. -c tun.c
ld -r -o tun tun.o
s10u8:/tmp/tun-1.1 # ls -l */tun
-rw-r--r--  1 root    root        8956 Jul 23 03:07 solaris/tun



All times are GMT -5. The time now is 08:00 PM.