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