xadhoom / mod_bcg729

FreeSWITCH G.729 module using the opensource bcg729 implementation by Belledonne Communications

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can not compile

p00h opened this issue · comments

Makefile has the line:
git clone git://git.linphone.org/bcg729.git; pushd bcg729 ; git checkout 1.0.1; popd;
We're gonna use the latest (1.0.1) version of original sources, but lots of functions already has differences in arguments list and implementation since 1.0.0. So I could NOT compile the module using 1.0.1 sources version, but I could using 1.0.0.

have you tried a diff and read the changelog of bcg729 ?
the C functions (and APIs) are the same and only fixes for windows build have been made (which is outside this project scope)

the breaking changes are in bcg729 commit 0d8f1a584794a9f42bd17850260ea60f96881758, when annexb has been included.

are you sure the checked out bcg729 is "HEAD detached at 1.0.1" ?

should be something like that:
[matteo@localhost mod_bcg729]$ cd bcg729/
[matteo@localhost bcg729]$ git branch

  • (HEAD detached at 1.0.1)
    master

I am sorry I was wrong about changes, but there is a tiny problem anyway.
Ok, lets go step-by-step way.

cd /tmp
git clone https://github.com/xadhoom/mod_bcg729.git
cd mod_bcg729
make

produces:

if [ ! -d bcg729 ]; then \
    git clone git://git.linphone.org/bcg729.git; pushd bcg729 ; git checkout 1.0.1; popd; \
fi
Cloning into 'bcg729'...
remote: Counting objects: 624, done.
remote: Compressing objects: 100% (450/450), done.
remote: Total 624 (delta 398), reused 222 (delta 152)
Receiving objects: 100% (624/624), 234.55 KiB | 0 bytes/s, done.
Resolving deltas: 100% (398/398), done.
Checking connectivity... done.
/bin/sh: 2: pushd: not found
error: pathspec '1.0.1' did not match any file(s) known to git.
/bin/sh: 2: popd: not found
Makefile:28: recipe for target 'clone_bcg729' failed
make: *** [clone_bcg729] Error 127

The git did not switch to correct version, and I (this is my fault) did not pay attention to the process. So as a workaround, I had to do it manually.

/bin/sh: 2: pushd: not found

is clear :) I'm using bash commands into makefile, sh lacks pushd and popd.

It can be fixed by changing

git clone git://git.linphone.org/bcg729.git; pushd bcg729 ; git checkout 1.0.1; popd; \

in

git clone git://git.linphone.org/bcg729.git; cd bcg729 ; git checkout 1.0.1; cd ..; \

into the Makefile

@xadhoom I've made it myself already) I believe it could be better to fix it coz not anybody would make an investigation)

feel free to open a PR :)

in several years is the first time I encounter someone using sh, unless is in an embedded device :)

I'm using zsh actually and there ARE both pushd and popd commands available. I have not any ideas why would it happen then.

According to the GNU make manual the SHELL environment variable should be defined to avoid that. The default behavior is to use /bin/sh as shell.