====== Building Asterisk from source under De{bi,vu}an ====== These notes relate to Asterisk 16.28.0 for Devuan Beowulf (Debian Buster). * You need the **autoconf** package installed (as well as **dpkg-dev** and **build-essentials**). * **apt build-dep asterisk** will tell you that you need to install **libsystemd-dev**, which of course is not installed on a Devuan system, and if you try to install it manually, it will want to uninstall quite a list of packages: Remove the following packages: 1) elogind [241.4-2 (now, oldstable)] 2) libelogind0 [241.4-2 (now, oldstable)] 3) libpam-elogind [241.4-2 (now, oldstable)] 4) libpolkit-agent-1-0 [0.105-25+devuan9 (now, oldstable)] 5) libpolkit-backend-1-0 [0.105-25+devuan9 (now, oldstable)] 6) libpolkit-backend-elogind-1-0 [0.105-25+devuan9 (now, oldstable)] 7) libpolkit-gobject-1-0 [0.105-25+devuan9 (now, oldstable)] 8) libpolkit-gobject-elogind-1-0 [0.105-25+devuan9 (now, oldstable)] 9) policykit-1 [0.105-25+devuan9 (now, oldstable)] 10) policykit-1-gnome [0.105-7 (now, oldstable)] * If you accept this, things get even worse:The following NEW packages will be installed: libsystemd-dev libsystemd0{a} The following packages will be REMOVED: adwaita-icon-theme{u} at-spi2-core{u} dconf-gsettings-backend{u} dconf-service{u} elogind{a} fontconfig{u} fontconfig-config{u} fonts-dejavu-core{u} glib-networking{u} glib-networking-common{u} glib-networking-services{u} gsettings-desktop-schemas{u} gtk-update-icon-cache{u} hicolor-icon-theme{u} libatk-bridge2.0-0{u} libatk1.0-0{u} libatk1.0-data{u} libatspi2.0-0{u} libavahi-client3{u} libavahi-common-data{u} libavahi-common3{u} libcairo-gobject2{u} libcairo2{u} libcolord2{u} libcroco3{u} libcups2{u} libdatrie1{u} libdconf1{u} libelogind0{a} libepoxy0{u} libfontconfig1{u} libgdk-pixbuf2.0-0{u} libgdk-pixbuf2.0-bin{u} libgdk-pixbuf2.0-common{u} libglib2.0-0{u} libglib2.0-data{u} libgraphite2-3{u} libgtk-3-0{u} libgtk-3-bin{u} libgtk-3-common{u} libharfbuzz0b{u} libjbig0{u} libjpeg62-turbo{u} libjson-glib-1.0-0{u} libjson-glib-1.0-common{u} liblcms2-2{u} libpam-elogind{a} libpango-1.0-0{u} libpangocairo-1.0-0{u} libpangoft2-1.0-0{u} libpixman-1-0{u} libpolkit-agent-1-0{a} libpolkit-backend-1-0{a} libpolkit-backend-elogind-1-0{a} libpolkit-gobject-1-0{a} libpolkit-gobject-elogind-1-0{a} libproxy1v5{u} librest-0.7-0{u} librsvg2-2{u} librsvg2-common{u} libsoup-gnome2.4-1{u} libsoup2.4-1{u} libthai-data{u} libthai0{u} libtiff5{u} libwayland-client0{u} libwayland-cursor0{u} libwayland-egl1{u} libwebp6{u} libxcb-render0{u} libxcb-shm0{u} libxcomposite1{u} libxcursor1{u} libxdamage1{u} libxfixes3{u} libxi6{u} libxinerama1{u} libxkbcommon0{u} libxrandr2{u} libxrender1{u} libxtst6{u} policykit-1{a} policykit-1-gnome{a} shared-mime-info{u} x11-common{u} xdg-user-dirs{u} * I accepted this (on a throwaway VM of course) to see whether I could build Asterisk with debugging symbols and no systemd dependency. * **apt build-dep asterisk** then installed 398 more packages! * **dpkg-buildpackage -b -uc -us** produced as many warnings and errors as seems to be completely standard for building modern source code (if I were more of a developer I would probably publish a bit of a rant about this, but I'm not, so I won't) I was building Asterisk from source specifically for https://wiki.asterisk.org/wiki/display/AST/Getting+a+Backtrace because I suspect a bug in Asterisk's ODBC handling, and [[https://community.asterisk.org/t/95826|was advised]] that this was the way to go about investigating it. After having verified that **dpkg-buildpackage -b -uc -us** did indeed create me a binary file (albeit an extremely large one - why isn't it the same as the one in the binary package for Asterisk?), I then proceeded to run **make menuselect**, enabled the Compiler Flags DONT_OPTIMIZE, DEBUG_THREADS and MALLOC_DEBUG and then ran **make**. Results: - Standard /sbin/asterisk installed from the binary package * Size: **3057784** bytes * Output of **file**: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=bca5c23ab46cabfba3829bd2e9e4c775b3adc502, stripped - Build using **dpkg-buildpackage -b -uc -us** * Size: **14398296** bytes * Output of **file**: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=34c3e31098866fcf1c5591eeb193f5efe77ff704, with debug_info, not stripped - Build using **make**: * Size: **10010928** bytes (amazingly, even smaller than the Debian build, but still significantly larger than the standard Debian binary) * Output of **file**: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=87045e41a44c64e55a926fb9bc74a7ae7f83f30e, with debug_info, not stripped The first obvious difference between these three binaries is that the standard one is "stripped" whereas the other two have debug_info and are not stripped. So, let's strip those and see what comes out: - Standard /sbin/asterisk installed from the binary package * Size: **3057784** bytes - Build using **dpkg-buildpackage -b -uc -us** and then **strip** * Size: **3057752** bytes - Build using **make** and then **strip** * Size: **3559024** bytes Those first two are so close to each other that I'm convinced I'm on to the right thing. Unfortunately, as soon as I move on to the next stage of this endeavour - trying to build a binary with **DEB_BUILD_OPTIONS="debug"** set - it fails in a most unhelpful way:../src/pjmedia/resample_resample.c:31:10: fatal error: third_party/resample/include/resamplesubs.h: No such file or directory It's not at all clear why this file is missing, or how to put it where it needs to be. I found [[https://trac.pjsip.org/repos/browser/pjproject/trunk/third_party/resample/include/resamplesubs.h|a copy]] on the PJSIP project, but putting this into my best guess at the correct location: third-party/pjproject/source/third_party/resample/include/resamplesubs.h resulted in (a) precisely the same error, and (b) the file disappearing. Something clearly doesn't want it there. ---- [[.:|Go up]]\\ Return to [[:|main index]].