What's new
  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

unexpected token `foreign'

Shonk

Senior Member
having a problem compiling merlin on ubuntu 32bit
anyone have any idea's



make[4]: Leaving directory `/root/asuswrt-merlin/release/src/router/ebtables'
cd libdaemon && ./configure --host=mipsel-linux --build=i686-linux-gnu ac_cv_func_setpgrp_void=yes \
--disable-dependency-tracking
configure: WARNING: unrecognized options: --disable-dependency-tracking
./configure: line 2162: syntax error near unexpected token `foreign'
./configure: line 2162: `AM_INIT_AUTOMAKE(foreign 1.10 -Wall)'
make[3]: *** [libdaemon/stamp-h1] Error 2
make[3]: Leaving directory `/root/asuswrt-merlin/release/src/router'
make[2]: *** [all] Error 2
 
Nope still the same

tried on my normal fedora x64 image
also on the ubuntu 32bit image that i setup the other day

still the same

will try a ubuntu x64 image as soon as its installed
 
installing packages on x64 14.04 lts atm will try if it does it with this

github seems a bit slow today :p

Untitled.jpg
 
Last edited:
From the wiki followed exactly 14.04 LTS x64

exactly the same as on other images i have done will install automake 1.11 now



--run automake-1.11 --foreign
Can't locate Automake/Struct.pm in @INC (you may need to install the Automake::Struct module) (@INC contains: /projects/hnd/tools/linux/hndtools-arm-linux-2.6.36-uclibc-4.5.3/share/automake-1.11 /etc/perl /usr/local/lib/perl/5.18.2 /usr/local/share/perl/5.18.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.18 /usr/share/perl/5.18 /usr/local/lib/site_perl .) at /opt/brcm-arm/bin/automake-1.11 line 47.
BEGIN failed--compilation aborted at /opt/brcm-arm/bin/automake-1.11 line 47.
WARNING: `automake-1.11' is missing on your system. You should only need it if
you modified `Makefile.am', `acinclude.m4' or `configure.ac'.
You might want to install the `Automake' and `Perl' packages.
Grab them from any GNU archive site.
CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/bash /root/asuswrt-merlin/release/src/router/libdaemon/missing --run autoconf
configure.ac:29: error: possibly undefined macro: AM_INIT_AUTOMAKE
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
configure.ac:45: error: possibly undefined macro: AM_PROG_CC_C_O
configure.ac:52: error: possibly undefined macro: AC_PROG_LIBTOOL
configure.ac:87: error: possibly undefined macro: AM_CONDITIONAL
make[4]: *** [configure] Error 1
make[4]: Leaving directory `/root/asuswrt-merlin/release/src/router/libdaemon'
make[3]: *** [libdaemon] Error 2
make[3]: Leaving directory `/root/asuswrt-merlin/release/src/router'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/root/asuswrt-merlin/release/src-rt-6.x'
make[1]: *** [bin] Error 2
make[1]: Leaving directory `/root/asuswrt-merlin/release/src-rt-6.x'
make: *** [rt-ac66u] Error 2
root@ubuntu:~/asuswrt-merlin/release/src-rt-6.x# make rt-ac66u
 
root@ubuntu:~/asuswrt-merlin/release/src-rt-6.x# apt-get install automake1.11Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
automake1.11
0 upgraded, 1 newly installed, 0 to remove and 91 not upgraded.
Need to get 577 kB of archives.
After this operation, 1,541 kB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu/ trusty/main automake1.11 all 1:1.11.6-2 [577 kB]
Fetched 577 kB in 0s (603 kB/s)
Selecting previously unselected package automake1.11.
(Reading database ... 172075 files and directories currently installed.)
Preparing to unpack .../automake1.11_1%3a1.11.6-2_all.deb ...
Unpacking automake1.11 (1:1.11.6-2) ...
Processing triggers for man-db (2.6.7.1-1) ...
Processing triggers for doc-base (0.10.5) ...
Processing 1 added doc-base file...
Processing triggers for install-info (5.2.0.dfsg.1-2) ...
Setting up automake1.11 (1:1.11.6-2) ...
root@ubuntu:~/asuswrt-merlin/release/src-rt-6.x#
 
And back to the same error...


make[4]: Leaving directory `/root/asuswrt-merlin/release/src/router/ebtables'
make -C libdaemon
make[4]: Entering directory `/root/asuswrt-merlin/release/src/router/libdaemon'
/bin/bash ./config.status --recheck
running CONFIG_SHELL=/bin/bash /bin/bash ./configure --host=mipsel-linux --build=x86_64-linux-gnu ac_cv_func_setpgrp_void=yes --disable-dependency-tracking build_alias=x86_64-linux-gnu host_alias=mipsel-linux CC=mipsel-uclibc-gcc CFLAGS=-DBCMWPA2 -DBCMQOS -DBCM_DCS -DEXT_ACS -DD11AC_IOTYPES -DNAS_GTK_PER_STA -DPHYMON -DPROXYARP -DTRAFFIC_MGMT -DTRAFFIC_MGMT_RSSI_POLICY -DLINUX26 -DCONFIG_BCMWL5 -DDEBUG_NOISY -DDEBUG_RCTEST -pipe -DBCMWPA2 -funit-at-a-time -Wno-pointer-sign -mtune=mips32r2 -mips32r2 -DRTCONFIG_NVRAM_64K -DLINUX_KERNEL_VERSION=132630 -D__CONFIG_EMF__ -D__CONFIG_WPS__ --no-create --no-recursion
configure: WARNING: unrecognized options: --disable-dependency-tracking
./configure: line 2162: syntax error near unexpected token `foreign'
./configure: line 2162: `AM_INIT_AUTOMAKE(foreign 1.10 -Wall)'
make[4]: *** [config.status] Error 2
make[4]: Leaving directory `/root/asuswrt-merlin/release/src/router/libdaemon'
make[3]: *** [libdaemon] Error 2
make[3]: Leaving directory `/root/asuswrt-merlin/release/src/router'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/root/asuswrt-merlin/release/src-rt-6.x'
make[1]: *** [bin] Error 2
make[1]: Leaving directory `/root/asuswrt-merlin/release/src-rt-6.x'
make: *** [rt-ac66u] Error 2
root@ubuntu:~/asuswrt-merlin/release/src-rt-6.x#
 
TADA..

USE 12.04 LTS x64

14.04 is nothing but problems


ctools/trx -o image/linux-lzma.trx ctools/vmlinuz-lzma ctools/target.squashfs
ctools/trx_asus -i image/linux-lzma.trx -r RT-AC66U,3.0.0.4,image/RT-AC66U_3.0.0.4_374.42_0.trx

Creating ASUS RT-AC66U firmware to image/RT-AC66U_3.0.0.4_374.42_0.trx

TRX Image:
Total Size .... : 26918912 (26288.0 KB) (25.7 MB)
CRC-32 ........ : 4B82892F


make[3]: Leaving directory `/root/asuswrt-merlin/release/src-rt-6.x'
make[2]: Leaving directory `/root/asuswrt-merlin/release/src-rt-6.x'
make[1]: Leaving directory `/root/asuswrt-merlin/release/src-rt-6.x'
root@ubuntu:~/asuswrt-merlin/release/src-rt-6.x#
 
Better still it actually worked now to get tinkering..

Linux version 2.6.22.19 (root@asus) (gcc version 4.2.4) #1 Tue May 13 02:37:53 BST 2014

Linux Aurora 2.6.22.19 #1 Tue May 13 02:37:53 BST 2014 mips GNU/Linux
 
Got asuswrt-merlin to successfully build on Ubuntu 14.04 LTS x64

And back to the same error...


make[4]: Leaving directory `/root/asuswrt-merlin/release/src/router/ebtables'
make -C libdaemon
make[4]: Entering directory `/root/asuswrt-merlin/release/src/router/libdaemon'
/bin/bash ./config.status --recheck
running CONFIG_SHELL=/bin/bash /bin/bash ./configure --host=mipsel-linux --build=x86_64-linux-gnu ac_cv_func_setpgrp_void=yes --disable-dependency-tracking build_alias=x86_64-linux-gnu host_alias=mipsel-linux CC=mipsel-uclibc-gcc CFLAGS=-DBCMWPA2 -DBCMQOS -DBCM_DCS -DEXT_ACS -DD11AC_IOTYPES -DNAS_GTK_PER_STA -DPHYMON -DPROXYARP -DTRAFFIC_MGMT -DTRAFFIC_MGMT_RSSI_POLICY -DLINUX26 -DCONFIG_BCMWL5 -DDEBUG_NOISY -DDEBUG_RCTEST -pipe -DBCMWPA2 -funit-at-a-time -Wno-pointer-sign -mtune=mips32r2 -mips32r2 -DRTCONFIG_NVRAM_64K -DLINUX_KERNEL_VERSION=132630 -D__CONFIG_EMF__ -D__CONFIG_WPS__ --no-create --no-recursion
configure: WARNING: unrecognized options: --disable-dependency-tracking
./configure: line 2162: syntax error near unexpected token `foreign'
./configure: line 2162: `AM_INIT_AUTOMAKE(foreign 1.10 -Wall)'
make[4]: *** [config.status] Error 2
make[4]: Leaving directory `/root/asuswrt-merlin/release/src/router/libdaemon'
make[3]: *** [libdaemon] Error 2
make[3]: Leaving directory `/root/asuswrt-merlin/release/src/router'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/root/asuswrt-merlin/release/src-rt-6.x'
make[1]: *** [bin] Error 2
make[1]: Leaving directory `/root/asuswrt-merlin/release/src-rt-6.x'
make: *** [rt-ac66u] Error 2
root@ubuntu:~/asuswrt-merlin/release/src-rt-6.x#

I was getting the same error and got it fixed and working on Ubuntu 14.04 LTS x64.

Here are all of what I did:
Initially (not following the wiki as I didn't know about it, instead using https://github.com/RMerl/asuswrt-merlin/blob/master/README.TXT )
1. Used Ubuntu Software Center and installed the packages in the readme.
2. Ran the following:
Code:
git clone https://github.com/RMerl/asuswrt-merlin.git ~/asuswrt
sudo ln -s $HOME/asuswrt/tools/brcm /opt/brcm
sudo ln -s $HOME/asuswrt/release/src-rt-6.x.4708/toolchains/hndtools-arm-linux-2.6.36-uclibc-4.5.3 /opt/brcm-arm
export PATH=$PATH:/opt/brcm/hndtools-mipsel-linux/bin:/opt/brcm/hndtools-mipsel-uclibc/bin:/opt/brcm-arm/bin
cd release/src-rt
make rt-n16

Got an error that automake-1.11 / aclocal-1.11 couldn't be found.
3. Used Ubuntu Software Center and installed automake1.11 (Note: the default is automake 1.14 which per Ubuntu Software Center: "Automake 1.14 fails to work in a number of situations that Automake 1.4, 1.6, 1.7, 1.8, 1.10, and 1.11 did, so previous versions are available as separate packages.")

4. Retried the build using "make rt-n16" again. It failed with the above error
WARNING: unrecognized options: --disable-dependency-tracking
./configure: line 2162: syntax error near unexpected token `foreign'

5. Saw and ran the following after reading the wiki https://github.com/RMerl/asuswrt-merlin/wiki/Compile-Firmware-from-source-using-Ubuntu:
Code:
sudo apt-get install autoconf automake bash bison bzip2 diffutils file flex m4 \
g++ gawk groff-base libncurses-dev libtool libslang2 make patch perl pkg-config \
shtool subversion tar texinfo zlib1g zlib1g-dev git-core gettext libexpat1-dev \
libssl-dev cvs gperf unzip python libxml-parser-perl gcc-multilib gconf-editor \
libxml2-dev g++-4.4 g++-multilib gitk libncurses5 mtd-utils libncurses5-dev \
libstdc++6-4.4-dev libvorbis-dev g++-4.4-multilib git autopoint autogen sed \
build-essential intltool libelf1:i386 libglib2.0-dev

sudo apt-get install lib32z1-dev

sudo apt-get install libproxy-dev

cp /usr/include/proxy.h ~/asuswrt/release/src/router/neon/
cd ~/asuswrt/release/src/router/libdaemon
aclocal
cd ~/asuswrt/release/src/router/libxml2
sed -i s/AM_C_PROTOTYPES/#AM_C_PROTOTYPES/g ~/asuswrt/release/src/router/libxml2/configure.in
aclocal

6. Retried the build using "make rt-n16" again, and eventually got:
...
Exportable Little endian filesystem, data block size 65536, compressed data, compressed metadata, compressed fragments, duplicates are removed
Filesystem size 24513.80 Kbytes (23.94 Mbytes)
39.37% of uncompressed filesystem size (62257.51 Kbytes)
Inode table size 14053 bytes (13.72 Kbytes)
24.93% of uncompressed inode table size (56367 bytes)
Directory table size 16766 bytes (16.37 Kbytes)
54.71% of uncompressed directory table size (30648 bytes)
Number of duplicate files found 8
Number of inodes 1690
Number of files 1340
Number of fragments 192
Number of symbolic links 255
Number of device nodes 0
Number of fifo nodes 0
Number of socket nodes 0
Number of directories 95
Number of uids 1
root (0)
Number of gids 0
ctools/trx -o image/linux-lzma.trx lzma-loader/loader.gz ctools/vmlinuz-lzma ctools/target.squashfs
warning: increasing offset 2699 to 2700
warning: increasing offset 1254082 to 1254084
ctools/trx_asus -i image/linux-lzma.trx -r RT-N16,3.0.0.4,image/RT-N16_3.0.0.4_374.42_2.trx

Creating ASUS RT-N16 firmware to image/RT-N16_3.0.0.4_374.42_2.trx

TRX Image:
Total Size .... : 26361856 (25744.0 KB) (25.1 MB)
CRC-32 ........ : 3C3D00C1

BINGO! :D

Now I need to figure out how the code is organized so I can put together some potentially useful patches.
 
Last edited:
Interestingly, just following the above steps and doing a build resulted bunch of changes to the src. They are mostly Makefiles, with the exception of proxy.h, aclocal.m4, and a few configs. Am I supposed to discard these?

Code:
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   ../src/router/avahi-0.6.31/Makefile.in
	modified:   ../src/router/avahi-0.6.31/aclocal.m4
	modified:   ../src/router/avahi-0.6.31/avahi-autoipd/Makefile.in
	modified:   ../src/router/avahi-0.6.31/avahi-client/Makefile.in
	modified:   ../src/router/avahi-0.6.31/avahi-common/Makefile.in
	modified:   ../src/router/avahi-0.6.31/avahi-compat-howl/Makefile.in
	modified:   ../src/router/avahi-0.6.31/avahi-compat-howl/samples/Makefile.in
	modified:   ../src/router/avahi-0.6.31/avahi-compat-libdns_sd/Makefile.in
	modified:   ../src/router/avahi-0.6.31/avahi-core/Makefile.in
	modified:   ../src/router/avahi-0.6.31/avahi-daemon/Makefile.in
	modified:   ../src/router/avahi-0.6.31/avahi-discover-standalone/Makefile.in
	modified:   ../src/router/avahi-0.6.31/avahi-dnsconfd/Makefile.in
	modified:   ../src/router/avahi-0.6.31/avahi-glib/Makefile.in
	modified:   ../src/router/avahi-0.6.31/avahi-gobject/Makefile.in
	modified:   ../src/router/avahi-0.6.31/avahi-python/Makefile.in
	modified:   ../src/router/avahi-0.6.31/avahi-python/avahi-discover/Makefile.in
	modified:   ../src/router/avahi-0.6.31/avahi-python/avahi/Makefile.in
	modified:   ../src/router/avahi-0.6.31/avahi-qt/Makefile.in
	modified:   ../src/router/avahi-0.6.31/avahi-sharp/Makefile.in
	modified:   ../src/router/avahi-0.6.31/avahi-ui-sharp/Makefile.in
	modified:   ../src/router/avahi-0.6.31/avahi-ui/Makefile.in
	modified:   ../src/router/avahi-0.6.31/avahi-utils/Makefile.in
	modified:   ../src/router/avahi-0.6.31/common/Makefile.in
	modified:   ../src/router/avahi-0.6.31/configure
	modified:   ../src/router/avahi-0.6.31/examples/Makefile.in
	modified:   ../src/router/avahi-0.6.31/initscript/Makefile.in
	modified:   ../src/router/avahi-0.6.31/initscript/archlinux/Makefile.in
	modified:   ../src/router/avahi-0.6.31/initscript/darwin/Makefile.in
	modified:   ../src/router/avahi-0.6.31/initscript/debian/Makefile.in
	modified:   ../src/router/avahi-0.6.31/initscript/fedora/Makefile.in
	modified:   ../src/router/avahi-0.6.31/initscript/freebsd/Makefile.in
	modified:   ../src/router/avahi-0.6.31/initscript/gentoo/Makefile.in
	modified:   ../src/router/avahi-0.6.31/initscript/lfs/Makefile.in
	modified:   ../src/router/avahi-0.6.31/initscript/mandriva/Makefile.in
	modified:   ../src/router/avahi-0.6.31/initscript/slackware/Makefile.in
	modified:   ../src/router/avahi-0.6.31/initscript/suse/Makefile.in
	modified:   ../src/router/avahi-0.6.31/man/Makefile.in
	modified:   ../src/router/avahi-0.6.31/service-type-database/Makefile.in
	modified:   ../src/router/avahi-0.6.31/tests/Makefile.in
	modified:   ../src/router/libdaemon/config.h.in
	modified:   ../src/router/libdaemon/configure
	modified:   ../src/router/libid3tag/configure
	modified:   ../src/router/libxml2/config.h.in
	modified:   ../src/router/libxml2/configure
	modified:   ../src/router/libxml2/configure.in
	modified:   ../src/router/lighttpd-1.4.29/Makefile.in
	modified:   ../src/router/lighttpd-1.4.29/aclocal.m4
	modified:   ../src/router/lighttpd-1.4.29/configure
	modified:   ../src/router/lighttpd-1.4.29/doc/Makefile.in
	modified:   ../src/router/lighttpd-1.4.29/doc/config/Makefile.in
	modified:   ../src/router/lighttpd-1.4.29/doc/config/conf.d/Makefile.in
	modified:   ../src/router/lighttpd-1.4.29/doc/config/vhosts.d/Makefile.in
	modified:   ../src/router/lighttpd-1.4.29/doc/initscripts/Makefile.in
	modified:   ../src/router/lighttpd-1.4.29/doc/outdated/Makefile.in
	modified:   ../src/router/lighttpd-1.4.29/doc/scripts/Makefile.in
	modified:   ../src/router/lighttpd-1.4.29/src/Makefile.in
	modified:   ../src/router/lighttpd-1.4.29/tests/Makefile.in
	modified:   ../src/router/lighttpd-1.4.29/tests/docroot/123/Makefile.in
	modified:   ../src/router/lighttpd-1.4.29/tests/docroot/Makefile.in
	modified:   ../src/router/lighttpd-1.4.29/tests/docroot/www/Makefile.in
	modified:   ../src/router/lighttpd-1.4.29/tests/docroot/www/expire/Makefile.in
	modified:   ../src/router/lighttpd-1.4.29/tests/docroot/www/go/Makefile.in
	modified:   ../src/router/lighttpd-1.4.29/tests/docroot/www/indexfile/Makefile.in
	modified:   ../src/router/ndisc6/Makefile.in
	modified:   ../src/router/ndisc6/aclocal.m4
	modified:   ../src/router/ndisc6/compat/Makefile.in
	modified:   ../src/router/ndisc6/configure
	modified:   ../src/router/ndisc6/doc/Makefile.in
	modified:   ../src/router/ndisc6/m4/Makefile.in
	modified:   ../src/router/ndisc6/rdnssd/Makefile.in
	modified:   ../src/router/ndisc6/src/Makefile.in

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	../src/router/neon/proxy.h
 

Is there a way to automatically remove/undo all of the automake changes, so when I am checking my own changes using 'git status' or 'git diff' I don't get spammed by all of the Makefile.in and other automake changes? I tried 'make clean' and 'make distclean', but they didn't remove the auto generated files. The root cause of the changes is because the current Automake artifacts are made by 1.11.1, while I have version 1.11.6.

I see two options:
1. The files in git repository are updated to use Automake 1.11.6. This may require Asus to update their build system, which is out of our control.
2. A cleanup or ignore process intervenes all of the Automake 1.11.6 changes in Makefiles, etc. so they don't pollute as changes git is tracking.

(Note that I am not listing downgrade of Automake to 1.11.1 as an option since Automake 1.11.6 includes two security fixes that affect 1.11.1: CVE-2012-3386 and CVE-2009-4029)

:confused: Any ideas on how to do Option 2 ?
 
Last edited:
lighttpd-1.4.28 is not very current. You may be suffering from lighttpd bug #2300 Libev-4.0 isn't detected by lighttpd-1.x, this was fixed in 1.4.29 (backport from 2.0).

Otherwise, try:

- double check your dependencies (specifically required versions of autoconf etc) as documented on the h264.code-shop.com instructions
- make sure you can build lighttpd from source without the h264 module so that you can eliminate one problem at a time
 

Similar threads

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Back
Top