Debian Codegraph @

00XCONFIG

raw
1
2 Cross-configuring Lsof
3
4 Introduction
5 ============
6
7 Lsof cross-configuration is useful when the target dialect or target
8 dialect version for which lsof is to be configured and built differs
9 from the one on which the Configure operation is done.
10
11 Marty Leisner <[email protected]> suggested the method
12 described here for lsof cross-configuration, and he supplied
13 modifications to the Configure script for cross-configuring Linux
14 lsof.
15
16 Marty says:
17
18 "I used this to successfully compile (lsof) on the same machine
19 for (Linux) 2.0.30 and 2.1.42. (I normally don't bring up a
20 2.1.42 machine all the time). Also it (the 2.0.30 system)
21 doesn't have much storage and compiles on it are slow.
22
23 Set LSOF_VERS if it's not the (version of the) current system.
24 (Actually, you should get the version out of include/linux/version.h.)
25
26 Define LINUX_KERNEL to (the path) where the kernel sources
27 are (located). (No longer necessary as of lsof revision 4.53.)
28
29 This should work on most systems; they put a kernel in
30 /usr/src/linux, which is the default.
31
32 Now I can just do:
33
34 LINUX_KERNEL=/some/other/kernel LSOF_VERS=2142 ./Configure linux
35
36 Comments? It's very convenient when running multiple kernels.
37 (It would be (have been) very handy when the structures changed
38 between 2.0.2* and 2.0.30 , or whatever.)
39
40 I run multiple OSes at a time (not to mention multiple
41 architectures. It's very pleasant to cross-build either
42 operating systems or versions."
43
44 So, the situation is that you have lsof sources on a UNIX dialect
45 version, and you want to configure them to build lsof for some
46 other version of the same dialect, or perhaps for some other UNIX
47 dialect altogether.
48
49
50 The Cross-Configure Method
51 ==========================
52
53 The lsof cross-configure method uses environment variables to tell
54 the lsof Configure script about the target dialect. The environment
55 variables may specify alternate locations for Configure to examine
56 when it determines characteristics of the target, or they may
57 specify the values Configure would discover when it examined the
58 target's characteristics.
59
60 Consult each environment variable description for the UNIX dialect
61 in which you're interested to see how it affects the operation of
62 the Configure script.
63
64 The number and values of the variables differ by dialect. Each
65 variable begins with an upper case version of the dialect's Configure
66 abbreviation -- e.g., AIX for aix or aixgcc, LINUX for linux,
67 UW for uw (UnixWare), etc.
68
69 Of course, the UNIX dialect's version is probably different from
70 that of the system on which you're doing the cross-configuration,
71 so you will need to specify the new version, too. For example, to
72 configure for FreeBSD 3.0 on a 2.1.7 system, where the standard
73 3.0 header files are in /3.0/usr/include and the 3.0 system sources
74 are in /3.0/sys, do this:
75
76 LSOF_VERS=300 LSOF_INCLUDE=/3.0/usr/include \
77 FREEBSD_SYS=/3.0/sys Configure -n freebsd
78
79
80 General Environment Variables
81 =============================
82
83 There are some environment variables whose names don't begin with
84 an upper case rendering of a dialect abbreviation. Generally they
85 apply to all dialects.
86
87 AFS_VICE is for AFS configuration. It need be set only if
88 lsof supports AFS on your dialect and you want to
89 specify an alternate path to the VICE files.
90
91 default: /usr/vice
92
93 LSOF_AR is the path to and arguments for the library archive
94 application that is used to build the lsof library,
95 liblsof.a. When this value is placed in the library
96 Makefile as the contents of the AR make string, it is
97 followed by the path to the library and the relative
98 paths of the library module
99
100 default: ar cr
101
102 LSOF_ARCH is the architecture type string for the system.
103 Usually this is the output of `uname -m`. Consult
104 the Configure script for details. The LSOF_ARCH
105 value may have to be quoted if it contains spaces.
106
107 default: auto-detection (e.g., from `uname -m`)
108
109 LSOF_BLDCMT may be used to introduce a builder's comment into
110 lsof's -v output. It defaults to the null string,
111 causing no builder's comment to appear in -v output.
112
113 default: none
114
115 LSOF_CC is the path to the C compiler. You may need to
116 specify it if your C compiler is in a non-standard
117 place, not found by your path. If you specify a
118 compiler different from the expected default, you
119 may have to change the compile time flags by
120 specifying new CFGF, CFGL, and DEBUG strings on
121 the make command line.
122
123 default: normally cc, but some dialects have other
124 defaults and some have auto-detection.
125
126 Check the dialect stanza in the lsof Configure
127 script to see how LSOF_CC is set by default.
128
129 LSOF_CCV is the C compiler version. You should specify it
130 if you have specified a compiler path in LSOF_CC.
131
132 default: the lsof Configure script knows how to find
133 the version number of gcc and some other
134 dialect-specific compilers.
135
136 Check the dialect stanza in the lsof Configure
137 script to see how lsof_CCV is set by default.
138
139 LSOF_CFGF may be used to specify additional configuration values
140 that will appear in the CFGF string of the Makefile.
141
142 LSOF_CFGL may be used to specify additional library specifications
143 that will appear in the CFGL string of the Makefile.
144
145 LSOF_HOST may be used to specify a value in lsof's -v output
146 other than the name of the host where lsof was
147 built. A value of "none" inhibits host name display
148 in -v output.
149
150 default: the dialect's host name application -- e.g.,
151 hostname or uname -n
152
153 LSOF_INCLUDE is the path to a tree of header files that is an exact
154 image of the standard header file tree for the
155 target dialect. You may need to specify it if you
156 want Configure to test header files in a tree different
157 from /usr/include and compile its test programs with
158 header files from that tree, then you want to compile
159 lsof from the header files in that different, duplicate
160 image tree.
161
162 Note: LSOF_INCLUDE should contain a single path
163 without any option flags, such as -I. It is always
164 supplied to the compiler in CFLAGS following the -I
165 option flag. If you want to specify other include
166 paths, use LSOF_OPINC.
167
168 ADDITIONAL NOTE: all the header files that lsof's
169 Configure tests for optional features and uses to
170 compile test programs must be in LSOF_CONFIGURE.
171 They can't be scattered in the other include path
172 that LSOF_OPINC names.
173
174 LSOF_LOGNAME may be used to specify a value in lsof's -v output
175 other than the one in the LOGNAME environment
176 variable for the login name of the person who built
177 lsof. A value of "none" inhibits login name display
178 in -v output.
179
180 default: the LOGNAME environment variable
181
182 LSOF_MAKE is the path to the make command.
183
184 default: the output of `which make`, if it is not NULL;
185 otherwise the string "make".
186
187 LSOF_MKC may be used to specify an alternate method of
188 connecting dialect sources to the top-level lsof
189 directory. See 00PORTING for more information.
190
191 default: ln -s
192
193 LSOF_OPINC may be used to specify other include file search
194 paths. Each must be preceded by the compiler's -I
195 option file and, if there are muliple paths, they
196 must be separated by spaces and the entire set must
197 be enclosed in double quote marks -- e.g.,
198
199 LSOF_OPINC="-I/path1 -I/path2 ..."
200
201 The optional include paths thus specified will be
202 appended to LSOF_INCLUDE and whatever special
203 include paths the lsof Configure script finds
204 necessary.
205
206 LSOF_RANLIB may be used to specify an alternate command for the
207 randomizing of the lsof library.
208
209 default: ranlib for most dialects
210 none for: IBM AIX; HP-UX; SCO OpenServer; Solaris
211 and SCO|Caldera UnixWare
212
213 LSOF_SYSINFO may be used to specify a value in lsof's -v output
214 other than the standard system identification --
215 e.g., output from uname. A value of "none" inhibits
216 system information display in -v output.
217
218 default: the dialect's standard system identification
219 application output -- e.g., uname, sysinfo
220
221 LSOF_USER may be used to specify a value in lsof's -v output
222 other than the one in the USER environment variable
223 for the login name of the person who built lsof.
224 A value of "none" inhibits login name display in
225 -v output.
226
227 default: the USER environment variable
228
229 LSOF_VERS is the target dialect version number. It must be
230 stated in the dialect's form -- e.g., FreeBSD 2.0.5
231 is given as 205, Solaris 7 as 70000, etc. The
232 table, "Abbreviations, Variable Prefixes, and
233 Version Numbers," in this file gives the form for
234 LSOF_VERS for each dialect lsof supports.
235
236 default: auto-detection (e.g., from `uname -r`)
237
238 LSOF_VSTR is the version string from which LSOF_VERS is
239 derived. Usually this is the output of `uname -r`
240 or `uname -v`. Consult the Configure script for
241 details. The LSOF_VSTR value may have to be quoted
242 if it contains spaces.
243
244 default: auto-detection (e.g., output from
245 `hostname`, `uname -r`, or `uname -v)
246
247
248 Make Strings
249 ============
250
251 The CFGF, CFGL, and DEBUG strings can be specified on the make
252 command line to change default values placed in the top-level and
253 library Makefiles by Configure. For example, Configure usually
254 defines the compiler optimization level to be -O, but you can change
255 that with "DEBUG=-g" on the make command -- e.g.,
256
257 $ make DEBUG=-g lsof
258
259 Similarly, the CFGF string contains miscellaneous compile-time
260 options, and CFGL contains loader options. Consult the Makefiles
261 generated by Configure for the values it defines by default for
262 CFGF and CFGL.
263
264 As an example, Configure might define CFGL to be "-L./lib -llsof -w"
265 for NextStep 3.1; to remove "-w", use this make invocation:
266
267 $ make CFGL="-L./lib -llsof"
268
269
270 Abbreviations, Variable Prefixes, and Version Numbers
271 =====================================================
272
273 The following table describes the relationship between Configure
274 abbreviations, environment variable prefixes, and lsof UNIX dialect
275 version numbers. The lsof UNIX dialect version number must be
276 declared exactly in the listed form when supplied via the LSOF_VERS
277 environment variable.
278
279 Dialect Lsof Version
280 Configure Variable Version Number for
281 Abbreviation* Prefix Number LSOF_VERS
282
283 aix AIX 3.2.5 3250
284 aixgcc 4.1.0 4100
285 4.1.4 4140
286 4.1.4 4150
287 4.2.0 4200
288 4.2.1 4210
289 4.3 4300
290 4.3.1 4310
291 4.3.2 4320
292 4.3.3 4330
293 5.0.x 5000
294 5.1.x 5100
295 5.2.x 5200
296 5.3.x 5300
297 darwin DARWIN 1.2* 120
298 1.3* 130
299 1.4* 140
300 5.[012] 500
301 5.[3-9] 530
302 6.x 600
303 7.x 700
304 8.x 800
305 freebsd FREEBSD 1.x 1000
306 2.x 2000
307 2.0.5 2005
308 2.1.x 2010
309 2.2.x 2020
310 3.x 30x0
311 4.x 40x0
312 4.1x 41x0
313 5.x 50x0
314 6.x 60x0
315 7.x 70x0
316 8.x 80x0
317 9.x 90x0
318 hpux HPUX 9.1 901
319 hpuxgcc HPUX 9.5 905
320 10.0 1000
321 10.10 1010
322 10.20 1020
323 11.00 1100
324 11.11 1111
325 linux LINUX 2.1.x 21xxx
326 2.2.x 22xxx
327 2.3.x 23xxx
328 2.4.x 24xxx
329 2.6.x 26xxx
330 netbsd NETBSD 1.2 1002000
331 1.3 1003000
332 1.4 1004000
333 1.5 1005000
334 1.6 1006000
335 2.0 2000000
336 2.99.9 2099009
337 2.99.10 2099010
338 openbsd OPENBSD 1.2 1020
339 2.0 2000
340 2.1 2010
341 2.2 2020
342 2.3 2030
343 2.4 2040
344 2.5 2050
345 2.6 2060
346 2.7 2070
347 2.8 2080
348 2.9 2090
349 3.0 3000
350 3.1 3010
351 3.2 3020
352 3.3 3030
353 3.4 3040
354 3.5 3050
355 3.6 3060
356 osr OSR 3.2v2.0 20
357 3.2v2.1 21
358 3.2v4.0 40
359 3.2v4.1 41
360 3.2v4.2 42
361 3.2v5.0.0 500
362 3.2v5.0.2 502
363 3.2v5.0.4 504
364 3.2v5.0.6 506
365 ou OU 8.0.0 80000
366 solaris SOLARIS 2.3 20300
367 solariscc SOLARIS 2.4 20400
368 2.5 20500
369 2.5.1 20501
370 2.6 20600
371 7 70000
372 8 80000
373 9 90000
374 10 100000
375 uw UW 7.0 70000
376 7.1.0 70100
377 7.1.1 70101
378 7.1.3 70103
379
380
381
382 Dialect-Specific Environment Variables
383 ======================================
384
385 Here are the dialect-specific environment variables, listed
386 alphabetically. The first part of any environment variable will
387 be the dialect abbreviation, as specified to Configure, converted
388 to upper case characters. See the `Configure -help` output for a
389 listing of the abbreviations.
390
391 AIX_ARCH specifies the AIX architecture when the AIX version is
392 5.0 or higher. A value of "" signifies POWER; "ia64",
393 64 bit x86 (Itanium).
394
395 default: none (tested via `uname -a`)
396
397 AIX_HAS_AFS specifies the state of AIX ADS support when the AIX
398 version is 4.3.3 or lower. (Lsof doesn't support AFS
399 above AIX 4.3.3.) A value of "" allows the Configure
400 script to determine the AFS support state; "no",
401 disables AFS support; and "yes", forces the enabling of
402 AFS support.
403
404 default: none (tested via presence of AFS files and the
405 lsof AFSConfig shell script)
406
407 AIX_KERNBITS specifies the kernel bit size, 32 or 64, of the Power
408 architecture AIX 5.x kernel for which lsof was built.
409
410 default: determined by the Configure script with a test
411 program that uses <sys/systemcfg.h> macros.
412
413 AIX_USHACK If this environment variable has a value of "Y" or "y",
414 and if the aixgcc Configure abbreviation is selected,
415 the AIX 4.1 and greater gcc user structure hack is
416 activated; any other non-NULL value, it's not set; a
417 NULL value, it's tested by compilation.
418
419 default: none (tested by compilation)
420
421 DARWIN_XNUDIR If this environment variable has a value, the value is
422 used as the path to the Darwin XNU kernel source code.
423
424 default: none (entry requested)
425
426 DARWIN_XNU_HEADERS If this environment variable has a value, the value is
427 used as the path to the Darwin XNU kernel header files.
428 This path would match the DSTROOT environment variable
429 used when a "make installhdrs" was executed from the
430 Darwin XNU kernel source directory.
431
432 default: none
433
434 FREEBSD_KERNEL specifies the path to the FreeBSD kernel for FreeBSD
435 version less than 2.0.
436
437 default: /386bsd
438
439 FREEBSD_SYS specifies the path to the FreeBSD system source
440 directory.
441
442 default: /sys
443
444 HPUX_BASE specifies the HP-UX lsof source code base, kmem or
445 pstat, to be used.
446
447 default: determined by testing for the
448 /usr/include/sys/pstat subdirectory
449
450 HPUX_BOOTFILE specifies the file in which lsof's Configure script can
451 find kernel information. This specification may be
452 useful for defining the path to a copy of /stand/vmunix
453 that has been processed by pxdb or q4pxdb.
454
455 default: /stand/vmunix
456
457 HPUX_CCDIR1 specifies the first directory where Configure might
458 find an HP-UX C compiler. This is ignored when
459 LSOF_CC has been specified.
460
461 default: /bin
462
463 HPUX_CCDIR2 specifies the second directory where Configure might
464 find an HP-UX C compiler. This is ignored when
465 LSOF_CC has been specified.
466
467 default: /usr/ccs/bin
468
469 HPUX_HASONLINEJFS If this environment variable has a value of "Y" or "y",
470 the HASONLINEJFS definition will be enabled in the
471 Makefile CFLAGS. That will cause dnode1.c to use an
472 alternate vx_inode.h header file in the hpux11 sub-
473 directory of dialects/hpux/kmem.
474
475 default: determined using nm and grep
476
477 HPUX_IPC_S_PATCH If this environment variable has a value of "1", the
478 ipc_s structure of the HP-UX 11 kernel is assumed to
479 have an ipc_ipis member, but it is assumed the ipis_s
480 structure lacks the ipis_msgsqueued member; "2", ipc_s
481 has ipc_ipis, but ipis_s has ipis_msgsqueued; "n" or
482 "N", ipc_s lacks ipc_ipis; any other non-NULL value is
483 considered an error; a NULL value, HPUX_IPC_S_PATCH is
484 determined by testing.
485
486 default: determined with q4 and grep
487
488 HPUX_KERNBITS specifies the number of bits (32 or 64) in the HP-UX
489 11 "basic kernel word.
490
491 default: `getconf _SC_KERNEL_BITS`
492
493 HPUX_LIBC1 specifies the first directory that might contain the
494 HP-UX C library, libc.sl.
495
496 default: /usr/lib
497
498 HPUX_LIBC2 specifies the second directory that might contain the
499 HP-UX C library, libc.sl.
500
501 default: /lib
502
503 HPUX_RNODE3 If this environment variable has a value of "1", the
504 Configure script will define HASRNODE3 in the Makefile
505 CFGF flags. If it is defined, but not "1", Configure
506 will not define HASRNODE2.
507
508 default: determined using `nm -x /stand/vmunix` and
509 `grep r_fh3 /usr/include/nfs/rnode.h`
510
511 HPUX_X25DIR specifies path to the HP-UX X25 directory that contains
512 configuration header files.
513
514 default: /etc/conf
515
516 LINUX_CLIB specifies the definition of the Linux C library:
517
518 default: "" (standard C library)
519 others: -DGLIBCV=2 (glibc2)
520
521 LINUX_CONF_CC specifies the location of the C compiler to use during
522 the running of the Configure script:
523
524 default: the value of the LSOF_CC variable, if defined,
525 or cc
526
527 LINUX_HASSELINUX If this environment variable has a value of "Y" or "y",
528 Configure unconditionally activates SELinux support.
529 If it has any other value, Configure unconditionally
530 inhibits SELinux support.
531
532 Default: assumed to be "Y" if <selinux/selinux.h>
533 exists
534
535 LINUX_INCL specifies the path to the header file tree:
536
537 default: /usr/include
538
539 LINUX_LSEEK If this environment variable has a value of "Y" or "y",
540 Configure uses Makefile.lseek in place of Makefile in
541 order to enable use of the private lseek() function for
542 2.1.x kernels; any other non-NULL value, Makefile.lseek
543 will isn't used; a NULL value, the alternate lseek()
544 need is determined by compilation.
545
546 default: determined by test program
547
548 LINUX_VERSION_CODE specifies the value of the LINUX_VERSION_CODE in the
549 same decimal form as found in the LINUX_VERSION_CODE
550 #define of /usr/include/linux/version.h:
551
552 default: the value of LINUX_VERSION_CODE in
553 /usr/include/linux/version.h
554
555 NETBSD_SYS specifies the path to the NetBSD system source
556 directory.
557
558 default: /usr/include
559
560 NETBSD_UVM If this environment variable has a value of "Y" or "y",
561 the NetBSD system uses the UVM virtual memory system;
562 any other non-NULL value, it does not; a NULL value,
563 it will be determined by the contents of /etc/mk.conf.
564
565 default: tested by grep'ping /etc/mk.conf
566
567 OPENBSD_SYS specifies the path to the OpenBSD system source
568 directory.
569
570 default: /sys
571
572 OPENBSD_UVM If this environment variable has a value of "Y" or "y",
573 the OpenBSD system uses the UVM virtual memory system;
574 any other non-NULL value, it does not; a NULL value,
575 it will be determined by examining /bsd.
576
577 default: tested by grep'ping `nm /bsd` output
578
579
580 OSR_CFGF The value of this environment variable is made the
581 initial value for the compiler flags the lsof Configure
582 script constructs for the Makefile CFGF macro.
583
584 default: ""
585
586 OSR_CFGL The value of this environment variable is made the
587 initial value for the loader flags the lsof Configure
588 script constructs for the Makefile CFGL macro.
589
590 default: ""
591
592 OSR_STATLSTAT If this environment variable has a value of "Y" or "y",
593 HAS_STATLSTAT is defined in the Makefile's CFGL string;
594 any other non-NULL value, it's not defined; a NULL
595 value, it is determined with nm and grep.
596
597 default: determined with nm and grep
598
599
600 SOLARIS_23P101318 If this environment variable has a non-NULL value, the
601 value is interpreted as the patch level of the Solaris
602 2.3 P101318 patch.
603
604 default: pkginfo tested with grep
605
606 SOLARIS_24P101945 If this environment variable has a non-NULL value, the
607 value is interpreted as the patch level of the Solaris
608 2.4 P101945 patch.
609
610 default: pkginfo tested with grep
611
612 SOLARIS_24P102303 If this environment variable has a non-NULL value, the
613 value is interpreted as the patch level of the Solaris
614 2.4 P102303 patch.
615
616 default: pkginfo tested with grep
617
618 SOLARIS_26PR_GWINDOWS If this environment variable has a value of "Y" or "y",
619 the HASPR_GWINDOWS definition is set in the Solaris 2.6
620 and 7 Makefile's CFG string; any other non-NULL value,
621 it's not set; a NULL value, it's tested by compilation.
622
623 default: tested by compilation
624
625 SOLARIS_26PR_LDT If this environment variable has a value of "Y" or "y",
626 the HASPR_LDT definition is set in the Solaris 2.6
627 Makefile's CFGL string; any other non-NULL value, it's
628 not set; a NULL value, it's tested by compilation.
629
630 default: tested by compilation
631
632 SOLARIS_CCDIR specifies the path to the Sun C compiler -- i.e., when
633 `Configure solariscc` is used. This is ignored when
634 LSOF_CC has been specified.
635
636 default: /opt/SUNWspro/bin
637
638 SOLARIS_INSTR specifies the Sun C compiler target instruction set
639 when building lsof for a 64 bit kernel -- i.e., when
640 the Configure abbreviation is "solariscc". Possible
641 values include amd64 and sparcv9. This is ignored when
642 the Configure abbreviation is "solaris" -- i.e., the
643 compiler is gcc.
644
645 default: tested with /bin/isainfo -k
646
647 SOLARIS_KERNBITS specifies the number of bits in the Solaris 7, 8, 9 or
648 10 kernel: 32 or 64.
649
650 default: tested with /bin/isainfo -kv
651
652 SOLARIS_VSOCK If this environment variable has a value of "Y" or "y",
653 the HAS_VSOCK definition is in the Solaris Makefile's
654 CFGL string; any other non-NULL value, it's not set; a
655 NULL value, it's tested by compilation.
656
657 default: tested by compilation
658
659 SOLARIS_VXFSINCL This environment variable defines the path to the
660 header files of the VxFS 3.4 or greater version. If
661 SOLARIS_VXFSINCL is not set, the default is used.
662
663 default: VxFS < 4.0:
664 /opt/VRTSvxfs/include
665 VxFS 4.0 and above:
666 /opt/VRTSfssdk/<version>/include
667
668 SOLARIS_VXFSLIB This environment variable defines the path to the
669 VxFS 3.4 or greater utility libraries, libvxfsutil.a
670 (32 bit) and libvxfsutil64.a (64 bit). If
671 SOLARIS_VXFSLIB is not set, the default is used.
672
673 Note: end SOLARIS_VXFSLIB at the "/lib" component; do
674 NOT put "/sparcv9" at its end. The lsof
675 Configure script will add "/sparcv9" if it is
676 required; hence, if Configure finds that
677 "/sparcv9" is needed, your SOLARIS_VXFSLIB
678 directory tree must have a sparcv9 subdirectory.
679
680 default: `dirname $SOLARIS_VXFSINCL`/lib
681
682 SUN_AFSAPATHDEF specifies the path to the AFS library modload file
683 for either Solaris or SunOS.
684
685 default: /usr/vice/etc/modload/libafs
686 Verified with ls.
687
688 Note: the SunOS support is no longer maintained.
689
690 UW_HAS_NSC If this environment variable has a value of "Y" or "y",
691 lsof will be configured for a UnixWare 7.1.1 or above
692 NonStop Cluster (NSC) system.
693
694 default: tested via /bin/node_self
695
696 Vic Abell <[email protected]>
697 October 13, 2014