This source file includes following definitions.
- main
1
2
3
4
5
6
7
8
9
10 #ifdef HAVE_UNISTD_H
11 #include <unistd.h>
12 #endif
13 #include <stdio.h>
14 #include <stdlib.h>
15
16 int main(int argc, char *argv[]) {
17 char *prog, *arch, *def, *version, *lib;
18 char s[1024];
19 char name[16];
20 int current, age, revision;
21
22 if (argc != 6) {
23 fprintf(stderr,"bad number of arguments");
24 exit(EXIT_FAILURE);
25 }
26
27 prog = argv[1];
28 arch = argv[2];
29 def = argv[3];
30 version = argv[4];
31 lib = argv[5];
32
33 if (sscanf(version, "%d:%d:%d", ¤t, &revision, &age) != 3)
34 exit(EXIT_FAILURE);
35
36 _snprintf(name, sizeof(name), "libhwloc-%d", current - age);
37 printf("using soname %s\n", name);
38
39 _snprintf(s, sizeof(s), "\"%s\" /machine:%s /def:%s /name:%s /out:%s",
40 prog, arch, def, name, lib);
41 if (system(s)) {
42 fprintf(stderr, "%s failed\n", s);
43 exit(EXIT_FAILURE);
44 }
45
46 exit(EXIT_SUCCESS);
47 }