1*44704f69SBart Van Assche 2*44704f69SBart Van Assche 3*44704f69SBart Van AsscheThe utilities in this directory are _not_ built automatically. So: 4*44704f69SBart Van Assche cd <root_of_sg3_utils_src> 5*44704f69SBart Van Assche ./configure ; make ; make install 6*44704f69SBart Van Asschewill _not_ build and install them. The make command (or some variant 7*44704f69SBart Van Asscheof it) needs to be run in this directory as outlined below. 8*44704f69SBart Van Assche 9*44704f69SBart Van AsscheBuilding files in this directory depends on several files being already 10*44704f69SBart Van Asschebuilt in the ../lib directory. So to build files here, the ./configure 11*44704f69SBart Van Asscheneeds to be executed in the parent directory followed by changing 12*44704f69SBart Van Asschedirectory to the lib directory and calling 'make' there. 13*44704f69SBart Van AsscheAnother way is to do a top level 'make' after the ./configure which 14*44704f69SBart Van Asschewill make the libraries followed by all the utilities in the src/ 15*44704f69SBart Van Asschedirectory. To make them in FreeBSD use 'make -f Makefile.freebsd' . 16*44704f69SBart Van Assche 17*44704f69SBart Van AsscheThe utilities in this directory do not have manpages. They have 18*44704f69SBart Van Asscherelatively complete but terse help messages, typically seen by using 19*44704f69SBart Van Asschethe '--help' option one or more times. If called several times, the 20*44704f69SBart Van Asscheshorter form of the help option is more convenient, for example: '-hhh'. 21*44704f69SBart Van AsscheAnd of course there is the source code. Unfortunately where the code 22*44704f69SBart Van Asscheimplements many different options, it can become a bit dense. There 23*44704f69SBart Van Asscheis also a large amount of error checking, as many of these utilities 24*44704f69SBart Van Asschewere used to test new features placed in the sg v4 driver in Linux. 25*44704f69SBart Van Assche 26*44704f69SBart Van AsscheThe sg_chk_asc utility decodes the SCSI additional sense code table 27*44704f69SBart Van Asschefound at https://www.t10.org/lists/asc-num.txt and checks it against 28*44704f69SBart Van Asschethe table found in sg_lib_data.c in the lib/ subdirectory. It is 29*44704f69SBart Van Asschedesigned to keep the table in sg_lib_data.c in "sync" with the 30*44704f69SBart Van Asschetable at the t10.org web site. 31*44704f69SBart Van Assche 32*44704f69SBart Van AsscheThe tst_sg_lib utility exercises several functions found in sg_lib.c 33*44704f69SBart Van Asscheand related files in the 'lib' sibling directory. Use 'tst_sg_lib -h' 34*44704f69SBart Van Asscheto get more information. 35*44704f69SBart Van Assche 36*44704f69SBart Van AsscheThere are both C and C++ files in this directory, they have extensions 37*44704f69SBart Van Assche'.c' and '.cpp' respectively. Now both are built with rules in Makefile 38*44704f69SBart Van Assche(at least in Linux). A gcc/g++ compiler of 4.7.3 vintage or later 39*44704f69SBart Van Assche(or a recent clang compiler) will be required. To make them in FreeBSD 40*44704f69SBart Van Asscheuse 'make -f Makefile.freebsd'. 41*44704f69SBart Van Assche 42*44704f69SBart Van AsscheThe sgh_dd utility (C++) uses 'libatomic' which may not be installed 43*44704f69SBart Van Asscheon some systems. On Debian based systems 'apt install libatomic1' fixes 44*44704f69SBart Van Asschethis. 45*44704f69SBart Van Assche 46*44704f69SBart Van AsscheDouglas Gilbert 47*44704f69SBart Van Assche17th September 2019 48