Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
shrapnel
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
shrapnel
Commits
2581dee1
Commit
2581dee1
authored
Dec 05, 2013
by
Amit Dev
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #59 from amitdev/master
fixes #58. Added proper check for libaio
parents
ce5d6356
a3e0e4bf
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
7 deletions
+26
-7
setup.py
setup.py
+12
-7
test/build/test_aio.c
test/build/test_aio.c
+14
-0
No files found.
setup.py
View file @
2581dee1
...
...
@@ -33,21 +33,26 @@ def newer(x, y):
def
exit_ok
(
status
):
return
os
.
WIFEXITED
(
status
)
and
os
.
WEXITSTATUS
(
status
)
==
0
def
compile_test
(
src
,
opts
=
''
):
src_path
=
'test/build/%s.c'
%
src
bin_path
=
'test/build/%s'
%
src
if
newer
(
src_path
,
bin_path
):
status
=
os
.
system
(
'gcc -o %s %s %s > /dev/null 2>&1'
%
(
bin_path
,
src_path
,
opts
))
if
not
exit_ok
(
status
):
return
False
status
=
os
.
system
(
bin_path
)
return
exit_ok
(
status
)
def
check_lio
():
if
os
.
getenv
(
'BUILDING'
)
is
not
None
:
# Doing this in a build environment.
# This is a terrible hack. However, there is no easy way to add
# arbitrary options to distutils.
return
True
if
newer
(
'test/build/test_lio.c'
,
'test/build/test_lio'
):
status
=
os
.
system
(
'gcc -o test/build/test_lio test/build/test_lio.c > /dev/null 2>&1'
)
if
not
exit_ok
(
status
):
return
False
status
=
os
.
system
(
'test/build/test_lio'
)
return
exit_ok
(
status
)
return
compile_test
(
'test_lio'
)
def
check_linux_aio
():
return
os
.
uname
()[
0
]
==
'Linux'
and
exit_ok
(
os
.
system
(
'ldconfig -p | grep libaio > /dev/null'
)
)
return
os
.
uname
()[
0
]
==
'Linux'
and
compile_test
(
'test_aio'
,
'-laio'
)
USE_LINUX_AIO
=
check_linux_aio
()
...
...
test/build/test_aio.c
0 → 100644
View file @
2581dee1
#include <libaio.h>
int
main
()
{
io_context_t
ctx
;
int
ret
;
ctx
=
0
;
ret
=
io_setup
(
128
,
&
ctx
);
if
(
ret
<
0
)
{
return
-
1
;
}
ret
=
io_destroy
(
ctx
);
return
0
;
}
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