Skip to content

Commit 36b7fe7

Browse files
committed
code: refactor automake into sub directories
Signed-off-by: Hans Zandbelt <[email protected]>
1 parent b117f05 commit 36b7fe7

File tree

11 files changed

+239
-188
lines changed

11 files changed

+239
-188
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,3 @@
2727
/Makefile.in
2828
/missing
2929
/test-driver
30-
/test-suite.log

Makefile.am

Lines changed: 5 additions & 177 deletions
Original file line numberDiff line numberDiff line change
@@ -1,189 +1,17 @@
11
ACLOCAL_AMFLAGS=-I m4
22

3-
noinst_LTLIBRARIES = libauth_openidc.la
4-
5-
libauth_openidc_la_SOURCES = \
6-
src/mod_auth_openidc.c \
7-
src/state.c \
8-
src/cfg/cfg.c \
9-
src/cfg/cache.c \
10-
src/cfg/provider.c \
11-
src/cfg/oauth.c \
12-
src/cfg/dir.c \
13-
src/cfg/parse.c \
14-
src/cfg/cmds.c \
15-
src/cache/file.c \
16-
src/cache/shm.c \
17-
src/cache/common.c \
18-
src/handle/authz.c \
19-
src/handle/content.c \
20-
src/handle/discovery.c \
21-
src/handle/dpop.c \
22-
src/handle/info.c \
23-
src/handle/jwks.c \
24-
src/handle/logout.c \
25-
src/handle/refresh.c \
26-
src/handle/request_uri.c \
27-
src/handle/request.c \
28-
src/handle/response.c \
29-
src/handle/revoke.c \
30-
src/handle/session_management.c \
31-
src/handle/userinfo.c \
32-
src/proto/auth.c \
33-
src/proto/discovery.c \
34-
src/proto/dpop.c \
35-
src/proto/id_token.c \
36-
src/proto/jwks.c \
37-
src/proto/jwt.c \
38-
src/proto/pkce.c \
39-
src/proto/profile.c \
40-
src/proto/proto.c \
41-
src/proto/request.c \
42-
src/proto/response.c \
43-
src/proto/state.c \
44-
src/proto/token.c \
45-
src/proto/userinfo.c \
46-
src/util/appinfo.c \
47-
src/util/base64.c \
48-
src/util/expr.c \
49-
src/util/file.c \
50-
src/util/html.c \
51-
src/util/jq.c \
52-
src/util/json.c \
53-
src/util/jwt.c \
54-
src/util/key.c \
55-
src/util/pcre_subst.c \
56-
src/util/random.c \
57-
src/util/url.c \
58-
src/util/util.c \
59-
src/metrics.c \
60-
src/oauth.c \
61-
src/http.c \
62-
src/session.c \
63-
src/metadata.c \
64-
src/jose.c
65-
66-
AM_CFLAGS = $(CODE_COVERAGE_CFLAGS) -DNAMEVER="@NAMEVER@" -I${top_srcdir}/src @APACHE_CFLAGS@ @OPENSSL_CFLAGS@ @CURL_CFLAGS@ @JANSSON_CFLAGS@ @CJOSE_CFLAGS@ @PCRE_CFLAGS@
67-
AM_CPPFLAGS = $(CODE_COVERAGE_CPPFLAGS) @APACHE_CPPFLAGS@
68-
AM_LDFLAGS = --coverage @APACHE_LDFLAGS@
69-
LIBADD = @APACHE_LIBS@ @OPENSSL_LIBS@ @CURL_LIBS@ @JANSSON_LIBS@ @CJOSE_LIBS@ @PCRE_LIBS@
70-
71-
if HAVE_LIBHIREDIS
72-
libauth_openidc_la_SOURCES += \
73-
src/cache/redis.c
74-
AM_CFLAGS += -DUSE_LIBHIREDIS @HIREDIS_CFLAGS@
75-
LIBADD += @HIREDIS_LIBS@
76-
endif
77-
78-
if HAVE_MEMCACHE
79-
AM_CFLAGS += -DUSE_MEMCACHE
80-
libauth_openidc_la_SOURCES += \
81-
src/cache/memcache.c
82-
endif
83-
84-
if HAVE_LIBJQ
85-
AM_CFLAGS += -DUSE_LIBJQ @JQ_CFLAGS@
86-
LIBADD += @JQ_LIBS@
87-
endif
88-
89-
if HAVE_LIBBROTLI
90-
AM_CFLAGS += -DUSE_LIBBROTLI @LIBBROTLIENC_CFLAGS@ @LIBBROTLIDEC_CFLAGS@
91-
LIBADD += @LIBBROTLIENC_LIBS@ @LIBBROTLIDEC_LIBS@
92-
endif
93-
94-
if HAVE_LIBZ
95-
AM_CFLAGS += -DUSE_ZLIB @ZLIB_CFLAGS@
96-
LIBADD += @ZLIB_LIBS@
97-
endif
98-
99-
noinst_HEADERS = \
100-
src/cfg/cfg.h \
101-
src/cfg/cfg_int.h \
102-
src/cfg/cache.h \
103-
src/cfg/provider.h \
104-
src/cfg/oauth.h \
105-
src/cfg/dir.h \
106-
src/cfg/parse.h \
107-
src/mod_auth_openidc.h \
108-
src/state.h \
109-
src/handle/handle.h \
110-
src/proto/proto.h \
111-
src/cache/cache.h \
112-
src/util/util.h \
113-
src/util/pcre_subst.h \
114-
src/oauth.h \
115-
src/metadata.h \
116-
src/session.h \
117-
src/jose.h \
118-
src/http.h \
119-
src/metrics.h \
120-
src/const.h
121-
122-
if HAVE_LIBHIREDIS
123-
noinst_HEADERS += \
124-
src/cache/redis.h
125-
endif
3+
SUBDIRS = src test
1264

1275
EXTRA_DIST = \
1286
README.md \
1297
ChangeLog \
1308
INSTALL \
1319
AUTHORS \
13210
LICENSE.txt \
133-
auth_openidc.conf \
134-
test/ecpriv.key \
135-
test/eccert.pem \
136-
test/private.pem \
137-
test/public.pem \
138-
test/certificate.pem \
139-
test/open-redirect-payload-list.txt
140-
141-
noinst_DATA = mod_auth_openidc.la
142-
143-
mod_auth_openidc.la: libauth_openidc.la
144-
${APXS} -c -o $@ libauth_openidc.la ${AM_CFLAGS} ${LIBADD}
145-
146-
install-exec-local:
147-
${INSTALL} -d $(DESTDIR)@APACHE_MODULEDIR@
148-
${INSTALL} -p -m 755 .libs/mod_auth_openidc.so $(DESTDIR)@APACHE_MODULEDIR@/mod_auth_openidc.so
149-
150-
uninstall-local:
151-
rm -f $(DESTDIR)@APACHE_MODULEDIR@/mod_auth_openidc.so mod_auth_openidc.la
152-
153-
clean-local:
154-
rm -f mod_auth_openidc.la test/*.gcno
155-
156-
LDADD = $(CODE_COVERAGE_LIBS) libauth_openidc.la ${LIBADD}
157-
158-
noinst_PROGRAMS = test/test-cmd
159-
test_test_cmd_SOURCES = test/test-cmd.c test/stub.c
160-
test_test_cmd_CFLAGS = ${AM_CFLAGS} -fPIC
161-
162-
TESTS = test/test
163-
164-
test_test_SOURCES = test/test.c test/stub.c
165-
test_test_CFLAGS = ${AM_CFLAGS} -fPIC
166-
167-
if HAVE_CHECK
168-
169-
noinst_HEADERS += test/helper.h
170-
171-
TESTS += test/test_jose
172-
test_test_jose_CFLAGS = @CHECK_CFLAGS@ ${AM_CFLAGS}
173-
test_test_jose_LDADD = @CHECK_LIBS@ ${LDADD}
174-
test_test_jose_SOURCES = test/test_jose.c test/helper.c test/stub.c
175-
176-
TESTS += test/test_util
177-
test_test_util_CFLAGS = @CHECK_CFLAGS@ ${AM_CFLAGS}
178-
test_test_util_LDADD = @CHECK_LIBS@ ${LDADD}
179-
test_test_util_SOURCES = test/test_util.c test/helper.c test/stub.c
180-
181-
endif
182-
183-
check_PROGRAMS = $(TESTS)
184-
185-
CODE_COVERAGE_LCOV_SHOPTS = --ignore-errors inconsistent --ignore-errors unused
186-
@CODE_COVERAGE_RULES@
11+
auth_openidc.conf
18712

18813
clang-format:
18914
clang-format -style=file -i $$(find . -maxdepth 3 -name *.[ch])
15+
16+
check-code-coverage: check
17+
${MAKE} -C test $@

configure.ac

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,5 +200,9 @@ AC_SUBST(CHECK_CFLAGS)
200200
AC_SUBST(CHECK_LIBS)
201201

202202
# Create Makefile from Makefile.in
203-
AC_CONFIG_FILES([Makefile])
203+
AC_CONFIG_FILES([
204+
Makefile
205+
src/Makefile
206+
test/Makefile
207+
])
204208
AC_OUTPUT

src/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@
1010
/config.h.in
1111
/config.h.in~
1212
/stamp-h1
13+
/Makefile
14+
/Makefile.in

src/Makefile.am

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
AM_CFLAGS = $(CODE_COVERAGE_CFLAGS) -DNAMEVER="@NAMEVER@" @APACHE_CFLAGS@ @OPENSSL_CFLAGS@ @CURL_CFLAGS@ @JANSSON_CFLAGS@ @CJOSE_CFLAGS@ @PCRE_CFLAGS@
2+
AM_CPPFLAGS = $(CODE_COVERAGE_CPPFLAGS) @APACHE_CPPFLAGS@
3+
AM_LDFLAGS = --coverage @APACHE_LDFLAGS@
4+
LIBADD = $(CODE_COVERAGE_LIBS) @APACHE_LIBS@ @OPENSSL_LIBS@ @CURL_LIBS@ @JANSSON_LIBS@ @CJOSE_LIBS@ @PCRE_LIBS@
5+
6+
if HAVE_LIBHIREDIS
7+
AM_CFLAGS += -DUSE_LIBHIREDIS @HIREDIS_CFLAGS@
8+
LIBADD += @HIREDIS_LIBS@
9+
endif
10+
11+
if HAVE_MEMCACHE
12+
AM_CFLAGS += -DUSE_MEMCACHE
13+
endif
14+
15+
if HAVE_LIBJQ
16+
AM_CFLAGS += -DUSE_LIBJQ @JQ_CFLAGS@
17+
LIBADD += @JQ_LIBS@
18+
endif
19+
20+
if HAVE_LIBBROTLI
21+
AM_CFLAGS += -DUSE_LIBBROTLI @LIBBROTLIENC_CFLAGS@ @LIBBROTLIDEC_CFLAGS@
22+
LIBADD += @LIBBROTLIENC_LIBS@ @LIBBROTLIDEC_LIBS@
23+
endif
24+
25+
if HAVE_LIBZ
26+
AM_CFLAGS += -DUSE_ZLIB @ZLIB_CFLAGS@
27+
LIBADD += @ZLIB_LIBS@
28+
endif
29+
30+
noinst_LTLIBRARIES = libauth_openidc.la
31+
32+
libauth_openidc_la_SOURCES = \
33+
mod_auth_openidc.c \
34+
state.c \
35+
cfg/cfg.c \
36+
cfg/cache.c \
37+
cfg/provider.c \
38+
cfg/oauth.c \
39+
cfg/dir.c \
40+
cfg/parse.c \
41+
cfg/cmds.c \
42+
cache/file.c \
43+
cache/shm.c \
44+
cache/common.c \
45+
handle/authz.c \
46+
handle/content.c \
47+
handle/discovery.c \
48+
handle/dpop.c \
49+
handle/info.c \
50+
handle/jwks.c \
51+
handle/logout.c \
52+
handle/refresh.c \
53+
handle/request_uri.c \
54+
handle/request.c \
55+
handle/response.c \
56+
handle/revoke.c \
57+
handle/session_management.c \
58+
handle/userinfo.c \
59+
proto/auth.c \
60+
proto/discovery.c \
61+
proto/dpop.c \
62+
proto/id_token.c \
63+
proto/jwks.c \
64+
proto/jwt.c \
65+
proto/pkce.c \
66+
proto/profile.c \
67+
proto/proto.c \
68+
proto/request.c \
69+
proto/response.c \
70+
proto/state.c \
71+
proto/token.c \
72+
proto/userinfo.c \
73+
util/appinfo.c \
74+
util/base64.c \
75+
util/expr.c \
76+
util/file.c \
77+
util/html.c \
78+
util/jq.c \
79+
util/json.c \
80+
util/jwt.c \
81+
util/key.c \
82+
util/pcre_subst.c \
83+
util/random.c \
84+
util/url.c \
85+
util/util.c \
86+
metrics.c \
87+
oauth.c \
88+
http.c \
89+
session.c \
90+
metadata.c \
91+
jose.c
92+
93+
if HAVE_LIBHIREDIS
94+
libauth_openidc_la_SOURCES += \
95+
cache/redis.c
96+
endif
97+
98+
if HAVE_MEMCACHE
99+
libauth_openidc_la_SOURCES += \
100+
cache/memcache.c
101+
endif
102+
103+
noinst_HEADERS = \
104+
cfg/cfg.h \
105+
cfg/cfg_int.h \
106+
cfg/cache.h \
107+
cfg/provider.h \
108+
cfg/oauth.h \
109+
cfg/dir.h \
110+
cfg/parse.h \
111+
mod_auth_openidc.h \
112+
state.h \
113+
handle/handle.h \
114+
proto/proto.h \
115+
cache/cache.h \
116+
util/util.h \
117+
util/pcre_subst.h \
118+
oauth.h \
119+
metadata.h \
120+
session.h \
121+
jose.h \
122+
http.h \
123+
metrics.h \
124+
const.h
125+
126+
if HAVE_LIBHIREDIS
127+
noinst_HEADERS += \
128+
cache/redis.h
129+
endif
130+
131+
noinst_DATA = mod_auth_openidc.la
132+
133+
mod_auth_openidc.la: libauth_openidc.la
134+
${APXS} -c -o $@ libauth_openidc.la ${AM_CFLAGS} ${LIBADD}
135+
136+
install-exec-local:
137+
${INSTALL} -d $(DESTDIR)@APACHE_MODULEDIR@
138+
${INSTALL} -p -m 755 .libs/mod_auth_openidc.so $(DESTDIR)@APACHE_MODULEDIR@/mod_auth_openidc.so
139+
140+
uninstall-local:
141+
rm -f $(DESTDIR)@APACHE_MODULEDIR@/mod_auth_openidc.so mod_auth_openidc.la
142+
143+
clean-local:
144+
rm -f mod_auth_openidc.la

test/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,5 @@
1212
/*.gcda
1313
/test_jose
1414
/test_util
15+
/Makefile
16+
/Makefile.in

0 commit comments

Comments
 (0)