File: configure.in

package info (click to toggle)
sane 0.72-1.1
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 3,008 kB
  • ctags: 5,180
  • sloc: ansic: 42,911; sh: 4,584; java: 1,421; makefile: 720
file content (221 lines) | stat: -rw-r--r-- 6,172 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
dnl Process this file with autoconf to produce a configure script. -*-sh-*-
AC_INIT(include/sane/sane.h)
AC_CONFIG_HEADER(include/sane/config.h)
AC_PREREQ(2.10)dnl		dnl Minimum Autoconf version required.
AC_ARG_PROGRAM

# version code:
V_MAJOR=0
V_MINOR=72

PACKAGE=sane
VERSION=${V_MAJOR}.${V_MINOR}
PACKAGE_VERSION="$PACKAGE-$VERSION"
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
AC_DEFINE_UNQUOTED(PACKAGE_VERSION, "$PACKAGE_VERSION")
AC_SUBST(PACKAGE)
AC_SUBST(VERSION)
AC_SUBST(PACKAGE_VERSION)

dnl Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_PROG_CPP
AC_PROG_GCC_TRADITIONAL
AC_AIX
AC_MINIX
AC_ISC_POSIX

CPPFLAGS="${CPPFLAGS} -D_GNU_SOURCE"
if test "${ac_cv_prog_gcc}" = "yes"; then
  CFLAGS="${CFLAGS} -Wall"
fi

dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h unistd.h libintl.h libc.h sys/dsreq.h sys/select.h \
    sys/scanio.h scsi.h sys/scsi.h sys/scsicmd.h sys/scsiio.h \
    bsd/dev/scsireg.h scsi/sg.h /usr/src/linux/include/scsi/sg.h io/cam/cam.h \
    os2.h sys/socket.h sys/io.h asm/io.h gscdds.h \
    sys/scsi/sgdefs.h sys/scsi/targets/scgio.h apollo/scsi.h)

dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIGNAL
AC_TYPE_SIZE_T
AC_TYPE_PID_T
AC_CHECK_TYPE(ssize_t, long)
AC_CHECK_TYPE(u_char, unsigned char)
AC_CHECK_TYPE(u_int, unsigned int)
AC_CHECK_TYPE(u_long, unsigned long)

if test "$ac_cv_header_sys_scsiio_h" = "yes" \
     -a "$ac_cv_header_scsi_h" = "yes";
then
 AC_TRY_COMPILE([
#include <sys/scsiio.h>
#include <scsi.h>
],[scsireq_t req],,
   AC_DEFINE(scsireq_t, struct scsireq_t))
fi

dnl Checks for libraries.

AC_CHECK_LIB(scsi, scsireq_enter)	# FreeBSD needs this
AC_CHECK_LIB(m,sqrt)
AC_CHECK_LIB(intl,gettext)
AC_CHECK_LIB(nsl,gethostbyaddr)
AC_CHECK_LIB(socket,socket)

dnl Checks for library functions.
AM_FUNC_ALLOCA
AC_FUNC_MMAP
AC_CHECK_FUNCS(atexit ioperm mkdir scsireq_enter sigprocmask \
    strdup strndup strftime strstr strsep strtod snprintf usleep \
    strncasecmp gtk_tooltips_set_tooltips)

dnl initialize libtool
AM_PROG_LIBTOOL
# Turn around -rpath problem with libtool 1.0c
# This define should be improbable enough to not conflict with anything
case ${host} in
  *-pc-linux-gnu)
    AC_MSG_RESULT([Fixing libtool for -rpath problems.])
    sed < libtool > libtool-2 \
    's/^hardcode_libdir_flag_spec.*$/hardcode_libdir_flag_spec=" -D__LIBTOOL_IS_A_FOOL__ "/'
    mv libtool-2 libtool
    chmod 755 libtool
  ;;
esac

dnl Checks for libraries.

#### Choose a window system.

AC_PATH_X
if test "$no_x" = yes; then
  window_system=none
else
  window_system=x11
fi

# Find glib include directory.  
for ac_dir in /usr/local/lib/glib/include /usr/lib/glib/include; do
  if test -r "$ac_dir/glibconfig.h"; then
    if test "${x_includes}" = NONE; then
      x_includes="$ac_dir"
    else
      x_includes="$x_includes:$ac_dir"
    fi
  fi
done

if test "${x_libraries}" != NONE && test -n "${x_libraries}"; then
  LD_SWITCH_X_SITE=-L`echo ${x_libraries} | sed -e "s/:/ -L/g"`
  LD_SWITCH_X_SITE_AUX=-R`echo ${x_libraries} | sed -e "s/:/ -R/g"`
fi
if test "${x_includes}" != NONE && test -n "${x_includes}"; then
  C_SWITCH_X_SITE=-I`echo ${x_includes} | sed -e "s/:/ -I/g"`
fi

if test "${enable_dynamic}" != "no"; then
  AC_CHECK_HEADERS(dlfcn.h,
  [AC_CHECK_LIB(dl,dlopen)
   AC_CHECK_FUNCS(dlopen, , enable_dynamic=no)],
  [enable_dynamic=no])
fi

# 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
  CPPFLAGS="$C_SWITCH_X_SITE $CPPFLAGS"
  LDFLAGS="$LDFLAGS $LD_SWITCH_X_SITE"
  LIBS="$LIBX $LIBS"
  CFLAGS="$C_SWITCH_X_SITE $CFLAGS"

  # 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

  SAVED_LIBS="$LIBS"
  AC_CHECK_LIB(X11,main)
  AC_CHECK_LIB(Xext,main)
  AC_CHECK_LIB(Xpm,main)
  LIBX11="$LIBS"
  AC_CHECK_LIB(glib,main)
  AC_CHECK_LIB(Xi,main)
  AC_CHECK_LIB(gdk,main)
  AC_CHECK_LIB(gtk,gtk_gamma_curve_new,XSCAN="xscanimage xcam";
		LIBS="-lgtk ${LIBS}")
  LIBGTK="$LIBS"
  AC_CHECK_HEADERS(libgimp/gimp.h,LIBGIMP="-lgimp")
  LIBS="$SAVED_LIBS"
fi
AC_SUBST(XSCAN)
AC_SUBST(LIBX11)
AC_SUBST(LIBGTK)
AC_SUBST(LIBGIMP)
CPPFLAGS="${CPPFLAGS} -DPATH_SANE_CONFIG_DIR=\$(configdir) \
	  -DPATH_SANE_DATA_DIR=\$(datadir) \
	  -DV_MAJOR=${V_MAJOR} -DV_MINOR=${V_MINOR}"

if test "${ac_cv_header_sys_scanio_h}" = "no"; then
  echo "disabling PINT backend"
  PINT=
else
  echo "enabling PINT backend"
  PINT=pint
fi
AC_SUBST(PINT)
if test "${ac_cv_func_ioperm}" = "no"; then
  echo "disabling QuickCam backend"
  QCAM=
else
  echo "enabling QuickCam backend"
  QCAM=qcam
fi
AC_SUBST(QCAM)
if test "${ac_cv_header_sys_socket_h}" = "no"; then
  echo "disabling NET backend"
  NET=
  SANED=
else
  echo "enabling NET backend"
  NET=net
  SANED=saned
fi
AC_SUBST(NET)
AC_SUBST(SANED)
if test "${enable_shared}" = "no"; then
  enable_preload=yes
fi
if test "${enable_dynamic}" = no || test "${enable_preload}" = "yes"; then
  echo "preloading backends into DLL"
  DLL_PRELOAD="\$(PRELOADABLE_BACKENDS)"
else
  DLL_PRELOAD=""
fi
AC_SUBST(V_MAJOR)
AC_SUBST(V_MINOR)
AC_SUBST(DLL_PRELOAD)

AC_OUTPUT([Makefile lib/Makefile sanei/Makefile frontend/Makefile
	   japi/Makefile backend/Makefile include/Makefile doc/Makefile
	   tools/Makefile],)

echo "****************************************************************"
echo "* Please be sure to read file PROBLEMS in this directory       *"
echo "* BEFORE running any of the SANE applications.  Some devices   *"
echo "* may be damaged by inproper operation, so please do heed this *"
echo "* advice.                                                      *"
echo "****************************************************************"