Advertisement

How to install source/headers into system?

Started by February 13, 2006 06:13 AM
9 comments, last by pulpfist 18 years, 10 months ago
Hi, I'm trying to add code libraries onto my solaris machine, but I'm not sure what to do. eg I've downloaded some .h and .c files. I want them to be accessible when I use the gcc or g++ compilers. Thank you.
I don't know much about Solaris, but on Linux i usualy use
./configure && make && make install

Basicly, if you have a 'configure' file in the main library directory, it'll work.

hope that helps
Matt
Advertisement
I see,

When I got to make I got all this(I cut out the middle, just errors resulting from the top):

Quote:
-bash-3.00$ make
gcc -g -O2 -Iinclude/ -Wall -g -c sample.c
sample.c:23:17: pty.h: No such file or directory
In file included from sample.c:26:
include/libssh/libssh.h:43: error: syntax error before "u32"
include/libssh/libssh.h:43: warning: type defaults to `int' in declaration of `u32'
include/libssh/libssh.h:43: warning: data definition has no type or storage class
etc...........
etc...........
etc...........


*** Error code 1
make: Fatal error: Command failed for target `sample.o'


Btw I tried "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/include/vte" which is where the pty.h file resides

Any idea on whats causing all this?

Thanks
Quote:
Any idea on whats causing all this?


Yes.

Quote:
sample.c:23:17: pty.h: No such file or directory


That is printed when the compiler can't find the header file pty.h
I edited the sample.c file and modified the #include <pty.h> , to:
#include "/usr/include/vte/pty.h"

And it gives this now:

Quote:
-bash-3.00$ make
gcc -g -O2 -Iinclude/ -Wall -g -c sample.c
In file included from sample.c:23:
/usr/include/vte/pty.h:32: error: syntax error before "int"
/usr/include/vte/pty.h:35: error: syntax error before "gboolean"
/usr/include/vte/pty.h:43: error: syntax error before "gboolean"
In file included from /usr/include/iso/signal_iso.h:31,
from /usr/include/signal.h:25,
from sample.c:24:
/usr/include/sys/iso/signal_iso.h:83: error: syntax error before "extern"
In file included from sample.c:26:
include/libssh/libssh.h:43: error: syntax error before "u32"
include/libssh/libssh.h:43: warning: type defaults to `int' in declaration of `u32'
include/libssh/libssh.h:43: warning: data definition has no type or storage class
include/libssh/libssh.h:44: error: syntax error before "u16"
include/libssh/libssh.h:44: warning: type defaults to `int' in declaration of `u16'
include/libssh/libssh.h:44: warning: data definition has no type or storage class
include/libssh/libssh.h:45: error: syntax error before "u64"
include/libssh/libssh.h:45: warning: type defaults to `int' in declaration of `u64'
include/libssh/libssh.h:45: warning: data definition has no type or storage class


...................etc etc etc

sample.c: In function `shell':
sample.c:182: warning: implicit declaration of function `cfmakeraw'
sample.c: In function `do_sftp':
sample.c:212: error: invalid lvalue in assignment
sample.c:213: error: `dir' undeclared (first use in this function)
sample.c:213: error: (Each undeclared identifier is reported only once
sample.c:213: error: for each function it appears in.)
sample.c:214: error: `file' undeclared (first use in this function)
sample.c:215: error: `fichier' undeclared (first use in this function)
sample.c:216: error: `to' undeclared (first use in this function)
*** Error code 1
make: Fatal error: Command failed for target `sample.o'

I would undo the changes in pty.h and
try INCLUDE=$INCLUDE:/usr/include/vte rather than
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/include/vte
And try again.

Or better yet:

$ make -I /usr/include/vte

[Edited by - pulpfist on February 13, 2006 8:42:19 AM]
Advertisement
Quote:
$ make -I /usr/include/vte


-bash-3.00$ make -I /usr/include/vte
Usage : make [ -f makefile ][ -K statefile ]... [ -d ][ -dd ][ -D ][ -DD ]
[ -e ][ -i ][ -k ][ -n ][ -p ][ -P ][ -q ][ -r ][ -s ][ -S ][ -t ]
[ -u ][ -w ][ -V ][ target... ][ macro=value... ][ "macro +=value"... ]
make: Fatal error: Unknown option `-I'



I just found a libssh-0.11-sol8.patch file to make it compile on solaris.

I tried calling from the install directory:
patch -p0 libssh-0.11-sol8.patch

but nothing happens. Am I supposed to do anything else?

Thanks
Beats me :/
Installing OpenSSH Packages for SPARC and Intel x86/Solaris 9 and 10
Im just glad Im using Debian linux...
Quote: Original post by johnnyBravo
I just found a libssh-0.11-sol8.patch file to make it compile on solaris.

I tried calling from the install directory:
patch -p0 libssh-0.11-sol8.patch

but nothing happens. Am I supposed to do anything else?

You have to run this: (notice the < you had missing)
patch -p0 < libssh-0.11-sol8.patch
Quote: Original post by necromancer_df
Quote: Original post by johnnyBravo
I just found a libssh-0.11-sol8.patch file to make it compile on solaris.

I tried calling from the install directory:
patch -p0 libssh-0.11-sol8.patch

but nothing happens. Am I supposed to do anything else?

You have to run this: (notice the < you had missing)
patch -p0 < libssh-0.11-sol8.patch



Its saying:
Quote:
-bash-3.00$ patch -p0 < libssh-0.11-sol8.patch
Looks like a unified context diff.
File to patch:


I'm not sure what file I'm suppose to put in there, I've tried entering:
include/libssh/libssh.h libssh/connect.c and sample.c, which fail.
eg:
Quote:
-bash-3.00$ patch -p0 < libssh-0.11-sol8.patch
Looks like a unified context diff.
File to patch: sample.c
Hunk #1 failed at line 40.
Hunk #2 failed at line 70.
Hunk #3 failed at line 93.
Hunk #4 failed at line 179.
4 out of 4 hunks failed: saving rejects to sample.c.rej
I can't seem to find a patch in there anywhere.



I got the files names from the patch file here:
--- include/libssh/libssh.h     2005/10/26 04:07:35     1.1+++ include/libssh/libssh.h     2005/10/26 04:07:53@@ -40,10 +40,10 @@ typedef struct ssh_kbdint SSH_KBDINT; /* integer values */-typedef u_int32_t u32;-typedef u_int16_t u16;-typedef u_int64_t u64;-typedef u_int8_t u8;+typedef uint32_t u32;+typedef uint16_t u16;+typedef uint64_t u64;+typedef uint8_t u8; /* the offsets of methods */ #define KEX_ALGO 0--- libssh/connect.c    2005/10/26 04:16:22     1.1+++ libssh/connect.c    2005/10/26 04:16:47@@ -70,7 +70,7 @@ #endif     if(!hp){         --count;-        ssh_set_error(NULL,SSH_FATAL,"Failed to resolve hostname %s (%s)",host,hstrerror(h_errno));+        ssh_set_error(NULL,SSH_FATAL,"Failed to resolve hostname %s", host);         return -1;     }     memset(&sa,0,sizeof(sa));@@ -93,7 +93,7 @@ #endif         if(!hp){             --count;-            ssh_set_error(NULL,SSH_FATAL,"Failed to resolve bind address %s (%s)",bind_addr,hstrerror(h_errno));+            ssh_set_error(NULL,SSH_FATAL,"Failed to resolve bind address %s",bind_addr);             return -1;         }     }--- sample.c    2005/10/26 04:16:57     1.2+++ sample.c    2005/10/26 04:18:38@@ -179,7 +179,11 @@     if(interactive){         tcgetattr(0,&terminal_local);         memcpy(&terminal,&terminal_local,sizeof(struct termios));-        cfmakeraw(&terminal_local);+       terminal_local.c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON);+       terminal_local.c_oflag &= ~OPOST;+       terminal_local.c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN);+       terminal_local.c_cflag &= ~(CSIZE|PARENB);+       terminal_local.c_cflag |= CS8;         tcsetattr(0,TCSANOW,&terminal_local);         setsignal();     }


Thanks

This topic is closed to new replies.

Advertisement