Error while upgrading Asterisk to 14 - PJSIP undeclared - makefile

I am trying to upgrade asterisk 11 to 14 on Debian (8.7) and I got the following error when I do make install.
The error is as below
res_pjsip_transport_management.c: In function ‘monitored_transport_state_callback’:
res_pjsip_transport_management.c:190:8: error: ‘PJSIP_TP_STATE_SHUTDOWN’ undeclared (first use in this function)
case PJSIP_TP_STATE_SHUTDOWN:
^
res_pjsip_transport_management.c:190:8: note: each undeclared identifier is reported only once for each function it appears in
/root/asterisk-14.3.0/Makefile.rules:149: recipe for target 'res_pjsip_transport_management.o' failed
make[1]: *** [res_pjsip_transport_management.o] Error 1
Makefile:401: recipe for target 'res' failed
make: *** [res] Error 2
The commands I used are as follow
tar -zxvf asterisk-14-current.tar.gz
/etc/init.d/asterisk stop
cd asterisk-14.3.0/
./configure
rm -f /usr/lib/asterisk/modules/*
make install
I tried some solutions from the internet and it didn't fix....

It seems like the pjsip versions do not match (could be that there is more then one version installed) so you want to remove all previous/existing versions of PJSip. If you do not know what packages belong to pjsip you can search them via:
apt-cache search pjsip
or
dpkg -l | grep pj
And once you know which package to remove do
apt-get --purge remove <package name>
You then want to download the latest version of pjsip (current 2.6 according to Asterisk website)
wget wget http://www.pjsip.org/release/2.6/pjproject-2.6.tar.bz2
tar -xjvf pjproject-2.6.tar.bz2
You want to place the pjproject in /usr/local.
cp -R pjproject-2.6 /usr/local/
Once this is done you have to build/compile/install the pjproject and
./configure --prefix=/usr --enable-shared CFLAGS='-O2 -DNDEBUG' //Various options (enable/disable) can be put in here. Please refer to manual
make dep
make
make install
ldconfig
Verify that pjproject has been installed in the target location
ldconfig -p | grep pj
Once this has been done you can now go to you Asterisk folder and issue
./configure
and proceed with installation further :)

pjsip version not match.
Never tried 14*(it is not LTS), for 13.* such error mean you have more then one pjsip or pjsip is not 2.4.
Before rebuilding pjsip do check
yum remove -y pjsip
rm -f `find / -name *pjsip*`

If I'm not mistaken, Asterisk 13 source code came with a built-in pjproject, but 14 will look for an installed pjproject on the system.
Make sure you have it installed (including the -dev or -devel packages, which contains the headers), than try to reconfigure asterisk source.
./bootstrap.sh
./configure
make menuconfig

Related

How to install unison from source on macOS

I was wondering whether somebody managed to install unison's latest version from source, on its macOS machine (Here I am trying with Catalina). I followed the steps here :
I verified that I had XCode installed (otherwise forget about compiling anything :)
I cloned the official Git repository by running
git clone https://github.com/bcpierce00/unison.git
I moved to the newly created directory unison
cd unison
As mentionned in the documentation I then ran the make command telling it to build the text UI:
make UISTYLE=text
Result should have been an executable file called unisonbut instead of this I got the following error :
Blablabla$ make UISTYLE=text
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C src UISTYLE=text
UISTYLE = text
Building for Unix
NATIVE = true
THREADS = false
STATIC = false
OSTYPE =
OSARCH = osx
ocamlopt: ubase/rx.mli ---> ubase/rx.cmi
ocamlopt -g -unsafe-string -I lwt -I ubase -I system -I fsmonitor -I fsmonitor/linux -I fsmonitor/windows -I system/generic -I lwt/generic -ccopt -mmacosx-version-min=10.6 -c /Users/Shared/unison/src/ubase/rx.mli
make[1]: ocamlopt: No such file or directory
make[1]: *** [ubase/rx.cmi] Error 1
make: *** [text] Error 2
I then wondered whether XCode might not carry with him an OCaml compiler. So I installed the official one using MacPort therefore running:
sudo port install ocaml
sudo port install opam
I then rerun the same make command
make UISTYLE=text
This time the result looked better and ended with:
/Applications/Xcode.app/Contents/Developer/usr/bin/make tags
if [ -f "`which etags`" ]; then \
etags *.mli */*.mli *.ml */*.ml */*.m *.c */*.c *.txt \
*Makefile* \
; fi
However, still no unison file visible anywhere.
Question is ... since there is no error message, where is this executable?
Re-hello people from the Internet,
I managed to help myself here and got a nice and fresh unison executable on my macOS Catalina computer.
Basically, the base make tries to move the compilation product into /Users/<your_user>/bin/. which makes sense I guess, but is rarely used by us macOS users. So here is what I did to fix the issue :
Create the bin directory into your home
mkdir ~/bin
Re run the make by doing
make UISTYLE=text
Verify you have the executable by asking its version:
~/bin/unison -version
Happy me, I got the expected message back from my terminal:
unison version 2.51.3 (ocaml 4.08.1)
Hope it can help somebody.

Why does this VLC Media Player Build Fail?

When building VLC on Ubuntu 18 using the following configure invocation:
First I obtain the source like so:
% git clone git://git.videolan.org/vlc.git
% cd vlc
% ./bootstrap
Then I build like so:
make clean
./configure --disable-lua --disable-swscale --disable-alsa --disable-chromecast --disable-fontconfig
The build fails like so:
codec/jpeg.c: In function ‘DecodeBlock’:
codec/jpeg.c:501:16: warning: variable ‘p_row_pointers’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Wclobbered]
JSAMPARRAY p_row_pointers = NULL;
^~~~~~~~~~~~~~
CCLD libjpeg_plugin.la
CC codec/libsdl_image_plugin_la-sdl_image.lo
CCLD libsdl_image_plugin.la
CC codec/libxwd_plugin_la-xwd.lo
CCLD libxwd_plugin.la
CC codec/liblibass_plugin_la-libass.lo
CCLD liblibass_plugin.la
/usr/bin/ld: /root/vlc-3.0.4/contrib/x86_64-linux-gnu/lib/libfontconfig.a(fcxml.o): in function `FcConfigMessage':
/root/vlc-3.0.4/contrib/native/fontconfig/src/fcxml.c:573: undefined reference to `xmlSAX2GetLineNumber'
/usr/bin/ld: /root/vlc-3.0.4/contrib/native/fontconfig/src/fcxml.c:576: undefined reference to `xmlSAX2GetLineNumber'
/usr/bin/ld: /root/vlc-3.0.4/contrib/x86_64-linux-gnu/lib/libfontconfig.a(fcxml.o): in function `IA__FcConfigParseAndLoad':
/root/vlc-3.0.4/contrib/native/fontconfig/src/fcxml.c:3309: undefined reference to `xmlCreatePushParserCtxt'
/usr/bin/ld: /root/vlc-3.0.4/contrib/native/fontconfig/src/fcxml.c:3348: undefined reference to `xmlParseChunk'
/usr/bin/ld: /root/vlc-3.0.4/contrib/native/fontconfig/src/fcxml.c:3362: undefined reference to `xmlFreeParserCtxt'
/usr/bin/ld: /root/vlc-3.0.4/contrib/native/fontconfig/src/fcxml.c:3354: undefined reference to `xmlCtxtGetLastError'
Any ideas what I did wrong here? It seems like the module in question should fail to build in this case as I disabled fontconfig.
Libfontconfig is in fact installed:
root#fuzzbot:~/vlc-3.0.4# apt-get install libfontconfig
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'libfontconfig1' instead of 'libfontconfig'
libfontconfig1 is already the newest version (2.13.0-5ubuntu3).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root#fuzzbot:~/vlc-3.0.4#
Additional ideas:
I tried in vain to find VLC's official bug tracker for this kind of thing. I found bug trackers for literally every subproject of VLC but the main project that I am trying to build. If anyone knows the proper channels to ask the VLC people about this, let me know.
Additionally if the admins feel that this question better fits on serverfault, or AskUbuntu, feel free to move it. As far as I can tell this is a little too automake specific to be serverfault's bag, and I don't think the issue is unique to Ubuntu, as the official VLC wiki specifies no specific instructions for Ubuntu.
I don't really need all the plugins for my use case. If doing any further --disables in my configure invocation will help, I'm willing to try it.
The errors indicates a problem with linking against "some" xml-library.
most likely libxml2, which you probably have not installed.
./configure is supposed to detect any missing library and prevent your build from failing, but there might be a bug in the configure script itself.
Anyhow, since you are on a Debian-based distribution, you could simply install all the packages that are required to build the official Debian (or Ubuntu) package. (Your personal build might have additional dependencies or lack some of the dependencies of the official package, but it is usually a good starting point).
apt-get build-dep vlc
If you are getting an error like E: You must put some 'source' URIs in your sources.list then you should add deb-src entries to your apt sources-list, e.g. using
find /etc/apt/sources.list /etc/apt/sources.list.d/ \
-type f -name "*.list" -not -name debsrc.list \
-exec echo sed -e 's|^deb |deb-src |' {} + > /etc/apt/sources.list.d/debsrc.list
I followed your post on vlc forum to this SO post.
As people there suggested the libass is the problem, thus I added the option to disable it. Now the configuration command looks like:
./configure --disable-libass \
--disable-lua --disable-swscale --disable-alsa --disable-chromecast --disable-fontconfig
The compilation proceeded without the previous fontconfig error. However it hits a different error:
....upnp....: undefined reference to `pthread_rwlock_wrlock'
A google search turned up another vlc forum thread. People suggesting turning off upnp. Configured it again by adding:
--disable-upnp
Then hit another error:
/libavcodec.a(fft.o): relocation R_X86_64_PC32 against symbol `ff_cos_32' can not be used when making a shared object; recompile with -fPIC
Another google search suggests to turn off chromaprint, adding yet another option:
--disable-chromaprint
Eventually it finishes with a success!
Before running the long configure command at the beginning of this post, I also tried building 3.0.7.1 but hit a problem with missing a liveMedia.hh file. In case anybody else is doing the same, here is the list of packages installed though not all of them are required since disabled a few features on the configure command line:
apt-get install git build-essential pkg-config libtool automake autopoint gettext
apt-get install subversion yasm cvs cmake ragel
apt-get install gperf
apt-get install openjdk-8-jre-headless openjdk-8-jdk-headless
apt-get install ant
apt-get install python3-pip
pip3 install meson
apt-get install nasm
apt-get install protobuf-c-compiler
apt-get install protobuf-compiler
apt-get install libpthread-stubs0-dev
apt-get install libasound2-dev liblivemedia-dev livemedia-utils
Summary
Use the videolan unix compile wiki page as a guide for steps below.
Install supporting packages as the list above shows.
Run cd contrib && mkdir native && cd native && ../bootstrap && make to build libraries.
Run the very long configure command:
./configure --disable-libass \
--disable-lua --disable-swscale --disable-alsa --disable-chromecast --disable-fontconfig \
--disable-upnp --disable-chromaprint
Run make.

updating to svn 1.9.4 via command line in mac

I am using SVN against my will. The current team I work with uses it for version control and they are not always available to help me. I am just trying to go from SVN Version 1.8.13 to the latest 1.9.4
I have download it and I have ran this command too
curl -o subversion-latest.tar.gz http://apache.mirrors.tds.net/subversion/subversion-1.9.4.tar.gz
tar -xvf subversion-latest.tar.gz
I have combined these two different tutorials with no luck.
svn update version
stackover flow issue
I am STUCK at with the configure part..
mymac ~/Downloads/subversion-1.9.4/serf
$ ./configure
-bash: ./configure: No such file or directory
mymac ~/Downloads/subversion-1.9.4/serf
UPDATE
I exited out of serf path and on
`mymac ~/Downloads/subversion-1.9.4` file path i ran the `./configure` My command line ran a bunch of "checks"
configure: Configuring Subversion 1.9.4
configure: creating config.nice checking for gcc...
gcc checking whether the C compiler works...
yes but eventually shot an error at the end...
configure: error: failed to recognize APR_INT64_T_FMT on this platform
mymac ~/Downloads/subversion-1.9.4
I have the latest version of XCode..
UPDATE2 tried neon, again
mymac ~/Downloads/subversion-1.9.4
$ sh get-deps.sh neon
Local directory 'serf' already exists; the downloaded copy won't be used
Local directory 'apr' already exists; the downloaded copy won't be used
Local directory 'apr-util' already exists; the downloaded copy won't be used
get-deps.sh: line 151: get_neon: command not found
Usage: get-deps.sh
Usage: get-deps.sh [ apr | serf | zlib | sqlite | gmock ] ...
mymac ~/Downloads/subversion-1.9.4
$ cd neon
-bash: cd: neon: No such file or directory
UPDATE 3
ran this command first ..
mymac ~/Downloads/subversion-1.9.4
$ ./configure --prefix=/usr/local --with-serf=/usr/local/serf
configure: Configuring Subversion 1.9.4
configure: creating config.nice
checking for gcc... gcc
checking whether the C compiler works... yes
I guess I should install a new version of serf?
checking was serf enabled... no
An appropriate version of serf could not be found, so libsvn_ra_serf
will not be built. If you want to build libsvn_ra_serf, please
install serf 1.3.4 or newer.
configure: error: Serf was explicitly enabled but an appropriate version was not found.
I have no clue where to go from here and how to get around it. I already figure out that neon is no longer supported and I am using serf Can someone offer a different way to go about this? Please? Thanks!
Consider using Brew or MacPorts, if possible. Then this can be as simple as:
brew install svn
If you really must install from source,
it might not be as complicated as the steps you described so far.
Try these much simpler steps exactly:
cd /tmp
curl -o subversion-latest.tar.gz http://apache.mirrors.tds.net/subversion/subversion-1.9.4.tar.gz
tar -xvf subversion-latest.tar.gz
cd subversion-1.9.4
./configure --prefix=/tmp/local
make
make install
This will (hopefully) build Subversion and install it into /tmp/local. Test with this command:
/tmp/local/bin/svn --version
If the output looks good, then repeat from the start, but use a different value for --prefix, as appropriate in your environment.
(I tried, and this worked well for me, right now, btw.)
Maybe it's not so simple. In that case please update your question with the output where you get stuck.

dpkg error: contains ununderstood data member

I'm trying to install a jailbreak tweak using make package install but I'm receiving this error from dpkg:
dpkg-deb: file `/tmp/_theos_install.deb' contains ununderstood data member data.tar.xz , giving up
dpkg: error processing /tmp/_theos_install.deb (--install):
subprocess dpkg-deb --fsys-tarfile returned error exit status 2
Errors were encountered while processing:
/tmp/_theos_install.deb
make: *** [internal-install] Error 1
So as far as I can tell it isn't able to understand the .xz extension, but I'm not sure why that file is being created. Thanks for the help.
I found out how to fix it. In $THEOS/makefiles/package/deb.mk replace this line:
$(ECHO_NOTHING)COPYFILE_DISABLE=1 $(FAKEROOT) -r dpkg-deb -b "$(THEOS_STAGING_DIR)" "$(_THEOS_DEB_PACKAGE_FILENAME)" $(STDERR_NULL_REDIRECT)$(ECHO_END)
with this line:
$(ECHO_NOTHING)COPYFILE_DISABLE=1 $(FAKEROOT) -r dpkg-deb -Zgzip -b "$(THEOS_STAGING_DIR)" "$(_THEOS_DEB_PACKAGE_FILENAME)" $(STDERR_NULL_REDIRECT)$(ECHO_END)
The .deb file is created because you told Theos build system to do that. The package install rule of the Makefile is creating the Debian package using xz compression. Now, this kind of compression is supported by versions of dpkg equal or higher than 1.15.6.
So, in order to solve your problem, you should update dpkg to a newer version or install Theos without packaging support. Probably a simple make install will do it.
In case that updating dpkg isn't possible and you don't want to install the program without package management support, the other (more painful) method is to change the algorithm in which the package is compressed. Here you have good information about how to do this.
In my case I was building a package on Ubuntu 18.04 and trying to install that package on Debian 7 (airgapped). I had to change the line in the Makefile that read:
dpkg --build $(DESTDIR)
..to:
dpkg-deb --build -Zgzip $(DESTDIR)
Thanks Connor!
Other option that you can try is to unpack the .deb that you where triying to install and repack with no XZ compression.
Unpack:
mkdir package/ && dpkg -x package.deb package/
Pack:
dpkg-deb --build -Zgzip package/
You can rename the resulting package with:
dpkg-name -o package.deb
Or simply name the package dir with the name of your package.
Important: In orther to perform this, you need to install dpkg-dev package:
sudo apt update
sudo apt install dpkg-dev

Can not configure Mapnik due to icuuc

Trying to compile Mapnik on OSX 10.8
So after I clone the Github repo, I go to run the configure command like so:
./configure and then get the error:
Checking for C++ library icuuc... no
Could not find required header or shared library for icuuc
and later:
Exiting... the following required dependencies were not found:
- icuuc (ICU C++ library | configure with ICU_LIBS & ICU_INCLUDES or use ICU_LIB_NAME to specify custom lib name | more info: http://site.icu-project.org/)
Looking at the Mapnik troubleshooting area for a solution: https://github.com/mapnik/mapnik/wiki/InstallationTroubleshooting
Says: Solution: If g++ is available then ICU must be in a custom location so set the paths to the libs and includes - ie. ICU_LIBS=/usr/local/lib and ICU_INCLUDES=/usr/local/include.
By running g++ from command line I get: i686-apple-darwin11-llvm-g++-4.2: no input files
So this means that g++ is available, but I have no idea how to go about setting the paths so that configure can find them.
ICU Libraries were installed by default or with homebrew, not sure which.
terminal: brew install icu4c
Warning: icu4c-51.1 already installed
Finding the icu4c install directory:
terminal: mdfind icu4c
/usr/local/Cellar/icu4c
You can add the path of your ICU_LIB/INCLUDE to your configure command:
./configure ICU_INCLUDES=/usr/local/Cellar/icu4c/include ICU_LIBS=/usr/local/Cellar/icu4c/lib
And for more help about configure on what options are accepted do:
./configure --help
For the installation reference, you can check this:
https://github.com/mapnik/mapnik/blob/v2.2.0/INSTALL.md
As per our discussion and my last comment something like the following might work.
export ICU_LIBS=/usr/local/Cellar/icu4c/lib
export ICU_INCLUDES=/usr/local/Cellar/icu4c/include
./configure
If you find same errors:
Checking for C++ library XXX... no
Follow the command
sudo apt-get install g++ libXXX-dev
Using tips (TAB button), you can see what XXX libraries you have available
sudo apt-get install libXXX(press double TAB)

Resources