OpenWrt Forum Archive

Topic: Failed on command "make menuconfig"

The content of this topic has been archived on 25 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I am new to openwrt.
I use ubuntu 14.10 as host OS.
I use openwrt 12.09 "git clone git://git.openwrt.org/12.09/openwrt.git"

But failed on command "make menuconfig", see below:

leaf@leaf:~/openwrt$ make menuconfig
Checking 'non-root'... ok.
Checking 'working-make'... ok.
Checking 'case-sensitive-fs'... ok.
Checking 'getopt'... ok.
Checking 'fileutils'... ok.
Checking 'working-gcc'... ok.
Checking 'working-g++'... ok.
Checking 'ncurses'... ok.
Checking 'zlib'... ok.
Checking 'gawk'... ok.
Checking 'unzip'... ok.
Checking 'bzip2'... ok.
Checking 'patch'... ok.
Checking 'perl'... ok.
Checking 'python'... ok.
Checking 'wget'... ok.
Checking 'git'... ok.
Checking 'gnutar'... ok.
Checking 'svn'... ok.
Checking 'gnu-find'... ok.
Checking 'getopt-extended'... ok.
make -s -C scripts/config all CC=gcc: build failed. Please re-run make with V=s to see what's going on
/home/leaf/openwrt/include/toplevel.mk:81: recipe for target 'scripts/config/mconf' failed
make: *** [scripts/config/mconf] Error 1

But "make V=s" succeeded, and generated many bin files under the dir of "../openwrt/bin"
openwrt-ar71xx-generic-a02-rb-w300n-squashfs-factory.bin
openwrt-ar71xx-generic-a02-rb-w300n-squashfs-sysupgrade.bin
openwrt-ar71xx-generic-alfa-ap96-jffs2-sysupgrade.bin
openwrt-ar71xx-generic-alfa-ap96-kernel.bin
openwrt-ar71xx-generic-alfa-ap96-rootfs-jffs2.bin
...

Could anyone help me?

Note "make kernel-menuconfig" works fine, and can go into configuration page.

It says to run "make menuconfig V=s" to see the error. Also 12.09 is unsupported. Use 15.05 unless you have a very good reason not to.

Noted and thanks!

I did as your guides, outcome is that "lxdialog" gets failed, seemly due to absence of some libs (host ubuntu lib).

leaf@leaf:~/openwrt$ make menuconfig V=s
...
make[1]: Entering directory '/home/leaf/openwrt/scripts/config'
make[2]: Entering directory '/home/leaf/openwrt/scripts/config/lxdialog'
checklist.o: In function `print_item':
checklist.c:(.text+0x24): undefined reference to `wmove'
checklist.c:(.text+0x3d): undefined reference to `waddch'
checklist.c:(.text+0x62): undefined reference to `wmove'
checklist.c:(.text+0xa6): undefined reference to `wprintw'
checklist.c:(.text+0xdb): undefined reference to `wmove'
checklist.c:(.text+0xf8): undefined reference to `waddch'
checklist.c:(.text+0x12d): undefined reference to `waddnstr'
checklist.c:(.text+0x14d): undefined reference to `wmove'
checklist.c:(.text+0x15b): undefined reference to `wrefresh'
checklist.o: In function `print_arrows':
checklist.c:(.text+0x177): undefined reference to `wmove'
checklist.c:(.text+0x197): undefined reference to `acs_map'
checklist.c:(.text+0x1a3): undefined reference to `waddch'
checklist.c:(.text+0x1b8): undefined reference to `waddnstr'
checklist.c:(.text+0x1d4): undefined reference to `acs_map'
checklist.c:(.text+0x1e0): undefined reference to `waddch'
checklist.c:(.text+0x1e8): undefined reference to `acs_map'
checklist.c:(.text+0x1f4): undefined reference to `waddch'
checklist.c:(.text+0x1fc): undefined reference to `acs_map'
checklist.c:(.text+0x208): undefined reference to `waddch'
checklist.c:(.text+0x210): undefined reference to `acs_map'
checklist.c:(.text+0x21c): undefined reference to `waddch'
checklist.c:(.text+0x23e): undefined reference to `wmove'
checklist.c:(.text+0x272): undefined reference to `acs_map'
checklist.c:(.text+0x27e): undefined reference to `waddch'
checklist.c:(.text+0x293): undefined reference to `waddnstr'
checklist.c:(.text+0x2af): undefined reference to `acs_map'
checklist.c:(.text+0x2bb): undefined reference to `waddch'
checklist.c:(.text+0x2c3): undefined reference to `acs_map'
checklist.c:(.text+0x2cf): undefined reference to `waddch'
checklist.c:(.text+0x2d7): undefined reference to `acs_map'
checklist.c:(.text+0x2e3): undefined reference to `waddch'
checklist.c:(.text+0x2eb): undefined reference to `acs_map'
checklist.c:(.text+0x2f7): undefined reference to `waddch'
checklist.o: In function `print_buttons':
checklist.c:(.text+0x390): undefined reference to `wmove'
checklist.c:(.text+0x39e): undefined reference to `wrefresh'
checklist.o: In function `dialog_checklist':
checklist.c:(.text+0x3e6): undefined reference to `endwin'
checklist.c:(.text+0x4cf): undefined reference to `COLS'
checklist.c:(.text+0x4e3): undefined reference to `LINES'
checklist.c:(.text+0x4f7): undefined reference to `stdscr'
checklist.c:(.text+0x520): undefined reference to `newwin'
checklist.c:(.text+0x533): undefined reference to `keypad'
...
msgbox.c:(.text+0x16b): undefined reference to `acs_map'
msgbox.c:(.text+0x177): undefined reference to `waddch'
msgbox.c:(.text+0x1b1): undefined reference to `wrefresh'
msgbox.c:(.text+0x1c1): undefined reference to `wgetch'
msgbox.c:(.text+0x205): undefined reference to `wrefresh'
msgbox.c:(.text+0x213): undefined reference to `delwin'
collect2: error: ld returned 1 exit status
Makefile:25: recipe for target 'lxdialog' failed
make[2]: *** [lxdialog] Error 1
make[2]: Leaving directory '/home/leaf/openwrt/scripts/config/lxdialog'
Makefile:27: recipe for target 'lxdialog/lxdialog' failed
make[1]: *** [lxdialog/lxdialog] Error 2
make[1]: Leaving directory '/home/leaf/openwrt/scripts/config'
/home/leaf/openwrt/include/toplevel.mk:81: recipe for target 'scripts/config/mconf' failed
make: *** [scripts/config/mconf] Error 2

Looks like missing / broken ncurses, though hard to believe Ubuntu has an issue here.

You might try reinstalling the prerequisites to the host, especially libncurses5-dev

https://wiki.openwrt.org/doc/howto/buil … tallations

sudo apt-get install build-essential subversion libncurses5-dev zlib1g-dev gawk gcc-multilib flex git-core gettext libssl-dev

I encountered ncurses problem before installed openwrt in current Ubuntu 14.10.

If use "sudo apt-get install libncurses5-dev", then always occur a version conflict "libncurses5-dev : rely: libtinfo5 (= 5.9+20140118-1ubuntu1) but to be installed 5.9+20140712-2ubuntu1...", I cannot solve it.

So I downloaded a ncurses package "- 5.9+20140118-1ubuntu1" from openwrt?, and installed it manually. Does it conflict?

But "make kernel-menuconfig" works fine, and can go to the configuration page.

If use "sudo apt-get install libncurses5-dev", then always occur a version conflict "libncurses5-dev : rely: libtinfo5 (= 5.9+20140118-1ubuntu1) but to be installed 5.9+20140712-2ubuntu1...", I cannot solve it.

You messed up your host, about how to fix it better ask some ubuntu folks or reinstall. Don't install any openwrt packages into your host system ever. Not even sure how you would have managed such.

I think in our PC, current installed "ncurses" is fine with ubuntu 14.10. Because "make kernel_menuconfig" can introduce to the configuration window page.
Since lxdialog was once compiled before "ncurse" installation problem settled ( by "make menuconfig"). I think some object files of lxdialog maybe stalled, later on I will try to clean up all object file before  "make menuconfig".
Is there any command like "make menuconfig clean"?
Do you think so?

leaf_ee wrote:

Is there any command like "make menuconfig clean"?

make config-clean

perus@ub1604:/Openwrt/trunk$ make config-clean
make[1]: Entering directory '/Openwrt/trunk/scripts/config'
rm -f *.o lxdialog/*.o zconf.tab.c lex.zconf.c zconf.hash.c conf mconf
make[1]: Leaving directory '/Openwrt/trunk/scripts/config'

The package manager is telling you the system is in an inconsistent state and doesn't know on his own how to transition to the resolution your package selection and repository impose. It might be easy to fix but I wouldn't know. I got an ubuntu cd handed out in the early day of canonical. Never heard of it before but was quite impressed at my first plug&play experience using linux. But that pretty much is my experience with it.

Try to reproduce the issue using trunk or 15.05

"make config-clean" has no effort.

"lxdialog" in "make menuconfig" cannot be through in compiling due to lacking libs/references.
But "lxdialog" in "make kernel_menuconfig" go through in compiling.
Those 2 "lxdialog"s are different of content,  located in different places either. One is in "scripts/..", another is in "build_dir/.."

leaf@leaf:~/openwrt$ make kernel_menuconfig V=s
export MAKEFLAGS= ;make V=ss -C target/linux menuconfig
make[1]: Entering directory '/home/leaf/openwrt/target/linux'
make[2]: Entering directory '/home/leaf/openwrt/target/linux/ar71xx'
rm -f /home/leaf/openwrt/build_dir/linux-ar71xx_generic/linux-3.3.8/.configured
/home/leaf/openwrt/scripts/kconfig.pl  + /home/leaf/openwrt/target/linux/generic/config-3.3 /home/leaf/openwrt/target/linux/ar71xx/config-3.3 > /home/leaf/openwrt/build_dir/linux-ar71xx_generic/linux-3.3.8/.config
export MAKEFLAGS= ;make -C /home/leaf/openwrt/build_dir/linux-ar71xx_generic/linux-3.3.8 -C /home/leaf/openwrt/build_dir/linux-ar71xx_generic/linux-3.3.8 HOSTCFLAGS="-O2 -I/home/leaf/openwrt/staging_dir/host/include -Wall -Wmissing-prototypes -Wstrict-prototypes" CROSS_COMPILE="mips-openwrt-linux-uclibc-" ARCH="mips" KBUILD_HAVE_NLS=no
CONFIG_SHELL="/bin/bash" V='' CC="mips-openwrt-linux-uclibc-gcc" menuconfig
make[3]: Entering directory '/home/leaf/openwrt/build_dir/linux-ar71xx_generic/linux-3.3.8'
  HOSTCC  scripts/kconfig/lxdialog/checklist.o
  HOSTCC  scripts/kconfig/lxdialog/inputbox.o
  HOSTCC  scripts/kconfig/lxdialog/menubox.o
  HOSTCC  scripts/kconfig/lxdialog/textbox.o
  HOSTCC  scripts/kconfig/lxdialog/util.o
  HOSTCC  scripts/kconfig/lxdialog/yesno.o
  HOSTCC  scripts/kconfig/mconf.o
  HOSTLD  scripts/kconfig/mconf
scripts/kconfig/mconf Kconfig

Then enter kernel configuration window page.

The problem is solved.

The cause is in "openwrt/scripts/config/lxdialog/check-lxdialog.sh"(openwrt v12.09). Function "ldflags" locates sources "dir" in "/usr/local/lib" and "/opt/local/lib".
But in my unbuntu 14.10, the file with path is "/usr/include/ncurses.h"

# What library to link
ldflags()
{
    for ext in so dylib; do
        for dir in "" /usr/local/lib /opt/local/lib; do
            $cc ${dir:+-L$dir} -print-file-name=libncursesw.$ext | grep -q /
            if [ $? -eq 0 ]; then
                echo $dir '-lncursesw'
                exit
            fi
            $cc ${dir:+-L$dir} -print-file-name=libncurses.$ext | grep -q /
            if [ $? -eq 0 ]; then
                echo $dir '-lncurses'
                exit
            fi
            $cc ${dir:+-L$dir} -print-file-name=libcurses.$ext | grep -q /
            if [ $? -eq 0 ]; then
                echo $dir '-lcurses'
                exit
            fi
        done
    done
    exit 1
}

Function "ldflags" should be changed like these:
# What library to link
ldflags()
{
    for ext in so a dylib ; do
        for lib in ncursesw ncurses curses ; do
            $cc -print-file-name=lib${lib}.${ext} | grep -q /
            if [ $? -eq 0 ]; then
                echo "-l${lib}"
                exit
            fi
        done
    done
    exit 1
}

I think somebody should have encountered that problem before.

Thank you all guys! Without your precious advice, I could not solve it.

leaf_ee wrote:

The cause is in "openwrt/scripts/config/lxdialog/check-lxdialog.sh"(openwrt v12.09). Function "ldflags" locates sources "dir" in "/usr/local/lib" and "/opt/local/lib".
But in my unbuntu 14.10, the file with path is "/usr/include/ncurses.h"
...
I think somebody should have encountered that problem before.

You are right. Somebody has encountered the problem and has likely fixed that 17 months ago:
https://dev.openwrt.org/changeset/43873/
"scripts/config: sync with linux upstream"

But that fix has not been backported to AA12.09 that was deprecated already then.

The fix is in trunk and CC15.05 branch, but not in AA12.09 or BB14.07.

(I didn't verify by compiling the old Openwrt version with an old Ubuntu, but that checkin has modified the ncurses detection in that script. Most likely just this issue, but a different solution.)

(Last edited by hnyman on 31 May 2016, 08:51)

The discussion might have continued from here.