Skip to content

Commit f06d408

Browse files
committed
Depends on a local libdill copy
We temporarily rley on a copy of libdill, due to a too rare availability in traditionnal distros
1 parent 9e98e5d commit f06d408

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+6880
-3
lines changed

CMakeLists.txt

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,22 @@ endif()
8282

8383
find_package(PkgConfig)
8484
pkg_check_modules(GLIB2 REQUIRED glib-2.0 gthread-2.0 gmodule-2.0)
85-
pkg_check_modules(DILL REQUIRED libdill)
8685

86+
add_custom_target(
87+
libdill_s
88+
ALL
89+
COMMAND mkdir -p ${CMAKE_BINARY_DIR}/vendor/sustrik/libdill
90+
COMMAND lndir ${CMAKE_SOURCE_DIR}/vendor/sustrik/libdill
91+
COMMAND ./autogen.sh
92+
COMMAND ./configure --enable-static --disable-shared
93+
COMMAND make
94+
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/vendor/sustrik/libdill
95+
COMMENT "Building libdill")
8796

8897
set(CMAKE_LIBRARY_PATH "")
8998
set(CMAKE_INCLUDE_PATH "")
9099
include_directories(AFTER
91-
${DILL_INCLUDE_DIRS}
100+
${CMAKE_SOURCE_DIR}/vendor/sustrik/libdill
92101
${GLIB2_INCLUDE_DIRS})
93102

94103
add_definitions(-DLOG_DOMAIN="gridinit")
@@ -102,7 +111,12 @@ add_executable(gridinit
102111
main/uid.c
103112
main/utils.c)
104113
target_link_libraries(gridinit
105-
${GLIB2_LIBRARIES} ${DILL_STATIC_LIBRARIES})
114+
${GLIB2_LIBRARIES}
115+
${CMAKE_BINARY_DIR}/vendor/sustrik/libdill/.libs/libdill.a
116+
-pthread -lrt)
117+
add_dependencies(gridinit
118+
libdill_s)
119+
106120

107121
add_executable(gridinit_cmd
108122
main/gridinit_cmd.c

vendor/sustrik/libdill/AUTHORS

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
Full list of copyright holders:
2+
3+
Alex Cornejo <acornejo@gmail.com>
4+
Bent Cardan <bent@nothingsatisfies.com>
5+
Constantine Tarasenkov <constantine@protonmail.com>
6+
Eli Riggs <eli@rje.li>
7+
Gonzalo Diethelm <gonzalo.diethelm@diethelm.org>*
8+
Jean-Francois Smigielski <jf.smigielski@gmail.com>
9+
Jim Jagielski <jimjag@gmail.com>
10+
Jim Schimpf <jim.schimpf@gmail.com>
11+
Luca Barbato <luca.barbato@gmail.com>
12+
Martin Lucina <martin@lucina.net>
13+
Martin Sustrik <sustrik@250bpm.com>*
14+
Maximilian Pudelko <maximilian.pudelko@gmail.com>
15+
Michael Gehring <mg@ebfe.org>
16+
Nick Desaulniers <nick@mozilla.com>
17+
Nickolay Ilyushin <nickolay02@inbox.ru>
18+
Nir Soffer <nsoffer@redhat.com>
19+
Paul Banks <banks@banksdesigns.co.uk>
20+
Petr Skocik <pskocik@gmail.com>
21+
Sergey Avseyev <sergey.avseyev@gmail.com>
22+
Tai Chi Minh Ralph Eastwood <tcmreastwood@gmail.com>*
23+
Yue Xu <red_angelx@qq.com>
24+
Zach Banks <zbanks@mit.edu>
25+
26+
* Future patches by this author are submitted under the MIT/X11 license
27+
28+
Copyrights for DNS resolution library in dns subdirectory are owned by:
29+
William Ahern <william@25thandClement.com>

vendor/sustrik/libdill/COPYING

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
2+
Permission is hereby granted, free of charge, to any person obtaining a copy
3+
of this software and associated documentation files (the "Software"),
4+
to deal in the Software without restriction, including without limitation
5+
the rights to use, copy, modify, merge, publish, distribute, sublicense,
6+
and/or sell copies of the Software, and to permit persons to whom
7+
the Software is furnished to do so, subject to the following conditions:
8+
9+
The above copyright notice and this permission notice shall be included
10+
in all copies or substantial portions of the Software.
11+
12+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
15+
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
17+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
18+
IN THE SOFTWARE.
19+

vendor/sustrik/libdill/Makefile.am

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
#
2+
# Copyright (c) 2016 Martin Sustrik All rights reserved.
3+
# Copyright (c) 2013 Luca Barbato
4+
#
5+
# Permission is hereby granted, free of charge, to any person obtaining a copy
6+
# of this software and associated documentation files (the "Software"),
7+
# to deal in the Software without restriction, including without limitation
8+
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
9+
# and/or sell copies of the Software, and to permit persons to whom
10+
# the Software is furnished to do so, subject to the following conditions:
11+
#
12+
# The above copyright notice and this permission notice shall be included
13+
# in all copies or substantial portions of the Software.
14+
#
15+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18+
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20+
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21+
# IN THE SOFTWARE.
22+
23+
ACLOCAL_AMFLAGS = -I m4
24+
25+
################################################################################
26+
# libdill library #
27+
################################################################################
28+
29+
dillincludedir = $(includedir)
30+
dillinclude_HEADERS = libdill.h libdillimpl.h
31+
32+
lib_LTLIBRARIES = libdill.la
33+
34+
libdill_la_SOURCES = \
35+
ipc.c \
36+
iol.h \
37+
iol.c \
38+
fd.h \
39+
fd.c \
40+
bsock.c \
41+
chan.c \
42+
cr.h \
43+
cr.c \
44+
epoll.h.inc \
45+
epoll.c.inc \
46+
handle.h \
47+
handle.c \
48+
kqueue.h.inc \
49+
kqueue.c.inc \
50+
libdill.c \
51+
list.h \
52+
now.h \
53+
now.c \
54+
poll.h.inc \
55+
poll.c.inc \
56+
pollset.h \
57+
pollset.c \
58+
qlist.h \
59+
rbtree.h \
60+
rbtree.c \
61+
slist.h \
62+
stack.h \
63+
stack.c \
64+
ctx.h \
65+
ctx.c \
66+
utils.h \
67+
utils.c
68+
69+
libdill_la_LDFLAGS = \
70+
-no-undefined -version-info @DILL_LIBTOOL_VERSION@ @PTHREAD_LIBS@
71+
72+
# Turn the source fortification in glibc off - otherwise it would panic
73+
# because of the stack pointer black magic in 'go' macro.
74+
libdill_la_CFLAGS = \
75+
@PTHREAD_CFLAGS@ \
76+
-fvisibility=hidden\
77+
-DDILL_EXPORTS \
78+
-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0
79+
80+
check_HEADERS = \
81+
tests/assert.h
82+
83+
LDADD = libdill.la
84+
85+
TESTS = $(check_PROGRAMS)
86+
87+
################################################################################
88+
# tutorials #
89+
################################################################################
90+
91+
noinst_PROGRAMS =
92+
93+
################################################################################
94+
# additional packaging-related stuff #
95+
################################################################################
96+
97+
# Generate ChangeLog file from git.
98+
# Also, there's no git availabe when building from the source package and
99+
# thus no way to obtain package version. Therefore, package version is
100+
# saved into a file when building a source package.
101+
dist-hook:
102+
@if test -d "$(srcdir)/.git"; \
103+
then \
104+
echo Creating ChangeLog; \
105+
cd "$(top_srcdir)"; \
106+
(echo '# Generated by Makefile. Do not edit.'; echo; \
107+
./missing --run git log --decorate ) > ChangeLog.tmp; \
108+
mv -f ChangeLog.tmp $(top_distdir)/ChangeLog; \
109+
rm -f ChangeLog.tmp; \
110+
else \
111+
cp -f ChangeLog $(top_distdir)/ChangeLog || \
112+
echo Failed to generate ChangeLog >&2; \
113+
fi; \
114+
$(srcdir)/package_version.sh > $(distdir)/.version
115+
116+
EXTRA_DIST = \
117+
./abi_version.sh \
118+
./package_version.sh
119+
120+
CLEANFILES = *.gcno *.gcda dns/*.gcno dns/*.gcda tests/*.gcno tests/*.gcda
121+
122+
distclean-local:
123+
-rm -f config.h
124+

vendor/sustrik/libdill/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# libdill: Structured Concurrency for C
2+
3+
[![Build Status](https://travis-ci.org/sustrik/libdill.svg?branch=master)](https://travis-ci.org/sustrik/libdill)
4+
5+
## Documentation
6+
7+
For the documentation check the project website:
8+
9+
http://libdill.org
10+
11+
## License
12+
13+
Libdill is licensed under MIT/X11 license.

vendor/sustrik/libdill/abi_version.sh

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#!/bin/sh
2+
3+
# Copyright (c) 2013 Luca Barbato
4+
#
5+
# Permission is hereby granted, free of charge, to any person obtaining a copy
6+
# of this software and associated documentation files (the "Software"),
7+
# to deal in the Software without restriction, including without limitation
8+
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
9+
# and/or sell copies of the Software, and to permit persons to whom
10+
# the Software is furnished to do so, subject to the following conditions:
11+
#
12+
# The above copyright notice and this permission notice shall be included
13+
# in all copies or substantial portions of the Software.
14+
#
15+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18+
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20+
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21+
# IN THE SOFTWARE.
22+
23+
if [ ! -f libdill.h ]; then
24+
echo "abi_version.sh: error: libdill.h does not exist" 1>&2
25+
exit 1
26+
fi
27+
28+
CURRENT=`egrep '^#define +DILL_VERSION_CURRENT +[0-9]+$' libdill.h`
29+
REVISION=`egrep '^#define +DILL_VERSION_REVISION +[0-9]+$' libdill.h`
30+
AGE=`egrep '^#define +DILL_VERSION_AGE +[0-9]+$' libdill.h`
31+
32+
if [ -z "$CURRENT" -o -z "$REVISION" -o -z "$AGE" ]; then
33+
echo "abi_version.sh: error: could not extract version from libdill.h" 1>&2
34+
exit 1
35+
fi
36+
37+
CURRENT=`echo $CURRENT | awk '{ print $3 }'`
38+
REVISION=`echo $REVISION | awk '{ print $3 }'`
39+
AGE=`echo $AGE | awk '{ print $3 }'`
40+
41+
case $1 in
42+
-libtool)
43+
printf '%s' "$CURRENT:$REVISION:$AGE"
44+
;;
45+
*)
46+
printf '%s' "$CURRENT.$REVISION.$AGE"
47+
;;
48+
esac
49+

vendor/sustrik/libdill/autogen.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
3+
autoreconf -ifv

vendor/sustrik/libdill/bsock.c

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
/*
2+
3+
Copyright (c) 2017 Martin Sustrik
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"),
7+
to deal in the Software without restriction, including without limitation
8+
the rights to use, copy, modify, merge, publish, distribute, sublicense,
9+
and/or sell copies of the Software, and to permit persons to whom
10+
the Software is furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included
13+
in all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18+
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21+
IN THE SOFTWARE.
22+
23+
*/
24+
25+
#include <errno.h>
26+
#include <stddef.h>
27+
28+
#define DILL_DISABLE_RAW_NAMES
29+
#include "libdillimpl.h"
30+
#include "utils.h"
31+
32+
dill_unique_id(dill_bsock_type);
33+
34+
int dill_bsend(int s, const void *buf, size_t len, int64_t deadline) {
35+
struct dill_bsock_vfs *b = dill_hquery(s, dill_bsock_type);
36+
if(dill_slow(!b)) return -1;
37+
struct dill_iolist iol = {(void*)buf, len, NULL, 0};
38+
return b->bsendl(b, &iol, &iol, deadline);
39+
}
40+
41+
int dill_brecv(int s, void *buf, size_t len, int64_t deadline) {
42+
struct dill_bsock_vfs *b = dill_hquery(s, dill_bsock_type);
43+
if(dill_slow(!b)) return -1;
44+
struct dill_iolist iol = {buf, len, NULL, 0};
45+
return b->brecvl(b, &iol, &iol, deadline);
46+
}
47+
48+
int dill_bsendl(int s, struct dill_iolist *first, struct dill_iolist *last,
49+
int64_t deadline) {
50+
struct dill_bsock_vfs *b = dill_hquery(s, dill_bsock_type);
51+
if(dill_slow(!b)) return -1;
52+
if(dill_slow(!first || !last || last->iol_next)) {
53+
errno = EINVAL; return -1;}
54+
return b->bsendl(b, first, last, deadline);
55+
}
56+
57+
int dill_brecvl(int s, struct dill_iolist *first, struct dill_iolist *last,
58+
int64_t deadline) {
59+
struct dill_bsock_vfs *b = dill_hquery(s, dill_bsock_type);
60+
if(dill_slow(!b)) return -1;
61+
if(dill_slow((first && !last) || (!first && last) || last->iol_next)) {
62+
errno = EINVAL; return -1;}
63+
return b->brecvl(b, first, last, deadline);
64+
}
65+

0 commit comments

Comments
 (0)