Skip to content

Commit

Permalink
* Build libdc1394 for the Windows platform as well (issue bytedeco/p…
Browse files Browse the repository at this point in the history
  • Loading branch information
saudet committed Apr 21, 2016
1 parent cdbcbfe commit 3abd1d6
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

* Build libdc1394 for the Windows platform as well ([issue bytedeco/procamcalib#4](https://github.com/bytedeco/procamcalib/issues/4))
* Lower Maven prerequisite in the `pom.xml` file to 3.0 ([issue bytedeco/javacpp#93](https://github.com/bytedeco/javacpp/issues/93))
* Include the `Descriptor` and `Message` APIs in the presets for Caffe ([issue #196](https://github.com/bytedeco/javacpp-presets/issues/196))
* Prevent creating text relocations for shared libraries on Android ([issue bytedeco/javacv#245](https://github.com/bytedeco/javacv/issues/245))
Expand Down
18 changes: 18 additions & 0 deletions libdc1394/cppbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,24 @@ case $PLATFORM in
make -j4
make install-strip
;;
windows-x86)
export C_INCLUDE_PATH="/c/Program Files (x86)/CMU/1394Camera/include/"
mkdir -p "$INSTALL_PATH/bin"
cp "/c/Program Files (x86)/CMU/1394Camera/lib/1394camera.dll" "$INSTALL_PATH/bin/lib1394camera.dll"
export LIBRARY_PATH="$INSTALL_PATH/bin/"
CC="gcc -m32 -static-libgcc" ./configure --prefix=$INSTALL_PATH --enable-shared --disable-static
make -j4
make install-strip
;;
windows-x86_64)
export C_INCLUDE_PATH="/c/Program Files (x86)/CMU/1394Camera/include/"
mkdir -p "$INSTALL_PATH/bin"
cp "/c/Program Files (x86)/CMU/1394Camera/lib64/x64/1394camera.dll" "$INSTALL_PATH/bin/lib1394camera.dll"
export LIBRARY_PATH="$INSTALL_PATH/bin/"
CC="gcc -m64 -static-libgcc" ./configure --prefix=$INSTALL_PATH --enable-shared --disable-static
make -j4
make install-strip
;;
*)
echo "Error: Platform \"$PLATFORM\" is not supported"
;;
Expand Down
30 changes: 30 additions & 0 deletions libdc1394/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,34 @@
</plugins>
</build>

<profiles>
<profile>
<id>mingw</id>
<activation>
<os><family>windows</family></os>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.bytedeco</groupId>
<artifactId>javacpp</artifactId>
<configuration>
<properties>${javacpp.platform}-mingw</properties>
<compilerOptions>
<compilerOption>-static-libgcc</compilerOption>
<compilerOption>-static-libstdc++</compilerOption>
<compilerOption>-Wl,-Bstatic</compilerOption>
<compilerOption>-lstdc++</compilerOption>
<compilerOption>-lgcc</compilerOption>
<compilerOption>-lgcc_eh</compilerOption>
<compilerOption>-lpthread</compilerOption>
<compilerOption>-Wl,-Bdynamic</compilerOption>
</compilerOptions>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@
* @author Samuel Audet
*/
@Properties(target="org.bytedeco.javacpp.dc1394", value={
@Platform(value={"linux", "macosx"}, include={"<poll.h>", "<dc1394/dc1394.h>", "<dc1394/types.h>", "<dc1394/log.h>",
@Platform(not="android", include={"<poll.h>", "<dc1394/dc1394.h>", "<dc1394/types.h>", "<dc1394/log.h>",
"<dc1394/camera.h>", "<dc1394/control.h>", "<dc1394/capture.h>", "<dc1394/conversions.h>", "<dc1394/format7.h>",
"<dc1394/iso.h>", "<dc1394/register.h>", "<dc1394/video.h>", "<dc1394/utils.h>"}, link="dc1394@.22", preload="libusb-1.0") })
"<dc1394/iso.h>", "<dc1394/register.h>", "<dc1394/video.h>", "<dc1394/utils.h>"}, link="dc1394@.22", preload="libusb-1.0"),
@Platform(value="windows", preload={"libdc1394-22", "libusb-1.0"}) })
public class dc1394 implements InfoMapper {
public void map(InfoMap infoMap) {
infoMap.put(new Info("poll.h").skip())
Expand All @@ -60,7 +61,7 @@ public void map(InfoMap infoMap) {
POLLHUP = 0x010,
POLLNVAL = 0x020;

public static class pollfd extends Pointer {
@Platform(not="windows") public static class pollfd extends Pointer {
static { Loader.load(); }
public pollfd() { allocate(); }
public pollfd(long size) { allocateArray(size); }
Expand All @@ -77,7 +78,7 @@ public static class pollfd extends Pointer {
public native short revents(); public native pollfd revents(short fd);
}

public native static int poll(pollfd fds, @Cast("nfds_t") long nfds, int timeout);
@Platform(not="windows") public native static int poll(pollfd fds, @Cast("nfds_t") long nfds, int timeout);

public static abstract class dc1394video_frame_t_abstract extends Pointer {
public dc1394video_frame_t_abstract() { }
Expand Down

0 comments on commit 3abd1d6

Please sign in to comment.