Re: [pcre-dev] how to get pcre-7.0 dll on windows

Startseite
Nachricht löschen
Autor: Sheri
Datum:  
To: pcre-dev, pcre-dev
Betreff: Re: [pcre-dev] how to get pcre-7.0 dll on windows
Bob Rossi wrote:
> Hi,
>
> I'm attempting to understand how the old dll's were created and how the
> new ones are. That way, I can see the difference and explain the
> situation clearly to a 3rd party.
>
> However, if I download pcre-7.0 and do
> $ ../pcre-7.0/configure --prefix=$PWD/../prefix --disable-static
> --enable-shared
> it only generates static libraries. Libtool complains that it has to.
> The output of the make is attached.
>
> How did anyone ever build a shared library on windows in the first
> place?
>
> Thanks,
> Bob Rossi
>

Hi Bob,

Here is my configure and make console (Msys) for 7.0. My configure
command has some differences from yours, esp. it does not have
--enable-shared on it. Let me know if you want me to try it specifically
with your configure options.

FWIW, as I recall when I previously ran those few commands that created
pcre.dll for 7.1-RC4 after using the new configure and make, it didn't
work unless I had configured without excluding static. But with 7.0's
make, it created everything it needed for making pcre.dll and
pcreposix.dll despite having --disable-static on the configure command.
I'm sure it has much to do with 7.0's Makefile.in.

Regards,
Sheri

Sheri@XXX-XXXXXXXXXXX /c/pcre-70-COFF/bob
$ CFLAGS='-O3 -s' ../pcre-7.0/configure --prefix=$PWD/../prefix
--enable-utf8
--enable-newline-is-any --enable-unicode-properties
--disable-stack-for-recursi
on --disable-static --disable-cpp
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 ISO C89... none needed
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for a BSD-compatible install... /bin/install -c
checking build system type... i686-pc-mingw32
checking host system type... i686-pc-mingw32
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 ld used by gcc... c:/mingw/mingw32/bin/ld.exe
checking if the linker (c:/mingw/mingw32/bin/ld.exe) is GNU ld... yes
checking for c:/mingw/mingw32/bin/ld.exe option to reload object files... -r
checking for BSD-compatible nm... /mingw/bin/nm
checking whether ln -s works... no, using cp -p
checking how to recognise dependent libraries... file_magic file format
pei*-i386(.*architecture: i386)?
checking for dlltool... dlltool
checking for as... as
checking for objdump... objdump
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 dlfcn.h usability... no
checking dlfcn.h presence... no
checking for dlfcn.h... no
checking how to run the C++ preprocessor... g++ -E
checking for g77... no
checking for f77... no
checking for xlf... no
checking for frt... no
checking for pgf77... no
checking for cf77... no
checking for fort77... no
checking for fl32... no
checking for af77... no
checking for f90... no
checking for xlf90... no
checking for pgf90... no
checking for pghpf... no
checking for epcf90... no
checking for gfortran... no
checking for g95... no
checking for f95... no
checking for fort... no
checking for xlf95... no
checking for ifort... no
checking for ifc... no
checking for efc... no
checking for pgf95... no
checking for lf95... no
checking for ftn... no
checking whether we are using the GNU Fortran 77 compiler... no
checking whether accepts -g... no
checking the maximum length of command line arguments... 8192
checking command to parse /mingw/bin/nm output from gcc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking for correct ltmain.sh version... yes
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -DDLL_EXPORT
checking if gcc PIC flag -DDLL_EXPORT works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking whether the gcc linker (c:/mingw/mingw32/bin/ld.exe) supports
shared libraries... yes
checking whether -lc should be explicitly linked in... yes
checking dynamic linker characteristics... Win32 ld.exe
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... no
configure: creating libtool
appending configuration tag "CXX" to libtool
checking for ld used by g++... c:/mingw/mingw32/bin/ld.exe
checking if the linker (c:/mingw/mingw32/bin/ld.exe) is GNU ld... yes
checking whether the g++ linker (c:/mingw/mingw32/bin/ld.exe) supports
shared libraries... yes
checking for g++ option to produce PIC... -DDLL_EXPORT
checking if g++ PIC flag -DDLL_EXPORT works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking whether the g++ linker (c:/mingw/mingw32/bin/ld.exe) supports
shared libraries... yes
checking dynamic linker characteristics... Win32 ld.exe
checking how to hardcode library paths into programs... immediate
appending configuration tag "F77" to libtool
checking for ANSI C header files... (cached) yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking for an ANSI C-conforming const... yes
checking for size_t... yes
checking for long long... yes
checking for unsigned long long... yes
checking for bcopy... no
checking for memmove... yes
checking for strerror... yes
checking for strtoq... no
checking for strtoll... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: WARNING: ../pcre-7.0/Makefile.in seems to ignore the
--datarootdir setting
config.status: creating pcre-config
config.status: creating libpcre.pc
config.status: creating libpcrecpp.pc
config.status: creating pcrecpparg.h
config.status: creating pcre_stringpiece.h
config.status: creating RunGrepTest
config.status: creating RunTest
config.status: creating config.h
config.status: executing default commands

Sheri@XXX-XXXXXXXXXXX /c/pcre-70-COFF/bob
$ make
gcc -c -O3 -s -I. ../pcre-7.0/dftables.c
/bin/sh ./libtool --mode=link gcc -O3 -s  -I. -I../pcre-7.0 -o
dftables.exe dftables.o
mkdir .libs
gcc -O3 -s -I. -I../pcre-7.0 -o dftables.exe dftables.o
./dftables.exe pcre_chartables.c
gcc -c -O3 -s -I. -I../pcre-7.0 -DNEWLINE=-1 -DNO_RECURSE
pcre_chartables.c  -DDLL_EXPORT -DPIC -o .libs/pcre_chartables.o
gcc -c -O3 -s -I. -I../pcre-7.0 -DNEWLINE=-1 -DNO_RECURSE
-DSUPPORT_UTF8 -DSUPPORT_UCP -DPOSIX_MALLOC_THRESHOLD=10
../pcre-7.0/pcre_compile.c  -DDLL_EXPORT -DPIC -o .libs/pcre_compile.o
gcc -c -O3 -s -I. -I../pcre-7.0 -DNEWLINE=-1 -DNO_RECURSE
-DSUPPORT_UTF8 -DSUPPORT_UCP -DPOSIX_MALLOC_THRESHOLD=10
../pcre-7.0/pcre_config.c  -DDLL_EXPORT -DPIC -o .libs/pcre_config.o
gcc -c -O3 -s -I. -I../pcre-7.0 -DNEWLINE=-1 -DNO_RECURSE
-DSUPPORT_UTF8 -DSUPPORT_UCP -DPOSIX_MALLOC_THRESHOLD=10
../pcre-7.0/pcre_dfa_exec.c  -DDLL_EXPORT -DPIC -o .libs/pcre_dfa_exec.o
gcc -c -O3 -s -I. -I../pcre-7.0 -DNEWLINE=-1 -DNO_RECURSE
-DSUPPORT_UTF8 -DSUPPORT_UCP -DPOSIX_MALLOC_THRESHOLD=10
../pcre-7.0/pcre_exec.c  -DDLL_EXPORT -DPIC -o .libs/pcre_exec.o
gcc -c -O3 -s -I. -I../pcre-7.0 -DNEWLINE=-1 -DNO_RECURSE
-DSUPPORT_UTF8 -DSUPPORT_UCP -DPOSIX_MALLOC_THRESHOLD=10
../pcre-7.0/pcre_fullinfo.c  -DDLL_EXPORT -DPIC -o .libs/pcre_fullinfo.o
gcc -c -O3 -s -I. -I../pcre-7.0 -DNEWLINE=-1 -DNO_RECURSE
-DSUPPORT_UTF8 -DSUPPORT_UCP -DPOSIX_MALLOC_THRESHOLD=10
../pcre-7.0/pcre_get.c  -DDLL_EXPORT -DPIC -o .libs/pcre_get.o
gcc -c -O3 -s -I. -I../pcre-7.0 -DNEWLINE=-1 -DNO_RECURSE
-DSUPPORT_UTF8 -DSUPPORT_UCP -DPOSIX_MALLOC_THRESHOLD=10
../pcre-7.0/pcre_globals.c  -DDLL_EXPORT -DPIC -o .libs/pcre_globals.o
gcc -c -O3 -s -I. -I../pcre-7.0 -DNEWLINE=-1 -DNO_RECURSE
-DSUPPORT_UTF8 -DSUPPORT_UCP -DPOSIX_MALLOC_THRESHOLD=10
../pcre-7.0/pcre_info.c  -DDLL_EXPORT -DPIC -o .libs/pcre_info.o
gcc -c -O3 -s -I. -I../pcre-7.0 -DNEWLINE=-1 -DNO_RECURSE
-DSUPPORT_UTF8 -DSUPPORT_UCP -DPOSIX_MALLOC_THRESHOLD=10
../pcre-7.0/pcre_maketables.c  -DDLL_EXPORT -DPIC -o .libs/pcre_maketables.o
gcc -c -O3 -s -I. -I../pcre-7.0 -DNEWLINE=-1 -DNO_RECURSE
-DSUPPORT_UTF8 -DSUPPORT_UCP -DPOSIX_MALLOC_THRESHOLD=10
../pcre-7.0/pcre_newline.c  -DDLL_EXPORT -DPIC -o .libs/pcre_newline.o
gcc -c -O3 -s -I. -I../pcre-7.0 -DNEWLINE=-1 -DNO_RECURSE
-DSUPPORT_UTF8 -DSUPPORT_UCP -DPOSIX_MALLOC_THRESHOLD=10
../pcre-7.0/pcre_ord2utf8.c  -DDLL_EXPORT -DPIC -o .libs/pcre_ord2utf8.o
gcc -c -O3 -s -I. -I../pcre-7.0 -DNEWLINE=-1 -DNO_RECURSE
-DSUPPORT_UTF8 -DSUPPORT_UCP -DPOSIX_MALLOC_THRESHOLD=10
../pcre-7.0/pcre_refcount.c  -DDLL_EXPORT -DPIC -o .libs/pcre_refcount.o
gcc -c -O3 -s -I. -I../pcre-7.0 -DNEWLINE=-1 -DNO_RECURSE
-DSUPPORT_UTF8 -DSUPPORT_UCP -DPOSIX_MALLOC_THRESHOLD=10
../pcre-7.0/pcre_study.c  -DDLL_EXPORT -DPIC -o .libs/pcre_study.o
gcc -c -O3 -s -I. -I../pcre-7.0 -DNEWLINE=-1 -DNO_RECURSE
-DSUPPORT_UTF8 -DSUPPORT_UCP -DPOSIX_MALLOC_THRESHOLD=10
../pcre-7.0/pcre_tables.c  -DDLL_EXPORT -DPIC -o .libs/pcre_tables.o
gcc -c -O3 -s -I. -I../pcre-7.0 -DNEWLINE=-1 -DNO_RECURSE
-DSUPPORT_UTF8 -DSUPPORT_UCP -DPOSIX_MALLOC_THRESHOLD=10
../pcre-7.0/pcre_try_flipped.c  -DDLL_EXPORT -DPIC -o
.libs/pcre_try_flipped.o
gcc -c -O3 -s -I. -I../pcre-7.0 -DNEWLINE=-1 -DNO_RECURSE
-DSUPPORT_UTF8 -DSUPPORT_UCP -DPOSIX_MALLOC_THRESHOLD=10
../pcre-7.0/pcre_ucp_searchfuncs.c  -DDLL_EXPORT -DPIC -o
.libs/pcre_ucp_searchfuncs.o
gcc -c -O3 -s -I. -I../pcre-7.0 -DNEWLINE=-1 -DNO_RECURSE
-DSUPPORT_UTF8 -DSUPPORT_UCP -DPOSIX_MALLOC_THRESHOLD=10
../pcre-7.0/pcre_valid_utf8.c  -DDLL_EXPORT -DPIC -o .libs/pcre_valid_utf8.o
gcc -c -O3 -s -I. -I../pcre-7.0 -DNEWLINE=-1 -DNO_RECURSE
-DSUPPORT_UTF8 -DSUPPORT_UCP -DPOSIX_MALLOC_THRESHOLD=10
../pcre-7.0/pcre_version.c  -DDLL_EXPORT -DPIC -o .libs/pcre_version.o
gcc -c -O3 -s -I. -I../pcre-7.0 -DNEWLINE=-1 -DNO_RECURSE
-DSUPPORT_UTF8 -DSUPPORT_UCP -DPOSIX_MALLOC_THRESHOLD=10
../pcre-7.0/pcre_xclass.c  -DDLL_EXPORT -DPIC -o .libs/pcre_xclass.o
gcc -c -O3 -s -I. -I../pcre-7.0 -DNEWLINE=-1 -DNO_RECURSE
-DPOSIX_MALLOC_THRESHOLD=10 ../pcre-7.0/pcreposix.c  -DDLL_EXPORT -DPIC
-o .libs/pcreposix.o
rm -f libpcre.la
/bin/sh ./libtool --mode=link gcc -export-symbols-regex '^[^_]'  -I.
-I../pcre-7.0 -rpath /c/pcre-70-COFF/bob/../prefix/lib -version-info \
        '0:1:0' -o libpcre.la pcre_chartables.lo pcre_compile.lo
pcre_config.lo pcre_dfa_exec.lo pcre_exec.lo pcre_fullinfo.lo
pcre_get.lo pcre_globals.lo pcre_info.lo pcre_maketables.lo
pcre_newline.lo pcre_ord2utf8.lo pcre_refcount.lo pcre_study.lo
pcre_tables.lo pcre_try_flipped.lo pcre_ucp_searchfuncs.lo
pcre_valid_utf8.lo pcre_version.lo pcre_xclass.lo pcreposix.lo
libtool: link: warning: undefined symbols not allowed in i686-pc-mingw32
shared libraries
ar cru .libs/libpcre.a  .libs/pcre_chartables.o .libs/pcre_compile.o
.libs/pcre_config.o .libs/pcre_dfa_exec.o .libs/pcre_exec.o
.libs/pcre_fullinfo.o .libs/pcre_get.o .libs/pcre_globals.o
.libs/pcre_info.o .libs/pcre_maketables.o .libs/pcre_newline.o
.libs/pcre_ord2utf8.o .libs/pcre_refcount.o .libs/pcre_study.o
.libs/pcre_tables.o .libs/pcre_try_flipped.o
.libs/pcre_ucp_searchfuncs.o .libs/pcre_valid_utf8.o
.libs/pcre_version.o .libs/pcre_xclass.o .libs/pcreposix.o
ranlib .libs/libpcre.a
creating libpcre.la
(cd .libs && rm -f libpcre.la && cp -p ../libpcre.la libpcre.la)
gcc -c -O3 -s -I. -I../pcre-7.0 -DSUPPORT_UTF8 -DSUPPORT_UCP \
         ../pcre-7.0/pcretest.c
gcc -O3 -s -shared -o .libs/pcre.dll pcre.coff \
-Wl,--whole-archive .libs/libpcre.a \
-Wl,--out-implib,.libs/libpcre.dll.a \
-Wl,--output-def,.libs/pcre.dll-def \
-Wl,--export-all-symbols \
-Wl,--no-whole-archive
Creating library file: .libs/libpcre.dll.a
sed -e "s#dlname=''#dlname='../bin/pcre.dll'#" \
-e "s#library_names=''#library_names='libpcre.dll.a'#" \
< .libs/libpcre.lai > .libs/libpcre.lai.tmp && \
mv -f .libs/libpcre.lai.tmp .libs/libpcre.lai
sed -e "s#dlname=''#dlname='../bin/pcre.dll'#" \
-e "s#library_names=''#library_names='libpcre.dll.a'#" \
< libpcre.la > libpcre.la.tmp && \
mv -f libpcre.la.tmp libpcre.la
rm -f libpcreposix.la
/bin/sh ./libtool --mode=link gcc -export-symbols-regex '^[^_]'  -I.
-I../pcre-7.0 -rpath /c/pcre-70-COFF/bob/../prefix/lib libpcre.la
-version-info \
        '0:0:0' -o libpcreposix.la pcreposix.lo
libtool: link: warning: undefined symbols not allowed in i686-pc-mingw32
shared libraries
ar cru .libs/libpcreposix.a  .libs/pcreposix.o
ranlib .libs/libpcreposix.a
creating libpcreposix.la
(cd .libs && rm -f libpcreposix.la && cp -p ../libpcreposix.la
libpcreposix.la)
gcc -O3 -s -shared -o .libs/pcreposix.dll \
-Wl,--whole-archive .libs/libpcreposix.a \
-Wl,--out-implib,.libs/pcreposix.dll.a \
-Wl,--output-def,.libs/libpcreposix.dll-def \
-Wl,--export-all-symbols \
-Wl,--no-whole-archive .libs/libpcre.a
Creating library file: .libs/pcreposix.dll.a
sed -e "s#dlname=''#dlname='../bin/pcreposix.dll'#" \
-e "s#library_names=''#library_names='libpcreposix.dll.a'#"\
< .libs/libpcreposix.lai > .libs/libpcreposix.lai.tmp && \
mv -f .libs/libpcreposix.lai.tmp .libs/libpcreposix.lai
sed -e "s#dlname=''#dlname='../bin/pcreposix.dll'#" \
-e "s#library_names=''#library_names='libpcreposix.dll.a'#"\
< libpcreposix.la > libpcreposix.la.tmp && \
mv -f libpcreposix.la.tmp libpcreposix.la
g++ -c -g -O2 -I. -I../pcre-7.0 -DNEWLINE=-1 -DNO_RECURSE
-DSUPPORT_UTF8 -DSUPPORT_UCP -DPOSIX_MALLOC_THRESHOLD=10
../pcre-7.0/pcrecpp.cc  -DDLL_EXPORT -DPIC -o .libs/pcrecpp.o
In file included from ../pcre-7.0/pcrecpp.cc:45:
./pcre_stringpiece.h:45:5: #if with no expression
./pcre_stringpiece.h:48:7: #if with no expression
make: *** [pcrecpp.o] Error 1


Sheri@XXX-XXXXXXXXXXX /c/pcre-70-COFF/bob
$ ls .libs/*.dll
.libs/pcre.dll .libs/pcreposix.dll

Sheri@XXX-XXXXXXXXXXX /c/pcre-70-COFF/bob
$ ls .libs
libpcre.a             pcre_compile.o     pcre_refcount.o
libpcre.dll.a         pcre_config.o      pcre_study.o
libpcre.la            pcre_dfa_exec.o    pcre_tables.o
libpcre.lai           pcre_exec.o        pcre_try_flipped.o
libpcreposix.a        pcre_fullinfo.o    pcre_ucp_searchfuncs.o
libpcreposix.dll-def  pcre_get.o         pcre_valid_utf8.o
libpcreposix.la       pcre_globals.o     pcre_version.o
libpcreposix.lai      pcre_info.o        pcre_xclass.o
pcre.dll              pcre_maketables.o  pcreposix.dll
pcre.dll-def          pcre_newline.o     pcreposix.dll.a
pcre_chartables.o     pcre_ord2utf8.o    pcreposix.o


Sheri@SLP-4EE84F358FA /c/pcre-70-COFF/bob
$