Compare commits

..

325 Commits

Author SHA1 Message Date
Janet B. Anderson
b95f7afd3c R3_13_0_beta8 1997-03-13 21:03:06 +00:00
Janet B. Anderson
a2db2d88ca epicsVersion.h now a created file. 1997-03-13 19:16:26 +00:00
Janet B. Anderson
cbe00bb737 Fixed version text. 1997-03-13 18:09:28 +00:00
Janet B. Anderson
7efb007b53 Removed epicsVersion.h and fixed Makefile.Host 1997-03-13 17:32:21 +00:00
Janet B. Anderson
4e7917d9fe Include stdlib.h. 1997-03-13 17:03:08 +00:00
Marty Kraimer
ee8fad1e7a Test version to diagnose bitbus problems 1997-03-13 16:57:49 +00:00
Janet B. Anderson
0fa8b1e62d CMPLR = OLD needed for alpha build. 1997-03-13 16:45:51 +00:00
Janet B. Anderson
117f75eac4 Initial Version 1997-03-13 16:42:52 +00:00
Marty Kraimer
85432e6307 Change hash algorithm to be slightly faster 1997-03-13 16:38:09 +00:00
Janet B. Anderson
cdbbf69a1e Modified names for CXX flags. 1997-03-12 23:08:37 +00:00
Marty Kraimer
fb8e026551 Allow CALC to be 40 characters. Increase rpbuf from 184 to 200 1997-03-12 21:38:38 +00:00
Marty Kraimer
5f1b0c19a8 Use maxCards from module_types.h 1997-03-12 21:35:16 +00:00
Janet B. Anderson
bbef91c39e Don not include filio and sockio headers. 1997-03-12 17:21:44 +00:00
Jeff Hill
f0120adba4 added purify build 1997-03-10 23:07:36 +00:00
Jeff Hill
457d64640e faster clean 1997-03-10 23:04:04 +00:00
Jeff Hill
eae68a0872 -DEXPL_TEMPL for g++ and others 1997-03-10 23:00:52 +00:00
Jeff Hill
48bbe65f60 installed 1997-03-10 22:58:31 +00:00
Janet B. Anderson
6e04d47209 Added cc depends rule. 1997-03-10 18:13:20 +00:00
Jim Kowalkowski
02dc1c300c Fixes cvs log id at top 1997-03-05 21:16:23 +00:00
Jim Kowalkowski
2d1c1d3e09 New server example 1997-03-05 21:14:56 +00:00
Jim Kowalkowski
5e9ebd8b9b Fixed a bug in TSreport - printing of IP addresses was incorrect 1997-03-05 13:20:44 +00:00
Jim Kowalkowski
c5bc89f11b Fixed bungled spelling of GUI_BITS, it was spelled GUI_BTS 1997-03-03 17:28:29 +00:00
Jeff Hill
bd2407153c installed host build make file 1997-02-27 18:59:18 +00:00
Janet B. Anderson
2b42b3eab0 Portability change - added EXE suffix to antelope and e_flex. 1997-02-24 16:22:56 +00:00
Janet B. Anderson
77146706a6 WHAT now defined in config files. 1997-02-24 16:14:20 +00:00
Janet B. Anderson
b6d0f183de Portability change /bin/pwd changed to pwd. 1997-02-24 16:13:03 +00:00
Janet B. Anderson
4f649964de getopt changed to getopts for portability. 1997-02-24 16:10:45 +00:00
Janet B. Anderson
f565901231 Added support for all action*arch targets. 1997-02-24 16:08:08 +00:00
Janet B. Anderson
9821aaa612 Added WHAT to config files. 1997-02-24 16:02:26 +00:00
Janet B. Anderson
a364fbe125 Portability change. 1997-02-21 15:16:43 +00:00
Janet B. Anderson
0500ccb4da Aplha support file from M. Rivers 1997-02-18 22:04:21 +00:00
Janet B. Anderson
3db726ddac sgi support file from M. Rivers 1997-02-18 22:03:56 +00:00
Janet B. Anderson
edff0569b6 Sgi support modifications from M. Rivers 1997-02-18 21:54:46 +00:00
Janet B. Anderson
cbbeb7ea25 Alpha support modifications from M. Rivers 1997-02-18 21:54:07 +00:00
Johnny Tang
ccb055cf78 Bx field DCT visible 1997-02-11 20:54:49 +00:00
Johnny Tang
4ddd63d141 Bx field DCT invisible 1997-02-11 20:54:31 +00:00
Johnny Tang
fdd89be534 bug fix 1997-02-11 20:48:54 +00:00
Johnny Tang
ed77e687a3 bug fix 1997-02-11 19:26:08 +00:00
Janet B. Anderson
f5e2c72b18 Added makefile dependancy for LIBNAME. 1997-02-07 21:15:17 +00:00
Janet B. Anderson
1e4e78d6bc Fixed DEPENDS rule lines. 1997-02-06 19:47:03 +00:00
Janet B. Anderson
3ede2a2512 Added vxldscript.MRI to ld flags. 1997-02-06 19:39:03 +00:00
Janet B. Anderson
1995c735a1 Bug fixes for INSTALL_LIBS and binInstalls 1997-02-06 15:49:53 +00:00
Janet B. Anderson
79a2ef7ad1 epics_R3_13_0_beta7 1997-02-05 22:22:45 +00:00
Janet B. Anderson
11b9be6dfd Removed Makefile.Unix files. 1997-02-05 22:18:03 +00:00
Janet B. Anderson
d21c4ba0ab Added c++ support, BIN_INSTALLS, and app LINNAME and DBDNAME dependancies. 1997-02-05 22:10:33 +00:00
Janet B. Anderson
a23b0be5a5 Added c++ support for Vx builds. 1997-02-05 22:07:57 +00:00
Marty Kraimer
199fdff643 dbAllocForm failed for macro links 1997-02-05 21:36:38 +00:00
Marty Kraimer
d762ed7af6 Removed extra rules at the end of makeBaseApp 1997-02-05 21:16:56 +00:00
Janet B. Anderson
85e3a6e0a1 Added CONFIG_BASE_VERSION. RULES.Db, RULES.ioc. 1997-02-05 21:08:16 +00:00
Janet B. Anderson
74f253820a CHMOD now defined in config dir. 1997-02-05 21:01:36 +00:00
Janet B. Anderson
3c73143f3a BUILD_ARCHS now defined without if stmnts. 1997-02-05 20:54:22 +00:00
Marty Kraimer
18cafc2d06 replace shell commands with wildcard 1997-02-05 19:32:49 +00:00
Marty Kraimer
6f6e34dced str_t_e did not allow for numeric value 1997-02-05 19:27:31 +00:00
Jim Kowalkowski
a16f99b8d0 New architecture type 1997-01-29 04:43:42 +00:00
Janet B. Anderson
46a180f755 epics_R3_13_0_beta6 1997-01-23 18:50:54 +00:00
Marty Kraimer
cebd5f3cf8 Added T_A 1997-01-23 18:32:12 +00:00
Janet B. Anderson
2ced0242bd Added install include dir to UNIX_INCLUDES. 1997-01-23 17:28:45 +00:00
Janet B. Anderson
7edc0cd149 Allow CONFIG_SITE to override CONFIG_COMMON vars. 1997-01-23 17:26:51 +00:00
Marty Kraimer
417411ab62 Makefile in *App/*Db was incorrect 1997-01-23 16:10:30 +00:00
Jeff Hill
ea589a75a9 added include of sys/types.h for VMS 1997-01-22 22:08:03 +00:00
Jeff Hill
d00b72f3e8 doc 1997-01-22 22:07:22 +00:00
Jeff Hill
56cf313613 removed 1997-01-22 22:04:56 +00:00
Jeff Hill
98498419c0 installed 1997-01-22 21:36:06 +00:00
Jeff Hill
653d8f1dae moved if.h include here 1997-01-22 21:35:28 +00:00
Jeff Hill
8405cf7323 clean up 1997-01-22 21:35:01 +00:00
Jeff Hill
80a8d9c37f include if.h here 1997-01-22 21:34:41 +00:00
Jeff Hill
ce87cee840 moved include of time.h and errno.h here 1997-01-22 21:34:10 +00:00
Jeff Hill
0ca6bf3ecc moved include of if.h here 1997-01-22 21:33:06 +00:00
Jeff Hill
8e0a2c9e0f moved targets down so that they dont repl all target 1997-01-22 21:20:01 +00:00
Jeff Hill
fad67f380d added dcan lock to db_post_single_event() 1997-01-22 21:17:41 +00:00
Jeff Hill
4dc12e992d updated tests 1997-01-22 21:14:50 +00:00
Jeff Hill
bf6f69065c fixed class decl order for VMS 1997-01-22 21:14:21 +00:00
Jeff Hill
be09fad901 doc 1997-01-22 21:13:08 +00:00
Jeff Hill
0b07bf8094 moved vms includes here 1997-01-22 21:11:49 +00:00
Jeff Hill
d2c38b8db5 cleaned out extra includes 1997-01-22 21:11:04 +00:00
Jeff Hill
7f1249ae45 smaller external sym name for VAXC 1997-01-22 21:10:26 +00:00
Jeff Hill
617b4dd26f moved include of if.h to osiSock.h 1997-01-22 21:08:48 +00:00
Jeff Hill
ef7b658bc0 removed use of ## for VAXC port 1997-01-22 21:08:17 +00:00
Jeff Hill
ef6adf90fc fixed array test 1997-01-22 21:07:27 +00:00
Jeff Hill
ca2a66514f use genLocalExcepWFL for generateLocalExceptionWithFileAndLine 1997-01-22 21:06:30 +00:00
Jeff Hill
ce3095d1fc define MULTINET and __STDC__ 1997-01-22 21:05:49 +00:00
Jeff Hill
2869b388dd added TESTPROD to clean target 1997-01-22 21:03:48 +00:00
Marty Kraimer
dc03deead7 Still did not work correctly 1997-01-22 21:00:20 +00:00
Marty Kraimer
99a0613092 Makefile in xxxApp/Db included wrong rules 1997-01-22 19:20:51 +00:00
Marty Kraimer
38044917f4 Modified comment in st.cmd 1997-01-22 14:08:10 +00:00
Marty Kraimer
2092f9faee On usage made it clear that -e is optional 1997-01-21 22:16:59 +00:00
Janet B. Anderson
f0ea531cc4 Removed def of target archs. 1997-01-21 21:59:46 +00:00
Janet B. Anderson
54de9067ee Dont require . to be in path. 1997-01-21 19:16:51 +00:00
Marty Kraimer
dcbf2a6331 src/st.cmd replaced by st.cmd 1997-01-21 19:01:39 +00:00
Marty Kraimer
63d0339d05 failed unless at least one dbLoadRecords("xxxApp/ ... appeared 1997-01-21 19:00:53 +00:00
Jim Kowalkowski
8d88cf2277 free up resources in clearData 1997-01-21 15:13:06 +00:00
Marty Kraimer
450f76d205 Minor changes 1997-01-21 15:06:38 +00:00
Jim Kowalkowski
890de43c91 Print IP address on report 1997-01-20 15:31:00 +00:00
Janet B. Anderson
a8879d0f41 Now works with MakeRelease 1997-01-17 20:02:29 +00:00
Janet B. Anderson
cdab5000bc Use config/CONFIG_BASE_VERSION to get version info. 1997-01-17 19:59:37 +00:00
Marty Kraimer
fd0daa0b92 various bugs 1997-01-17 19:48:27 +00:00
Janet B. Anderson
86219510c6 epics_R3_13_0_beta5 1997-01-17 18:53:19 +00:00
Janet B. Anderson
471a5a71e6 Initial version. 1997-01-17 17:54:40 +00:00
Janet B. Anderson
ae1b395a87 epicsVersion.h now created from CONFIG_BASE_VERSION. 1997-01-17 17:52:57 +00:00
Janet B. Anderson
fecf4de0d1 Added uninstall for templates dir. 1997-01-17 16:45:12 +00:00
Marty Kraimer
378cc22c07 Changes for Makefile.Host and also more like APS/ASD environment 1997-01-17 16:38:02 +00:00
Janet B. Anderson
6f3b75b485 Modified output message. 1997-01-17 16:20:34 +00:00
Janet B. Anderson
2b1aab904e Local libraries now first. 1997-01-16 22:22:18 +00:00
Janet B. Anderson
8afabaf4e1 MOved position of USR_INCLUDES on compile line. 1997-01-16 22:16:45 +00:00
Marty Kraimer
ff02a0fe6e Adding to base 1997-01-16 19:53:15 +00:00
Janet B. Anderson
8b9b9c0bf6 Added commented stmnt for devAiStats.o 1997-01-16 19:05:58 +00:00
Janet B. Anderson
b134b99686 Uninstall now removes dbd and doc directories. 1997-01-16 19:01:28 +00:00
Janet B. Anderson
61f0440de5 Fixed spelling srror in DEPENDS_RULE. 1997-01-16 17:30:41 +00:00
Marty Kraimer
c68ace1542 make nicer 1997-01-16 17:04:39 +00:00
Marty Kraimer
2207e20627 Did not properly implement support for multiple clients 1997-01-16 17:03:26 +00:00
Marty Kraimer
0a4d1f26d1 Changes so that applications build 1997-01-16 17:01:43 +00:00
Janet B. Anderson
1114813608 Initial version. 1997-01-14 22:58:33 +00:00
Jeff Hill
0b09d90b12 fixed problems associated with events lost msg 1997-01-13 23:13:50 +00:00
Marty Kraimer
219324f304 Made mistake removing get_value 1997-01-13 17:30:35 +00:00
Marty Kraimer
f0e00aacc8 Use dbGetFieldIndex. get rid of get_value 1997-01-13 15:59:21 +00:00
Marty Kraimer
02e5131522 recGblInitConstantLink for sgl was referencing wrong field 1997-01-13 15:58:07 +00:00
Marty Kraimer
194784d781 get rid of call to devGpibLib_setPvSevr 1997-01-13 15:56:31 +00:00
Marty Kraimer
a0a5198a2f minor change 1997-01-13 15:55:16 +00:00
Marty Kraimer
e41619eea3 Be willing to generate null string fields 1997-01-13 15:54:54 +00:00
Marty Kraimer
93deef330a The enums for menus had a comma after last item. 1997-01-13 15:54:11 +00:00
Jim Kowalkowski
5507e033d8 many errors fixed 1997-01-12 20:32:49 +00:00
Jeff Hill
d0c26b575e code around gnu g++ inline bug when -O isnt used 1997-01-10 21:18:56 +00:00
Jeff Hill
66c844cebf updated DL fmt 1997-01-10 21:15:43 +00:00
Jeff Hill
fc449a487e added casOpaqueAddr.cc 1997-01-10 21:13:42 +00:00
Jeff Hill
4be53cd0fa better message 1997-01-10 21:11:16 +00:00
Jeff Hill
2adb49b93e took out C++ 1997-01-10 21:06:06 +00:00
Jeff Hill
d7bb945cc0 host/user name set is now a NOOP 1997-01-10 21:02:10 +00:00
Jeff Hill
752fbcc6dc doc 1997-01-10 21:00:16 +00:00
Jeff Hill
d1e1a5f249 installed 1997-01-10 00:41:33 +00:00
Jeff Hill
a13d49cf81 BASE is up one more level 1997-01-10 00:31:30 +00:00
Jeff Hill
2fc75ca08e installed WIN32/Makefile.Host 1997-01-10 00:12:21 +00:00
Jeff Hill
7f3c5e6cbb installed 1997-01-10 00:05:21 +00:00
Jeff Hill
355fe461e7 installedMakefile.Host 1997-01-10 00:02:59 +00:00
Jeff Hill
b87c59eab2 dont mess with SIGPIPE under WIN32 1997-01-10 00:01:02 +00:00
Jeff Hill
e2edfb470f close() => socket_close() 1997-01-10 00:00:01 +00:00
Jeff Hill
8f642dfe1e installed 1997-01-09 22:29:51 +00:00
Jeff Hill
ad533e7c35 installed hostBuild branch 1997-01-09 22:29:17 +00:00
Jeff Hill
5937eb099e removed INC for gddAppFuncTable.h 1997-01-09 22:27:30 +00:00
Jeff Hill
9ca456bfb3 eliminate MSVC++ warning resulting from passing *this to a base 1997-01-09 22:24:46 +00:00
Jeff Hill
52854cd1ed MSC cannot use the default constructor 1997-01-09 22:22:30 +00:00
Jeff Hill
7a92120974 installed 1997-01-09 22:19:54 +00:00
Jeff Hill
9b1cf4a467 installed changes on hostBuild branch 1997-01-09 22:14:26 +00:00
Jeff Hill
62ae22ef7a added epicsShareAPI to ca_message_text[] 1997-01-09 22:11:43 +00:00
Jeff Hill
9e7f4020c2 doc 1997-01-09 22:10:56 +00:00
Jeff Hill
17aa8609b0 installed 1997-01-09 22:10:03 +00:00
Jeff Hill
4b83df7f01 Use CXX for CC 1997-01-09 22:07:22 +00:00
Jeff Hill
a1acb62b58 .PHONY becomes :: rule 1997-01-09 22:05:55 +00:00
Jeff Hill
71144f3c20 added WIN32 & pc486 1997-01-09 22:04:03 +00:00
Jeff Hill
7c89b7850f removed redundant steps 1997-01-09 22:03:32 +00:00
Jeff Hill
cdb42f3c11 .PHONY is :: rule 1997-01-09 22:01:43 +00:00
Jeff Hill
22cf3b4935 installed 1997-01-09 21:58:32 +00:00
Jeff Hill
d584853a94 improved message 1997-01-08 22:48:42 +00:00
Jim Kowalkowski
94ce85b538 reset line number at start of routines 1997-01-02 21:16:40 +00:00
Jim Kowalkowski
1427caaee9 More strings yet printed now 1996-12-20 13:11:42 +00:00
Jim Kowalkowski
3846165645 Working version, intermediate, still has problems 1996-12-20 13:09:49 +00:00
Jeff Hill
fdddf61b06 moved extra % from printf 1996-12-18 18:24:09 +00:00
Jim Kowalkowski
07e07db9c7 fixed bug in copyData, sets bounds now 1996-12-17 15:04:42 +00:00
Jeff Hill
1c091779a8 fixed bad data ref bug 1996-12-13 00:11:32 +00:00
Jeff Hill
88140f9116 dont unlock after destroy 1996-12-13 00:08:35 +00:00
Jeff Hill
e9b078491b moved casStreamOS *pStrmOS decl down 1996-12-12 21:24:17 +00:00
Jeff Hill
218ae4569a fixed send does not get armed after complete flush bug 1996-12-12 19:02:36 +00:00
Jeff Hill
03188d0eec doc 1996-12-12 18:56:27 +00:00
Jeff Hill
88c99148b2 fixed client initiated pv delete calls interestDelete() VF bug 1996-12-12 18:55:38 +00:00
Jeff Hill
261067b0f5 fixed fast build 1996-12-12 18:53:30 +00:00
Jeff Hill
89b90296ec added additional vector tests 1996-12-11 01:10:33 +00:00
Jeff Hill
dff79f6bea added vector support 1996-12-11 01:07:17 +00:00
Jeff Hill
fa64c5bdd2 getSender() nolonger in line 1996-12-11 01:04:54 +00:00
Jeff Hill
a9acb01482 removed redundant bad client attach detect 1996-12-11 01:03:52 +00:00
Jeff Hill
de4c463956 removed casEventMaskEntry def 1996-12-11 01:02:35 +00:00
Jeff Hill
07857588f0 casEventMaskEntry constr does res tbl add 1996-12-11 01:01:56 +00:00
Jeff Hill
f9346a7eca added bad chan attachment detection 1996-12-11 00:59:37 +00:00
Jeff Hill
e332794a4a better diagnostic 1996-12-11 00:58:35 +00:00
Jeff Hill
ab4c4baa52 moved casEventMaskEntry here 1996-12-11 00:57:56 +00:00
Jeff Hill
b372a53bbb use main include file 1996-12-11 00:56:47 +00:00
Jeff Hill
e031341af1 better message 1996-12-11 00:55:14 +00:00
Jeff Hill
ce5adaa037 added casPVListChan 1996-12-06 22:41:33 +00:00
Jeff Hill
b578f783e2 moved down one level 1996-12-06 22:40:40 +00:00
Jeff Hill
2c0a4561bd hew hierarchy 1996-12-06 22:38:00 +00:00
Jeff Hill
f14ac97ee2 new hierarchy 1996-12-06 22:37:38 +00:00
Jeff Hill
8431539f23 use destroyInProgress flag now functional nativeCount() 1996-12-06 22:36:30 +00:00
Jeff Hill
7f8be4b3a1 added destroyInProgress flag 1996-12-06 22:35:06 +00:00
Jeff Hill
59304ffd99 add maxDimension() and maxBound() 1996-12-06 22:34:22 +00:00
Jeff Hill
7c124f6e93 virtual ~casPVI(), ~casPVListChan(), ~casChannelI() 1996-12-06 22:33:49 +00:00
Jeff Hill
7543005120 force virtual destructor 1996-12-06 22:32:11 +00:00
Jeff Hill
f4784cafb5 add virt funcs to casPV 1996-12-06 22:30:50 +00:00
Jeff Hill
c80e584dfa fixed wrong start bug in getDD() 1996-12-06 22:27:44 +00:00
Jeff Hill
4820f93b6a added auto cleanup of installed classes to destroy 1996-12-06 22:26:36 +00:00
Jeff Hill
eff915d837 moved down one level 1996-12-06 22:20:22 +00:00
Janet B. Anderson
a7e61ddeb8 HP bug fix per S. lewis tech-talk msg 11/26 1996-12-02 15:12:33 +00:00
Jeff Hill
fb624a76d2 installed 1996-11-22 20:49:43 +00:00
Jeff Hill
33d5b78b5b doc 1996-11-22 20:43:03 +00:00
Jeff Hill
e6a68089c6 fixed protos for __SUNPRO_C 1996-11-22 20:39:33 +00:00
Jeff Hill
4d1875e738 added unistd.h for close() and added gethostname() proto 1996-11-22 20:38:17 +00:00
Jeff Hill
737f4b83e6 converted large inline templ funcs 1996-11-22 20:37:19 +00:00
Jeff Hill
a4362b3b3f win NT changes 1996-11-22 19:56:42 +00:00
Jeff Hill
96f6b17458 fixed spelling 1996-11-22 19:54:53 +00:00
Jeff Hill
e5df8aef5b doc 1996-11-22 19:52:24 +00:00
Jeff Hill
f8f7240e12 doc 1996-11-22 19:41:05 +00:00
Jeff Hill
7bab56dcb7 doc 1996-11-22 19:32:15 +00:00
Jeff Hill
37c4bead67 installed 1996-11-22 19:32:01 +00:00
Jeff Hill
3b934ac775 suppressed error msg and returned correct # bytes pending 1996-11-22 19:27:04 +00:00
Jeff Hill
d34ad2d0ff doc 1996-11-22 19:22:53 +00:00
Jeff Hill
ff0e52d4b4 installed 1996-11-22 19:21:55 +00:00
Jeff Hill
4961e0c799 added templInst.c 1996-11-22 19:20:37 +00:00
Jeff Hill
c41ea11302 CXXCMPLR = STRICT 1996-11-22 19:19:40 +00:00
Jeff Hill
8215339e79 CXXCMPLR = STRICT 1996-11-22 19:19:12 +00:00
Jeff Hill
49d0571e4a reorganized for improved readability 1996-11-22 19:16:00 +00:00
Jeff Hill
a93baf6214 added const to API 1996-11-22 19:08:02 +00:00
Jeff Hill
8dcf6e1a5f included string.h 1996-11-22 19:07:01 +00:00
Jeff Hill
687770d207 added const to build and connect API 1996-11-22 19:05:48 +00:00
Jeff Hill
a897ba6ac9 CMPLR = STRICT 1996-11-22 19:04:37 +00:00
Jeff Hill
87efbf9a7c GCC = /opt/gnu/bin/gcc not GCC = gcc 1996-11-22 18:59:10 +00:00
Jeff Hill
7aa17be09c additional patch for 2 days to CPU usage problem 1996-11-22 18:19:09 +00:00
Jeff Hill
292bbca26b fixed 2 day delay to CPU consumption bugseq_task.c 1996-11-21 22:54:00 +00:00
Jeff Hill
ede722c5da fixed printf fmt/arg incompatibilities 1996-11-21 21:13:03 +00:00
Jeff Hill
6844074eac use correct syntax for init 1996-11-21 21:12:05 +00:00
Jeff Hill
26385135f4 added missing include 1996-11-21 21:11:15 +00:00
Jeff Hill
079e377937 fixed GNU compile under solaris 1996-11-08 22:02:22 +00:00
Jeff Hill
369841f425 avoid confusing circular dependency message 1996-11-07 23:46:52 +00:00
Jeff Hill
3f7bfda8d8 doc 1996-11-07 14:42:36 +00:00
Jeff Hill
cfc470d480 allow monitor init read to using rd async io 1996-11-06 22:15:56 +00:00
Jeff Hill
ff7a84bbb1 removed cas and gdd agin 1996-11-06 22:14:36 +00:00
Jeff Hill
485817d819 Allow override of CROSS_COMPILER_HOST_ARCHS in CONFIG 1996-11-06 22:12:51 +00:00
Jeff Hill
bf4738a2b3 unclobbered the rebuild target 1996-11-06 20:05:43 +00:00
Jeff Hill
4449495196 o do the "inc" traget at the RULES_DIRS level for all arc targets
and the install target
o eliminated redundant "inc" build by creating buildInstall target
1996-11-06 19:41:44 +00:00
Jeff Hill
d89ceac446 added AB stepper 1996-11-06 15:55:33 +00:00
Jeff Hill
a9a77b8a9c use CC -xar on sun4 and solaris arch 1996-11-06 00:11:41 +00:00
Jeff Hill
d8fdf046d1 o fixed "-d" flag was ignored (directory was always created)
o fixed directory creation failed when relative path was used
	(ie path containing ".." or ".")
1996-11-05 18:17:08 +00:00
Janet B. Anderson
5f2999d9c4 Removed unused references to TCLLIBNAME and TCLINDEX 1996-11-05 16:06:05 +00:00
Jim Kowalkowski
0a943103f2 fix setFirst 1996-11-04 17:12:50 +00:00
Jeff Hill
8e34d8cc43 use osiSock.h to get proto for gettimeofday() for now 1996-11-02 02:52:54 +00:00
Jeff Hill
e05ed3ebae doc 1996-11-02 02:46:40 +00:00
Jeff Hill
da7f5837ec fixed warning 1996-11-02 02:42:19 +00:00
Jeff Hill
d8fc7ff7bd removed use of db_addr 1996-11-02 02:27:28 +00:00
Jeff Hill
66d2971efb use osiSock.h 1996-11-02 02:20:36 +00:00
Jeff Hill
16e9a2dbc0 removed gnu warnings 1996-11-02 02:19:55 +00:00
Jeff Hill
77cf658c05 PC arch changes 1996-11-02 02:18:31 +00:00
Jeff Hill
a1e16b72b7 removed 1996-11-02 02:13:33 +00:00
Jeff Hill
f48578f681 installed 1996-11-02 02:12:48 +00:00
Jeff Hill
cbc3f74479 use correct form of #define 1996-11-02 02:08:52 +00:00
Jeff Hill
569d7e7879 added TsAddDouble() proto 1996-11-02 02:07:54 +00:00
Jeff Hill
2d6ac57834 fixed several subtle problems 1996-11-02 02:06:59 +00:00
Jeff Hill
44aae92786 const param => #define 1996-11-02 02:06:00 +00:00
Jeff Hill
9976984eb8 %d => %ld 1996-11-02 02:05:24 +00:00
Jeff Hill
452d3d68ca fixed several subtle bugs 1996-11-02 02:04:42 +00:00
Jeff Hill
a609cfaa02 use strerror() to get err string since it is portable 1996-11-02 02:03:37 +00:00
Jeff Hill
c12f73e2b3 added envParamIsEmpty() 1996-11-02 02:00:05 +00:00
Jeff Hill
fd72915fae added cas env var 1996-11-02 01:59:43 +00:00
Jeff Hill
8d5cfe739f added os depen stuff 1996-11-02 01:58:52 +00:00
Jeff Hill
d40253a1b5 use correct form of #include 1996-11-02 01:57:45 +00:00
Jeff Hill
55589cb65a improved message 1996-11-02 01:56:55 +00:00
Jeff Hill
14127052f1 added os depen stuff 1996-11-02 01:38:00 +00:00
Jeff Hill
5201df3dbc installed 1996-11-02 01:36:25 +00:00
Jeff Hill
3263a885a3 more pc related changes 1996-11-02 01:30:51 +00:00
Jeff Hill
4dbb3d18de removed merge problems 1996-11-02 01:28:15 +00:00
Jeff Hill
31b046e108 strcpy => styrcpy (shuts up purify) 1996-11-02 01:24:49 +00:00
Jeff Hill
c25f195f08 pc does not have 68k's "nobitfield" option 1996-11-02 01:21:12 +00:00
Jeff Hill
f8910ba651 installed 1996-11-02 01:17:59 +00:00
Jeff Hill
9b05ce2169 added byte swapping for pc arch 1996-11-02 01:16:43 +00:00
Jeff Hill
6bbc5576f9 remove db_addr 1996-11-02 01:15:16 +00:00
Jeff Hill
52b5b08b62 installed 1996-11-02 01:07:48 +00:00
Jeff Hill
c83ef56154 many improvements 1996-11-02 01:07:24 +00:00
Jeff Hill
77c34614a2 added resourceLib.cc 1996-11-02 01:06:48 +00:00
Jeff Hill
0f925b7264 installed 1996-11-02 01:01:41 +00:00
Jeff Hill
17ff2420b4 many improvements 1996-11-02 00:55:02 +00:00
Jeff Hill
1f722b453d installed 1996-11-02 00:52:53 +00:00
Jeff Hill
5bcd8e3fe7 many pc port, const in API, and other changes 1996-11-02 00:51:12 +00:00
Jeff Hill
cacdbe8a7e added convert.o 1996-11-02 00:45:42 +00:00
Jeff Hill
8397c013f0 added purify target 1996-11-02 00:44:01 +00:00
Jeff Hill
40f6521d20 fixed line wrap 1996-11-02 00:41:23 +00:00
Jeff Hill
183386fc02 remove use of <test -d> to create directory 1996-11-02 00:39:51 +00:00
Jeff Hill
ee83524e6b removed use of <test -d> to create directory 1996-11-02 00:38:42 +00:00
Jeff Hill
58b02d04cb os depen -I 1996-11-02 00:35:42 +00:00
Jeff Hill
68006545e1 added new CAS env var 1996-11-02 00:31:00 +00:00
Jeff Hill
9a0e885a2e os depen include 1996-11-02 00:30:19 +00:00
Jeff Hill
4013ea544b os depen -I and $(CCC) -xar for ar 1996-11-02 00:29:02 +00:00
Marty Kraimer
9258159419 Removed precord arg from dbScanFwdLink 1996-11-01 17:15:58 +00:00
Marty Kraimer
ecc19506ef Added dbScanFwdLink 1996-11-01 15:53:32 +00:00
Marty Kraimer
6373069d52 Fixed bugs from last set of changes 1996-11-01 15:52:52 +00:00
Marty Kraimer
2a8ec06437 Made changes so that -Wall and -pedantic work properly 1996-11-01 15:51:50 +00:00
Janet B. Anderson
603519ae1c R3.13.0.beta4 1996-11-01 15:37:48 +00:00
Marty Kraimer
f7433d8e93 Fixed bug in dbAllocForm 1996-10-31 22:29:04 +00:00
Marty Kraimer
5ca50b7ce7 recGblInitConstantLink allows non constant link 1996-10-31 22:28:16 +00:00
Marty Kraimer
7287113d58 added dbGetNelements and dbIsLinkConnected 1996-10-31 22:27:03 +00:00
Marty Kraimer
179c9f6df0 Changes for udf and other problems discovered while looking at udf 1996-10-31 22:24:14 +00:00
Janet B. Anderson
a160ebf5ba Added quotes to echo stmnts. 1996-10-31 20:01:00 +00:00
Janet B. Anderson
b52605705b siol cannot be a constant link. 1996-10-30 21:31:07 +00:00
Janet B. Anderson
3ef7c191db Changed inp type test to DB_LINK 1996-10-30 21:30:01 +00:00
Janet B. Anderson
73dc2a91e4 Typo erro bug fix 1996-10-30 19:30:03 +00:00
Janet B. Anderson
ad76c5efab In init_record the udf field is set to false only if svl is a
constant link and recGblInitConstantLink returns success.
1996-10-30 17:47:02 +00:00
Janet B. Anderson
5981891ee0 The udf field is no longer set to false in write_<record type>. 1996-10-30 17:46:33 +00:00
Janet B. Anderson
884737e82e In init_record the udf field is no longer set to false if inp
is a constant link and recGblInitConstantLink returns success
(rval, not val, was successfully initialized).
1996-10-30 17:45:15 +00:00
Janet B. Anderson
e301e1b359 In init_record the udf field is set to false only if inp
is a constant link and recGblInitConstantLink returns success.
In read_<record type> the udf field is set to false only if
inp is not a constant link and dbGetLink returns success.
1996-10-30 17:44:33 +00:00
Janet B. Anderson
a3b1033015 The siol field, if it is a constant, is now initialized
during record initialization.  In process the udf field
is now set to false if siol is not a constant link and
dbGetLink returns success.
1996-10-30 17:42:00 +00:00
Janet B. Anderson
ac5e26f132 In process the udf field is now set to false if dol is
not a constant link and dbGetLink returns success.
1996-10-30 17:41:37 +00:00
Janet B. Anderson
19cc8098dc In process the udf field is now set to false if dol is
not a constant link and dbGetLink returns success.
Changes made to modify DB_LINK test on rdbl field to
allow type CA_LINK.
1996-10-30 17:41:12 +00:00
Janet B. Anderson
49da47700d Changes made to modify DB_LINK tests on the lnk and dol
fields to allow type CA_LINK.
1996-10-30 17:40:50 +00:00
Janet B. Anderson
3d22feedd8 Changes made to modify DB_LINK test on cvl field to allow type CA_LINK. 1996-10-30 17:40:28 +00:00
Janet B. Anderson
bab66fe7cc Old style, pre R3.12, c code in init_record was updated. 1996-10-30 17:39:23 +00:00
Janet B. Anderson
4de3accb61 Udf now set to false in process when val is initialized. 1996-10-30 17:38:49 +00:00
Janet B. Anderson
ba2b082abd Udf now set to false in put_enum_string when val is initialized. 1996-10-30 17:38:29 +00:00
Janet B. Anderson
086f5999aa Changes made to fanoutRecord.c to modify DB_LINK test
on lnk* fields to allow type CA_LINK.
1996-10-30 17:37:54 +00:00
Janet B. Anderson
96f51f2b99 In process() the udf field is set to false when dbGetLink returns
success only if dol is not a constant link.
1996-10-30 17:37:32 +00:00
Janet B. Anderson
a93773ae77 Changes made to compressRecord.c to modify DB_LINK test
on inp field to allow type CA_LINK.
1996-10-30 17:37:02 +00:00
Janet B. Anderson
d997adeb16 The siol field, which was never used in record processing, has been
removed from aaiRecord.dbd and aaoRecord.dbd files. Old style, pre R3.12,
c code in init_record was updated.
1996-10-30 17:34:35 +00:00
Marty Kraimer
299c22ff0f minor format and message changes 1996-10-30 13:56:18 +00:00
Marty Kraimer
71e83671aa get rid of client_stat_summary. casr provides functionality 1996-10-29 21:06:32 +00:00
Marty Kraimer
1b66a4c204 Changed menu initial values to string from index 1996-10-29 20:58:05 +00:00
Marty Kraimer
0c8f41a6a0 Changed menu initial vales to string from index; cleaned up dbTest.c 1996-10-29 20:56:46 +00:00
Marty Kraimer
5268e13e74 Many changes to properly support DCT operation 1996-10-29 20:49:13 +00:00
Jim Kowalkowski
a0d4d84622 first proof reading corrections 1996-10-29 19:24:12 +00:00
Jim Kowalkowski
9427acb0a1 Much new doc added. Fixed bug in gdd.cc. 1996-10-29 15:40:02 +00:00
Jim Kowalkowski
41d5c292f9 New gdd reference manual 1996-10-25 12:33:12 +00:00
Jim Kowalkowski
f2ceaba174 many more changes 1996-10-24 17:37:03 +00:00
Jim Kowalkowski
0faa5d56cc New program for running programs with different priority and changing the
maximum number of file descriptors.
1996-10-22 15:40:04 +00:00
Jim Kowalkowski
072c850568 added line for vxWorks statistics device support 1996-10-21 19:04:06 +00:00
Jim Kowalkowski
0f4b4deb80 added the code for ioc statistic processing on IOC and workstation 1996-10-21 16:01:28 +00:00
Jim Kowalkowski
e22ae5f857 Added ai/ao device support for vxWorks statics (memory/load/TCP con) 1996-10-21 15:30:37 +00:00
Jim Kowalkowski
926298ac6d double blob 1996-10-17 12:42:23 +00:00
Jim Kowalkowski
e135b2a4c0 blob 1996-10-17 12:42:07 +00:00
Jim Kowalkowski
69a07d8807 took out strdup function - replaced with strDup 1996-10-17 12:41:48 +00:00
Jim Kowalkowski
5c341931d0 network byte order stuff / added strDup function to Helpers 1996-10-17 12:41:07 +00:00
Jim Kowalkowski
f78d291850 adjusted the network byte ordering dump 1996-10-17 12:40:06 +00:00
Jim Kowalkowski
89e5f59610 removed strdup definition, fixed up the local/network byte order functions 1996-10-17 12:39:14 +00:00
Jim Kowalkowski
09ce70661a Modified to store records with a visibility option for graphic editors.
The ".db" file now generates "grecord" for visible records and "record" for
invisible records.
1996-10-17 00:17:30 +00:00
439 changed files with 23951 additions and 10229 deletions

View File

@@ -10,6 +10,9 @@
# [-b] - For fully built release
#
# $Log$
# Revision 1.9 1996/09/04 21:41:36 jba
# Top level dir no longer passed to MakeRelease
#
# Revision 1.8 1996/07/02 13:45:09 jba
# Added dbd and base/config dirs. Removed epics/config and base/rec.
#
@@ -87,35 +90,23 @@ if [ "${1}" = "-b" ]; then
fi
fi
# Retrieve EPICS release string from src/include/epicsVersion.h
grep EPICS_VERSION_STRING src/include/epicsVersion.h > /dev/null 2>&1 || ERR=1;
# Retrieve EPICS release string from config/CONFIG_BASE_VERSION
. config/CONFIG_BASE_VERSION
if [ "$ERR" = "1" ];
if [ -z "${EPICS_VERSION}" ];
then
echo "TOP: Cannot retrieve release number from include/epicsVersion.h";
echo "TOP: Cannot retrieve release number from config/CONFIG_BASE_VERSION";
exit 1;
fi
RELS=`grep "EPICS_VERSION_STRING" src/include/epicsVersion.h \
| sed -e 's-.*Version--' \
-e 's-[ ][ ]*--g' \
-e 's-".*--' \
-e 's-\.0$--'`;
if [ -z "${RELS}" ];
then
echo "TOP: Cannot retrieve release number from src/include/epicsVersion.h";
exit 1;
fi
RELS="R${RELS}";
RELS="R${EPICS_VERSION}.${EPICS_REVISION}.${EPICS_MODIFICATION}.${EPICS_UPDATE_NAME}${EPICS_UPDATE_LEVEL}";
echo TOP: Creating ../${RELS}.Tar;
if [ -f ${RELS}.Tar* ];
then
echo "TOP: This release has already been created.";
echo "TOP: Remove Tar file or edit src/include/epicsVersion.h.";
echo "TOP: Remove Tar file or edit config/CONFIG_BASE_VERSION.";
exit 1;
fi

161
README.WIN32 Normal file
View File

@@ -0,0 +1,161 @@
Compiling EPICS on WIN32 (Windows95/NT)
---------------------------------------
-kuk- 11/18/96 questions & comments please
mailto:kasemir@atdiv.lanl.gov
0) what you will get
--------------------
Right now this port of EPICS to WIN32 should allow you to
* compile almost all EPICS base using Tornado, MS Visual C
and some additional tools: gnumake, a UNIX-like shell, awk, sed, ...
(See below where to get these.)
* load EPICS on a PC IOC (486, pentium),
load simple databases
(no drivers/devices for real I/O available, yet.
Some Greenspring IP support [Relay, Dig, ADC, DAC] is in progress)
* build and use ca.dll on NT or Win95 to access all IOCs,
as well as the Com-library as a DLL.
The remaining libraries are statically linked and
therefore only accessible from programming languages like C,
not general WIN32 apps.
* build gdd, cas and a demo of the new portable CA server on WIN32.
* missing: the sequencer, makeExampleApp etc. and long term tests
1) see what you have
--------------------
To compiler EPICS on WIN32, we need
WindRiver Systems Tornado (used: 1.0)
Microsoft Visual C (used: 4.0)
and some tools:
a Unix-like shell
gnumake
basename
date
mv
touch
sort
All the above except. the shell are available 'on the net'
as sources which compile with MS Visual C++.
If you cannot/don't want to find them, contact me, please!
I could not find a shell that's fully operational.
The best one seems to be the Cygnus bash for WIN32, though it
still has errors and doesn't come with sources that compile
under MS VC++.
I use a small self-written shell called knts,
again: Contact me if you need it.
* The final solution to make the shell, basename, date, ...
* obsolete:
* Use
* 1) no shell scripts
* 2) Perl which is available for Unix and WIN32
In addition we need some binaries that I have no sources
for, yet, but that come with Tornado if and only if you
INSTALL THE FULL PACKAGE (!)
Including the 'WTX Test Suite i386/i486'
(under "Select Sub-components" when installing Tornado)
You should find in your <Tornado>/host/x86-win32/bin dir:
awk, cat, cp, rm, mkdir
(There is also a bash and a GNU-make which are really poor,
and WindRiver told me that they do not consider to support
those in the future, so I no longer use them.)
2) set environment variables
----------------------------
Your path should include:
- The EPICS-binaries that we are about to build in base/bin/WIN32
- The NTtools that you've built in step 1
- The System (for me it's in NT40...)
- The MS Visual C compiler binaries
- The Tornado binaries
Check with e.g.:
/users/kay/Src/epics/nttools >echo $Path
c:\users\kay\src\epics\base\bin\WIN32;c:\users\kay\src\epics\NTtools\bin;C:\NT40
\system32;C:\NT40;c:\msdev\bin;C:\users\Tornado\host\x86-win32\bin
On NT, $Path is defined by the operatin system, on Win95, it's $PATH instead.
knts tries to use PATH and falls back on Path,
what should wok on both systems.
MS Visual C and Tornado should be installed properly with
these env. variables set:
WIND_BASE=c:\usersTornado
WIND_HOST_TYPE=x86-win32
This way the EPICS makesystem can locate Tornado
without any changes to the files in base/config.
So for pc486 the settings in CONFIG_SITE where
you specify the location of VxWorks are ignored,
this information is taken from WIND_BASE and _HOST_TYPE!!
MSDevDir=C:\MSDEV
include=c:\msdev\include;c:\msdev\mfc\include
lib=c:\msdev\lib;c:\msdev\mfc\lib
(Setting env. vars. is different: for NT, use Settings/System,
for Win95 use autoexec.bat)
For EPICS, set:
# select host arch to build:
HOST_ARCH=WIN32
EPICS_CA_ADDR_LIST 128.165.32.255 (addr of WIN32 host)
EPICS_CA_AUTO_CA_ADDR_LIST NO
EPICS_CA_CONN_TMO 30.0
EPICS_CA_BEACON_PERIOD 15.0
EPICS_CA_REPEATER_PORT 5065
EPICS_CA_SERVER_PORT 5064
EPICS_TS_MIN_WEST 420 (Germany: -120)
To debug knts, set KNTS to 5:
KNTS=5
export KNTS
You should do this, however, only if you really want the debugging info.
3) building EPICS
-----------------
Prepare apx. 2 ltr. Tee and type:
cd <epics>/base
gnumake
Watch for errors and send them to me.
There might be loads of compiler warnings.
Known errors:
* gnumake seems to be faster than WIN32 sometimes
which results in warnings/errors like
"file has modification date in the future"
for newly vreated things.
Very seldom this is fatal, so you have to
stop gnumake and restart it.
* This is strange because Windows95/NT don't care
about upper/lower case:
WIN32 is WIN32, not win32. Gnumake fails
if e.g. base/src/include/os/WIN32 is ...win32.
Good luck !
-Kay

43
README.cxxTemplates Normal file
View File

@@ -0,0 +1,43 @@
The templates supplied with EPICS base are in $(EPICS)/base/src/cxxTemplates
In Stroustrups's "The C++ Programming Language" Appendix A: r.14.9
(ANSI/ISO resolutions) a mechanism is described for the explicit
instantiation of template member functions (that are not inline).
At this time some compilers do not support this mechanism (and use
a template database or smart linker instead). Other compilers
(such as g++) provide only limited support for other forms of
instantiation.
Since there is no defacto standard mechanism for instatiating
templates at this time we are defining the preprocessor flag
EXPL_TEMPL in the build system when the compiler supports
explicit instantiation.
EPICS codes that use templates may need to include a code block
as follow that instantiates the template only once into each
program.
#include <classXYZ.h>
#include <templXXX.h>
#include <templXXX.cc>
//
// if the compiler supports explicit instantiation of
// template member functions
//
#if defined(EXPL_TEMPL)
//
// From Stroustrups's "The C++ Programming Language"
// Appendix A: r.14.9
//
// This explicitly instantiates the template class's member
// functions into "templInst.o"
//
template class templXXX <classXYZ>;
#endif
Jeff Hill 3-6-97
johill@lanl.gov

View File

@@ -1,6 +1,9 @@
----------------------------------------------------------------------------
EPICS R3.12.2 Notes for Solaris
- By Andrew Johnson
updated 12-16-96 by Jeff Hill
----------------------------------------------------------------------------
Notes:
@@ -8,8 +11,10 @@ Notes:
1. In order to build EPICS under Solaris 2, you must ensure that the
solaris directory /usr/ccs/bin is in your search path.
2. It is not possible to compile EPICS under Solaris 2 using only the
GNU gcc compiler -- you must have the Sun SPARCworks ANSI C compiler.
2. It is now possible to compile EPICS under Solaris 2 using either the
GNU gcc compiler or the Sun SPARCworks ANSI C compiler. The g++/
Sun SPARCworks ANSI C compiler combination has compiled and linked
without errors but has not been extensively tested.
3. EPICS under Solaris 2 no longer uses the UCB compatability libraries.
In order to ensure that the /usr/ucblib files are not inherited, you

View File

@@ -3,14 +3,14 @@
#
# The developer may edit this file.
# Site-specific build options
#
include $(EPICS_BASE)/config/CONFIG_SITE
# EPICS base definitions
#
include $(EPICS_BASE)/config/CONFIG_COMMON
# Site-specific build options
#
include $(EPICS_BASE)/config/CONFIG_SITE
# assume T_A is the host arch if not specified
ifndef T_A
T_A = $(HOST_ARCH)
@@ -25,6 +25,7 @@ include $(EPICS_BASE)/config/CONFIG.$(T_A)
# User specific definitions
#
-include $(HOME)/.EPICS_CONFIG
-include $(HOME)/.EPICS_CONFIG.$(HOST_ARCH)
# All EPICS options other than BUILD_TYPE
# may be overridden here.

View File

@@ -14,8 +14,9 @@ BUILD_TYPE = Unix
GCC = gcc
ACC = acc
SUNCC = cc
AR = ar
AR = ar
ARFLAGS = r
ARCMD = $(AR) $(ARFLAGS)
RANLIB = ranlib
RANLIBFLAGS = -t
YACC = $(EYACC)
@@ -25,6 +26,8 @@ CCC = CC
MV = mv
RMDIR = rm -rf
MKDIR = mkdir
CHMOD = "/bin/chmod"
WHAT = what
ACC_ANSI_INVOKE_W_NO = $(ACC) -Xa -w
ACC_ANSI_INVOKE_W_YES = $(ACC) -Xa
@@ -51,15 +54,18 @@ CCC_NORMAL_INVOKE_W_YES = $(CCC) +p +w
CCC_STRICT_INVOKE_W_YES = $(CCC) +p +w
CCC_LD_FLAGS =
CCC_LD_LIBS =
CCC_TEMPL_INST_FLAG =
G++_NORMAL_INVOKE_W_NO = $(G++) -ansi -pedantic -w
G++_NORMAL_INVOKE_W_YES = $(G++) -ansi -pedantic -Wall
G++_STRICT_INVOKE_W_YES = $(G++) -ansi -pedantic -Wtraditional -Wall \
-Wmissing-prototypes -Woverloaded-virtual \
-Wwrite-strings -Wconversion -Wstrict-prototypes\
-Wpointer-arith -Winline
G++_TEMPL_INST_FLAG = -DEXPL_TEMPL
CXX_NORMAL = $($(CPLUSPLUS)_NORMAL_INVOKE_W_$(UNIX_WARN))
CXX_STRICT = $($(CPLUSPLUS)_STRICT_INVOKE_W_YES)
TEMPL_INST_CXXFLAG = $($(CPLUSPLUS)_TEMPL_INST_FLAG)
# GNU make likes CXX instead of CCC
CXX = $(CXX_$(CXXCMPLR))
@@ -83,7 +89,8 @@ OPTIM_NO =
UNIX_OPT_FLAGS = $(OPTIM_$(UNIX_OPT))
# Include files
UNIX_INCLUDES = -I. -I.. -I$(EPICS_BASE_INCLUDE)
UNIX_INCLUDES = -I. -I.. $(USR_INCLUDES) -I$(INSTALL_INCLUDE) -I$(EPICS_BASE_INCLUDE) \
-I$(EPICS_BASE_INCLUDE)/os/$(T_A)
# Operating system flags
OP_SYS_FLAGS = -DUNIX
@@ -92,27 +99,25 @@ UNIX_LDFLAGS = -L$(EPICS_BASE_LIB)
UNIX_LDLIBS = -lm
ARCH_DEP_CFLAGS = -D_X86_ -Dlinux
ARCH_DEP_CCFLAGS = $(ARCH_DEP_CFLAGS)
ARCH_DEP_CXXFLAGS = $(ARCH_DEP_CFLAGS)
UNIX_CFLAGS = $(UNIX_SFLAGS) $(USR_INCLUDES) $(UNIX_INCLUDES) $(OP_SYS_FLAGS)
UNIX_CFLAGS = $(UNIX_SFLAGS) $(UNIX_INCLUDES) $(OP_SYS_FLAGS)
UNIX_CCFLAGS = $(UNIX_CFLAGS)
UNIX_CXXFLAGS = $(UNIX_CFLAGS)
# Target specific flags
TARGET_CFLAGS = $($(basename $@)_CFLAGS)
TARGET_CCFLAGS = $($(basename $@)_CCFLAGS)
TARGET_CXXFLAGS = $($(basename $@)_CXXFLAGS)
TARGET_CPPFLAGS = $($(basename $@)_CPPFLAGS)
TARGET_LDFLAGS = $($(basename $@)_LDFLAGS)
TARGET_LDLIBS = $($(basename $@)_LDLIBS)
TARGET_SNCFLAGS = $($(basename $@)_SNCFLAGS)
CFLAGS = $(UNIX_OPT_FLAGS) $(TARGET_CFLAGS) $(USR_CFLAGS) $(ARCH_DEP_CFLAGS) $(UNIX_CFLAGS)
CCFLAGS = $(UNIX_OPT_FLAGS) $(TARGET_CCFLAGS) $(USR_CCFLAGS) $(ARCH_DEP_CCFLAGS) $(UNIX_CCFLAGS)
CXXFLAGS = $(UNIX_OPT_FLAGS) $(TARGET_CXXFLAGS) $(USR_CXXFLAGS) \
$(ARCH_DEP_CXXFLAGS) $(UNIX_CXXFLAGS) $(TEMPL_INST_CXXFLAG)
CPPFLAGS += $(TARGET_CPPFLAGS) $(USR_CPPFLAGS)
# GNU make likes CXX instead of CCC
CXXFLAGS = $(CCFLAGS)
LDFLAGS = $(SPECIAL_LDFLAGS) $(TARGET_LDFLAGS) $(USR_LDFLAGS) $(ARCH_DEP_LDFLAGS) $(UNIX_LDFLAGS)
LDLIBS = $(TARGET_LDLIBS) $(USR_LDLIBS) $(ARCH_DEP_LDLIBS) $(UNIX_LDLIBS)
@@ -120,7 +125,7 @@ LDLIBS = $(TARGET_LDLIBS) $(USR_LDLIBS) $(ARCH_DEP_LDLIBS) $(UNIX_LDLIBS)
COMPILE.c = $(CC) $(CFLAGS) $(CPPFLAGS) -c
COMPILE.cc = $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c
LINK.c = $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
LINK.cc = $(CXX) $(CCFLAGS) $(CPPFLAGS) $(LDFLAGS)
LINK.cc = $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS)
DEPENDS_RULE.c = -$(COMPILE.c) -M $(SRCS.c) > .DEPENDS
DEPENDS_RULE.cc = @echo no DEPENDS_RULE.cc defined in CONFIG.Unix.Linux
DEPENDS_RULE.cc = @echo no DEPENDS_RULE.cc defined in CONFIG.Linux

View File

@@ -8,7 +8,6 @@ RANLIB = $(VX_GNU_BIN)/ranlib68k
YACC = $(EYACC)
LEX = $(ELEX)
CC = $(VX_GNU_BIN)/cc68k -B$(VX_GNU_LIB)/gcc-lib/ -nostdinc
CXX = $(VX_GNU_BIN)/cc68k -B$(VX_GNU_LIB)/gcc-lib/ -nostdinc
CPP = $(VX_GNU_BIN)/cpp68k -nostdinc
#CPP = $(CC) -E
GCC = $(CC)
@@ -16,8 +15,55 @@ LD = $(VX_GNU_BIN)/ld68k -r
EPICS_LDLIBS =
MV=mv
RM=rm -f
MKDIR=mkdir
MKDIR = mkdir
RMDIR=rm -rf
WHAT = what
#----------------------------
# Only G++ currently supported
CPLUSPLUS = G++
CXXCMPLR = NORMAL
VX_OPT = YES
BOARD = $(subst mv,MV,$(T_A))
CPU = 68000
OS = VXWORKS
#----------------------------
CCC = $(VX_GNU_BIN)/cc68k -B$(VX_GNU_LIB)/gcc-lib/ -nostdinc
AR_CCC = $(VX_GNU_BIN)/ar68k
CPP_CCC = $(VX_GNU_BIN)/cpp68k -nostdinc
RANLIB_CCC = $(VX_GNU_BIN)/ranlib68k
LD_CCC = $(VX_GNU_BIN)/ld68k
CCC_CCFLAGS =
CCC_ARCH_DEP_CCFLAGS =
CCC_ARCH_DEP_LDFLAGS =
G++ = $(GNU_BIN)/sun3-g++ -B$(GNU_LIB)/gcc-lib/ -nostdinc -DEXPL_TEMPL
AR_G++ = $(GNU_BIN)/sun3-ar
CPP_G++ = $(GNU_BIN)/sun3-cpp
RANLIB_G++ = $(GNU_BIN)/sun3-ranlib
LD_G++ = $(GNU_BIN)/sun3-ld
G++_ARCH_DEP_CCFLAGS = --no-builtin -Wa,"-m68040" -DOS_EQ_$(OS) \
-DBOARD_EQ_$(BOARD) -DCPU_EQ_$(CPU) -DBOARD=$(BOARD)
G++_ARCH_DEP_LDFLAGS = -Ur -N -T$(EPICS_BASE_BIN)/vxldscript.MRI
CCC_NORMAL = $(CCC)
CCC_STRICT = $(CCC) -ansi -pedantic -Wtraditional \
-Wmissing-prototypes -Woverloaded-virtual \
-Wwrite-strings -Wconversion -Wstrict-prototypes\
-Wpointer-arith -Winline
G++_NORMAL = $(G++)
G++_STRICT = $(G++) -ansi -pedantic -Wtraditional
CXX = $($(CPLUSPLUS)_$(CXXCMPLR))
AR_CXX = $(AR_$(CPLUSPLUS))
CPP_CXX = $(CPP_$(CPLUSPLUS))
RANLIB_CXX = $(RANLIB_$(CPLUSPLUS))
LD_CXX = $(LD_$(CPLUSPLUS))
ARCH_DEP_CXXFLAGS += $($(CPLUSPLUS)_ARCH_DEP_CCFLAGS) $(ARCH_DEP_CFLAGS)
ARCH_DEP_CXXLDFLAGS = $($(CPLUSPLUS)_ARCH_DEP_LDFLAGS) $(ARCH_DEP_LDFLAGS)
# special c library requirements
SPECIAL_LANG =
@@ -29,12 +75,13 @@ VX_OPT_NO =
VX_OPT_FLAGS = $(VX_OPT_$(VX_OPT))
# Include files
VX_INCLUDES = -I. -I.. -I$(EPICS_BASE_INCLUDE) -I$(VX_INCLUDE)
VX_INCLUDES = -I. -I.. $(USR_INCLUDES) -I$(INSTALL_INCLUDE) -I$(EPICS_BASE_INCLUDE) \
-I$(EPICS_BASE_INCLUDE)/os/vxWorks -I$(VX_INCLUDE)
# Warnings
#At some time we should turn on pedantic
#VX_WARN_YES = -Wall -pedantic
VX_WARN_YES = -W
VX_WARN_YES = -Wall
VX_WARN_NO =
VX_WARN_FLAGS = $(VX_WARN_$(VX_WARN))
@@ -42,29 +89,31 @@ VX_WARN_FLAGS = $(VX_WARN_$(VX_WARN))
VX_OP_SYS_FLAGS = -DvxWorks -DV5_vxWorks
# Arch dependent flags are set in CONFIG_ARCH.*
VX_CFLAGS = $(VX_OPT_FLAGS) $(VX_WARN_FLAGS) $(USR_INCLUDES) \
VX_CFLAGS = $(VX_OPT_FLAGS) $(VX_WARN_FLAGS) \
$(VX_INCLUDES) $(VX_OP_SYS_FLAGS)
VX_CXXFLAGS += $(VX_CFLAGS)
VX_LDFLAGS = -o
VX_LDFLAGS = -o
TARGET_CFLAGS = $($(basename $@)_CFLAGS)
TARGET_CXXFLAGS = $($(basename $@)_CXXFLAGS)
TARGET_LDFLAGS = $($(basename $@)_LDFLAGS)
TARGET_CPPFLAGS = $($(basename $@)_CPPFLAGS)
TARGET_SNCFLAGS = $($(basename $@)_SNCFLAGS)
CFLAGS = $(TARGET_CFLAGS) $(USR_CFLAGS) $(ARCH_DEP_CFLAGS) $(VX_CFLAGS)
CXXFLAGS = $(TARGET_CFLAGS) $(USR_CFLAGS) $(ARCH_DEP_CFLAGS) $(VX_CFLAGS)
LDFLAGS = $(TARGET_LDFLAGS) $(USR_LDFLAGS) $(ARCH_DEP_LDFLAGS) $(VX_LDFLAGS)
CXXFLAGS = $(TARGET_CXXFLAGS) $(USR_CXXFLAGS) $(ARCH_DEP_CXXFLAGS) $(VX_CXXFLAGS)
LDFLAGS = $(TARGET_LDFLAGS) $(USR_LDFLAGS) $(ARCH_DEP_LDFLAGS) $(VX_LDFLAGS)
CXXLDFLAGS = $(TARGET_LDFLAGS) $(USR_LDFLAGS) $(ARCH_DEP_CXXLDFLAGS) $(VX_LDFLAGS)
CPPFLAGS += $(TARGET_CPPFLAGS) $(USR_CPPFLAGS)
# Build compile line here
COMPILE.c = $(CC) $(CFLAGS) $(CPPFLAGS) -c
LINK.c = $(LD) $(LDFLAGS)
COMPILE.cc = $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c
LINK.cc = $(LD) $(LDFLAGS)
LINK.cc = $(LD_CXX) $(CXXLDFLAGS)
CPPSNCFLAGS = $(USR_INCLUDES) $(VX_INCLUDES)
CPPSNCFLAGS = $(VX_INCLUDES)
DEPENDS_RULE.c = -$(COMPILE.c) -M $(SRCS.c) > .DEPENDS
DEPENDS_RULE.cc = -$(COMPILE.cc) -M $(SRCS.cc) > .DEPENDS
DEPENDS_RULE.c = -$(COMPILE.c) -M $(SRCS.c) >> .DEPENDS
DEPENDS_RULE.cc = -$(COMPILE.cc) -M $(SRCS.cc) >> .DEPENDS

93
config/CONFIG.Vx.pc486 Normal file
View File

@@ -0,0 +1,93 @@
# $Id$
#
# This file is maintained by the EPICS community.
# OLDINSTALL def used only for releases prior to R3.12.2.2
# Unix Compiler and other Utilities
OLDINSTALL = echo CONFIG.Vx.486 OLDINSTALL
MV=mv
RM=rm -f
CP=cp
RMDIR=rm -rf
MKDIR=mkdir
CHMOD = "/bin/chmod"
WHAT = what
# overrides defines in CONFIG_SITE that don't fit Tornado
#
# We are lucky because
# this should not really be site specific
#
# (if Tornado is installed correctly
# -> WIND_BASE, WIND_HOST_TYPE set )
#
# At first we hack a little bit on WIND_BASE
# to convert the DOS style into a Unix style path:
#
# If C: was in WIND_BASE, it's converted into c: (lowercase),
# then c: is removed and all '\' are converted into '/'.
SANE_WIND_BASE := $(subst \,/,$(subst c:,,$(subst C:,c:,$(WIND_BASE))))
VX_DIR := $(SANE_WIND_BASE)/target
VX_GNU := $(SANE_WIND_BASE)/host/$(WIND_HOST_TYPE)
VX_GNU_BIN := $(VX_GNU)/bin
VX_GNU_LIB := $(VX_GNU)/lib
VX_IMAGE = $(VX_CONFIG_DIR)/$(T_A)/vxWorks
VX_IMAGE_SYM = $(VX_CONFIG_DIR)/$(T_A)/vxWorks.sym
AR = $(VX_GNU_BIN)/ar386
RANLIB = $(VX_GNU_BIN)/ranlib386
YACC = $(EYACC)
LEX = $(ELEX)
CC = $(VX_GNU_BIN)/cc386 -B$(VX_GNU_LIB)/gcc-lib/ -nostdinc -fno-builtin -fno-defer-pop
CPP = $(VX_GNU_BIN)/cpp386 -nostdinc
#CPP = $(CC) -E
GCC = $(CC)
LD = $(VX_GNU_BIN)/ld386 -r
EPICS_LDLIBS =
# special c library requirements
SPECIAL_LANG =
# Compiler flags, don't mess with this
# Optimization flags
VX_OPT_YES = -O
VX_OPT_NO = -O0
VX_OPT_FLAGS = $(VX_OPT_$(VX_OPT))
# Include files
VX_INCLUDES = -I. -I.. $(USR_INCLUDES) -I$(INSTALL_INCLUDE) -I$(EPICS_BASE_INCLUDE) \
-I$(EPICS_BASE_INCLUDE)/os/vxWorks -I$(VX_INCLUDE)
# Warnings
#At some time we should turn on pedantic
#VX_WARN_YES = -Wall -pedantic
VX_WARN_YES = -W
VX_WARN_NO =
VX_WARN_FLAGS = $(VX_WARN_$(VX_WARN))
# Operating system flags
VX_OP_SYS_FLAGS = -DvxWorks -DV5_vxWorks
# Arch dependent flags are set in CONFIG_ARCH.*
VX_CFLAGS = $(VX_OPT_FLAGS) $(VX_WARN_FLAGS) \
$(VX_INCLUDES) $(VX_OP_SYS_FLAGS)
VX_LDFLAGS = -o
TARGET_CFLAGS = $($(basename $@)_CFLAGS)
TARGET_LDFLAGS = $($(basename $@)_LDFLAGS)
CFLAGS = $(TARGET_CFLAGS) $(USR_CFLAGS) $(ARCH_DEP_CFLAGS) $(VX_CFLAGS)
LDFLAGS = $(TARGET_LDFLAGS) $(USR_LDFLAGS) $(ARCH_DEP_LDFLAGS) $(VX_LDFLAGS)
# Build compile line here
COMPILE.c = $(CC) $(CFLAGS) $(CPPFLAGS) -c
COMPILE.cc = $(CC) -x 'c++' -DEXPL_TEMPL $(CFLAGS) $(CPPFLAGS) -c
LINK.c = $(LD) $(LDFLAGS)
CPPSNCFLAGS = $(USR_INCLUDES) $(VX_INCLUDES)
DEPENDS_RULE.c = -$(COMPILE.c) -M $(SRCS.c) >> .DEPENDS
DEPENDS_RULE.cc = @echo no DEPENDS_RULE.cc defined in CONFIG.68k

128
config/CONFIG.WIN32 Normal file
View File

@@ -0,0 +1,128 @@
# CONFIG.WIN32 -kuk-
#
# The current make-system for WIN32
# needs
# * gnumake (OK, sources for WIN32 are available)
# * several UNIX tools: sed, grep, ... (dito)
# * a UNIX-like shell (ouch!)
#
# I found no fully operational shell and no sources for WIN32 so far,
# Cygnus' bash e.g. cannot handle this:
# (echo a>a; echo b>>a)
# Right now I use the knts that I wrote and simplified scripts.
# Jeff eliminated many shell-lines in Makefile.*,
# the final solution could be:
# 1) replace shell, awk, grep, sed, ... by Perl!
# 2) use C code
#
# Set this to the UNIX-like shell that you have:
SHELL=knts
# BUILD_TYPE
# Currently either Vx or Host (latter used to be Unix)
BUILD_TYPE=Host
# to identify the general architecture class:
# should be BSD, SYSV, WIN32, ...
# is: WIN32, sun4, hpux, linux, ...
#
ARCH_CLASS=WIN32
EXE=.exe
OBJ=.obj
# ifdef WIN32 looks better that ifeq ($(ARCH_CLASS),WIN32) ??
WIN32=1
# Compiler and utility invocation (supply path to compiler here)
# (with warning flags built in)
# Paths to compilers
YACC = $(EYACC)
LEX = $(ELEX)
CC = cl -nologo
MV=mv
RM=rm -f
MKDIR=mkdir
RMDIR=rm -rf
WHAT = echo
# Include files
HOST_INCLUDES = -I. -I.. $(USR_INCLUDES) -I$(INSTALL_INCLUDE) -I$(EPICS_BASE_INCLUDE) \
-I$(EPICS_BASE_INCLUDE)/os/$(ARCH_CLASS)
# Operating system flags (from win32.mak)
#
# __STDC__=0 is a real great idea of Jeff that gives us both:
# 1) define STDC for EPICS code (pretend ANSI conformance)
# 2) set it to 0 to use MS C "extensions" (open for _open etc.)
# because MS uses: if __STDC__ ... disable many nice things
#
# -MDd : use MSVCRTD (run-time as DLL, multi-thread support)
# this also calls for _DLL
# -Zi : included debugging info
#
OP_SYS_FLAGS:=-MDd -Zi -VMG -VMV -DWIN32 -D_WIN32 -D_DEBUG -D_WINDOWS \
-D_X86_ -D_NTSDK -D_DLL -D__STDC__=0
# Files and flags needed to link DLLs (used in RULES.Host)
#
# Strange but seems to work without: WIN32LDFLAGS should contain
# an entry point:
# '-entry:_DllMainCRTStartup$(DLLENTRY)'
DLLENTRY:=@12
WIN32SYSTEMLIBS := user32.lib kernel32.lib wsock32.lib advapi32.lib winmm.lib
# yes, for MS it's I386 for 386, 486, Pentium!
# don't mix this with VxWorks which has different BSPs for [34]86 !
WIN32LDFLAGS := $(WIN32SYSTEMLIBS) -nologo -subsystem:windows -dll\
-incremental:no -debug -machine:I386
#
# The remaining lines are very similar to
# all other CONFIG.xxx files.
# This includes the GCC lines which may be removed?
#
HOST_LDLIBS:=$(WIN32SYSTEMLIBS)
ARCH_DEP_CFLAGS =
ARCH_DEP_CXXFLAGS = $(ARCH_DEP_CFLAGS)
HOST_CFLAGS = $(HOST_SFLAGS) $(HOST_INCLUDES) $(OP_SYS_FLAGS)
HOST_CXXFLAGS = $(HOST_CFLAGS)
# Target specific flags
TARGET_CFLAGS = $($(basename $@)_CFLAGS)
TARGET_CXXFLAGS = $($(basename $@)_CXXFLAGS)
TARGET_CPPFLAGS = $($(basename $@)_CPPFLAGS)
TARGET_LDFLAGS = $($(basename $@)_LDFLAGS)
TARGET_LDLIBS = $($(basename $@)_LDLIBS)
TARGET_SNCFLAGS = $($(basename $@)_SNCFLAGS)
CFLAGS = $(HOST_OPT_FLAGS) $(TARGET_CFLAGS) $(USR_CFLAGS) $(ARCH_DEP_CFLAGS) $(HOST_CFLAGS)
CXXFLAGS = $(HOST_OPT_FLAGS) $(TARGET_CXXFLAGS) $(USR_CXXFLAGS) $(ARCH_DEP_CXXFLAGS) $(HOST_CXXFLAGS)
CPPFLAGS += $(TARGET_CPPFLAGS) $(USR_CPPFLAGS)
CXX = cl
LDFLAGS = $(SPECIAL_LDFLAGS) $(TARGET_LDFLAGS) $(USR_LDFLAGS) $(ARCH_DEP_LDFLAGS) $(HOST_LDFLAGS)
LDLIBS = $(TARGET_LDLIBS) $(USR_LDLIBS) $(ARCH_DEP_LDLIBS) $(HOST_LDLIBS)
# Override SUN defaults
COMPILE.c = $(CC) $(CFLAGS) $(CPPFLAGS) -c
# Problem: MS Visual C++ does not recognize *.cc as C++ source,
# we have to compile xx.cc using the flag -Tp xx.cc,
# i.e. -Tp has to be immediately before the source file name
COMPILE.cc = $(CXX) $(CXXFLAGS) $(CPPFLAGS) -DEXPL_TEMPL -c -Tp
LINK.c = $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -Fe$@
LINK.cc = $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) -Fe$@
# The DEPENDS_RULE may be a script on other systems,
# if you need different rules for .c and .cc,
# that script has to figure out what to call.
#
DEPENDS_RULE = @echo no DEPENDS_RULE defined in CONFIG.WIN32

View File

@@ -3,31 +3,47 @@
# This file is maintained by the EPICS community.
# BUILD_TYPE
# Currently either Vx or Unix
BUILD_TYPE = Unix
# Currently either Vx or Host
BUILD_TYPE = Host
ARCH_CLASS = alpha
# Compiler and utility invocation (supply path to compiler here)
# (with warning flags built in)
# Paths to compilers
GCC = gcc
ACC = cc -std
TRADCC = cc -traditional
AR = ar
ACC = cc
AR = ar -rc
_AR = $(AR) $(ARFLAGS)
G++_AR = $(_AR)
CCC_AR = $(AR)
ARCMD = $($(CPLUSPLUS)_AR)
RANLIB = ranlib
YACC = $(EYACC)
LEX = $(ELEX)
G++ = g++
CCC = CC
CCC = cc
CP=cp
MV = mv
RM=rm -f
RMDIR = rm -rf
MKDIR = mkdir
CHMOD = "/bin/chmod"
WHAT = what
ACC_ANSI_INVOKE_W_NO = $(ACC) -w
ACC_ANSI_INVOKE_W_YES = $(ACC)
ACC_STRICT_INVOKE_W_YES = $(ACC) -stdl -w
ACC_STRICT_INVOKE_W_NO = $(ACC) -stdl
ACC_TRAD_INVOKE_W_NO = $(ACC) -w
ACC_TRAD_INVOKE_W_YES = $(ACC)
EXE=
OBJ=.o
ACC_ANSI_INVOKE_W_NO = $(ACC) -std -w
ACC_ANSI_INVOKE_W_YES = $(ACC) -std
ACC_STRICT_INVOKE_W_YES = $(ACC) -std1 -w
ACC_STRICT_INVOKE_W_NO = $(ACC) -std1
ACC_TRAD_INVOKE_W_NO = $(ACC) -std0 -w
ACC_TRAD_INVOKE_W_YES = $(ACC) -std0
GCC_ANSI_INVOKE_W_NO = $(GCC) -ansi -w
GCC_ANSI_INVOKE_W_YES = $(GCC) -ansi
GCC_STRICT_INVOKE_W_NO = $(GCC) -ansi -pedantic
@@ -45,15 +61,18 @@ CCC_NORMAL_INVOKE_W_YES = $(CCC) +p +w
CCC_STRICT_INVOKE_W_YES = $(CCC) +p +w
CCC_LD_FLAGS =
CCC_LD_LIBS =
CCC_TEMPL_INST_FLAG =
G++_NORMAL_INVOKE_W_NO = $(G++) -ansi -pedantic -w
G++_NORMAL_INVOKE_W_YES = $(G++) -ansi -pedantic -Wall
G++_STRICT_INVOKE_W_YES = $(G++) -ansi -pedantic -Wtraditional -Wall \
-Wmissing-prototypes -Woverloaded-virtual \
-Wwrite-strings -Wconversion -Wstrict-prototypes\
-Wpointer-arith -Winline
G++_TEMPL_INST_FLAG = -DEXPL_TEMPL
CXX_NORMAL = $($(CPLUSPLUS)_NORMAL_INVOKE_W_$(UNIX_WARN))
CXX_STRICT = $($(CPLUSPLUS)_STRICT_INVOKE_W_YES)
TEMPL_INST_CXXFLAG = $($(CPLUSPLUS)_TEMPL_INST_FLAG)
# GNU make likes CXX instead of CCC
CXX = $(CXX_$(CXXCMPLR))
@@ -77,7 +96,8 @@ OPTIM_NO =
UNIX_OPT_FLAGS = $(OPTIM_$(UNIX_OPT))
# Include files
UNIX_INCLUDES = -I. -I.. -I$(EPICS_BASE_INCLUDE)
UNIX_INCLUDES = -I. -I.. $(USR_INCLUDES) -I$(INSTALL_INCLUDE) -I$(EPICS_BASE_INCLUDE) \
-I$(EPICS_BASE_INCLUDE)/os/$(T_A)
# Operating system flags
OP_SYS_FLAGS = -DUNIX
@@ -86,24 +106,27 @@ SPECIAL_LDFLAGS =
UNIX_LDFLAGS = -L$(EPICS_BASE_LIB)
UNIX_LDLIBS = -lm
ARCH_DEP_CFLAGS = -D_OSF_SOURCE -DLITTLE_ENDIAN
ARCH_DEP_CCFLAGS = $(ARCH_DEP_CFLAGS)
UNIX_CFLAGS = $(UNIX_SFLAGS) $(USR_INCLUDES) $(UNIX_INCLUDES) $(OP_SYS_FLAGS)
# Architecture specific build flags
ARCH_DEP_CFLAGS = -D_OSF_SOURCE
ARCH_DEP_CXXFLAGS = $(ARCH_DEP_CFLAGS)
ARCH_DEP_LDLIBS = -lnsl
UNIX_CFLAGS = $(UNIX_SFLAGS) $(UNIX_INCLUDES) $(OP_SYS_FLAGS)
UNIX_CCFLAGS = $(UNIX_CFLAGS)
UNIX_CXXFLAGS = $(UNIX_CFLAGS)
# Target specific flags
TARGET_CFLAGS = $($(basename $@)_CFLAGS)
TARGET_CCFLAGS = $($(basename $@)_CCFLAGS)
TARGET_CXXFLAGS = $($(basename $@)_CXXFLAGS)
TARGET_CPPFLAGS = $($(basename $@)_CPPFLAGS)
TARGET_LDFLAGS = $($(basename $@)_LDFLAGS)
TARGET_LDLIBS = $($(basename $@)_LDLIBS)
TARGET_SNCFLAGS = $($(basename $@)_SNCFLAGS)
CFLAGS = $(UNIX_OPT_FLAGS) $(TARGET_CFLAGS) $(USR_CFLAGS) $(ARCH_DEP_CFLAGS) $(UNIX_CFLAGS)
CCFLAGS = $(UNIX_OPT_FLAGS) $(TARGET_CCFLAGS) $(USR_CCFLAGS) $(ARCH_DEP_CCFLAGS) $(UNIX_CCFLAGS)
CXXFLAGS = $(UNIX_OPT_FLAGS) $(TARGET_CXXFLAGS) $(USR_CXXFLAGS) \
$(ARCH_DEP_CXXFLAGS) $(UNIX_CXXFLAGS) $(TEMPL_INST_CXXFLAG)
CPPFLAGS += $(TARGET_CPPFLAGS) $(USR_CPPFLAGS)
CXXFLAGS = $(CCFLAGS)
LDFLAGS = $(SPECIAL_LDFLAGS) $(TARGET_LDFLAGS) $(USR_LDFLAGS) $(ARCH_DEP_LDFLAGS) $(UNIX_LDFLAGS)
LDLIBS = $(TARGET_LDLIBS) $(USR_LDLIBS) $(ARCH_DEP_LDLIBS) $(UNIX_LDLIBS)
@@ -111,9 +134,10 @@ LDLIBS = $(TARGET_LDLIBS) $(USR_LDLIBS) $(ARCH_DEP_LDLIBS) $(UNIX_LDLIBS)
# Override defaults
COMPILE.c = $(CC) $(CFLAGS) $(CPPFLAGS) -c
COMPILE.cc = $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c
LINK.c = $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
LINK.cc = $(CXX) $(CCFLAGS) $(CPPFLAGS) $(LDFLAGS)
# Unlike the 'Unix' makesystem, output flags -o .. are now part of LINK.c[c]
LINK.c = $(CC) -o $@ $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
LINK.cc = $(CXX) -o $@ $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS)
DEPEND_RULE.c = @echo echo no DEPENDS_RULE.c defined in CONFIG.Unix.alpha
DEPEND_RULE.cc = @echo echo no DEPENDS_RULE.cc defined in CONFIG.Unix.alpha
DEPEND_RULE.c = @echo no DEPENDS_RULE.c defined in CONFIG.alpha
DEPEND_RULE.cc = @echo no DEPENDS_RULE.cc defined in CONFIG.alpha

View File

@@ -14,7 +14,8 @@ ACC = cc -Aa
HPACC = cc -Aa
HPCC = cc -Ac
TRADCC = cc
AR = ar
AR = ar
ARCMD = $(AR) $(ARFLAGS)
RANLIB = ranlib
YACC = $(EYACC)
LEX = $(ELEX)
@@ -23,6 +24,8 @@ CCC = CC
MV = mv
RMDIR = rm -rf
MKDIR = mkdir
CHMOD = "/bin/chmod"
WHAT = what
ACC_ANSI_INVOKE_W_NO = $(ACC) -w
ACC_ANSI_INVOKE_W_YES = $(ACC)
@@ -48,15 +51,18 @@ CCC_NORMAL_INVOKE_W_YES = $(CCC) +p +w
CCC_STRICT_INVOKE_W_YES = $(CCC) +p +w
CCC_LD_FLAGS =
CCC_LD_LIBS =
CCC_TEMPL_INST_FLAG =
G++_NORMAL_INVOKE_W_NO = $(G++) -ansi -pedantic -w
G++_NORMAL_INVOKE_W_YES = $(G++) -ansi -pedantic -Wall
G++_STRICT_INVOKE_W_YES = $(G++) -ansi -pedantic -Wtraditional -Wall \
-Wmissing-prototypes -Woverloaded-virtual \
-Wwrite-strings -Wconversion -Wstrict-prototypes\
-Wpointer-arith -Winline
G++_TEMPL_INST_FLAG = -DEXPL_TEMPL
CXX_NORMAL = $($(CPLUSPLUS)_NORMAL_INVOKE_W_$(UNIX_WARN))
CXX_STRICT = $($(CPLUSPLUS)_STRICT_INVOKE_W_YES)
TEMPL_INST_CXXFLAG = $($(CPLUSPLUS)_TEMPL_INST_FLAG)
# GNU make likes CXX instead of CCC
CXX = $(CXX_$(CXXCMPLR))
@@ -85,7 +91,8 @@ OPTIM_NO =
UNIX_OPT_FLAGS = $(OPTIM_$(UNIX_OPT))
# Include files
UNIX_INCLUDES = -I. -I.. -I$(EPICS_BASE_INCLUDE)
UNIX_INCLUDES = -I. -I.. $(USR_INCLUDES) -I$(INSTALL_INCLUDE) -I$(EPICS_BASE_INCLUDE) \
-I$(EPICS_BASE_INCLUDE)/os/$(T_A)
# Operating system flags
OP_SYS_FLAGS = -DUNIX
@@ -95,23 +102,23 @@ UNIX_LDFLAGS = -L$(EPICS_BASE_LIB)
UNIX_LDLIBS = -lm
ARCH_DEP_CFLAGS = -D_HPUX_SOURCE -DHP_UX
ARCH_DEP_CCFLAGS = $(ARCH_DEP_CFLAGS)
ARCH_DEP_CXXFLAGS = $(ARCH_DEP_CFLAGS)
UNIX_CFLAGS = $(UNIX_SFLAGS) $(USR_INCLUDES) $(UNIX_INCLUDES) $(OP_SYS_FLAGS)
UNIX_CCFLAGS = $(UNIX_CFLAGS)
UNIX_CFLAGS = $(UNIX_SFLAGS) $(UNIX_INCLUDES) $(OP_SYS_FLAGS)
UNIX_CXXFLAGS = $(UNIX_CFLAGS)
# Target specific flags
TARGET_CFLAGS = $($(basename $@)_CFLAGS)
TARGET_CCFLAGS = $($(basename $@)_CCFLAGS)
TARGET_CXXFLAGS = $($(basename $@)_CXXFLAGS)
TARGET_CPPFLAGS = $($(basename $@)_CPPFLAGS)
TARGET_LDFLAGS = $($(basename $@)_LDFLAGS)
TARGET_LDLIBS = $($(basename $@)_LDLIBS)
TARGET_SNCFLAGS = $($(basename $@)_SNCFLAGS)
CFLAGS = $(UNIX_OPT_FLAGS) $(TARGET_CFLAGS) $(USR_CFLAGS) $(ARCH_DEP_CFLAGS) $(UNIX_CFLAGS)
CCFLAGS = $(UNIX_OPT_FLAGS) $(TARGET_CCFLAGS) $(USR_CCFLAGS) $(ARCH_DEP_CCFLAGS) $(UNIX_CCFLAGS)
CXXFLAGS = $(UNIX_OPT_FLAGS) $(TARGET_CXXFLAGS) $(USR_CXXFLAGS) \
$(ARCH_DEP_CXXFLAGS) $(UNIX_CXXFLAGS) $(TEMPL_INST_CXXFLAG)
CPPFLAGS += $(TARGET_CPPFLAGS) $(USR_CPPFLAGS)
CXXFLAGS = $(CCFLAGS)
ARFLAGS = rv
@@ -122,7 +129,7 @@ LDLIBS = $(TARGET_LDLIBS) $(USR_LDLIBS) $(ARCH_DEP_LDLIBS) $(UNIX_LDLIBS)
COMPILE.c = $(CC) $(CFLAGS) $(CPPFLAGS) -c
COMPILE.cc = $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c
LINK.c = $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
LINK.cc = $(CXX) $(CCFLAGS) $(CPPFLAGS) $(LDFLAGS)
DEPEND_RULE.c = @echo echo no DEPENDS_RULE.c defined in CONFIG.Unix.hp700
DEPEND_RULE.cc = @echo echo no DEPENDS_RULE.cc defined in CONFIG.Unix.hp700
LINK.cc = $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS)
DEPENDS_RULE.c = @echo no DEPENDS_RULE.c defined in CONFIG.hp700
DEPENDS_RULE.cc = @echo no DEPENDS_RULE.cc defined in CONFIG.hp700

16
config/CONFIG.mv177 Normal file
View File

@@ -0,0 +1,16 @@
# $Id$
#
# This file is maintained by the EPICS community.
BUILD_TYPE = Vx
# For Vx directories of form:
# $(VX_DIR)/$(HOST_ARCH).$(ARCH_CLASS)/bin
ARCH_CLASS = 68k
include $(EPICS_BASE)/config/CONFIG.$(BUILD_TYPE).$(ARCH_CLASS)
# Architecture specific build flags
ARCH_DEP_CFLAGS = -DCPU=MC68060 -m68040 -DCPU_FAMILY=MC680X0

27
config/CONFIG.pc486 Normal file
View File

@@ -0,0 +1,27 @@
SHELL=knts
# BUILD_TYPE
# Currently either Vx or Unix
BUILD_TYPE = Vx
# For Vx directories of form:
#
# $(VX_DIR)/$(HOST_ARCH).$(ARCH_CLASS)/bin
#
# And configuration files:
#
# CONFIG_SITE.Vx.68k -or- CONFIG_SITE.Unix.sun4
#
ARCH_CLASS = pc486
include $(EPICS_BASE)/config/CONFIG.$(BUILD_TYPE).$(ARCH_CLASS)
# Architecture specific build flags
# Defines:
# CPU, CPU_FAMILY is used by VxWorks header files,
# _X86_ is used in base/src/ca
#
# -g is for debugging information, I didn't know where elso to put it
#
ARCH_DEP_CFLAGS = -DCPU=I80486 -m486 -DCPU_FAMILY=I80x86 -D_X86_ -g

View File

@@ -4,35 +4,44 @@
# This file is maintained by the EPICS community.
# BUILD_TYPE
# Currently either Vx or Unix
BUILD_TYPE = Unix
# Currently either Vx or Host
BUILD_TYPE = Host
ARCH_CLASS = sgi
# Compiler and utility invocation (supply path to compiler here)
# (with warning flags built in)
# Paths to compilers
GCC = cc
ACC = cc
KRCC = cc -cckr
AR = ar
AR = ar
ARCMD = $(AR) $(ARFLAGS)
ARFLAGS = r
RANLIB = ls
RANLIBFLAGS =
RANLIB =
YACC = $(EYACC)
LEX = $(ELEX)
G++ = g++
CCC = CC
CP=cp
MV = mv
RM=rm -f
RMDIR = rm -rf
MKDIR = mkdir
CHMOD = "/bin/chmod"
WHAT = what
EXE=
OBJ=.o
ACC_ANSI_INVOKE_W_NO = $(ACC) -xansi -w
ACC_ANSI_INVOKE_W_YES = $(ACC) -xansi
ACC_TRAD_INVOKE_W_NO = $(ACC) -Xs -xansi -w
ACC_TRAD_INVOKE_W_YES = $(ACC) -Xs -xansi
KRCC_TRAD_INVOKE_W_NO = $(KRCC) -w
KRCC_TRAD_INVOKE_W_YES = $(KRCC)
ACC_STRICT_INVOKE_W_NO = $(ACC) -ansi -w
ACC_STRICT_INVOKE_W_YES = $(ACC) -ansi
ACC_STRICT_INVOKE_W_NO = $(ACC) -xansi -w
ACC_STRICT_INVOKE_W_YES = $(ACC) -xansi
ACC_TRAD_INVOKE_W_NO = $(ACC) -cckr -Xs -w
ACC_TRAD_INVOKE_W_YES = $(ACC) -cckr -Xs
GCC_ANSI_INVOKE_W_NO = $(GCC) -ansi -w
GCC_ANSI_INVOKE_W_YES = $(GCC) -ansi
GCC_STRICT_INVOKE_W_NO = $(GCC) -ansi -pedantic
@@ -50,15 +59,18 @@ CCC_NORMAL_INVOKE_W_YES = $(CCC) +p +w
CCC_STRICT_INVOKE_W_YES = $(CCC) +p +w
CCC_LD_FLAGS =
CCC_LD_LIBS =
CCC_TEMPL_INST_FLAG =
G++_NORMAL_INVOKE_W_NO = $(G++) -ansi -pedantic -w
G++_NORMAL_INVOKE_W_YES = $(G++) -ansi -pedantic -Wall
G++_STRICT_INVOKE_W_YES = $(G++) -ansi -pedantic -Wtraditional -Wall \
-Wmissing-prototypes -Woverloaded-virtual \
-Wwrite-strings -Wconversion -Wstrict-prototypes\
-Wpointer-arith -Winline
G++_TEMPL_INST_FLAG = -DEXPL_TEMPL
CXX_NORMAL = $($(CPLUSPLUS)_NORMAL_INVOKE_W_$(UNIX_WARN))
CXX_STRICT = $($(CPLUSPLUS)_STRICT_INVOKE_W_YES)
TEMPL_INST_CXXFLAG = $($(CPLUSPLUS)_TEMPL_INST_FLAG)
# GNU make likes CXX instead of CCC
CXX = $(CXX_$(CXXCMPLR))
@@ -83,7 +95,8 @@ OPTIM_NO =
UNIX_OPT_FLAGS = $(OPTIM_$(UNIX_OPT))
# Include files
UNIX_INCLUDES = -I. -I.. -I$(EPICS_BASE_INCLUDE)
UNIX_INCLUDES = -I. -I.. $(USR_INCLUDES) -I$(INSTALL_INCLUDE) -I$(EPICS_BASE_INCLUDE) \
-I$(EPICS_BASE_INCLUDE)/os/$(T_A)
# Operating system flags
OP_SYS_FLAGS = -DUNIX
@@ -92,35 +105,34 @@ UNIX_LDFLAGS = -L$(EPICS_BASE_LIB)
UNIX_LDLIBS = -lm
ARCH_DEP_CFLAGS = -DSGI
ARCH_DEP_CCFLAGS = $(ARCH_DEP_CFLAGS)
UNIX_CFLAGS = $(UNIX_SFLAGS) $(USR_INCLUDES) $(UNIX_INCLUDES) $(OP_SYS_FLAGS)
ARCH_DEP_CXXFLAGS = $(ARCH_DEP_CFLAGS)
UNIX_CFLAGS = $(UNIX_SFLAGS) $(UNIX_INCLUDES) $(OP_SYS_FLAGS)
UNIX_CCFLAGS = $(UNIX_CFLAGS)
UNIX_CXXFLAGS = $(UNIX_CFLAGS)
# Target specific flags
TARGET_CFLAGS = $($(basename $@)_CFLAGS)
TARGET_CCFLAGS = $($(basename $@)_CCFLAGS)
TARGET_CXXFLAGS = $($(basename $@)_CXXFLAGS)
TARGET_CPPFLAGS = $($(basename $@)_CPPFLAGS)
TARGET_LDFLAGS = $($(basename $@)_LDFLAGS)
TARGET_LDLIBS = $($(basename $@)_LDLIBS)
TARGET_SNCFLAGS = $($(basename $@)_SNCFLAGS)
CFLAGS = $(UNIX_OPT_FLAGS) $(TARGET_CFLAGS) $(USR_CFLAGS) $(ARCH_DEP_CFLAGS) $(UNIX_CFLAGS)
CCFLAGS = $(UNIX_OPT_FLAGS) $(TARGET_CCFLAGS) $(USR_CCFLAGS) $(ARCH_DEP_CCFLAGS) $(UNIX_CCFLAGS)
CXXFLAGS = $(UNIX_OPT_FLAGS) $(TARGET_CXXFLAGS) $(USR_CXXFLAGS) \
$(ARCH_DEP_CXXFLAGS) $(UNIX_CXXFLAGS) $(TEMPL_INST_CXXFLAG)
CPPFLAGS += $(TARGET_CPPFLAGS) $(USR_CPPFLAGS)
# GNU make likes CXX instead of CCC
CXXFLAGS = $(CCFLAGS)
LDFLAGS = $(SPECIAL_LDFLAGS) $(TARGET_LDFLAGS) $(USR_LDFLAGS) $(ARCH_DEP_LDFLAGS) $(UNIX_LDFLAGS)
LDLIBS = $(TARGET_LDLIBS) $(USR_LDLIBS) $(ARCH_DEP_LDLIBS) $(UNIX_LDLIBS)
# Override defaults
COMPILE.c = $(CC) $(CFLAGS) $(CPPFLAGS) -c
COMPILE.cc = $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c
LINK.c = $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
LINK.cc = $(CXX) $(CCFLAGS) $(CPPFLAGS) $(LDFLAGS)
LOAD.c = ld -shared $(LDFLAGS)
# Unlike the 'Unix' makesystem, output flags -o .. are now part of LINK.c[c]
LINK.c = $(CC) -o $@ $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
LINK.cc = $(CXX) -o $@ $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS)
DEPENDS_RULE.c = -$(COMPILE.c) -M $(SRCS.c) > .DEPENDS
DEPENDS_RULE.cc = @echo no DEPENDS_RULE.cc defined in CONFIG.Unix.sgi
DEPENDS_RULE.cc = @echo no DEPENDS_RULE.cc defined in CONFIG.sgi

View File

@@ -4,25 +4,44 @@
# This file is maintained by the EPICS community.
# BUILD_TYPE
# Currently either Vx or Unix
BUILD_TYPE = Unix
# Currently either Vx or Host
BUILD_TYPE = Host
ARCH_CLASS = solaris
# Compiler and utility invocation (supply path to compiler here)
# (with warning flags built in)
# Paths to compilers
GCC = gcc
GCC = /opt/gnu/bin/gcc
ACC = $(SPARCWORKS)/bin/cc
# SUNCC doesn't exist under Solaris
#
# required by sun's C++ compiler
#
AR = ar
_AR = $(AR) $(ARFLAGS)
G++_AR = $(_AR)
CCC_AR = $(CCC) -xar -o
ARCMD = $($(CPLUSPLUS)_AR)
RANLIB =
YACC = $(EYACC)
LEX = $(ELEX)
G++ = /opt/gnu/bin/g++
CCC = /opt/SUNWspro/bin/CC
MV = mv
RMDIR = rm -rf
MKDIR = mkdir
CP=cp
MV=mv
RM=rm -f
MKDIR=mkdir
RMDIR=rm -rf
CHMOD = "/bin/chmod"
WHAT = what
EXE=
OBJ=.o
ACC_ANSI_INVOKE_W_NO = $(ACC) -Xa -w
ACC_ANSI_INVOKE_W_YES = $(ACC) -Xa
@@ -60,16 +79,19 @@ CCC_NORMAL_INVOKE_W_YES = $(CCC) +p +w
CCC_STRICT_INVOKE_W_YES = $(CCC) +p +w
CCC_LD_FLAGS = -L$(SPECIAL_LANG)
CCC_LD_LIBS =
CCC_TEMPL_INST_FLAG =
G++_NORMAL_INVOKE_W_NO = $(G++) -ansi -pedantic -w
G++_NORMAL_INVOKE_W_YES = $(G++) -ansi -pedantic -Wall
G++_STRICT_INVOKE_W_YES = $(G++) -ansi -pedantic -Wtraditional -Wall \
-Wmissing-prototypes -Woverloaded-virtual \
-Wwrite-strings -Wconversion -Wstrict-prototypes\
-Wpointer-arith -Winline
G++_TEMPL_INST_FLAG = -DEXPL_TEMPL
CXX_NORMAL = $($(CPLUSPLUS)_NORMAL_INVOKE_W_$(UNIX_WARN))
CXX_STRICT = $($(CPLUSPLUS)_STRICT_INVOKE_W_YES)
TEMPL_INST_CXXFLAG = $($(CPLUSPLUS)_TEMPL_INST_FLAG)
# GNU make likes CXX instead of CCC
CXX = $(CXX_$(CXXCMPLR))
@@ -100,7 +122,8 @@ OPTIM_NO =
UNIX_OPT_FLAGS = $(OPTIM_$(UNIX_OPT))
# Include files
UNIX_INCLUDES = -I. -I.. -I$(EPICS_BASE_INCLUDE)
UNIX_INCLUDES = -I. -I.. $(USR_INCLUDES) -I$(INSTALL_INCLUDE) -I$(EPICS_BASE_INCLUDE) \
-I$(EPICS_BASE_INCLUDE)/os/$(T_A)
# Operating system flags
OP_SYS_FLAGS = -DUNIX
@@ -109,39 +132,38 @@ UNIX_LDFLAGS = -L$(EPICS_BASE_LIB) $(CCOMPILER_LDFLAGS)
UNIX_LDLIBS = $(UNIX_SLIBS) -lm $(CCOMPILER_LDLIBS)
# Architecture specific build flags
ARCH_DEP_CFLAGS = -DSOLARIS
ARCH_DEP_CCFLAGS = $(ARCH_DEP_CFLAGS)
ARCH_DEP_CFLAGS = -DSOLARIS -D_REENTRANT
ARCH_DEP_CXXFLAGS = $(ARCH_DEP_CFLAGS)
ARCH_DEP_LDLIBS = -lsocket -lnsl
# -lsocket needed by libca.a
# -lnsl needed by libca.a
UNIX_CFLAGS = $(UNIX_SFLAGS) $(UNIX_INCLUDES) $(USR_INCLUDES) $(OP_SYS_FLAGS)
UNIX_CFLAGS = $(UNIX_SFLAGS) $(UNIX_INCLUDES) $(OP_SYS_FLAGS)
UNIX_CCFLAGS = $(UNIX_CFLAGS)
UNIX_CXXFLAGS = $(UNIX_CFLAGS)
# Target specific flags
TARGET_CFLAGS = $($(basename $@)_CFLAGS)
TARGET_CCFLAGS = $($(basename $@)_CCFLAGS)
TARGET_CXXFLAGS = $($(basename $@)_CXXFLAGS)
TARGET_CPPFLAGS = $($(basename $@)_CPPFLAGS)
TARGET_LDFLAGS = $($(basename $@)_LDFLAGS)
TARGET_LDLIBS = $($(basename $@)_LDLIBS)
TARGET_SNCFLAGS = $($(basename $@)_SNCFLAGS)
CFLAGS = $(UNIX_OPT_FLAGS) $(TARGET_CFLAGS) $(USR_CFLAGS) $(ARCH_DEP_CFLAGS) $(UNIX_CFLAGS)
CCFLAGS = $(UNIX_OPT_FLAGS) $(TARGET_CCFLAGS) $(USR_CCFLAGS) $(ARCH_DEP_CCFLAGS) $(UNIX_CCFLAGS)
CXXFLAGS = $(UNIX_OPT_FLAGS) $(TARGET_CXXFLAGS) $(USR_CXXFLAGS) \
$(ARCH_DEP_CXXFLAGS) $(UNIX_CXXFLAGS) $(TEMPL_INST_CXXFLAG)
CPPFLAGS += $(TARGET_CPPFLAGS) $(USR_CPPFLAGS)
# GNU make likes CXX instead of CCC
CXXFLAGS = $(CCFLAGS)
LDFLAGS = $(SPECIAL_LDFLAGS) $(TARGET_LDFLAGS) $(USR_LDFLAGS) $(ARCH_DEP_LDFLAGS) $(UNIX_LDFLAGS)
LDLIBS = $(TARGET_LDLIBS) $(USR_LDLIBS) $(ARCH_DEP_LDLIBS) $(UNIX_LDLIBS)
# Override SUN defaults
COMPILE.c = $(CC) $(CFLAGS) $(CPPFLAGS) -c
COMPILE.cc = $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c
LINK.c = $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
LINK.cc = $(CXX) $(CCFLAGS) $(CPPFLAGS) $(LDFLAGS)
# Unlike the 'Unix' makesystem, output flags -o .. are now part of LINK.c[c]
LINK.c = $(CC) -o $@ $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
LINK.cc = $(CXX) -o $@ $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS)
DEPENDS_RULE.c = -$(COMPILE.c) -xM $(SRCS.c) > .DEPENDS
DEPENDS_RULE.cc = @echo no DEPENDS_RULE.cc defined in CONFIG.Unix.solaris
DEPENDS_RULE.cc = -$(COMPILE.cc) -xM $(SRCS.cc) >> .DEPENDS

View File

@@ -4,8 +4,11 @@
# This file is maintained by the EPICS community.
# BUILD_TYPE
# Currently either Vx or Unix
BUILD_TYPE = Unix
# Currently either Vx or Host
BUILD_TYPE = Host
ARCH_CLASS=sun4
# Compiler and utility invocation (supply path to compiler here)
# (with warning flags built in)
@@ -13,17 +16,37 @@ BUILD_TYPE = Unix
GCC = gcc
ACC = /usr/lang/acc
SUNCC = cc
AR = ar
ARFLAGS = r
RANLIB = ranlib
RANLIBFLAGS = -t
YACC = $(EYACC)
LEX = $(ELEX)
G++ = g++
CCC = /usr/lang/CC
MV = mv
RMDIR = rm -rf
MKDIR = mkdir
CHMOD = "/bin/chmod"
CP=cp
MV=mv
RM=rm -f
WHAT = what
EXE=
OBJ=.o
#
# original before use of sun C++
#
#
# required by sun's C++ compiler
#
ARFLAGS = r
AR = ar
_AR = $(AR) $(ARFLAGS)
G++_AR = $(_AR)
CCC_AR = $(CCC) -xar -o
ARCMD = $($(CPLUSPLUS)_AR)
ACC_ANSI_INVOKE_W_NO = $(ACC) -Xa -w
ACC_ANSI_INVOKE_W_YES = $(ACC) -Xa
@@ -63,20 +86,22 @@ CCC_NORMAL_INVOKE_W_YES = $(CCC) +p +w
CCC_STRICT_INVOKE_W_YES = $(CCC) +p +w
CCC_LD_FLAGS = -L$(SPECIAL_LANG)
CCC_LD_LIBS =
CCC_TEMPL_INST_FLAG =
G++_NORMAL_INVOKE_W_NO = $(G++) -ansi -pedantic -w
G++_NORMAL_INVOKE_W_YES = $(G++) -ansi -pedantic -Wall
G++_STRICT_INVOKE_W_YES = $(G++) -ansi -pedantic -Wtraditional -Wall \
-Wmissing-prototypes -Woverloaded-virtual \
-Wwrite-strings -Wconversion -Wstrict-prototypes\
-Wpointer-arith -Winline
G++_TEMPL_INST_FLAG = -DEXPL_TEMPL
CXX_NORMAL = $($(CPLUSPLUS)_NORMAL_INVOKE_W_$(UNIX_WARN))
CXX_STRICT = $($(CPLUSPLUS)_STRICT_INVOKE_W_YES)
TEMPL_INST_CXXFLAG = $($(CPLUSPLUS)_TEMPL_INST_FLAG)
# GNU make likes CXX instead of CCC
CXX = $(CXX_$(CXXCMPLR))
# Static Build options
ACC_SFLAGS_YES= -Bstatic
ACC_SFLAGS_NO=
@@ -96,7 +121,8 @@ OPTIM_NO =
UNIX_OPT_FLAGS = $(OPTIM_$(UNIX_OPT))
# Include files
UNIX_INCLUDES = -I. -I.. -I$(EPICS_BASE_INCLUDE)
UNIX_INCLUDES = -I. -I.. $(USR_INCLUDES) -I$(INSTALL_INCLUDE) -I$(EPICS_BASE_INCLUDE) \
-I$(EPICS_BASE_INCLUDE)/os/$(T_A)
# Operating system flags
OP_SYS_FLAGS = -DUNIX
@@ -107,34 +133,35 @@ UNIX_LDFLAGS = -L$(EPICS_BASE_LIB) $(CCOMPILER_LDFLAGS)
UNIX_LDLIBS = -lm $(CCOMPILER_LDLIBS)
ARCH_DEP_CFLAGS = -DSUNOS4
ARCH_DEP_CCFLAGS = $(ARCH_DEP_CFLAGS)
UNIX_CFLAGS = $(UNIX_SFLAGS) $(USR_INCLUDES) $(UNIX_INCLUDES) $(OP_SYS_FLAGS)
ARCH_DEP_CXXFLAGS = $(ARCH_DEP_CFLAGS)
UNIX_CFLAGS = $(UNIX_SFLAGS) $(UNIX_INCLUDES) $(OP_SYS_FLAGS)
UNIX_CCFLAGS = $(UNIX_CFLAGS)
UNIX_CXXFLAGS = $(UNIX_CFLAGS)
# Target specific flags
TARGET_CFLAGS = $($(basename $@)_CFLAGS)
TARGET_CCFLAGS = $($(basename $@)_CCFLAGS)
TARGET_CXXFLAGS = $($(basename $@)_CXXFLAGS)
TARGET_CPPFLAGS = $($(basename $@)_CPPFLAGS)
TARGET_LDFLAGS = $($(basename $@)_LDFLAGS)
TARGET_LDLIBS = $($(basename $@)_LDLIBS)
TARGET_SNCFLAGS = $($(basename $@)_SNCFLAGS)
CFLAGS = $(UNIX_OPT_FLAGS) $(TARGET_CFLAGS) $(USR_CFLAGS) $(ARCH_DEP_CFLAGS) $(UNIX_CFLAGS)
CCFLAGS = $(UNIX_OPT_FLAGS) $(TARGET_CCFLAGS) $(USR_CCFLAGS) $(ARCH_DEP_CCFLAGS) $(UNIX_CCFLAGS)
CXXFLAGS = $(UNIX_OPT_FLAGS) $(TARGET_CXXFLAGS) $(USR_CXXFLAGS) $(ARCH_DEP_CXXFLAGS) \
$(UNIX_CXXFLAGS) $(TEMPL_INST_CXXFLAG)
CPPFLAGS += $(TARGET_CPPFLAGS) $(USR_CPPFLAGS)
# GNU make likes CXX instead of CCC
CXXFLAGS = $(CCFLAGS)
LDFLAGS = $(SPECIAL_LDFLAGS) $(TARGET_LDFLAGS) $(USR_LDFLAGS) $(ARCH_DEP_LDFLAGS) $(UNIX_LDFLAGS)
LDLIBS = $(TARGET_LDLIBS) $(USR_LDLIBS) $(ARCH_DEP_LDLIBS) $(UNIX_LDLIBS)
# Override SUN defaults
COMPILE.c = $(CC) $(CFLAGS) $(CPPFLAGS) -c
COMPILE.cc = $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c
LINK.c = $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
LINK.cc = $(CXX) $(CCFLAGS) $(CPPFLAGS) $(LDFLAGS)
# changed from 'Unix' makesystem:
# link command now contains the output flag '-o $@'
LINK.c = $(CC) -o $@ $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
LINK.cc = $(CXX) -o $@ $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS)
DEPENDS_RULE.c = -$(COMPILE.c) -M $(SRCS.c) > .DEPENDS
DEPENDS_RULE.cc = @echo no DEPENDS_RULE.cc defined in CONFIG.Unix.sun4
DEPENDS_RULE.cc = @echo no DEPENDS_RULE.cc defined in CONFIG.sun4

View File

@@ -4,8 +4,10 @@
# the order of following list is important
#
# for c++ build add the dirs gdd and cas after ca
# (and uncomment the c++ files in src/lbCom/Makefile.Unix)
#
DIRS = \
tools \
include \
@@ -30,20 +32,19 @@ DIRS = \
devOpt\
iocCore
EPICS_BASE = $(TOP)
# EPICS include config file
include $(TOP)/config/CONFIG
include $(EPICS_BASE)/config/CONFIG
EPICS_BASE = $(INSTALL_LOCATION)
#
# this speeds up the build by turning off implicit rules search
#
.PHONY: $(TOP)/config/CONFIG
.PHONY: $(TOP)/config/CONFIG.* $(TOP)/config/CONFIG_*
.PHONY: $(TOP)/config/RULES.* $(TOP)/config/RULES_* .DEPENDS
.PHONY: $(HOME)/.EPICS_CONFIG
.PHONY: ../Makefile.Vx ../Makefile.Unix ../Makefile.Host Makefile
.PHONY:: $(EPICS_BASE)/config/CONFIG
.PHONY:: $(EPICS_BASE)/config/CONFIG.* $(EPICS_BASE)/config/CONFIG_*
.PHONY:: $(EPICS_BASE)/config/RULES.* $(EPICS_BASE)/config/RULES_* .DEPENDS
.PHONY:: $(HOME)/.EPICS_CONFIG $(HOME)/.EPICS_CONFIG.$(HOST_ARCH)
.PHONY:: ../Makefile.Vx ../Makefile.Unix ../Makefile.Host Makefile

View File

@@ -0,0 +1,19 @@
#
# $Id$
#
# EPICS Version information
#
# This file is interpreted by the Bourne Shell (MakeRelease), so spaces are
# not allowed around the '=' signs or in unquoted values.
#
EPICS_VERSION=3
EPICS_REVISION=13
EPICS_MODIFICATION=0
EPICS_UPDATE_NAME=beta
EPICS_UPDATE_LEVEL=8
EPICS_VERSION_STRING="EPICS Version ${EPICS_VERSION}.${EPICS_REVISION}.${EPICS_MODIFICATION}.${EPICS_UPDATE_NAME}${EPICS_UPDATE_LEVEL}"
CVS_DATE="\$$Date$$"

View File

@@ -9,15 +9,15 @@
# Common Configuration Information
BUILD_ARCHS=$(HOST_ARCH)
ifndef CROSS_COMPILER_HOST_ARCHS
BUILD_ARCHS+=$(CROSS_COMPILER_TARGET_ARCHS)
else
ifeq ($(HOST_ARCH),$(findstring $(HOST_ARCH),$(CROSS_COMPILER_HOST_ARCHS)))
BUILD_ARCHS+=$(CROSS_COMPILER_TARGET_ARCHS)
endif
endif
# CROSS1 will be defined only when CROSS_COMPILER_HOST_ARCHS is NOT defined
CROSS1 = $(CROSS_COMPILER_TARGET_ARCHS$(word 1,$(CROSS_COMPILER_HOST_ARCHS)))
# CROSS2 will be defined only when CROSS_COMPILER_HOST_ARCHS is defined
# and HOST_ARCH is one of it's words
CROSS2 = $(CROSS_COMPILER_TARGET_ARCHS$(filter-out 1,$(words $(filter $(HOST_ARCH),$(CROSS_COMPILER_HOST_ARCHS)))))
BUILD_ARCHS = $(HOST_ARCH) $(CROSS1) $(CROSS2)
INSTALL_LOCATION = $(TOP)
INSTALL_LOCATION_LIB = $(INSTALL_LOCATION)/lib
@@ -39,8 +39,8 @@ EPICS_EXTENSIONS_TEMPLATES = $(EPICS_EXTENSIONS)/templates
DIVIDER = .
# private versions of lex/yacc from EPICS
EYACC = $(EPICS_BASE)/bin/$(HOST_ARCH)/antelope
ELEX = $(EPICS_BASE)/bin/$(HOST_ARCH)/e_flex -S$(EPICS_BASE_INCLUDE)/flex.skel.static
EYACC = $(EPICS_BASE)/bin/$(HOST_ARCH)/antelope$(EXE)
ELEX = $(EPICS_BASE)/bin/$(HOST_ARCH)/e_flex$(EXE) -S$(EPICS_BASE_INCLUDE)/flex.skel.static
# install from EPICS
INSTALL = $(EPICS_BASE)/bin/$(HOST_ARCH)/installEpics

View File

@@ -20,20 +20,43 @@
# from white space separated ip addresses in this
# environment variable. "Quote" if more than one addr.
# EPICS_CA_AUTO_ADDR_LIST YES = augment beacon/search dest ip
# addr list from interfaces found; NO = only use
# addr list from network interfaces found; NO = only use
# EPICS_CA_ADDR_LIST to create this list.
# EPICS_CA_CONN_TMO sec before sending echo request from client.
# EPICS_CA_BEACON_PERIOD quiescent sec between server beacons.
# EPICS_CA_REPEATER_PORT CA repeater port number.
# EPICS_CA_SERVER_PORT CA server port number.
EPICS_CA_ADDR_LIST=""
EPICS_CA_AUTO_ADDR_LIST=YES
EPICS_CA_CONN_TMO=30.0
EPICS_CA_BEACON_PERIOD=15.0
EPICS_CA_REPEATER_PORT=5065
EPICS_CA_SERVER_PORT=5064
#
# These parameters are only used by the CA server library
#
# EPICS_CA_BEACON_PERIOD quiescent sec between server beacons.
# EPICS_CAS_INTF_ADDR_LIST - list of IP addresses identifying
# a limited set of interfaces that the server should bind to.
# If this parameter is empty then connections are accepted
# from any interface. Beacons are sent only to the broadcast
# address of each interface in this list (or the destination
# address of point to point interfaces) if EPICS_CA_AUTO_ADDR_LIST
# is YES. Type "ifconfig -a" in order to determine which
# interfaces are available.
# EPICS_CAS_BEACON_ADDR_LIST - If this parameter is specified
# or if EPICS_CAS_INTF_ADDR_LIST isnt empty then this parameter
# is used instead of EPICS_CA_ADDR_LIST by the server library
# to augment the list of addresses to send beacons to.
# EPICS_CAS_SERVER_PORT - If this parameter is specified then it
# and not EPICS_CA_SERVER_PORT is used to determine the server's
# port number.
#
EPICS_CA_BEACON_PERIOD=15.0
EPICS_CAS_INTF_ADDR_LIST=""
EPICS_CAS_BEACON_ADDR_LIST=""
EPICS_CAS_SERVER_PORT=
# Log Server:
# EPICS_IOC_LOG_PORT Log server port number.

View File

@@ -19,6 +19,7 @@
# solaris
# sgi
# Linux
# WIN32
#
# HOST_ARCH now an environment variable
# HOST_ARCH=$(shell /usr/local/epics/startup/HostArch)
@@ -35,6 +36,7 @@ endif
# mv147
# hkv2f
# niCpu030
# pc486
#
CROSS_COMPILER_TARGET_ARCHS=mv167 mv162
@@ -50,9 +52,14 @@ CROSS_COMPILER_TARGET_ARCHS=mv167 mv162
#VX_DIR=/usr/local/vw/vxV52/vw
VX_DIR=/usr/local/vw/vxV52p1/vw
# Gnu directory for gcc
#VX_GNU = $(VX_DIR)
VX_GNU = $(VX_DIR)/../vxgccV2.2.3.1
# Gnu directory for g++
GNU_DIR = /usr/local/hideos/gnu_install-2.7.2
GNU_BIN = $(GNU_DIR)/bin
GNU_LIB = $(GNU_DIR)/lib
# Client ANSI Compiler
# GCC (gcc -ansi)

7
config/CONFIG_SITE.WIN32 Normal file
View File

@@ -0,0 +1,7 @@
#
# $Id$
#
# Site Specific Configuration Information
# Only the local epics system manager should modify this file

9
config/CONFIG_SITE.mv177 Normal file
View File

@@ -0,0 +1,9 @@
# $Id$
#
# Site Specific Configuration Information
# Only the local epics system manager should modify this file
# Epics defs

6
config/CONFIG_SITE.pc486 Normal file
View File

@@ -0,0 +1,6 @@
# $Log$
# Revision 1.1.2.1 1996/11/25 20:20:22 jhill
# installed
#
# -kuk-

View File

@@ -22,6 +22,6 @@ CXXCMPLR=NORMAL
#CXXCMPLR=STRICT
# Special C library requirements
SPECIAL_LANG = /usr/lang/SC2.0.1patch
SPECIAL_LANG =

99
config/HostSys.txt Normal file
View File

@@ -0,0 +1,99 @@
Short Description of the "Host" (vs. "Unix") Build System
---------------------------------------------------------
7-30-96 -kuk-
questions/comments please mailto:kasemir@atdiv.lanl.gov
To build EPICS on the WIN32 architecture
the "old" make-system using Makefile.Unix in each
subdir and RULES.Host was not suitable because
it is too much Unix-dependent.
A "new" system using Makefile.Host and RULES.Host
was used instead. This "host" system should work
on all other architectures as well.
The idea is that ALL architectures should be able to use
the "host" system in future because.
The syntax of the 'Host' Makefiles is described
in 'Sample.Makefile.Host'. Any suggestions for a
better syntax (in connection whith ideas how to
implement this in RULES.Host!) are very welcome!
To use it, only a few changes should be necessary:
A) In CONFIG.<WIN32, sun4, hp700, ... whatever you are using>:
1) Set
BUILD_TYPE=Host
instead of 'Unix'. This switches you over to using
Makefile.Host instead of Makefile.Unix.
2) Set ARCH_CLASS to the correct architecture class.
(ARCH_CLASS used to be defined in the past, right now
it seems it's only set for VxWorks targets, not hosts).
ARCH_CLASS is used to define system-dependent
CFLAGS, library contents etc. in Makefile.Host,
so it should describe the general architecture,
maybe
WIN32 : this is the only one really supported in Makefile.Host by now
BSD for sun4,
SYSV for ??,
Maybe this "general arch" is not sufficient, so we will
end up using
ARCH_CLASS=WIN32, sun4, hp700, ....
as it used to be.
3) Make sure that the following (new) macros are defined:
CP=cp
MV=mv
RM=rm -f
MKDIR=mkdir
RMDIR=rm -rf
EXE=
OBJ=.o
4) LINK.c and LINK.cc must now include the target-flag, e.g.:
LINK.c = $(CC) $(LDFLAGS) -o $@
because the "-o $@" is also system dependent (it's -Fe$@ for WIN32)
5) The bin directory for the host based epics tools
$(EPICS)/base/bin/$(HOST_ARCH)
must be in your PATH.
B) Adjust Makefile.Host
If you are trying to build EPICS now, there might be errors
because the Makefile.Host files are only tested on WIN32, yet.
If changes are necessare in some base/src/???/Makefile.Host,
refer to Sample.Makefile.Host in the base/config dir.
The current make-system for WIN32
needs
* gnumake (OK, sources for WIN32 are available)
* several UNIX tools: sed, grep, ... (dito)
* a UNIX-like shell (ouch!)
I found no fully operational shell and no sources for WIN32 so far,
Cygnus' bash e.g. cannot handle this:
(echo a>a; echo b>>a)
Right now I use the knts that I wrote and simplified scripts.
Jeff eliminated many shell-lines in Makefile.*,
the final solution could be:
1) replace shell, awk, grep, sed, ... by Perl!
2) use C code
Perl looks like a real option because it's available
for many platforms and maybe the best idea for
'portable scripts'.

57
config/Makefile.Host Normal file
View File

@@ -0,0 +1,57 @@
#
# $Id$
#
TOP = ../..
include $(TOP)/config/CONFIG_BASE
CONFIGS += CONFIG
CONFIGS += CONFIG_BASE
CONFIGS += CONFIG_BASE_VERSION
CONFIGS += CONFIG_COMMON
CONFIGS += CONFIG_ENV
CONFIGS += CONFIG.WIN32
CONFIGS += CONFIG.pc486
CONFIGS += CONFIG.Linux
CONFIGS += CONFIG.alpha
CONFIGS += CONFIG.hp700
CONFIGS += CONFIG.sgi
CONFIGS += CONFIG.solaris
CONFIGS += CONFIG.sun4
CONFIGS += CONFIG.hkv2f
CONFIGS += CONFIG.mv147
CONFIGS += CONFIG.mv162
CONFIGS += CONFIG.mv162lc
CONFIGS += CONFIG.mv167
CONFIGS += CONFIG.niCpu030
CONFIGS += CONFIG.Vx.68k
CONFIGS += CONFIG_SITE
CONFIGS += CONFIG_SITE_ENV
CONFIGS += CONFIG_SITE.WIN32
CONFIGS += CONFIG_SITE.pc486
CONFIGS += CONFIG_SITE.Linux
CONFIGS += CONFIG_SITE.alpha
CONFIGS += CONFIG_SITE.hp700
CONFIGS += CONFIG_SITE.sgi
CONFIGS += CONFIG_SITE.solaris
CONFIGS += CONFIG_SITE.sun4
CONFIGS += CONFIG_SITE.hkv2f
CONFIGS += CONFIG_SITE.mv147
CONFIGS += CONFIG_SITE.mv162lc
CONFIGS += CONFIG_SITE.mv162
CONFIGS += CONFIG_SITE.mv167
CONFIGS += CONFIG_SITE.niCpu030
CONFIGS += RULES.Host
CONFIGS += RULES.Vx
CONFIGS += RULES_ARCHS
CONFIGS += RULES_DIRS
CONFIGS += RULES_TOP
CONFIGS += RULES.Db
CONFIGS += RULES.ioc
include $(TOP)/config/RULES.Host

56
config/RULES.Db Normal file
View File

@@ -0,0 +1,56 @@
#RULES.Db
SUBTOOL = $(EPICS_BASE_BIN)/subtool
PREFIX=$(shell echo $* | sed -e 's-[0-9]--g' | sed -e 's-\.db--g')
ARCHS += $(BUILD_ARCHS) host cross
ACTIONS += clean inc depends buildInstall build
actionArchTargets = $(foreach action, $(ACTIONS) install,\
$(foreach arch, $(ARCHS), \
$(action)$(DIVIDER)$(arch)))
all install :: inc buildInstall
buildInstall: .DEPENDS dbd $(DBFROMTEMPLATE) $(INDDBFROMTEMPLATE) $(PROD)
inc build depends:
dbd:
@if [ ! -d $(TOP)/dbd ]; then \
mkdir $(TOP)/dbd ; \
fi
@if [ ! -d dbd ]; then \
echo "ln -s $(TOP)/dbd dbd" ; \
ln -s $(TOP)/dbd dbd ; \
fi
$(DBFROMTEMPLATE):%.db: %.template %.substitutions
$(RM) $@
$(SUBTOOL) $*.template $*.substitutions > $@
$(INDDBFROMTEMPLATE):%.db: %.substitutions
$(RM) $@
$(SUBTOOL) $(PREFIX).template $*.substitutions > $@
.DEPENDS: Makefile
@$(RM) $@
@for NAME in $(INDDBFROMTEMPLATE) garbage_marty ; do \
if [ $$NAME != garbage_marty ] ; then \
PREFIX="`echo $$NAME | sed -e 's-[0-9]--g' | sed -e 's-\.db--g'`";\
echo "$$NAME: $$PREFIX.template" >> $@;\
fi ; \
done
clean::
@$(RM) dbd $(DBFROMTEMPLATE) $(INDDBFROMTEMPLATE) .DEPENDS $(PROD)
$(actionArchTargets) :%:
$(MAKE) $(word 1, $(subst $(DIVIDER), ,$@))
$(ARCHS):%: install
.PHONY :: $(ARCHS) $(ACTIONS)
.PHONY :: $(actionArchTargets)
-include .DEPENDS

581
config/RULES.Host Normal file
View File

@@ -0,0 +1,581 @@
# $Id$
#
# Rules for making things specified in Makefile.Host
#
# Some rules for filename-massage are system specific
# and have "ifdefs" here instead of using definitions
# from CONFIG.Host.$(ARCH_CLASS) - sorry about this,
# but so far the rules are quite similar on all systems
# except WIN32 has some specials.
#
# Maybe there is a way to use indentation to make it
# easier to read this file?
#
# Most things may also work if you say e.g.
# VAR+=ADD
# even if ADD is not there, but this way "VAR" would
# be defined in any case, that's why I try to use
# ifdef ADD
# VAR+=ADD
# endif
#
# -kuk-
# we are in O.$(ARCH_CLASS), but most sources are one dir above:
#
# The use of VPATH (no suffix specification) caused everything
# to break several times.
# vpath, of course, has the disadvantage that we need explicit rules
# for scripts or similar os-specific filed which have _no_ suffix...
vpath %.c $(USER_VPATH) ../os/$(ARCH_CLASS) ../os/generic ..
vpath %.cc $(USER_VPATH) ../os/$(ARCH_CLASS) ../os/generic ..
# This prevents base/src/include/*.h from being installed. Why??
#vpath %.h ../os/$(ARCH_CLASS) ../os/generic ..
vpath %.h $(USER_VPATH)
# check for add-on CFLAGS and CXXFLAGS
#
# Rules:
# 1) USR_CFLAGS is used
# 2) if there is a special USR_CFLAGS_$(ARCH_CLASS), it's
# appended to 1)
# 3) if there is no special defined, but a generic USR_CFLAGS_DEFAULT,
# this one is appended
# 4) if you have the special case that your USR_CFLAGS_$(ARCH_CLASS) is
# empty but you don't want 3), you have to define it as '-nil-', e.g.:
# USR_CFLAGS := <defines for all systems>
# USR_CFLAGS_sun4 := -nil-
# USR_CFLAGS_DEFAULT := <defines for most systems, not sun4>
#
# These rules apply to these Makefile-variables:
# USR_CFLAGS C flags
# USR_CXXFLAGS C++ flags
# INC include-files to install
# LIBSRCS source files for building library
# PROD_LIBS libs needed by PROD
# PROD products to build and install
# SCRIPTS scripts to install
#
# Remark:
# If you define a special INC, e.g. INC_WIN32 := getopt.h,
# the source (getopt.h) has to be in os/WIN32 (or os/<your ARCH_CLASS>)
#
# This makes INC_$(ARCH_CLASS) slightly different from OSINC:
# OSINC := a_file.h
# means that you have a special os/$(ARCH_CLASS)/a_file.h
# for _every_ ARCH_CLASS.
# If you use INC_$(ARCH_CLASS), you need the special include
# only for the specified ARCH_CLASS!
#
ifneq (x$(USR_CFLAGS_$(ARCH_CLASS)),x)
USR_CFLAGS+=$(subst -nil-,,$(USR_CFLAGS_$(ARCH_CLASS)))
else
ifdef USR_CFLAGS_DEFAULT
USR_CFLAGS+=$(USR_CFLAGS_DEFAULT)
endif
endif
ifneq (x$(USR_CXXFLAGS_$(ARCH_CLASS)),x)
USR_CXXFLAGS+=$(subst -nil-,,$(USR_CXXFLAGS_$(ARCH_CLASS)))
else
ifdef USR_CXXFLAGS_DEFAULT
USR_CXXFLAGS+=$(USR_CXXFLAGS_DEFAULT)
endif
endif
# check for special includes:
#
ifneq (x$(INC_$(ARCH_CLASS)),x)
# os-specific includes go to the include/os-directory:
OSINC += $(subst -nil-,,$(INC_$(ARCH_CLASS)))
else
ifdef INC_DEFAULT
INC += $(INC_DEFAULT)
endif
endif
# concat specific library contents (if defined) to LIBCONTENS
#
ifneq (x$(LIBSRCS_$(ARCH_CLASS)),x)
LIBSRCS += $(subst -nil-,,$(LIBSRCS_$(ARCH_CLASS)))
else
ifdef LIBSRCS_DEFAULT
LIBSRCS+=$(LIBSRCS_DEFAULT)
endif
endif
# adjust object names for library contents
#
ifdef LIBSRCS
LIBOBJS=$(addsuffix $(OBJ), $(basename $(LIBSRCS)))
endif
#
# concat specific library contents (if defined) to PROD_LIBS
#
ifneq (x$(PROD_LIBS_$(ARCH_CLASS)),x)
PROD_LIBS += $(subst -nil-,,$(PROD_LIBS_$(ARCH_CLASS)))
else
ifdef PROD_LIBS_DEFAULT
PROD_LIBS += $(PROD_LIBS_DEFAULT)
endif
endif
#
# concat specific products
#
ifneq (x$(PROD_$(ARCH_CLASS)),x)
PROD += $(subst -nil-,,$(PROD_$(ARCH_CLASS)))
else
ifdef PROD_DEFAULT
PROD += $(PROD_DEFAULT)
endif
endif
#
# concat specific scripts
#
ifneq (x$(SCRIPTS_$(ARCH_CLASS)),x)
SCRIPTS += $(subst -nil-,,$(SCRIPTS_$(ARCH_CLASS)))
else
ifdef SCRIPTS_DEFAULT
SCRIPTS += $(SCRIPTS_DEFAULT)
endif
endif
# -------------------------------------------------------------------
# adjust names to platform specific pre-/postfixes,
# this is ugly (ifdef XXX...) but hopefully get's you there...
# -------------------------------------------------------------------
# adjust names of libraries to build
#
# But: if there are no objects LIBOBJS to include
# in this library (may be for e.g. base/src/libCompat
# on some archs), don't define (and build) any library!
ifdef LIBRARY
ifdef LIBOBJS
ifndef WIN32
# handle plain Unix first because it's easy: <lib> -> lib<lib>.a
LIBNAME:=$(LIBRARY:%=lib%.a)
else
# WIN32 library name:
LIBNAME:=$(LIBRARY).lib
# check if DLL or plain lib requested:
ifeq ($(LIBTYPE),SHARED)
# create name for dll, import file
DLLNAME:=$(LIBRARY).dll
# libs defined that we need to link the DLL with?
DLL_DEP_LIBS:=$(DLL_LIBS:%=$(INSTALL_LIB)/%.lib)
endif # LIBTYPE=SHARED
endif # WIN32
endif
endif # LIBRARY and LIBOBJS
# dito for libraries used by PROD
#
ifdef PROD_LIBS
ifdef WIN32
PRODDEPLIBS:=$(PROD_LIBS:%=$(INSTALL_LIB)/%.lib)
# add to USR_LDLIBS so that the libs are linked
# we need the full path because there is no "-L" option on WIN32....
USR_LDLIBS += $(PRODDEPLIBS)
else
# On Unix: library "ca" is linked with "-lca" etc.
# A library may be just newly build in the local dir: add "-L."
PRODDEPLIBS=$(PROD_LIBS:%=lib%.a)
USR_LDLIBS += -L. $(PROD_LIBS:%=-l%)
endif
endif
# adjust executables
ifdef PROD
PROD := $(addsuffix $(EXE), $(PROD))
endif
ifdef TESTPROD
TESTPROD := $(addsuffix $(EXE), $(TESTPROD))
endif
# ----------------------------------------------------
# create names (lists) for installed things
# ----------------------------------------------------
# each list starts with the destination directory name(s)
# to make sure it's there
INSTALL_PROD= $(PROD:%= $(INSTALL_BIN)/%)
# DLLs (only defined on WIN32) are like executables:
ifdef DLLNAME
INSTALL_DLLS=$(DLLNAME:%=$(INSTALL_BIN)/%)
endif
INSTALL_LIBS= $(LIBNAME:%=$(INSTALL_LIB)/%)
INSTALL_INC= $(INC:%=$(INSTALL_INCLUDE)/%)
INSTALL_OSINCLUDE=$(INSTALL_INCLUDE)/os/$(ARCH_CLASS)
INSTALL_OSINC= $(OSINC:%= $(INSTALL_OSINCLUDE)/%)
MANLIST = 1 2 3 4 5 6 7 8 9
INSTALL_MANS = $(foreach n, \
$(MANLIST),$(INSTALL_MAN)/man$(n) $(MAN$(n):%= $(INSTALL_MAN)/man$(n)/%))
INSTALL_DOCS = $(DOCS:%= $(INSTALL_DOC)/%)
INSTALL_SCRIPTS = $(SCRIPTS:%= $(INSTALL_BIN)/%)
ifdef TEMPLATES_DIR
INSTALL_TEMPLATES_SUBDIR = $(INSTALL_TEMPLATES)/$(TEMPLATES_DIR)
else
INSTALL_TEMPLATES_SUBDIR = $(INSTALL_TEMPLATES)
endif
INSTALL_TEMPLATE = $(TEMPLATES:%= $(INSTALL_TEMPLATES_SUBDIR)/%)
INSTALL_CONFIGS = $(CONFIGS:%= $(INSTALL_CONFIG)/%)
MAN_DIRECTORY_TARGETS = $(foreach n, $(MANLIST),$(INSTALL_MAN)/man$(n))
DIRECTORY_TARGETS = $(INSTALL_INCLUDE) $(INSTALL_INCLUDE)/os \
$(INSTALL_OSINCLUDE) $(INSTALL_DOC) \
$(INSTALL_LOCATION_BIN) $(INSTALL_BIN) $(INSTALL_LIB) \
$(INSTALL_LOCATION_LIB) $(INSTALL_CONFIG) \
$(MAN_DIRECTORY_TARGETS) $(INSTALL_MAN) \
$(INSTALL_TEMPLATES)
ifdef TEMPLATES_DIR
DIRECTORY_TARGETS += $(INSTALL_TEMPLATES)/$(TEMPLATES_DIR)
endif
# Main target
#
all:: install
# Problem on WIN32:
# There seems to be no -L switch, so we have to specify the
# full library names (including the path).
# OK, so we prefix all libs by $(INSTALL_LIB) to be able to link
# with the installed libraries. This means, however, that
# libs have to be installed _before_ we build any PROD that uses them,
# because we cannot use them from the current O.WIN32 directory any more.
# Example: dbExpand etc. in dbStatic all need the db library.
#
# Solution: place INSTALL_DLLS and _LIBS in build
#
build:: $(LIBNAME) $(DLLNAME) \
$(INSTALL_LOCATION_LIB) $(INSTALL_LIB)\
$(INSTALL_LIBS) $(INSTALL_DLLS) $(PROD) $(TESTPROD)
inc:: $(INSTALL_INCLUDE) $(INSTALL_INC) \
$(INSTALL_INCLUDE)/os $(INSTALL_OSINCLUDE) $(INSTALL_OSINC)
rebuild:: clean install
install:: inc buildInstall
buildInstall :: build $(TARGETS) $(INSTALL_LOCATION_BIN) \
$(INSTALL_BIN) $(INSTALL_SCRIPTS) $(INSTALL_PROD) \
$(INSTALL_MAN) $(INSTALL_MANS) \
$(INSTALL_DOC) $(INSTALL_DOCS) \
$(INSTALL_TEMPLATES) $(INSTALL_TEMPLATES_SUBDIR) $(INSTALL_TEMPLATE) \
$(INSTALL_CONFIG) $(INSTALL_CONFIGS)
depends:: $(LIBSRCS) $(SRCS)
$(RM) .DEPENDS
touch .DEPENDS
ifdef $(SRCS.c)
$(DEPENDS_RULE.c)
endif
ifdef $(SRCS.cc)
$(DEPENDS_RULE.cc)
endif
clean::
@echo "Cleaning"
@$(RM) *.i *$(OBJ) *.a $(PROD) $(TESTPROD) $(LIBNAME) $(INC)
$(DIRECTORY_TARGETS) :
$(MKDIR) $@
# Problem: PRODDEPLIBS may contain libm.a etc. which we cannot locate
# But: The order in build/install should make sure that libs are
# in place before we build PROD anyway.
# $(PROD): $(PRODDEPLIBS)
# The order of the following dependencies is
# VERY IMPORTANT !!!!
# generic rule to build executable from same-name-object:
# (this should be handled by the implicit rule below)
#
#%$(EXE): %$(OBJ)
#ifdef WIN32
# $(LINK.c) $< $(LDLIBS)
#else
# $(RM) $@
# echo LINKING:
# $(LINK.c) $< $(LDLIBS)
#endif
# explicit list of source files given for PROD ?
# (otherwise implicit rule .c -> $(OBJ) -> $(EXE)
ifdef SRCS
ifeq ($(findstring cc,$(suffix $(SRCS))),cc)
PROD_LINKER = $(LINK.cc)
else
PROD_LINKER = $(LINK.c)
endif
PROD_OBJS=$(addsuffix $(OBJ), $(basename $(SRCS)))
$(PROD): $(PROD_OBJS)
$(RM) $@
echo $(LDLIBS)
$(PROD_LINKER) $(PROD_OBJS) $(LDLIBS)
endif
# explicit list of source files given for TESTPROD ?
# (otherwise implicit rule .c -> $(OBJ) -> $(EXE)
ifdef TESTPROD_SRCS
ifeq ($(findstring cc,$(suffix $(TESTPROD_SRCS))),cc)
TESTPROD_LINKER = $(LINK.cc)
else
TESTPROD_LINKER = $(LINK.c)
endif
TESTPROD_OBJS=$(addsuffix $(OBJ), $(basename $(TESTPROD_SRCS)))
$(TESTPROD): $(TESTPROD_OBJS)
$(RM) $@
$(TESTPROD_LINKER) $(TESTPROD_OBJS) $(LDLIBS)
endif
%$(EXE): %.c
$(RM) $@
$(LINK.c) $< $(LDLIBS)
%$(EXE): %.cc
$(RM) $@
$(LINK.cc) $< $(LDLIBS)
%$(OBJ): %.c
$(RM) $@
$(COMPILE.c) $<
%$(OBJ): %.cc
$(RM) $@
$(COMPILE.cc) $<
%.c %.h: ../%.y
$(RM) y.tab.c y.tab.h
$(YACC) $(YACCOPT) $<
@if [ -f y.tab.c ]; \
then \
echo "$(MV) y.tab.c $*.c"; \
$(RM) $*.c; \
$(MV) y.tab.c $*.c; \
fi
@if [ -f y.tab.h ]; \
then \
echo "$(MV) y.tab.h $*.h"; \
$(RM) $*.h; \
$(MV) y.tab.h $*.h; \
fi
%.c: ../%.l
$(RM) lex.yy.c
$(LEX) $(LEXOPT) $<
$(RM) $@
$(MV) lex.yy.c $@
#state notation language rule
%.c: ../%.st
@echo "preprocessing $*.st"
@$(RM) $*.i
$(CPP) $(CPPFLAGS) $< $*.i
@echo "converting $*.i"
@$(RM) $@
$(SNC) $(TARGET_SNCFLAGS) $(SNCFLAGS) $*.i
%.c: %.stt
@echo "converting $<"
@$(RM) $@
$(SNC) $(TARGET_SNCFLAGS) $(SNCFLAGS) $<
# Capfast Rules:
%.db: %.edf
$(E2DB) $(E2SR_SYSFLAGS) $(E2SR_FLAGS) $<
%.db: ../%.edf
$(E2DB) $(E2SR_SYSFLAGS) $(E2SR_FLAGS) $<
%.edf: ../%.sch $(DEPSCHS)
@if [ ! -f cad.rc -a -r ../cad.rc ] ; then ln -s ../cad.rc ; fi
$(SCH2EDIF) $(SCH2EDIF_SYSFLAGS) $(SCH2EDIF_FLAGS) $<
# Mangen Rule:
%.1:%
$(RM) $(<F)
$(RM) $(<F).nr
ln -s $<
$(MANGEN) -s $(<F)
$(MV) $(<F).nr $(<F).1
# Mangen Rule:
%.1:../%
$(RM) $(<F)
$(RM) $(<F).nr
ln -s $<
$(MANGEN) -s $(<F)
$(MV) $(<F).nr $(<F).1
# Rules for building LIBRARY with LIBSRCS
# (which are now LIBNAME, LIBOBJS)
#
ifdef WIN32
ifeq ($(LIBTYPE),SHARED)
# A WIN32 dll has tree parts:
# x.dll: the real dll (DLLNAME)
# x.lib: what you link to progs that use the dll (LIBNAME)
# x.exp: what you need to build the dll (in no variable)
#
# the latter two are created automatically when building the dll:
$(LIBNAME): $(DLLNAME)
# test if there is a def file for this dll:
#
DLL_DEF_FILE := ../$(LIBRARY).def
ifeq ($(DLL_DEF_FILE), $(wildcard $(DLL_DEF_FILE)))
DLL_DEF := -def:$(DLL_DEF_FILE)
endif
# Ugly trick:
# HOST_OPT_FLAGS is part of CFLAGS/CXXFLAGS,
# which in turn are used in COMPILE.c[c]
#
# If we compile a .c, .cc into an $(OBJ),
# we test if this object is part of the
# library objects LIBOBJS.
# If so, we define _WINDLL so that
# e.g. include/shareLib.h works correctly.
#
#HOST_OPT_FLAGS += $(subst $@, -D_WINDLL, $(findstring $@,$(LIBOBJS)))
$(DLLNAME): $(LIBOBJS)
link $(WIN32LDFLAGS)\
-implib:$(LIBNAME) -out:$(DLLNAME) $(DLL_DEF) \
$(DLL_DEP_LIBS) $(LIBOBJS)
else
# still on WIN32, this time no DLL but plain lib requested:
$(LIBNAME): $(LIBOBJS)
lib -nologo -verbose -out:$(LIBNAME)\
$(LIBOBJS)
lib -nologo -list $(LIBNAME)
endif # LIBTYPE is SHARED ?
else # not WIN32
# usual Unix rule for lib creation
$(LIBNAME): $(LIBOBJS)
$(RM) $@
$(ARCMD) $@ $(LIBOBJS)
@if [ ! -z "$(RANLIB)" ] ; then\
echo $(RANLIB) $@; \
$(RANLIB) $@; \
fi
endif # ifdef WIN32
# end of library creation rules
$(INSTALL_BIN)/%: ../os/$(ARCH_CLASS)/%
@echo "Installing os-specific script $@"
@$(INSTALL_PRODUCT) -m 555 $< $(INSTALL_BIN)
$(INSTALL_BIN)/%: %
@echo "Installing binary $@"
@$(INSTALL_PRODUCT) -m 555 $< $(INSTALL_BIN)
$(INSTALL_BIN)/%: ../%
@echo "Installing script $@"
@$(INSTALL_PRODUCT) -m 555 $< $(INSTALL_BIN)
$(INSTALL_LIB)/%.a: %.a
@echo "Installing library $@"
@$(INSTALL) -m 644 $< $(INSTALL_LIB)
@if [ ! -z "$(RANLIB)" ] ; then\
$(RANLIB) $(RANLIBFLAGS) $@; \
fi
$(INSTALL_LIB)/%.lib: %.lib
@echo "Installing library $@"
@$(INSTALL) -m 644 $< $(INSTALL_LIB)
$(INSTALL_CONFIG)/%: %
@echo "Installing config file $@"
@$(INSTALL) -m 644 $< $(INSTALL_CONFIG)
$(INSTALL_CONFIG)/%: ../%
@echo "Installing config file $@"
@$(INSTALL) -m 644 $< $(INSTALL_CONFIG)
$(addsuffix /%,$(MAN_DIRECTORY_TARGETS)) : %
@echo "Installing man file $@"
@$(INSTALL) -m 644 $< $(@D)
$(addsuffix /%,$(MAN_DIRECTORY_TARGETS)) : ../%
@echo "Installing man file $@"
@$(INSTALL) -m 644 $< $(@D)
$(INSTALL_INCLUDE)/%: %
@echo "Installing include file $@"
@$(INSTALL) -m 644 $< $(@D)
$(INSTALL_INCLUDE)/%: ../%
@echo "Installing include file $@"
@$(INSTALL) -m 644 $< $(@D)
$(INSTALL_DOC)/%: %
@echo "Installing doc $@"
@testmkdir $(INSTALL_DOC)
@$(INSTALL) -m 644 $< $(INSTALL_DOC)
$(INSTALL_DOC)/%: ../%
@echo "Installing doc $@"
@testmkdir $(INSTALL_DOC)
@$(INSTALL) -m 644 $< $(INSTALL_DOC)
$(INSTALL_TEMPLATES)/$(TEMPLATES_DIR)/%: ../%
@echo "Installing $@"
@$(INSTALL) -m 644 $< $(INSTALL_TEMPLATES)/$(TEMPLATES_DIR)
$(INSTALL_TEMPLATES)/$(TEMPLATES_DIR)/%: %
@echo "Installing $@"
@$(INSTALL) -m 644 $< $(INSTALL_TEMPLATES)/$(TEMPLATES_DIR)
.PRECIOUS: %.o %.c
-include .DEPENDS
.PHONY:: all inc depends build install clean rebuild buildInstall
# EOF RULES.Host

View File

@@ -1,23 +1,27 @@
# $Id$
INSTALL_PROD=$(PROD:%=$(INSTALL_BIN)/%)
INSTALL_LIBS=$(LIBNAME:%=$(INSTALL_LIB)/%)
INSTALL_INC=$(INC:%=$(INSTALL_INCLUDE)/%)
INSTALL_MANS+=$(MAN1:%=$(INSTALL_MAN)/man1/%)
INSTALL_MANS+=$(MAN2:%=$(INSTALL_MAN)/man2/%)
INSTALL_MANS+=$(MAN3:%=$(INSTALL_MAN)/man3/%)
INSTALL_MANS+=$(MAN4:%=$(INSTALL_MAN)/man4/%)
INSTALL_MANS+=$(MAN5:%=$(INSTALL_MAN)/man5/%)
INSTALL_MANS+=$(MAN6:%=$(INSTALL_MAN)/man6/%)
INSTALL_MANS+=$(MAN7:%=$(INSTALL_MAN)/man7/%)
INSTALL_MANS+=$(MAN8:%=$(INSTALL_MAN)/man8/%)
INSTALL_MANS+=$(MAN9:%=$(INSTALL_MAN)/man9/%)
INSTALL_DOCS=$(DOCS:%=$(INSTALL_DOC)/%)
INSTALL_SCRIPTS=$(SCRIPTS:%=$(INSTALL_BIN)/%)
INSTALL_TEMPLATE=$(TEMPLATES:%=$(INSTALL_TEMPLATES)/$(TEMPLATES_DIR)/%)
INSTALL_TCLLIBS=$(TCLLIBNAME:%=$(INSTALL_TCLLIB)/%)
INSTALL_TCLINDEX=$(TCLINDEX:%=$(INSTALL_TCLLIB)/%)
INSTALL_CONFIGS=$(CONFIGS:%=$(INSTALL_CONFIG)/%)
INSTALL_PROD = $(PROD:%= $(INSTALL_BIN)/%)
INSTALL_LIBS = $(LIBNAME:%= $(INSTALL_LIB)/%)
INSTALL_INC = $(INC:%= $(INSTALL_INCLUDE)/%)
INSTALL_OSINCLUDE = $(INSTALL_INCLUDE)/os/$(T_A)
INSTALL_OSINC = $(OSINC:%= $(INSTALL_OSINCLUDE)/%)
MANLIST = 1 2 3 4 5 6 7 8 9
INSTALL_MANS = $(foreach n, \
$(MANLIST),$(INSTALL_MAN)/man$(n) $(MAN$(n):%= $(INSTALL_MAN)/man$(n)/%))
INSTALL_DOCS = $(DOCS:%= $(INSTALL_DOC)/%)
INSTALL_SCRIPTS = $(SCRIPTS:%= $(INSTALL_BIN)/%)
INSTALL_TEMPLATES_SUBDIR = $(INSTALL_TEMPLATES)/$(TEMPLATES_DIR)
INSTALL_TEMPLATE = $(TEMPLATES:%= $(INSTALL_TEMPLATES_SUBDIR)/%)
INSTALL_CONFIGS = $(CONFIGS:%= $(INSTALL_CONFIG)/%)
MAN_DIRECTORY_TARGETS = $(foreach n, $(MANLIST),$(INSTALL_MAN)/man$(n))
DIRECTORY_TARGETS = $(INSTALL_INCLUDE) $(INSTALL_INCLUDE)/os \
$(INSTALL_OSINCLUDE) $(INSTALL_DOC) \
$(INSTALL_TEMPLATES)/$(TEMPLATES_DIR) $(INSTALL_TEMPLATES) \
$(INSTALL_LOCATION_BIN) $(INSTALL_BIN) $(INSTALL_LIB) \
$(INSTALL_LOCATION_LIB) $(INSTALL_CONFIG) \
$(MAN_DIRECTORY_TARGETS) $(INSTALL_MAN)
all:: install
@@ -27,11 +31,20 @@ rebuild:: clean install
build:: pre_build $(LIBNAME) $(TARGETS) $(PROD)
inc:: $(INSTALL_INC)
inc:: $(INSTALL_INCLUDE) $(INSTALL_INC) $(INSTALL_INCLUDE)/os \
$(INSTALL_OSINCLUDE) $(INSTALL_OSINC)
install:: inc build $(INSTALL_LIBS) $(TARGETS) $(INSTALL_SCRIPTS) $(INSTALL_PROD) \
$(INSTALL_MANS) $(INSTALL_DOCS) $(INSTALL_TEMPLATE) \
$(INSTALL_TCLLIBS) $(INSTALL_TCLINDEX) $(INSTALL_CONFIGS)
install:: inc buildInstall
buildInstall :: build \
$(INSTALL_LOCATION_LIB) $(INSTALL_LIB) $(INSTALL_LIBS) \
$(TARGETS) \
$(INSTALL_LOCATION_BIN) $(INSTALL_BIN) \
$(INSTALL_SCRIPTS) $(INSTALL_PROD) \
$(INSTALL_MAN) $(INSTALL_MANS) \
$(INSTALL_DOC) $(INSTALL_DOCS) $(INSTALL_TEMPLATES) \
$(INSTALL_TEMPLATES)/$(TEMPLATES_DIR) $(INSTALL_TEMPLATE) \
$(INSTALL_CONFIG) $(INSTALL_CONFIGS)
depends:: $(SRCS.c) $(SRCS.cc)
ifdef SRCS
@@ -49,6 +62,8 @@ clean::
@echo "Cleaning"
@$(RM) *.i *.o *.a $(TARGETS) $(PROD) $(LIBNAME) $(INC)
$(DIRECTORY_TARGETS) :
@$(MKDIR) $@
$(TARGETS) $(PROD): $(DEPLIBS)
@@ -143,118 +158,70 @@ $(TARGETS) $(PROD): $(DEPLIBS)
$(LIBNAME): $(LIBOBJS)
@echo Building library $@
$(RM) $@
$(AR) $(ARFLAGS) $@ $(LIBOBJS)
$(ARCMD) $@ $(LIBOBJS)
@if [ ! -z "$(RANLIB)" ] ; then\
echo $(RANLIB) $@; \
$(RANLIB) $@; \
fi
$(INSTALL_BIN)/%: %
@echo "Installing $@"
@test -d $(INSTALL_LOCATION_BIN) || mkdir $(INSTALL_LOCATION_BIN)
@test -d $(INSTALL_BIN) || mkdir $(INSTALL_BIN)
$(INSTALL_BIN)/%: %
@echo "Installing Binary $@"
@$(INSTALL_PRODUCT) -m 555 $< $(INSTALL_BIN)
$(INSTALL_BIN)/%: ../%
@echo "Installing $@"
@test -d $(INSTALL_LOCATION_BIN) || mkdir $(INSTALL_LOCATION_BIN)
@test -d $(INSTALL_BIN) || mkdir $(INSTALL_BIN)
$(INSTALL_BIN)/%: ../%
@echo "Installing Binary $@"
@$(INSTALL_PRODUCT) -m 555 $< $(INSTALL_BIN)
$(INSTALL_LIB)/%.a: %.a
$(INSTALL_LIB)/%.a: %.a
@echo "Installing library $@"
@test -d $(INSTALL_LOCATION_LIB) || mkdir $(INSTALL_LOCATION_LIB)
@test -d $(INSTALL_LIB) || mkdir $(INSTALL_LIB)
@$(INSTALL) -m 644 $< $(INSTALL_LIB)
@if [ ! -z "$(RANLIB)" ] ; then\
$(RANLIB) $(RANLIBFLAGS) $@; \
fi
$(INSTALL_CONFIG)/%: %
@echo "Installing $@"
@test -d $(INSTALL_CONFIG) || mkdir $(INSTALL_CONFIG)
$(INSTALL_CONFIG)/%: %
@echo "Installing Config File $@"
@$(INSTALL) -m 644 $< $(INSTALL_CONFIG)
$(INSTALL_CONFIG)/%: ../%
@echo "Installing $@"
@test -d $(INSTALL_CONFIG) || mkdir $(INSTALL_CONFIG)
$(INSTALL_CONFIG)/%: ../%
@echo "Installing Config File $@"
@$(INSTALL) -m 644 $< $(INSTALL_CONFIG)
$(INSTALL_TCLLIB)/%: ../%
@echo "Installing Tcl library $@"
@test -d $(INSTALL_LOCATION_LIB) || mkdir $(INSTALL_LOCATION_LIB)
@test -d $(INSTALL_LIB) || mkdir $(INSTALL_LIB)
@$(INSTALL) -m 644 $< $(INSTALL_LIB)
$(INSTALL_TCLLIB)/$(TCLINDEX): $(INSTALL_TCLLIBS)
@echo "Updating $@"
@echo eval auto_mkindex $(INSTALL_LIB) "$(TCLLIBNAME)" | tclsh
$(INSTALL_MAN)/man9/% \
$(INSTALL_MAN)/man8/% \
$(INSTALL_MAN)/man7/% \
$(INSTALL_MAN)/man6/% \
$(INSTALL_MAN)/man5/% \
$(INSTALL_MAN)/man4/% \
$(INSTALL_MAN)/man3/% \
$(INSTALL_MAN)/man2/% \
$(INSTALL_MAN)/man1/%: %
@echo "Installing $@"
@test -d $(INSTALL_MAN) || mkdir $(INSTALL_MAN)
@test -d $(@D) || mkdir $(@D)
$(addsuffix /%,$(MAN_DIRECTORY_TARGETS)) : %
@echo "Installing man file $@"
@$(INSTALL) -m 644 $< $(@D)
$(INSTALL_MAN)/man9/% \
$(INSTALL_MAN)/man8/% \
$(INSTALL_MAN)/man7/% \
$(INSTALL_MAN)/man6/% \
$(INSTALL_MAN)/man5/% \
$(INSTALL_MAN)/man4/% \
$(INSTALL_MAN)/man3/% \
$(INSTALL_MAN)/man2/% \
$(INSTALL_MAN)/man1/%: ../%
@echo "Installing $@"
@test -d $(INSTALL_MAN) || mkdir $(INSTALL_MAN)
@test -d $(@D) || mkdir $(@D)
$(addsuffix /%,$(MAN_DIRECTORY_TARGETS)) : ../%
@echo "Installing man file $@"
@$(INSTALL) -m 644 $< $(@D)
$(INSTALL_INCLUDE)/%: %
@echo "Installing $@"
@test -d $(INSTALL_INCLUDE) || mkdir $(INSTALL_INCLUDE)
@$(INSTALL) -m 644 $< $(INSTALL_INCLUDE)
$(INSTALL_INCLUDE)/%: %
@echo "Installing Include File $@"
@$(INSTALL) -m 644 $< $(@D)
$(INSTALL_INCLUDE)/%: ../%
@echo "Installing $@"
@test -d $(INSTALL_INCLUDE) || mkdir $(INSTALL_INCLUDE)
@$(INSTALL) -m 644 $< $(INSTALL_INCLUDE)
$(INSTALL_INCLUDE)/%: ../%
@echo "Installing Include File $@"
@$(INSTALL) -m 644 $< $(@D)
$(INSTALL_DOC)/%: %
@echo "Installing $@"
@test -d $(INSTALL_DOC) || mkdir $(INSTALL_DOC)
$(INSTALL_DOC)/%: %
@echo "Installing doc $@"
@$(INSTALL) -m 644 $< $(INSTALL_DOC)
$(INSTALL_DOC)/%: ../%
@echo "Installing $@"
@test -d $(INSTALL_DOC) || mkdir $(INSTALL_DOC)
$(INSTALL_DOC)/%: ../%
@echo "Installing doc $@"
@$(INSTALL) -m 644 $< $(INSTALL_DOC)
$(INSTALL_TEMPLATES)/$(TEMPLATES_DIR)/%: ../%
@echo "Installing $@"
@test -d $(INSTALL_TEMPLATES) || mkdir $(INSTALL_TEMPLATES)
@test -d $(INSTALL_TEMPLATES)/$(TEMPLATES_DIR) || \
mkdir $(INSTALL_TEMPLATES)/$(TEMPLATES_DIR)
$(INSTALL_TEMPLATES)/$(TEMPLATES_DIR)/%: ../%
@echo "Installing template $@"
@$(INSTALL) -d -m 644 $< $(INSTALL_TEMPLATES)/$(TEMPLATES_DIR)
$(INSTALL_TEMPLATES)/$(TEMPLATES_DIR)/%: %
@echo "Installing $@"
@test -d $(INSTALL_TEMPLATES) || mkdir $(INSTALL_TEMPLATES)
@test -d $(INSTALL_TEMPLATES)/$(TEMPLATES_DIR) || \
mkdir $(INSTALL_TEMPLATES)/$(TEMPLATES_DIR)
$(INSTALL_TEMPLATES)/$(TEMPLATES_DIR)/%: %
@echo "Installing template $@"
@$(INSTALL) -d -m 644 $< $(INSTALL_TEMPLATES)/$(TEMPLATES_DIR)
.PRECIOUS: %.o %.c
.PHONY: all inc depends build install pre-build clean rebuild
.PHONY:: all inc depends build install pre-build clean rebuild
-include .DEPENDS

View File

@@ -1,46 +1,57 @@
# $Id$
INCREC +=$(RECTYPES) $(MENUS)
INSTALL_PROD=$(PROD:%=$(INSTALL_BIN)/%)
INSTALL_LIBS=$(LIBNAME:%=$(INSTALL_BIN)/%)
INSTALL_INC=$(INC:%=$(INSTALL_INCLUDE)/%)
INSTALL_INCREC=$(INCREC:%=$(INSTALL_INCLUDE)/%)
INSTALL_MANS+=$(MAN1:%=$(INSTALL_MAN)/man1/%)
INSTALL_MANS+=$(MAN2:%=$(INSTALL_MAN)/man2/%)
INSTALL_MANS+=$(MAN3:%=$(INSTALL_MAN)/man3/%)
INSTALL_MANS+=$(MAN4:%=$(INSTALL_MAN)/man4/%)
INSTALL_MANS+=$(MAN5:%=$(INSTALL_MAN)/man5/%)
INSTALL_MANS+=$(MAN6:%=$(INSTALL_MAN)/man6/%)
INSTALL_MANS+=$(MAN7:%=$(INSTALL_MAN)/man7/%)
INSTALL_MANS+=$(MAN8:%=$(INSTALL_MAN)/man8/%)
INSTALL_MANS+=$(MAN9:%=$(INSTALL_MAN)/man9/%)
INSTALL_DOCS=$(DOCS:%=$(INSTALL_DOC)/%)
INSTALL_SCRIPTS=$(SCRIPTS:%=$(INSTALL_BIN)/%)
INSTALL_INSTALLS=$(INSTALLS:%=$(INSTALL_BIN)/%)
INSTALL_PROD = $(PROD:%= $(INSTALL_BIN)/%)
INSTALL_LIBS = $(LIBNAME:%= $(INSTALL_BIN)/%)
INSTALL_LIBS_CXX = $(LIBNAME_CXX:%= $(INSTALL_BIN)/%)
INSTALL_INC = $(INC:%= $(INSTALL_INCLUDE)/%)
INSTALL_OSINCLUDE = $(INSTALL_INCLUDE)/os/vxWorks
INSTALL_OSINC = $(OSINC:%= $(INSTALL_OSINCLUDE)/%)
INSTALL_INCREC = $(INCREC:%= $(INSTALL_INCLUDE)/%)
MANLIST = 1 2 3 4 5 6 7 8 9
INSTALL_MANS = $(foreach n, \
$(MANLIST),$(INSTALL_MAN)/man$(n) $(MAN$(n):%= $(INSTALL_MAN)/man$(n)/%))
INSTALL_DOCS = $(DOCS:%= $(INSTALL_DOC)/%)
INSTALL_SCRIPTS = $(SCRIPTS:%= $(INSTALL_BIN)/%)
INSTALL_INSTALLS = $(INSTALLS:%= $(INSTALL_BIN)/%)
INSTALL_BPTS=$(BPTS:%=$(INSTALL_DBD)/%)
INSTALL_DBS=$(DBDINSTALL:%=$(INSTALL_DBD)/%)\
$(RECTYPES:%.h=$(INSTALL_DBD)/%.dbd)\
$(MENUS:%.h=$(INSTALL_DBD)/%.dbd)
INSTALL_BPTS = $(BPTS:%= $(INSTALL_DBD)/%)
INSTALL_DBS = $(DBDINSTALL:%= $(INSTALL_DBD)/%)\
$(RECTYPES:%.h= $(INSTALL_DBD)/%.dbd)\
$(MENUS:%.h= $(INSTALL_DBD)/%.dbd)
INSTALL_DBDNAME=$(DBDNAME:%=$(INSTALL_DBD)/%)
INSTALL_DBDNAME = $(DBDNAME:%= $(INSTALL_DBD)/%)
all:: install
MAN_DIRECTORY_TARGETS = $(foreach n, $(MANLIST),$(INSTALL_MAN)/man$(n))
DIRECTORY_TARGETS = $(INSTALL_INCLUDE) $(INSTALL_DOC) $(INSTALL_DBD) \
$(INSTALL_OSINCLUDE) $(INSTALL_INCLUDE)/os \
$(INSTALL_LOCATION_BIN) $(INSTALL_BIN) \
$(MAN_DIRECTORY_TARGETS) $(INSTALL_MAN)
all:: install
rebuild:: clean install
pre_build::
build:: pre_build $(MENUS) $(RECTYPES) $(BPTS)\
$(LIBNAME) $(TARGETS) $(PROD) $(DBDNAME)
$(LIBNAME) $(LIBNAME_CXX) $(TARGETS) $(PROD) $(DBDNAME)
inc:: $(INSTALL_INC)
inc:: $(INSTALL_INCLUDE) $(INSTALL_INC) $(INSTALL_INCLUDE)/os \
$(INSTALL_OSINCLUDE) $(INSTALL_OSINC)
install:: inc build $(INSTALL_INCREC)\
$(INSTALL_LIBS) $(TARGETS) $(INSTALL_PROD) $(INSTALL_MANS)\
$(INSTALL_DOCS) $(INSTALL_SCRIPTS)\
$(INSTALL_INSTALLS) $(INSTALL_DBS) $(INSTALL_BPTS)\
$(INSTALL_DBDNAME)
install:: inc buildInstall
buildInstall :: build $(INSTALL_INCREC)\
$(INSTALL_LOCATION_BIN) \
$(INSTALL_BIN) $(INSTALL_LIBS) $(INSTALL_LIBS_CXX) \
$(TARGETS) $(INSTALL_PROD) \
$(INSTALL_MAN) $(INSTALL_MANS)\
$(INSTALL_DOC) $(INSTALL_DOCS) \
$(INSTALL_SCRIPTS) $(INSTALL_INSTALLS)\
$(INSTALL_DBD) $(INSTALL_DBS) $(INSTALL_BPTS) \
$(INSTALL_DBDNAME) binInstalls
depends:: $(SRCS.c) $(SRCS.cc)
ifdef SRCS
@@ -59,6 +70,8 @@ clean::
@$(RM) *.i *.o *.a $(TARGETS) $(PROD) $(LIBNAME) $(INC) \
$(DBDINSTALL) $(MENUS) $(RECTYPES) $(BPTS) $(DBDNAME)
$(DIRECTORY_TARGETS) :
@$(MKDIR) $@
# The order of the following dependencies is
# VERY IMPORTANT !!!!
@@ -140,15 +153,15 @@ clean::
$(MANGEN) -s $(<F)
$(MV) $(<F).nr $(<F).1
binInstalls: $(BIN_INSTALLS)
@$(INSTALL) -m 555 $^ $(INSTALL_BIN)
$(INSTALL_DBD)/%: %
$(INSTALL_DBD)/%: %
@echo "Installing $@"
@test -d $(INSTALL_DBD) || mkdir $(INSTALL_DBD)
@$(INSTALL) -m 644 $< $(INSTALL_DBD)
$(INSTALL_DBD)/%: ../%
$(INSTALL_DBD)/%: ../%
@echo "Installing $@"
@test -d $(INSTALL_DBD) || mkdir $(INSTALL_DBD)
@$(INSTALL) -m 644 $< $(INSTALL_DBD)
%Record.h: %Record.dbd
@@ -188,75 +201,62 @@ $(LIBNAME): $(LIBOBJS)
@$(RM) $@
$(LINK.c) $@ $(LIBOBJS)
$(INSTALL_BIN)/%: %
$(LIBNAME_CXX): $(LIBOBJS_CXX)
@echo Building CXX library $@
@$(RM) $@
$(LINK.cc) $@ $(LIBOBJS_CXX)
$(INSTALL_BIN)/%: %
@echo "Installing $@"
@test -d $(INSTALL_LOCATION_BIN) || mkdir $(INSTALL_LOCATION_BIN)
@test -d $(INSTALL_BIN) || mkdir $(INSTALL_BIN)
@$(INSTALL) -m 555 $< $(INSTALL_BIN)
$(INSTALL_BIN)/%: ../%
$(INSTALL_BIN)/%: ../%
@echo "Installing $@"
@test -d $(INSTALL_LOCATION_BIN) || mkdir $(INSTALL_LOCATION_BIN)
@test -d $(INSTALL_BIN) || mkdir $(INSTALL_BIN)
@$(INSTALL) -m 555 $< $(INSTALL_BIN)
$(INSTALL_BIN)/%: $(EPICS_BASE_BIN)/%
#
# avoid confusing circular dependency message when
# INSTALL_BIN and EPICS_BASE_BIN are the same (in base)
#
ifneq ($(INSTALL_BIN),$(EPICS_BASE_BIN))
$(INSTALL_BIN)/%: $(EPICS_BASE_BIN)/%
@echo "Installing $@"
@test -d $(INSTALL_LOCATION_BIN) || mkdir $(INSTALL_LOCATION_BIN)
@test -d $(INSTALL_BIN) || mkdir $(INSTALL_BIN)
@$(INSTALL) -m 555 $< $(INSTALL_BIN)
endif
$(INSTALL_MAN)/man9/% \
$(INSTALL_MAN)/man8/% \
$(INSTALL_MAN)/man7/% \
$(INSTALL_MAN)/man6/% \
$(INSTALL_MAN)/man5/% \
$(INSTALL_MAN)/man4/% \
$(INSTALL_MAN)/man3/% \
$(INSTALL_MAN)/man2/% \
$(INSTALL_MAN)/man1/%: %
$(addsuffix /%,$(MAN_DIRECTORY_TARGETS)) : %
@echo "Installing $@"
@test -d $(INSTALL_MAN) || mkdir $(INSTALL_MAN)
@test -d $(@D) || mkdir $(@D)
@$(INSTALL) -m 644 $< $(@D)
$(INSTALL_MAN)/man9/% \
$(INSTALL_MAN)/man8/% \
$(INSTALL_MAN)/man7/% \
$(INSTALL_MAN)/man6/% \
$(INSTALL_MAN)/man5/% \
$(INSTALL_MAN)/man4/% \
$(INSTALL_MAN)/man3/% \
$(INSTALL_MAN)/man2/% \
$(INSTALL_MAN)/man1/%: ../%
$(addsuffix /%,$(MAN_DIRECTORY_TARGETS)) : ../%
@echo "Installing $@"
@test -d $(INSTALL_MAN) || mkdir $(INSTALL_MAN)
@test -d $(@D) || mkdir $(@D)
@$(INSTALL) -m 644 $< $(@D)
$(INSTALL_INCLUDE)/%: %
$(INSTALL_INCLUDE)/%: %
@echo "Installing $@"
@test -d $(INSTALL_INCLUDE) || mkdir $(INSTALL_INCLUDE)
@$(INSTALL) -m 644 $< $(INSTALL_INCLUDE)
@$(INSTALL) -m 644 $< $(@D)
$(INSTALL_INCLUDE)/%: ../%
$(INSTALL_INCLUDE)/%: ../%
@echo "Installing $@"
@test -d $(INSTALL_INCLUDE) || mkdir $(INSTALL_INCLUDE)
@$(INSTALL) -m 644 $< $(INSTALL_INCLUDE)
@$(INSTALL) -m 644 $< $(@D)
$(INSTALL_DOC)/%: %
$(INSTALL_DOC)/%: %
@echo "Installing $@"
@test -d $(INSTALL_DOC) || mkdir $(INSTALL_DOC)
@$(INSTALL) -m 644 $< $(INSTALL_DOC)
$(INSTALL_DOC)/%: ../%
$(INSTALL_DOC)/%: ../%
@echo "Installing $@"
@test -d $(INSTALL_DOC) || mkdir $(INSTALL_DOC)
@$(INSTALL) -m 644 $< $(INSTALL_DOC)
.PRECIOUS: %.o %.c
.PHONY: all inc depends build install pre-build clean rebuild
.PHONY:: all inc depends build install pre_build clean rebuild buildInstall binInstalls
-include .DEPENDS
ifneq (,$(wildcard ../baseLIBOBJS))
$(LIBNAME): ../baseLIBOBJS
endif
$(LIBNAME): ../Makefile.Vx
$(DBDNAME): ../base.dbd $(RECTYPES:%.h=../%.dbd)

50
config/RULES.ioc Normal file
View File

@@ -0,0 +1,50 @@
#RULES.ioc
APPDIR := $(shell grep '.*".*App/' st.* | sed -e 's/.*"\(.*App\).*/\1/' | sort -u )
ASCF = $(TOP)/../ascf
TARGETBIN = $(TOP)/bin/$(ARCH)
ARCHS = $(BUILD_ARCHS) host cross
ACTIONS += clean inc depends buildInstall build
actionArchTargets = $(foreach action, $(ACTIONS) install,\
$(foreach arch, $(ARCHS), \
$(action)$(DIVIDER)$(arch)))
all install :: inc buildInstall
buildInstall: makelinks
inc build depends:
makelinks:
@$(RM) ascf bin vxWorks vxWorks.sym dbd share $(APPDIR)
ln -s $(ASCF) ascf
ln -s $(TARGETBIN) bin
ln -s $(TARGETBIN)/vxWorks vxWorks
ln -s $(TARGETBIN)/vxWorks.sym vxWorks.sym
ln -s $(TOP)/dbd dbd
ln -s $(SHARE) share
@for dir in $(APPDIR) scum ; do \
if [ $$dir = scum ]; then \
: ; \
elif [ -d $(TOP)/$$dir ]; then \
ln -s $(TOP)/$$dir $$dir ; \
echo "ln -s $(TOP)/$$dir $$dir" ; \
elif [ -d $(MASTER_IOCAPPS)/$$dir ]; then \
ln -s $(MASTER_IOCAPPS)/$$dir $$dir ; \
echo "ln -s $(MASTER_IOCAPPS)/$$dir $$dir" ; \
else \
echo "$$dir not found" ; \
fi ; \
done
clean::
@$(RM) ascf bin vxWorks vxWorks.sym dbd share $(APPDIR)
$(actionArchTargets) :%:
$(MAKE) $(word 1, $(subst $(DIVIDER), ,$@))
$(ARCHS):%: install
.PHONY :: $(ARCHS) $(ACTIONS)
.PHONY :: $(actionArchTargets)

View File

@@ -10,6 +10,7 @@ all:: install
ACTIONS += inc
ACTIONS += build
ACTIONS += install
ACTIONS += buildInstall
ACTIONS += depends
ACTIONS += rebuild
@@ -63,7 +64,7 @@ $(crossDirs) :
#
# host/cross action targets
#
$(ACTIONS) clean : % : %$(DIVIDER)host %$(DIVIDER)cross
$(ACTIONS) : % : %$(DIVIDER)host %$(DIVIDER)cross
HostActionTargets = $(foreach x, $(ACTIONS) clean, $(x)$(DIVIDER)host)
CrossActionTargets = $(foreach x, $(ACTIONS) clean, $(x)$(DIVIDER)cross)
$(HostActionTargets) : %$(DIVIDER)host : $(addprefix %$(DIVIDER), $(hostArchs))
@@ -79,13 +80,15 @@ cross : $(crossArchs)
#
# special clean rule
#
clean :
$(RMDIR) $(hostDirs) $(crossDirs)
clean$(DIVIDER)% :
$(RMDIR) O.$*
.PHONY : $(HostActionTargets)
.PHONY : $(CrossActionTargets)
.PHONY : $(crossActionArchTargets)
.PHONY : $(hostActionArchTargets)
.PHONY : $(hostArchs) $(crossArchs)
.PHONY : $(ACTIONS) clean all host cross
.PHONY :: $(HostActionTargets)
.PHONY :: $(CrossActionTargets)
.PHONY :: $(crossActionArchTargets)
.PHONY :: $(hostActionArchTargets)
.PHONY :: $(hostArchs) $(crossArchs)
.PHONY :: $(ACTIONS) clean all host cross

View File

@@ -4,39 +4,43 @@
ARCHS += $(BUILD_ARCHS) host cross
ACTIONS += clean inc install depends
ACTIONS += clean inc depends buildInstall
dirPart = $(word 1, $(subst $(DIVIDER), ,$@))
actionArchPart = $(subst $(dirPart)$(DIVIDER), ,$@)
dirActionArchTargets = $(foreach dir, $(DIRS), \
$(foreach action, $(ACTIONS),\
$(foreach action, $(ACTIONS) install,\
$(foreach arch, $(ARCHS), \
$(dir)$(DIVIDER)$(action)$(DIVIDER)$(arch))))
dirArchTargets += $(foreach dir, $(DIRS), \
$(foreach arch, $(ARCHS),\
$(dir)$(DIVIDER)$(arch)))
dirActionTargets += $(foreach dir, $(DIRS), \
$(foreach action, $(ACTIONS),\
$(foreach action, $(ACTIONS) install,\
$(dir)$(DIVIDER)$(action)))
actionArchTargets = $(foreach action, $(ACTIONS),\
actionArchTargets = $(foreach action, $(ACTIONS) install,\
$(foreach arch, $(ARCHS), \
$(action)$(DIVIDER)$(arch)))
all:: inc install
all install :: inc buildInstall
rebuild:: clean all
$(DIRS) $(dirActionTargets) $(dirArchTargets)$(dirActionArchTargets) ::
$(MAKE) -C $(dirPart) $(actionArchPart)
$(ARCHS) $(ACTIONS) $(actionArchTargets):%: $(foreach dir, $(DIRS), $(dir)$(DIVIDER)%)
$(ARCHS) $(installArchTargets) :%: \
$(foreach dir, $(DIRS), $(dir)$(DIVIDER)inc) \
$(foreach dir, $(DIRS), $(dir)$(DIVIDER)%)
$(ACTIONS) $(actionArchTargets) :%: \
$(foreach dir, $(DIRS), $(dir)$(DIVIDER)%)
.PHONY : $(DIRS)
.PHONY : $(ARCHS) $(ACTIONS)
.PHONY : $(dirActionTargets) $(dirArchTargets)
.PHONY : $(dirActionArchTargets)
.PHONY : $(actionArchTargets)
.PHONY :: $(DIRS) all install rebuild
.PHONY :: $(ARCHS) $(ACTIONS)
.PHONY :: $(dirActionTargets) $(dirArchTargets)
.PHONY :: $(dirActionArchTargets)
.PHONY :: $(actionArchTargets)

View File

@@ -6,7 +6,8 @@ include $(TOP)/config/RULES_DIRS
uninstall$(DIVIDER)%::
@$(RMDIR) $(INSTALL_LOCATION_BIN)/$* $(INSTALL_LOCATION_LIB)/$* \
$(INSTALL_LOCATION)/dbd $(INSTALL_MAN) $(INSTALL_INCLUDE)
$(INSTALL_LOCATION)/dbd $(INSTALL_MAN) $(INSTALL_INCLUDE) \
$(INSTALL_DOC) $(INSTALL_DBD) $(INSTALL_TEMPLATES)
@$(RMDIR) rec.bak rec
uninstall:: $(addprefix uninstall$(DIVIDER),$(BUILD_ARCHS))
@@ -45,6 +46,6 @@ help:
@echo "Indiv. object targets are supported by O.<arch> level Makefile .e.g"
@echo " xxxRecord.o
.PHONY : uninstall tar help
.PHONY : $(addprefix uninstall$(DIVIDER), $(BUILDARCHS))
.PHONY :: uninstall tar help
.PHONY :: $(addprefix uninstall$(DIVIDER), $(BUILDARCHS))

185
config/Sample.Makefile.Host Normal file
View File

@@ -0,0 +1,185 @@
# Makefile.Host for base/src/sample
#
#
# Sample Makefile.Host showing all possible entries
# that are allowed using RULES.Host.
#
# 8-01-96 -kuk-
#
#
TOP = ../../..
include $(TOP)/config/CONFIG_BASE
CMPLR = STRICT
# Add-on CFLAGS that are needed in this subproject.
# (If possible, all system specific flags should be
# defined in CONFIG.$(ARCH_CLASS))
#
# Whenever possible, ONLY USR_CFLAGS should be
# used. If you need special flags for your system,
# try to put them in CONFIG.YourSystem!
#
# This is used on all systems:
USR_CFLAGS := -DVAR=value -Ddefine_for_all_systems
# This is added to the above, but only for ARCH_CLASS=BSD:
USR_CFLAGS_BSD := -DVERSION='Berkeley enhanced'
# ..only for WIN32:
USR_CFLAGS_WIN32 := -DVERSION='WIN32 port'
#
# -nil- is special:
# if USR_CFLAGS_SYSV was undefined or empty, .._DEFAULT would have
# been used.
# To indicate
# "yes, there is a special USR_CFLAGS for SYSV, but it's empty"
# you have to set it to -nil-:
USR_CFLAGS_SYSV := -nil-
# .. for all other arch classes:
USR_CFLAGS_DEFAULT := -DVERSION='generic Unix'
# CFLAGS that are only used to compile a_file.c or a_file.cc:
#
a_file_CFLAGS := -DIN_A_FILE
# ---------------------------------------------------------
# general rule for all .c .cc .h .hh files and scripts:
#
# In here you supply just the filename without '../' etc.
# While building in an O.xxx subdir, the
# sources are extracted from either the
# '..'
# dir or - if it exists - the dir
# '../$(ARCH_CLASS)'
# is preferred.
# ---------------------------------------------------------
# includes to install from this sub-project
#
# again: if INC_$(ARCH_CLASS) is defined, it is added to INC,
# otherwise INC_DEFAULT (if defined) is added:
#
INC_DEFAULT := for_all_but_WIN32_or_hp700.h
INC_WIN32 := only_for_WIN32.h
INC_hp700 := -nil- # hp700 uses no special include
INC := file.h
# --------------------------------------------------------------------
# defining a library
# --------------------------------------------------------------------
#
# Contents of a library are specified via LIBSRCS.
# From this the platform specific object names (.o, .obj, ...)
# are derived automatically.
#
# Platform specific objects:
# use LIBOBJS_$(ARCH_CLASS) or .._DEFAULT
#
# Platform specific files can also be put in
# separate os/ARCH_CLASS directories!
#
# For almost every file the seach order is:
# ./os/ARCH_CLASS
# ./os/generic
# .
# So usually only LIBSRCS should be sufficient!
#
LIBSRCS := file_for_lib.c another_file.cc
LIBSRCS_DEFAULT := posix.c
LIBSRCS_WIN32 := win32_special.c
LIBSRCS_BSD := -nil-
# Type of library to build.
# On WIN32, SHARED results in a DLL, others may ignore this.
LIBTYPE:=SHARED
# Ugly but necessary for WIN32:
# If LIBRARY is build as a dll, it may need other libraries
# to link with that you specify here.
# (because a dll is similar to a program:
# all references have to be resolved)
#
# If there is a file ../$(LIBRARY).def, it will
# be used as the dll-def-file on WIN32
#
# We need this flag because
# 1) you may not use a def file ('proper' code needs no def files)
# 2) you may have one and still not want a DLL (for testing etc.)
#
DLL_LIBS:=some_dll
# Library to build:
# lib$(LIBRARY).a or ..dll/..exp/..lib
#
# Currently you can build only one (1) lib per Makefile.Host!
#
LIBRARY:=libname
# --------------------------------------------------------------------
# defining products (executable programs)
# --------------------------------------------------------------------
#
# if SRCS is undefined, it defaults to $(PROD).c
SRCS=a.c b.c c.c
# libs needed to link PROD and TESTPROD
#
# for all systems:
PROD_LIBS := Com Ca
# for most systems:
PROD_LIBS_DEFAULT := mathlib
PROD_LIBS_WIN32 := -nil-
# Product,
# may be caRepeater.o -> caRepeater
# or caRepeater.obj -> caRepeater.exe
PROD := prod
PROD_DEFAULT := product_for_rest
PROD_WIN32 := product_only_for_WIN32
PROD_BSD := product_only_for_BSD
PROD_SYSV := product_only_for_SYSV
# Scripts to install
#
# If there is both ../$(SCRIPT) and ../$(ARCH_CLASS)/$(SCRIPT),
# the latter, system specific version will be installed!
#
SCRIPTS_DEFAULT := script_for_rest
SCRIPTS_WIN32 := script_only_for_WIN32
SCRIPTS_BSD := script_only_for_BSD
SCRIPTS := script
# uncomment if you want to build these locally without installing:
# TESTPROD = test
# Unfortunately the above allows you only to
# 1) build one PROD:=p from many SRCS:=a.c b.c c.c
# or
# 2) build many PROD:=a b c each from a single source (a.c, b.c, c.c)
#
# If you have several multi-source products in the same dir
# you have to fall back to explicit rules.
# (suggestions for a better syntax welcome!)
#
# The explicit rules, however, should look like the following:
# be careful if you add rules and dependencies:
# use $(MV) $(RM) $(CP) $(MKDIR) $(RMDIR) $(OBJ) $(EXE) $(LINK.c) ....
xxxxx$(OBJ): c1.c c2.c h1.h
# because the output-flag (mostly '-o $@' on Unix, '-Fe$@' on WIN32)
# is also system dependend, it's included in $(LINK.c) and $(LINK.cc) !
#
prog$(EXE): a$(OBJ) b$(OBJ)
$(LINK.c) a$(OBJ) b$(OBJ) $(LDLIBS)
clean::
$(RM) dbLex.c
include $(TOP)/config/RULES.Host
# EOF Makefile.Host

32
src/as/Makefile.Host Normal file
View File

@@ -0,0 +1,32 @@
TOP = ../../..
include $(TOP)/config/CONFIG_BASE
USR_CFLAGS = -D_NO_PROTO
INC := asDbLib.h asLib.h
# build lib As from asLib.c:
#
LIBSRCS := asLib.c
LIBRARY := As
# All systems link the libs As, Com, Db (and again Com ??),
# generic Unix needs also lib m:
#
PROD_LIBS_DEFAULT := m
PROD_LIBS_WIN32 := -nil-
PROD_LIBS := As Com Db Com
PROD := ascheck
include $(TOP)/config/RULES.Host
# Extra rule since asLib_lex.c is included in asLib.c
# In my opinion, these objects should really be built
# independently.
asLib$(OBJ): asLib_lex.c ../asLibRoutines.c
clean::
@$(RM) asLib.c asLib_lex.c

View File

@@ -1,31 +0,0 @@
TOP = ../../..
include $(TOP)/config/CONFIG_BASE
USR_CFLAGS = -D_NO_PROTO
USR_LDLIBS = -lAs -lCom -lDb -lCom -lm -s
USR_LDFLAGS = -L.
DEPLIBS_BASE = $(INSTALL_LIB)
DEPLIBS = ./libAs.a\
$(DEPLIBS_BASE)/libCom.a\
$(DEPLIBS_BASE)/libDb.a
INC += asDbLib.h
INC += asLib.h
SRCS.c = ../ascheck.c asLib.c
OBJS = ascheck.o
LIBOBJS = asLib.o
LIBNAME = libAs.a
PROD = ascheck
include $(TOP)/config/RULES.Unix
# Extra rule since asLib_lex.c is included in asLib.c
# In my opinion, these objects should really be built
# independently.
asLib.o: asLib_lex.c ../asLibRoutines.c
clean::
@$(RM) asLib.c asLib_lex.c

10
src/bdt/Makefile.Host Normal file
View File

@@ -0,0 +1,10 @@
TOP = ../../..
include $(TOP)/config/CONFIG_BASE
INC := bdt.h
LIBSRCS := bdt.c
LIBRARY := Bdt
include $(TOP)/config/RULES.Host

View File

@@ -1,10 +0,0 @@
TOP = ../../..
include $(TOP)/config/CONFIG_BASE
INC += bdt.h
LIBOBJS += bdt.o
LIBNAME = libBdt.a
include $(TOP)/config/RULES.Unix

14
src/bpt/Makefile.Host Normal file
View File

@@ -0,0 +1,14 @@
# Makefile.Host for base/src/bpt
#
TOP = ../../..
include $(TOP)/config/CONFIG_BASE
INC := cvtTable.h
SRCS := makeBpt.c
PROD := makeBpt
include $(TOP)/config/RULES.Host
# EOF Makefile.Host for base/src/bpt

View File

@@ -1,15 +0,0 @@
TOP = ../../..
include $(TOP)/config/CONFIG_BASE
INC += cvtTable.h
SRCS.c = ../makeBpt.c
OBJS = makeBpt.o
PROD = makeBpt
include $(TOP)/config/RULES.Unix
$(PROD): $(OBJS)
$(RM) $@
$(LINK.c) -o $@ ${OBJS} $(LDLIBS)

View File

@@ -135,9 +135,12 @@ $ if f$getsyi("HW_MODEL") .ge. 1024
$ then
$! turn of no prototype messages because MULTINET does not
$! supply prototypes.
$ cc_command:== cc /warn=(disable=IMPLICITFUNC)/float=d_float /include=([], [-.include], [-.libcom])
$ cc_command:== cc /warn=(disable=IMPLICITFUNC)/float=d_float -
/include=([], [-.include], [-.libcom]) -
/define=("MULTINET=1")
$ else
$ cc_command:== cc /include=([], [-.include], [-.libcom])
$ cc_command:== cc /include=([], [-.include], [-.libcom]) -
/define=("__STDC__=1", "MULTINET=1")
$ endif
$ endsubroutine
$! ************************************************************

64
src/ca/Makefile.Host Normal file
View File

@@ -0,0 +1,64 @@
# Makefile.Host
TOP = ../../..
include $(TOP)/config/CONFIG_BASE
CMPLR = STRICT
#
# includes to install from this subproject
#
INC += cadef.h
INC += caerr.h
INC += caeventmask.h
INC += caProto.h
#
# Contents of library: generic, special and for all systems
#
# on generic system
LIBSRCS_DEFAULT := posix_depen.c if_depen.c caRepeater.c
# on WIN32 only
LIBSRCS_WIN32 := windows_depen.c
# on all systems
LIBSRCS += iocinf.c
LIBSRCS += service.c
LIBSRCS += conn.c
LIBSRCS += netdb_depen.c
LIBSRCS += flow_control.c
LIBSRCS += syncgrp.c
LIBSRCS += access.c
LIBSRCS += convert.c
LIBSRCS += test_event.c
LIBSRCS += bsd_depen.c
LIBSRCS += repeater.c
# Library to build:
# lib$(LIBRARY).a or ..dll/..exp/..lib
#
LIBRARY := ca
# build LIBRARY as a DLL on WIN32, other systems may ignore this
LIBTYPE := SHARED
# WIN32 only: need additional lib to build the DLL and special def-file
DLL_LIBS := Com
PROD := caRepeater
# libs needed to build [TEST]PRODUCT
PROD_LIBS := ca Com
TESTPROD := catime acctst
include $(TOP)/config/RULES.Host
pcatime : catime.o $(PRODDEPLIBS)
$(PURIFY) $(LINK.c) catime.o $(LDLIBS)
pacctst : acctst.o $(PRODDEPLIBS)
$(PURIFY) $(LINK.c) acctst.o $(LDLIBS)
# EOF Makefile.Host

View File

@@ -1,36 +0,0 @@
TOP = ../../..
include $(TOP)/config/CONFIG_BASE
USR_LDLIBS = -lca -lCom
USR_LDFLAGS = -L.
DEPLIBS_BASE = $(INSTALL_LIB)
DEPLIBS = ./libca.a $(DEPLIBS_BASE)/libCom.a
INC += cadef.h
INC += caerr.h
INC += caeventmask.h
INC += caProto.h
SRCS.c = \
../iocinf.c ../access.c ../test_event.c ../service.c \
../flow_control.c ../repeater.c ../conn.c \
../syncgrp.c ../if_depen.c ../netdb_depen.c ../bsd_depen.c \
../posix_depen.c ../caRepeater.c ../acctst.c ../catime.c \
../convert.c
OBJS = caRepeater.o
LIBOBJS = \
iocinf.o access.o test_event.o service.o flow_control.o repeater.o \
conn.o syncgrp.o if_depen.o netdb_depen.o \
bsd_depen.o posix_depen.o convert.o
LIBNAME = libca.a
PROD = caRepeater
TARGETS = acctst catime
include $(TOP)/config/RULES.Unix

View File

@@ -5,11 +5,12 @@ SRCS.c = \
../iocinf.c ../access.c ../test_event.c ../service.c \
../flow_control.c ../repeater.c ../conn.c ../syncgrp.c \
../if_depen.c ../bsd_depen.c ../vxWorks_depen.c ../acctst.c \
../catime.c
../catime.c ../convert.c
LIBOBJS = \
iocinf.o access.o test_event.o service.o flow_control.o \
repeater.o conn.o syncgrp.o if_depen.o bsd_depen.o vxWorks_depen.o
repeater.o conn.o syncgrp.o if_depen.o bsd_depen.o vxWorks_depen.o \
convert.o
LIBNAME = caLib

File diff suppressed because it is too large Load Diff

View File

@@ -7,6 +7,18 @@ static char *sccsId = "@(#) $Id$";
/*
* $Log$
* Revision 1.42 1996/12/12 18:51:41 jhill
* doc
*
* Revision 1.41 1996/12/11 01:10:33 jhill
* added additional vector tests
*
* Revision 1.40 1996/11/22 19:07:01 jhill
* included string.h
*
* Revision 1.39 1996/11/02 00:50:36 jhill
* many pc port, const in API, and other changes
*
* Revision 1.37 1996/09/16 16:31:01 jhill
* fixed NT warnings
*
@@ -36,10 +48,6 @@ static char *sccsId = "@(#) $Id$";
*
*/
#ifdef VMS
#include <LIB$ROUTINES.H>
#endif
/*
* ANSI
*/
@@ -47,10 +55,12 @@ static char *sccsId = "@(#) $Id$";
#include <stdlib.h>
#include <math.h>
#include <float.h>
#include "os_depen.h"
#include <string.h>
#include <assert.h>
/*
* CA
*/
#include <cadef.h>
#define EVENT_ROUTINE null_event
@@ -64,6 +74,18 @@ int conn_cb_count;
#define min(A,B) ((A)>(B)?(B):(A))
#endif
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
#ifndef NELEMENTS
#define NELEMENTS(A) (sizeof(A)/sizeof(A[0]))
#endif
int doacctst(char *pname);
void test_sync_groups(chid chix);
void multiple_sg_requests(chid chix, CA_SYNC_GID gid);
@@ -88,6 +110,8 @@ dbr_float_t epsilon,
unsigned iterations);
#ifdef vxWorks
#include <vxWorks.h>
#include <taskLib.h>
int acctst(char *pname)
{
@@ -137,15 +161,13 @@ int doacctst(char *pname)
evid monix;
char pstring[NUM][MAX_STRING_SIZE];
unsigned size;
unsigned monCount=0u;
SEVCHK(ca_task_initialize(), "Unable to initialize");
conn_cb_count = 0;
printf("begin\n");
#ifdef VMS
lib$init_timer();
#endif /*VMS*/
printf("CA Client V%s\n", ca_version());
@@ -210,14 +232,9 @@ int doacctst(char *pname)
&chix2);
SEVCHK(status, NULL);
status = ca_build_and_connect(
pname,
TYPENOTCONN,
0,
&chix1,
NULL,
NULL,
NULL);
status = ca_search(
pname,
&chix1);
SEVCHK(status, NULL);
if (ca_test_io() == ECA_IOINPROGRESS) {
@@ -252,62 +269,143 @@ int doacctst(char *pname)
}
printf("\n");
/*
* look for problems with ca_search(), ca_clear_channel(),
* ca_change_connection_event(), and ca_pend_io(() combo
*/
status = ca_search(pname,& chix3);
SEVCHK(status, NULL);
status = ca_replace_access_rights_event(chix3, accessSecurity_cb);
SEVCHK(status, NULL);
/*
* verify clear before connect
*/
status = ca_search_and_connect(pname, &chix4, CONN_ROUTINE, NULL);
status = ca_search(pname, &chix4);
SEVCHK(status, NULL);
status = ca_clear_channel(chix4);
SEVCHK(status, NULL);
status = ca_search_and_connect(pname, &chix4, CONN_ROUTINE, NULL);
status = ca_search(pname, &chix4);
SEVCHK(status, NULL);
status = ca_replace_access_rights_event(chix4, accessSecurity_cb);
SEVCHK(status, NULL);
status = ca_search_and_connect(pname, &chix2, CONN_ROUTINE, NULL);
status = ca_search(pname, &chix2);
SEVCHK(status, NULL);
status = ca_replace_access_rights_event(chix2, accessSecurity_cb);
SEVCHK(status, NULL);
status = ca_search_and_connect(pname, &chix1, CONN_ROUTINE, NULL);
status = ca_search(pname, &chix1);
SEVCHK(status, NULL);
status = ca_replace_access_rights_event(chix1, accessSecurity_cb);
SEVCHK(status, NULL);
status = ca_change_connection_event(chix1,conn);
SEVCHK(status, NULL);
status = ca_change_connection_event(chix1,NULL);
SEVCHK(status, NULL);
status = ca_change_connection_event(chix1,conn);
SEVCHK(status, NULL);
status = ca_change_connection_event(chix1,NULL);
SEVCHK(status, NULL);
status = ca_pend_io(1000.0);
SEVCHK(status, NULL);
assert(ca_state(chix1) == cs_conn);
assert(ca_state(chix2) == cs_conn);
assert(ca_state(chix3) == cs_conn);
assert(ca_state(chix4) == cs_conn);
assert (ca_state(chix1) == cs_conn);
assert (ca_state(chix2) == cs_conn);
assert (ca_state(chix3) == cs_conn);
assert (ca_state(chix4) == cs_conn);
assert(INVALID_DB_REQ(chix1->type) == FALSE);
assert(INVALID_DB_REQ(chix2->type) == FALSE);
assert(INVALID_DB_REQ(chix3->type) == FALSE);
assert(INVALID_DB_REQ(chix4->type) == FALSE);
assert (INVALID_DB_REQ(chix1->type) == FALSE);
assert (INVALID_DB_REQ(chix2->type) == FALSE);
assert (INVALID_DB_REQ(chix3->type) == FALSE);
assert (INVALID_DB_REQ(chix4->type) == FALSE);
#ifdef VMS
lib$show_timer();
#endif /*VMS*/
/*
* verify connection handlers are working
*/
status = ca_clear_channel(chix1);
SEVCHK(status, NULL);
status = ca_clear_channel(chix2);
SEVCHK(status, NULL);
status = ca_clear_channel(chix3);
SEVCHK(status, NULL);
status = ca_clear_channel(chix4);
SEVCHK(status, NULL);
#ifdef VMS
lib$init_timer();
#endif /*VMS*/
status = ca_search_and_connect(pname, &chix1, conn, NULL);
SEVCHK(status, NULL);
status = ca_search_and_connect(pname, &chix2, conn, NULL);
SEVCHK(status, NULL);
status = ca_search_and_connect(pname, &chix3, conn, NULL);
SEVCHK(status, NULL);
status = ca_search_and_connect(pname, &chix4, conn, NULL);
SEVCHK(status, NULL);
ca_pend_event(1.0);
while (conn_cb_count != 4){
ca_pend_event(1.0);
printf("waiting on connect...");
fflush(stdout);
}
printf("Read Access=%d Write Access=%d\n",
ca_read_access(chix1),
ca_write_access(chix1));
/*
* ca_pend_io() must block
*/
if(ca_read_access(chix4)){
dbr_float_t req;
dbr_float_t resp;
printf ("get TMO test ...");
fflush(stdout);
req = 56.57f;
resp = -99.99f;
SEVCHK(ca_put(DBR_FLOAT, chix4, &req),NULL);
SEVCHK(ca_get(DBR_FLOAT, chix4, &resp),NULL);
status = ca_pend_io(1.0e-12);
if (status==ECA_NORMAL) {
if (resp != req) {
printf (
"get block test failed - val written %f\n", req);
printf (
"get block test failed - val read %f\n", resp);
assert(0);
}
}
else if (resp != -99.99f) {
printf (
"CA didnt block for get to return?\n");
}
req = 33.44f;
resp = -99.99f;
SEVCHK (ca_put(DBR_FLOAT, chix4, &req),NULL);
SEVCHK (ca_get(DBR_FLOAT, chix4, &resp),NULL);
SEVCHK (ca_pend_io(2000.0),NULL);
if (resp != req) {
printf (
"get block test failed - val written %f\n", req);
printf (
"get block test failed - val read %f\n", resp);
assert(0);
}
printf ("done\n");
}
/*
* Verify that we can write and then read back
* the same analog value (DBR_FLOAT)
@@ -389,33 +487,6 @@ int doacctst(char *pname)
printf ("done\n");
}
/*
* ca_pend_io() must block
*/
if(ca_read_access(chix4)){
dbr_float_t req = 3.3F;
dbr_float_t resp = 0.0F;
printf ("get TMO test ...");
fflush(stdout);
SEVCHK(ca_put(DBR_FLOAT, chix4, &req),NULL);
SEVCHK(ca_get(DBR_FLOAT, chix4, &resp),NULL);
status = ca_pend_io(1.0e-12);
if (status==ECA_NORMAL) {
assert (resp == req);
}
else {
assert (resp == 0.0F);
}
resp = 0.0F;
SEVCHK (ca_put(DBR_FLOAT, chix4, &req),NULL);
SEVCHK (ca_get(DBR_FLOAT, chix4, &resp),NULL);
SEVCHK (ca_pend_io(2000.0),NULL);
assert (resp == req);
printf ("done\n");
}
/*
* verify we dont jam up on many uninterrupted
* solicitations
@@ -485,7 +556,7 @@ int doacctst(char *pname)
/*
* verify we dont jam up on many uninterrupted
* solicitations
* put callback solicitations
*/
if(ca_write_access(chix1) && ca_v42_ok(chix1)){
unsigned count=0u;
@@ -509,12 +580,37 @@ int doacctst(char *pname)
printf("waiting...");
fflush(stdout);
}
printf("done.\n");
}
else{
printf("Skipped multiple put cb test - no write access\n");
}
/*
* verify that we detect that a large string has been written
*/
if(ca_write_access(chix1)){
dbr_string_t stimStr;
dbr_string_t respStr;
memset(stimStr, 'a', sizeof(stimStr));
status = ca_array_put(DBR_STRING, 1u, chix1, stimStr);
assert(status==ECA_STRTOBIG);
sprintf(stimStr, "%u", 8u);
status = ca_array_put(DBR_STRING, 1u, chix1, stimStr);
assert(status==ECA_NORMAL);
status = ca_array_get(DBR_STRING, 1u, chix1, respStr);
assert(status==ECA_NORMAL);
status = ca_pend_io(0.0);
assert(status==ECA_NORMAL);
printf(
"Test fails if stim \"%s\" isnt roughly equiv to resp \"%s\"\n",
stimStr, respStr);
}
else{
printf("Skipped bad string test - no write access\n");
}
if(ca_v42_ok(chix1)){
test_sync_groups(chix1);
}
@@ -525,16 +621,21 @@ int doacctst(char *pname)
printf("Performing multiple monitor test...");
fflush(stdout);
{
unsigned count=0u;
evid mid[1000];
dbr_float_t temp;
for(i=0; i<NELEMENTS(mid); i++){
SEVCHK(ca_add_event(DBR_GR_FLOAT, chix4, null_event,
NULL, &mid[i]),NULL);
&count, &mid[i]),NULL);
}
/*
* force all of the monitors requests to
* complete
*
* NOTE: this hopefully demonstrates that when the
* server is very busy with monitors the client
* is still able to punch through with a request.
*/
SEVCHK(ca_get(DBR_FLOAT,chix4,&temp),NULL);
SEVCHK(ca_pend_io(1000.0),NULL);
@@ -565,7 +666,7 @@ int doacctst(char *pname)
DBR_FLOAT,
chix4,
EVENT_ROUTINE,
NULL,
&monCount,
&monix);
SEVCHK(status, NULL);
SEVCHK(ca_clear_event(monix), NULL);
@@ -573,7 +674,7 @@ int doacctst(char *pname)
DBR_FLOAT,
chix4,
EVENT_ROUTINE,
NULL,
&monCount,
&monix);
SEVCHK(status, NULL);
}
@@ -582,7 +683,7 @@ int doacctst(char *pname)
DBR_FLOAT,
chix4,
EVENT_ROUTINE,
NULL,
&monCount,
&monix);
SEVCHK(status, NULL);
SEVCHK(ca_clear_event(monix), NULL);
@@ -592,14 +693,14 @@ int doacctst(char *pname)
DBR_FLOAT,
chix3,
EVENT_ROUTINE,
NULL,
&monCount,
&monix);
SEVCHK(status, NULL);
status = ca_add_event(
DBR_FLOAT,
chix3,
write_event,
NULL,
&monCount,
&monix);
SEVCHK(status, NULL);
}
@@ -643,9 +744,77 @@ int doacctst(char *pname)
SEVCHK(ca_pend_io(4000.0), NULL);
#ifdef VMS
lib$show_timer();
#endif /*VMS*/
/*
* array test
* o verifies that we can at least write and read back the same array
* if multiple elements are present
*/
if (VALID_DB_REQ(chix1->type)) {
if (ca_element_count(chix1)>1u && ca_read_access(chix1)) {
dbr_float_t *pRF, *pWF, *pEF, *pT1, *pT2;
printf("Performing %u element array test...",
ca_element_count(chix1));
fflush(stdout);
pRF = (dbr_float_t *) calloc(ca_element_count(chix1),
sizeof(*pRF));
assert(pRF!=NULL);
pWF = (dbr_float_t *)calloc(ca_element_count(chix1),
sizeof(*pWF));
assert(pWF!=NULL);
/*
* write some random numbers into the array
*/
if (ca_write_access(chix1)) {
pT1 = pWF;
pEF = &pWF[ca_element_count(chix1)];
while(pT1<pEF) {
*pT1++ = rand();
}
status = ca_array_put(
DBR_FLOAT,
ca_element_count(chix1),
chix1,
pWF);
SEVCHK(status, "array write request failed");
}
/*
* read back the array
*/
if (ca_read_access(chix1)) {
status = ca_array_get(
DBR_FLOAT,
ca_element_count(chix1),
chix1,
pRF);
SEVCHK(status, "array read request failed");
status = ca_pend_io(30.0);
SEVCHK(status, "array read failed");
}
/*
* verify read response matches values written
*/
if (ca_read_access(chix1) && ca_write_access(chix1)) {
pEF = &pRF[ca_element_count(chix1)];
pT1 = pRF;
pT2 = pWF;
while (pT1<pEF) {
assert (*pT1 == *pT2);
pT1++;
pT2++;
}
}
printf("done\n");
free(pRF);
free(pWF);
}
}
for (i = 0; i < NUM; i++) {
printf("Float value Returned from put/get %f\n", pfloat[i]);
printf("Double value Returned from put/get %f\n", pdouble[i]);
@@ -661,11 +830,6 @@ int doacctst(char *pname)
SEVCHK(ca_modify_user_name("Willma"), NULL);
SEVCHK(ca_modify_host_name("Bed Rock"), NULL);
if (conn_cb_count != 3){
printf ("!!!! Connect cb count = %d expected = 3 !!!!\n",
conn_cb_count);
}
{
TS_STAMP end_time;
TS_STAMP start_time;
@@ -781,11 +945,13 @@ unsigned iterations)
void null_event(struct event_handler_args args)
{
static int i;
unsigned *pInc = (unsigned *) args.usr;
if (pInc) {
(*pInc)++;
if (*pInc%1000u == 0u) {
printf("1000 occurred\n");
}
}
#if 0
if (ca_state(args.chid)==cs_conn) {
@@ -797,11 +963,6 @@ void null_event(struct event_handler_args args)
ca_name(args.chid));
}
#endif
if (i++ > 1000) {
printf("1000 occurred\n");
i = 0;
}
}
@@ -871,6 +1032,7 @@ void test_sync_groups(chid chix)
status = ca_sg_create(&gid2);
SEVCHK(status, NULL);
multiple_sg_requests(chix, gid2);
multiple_sg_requests(chix, gid1);
status = ca_sg_test(gid2);
@@ -881,10 +1043,12 @@ void test_sync_groups(chid chix)
SEVCHK(status, "SYNC GRP1");
status = ca_sg_block(gid2, 500.0);
SEVCHK(status, "SYNC GRP2");
status = ca_sg_delete(gid2);
SEVCHK(status, NULL);
status = ca_sg_create(&gid2);
SEVCHK(status, NULL);
multiple_sg_requests(chix, gid1);
multiple_sg_requests(chix, gid2);
status = ca_sg_block(gid1, 15.0);

View File

@@ -3,8 +3,7 @@
extern "C" {
#endif
#include <envDefs.h>
#include <envDefs.h>
void caSetupAddrList(
ELLLIST *pList,
@@ -15,7 +14,8 @@ void caPrintAddrList(ELLLIST *pList);
void caDiscoverInterfaces(
ELLLIST *pList,
SOCKET socket,
int port);
int port,
struct in_addr matchAddr);
void caAddConfiguredAddr(
ELLLIST *pList,

View File

@@ -150,17 +150,17 @@ int cac_select_io(struct timeval *ptimeout, int flags)
}
if (status<0) {
if (MYERRNO == EINTR) {
if (SOCKERRNO == EINTR) {
}
else if (MYERRNO == EWOULDBLOCK) {
else if (SOCKERRNO == EWOULDBLOCK) {
ca_printf("CAC: blocked at select ?\n");
}
else if (MYERRNO == ESRCH) {
else if (SOCKERRNO == ESRCH) {
}
else {
ca_printf (
"CAC: unexpected select fail: %s\n",
strerror(MYERRNO));
strerror(SOCKERRNO));
}
}

59
src/ca/ca.def Normal file
View File

@@ -0,0 +1,59 @@
LIBRARY ca
VERSION 13
CODE PRELOAD MOVEABLE DISCARDABLE
DATA PRELOAD SINGLE
EXPORTS
ca_version
ca_test_event
ca_task_initialize
ca_task_exit
ca_search_and_connect
ca_build_and_connect
ca_change_connection_event
ca_replace_access_rights_event
ca_add_exception_event
ca_clear_channel
ca_array_put
ca_array_put_callback
ca_array_get
ca_array_get_callback
ca_add_masked_array_event
ca_clear_event
ca_pend
ca_repeater
ca_test_io
ca_flush_io
ca_signal
ca_signal_with_file_and_lineno
ca_host_name_function
ca_add_fd_registration
ca_sg_create
ca_sg_delete
ca_sg_block
ca_sg_test
ca_sg_reset
ca_sg_array_get
ca_sg_array_put
ca_modify_user_name
ca_modify_host_name
ca_v42_ok
caFetchPortConfig
caAddConfiguredAddr
caDiscoverInterfaces
ca_printf
ca_message_text
ca_message
cac_gettimeval
dbr_value_size
dbr_value_offset
dbf_text
dbf_text_invalid
dbf_text_dim
dbr_text
dbr_text_invalid
dbr_text_dim
dbr_size

View File

@@ -29,6 +29,9 @@
*
* History
* $Log$
* Revision 1.2 1996/09/16 16:32:49 jhill
* added CA version string
*
* Revision 1.1 1996/06/20 18:02:22 jhill
* installed into CVS
*
@@ -65,6 +68,9 @@
*
* .10 050594 joh New command added for CA V4.3 - wakeup the server
* $Log$
* Revision 1.2 1996/09/16 16:32:49 jhill
* added CA version string
*
* Revision 1.1 1996/06/20 18:02:22 jhill
* installed into CVS
*
@@ -80,20 +86,9 @@
* CA protocol number
* TCP/UDP port number (bumped each major protocol change)
*/
#define CA_PROTOCOL_VERSION_STR 4
#define CA_MINOR_VERSION_STR 7
/*
* add unsigned to the above numbers for numerical
* comparisons (two defines above are used to create
* version number string - prefer not to have u there)
*/
#ifndef CONCAT
#define CONCAT(A,B) A ## B
#endif
#define UNSIGNED(N) CONCAT(N,u)
#define CA_PROTOCOL_VERSION UNSIGNED(CA_PROTOCOL_VERSION_STR)
#define CA_MINOR_VERSION UNSIGNED(CA_MINOR_VERSION_STR)
#define CA_PROTOCOL_VERSION 4u
#define CA_MINOR_VERSION 7u
#define CA_VERSION_STRING "4.7"
#define CA_UKN_MINOR_VERSION 0u /* unknown minor version */
#if CA_PROTOCOL_VERSION == 4u
#define CA_V41(MAJOR,MINOR) ((MINOR)>=1u)
@@ -249,14 +244,5 @@ struct monops { /* monitor req opi to ioc */
*/
#define unreasonablePVNameSize 500u
#ifndef STRINGOF
#define STRINGOF(A) #A
#endif
#ifndef EXPANDTOSTRING
#define EXPANDTOSTRING(A) STRINGOF(A)
#endif
#define CA_VERSION_STRING \
(EXPANDTOSTRING(CA_PROTOCOL_VERSION_STR)"."EXPANDTOSTRING(CA_MINOR_VERSION_STR))
#endif /* __CAPROTO__ */

View File

@@ -21,9 +21,10 @@
#include <iocinf.h>
main()
int main()
{
ca_repeater ();
assert (0);
return (0);
}

File diff suppressed because it is too large Load Diff

View File

@@ -196,7 +196,9 @@ void timeIt(
assert (status == S_ts_OK);
#endif
TsDiffAsDouble(&delay,&end_time,&start_time);
printf ("Elapsed Per Item = %f\n", delay/(iterations*inlineIter));
printf ("Elapsed Per Item = %12.8f sec (%10.1f Items per sec)\n",
delay/(iterations*inlineIter),
(iterations*inlineIter)/delay);
}

View File

@@ -30,6 +30,9 @@
/* (dont send all chans in a block) */
/* */
/* $Log$
* Revision 1.36 1996/09/16 16:35:22 jhill
* local exceptions => exception handler
*
* Revision 1.35 1996/06/19 17:59:04 jhill
* many 3.13 beta changes
*
@@ -239,7 +242,7 @@ void manage_conn(int silent)
LOCAL void retrySearchRequest (int silent)
{
ELLLIST channelsSent;
chid chix;
ciu chix;
unsigned min_retry_num;
unsigned retry_cnt = 0;
unsigned retry_cnt_no_handler = 0;
@@ -253,7 +256,7 @@ LOCAL void retrySearchRequest (int silent)
LOCK;
min_retry_num = MAXCONNTRIES;
while (chix = (chid) ellGet (&piiuCast->chidlist)) {
while ( (chix = (ciu) ellGet (&piiuCast->chidlist)) ) {
ellAdd (&channelsSent, &chix->node);
@@ -359,7 +362,7 @@ LOCAL void logRetryInterval(char *pFN, unsigned lineno)
*/
void mark_server_available(const struct in_addr *pnet_addr)
{
chid chan;
ciu chan;
ca_real currentPeriod;
bhe *pBHE;
unsigned port;
@@ -495,10 +498,10 @@ void mark_server_available(const struct in_addr *pnet_addr)
* set retry count of all disconnected channels
* to zero
*/
chan = (chid) ellFirst(&piiuCast->chidlist);
chan = (ciu) ellFirst(&piiuCast->chidlist);
while (chan) {
chan->retry = 0;
chan = (chid) ellNext (&chan->node);
chan = (ciu) ellNext (&chan->node);
}
UNLOCK;

View File

@@ -35,6 +35,11 @@ static char *sccsId = "@(#) $Id$";
#include "iocinf.h"
#include "net_convert.h"
/*
* NOOP if this isnt required
*/
#ifdef CONVERSION_REQUIRED
/*
* if hton is true then it is a host to network conversion
* otherwise vise-versa
@@ -156,6 +161,9 @@ unsigned long num /* number of values */
char *pSrc = s;
char *pDest = d;
/* convert "in place" -> nothing to do */
if (s == d)
return;
if(num == 1){
strcpy(pDest, pSrc);
}
@@ -212,6 +220,9 @@ unsigned long num /* number of values */
dbr_char_t *pSrc = s;
dbr_char_t *pDest = d;
/* convert "in place" -> nothing to do */
if (s == d)
return;
for(i=0; i<num; i++){
*pDest++ = *pSrc++;
}
@@ -377,6 +388,11 @@ unsigned long num /* number of values */
/* convert ieee to vax format or vax to ieee */
pDest->status = dbr_ntohs(pSrc->status);
pDest->severity = dbr_ntohs(pSrc->severity);
/* convert "in place" -> nothing else to do */
if (s == d)
return;
if (num == 1) /* if single value */
strcpy(pDest->value, pSrc->value);
else
@@ -570,6 +586,10 @@ unsigned long num /* number of values */
pDest->status = dbr_ntohs(pSrc->status);
pDest->severity = dbr_ntohs(pSrc->severity);
if (s == d) /* source == dest -> no more conversions */
return;
memcpy(pDest->units,pSrc->units,sizeof(pSrc->units));
pDest->upper_disp_limit = pSrc->upper_disp_limit;
@@ -1686,4 +1706,5 @@ void dbr_htonf (dbr_float_t *IEEEhost, dbr_float_t *IEEEnet)
#endif /* IEEE float and little endian */
#endif /* CONVERSION_REQUIRED */

View File

@@ -37,7 +37,6 @@
static char *sccsId = "@(#) $Id$";
#include "iocinf.h"
/*
@@ -79,7 +78,7 @@ int local_addr(int s, struct sockaddr_in *plcladdr)
if (status < 0 || ifconf.ifc_len == 0) {
ca_printf(
"CAC: ioctl failed because \"%s\"\n",
strerror(MYERRNO));
strerror(SOCKERRNO));
ifconf.ifc_len = 0;
}
@@ -169,12 +168,14 @@ int local_addr (int s, struct sockaddr_in *plcladdr)
/*
* caDiscoverInterfaces()
*
* This routine is provided with the address of an ELLLIST a socket
* and a destination port number. When the routine returns there
* will be one additional inet address (a caAddrNode) in the list
* for each inet interface found that is up and isnt a loop back
* interface. If the interface supports broadcast then I add its
* broadcast address to the list. If the interface is a point to
* This routine is provided with the address of an ELLLIST, a socket
* a destination port number, and a match address. When the
* routine returns there will be one additional inet address
* (a caAddrNode) in the list for each inet interface found that
* is up and isnt a loop back interface (match addr is INADDR_ANY)
* or it matches the specified interface (match addr isnt INADDR_ANY).
* If the interface supports broadcast then I add its broadcast
* address to the list. If the interface is a point to
* point link then I add the destination address of the point to
* point link to the list. In either case I set the port number
* in the address node to the port supplied in the argument
@@ -183,7 +184,8 @@ int local_addr (int s, struct sockaddr_in *plcladdr)
* LOCK should be applied here for (pList)
* (this is also called from the server)
*/
void caDiscoverInterfaces(ELLLIST *pList, int socket, int port)
void caDiscoverInterfaces(ELLLIST *pList, int socket, int port,
struct in_addr matchAddr)
{
struct sockaddr_in localAddr;
struct sockaddr_in *pInetAddr;
@@ -243,6 +245,7 @@ void caDiscoverInterfaces(ELLLIST *pList, int socket, int port)
if (status){
continue;
}
/*
* If its not an internet inteface
* then dont use it.
@@ -250,9 +253,23 @@ void caDiscoverInterfaces(ELLLIST *pList, int socket, int port)
if (pifreq->ifr_addr.sa_family != AF_INET) {
continue;
}
/*
* save the interface's IP address
*/
pInetAddr = (struct sockaddr_in *)&pifreq->ifr_addr;
localAddr = *pInetAddr;
/*
* if it isnt a wildcarded interface then look for
* an exact match
*/
if (matchAddr.s_addr != INADDR_ANY) {
if (pInetAddr->sin_addr.s_addr != matchAddr.s_addr) {
continue;
}
}
/*
* If this is an interface that supports
* broadcast fetch the broadcast address.
@@ -285,9 +302,6 @@ void caDiscoverInterfaces(ELLLIST *pList, int socket, int port)
continue;
}
pNode = (caAddrNode *) calloc(1,sizeof(*pNode));
if(!pNode){
continue;
@@ -306,4 +320,3 @@ void caDiscoverInterfaces(ELLLIST *pList, int socket, int port)
free(pIfreqList);
}

View File

@@ -47,6 +47,14 @@
/* address in use so that test works on UNIX */
/* kernels that support multicast */
/* $Log$
* Revision 1.66 1996/11/02 00:50:53 jhill
* many pc port, const in API, and other changes
*
* Revision 1.65 1996/09/16 16:37:02 jhill
* o dont print disconnect message when the last channel on a connection is
* deleted and the conn goes away
* o local exceptions => exception handler
*
* Revision 1.64 1996/08/13 23:15:36 jhill
* fixed warning
*
@@ -347,7 +355,7 @@ int net_proto
&pNode->destAddr.sa,
sizeof(pNode->destAddr.sa));
if(status < 0){
ca_printf("CAC: no conn err=\"%s\"\n", strerror(MYERRNO));
ca_printf("CAC: no conn err=\"%s\"\n", strerror(SOCKERRNO));
status = socket_close(sock);
if(status<0){
SEVCHK(ECA_INTERNAL,NULL);
@@ -405,7 +413,7 @@ int net_proto
if(status<0){
free(piiu);
ca_printf("CAC: sso (err=\"%s\")\n",
strerror(MYERRNO));
strerror(SOCKERRNO));
status = socket_close(sock);
if(status < 0){
SEVCHK(ECA_INTERNAL,NULL);
@@ -427,7 +435,7 @@ int net_proto
(struct sockaddr *) &saddr,
sizeof(saddr));
if(status<0){
ca_printf("CAC: bind (err=%s)\n",strerror(MYERRNO));
ca_printf("CAC: bind (err=%s)\n",strerror(SOCKERRNO));
genLocalExcep (ECA_INTERNAL,"bind failed");
}
#endif
@@ -473,12 +481,12 @@ int net_proto
if(status<0){
ca_printf(
"Error setting non-blocking io: %s\n",
strerror(MYERRNO));
strerror(SOCKERRNO));
}
if(fd_register_func){
LOCKEVENTS;
(*fd_register_func)(fd_register_arg, sock, TRUE);
(*fd_register_func)((void *)fd_register_arg, sock, TRUE);
UNLOCKEVENTS;
}
@@ -531,10 +539,13 @@ void caSetupBCastAddrList (ELLLIST *pList, SOCKET sock, unsigned port)
* (lock outside because this is used by the server also)
*/
if (yes) {
struct in_addr addr;
addr.s_addr = INADDR_ANY;
caDiscoverInterfaces(
pList,
sock,
port);
port,
addr);
}
caAddConfiguredAddr(
@@ -629,18 +640,18 @@ void notify_ca_repeater()
(struct sockaddr *)&saddr,
sizeof(saddr));
if(status < 0){
if( MYERRNO != EINTR &&
MYERRNO != ENOBUFS &&
MYERRNO != EWOULDBLOCK &&
if( SOCKERRNO != EINTR &&
SOCKERRNO != ENOBUFS &&
SOCKERRNO != EWOULDBLOCK &&
/*
* This is returned from Linux when
* the repeater isnt running
*/
MYERRNO != ECONNREFUSED
SOCKERRNO != ECONNREFUSED
){
ca_printf(
"CAC: error sending to repeater is \"%s\"\n",
strerror(MYERRNO));
strerror(SOCKERRNO));
}
}
else{
@@ -702,7 +713,7 @@ LOCAL void cac_udp_send_msg_piiu(struct ioc_in_use *piiu)
else {
int localErrno;
localErrno = MYERRNO;
localErrno = SOCKERRNO;
if( localErrno != EWOULDBLOCK &&
localErrno != ENOBUFS &&
@@ -789,7 +800,7 @@ LOCAL void cac_tcp_send_msg_piiu(struct ioc_in_use *piiu)
return;
}
localError = MYERRNO;
localError = SOCKERRNO;
if( localError == EWOULDBLOCK ||
localError == ENOBUFS ||
@@ -941,16 +952,16 @@ LOCAL void tcp_recv_msg(struct ioc_in_use *piiu)
}
else if(status <0){
/* try again on status of -1 and no luck this time */
if(MYERRNO == EWOULDBLOCK || MYERRNO == EINTR){
if(SOCKERRNO == EWOULDBLOCK || SOCKERRNO == EINTR){
break;
}
if( MYERRNO != EPIPE &&
MYERRNO != ECONNRESET &&
MYERRNO != ETIMEDOUT){
if( SOCKERRNO != EPIPE &&
SOCKERRNO != ECONNRESET &&
SOCKERRNO != ETIMEDOUT){
ca_printf(
"CAC: unexpected recv error (err=%s)\n",
strerror(MYERRNO));
"CAC: unexpected TCP recv error (err=%s)\n",
strerror(SOCKERRNO));
}
TAG_CONN_DOWN(piiu);
break;
@@ -1063,7 +1074,7 @@ LOCAL void udp_recv_msg(struct ioc_in_use *piiu)
* op would block which is ok to ignore till ready
* later
*/
if(MYERRNO == EWOULDBLOCK || MYERRNO == EINTR){
if(SOCKERRNO == EWOULDBLOCK || SOCKERRNO == EINTR){
UNLOCK;
return;
}
@@ -1072,12 +1083,12 @@ LOCAL void udp_recv_msg(struct ioc_in_use *piiu)
* Avoid spurious ECONNREFUSED bug
* in linux
*/
if (MYERRNO==ECONNREFUSED) {
if (SOCKERRNO==ECONNREFUSED) {
UNLOCK;
return;
}
# endif
ca_printf("Unexpected UDP failure %s\n", strerror(MYERRNO));
ca_printf("Unexpected UDP failure %s\n", strerror(SOCKERRNO));
}
else if(status > 0){
unsigned long bytesActual;
@@ -1164,10 +1175,10 @@ LOCAL void ca_process_udp(struct ioc_in_use *piiu)
pmsglog->nbytes);
if(status != OK || piiu->curMsgBytes){
ca_printf(
"%s: bad UDP msg from port=%d addr=%x\n",
__FILE__,
pmsglog->addr.sin_port,
pmsglog->addr.sin_addr.s_addr);
"%s: bad UDP msg from port=%d addr=%s\n",
__FILE__,
ntohs(pmsglog->addr.sin_port),
inet_ntoa(pmsglog->addr.sin_addr));
/*
* resync the ring buffer
* (discard existing messages)
@@ -1207,7 +1218,7 @@ LOCAL void ca_process_udp(struct ioc_in_use *piiu)
LOCAL void close_ioc (IIU *piiu)
{
caAddrNode *pNode;
chid chix;
ciu chix;
int status;
unsigned chanDisconnectCount;
@@ -1231,7 +1242,7 @@ LOCAL void close_ioc (IIU *piiu)
chanDisconnectCount = 0u;
}
else {
chid pNext;
ciu pNext;
chanDisconnectCount = ellCount(&piiu->chidlist);
@@ -1248,15 +1259,15 @@ LOCAL void close_ioc (IIU *piiu)
* handler tries to use a channel before
* I mark it disconnected.
*/
chix = (chid) ellFirst(&piiu->chidlist);
chix = (ciu) ellFirst(&piiu->chidlist);
while (chix) {
chix->state = cs_prev_conn;
chix = (chid) ellNext(&chix->node);
chix = (ciu) ellNext(&chix->node);
}
chix = (chid) ellFirst(&piiu->chidlist);
chix = (ciu) ellFirst(&piiu->chidlist);
while (chix) {
pNext = (chid) ellNext(&chix->node);
pNext = (ciu) ellNext(&chix->node);
cacDisconnectChannel(chix, cs_conn);
chix = pNext;
}
@@ -1264,7 +1275,7 @@ LOCAL void close_ioc (IIU *piiu)
if (fd_register_func) {
LOCKEVENTS;
(*fd_register_func) (fd_register_arg, piiu->sock_chan, FALSE);
(*fd_register_func) ((void *)fd_register_arg, piiu->sock_chan, FALSE);
UNLOCKEVENTS;
}
@@ -1298,7 +1309,7 @@ LOCAL void close_ioc (IIU *piiu)
* cacDisconnectChannel()
* (LOCK must be applied when calling this routine)
*/
void cacDisconnectChannel(chid chix, enum channel_state state)
void cacDisconnectChannel(ciu chix, enum channel_state state)
{
struct ioc_in_use *piiu;
@@ -1412,7 +1423,7 @@ int repeater_installed()
(struct sockaddr *) &bd,
sizeof bd);
if(status<0){
if(MYERRNO == EADDRINUSE){
if(SOCKERRNO == EADDRINUSE){
installed = TRUE;
}
}
@@ -1484,12 +1495,12 @@ unsigned long nBytes)
*/
unsigned long cacRingBufferWrite(
struct ca_buffer *pRing,
void *pBuf,
const void *pBuf,
unsigned long nBytes)
{
unsigned long potentialBytes;
unsigned long actualBytes;
char *pCharBuf;
const char *pCharBuf;
actualBytes = 0;
pCharBuf = pBuf;
@@ -1787,7 +1798,7 @@ unsigned short caFetchPortConfig(ENV_PARAM *pEnv, unsigned short defaultPort)
}
/*
* ok to clip to int here because we checked the range
* ok to clip to unsigned short here because we checked the range
*/
port = (unsigned short) epicsParam;

View File

@@ -32,6 +32,12 @@
/************************************************************************/
/* $Log$
* Revision 1.58 1996/11/02 00:50:56 jhill
* many pc port, const in API, and other changes
*
* Revision 1.57 1996/09/16 16:38:05 jhill
* local except => except handler
*
* Revision 1.56 1996/08/13 23:16:19 jhill
* removed os specific code
*
@@ -94,7 +100,7 @@
# define GLBLTYPE extern
#endif
#ifdef __STDC__
#if defined(__STDC__) && !defined(VAXC)
# define VERSIONID(NAME,VERS) \
char *EPICS_CAS_VID_ ## NAME = VERS;
#else /*__STDC__*/
@@ -121,28 +127,65 @@ HDRVERSIONID(iocinfh, "$Id$")
#include <stdarg.h>
#include <time.h>
#include <shareLib.h>
#include "shareLib.h"
/*
* OS dependent includes
*/
#include "osiSock.h"
#include "os_depen.h"
/*
* EPICS includes
*/
#include <epicsAssert.h>
#include <cadef.h>
#include <bucketLib.h>
#include <ellLib.h>
#include <envDefs.h>
#include <epicsPrint.h>
#include "epicsAssert.h"
#include "cadef.h"
#include "bucketLib.h"
#include "ellLib.h"
#include "envDefs.h"
#include "epicsPrint.h"
/*
* CA private includes
*/
#include "addrList.h"
#include "caProto.h"
#include "net_convert.h"
#ifndef NULL
#define NULL 0
#endif
#ifndef FALSE
#define FALSE 0
#endif
#ifndef TRUE
#define TRUE 1
#endif
#ifndef OK
#define OK 0
#endif
#ifndef ERROR
#define ERROR (-1)
#endif
#ifndef NELEMENTS
#define NELEMENTS(array) (sizeof(array)/sizeof((array)[0]))
#endif
#ifndef LOCAL
#define LOCAL static
#endif
/*
* writable channel_in_use and pending_event pointers
* for internal use
*/
typedef struct channel_in_use *ciu;
typedef struct pending_event *miu;
#ifndef min
#define min(A,B) ((A)>(B)?(B):(A))
@@ -173,7 +216,7 @@ if(!ca_static){ \
#define VALID_MSG(PIIU) (piiu->read_seq == piiu->cur_read_seq)
#define SETPENDRECV {pndrecvcnt++;}
#define CLRPENDRECV(LOCK) {if(--pndrecvcnt<1){POST_IO_EV;}}
#define CLRPENDRECV {if(--pndrecvcnt<1){POST_IO_EV;}}
struct udpmsglog{
long nbytes;
@@ -295,7 +338,7 @@ typedef struct caclient_put_notify{
#define nextFastBucketId (ca_static->ca_nextFastBucketId)
#if defined(vxWorks)
# define io_done_sem (ca_static->ca_io_done_sem)
# define io_done_sem (ca_static->ca_io_done_sem)
# define evuser (ca_static->ca_evuser)
# define client_lock (ca_static->ca_client_lock)
# define event_lock (ca_static->ca_event_lock)
@@ -438,16 +481,11 @@ struct ca_static{
IIU *ca_piiuCast;
void (*ca_exception_func)
(struct exception_handler_args);
void *ca_exception_arg;
#if 0
void (*ca_connection_func)
(struct connection_handler_args);
void *ca_connection_arg;
#endif
const void *ca_exception_arg;
int (*ca_printf_func)(const char *pformat, va_list args);
void (*ca_fd_register_func)
(void *, SOCKET, int);
void *ca_fd_register_arg;
const void *ca_fd_register_arg;
char *ca_pUserName;
char *ca_pHostName;
BUCKET *ca_pSlowBucket;
@@ -490,11 +528,11 @@ struct ca_static{
* one per outstanding op
*/
typedef struct{
ELLNODE node;
WRITEABLE_CA_SYNC_GID id;
void *pValue;
unsigned long magic;
unsigned long seqNo;
ELLNODE node;
CA_SYNC_GID id;
void *pValue;
unsigned long magic;
unsigned long seqNo;
}CASGOP;
@@ -503,7 +541,7 @@ typedef struct{
*/
typedef struct{
ELLNODE node;
WRITEABLE_CA_SYNC_GID id;
CA_SYNC_GID id;
unsigned long magic;
unsigned long opPendCount;
unsigned long seqNo;
@@ -532,7 +570,7 @@ struct ca_static *ca_static;
void cac_send_msg(void);
void cac_mux_io(struct timeval *ptimeout);
int repeater_installed(void);
int search_msg(chid chix, int reply_type);
int search_msg(ciu chix, int reply_type);
int ca_request_event(evid monix);
void ca_busy_message(struct ioc_in_use *piiu);
void ca_ready_message(struct ioc_in_use *piiu);
@@ -570,7 +608,7 @@ int alloc_ioc(
);
unsigned long cacRingBufferWrite(
struct ca_buffer *pRing,
void *pBuf,
const void *pBuf,
unsigned long nBytes);
unsigned long cacRingBufferRead(
@@ -625,21 +663,20 @@ int cac_os_depen_init(struct ca_static *pcas);
void cac_os_depen_exit (struct ca_static *pcas);
void ca_process_exit();
void ca_spawn_repeater(void);
typedef void CACVRTFUNC(void *pSrc, void *pDest, int hton, unsigned long count);
void cac_gettimeval(struct timeval *pt);
/* returns A - B in floating secs */
ca_real cac_time_diff(ca_time *pTVA, ca_time *pTVB);
/* returns A + B in integer secs & integer usec */
ca_time cac_time_sum(ca_time *pTVA, ca_time *pTVB);
void caIOBlockFree(evid pIOBlock);
void caIOBlockFree(miu pIOBlock);
void clearChannelResources(unsigned id);
void caSetDefaultPrintfHandler (void);
void cacDisconnectChannel(chid chix, enum channel_state state);
void cacDisconnectChannel(ciu chix, enum channel_state state);
int caSendMsgPending(void);
void generateLocalExceptionWithFileAndLine(long stat, char *ctx,
void genLocalExcepWFL(long stat, char *ctx,
char *pFile, unsigned line);
#define genLocalExcep(STAT, PCTX) \
generateLocalExceptionWithFileAndLine (STAT, PCTX, __FILE__, __LINE__)
genLocalExcepWFL (STAT, PCTX, __FILE__, __LINE__)
/*
* !!KLUDGE!!

View File

@@ -1,185 +0,0 @@
#ifndef __IOCMSG__
/* $Id$ */
/*
* History
* .01 01xx90 joh removed status field in favor of a independent m_cmmd-
* saves space on every successful operation
*
* .02 041390 joh moved server ports to above IPPORT_USERRESERVED
* see in.h
*
* .03 060391 joh Bumped protocol version to 4 to support changes for
* SPARC alignment in db_access.h
*
* .04 071291 joh New command added - claim channel in use block
*
* .05 011294 joh New command added - write notify
*
* .06 020194 joh New command added for CA V4.1 - client name
*
* .07 041194 joh New command added for CA V4.2 - access rights
*
* .08 050594 joh New command added for CA V4.3 - echo request
*
* .09 050594 joh New command added for CA V4.3 - repeater fanout register
*
* .10 050594 joh New command added for CA V4.3 - wakeup the server
* $Log$
* Revision 1.23 1995/08/23 00:35:17 jhill
* added log entries
*
*/
#define __IOCMSG__
HDRVERSIONID(iocmsgh, "@(#) $Id$ CA version 4.4")
/* TCP/UDP port number (bumped each protocol change) */
#define CA_PROTOCOL_VERSION 4
#define CA_MINOR_VERSION 6
#define CA_UKN_MINOR_VERSION 0 /* unknown minor version */
#if CA_PROTOCOL_VERSION == 4
#define CA_V41(MAJOR,MINOR) ((MINOR)>=1)
#define CA_V42(MAJOR,MINOR) ((MINOR)>=2)
#define CA_V43(MAJOR,MINOR) ((MINOR)>=3)
#define CA_V44(MAJOR,MINOR) ((MINOR)>=4)
#define CA_V45(MAJOR,MINOR) ((MINOR)>=5)
#define CA_V46(MAJOR,MINOR) ((MINOR)>=6)
#elif CA_PROTOCOL_VERSION > 4
#define CA_V41(MAJOR,MINOR) ( 1 )
#define CA_V42(MAJOR,MINOR) ( 1 )
#define CA_V43(MAJOR,MINOR) ( 1 )
#define CA_V44(MAJOR,MINOR) ( 1 )
#define CA_V45(MAJOR,MINOR) ( 1 )
#define CA_V46(MAJOR,MINOR) ( 1 )
#else
#define CA_V41(MAJOR,MINOR) ( 0 )
#define CA_V42(MAJOR,MINOR) ( 0 )
#define CA_V43(MAJOR,MINOR) ( 0 )
#define CA_V44(MAJOR,MINOR) ( 0 )
#define CA_V45(MAJOR,MINOR) ( 0 )
#define CA_V46(MAJOR,MINOR) ( 0 )
#endif
/*
* NOTE: These port numbers are only used if the CA repeater and
* CA server port numbers cant be obtained from the EPICS
* environment variables "EPICS_CA_REPEATER_PORT" and
* "EPICS_CA_SERVER_PORT"
*/
#define CA_PORT_BASE IPPORT_USERRESERVED + 56U
#define CA_SERVER_PORT (CA_PORT_BASE+CA_PROTOCOL_VERSION*2)
#define CA_REPEATER_PORT (CA_PORT_BASE+CA_PROTOCOL_VERSION*2+1)
#define MAX_UDP 1024
#define MAX_TCP (MAX_UDP*16) /* so waveforms fit */
#define MAX_MSG_SIZE (MAX_TCP) /* the larger of tcp and udp max */
/*
* architecture independent types
*
* (so far this works on all archs we have ported to)
*/
typedef unsigned short ca_uint16_t;
typedef unsigned int ca_uint32_t;
typedef float ca_float32_t;
typedef ca_uint32_t caResId;
/* values for m_cmmd */
#define IOC_NOOP 0 /* do nothing, but verify TCP */
#define IOC_EVENT_ADD 1 /* add an event */
#define IOC_EVENT_CANCEL 2 /* cancel an event */
#define IOC_READ 3 /* read and return a channel value*/
#define IOC_WRITE 4 /* write a channel value */
#define IOC_SNAPSHOT 5 /* snapshot of the system */
#define IOC_SEARCH 6 /* IOC channel search */
#define IOC_BUILD 7 /* build - obsolete */
#define IOC_EVENTS_OFF 8 /* flow control */
#define IOC_EVENTS_ON 9 /* flow control */
#define IOC_READ_SYNC 10 /* purge old reads */
#define IOC_ERROR 11 /* an operation failed */
#define IOC_CLEAR_CHANNEL 12 /* free chan resources */
#define IOC_RSRV_IS_UP 13 /* CA server has joined the net */
#define IOC_NOT_FOUND 14 /* channel not found */
#define IOC_READ_NOTIFY 15 /* add a one shot event */
#define IOC_READ_BUILD 16 /* read and build - obsolete */
#define REPEATER_CONFIRM 17 /* registration confirmation */
#define IOC_CLAIM_CIU 18 /* client claims resource in server */
#define IOC_WRITE_NOTIFY 19 /* notify after write chan value */
#define IOC_CLIENT_NAME 20 /* CA V4.1 identify client */
#define IOC_HOST_NAME 21 /* CA V4.1 identify client */
#define IOC_ACCESS_RIGHTS 22 /* CA V4.2 asynch access rights chg */
#define IOC_ECHO 23 /* CA V4.3 connection verify */
#define REPEATER_REGISTER 24 /* registr for repeater fan out */
#define IOC_SIGNAL 25 /* knock the server out of select */
#define IOC_CLAIM_CIU_FAILED 26 /* unable to create chan resource in server */
/*
* for use with search and not_found (if search fails and
* its not a broadcast tell the client to look elesewhere)
*/
#define DOREPLY 10
#define DONTREPLY 5
/* size of object in bytes rounded up to nearest oct word */
#define OCT_ROUND(A) ((((unsigned long)(A))+7)>>3)
#define OCT_SIZEOF(A) (OCT_ROUND(sizeof(A)))
/* size of object in bytes rounded up to nearest long word */
#define QUAD_ROUND(A) (((unsigned long)(A))+3)>>2)
#define QUAD_SIZEOF(A) (QUAD_ROUND(sizeof(A)))
/* size of object in bytes rounded up to nearest short word */
#define BI_ROUND(A) ((((unsigned long)(A))+1)>>1)
#define BI_SIZEOF(A) (BI_ROUND(sizeof(A)))
/*
* For communicating access rights to the clients
*
* (placed in m_available hdr field of IOC_ACCESS_RIGHTS cmmd
*/
#define CA_ACCESS_RIGHT_READ (1<<0)
#define CA_ACCESS_RIGHT_WRITE (1<<1)
/*
* All structures passed in the protocol must have individual
* fields aligned on natural boundaries.
*
* NOTE: all structures declared in this file must have a
* byte count which is evenly divisible by 8 matching
* the largest atomic data type in db_access.h.
*/
#define CA_MESSAGE_ALIGN(A) (OCT_ROUND(A)<<3)
/*
* the common part of each message sent/recv by the
* CA server.
*/
typedef struct extmsg {
ca_uint16_t m_cmmd; /* operation to be performed */
ca_uint16_t m_postsize; /* size of message extension */
ca_uint16_t m_type; /* operation data type */
ca_uint16_t m_count; /* operation data count */
ca_uint32_t m_cid; /* channel identifier */
ca_uint32_t m_available; /* undefined message location for use
* by client processes */
}caHdr;
/*
* for monitor (event) message extension
*/
struct mon_info{
ca_float32_t m_lval; /* low delta */
ca_float32_t m_hval; /* high delta */
ca_float32_t m_toval; /* period btween samples */
ca_uint16_t m_mask; /* event select mask */
ca_uint16_t m_pad; /* extend to 32 bits */
};
struct monops { /* monitor req opi to ioc */
struct extmsg m_header;
struct mon_info m_info;
};
#endif /* __IOCMSG__ */

View File

@@ -1,10 +1,18 @@
/*
* $Id$
*
* N E T _ C O N V E R T . H
* MACROS for rapid conversion between HOST data formats and those used
* by the IOCs (NETWORK).
*
* Author: J. Hill
*
* The conversion routines are used in both ca lib
* and the IOC ca server (base/rsrv).
* The latter, however, cannot include os_depen.h so
* I extracted the conversion specific code from there
* and put it in this "now stand alone" net_convert.h
* 8-22-96 -kuk-
*
*
* joh 09-13-90 force MIT sign to zero if exponent is zero
* to prevent a reseved operand fault.
@@ -16,8 +24,79 @@
*
*/
#ifndef _NET_CONVERT_H
#define _NET_CONVERT_H
#include <db_access.h>
/*
* Here are the definitions for architecture dependent byte ordering
* and floating point format
*/
#if defined(VAX)
# define CA_FLOAT_MIT
# define CA_LITTLE_ENDIAN
#elif defined(_X86_)
# define CA_FLOAT_IEEE
# define CA_LITTLE_ENDIAN
#elif (defined(__ALPHA) && defined(VMS) || defined(__alpha)) && defined(VMS)
# define CA_FLOAT_MIT
# define CA_LITTLE_ENDIAN
#elif (defined(__ALPHA) && defined(UNIX) || defined(__alpha)) && defined(UNIX)
# define CA_FLOAT_IEEE
# define CA_LITTLE_ENDIAN
#else
# define CA_FLOAT_IEEE
# define CA_BIG_ENDIAN
#endif
/*
* some architecture sanity checks
*/
#if defined(CA_BIG_ENDIAN) && defined(CA_LITTLE_ENDIAN)
#error defined(CA_BIG_ENDIAN) && defined(CA_LITTLE_ENDIAN)
#endif
#if !defined(CA_BIG_ENDIAN) && !defined(CA_LITTLE_ENDIAN)
#error !defined(CA_BIG_ENDIAN) && !defined(CA_LITTLE_ENDIAN)
#endif
#if defined(CA_FLOAT_IEEE) && defined(CA_FLOAT_MIT)
#error defined(CA_FLOAT_IEEE) && defined(CA_FLOAT_MIT)
#endif
#if !defined(CA_FLOAT_IEEE) && !defined(CA_FLOAT_MIT)
#error !defined(CA_FLOAT_IEEE) && !defined(CA_FLOAT_MIT)
#endif
/*
* CONVERSION_REQUIRED is set if either the byte order
* or the floating point does not match
*/
#if !defined(CA_FLOAT_IEEE) || !defined(CA_BIG_ENDIAN)
#define CONVERSION_REQUIRED
#endif
/*
* if hton is true then it is a host to network conversion
* otherwise vise-versa
*
* net format: big endian and IEEE float
*/
typedef void CACVRTFUNC(void *pSrc, void *pDest, int hton, unsigned long count);
#ifdef CONVERSION_REQUIRED
/* cvrt is (array of) (pointer to) (function returning) int */
extern CACVRTFUNC *cac_dbr_cvrt[];
#endif
/*
* Macros ...
*
* This is also used in the ca server on pc486 archs,
* where source and destination buffers are identical,
* so we need a tmp variable in e.g. 'double' conversions.
*/
#ifdef CA_LITTLE_ENDIAN
# ifndef ntohs
# define ntohs(SHORT)\
@@ -79,12 +158,20 @@
{*((dbr_long_t *)(HOST)) = ntohl(*((dbr_long_t *)(NET )));}
# define dbr_htonf(HOST,NET) \
{*((dbr_long_t *)(NET) ) = htonl(*((dbr_long_t *)(HOST)));}
# define dbr_ntohd(NET,HOST) \
{ ((dbr_long_t *)(HOST))[1] = ntohl(((dbr_long_t *)(NET))[0]) ; \
((dbr_long_t *)(HOST))[0] = ntohl(((dbr_long_t *)(NET))[1]) ;}
# define dbr_htond(HOST,NET) \
{ ((dbr_long_t *)(NET))[1] = htonl(((dbr_long_t *)(HOST))[0]) ; \
((dbr_long_t *)(NET))[0] = htonl(((dbr_long_t *)(HOST))[1]) ;}
# define dbr_ntohd(NET,HOST) \
{ \
dbr_long_t cvrt_tmp; \
cvrt_tmp = ntohl(((dbr_long_t *)(NET))[0]); \
((dbr_long_t *)(HOST))[0] = ntohl(((dbr_long_t *)(NET))[1]); \
((dbr_long_t *)(HOST))[1] = cvrt_tmp; \
}
# define dbr_htond(HOST,NET) \
{ \
dbr_long_t cvrt_tmp; \
cvrt_tmp = htonl(((dbr_long_t *)(HOST))[0]); \
((dbr_long_t *)(NET))[0] = htonl(((dbr_long_t *)(HOST))[1]); \
((dbr_long_t *)(NET))[1] = cvrt_tmp; \
}
#else
void dbr_htond(dbr_double_t *pHost, dbr_double_t *pNet);
void dbr_ntohd(dbr_double_t *pNet, dbr_double_t *pHost);
@@ -92,3 +179,4 @@
void dbr_ntohf(dbr_float_t *pNet, dbr_float_t *pHost);
#endif
#endif /* define _NET_CONVERT_H */

View File

@@ -35,52 +35,16 @@
static char *os_depenhSccsId = "$Id$";
/*
* errno.h is ANSI however we
* include it here because of differences
* between error code sets provided by
* each socket library
*/
#ifdef UNIX
# include <unistd.h>
# include <errno.h>
# include <time.h>
# include <sys/types.h>
# include <sys/time.h>
# include <sys/ioctl.h>
# include <sys/param.h>
# include <sys/socket.h>
# include <netinet/in.h>
# include <netinet/tcp.h>
# include <net/if.h>
# include <arpa/inet.h>
# include <netdb.h>
/*
* normally these are included by ioctl.h
*/
# ifdef SOLARIS
# include <sys/filio.h>
# include <sys/sockio.h>
# endif
# define CA_OS_CONFIGURED
#endif
#ifdef vxWorks
# include <vxWorks.h>
# include <errno.h>
# include <sys/types.h>
# include <sys/ioctl.h>
# include <sys/socket.h>
# include <netinet/in.h>
# include <netinet/tcp.h>
# include <net/if.h>
# include <systime.h>
# include <ioLib.h>
# include <tickLib.h>
# include <taskHookLib.h>
# include <selectLib.h>
# include <sockLib.h>
# include <errnoLib.h>
# include <sysLib.h>
# include <taskVarLib.h>
@@ -90,55 +54,19 @@ static char *os_depenhSccsId = "$Id$";
# include <dbgLib.h>
# include <inetLib.h>
# include <taskLib.h>
# include <vxLib.h>
# include <task_params.h>
# include <taskwd.h>
# include <fast_lock.h>
/*
* logistical problems prevent including this file
*/
#if 0
#define caClient
#include <dbEvent.h>
#endif
# define CA_OS_CONFIGURED
#endif
#ifdef VMS
# include <sys/types.h>
# include <sys/socket.h>
# include <netinet/in.h>
# include <netinet/tcp.h>
#if !defined(UCX)
# include <sys/time.h>
# include <tcp/errno.h>
#else
# include <errno>
#endif
# include <ssdef>
# include <stsdef>
# include <iodef.h>
# include <psldef.h>
# include <prcdef.h>
# include <descrip.h>
# define MAXHOSTNAMELEN 75
#ifdef UCX /* GeG 09-DEC-1992 */
# include <sys/ucx$inetdef.h>
# include <ucx.h>
#else
# include <net/if.h>
# include <vms/inetiodef.h>
# include <sys/ioctl.h>
#endif
# define CA_OS_CONFIGURED
#endif /*VMS*/
#ifdef WIN32
# include <errno.h>
# include <time.h>
# include <windows.h>
# include <winsock.h>
# define CA_OS_CONFIGURED
#endif /*WIN32*/
@@ -146,87 +74,8 @@ static char *os_depenhSccsId = "$Id$";
#error Please define one of vxWorks, UNIX, VMS, or WIN32
#endif
/*
* Here are the definitions for architecture dependent byte ordering
* and floating point format
*/
#if defined(VAX)
# define CA_FLOAT_MIT
# define CA_LITTLE_ENDIAN
#elif defined(_X86_)
# define CA_FLOAT_IEEE
# define CA_LITTLE_ENDIAN
#elif (defined(__ALPHA) && defined(VMS) || defined(__alpha)) && defined(VMS)
# define CA_FLOAT_MIT
# define CA_LITTLE_ENDIAN
#elif (defined(__ALPHA) && defined(UNIX) || defined(__alpha)) && defined(UNIX)
# define CA_FLOAT_IEEE
# define CA_LITTLE_ENDIAN
#else
# define CA_FLOAT_IEEE
# define CA_BIG_ENDIAN
#endif
/*
* some architecture sanity checks
*/
#if defined(CA_BIG_ENDIAN) && defined(CA_LITTLE_ENDIAN)
#error defined(CA_BIG_ENDIAN) && defined(CA_LITTLE_ENDIAN)
#endif
#if !defined(CA_BIG_ENDIAN) && !defined(CA_LITTLE_ENDIAN)
#error !defined(CA_BIG_ENDIAN) && !defined(CA_LITTLE_ENDIAN)
#endif
#if defined(CA_FLOAT_IEEE) && defined(CA_FLOAT_MIT)
#error defined(CA_FLOAT_IEEE) && defined(CA_FLOAT_MIT)
#endif
#if !defined(CA_FLOAT_IEEE) && !defined(CA_FLOAT_MIT)
#error !defined(CA_FLOAT_IEEE) && !defined(CA_FLOAT_MIT)
#endif
/*
* CONVERSION_REQUIRED is set if either the byte order
* or the floating point does not match
*/
#if !defined(CA_FLOAT_IEEE) || !defined(CA_BIG_ENDIAN)
#define CONVERSION_REQUIRED
#endif
#ifndef NULL
#define NULL 0
#endif
#ifndef FALSE
#define FALSE 0
#endif
#ifndef TRUE
#define TRUE 1
#endif
#ifndef OK
#define OK 0
#endif
#ifndef ERROR
#define ERROR (-1)
#endif
#ifndef NELEMENTS
#define NELEMENTS(array) (sizeof(array)/sizeof((array)[0]))
#endif
#ifndef LOCAL
#define LOCAL static
#endif
/*
* BSD prototypes missing from SUNOS4, MULTINET and
* perhaps other environments
*/
#include <epicsTypes.h>
#include <bsdProto.h>
#if defined(vxWorks)
# define POST_IO_EV semGive(io_done_sem)
# define VXTASKIDNONE 0
# define LOCK semTake(client_lock, WAIT_FOREVER);
# define UNLOCK semGive(client_lock);
@@ -238,79 +87,34 @@ static char *os_depenhSccsId = "$Id$";
(((int)taskIdCurrent)==event_tid || ca_static->recv_tid == (int)taskIdCurrent)
# define VXTHISTASKID taskIdSelf()
# define abort() taskSuspend(VXTHISTASKID)
# define socket_close(S) close(S)
/* vxWorks still has a brain dead func proto for ioctl */
# define socket_ioctl(A,B,C) ioctl(A,B,(int)C)
# define MYERRNO (errnoGet()&0xffff)
# define POST_IO_EV semGive(io_done_sem)
typedef int SOCKET;
# define INVALID_SOCKET (-1)
#endif
#if defined(UNIX)
# define POST_IO_EV
# define LOCK
# define UNLOCK
# define LOCKEVENTS
# define UNLOCKEVENTS
# define EVENTLOCKTEST (post_msg_active)
# define socket_close(S) close(S)
# define socket_ioctl(A,B,C) ioctl(A,B,C)
# define MYERRNO errno
# define POST_IO_EV
typedef int SOCKET;
# define INVALID_SOCKET (-1)
#endif
#if defined(VMS)
# if defined(WINTCP) /* Wallangong */
/* (the VAXC runtime lib has its own close */
# define socket_close(S) netclose(S)
# define socket_ioctl(A,B,C) ioctl(A,B,C)
# endif
# if defined(UCX) /* GeG 09-DEC-1992 */
# define socket_close(S) close(S)
# define socket_ioctl(A,B,C) ioctl(A,B,C)
# endif
# ifdef WINTCP
extern int uerrno;
# define MYERRNO uerrno
# else
# ifdef UCX
# define MYERRNO errno
# else
# define MYERRNO socket_errno
# endif
# endif
# define POST_IO_EV
# define LOCK
# define UNLOCK
# define LOCKEVENTS
# define UNLOCKEVENTS
# define EVENTLOCKTEST (post_msg_active)
typedef int SOCKET;
# define INVALID_SOCKET (-1)
#endif
#ifdef WIN32
# define POST_IO_EV
# define LOCK
# define UNLOCK
# define LOCKEVENTS
# define UNLOCKEVENTS
# define EVENTLOCKTEST (post_msg_active)
# define MAXHOSTNAMELEN 75
# define IPPORT_USERRESERVED 5000U
# define EWOULDBLOCK WSAEWOULDBLOCK
# define ENOBUFS WSAENOBUFS
# define ECONNRESET WSAECONNRESET
# define ETIMEDOUT WSAETIMEDOUT
# define EADDRINUSE WSAEADDRINUSE
# define ECONNREFUSED WSAECONNREFUSED
# define socket_close(S) closesocket(S)
# define socket_ioctl(A,B,C) ioctlsocket(A,B,C)
# define MYERRNO WSAGetLastError()
# define POST_IO_EV
# define EVENTLOCKTEST (post_msg_active)
#endif /*WIN32*/
#endif
#endif /* INCos_depenh */

View File

@@ -29,6 +29,9 @@
* Modification Log:
* -----------------
* $Log$
* Revision 1.19 1996/07/09 22:41:02 jhill
* pass nill 2nd arg to gettimeofday()
*
* Revision 1.18 1996/06/20 21:19:29 jhill
* fixed posix signal problem with "cc -Xc"
*
@@ -46,7 +49,6 @@
#include <unistd.h>
#include <pwd.h>
#include <sys/param.h>
#include "iocinf.h"
@@ -141,7 +143,7 @@ int cac_os_depen_init(struct ca_static *pcas)
ca_printf(
"%s: Error from signal replace was \"%s\"\n",
__FILE__,
strerror(MYERRNO));
strerror(errno));
}
}
}
@@ -149,7 +151,7 @@ int cac_os_depen_init(struct ca_static *pcas)
ca_printf(
"%s: Error from signal query was \"%s\"\n",
__FILE__,
strerror(MYERRNO));
strerror(errno));
}
status = ca_os_independent_init ();
@@ -238,7 +240,7 @@ void ca_spawn_repeater()
if(status<0){
ca_printf("!!WARNING!!\n");
ca_printf("The executable \"%s\" couldnt be located\n", pImageName);
ca_printf("because of errno = \"%s\"\n", strerror(MYERRNO));
ca_printf("because of errno = \"%s\"\n", strerror(errno));
ca_printf("You may need to modify your PATH environment variable.\n");
ca_printf("Creating CA repeater with fork() system call.\n");
ca_printf("Repeater will inherit parents process name and resources.\n");

View File

@@ -63,6 +63,9 @@
* datagram socket (and watching for ECONNREFUSED)
*
* $Log$
* Revision 1.37 1996/09/04 20:02:32 jhill
* fixed gcc warning
*
* Revision 1.36 1996/07/12 00:40:48 jhill
* fixed client disconnect problem under solaris
*
@@ -137,12 +140,12 @@ void ca_repeater()
/*
* test for server was already started
*/
if (MYERRNO==EADDRINUSE) {
if (SOCKERRNO==EADDRINUSE) {
exit(0);
}
ca_printf("%s: Unable to create repeater socket because \"%s\"\n",
__FILE__,
strerror(MYERRNO));
strerror(SOCKERRNO));
exit(0);
}
@@ -174,12 +177,12 @@ void ca_repeater()
* Avoid spurious ECONNREFUSED bug
* in linux
*/
if (MYERRNO==ECONNREFUSED) {
if (SOCKERRNO==ECONNREFUSED) {
continue;
}
# endif
ca_printf("CA Repeater: recv err %s\n",
strerror(MYERRNO));
strerror(SOCKERRNO));
continue;
}
@@ -246,10 +249,10 @@ LOCAL void fanOut(struct sockaddr_in *pFrom, const char *pMsg, unsigned msgSize)
#endif
}
if(status < 0){
if (MYERRNO == ECONNREFUSED) {
if (SOCKERRNO == ECONNREFUSED) {
#ifdef DEBUG
ca_printf("Deleted client %d\n",
pclient->from.sin_port);
ntohs( pclient->from.sin_port));
#endif
ellDelete(&theClients,
&pclient->node);
@@ -259,7 +262,7 @@ LOCAL void fanOut(struct sockaddr_in *pFrom, const char *pMsg, unsigned msgSize)
else {
ca_printf(
"CA Repeater: fan out err was \"%s\"\n",
strerror(MYERRNO));
strerror(SOCKERRNO));
}
}
}
@@ -282,10 +285,10 @@ LOCAL void verifyClients()
ellAdd(&theClients, &pclient->node);
sock = makeSocket(ntohs(pclient->from.sin_port), FALSE);
if (sock>=0) {
if (sock!=INVALID_SOCKET) {
#ifdef DEBUG
ca_printf("Deleted client %d\n",
pclient->from.sin_port);
ntohs(pclient->from.sin_port));
#endif
ellDelete(&theClients, &pclient->node);
socket_close(sock);
@@ -293,9 +296,9 @@ LOCAL void verifyClients()
free(pclient);
}
else {
if (MYERRNO!=EADDRINUSE) {
if (SOCKERRNO!=EADDRINUSE) {
ca_printf(
"CA Repeater: bind test err was \"%s\"\n", strerror(MYERRNO));
"CA Repeater: bind test err was \"%s\"\n", strerror(SOCKERRNO));
}
}
}
@@ -324,6 +327,16 @@ LOCAL SOCKET makeSocket(unsigned short port, int reuseAddr)
* no need to bind if unconstrained
*/
if (port != PORT_ANY) {
memset((char *)&bd, 0, sizeof(bd));
bd.sin_family = AF_INET;
bd.sin_addr.s_addr = INADDR_ANY;
bd.sin_port = htons(port);
status = bind(sock, (struct sockaddr *)&bd, (int)sizeof(bd));
if (status<0) {
socket_close(sock);
return INVALID_SOCKET;
}
if (reuseAddr) {
status = setsockopt( sock,
SOL_SOCKET,
@@ -333,19 +346,9 @@ LOCAL SOCKET makeSocket(unsigned short port, int reuseAddr)
if (status<0) {
ca_printf(
"%s: set socket option failed because \"%s\"\n",
__FILE__, strerror(MYERRNO));
__FILE__, strerror(SOCKERRNO));
}
}
memset((char *)&bd, 0, sizeof(bd));
bd.sin_family = AF_INET;
bd.sin_addr.s_addr = INADDR_ANY;
bd.sin_port = htons(port);
status = bind(sock, (struct sockaddr *)&bd, (int)sizeof(bd));
if(status<0){
socket_close(sock);
return INVALID_SOCKET;
}
}
return sock;
@@ -398,7 +401,7 @@ struct sockaddr_in *pFrom)
free(pclient);
ca_printf("%s: no client sock because \"%s\"\n",
__FILE__,
strerror(MYERRNO));
strerror(SOCKERRNO));
return;
}
@@ -421,7 +424,7 @@ struct sockaddr_in *pFrom)
#ifdef DEBUG
ca_printf (
"Added %d\n",
pFrom->sin_port);
ntohs(pFrom->sin_port));
#endif
}
@@ -436,7 +439,7 @@ struct sockaddr_in *pFrom)
if (status >= 0) {
assert(status == sizeof(confirm));
}
else if (MYERRNO == ECONNREFUSED){
else if (SOCKERRNO == ECONNREFUSED){
#ifdef DEBUG
ca_printf("Deleted repeater client=%d sending ack\n",
pFrom->sin_port);
@@ -447,7 +450,7 @@ struct sockaddr_in *pFrom)
}
else {
ca_printf("CA Repeater: confirm err was \"%s\"\n",
strerror(MYERRNO));
strerror(SOCKERRNO));
}
/*

View File

@@ -76,7 +76,7 @@ static char *sccsId = "@(#) $Id$";
LOCAL void reconnect_channel(
IIU *piiu,
chid chan
ciu chan
);
LOCAL int cacMsg(
@@ -177,17 +177,25 @@ unsigned long blockSize
* make sure we have a large enough message body cache
*/
if (piiu->curMsg.m_postsize>piiu->curDataMax) {
void *pCurData;
size_t size;
/*
* scalar DBR_STRING is sometimes clipped to the
* actual string size so make sure this cache is
* as large as one DBR_STRING so they will
* not page fault if they read MAX_STRING_SIZE
* bytes (instead of the actual string size).
*/
size = max(piiu->curMsg.m_postsize,MAX_STRING_SIZE);
pCurData = (void *) calloc(1u, size);
if(!pCurData){
return ERROR;
}
if(piiu->pCurData){
free(piiu->pCurData);
}
piiu->pCurData = (void *)
malloc(piiu->curMsg.m_postsize);
if(!piiu->pCurData){
piiu->curDataMax = 0;
piiu->curMsgBytes = 0;
piiu->curDataBytes = 0;
return ERROR;
}
piiu->pCurData = pCurData;
piiu->curDataMax =
piiu->curMsg.m_postsize;
}
@@ -241,7 +249,8 @@ struct ioc_in_use *piiu,
const struct in_addr *pnet_addr
)
{
evid monix;
miu monix;
ciu pChan;
switch (piiu->curMsg.m_cmmd) {
@@ -260,7 +269,7 @@ const struct in_addr *pnet_addr
* run the user's event handler
*/
LOCK;
monix = (evid) bucketLookupItemUnsignedId(
monix = (miu) bucketLookupItemUnsignedId(
pFastBucket,
&piiu->curMsg.m_available);
UNLOCK;
@@ -274,7 +283,7 @@ const struct in_addr *pnet_addr
* chid in the interim
*/
if (monix->usr_func) {
args.usr = monix->usr_arg;
args.usr = (void *) monix->usr_arg;
args.chid = monix->chan;
args.type = monix->type;
args.count = monix->count;
@@ -308,7 +317,7 @@ const struct in_addr *pnet_addr
*/
LOCK;
monix = (evid) bucketLookupItemUnsignedId(
monix = (miu) bucketLookupItemUnsignedId(
pFastBucket,
&piiu->curMsg.m_available);
UNLOCK;
@@ -337,7 +346,7 @@ const struct in_addr *pnet_addr
piiu->curMsg.m_count);
# endif
args.usr = monix->usr_arg;
args.usr = (void *) monix->usr_arg;
args.chid = monix->chan;
args.type = piiu->curMsg.m_type;
args.count = piiu->curMsg.m_count;
@@ -377,7 +386,7 @@ const struct in_addr *pnet_addr
* run the user's event handler
*/
LOCK;
monix = (evid) bucketLookupItemUnsignedId(
monix = (miu) bucketLookupItemUnsignedId(
pFastBucket,
&piiu->curMsg.m_available);
UNLOCK;
@@ -392,7 +401,8 @@ const struct in_addr *pnet_addr
*/
if (!piiu->curMsg.m_postsize) {
LOCK;
ellDelete(&monix->chan->eventq, &monix->node);
pChan = (ciu) monix->chan; /* discard const */
ellDelete(&pChan->eventq, &monix->node);
caIOBlockFree(monix);
UNLOCK;
@@ -421,7 +431,7 @@ const struct in_addr *pnet_addr
* structure rather than the structure itself
* early on.
*/
args.usr = monix->usr_arg;
args.usr = (void *) monix->usr_arg;
args.chid = monix->chan;
args.type = piiu->curMsg.m_type;
args.count = piiu->curMsg.m_count;
@@ -450,13 +460,13 @@ const struct in_addr *pnet_addr
}
case CA_PROTO_READ:
{
evid pIOBlock;
miu pIOBlock;
/*
* verify the event id
*/
LOCK;
pIOBlock = (evid) bucketLookupItemUnsignedId(
pIOBlock = (miu) bucketLookupItemUnsignedId(
pFastBucket,
&piiu->curMsg.m_available);
UNLOCK;
@@ -476,7 +486,7 @@ const struct in_addr *pnet_addr
# ifdef CONVERSION_REQUIRED
(*cac_dbr_cvrt[piiu->curMsg.m_type])(
piiu->pCurData,
pIOBlock->usr_arg,
(void *) pIOBlock->usr_arg,
FALSE,
piiu->curMsg.m_count);
# else
@@ -499,7 +509,7 @@ const struct in_addr *pnet_addr
/*
* decrement the outstanding IO count
*/
CLRPENDRECV(TRUE);
CLRPENDRECV;
}
LOCK;
ellDelete(&pend_read_list, &pIOBlock->node);
@@ -520,7 +530,20 @@ const struct in_addr *pnet_addr
{
struct in_addr ina;
ina.s_addr = piiu->curMsg.m_available;
/*
* this allows a fan-out server to potentially
* insert the true address of a server
* (servers prior to 3.13 always set this
* field to one of the ip addresses of the host)
* (clients prior to 3.13 always expect that this
* field is set to the server's IP address).
*/
if (piiu->curMsg.m_available != INADDR_ANY) {
ina.s_addr = piiu->curMsg.m_available;
}
else {
ina = *pnet_addr;
}
mark_server_available(&ina);
}
UNLOCK;
@@ -543,10 +566,10 @@ const struct in_addr *pnet_addr
case CA_PROTO_ERROR:
{
ELLLIST *pList = NULL;
evid monix;
miu monix;
char nameBuf[64];
char context[255];
caHdr *req = piiu->pCurData;
caHdr *req = piiu->pCurData;
int op;
struct exception_handler_args args;
@@ -584,24 +607,24 @@ const struct in_addr *pnet_addr
LOCK;
switch (ntohs(req->m_cmmd)) {
case CA_PROTO_READ_NOTIFY:
monix = (evid) bucketLookupItemUnsignedId(
monix = (miu) bucketLookupItemUnsignedId(
pFastBucket,
&req->m_available);
pList = &pend_read_list;
op = CA_OP_GET;
break;
case CA_PROTO_READ:
monix = (evid) bucketLookupItemUnsignedId(
monix = (miu) bucketLookupItemUnsignedId(
pFastBucket,
&req->m_available);
if(monix){
args.addr = monix->usr_arg;
args.addr = (void *) monix->usr_arg;
}
pList = &pend_read_list;
op = CA_OP_GET;
break;
case CA_PROTO_WRITE_NOTIFY:
monix = (evid) bucketLookupItemUnsignedId(
monix = (miu) bucketLookupItemUnsignedId(
pFastBucket,
&req->m_available);
pList = &pend_write_list;
@@ -614,16 +637,17 @@ const struct in_addr *pnet_addr
op = CA_OP_SEARCH;
break;
case CA_PROTO_EVENT_ADD:
monix = (evid) bucketLookupItemUnsignedId(
monix = (miu) bucketLookupItemUnsignedId(
pFastBucket,
&req->m_available);
op = CA_OP_ADD_EVENT;
if (monix) {
pList = &monix->chan->eventq;
ciu pChan = (ciu) monix->chan;
pList = &pChan->eventq;
}
break;
case CA_PROTO_EVENT_CANCEL:
monix = (evid) bucketLookupItemUnsignedId(
monix = (miu) bucketLookupItemUnsignedId(
pFastBucket,
&req->m_available);
op = CA_OP_CLEAR_EVENT;
@@ -643,7 +667,7 @@ const struct in_addr *pnet_addr
args.chid = bucketLookupItemUnsignedId
(pSlowBucket, &piiu->curMsg.m_cid);
UNLOCK;
args.usr = ca_static->ca_exception_arg;
args.usr = (void *) ca_static->ca_exception_arg;
args.type = ntohs (req->m_type);
args.count = ntohs (req->m_count);
args.stat = ntohl (piiu->curMsg.m_available);
@@ -658,10 +682,11 @@ const struct in_addr *pnet_addr
case CA_PROTO_ACCESS_RIGHTS:
{
int ar;
chid chan;
ciu chan;
LOCK;
chan = bucketLookupItemUnsignedId(pSlowBucket, &piiu->curMsg.m_cid);
chan = (ciu) bucketLookupItemUnsignedId(
pSlowBucket, &piiu->curMsg.m_cid);
UNLOCK;
if(!chan){
/*
@@ -686,10 +711,10 @@ const struct in_addr *pnet_addr
}
case CA_PROTO_CLAIM_CIU:
{
chid chan;
ciu chan;
LOCK;
chan = bucketLookupItemUnsignedId(
chan = (ciu) bucketLookupItemUnsignedId(
pSlowBucket, &piiu->curMsg.m_cid);
UNLOCK;
if(!chan){
@@ -725,10 +750,10 @@ const struct in_addr *pnet_addr
*/
LOCAL void verifyChanAndDisconnect(IIU *piiu, enum channel_state state)
{
chid chan;
ciu chan;
LOCK;
chan = bucketLookupItemUnsignedId(
chan = (ciu) bucketLookupItemUnsignedId(
pSlowBucket, &piiu->curMsg.m_cid);
if (!chan) {
/*
@@ -761,7 +786,7 @@ const struct in_addr *pnet_addr
int v42;
unsigned short port;
char rej[64];
chid chan;
ciu chan;
int status;
IIU *allocpiiu;
IIU *chpiiu;
@@ -774,7 +799,7 @@ const struct in_addr *pnet_addr
* lock required around use of the sprintf buffer
*/
LOCK;
chan = bucketLookupItemUnsignedId(
chan = (ciu) bucketLookupItemUnsignedId(
pSlowBucket,
&piiu->curMsg.m_available);
if(!chan){
@@ -923,8 +948,8 @@ const struct in_addr *pnet_addr
* reconnect_channel()
*/
LOCAL void reconnect_channel(
IIU *piiu,
chid chan
IIU *piiu,
ciu chan
)
{
evid pevent;
@@ -1007,7 +1032,7 @@ chid chan
}
else if(prev_cs==cs_never_conn){
/* decrement the outstanding IO count */
CLRPENDRECV(TRUE);
CLRPENDRECV;
}
}

View File

@@ -29,6 +29,12 @@
* Modification Log:
* -----------------
* $Log$
* Revision 1.21 1996/11/02 00:51:08 jhill
* many pc port, const in API, and other changes
*
* Revision 1.20 1996/07/10 23:30:12 jhill
* fixed GNU warnings
*
* Revision 1.19 1996/06/19 17:59:29 jhill
* many 3.13 beta changes
*
@@ -176,7 +182,7 @@ int epicsShareAPI ca_sg_create(CA_SYNC_GID *pgid)
UNLOCK;
*(WRITEABLE_CA_SYNC_GID *)pgid = pcasg->id;
*pgid = pcasg->id;
return ECA_NORMAL;
}
@@ -184,7 +190,7 @@ int epicsShareAPI ca_sg_create(CA_SYNC_GID *pgid)
/*
* ca_sg_delete()
*/
int epicsShareAPI ca_sg_delete(CA_SYNC_GID gid)
int epicsShareAPI ca_sg_delete(const CA_SYNC_GID gid)
{
int status;
CASG *pcasg;
@@ -222,7 +228,7 @@ int epicsShareAPI ca_sg_delete(CA_SYNC_GID gid)
/*
* ca_sg_block()
*/
int epicsShareAPI ca_sg_block(CA_SYNC_GID gid, ca_real timeout)
int epicsShareAPI ca_sg_block(const CA_SYNC_GID gid, ca_real timeout)
{
struct timeval beg_time;
ca_real delay;
@@ -318,7 +324,7 @@ int epicsShareAPI ca_sg_block(CA_SYNC_GID gid, ca_real timeout)
/*
* ca_sg_reset
*/
int epicsShareAPI ca_sg_reset(CA_SYNC_GID gid)
int epicsShareAPI ca_sg_reset(const CA_SYNC_GID gid)
{
CASG *pcasg;
@@ -340,7 +346,7 @@ int epicsShareAPI ca_sg_reset(CA_SYNC_GID gid)
/*
* ca_sg_stat
*/
int epicsShareAPI ca_sg_stat(CA_SYNC_GID gid)
int epicsShareAPI ca_sg_stat(const CA_SYNC_GID gid)
{
CASG *pcasg;
CASGOP *pcasgop;
@@ -376,7 +382,7 @@ int epicsShareAPI ca_sg_stat(CA_SYNC_GID gid)
/*
* ca_sg_test
*/
int epicsShareAPI ca_sg_test(CA_SYNC_GID gid)
int epicsShareAPI ca_sg_test(const CA_SYNC_GID gid)
{
CASG *pcasg;
@@ -401,11 +407,11 @@ int epicsShareAPI ca_sg_test(CA_SYNC_GID gid)
* ca_sg_array_put()
*/
int epicsShareAPI ca_sg_array_put(
CA_SYNC_GID gid,
chtype type,
unsigned long count,
chid chix,
void *pvalue)
const CA_SYNC_GID gid,
chtype type,
unsigned long count,
chid chix,
const void *pvalue)
{
int status;
CASGOP *pcasgop;
@@ -467,11 +473,11 @@ void *pvalue)
* ca_sg_array_get()
*/
int epicsShareAPI ca_sg_array_get(
CA_SYNC_GID gid,
chtype type,
unsigned long count,
chid chix,
void *pvalue)
const CA_SYNC_GID gid,
chtype type,
unsigned long count,
chid chix,
void *pvalue)
{
int status;
CASGOP *pcasgop;

View File

@@ -32,6 +32,9 @@
* cjm 20-Nov-95 Add code for gettimeofday
*
* $Log$
* Revision 1.20 1996/07/02 23:04:07 jhill
* took &tz out of gettimeofday()
*
* Revision 1.19 1995/12/19 19:35:24 jhill
* -cjm 20-Nov-95 Add code for gettimeofday
*
@@ -47,20 +50,16 @@
/*
* VMS includes
*/
#include <stsdef.h>
#include <ssdef.h>
#include <stsdef.h>
#include <iodef.h>
#include <psldef.h>
#include <prcdef.h>
#include <jpidef.h>
#include <descrip.h>
#include "iocinf.h"
#ifdef UCX
#include "ucx.h"
#endif
#if 0
#define CONNECTION_TIMER_ID 56
#endif
/*
* cac_gettimeval

View File

@@ -29,6 +29,9 @@
* Modification Log:
* -----------------
* $Log$
* Revision 1.26 1996/09/16 16:39:20 jhill
* local except => except handler
*
* Revision 1.25 1996/08/13 23:16:23 jhill
* removed os specific code
*
@@ -421,8 +424,8 @@ void cac_os_depen_exit (struct ca_static *pcas)
LOCAL int cac_os_depen_exit_tid (struct ca_static *pcas, int tid)
{
int status;
chid chix;
evid monix;
ciu chix;
miu monix;
TVIU *ptviu;
CALLBACK *pcb;
@@ -449,7 +452,7 @@ LOCAL int cac_os_depen_exit_tid (struct ca_static *pcas, int tid)
status = taskSuspend (pcas->recv_tid);
if (status<0) {
ca_printf ("taskSuspend() error = %s\n",
strerror (MYERRNO) );
strerror (errno) );
}
}
}
@@ -459,9 +462,9 @@ LOCAL int cac_os_depen_exit_tid (struct ca_static *pcas, int tid)
* (and put call backs)
*
*/
chix = (chid) & pcas->ca_local_chidlist.node;
while (chix = (chid) chix->node.next) {
while (monix = (evid) ellGet(&chix->eventq)) {
chix = (ciu) & pcas->ca_local_chidlist.node;
while ( (chix = (ciu) chix->node.next) ) {
while ( (monix = (miu) ellGet(&chix->eventq)) ) {
/*
* temp release lock so that the event task
* can finish
@@ -498,7 +501,7 @@ LOCAL int cac_os_depen_exit_tid (struct ca_static *pcas, int tid)
*
* db_close_events() does not require a CA context.
*/
while (ptviu = (TVIU *)ellGet(&pcas->ca_taskVarList)) {
while ( (ptviu = (TVIU *)ellGet(&pcas->ca_taskVarList)) ) {
# ifdef DEBUG
ca_printf("CAC: removing task var %x\n", ptviu->tid);
# endif

View File

@@ -32,6 +32,15 @@
* Modification Log:
* -----------------
* $Log$
* Revision 1.23.2.1 1996/11/25 16:29:18 jhill
* stuct=>struct and added debug msg
*
* Revision 1.23 1996/11/02 00:51:12 jhill
* many pc port, const in API, and other changes
*
* Revision 1.22 1996/09/16 16:40:13 jhill
* make EPICS version be the console title
*
* Revision 1.21 1996/08/05 19:20:29 jhill
* removed incorrect ver number
*
@@ -40,6 +49,15 @@
*
* Revision 1.19 1995/11/29 19:15:42 jhill
* added $Log$
* added Revision 1.23.2.1 1996/11/25 16:29:18 jhill
* added stuct=>struct and added debug msg
* added
* added Revision 1.23 1996/11/02 00:51:12 jhill
* added many pc port, const in API, and other changes
* added
* added Revision 1.22 1996/09/16 16:40:13 jhill
* added make EPICS version be the console title
* added
* added Revision 1.21 1996/08/05 19:20:29 jhill
* added removed incorrect ver number
* added
@@ -55,6 +73,7 @@
#include <windows.h>
#include <process.h>
#include <mmsystem.h>
#include <epicsVersion.h>
#include "iocinf.h"
@@ -263,7 +282,7 @@ int local_addr (SOCKET s, struct sockaddr_in *plcladdr)
plcladdr->sin_family = AF_INET;
plcladdr->sin_port = 0;
plcladdr->sin_addr.s_addr = ntohl (loopBackAddress);
plcladdr->sin_addr.s_addr = htonl (loopBackAddress);
return OK;
}
@@ -271,24 +290,27 @@ int local_addr (SOCKET s, struct sockaddr_in *plcladdr)
/*
* caDiscoverInterfaces()
*
* This routine is provided with the address of an ELLLIST a socket
* and a destination port number. When the routine returns there
* will be one additional inet address (a caAddrNode) in the list
* for each inet interface found that is up and isnt a loop back
* interface. If the interface supports broadcast then I add its
* broadcast address to the list. If the interface is a point to
* point link then I add the destination address of the point to
* point link to the list. In either case I set the port number
* in the address node to the port supplied in the argument
* list.
* This routine is provided with the address of an ELLLIST, a socket
* a destination port number, and a match address. When the
* routine returns there will be one additional inet address
* (a caAddrNode) in the list for each inet interface found that
* is up and isnt a loop back interface (match addr is INADDR_ANY)
* or it matches the specified interface (match addr isnt INADDR_ANY).
* If the interface supports broadcast then I add its broadcast
* address to the list. If the interface is a point to
* point link then I add the destination address of the point to
* point link to the list. In either case I set the port number
* in the address node to the port supplied in the argument
* list.
*
* LOCK should be applied here for (pList)
* (this is also called from the server)
*/
void caDiscoverInterfaces(ELLLIST *pList, SOCKET socket, int port)
void caDiscoverInterfaces(ELLLIST *pList, SOCKET socket, int port,
struct in_addr matchAddr)
{
struct in_addr bcast_addr;
caAddrNode *pNode;
caAddrNode *pNode;
pNode = (caAddrNode *) calloc(1,sizeof(*pNode));
if(!pNode){
@@ -323,7 +345,7 @@ broadcast_addr( struct in_addr *pcastaddr )
gethostname(lhostname,sizeof(lhostname));
phostent = gethostbyname(lhostname);
if (!phostent) {
return MYERRNO;
return SOCKERRNO;
}
if (status = get_subnet_mask(netmask))
@@ -463,6 +485,8 @@ static int RegKeyData (CHAR *RegPath, HANDLE hKeyRoot, LPSTR lpzValueName,
}
#define NO_PROCESS_MSG
BOOL epicsShareAPI DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved)
{
int status;
@@ -479,8 +503,11 @@ BOOL epicsShareAPI DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved)
SetConsoleTitle(EPICS_VERSION_STRING);
freopen( "CONOUT$", "a", stderr );
}
#ifndef NO_PROCESS_MSG
fprintf(stderr, "Process attached to ca.dll\n");
#endif /* init. winsock */
#endif
#endif
/* init. winsock */
if ((status = WSAStartup(MAKEWORD(1,1), &WsaData)) != 0) {
fprintf(stderr,"Cant init winsock \n");
return FALSE;
@@ -510,13 +537,17 @@ BOOL epicsShareAPI DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved)
case DLL_THREAD_ATTACH:
#if _DEBUG
#ifndef NO_PROCESS_MSG
fprintf(stderr, "Thread attached to ca.dll\n");
#endif
#endif
break;
case DLL_THREAD_DETACH:
#if _DEBUG
#ifndef NO_PROCESS_MSG
fprintf(stderr, "Thread detached from ca.dll\n");
#endif
#endif
break;

View File

@@ -6,24 +6,28 @@ README file for the EPICS Channel Access Server
Author Jeff Hill johill@lanl.gov
$Log$
Revision 1.1.1.1 1996/06/20 00:28:06 jhill
ca server installation
Directory Structure
-------------------
o example - example server tool
o generic - generic server lib source code
o os - os dependnet server lib source code
o io - io dependnet server lib source code
o build - server lib object code
o example - example server tool
o generic - generic server lib source code
o os - os dependnet server lib source code
o io - io dependnet server lib source code
o build/singleThread - server lib object code for single threaded use
o build/multiThread - server lib object code for multi threaded use
Internal Source Code Naming Conventions
---------------------------------------
o API class X will almost always have associated internal (usually
private base) class named XI
o for class X there will be
o X.h - the class declaration (and simple inlines)
o XIL.h - complex inline functions (that will not
compile with until the compiler has seen
o for class X there will
o sometimes be X.h - the class declaration (and simple inlines)
o sometimes be XIL.h - complex inline functions (that will not
compile unless the compiler has seen
the declarations of other classes)
o X.cc - all other source code for the class
o be X.cc - all other source code for the class

120
src/cas/RELEASE_NOTES Normal file
View File

@@ -0,0 +1,120 @@
Changes between epics 3.13 Beta 4 and 3.13 Beta 5
**** API Change ****
o The canonical PV name is returned from caServer::pvExistTest()
in the supplied buffer and not in a gdd data descriptor. See
"casdef.h".
old API:
//
// pvExistTest()
//
// The server tool is encouraged to accept multiple PV name
// aliases for the same PV here. However, a unique canonical name
// must be selected for each PV.
//
// returns S_casApp_success and fills in canonicalPVName
// if the PV is in this server tool
//
// returns S_casApp_pvNotFound if the PV does not exist in
// the server tool
//
// The server tool returns the unique canonical name for
// the pv into the gdd. A gdd is used here because this
// operation is allowed to complete asynchronously.
//
virtual caStatus pvExistTest (const casCtx &ctx, const char *pPVName,
gdd &canonicalPVName) = 0;
new API:
//
// pvExistTest()
//
// The server tool is encouraged to accept multiple PV name
// aliases for the same PV here. However, one unique canonical name
// must be selected by the server tool and returned to the
// server lib for each PV. The server will use this canonical
// name to prevent internal duplication of data structures for
// process variables that have multiple aliases.
//
// o returns S_casApp_success and a valid canonical name string
// when the PV is in this server tool
//
// o returns S_casApp_pvNotFound if the PV does not exist in
// the server tool
//
// Examples:
// caServerXXX::pvExistTest(const casCtx &ctx, const char *pPVName)
// {
// return pvExistReturn(S_casApp_success, pPVName); // common
// return pvExistReturn(S_casApp_pvNotFound); // no PV by that name
//
// char pName[9] = "myPVName";
// return pvExistReturn(S_casApp_success, pName); // also common
// return pvExistReturn(S_casApp_asyncCompletion); // not now
// }
//
virtual pvExistReturn pvExistTest (const casCtx &ctx,
const char *pPVName)=0;
**** API Change ****
o The server tool must now use one of class casAsyncReadIO, casAsyncWriteIO, or
casAsyncPVExistIO in place of casAsyncIO. See "casdef.h".
**** API Change ****
o Virtual function prototype change:
Before: "aitEnum casPV::bestExternalType()"
After: "aitEnum casPV::bestExternalType() const"
**** API Change ****
o The following virtual functions were added to casPV:
//
// Returns the maximum bounding box for all present and
// future data stored within the PV.
//
// The routine "dimension()" returns the maximum
// number of dimensions in the hypercube (0=scaler,
// 1=array, 2=plane, 3=cube ...}.
//
// The routine "maxBound(dimension)" returns the
// maximum length of a particular dimension of the
// hypercube as follows:
//
// dim equal to 0 1 3 ...
// -------------------------------------------
// hypercube
// type
// ---------
//
// array array
// length
//
// plane x y
//
// cube x y z
//
// .
// .
// .
//
// The default (base) "dimension()" returns zero (scaler).
// The default (base) "maxBound()" returns scaler bounds
// for all dimensions.
//
// Clients will see that the PV's data is scaler if
// these routines are not supplied in the derived class.
//
// If the "dimension" argument to maxBounds() is set to
// zero then the bound on the first dimension is being
// fetched. If the "dimension" argument to maxBound() is
// set to one then the bound on the second dimension
// are being fetched...
//
virtual unsigned maxDimension() const; // return zero if scaler
virtual aitIndex maxBound (unsigned dimension) const;
The defaults in base class casPV implement identical behavior
to the past if these routines are not supplied by the derived
class.

View File

@@ -1,78 +0,0 @@
TOP = ../../..
CAS = ../../..
SRC = $(CAS)/generic
IOSRC = $(CAS)/io/bsdSocket
OSSRC = $(CAS)/os/posix
VPATH = $(SRC) $(IOSRC) $(OSSRC)
include Target.include
include $(TOP)/config/CONFIG_BASE
USR_INCLUDES = -I$(CAS)/../ca -I$(OSSRC) -I$(IOSRC) -I$(CAS)/gdd
USR_LDLIBS = -lcas -lm
USR_LDFLAGS = -L.
DEPLIBS_BASE = $(EPICS_BASE_LIB)
#CPLUSPLUS = G++
SRCS.cc += $(SRC)/caServer.cc
SRCS.cc += $(SRC)/casClient.cc
SRCS.cc += $(SRC)/casDGClient.cc
SRCS.cc += $(SRC)/casStreamClient.cc
SRCS.cc += $(SRC)/casPV.cc
SRCS.cc += $(SRC)/casPVI.cc
SRCS.cc += $(SRC)/casChannel.cc
SRCS.cc += $(SRC)/casChannelI.cc
SRCS.cc += $(SRC)/casClientMon.cc
SRCS.cc += $(SRC)/casMsgIO.cc
SRCS.cc += $(SRC)/casAsyncIO.cc
SRCS.cc += $(SRC)/casAsyncIOI.cc
SRCS.cc += $(SRC)/casEventSys.cc
SRCS.cc += $(SRC)/outBuf.cc
SRCS.cc += $(SRC)/inBuf.cc
SRCS.cc += $(SRC)/casMapDBR.cc
SRCS.cc += $(OSSRC)/casDGOS.cc
SRCS.cc += $(OSSRC)/casServerOS.cc
SRCS.cc += $(OSSRC)/casStreamOS.cc
SRCS.cc += $(IOSRC)/casDGIO.cc
SRCS.cc += $(IOSRC)/casStreamIO.cc
SRCS.cc += $(IOSRC)/caServerIO.cc
LIBOBJS += caServer.o
LIBOBJS += casClient.o
LIBOBJS += casDGClient.o
LIBOBJS += casStreamClient.o
LIBOBJS += casPV.o
LIBOBJS += casPVI.o
LIBOBJS += casChannel.o
LIBOBJS += casChannelI.o
LIBOBJS += casClientMon.o
LIBOBJS += casMsgIO.o
LIBOBJS += casAsyncIO.o
LIBOBJS += casAsyncIOI.o
LIBOBJS += casEventSys.o
LIBOBJS += outBuf.o
LIBOBJS += inBuf.o
LIBOBJS += casMapDBR.o
LIBOBJS += casDGOS.o
LIBOBJS += casServerOS.o
LIBOBJS += casStreamOS.o
LIBOBJS += casDGIO.o
LIBOBJS += casStreamIO.o
LIBOBJS += caServerIO.o
LIBNAME = libcas.a
include $(TOP)/config/RULES.Unix
obj: $(LIBOBJS)
clean::
@$(RM) -rf Templates.DB

View File

@@ -7,7 +7,7 @@ SRC = $(CAS)/generic
CA = $(CAS)/../ca
IOSRC = $(CAS)/io/bsdSocket
OSSRC = $(CAS)/os/vxWorks
VPATH = $(SRC) $(IOSRC) $(OSSRC)
VPATH = $(SRC) $(SRC)/mt $(IOSRC) $(OSSRC)
include $(TOP)/config/CONFIG_BASE
@@ -18,36 +18,37 @@ USR_INCLUDES = -I$(SRC) -I$(OSSRC) -I$(IOSRC) -I$(CA)\
DEPLIBS_BASE = $(EPICS_BASE_LIB)
SRCS.cc += $(SRC)/caServer.cc
SRCS.cc += $(SRC)/caServerI.cc
SRCS.cc += $(SRC)/casCoreClient.cc
SRCS.cc += $(SRC)/casClient.cc
SRCS.cc += $(SRC)/casDGClient.cc
SRCS.cc += $(SRC)/casStrmClient.cc
SRCS.cc += $(SRC)/casPV.cc
SRCS.cc += $(SRC)/casPVI.cc
SRCS.cc += $(SRC)/casChannel.cc
SRCS.cc += $(SRC)/casChannelI.cc
SRCS.cc += $(SRC)/casClientMon.cc
SRCS.cc += $(SRC)/casChanDelEv.cc
SRCS.cc += $(SRC)/casMsgIO.cc
SRCS.cc += $(SRC)/casAsyncIO.cc
SRCS.cc += $(SRC)/casAsyncIOI.cc
SRCS.cc += $(SRC)/casEventSys.cc
SRCS.cc += $(SRC)/casMonitor.cc
SRCS.cc += $(SRC)/casMonEvent.cc
SRCS.cc += $(SRC)/outBuf.cc
SRCS.cc += $(SRC)/inBuf.cc
SRCS.cc += $(SRC)/casEventMask.cc
SRCS.cc += caServer.cc
SRCS.cc += caServerI.cc
SRCS.cc += casCoreClient.cc
SRCS.cc += casClient.cc
SRCS.cc += casDGClient.cc
SRCS.cc += casStrmClient.cc
SRCS.cc += casPV.cc
SRCS.cc += casPVI.cc
SRCS.cc += casChannel.cc
SRCS.cc += casChannelI.cc
SRCS.cc += casClientMon.cc
SRCS.cc += casChanDelEv.cc
SRCS.cc += casMsgIO.cc
SRCS.cc += casAsyncIO.cc
SRCS.cc += casAsyncIOI.cc
SRCS.cc += casEventSys.cc
SRCS.cc += casMonitor.cc
SRCS.cc += casMonEvent.cc
SRCS.cc += outBuf.cc
SRCS.cc += inBuf.cc
SRCS.cc += casEventMask.cc
SRCS.cc += ioBlocked.cc
SRCS.cc += $(OSSRC)/caServerOS.cc
SRCS.cc += $(OSSRC)/casDGOS.cc
SRCS.cc += $(OSSRC)/casStreamOS.cc
SRCS.cc += caServerOS.cc
SRCS.cc += casDGOS.cc
SRCS.cc += casStreamOS.cc
SRCS.cc += $(IOSRC)/caServerIO.cc
SRCS.cc += $(IOSRC)/casDGIO.cc
SRCS.cc += $(IOSRC)/casStreamIO.cc
SRCS.c += $(IOSRC)/sigPipeIgnore.c
SRCS.cc += caServerIO.cc
SRCS.cc += casDGIO.cc
SRCS.cc += casStreamIO.cc
SRCS.c += sigPipeIgnore.c
LIBOBJS += caServer.o
LIBOBJS += caServerI.o
@@ -70,6 +71,7 @@ LIBOBJS += casMonEvent.o
LIBOBJS += outBuf.o
LIBOBJS += inBuf.o
LIBOBJS += casEventMask.o
LIBOBJS += ioBlocked.o
LIBOBJS += caServerOS.o
LIBOBJS += casDGOS.o

View File

@@ -0,0 +1,69 @@
CAS := ../../..
TOP := $(CAS)/../..
SRC := $(CAS)/generic
CA := $(CAS)/../ca
IOSRC := $(CAS)/io/bsdSocket
STSRC := $(SRC)/st
USER_VPATH := $(SRC) $(STSRC) $(IOSRC)
include $(TOP)/config/CONFIG_BASE
CXXCMPLR = STRICT
# sometimes it's good to have different C/C++ flags, not now:
USR_CFLAGS = -I$(SRC) -I$(IOSRC) -I$(STSRC) -I$(CA)
USR_CXXFLAGS = $(USR_CFLAGS)
LIBSRCS += caServer.cc
LIBSRCS += caServerI.cc
LIBSRCS += casCoreClient.cc
LIBSRCS += casClient.cc
LIBSRCS += casDGClient.cc
LIBSRCS += casStrmClient.cc
LIBSRCS += casPV.cc
LIBSRCS += casPVI.cc
LIBSRCS += casChannel.cc
LIBSRCS += casChannelI.cc
LIBSRCS += casPVListChan.cc
LIBSRCS += casClientMon.cc
LIBSRCS += casChanDelEv.cc
LIBSRCS += casMsgIO.cc
LIBSRCS += casAsyncIO.cc
LIBSRCS += casAsyncIOI.cc
LIBSRCS += casAsyncXXIO.cc
LIBSRCS += casAsyncRdIOI.cc
LIBSRCS += casAsyncWtIOI.cc
LIBSRCS += casAsyncExIOI.cc
LIBSRCS += casEventSys.cc
LIBSRCS += casMonitor.cc
LIBSRCS += casMonEvent.cc
LIBSRCS += casOpaqueAddr.cc
LIBSRCS += inBuf.o
LIBSRCS += outBuf.cc
LIBSRCS += dgInBuf.o
LIBSRCS += dgOutBuf.cc
LIBSRCS += casCtx.o
LIBSRCS += casEventMask.cc
LIBSRCS += ioBlocked.cc
LIBSRCS += templInst.cc
LIBSRCS += caServerOS.cc
LIBSRCS += casIntfOS.cc
LIBSRCS += casDGIntfOS.cc
LIBSRCS += casDGOS.cc
LIBSRCS += casStreamOS.cc
LIBSRCS += caServerIO.cc
LIBSRCS += casIntfIO.cc
LIBSRCS += casDGIntfIO.cc
LIBSRCS += casDGIO.cc
LIBSRCS += casStreamIO.cc
LIBSRCS += sigPipeIgnore.c
LIBRARY := cas
include $(TOP)/config/RULES.Host
clean::
@$(RM) -rf Templates.DB

View File

@@ -1,91 +0,0 @@
#HERE := $(shell pwd)
HERE = .
CAS := $(HERE)/../../..
TOP = $(CAS)/../..
SRC = $(CAS)/generic
CA = $(CAS)/../ca
IOSRC = $(CAS)/io/bsdSocket
OSSRC = $(CAS)/os/posix
VPATH = $(SRC) $(IOSRC) $(OSSRC)
include $(TOP)/config/CONFIG_BASE
CXXCMPLR = STRICT
USR_INCLUDES = -I$(SRC) -I$(OSSRC) -I$(IOSRC) -I$(CA) \
-I$(TOP)/src/include/os/$(T_A)
DEPLIBS_BASE = $(EPICS_BASE_LIB)
SRCS.cc += $(SRC)/caServer.cc
SRCS.cc += $(SRC)/caServerI.cc
SRCS.cc += $(SRC)/casCoreClient.cc
SRCS.cc += $(SRC)/casClient.cc
SRCS.cc += $(SRC)/casDGClient.cc
SRCS.cc += $(SRC)/casStrmClient.cc
SRCS.cc += $(SRC)/casPV.cc
SRCS.cc += $(SRC)/casPVI.cc
SRCS.cc += $(SRC)/casChannel.cc
SRCS.cc += $(SRC)/casChannelI.cc
SRCS.cc += $(SRC)/casClientMon.cc
SRCS.cc += $(SRC)/casChanDelEv.cc
SRCS.cc += $(SRC)/casMsgIO.cc
SRCS.cc += $(SRC)/casAsyncIO.cc
SRCS.cc += $(SRC)/casAsyncIOI.cc
SRCS.cc += $(SRC)/casEventSys.cc
SRCS.cc += $(SRC)/casMonitor.cc
SRCS.cc += $(SRC)/casMonEvent.cc
SRCS.cc += $(SRC)/outBuf.cc
SRCS.cc += $(SRC)/inBuf.cc
SRCS.cc += $(SRC)/casEventMask.cc
SRCS.cc += $(OSSRC)/caServerOS.cc
SRCS.cc += $(OSSRC)/casDGOS.cc
SRCS.cc += $(OSSRC)/casStreamOS.cc
SRCS.cc += $(IOSRC)/caServerIO.cc
SRCS.cc += $(IOSRC)/casDGIO.cc
SRCS.cc += $(IOSRC)/casStreamIO.cc
SRCS.c += $(IOSRC)/sigPipeIgnore.c
LIBOBJS += caServer.o
LIBOBJS += caServerI.o
LIBOBJS += casCoreClient.o
LIBOBJS += casClient.o
LIBOBJS += casDGClient.o
LIBOBJS += casStrmClient.o
LIBOBJS += casPV.o
LIBOBJS += casPVI.o
LIBOBJS += casChannel.o
LIBOBJS += casChannelI.o
LIBOBJS += casClientMon.o
LIBOBJS += casChanDelEv.o
LIBOBJS += casMsgIO.o
LIBOBJS += casAsyncIO.o
LIBOBJS += casAsyncIOI.o
LIBOBJS += casEventSys.o
LIBOBJS += casMonitor.o
LIBOBJS += casMonEvent.o
LIBOBJS += outBuf.o
LIBOBJS += inBuf.o
LIBOBJS += casEventMask.o
LIBOBJS += caServerOS.o
LIBOBJS += casDGOS.o
LIBOBJS += casStreamOS.o
LIBOBJS += caServerIO.o
LIBOBJS += casDGIO.o
LIBOBJS += casStreamIO.o
LIBOBJS += sigPipeIgnore.o
LIBNAME = libcas.a
include $(TOP)/config/RULES.Unix
obj: $(LIBOBJS)
clean::
@$(RM) -rf Templates.DB

View File

@@ -3,5 +3,8 @@ TOP=../../..
include $(TOP)/config/CONFIG_BASE
include $(TOP)/config/RULES_ARCHS
DIRS = simple
include $(TOP)/config/RULES_DIRS

View File

@@ -1,91 +0,0 @@
CAS = ../..
TOP = $(CAS)/../..
include $(TOP)/config/CONFIG_BASE
CXXCMPLR = STRICT
USR_INCLUDES =
USR_LDLIBS = -lcas -lca -lCom -lgdd
USR_LDFLAGS =
DEPLIBS_BASE = $(EPICS_BASE_LIB)
DEPLIBSWOCAS = $(DEPLIBS_BASE)/libca.a $(DEPLIBS_BASE)/libCom.a \
$(DEPLIBS_BASE)/libgdd.a
DEPLIBS = $(DEPLIBS_BASE)/libcas.a $(DEPLIBSWOCAS)
SRCS.cc += ../main.cc
SRCS.cc += ../exServer.cc
SRCS.cc += ../exPV.cc
SRCS.cc += ../exSyncPV.cc
SRCS.cc += ../exAsyncPV.cc
SRCS.cc += ../exChannel.cc
OBJS += main.o
OBJS += exServer.o
OBJS += exPV.o
OBJS += exSyncPV.o
OBJS += exAsyncPV.o
OBJS += exChannel.o
PROD += excas
BUILDDIR = $(CAS)/build/singleThread/O.sun4/
GLOMBOBJ += $(BUILDDIR)caServer.o
GLOMBOBJ += $(BUILDDIR)caServerI.o
GLOMBOBJ += $(BUILDDIR)casCoreClient.o
GLOMBOBJ += $(BUILDDIR)casClient.o
GLOMBOBJ += $(BUILDDIR)casDGClient.o
GLOMBOBJ += $(BUILDDIR)casStrmClient.o
GLOMBOBJ += $(BUILDDIR)casPV.o
GLOMBOBJ += $(BUILDDIR)casPVI.o
GLOMBOBJ += $(BUILDDIR)casChannel.o
GLOMBOBJ += $(BUILDDIR)casChannelI.o
GLOMBOBJ += $(BUILDDIR)casClientMon.o
GLOMBOBJ += $(BUILDDIR)casChanDelEv.o
GLOMBOBJ += $(BUILDDIR)casMsgIO.o
GLOMBOBJ += $(BUILDDIR)casAsyncIO.o
GLOMBOBJ += $(BUILDDIR)casAsyncIOI.o
GLOMBOBJ += $(BUILDDIR)casEventSys.o
GLOMBOBJ += $(BUILDDIR)casMonitor.o
GLOMBOBJ += $(BUILDDIR)casMonEvent.o
GLOMBOBJ += $(BUILDDIR)outBuf.o
GLOMBOBJ += $(BUILDDIR)inBuf.o
GLOMBOBJ += $(BUILDDIR)casEventMask.o
GLOMBOBJ += $(BUILDDIR)caServerOS.o
GLOMBOBJ += $(BUILDDIR)casDGOS.o
GLOMBOBJ += $(BUILDDIR)casStreamOS.o
GLOMBOBJ += $(BUILDDIR)caServerIO.o
GLOMBOBJ += $(BUILDDIR)casDGIO.o
GLOMBOBJ += $(BUILDDIR)casStreamIO.o
GLOMBOBJ += $(BUILDDIR)sigPipeIgnore.o
include $(TOP)/config/RULES.Unix
excas: $(OBJS) $(DEPLIBS)
$(LINK.cc) -o $@ $(OBJS) $(LDFLAGS) $(LDLIBS)
#
# fast link (without waiting for library build)
#
nolib: $(OBJS) $(GLOMBOBJ) $(DEPLIBSWOCAS)
$(LINK.cc) -o $@ $(OBJS) $(GLOMBOBJ) $(DEPLIBSWOCAS)
#
# build with purify
#
purify: $(OBJS) $(GLOMBOBJ) $(DEPLIBSWOCAS)
$(PURIFY) -best-effort $(LINK.cc) -o $@ $(OBJS) $(GLOMBOBJ) $(DEPLIBSWOCAS)
clean::
@$(RM) excas
@$(RM) nolib
@$(RM) purify
@$(RM) -rf Templates.DB
@$(RM) core

5
src/cas/example/README Normal file
View File

@@ -0,0 +1,5 @@
This directory contains several server tool examples (which
use the ca server library). The original ca server example
is in the "simple" subdirectory.

View File

@@ -1,38 +0,0 @@
//
// Example EPICS CA server
//
#include <exServer.h>
//
// exSyncPV::exSyncPV()
//
exSyncPV::exSyncPV (const casCtx &ctxIn, const pvInfo &setup) :
exPV (ctxIn, setup)
{
}
//
// exSyncPV::~exSyncPV()
//
exSyncPV::~exSyncPV()
{
}
//
// exSyncPV::write()
//
caStatus exSyncPV::write (const casCtx &, gdd &valueIn)
{
return this->update (valueIn);
}
//
// exSyncPV::read()
//
caStatus exSyncPV::read (const casCtx &, gdd &protoIn)
{
return exServer::read(*this, protoIn);
}

View File

@@ -0,0 +1,7 @@
TOP=../../../..
include $(TOP)/config/CONFIG_BASE
include $(TOP)/config/RULES_ARCHS

View File

@@ -0,0 +1,30 @@
CAS = ../../..
TOP = $(CAS)/../..
include $(TOP)/config/CONFIG_BASE
CXXCMPLR = STRICT
PROD_LIBS := cas ca gdd Com
SRCS += main.cc
SRCS += exServer.cc
SRCS += exPV.cc
SRCS += exVectorPV.cc
SRCS += exScalarPV.cc
SRCS += exAsyncPV.cc
SRCS += exChannel.cc
SRCS += templInst.cc
PROD := excas
include $(TOP)/config/RULES.Host
clean::
@$(RM) excas
@$(RM) fexcas
@$(RM) pexcas
@$(RM) -rf Templates.DB
@$(RM) core

View File

@@ -0,0 +1,38 @@
CAS = ../../..
TOP = $(CAS)/../..
include $(TOP)/config/CONFIG_BASE
CXXCMPLR = STRICT
USR_INCLUDES =
USR_LDFLAGS =
DEPLIBS_BASE = $(EPICS_BASE_LIB)
DEPLIBS = $(DEPLIBS_BASE)/libcas.a $(DEPLIBSWOCAS)
SRCS.cc += ../vxEntry.cc
SRCS.cc += ../exServer.cc
SRCS.cc += ../exPV.cc
SRCS.cc += ../exSyncPV.cc
SRCS.cc += ../exAsyncPV.cc
SRCS.cc += ../exChannel.cc
LIBOBJS += vxEntry.o
LIBOBJS += exServer.o
LIBOBJS += exPV.o
LIBOBJS += exSyncPV.o
LIBOBJS += exAsyncPV.o
LIBOBJS += exChannel.o
LIBNAME = libexserver.o
include $(TOP)/config/RULES.Vx
excas: $(OBJS) $(DEPLIBS)
$(LINK.cc) -o $@ $(OBJS) $(LDFLAGS) $(LDLIBS)
clean::
@$(RM) -rf Templates.DB
@$(RM) core

View File

@@ -0,0 +1,13 @@
This directory contains an example ca server. The example server
exports 4 process variables (PVs): "fred", "freddy", "jane", and
"janet". "fred" and "jane" are synchronous PVs. "freddy" and "janet"
are asynchronous. Many ca servers will find that synchronous
variables will meet there needs and therefore will not require
the increased complexity associated with asynchronous PVs. The PVs in
the example server are updated periodically. Some random "noise"
is added to each PVs current value each time that it is updated.
The example server does not so far implement enumerated data types.

View File

@@ -1,6 +1,7 @@
//
// Example EPICS CA server
// (asynchrronous process variable)
//
#include <exServer.h>
@@ -20,7 +21,7 @@ unsigned exAsyncPV::maxSimultAsyncOps () const
//
caStatus exAsyncPV::read (const casCtx &ctx, gdd &valueIn)
{
exAsyncIO *pIO;
exAsyncReadIO *pIO;
pIO = new exAsyncReadIO(ctx, *this, valueIn);
if (!pIO) {
@@ -36,7 +37,7 @@ caStatus exAsyncPV::read (const casCtx &ctx, gdd &valueIn)
//
caStatus exAsyncPV::write (const casCtx &ctx, gdd &valueIn)
{
exAsyncIO *pIO;
exAsyncWriteIO *pIO;
pIO = new exAsyncWriteIO(ctx, *this, valueIn);
if (!pIO) {
@@ -53,11 +54,18 @@ caStatus exAsyncPV::write (const casCtx &ctx, gdd &valueIn)
void exAsyncWriteIO::expire()
{
caStatus status;
status = this->pv.update(*this->getValuePtr());
this->clrValue();
status = this->pv.update(this->value);
this->postIOCompletion (status);
}
//
// exAsyncWriteIO::name()
//
const char *exAsyncWriteIO::name() const
{
return "exAsyncWriteIO";
}
//
// exAsyncReadIO::expire()
// (a virtual function that runs when the base timer expires)
@@ -65,17 +73,24 @@ void exAsyncWriteIO::expire()
void exAsyncReadIO::expire()
{
caStatus status;
gdd *pValue = this->getValuePtr();
//
// map between the prototype in and the
// current value
//
status = exServer::read(this->pv, *pValue);
status = exServer::read(this->pv, this->proto);
//
// post IO completion
//
this->postIOCompletion(status);
this->postIOCompletion(status, this->proto);
}
//
// exAsyncReadIO::name()
//
const char *exAsyncReadIO::name() const
{
return "exAsyncReadIO";
}

View File

@@ -5,8 +5,6 @@
#include <exServer.h>
#include <gddApps.h>
const double myPI = 3.14159265358979323846;
osiTime exPV::currentTime;
//
@@ -20,9 +18,9 @@ exPV::exPV (const casCtx &ctxIn, const pvInfo &setup) :
interest(aitFalse)
{
//
// load initial value
// no dataless PV allowed
//
this->scanPV();
assert (this->info.getElementCount()>=1u);
}
//
@@ -41,55 +39,46 @@ exPV::~exPV()
}
//
// exPV::scanPV();
// exPV::update()
//
void exPV::scanPV()
caStatus exPV::update(gdd &valueIn)
{
caStatus status;
double radians;
gdd *pDD;
float newValue;
float limit;
caServer *pCAS = this->getCAS();
caServer *pCAS = this->getCAS();
//
// gettimeofday() is very slow under sunos4
//
osiTime cur (this->currentTime);
struct timespec t;
caStatus cas;
if (!pCAS) {
return S_casApp_noSupport;
}
# if DEBUG
printf("Setting %s too:\n", this->info.getName().string());
valueIn.dump();
# endif
if (!pCAS) {
return;
cas = this->updateValue (valueIn);
if (cas || !this->pValue) {
return cas;
}
cur.get (t.tv_sec, t.tv_nsec);
this->pValue->setTimeStamp(&t);
this->pValue->setStat (epicsAlarmNone);
this->pValue->setSevr (epicsSevNone);
//
// update current time (so we are not required to do
// this every time that we write the PV which impacts
// throughput under sunos4 because gettimeofday() is
// slow)
// post a value change event
//
this->currentTime = osiTime::getCurrent();
pDD = new gddScalar (gddAppType_value, aitEnumFloat32);
if (!pDD) {
return;
}
radians = (rand () * 2.0 * myPI)/RAND_MAX;
if (this->pValue) {
this->pValue->getConvert(newValue);
}
else {
newValue = 0.0f;
}
newValue += (float) (sin (radians) / 10.0);
limit = (float) this->info.getHopr();
newValue = min (newValue, limit);
limit = (float) this->info.getLopr();
newValue = max (newValue, limit);
*pDD = newValue;
pDD->setStat (epicsAlarmNone);
pDD->setSevr (epicsSevNone);
status = this->update (*pDD);
if (status) {
errMessage (status, "scan update failed\n");
}
pDD->unreference();
if (this->interest==aitTrue) {
casEventMask select(pCAS->valueEventMask|pCAS->logEventMask);
this->postEvent (select, *this->pValue);
}
return S_casApp_success;
}
//
@@ -97,13 +86,13 @@ void exPV::scanPV()
//
void exScanTimer::expire ()
{
pv.scanPV();
pv.scan();
}
//
// exScanTimer::again()
//
osiBool exScanTimer::again()
osiBool exScanTimer::again() const
{
return osiTrue;
}
@@ -111,85 +100,23 @@ osiBool exScanTimer::again()
//
// exScanTimer::delay()
//
const osiTime exScanTimer::delay()
const osiTime exScanTimer::delay() const
{
return pv.getScanRate();
}
//
// exPV::update ()
// exScanTimer::name()
//
caStatus exPV::update(gdd &valueIn)
const char *exScanTimer::name() const
{
gdd *pNewValue;
caServer *pCAS = this->getCAS();
//
// gettimeofday() is very slow under sunos4
//
osiTime cur (this->currentTime);
struct timespec t;
gddStatus gdds;
if (!pCAS) {
return S_casApp_noSupport;
}
# if DEBUG
printf("%s = %f\n",
this->info.getName().string, valueIn);
# endif
if (valueIn.isScalar()) {
pNewValue = &valueIn;
pNewValue->reference();
}
else {
//
// this does not modify the current value
// (because it may be referenced in the event queue)
//
pNewValue = new gddScalar (gddAppType_value, aitEnumFloat32);
if (!pNewValue) {
return S_casApp_noMemory;
}
gdds = gddApplicationTypeTable::
app_table.smartCopy(pNewValue, &valueIn);
if (gdds) {
pNewValue->unreference();
return S_cas_noConvert;
}
pNewValue->setStat (epicsAlarmNone);
pNewValue->setSevr (epicsSevNone);
}
cur.get (t.tv_sec, t.tv_nsec);
pNewValue->setTimeStamp(&t);
//
// release old value and replace it
// with the new one
//
if (this->pValue) {
this->pValue->unreference();
}
this->pValue = pNewValue;
if (this->interest==aitTrue) {
casEventMask select(pCAS->valueEventMask|pCAS->logEventMask);
this->postEvent (select, *this->pValue);
}
return S_casApp_success;
return "exScanTimer";
}
//
// exPV::bestExternalType()
//
aitEnum exPV::bestExternalType()
aitEnum exPV::bestExternalType() const
{
return aitEnumFloat32;
}
@@ -345,7 +272,7 @@ caStatus exPV::getLowLimit(gdd &value)
//
caStatus exPV::getUnits(gdd &units)
{
static aitString str("@#$%");
static aitString str("furlongs");
units.put(str);
return S_cas_success;
}
@@ -383,3 +310,21 @@ caStatus exPV::getValue(gdd &value)
return status;
}
//
// exPV::write()
// (synchronous default)
//
caStatus exPV::write (const casCtx &, gdd &valueIn)
{
return this->update (valueIn);
}
//
// exPV::read()
// (synchronous default)
//
caStatus exPV::read (const casCtx &, gdd &protoIn)
{
return exServer::read(*this, protoIn);
}

View File

@@ -0,0 +1,103 @@
#include <exServer.h>
#include <gddApps.h>
#include <math.h>
#include <limits.h>
#include <stdlib.h>
#define myPI 3.14159265358979323846
//
// SUN C++ does not have RAND_MAX yet
//
#if !defined(RAND_MAX)
//
// Apparently SUN C++ is using the SYSV version of rand
//
#if 0
#define RAND_MAX INT_MAX
#else
#define RAND_MAX SHRT_MAX
#endif
#endif
//
// exScalarPV::scan
//
void exScalarPV::scan()
{
caStatus status;
double radians;
gdd *pDD;
float newValue;
float limit;
//
// update current time (so we are not required to do
// this every time that we write the PV which impacts
// throughput under sunos4 because gettimeofday() is
// slow)
//
this->currentTime = osiTime::getCurrent();
pDD = new gddScalar (gddAppType_value, aitEnumFloat32);
if (!pDD) {
return;
}
radians = (rand () * 2.0 * myPI)/RAND_MAX;
if (this->pValue) {
this->pValue->getConvert(newValue);
}
else {
newValue = 0.0f;
}
newValue += (float) (sin (radians) / 10.0);
limit = (float) this->info.getHopr();
newValue = min (newValue, limit);
limit = (float) this->info.getLopr();
newValue = max (newValue, limit);
*pDD = newValue;
status = this->update (*pDD);
if (status) {
errMessage (status, "scan update failed\n");
}
pDD->unreference();
}
//
// exScalarPV::updateValue ()
//
// NOTES:
// 1) This should have a test which verifies that the
// incoming value in all of its various data types can
// be translated into a real number?
// 2) We prefer to unreference the old PV value here and
// reference the incomming value because this will
// result in each value change events retaining an
// independent value on the event queue.
//
caStatus exScalarPV::updateValue (gdd &valueIn)
{
//
// Really no need to perform this check since the
// server lib verifies that all requests are in range
//
if (!valueIn.isScalar()) {
return S_casApp_outOfBounds;
}
//
// release old value and replace it
// with the new one
//
if (this->pValue) {
this->pValue->unreference();
}
valueIn.reference();
this->pValue = &valueIn;
return S_casApp_success;
}

View File

@@ -10,10 +10,12 @@
#include <exServer.h>
const pvInfo exServer::pvList[] = {
pvInfo (1.0e-1, "jane", 10.0f, 0.0f, excasIoSync),
pvInfo (2.0, "fred", 10.0f, -10.0f, excasIoSync),
pvInfo (1.0e-1, "janet", 10.0f, 0.0f, excasIoAsync),
pvInfo (2.0, "freddy", 10.0f, -10.0f, excasIoAsync)
pvInfo (1.0e-1, "jane", 10.0f, 0.0f, excasIoSync, 1u),
pvInfo (2.0, "fred", 10.0f, -10.0f, excasIoSync, 1u),
pvInfo (1.0e-1, "janet", 10.0f, 0.0f, excasIoAsync, 1u),
pvInfo (2.0, "freddy", 10.0f, -10.0f, excasIoAsync, 1u),
pvInfo (2.0, "alan", 10.0f, -10.0f, excasIoSync, 100u),
pvInfo (20.0, "albert", 10.0f, -10.0f, excasIoSync, 1000u)
};
//
@@ -49,8 +51,7 @@ exServer::exServer(unsigned pvMaxNameLength, unsigned pvCountEstimate,
//
// exServer::pvExistTest()
//
caStatus exServer::pvExistTest(const casCtx &ctxIn, const char *pPVName,
gdd &canonicalPVName)
pvExistReturn exServer::pvExistTest(const casCtx &ctxIn, const char *pPVName)
{
const pvInfo *pPVI;
@@ -58,24 +59,20 @@ caStatus exServer::pvExistTest(const casCtx &ctxIn, const char *pPVName,
if (pPVI) {
if (pPVI->getIOType()==excasIoAsync) {
exAsyncExistIO *pIO;
pIO = new exAsyncExistIO(pPVI, ctxIn, canonicalPVName);
pIO = new exAsyncExistIO(*pPVI, ctxIn);
if (pIO) {
return S_casApp_asyncCompletion;
return pvExistReturn(S_casApp_asyncCompletion);
}
else {
return S_casApp_noMemory;
return pvExistReturn(S_casApp_noMemory);
}
}
//
// there are no name aliases in this
// server's PV name syntax
//
canonicalPVName.put (pPVI->getName());
return S_casApp_success;
const char *pName = pPVI->getName();
return pvExistReturn(S_casApp_success, pName);
}
return S_casApp_pvNotFound;
return pvExistReturn(S_casApp_pvNotFound);
}
//
@@ -101,24 +98,49 @@ const pvInfo *exServer::findPV(const char *pName)
casPV *exServer::createPV (const casCtx &ctxIn, const char *pPVName)
{
const pvInfo *pInfo;
exPV *pPV;
pInfo = exServer::findPV(pPVName);
if (!pInfo) {
return NULL;
}
switch (pInfo->getIOType()){
case excasIoSync:
return new exSyncPV (ctxIn, *pInfo);
case excasIoAsync:
return new exAsyncPV (ctxIn, *pInfo);
default:
return NULL;
//
// create an instance of the appropriate class
// depending on the io type and the number
// of elements
//
if (pInfo->getElementCount()==1u) {
switch (pInfo->getIOType()){
case excasIoSync:
pPV = new exScalarPV (ctxIn, *pInfo);
break;
case excasIoAsync:
pPV = new exAsyncPV (ctxIn, *pInfo);
break;
default:
pPV = NULL;
break;
}
}
else {
pPV = new exVectorPV (ctxIn, *pInfo);
}
//
// load initial value (this is not done in
// the constructor because the base class's
// pure virtual function would be called)
//
if (pPV) {
pPV->scan();
}
return pPV;
}
//
// exServer::createPV()
// exServer::show()
//
void exServer::show (unsigned level)
{
@@ -138,7 +160,7 @@ void exServer::show (unsigned level)
// destroy so the exAsyncIO class will hang around until the
// casAsyncIO::destroy() is called
//
void exAsyncIOTimer::destroy()
void exOSITimer::destroy()
{
}
@@ -148,9 +170,19 @@ void exAsyncIOTimer::destroy()
//
void exAsyncExistIO::expire()
{
const char *pName = pvi.getName();
//
// post IO completion
//
this->postIOCompletion(S_cas_success);
this->postIOCompletion (pvExistReturn(S_cas_success, pName));
}
//
// exAsyncExistIO::name()
//
const char *exAsyncExistIO::name() const
{
return "exAsyncExistIO";
}

View File

@@ -1,29 +1,27 @@
//
// Example EPICS CA server
// Example EPICS CA server
//
//
// caServer
// |
// exServer
//
// casPV
// |
// exPV-------------
// | |
// exScalarPV exVectorPV
// |
// exAsyncPV
//
//
//
// ANSI C
//
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <limits.h>
//
// SUN C++ does not have RAND_MAX yet
//
#if !defined(RAND_MAX)
//
// Apparently SUN C++ is using the SYSV version of rand
//
#if 0
#define RAND_MAX INT_MAX
#else
#define RAND_MAX SHRT_MAX
#endif
#endif
//
// EPICS
@@ -56,20 +54,20 @@ class pvInfo {
public:
pvInfo (double scanRateIn, const char *pName,
aitFloat32 hoprIn, aitFloat32 loprIn,
excasIoType ioTypeIn) :
excasIoType ioTypeIn, unsigned countIn) :
scanRate(scanRateIn), name(pName), hopr(hoprIn),
lopr(loprIn), ioType(ioTypeIn)
lopr(loprIn), ioType(ioTypeIn), elementCount(countIn)
{
}
//
// for use when MSVC++ will not build a defualt copy constructor
// for use when MSVC++ will not build a default copy constructor
// for this class
//
pvInfo (const pvInfo &copyIn) :
scanRate(copyIn.scanRate), name(copyIn.name),
hopr(copyIn.hopr), lopr(copyIn.lopr),
ioType(copyIn.ioType)
ioType(copyIn.ioType), elementCount(copyIn.elementCount)
{
}
@@ -78,12 +76,14 @@ public:
const double getHopr () const { return this->hopr; }
const double getLopr () const { return this->lopr; }
const excasIoType getIOType () const { return this->ioType; }
const unsigned getElementCount() const { return this->elementCount; }
private:
const double scanRate;
const aitString name;
const double hopr;
const double lopr;
const excasIoType ioType;
const unsigned elementCount;
};
class exPV;
@@ -97,12 +97,9 @@ public:
exScanTimer (double delayIn, exPV &pvIn) :
pv(pvIn), osiTimer(delayIn) {}
void expire ();
osiBool again();
const osiTime delay();
const char *name()
{
return "exScanTimer";
}
osiBool again() const;
const osiTime delay() const;
const char *name() const;
private:
exPV &pv;
};
@@ -116,8 +113,6 @@ public:
exPV (const casCtx &ctxIn, const pvInfo &setup);
virtual ~exPV();
void scanPV();
void show(unsigned level);
//
@@ -133,7 +128,7 @@ public:
//
void interestDelete();
aitEnum bestExternalType();
aitEnum bestExternalType() const;
//
// chCreate() is called each time that a PV is attached to
@@ -146,8 +141,16 @@ public:
//
//casChannel *createChannel ();
//
// This gets called when the pv gets a new value
//
caStatus update (gdd &value);
//
// Gets called when we add noise to the current value
//
virtual void scan() = 0;
//
// Std PV Attribute fetch support
//
@@ -171,13 +174,47 @@ public:
{
return this->info.getScanRate();
}
caStatus read (const casCtx &, gdd &protoIn);
caStatus write (const casCtx &, gdd &protoIn);
protected:
gdd *pValue;
exScanTimer *pScanTimer;
const pvInfo & info;
aitBool interest;
private:
static osiTime currentTime;
virtual caStatus updateValue (gdd &value) = 0;
};
//
// exScalerPV
//
class exScalarPV : public exPV {
public:
exScalarPV (const casCtx &ctxIn, const pvInfo &setup) :
exPV (ctxIn, setup) {}
void scan();
private:
caStatus updateValue (gdd &value);
};
//
// exVectorPV
//
class exVectorPV : public exPV {
public:
exVectorPV (const casCtx &ctxIn, const pvInfo &setup) :
exPV (ctxIn, setup) {}
void scan();
unsigned maxDimension() const;
aitIndex maxBound (unsigned dimension) const;
private:
caStatus updateValue (gdd &value);
};
//
@@ -188,8 +225,7 @@ public:
exServer(unsigned pvMaxNameLength, unsigned pvCountEstimate=0x3ff,
unsigned maxSimultaneousIO=1u);
void show (unsigned level);
caStatus pvExistTest (const casCtx &ctxIn, const char *pPVName,
gdd &canonicalPVName);
pvExistReturn pvExistTest (const casCtx &ctxIn, const char *pPVName);
casPV *createPV (const casCtx &ctxIn, const char *pPVName);
static const pvInfo *findPV(const char *pName);
@@ -203,37 +239,16 @@ private:
static gddAppFuncTable<exPV> ft;
};
//
// exSyncPV
//
class exSyncPV : public exPV {
public:
exSyncPV (const casCtx &ctxIn, const pvInfo &setup);
~exSyncPV();
//
// read
//
caStatus read(const casCtx &ctxIn, gdd &value);
//
// write
//
caStatus write(const casCtx &ctxIn, gdd &value);
private:
};
//
// exAsyncPV
// (asychronous PV)
//
class exAsyncPV : public exPV {
class exAsyncPV : public exScalarPV {
public:
//
// exAsyncPV()
//
exAsyncPV (const casCtx &ctxIn, const pvInfo &setup) :
exPV (ctxIn, setup) {}
exAsyncPV (const casCtx &ctxIn, const pvInfo &setup) :
exScalarPV (ctxIn, setup) {}
//
// read
@@ -281,46 +296,44 @@ public:
private:
};
//
// exAsyncIOTimer
// exOSITimer
//
class exAsyncIOTimer : public osiTimer {
// a special version of osiTimer which is only to be used
// within an exAsyncIO. The destroy() method is replaced
// so that the timer destroy() will not destroy the
// exAsyncIO until the casAsyncIO has completed
//
class exOSITimer : public osiTimer {
public:
exAsyncIOTimer (osiTime delayIn) : osiTimer(delayIn) {}
exOSITimer() : osiTimer(osiTime(0.010)) {} // 10 mSec
//
// this is a noop that postpones the timer expiration
// destroy so this object will hang around until the
// casAsyncIO::destroy() is called
//
void destroy();
const char *name()
{
return "exAsyncIOTimer";
}
};
//
// exAsyncIO()
//
class exAsyncIO : public casAsyncIO, public exAsyncIOTimer {
public:
exAsyncIO(const casCtx &ctxIn, gdd *pValue = 0) :
casAsyncIO(ctxIn, pValue),
exAsyncIOTimer(osiTime(0.010)) {} // 10 mSec
};
//
// exAsyncWriteIO
//
class exAsyncWriteIO : public exAsyncIO {
class exAsyncWriteIO : public casAsyncWriteIO, public exOSITimer {
public:
//
// exAsyncWriteIO()
//
exAsyncWriteIO(const casCtx &ctxIn, exAsyncPV &pvIn, gdd &valueIn) :
exAsyncIO(ctxIn, &valueIn), pv(pvIn) {}
casAsyncWriteIO(ctxIn), pv(pvIn), value(valueIn)
{
this->value.reference();
}
~exAsyncWriteIO()
{
this->value.unreference();
}
//
// expire()
@@ -328,20 +341,32 @@ public:
// see exAsyncPV.cc
//
void expire();
const char *name() const;
private:
exAsyncPV &pv;
gdd &value;
};
//
// exAsyncReadIO
//
class exAsyncReadIO : public exAsyncIO {
class exAsyncReadIO : public casAsyncReadIO, public exOSITimer {
public:
//
// exAsyncReadIO()
//
exAsyncReadIO(const casCtx &ctxIn, exAsyncPV &pvIn, gdd &protoIn) :
exAsyncIO(ctxIn, &protoIn), pv(pvIn) {}
casAsyncReadIO(ctxIn), pv(pvIn), proto(protoIn)
{
this->proto.reference();
}
~exAsyncReadIO()
{
this->proto.unreference();
}
//
// expire()
@@ -350,25 +375,24 @@ public:
//
void expire();
const char *name() const;
private:
exAsyncPV &pv;
gdd &proto;
};
//
// exAsyncExistIO
// (PV exist async IO)
//
class exAsyncExistIO : public exAsyncIO {
class exAsyncExistIO : public casAsyncPVExistIO, public exOSITimer {
public:
//
// exAsyncExistIO()
//
exAsyncExistIO(const pvInfo *pPVI,
const casCtx &ctxIn, gdd &canonicalPVName) :
exAsyncIO(ctxIn, &canonicalPVName)
{
canonicalPVName.put (pPVI->getName());
}
exAsyncExistIO(const pvInfo &pviIn, const casCtx &ctxIn) :
casAsyncPVExistIO(ctxIn), pvi(pviIn) {}
//
// expire()
@@ -376,7 +400,10 @@ public:
// see exServer.cc
//
void expire();
const char *name() const;
private:
const pvInfo &pvi;
};

View File

@@ -0,0 +1,241 @@
#include <exServer.h>
#include <gddApps.h>
#define myPI 3.14159265358979323846
//
// SUN C++ does not have RAND_MAX yet
//
#if !defined(RAND_MAX)
//
// Apparently SUN C++ is using the SYSV version of rand
//
#if 0
#define RAND_MAX INT_MAX
#else
#define RAND_MAX SHRT_MAX
#endif
#endif
//
// exVectorPV::maxDimension()
//
unsigned exVectorPV::maxDimension() const
{
return 1u;
}
//
// exVectorPV::maxBound()
//
aitIndex exVectorPV::maxBound (unsigned dimension) const
{
if (dimension==0u) {
return this->info.getElementCount();
}
else {
return 0u;
}
}
//
// exVectorPV::scan
//
void exVectorPV::scan()
{
caStatus status;
double radians;
gdd *pDD;
aitFloat32 *pF, *pFE, *pCF;
float newValue;
float limit;
//
// update current time (so we are not required to do
// this every time that we write the PV which impacts
// throughput under sunos4 because gettimeofday() is
// slow)
//
this->currentTime = osiTime::getCurrent();
pDD = new gddAtomic (gddAppType_value, aitEnumFloat32,
1u, this->info.getElementCount());
if (pDD==NULL) {
return;
}
//
// allocate array buffer
//
pF = new aitFloat32 [this->info.getElementCount()];
if (!pF) {
pDD->unreference();
}
//
// install the buffer into the DD
// (do this before we increment pF)
//
*pDD = pF;
//
// double check for reasonable bounds on the
// current value
//
pCF=NULL;
if (this->pValue) {
if (this->pValue->dimension()==1u) {
const gddBounds *pB = this->pValue->getBounds();
if (pB[0u].size()==this->info.getElementCount()) {
pCF = *pDD;
}
}
}
pFE = &pF[this->info.getElementCount()];
while (pF<pFE) {
radians = (rand () * 2.0 * myPI)/RAND_MAX;
if (pCF) {
newValue = *pCF++;
}
else {
newValue = 0.0f;
}
newValue += (float) (sin (radians) / 10.0);
limit = (float) this->info.getHopr();
newValue = min (newValue, limit);
limit = (float) this->info.getLopr();
newValue = max (newValue, limit);
*(pF++) = newValue;
}
status = this->update (*pDD);
if (status) {
errMessage (status, "scan update failed\n");
}
pDD->unreference();
}
//
// exVectorPV::updateValue ()
//
// NOTES:
// 1) This should have a test which verifies that the
// incoming value in all of its various data types can
// be translated into a real number?
// 2) We prefer to unreference the old PV value here and
// reference the incomming value because this will
// result in value change events each retaining an
// independent value on the event queue. With large arrays
// this may result in too much memory consumtion on
// the event queue.
//
caStatus exVectorPV::updateValue(gdd &valueIn)
{
enum {replace, dontReplace} replFlag = dontReplace;
gddStatus gdds;
gdd *pNewValue;
//
// Check bounds of incoming request
// (and see if we are replacing all elements -
// replaceOk==TRUE)
//
// Perhaps much of this is unnecessary since the
// server lib checks the bounds of all requests
//
if (valueIn.isAtomic()) {
if (valueIn.dimension()!=1u) {
return S_casApp_badDimension;
}
const gddBounds* pb = valueIn.getBounds();
if (pb[0u].first()!=0u) {
return S_casApp_outOfBounds;
}
if (pb[0u].size()==this->info.getElementCount()) {
replFlag = replace;
}
else if (pb[0u].size()>this->info.getElementCount()) {
return S_casApp_outOfBounds;
}
}
else if (!valueIn.isScalar()) {
//
// no containers
//
return S_casApp_outOfBounds;
}
if (replFlag==replace) {
//
// replacing all elements is efficient
//
valueIn.reference();
pNewValue = &valueIn;
}
else {
aitFloat32 *pF, *pFE;
//
// Create a new array data descriptor
// (so that old values that may be referenced on the
// event queue are not replaced)
//
pNewValue = new gddAtomic (gddAppType_value, aitEnumFloat32,
1u, this->info.getElementCount());
if (pNewValue==NULL) {
return S_casApp_noMemory;
}
//
// copy over the old values if they exist
// (or initialize all elements to zero)
//
if (this->pValue) {
gdds = pNewValue->copy(this->pValue);
if (gdds) {
pNewValue->unreference();
return S_cas_noConvert;
}
}
else {
//
// allocate array buffer
//
pF = new aitFloat32 [this->info.getElementCount()];
if (!pF) {
pNewValue->unreference();
return S_casApp_noMemory;
}
//
// Install (and initialize) array buffer
// if no old values exist
//
pFE = &pF[this->info.getElementCount()];
while (pF<pFE) {
*(pF++) = 0.0;
}
*pNewValue = pF;
}
//
// insert the values that they are writing
//
gdds = pNewValue->put(&valueIn);
if (gdds) {
pNewValue->unreference();
return S_cas_noConvert;
}
}
if (this->pValue) {
this->pValue->unreference();
}
this->pValue = pNewValue;
return S_casApp_success;
}

View File

@@ -4,6 +4,7 @@
//
// main()
// (example single threaded ca server tool main loop)
//
int main (int argc, const char **argv)
{
@@ -14,11 +15,6 @@ int main (int argc, const char **argv)
aitBool forever = aitTrue;
int i;
pCAS = new exServer(32u,5u,500u);
if (!pCAS) {
return (-1);
}
for (i=1; i<argc; i++) {
if (sscanf(argv[i], "-d %u", &debugLevel)==1) {
continue;
@@ -32,6 +28,11 @@ int main (int argc, const char **argv)
return (1);
}
pCAS = new exServer(32u,5u,500u);
if (!pCAS) {
return (-1);
}
pCAS->setDebugLevel(debugLevel);
if (forever) {

View File

@@ -0,0 +1,26 @@
//
// $Id$
//
// Explcit instantiation of template instances used by the
// example server
//
//
#include "exServer.h"
#include "gddAppFuncTable.cc"
//
// Sun C++ 4.1 still appears to be lacking support in this area
//
#if !defined(__SUNPRO_CC)
//
// From Stroustrups's "The C++ Programming Language"
// Appendix A: r.14.9
//
// This explicitly instantiates the template class's
// member functions into "templInst.o"
//
template class gddAppFuncTable <exPV>;
#endif

View File

@@ -4,7 +4,7 @@ file {
display {
magic="305419896"
majv="2"
mnrv="2"
mnrv="4"
ndyng="0"
npc="5"
nstr="8"
@@ -41,8 +41,6 @@ display {
width="0"
clrmod="static"
vismod="static"
RISC_pad1="0"
RISC_pad2="0"
clrrule="alarm"
pv=""
cmap=""
@@ -320,7 +318,7 @@ display {
rulecolorfg="0"
hdl="0"
ldl="0"
prec="0"
prec="-1"
newunits=""
units="none"
decorate="none"
@@ -366,7 +364,7 @@ display {
rulecolorfg="0"
hdl="0"
ldl="0"
prec="0"
prec="-1"
newunits=""
units="append"
decorate="none"
@@ -388,7 +386,7 @@ display {
chan="fred"
clr="0"
bclr="1"
label="none"
label="limits"
clrmod="static"
rulechan[0] = ""
rulechan[1] = ""
@@ -412,7 +410,7 @@ display {
rulecolorfg="0"
hdl="0"
ldl="0"
prec="0"
prec="-1"
newunits=""
units="none"
decorate="none"
@@ -460,7 +458,7 @@ display {
rulecolorfg="0"
hdl="0"
ldl="0"
prec="0"
prec="-1"
newunits=""
units="none"
decorate="none"
@@ -506,7 +504,7 @@ display {
rulecolorfg="0"
hdl="0"
ldl="0"
prec="0"
prec="-1"
newunits=""
units="append"
decorate="none"
@@ -528,7 +526,7 @@ display {
chan="freddy"
clr="0"
bclr="1"
label="none"
label="limits"
clrmod="static"
rulechan[0] = ""
rulechan[1] = ""
@@ -552,7 +550,7 @@ display {
rulecolorfg="0"
hdl="0"
ldl="0"
prec="0"
prec="-1"
newunits=""
units="none"
decorate="none"
@@ -600,7 +598,7 @@ display {
rulecolorfg="0"
hdl="0"
ldl="0"
prec="0"
prec="-1"
newunits=""
units="none"
decorate="none"
@@ -646,7 +644,7 @@ display {
rulecolorfg="0"
hdl="0"
ldl="0"
prec="0"
prec="-1"
newunits=""
units="append"
decorate="none"
@@ -668,7 +666,7 @@ display {
chan="jane"
clr="0"
bclr="1"
label="none"
label="limits"
clrmod="static"
rulechan[0] = ""
rulechan[1] = ""
@@ -692,7 +690,7 @@ display {
rulecolorfg="0"
hdl="0"
ldl="0"
prec="0"
prec="-1"
newunits=""
units="none"
decorate="none"
@@ -740,7 +738,7 @@ display {
rulecolorfg="0"
hdl="0"
ldl="0"
prec="0"
prec="-1"
newunits=""
units="none"
decorate="none"
@@ -786,7 +784,7 @@ display {
rulecolorfg="0"
hdl="0"
ldl="0"
prec="0"
prec="-1"
newunits=""
units="append"
decorate="none"
@@ -808,7 +806,7 @@ display {
chan="janet"
clr="0"
bclr="1"
label="none"
label="limits"
clrmod="static"
rulechan[0] = ""
rulechan[1] = ""
@@ -832,7 +830,7 @@ display {
rulecolorfg="0"
hdl="0"
ldl="0"
prec="0"
prec="-1"
newunits=""
units="none"
decorate="none"

View File

@@ -3,6 +3,9 @@
// Author: Jeff HIll (LANL)
//
// $Log$
// Revision 1.2 1996/09/16 18:22:09 jhill
// added cvs log entries
//
//
#include <exServer.h>

View File

@@ -0,0 +1,9 @@
# $Log$
TOP=../../../..
include $(TOP)/config/CONFIG_BASE
include $(TOP)/config/RULES_ARCHS

View File

@@ -0,0 +1,23 @@
# $Log$
CAS = ../../..
TOP = $(CAS)/../..
include $(TOP)/config/CONFIG_BASE
CXXCMPLR = STRICT
PROD_LIBS := cas ca gdd Com
SRCS += pvServ.cc
PROD :=pvServ
include $(TOP)/config/RULES.Host
clean::
@$(RM) pvServ
@$(RM) -rf Templates.DB
@$(RM) core

View File

@@ -0,0 +1,279 @@
// $Id$
// $Log$
#include <stdio.h>
#include "pvServ.h"
#include "fdManager.h"
#include "gdd.h"
#include "gddAppTable.h"
#include "alarm.h"
static int appValue;
void dBase::eventReady(void)
{
if(counter+1.0 > 100.0)
writeData(0.0);
else
writeData(counter+1.0);
}
void dBase::writeData(double x)
{
counter=x;
time((time_t*)&ts.tv_sec);
if(counter>hihi)
{ sevr=MAJOR_ALARM; stat=HIHI_ALARM; }
else if(counter<lolo)
{ sevr=MAJOR_ALARM; stat=LOLO_ALARM; }
else if(counter>high)
{ sevr=MINOR_ALARM; stat=HIGH_ALARM; }
else if(counter<low)
{ sevr=MINOR_ALARM; stat=LOW_ALARM; }
else
{ sevr=NO_ALARM; stat=0; }
if(node) node->eventReady();
}
int main(int argc, char* argv[])
{
gddApplicationTypeTable& table=gddApplicationTypeTable::AppTable();
int rc;
int total_pv;
double rate;
serv* server;
char* name;
if(argc<3)
{
fprintf(stderr,"Usage %s pv_total monitor_rate optional_pv_prefix\n",
argv[0]);
fprintf(stderr," pv_total is the number of PVs to generate (int)\n");
fprintf(stderr," monitor_rate is events per second (float)\n");
fprintf(stderr," optional_pv_prefix defaults to your login name\n");
fprintf(stderr,"\n");
fprintf(stderr," PVs are named <PREFIX>_#\n");
fprintf(stderr," where # is an integer is the range [0,pv_total)\n");
return -1;
}
if(sscanf(argv[1],"%d",&total_pv)!=1)
{
fprintf(stderr,"Failed to convert pv_total argument to number\n");
return -1;
}
if(sscanf(argv[2],"%lf",&rate)!=1)
{
fprintf(stderr,"Failed to convert monitor_rate argument to number\n");
return -1;
}
if(argc<=4)
name=argv[3];
else
name=NULL;
appValue=table.getApplicationType("value");
Debug3("total=%d,rate=%lf,prefix=%s\n",total_pv,rate,name);
server = new serv(total_pv,rate,name,40u,total_pv,total_pv);
rc=server->Main();
delete server;
return rc;
}
int serv::InitDB(void)
{
unsigned i;
db_sync=new dBase[pv_total];
for(i=0;i<pv_total;i++)
sprintf(db_sync[i].pvname,"%s_%d",prefix,i);
return 0;
}
int serv::Main(void)
{
unsigned i;
int not_done=1;
double inv=(1.0/event_rate);
double num=(unsigned long)inv;
double fract=inv-num;
unsigned long lfract=fract?(unsigned long)(1.0/fract):0;
unsigned long nsec = lfract?1000000000u/lfract:0;
unsigned long sec = (unsigned long)num;
struct timeval tv_curr,tv_prev;
osiTime delay(sec,nsec);
tv_prev.tv_sec=0;
tv_prev.tv_usec=0;
Debug2("Update every sec=%lu nsec=%lu\n",sec,nsec);
while(not_done)
{
fileDescriptorManager.process(delay);
gettimeofday(&tv_curr,NULL);
if(tv_curr.tv_sec-tv_prev.tv_sec >= sec &&
tv_curr.tv_usec-tv_prev.tv_usec >= (nsec/1000))
{
for(i=0;i<pv_total;i++)
db_sync[i].eventReady();
}
tv_prev=tv_curr;
}
return 0;
}
// ------------------------- server stuff ----------------------------
serv::serv(int tot,double rate,char* name,
unsigned max_name_len,unsigned pv_count_est,unsigned max_sim_io):
caServer(max_name_len, pv_count_est, max_sim_io),
db_sync(NULL),pv_total(tot),event_rate(rate),prefix(name)
{
event_mask|=(alarmEventMask|valueEventMask|logEventMask);
if(name)
prefix=name;
else if((prefix=getenv("LOGNAME"))==NULL)
prefix="noname";
prefix_len=strlen(prefix);
InitDB();
}
serv::~serv(void)
{
delete [] db_sync;
}
pvExistReturn serv::pvExistTest(const casCtx&,const char* pvname)
{
int val;
dBase* node=NULL;
caStatus rc=S_casApp_pvNotFound;
if(strncmp(pvname,prefix,prefix_len)==0)
{
// we may have this one, number is after underscore
if(sscanf(&pvname[prefix_len+1],"%d",&val)==1)
{
if(val>=0 && val<pv_total)
{
Debug("ExistTest: I have this PV\n");
node=&db_sync[val];
rc=S_casApp_success;
}
}
}
return (rc==S_casApp_success)?pvExistReturn(rc,node->pvname):
pvExistReturn(rc);
}
casPV* serv::createPV(const casCtx& in,const char* pvname)
{
casPV* rc=NULL;
int val;
Debug1("createPV: %s\n",pvname);
if(strncmp(pvname,prefix,prefix_len)==0)
{
// we may have this one, number is after underscore
if(sscanf(&pvname[prefix_len+1],"%d",&val)==1)
{
Debug("createPV: I am making this PV\n");
if(val>=0 && val<pv_total)
rc=new servPV(in,*this,pvname,db_sync[val]);
}
}
return rc;
}
// -----------------------PV stuff -------------------------------
servPV::servPV(const casCtx& c,serv& m,const char* n,dBase& x):
casPV(c,n),db(x),mgr(m),monitored(0)
{
db.node=this;
value=new gddScalar(appValue,aitEnumFloat64);
}
servPV::~servPV(void)
{
value->unreference();
db.node=NULL;
}
unsigned servPV::maxSimultAsyncOps(void) const { return 100000u; }
caStatus servPV::interestRegister()
{
if(!monitored) monitored=1;
return S_casApp_success;
}
void servPV::interestDelete()
{
if(monitored) monitored=0;
}
aitEnum servPV::bestExternalType() const
{
return aitEnumFloat64;
}
caStatus servPV::read(const casCtx&, gdd &dd)
{
Debug1("read: %s\n",db.pvname);
gddApplicationTypeTable& table=gddApplicationTypeTable::AppTable();
// this is a cheesy way to do this
value->put(db.counter);
value->setStatSevr(db.stat,db.sevr);
value->setTimeStamp(&db.ts);
table.smartCopy(&dd,value);
return S_casApp_success;
}
caStatus servPV::write(const casCtx&, gdd &dd)
{
Debug1("write: %s\n",db.pvname);
gddApplicationTypeTable& table=gddApplicationTypeTable::AppTable();
// this is also cheesy
table.smartCopy(value,&dd);
db.writeData((double)*value);
return S_casApp_success;
}
void servPV::destroy()
{
casPV::destroy();
}
void servPV::eventReady(void)
{
value->put(db.counter);
value->setStatSevr(db.stat,db.sevr);
value->setTimeStamp(&db.ts);
postEvent(mgr.event_mask,*value);
}

View File

@@ -0,0 +1,92 @@
/*
* $Id$
* $Log$
*/
#include "casdef.h"
#include "osiTimer.h"
class gdd;
class servPV;
#ifdef PVDEBUG
#define Debug(str) { fprintf(stderr,str); }
#define Debug1(str,val) { fprintf(stderr,str,val); }
#define Debug2(str,val1,val2) { fprintf(stderr,str,val1,val2); }
#define Debug3(str,val1,val2,val3) { fprintf(stderr,str,val1,val2,val3); }
#else
#define Debug(str) ;
#define Debug1(str,val) ;
#define Debug2(str,val1,val2) ;
#define Debug3(str,val1,val2,val3) ;
#endif
class dBase
{
public:
dBase(void)
{
pvname[0]='\0';counter=0;
hihi=90.0;high=80.0;low=20.0;lolo=10.0;
ts.tv_sec=0; ts.tv_nsec=0;
stat=0; sevr=0;
node=NULL;
}
void eventReady(void);
void writeData(double);
char pvname[50];
double counter;
double hihi,high,low,lolo;
aitTimeStamp ts;
aitInt16 stat,sevr;
servPV* node;
};
class serv : public caServer
{
public:
serv(int totpv,double rate,char* prefix,
unsigned maxnamelen,unsigned pvtotalest, unsigned maxsimio);
virtual ~serv(void);
virtual pvExistReturn pvExistTest(const casCtx& c,const char* pvname);
virtual casPV* createPV(const casCtx& c,const char* pvname);
int InitDB(void);
int Main(void);
// sloppy
char* prefix;
int prefix_len;
int pv_total;
double event_rate;
casEventMask event_mask;
dBase* db_sync;
};
class servPV : public casPV
{
public:
servPV(const casCtx&,serv&,const char* pvname,dBase&);
virtual ~servPV(void);
virtual caStatus interestRegister(void);
virtual void interestDelete(void);
virtual aitEnum bestExternalType(void) const;
virtual caStatus read(const casCtx &ctx, gdd &prototype);
virtual caStatus write(const casCtx &ctx, gdd &value);
virtual void destroy(void);
virtual unsigned maxSimultAsyncOps(void) const;
void eventReady(void);
private:
serv& mgr;
dBase& db;
gdd* value;
int monitored;
};

View File

@@ -0,0 +1,8 @@
TOP = ../../../..
include $(TOP)/config/CONFIG_BASE
INC := casdef.h casInternal.h casEventMask.h
include $(TOP)/config/RULES.Host

Some files were not shown because too many files have changed in this diff Show More