Issue with configure on OSX

Issue #121 new
Anonymous created an issue

Issue when using configure on OSX:

I am attempting to build libgd 2.1.0 on OSX 10.6 with support for PNG, JPEG, and TIFF files. The libraries and header files are installed on my system in the directories /usr/local/imagemagick/lib and /usr/local/imagemagick/include. I have tried to build libgd with gcc and cmake, but have failed in both cases.

When looking around the net for a solution to this problem I came across a post from someone on Stack Overflow:

http://stackoverflow.com/questions/22059211/error-installing-libgd-in-mac-10-9

Thus, it looks as if this could be a general bug, but I would really appreciate it if someone could help me resolve this issue.

When using cmake I have the following output:

$ cmake -DBUILD_TEST=1 ENABLE_PNG=1 ENABLE_JPEG=1 ENABLE_TIFF=1 ENABLE_FREETYPE=1 -DCMAKE_LIBRARY_PATH=/usr/local/imagemagick/lib -DCMAKE_INCLUDE_PATH=/usr/local/imagemagick/include ../src
-- The C compiler identification is GNU 4.2.1
-- The CXX compiler identification is GNU 4.2.1
-- Checking whether C compiler has -isysroot
-- Checking whether C compiler has -isysroot - yes
-- Checking whether C compiler supports OSX deployment target flag
-- Checking whether C compiler supports OSX deployment target flag - yes
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Checking whether CXX compiler has -isysroot
-- Checking whether CXX compiler has -isysroot - yes
-- Checking whether CXX compiler supports OSX deployment target flag
-- Checking whether CXX compiler supports OSX deployment target flag - yes
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
CMake Error at CMakeLists.txt:83 (target_link_libraries):
target_link_libraries called with incorrect number of arguments

CMake Error at CMakeLists.txt:84 (target_link_libraries):
target_link_libraries called with incorrect number of arguments

CMake Warning (dev) in CMakeLists.txt:
No cmake_minimum_required command is present. A line of code such as

cmake_minimum_required(VERSION 2.8)

should be added at the top of the file. The version specified may be lower
if you wish to support older CMake versions for this project. For more
information run "cmake --help-policy CMP0000".
This warning is for project developers. Use -Wno-dev to suppress it.

-- Configuring incomplete, errors occurred!

The version of cmake I have installed on my machine is: cmake-2.8.10.2

When attempting to compile the software with gcc I have tried many variants of the command line to indicate where the headers and libraries are located:

$ MACOSX_DEPLOYMENT_TARGET=10.6 CFLAGS="-arch i386 -arch x86_64 -g -Os -pipe" LIBDIR="/usr/local/imagemagick/lib" CCFLAGS="-arch i386 -arch x86_64 -g -Os -pipe" CXXFLAGS="-arch i386 -arch x86_64 -g -Os -pipe" CPP="cpp" CPPFLAGS="-I/usr/local/imagemagick/include" LDFLAGS="-arch i386 -arch x86_64 -L/usr/local/imagemagick/lib" ./configure --disable-dependency-tracking --with-jpeg=/usr/local/imagemagick --with-tiff=/usr/local/imagemagick
checking build system type... x86_64-apple-darwin10.8.0
checking host system type... x86_64-apple-darwin10.8.0
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... config/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 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... none
checking for gcc option to accept ISO C99... -std=gnu99
checking for gcc -std=gnu99 option to accept ISO Standard C... (cached) -std=gnu99
checking whether gcc -std=gnu99 and cc understand -c and -o together... yes
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 -std=gnu99... /usr/libexec/gcc/i686-apple-darwin10/4.2.1/ld
checking if the linker (/usr/libexec/gcc/i686-apple-darwin10/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/libexec/gcc/i686-apple-darwin10/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 -std=gnu99 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... cpp
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 -std=gnu99 supports -fno-rtti -fno-exceptions... no
checking for gcc -std=gnu99 option to produce PIC... -fno-common -DPIC
checking if gcc -std=gnu99 PIC flag -fno-common -DPIC works... yes
checking if gcc -std=gnu99 static flag -static works... no
checking if gcc -std=gnu99 supports -c -o file.o... yes
checking if gcc -std=gnu99 supports -c -o file.o... (cached) yes
checking whether the gcc -std=gnu99 linker (/usr/libexec/gcc/i686-apple-darwin10/4.2.1/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin10.8.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 whether ln -s works... yes
checking whether make sets $(MAKE)... (cached) yes
checking for pkg-config... no
checking for X... libraries /usr/X11/lib, headers
checking for ANSI C header files... (cached) yes
checking errno.h usability... yes
checking errno.h presence... yes
checking for errno.h... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking stddef.h usability... yes
checking stddef.h presence... yes
checking for stddef.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for unistd.h... (cached) yes
checking for ld used by GCC... /usr/libexec/gcc/i686-apple-darwin10/4.2.1/ld
checking if the linker (/usr/libexec/gcc/i686-apple-darwin10/4.2.1/ld) is GNU ld... no
checking for shared library run path origin... done
checking for iconv... yes
checking for working iconv... yes
checking how to link with libiconv... -liconv
checking for iconv declaration...
extern size_t iconv (iconv_t cd, char * inbuf, size_t inbytesleft, char * outbuf, size_t outbytesleft);
checking iconv.h usability... yes
checking iconv.h presence... yes
checking for iconv.h... yes
checking whether iconv.h defines iconv_t... yes
checking for sin... yes
checking for deflate in -lz... yes
checking for LIBPNG... no
checking for LIBFREETYPE... no
checking for LIBFONTCONFIG... no
checking for jpeg_set_defaults in -ljpeg... no
checking for LIBXPM... no
checking for LIBVPX... no
checking for LIBVPX... no
checking for TIFFClientOpen in -ltiff... no
configure: error: tiff support requested, but not found

If I leave off the options --with-jpeg=/usr/local/imagemagick --with-tiff=/usr/local/imagemagick

It completes producing the following summary:

....
checking for simple visibility declarations... yes
checking whether pthreads work with -pthread... yes
checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
checking if more special flags are required for pthreads... -D_THREAD_SAFE
checking for PTHREAD_PRIO_INHERIT... yes
checking whether we are building for a Win32 host... no

** Configuration summary for libgd 2.1.0:

Support for Zlib: yes
Support for PNG library: no
Support for JPEG library: no
Support for VPX library: no
Support for TIFF library: no
Support for Freetype 2.x library: no
Support for Fontconfig library: no
Support for Xpm library: no
Support for pthreads: yes

configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating tests/Makefile
config.status: creating tests/test_config.h
config.status: creating config/Makefile
config.status: creating config/gdlib-config
config.status: creating config/gdlib.pc
config.status: creating src/config.h
config.status: src/config.h is unchanged
config.status: executing depfiles commands
config.status: executing libtool commands

I have tried creating symbolic links to the headers and libraries in /usr/local/include and /usr/local/lib in case that would solve the problem, but this does not help. I have linked other software against these libraries, so I believe they are installed correctly.

I would really appreciate it if some one could help me install libgd configured to support these image formats.

Best wishes,

Robert

Comments (3)

  1. Odumosu Dipo

    I've no idea what your particular setup is, but if you have homebrew installed, you can easily do brew install gd and it will build with support for PNG, JPG and TIFF by default.

    Also, I may be wrong, but GD and ImageMagick don't necessarily depend on each other.

  2. Diana

    In your configure output I see : "checking for pkg-config... no".

    Pkg_config is the executable that configure is using to look for libpng info and libfreetype info (among others - in the config.log look for the variable $PKG_CONFIG too see the others). This could just mean that it, pkg-config, is not in your PATH. I would say go find pkg-config and make sure it is in your PATH.

    Incidentally, pkg-config can source different directories for package information, so once you find the binary you might have to create a PKG_CONFIG_PATH environment variable with all the package install directories you need.

    Have faith. I updated all my libs this morning on my Mac, for a project I am working on, and everything built including gd. Gd "make check" passed 89 tests and skipped only one (apparently it thinks libjpeg v9 is too new).

    Di

  3. Log in to comment