Skip to content

Commit bc3c9b1

Browse files
committed
small autotools cleanup
git-svn-id: svn://localhost/trunk@85 6180dd3e-e324-4e3e-922d-17de1ae2f315
1 parent 06e031c commit bc3c9b1

12 files changed

+69
-103
lines changed

Diff for: AUTHORS

+2
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
Douglas Gilbert <dgilbert at interlog dot com>
2+
3+
See the CREDITS file for the names of those who have contributed.

Diff for: ChangeLog

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Each utility has its own version number, date of last change and
22
some description at the top of its ".c" file. All utilities in the main
33
directory have their own "man" pages. There is also a sg3_utils man page.
44

5-
Changelog for sg3_utils-1.25 [20070715]
5+
Changelog for sg3_utils-1.25 [20070716]
66
- sg_dd: add oflag=sparse to step over bs*bpt number of zeros;
77
- with oflag=sparse, write last bs*bpt segment at end or after
88
error so file length of OFILE is appropriate
@@ -12,8 +12,10 @@ Changelog for sg3_utils-1.25 [20070715]
1212
- sg_ses: sync with ses2r17
1313
- sg_vpd: add block device characteristics VPD page
1414
- place source in subversion repository
15-
- convert build logic to use autotools
15+
- convert build logic to use autotools (i.e. './configure ; make')
1616
- rename this file from CHANGELOG to ChangeLog
17+
- note: only utilities in main directory built by autotools
18+
infrastructure; subdirectories still use hand-crafted Makefiles
1719

1820
Changelog for sg3_utils-1.24 [20070507]
1921
- sg_raw: new utility to send arbirary SCSI commands

Diff for: INSTALL

+56-91
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,39 @@
1-
During the development of sg3_utils version 1.25 this package
2-
was changed to use autotools. It previously used handed
3-
crafted Makefiles.
1+
Installing this package
2+
-----------------------
3+
4+
Introduction
5+
============
6+
During the development of sg3_utils version 1.25 this package was changed
7+
to use autotools. Prior to version 1.25 it used handed crafted Makefiles.
48

59
In most cases the build process is now:
6-
a) fetch the source tarball, untar it and go to the top level
7-
directory, then do
10+
a) fetch the source tarball, untar it and go to the top level directory,
11+
then do
812
b) ./configure
913
c) make
1014
d) make install
1115

12-
Step d) usually requires root permissions. Notes on individual
13-
supported architectures are given below. If the architecture
14-
supports shared libraries (in Unix/Linux) then the default
15-
'./configure' generates a Makefile that will build executables
16-
that use a shared library. The name of that shared library starts
17-
with 'libsgutils'. To build without that shared library use this
18-
invocation instead of step b): './configure --disable-shared'
19-
20-
21-
More information about the autotool build needs to be added
22-
23-
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
24-
25-
26-
Unless otherwise noted, these install instructions are for the
27-
Linux operating system. See below for other operating systems.
28-
29-
By default, the Makefile will build for Linux with a shared library.
30-
The invocation sequence is:
16+
Step d) usually requires root permissions. Notes specific to supported
17+
architectures are given below. If the architecture supports shared libraries
18+
(in Unix/Linux) then the default './configure' generates a Makefile that
19+
will build executables that use a shared library. The name of that shared
20+
library starts with 'libsgutils'. To build without that shared library use
21+
this invocation instead of step b): './configure --disable-shared' .
3122

32-
make
33-
make install [may need root permission]
23+
The two script files that driven the autotools build are configure.ac
24+
and Makefile.am . If the former is changed, autoconf should be run
25+
and if the latter is chnaged, autmake should be run. More simply if
26+
either is changed the autogen.sh script can be run.
3427

35-
Unless overridden or edited in the Makefile, INSTDIR places the executables
36-
in the /usr/local/bin directory, LIBDIR places libraries in the
37-
/usr/local/lib directory, MANDIR places the man pages in the
38-
/usr/local/share/man directory and INCLUDEDIR places header files in the
39-
/usr/local/include/scsi directory. For FreeBSD the default MANDIR is
40-
/usr/local/man .
28+
Note that only the utilities in the main directory are build by the
29+
'./configure' infrastructure. [A caveat: the code is the getopt_long
30+
directory is built for OSF (Tru64).] Code in the examples, utils and
31+
archives directories can be built with simple Makefiles which are
32+
typically found in those directories.
4133

42-
Other Makefile targets that might be useful:
43-
make clean # remove .o, executables, core and .depend file
44-
make depend # generate dependency hierarchy in .depend file
45-
make dep # same as 'make depend'
46-
make sg_inq # build a specific executable (e.g. 'sg_inq')
47-
make uninstall # removes executables, libraries and build remnants
48-
make -f no_lib/Makefile.linux # build without a library
49-
50-
./make_no_lib.sh sg_inq # is a simple script; in this case it expands to:
51-
# make -f no_lib/Makefile.linux sg_inq
52-
53-
Note that the main Makefile does _not_ call the Makefiles in the
54-
subdirectories (i.e. archive, examples and utils directories).
55-
56-
By default, this package now builds a shared library called
57-
libsgutils.so and the corresponding static library: libsgutils.a .
58-
The GNU "libtool" is required by sg3_utils to build its libraries.
59-
The 'make' will build those libraries and executables and put them
60-
in the ".libs" subdirectory (as libtool requires/enforces).
61-
The 'make' puts scripts in the main directory with the same names as
62-
the utilities (e.g. sg_dd, sg_inq etc) which set up an appropriate
63-
environment and call the "real" executable "hiding" in the ".libs"
64-
subdirectory.
65-
The "make install" will install the libraries in the /usr/local/lib
66-
directory. If an executable cannot find the libsgutils shared library
67-
(check with 'ldd sg_inq' for example) then the addition of "/usr/local/lib"
68-
to the /etc/ld.so.conf file may be required in some distributions.
6934

35+
Linux
36+
=====
7037
A "spec" file is included for building rpm packages. It is called
7138
sg3_utils.spec . To build binary and source rpms place a copy of the
7239
gzipped tarball in the "SOURCES" directory and place a copy of
@@ -101,55 +68,51 @@ can be found in the "no_lib" subdirectory.
10168

10269
FreeBSD
10370
=======
104-
In FreeBSD, the utilities can be built with "make -f Makefile.freebsd".
105-
This will build a shared object (i.e. libsgutils.so and friends) that
106-
the utilities depend on. To install use "make -f Makefile.freebsd install".
107-
These makes depend on libtool. To build without reliance on a shared
108-
library (and thus libtool) use "make -f no_lib/Makefile.freebsd" (or
109-
execute the "make_no_lib_freebsd.sh" script which does the same thing).
71+
In FreeBSD, the utilities can be built and installed as shown in the
72+
Introduction section above.
73+
11074
Utilities that are linux specific (e.g. sg_map) are not built for
111-
FreeBSD.
75+
FreeBSD. See the "bin_PROGRAMS" definition within the OS_FREEBSD
76+
conditional of the Makefile.am file for a definitive list.
11277

11378

11479
Solaris
11580
=======
116-
In Solaris, the utilities can be built with "make -f Makefile.solaris".
117-
This will build a shared object (i.e. libsgutils.so and friends) that
118-
the utilities depend on. To install use "make -f Makefile.solaris install".
119-
These makes depend on gcc and libtool. To build without reliance on a shared
120-
library (and thus libtool) use "make -f no_lib/Makefile.solaris" (or
121-
execute the "make_no_lib_solaris.sh" script which does the same thing).
81+
In Solaris, the utilities can be built and installed as shown in the
82+
Introduction section above.
83+
12284
Utilities that are linux specific (e.g. sg_map) are not built for
123-
Solaris.
85+
Solaris. See the "bin_PROGRAMS" definition within the OS_SOLARIS
86+
conditional of the Makefile.am file for a definitive list.
12487

12588

12689
Tru64 (OSF)
12790
===========
128-
In Tru64, the utilities can be built with "make -f Makefile.osf1".
129-
This will build a shared object (i.e. libsgutils.so and friends) that
130-
the utilities depend on. To install use "make -f Makefile.osf1 install".
131-
These makes depend on libtool. To build without reliance on a shared
132-
library (and thus libtool) use "make -f no_lib/Makefile.osf1" (or
133-
execute the "make_no_lib_osf1.sh" script which does the same thing).
91+
In Tru64 (OSF), the utilities can be built and installed as shown in the
92+
Introduction section above.
93+
13494
Utilities that are linux specific (e.g. sg_map) are not built for
135-
Tru64.
95+
Tru64. See the "bin_PROGRAMS" definition within the OS_OSF
96+
conditional of the Makefile.am file for a definitive list.
13697

13798

13899
Windows
139100
=======
140-
In Windows only the Windows NT, 2000, 2003 and XP operating systems (and
141-
their variants) are currently supported. The various device names that the
142-
sg3_utils utilities will accept in Windows can be seen by running the
101+
In Windows only the Windows NT, 2000, 2003, XP and Vist operating systems
102+
(and their variants) are currently supported. The various device names that
103+
the sg3_utils utilities will accept in Windows can be seen by running the
143104
sg_scan utility (and perhaps looking at its man page (i.e. sg_scan.8 or
144105
sg_scan.8w)).
145106

146107
The source tarball can be built in a cygwin or MinGW environment on Windows.
147108

148109
For cygwin see http://www.cygwin.com for more information. Various extras
149110
such as 'gcc' (the GNU C compiler) and 'make' need to be loaded as they are
150-
not in the minimal cygwin default distribution. The build command
151-
is "make -f Makefile.win32" and to install (for a cygwin environment)
152-
use "make -f Makefile.win32 install". Currently the make doesn't build a
111+
not in the minimal cygwin default distribution. The utilities can be built
112+
and installed as shown in the Introduction section above. Utilities that
113+
are linux specific (e.g. sg_map) are not built for cygwin. See the
114+
"bin_PROGRAMS" definition within the OS_CYGWIN conditional of the
115+
Makefile.am file for a definitive list. Currently the make doesn't build a
153116
dll (cf shared libraries are built on Linux and FreeBSD) so the executable
154117
files are bigger than they need to be. Once built, the various ".exe"
155118
commands can either be executed in a cygwin shell (typically "bash") or a
@@ -159,11 +122,13 @@ the "cygwin1.dll" (obtained from http://www.cygwin.com ) is required.
159122
There is also the "Minimalist Gnu for Windows" (MinGW) and its associated
160123
shell (MSYS) that can serve as a build environment for sg3_utils. This
161124
removes the dependence on the proprietary cygwin1.dll at the expense
162-
of some timing features. In a MSYS shell untar the sg3_utils tarball and
163-
in its top level directory use "make -f Makefile.mingw". The executables
164-
will be placed in that directory. They can be executed in a MSYS or "cmd"
165-
shell.
125+
of some timing features. In a MSYS shell the utilities can be built
126+
and installed as shown in the Introduction section above. Utilities that
127+
are linux specific (e.g. sg_map) are not built for MinGW. See the
128+
"bin_PROGRAMS" definition within the OS_MINGW conditional of the
129+
Makefile.am file for a definitive list. The executables have a '.exe'
130+
extension and can be executed in a MSYS or "cmd" shell.
166131

167132

168-
15th July 2007
133+
16th July 2007
169134
Doug Gilbert

Diff for: README

+6-9
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,9 @@ via the function based interface defined in sg_pt.h . The linux specific
8181
implementation of that pass through is found in the sg_pt_linux.c file. Since
8282
almost all of the utilities use these files, a shared library called
8383
"libsgutils.so" is built. Use of this library cuts down the size of the
84-
binary distributions of sg3_utils significantly. The "Makefile" provided in
84+
binary distributions of sg3_utils significantly. The build scripts provided in
8585
the main directory builds libsgutils.so and then builds each utility to use
86-
that shared library. Alternatively there is a script called "make_no_lib.sh"
87-
that will build utilities without depending on libsgutils.so . For example
88-
"./make_no_lib.sh sg_dd" builds a version of the sg_dd utility that does not
89-
depend on libsgutils.so . See the INSTALL file for more information.
86+
that shared library. See the INSTALL file for more information.
9087

9188
All the utilities in the main directory have "man" pages. There is also a
9289
sg3_utils (8) man page that summarizes common facilities including exit
@@ -158,9 +155,9 @@ of the sg3_utils directory:
158155
sg_verify, sg_vpd, sg_write_buffer, sg_write_long, sg_wr_mode
159156

160157
These utilities and the libsgutils.so library which they depend on are built
161-
by the Makefile in the main directory. This Makefile does not invoke the
162-
Makefile's in the subdirectories. Each utility in the main directory has a
163-
"man" page in section 8 (system administration commands). Binary distributions
158+
by the build scripts in the main directory. Only the code in the main
159+
directory is built. Each utility in the main directory has a "man" page in
160+
section 8 (system administration commands). Binary distributions
164161
of the sg3_utils package (e.g. "rpm" and debian packages) typically contain
165162
the shared library, the utilities in the main directory, their associated man
166163
pages and some documentation files (e.g. README, INSTALL, CREDITS, COPYING
@@ -325,4 +322,4 @@ See http://www.torque.net/sg/tools.html
325322

326323

327324
Doug Gilbert
328-
15th July 2007
325+
16th July 2007
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

Diff for: sg3_utils.spec

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Includes utilities to copy data based on "dd" syntax and semantics (called
1818
sg_dd, sgp_dd and sgm_dd); check INQUIRY data and VPD pages (sg_inq); check
1919
mode and log pages (sginfo, sg_modes and sg_logs); spin up and down
2020
disks (sg_start); do self tests (sg_senddiag); and various other functions.
21-
See the README, CHANGELOG and COVERAGE files. Requires the linux kernel 2.4
21+
See the README, ChangeLog and COVERAGE files. Requires the linux kernel 2.4
2222
series or later. In the 2.4 series SCSI generic device names (e.g. /dev/sg0)
2323
must be used. In the 2.6 series other device names may be used as
2424
well (e.g. /dev/sda).

0 commit comments

Comments
 (0)