Compiling on Mac OS 10.7 | docsis.org

You are here

Compiling on Mac OS 10.7

4 posts / 0 new
Last post
jchiar
Compiling on Mac OS 10.7

Trying to compile docsis 0.9.6 on Mac os. First I needed to set the arch to i386

sh-3.2# export CFLAGS="-arch i386"
sh-3.2# ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking build system type... i686-apple-darwin11.3.0
checking host system type... i686-apple-darwin11.3.0
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld
checking if the linker (/usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld) is GNU ld... no
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm
checking the name lister (/usr/bin/nm) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 196608
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for /usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld option to reload object files... -r
checking for objdump... no
checking how to recognize dependent libraries... pass_all
checking for ar... ar
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm output from gcc object... ok
checking for dsymutil... dsymutil
checking for nmedit... nmedit
checking for lipo... lipo
checking for otool... otool
checking for otool64... no
checking for -single_module linker flag... yes
checking for -exported_symbols_list linker flag... yes
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fno-common -DPIC
checking if gcc PIC flag -fno-common -DPIC works... yes
checking if gcc static flag -static works... no
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin11.3.0 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for flex... flex
checking lex output file root... lex.yy
checking lex library... -lfl
checking whether yytext is a pointer... yes
checking for inet_aton in -lresolv... yes
checking for gm4... /opt/local/bin/gm4
found m4 (GNU M4) 1.4.16 at /opt/local/bin/gm4
checking for bison... /usr/bin/bison
found bison version 2003000, using /usr/bin/bison -t -d -y
checking for net-snmp-config... /opt/local/bin/net-snmp-config
found net-snmp version 5005000
checking for Cygwin... no
checking for sed... /usr/bin/sed
checking for -Waggregate-return option to gcc... no
checking for -Wbad-function-cast option to gcc... no
checking for -Wcast-align option to gcc... no
checking for -Wdeclaration-after-statement option to gcc... no
checking for -Wendif-labels option to gcc... no
checking for -Werror-implicit-function-declaration option to gcc... no
checking for -Wextra -Wno-unused-parameter option to gcc... no
checking for -Wfloat-equal option to gcc... no
checking for -Wformat-security option to gcc... no
checking for -Werror=format-security option to gcc... no
checking for -Winit-self option to gcc... no
checking for -Wmissing-declarations option to gcc... no
checking for -Wmissing-noreturn option to gcc... no
checking for -Wmissing-prototypes option to gcc... no
checking for -Wpointer-arith option to gcc... no
checking for -Wundef option to gcc... no
configure: creating ./config.status
config.status: creating build_setup.nsi
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating doc/Makefile
config.status: creating examples/Makefile
config.status: creating mibs/Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
config.status: executing libtool commands

That seemed to work. But now when I make the file:
sh-3.2# make
make all-recursive
Making all in src
gcc -DHAVE_CONFIG_H -I. -I.. -DNETSNMP_ENABLE_IPV6 -pipe -O2 -Udarwin10 -Ddarwin10=darwin10 -pipe -O2 -arch i386 -fno-common -DPERL_DARWIN -I/opt/local/include -no-cpp-precomp -fno-strict-aliasing -I/usr/local/include -I/opt/local/include -I/opt/local/lib/perl5/5.8.9/darwin-2level/CORE -I/opt/local/include -I/opt/local/include -I. -I/opt/local/include -m32 -Wall -g -arch i386 -MT docsis.o -MD -MP -MF .deps/docsis.Tpo -c -o docsis.o docsis.c
mv -f .deps/docsis.Tpo .deps/docsis.Po
gcc -DHAVE_CONFIG_H -I. -I.. -DNETSNMP_ENABLE_IPV6 -pipe -O2 -Udarwin10 -Ddarwin10=darwin10 -pipe -O2 -arch i386 -fno-common -DPERL_DARWIN -I/opt/local/include -no-cpp-precomp -fno-strict-aliasing -I/usr/local/include -I/opt/local/include -I/opt/local/lib/perl5/5.8.9/darwin-2level/CORE -I/opt/local/include -I/opt/local/include -I. -I/opt/local/include -m32 -Wall -g -arch i386 -MT ethermac.o -MD -MP -MF .deps/ethermac.Tpo -c -o ethermac.o ethermac.c
mv -f .deps/ethermac.Tpo .deps/ethermac.Po
gcc -DHAVE_CONFIG_H -I. -I.. -DNETSNMP_ENABLE_IPV6 -pipe -O2 -Udarwin10 -Ddarwin10=darwin10 -pipe -O2 -arch i386 -fno-common -DPERL_DARWIN -I/opt/local/include -no-cpp-precomp -fno-strict-aliasing -I/usr/local/include -I/opt/local/include -I/opt/local/lib/perl5/5.8.9/darwin-2level/CORE -I/opt/local/include -I/opt/local/include -I. -I/opt/local/include -m32 -Wall -g -arch i386 -MT md5.o -MD -MP -MF .deps/md5.Tpo -c -o md5.o md5.c
mv -f .deps/md5.Tpo .deps/md5.Po
gcc -DHAVE_CONFIG_H -I. -I.. -DNETSNMP_ENABLE_IPV6 -pipe -O2 -Udarwin10 -Ddarwin10=darwin10 -pipe -O2 -arch i386 -fno-common -DPERL_DARWIN -I/opt/local/include -no-cpp-precomp -fno-strict-aliasing -I/usr/local/include -I/opt/local/include -I/opt/local/lib/perl5/5.8.9/darwin-2level/CORE -I/opt/local/include -I/opt/local/include -I. -I/opt/local/include -m32 -Wall -g -arch i386 -MT docsis_encode.o -MD -MP -MF .deps/docsis_encode.Tpo -c -o docsis_encode.o docsis_encode.c
mv -f .deps/docsis_encode.Tpo .deps/docsis_encode.Po
gcc -DHAVE_CONFIG_H -I. -I.. -DNETSNMP_ENABLE_IPV6 -pipe -O2 -Udarwin10 -Ddarwin10=darwin10 -pipe -O2 -arch i386 -fno-common -DPERL_DARWIN -I/opt/local/include -no-cpp-precomp -fno-strict-aliasing -I/usr/local/include -I/opt/local/include -I/opt/local/lib/perl5/5.8.9/darwin-2level/CORE -I/opt/local/include -I/opt/local/include -I. -I/opt/local/include -m32 -Wall -g -arch i386 -MT docsis_decode.o -MD -MP -MF .deps/docsis_decode.Tpo -c -o docsis_decode.o docsis_decode.c
In file included from /opt/local/include/net-snmp/utilities.h:54,
from docsis_snmp.h:28,
from docsis_decode.c:28:
/opt/local/include/net-snmp/library/container.h: In function ‘SUBCONTAINER_FIND’:
/opt/local/include/net-snmp/library/container.h:497: warning: implicit declaration of function ‘strcmp’
mv -f .deps/docsis_decode.Tpo .deps/docsis_decode.Po
gcc -DHAVE_CONFIG_H -I. -I.. -DNETSNMP_ENABLE_IPV6 -pipe -O2 -Udarwin10 -Ddarwin10=darwin10 -pipe -O2 -arch i386 -fno-common -DPERL_DARWIN -I/opt/local/include -no-cpp-precomp -fno-strict-aliasing -I/usr/local/include -I/opt/local/include -I/opt/local/lib/perl5/5.8.9/darwin-2level/CORE -I/opt/local/include -I/opt/local/include -I. -I/opt/local/include -m32 -Wall -g -arch i386 -MT docsis_snmp.o -MD -MP -MF .deps/docsis_snmp.Tpo -c -o docsis_snmp.o docsis_snmp.c
In file included from /opt/local/include/net-snmp/utilities.h:54,
from docsis_snmp.h:28,
from docsis_snmp.c:23:
/opt/local/include/net-snmp/library/container.h: In function ‘CONTAINER_FREE’:
/opt/local/include/net-snmp/library/container.h:443: warning: implicit declaration of function ‘free’
/opt/local/include/net-snmp/library/container.h: In function ‘SUBCONTAINER_FIND’:
/opt/local/include/net-snmp/library/container.h:497: warning: implicit declaration of function ‘strcmp’
mv -f .deps/docsis_snmp.Tpo .deps/docsis_snmp.Po
/bin/sh ../ylwrap docsis_yy.y y.tab.c docsis_yy.c y.tab.h docsis_yy.h y.output docsis_yy.output -- /usr/bin/bison -t -d -y
updating docsis_yy.h
gcc -DHAVE_CONFIG_H -I. -I.. -DNETSNMP_ENABLE_IPV6 -pipe -O2 -Udarwin10 -Ddarwin10=darwin10 -pipe -O2 -arch i386 -fno-common -DPERL_DARWIN -I/opt/local/include -no-cpp-precomp -fno-strict-aliasing -I/usr/local/include -I/opt/local/include -I/opt/local/lib/perl5/5.8.9/darwin-2level/CORE -I/opt/local/include -I/opt/local/include -I. -I/opt/local/include -m32 -Wall -g -arch i386 -MT docsis_yy.o -MD -MP -MF .deps/docsis_yy.Tpo -c -o docsis_yy.o docsis_yy.c
mv -f .deps/docsis_yy.Tpo .deps/docsis_yy.Po
/bin/sh ../ylwrap docsis_lex.l lex.yy.c docsis_lex.c -- flex
gcc -DHAVE_CONFIG_H -I. -I.. -DNETSNMP_ENABLE_IPV6 -pipe -O2 -Udarwin10 -Ddarwin10=darwin10 -pipe -O2 -arch i386 -fno-common -DPERL_DARWIN -I/opt/local/include -no-cpp-precomp -fno-strict-aliasing -I/usr/local/include -I/opt/local/include -I/opt/local/lib/perl5/5.8.9/darwin-2level/CORE -I/opt/local/include -I/opt/local/include -I. -I/opt/local/include -m32 -Wall -g -arch i386 -MT docsis_lex.o -MD -MP -MF .deps/docsis_lex.Tpo -c -o docsis_lex.o docsis_lex.c
docsis_lex.c:1972: warning: ‘yyunput’ defined but not used
mv -f .deps/docsis_lex.Tpo .deps/docsis_lex.Po
gcc -DHAVE_CONFIG_H -I. -I.. -DNETSNMP_ENABLE_IPV6 -pipe -O2 -Udarwin10 -Ddarwin10=darwin10 -pipe -O2 -arch i386 -fno-common -DPERL_DARWIN -I/opt/local/include -no-cpp-precomp -fno-strict-aliasing -I/usr/local/include -I/opt/local/include -I/opt/local/lib/perl5/5.8.9/darwin-2level/CORE -I/opt/local/include -I/opt/local/include -I. -I/opt/local/include -m32 -Wall -g -arch i386 -MT hmac_md5.o -MD -MP -MF .deps/hmac_md5.Tpo -c -o hmac_md5.o hmac_md5.c
mv -f .deps/hmac_md5.Tpo .deps/hmac_md5.Po
/bin/sh ../libtool --tag=CC --mode=link gcc -Wall -g -arch i386 -L/opt/local/lib -L/opt/local/lib -L/opt/local/lib -lnetsnmp -lfl -o docsis docsis.o ethermac.o md5.o docsis_encode.o docsis_decode.o docsis_snmp.o docsis_yy.o docsis_lex.o hmac_md5.o -lresolv
libtool: link: gcc -Wall -g -arch i386 -o docsis docsis.o ethermac.o md5.o docsis_encode.o docsis_decode.o docsis_snmp.o docsis_yy.o docsis_lex.o hmac_md5.o -L/opt/local/lib /opt/local/lib/libnetsnmp.dylib -lcrypto -lfl -lresolv
ld: duplicate symbol _prog_name in docsis_encode.o and docsis.o for architecture i386
collect2: ld returned 1 exit status
make[2]: *** [docsis] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

I get errors. Any ideas?

schirrmeister
Hi,

Hi,

it's a while ago that I had this issue adding the following to docsis_encode.c should fix this:

extern char prog_name[255];

I added this to line 42 as in line 41 there is already a extern state:

41 extern unsigned int line; /* defined in docsis_lex.l */
42 extern char prog_name[255];

I hope this helps,
regards,

Benedikt

jchiar
Did that, same issue.

Did that, same issue.

sh-3.2# make
make all-recursive
Making all in src
gcc -DHAVE_CONFIG_H -I. -I.. -DNETSNMP_ENABLE_IPV6 -pipe -O2 -Udarwin10 -Ddarwin10=darwin10 -pipe -O2 -arch i386 -fno-common -DPERL_DARWIN -I/opt/local/include -no-cpp-precomp -fno-strict-aliasing -I/usr/local/include -I/opt/local/include -I/opt/local/lib/perl5/5.8.9/darwin-2level/CORE -I/opt/local/include -I/opt/local/include -I. -I/opt/local/include -Wall -g -arch i386 -MT docsis_encode.o -MD -MP -MF .deps/docsis_encode.Tpo -c -o docsis_encode.o docsis_encode.c
mv -f .deps/docsis_encode.Tpo .deps/docsis_encode.Po
/bin/sh ../libtool --tag=CC --mode=link gcc -Wall -g -arch i386 -L/opt/local/lib -L/opt/local/lib -L/opt/local/lib -lnetsnmp -lfl -o docsis docsis.o ethermac.o md5.o docsis_encode.o docsis_decode.o docsis_snmp.o docsis_yy.o docsis_lex.o hmac_md5.o -lresolv
libtool: link: gcc -Wall -g -arch i386 -o docsis docsis.o ethermac.o md5.o docsis_encode.o docsis_decode.o docsis_snmp.o docsis_yy.o docsis_lex.o hmac_md5.o -L/opt/local/lib /opt/local/lib/libnetsnmp.dylib -lcrypto -lfl -lresolv
ld: duplicate symbol _prog_name in docsis_encode.o and docsis.o for architecture i386
collect2: ld returned 1 exit status
make[2]: *** [docsis] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

jchiar
Binary

Anyone have a binary for mac os 10.7?

Log in or register to post comments