mingw-cross-env-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Mingw-cross-env-list] Help compiling libmicrohttpd with MXE


From: Richard Ellis
Subject: [Mingw-cross-env-list] Help compiling libmicrohttpd with MXE
Date: Sun, 10 Nov 2013 15:33:28 -0500
User-agent: Mutt/1.4.2.2i

I am attempting to compile libmicrohttpd ("LMH") for windows using
MXE and I can't seem to get past a roadblock with LMH's initial
"./configure" run.

I am using the current stable MXE (last commit of
78996663aa75360d3923e56ba9fcbcc7a09f0032).

I assume that there is something very obvious that I'm missing, so
here is what I have setup.

My MXE build environment when I attempt to configure libmicrohttpd
has the following environment variables set:

AR=i686-pc-mingw32-ar
TERM=xterm
LIBDIR=/tmp/mxe/usr/i686-pc-mingw32/lib
PATH=/tmp/mxe/usr/bin/:~/bin:/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/lib64/java/bin:/usr/lib64/qt/bin:/usr/share/texmf/bin:.
LD=i686-pc-mingw32-ld
EDITOR=joe
LANG=en_US
HOME=/home/rellis
PKG_CONFIG_PATH_i686_pc_mingw32=/tmp/mxe/usr/i686-pc-mingw32/lib/pkgconfig
CFLAGS=-I /tmp/mxe/usr/i686-pc-mingw32/include/plibc -L 
/tmp/mxe/usr/i686-pc-mingw32/lib
PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig:/usr/lib64/pkgconfig:/usr/local/lib64/pkgconfig
PKG_CONFIG=i686-pc-mingw32-pkg-config
CROSS=i686-pc-mingw32
CC=i686-pc-mingw32-gcc
_=/usr/bin/env

I am running LMH's configure script in this way:

./configure --host=i686-pc-mingw32 --enable-static \
  --disable-shared --disable-curl --disable-spdy \
  --disable-https

The CFLAGS is set the way it is to get past the first roadblock I
encountered with LMH.  It stopped at the PlibC detection
phase with a config.log error of "count not find plibc.h".  The
reason is that LMH is looking for <plibc.h> and MXE installs plibc.h
into "mxe/usr/i686-pc-mingw32/include/plibc" instead of
"mxe/usr/i686-pc-mingw32/include".  So adding an include path to
include/plibc fixed that roadblock.

But the fix above led to a second roadblock.  Now LMH's config is
complaining that PlibC is not installed because it can't link the
compiled plibc.  The error in config.log is (some manual word
wrapping added below):

==== begin config.log ====
configure:12710: checking if PlibC is installed
configure:12729: i686-pc-mingw32-gcc -o conftest.exe
   -fno-strict-aliasing 
   -I /tmp/mxe/usr/i686-pc-mingw32/include/plibc 
   -L /tmp/mxe/usr/i686-pc-mingw32/lib  -lplibc  
   -Wl,-no-undefined -Wl,--export-all-symbols 
   -lws2_32 conftest.c  >&5
/tmp/cc7OuxdB.o:conftest.c:(.text+0x1e): undefined reference
   to `plibc_init'
collect2: error: ld returned 1 exit status
configure:12729: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "libmicrohttpd"
| #define PACKAGE_TARNAME "libmicrohttpd"
| #define PACKAGE_VERSION "0.9.31"
| #define PACKAGE_STRING "libmicrohttpd 0.9.31"
| #define PACKAGE_BUGREPORT "address@hidden"
| #define PACKAGE_URL ""
| #define PACKAGE "libmicrohttpd"
| #define VERSION "0.9.31"
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define LT_OBJDIR ".libs/"
| #define MINGW 1
| #define WINDOWS 1
| /* end confdefs.h.  */
| 
|                 #include <plibc.h>
| 
| int
| main ()
| {
| 
|                 plibc_init("", "");
| 
|   ;
|   return 0;
| }
configure:12739: error: PlibC is not available on your windows machine!
==== end config.log ====

As a result of this log entry, I added the -L option to CFLAGS above,
thinking that maybe the MXE linker was not finding the right lib dir
location.  But that did not help.

In fact, if I copy out the conftest.c program from the config.log and
try to compile it in two passes, I get the same error in the link
phase (manual word wrap added):

i686-pc-mingw32-gcc -fno-strict-aliasing 
   -I /tmp/mxe/usr/i686-pc-mingw32/include/plibc 
   -L /tmp/mxe/usr/i686-pc-mingw32/lib 
   -lplibc -Wl,-no-undefined -Wl,--export-all-symbols
   -lws2_32 -c ctest.c

i686-pc-mingw32-gcc -o ctest.exe -fno-strict-aliasing
   -I /tmp/mxe/usr/i686-pc-mingw32/include/plibc
   -L /tmp/mxe/usr/i686-pc-mingw32/lib -lplibc -Wl,-no-undefined
   -Wl,--export-all-symbols -lws2_32
   /tmp/mxe/usr/i686-pc-mingw32/lib/libplibc.a ctest.o 
ctest.o:ctest.c:(.text+0x1e): undefined reference to `plibc_init'
collect2: error: ld returned 1 exit status

Running strace on the manual link stage above shows the MXE linker
opening libplibc.a and appearing to read the contents, but for
reasons that stump me, it still does not find plibc_init.

Running objdump on the libplibc.a file shows a _plibc_init symbol
defined in the archive:

/tmp/mxe/usr/bin/i686-pc-mingw32-objdump -t \
   /tmp/mxe/usr/i686-pc-mingw32/lib/libplibc.a 

In archive /tmp/mxe/usr/i686-pc-mingw32/lib/libplibc.a:

access.o:     file format pe-i386

SYMBOL TABLE:
...
[ 15](sec  1)(fl 0x00)(ty  20)(scl   2) (nx 0) 0x000004c2 _plibc_init
...

So I'm stumped as to what is going wrong.  Any help would be
appreciated.

Thank you in advance,
Rich




reply via email to

[Prev in Thread] Current Thread [Next in Thread]