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.
4
8
5
9
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
8
12
b) ./configure
9
13
c) make
10
14
d) make install
11
15
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' .
31
22
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.
34
27
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.
41
33
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.
69
34
35
+ Linux
36
+ =====
70
37
A "spec" file is included for building rpm packages. It is called
71
38
sg3_utils.spec . To build binary and source rpms place a copy of the
72
39
gzipped tarball in the "SOURCES" directory and place a copy of
@@ -101,55 +68,51 @@ can be found in the "no_lib" subdirectory.
101
68
102
69
FreeBSD
103
70
=======
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
+
110
74
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.
112
77
113
78
114
79
Solaris
115
80
=======
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
+
122
84
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.
124
87
125
88
126
89
Tru64 (OSF)
127
90
===========
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
+
134
94
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.
136
97
137
98
138
99
Windows
139
100
=======
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
143
104
sg_scan utility (and perhaps looking at its man page (i.e. sg_scan.8 or
144
105
sg_scan.8w)).
145
106
146
107
The source tarball can be built in a cygwin or MinGW environment on Windows.
147
108
148
109
For cygwin see http://www.cygwin.com for more information. Various extras
149
110
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
153
116
dll (cf shared libraries are built on Linux and FreeBSD) so the executable
154
117
files are bigger than they need to be. Once built, the various ".exe"
155
118
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.
159
122
There is also the "Minimalist Gnu for Windows" (MinGW) and its associated
160
123
shell (MSYS) that can serve as a build environment for sg3_utils. This
161
124
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.
166
131
167
132
168
- 15th July 2007
133
+ 16th July 2007
169
134
Doug Gilbert
0 commit comments