#111 Can't build tidy on Mac OS X

closed-fixed
nobody
5
2007-04-11
2007-04-09
No

I'm trying to build the current version of tidy on OS X, as the DarwinPorts and Fink versions are a couple of years old, and don't include the new "preserve-entities" option, which I'd very much like to have.

I checked out the latest code from CVS on April 9, 2007, and tried to build tidy using gmake, but I get the following errors. Any help would be greatly appreciated.

if [ ! -d ./obj ]; then mkdir ./obj; fi
gcc -g -pedantic -Wall -Wno-switch -Wno-parentheses -I ../../include -Wunused-parameter -D_DEBUG=1 -o obj/access.o -c ../../src/access.c
if [ ! -d ./obj ]; then mkdir ./obj; fi
gcc -g -pedantic -Wall -Wno-switch -Wno-parentheses -I ../../include -Wunused-parameter -D_DEBUG=1 -o obj/attrs.o -c ../../src/attrs.c
if [ ! -d ./obj ]; then mkdir ./obj; fi
gcc -g -pedantic -Wall -Wno-switch -Wno-parentheses -I ../../include -Wunused-parameter -D_DEBUG=1 -o obj/istack.o -c ../../src/istack.c
if [ ! -d ./obj ]; then mkdir ./obj; fi
gcc -g -pedantic -Wall -Wno-switch -Wno-parentheses -I ../../include -Wunused-parameter -D_DEBUG=1 -o obj/parser.o -c ../../src/parser.c
if [ ! -d ./obj ]; then mkdir ./obj; fi
gcc -g -pedantic -Wall -Wno-switch -Wno-parentheses -I ../../include -Wunused-parameter -D_DEBUG=1 -o obj/tags.o -c ../../src/tags.c
if [ ! -d ./obj ]; then mkdir ./obj; fi
gcc -g -pedantic -Wall -Wno-switch -Wno-parentheses -I ../../include -Wunused-parameter -D_DEBUG=1 -o obj/entities.o -c ../../src/entities.c
if [ ! -d ./obj ]; then mkdir ./obj; fi
gcc -g -pedantic -Wall -Wno-switch -Wno-parentheses -I ../../include -Wunused-parameter -D_DEBUG=1 -o obj/lexer.o -c ../../src/lexer.c
if [ ! -d ./obj ]; then mkdir ./obj; fi
gcc -g -pedantic -Wall -Wno-switch -Wno-parentheses -I ../../include -Wunused-parameter -D_DEBUG=1 -o obj/pprint.o -c ../../src/pprint.c
if [ ! -d ./obj ]; then mkdir ./obj; fi
gcc -g -pedantic -Wall -Wno-switch -Wno-parentheses -I ../../include -Wunused-parameter -D_DEBUG=1 -o obj/clean.o -c ../../src/clean.c
if [ ! -d ./obj ]; then mkdir ./obj; fi
gcc -g -pedantic -Wall -Wno-switch -Wno-parentheses -I ../../include -Wunused-parameter -D_DEBUG=1 -o obj/localize.o -c ../../src/localize.c
../../src/localize.c:421: warning: string length '979' is greater than the length '509' ISO C89 compilers are required to support
../../src/localize.c:567: warning: string length '586' is greater than the length '509' ISO C89 compilers are required to support
../../src/localize.c:734: warning: string length '662' is greater than the length '509' ISO C89 compilers are required to support
if [ ! -d ./obj ]; then mkdir ./obj; fi
gcc -g -pedantic -Wall -Wno-switch -Wno-parentheses -I ../../include -Wunused-parameter -D_DEBUG=1 -o obj/config.o -c ../../src/config.c
if [ ! -d ./obj ]; then mkdir ./obj; fi
gcc -g -pedantic -Wall -Wno-switch -Wno-parentheses -I ../../include -Wunused-parameter -D_DEBUG=1 -o obj/alloc.o -c ../../src/alloc.c
if [ ! -d ./obj ]; then mkdir ./obj; fi
gcc -g -pedantic -Wall -Wno-switch -Wno-parentheses -I ../../include -Wunused-parameter -D_DEBUG=1 -o obj/attrask.o -c ../../src/attrask.c
if [ ! -d ./obj ]; then mkdir ./obj; fi
gcc -g -pedantic -Wall -Wno-switch -Wno-parentheses -I ../../include -Wunused-parameter -D_DEBUG=1 -o obj/attrdict.o -c ../../src/attrdict.c
if [ ! -d ./obj ]; then mkdir ./obj; fi
gcc -g -pedantic -Wall -Wno-switch -Wno-parentheses -I ../../include -Wunused-parameter -D_DEBUG=1 -o obj/attrget.o -c ../../src/attrget.c
if [ ! -d ./obj ]; then mkdir ./obj; fi
gcc -g -pedantic -Wall -Wno-switch -Wno-parentheses -I ../../include -Wunused-parameter -D_DEBUG=1 -o obj/buffio.o -c ../../src/buffio.c
if [ ! -d ./obj ]; then mkdir ./obj; fi
gcc -g -pedantic -Wall -Wno-switch -Wno-parentheses -I ../../include -Wunused-parameter -D_DEBUG=1 -o obj/fileio.o -c ../../src/fileio.c
if [ ! -d ./obj ]; then mkdir ./obj; fi
gcc -g -pedantic -Wall -Wno-switch -Wno-parentheses -I ../../include -Wunused-parameter -D_DEBUG=1 -o obj/streamio.o -c ../../src/streamio.c
if [ ! -d ./obj ]; then mkdir ./obj; fi
gcc -g -pedantic -Wall -Wno-switch -Wno-parentheses -I ../../include -Wunused-parameter -D_DEBUG=1 -o obj/tagask.o -c ../../src/tagask.c
if [ ! -d ./obj ]; then mkdir ./obj; fi
gcc -g -pedantic -Wall -Wno-switch -Wno-parentheses -I ../../include -Wunused-parameter -D_DEBUG=1 -o obj/tmbstr.o -c ../../src/tmbstr.c
if [ ! -d ./obj ]; then mkdir ./obj; fi
gcc -g -pedantic -Wall -Wno-switch -Wno-parentheses -I ../../include -Wunused-parameter -D_DEBUG=1 -o obj/utf8.o -c ../../src/utf8.c
if [ ! -d ./obj ]; then mkdir ./obj; fi
gcc -g -pedantic -Wall -Wno-switch -Wno-parentheses -I ../../include -Wunused-parameter -D_DEBUG=1 -o obj/tidylib.o -c ../../src/tidylib.c
if [ ! -d ./obj ]; then mkdir ./obj; fi
gcc -g -pedantic -Wall -Wno-switch -Wno-parentheses -I ../../include -Wunused-parameter -D_DEBUG=1 -o obj/mappedio.o -c ../../src/mappedio.c
if [ ! -d ../../lib ]; then mkdir ../../lib; fi
ar -r ../../lib/libtidy.a ./obj/access.o ./obj/attrs.o ./obj/istack.o ./obj/parser.o ./obj/tags.o ./obj/entities.o ./obj/lexer.o ./obj/pprint.o ./obj/clean.o ./obj/localize.o ./obj/config.o ./obj/alloc.o ./obj/attrask.o ./obj/attrdict.o ./obj/attrget.o ./obj/buffio.o ./obj/fileio.o ./obj/streamio.o ./obj/tagask.o ./obj/tmbstr.o ./obj/utf8.o ./obj/tidylib.o ./obj/mappedio.o
if [ ! -d ../../bin ]; then mkdir ../../bin; fi
gcc -g -pedantic -Wall -Wno-switch -Wno-parentheses -I ../../include -Wunused-parameter -D_DEBUG=1 -o ../../bin/tidy ../../console/tidy.c -I../../include -L../../lib -ltidy
/usr/bin/ld: Undefined symbols:
_tidyOptGetDoc
_tidyOptGetDocLinksList
_tidyOptGetNextDocLinks
collect2: ld returned 1 exit status
gmake: *** [../../bin/tidy] Error 1

Discussion

  • Logged In: YES
    user_id=566665
    Originator: NO

    I think that you need to replace "-L../../lib -ltidy" by "../../libtidy.a". On MacOSX, the Apple linker insists on finding the existing shared library which is somewhere on your system.
    I added a note to "Makefile" to that effect.

     
    • status: open --> pending-accepted
     
  • Logged In: YES
    user_id=651850
    Originator: YES

    Thanks, that worked like a charm.

     
    • status: pending-accepted --> open-accepted
     
    • labels: --> Install Problem
    • status: open-accepted --> closed-fixed