Re: Problem compiling umax-driver with glibc-2.03

David Mosberger-Tang (davidm@azstarnet.com)
Sat, 21 Jun 1997 08:45:42 -0700

--RneQJTE4FF
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

>>>>> On Sat, 21 Jun 1997 13:50:50 +0059 (MDT), "Mathias Weigt (Stud. 94)" <p5iba@medchem2.pharmazie.uni-halle.de> said:

>> I still have problems with my glibc 2.03 (now updated for the
>> missing files) and compiling sane-0.6. GCC (2.7.2.2) complains
>> about a type mismatch in the umax driver:
>>
>> [snip...]
>>
>> I can only suspect that something in the signal-handling has
>> changed because sigset_t is now defined in signal.h as of type
>> __sigset_t at line 164 and __sigset_t is defined in sigset.h
>> around line 28:

Yes, it's fairly safe to assume that if you see any user-level program
make use of a C object whose name starts with an underscore then
something is seriously amiss. Such names are reserved for the
C-library/system and are not meant to be used by applications.

Fortunately, Gord already has sent a patch for this. I attached it
below. Let me know if it fixes the problem.

--david

--RneQJTE4FF
Content-Type: message/rfc822
Content-Transfer-Encoding: 7bit

Mime-Version: 1.0 (generated by tm-edit 7.92)
Content-Type: multipart/mixed;
boundary="Multipart_Thu_Jun_19_15:33:08_1997-1"
Return-Path: <gord@m-tech.ab.ca>
Received: from mail.azstarnet.com (localhost [127.0.0.1])
by panda.mosberger (8.8.5/8.8.5) with SMTP id OAA31538
for <davidm>; Thu, 19 Jun 1997 14:33:03 -0700
Received: from aries.azstarnet.com (slist@aries.azstarnet.com [169.197.1.12]) by mailhost.azstarnet.com (8.8.5-nerd/8.8.5) with ESMTP id OAA00212 for <davidm@azstarnet.com>; Thu, 19 Jun 1997 14:32:08 -0700 (MST)
Received: (from slist@localhost) by aries.azstarnet.com (8.8.5/8.8.5) id OAA12768 for davidm@azstarnet.com; Thu, 19 Jun 1997 14:39:38 -0700
Resent-Date: Thu, 19 Jun 1997 14:39:38 -0700
X-Envelope-From: sane-devel-request@listserv.azstarnet.com Thu Jun 19 14:39:37 1997
X-Attribution: Gord
Old-Date: 19 Jun 1997 15:33:08 -0600
Message-ID: <86bu52mg6j.fsf@localhost.profitpress.com>
Lines: 276
Resent-Message-ID: <"OYppl1.0.F73.PSQgp"@aries>
Resent-From: sane-devel@listserv.azstarnet.com
X-Mailing-List: <sane-devel@listserv.azstarnet.com> archive/latest/344
X-Loop: sane-devel@listserv.azstarnet.com
Precedence: list
Resent-Sender: sane-devel-request@listserv.azstarnet.com
X-Diagnostic: /usr/lib/sendmail sane-devel-dist@listserv.azstarnet.com failed
X-Diagnostic: Mail coming from a daemon, ignored
X-Diagnostic: Possible loopback problem
X-Envelope-To: sane-devel
X-UIDL: e9baabb89cd7b65a697a6376c10b3233
From: Gordon Matzigkeit <gord@m-tech.ab.ca>
Sender: gord@localhost.profitpress.com
To: SANE mailing list <sane-devel@azstarnet.com>
Subject: fixes for 0.6
Date: Thu, 19 Jun 1997 14:39:38 -0700
Reply-To: sane-devel@listserv.azstarnet.com

--Multipart_Thu_Jun_19_15:33:08_1997-1
Content-Type: text/plain; charset=US-ASCII

Hi, David!

Here are some tiny patches that coerce the UMAX backend into building
on some other platforms, as well as making the installation a little
cleaner. I finally got sick of having to `mkdir' a bunch of my own
directories every time I installed SANE.... ;)

BTW, should gtk+960606 be better named gtk+970606?

-- 
  Gord Matzigkeit   | Proudly running pieces of the GNU operating system.
 gord@m-tech.ab.ca  |  Jacques Cousteau loved programming in assembler.

--Multipart_Thu_Jun_19_15:33:08_1997-1 Content-Type: application/octet-stream; type=patch Content-Disposition: attachment; filename="sane-0.6.diff"

diff -u ChangeLog.orig ChangeLog --- ChangeLog.orig Sat Jun 14 15:40:03 1997 +++ ChangeLog Thu Jun 19 15:24:52 1997 @@ -1,3 +1,13 @@ +Thu Jun 19 15:19:38 1997 Gordon Matzigkeit <gord@gnu.ai.mit.edu> + + * backend/umax-scsi.c: Parameterize slightly more so that the + build succeeds on non-Linux platforms. + + * Makefile.in, backend/Makefile.in, doc/Makefile.in, + frontend/Makefile.in (install): Fail immediately if any + installation fails. Use mkinstalldirs to create all installation + directories. + Sat Jun 14 11:07:13 1997 David Mosberger-Tang <davidm@azstarnet.com> * Version 0.6 released. diff -u Makefile.in.orig Makefile.in --- Makefile.in.orig Thu Jun 19 15:22:11 1997 +++ Makefile.in Thu Jun 19 15:22:48 1997 @@ -20,6 +20,7 @@ includedir = @includedir@ oldincludedir = /usr/include +MKDIR = $(top_srcdir)/mkinstalldirs INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ @@ -37,10 +38,10 @@ install: install-recursive - -mkdir $(includedir)/sane + $(MKDIR) $(includedir)/sane @list="$(INSTALLED_INCLUDES)"; for file in $$list; do \ echo installing $${file} in $(includedir)/sane...; \ - $(INSTALL_DATA) $${file} $(includedir)/sane; \ + $(INSTALL_DATA) $${file} $(includedir)/sane || exit 1; \ done clean: clean-recursive diff -u backend/Makefile.in.orig backend/Makefile.in --- backend/Makefile.in.orig Thu Jun 19 15:13:23 1997 +++ backend/Makefile.in Thu Jun 19 15:19:35 1997 @@ -81,21 +81,21 @@ all: $(LIBS) libsane.la install: + $(MKDIR) $(libdir) $(configdir) @list="$(LIBS)"; for be in $$list; do \ echo installing $${be} in $(libdir)...; \ - $(LIBTOOL) $(MINST) $(INSTALL_PROGRAM) $${be} $(libdir)/$${be}; \ + $(LIBTOOL) $(MINST) $(INSTALL_PROGRAM) $${be} $(libdir)/$${be} || exit 1; \ done @$(LIBTOOL) $(MINST) $(INSTALL_PROGRAM) libsane.la $(libdir)/libsane.la ln -f -s libsane-dll.so $(libdir)/libsane.so.$(V_MAJOR) ln -f -s libsane-dll.a $(libdir)/libsane.a - $(MKDIR) $(configdir) @list="$(CONFIGS)"; for cfg in $$list; do \ if test ! -r $${cfg}; then continue; fi; \ if test -f $(configdir)/$${cfg}; then \ echo NOT overwriting $${cfg} in $(configdir)...; \ else \ echo installing $${cfg} in $(configdir)...; \ - $(INSTALL_DATA) $${cfg} $(configdir)/$${cfg}; \ + $(INSTALL_DATA) $${cfg} $(configdir)/$${cfg} || exit 1; \ fi; \ done diff -u backend/umax-scsi.c.orig backend/umax-scsi.c --- backend/umax-scsi.c.orig Thu Jun 19 14:48:57 1997 +++ backend/umax-scsi.c Thu Jun 19 15:09:13 1997 @@ -14,28 +14,29 @@ * work it out, we hope...) * and propably will work in the late future with * scanners of other vendors. - * - * + * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public * License along with this program ( thats a lie at the moment) * if not, write to the Free Software Foundation, Inc., * 675 Mass Ave, Cambridge, MA 02139, USA. - * + * */ /* ------------------------------- INCLUDES -------------------------------- */ +#ifndef UMAX_TO_SANE #include "sys/types.h" #include "sys/stat.h" #include "sys/mman.h" @@ -58,6 +59,20 @@ #include "scsi/scsi.h" #include "scsi/sg.h" +#else /* UMAX_TO_SANE */ + +#include <sys/types.h> +#include <unistd.h> +#include <string.h> +#include <assert.h> +#include <signal.h> +#include <stdlib.h> +#include <math.h> + +#include <stdio.h> +#include <getopt.h> + +#endif /* UMAX_TO_SANE */ #include "umax-scsidef.h" #include "umax-scanner.h" @@ -66,14 +81,15 @@ #ifndef UMAX_TO_SANE /* ONLY FOR UMAX-CLI */ - #include "scsicmd.h" + #include "scsicmd.h" #include "debug.h" #define UMAX_SCSI_MAX_REQUEST_SIZE SG_BIG_BUFF #define sense_handler NULL + #define RETSIGTYPE void #else /* ONLY FOR SANE-BACKEND */ - #include "../include/sane/sanei_scsi.h" - #include "../include/sane/sanei_debug.h" + #include <sane/sanei_scsi.h> + #include <sane/sanei_debug.h> #define do_scsi_cmd(fd, cmd, cmd_len, out, out_len) \ sanei_scsi_cmd(fd, cmd, cmd_len, out, out_len) #define umax_do_scsi_open(dev, fd, handler) sanei_scsi_open(dev, fd, handler) @@ -248,9 +264,8 @@ /* -------------------- UMAX EMERGENCY GIVE SCANNER ------------------------ */ - static US *emergency_us; -int umax_emergency_give_scanner(int i) +RETSIGTYPE umax_emergency_give_scanner(int i) { if (emergency_us->verbose) @@ -288,7 +303,7 @@ * GOOD * RESERVE UNIT * GOOD - * + * * It is then responsible for installing appropriate signal handlers * to call emergency_give_scanner() if user aborts. */ @@ -306,11 +321,11 @@ /* And if we abort? */ emergency_us = us; - signal(SIGINT, (__sighandler_t) umax_emergency_give_scanner); - signal(SIGTERM, (__sighandler_t) umax_emergency_give_scanner); - signal(SIGABRT, (__sighandler_t) umax_emergency_give_scanner); - signal(SIGILL, (__sighandler_t) umax_emergency_give_scanner); - signal(SIGSEGV, (__sighandler_t) umax_emergency_give_scanner); + signal(SIGINT, umax_emergency_give_scanner); + signal(SIGTERM, umax_emergency_give_scanner); + signal(SIGABRT, umax_emergency_give_scanner); + signal(SIGILL, umax_emergency_give_scanner); + signal(SIGSEGV, umax_emergency_give_scanner); return 0; } diff -u configure.in.orig configure.in --- configure.in.orig Fri Jun 13 19:28:34 1997 +++ configure.in Thu Jun 19 15:02:34 1997 @@ -35,6 +35,7 @@ dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST +AC_TYPE_SIGNAL AC_TYPE_SIZE_T AC_CHECK_TYPE(ssize_t, long) diff -u doc/Makefile.in.orig doc/Makefile.in --- doc/Makefile.in.orig Fri Jun 13 09:14:40 1997 +++ doc/Makefile.in Thu Jun 19 15:24:23 1997 @@ -30,7 +30,7 @@ SECT1 = saned.1 scanimage.1 xscanimage.1 SECT5 = sane-dll.5 sane-hp.5 sane-mustek.5 sane-net.5 sane-pint.5 \ - sane-pnm.5 sane-umax.5 sane-qcam.5 + sane-pnm.5 sane-umax.5 sane-qcam.5 MANPAGES = $(SECT1) $(SECT5) LATEX = TEXINPUTS=$(srcdir):$$TEXINPUTS latex DLH = TEXINPUTS=$(srcdir):$$TEXINPUTS dlh @@ -44,15 +44,14 @@ -e 's|@SBINDIR@|$(sbindir)|g' $^ >$@ install: $(MANPAGES) - $(MKDIR) $(mandir)/man1 - $(MKDIR) $(mandir)/man5 + $(MKDIR) $(mandir)/man1 $(mandir)/man5 @for page in $(SECT1); do \ echo installing $${page} in $(mandir)/man1/$${page}...; \ - $(INSTALL_DATA) $${page} $(mandir)/man1/$${page}; \ + $(INSTALL_DATA) $${page} $(mandir)/man1/$${page} || exit 1; \ done @for page in $(SECT5); do \ echo installing $${page} in $(mandir)/man5/$${page}...; \ - $(INSTALL_DATA) $${page} $(mandir)/man5/$${page}; \ + $(INSTALL_DATA) $${page} $(mandir)/man5/$${page} || exit 1; \ done docs: ps html diff -u frontend/Makefile.in.orig frontend/Makefile.in --- frontend/Makefile.in.orig Thu Jun 19 15:15:53 1997 +++ frontend/Makefile.in Thu Jun 19 15:19:11 1997 @@ -64,8 +64,7 @@ all: $(PROGRAMS) install: $(PROGRAMS) - $(MKDIR) $(bindir) - $(MKDIR) $(sbindir) + $(MKDIR) $(bindir) $(sbindir) $(datadir) @for program in $(BINPROGS); do \ $(LIBTOOL) $(MINST) $(INSTALL_PROGRAM) $${program} $(bindir)/$${program}; \ done diff -u include/sane/config.h.in.orig include/sane/config.h.in --- include/sane/config.h.in.orig Fri Jun 13 19:51:05 1997 +++ include/sane/config.h.in Thu Jun 19 15:03:33 1997 @@ -43,6 +43,9 @@ /* Define to `unsigned' if <sys/types.h> doesn't define. */ #undef size_t +/* Define to the return type of signal handlers. */ +#undef RETSIGTYPE + /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at run-time.

--Multipart_Thu_Jun_19_15:33:08_1997-1--

--
Source code, list archive, and docs: http://www.azstarnet.com/~axplinux/sane/
To unsubscribe: mail -s unsubscribe sane-devel-request@listserv.azstarnet.com

--RneQJTE4FF--

--
Source code, list archive, and docs: http://www.azstarnet.com/~axplinux/sane/
To unsubscribe: mail -s unsubscribe sane-devel-request@listserv.azstarnet.com