Subject: location of sg.h

From: Lee Olds <[email-masked]>
Date: Sat, 20 Jul 1996 10:40:27 -0700 (PDT)

As a first package, I'm debianizing cdda2wav.

It tries to include sg.h as follows:
   #include <linux/../../drivers/scsi/sg.h>

This doesn't work because /usr/include/linux is not a symbolic link.
Currently I am using this instead:

   #include </usr/src/linux/include/scsi/sg.h>

What is the correct way for a user program to include this file? Is sg.h
in the wrong place? Should /usr/include/linux be a symbolic link? Should
any package that uses this file depend on the kernel source?

Thanks

---

From: Mr Stuart Lamble <[email-masked]>
Date: Sun, 21 Jul 1996 13:00:19 +1000 (EST)

> any package that uses this file depend on the kernel source?

The file "README" in the 2.0.7 source says...

 - make sure your /usr/include/asm, /usr/include/linux, and /usr/include/scsi
   directories are just symlinks to the kernel sources:

                cd /usr/include
                rm -rf asm linux scsi
                ln -s /usr/src/linux/include/asm-i386 asm
                ln -s /usr/src/linux/include/linux linux
                ln -s /usr/src/linux/include/scsi scsi

In other words, the file you want should be #included from <scsi/sg.h>, not
as an absolute include. If the kernel include files aren't installed in
these directories, I'd view it as a bug - I don't know, though, since I
got rid of the kernel packages, and downloaded the source from the Monash
mirror. :-)

As for the depending on the kernel source - I always have the appropriate
kernel sources installed, and the symlinks in /usr/include pointing to the
right places. (ok, so I haven't checked out the way Debian does kernel
sources lately...give me time. :-)

I've just had a look at the 1.2 files, and this won't work for the 1.2
kernel (but then, that's a rather moot point, given that Debian has the 2.0
kernels by default :-)

Sorry if I seem to be rambling; over 100 mail messages in my inbox is not
the most pleasant of surprises. :) Hope this helps.

-- 
I'm on a low-fat, high stress diet: coffee and fingernails.

---

From: Ian Jackson <[email-masked]>
Date: Thu, 1 Aug 96 01:49 BST

> any package that uses this file depend on the kernel source?

Hmm.  I'd be tempted to do
 #include <scsi/sg.h>
and use -I/usr/src/linux/include.

I don't think that every program that uses the SCSI generic interface
should need to include a kernel header file.  Can the public bits not
be put in a public header file ?

Ian.

---

From: Ian Jackson <[email-masked]>
Date: Thu, 1 Aug 96 01:53 BST

Stuart Lamble quotes the 2.0.7 kernel README:
...
>                 ln -s /usr/src/linux/include/scsi scsi

Does this mean that our libc5-dev package should include
/usr/include/scsi ?

Ian.

---

From: Mr Stuart Lamble <[email-masked]>
Date: Thu, 1 Aug 1996 12:16:03 +1000 (EST)

...
> and use -I/usr/src/linux/include.

I'm sure I wrote a response to this earlier...I'll restate it here.

As of (at the latest) 2.0.0, /usr/include/scsi should be a symbolic link
to /usr/src/linux/include/scsi. Given that libc5 includes the kernel
headers (I still dislike this, btw, and yes, I've read the FAQ), it
should be updated to include this.

In other words, the #include should just be <scsi/sg.h>.

> be put in a public header file ?

See above. :-)