Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
L
libzmq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
libzmq
Commits
ac777bad
Unverified
Commit
ac777bad
authored
Feb 10, 2018
by
Simon Giesecke
Committed by
GitHub
Feb 10, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2938 from bluca/format_autotools
Problem: make format-check not implemented with autotools
parents
504e6d0e
d832267e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
64 additions
and
0 deletions
+64
-0
Makefile.am
Makefile.am
+51
-0
configure.ac
configure.ac
+13
-0
No files found.
Makefile.am
View file @
ac777bad
...
...
@@ -882,6 +882,57 @@ MAINTAINERCLEANFILES = \
$(srcdir)
/configure
\
`
find
"
$(srcdir)
"
-type
f
-name
Makefile.in
-print
`
if
WITH_CLANG_FORMAT
ALL_SOURCE_FILES
=
$
(
wildcard
\
$(top_srcdir)
/src/
*
.c
\
$(top_srcdir)
/src/
*
.cc
\
$(top_srcdir)
/src/
*
.cpp
\
$(top_srcdir)
/src/
*
.h
\
$(top_srcdir)
/src/
*
.hpp
\
$(top_srcdir)
/tests/
*
.c
\
$(top_srcdir)
/tests/
*
.cc
\
$(top_srcdir)
/tests/
*
.cpp
\
$(top_srcdir)
/tests/
*
.h
\
$(top_srcdir)
/tests/
*
.hpp
\
$(top_srcdir)
/perf/
*
.c
\
$(top_srcdir)
/perf/
*
.cc
\
$(top_srcdir)
/perf/
*
.cpp
\
$(top_srcdir)
/perf/
*
.h
\
$(top_srcdir)
/perf/
*
.hpp
\
$(top_srcdir)
/tools/
*
.c
\
$(top_srcdir)
/tools/
*
.cc
\
$(top_srcdir)
/tools/
*
.cpp
\
$(top_srcdir)
/tools/
*
.h
\
$(top_srcdir)
/tools/
*
.hpp
\
$(top_srcdir)
/include/
*
.h
\
)
# Check if any sources need to be fixed, report the filenames and an error code
clang-format-check
:
$(ALL_SOURCE_FILES)
@
FAILED
=
0
;
IFS
=
";"
;
IDS
=
"
`
printf
'\n\b'
`
"
;
export
IFS IDS
;
\
for
FILE
in
$(ALL_SOURCE_FILES)
;
do
\
test
-s
$$
FILE
||
continue
;
\
$(CLANG_FORMAT)
-style
=
file
-output-replacements-xml
"
$$
FILE"
|
grep
"<replacement "
>
/dev/null
&&
\
{
echo
"
$$
FILE is not correctly formatted"
>
&2
;
FAILED
=
1
;
}
;
\
done
;
\
if
test
"
$$
FAILED"
!=
0
;
then
\
exit
1
;
\
fi
# Change source formatting
clang-format
:
$(ALL_SOURCE_FILES)
$(CLANG_FORMAT)
-style
=
file
-i
$(ALL_SOURCE_FILES)
# Change source formatting AND report the diff
clang-format-diff
:
clang-format
git diff
$(ALL_SOURCE_FILES)
else
clang-format clang-format-check clang-format-diff
:
@
echo
"Install the clang-format program, reconfigure and re-run this request"
@
exit
1
endif
@CODE_COVERAGE_RULES@
dist-hook
:
...
...
configure.ac
View file @
ac777bad
...
...
@@ -800,6 +800,19 @@ if test "x$enable_libunwind" != "xno"; then
])
fi
# See if clang-format is in PATH; the result unblocks the relevant recipes
WITH_CLANG_FORMAT=""
AS_IF([test x"$CLANG_FORMAT" = x],
[AC_PATH_PROG([CLANG_FORMAT], [clang-format], [])],
[AC_CHECK_PROG([WITH_CLANG_FORMAT], [$CLANG_FORMAT], [true], [fail])])
AS_IF([test x"$CLANG_FORMAT" != x && test x"$WITH_CLANG_FORMAT" = x],
[AS_IF([test -x "$CLANG_FORMAT"],
[WITH_CLANG_FORMAT=true],
[AC_CHECK_PROG([WITH_CLANG_FORMAT], [$CLANG_FORMAT], [true], [false])])])
AS_IF([test "$WITH_CLANG_FORMAT" = fail],
[AC_MSG_ERROR([Caller explicitly referenced CLANG_FORMAT=$CLANG_FORMAT which was not found])])
AM_CONDITIONAL([WITH_CLANG_FORMAT], [$WITH_CLANG_FORMAT])
# Subst LIBZMQ_EXTRA_CFLAGS & CXXFLAGS & LDFLAGS
AC_SUBST(LIBZMQ_EXTRA_CFLAGS)
AC_SUBST(LIBZMQ_EXTRA_CXXFLAGS)
...
...
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