Author: wyoung
Date: Fri Dec  7 06:06:09 2007
New Revision: 1979

URL: http://svn.gna.org/viewcvs/mysqlpp?rev=1979&view=rev
Log:
Genericized Windows MySQL Server path handling for VC++ and mingw

Modified:
    trunk/README.mingw
    trunk/README.vc
    trunk/mysql++.bkl

Modified: trunk/README.mingw
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/README.mingw?rev=1979&r1=1978&r2=1979&view=diff
==============================================================================
--- trunk/README.mingw (original)
+++ trunk/README.mingw Fri Dec  7 06:06:09 2007
@@ -1,49 +1,56 @@
 MinGW Version
 ~~~~~~~~~~~~~
-       You need a fairly recent version of MinGW for MySQL++ to work.
-       As I write this, the current release version includes GCC
-       3.4.2, which has known problems.  Unless they've released
-       a newer version since I wrote this, you'll probably need to
-       install the "candidate" version for best compatibility.
+    You need a fairly recent version of MinGW for MySQL++ to work.
+    As I write this, the current release version includes GCC 3.4.2,
+    which has known problems.  Unless they've released a newer version
+    since I wrote this, you'll probably need to install the "candidate"
+    version for best compatibility.
 
 
 Prerequisite: Create Import Library
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-       Before you can build MySQL++ with MinGW, you will need to
-       create a MinGW-compatible import library for MySQL's C API
-       library.  Using the current default install path for MySQL and
-       assuming MySQL++ is in c:\mysql++, the commands to do this are:
+    Before you can build MySQL++ with MinGW, you will need to create
+    a MinGW-compatible import library for MySQL's C API library.
+    Using the current default install path for MySQL and assuming
+    MySQL++ is in c:\mysql++, the commands to do this are:
 
-               cd C:\Program Files\MySQL\MySQL Server 5.0\lib\opt
-           dlltool -k -d c:\mysql++\libmysqlclient.def -l libmysqlclient.a
+        cd C:\Program Files\MySQL\MySQL Server 5.0\lib\opt
+        dlltool -k -d c:\mysql++\libmysqlclient.def -l libmysqlclient.a
+
+
+Prerequisite: MySQL C Development Files
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+    You'll also need to have MySQL installed, including all the MySQL C
+    development files; MySQL++ is built atop this library.  If it isn't
+    in C:\Program Files\MySQL\MySQL Server 5.0\ you have two options.
+
+    The simplest is to edit Makefile.mingw.  This is a generated
+    file, but if that's all the only change to MySQL++ you need,
+    it works fine.
+
+    If you're doing deeper work on MySQL++, you should change the
+    variable MYSQL_WIN_DIR at the top of mysql++.bkl instead.  Then to
+    generate Makefile.mingw from that file, you will need the Win32
+    port of Bakefile from http://bakefile.org/  The command to do
+    that is:
+
+        bakefile_gen -f mingw
 
 
 Building the Library and Example Programs
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-       Now you can build MySQL++ with this command:
-       
-               mingw32-make -f Makefile.mingw
+    Now you can build MySQL++ with this command:
+    
+        mingw32-make -f Makefile.mingw
 
-       Notice that we're using the MinGW-specific version of GNU
-       make, not the Cygwin or MSYS versions.  This is in order to
-       get proper path separator handling.
+    Notice that we're using the MinGW-specific version of GNU make,
+    not the Cygwin or MSYS versions.  This is required, to get proper
+    path separator handling.
 
-       If MySQL isn't in C:\Program Files\MySQL\MySQL Server 5.0\ you have
-       two options:
-       
-               - The simplest is to edit Makefile.mingw.  This is
-                 a generated file, but if that's all the only change
-                 to MySQL++ you need, it works fine.
+    Once the library is built, you should run the examples.
+    At minimum, run resetdb and simple1.
 
-               - If you're doing deeper work on MySQL++, you
-                 should make your changes in mysql++.bkl instead.
-                 Then to generate Makefile.mingw from that file,
-                 you will need the Win32 port of Bakefile from
-                 http://bakefile.sf.net/  The command to do that is:
-
-                         bakefile -f mingw -o Makefile.mingw mysql++.bkl
-
-    Once the library is built and you're satisfied that it's working
-    correctly, you can run the install.bat file at the project
-    root to automatically install the library files and headers in
-    subdirectories under c:\mysql++.
+    Once you're satisfied that the library is working correctly, you
+    can run the install.bat file at the project root to automatically
+    install the library files and headers in subdirectories under
+    c:\mysql++.

Modified: trunk/README.vc
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/README.vc?rev=1979&r1=1978&r2=1979&view=diff
==============================================================================
--- trunk/README.vc (original)
+++ trunk/README.vc Fri Dec  7 06:06:09 2007
@@ -22,13 +22,12 @@
     
         C:\Program Files\MySQL\MySQL Server 5.0\
         
-    you need to change the project file settings.  The simplest way
-    to do this is to change the link and include file directories in
-    the project settings directly.  Although these are technically
-    generated files and it's generally bad practice to change generated
-    files, if that's all the only change to MySQL++ you need, this
-    is harmless.  See below if you want to change the actual source
-    files that create the project files.
+    you need to change the project file settings.  If you're willing to
+    install Bakefile (see below), you can do this quickly by changing
+    the variable MYSQL_WIN_DIR at the top of the file mysql++.bkl,
+    then regenerating the project files by running rebake.bat.
+    Otherwise, you'll need to change the include and library paths
+    in all of the project files by hand.
 
     You must build both the Debug and Release versions of the library.
     You will need them both because when you build your program in
@@ -153,17 +152,19 @@
     Bakefile up on that web site.  Download that and put the directory
     containing bakefile.exe in your Windows PATH.
 
-    Therefore, if you need to make changes to the project files
-    and want to submit those changes back to the MySQL++ project,
-    you need to do your changes to mysql++.bkl instead of directly to
-    the project files.
-
-    The documentation on the Bakefile web site isn't wonderful, but
-    is adequate for most things.  If you can't find documentation
-    for the feature you need, it's quite likely that Bakefile just
-    doesn't support it.  There are things you can do to the project
-    settings in Visual Studio that you can't do in Bakefile, since
-    it's a cross-platform tool.
+    Bakefile generates the various project files and Makefiles from
+    a single source file, mysql++.bkl.  This is usually the file you
+    need to change when you want to submit some change to the MySQL++
+    build system.  You might also look into the files Bakefiles.bkgen,
+    rebake.bat and bootstrap; they're also involved in building the
+    Visual C++ project files.
+
+    Although Bakefile's documentation is lacking, it does at least
+    list all the supported features.  So, if you can't see a way
+    to make Bakefile do something, it's likely it just can't do it.
+    Bakefile is a high-level abstraction of build systems in general,
+    so it'll never support all the particulars of every odd build
+    system out there.
 
     Once you've made your changes, you can generate the Visual C++
     project files by running rebake.bat, which you can find in the

Modified: trunk/mysql++.bkl
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/mysql%2B%2B.bkl?rev=1979&r1=1978&r2=1979&view=diff
==============================================================================
--- trunk/mysql++.bkl (original)
+++ trunk/mysql++.bkl Fri Dec  7 06:06:09 2007
@@ -22,6 +22,10 @@
             Type of compiled binaries
         </description>
     </option>
+
+       <set var="MYSQL_WIN_DIR">
+               C:\Program Files\MySQL\MySQL Server 5.0
+       </set>
 
     <set var="DEBUGINFO">
         <if cond="BUILD=='debug'">on</if>
@@ -80,8 +84,8 @@
                                <define>_UNICODE</define>
                                <define>MYSQLPP_MAKING_DLL</define>
                                <define>HAVE_MYSQL_SSL_SET</define>
-                               <include>"C:\Program Files\MySQL\MySQL Server 
5.0\include"</include>
-                               <lib-path>C:\Program Files\MySQL\MySQL Server 
5.0\lib\opt</lib-path>
+                               <include>$(MYSQL_WIN_DIR)\include</include>
+                               <lib-path>$(MYSQL_WIN_DIR)\lib\opt</lib-path>
                                <sys-lib>libmysql</sys-lib>
                                <sys-lib>wsock32</sys-lib>
                        </if>
@@ -90,8 +94,8 @@
                                <define>_UNICODE</define>
                                <define>MYSQLPP_NO_DLL</define>
                                <define>HAVE_MYSQL_SSL_SET</define>
-                               <include>"C:\Program Files\MySQL\MySQL Server 
5.0\include"</include>
-                               <lib-path>"C:\Program Files\MySQL\MySQL Server 
5.0\lib\opt"</lib-path>
+                               <include>"$(MYSQL_WIN_DIR)\include"</include>
+                               <lib-path>"$(MYSQL_WIN_DIR)\lib\opt"</lib-path>
                                <sys-lib>mysqlclient</sys-lib>
                        </if>
 
@@ -146,8 +150,8 @@
                <if cond="FORMAT=='msvs2005prj'">
                        <define>_UNICODE</define>
                        <lib-path>$(BUILD)</lib-path>
-                       <lib-path>C:\Program Files\MySQL\MySQL Server 
5.0\lib\opt</lib-path>
-                       <include>"C:\Program Files\MySQL\MySQL Server 
5.0\include"</include>
+                       <include>$(MYSQL_WIN_DIR)\include</include>
+                       <lib-path>$(MYSQL_WIN_DIR)\lib\opt</lib-path>
                        <sys-lib>libmysql</sys-lib>
                        <sys-lib>mysqlpp</sys-lib>
                </if>
@@ -159,8 +163,8 @@
                                -Wl,--enable-auto-import 
-Wl,--enable-runtime-pseudo-reloc
                        </ldflags>
                        <lib-path>..\lib</lib-path>
-                       <lib-path>"C:\Program Files\MySQL\MySQL Server 
5.0\lib\opt"</lib-path>
-                       <include>"C:\Program Files\MySQL\MySQL Server 
5.0\include"</include>
+                       <include>"$(MYSQL_WIN_DIR)\include"</include>
+                       <lib-path>"$(MYSQL_WIN_DIR)\lib\opt"</lib-path>
                        <sys-lib>mysqlclient</sys-lib>
                        <sys-lib>mysqlpp</sys-lib>
                </if>
@@ -169,7 +173,6 @@
                        <cxxflags>@PTHREAD_CFLAGS@</cxxflags>
                        <ldflags>@PTHREAD_LIBS@ @MYSQLPP_EXTRA_LIBS@</ldflags>
                        <sys-lib>@MYSQL_C_LIB@</sys-lib>
-
                        <warnings>max</warnings>
                        <sys-lib>mysqlpp</sys-lib>
                        <if cond="ZLIB=='yes'">


_______________________________________________
Mysqlpp-commits mailing list
[email protected]
https://mail.gna.org/listinfo/mysqlpp-commits

Reply via email to