Compiling GDC on Windows -- where to get GMP and MPFR dependencies? - gmp

I'm trying to compile GDC (v2) on Windows 7, using MinGW's MSYS.
When I get to this step:
$ ../configure --enable-languages=d --disable-shared --disable-bootstrap
I get:
checking build system type... i686-pc-mingw32
checking host system type... i686-pc-mingw32
checking target system type... i686-pc-mingw32
checking for a BSD-compatible install... /bin/install -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for gcc... gcc
checking for C compiler default output file name... a.exe
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... .exe
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 ANSI C... none needed
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for gnatbind... no
checking for gnatmake... no
checking whether compiler driver understands Ada... no
checking how to compare bootstrapped objects... cmp --ignore-initial=16 $$f1 $$f2
checking for correct version of gmp.h... yes
checking for correct version of mpfr.h... no
configure: error: Building GCC requires GMP 4.1+ and MPFR 2.3.2+.
Try the --with-gmp and/or --with-mpfr options to specify their locations.
Copies of these libraries' source code can be found at their respective
hosting sites as well as at ftp://gcc.gnu.org/pub/gcc/infrastructure/.
See also http://gcc.gnu.org/install/prerequisites.html for additional info.
If you obtained GMP and/or MPFR from a vendor distribution package, make
sure that you have installed both the libraries and the header files.
They may be located in separate packages.
This made me look back at the instructions, which noted that it needs these libraries:
libgmp3-dev
libmpfr-dev
libmpc-dev
So now the question is, where do I find these headers and/or libraries? I've searched all over for libgmp3-dev, but I can't find anything for Windows. (I'm still in the learning process for *nix, so I'm not too familiar with anything.)
Thanks!
Update:
So I tried to make MPFR (I don't even know if it was the right version), and I got this error:
$ make install
Making install in tests
[...]
test -z "/usr/local/lib" || /bin/mkdir -p "/usr/local/lib"
/bin/sh ./libtool --mode=install /bin/install -c libmpfr.la '/usr/local/lib'
libtool: install: /bin/install -c .libs/libmpfr.lai /usr/local/lib/libmpfr.la
libtool: install: /bin/install -c .libs/libmpfr.a /usr/local/lib/libmpfr.a
libtool: install: chmod 644 /usr/local/lib/libmpfr.a
libtool: install: ranlib /usr/local/lib/libmpfr.a
/bin/sh: /home/Home: No such file or directory
make[2]: *** [install-libLTLIBRARIES] Error 127
make[2]: Leaving directory `/home/Home User/mpfr-2.4.2'
make[1]: *** [install-am] Error 2
make[1]: Leaving directory `/home/Home User/mpfr-2.4.2'
make: *** [install-recursive] Error 1
Any ideas?

From https://bitbucket.org/goshawk/gdc/wiki/MinGWCompile :
ftp://ftp.gmplib.org/pub/gmp-5.0.1/gmp-5.0.1.tar.bz2
http://www.mpfr.org/mpfr-current/mpfr-3.0.0.tar.bz2

http://gmplib.org/
http://www.mpfr.org/
Just download the source tarballs. As for building these, I don't remember the details (the instructions should be clear on this) but I know you can put these GMP and MPFR in the source tree with GCC and the GCC build process will automatically take care of building these. This may be easier than building/installing/setting environment variables for them as a discrete step.

I always use this for building gdc on Windows: http://gladman.plushost.co.uk/oldsite/computing/gmp4win.php

The error message you posted has the links to find the libraries. You might need to download their source code and compile them, but they are both easy to build.

Related

ld: cannot open output file conftest.exe: Permission denied

Using MSYS2 (version x86_64-20160205) on Windows 7 64bits, I'm trying to compile corkscrew.
Here is the output:
$ ./configure
loading cache ./config.cache
checking for a BSD compatible install... (cached) /usr/bin/install -c
checking whether build environment is sane... yes
checking whether make sets ${MAKE}... (cached) no
checking for working aclocal... found
checking for working autoconf... missing
checking for working automake... found
checking for working autoheader... missing
checking for working makeinfo... missing
checking for gcc... (cached) gcc
checking whether the C compiler (gcc ) works... yes
checking whether the C compiler (gcc ) is a cross-compiler... no
checking whether we are using GNU C... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ANSI C... (cached) none needed
checking how to run the C preprocessor... (cached) gcc -E
checking for function prototypes... yes
checking for gcc... (cached) gcc
checking whether the C compiler (gcc -g -O2 ) works... no
configure: error: installation or configuration problem: C compiler cannot create executables.
And the content of config.log:
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
configure:556: checking for a BSD compatible install
configure:609: checking whether build environment is sane
configure:666: checking whether make sets ${MAKE}
configure:712: checking for working aclocal
configure:725: checking for working autoconf
configure:738: checking for working automake
configure:751: checking for working autoheader
configure:764: checking for working makeinfo
configure:783: checking for gcc
configure:896: checking whether the C compiler (gcc ) works
configure:912: gcc -o conftest conftest.c 1>&5
configure:909:1: warning: return type defaults to 'int' [-Wimplicit-int]
main(){return(0);}
^
configure:938: checking whether the C compiler (gcc ) is a cross-compiler
configure:943: checking whether we are using GNU C
configure:971: checking whether gcc accepts -g
configure:1006: checking for gcc option to accept ANSI C
configure:1083: checking how to run the C preprocessor
configure:1165: checking for function prototypes
configure:1327: checking for gcc
configure:1440: checking whether the C compiler (gcc -g -O2 ) works
configure:1456: gcc -o conftest -g -O2 conftest.c 1>&5
configure:1453:1: warning: return type defaults to 'int' [-Wimplicit-int]
main(){return(0);}
^
/usr/lib/gcc/x86_64-pc-msys/5.3.0/../../../../x86_64-pc-msys/bin/ld: cannot open output file conftest.exe: Permission denied
collect2: error: ld returned 1 exit status
configure: failed program was:
#line 1451 "configure"
#include "confdefs.h"
main(){return(0);}
I've tested this answer without any success. Or to be more precise, it goes to the next step (which is failing at detecting my system, which is more a corkscrew's config issue I think) randomly...
This is not a rights problem as I have all the rights on that folder and I use my user to execute ./configure.
Any idea?
It looks like ld is having trouble creating an executable file due to permission problems. Try building the program in a folder that you are sure that you own (like C:\Users\yourusername) or try adjusting the permissions for the folder you are building in.

Tryiing to build bitcoind on mac using port

I am following the instructions for the MacOS X port version to build bitcoind, but make finally cannot find a makefile to continiue the build:
ginger:bitcoin sven.haiges$ ./autogen.sh
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force -I src/m4
autoreconf: configure.ac: tracing
autoreconf: configure.ac: not using Libtool
autoreconf: running: /opt/local/bin/autoconf --force
autoreconf: running: /opt/local/bin/autoheader --force
autoreconf: running: automake --add-missing --copy --force-missing
configure.ac:730: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
configure.ac:730: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
configure.ac:730: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
configure.ac:730: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
configure.ac:730: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
autoreconf: Leaving directory `.'
ginger:bitcoin sven.haiges$ ls
COPYING Makefile.in autogen.sh configure doc share
INSTALL README.md autom4te.cache configure.ac pkg.m4 src
Makefile.am aclocal.m4 config.log contrib qa
ginger:bitcoin sven.haiges$ ./configure
checking build system type... x86_64-apple-darwin12.5.0
checking host system type... x86_64-apple-darwin12.5.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... src/build-aux/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 whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... yes
checking whether make supports nested variables... (cached) yes
checking for g++... g++
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 g++ accepts -g... yes
checking for style of include used by make... GNU
checking dependency style of g++... gcc3
checking for gcc... gcc
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 whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking how to run the C++ preprocessor... g++ -E
checking for gcc... gcc
checking whether we are using the GNU Objective C compiler... yes
checking whether gcc accepts -g... yes
checking dependency style of gcc... gcc3
checking for g++... g++
checking whether we are using the GNU Objective C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking for a sed that does not truncate output... /usr/bin/sed
checking for ar... /usr/bin/ar
checking for ranlib... /usr/bin/ranlib
checking for strip... /usr/bin/strip
checking for gcov... /usr/bin/gcov
checking for lcov... no
checking for java... /usr/bin/java
checking for genhtml... no
checking for git... /usr/bin/git
checking for moc-qt4... no
checking for moc4... no
checking for moc... no
configure: WARNING: MOC not found; bitcoin-qt frontend will not be built
checking for ccache... no
checking for lupdate-qt4... no
checking for lupdate4... no
checking for lupdate... no
checking for xgettext... /opt/local/bin/xgettext
checking for hexdump... /usr/bin/hexdump
checking for pkg-config... no
checking for port... port
checking for brew... no
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -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 whether byte ordering is bigendian... no
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 for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking whether the linker accepts -Wl,--large-address-aware... no
checking whether C++ compiler accepts -Wstack-protector... yes
checking whether C++ compiler accepts -fPIE... yes
checking whether C++ preprocessor accepts -D_FORTIFY_SOURCE=2... yes
checking whether the linker accepts -Wl,--dynamicbase... no
checking whether the linker accepts -Wl,--nxcompat... no
checking whether the linker accepts -Wl,-z,relro... no
checking whether the linker accepts -Wl,-z,now... no
checking whether C++ compiler accepts -fno-stack-protector... yes
checking whether C++ compiler accepts -fstack-protector-all... yes
checking whether the linker accepts -pie... yes
checking whether the linker accepts -Wl,-dead_strip... yes
checking stdio.h usability... yes
checking stdio.h presence... yes
checking for stdio.h... yes
checking for stdlib.h... (cached) yes
checking for unistd.h... (cached) yes
checking for strings.h... (cached) yes
checking for sys/types.h... (cached) yes
checking for sys/stat.h... (cached) yes
checking for MSG_NOSIGNAL... no
checking for Berkeley DB C++ headers... /opt/local/include/db48/
checking for main in -ldb_cxx-4.8... yes
checking for main in -lminiupnpc... yes
checking for boostlib >= 1.20.0... yes
checking whether the Boost::System library is available... yes
checking for exit in -lboost_system-mt... yes
checking whether the Boost::Filesystem library is available... yes
checking for exit in -lboost_filesystem-mt... yes
checking whether the Boost::Program_Options library is available... yes
checking for exit in -lboost_program_options-mt... yes
checking whether the Boost::Thread library is available... yes
checking for exit in -lboost_thread-mt... yes
checking whether the Boost::Chrono library is available... yes
checking for exit in -lboost_chrono-mt... yes
checking whether the Boost::Unit_Test_Framework library is available... yes
configure: error: pkg-config not found.
ginger:bitcoin sven.haiges$ make
make: *** No targets specified and no makefile found. Stop.
ginger:bitcoin sven.haiges$ ls
COPYING Makefile.in autogen.sh configure doc share
INSTALL README.md autom4te.cache configure.ac pkg.m4 src
Makefile.am aclocal.m4 config.log contrib qa
ginger:bitcoin sven.haiges$ ci Makefile.in
Makefile.in,v > :q^[^X^X^C
RCS: Interrupt
RCS: Cleaning up.
ginger:bitcoin sven.haiges$
ginger:bitcoin sven.haiges$
ginger:bitcoin sven.haiges$ vi Makefile.in
ginger:bitcoin sven.haiges$ make Makefile.in
make: Nothing to be done for `Makefile.in'.
ginger:bitcoin sven.haiges$ make Makefile.am
make: Nothing to be done for `Makefile.am'.
ginger:bitcoin sven.haiges$
Any ideas?
You have to install pkg-config before running ./configure
sudo port install pkgconfig

Using Heroku Vulcan to build lib with dependency

Mission: Make a build of ffmpegthumbnailer that can be vendored with a Rails app and deployed to Heroku's Cedar stack.
Process so far:
[success] Build ffmpeg with Vulcan (using this guide) and upload to S3
[failed] Build ffmpegthumbnailer with ffmpeg as dependency.
Using command:
$ vulcan build -v -s ffmpegthumbnailer-2.0.8 -d http://s3.amazonaws.com/remoting-io-cdn/heroku-building-lib/ffmpeg
I get the following (see error at the bottom):
Packaging local directory... done
Uploading source package... done
Building with: ./configure --prefix /app/vendor/ffmpegthumbnailer-2.0 && make install
downloading http://s3.amazonaws.com/remoting-io-cdn/heroku-building-lib/ffmpeg
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking for g++... g++
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 g++ accepts -g... yes
checking for style of include used by make... GNU
checking dependency style of g++... gcc3
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking how to print strings... printf
checking for gcc... gcc
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... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver #FILE support... #
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for mt... mt
checking if mt is a manifest tool... no
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... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
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/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
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 how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking whether make supports nested variables... yes
checking for ANSI C header files... (cached) yes
checking for inttypes.h... (cached) yes
checking for sys/stat.h... (cached) yes
checking whether /usr/bin/ld -m elf_x86_64 accepts --as-needed... yes
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for FFMPEG... no
configure: error: Package requirements (libavutil libavformat libavcodec >= 52.26.0 libswscale) were not met:
No package 'libavutil' found
No package 'libavformat' found
No package 'libavcodec' found
No package 'libswscale' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables FFMPEG_CFLAGS
and FFMPEG_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
bin/vulcan-make:69:in `chdir': No such file or directory - /app/vendor/ffmpegthumbnailer-2.0 (Errno::ENOENT)
from bin/vulcan-make:69:in `block (2 levels) in <main>'
from bin/vulcan-make:18:in `chdir'
from bin/vulcan-make:18:in `block in <main>'
from /usr/local/lib/ruby/1.9.1/tmpdir.rb:83:in `mktmpdir'
from bin/vulcan-make:17:in `<main>'
>> Downloading build artifacts to: /tmp/ffmpegthumbnailer-2.0.tgz
(available at http://remoting-io-lib-builder.herokuapp.com/output/e25f3591-ce65-433d-a45a-15bd7ea36109)
What does that error message mean? And what should I do differently to compile it correctly?
You have a few problems
You need to build it's dependencies first (libavutil, libavformat, libavcodec, libswscale)
The thing that you downloaded is not actually the build (the build never happened it failed at configure) It is just the artifacts from the progress that was made.
I have had much more success with hammer (https://github.com/hone/hammer) then vulcan in terms of reusability.
To solve this you are going to need to go through this same process for each of the dependancies then in your build script pull them down from s3 extract them and make sure that they are in your path or lib directory.
I have also found that heroku run bash is invaluable when hacking on these things because it allows you to tinker with your environment more.
ffmpeg and ffmpegthumbnailer can be build with Vulcan following the steps explained here
A sample app with vendored ffmpeg and ffmpegthumbnailer is available here: https://github.com/JonasNielsen/ffmpegthumbnailer Check out the Heroku configuration instructions in the readme.

configure script not enabling make to generate shared library

This is in regards to compiling libjpeg v6b if that is relevant.
I run ./configure --prefix=/c/tmp/jpeg-6b-build --enable-shared --enable-static like the install doc says but libtool isn't having it.
checking dynamic linker characteristics... no
checking if libtool supports shared libraries... no
checking whether to build shared libraries... no
checking whether to build static libraries... yes
I think I need this shared library to be able to compile some functions. libjpeg itself compiles fine and the .exe's it generates work but I need to use the source for something else. v6b doesn't generate a .DLL for some reason while v9 does.
Full output for ./configure command:
ild
checking for gcc... gcc
checking whether the C compiler (gcc ) works... yes
checking whether the C compiler (gcc ) is a cross-compiler... no
checking whether we are using GNU C... yes
checking how to run the C preprocessor... gcc -E
checking for function prototypes... yes
checking for stddef.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for size_t... yes
checking for type unsigned char... yes
checking for type unsigned short... yes
checking for type void... yes
checking for working const... yes
checking for inline... __inline__
checking for broken incomplete types... ok
checking for short external names... ok
checking to see if char is signed... yes
checking to see if right shift is signed... yes
checking to see if fopen accepts b spec... yes
checking for a BSD compatible install... /bin/install -c
checking for ranlib... ranlib
checking host system type... i386-pc-mingw32
checking for ranlib... ranlib
checking for gcc... gcc
checking whether we are using GNU C... yes
checking for gcc option to produce PIC... -fPIC
checking if gcc PIC flag -fPIC works... no
checking if gcc static flag -static works... -static
checking whether ln -s works... no
checking for ld used by GCC... ./c:/mingw/bin/../lib/gcc/mingw32/4.7.2/../../../
../mingw32/bin/ld.exe
checking if the linker (./c:/mingw/bin/../lib/gcc/mingw32/4.7.2/../../../../ming
w32/bin/ld.exe) is GNU ld... yes
checking whether the linker (./c:/mingw/bin/../lib/gcc/mingw32/4.7.2/../../../..
/mingw32/bin/ld.exe) supports shared libraries... yes
checking for BSD-compatible nm... /mingw/bin/nm
checking command to parse /mingw/bin/nm output... no
checking how to hardcode library paths into programs... immediate
checking for ./c:/mingw/bin/../lib/gcc/mingw32/4.7.2/../../../../mingw32/bin/ld.
exe option to reload object files... -r
checking dynamic linker characteristics... no
checking if libtool supports shared libraries... no
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking for objdir... .libs
creating libtool
checking libjpeg version number... 62
creating ./config.status
creating Makefile
creating jconfig.h
jconfig.h is unchanged
Related question: Need help compiling jpegtran.c code from libjpeg
I encountered the same problem, and I believe it is because jpeg-6b is built with a very old version of autotools (the jpeg-6b version dates back 1998 if the sourceforge page is correct).
In particular, the problem is the way it checks if gcc supports the -fPIC flag:
checking for gcc option to produce PIC... -fPIC
checking if gcc PIC flag -fPIC works... no
And this is how they perform the check from config.log:
ltconfig:547: checking if gcc PIC flag -fPIC works
ltconfig:548: gcc -c -fPIC -DPIC -I/local/include conftest.c 1>&5
conftest.c:1:0: warning: -fPIC ignored for target (all code is position independent)
^
Notice how gcc returns a warning, it probably returns exit code 1 which makes the check fail. And position-independent code is necessary for shared libraries, so this makes it think it can't make them, and it later outputs:
checking whether to build shared libraries... no
Compare that with libjpeg9, which I assume uses a more up-to-date version of autotools:
checking for gcc -std=gnu99 option to produce PIC... -DDLL_EXPORT -DPIC
checking if gcc -std=gnu99 PIC flag -DDLL_EXPORT -DPIC works... yes
And from config.log:
configure:10108: checking for gcc -std=gnu99 option to produce PIC
configure:10115: result: -DDLL_EXPORT -DPIC
configure:10123: checking if gcc -std=gnu99 PIC flag -DDLL_EXPORT -DPIC works
configure:10141: gcc -std=gnu99 -c -g -O2 -I/local/include -DDLL_EXPORT -DPIC -DPIC conftest.c >&5
configure:10145: $? = 0
configure:10158: result: yes
I eventually compiled libjpeg9 instead, but I think libjpeg6 might also be compilable if you can recreate the ./configure script using a newer version of autotools.
You should probably try to run
./configure --help
and see all available configure flags, maybe you misspelled some or you need --enable-dynamic or something different.
For configure output you could also refer to config.log, that is in the project's (in your case -- libjpeg's) directory, just next to the configure file.

How to cross-build GZIP?

I am trying to build gzip for an embedded platform on a Linux machine. I downloaded the latest gzip distribution from here. Then, make requires first to run the configure program in order to tailor a Makefile for the specific target.
So I run configure and get some error messages. The problem seems to be a combination of a few things. Our compiler version is called e-gcc, so I used the following line, and got this error:
~/Projects/gzip-1.4$ ./configure CC=e-gcc
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for style of include used by make... GNU
checking for gcc... e-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... configure: error: in `/home/xyz/Projects/gzip-1.4':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.
Obviously, C compiled programs cannot run, b/c it is cross-compiler. The message say I have to use the --host option, but the problem is that we don't really have a defined name in gcc. However, I tried:
./configure CC=e-gcc --host=epiphany
and the error received is:
configure: WARNING: If you wanted to set the --build type, don't use --host.
If a cross compiler is detected then cross compile mode will be used.
checking for a BSD-compatible install... /usr/bin/install -c
blah blah blah
checking build system type... x86_64-unknown-linux-gnu
checking host system type... Invalid configuration `epiphany': machine `epiphany' not recognized
configure: error: /bin/bash build-aux/config.sub epiphany failed
Last thing, I tried cheating and setting the host to arm as it is closest in spirit to our architecture. The configuration went much further, but eventually failed as well with the following message:
checking for GNU libc compatible realloc... no
checking for rmdir... no
configure: error: in `/home/xyz/Projects/gzip-1.4':
configure: error: Your system lacks the rmdir function.
Please report this, along with the output of "uname -a", to the
bug-coreutils#gnu.org mailing list. To continue past this point,
rerun configure with SKIP_RMDIR_CHECK=yes.
E.g., ./configure SKIP_RMDIR_CHECK=yes
See `config.log' for more details.
I am now pretty clueless on how to continue. Any suggestions?
Does the embedded platform have an environment in which a command-line gzip program makes sense? If you want to do gzip compression and decompression from software that you're writing for the embedded platform, then you should consider zlib instead.
Did you try running with the
SKIP_RMDIR_CHECK=yes
directive?
OK, Thanks, very helpful, it gave me the clues I needed.
I have gone a little further in that I now have a more correct --host string :
--host=eIII-parallella-epiphany
so I call configure as :
./configure CC=/cygdrive/[MYPATH]/Parallella/INSTALL/bin/e-gcc --host=eIII-parallella-epiphany
However you need to do a few other things, including copying the config.sub script from the epiphany sources into your own configure space. I also had to do some other edits, so that MACHOS was defined.
see : http://forums.parallella.org/viewtopic.php?f=13&t=337&p=2014#p2014 for more details.
cheers, Beau Webber