aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkraxel <kraxel>2005-02-09 11:57:25 +0000
committerkraxel <kraxel>2005-02-09 11:57:25 +0000
commitb00ae68a83de451edb86a2bb3bbaa1a16021d199 (patch)
tree3a41d314ceb275bc467b6186d4a08fc079eb6884
parent65b4d6491a2fcd32efe5b0cacf137305af95b541 (diff)
downloadscsi-changer-b00ae68a83de451edb86a2bb3bbaa1a16021d199.tar.gz
- merge patch from Michael Riepe (specify device to use).
- fix some minor compiler warnings.
-rw-r--r--GNUmakefile2
-rw-r--r--INSTALL69
-rw-r--r--autojuke.c2
-rw-r--r--mover.c20
-rw-r--r--unload.c2
-rw-r--r--xmover.c14
6 files changed, 71 insertions, 38 deletions
diff --git a/GNUmakefile b/GNUmakefile
index b2c62c1..e2c3a07 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -46,6 +46,8 @@ unload: unload.o
mover: mover.o
+autojuke: autojuke.o
+
xmover: xmover.o man.o RegEdit.o
xmover.o: xmover.c xmover.h
diff --git a/INSTALL b/INSTALL
index a7ee64b..0d1ba36 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,34 +1,59 @@
-Compiling the package
----------------------
+howto compile and install this package
+======================================
-The driver itself is provided as patch. There are patches for both
-2.2.x and 2.4.x kernels. Apply the patch, configure the kernel,
-recompile. The 2.2.x version isn't maintained any more. The old patch
-is still there, but the latest and greatest stuff is available for 2.4.x
-only.
-A simple 'make' should compile the tools. After compiling you should
-have the following files:
+really short install instructions
+---------------------------------
- mover - a small program for testing the driver / sending commands
- to the changer
- xmover - a X11 frontend for the driver -- needs Motif.
- autojuke - a tool for using a changer with autofs.
- unload - a even smaller program to send a eject to any SCSI device
- load - (symlink to unload) sends a load instead of eject.
+ $ make
+ $ su -c "make install"
-man-pages for these utilities are available. Also have a look at the
-README for some general informations about scsi changers and about the
-driver.
-In the todo subdirectory is autojuke version with support for
-double-sided media hacked in. Drawback is that volume tag support is
-broken in this version. To be merged some day ...
+
+the more detailed version
+-------------------------
+
+Make sure you use GNU make. The file name "GNUmakefile" isn't a joke,
+this package really requires GNU make.
+
+As first step make will do some config checks on your system and write
+the results to Make.config. If you want to have a look at Make.config
+before the actual build starts you can run this step separately using
+"make config".
+
+The Makefiles use the usual GNU-ish Makefile conventions for variable
+names and default values, i.e. prefix=/usr/local, ...
+
+The values for some frequently adapted variables are initialized from
+the enviroment. Thus you can change the defaults simply by setting
+environment variables:
+
+ $ prefix="/usr"
+ $ CFLAGS="-O3 -mcpu=i686"
+ $ export prefix CFLAGS
+
+Almost any variable can be overridden on the make command line. It is
+often used this way to install into some buildroot for packaging ...
+
+ $ su -c "make DESTDIR=/tmp/buildroot install"
+
+... but it works for most other variables equally well. There are
+some exceptions through, it usually does _not_ work for CFLAGS for
+example.
+
+Try "make verbose=yes" if you want to see the complete command lines
+executed by make instead of the short messages (for trouble shooting,
+because you like this way, for whatever reason ...). This also makes
+the config checks performed by "make config" more verbose.
+
+If you don't trust my Makefiles you can run "make -n install" to see
+what "make install" would do on your system. It will produce
+human-readable output (unlike automake ...).
Have fun,
Gerd
---
+--
Gerd Knorr <kraxel@bytesex.org>
diff --git a/autojuke.c b/autojuke.c
index c27f135..f80a972 100644
--- a/autojuke.c
+++ b/autojuke.c
@@ -29,7 +29,7 @@
/* ---------------------------------------------------------------------- */
-int
+static int
check_mtab(int n, char **devs)
{
int i,res;
diff --git a/mover.c b/mover.c
index 8866abe..ab8a1a0 100644
--- a/mover.c
+++ b/mover.c
@@ -15,7 +15,7 @@
struct changer_params params;
struct changer_vendor_params vparams;
-int
+static int
parse_arg(char *arg, int *type, int *nr)
{
char t;
@@ -116,10 +116,14 @@ print_stat(int fd, int type, int count)
int
main(int argc, char *argv[])
{
+ char *changer;
int fd,rc;
- if (-1 == (fd = open(CHANGER,O_RDONLY))) {
- perror("open");
+ if (!(changer = getenv("CHANGER"))) {
+ changer = CHANGER;
+ }
+ if (-1 == (fd = open(changer,O_RDONLY))) {
+ fprintf(stderr,"open %s: %s\n",changer,strerror(errno));
exit(1);
}
@@ -128,7 +132,7 @@ main(int argc, char *argv[])
fprintf(stderr,"ioctl failed (GPARAMS): %s\n",strerror(errno));
exit(1);
} else {
- printf(CHANGER ": mt=%i st=%i ie=%i dt=%i\n",
+ printf("%s: mt=%i st=%i ie=%i dt=%i\n", changer,
params.cp_npickers,params.cp_nslots,
params.cp_nportals,params.cp_ndrives);
}
@@ -137,13 +141,13 @@ main(int argc, char *argv[])
fprintf(stderr,"ioctl failed (VPARAMS): %s\n",strerror(errno));
} else {
if (vparams.cvp_n1)
- printf(CHANGER ": v1=%d [%s]\n",vparams.cvp_n1,vparams.cvp_label1);
+ printf("%s: v1=%d [%s]\n",changer,vparams.cvp_n1,vparams.cvp_label1);
if (vparams.cvp_n2)
- printf(CHANGER ": v2=%d [%s]\n",vparams.cvp_n2,vparams.cvp_label2);
+ printf("%s: v2=%d [%s]\n",changer,vparams.cvp_n2,vparams.cvp_label2);
if (vparams.cvp_n3)
- printf(CHANGER ": v3=%d [%s]\n",vparams.cvp_n3,vparams.cvp_label3);
+ printf("%s: v3=%d [%s]\n",changer,vparams.cvp_n3,vparams.cvp_label3);
if (vparams.cvp_n4)
- printf(CHANGER ": v4=%d [%s]\n",vparams.cvp_n4,vparams.cvp_label4);
+ printf("%s: v4=%d [%s]\n",changer,vparams.cvp_n4,vparams.cvp_label4);
}
if (argc == 1 || 0 == strcasecmp(argv[1],"status")) {
diff --git a/unload.c b/unload.c
index a1005c2..eb017fe 100644
--- a/unload.c
+++ b/unload.c
@@ -36,7 +36,7 @@ main(int argc, char *argv[])
if (-1 == (fd = open(device, O_RDONLY))) {
fprintf(stderr,"%s: can't open %s: %s\n",prog,device,
- sys_errlist[errno]);
+ strerror(errno));
exit(1);
}
diff --git a/xmover.c b/xmover.c
index 241f0a7..1b85bbb 100644
--- a/xmover.c
+++ b/xmover.c
@@ -107,7 +107,7 @@ static Atom _XMOVER_REFRESH;
static Atom targets[2];
static Cardinal ntargets;
-void init_atoms(Display *dpy)
+static void init_atoms(Display *dpy)
{
XA_WM_DELETE_WINDOW = XInternAtom(dpy, "WM_DELETE_WINDOW", False);
@@ -208,7 +208,7 @@ static struct list_head ptr_wins;
static Cursor ptr_idle;
static Cursor ptr_busy;
-void ptr_register(Widget widget)
+static void ptr_register(Widget widget)
{
struct ptr_list *item;
@@ -220,7 +220,8 @@ void ptr_register(Widget widget)
list_add_tail(&item->list,&ptr_wins);
}
-void ptr_unregister(Widget widget)
+#if 0
+static void ptr_unregister(Widget widget)
{
struct list_head *item;
struct ptr_list *win,*del;
@@ -234,8 +235,9 @@ void ptr_unregister(Widget widget)
if (del)
list_del(&del->list);
}
+#endif
-void ptr_set(Cursor ptr)
+static void ptr_set(Cursor ptr)
{
struct list_head *item;
struct ptr_list *win;
@@ -252,7 +254,7 @@ void ptr_set(Cursor ptr)
XSync(dpy,False);
}
-void ptr_init(Widget shell)
+static void ptr_init(Widget shell)
{
XColor white,red,dummy;
Colormap cmap = DefaultColormapOfScreen(XtScreen(shell));
@@ -609,7 +611,7 @@ elem_destination(Widget widget, XtPointer clientdata, XtPointer call_data)
/* --------------------------------------------------------------------- */
/* gui + basic callbacks */
-void
+static void
destroy_cb(Widget widget, XtPointer clientdata, XtPointer call_data)
{
XtDestroyWidget(clientdata);