Compile single package questions/concerns


I've managed to create a working Makefile for a package I wish to install:

# Copyright (C) 2007-2014
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.

include $(TOPDIR)/

# Name, version and release number
# The name and version of your package are used to define the variable to point to the build directory of your package:



# Source settings (i.e. where to find the source codes)
# This is a custom variable, used below


include $(INCLUDE_DIR)/

# Package definition; instructs on how and where our package will appear in the overall configuration menu ('make menuconfig')
define Package/libax25
  TITLE:=ax25 library for hamradio applications
  MAINTAINER:=Ralf Baechle DL5RB <>, \
				Thomas Osterried DL9SAU <>

# Package description; a more verbose description on what our package does
define Package/libax25/description
This library is for ham radio applications that use the ax25
protocol.  Included are routines to do ax25 address parsing, common
ax25 application config file parsing, etc.

define Package/libax25/install
	$(INSTALL_DIR) $(1)/usr/bin
	$(CP) $(PKG_INSTALL_DIR)/usr/bin/$(PKG_NAME) $(1)/usr/bin/

$(eval $(call BuildPackage,libax25))

I modified this from the nano Makefile at:

have setup SDK, path, feeds file, etc. and typed the commands:

cd /home/user/lede-sdk-17.01.4-ar71xx-generic_gcc-5.4.0_musl-1.1.16.Linux-x86_64
./scripts/feeds update mypackages
./scripts/feeds install -a -p mypackages
make package/libax25/compile

And my computer appears to be making a lot of IPK files...when I tested helloworld it only made one.

Is this because of the DEPENDS:=+kmod-ax25 argument?

If so...does this mean when I install this IPK on my router, that it will attempt to install kmod-ax25 first???

Is my Makefile missing something...?

I have further edited the Makefile, allowed hundreds of IPKs to compile, and I am now here:

daemon.c: In function 'daemon_start':
daemon.c:43:12: warning: implicit declaration of function 'open' [-Wimplicit-function-declaration]
  if ((fd = open("/dev/tty", O_RDWR)) >= 0) {
daemon.c:43:29: error: 'O_RDWR' undeclared (first use in this function)
  if ((fd = open("/dev/tty", O_RDWR)) >= 0) {
daemon.c:43:29: note: each undeclared identifier is reported only once for each function it appears in
Makefile:461: recipe for target 'daemon.lo' failed
make[4]: *** [daemon.lo] Error 1
make[4]: Leaving directory '/home/user/lede-sdk-17.01.4-ar71xx-generic_gcc-5.4.0_musl-1.1.16.Linux-x86_64/build_dir/target-mips_24kc_musl-1.1.16/libax25-0.0.12-rc4'
Makefile:339: recipe for target 'all' failed

When compiling software, I recall I had to add the various arguments if errors appeared...but where in my Makefile do I specify to run with -Wimplicit-function-declaration ...and what is the proper syntax for the file (or provide a link to a tutorial on this specific topic)?

I may be wrong, and very well may be, but I don't believe a library should result in hundreds of additional packages being compiled (someone else will need to confirm if my understanding is correct, as I've never tried what you're doing).

  • As to your error, I'm not sure

It compiles without error with the following patch. Name it "patches/001_missing_includes.patch" or similar.

diff -uN libax25-0.0.12-rc4/daemon.c.orig libax25-0.0.12-rc4/daemon.c
--- libax25-0.0.12-rc4/daemon.c.orig    2018-03-01 14:07:53.994106025 +0100
+++ libax25-0.0.12-rc4/daemon.c 2018-03-01 14:08:24.870789746 +0100
@@ -3,11 +3,13 @@
 #include <stdlib.h>
 #include <signal.h>
 #include <errno.h>
+#include <fcntl.h>
 #include <sys/param.h>
 #include <sys/file.h>
 #include <sys/ioctl.h>
 #include <sys/stat.h>
+#include <sys/types.h>
 #include <netax25/daemon.h>

The install section also needs some changes.

And don't forget to remove PKG_BUILD_DIR if you are going to publish the Makefile for other people to use.

1 Like


I saw the header issue, but didn't know how to tell the compiler those headers would be in the downloaded TAR file.

Also, you noted:

Did you mean the local folder name? (I did remove it)

Also,does this line mean that OpenWRT will install kmod-ax25 before installing the IPK:

I'm now getting this error:

install: cannot stat '/home/user/lede-sdk-17.01.4-ar71xx-generic_gcc-5.4.0_musl-1.1.16.Linux-x86_64/build_dir/target-mips_24kc_musl-1.1.16/libax25-0.0.12-rc4/libax25': No such file or directory
Makefile:53: recipe for target '/home/user/lede-sdk-17.01.4-ar71xx-generic_gcc-5.4.0_musl-1.1.16.Linux-x86_64/bin/packages/mips_24kc/mypackages/libax25_0.0.12-rc4-1_mips_24kc.ipk' failed
make[2]: *** [/home/user/lede-sdk-17.01.4-ar71xx-generic_gcc-5.4.0_musl-1.1.16.Linux-x86_64/bin/packages/mips_24kc/mypackages/libax25_0.0.12-rc4-1_mips_24kc.ipk] Error 1
make[2]: Leaving directory '/home/user/mypackages/examples/libax25'
package/Makefile:105: recipe for target 'package/feeds/mypackages/libax25/compile' failed
make[1]: *** [package/feeds/mypackages/libax25/compile] Error 2
make[1]: Leaving directory '/home/user/lede-sdk-17.01.4-ar71xx-generic_gcc-5.4.0_musl-1.1.16.Linux-x86_64'
/home/user/lede-sdk-17.01.4-ar71xx-generic_gcc-5.4.0_musl-1.1.16.Linux-x86_64/include/ recipe for target 'package/libax25/compile' failed
make: *** [package/libax25/compile] Error 2

Any ideas?

The following should fix problem with: '...libax25': No such file or directory

define Package/libax25/install
	$(INSTALL_DIR) $(1)/usr/lib
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/$(PKG_NAME).so.* $(1)/usr/lib/
1 Like

Excellent, I have an IPK file!!!

Thank you!

That was one of three (now I have to compile the tools). On the second, I'm getting this response, but receiving no error...

make[2]: Entering directory '/home/user/mypackages/examples/ax25-tools'
if [ -f /home/user/lede-sdk-17.01.4-ar71xx-generic_gcc-5.4.0_musl-1.1.16.Linux-x86_64/staging_dir/target-mips_24kc_musl-1.1.16/pkginfo/ax25-tools.default.install.clean ]; then rm -f /home/user/lede-sdk-17.01.4-ar71xx-generic_gcc-5.4.0_musl-1.1.16.Linux-x86_64/staging_dir/target-mips_24kc_musl-1.1.16/pkginfo/ax25-tools.default.install /home/user/lede-sdk-17.01.4-ar71xx-generic_gcc-5.4.0_musl-1.1.16.Linux-x86_64/staging_dir/target-mips_24kc_musl-1.1.16/pkginfo/ax25-tools.default.install.clean; fi
make[2]: Leaving directory '/home/user/mypackages/examples/ax25-tools'
make[1]: Leaving directory '/home/user/lede-sdk-17.01.4-ar71xx-generic_gcc-5.4.0_musl-1.1.16.Linux-x86_64'

Completely starting from scratch:

checking for zlibVersion in -lz... no
checking for ax25_config_load_ports in -lax25... no
configure: error: Could not find the libax25 libraries; aborting
Makefile:55: recipe for target '/home/user/lede-sdk-17.01.4-ar71xx-generic_gcc-5.4.0_musl-1.1.16.Linux-x86_64/build_dir/target-mips_24kc_musl-1.1.16/ax25-tools-0.0.10-rc4/.configured_yynn' failed
make[2]: *** [/home/user/lede-sdk-17.01.4-ar71xx-generic_gcc-5.4.0_musl-1.1.16.Linux-x86_64/build_dir/target-mips_24kc_musl-1.1.16/ax25-tools-0.0.10-rc4/.configured_yynn] Error 1
make[2]: Leaving directory '/home/user/mypackages/examples/ax25-tools'
package/Makefile:105: recipe for target 'package/feeds/mypackages/ax25-tools/compile' failed
make[1]: *** [package/feeds/mypackages/ax25-tools/compile] Error 2
make[1]: Leaving directory '/home/user/lede-sdk-17.01.4-ar71xx-generic_gcc-5.4.0_musl-1.1.16.Linux-x86_64'
/home/user/lede-sdk-17.01.4-ar71xx-generic_gcc-5.4.0_musl-1.1.16.Linux-x86_64/include/ recipe for target 'package/ax25-tools/compile' failed
make: *** [package/ax25-tools/compile] Error 2

How do I add the proper libraries (they appear to be part of the first package I compiled)?

If anyone could provide a links to more detailed information regarding how to do this...I've successfully compiled the dependency, I jus don't know how to tell the SDK or makefile how to locate them...

  • Should I move the foo.h files to the correct folder, ot is it looking for the libax25 binaries?
  • I assume it's looking for the binaries (and not the header files from the other TAR). If so...does it want the x86_64 or mips_24kc binaries?

I've found this has been requested before, no action:

Can you give copy of succesful file ?

It might bee good idea to have make files
to all libax25 hamlib aprsx combined,..?

Like I try to get A5-V11 to work as aprx + modem
also try if enough power/sapce left for rtl-sdr !!

I took many hours to find fixes,... copy netax25 directory to build_dirs,...

But it could be better procedure to build aprx libax25 + all tools from
sources and I can not find make file's which should be added
to cloned git sources ,... BUT NOW I KNOW HOW TO MAKE ONE !