#33 optipng v0.7 compilation error on OS X 10.6.8


i am trying to compile 0.7 on OS X 10.6.8 (Snow Leopard) but I am getting a compile time error

*** first, i run ./configure:

$ sudo ./configure
Checking for gcc...
Using pre-configured libpng...
Configuring zlib...
Checking for gcc...
Building static library libz.a version 1.2.6-optipng with gcc.
Checking for off64_t... No.
Checking for fseeko... Yes.
Checking for unistd.h... Yes.
Checking for stdarg.h... Yes.
Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf().
Checking for vsnprintf() in stdio.h... Yes.
Checking for return value of vsnprintf()... Yes.
Checking for attribute(visibility) support... Yes.

*** the I run make

$ sudo make
cd src/optipng && \ make && \ cd ../..
gcc -c -O2 -Wall -Wextra -I../cexcept -I../zlib -I../libpng -I../pngxtern optipng.c
gcc -c -O2 -Wall -Wextra -I../cexcept -I../zlib -I../libpng -I../pngxtern opngoptim.c
gcc -c -O2 -Wall -Wextra -I../cexcept -I../zlib -I../libpng -I../pngxtern opngreduc.c
gcc -c -O2 -Wall -Wextra -I../cexcept -I../zlib -I../libpng -I../pngxtern cbitset.c
gcc -c -O2 -Wall -Wextra -I../cexcept -I../zlib -I../libpng -I../pngxtern osys.c
gcc -c -O2 -Wall -Wextra -I../cexcept -I../zlib -I../libpng -I../pngxtern wildargs.c
cd ../zlib && \ make -f Makefile libz.a && \ cd ../optipng
gcc -O3 -c -o adler32.o adler32.c
gcc -O3 -c -o crc32.o crc32.c
gcc -O3 -c -o deflate.o deflate.c
gcc -O3 -c -o infback.o infback.c
gcc -O3 -c -o inffast.o inffast.c
gcc -O3 -c -o inflate.o inflate.c
gcc -O3 -c -o inftrees.o inftrees.c
gcc -O3 -c -o trees.o trees.c
gcc -O3 -c -o zutil.o zutil.c
gcc -O3 -c -o compress.o compress.c
gcc -O3 -c -o uncompr.o uncompr.c
gcc -O3 -c -o gzclose.o gzclose.c
gcc -O3 -c -o gzlib.o gzlib.c
gcc -O3 -c -o gzread.o gzread.c
gcc -O3 -c -o gzwrite.o gzwrite.c
libtool -o libz.a adler32.o crc32.o deflate.o infback.o inffast.o inflate.o inftrees.o trees.o zutil.o compress.o uncompr.o gzclose.o gzlib.o gzread.o gzwrite.o
libtool: unrecognized option `-o'
libtool: Try `libtool --help' for more information.
make[2]: *** [libz.a] Error 1
make[1]: *** [../zlib/libz.a] Error 2
make: *** [all] Error 2

libtool doesn't recognize the "-o" flag

*** here is my output of libtool's help:

$ libtool --help |more
Usage: libtool [OPTION]... [MODE-ARG]...

Provide generalized library-building support services.

--config show all configuration variables
--debug enable verbose shell tracing
-n, --dry-run display commands without modifying any files
--features display basic configuration information and exit
--mode=MODE use operation mode MODE
--preserve-dup-deps don't remove duplicate dependency libraries
--quiet, --silent don't print informational messages
--no-quiet, --no-silent
print informational messages (default)
--tag=TAG use configuration variables from tag TAG
-v, --verbose print more informational messages than default
--no-verbose don't print the extra informational messages
--version print version information
-h, --help, --help-all print short, long, or detailed help message

MODE must be one of the following:

clean remove files from the build directory
compile compile a source file into a libtool object
execute automatically set library path, then run a program
finish complete the installation of libtool libraries
install install libraries or executables
link create a library or an executable
uninstall remove libraries from an installed directory

MODE-ARGS vary depending on the MODE. When passed as first option,
`--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that.
Try `libtool --help --mode=MODE' for a more detailed description of MODE.

When reporting a bug, please describe a test case to reproduce it and
include the following information:

host-triplet: powerpc-apple-darwin8.11.0
shell: /bin/sh
compiler: gcc
compiler flags: -g -O2
linker: /usr/bin/ld (gnu? no)
libtool: (GNU libtool) 2.4
automake: automake (GNU automake) 1.10
autoconf: autoconf (GNU Autoconf) 2.61

Report bugs to <bug-libtool@gnu.org>.
GNU libtool home page: <http://www.gnu.org/software/libtool/>.
General help using GNU software: <http://www.gnu.org/gethelp/>.


  • Cosmin Truta

    Cosmin Truta - 2012-03-14
    • assigned_to: nobody --> cosmin
    • status: open --> open-accepted
  • Cosmin Truta

    Cosmin Truta - 2012-03-14

    Thank you for your report.
    This looks like a failure in zlib's build on OS X. I will forward this bug report to the zlib developers.

  • Cosmin Truta

    Cosmin Truta - 2012-03-15


    I spoke with the zlib developer, who actually uses OS X as his primary development environment. He uses the Apple-supplied libtool which comes with Xcode, and he does not see the problem that you reported.

    In your report, it appears you are using GNU libtool. Did you, by any chance, get this from MacPorts, or maybe Fink? Could you please tell me what comes out of the command `which libtool`?

  • Norm

    Norm - 2012-03-15

    ah, this makes sense. I have MAMP installed and it's listed earlier in my PATH var, so it's using /Applications/MAMP/Library/bin/libtool instead of /usr/bin/libtool

    $ which libtool

    $ which -a libtool

    looks to be a PATH precedence issue on my machine! thanks for looking into this!

  • Cosmin Truta

    Cosmin Truta - 2012-03-15

    Ok, thank you for the confirmation.
    I forwarded your info to the zlib mailing list. Since I don't use a Mac, I have no opinion on whether zlib should adapt their build system to non-Apple libtool, or whether MAMP should leave the Apple libtool in its right place in PATH.
    If you do have an opinion/suggestion on this, I encourage you to share it with them:

  • Cosmin Truta

    Cosmin Truta - 2012-03-18

    Closing bug as WONTFIX, following the decision of the zlib developers.
    I appreciate your report, though. It's good to be aware of this issue.

  • Cosmin Truta

    Cosmin Truta - 2012-03-18
    • status: open-accepted --> closed-wont-fix

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks