一、背景
假设源代码路径为/home/freeswitch

二、编译安装libesl.a
1. cd /home/freeswitch(源代码的根目录)

执行./configure,以便生成必要的Makefile文件。

2. cd /home/freeswitch/libs/esl

make && make install

3. 默认libesl.a安装在/usr/local/freeswitch/lib目录下

需要拷贝到/home/freeswitch/libs/esl目录下

因为esl的Makefile默认libesl.a这个库文件在当前目录

三、编译esl.jar和libesljni.so

1. 修改java模块的Makefile
  cd /home/freeswitch/libs/esl/java 
  默认的关于java头文件的配置
  LOCAL_CFLAGS=-I../src/include -I/usr/java/jdk1.6.0_14/include -I/usr/java/jdk1.6.0_14/include/linux -I/usr/lib/jvm/java-6-openjdk/include/ -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/linux
  修改为机器的实际路径,例如

LOCAL_CFLAGS=-I../src/include -I/usr/java/jdk1.8.0_112/include -I/usr/java/jdk1.8.0_112/include/linux

2. 编译

    cd /home/freeswitch/libs/esl(返回上一级目录)

make javamod

3. cd /home/freeswitch/libs/esl/java

如果一切顺利的话,你能看到esl.jar和libesljni.so这两个文件。

OK,可以在java中通过jni调用libesljni.so库了。

相关文章:

  • 2021-10-07
  • 2021-08-13
  • 2022-02-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-02
  • 2022-12-23
猜你喜欢
  • 2021-04-30
  • 2022-01-18
  • 2022-01-19
  • 2022-02-27
  • 2022-02-03
  • 2021-10-13
  • 2021-07-06
相关资源
相似解决方案