adds build, adds the play_sin ccalls to portaudio.jl for testing
This commit is contained in:
parent
266bd6ef3e
commit
0d89ddb532
3 changed files with 19 additions and 2 deletions
13
deps/build.jl
vendored
Normal file
13
deps/build.jl
vendored
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
using BinDeps
|
||||||
|
|
||||||
|
ENV["JULIA_ROOT"] = abspath(JULIA_HOME, "../../")
|
||||||
|
|
||||||
|
cd(joinpath(Pkg.dir(), "PortAudio", "deps", "src") )
|
||||||
|
run(`make`)
|
||||||
|
if (!ispath("../usr"))
|
||||||
|
run(`mkdir ../usr`)
|
||||||
|
end
|
||||||
|
if (!ispath("../usr/lib"))
|
||||||
|
run(`mkdir ../usr/lib`)
|
||||||
|
end
|
||||||
|
run(`mv libportaudio_shim.$(BinDeps.shlib_ext) ../usr/lib`)
|
4
deps/src/Makefile
vendored
4
deps/src/Makefile
vendored
|
@ -37,12 +37,12 @@ else
|
||||||
SHLIB_EXT = so
|
SHLIB_EXT = so
|
||||||
endif
|
endif
|
||||||
|
|
||||||
default: portaudio_shim.$(SHLIB_EXT)
|
default: libportaudio_shim.$(SHLIB_EXT)
|
||||||
|
|
||||||
%.o: %.c
|
%.o: %.c
|
||||||
$(CC) $< -fPIC -c -o $@ $(INC) $(CFLAGS) $(FLAGS)
|
$(CC) $< -fPIC -c -o $@ $(INC) $(CFLAGS) $(FLAGS)
|
||||||
|
|
||||||
portaudio_shim.$(SHLIB_EXT): $(OBJS)
|
libportaudio_shim.$(SHLIB_EXT): $(OBJS)
|
||||||
$(CC) $(OBJS) -rdynamic -shared -o $@ $(LDFLAGS) $(LIBS)
|
$(CC) $(OBJS) -rdynamic -shared -o $@ $(LDFLAGS) $(LIBS)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
|
|
@ -28,9 +28,13 @@ function deinit()
|
||||||
end
|
end
|
||||||
|
|
||||||
function play_sin()
|
function play_sin()
|
||||||
|
err = ccall((:play_sin, "libportaudio_shim"), PaError, ())
|
||||||
|
handle_status(err)
|
||||||
end
|
end
|
||||||
|
|
||||||
function stop_sin()
|
function stop_sin()
|
||||||
|
err = ccall((:stop_sin, "libportaudio_shim"), PaError, ())
|
||||||
|
handle_status(err)
|
||||||
end
|
end
|
||||||
|
|
||||||
end # module PortAudio
|
end # module PortAudio
|
||||||
|
|
Loading…
Reference in a new issue