Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
ccan
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mirror
ccan
Commits
27b8937c
Commit
27b8937c
authored
Mar 01, 2011
by
Rusty Russell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ccanlint: --compiler and --cflags options.
parent
104125b2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
7 deletions
+19
-7
tools/ccanlint/ccanlint.c
tools/ccanlint/ccanlint.c
+18
-6
tools/ccanlint/ccanlint.h
tools/ccanlint/ccanlint.h
+1
-1
No files found.
tools/ccanlint/ccanlint.c
View file @
27b8937c
...
@@ -43,8 +43,8 @@ static struct btree *info_exclude;
...
@@ -43,8 +43,8 @@ static struct btree *info_exclude;
static
unsigned
int
timeout
;
static
unsigned
int
timeout
;
/* These are overridden at runtime if we can find config.h */
/* These are overridden at runtime if we can find config.h */
c
onst
char
*
compiler
=
CCAN_COMPILER
;
c
har
*
compiler
=
NULL
;
c
onst
char
*
cflags
=
CCAN_CFLAGS
;
c
har
*
cflags
=
NULL
;
const
char
*
config_header
;
const
char
*
config_header
;
...
@@ -552,20 +552,28 @@ static void read_config_header(void)
...
@@ -552,20 +552,28 @@ static void read_config_header(void)
if
(
!
get_token
(
line
,
"define"
))
if
(
!
get_token
(
line
,
"define"
))
continue
;
continue
;
sym
=
get_symbol_token
(
lines
,
line
);
sym
=
get_symbol_token
(
lines
,
line
);
if
(
streq
(
sym
,
"CCAN_COMPILER"
))
{
if
(
streq
(
sym
,
"CCAN_COMPILER"
)
&&
!
compiler
)
{
compiler
=
demangle_string
(
lines
[
i
]);
compiler
=
demangle_string
(
lines
[
i
]);
if
(
!
compiler
)
errx
(
1
,
"%s:%u:could not parse CCAN_COMPILER"
,
fname
,
i
+
1
);
if
(
verbose
>
1
)
if
(
verbose
>
1
)
printf
(
"%s: compiler set to '%s'
\n
"
,
printf
(
"%s: compiler set to '%s'
\n
"
,
fname
,
compiler
);
fname
,
compiler
);
}
else
if
(
streq
(
sym
,
"CCAN_CFLAGS"
))
{
}
else
if
(
streq
(
sym
,
"CCAN_CFLAGS"
)
&&
!
cflags
)
{
cflags
=
demangle_string
(
lines
[
i
]);
cflags
=
demangle_string
(
lines
[
i
]);
if
(
!
cflags
)
errx
(
1
,
"%s:%u:could not parse CCAN_CFLAGS"
,
fname
,
i
+
1
);
if
(
verbose
>
1
)
if
(
verbose
>
1
)
printf
(
"%s: compiler flags set to '%s'
\n
"
,
printf
(
"%s: compiler flags set to '%s'
\n
"
,
fname
,
cflags
);
fname
,
cflags
);
}
}
}
}
if
(
!
compiler
||
!
cflags
)
if
(
!
compiler
)
errx
(
1
,
"Problem parsing %s"
,
fname
);
compiler
=
CCAN_COMPILER
;
if
(
!
cflags
)
compiler
=
CCAN_CFLAGS
;
}
}
int
main
(
int
argc
,
char
*
argv
[])
int
main
(
int
argc
,
char
*
argv
[])
...
@@ -605,6 +613,10 @@ int main(int argc, char *argv[])
...
@@ -605,6 +613,10 @@ int main(int argc, char *argv[])
opt_register_arg
(
"--target <testname>"
,
opt_set_charp
,
opt_register_arg
(
"--target <testname>"
,
opt_set_charp
,
NULL
,
&
target
,
NULL
,
&
target
,
"only run one test (and its prerequisites)"
);
"only run one test (and its prerequisites)"
);
opt_register_arg
(
"--compiler <compiler>"
,
opt_set_charp
,
NULL
,
&
compiler
,
"set the compiler"
);
opt_register_arg
(
"--cflags <flags>"
,
opt_set_charp
,
NULL
,
&
cflags
,
"set the compiler flags"
);
opt_register_noarg
(
"-?|-h|--help"
,
opt_usage_and_exit
,
opt_register_noarg
(
"-?|-h|--help"
,
opt_usage_and_exit
,
"
\n
A program for checking and guiding development"
"
\n
A program for checking and guiding development"
" of CCAN modules."
,
" of CCAN modules."
,
...
...
tools/ccanlint/ccanlint.h
View file @
27b8937c
...
@@ -222,7 +222,7 @@ extern bool safe_mode;
...
@@ -222,7 +222,7 @@ extern bool safe_mode;
extern
const
char
*
ccan_dir
;
extern
const
char
*
ccan_dir
;
/* Compiler and CFLAGS, from config.h if available. */
/* Compiler and CFLAGS, from config.h if available. */
extern
c
onst
c
har
*
compiler
,
*
cflags
;
extern
char
*
compiler
,
*
cflags
;
/* Contents of config.h (or NULL if not found) */
/* Contents of config.h (or NULL if not found) */
extern
const
char
*
config_header
;
extern
const
char
*
config_header
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment