-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathconfigure.in
159 lines (142 loc) · 5.12 KB
/
configure.in
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
AC_INIT(ijs.c)
IJS_VERSION=0.35
AC_SUBST(IJS_VERSION)
AC_PROG_CC
BID_OBJS="epl_57interpret.o epl_59interpret.o epl_62interpret.o"
# Prepare to check for USB support.
# Check for OS USB support
os=`uname -s`
AC_MSG_CHECKING(for OS USB support)
AC_ARG_WITH(kernelusb, [ --without-kernelusb disable kernel USB device support
--with-kernelusb enable kernel USB device support])
if test "$with_kernelusb" != no ; then
if test "$os" = Linux ; then
uname=`uname -r`
#before 1st dot
major=${uname%%.*}
#after 1st dot
minor_plus=${uname#$major.}
#before 1st fot in minor_plus
minor=${minor_plus%%.*}
#after 1st dot in minor_plus
patch=${minor_plus#$minor.}
#remove everything after dash and . - some newer kernels have extra levels
patch=${patch%%-*}
patch=${patch%%.*}
#only accepts 3.x+, 2.6.x+, 2.5.7+ , 2.4.19+
if test "$major" -ge 3 \
-o "$major" -eq 2 -a "$minor" -ge 6 \
-o "$major" -eq 2 -a "$minor" -eq 5 -a "$patch" -ge 7 \
-o "$major" -eq 2 -a "$minor" -eq 4 -a "$patch" -ge 19 \
-o "$with_kernelusb" = yes ; then
HAVE_KERNEL_USB_DEVICE=-DHAVE_KERNEL_USB_DEVICE
KUSB_EXTRA_OBJS=epl_utils_kusb.o
BID_EXTRA_OBJS=${BID_OBJS}
if test "$with_kernelusb" = yes ; then
AC_MSG_RESULT(Linux ${major}.${minor}.${patch} - configured to yes - I hope you know what you are doing, not using auto)
else
AC_MSG_RESULT(Linux ${major}.${minor}.${patch} ... seems good.)
fi
else
AC_MSG_RESULT(Linux ${major}.${minor}.${patch} ... incompatible - too old?)
fi
else
AC_MSG_RESULT(Not Linux. Disabling option.)
fi
else
AC_MSG_RESULT(Not checked.)
fi
# Check for libusb support (needed for composite USB support
# on Linux and for all USB support on non-Linux systems).
AC_ARG_WITH(libusb,[ --with-libusb enable libusb support (requires libusb sub-directory)
--without-libusb disable libusb and full-feature USB support])
AC_MSG_CHECKING(for libusb)
if test "$with_libusb" != no -a -d libusb -a -f libusb/usb.h ; then
HAVE_LIBUSB="-DHAVE_LIBUSB -D_SVID_SOURCE"
LIBUSB_EXTRA_LDPATH=-L./libusb/.libs
LIBUSB_EXTRA_LDLIBS=-lusb
LIBUSB_EXTRA_DEPS=libusb/.libs/libusb.a
LIBUSB_EXTRA_OBJS=epl_utils_libusb.o
LIBUSB_EXTRA_BINS=
BID_EXTRA_OBJS=${BID_OBJS}
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
# Check for OS IEEE1284 support
AC_MSG_CHECKING(for OS 1284 support)
AC_ARG_WITH(kernel1284, [ --without-kernel1284 disable kernel ieee1284 device support
--with-kernel1284 enable kernel ieee1284 device support])
if test "$with_kernel1284" != no ; then
#the autoprobe file is a sign of os 1284 config. may be version dependent.
if test "$os" = Linux -a -f /proc/sys/dev/parport/parport0/autoprobe ; then
HAVE_KERNEL_1284=-DHAVE_KERNEL_1284
BID_EXTRA_OBJS=${BID_OBJS}
AC_MSG_RESULT(yes, kernel built with IEEE 1284 support)
else
AC_MSG_RESULT(OS doesn't seem to have IEEE 1284 support)
fi
else
AC_MSG_RESULT(Not checked.)
fi
# Check for libieee1284 support (needed for status info through parallel port
# on Linux and for bid-dir parallel port support on non-Linux systems).
AC_ARG_WITH(libieee1284,[ --with-libieee1284 enable libieee1284 support (requires libieee1284 sub-directory)
--without-libieee1284 disable libieee1284 and full-feature parallel port support])
AC_MSG_CHECKING(for libieee1284)
if test "$with_libieee1284" != no -a -d libieee1284 -a -f libieee1284/include/ieee1284.h ; then
HAVE_LIBIEEE1284="-DHAVE_LIBIEEE1284"
LIBIEEE1284_EXTRA_LDPATH=-L./libieee1284/.libs
LIBIEEE1284_EXTRA_LDLIBS=-lieee1284
LIBIEEE1284_EXTRA_DEPS=libieee1284/.libs/libieee1284.a
LIBIEEE1284_EXTRA_OBJS=epl_utils_libieee1284.o
LIBIEEE1284_EXTRA_BINS=
BID_EXTRA_OBJS=${BID_OBJS}
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
# build dummy transport support
AC_ARG_WITH(nulltransport,[ --with-nulltransport enable null transport debugging code
--without-nulltransport disable null transport debugging code])
AC_MSG_CHECKING(for null transport)
if test "$with_nulltransport" != no; then
HAVE_NULLTRANS="-DHAVE_NULLTRANS"
NULLTRANS_EXTRA_OBJS=epl_utils_null.o
BID_EXTRA_OBJS=${BID_OBJS}
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
#may want to check to `uname -o` = Solaris one day.
AC_MSG_CHECKING(for solaris-specific requirements)
if test "$os" = SunOS ; then
AC_MSG_RESULT(yes)
SOLARIS_EXTRA_LDLIBS=-lrt
else
AC_MSG_RESULT(no)
SOLARIS_EXTRA_LDLIBS=
fi
AC_SUBST(HAVE_KERNEL_USB_DEVICE)
AC_SUBST(HAVE_KERNEL_1284)
AC_SUBST(HAVE_LIBIEEE1284)
AC_SUBST(HAVE_LIBUSB)
AC_SUBST(HAVE_NULLTRANS)
AC_SUBST(KUSB_EXTRA_OBJS)
AC_SUBST(LIBUSB_EXTRA_LDPATH)
AC_SUBST(LIBUSB_EXTRA_LDLIBS)
AC_SUBST(LIBUSB_EXTRA_OBJS)
AC_SUBST(LIBUSB_EXTRA_DEPS)
AC_SUBST(LIBUSB_EXTRA_BINS)
AC_SUBST(LIBIEEE1284_EXTRA_LDPATH)
AC_SUBST(LIBIEEE1284_EXTRA_LDLIBS)
AC_SUBST(LIBIEEE1284_EXTRA_OBJS)
AC_SUBST(LIBIEEE1284_EXTRA_DEPS)
AC_SUBST(LIBIEEE1284_EXTRA_BINS)
AC_SUBST(NULLTRANS_EXTRA_OBJS)
AC_SUBST(BID_EXTRA_OBJS)
AC_SUBST(SOLARIS_EXTRA_LDLIBS)
AC_PROG_RANLIB
AC_PROG_INSTALL
AC_OUTPUT(Makefile
ijs-config, [case "$CONFIG_FILES" in *ijs-config*) chmod +x ijs-config;; esac])