Author: wyoung
Date: Fri Jun 21 03:49:32 2013
New Revision: 2743
URL: http://svn.gna.org/viewcvs/mysqlpp?rev=2743&view=rev
Log:
Reworked the MinGW section of the userman, replacing all the Cygwin +
MinGW stuff with a simple SHELL override in the Makefile. Also replaced
the dev file locations with current Connector/C locations.
Modified:
trunk/doc/userman/Makefile.hello.mingw
trunk/doc/userman/incorporating.dbx
Modified: trunk/doc/userman/Makefile.hello.mingw
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/doc/userman/Makefile.hello.mingw?rev=2743&r1=2742&r2=2743&view=diff
==============================================================================
--- trunk/doc/userman/Makefile.hello.mingw (original)
+++ trunk/doc/userman/Makefile.hello.mingw Fri Jun 21 03:49:32 2013
@@ -1,3 +1,4 @@
+SHELL := $(COMSPEC)
MYSQL_DIR := "c:/Program Files/MySQL/MySQL Connector C 6.1"
CXXFLAGS := -I$(MYSQL_DIR)/include -Ic:/MySQL++/include
LDFLAGS := -L$(MYSQL_DIR)/lib/opt -Lc:/MySQL++/lib/MinGW
Modified: trunk/doc/userman/incorporating.dbx
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/doc/userman/incorporating.dbx?rev=2743&r1=2742&r2=2743&view=diff
==============================================================================
--- trunk/doc/userman/incorporating.dbx (original)
+++ trunk/doc/userman/incorporating.dbx Fri Jun 21 03:49:32 2013
@@ -182,8 +182,8 @@
<para>There are lots of ways to build programs on Unixy
platforms. We’ll cover just the most generic way
here, <filename>Makefile</filename>s. We’ll use a very
- simple example so it’s clear how to translate this to
- more sophisticated build systems such as GNU Autotools or
+ simple example so it’s clear how to translate this
+ to more sophisticated build systems such as GNU Autotools or
Bakefile.</para>
<para>“Hello, world!” for MySQL++ might look something
@@ -248,9 +248,10 @@
<sect3 id="inc-osx-makefile">
<title>Makefiles</title>
- <para>The <link linkend="inc-unix">generic Makefile
- instructions above</link> cover most of what you need to know
- about using Makefiles on OS X.</para>
+ <para>The <link linkend="inc-unix">generic
+ <filename>Makefile</filename> instructions above</link>
+ cover most of what you need to know about using Makefiles on
+ OS X.</para>
<para>One thing that may trip you up on OS X is that it uses an
uncommon dynamic linkage system. The easiest way to cope with
@@ -280,8 +281,9 @@
<sect3 id="inc-mingw-makefile">
<title>Makefiles</title>
- <para>The <link linkend="inc-unix">generic Makefile instructions
- above</link> apply to MinGW’s version of GNU make as
+ <para>The <link linkend="inc-unix">generic
+ <filename>Makefile</filename> instructions above</link> apply
+ to MinGW’s version of GNU <filename>make</filename> as
well. You will have some differences due to the platform, so
here’s the adjusted <filename>Makefile</filename>:</para>
@@ -289,76 +291,27 @@
href="Makefile.hello.mingw" parse="text"
xmlns:xi="http://www.w3.org/2001/XInclude"/></programlisting>
- <para>Note the use of forward slashes. GNU make uses the
- backslash as an escape character, so you’d have to double
- them if you’re unwilling to use forward slashes.</para>
-
- <para>Also note that I’ve used <command>del</command>
- instead of <command>rm</command> in the clean target. Unless
- there is a program called <filename>sh.exe</filename> in
- your <varname>PATH</varname>, MinGW make uses Windows’
- <filename>cmd.exe</filename> for shell commands. The most likely
- reason to have <filename>sh.exe</filename> is if you also have
- Cygwin or MSYS installed. The next section covers the best way
- I’ve found to cope with that.</para>
-
- <sect4 id="inc-mingw-cygwin">
- <title>Working with MinGW Under Cygwin</title>
-
- <para>Compared to Unix, the biggest difference you’ll
- find is that MinGW calls its <filename>make</filename>
- executable <filename>mingw32-make</filename>. As I understand
- it, this is to allow it to coexist with Cygwin, since the two
- versions have some behavioral differences, despite both being
- based on GNU Make. A <filename>Makefile</filename> written
- for one is likely to fail to work correctly with the other,
- so you have to be able to specify which one you mean.</para>
-
- <para>If you have both MinGW and Cygwin installed, you may be
- tempted to use Cygwin’s superior command line environment
- over a Windows command shell or MSYS. If you’re like me,
- you type <filename>make</filename> reflexively now; typing
- <filename>mingw32-make</filename> instead isn’t going
- to work. Another problem with having Cygwin and MinGW on the
- same system is that this puts a <filename>sh.exe</filename>
- program in your system’s <varname>PATH</varname>
- which makes MinGW make send shell commands to it instead of
- <filename>cmd.exe</filename> as it normally would. I find it
- best to set up a special MinGW environment to avoid problems
- stemming from these platform differences.</para>
-
- <para>I’ve created a pair of scripts that let me work
- in Cygwin mode most of the time and temporarily drop down
- into “MinGW mode” only when necessary. I call the
- first script <filename>mingw</filename>, and put it somewhere
- in the Cygwin <varname>PATH</varname>:</para>
-
- <programlisting>
- #!/bin/sh
-
PATH=/cygdrive/c/mingw/bin:/cygdrive/c/windows:/cygdrive/c/windows/system32:/cygdrive/c/cygwin/bin
- echo "Say 'exit' to leave MinGW shell and restore Cygwin environment."
- /usr/bin/bash --rcfile ~/.mingwrc</programlisting>
-
- <para>Then there’s a tiny little file called
- <filename>.mingwrc</filename> that goes in your Cygwin home
- directory:</para>
-
- <programlisting>
- alias make=mingw32-make
- PS1='MinGW: \W \$ '</programlisting>
-
- <para>(This split is necessary due to the way Bash works.)</para>
-
- <para>The first script sets up most of the MinGW environment,
- putting the MinGW and Windows directories ahead of the Cygwin
- directory so programs in those locations take precedence. Then
- the second script finishes setting up the MinGW sub-shell,
- causing the <filename>make</filename> command to invoke
- MinGW’s make program instead of Cygwin’s, and
- changing the command prompt to remind you that you’re
- in a sub-shell. Just say <command>exit</command> to get back
- to Cygwin mode.</para>
- </sect4>
+ <para>Note that I’ve used <command>del</command>
+ instead of <command>rm</command> in the clean target. In
+ the past, at least, MinGW <filename>make</filename>
+ had some funny rules about whether commands in target
+ rules would get run with <filename>sh.exe</filename>
+ or with <filename>cmd.exe</filename>. I can’t
+ currently get my installation of MinGW to do anything
+ but use <filename>sh.exe</filename> by default, but that
+ may be because I have Cygwin installed, which provides
+ <filename>sh.exe</filename>. This explains the first
+ line in the file, which overrides the default shell with
+ <filename>cmd.exe</filename>, purely to get consistent
+ behavior across platforms. If you knew all your platforms
+ would have a better shell, you’d probably want to use
+ that instead.</para>
+
+ <para>Note the use of forward slashes in the path to the MySQL
+ Connector/C development files. GNU <filename>make</filename>
+ uses the backslash as an escape character, so you’d
+ have to double them if you’re unwilling to use forward
+ slashes.</para>
</sect3>
<sect3 id="inc-mingw-ide">
@@ -367,7 +320,8 @@
<para>I have no information on how to do this. We’ve
received reports on the mailing list from people that have made
it work, but no specifics on what all needs to be done. The
- Makefile discussion above should give you some hints.</para>
+ <filename>Makefile</filename> discussion above should give you
+ some hints.</para>
</sect3>
</sect2>
@@ -375,13 +329,13 @@
<sect2 id="inc-eclipse">
<title>Eclipse</title>
- <para>As far as I can tell, the simplest way to build a C++
- project with Eclipse is to set up a Makefile for it as described
- <link linkend="inc-unix">above</link>, then add an external
- run configuration for your local make tool. Get the project
- building from the command line with make, then go to Run |
- External Tools | Open External Tools Dialog and add a new launch
- configuration.</para>
+ <para>As far as I can tell, the simplest way to build a C++ project
+ with Eclipse is to set up a <filename>Makefile</filename> for it
+ as described <link linkend="inc-unix">above</link>, then add an
+ external run configuration for your local <filename>make</filename>
+ tool. Get the project building from the command line with
+ <filename>make</filename>, then go to Run | External Tools | Open
+ External Tools Dialog and add a new launch configuration.</para>
<para>For example, on my OS X system I use
<filename>/usr/bin/gnumake</filename> for the program location
_______________________________________________
Mysqlpp-commits mailing list
[email protected]
https://mail.gna.org/listinfo/mysqlpp-commits