##// END OF EJS Templates
some linux bug fixes, added timeouts for read actions
jeandet -
r12:1b7c273d222a alexis
parent child
Show More
@@ -1,19 +1,19
1 lib_LTLIBRARIES = librs232-@RS232_API_VERSION@.la
1 lib_LTLIBRARIES = librs232-@RS232_API_VERSION@.la
2
2
3
3
4 librs232_@RS232_API_VERSION@_la_LDFLAGS = -no-undefined -version-info $(RS232_SO_VERSION)
4 librs232_@RS232_API_VERSION@_la_LDFLAGS = -no-undefined -fPIC -version-info $(RS232_SO_VERSION)
5
5
6 rs232_includedir = $(includedir)/rs232-$(RS232_API_VERSION)
6 rs232_includedir = $(includedir)/rs232-$(RS232_API_VERSION)
7
7
8
8
9 rs232_libincludedir = $(libdir)/rs232-$(RS232_API_VERSION)/include
9 rs232_libincludedir = $(libdir)/rs232-$(RS232_API_VERSION)/include
10
10
11 librs232_@RS232_API_VERSION@_la_SOURCES = \
11 librs232_@RS232_API_VERSION@_la_SOURCES = \
12 RS232_unix.c \
12 RS232_unix.c \
13 RS232_win.c
13 RS232_win.c
14
14
15 include_HEADERS = RS232.h rs232config.h
15 include_HEADERS = RS232.h rs232config.h
16
16
17
17
18 pkgconfigdir = $(libdir)/pkgconfig
18 pkgconfigdir = $(libdir)/pkgconfig
19 pkgconfig_DATA = ../rs232-@RS232_API_VERSION@.pc
19 pkgconfig_DATA = ../rs232-@RS232_API_VERSION@.pc
@@ -1,598 +1,599
1 # Makefile.in generated by automake 1.11.1 from Makefile.am.
1 # Makefile.in generated by automake 1.11.1 from Makefile.am.
2 # @configure_input@
2 # @configure_input@
3
3
4 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
4 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
5 # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
5 # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
6 # Inc.
6 # Inc.
7 # This Makefile.in is free software; the Free Software Foundation
7 # This Makefile.in is free software; the Free Software Foundation
8 # gives unlimited permission to copy and/or distribute it,
8 # gives unlimited permission to copy and/or distribute it,
9 # with or without modifications, as long as this notice is preserved.
9 # with or without modifications, as long as this notice is preserved.
10
10
11 # This program is distributed in the hope that it will be useful,
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
12 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
13 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14 # PARTICULAR PURPOSE.
14 # PARTICULAR PURPOSE.
15
15
16 @SET_MAKE@
16 @SET_MAKE@
17
17
18
18
19
19
20 VPATH = @srcdir@
20 VPATH = @srcdir@
21 pkgdatadir = $(datadir)/@PACKAGE@
21 pkgdatadir = $(datadir)/@PACKAGE@
22 pkgincludedir = $(includedir)/@PACKAGE@
22 pkgincludedir = $(includedir)/@PACKAGE@
23 pkglibdir = $(libdir)/@PACKAGE@
23 pkglibdir = $(libdir)/@PACKAGE@
24 pkglibexecdir = $(libexecdir)/@PACKAGE@
24 pkglibexecdir = $(libexecdir)/@PACKAGE@
25 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
25 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
26 install_sh_DATA = $(install_sh) -c -m 644
26 install_sh_DATA = $(install_sh) -c -m 644
27 install_sh_PROGRAM = $(install_sh) -c
27 install_sh_PROGRAM = $(install_sh) -c
28 install_sh_SCRIPT = $(install_sh) -c
28 install_sh_SCRIPT = $(install_sh) -c
29 INSTALL_HEADER = $(INSTALL_DATA)
29 INSTALL_HEADER = $(INSTALL_DATA)
30 transform = $(program_transform_name)
30 transform = $(program_transform_name)
31 NORMAL_INSTALL = :
31 NORMAL_INSTALL = :
32 PRE_INSTALL = :
32 PRE_INSTALL = :
33 POST_INSTALL = :
33 POST_INSTALL = :
34 NORMAL_UNINSTALL = :
34 NORMAL_UNINSTALL = :
35 PRE_UNINSTALL = :
35 PRE_UNINSTALL = :
36 POST_UNINSTALL = :
36 POST_UNINSTALL = :
37 build_triplet = @build@
37 build_triplet = @build@
38 host_triplet = @host@
38 host_triplet = @host@
39 subdir = src
39 subdir = src
40 DIST_COMMON = $(include_HEADERS) $(srcdir)/Makefile.am \
40 DIST_COMMON = $(include_HEADERS) $(srcdir)/Makefile.am \
41 $(srcdir)/Makefile.in $(srcdir)/rs232config.h.in
41 $(srcdir)/Makefile.in $(srcdir)/rs232config.h.in
42 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
42 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
43 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
43 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
44 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
44 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
45 $(ACLOCAL_M4)
45 $(ACLOCAL_M4)
46 mkinstalldirs = $(install_sh) -d
46 mkinstalldirs = $(install_sh) -d
47 CONFIG_HEADER = rs232config.h
47 CONFIG_HEADER = rs232config.h
48 CONFIG_CLEAN_FILES =
48 CONFIG_CLEAN_FILES =
49 CONFIG_CLEAN_VPATH_FILES =
49 CONFIG_CLEAN_VPATH_FILES =
50 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
50 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
51 am__vpath_adj = case $$p in \
51 am__vpath_adj = case $$p in \
52 $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
52 $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
53 *) f=$$p;; \
53 *) f=$$p;; \
54 esac;
54 esac;
55 am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
55 am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
56 am__install_max = 40
56 am__install_max = 40
57 am__nobase_strip_setup = \
57 am__nobase_strip_setup = \
58 srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
58 srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
59 am__nobase_strip = \
59 am__nobase_strip = \
60 for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
60 for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
61 am__nobase_list = $(am__nobase_strip_setup); \
61 am__nobase_list = $(am__nobase_strip_setup); \
62 for p in $$list; do echo "$$p $$p"; done | \
62 for p in $$list; do echo "$$p $$p"; done | \
63 sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
63 sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
64 $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
64 $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
65 if (++n[$$2] == $(am__install_max)) \
65 if (++n[$$2] == $(am__install_max)) \
66 { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
66 { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
67 END { for (dir in files) print dir, files[dir] }'
67 END { for (dir in files) print dir, files[dir] }'
68 am__base_list = \
68 am__base_list = \
69 sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
69 sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
70 sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
70 sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
71 am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)" \
71 am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)" \
72 "$(DESTDIR)$(includedir)"
72 "$(DESTDIR)$(includedir)"
73 LTLIBRARIES = $(lib_LTLIBRARIES)
73 LTLIBRARIES = $(lib_LTLIBRARIES)
74 librs232_@RS232_API_VERSION@_la_LIBADD =
74 librs232_@RS232_API_VERSION@_la_LIBADD =
75 am_librs232_@RS232_API_VERSION@_la_OBJECTS = RS232_unix.lo \
75 am_librs232_@RS232_API_VERSION@_la_OBJECTS = RS232_unix.lo \
76 RS232_win.lo
76 RS232_win.lo
77 librs232_@RS232_API_VERSION@_la_OBJECTS = \
77 librs232_@RS232_API_VERSION@_la_OBJECTS = \
78 $(am_librs232_@RS232_API_VERSION@_la_OBJECTS)
78 $(am_librs232_@RS232_API_VERSION@_la_OBJECTS)
79 librs232_@RS232_API_VERSION@_la_LINK = $(LIBTOOL) --tag=CC \
79 librs232_@RS232_API_VERSION@_la_LINK = $(LIBTOOL) --tag=CC \
80 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
80 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
81 $(AM_CFLAGS) $(CFLAGS) \
81 $(AM_CFLAGS) $(CFLAGS) \
82 $(librs232_@RS232_API_VERSION@_la_LDFLAGS) $(LDFLAGS) -o $@
82 $(librs232_@RS232_API_VERSION@_la_LDFLAGS) $(LDFLAGS) -o $@
83 DEFAULT_INCLUDES = -I.@am__isrc@
83 DEFAULT_INCLUDES = -I.@am__isrc@
84 depcomp = $(SHELL) $(top_srcdir)/depcomp
84 depcomp = $(SHELL) $(top_srcdir)/depcomp
85 am__depfiles_maybe = depfiles
85 am__depfiles_maybe = depfiles
86 am__mv = mv -f
86 am__mv = mv -f
87 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
87 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
88 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
88 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
89 LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
89 LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
90 --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
90 --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
91 $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
91 $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
92 CCLD = $(CC)
92 CCLD = $(CC)
93 LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
93 LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
94 --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
94 --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
95 $(LDFLAGS) -o $@
95 $(LDFLAGS) -o $@
96 SOURCES = $(librs232_@RS232_API_VERSION@_la_SOURCES)
96 SOURCES = $(librs232_@RS232_API_VERSION@_la_SOURCES)
97 DIST_SOURCES = $(librs232_@RS232_API_VERSION@_la_SOURCES)
97 DIST_SOURCES = $(librs232_@RS232_API_VERSION@_la_SOURCES)
98 DATA = $(pkgconfig_DATA)
98 DATA = $(pkgconfig_DATA)
99 HEADERS = $(include_HEADERS)
99 HEADERS = $(include_HEADERS)
100 ETAGS = etags
100 ETAGS = etags
101 CTAGS = ctags
101 CTAGS = ctags
102 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
102 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
103 ACLOCAL = @ACLOCAL@
103 ACLOCAL = @ACLOCAL@
104 AMTAR = @AMTAR@
104 AMTAR = @AMTAR@
105 AR = @AR@
105 AR = @AR@
106 AS = @AS@
106 AS = @AS@
107 AUTOCONF = @AUTOCONF@
107 AUTOCONF = @AUTOCONF@
108 AUTOHEADER = @AUTOHEADER@
108 AUTOHEADER = @AUTOHEADER@
109 AUTOMAKE = @AUTOMAKE@
109 AUTOMAKE = @AUTOMAKE@
110 AWK = @AWK@
110 AWK = @AWK@
111 CC = @CC@
111 CC = @CC@
112 CCDEPMODE = @CCDEPMODE@
112 CCDEPMODE = @CCDEPMODE@
113 CFLAGS = @CFLAGS@
113 CFLAGS = @CFLAGS@
114 CPP = @CPP@
114 CPP = @CPP@
115 CPPFLAGS = @CPPFLAGS@
115 CPPFLAGS = @CPPFLAGS@
116 CYGPATH_W = @CYGPATH_W@
116 CYGPATH_W = @CYGPATH_W@
117 DEFS = @DEFS@
117 DEFS = @DEFS@
118 DEPDIR = @DEPDIR@
118 DEPDIR = @DEPDIR@
119 DLLTOOL = @DLLTOOL@
119 DLLTOOL = @DLLTOOL@
120 DSYMUTIL = @DSYMUTIL@
120 DSYMUTIL = @DSYMUTIL@
121 DUMPBIN = @DUMPBIN@
121 DUMPBIN = @DUMPBIN@
122 ECHO_C = @ECHO_C@
122 ECHO_C = @ECHO_C@
123 ECHO_N = @ECHO_N@
123 ECHO_N = @ECHO_N@
124 ECHO_T = @ECHO_T@
124 ECHO_T = @ECHO_T@
125 EGREP = @EGREP@
125 EGREP = @EGREP@
126 EXEEXT = @EXEEXT@
126 EXEEXT = @EXEEXT@
127 FGREP = @FGREP@
127 FGREP = @FGREP@
128 GREP = @GREP@
128 GREP = @GREP@
129 INSTALL = @INSTALL@
129 INSTALL = @INSTALL@
130 INSTALL_DATA = @INSTALL_DATA@
130 INSTALL_DATA = @INSTALL_DATA@
131 INSTALL_PROGRAM = @INSTALL_PROGRAM@
131 INSTALL_PROGRAM = @INSTALL_PROGRAM@
132 INSTALL_SCRIPT = @INSTALL_SCRIPT@
132 INSTALL_SCRIPT = @INSTALL_SCRIPT@
133 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
133 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
134 LD = @LD@
134 LD = @LD@
135 LDFLAGS = @LDFLAGS@
135 LDFLAGS = @LDFLAGS@
136 LIBOBJS = @LIBOBJS@
136 LIBOBJS = @LIBOBJS@
137 LIBS = @LIBS@
137 LIBS = @LIBS@
138 LIBTOOL = @LIBTOOL@
138 LIBTOOL = @LIBTOOL@
139 LIPO = @LIPO@
139 LIPO = @LIPO@
140 LN_S = @LN_S@
140 LN_S = @LN_S@
141 LTLIBOBJS = @LTLIBOBJS@
141 LTLIBOBJS = @LTLIBOBJS@
142 MAKEINFO = @MAKEINFO@
142 MAKEINFO = @MAKEINFO@
143 MANIFEST_TOOL = @MANIFEST_TOOL@
143 MKDIR_P = @MKDIR_P@
144 MKDIR_P = @MKDIR_P@
144 NM = @NM@
145 NM = @NM@
145 NMEDIT = @NMEDIT@
146 NMEDIT = @NMEDIT@
146 OBJDUMP = @OBJDUMP@
147 OBJDUMP = @OBJDUMP@
147 OBJEXT = @OBJEXT@
148 OBJEXT = @OBJEXT@
148 OTOOL = @OTOOL@
149 OTOOL = @OTOOL@
149 OTOOL64 = @OTOOL64@
150 OTOOL64 = @OTOOL64@
150 PACKAGE = @PACKAGE@
151 PACKAGE = @PACKAGE@
151 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
152 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
152 PACKAGE_NAME = @PACKAGE_NAME@
153 PACKAGE_NAME = @PACKAGE_NAME@
153 PACKAGE_STRING = @PACKAGE_STRING@
154 PACKAGE_STRING = @PACKAGE_STRING@
154 PACKAGE_TARNAME = @PACKAGE_TARNAME@
155 PACKAGE_TARNAME = @PACKAGE_TARNAME@
155 PACKAGE_URL = @PACKAGE_URL@
156 PACKAGE_URL = @PACKAGE_URL@
156 PACKAGE_VERSION = @PACKAGE_VERSION@
157 PACKAGE_VERSION = @PACKAGE_VERSION@
157 PATH_SEPARATOR = @PATH_SEPARATOR@
158 PATH_SEPARATOR = @PATH_SEPARATOR@
158 RANLIB = @RANLIB@
159 RANLIB = @RANLIB@
159 RS232_API_VERSION = @RS232_API_VERSION@
160 RS232_API_VERSION = @RS232_API_VERSION@
160 RS232_SO_VERSION = @RS232_SO_VERSION@
161 RS232_SO_VERSION = @RS232_SO_VERSION@
161 SED = @SED@
162 SED = @SED@
162 SET_MAKE = @SET_MAKE@
163 SET_MAKE = @SET_MAKE@
163 SHELL = @SHELL@
164 SHELL = @SHELL@
164 STRIP = @STRIP@
165 STRIP = @STRIP@
165 VERSION = @VERSION@
166 VERSION = @VERSION@
166 abs_builddir = @abs_builddir@
167 abs_builddir = @abs_builddir@
167 abs_srcdir = @abs_srcdir@
168 abs_srcdir = @abs_srcdir@
168 abs_top_builddir = @abs_top_builddir@
169 abs_top_builddir = @abs_top_builddir@
169 abs_top_srcdir = @abs_top_srcdir@
170 abs_top_srcdir = @abs_top_srcdir@
171 ac_ct_AR = @ac_ct_AR@
170 ac_ct_CC = @ac_ct_CC@
172 ac_ct_CC = @ac_ct_CC@
171 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
173 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
172 am__include = @am__include@
174 am__include = @am__include@
173 am__leading_dot = @am__leading_dot@
175 am__leading_dot = @am__leading_dot@
174 am__quote = @am__quote@
176 am__quote = @am__quote@
175 am__tar = @am__tar@
177 am__tar = @am__tar@
176 am__untar = @am__untar@
178 am__untar = @am__untar@
177 bindir = @bindir@
179 bindir = @bindir@
178 build = @build@
180 build = @build@
179 build_alias = @build_alias@
181 build_alias = @build_alias@
180 build_cpu = @build_cpu@
182 build_cpu = @build_cpu@
181 build_os = @build_os@
183 build_os = @build_os@
182 build_vendor = @build_vendor@
184 build_vendor = @build_vendor@
183 builddir = @builddir@
185 builddir = @builddir@
184 datadir = @datadir@
186 datadir = @datadir@
185 datarootdir = @datarootdir@
187 datarootdir = @datarootdir@
186 docdir = @docdir@
188 docdir = @docdir@
187 dvidir = @dvidir@
189 dvidir = @dvidir@
188 exec_prefix = @exec_prefix@
190 exec_prefix = @exec_prefix@
189 host = @host@
191 host = @host@
190 host_alias = @host_alias@
192 host_alias = @host_alias@
191 host_cpu = @host_cpu@
193 host_cpu = @host_cpu@
192 host_os = @host_os@
194 host_os = @host_os@
193 host_vendor = @host_vendor@
195 host_vendor = @host_vendor@
194 htmldir = @htmldir@
196 htmldir = @htmldir@
195 includedir = @includedir@
197 includedir = @includedir@
196 infodir = @infodir@
198 infodir = @infodir@
197 install_sh = @install_sh@
199 install_sh = @install_sh@
198 libdir = @libdir@
200 libdir = @libdir@
199 libexecdir = @libexecdir@
201 libexecdir = @libexecdir@
200 localedir = @localedir@
202 localedir = @localedir@
201 localstatedir = @localstatedir@
203 localstatedir = @localstatedir@
202 lt_ECHO = @lt_ECHO@
203 mandir = @mandir@
204 mandir = @mandir@
204 mkdir_p = @mkdir_p@
205 mkdir_p = @mkdir_p@
205 oldincludedir = @oldincludedir@
206 oldincludedir = @oldincludedir@
206 pdfdir = @pdfdir@
207 pdfdir = @pdfdir@
207 prefix = @prefix@
208 prefix = @prefix@
208 program_transform_name = @program_transform_name@
209 program_transform_name = @program_transform_name@
209 psdir = @psdir@
210 psdir = @psdir@
210 sbindir = @sbindir@
211 sbindir = @sbindir@
211 sharedstatedir = @sharedstatedir@
212 sharedstatedir = @sharedstatedir@
212 srcdir = @srcdir@
213 srcdir = @srcdir@
213 sysconfdir = @sysconfdir@
214 sysconfdir = @sysconfdir@
214 target_alias = @target_alias@
215 target_alias = @target_alias@
215 top_build_prefix = @top_build_prefix@
216 top_build_prefix = @top_build_prefix@
216 top_builddir = @top_builddir@
217 top_builddir = @top_builddir@
217 top_srcdir = @top_srcdir@
218 top_srcdir = @top_srcdir@
218 lib_LTLIBRARIES = librs232-@RS232_API_VERSION@.la
219 lib_LTLIBRARIES = librs232-@RS232_API_VERSION@.la
219 librs232_@RS232_API_VERSION@_la_LDFLAGS = -no-undefined -version-info $(RS232_SO_VERSION)
220 librs232_@RS232_API_VERSION@_la_LDFLAGS = -no-undefined -fPIC -version-info $(RS232_SO_VERSION)
220 rs232_includedir = $(includedir)/rs232-$(RS232_API_VERSION)
221 rs232_includedir = $(includedir)/rs232-$(RS232_API_VERSION)
221 rs232_libincludedir = $(libdir)/rs232-$(RS232_API_VERSION)/include
222 rs232_libincludedir = $(libdir)/rs232-$(RS232_API_VERSION)/include
222 librs232_@RS232_API_VERSION@_la_SOURCES = \
223 librs232_@RS232_API_VERSION@_la_SOURCES = \
223 RS232_unix.c \
224 RS232_unix.c \
224 RS232_win.c
225 RS232_win.c
225
226
226 include_HEADERS = RS232.h rs232config.h
227 include_HEADERS = RS232.h rs232config.h
227 pkgconfigdir = $(libdir)/pkgconfig
228 pkgconfigdir = $(libdir)/pkgconfig
228 pkgconfig_DATA = ../rs232-@RS232_API_VERSION@.pc
229 pkgconfig_DATA = ../rs232-@RS232_API_VERSION@.pc
229 all: rs232config.h
230 all: rs232config.h
230 $(MAKE) $(AM_MAKEFLAGS) all-am
231 $(MAKE) $(AM_MAKEFLAGS) all-am
231
232
232 .SUFFIXES:
233 .SUFFIXES:
233 .SUFFIXES: .c .lo .o .obj
234 .SUFFIXES: .c .lo .o .obj
234 $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
235 $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
235 @for dep in $?; do \
236 @for dep in $?; do \
236 case '$(am__configure_deps)' in \
237 case '$(am__configure_deps)' in \
237 *$$dep*) \
238 *$$dep*) \
238 ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
239 ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
239 && { if test -f $@; then exit 0; else break; fi; }; \
240 && { if test -f $@; then exit 0; else break; fi; }; \
240 exit 1;; \
241 exit 1;; \
241 esac; \
242 esac; \
242 done; \
243 done; \
243 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \
244 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \
244 $(am__cd) $(top_srcdir) && \
245 $(am__cd) $(top_srcdir) && \
245 $(AUTOMAKE) --foreign src/Makefile
246 $(AUTOMAKE) --foreign src/Makefile
246 .PRECIOUS: Makefile
247 .PRECIOUS: Makefile
247 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
248 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
248 @case '$?' in \
249 @case '$?' in \
249 *config.status*) \
250 *config.status*) \
250 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
251 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
251 *) \
252 *) \
252 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
253 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
253 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
254 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
254 esac;
255 esac;
255
256
256 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
257 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
257 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
258 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
258
259
259 $(top_srcdir)/configure: $(am__configure_deps)
260 $(top_srcdir)/configure: $(am__configure_deps)
260 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
261 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
261 $(ACLOCAL_M4): $(am__aclocal_m4_deps)
262 $(ACLOCAL_M4): $(am__aclocal_m4_deps)
262 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
263 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
263 $(am__aclocal_m4_deps):
264 $(am__aclocal_m4_deps):
264
265
265 rs232config.h: stamp-h1
266 rs232config.h: stamp-h1
266 @if test ! -f $@; then \
267 @if test ! -f $@; then \
267 rm -f stamp-h1; \
268 rm -f stamp-h1; \
268 $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \
269 $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \
269 else :; fi
270 else :; fi
270
271
271 stamp-h1: $(srcdir)/rs232config.h.in $(top_builddir)/config.status
272 stamp-h1: $(srcdir)/rs232config.h.in $(top_builddir)/config.status
272 @rm -f stamp-h1
273 @rm -f stamp-h1
273 cd $(top_builddir) && $(SHELL) ./config.status src/rs232config.h
274 cd $(top_builddir) && $(SHELL) ./config.status src/rs232config.h
274 $(srcdir)/rs232config.h.in: $(am__configure_deps)
275 $(srcdir)/rs232config.h.in: $(am__configure_deps)
275 ($(am__cd) $(top_srcdir) && $(AUTOHEADER))
276 ($(am__cd) $(top_srcdir) && $(AUTOHEADER))
276 rm -f stamp-h1
277 rm -f stamp-h1
277 touch $@
278 touch $@
278
279
279 distclean-hdr:
280 distclean-hdr:
280 -rm -f rs232config.h stamp-h1
281 -rm -f rs232config.h stamp-h1
281 install-libLTLIBRARIES: $(lib_LTLIBRARIES)
282 install-libLTLIBRARIES: $(lib_LTLIBRARIES)
282 @$(NORMAL_INSTALL)
283 @$(NORMAL_INSTALL)
283 test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
284 test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
284 @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
285 @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
285 list2=; for p in $$list; do \
286 list2=; for p in $$list; do \
286 if test -f $$p; then \
287 if test -f $$p; then \
287 list2="$$list2 $$p"; \
288 list2="$$list2 $$p"; \
288 else :; fi; \
289 else :; fi; \
289 done; \
290 done; \
290 test -z "$$list2" || { \
291 test -z "$$list2" || { \
291 echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
292 echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
292 $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
293 $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
293 }
294 }
294
295
295 uninstall-libLTLIBRARIES:
296 uninstall-libLTLIBRARIES:
296 @$(NORMAL_UNINSTALL)
297 @$(NORMAL_UNINSTALL)
297 @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
298 @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
298 for p in $$list; do \
299 for p in $$list; do \
299 $(am__strip_dir) \
300 $(am__strip_dir) \
300 echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
301 echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
301 $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
302 $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
302 done
303 done
303
304
304 clean-libLTLIBRARIES:
305 clean-libLTLIBRARIES:
305 -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
306 -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
306 @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
307 @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
307 dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
308 dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
308 test "$$dir" != "$$p" || dir=.; \
309 test "$$dir" != "$$p" || dir=.; \
309 echo "rm -f \"$${dir}/so_locations\""; \
310 echo "rm -f \"$${dir}/so_locations\""; \
310 rm -f "$${dir}/so_locations"; \
311 rm -f "$${dir}/so_locations"; \
311 done
312 done
312 librs232-@RS232_API_VERSION@.la: $(librs232_@RS232_API_VERSION@_la_OBJECTS) $(librs232_@RS232_API_VERSION@_la_DEPENDENCIES)
313 librs232-@RS232_API_VERSION@.la: $(librs232_@RS232_API_VERSION@_la_OBJECTS) $(librs232_@RS232_API_VERSION@_la_DEPENDENCIES)
313 $(librs232_@RS232_API_VERSION@_la_LINK) -rpath $(libdir) $(librs232_@RS232_API_VERSION@_la_OBJECTS) $(librs232_@RS232_API_VERSION@_la_LIBADD) $(LIBS)
314 $(librs232_@RS232_API_VERSION@_la_LINK) -rpath $(libdir) $(librs232_@RS232_API_VERSION@_la_OBJECTS) $(librs232_@RS232_API_VERSION@_la_LIBADD) $(LIBS)
314
315
315 mostlyclean-compile:
316 mostlyclean-compile:
316 -rm -f *.$(OBJEXT)
317 -rm -f *.$(OBJEXT)
317
318
318 distclean-compile:
319 distclean-compile:
319 -rm -f *.tab.c
320 -rm -f *.tab.c
320
321
321 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RS232_unix.Plo@am__quote@
322 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RS232_unix.Plo@am__quote@
322 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RS232_win.Plo@am__quote@
323 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RS232_win.Plo@am__quote@
323
324
324 .c.o:
325 .c.o:
325 @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
326 @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
326 @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
327 @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
327 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
328 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
328 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
329 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
329 @am__fastdepCC_FALSE@ $(COMPILE) -c $<
330 @am__fastdepCC_FALSE@ $(COMPILE) -c $<
330
331
331 .c.obj:
332 .c.obj:
332 @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
333 @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
333 @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
334 @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
334 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
335 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
335 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
336 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
336 @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
337 @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
337
338
338 .c.lo:
339 .c.lo:
339 @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
340 @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
340 @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
341 @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
341 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
342 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
342 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
343 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
343 @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
344 @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
344
345
345 mostlyclean-libtool:
346 mostlyclean-libtool:
346 -rm -f *.lo
347 -rm -f *.lo
347
348
348 clean-libtool:
349 clean-libtool:
349 -rm -rf .libs _libs
350 -rm -rf .libs _libs
350 install-pkgconfigDATA: $(pkgconfig_DATA)
351 install-pkgconfigDATA: $(pkgconfig_DATA)
351 @$(NORMAL_INSTALL)
352 @$(NORMAL_INSTALL)
352 test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)"
353 test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)"
353 @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
354 @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
354 for p in $$list; do \
355 for p in $$list; do \
355 if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
356 if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
356 echo "$$d$$p"; \
357 echo "$$d$$p"; \
357 done | $(am__base_list) | \
358 done | $(am__base_list) | \
358 while read files; do \
359 while read files; do \
359 echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \
360 echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \
360 $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \
361 $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \
361 done
362 done
362
363
363 uninstall-pkgconfigDATA:
364 uninstall-pkgconfigDATA:
364 @$(NORMAL_UNINSTALL)
365 @$(NORMAL_UNINSTALL)
365 @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
366 @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
366 files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
367 files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
367 test -n "$$files" || exit 0; \
368 test -n "$$files" || exit 0; \
368 echo " ( cd '$(DESTDIR)$(pkgconfigdir)' && rm -f" $$files ")"; \
369 echo " ( cd '$(DESTDIR)$(pkgconfigdir)' && rm -f" $$files ")"; \
369 cd "$(DESTDIR)$(pkgconfigdir)" && rm -f $$files
370 cd "$(DESTDIR)$(pkgconfigdir)" && rm -f $$files
370 install-includeHEADERS: $(include_HEADERS)
371 install-includeHEADERS: $(include_HEADERS)
371 @$(NORMAL_INSTALL)
372 @$(NORMAL_INSTALL)
372 test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)"
373 test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)"
373 @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
374 @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
374 for p in $$list; do \
375 for p in $$list; do \
375 if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
376 if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
376 echo "$$d$$p"; \
377 echo "$$d$$p"; \
377 done | $(am__base_list) | \
378 done | $(am__base_list) | \
378 while read files; do \
379 while read files; do \
379 echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \
380 echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \
380 $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \
381 $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \
381 done
382 done
382
383
383 uninstall-includeHEADERS:
384 uninstall-includeHEADERS:
384 @$(NORMAL_UNINSTALL)
385 @$(NORMAL_UNINSTALL)
385 @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
386 @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
386 files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
387 files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
387 test -n "$$files" || exit 0; \
388 test -n "$$files" || exit 0; \
388 echo " ( cd '$(DESTDIR)$(includedir)' && rm -f" $$files ")"; \
389 echo " ( cd '$(DESTDIR)$(includedir)' && rm -f" $$files ")"; \
389 cd "$(DESTDIR)$(includedir)" && rm -f $$files
390 cd "$(DESTDIR)$(includedir)" && rm -f $$files
390
391
391 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
392 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
392 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
393 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
393 unique=`for i in $$list; do \
394 unique=`for i in $$list; do \
394 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
395 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
395 done | \
396 done | \
396 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
397 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
397 END { if (nonempty) { for (i in files) print i; }; }'`; \
398 END { if (nonempty) { for (i in files) print i; }; }'`; \
398 mkid -fID $$unique
399 mkid -fID $$unique
399 tags: TAGS
400 tags: TAGS
400
401
401 TAGS: $(HEADERS) $(SOURCES) rs232config.h.in $(TAGS_DEPENDENCIES) \
402 TAGS: $(HEADERS) $(SOURCES) rs232config.h.in $(TAGS_DEPENDENCIES) \
402 $(TAGS_FILES) $(LISP)
403 $(TAGS_FILES) $(LISP)
403 set x; \
404 set x; \
404 here=`pwd`; \
405 here=`pwd`; \
405 list='$(SOURCES) $(HEADERS) rs232config.h.in $(LISP) $(TAGS_FILES)'; \
406 list='$(SOURCES) $(HEADERS) rs232config.h.in $(LISP) $(TAGS_FILES)'; \
406 unique=`for i in $$list; do \
407 unique=`for i in $$list; do \
407 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
408 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
408 done | \
409 done | \
409 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
410 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
410 END { if (nonempty) { for (i in files) print i; }; }'`; \
411 END { if (nonempty) { for (i in files) print i; }; }'`; \
411 shift; \
412 shift; \
412 if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
413 if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
413 test -n "$$unique" || unique=$$empty_fix; \
414 test -n "$$unique" || unique=$$empty_fix; \
414 if test $$# -gt 0; then \
415 if test $$# -gt 0; then \
415 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
416 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
416 "$$@" $$unique; \
417 "$$@" $$unique; \
417 else \
418 else \
418 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
419 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
419 $$unique; \
420 $$unique; \
420 fi; \
421 fi; \
421 fi
422 fi
422 ctags: CTAGS
423 ctags: CTAGS
423 CTAGS: $(HEADERS) $(SOURCES) rs232config.h.in $(TAGS_DEPENDENCIES) \
424 CTAGS: $(HEADERS) $(SOURCES) rs232config.h.in $(TAGS_DEPENDENCIES) \
424 $(TAGS_FILES) $(LISP)
425 $(TAGS_FILES) $(LISP)
425 list='$(SOURCES) $(HEADERS) rs232config.h.in $(LISP) $(TAGS_FILES)'; \
426 list='$(SOURCES) $(HEADERS) rs232config.h.in $(LISP) $(TAGS_FILES)'; \
426 unique=`for i in $$list; do \
427 unique=`for i in $$list; do \
427 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
428 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
428 done | \
429 done | \
429 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
430 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
430 END { if (nonempty) { for (i in files) print i; }; }'`; \
431 END { if (nonempty) { for (i in files) print i; }; }'`; \
431 test -z "$(CTAGS_ARGS)$$unique" \
432 test -z "$(CTAGS_ARGS)$$unique" \
432 || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
433 || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
433 $$unique
434 $$unique
434
435
435 GTAGS:
436 GTAGS:
436 here=`$(am__cd) $(top_builddir) && pwd` \
437 here=`$(am__cd) $(top_builddir) && pwd` \
437 && $(am__cd) $(top_srcdir) \
438 && $(am__cd) $(top_srcdir) \
438 && gtags -i $(GTAGS_ARGS) "$$here"
439 && gtags -i $(GTAGS_ARGS) "$$here"
439
440
440 distclean-tags:
441 distclean-tags:
441 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
442 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
442
443
443 distdir: $(DISTFILES)
444 distdir: $(DISTFILES)
444 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
445 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
445 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
446 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
446 list='$(DISTFILES)'; \
447 list='$(DISTFILES)'; \
447 dist_files=`for file in $$list; do echo $$file; done | \
448 dist_files=`for file in $$list; do echo $$file; done | \
448 sed -e "s|^$$srcdirstrip/||;t" \
449 sed -e "s|^$$srcdirstrip/||;t" \
449 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
450 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
450 case $$dist_files in \
451 case $$dist_files in \
451 */*) $(MKDIR_P) `echo "$$dist_files" | \
452 */*) $(MKDIR_P) `echo "$$dist_files" | \
452 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
453 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
453 sort -u` ;; \
454 sort -u` ;; \
454 esac; \
455 esac; \
455 for file in $$dist_files; do \
456 for file in $$dist_files; do \
456 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
457 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
457 if test -d $$d/$$file; then \
458 if test -d $$d/$$file; then \
458 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
459 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
459 if test -d "$(distdir)/$$file"; then \
460 if test -d "$(distdir)/$$file"; then \
460 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
461 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
461 fi; \
462 fi; \
462 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
463 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
463 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
464 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
464 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
465 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
465 fi; \
466 fi; \
466 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
467 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
467 else \
468 else \
468 test -f "$(distdir)/$$file" \
469 test -f "$(distdir)/$$file" \
469 || cp -p $$d/$$file "$(distdir)/$$file" \
470 || cp -p $$d/$$file "$(distdir)/$$file" \
470 || exit 1; \
471 || exit 1; \
471 fi; \
472 fi; \
472 done
473 done
473 check-am: all-am
474 check-am: all-am
474 check: check-am
475 check: check-am
475 all-am: Makefile $(LTLIBRARIES) $(DATA) $(HEADERS) rs232config.h
476 all-am: Makefile $(LTLIBRARIES) $(DATA) $(HEADERS) rs232config.h
476 installdirs:
477 installdirs:
477 for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(includedir)"; do \
478 for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(includedir)"; do \
478 test -z "$$dir" || $(MKDIR_P) "$$dir"; \
479 test -z "$$dir" || $(MKDIR_P) "$$dir"; \
479 done
480 done
480 install: install-am
481 install: install-am
481 install-exec: install-exec-am
482 install-exec: install-exec-am
482 install-data: install-data-am
483 install-data: install-data-am
483 uninstall: uninstall-am
484 uninstall: uninstall-am
484
485
485 install-am: all-am
486 install-am: all-am
486 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
487 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
487
488
488 installcheck: installcheck-am
489 installcheck: installcheck-am
489 install-strip:
490 install-strip:
490 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
491 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
491 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
492 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
492 `test -z '$(STRIP)' || \
493 `test -z '$(STRIP)' || \
493 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
494 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
494 mostlyclean-generic:
495 mostlyclean-generic:
495
496
496 clean-generic:
497 clean-generic:
497
498
498 distclean-generic:
499 distclean-generic:
499 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
500 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
500 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
501 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
501
502
502 maintainer-clean-generic:
503 maintainer-clean-generic:
503 @echo "This command is intended for maintainers to use"
504 @echo "This command is intended for maintainers to use"
504 @echo "it deletes files that may require special tools to rebuild."
505 @echo "it deletes files that may require special tools to rebuild."
505 clean: clean-am
506 clean: clean-am
506
507
507 clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
508 clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
508 mostlyclean-am
509 mostlyclean-am
509
510
510 distclean: distclean-am
511 distclean: distclean-am
511 -rm -rf ./$(DEPDIR)
512 -rm -rf ./$(DEPDIR)
512 -rm -f Makefile
513 -rm -f Makefile
513 distclean-am: clean-am distclean-compile distclean-generic \
514 distclean-am: clean-am distclean-compile distclean-generic \
514 distclean-hdr distclean-tags
515 distclean-hdr distclean-tags
515
516
516 dvi: dvi-am
517 dvi: dvi-am
517
518
518 dvi-am:
519 dvi-am:
519
520
520 html: html-am
521 html: html-am
521
522
522 html-am:
523 html-am:
523
524
524 info: info-am
525 info: info-am
525
526
526 info-am:
527 info-am:
527
528
528 install-data-am: install-includeHEADERS install-pkgconfigDATA
529 install-data-am: install-includeHEADERS install-pkgconfigDATA
529
530
530 install-dvi: install-dvi-am
531 install-dvi: install-dvi-am
531
532
532 install-dvi-am:
533 install-dvi-am:
533
534
534 install-exec-am: install-libLTLIBRARIES
535 install-exec-am: install-libLTLIBRARIES
535
536
536 install-html: install-html-am
537 install-html: install-html-am
537
538
538 install-html-am:
539 install-html-am:
539
540
540 install-info: install-info-am
541 install-info: install-info-am
541
542
542 install-info-am:
543 install-info-am:
543
544
544 install-man:
545 install-man:
545
546
546 install-pdf: install-pdf-am
547 install-pdf: install-pdf-am
547
548
548 install-pdf-am:
549 install-pdf-am:
549
550
550 install-ps: install-ps-am
551 install-ps: install-ps-am
551
552
552 install-ps-am:
553 install-ps-am:
553
554
554 installcheck-am:
555 installcheck-am:
555
556
556 maintainer-clean: maintainer-clean-am
557 maintainer-clean: maintainer-clean-am
557 -rm -rf ./$(DEPDIR)
558 -rm -rf ./$(DEPDIR)
558 -rm -f Makefile
559 -rm -f Makefile
559 maintainer-clean-am: distclean-am maintainer-clean-generic
560 maintainer-clean-am: distclean-am maintainer-clean-generic
560
561
561 mostlyclean: mostlyclean-am
562 mostlyclean: mostlyclean-am
562
563
563 mostlyclean-am: mostlyclean-compile mostlyclean-generic \
564 mostlyclean-am: mostlyclean-compile mostlyclean-generic \
564 mostlyclean-libtool
565 mostlyclean-libtool
565
566
566 pdf: pdf-am
567 pdf: pdf-am
567
568
568 pdf-am:
569 pdf-am:
569
570
570 ps: ps-am
571 ps: ps-am
571
572
572 ps-am:
573 ps-am:
573
574
574 uninstall-am: uninstall-includeHEADERS uninstall-libLTLIBRARIES \
575 uninstall-am: uninstall-includeHEADERS uninstall-libLTLIBRARIES \
575 uninstall-pkgconfigDATA
576 uninstall-pkgconfigDATA
576
577
577 .MAKE: all install-am install-strip
578 .MAKE: all install-am install-strip
578
579
579 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
580 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
580 clean-libLTLIBRARIES clean-libtool ctags distclean \
581 clean-libLTLIBRARIES clean-libtool ctags distclean \
581 distclean-compile distclean-generic distclean-hdr \
582 distclean-compile distclean-generic distclean-hdr \
582 distclean-libtool distclean-tags distdir dvi dvi-am html \
583 distclean-libtool distclean-tags distdir dvi dvi-am html \
583 html-am info info-am install install-am install-data \
584 html-am info info-am install install-am install-data \
584 install-data-am install-dvi install-dvi-am install-exec \
585 install-data-am install-dvi install-dvi-am install-exec \
585 install-exec-am install-html install-html-am \
586 install-exec-am install-html install-html-am \
586 install-includeHEADERS install-info install-info-am \
587 install-includeHEADERS install-info install-info-am \
587 install-libLTLIBRARIES install-man install-pdf install-pdf-am \
588 install-libLTLIBRARIES install-man install-pdf install-pdf-am \
588 install-pkgconfigDATA install-ps install-ps-am install-strip \
589 install-pkgconfigDATA install-ps install-ps-am install-strip \
589 installcheck installcheck-am installdirs maintainer-clean \
590 installcheck installcheck-am installdirs maintainer-clean \
590 maintainer-clean-generic mostlyclean mostlyclean-compile \
591 maintainer-clean-generic mostlyclean mostlyclean-compile \
591 mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
592 mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
592 tags uninstall uninstall-am uninstall-includeHEADERS \
593 tags uninstall uninstall-am uninstall-includeHEADERS \
593 uninstall-libLTLIBRARIES uninstall-pkgconfigDATA
594 uninstall-libLTLIBRARIES uninstall-pkgconfigDATA
594
595
595
596
596 # Tell versions [3.59,3.63) of GNU make to not export all variables.
597 # Tell versions [3.59,3.63) of GNU make to not export all variables.
597 # Otherwise a system limit (for SysV at least) may be exceeded.
598 # Otherwise a system limit (for SysV at least) may be exceeded.
598 .NOEXPORT:
599 .NOEXPORT:
@@ -1,339 +1,343
1 #include <stdio.h>
1 #include <stdio.h>
2 #include <unistd.h>
2 #include <unistd.h>
3 #include <fcntl.h>
3 #include <fcntl.h>
4 #include <string.h>
4 #include <string.h>
5 #include <errno.h>
5 #include <errno.h>
6 #include "rs232config.h"
6 #include "rs232config.h"
7 #ifdef HAVE_TERMIOS_H
7 #ifdef HAVE_TERMIOS_H
8 #include <termios.h>
8 #include <termios.h>
9 #endif
9 #endif
10 #include "RS232.h"
10 #include "RS232.h"
11
11
12 #ifdef HAVE_WINDOWS_H
12 #ifdef HAVE_WINDOWS_H
13 #else
13 #else
14 #ifdef HAVE_TERMIOS_H
14 #ifdef HAVE_TERMIOS_H
15 rs232speed_t rs232cfspeed(unsigned int BaudeRate);
15 rs232speed_t rs232cfspeed(unsigned int BaudeRate);
16
16
17 rs232port_t rs232open(char* psPortName)
17 rs232port_t rs232open(char* psPortName)
18 {
18 {
19 rs232port_t fd;
19 rs232port_t fd;
20 fd = open(psPortName, O_RDWR | O_NOCTTY | O_NDELAY);
20 fd = open(psPortName, O_RDWR | O_NOCTTY | O_NDELAY);
21 fcntl(fd, F_SETFL, 0);
22 //fd = open(psPortName, O_RDWR | O_NOCTTY);
21 #ifdef debug
23 #ifdef debug
22 if(fd==-1)printf("can't open Port\n");
24 if(fd==-1)printf("can't open Port\n");
23 #endif
25 #endif
24 return fd;
26 return fd;
25 }
27 }
26
28
27 int rs232close(rs232port_t fd)
29 int rs232close(rs232port_t fd)
28 {
30 {
29 if ((int)fd == -1)
31 if ((int)fd == -1)
30 {
32 {
31 return -1;
33 return -1;
32 }
34 }
33 else
35 else
34 {
36 {
35 close(fd);
37 close(fd);
36 return 0;
38 return 0;
37 }
39 }
38 }
40 }
39
41
40
42
41 int rs232setup(rs232port_t fd, int ChSize, int BaudeRate, rs232parity Parity, rs232stop NbStop)
43 int rs232setup(rs232port_t fd, int ChSize, int BaudeRate, rs232parity Parity, rs232stop NbStop)
42 {
44 {
43 if ((int)fd == -1)
45 if ((int)fd == -1)
44 {
46 {
45 return -1;
47 return -1;
46 }
48 }
47 else
49 else
48 {
50 {
49 struct termios terminos;
51 struct termios terminos;
50 tcgetattr(fd, &terminos);
52 tcgetattr(fd, &terminos);
51 cfsetispeed(&terminos, rs232cfspeed(BaudeRate));
53 cfsetispeed(&terminos, rs232cfspeed(BaudeRate));
52 cfsetospeed(&terminos, rs232cfspeed(BaudeRate));
54 cfsetospeed(&terminos, rs232cfspeed(BaudeRate));
53 terminos.c_cflag |= (CLOCAL | CREAD);
55 terminos.c_cflag |= (CLOCAL | CREAD);
54 rs232cfparity(fd, &terminos, Parity);
56 rs232cfparity(fd, &terminos, Parity);
55 rs232cfnbstop(fd, &terminos, NbStop);
57 rs232cfnbstop(fd, &terminos, NbStop);
56 rs232cfcsize(fd, &terminos, ChSize);
58 rs232cfcsize(fd, &terminos, ChSize);
57
59 terminos.c_cc[VMIN]=0;
60 terminos.c_cc[VTIME]=20;
61 tcflush(fd, TCIFLUSH);
58 #ifdef debug
62 #ifdef debug
59 if(tcsetattr(fd, TCSANOW, &terminos)!=0)printf("bad setup\n");
63 if(tcsetattr(fd, TCSANOW, &terminos)!=0)printf("bad setup\n");
60 #else
64 #else
61 tcsetattr(fd, TCSANOW, &terminos);
65 tcsetattr(fd, TCSANOW, &terminos);
62 #endif
66 #endif
63 return 0;
67 return 0;
64 }
68 }
65 }
69 }
66
70
67 int rs232setbaudrate(rs232port_t fd, int baudrate)
71 int rs232setbaudrate(rs232port_t fd, int baudrate)
68 {
72 {
69 if ((int)fd == -1)
73 if ((int)fd == -1)
70 {
74 {
71 return fd;
75 return fd;
72 }
76 }
73 else
77 else
74 {
78 {
75 struct termios terminos;
79 struct termios terminos;
76 tcgetattr(fd, &terminos);
80 tcgetattr(fd, &terminos);
77 cfsetispeed(&terminos, rs232cfspeed(baudrate));
81 cfsetispeed(&terminos, rs232cfspeed(baudrate));
78 cfsetospeed(&terminos, rs232cfspeed(baudrate));
82 cfsetospeed(&terminos, rs232cfspeed(baudrate));
79 tcsetattr(fd, TCSANOW, &terminos);
83 tcsetattr(fd, TCSANOW, &terminos);
80 return 0;
84 return 0;
81 }
85 }
82 }
86 }
83
87
84 int rs232setparity(rs232port_t fd, rs232parity Parity)
88 int rs232setparity(rs232port_t fd, rs232parity Parity)
85 {
89 {
86 if ((int)fd == -1)
90 if ((int)fd == -1)
87 {
91 {
88 return fd;
92 return fd;
89 }
93 }
90 else
94 else
91 {
95 {
92 struct termios terminos;
96 struct termios terminos;
93 tcgetattr(fd, &terminos);
97 tcgetattr(fd, &terminos);
94 switch(Parity)
98 switch(Parity)
95 {
99 {
96 case rs232parityNo:
100 case rs232parityNo:
97 terminos.c_cflag &= Parity;
101 terminos.c_cflag &= Parity;
98 break;
102 break;
99 case rs232parityOdd:
103 case rs232parityOdd:
100 terminos.c_cflag &= ~PARENB;
104 terminos.c_cflag &= ~PARENB;
101 terminos.c_cflag |= Parity;
105 terminos.c_cflag |= Parity;
102 break;
106 break;
103 case rs232parityEven:
107 case rs232parityEven:
104 terminos.c_cflag &= ~PARENB;
108 terminos.c_cflag &= ~PARENB;
105 terminos.c_cflag |= Parity;
109 terminos.c_cflag |= Parity;
106 break;
110 break;
107 default:
111 default:
108 terminos.c_cflag &= ~PARENB;
112 terminos.c_cflag &= ~PARENB;
109 break;
113 break;
110 }
114 }
111 tcsetattr(fd, TCSANOW, &terminos);
115 tcsetattr(fd, TCSANOW, &terminos);
112 return 0;
116 return 0;
113 }
117 }
114 }
118 }
115
119
116 int rs232setnbstop(rs232port_t fd, rs232stop NbStop)
120 int rs232setnbstop(rs232port_t fd, rs232stop NbStop)
117 {
121 {
118 if ((int)fd == -1)
122 if ((int)fd == -1)
119 {
123 {
120 return fd;
124 return fd;
121 }
125 }
122 else
126 else
123 {
127 {
124 struct termios terminos;
128 struct termios terminos;
125 tcgetattr(fd, &terminos);
129 tcgetattr(fd, &terminos);
126 switch(NbStop)
130 switch(NbStop)
127 {
131 {
128 case 2:
132 case 2:
129 terminos.c_cflag |= CSTOPB;
133 terminos.c_cflag |= CSTOPB;
130 break;
134 break;
131 default:
135 default:
132 terminos.c_cflag &= ~CSTOPB;
136 terminos.c_cflag &= ~CSTOPB;
133 break;
137 break;
134 }
138 }
135 tcsetattr(fd, TCSANOW, &terminos);
139 tcsetattr(fd, TCSANOW, &terminos);
136 return 0;
140 return 0;
137 }
141 }
138 }
142 }
139
143
140
144
141 int rs232setcsize(rs232port_t fd, int ChSize)
145 int rs232setcsize(rs232port_t fd, int ChSize)
142 {
146 {
143 if ((int)fd == -1)
147 if ((int)fd == -1)
144 {
148 {
145 return fd;
149 return fd;
146 }
150 }
147 else
151 else
148 {
152 {
149 struct termios terminos;
153 struct termios terminos;
150 tcgetattr(fd, &terminos);
154 tcgetattr(fd, &terminos);
151 switch(ChSize)
155 switch(ChSize)
152 {
156 {
153 case 5:
157 case 5:
154 terminos.c_cflag |= CS5;
158 terminos.c_cflag |= CS5;
155 break;
159 break;
156 case 6:
160 case 6:
157 terminos.c_cflag |= CS6;
161 terminos.c_cflag |= CS6;
158 break;
162 break;
159 case 7:
163 case 7:
160 terminos.c_cflag |= CS7;
164 terminos.c_cflag |= CS7;
161 break;
165 break;
162 default:
166 default:
163 terminos.c_cflag |= CS8;
167 terminos.c_cflag |= CS8;
164 break;
168 break;
165 }
169 }
166 tcsetattr(fd, TCSANOW, &terminos);
170 tcsetattr(fd, TCSANOW, &terminos);
167 return 0;
171 return 0;
168 }
172 }
169 }
173 }
170
174
171 rs232speed_t rs232cfspeed(unsigned int BaudeRate)
175 rs232speed_t rs232cfspeed(unsigned int BaudeRate)
172 {
176 {
173 if(BaudeRate<25)
177 if(BaudeRate<25)
174 return B0;
178 return B0;
175
179
176 if(BaudeRate<67)
180 if(BaudeRate<67)
177 return B50;
181 return B50;
178
182
179 if(BaudeRate<93)
183 if(BaudeRate<93)
180 return B75;
184 return B75;
181
185
182 if(BaudeRate<123)
186 if(BaudeRate<123)
183 return B110;
187 return B110;
184
188
185 if(BaudeRate<142)
189 if(BaudeRate<142)
186 return B134;
190 return B134;
187
191
188 if(BaudeRate<175)
192 if(BaudeRate<175)
189 return B150;
193 return B150;
190
194
191 if(BaudeRate<250)
195 if(BaudeRate<250)
192 return B200;
196 return B200;
193
197
194 if(BaudeRate<450)
198 if(BaudeRate<450)
195 return B300;
199 return B300;
196
200
197 if(BaudeRate<900)
201 if(BaudeRate<900)
198 return B600;
202 return B600;
199
203
200 if(BaudeRate<1500)
204 if(BaudeRate<1500)
201 return B1200;
205 return B1200;
202
206
203 if(BaudeRate<2100)
207 if(BaudeRate<2100)
204 return B1800;
208 return B1800;
205
209
206 if(BaudeRate<3600)
210 if(BaudeRate<3600)
207 return B2400;
211 return B2400;
208
212
209 if(BaudeRate<7200)
213 if(BaudeRate<7200)
210 return B4800;
214 return B4800;
211
215
212 if(BaudeRate<1400)
216 if(BaudeRate<1400)
213 return B9600;
217 return B9600;
214
218
215 if(BaudeRate<28800)
219 if(BaudeRate<28800)
216 return B19200;
220 return B19200;
217
221
218 if(BaudeRate<48000)
222 if(BaudeRate<48000)
219 return B38400;
223 return B38400;
220
224
221 if(BaudeRate<86400)
225 if(BaudeRate<86400)
222 return B57600;
226 return B57600;
223
227
224 if(BaudeRate<172800)
228 if(BaudeRate<172800)
225 return B115200;
229 return B115200;
226 else
230 else
227 return B230400;
231 return B230400;
228 }
232 }
229
233
230
234
231 int rs232cfparity(int fd, struct termios *terminos, rs232parity Parity)
235 int rs232cfparity(int fd, struct termios *terminos, rs232parity Parity)
232 {
236 {
233 if ((int)fd == -1)
237 if ((int)fd == -1)
234 {
238 {
235 return fd;
239 return fd;
236 }
240 }
237 else
241 else
238 {
242 {
239 switch(Parity)
243 switch(Parity)
240 {
244 {
241 case rs232parityNo:
245 case rs232parityNo:
242 terminos->c_cflag &= Parity;
246 terminos->c_cflag &= Parity;
243 break;
247 break;
244 case rs232parityOdd:
248 case rs232parityOdd:
245 terminos->c_cflag &= ~PARENB;
249 terminos->c_cflag &= ~PARENB;
246 terminos->c_cflag |= Parity;
250 terminos->c_cflag |= Parity;
247 break;
251 break;
248 case rs232parityEven:
252 case rs232parityEven:
249 terminos->c_cflag &= ~PARENB;
253 terminos->c_cflag &= ~PARENB;
250 terminos->c_cflag |= Parity;
254 terminos->c_cflag |= Parity;
251 break;
255 break;
252 default:
256 default:
253 terminos->c_cflag &= ~PARENB;
257 terminos->c_cflag &= ~PARENB;
254 break;
258 break;
255 }
259 }
256 return 0;
260 return 0;
257 }
261 }
258 }
262 }
259
263
260 int rs232cfnbstop(int fd, struct termios *terminos, rs232stop NbStop)
264 int rs232cfnbstop(int fd, struct termios *terminos, rs232stop NbStop)
261 {
265 {
262 if ((int)fd == -1)
266 if ((int)fd == -1)
263 {
267 {
264 return fd;
268 return fd;
265 }
269 }
266 else
270 else
267 {
271 {
268 switch(NbStop)
272 switch(NbStop)
269 {
273 {
270 case 2:
274 case 2:
271 terminos->c_cflag |= CSTOPB;
275 terminos->c_cflag |= CSTOPB;
272 break;
276 break;
273 default:
277 default:
274 terminos->c_cflag &= ~CSTOPB;
278 terminos->c_cflag &= ~CSTOPB;
275 break;
279 break;
276 }
280 }
277 return 0;
281 return 0;
278 }
282 }
279 }
283 }
280
284
281
285
282 int rs232cfcsize(int fd, struct termios *terminos, int ChSize)
286 int rs232cfcsize(int fd, struct termios *terminos, int ChSize)
283 {
287 {
284 if ((int)fd == -1)
288 if ((int)fd == -1)
285 {
289 {
286 return fd;
290 return fd;
287 }
291 }
288 else
292 else
289 {
293 {
290 switch(ChSize)
294 switch(ChSize)
291 {
295 {
292 case 5:
296 case 5:
293 terminos->c_cflag |= CS5;
297 terminos->c_cflag |= CS5;
294 break;
298 break;
295 case 6:
299 case 6:
296 terminos->c_cflag |= CS6;
300 terminos->c_cflag |= CS6;
297 break;
301 break;
298 case 7:
302 case 7:
299 terminos->c_cflag |= CS7;
303 terminos->c_cflag |= CS7;
300 break;
304 break;
301 default:
305 default:
302 terminos->c_cflag |= CS8;
306 terminos->c_cflag |= CS8;
303 break;
307 break;
304 }
308 }
305 return 0;
309 return 0;
306 }
310 }
307 }
311 }
308
312
309
313
310 int rs232write(rs232port_t fd,char *psWrite, int WriteBufferSize)
314 int rs232write(rs232port_t fd,char *psWrite, int WriteBufferSize)
311 {
315 {
312 if ((int)fd == -1)
316 if ((int)fd == -1)
313 {
317 {
314 return -1;
318 return -1;
315 }
319 }
316 else
320 else
317 {
321 {
318 return write(fd, psWrite, WriteBufferSize);
322 return write(fd, psWrite, WriteBufferSize);
319 }
323 }
320 }
324 }
321
325
322
326
323 int rs232read(rs232port_t fd,char *psReadHex, int ReadBufferSize)
327 int rs232read(rs232port_t fd,char *psReadHex, int ReadBufferSize)
324 {
328 {
325
329
326 if ((int)fd == -1)
330 if ((int)fd == -1)
327 {
331 {
328 return -1;
332 return -1;
329 }
333 }
330 else
334 else
331 {
335 {
332 return read(fd, psReadHex, ReadBufferSize);
336 return read(fd, psReadHex, ReadBufferSize);
333 }
337 }
334
338
335 }
339 }
336
340
337 #endif
341 #endif
338 #endif //#ifdef HAVE_TERMIOS_H
342 #endif //#ifdef HAVE_TERMIOS_H
339
343
General Comments 0
You need to be logged in to leave comments. Login now