sane 0.72pre meets FreeBSD

=?ISO-8859-1?Q?Mikko_Ty=F6l=E4j=E4rvi?= (mikko@securitydynamics.com)
Sun, 5 Apr 1998 21:21:08 +0200 (CEST)

The patches below are all (?) that is required to compile and pass
initial tests on FreeBSD 2.2.5 with gtk 0.99.9 and gimp 0.99.23.

I haven't had time to test on FreeBSD 2.2.6 or 3.0 yet, but I'd be
surprised if the result is any different.

Question 0:

Is the entire build supposed to pass without any compiler warnings?
If so, there are a few things that could be improved:

- getopt.c does not include headers to get declarations of getpid()
and strdup(). Well, it sort of does, but there are enough #ifdefs
to make sure it does not happen. But I guess this file is simply
grabbed out of GNU libs, and should not be changed. No big deal.

- sane provides strndup() for systems that does not have it, but
fails to declare it anywhere. It could be done in config.h, which
would require to include <sys/types.h> somewhere too (to get size_t).

Question 1:

Is it necessary to keep all the loadable backends in the standard
library path? I'm getting an uneasy feeling when sane singlehandedly
doubles the number of entries in my /usr/local/lib, with something
that could be considered as internal to sane.

Am I missing something, or could they be moved to (for example)
/usr/local/lib/sane/? Aren't the backends just dlopen()ed?

Patch 0:

The test for libgimp/gimp.h does not use CFLAGS, which are updated to
contain the X11 include directory. It uses CPPFLAGS. This way gimp.h
is located automagically in case gimp is in /usr/X11R6 or so.

Maybe CFLAGS and CPPFLAGS should be restored further down, as the
comment suggests (but which never happens).

--- sane-pre0.72.org/configure.in Fri Apr 3 09:52:35 1998
+++ sane-pre0.72/configure.in Sun Apr 5 20:17:51 1998
@@ -108,20 +108,21 @@

# Change CFLAGS temporarily so that C_SWITCH_X_SITE gets used
# for the tests that follow. We set it back to REAL_CFLAGS later on.

HAVE_X11=yes
if test "${HAVE_X11}" = "yes"; then
DEFS="$C_SWITCH_X_SITE $DEFS"
LDFLAGS="$LDFLAGS $LD_SWITCH_X_SITE"
LIBS="$LIBX $LIBS"
CFLAGS="$C_SWITCH_X_SITE $CFLAGS"
+ CPPFLAGS="$C_SWITCH_X_SITE $CPPFLAGS"

# On Solaris, arrange for LD_RUN_PATH to point to the X libraries for tests.
# This is handled by LD_SWITCH_X_SITE_AUX during the real build,
# but it's more convenient here to set LD_RUN_PATH
# since this also works on hosts that don't understand LD_SWITCH_X_SITE_AUX.
if test "${x_libraries}" != NONE && test -n "${x_libraries}"; then
LD_RUN_PATH=$x_libraries${LD_RUN_PATH+:}$LD_RUN_PATH
export LD_RUN_PATH
fi

Patch 1:

--- sane-pre0.72.org/backend/coolscan.c Fri Apr 3 10:36:11 1998
+++ sane-pre0.72/backend/coolscan.c Sun Apr 5 20:01:13 1998
@@ -66,7 +66,7 @@

/*#include "sane/config.h"*/

-#include <alloca.h>
+#include <lalloca.h>
#include <errno.h>
#include <fcntl.h>
#include <limits.h>

Regards,
/Mikko

Mikko Tyo"la"ja"rvi________________________________mikko@securitydynamics.com
SecurityDynamics

--
Source code, list archive, and docs: http://www.mostang.com/sane/
To unsubscribe: echo unsubscribe sane-devel | mail majordomo@mostang.com