Compile for Openbsd


#21

I’m following it but nothing has been built in lib/native/openbsd-x86-64/

That’s why I was asking, I tried to restart from the begining but no success


#22

You need to compile yourself libjnsctp and copy it then to that folder and then when building libjitsi it will embed that lib in the jar file. This is how all the other content about linux, windows, mac got there, somebody compiled it and moved it and committed it.


#23

Thank you for your answer but how should I compile libjnsctp ?
Where should I start ?

Compiling usrsctp doesn’t produce such binary
Compiling libjitsi doesn’t produce such binary

how should I compile libjnsctp ?


#24

ant sctp -Dusrsctp=/path/to/compiles/usersctp


#25

Hello;

I did what you said but still, I don’t understand.

I did create this directory but it’s empty

ls /usr/local/libjitsi/lib/native/openbsd-x86-64/

I did the command you told me

ant sctp -Dusrsctp=/usr/local/usrsctp/
Buildfile: /usr/local/libjitsi/build.xml
[maven-artifact:dependencies] [WARNING] POM for ‘org.osgi:org.osgi.core:pom:4.3.1:compile’ is invalid.
[maven-artifact:dependencies]
[maven-artifact:dependencies] Its dependencies (if any) will NOT be available to the current build.
[maven-artifact:dependencies] [WARNING] POM for ‘org.osgi:org.osgi.core:pom:4.3.1:compile’ is invalid.
[maven-artifact:dependencies]
[maven-artifact:dependencies] Its dependencies (if any) will NOT be available to the current build.
init-native:
-sctp-macosx:
-sctp-win:
-sctp-linux:
sctp:
BUILD SUCCESSFUL
Total time: 3 seconds

But I have warnings, and I don’t see what it did build because I have nothing in /usr/local/libjitsi/lib/native/openbsd-x86-64/

Earlier you talked aboutpom.xml and I added this

               openbsd-x86-64/libjnawtrenderer.so;
               openbsd-x86-64/libjnopenssl.so;
               openbsd-x86-64/libjnopus.so;
               openbsd-x86-64/libjnportaudio.so;
               openbsd-x86-64/libjnpulseaudio.so;
               openbsd-x86-64/libjnscreencapture.so;
               openbsd-x86-64/libjnsctp.so;
               openbsd-x86-64/libjnspeex.so;
               openbsd-x86-64/libjnvideo4linux2.so;
               openbsd-x86-64/libjnvpx.so;osname=OpenBSD;processor=x86-64,

What should I do exactly ? Are these warning a problem ? How to move forward ?


#26

You need to implement openbsd ant target for the compilation.


#27

Yes but how should I do that ?

I see in your previous comment

<target name="sctp" description="Build sctp shared library"
        depends="init-native,-sctp-macosx,-sctp-win,-sctp-linux"/>

So should I add -sctp-openbsd or something more complicated ?


#28

Yes, you should add a target, like the one -sctp-linux which compiles libsctp the openbsd way.


#29

Hello,

I added it but still got issues

ant sctp -Dusrsctp=/usr/local/usrsctp/
Buildfile: /usr/local/libjitsi/build.xml
[maven-artifact:dependencies] [WARNING] POM for ‘org.osgi:org.osgi.core:pom:4.3.1:compile’ is invalid.
[maven-artifact:dependencies]
[maven-artifact:dependencies] Its dependencies (if any) will NOT be available to the current build.
[maven-artifact:dependencies] [WARNING] POM for ‘org.osgi:org.osgi.core:pom:4.3.1:compile’ is invalid.
[maven-artifact:dependencies]
[maven-artifact:dependencies] Its dependencies (if any) will NOT be available to the current build.
init-native:
-sctp-macosx:
-sctp-win:
-sctp-linux:
-sctp-openbsd:
sctp:
BUILD SUCCESSFUL
Total time: 2 seconds

I added in src/native/build.xml

<!-- compile sctp
usrsctp - compile steps in README file-->
<target name="sctp" description="Build sctp shared library"
        depends="init-native,-sctp-macosx,-sctp-win,-sctp-linux,-sctp-openbsd"/>

#30

And what does target -sctp-openbsd looks like?


#31

I don’t understand what you meant.


#32

“-sctp-openbsd” is a target (an ant subroutine of tasks and commands), so you have to create it and define it. It’s not a command line option, it won’t exist if you don’t create it. Look the way “-sctp-linux” is constructed and create your own for openbsd.

https://ant.apache.org/manual/targets.html


#33

Hello,
Thank you for your answer but where should I create and define it ?
I src/native/build.xml ?

I added this but same result

<target name="-sctp-openbsd" if="is.running.openbsd">

    <fail message="usrsctp repository not set!" unless="usrsctp"/>

    <cc outtype="shared" name="gcc"
        outfile="${native_install_dir}/jnsctp"
        objdir="${obj}">

        <compilerarg value="-g" />
        <compilerarg value="-DSCTP_DEBUG=1" if="SCTP_DEBUG"/>
        <compilerarg value="-D_JNI_IMPLEMENTATION_" />
        <compilerarg value="-DINET6=1" />
        <compilerarg value="-fPIC" />
        <compilerarg value="-std=c99" />
        <compilerarg value="-O2" />
        <compilerarg value="-Wall" />
        <compilerarg value="-I${system.JAVA_HOME}/include" />
        <compilerarg value="-I${system.JAVA_HOME}/include/openbsd" if="is.running.openbsd"/>
        <compilerarg value="-I${usrsctp}/usrsctplib" />

        <compilerarg value="-m32" if="cross_32" />
        <compilerarg value="-m64" if="cross_64" />

        <linkerarg value="-m32" if="cross_32" />
        <linkerarg value="-m64" if="cross_64" />

        <linkerarg value="-Wl,-z,relro" if="is.running.debian"/>
        <linkerarg value="-Wl,-Bstatic" location="end" />
        <linkerarg value="-lusrsctp" location="end" />
        <linkerarg value="-Wl,-Bdynamic" location="end" />
        <linkerarg value="-lpthread" location="end" />
        <linkerarg value="-L${usrsctp}/usrsctplib/.libs" />

        <fileset dir="${src}/native/sctp" includes="org_jitsi_sctp4j_Sctp.c"/>

    </cc>
</target>

#34

You are missing definition of is.running.openbsd, I suspect. Check how is.running.linux and the others are defined.


#35

Thank you, it seems better.

I now have

-sctp-openbsd:
[cc] Starting dependency analysis for 1 files.
[cc] 1 files are up to date.
[cc] 0 files to be recompiled from dependency analysis.
[cc] 0 total files to be compiled.

BUILD FAILED
/usr/local/libjitsi/src/native/build.xml:1356: Output directory is not a directory

On line 1356 (objdir) I see

    <cc outtype="shared" name="gcc"
        outfile="${native_install_dir}/jnsctp"
        objdir="${obj}">

The error message is not very accurate