Re: [pcre-dev] More Windows-related/misc. tweaks

Pàgina inicial
Delete this message
Autor: Sheri
Data:  
A: Daniel Richard G., pcre-dev
Assumpte: Re: [pcre-dev] More Windows-related/misc. tweaks
Hi Daniel,

Had some trouble.

Problem summary:
The cmake process needs to include ANYCRLF as a default newline option.
The library names are not defaulting to pcre.dll and pcreposix.dll
(prefixing with "lib" instead)
make check doesn't work in Msys (ditto in libtool build)
RunTest.bat has test 3 commented out (and lacks the nicety that
supposedly works with 'make check' to use locale french instead of fr_FR)

Daniel Richard G. wrote:
>
> Not a problem! Here's a step-by-step:
>
> 1. Assume that the PCRE source tree is in C:\devel\pcre\, C:\tmp\ is 
>    available, and CMake is downloaded (http://www.cmake.org/), installed, 
>    and in the PATH.

>

My source is at C:\pcre-7.3\pcre-7.3-RC8\
Desired build dir at C:\pcre-7.3\cmakeRC8\
> 2. Create a new, empty build directory: C:\tmp\pcre-build\
>

cmake created it because it did not exist
> 3. Run CMakeSetup
>

Could not find initially find anything by this name. After installing
cmake 2.4, I ran cmake from the windows start menu.

Initially I tried installing cmake using all its default file locations
etc., which caused Cmake to be installed at C:\Program Files\Cmake 2.4\
(I think). I had problems which I thought might be related to spaces in
the file path, so I uninstalled and reinstalled to C:\cmake\ When
installing the second time I allowed the installer to alter my path,
first time around I had added cmake's bin dir to my path manually.
Before reprocessing with the new installation, I cleared out the build
directory.
> 4. Enter C:\devel\pcre and C:\tmp\pcre-build for the source and build 
>    directories, respectively

>

Browsed my locations.
> 5. Hit the "Configure" button.
>
> 6. Select the particular IDE / build tool that you wish to use (Visual 
>    Studio, MSYS makefiles, MinGW makefiles, etc.)

>

I selected Msys Makefiles

I got this error:
=============
Error

CMake Error: The C compiler "C:/MinGW/bin/gcc.exe" is not able to
compile a simple test program.
It fails with the following output:
make -f CMakeFiles/cmTryCompileExec.dir/build.make
CMakeFiles/cmTryCompileExec.dir/build
/C/cmake/bin/cmake.exe -E cmake_progress_report
/C/pcre-7.3/cmakerc8/CMakeFiles/CMakeTmp/CMakeFiles 1
/C/cmake/bin/cmake.exe: not found
*** Error code 1

Stop.
*** Error code 1

Stop.


CMake will not be able to correctly generate this project.

(Press Cancel to suppress any further messages.)

=============
cmake.exe certainly *does* exist at C:\cmake\bin.

Maybe I need to start CMakeSetup (which I now see in the CMake\bin dir)
from inside the Msys shell?

Bingo, gets further if I start CMakeSetup from inside the Msys shell.
CMakeSetup is in the bin dir, but is not in the Windows Start Programs
shortcuts. Now using it from inside Msys.

> 7. The GUI will then list several configuration options. This is where you 
>    can enable UTF-8 support, etc.

>
> 8. Hit "Configure" again. The adjacent "OK" button should now be active.
>

New error:
===========

CMake Error: The PCRE_NEWLINE variable must be set to one of the
following values: "LF", "CR", "CRLF", "ANY".

(Press Cancel to suppress any further messages.)
===========

(the cmake build process is not currently allowing ANYCRLF)

Ok, I'll try with ANY. BTW, I didn't elect to build pcrecpp, turned on
norecurse, and enabled utf8 and unicode property support.

Now it configures.
> 9. Hit "OK".
>
> 10. The build directory should now contain a usable build system, be it a 
>     solution file for Visual Studio, makefiles for MinGW, etc.

>

It did create a MakeFile.

Back in Msys, I ran (from my build dir):

$ make

I did not get not pcre.dll and pcreposix.dll; I got libpcre.dll and
libpcreposix.dll.

'make check' reports: "no rule to make target 'check'." (make check
doesn't work on Msys with the libtool process either, but not for this
reason).

'make install' installs to the dir I identified for prefix.

I copied in the testdata and RunTest.bat file. Always have to edit
RunTest.bat file remove the Rem in front of test 3. Upon running
RunTest.bat and visually comparing results, the only differences are 17
differences for inability to change to fr_FR locale. So the libraries
are working at least as well as the ones from the libtool process.
However, I can't test them with our app because of incompatible file
names. There was never a problem with pcretest and callouts, only with
our app.
>
> Let me know if you run into any snags. CMake also has an ncurses tool
> (ccmake) and one for the command-line (cmake), but CMakeSetup is a
> friendly, mostly-polished tool that is good for first-time/infrequent use.
> Its availability, IMO, is a credit to the CMake project.
>
>
> --Daniel
>
>
>

When I ran from the Windows start menu shortcut, it ran cmake.exe, and
it displayed the same GUI as CMakeSetup. It just didn't work I guess
because I was not processing from inside the Msys shell. Probably if
cmake.exe gets no arguments it launches CMakeSetup.

Regards,
Sheri