logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Building & Member Downloads View previous topic :: View next topic
Reply to topic   Topic: Another set of VC++ 2005 command-line build instructions
Author
tdonovan
Moderator


Joined: 17 Dec 2005
Posts: 611
Location: Milford, MA, USA

PostPosted: Sun 10 Sep '06 22:26    Post subject: Another set of VC++ 2005 command-line build instructions Reply with quote

At the risk of creating yet another large topic - this set of command-line instructions for building Apache 2.2.3 with mod_ssl and mod_deflate differs in several ways from the previous posts:
    The "not for commercial use" MASM V8 assembler is avoided
    GCC is used to build ZLib using an assembly language component
    Warnings during the ZLib build are reduced
    Separate .manifest files are not needed
This produces a "Release" build of Apache 2.2.3 which builds and runs OK for me on both Windows 2003 and Windows 2000.

I hope it will be useful to other Windows/Apache enthusiasts.

-tom-

TOOLS USED TO BUILD APACHE 2.2.3
(1) Start the Visual C++ 2005 Express Edition at least once before installing Windows Server 2003 R2 Platform SDK

(2) Copy or rename C:\Program Files\GnuWin32\bin\gawk.exe to awk.exe so the Apache build will recognize it.

An alternative to GAWK is at http://cm.bell-labs.com/cm/cs/who/bwk/awk95.exe.
If you use this version of awk, be sure to copy or rename awk95.exe to awk.exe.

(3) Versions of BISON higher than 1.875-4 will not work to build OpenSSL. All other GNU tools are the latest version.

(4) PATCH is only needed to correct errors in Apache 2.2.3 Windows source makefiles.

(5) A roughly 10% performance gain in OpenSSL (mod_ssl) can be acheived by using several assembly-language components
NASM will assemble a dialect of Intel-format assembly-language files.

(6) A roughly 10% performance gain in Zlib compression (mod_deflate) can be acheived by using one assembly-language component
GCC.exe and AS.exe (which is in the binutils package) will assemble a dialect of AT&T-format assembly-language files.

If you do not have a utility which will expand .tar.gz files (like WinZip version 9 or higher), the additional GNU tools GZIP and TAR are useful.
Create a new directory to un-tar the MinGW tools into, for example:
Code:
MKDIR \MinGW
MOVE gcc-core-3.4.2-20040916-1.tar.gz  \MinGW
MOVE binutils-2.17.50-20060824-1.tar.gz \MinGW
CD \MinGW
gunzip gcc-core-3.4.2-20040916-1.tar.gz
tar xf gcc-core-3.4.2-20040916-1.tar
gunzip binutils-2.17.50-20060824-1.tar.gz
tar xf binutils-2.17.50-20060824-1.tar
DEL gcc-core-3.4.2-20040916-1.tar
DEL xf binutils-2.17.50-20060824-1.tar


PROGRAM SOURCES


PREPARATION FOR BUILDING
Unzip the Apache 2.2.3 source into a working directory, preserving directories.

Untar the OpenSSL source into httpd-2.2.3\srclib preserving directories, which creates httpd-2.2.3\srclib\openssl-0.9.8c,
then rename httpd-2.2.3\srclib\openssl-0.9.8c to httpd-2.2.3\srclib\openssl.

Unzip the ZLib source into (create new directory) httpd-2.2.3\srclib\zlib preserving directories.

Make sure that all required tools can be found via your PATH environment variable. Typically these directories must be included (depending on where you installed the various tools):
    PATH
    C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Bin
    C:\Program Files\Microsoft Visual Studio 8\Common7\IDE
    C:\Program Files\Microsoft Visual Studio 8\VC\BIN
    C:\Program Files\Microsoft Visual Studio 8\Common7\Tools
    C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\bin
    C:\WINNT\Microsoft.NET\Framework\v2.0.50727
    C:\Program Files\Microsoft Visual Studio 8\VC\VCPackages
    C:\Perl\bin
    C:\Program Files\GnuWin32\bin
    C:\MinGW\bin
    C:\NASM

Make sure that your INCLUDE and LIB environment variables include values for both the Platform SDK and Visual C++ 2005:
    INCLUDE
    C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include
    C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE

    LIB
    C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib
    C:\Program Files\Microsoft Visual Studio 8\VC\LIB


EXTRA STEP - ONLY FOR APACHE VERSION 2.2.3
Correct the errors in two Apache makefiles which shipped with the Apache 2.2.3 Windows source.

Create a file in the httpd-2.2.3 directory named patch_httpd-2.2.3_makefile_errors.diff. See the contents of this patch file below.

In the httpd-2.2.3 directory, execute this command to patch the makefiles:
Code:
PATCH -p0 -l < patch_httpd-2.2.3_makefile_errors.diff

The output from the command should say:
Quote:
patching file modules/metadata/mod_usertrack.mak
patching file support/htpasswd.mak


STEP 1 - Build OpenSSL which is used by mod_ssl
Change to the httpd-2.2.3\srclib\openssl directory and execute these commands to configure OpenSSL and assemble several files using NASM while compiling & linking the OpenSSL libraries:
Code:
PERL Configure VC-WIN32
ms\do_nasm.bat
NMAKE -f ms\ntdll.mak
Change to the httpd-2.2.3\srclib\openssl\out32dll directory and check that OpenSSL was built correctly with this command:
Code:
..\ms\test.bat

The last line of output should say "passed all tests".

STEP 2 - Build ZLib which is used by mod_deflate
Change to the httpd-2.2.3\srclib\zlib directory and execute these commands to assemble one file using GCC and compile & link the ZLib library:
Code:
GCC -c -o match.obj contrib\asm686\match.S
NMAKE -f win32\Makefile.msc  LOC="-D_CRT_SECURE_NO_DEPRECATE /wd4996 -DASMV" OBJA="match.obj"

Check that ZLib was built correctly by executing this command in the httpd-2.2.3\srclib\zlib directory:
Code:
example.exe
The last line of output should say "inflate with dictionary: hello, hello!".

STEP 3 - Build and install Apache 2.2.3 with OpenSSL and ZLib
Change to the httpd-2.2.3 directory and execute this command to build Apache, changing the INSTDIR value as appropriate:
Code:
NMAKE /f Makefile.win INSTDIR="C:\Program Files\Apache Group\Apache2"   installr


OPTIONAL
Embed the Visual C++ 2005 manifest files into the executables and libraries with these commands so the .manifest files will not need to be present as separate files in the target directories:
Code:
FOR /R %a in (*.exe) DO @if exist %a.manifest mt -nologo -manifest %a.manifest -outputresource:%a;1
FOR /R %a in (*.dll) DO @if exist %a.manifest mt -nologo -manifest %a.manifest -outputresource:%a;2
FOR /R %a in (*.so)  DO @if exist %a.manifest mt -nologo -manifest %a.manifest -outputresource:%a;2
Then execute this command to re-install the binaries without triggering a re-build:
Code:
NMAKE /f Makefile.win INSTDIR="C:\Program Files\Apache Group\Apache2" SHORT=R LONG=Release _install
Note that if you put the three "FOR" commands in a Windows .bat file, you must change "%a" to "%%a" to make it work.

OPTIONAL
All the .pdb files can be deleted from the target directories to save space in a production environment:
Code:
DEL /S "C:\Program Files\Apache Group\Apache2\*.pdb"


VARIATIONS
If you have the Microsoft MASM Assembler, neither NASM nor the MinGW GCC compiler/assembler is required.

A copy of the Microsoft MASM Assembler Version 8 for non-commercial use can be downloaded from http://www.microsoft.com/downloads/details.aspx?FamilyID=7a1c9da0-0510-44a2-b042-7ef370530c64
MASM assembles a dialect of Intel-format assembly-language files, which is slightly different from the NASM dialect.

Use these commands to build OpenSSL using the MASM assembler:
Code:
PERL Configure VC-WIN32
ms\do_masm.bat
NMAKE -f ms\ntdll.mak
Use these commands to build ZLib using the MASM assembler:
Code:
ML /coff /Zi /c contrib\masm686\match.asm
NMAKE -f win32\Makefile.msc  LOC="-D_CRT_SECURE_NO_DEPRECATE /wd4996 -DASMV" OBJA="match.obj"



If no assembly-language components are desired, neither NASM nor the MinGW GCC compiler/assembler nor MASM is needed. Apache (including mod_ssl and mod_deflate) can be built without any assembly-language components. Use these commands to build OpenSSL without any assembly-language components:
Code:
PERL Configure VC-WIN32
ms\do_ms.bat
NMAKE -f ms\ntdll.mak
Use this command to build ZLib without any assembly-language components:
Code:
NMAKE -f win32\Makefile.msc  LOC="-D_CRT_SECURE_NO_DEPRECATE /wd4996"



PATCH FILE TO CORRECT Apache 2.2.3 MAKEFILE ERRORS
Copy this into a new file named patch_httpd-2.2.3_makefile_errors.diff.
Note that some lines may wrap when you view this Code: in a browser, but it should still cut & paste correctly into a text editor. The final file should have 37 lines.
Code:
Index: modules/metadata/mod_usertrack.mak
===================================================================
--- modules/metadata/mod_usertrack.mak  (revision 1)
+++ modules/metadata/mod_usertrack.mak  (working copy)
@@ -58 +58 @@
-   -@erase ".\Debug\mod_usertrack.res"
+   -@erase "$(INTDIR)\mod_usertrack.res"
@@ -99 +99 @@
-RSC_PROJ=/l 0x409 /fo"Debug/mod_usertrack.res" /i "../../include" /i "../../srclib/apr/include" /d "_DEBUG" /d BIN_NAME="mod_usertrack.so" /d LONG_NAME="usertrack_module for Apache"
+RSC_PROJ=/l 0x409 /fo"$(OUTDIR)/mod_usertrack.res" /i "../../include" /i "../../srclib/apr/include" /d "NDEBUG" /d BIN_NAME="mod_usertrack.so" /d LONG_NAME="usertrack_module for Apache"
@@ -108 +108 @@
-   ".\Debug\mod_usertrack.res" \
+   "$(INTDIR)\mod_usertrack.res" \
@@ -305,2 +305,2 @@
-".\Debug\mod_usertrack.res" : $(SOURCE) "$(INTDIR)"
-   $(RSC) /l 0x409 /fo"Debug/mod_usertrack.res" /i "../../include" /i "../../srclib/apr/include" /i "\asf-build\build-2.2.3\build\win32" /d "_DEBUG" /d BIN_NAME="mod_usertrack.so" /d LONG_NAME="usertrack_module for Apache" $(SOURCE)
+"$(INTDIR)\mod_usertrack.res" : $(SOURCE) "$(INTDIR)"
+   $(RSC) /l 0x409 /fo"$(INTDIR)/mod_usertrack.res" /i "../../include" /i "../../srclib/apr/include" /i "\asf-build\build-2.2.3\build\win32" /d "NDEBUG" /d BIN_NAME="mod_usertrack.so" /d LONG_NAME="usertrack_module for Apache" $(SOURCE)

Index: support/htpasswd.mak
===================================================================
--- support/htpasswd.mak    (revision 1)
+++ support/htpasswd.mak    (working copy)
@@ -56 +56 @@
-   -@erase ".\Debug\htpasswd.res"
+   -@erase "$(OUTDIR)\htpasswd.res"
@@ -95 +95 @@
-RSC_PROJ=/l 0x409 /fo"Debug/htpasswd.res" /i "../include" /i "../srclib/apr/include" /d "_DEBUG" /d "APP_FILE" /d BIN_NAME="htpasswd.exe" /d LONG_NAME="Apache htpasswd command line utility"
+RSC_PROJ=/l 0x409 /fo"$(OUTDIR)/htpasswd.res" /i "../include" /i "../srclib/apr/include" /d "NDEBUG" /d "APP_FILE" /d BIN_NAME="htpasswd.exe" /d LONG_NAME="Apache htpasswd command line utility"
@@ -104 +104 @@
-   ".\Debug\htpasswd.res" \
+   "$(OUTDIR)\htpasswd.res" \
@@ -274,2 +274,2 @@
-".\Debug\htpasswd.res" : $(SOURCE) "$(INTDIR)"
-   $(RSC) /l 0x409 /fo"Debug/htpasswd.res" /i "../include" /i "../srclib/apr/include" /i "\asf-build\build-2.2.3\build\win32" /d "_DEBUG" /d "APP_FILE" /d BIN_NAME="htpasswd.exe" /d LONG_NAME="Apache htpasswd command line utility" $(SOURCE)
+"$(OUTDIR)\htpasswd.res" : $(SOURCE) "$(INTDIR)"
+   $(RSC) /l 0x409 /fo"$(OUTDIR)/htpasswd.res" /i "../include" /i "../srclib/apr/include" /i "\asf-build\build-2.2.3\build\win32" /d "NDEBUG" /d "APP_FILE" /d BIN_NAME="htpasswd.exe" /d LONG_NAME="Apache htpasswd command line utility" $(SOURCE)
Back to top
toadie



Joined: 28 Oct 2006
Posts: 8

PostPosted: Sat 28 Oct '06 9:46    Post subject: re: Another set of VC++ 2005 build instructions MSVCR80.dll Reply with quote

THe build went fine . When trying to run it, it says I am missing MSVC*80.dll.

I followed the instructions from MS to install the redistributable DLL, still failed.

Any one has any luck?

Thanks
Back to top
tdonovan
Moderator


Joined: 17 Dec 2005
Posts: 611
Location: Milford, MA, USA

PostPosted: Sat 28 Oct '06 18:16    Post subject: Reply with quote

Installing the redistributable DLL should have put MSVCR80.DLL in a directory with a name like
C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_0de06acd
for Windows XP.

A copy also goes in C:\WINNT\System32 for Windows 2000.

If Apache cannot find this file - you might try searching for MSVCR80.DLL and copying it to your Apache \bin directory.

-tom-
Back to top
toadie



Joined: 28 Oct 2006
Posts: 8

PostPosted: Sun 29 Oct '06 6:24    Post subject: Reply with quote

Thanks tdonovan. That works. One more followup question. That works on another machine but not the one that I used to build the binaries. Apparently my WinXP Sp2 has 2 copies of the DLL. Any idea how I can remove ond of the DLL?

Both are in C:\WINDOWS\WinSxS and complete with manifests.

Thanks a bunch
Toadie
Back to top
acid.-.burn



Joined: 15 Jan 2007
Posts: 17

PostPosted: Wed 28 Feb '07 6:33    Post subject: Reply with quote

i have did ever thing in the above & it built ever thing ok all exe's dll's & mod folders & files but 1 problem when i ziped it up to put on anuther pc it will not work but it works on the pc i built it on am i missing somthing here i have even tryed the dll with the code in anuther tut here

MSVCR80.DLL

Microsoft.VC80.CRT.manifest

Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!-- Copyright © 1981-2001 Microsoft Corporation -->
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<noInheritable/>
<assemblyIdentity
type="win32"
name="Microsoft.VC80.CRT"
version="8.0.50608.0"
processorArchitecture="x86"
publicKeyToken="1fc8b3b9a1e18e3b"
/>
<file name="msvcr80.dll"/>
<file name="msvcp80.dll"/>
<file name="msvcm80.dll"/>
</assembly>
Back to top
krka01



Joined: 02 Jun 2006
Posts: 14
Location: Stockholm, Sweden

PostPosted: Wed 28 Feb '07 14:18    Post subject: Reply with quote

Hi,

Have you installed the Microsoft Visual C++ 2005 Redistributable Package (x86)? Check out this thread for more info:

http://www.apachelounge.com/viewtopic.php?p=6074

Krister
Back to top
acid.-.burn



Joined: 15 Jan 2007
Posts: 17

PostPosted: Wed 28 Feb '07 15:53    Post subject: Reply with quote

Thanks that worked like a charm Very Happy
Back to top
krka01



Joined: 02 Jun 2006
Posts: 14
Location: Stockholm, Sweden

PostPosted: Tue 03 Jul '07 8:08    Post subject: Reply with quote

Tdonovan,

Thanks for this excellent command-line guide, it´s a timesaver and have help me a lot. Any chance you will add instructions howto compile modsecurity2?

Krister
Back to top
Mitron



Joined: 04 Jan 2006
Posts: 63

PostPosted: Mon 10 Mar '08 21:20    Post subject: Reply with quote

I do like this tutorial, I was able to compile Apache 2.2.8 without issue. I attempted to take it one step further by enabling DBD support and attempting to build the apr_dbd_mysql but I got a little lost on where to put the mysql\lib\opt files.

I added my mysql\bin, mysql\include and mysql\lib paths to the PATH, INCLUDE and LIB variables, edited apu.hw to add the #define APR_DSO_BUILD 1 and #define APU_HAVE_MYSQL 1 but then it can't find the includes. If I do an echo %INCLUDE% the mysql\include path is listed but the build errors trying to find mysql.h.

By placing the mysql\include files in the work\httpd-2.2.8\srclib\apr-util\include\mysql folder I was able to get it to recognize all the *.h files but then it can't find the libraries, or so it seems by the erros. There doesn't seem to be a work\httpd-2.2.8\srclib\apr-util\lib folder to place the mysql\lib\opt files so I'm not sure where to place them. Again if I do an echo %LIB% the mysql\lib path is listed.

One other thing I noticed nibbing around in apu.hnw I noticed this line of code.
Code:
/*
 * Hack to enable dynamic loads within apr_dbd
 */
#define APR_DSO_BUILD APR_HAS_DSO
yet the instructions I found here in another post indicated we place
Code:
#define APR_DSO_BUILD 1
in apu.hw. Should the value be 1 or APR_HAS_DSO?

I did a pretty exhaustive search on google for docs on this and so far this is the only place that even mentions it. Appreciate any insight here. Smile
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3092
Location: Hilversum, NL, EU

PostPosted: Mon 10 Mar '08 23:09    Post subject: Reply with quote

You should only add this line to srclib\apr\include\apr.hw

#define APR_DSO_BUILD 1

Thats all.

This will let you use MySQL authentcation with ODBC, see the modules from Tom on the download page. No need to build Mysql in it.

Btw.
The DBD mods from Tom are working Great !!! here.


Steffen
Back to top
Mitron



Joined: 04 Jan 2006
Posts: 63

PostPosted: Tue 11 Mar '08 0:10    Post subject: Reply with quote

Steffen wrote:

No need to build Mysql in it.


Well this is the purpose for me turning on DBD support, to test these other drivers and document the build procedure. I know Tom has an excellent ODBC module available, but I'd like to try with apr_dbd_mysql.c, apr_dbd_pqsql.c, apr_dbd_sqlite2.c, apr_dbd_sqlite3.c already listed in the db folder. Unfortunately I can't seem to find any documentation on this proceedure.

I know Tom says he has tested Apache with these drivers, just trying to see if its possible with the current source and VC++ 2005 Express so we can document it. Smile
Back to top
tdonovan
Moderator


Joined: 17 Dec 2005
Posts: 611
Location: Milford, MA, USA

PostPosted: Tue 11 Mar '08 4:31    Post subject: Reply with quote

Yes - I built the mysql, pgsql, and sqlite3 dbd drivers from the SVN source sometime during the Apache 2.2.6 time frame in order to compare their performance to the odbc driver.

I dug up my notes, but I didn't really keep good notes about building them - just my results. My impression was that no one had previously built or tested any of these drivers on Windows. There are none of the usual #ifdef WIN32 directives which indicate someone ported the source code for Windows, and no Makefile - so be sure to test very thoroughly before using them in production!.

From memory, I built them like this:
    * edit apu.h and set the symbols APU_HAVE_MYSQL, etc. to 1
    (remember to change this file back before re-building Apache again)

    * for all the drivers, compile and link each driver manually in the apu-util\dbd directory using the same compiler switches and defines that you see when you build libaprutil. The -DWIN32 and -DAPU_DECLARE_EXPORT switches are important. Add a -I compiler switch to the apr-util\include\private directory. Link with the the /DLL switch and include the Apache libraries: libaprutil-1.lib and libapr-1.lib, and also the Windows library: wsock32.lib

    * for mysql, add a -I compiler switch to your mysql \include directory. Link with the libmysql.lib which corresponds to your libmysql.dll. I don't remember if you get this file with the MySQL distribution - but you will get one if you build MySQL yourself from source. I think I remember editing apr_dbd_mysql.c to fix the directory for the mysql include files.

    * for pgsql, pretty much the same. add -I to your Postgresql \include directory. link with libpq.lib.

    * for sqlite3, first build sqlite3 from source, then add -I to the directory containing sqlite3.h. Link with sqlite3.lib.
My notes about using them were:
    * mysql - runs nearly as fast as odbc. OK to retrieve columns which are NULL, but don't ever pass it any NULL parameters.

    * pgsql - runs even faster than odbc, but doesn't handle NULLs at all - either results or parameters. No error messages except for open errors - it just returns zero rows for any SQL error (the same as if there were no rows). This makes it pretty hard to diagnose problems.

    * sqlite3 - as expected, it is amazingly fast on reads (> 2,000 per sec) and terrible on writes/updates (10-20 per second). This is sqlite's niche so it was no surprise. You definitely don't want to use sqlite for logging - but it is excellent for authentication, virtual host lookups, etc. I didn't note whether it handled NULLs correctly. It probably did.
Sorry it's such sketchy info. If I find the time I will try to build them all from the Apache 2.2.8 source and make some proper cookbook-style notes.

Hope this helps,
-tom-
Back to top
Mitron



Joined: 04 Jan 2006
Posts: 63

PostPosted: Sat 15 Mar '08 12:10    Post subject: Reply with quote

tdonovan wrote:
From memory, I built them like this:[list]* edit apu.h and set the symbols APU_HAVE_MYSQL, etc. to 1
(remember to change this file back before re-building Apache again)


Ok, you pretty much lost me after this. According to the README.MySQL file you simply add a --with-mysql to configure in order to build it although I saw nothing in the code that would check for that switch.

I'm not sure how to manually compile it with just a .c file. I don't suppose the NWGNU files would help any, i.e. NWGNUdbdmysql and NWGNUmakefile?

I did at least accomplish building Apache 2.2.8 with DBD support so if all else fails I can at least use your ODBC driver. Wink
Back to top
tdonovan
Moderator


Joined: 17 Dec 2005
Posts: 611
Location: Milford, MA, USA

PostPosted: Thu 20 Mar '08 17:20    Post subject: Building the MySQL, PostgreSQL, and SQLite3 DBD drivers Reply with quote

Sorry for the delay responding to your question.

Here is how to manually build the MySQL, PostGreSQL, and SQLite3 DBD drivers with Visual Studio 2005 from the Apache 2.2.8 source code:

* Edit the file srclib\apr-util\include\apu.h and change the defines for the three databases to 1:
Code:
#define APU_HAVE_PGSQL         1
#define APU_HAVE_MYSQL         1
#define APU_HAVE_SQLITE2       0
#define APU_HAVE_SQLITE3       1
#define APU_HAVE_ORACLE        0

* Open a Visual Studio 2005 command prompt and change to the Apache 2.2.8 source directory srclib\apr-util\dbd.

* Set an environment variable to the directory where Apache is installed on your system:
Code:
SET APACHE=C:\Apache2

* To build the MySQL driver - execute the following four commands, changing the MYSQL environment variable to where MySQL is installed on your system:
(the long lines will wrap when displayed in your browser, but they should cut & paste OK to 4 command lines)
Code:
SET MYSQL=C:\Program Files\MySQL\MySQL Server 5.0.52
CL /nologo /MD /c /Zi /O2 /I..\include -I..\include\private -I..\..\apr\include -DWIN32 -I"%MYSQL%\include" apr_dbd_mysql.c -DAPU_DECLARE_EXPORT -DHAVE_MYSQL_H
LINK /NOLOGO /DEBUG /DLL apr_dbd_mysql.obj /LIBPATH:"%MYSQL%\lib\opt" libmysql.lib  /LIBPATH:"%APACHE%\lib" libaprutil-1.lib  libapr-1.lib kernel32.lib wsock32.lib
MT /NOLOGO -manifest apr_dbd_mysql.dll.manifest -outputresource:apr_dbd_mysql.dll;2
Copy apr_dbd_mysql.dll to your Apache \bin directory. Apache must also be able to find libmysql.dll at runtime (via your PATH or a LoadFile directive).

* To build the PostgreSQL driver - execute the following four commands, changing the POSTGRESQL environment variable to where PostgreSQL is installed on your system:
(you might need to change /LIBPATH:"%POSTGRESQL%\lib" to /LIBPATH:"%POSTGRESQL%\lib\ms" for older versions of PostgreSQL)
Code:
SET POSTGRESQL=C:\Program Files\PostgreSQL\8.3
CL /nologo /MD /c /Zi /O2 -DHAVE_LIBPQ_FE_H /I..\include -I..\include\private -I..\..\apr\include -DWIN32 -I"%POSTGRESQL%\include" apr_dbd_pgsql.c -DAPU_DECLARE_EXPORT
LINK /NOLOGO /INCREMENTAL:NO /DEBUG /DLL apr_dbd_pgsql.obj /LIBPATH:"%POSTGRESQL%\lib" libpq.lib  /LIBPATH:"%APACHE%\lib" libaprutil-1.lib  libapr-1.lib kernel32.lib wsock32.lib
MT /NOLOGO -manifest apr_dbd_pgsql.dll.manifest -outputresource:apr_dbd_pgsql.dll;2
Copy apr_dbd_pgsql.dll to your Apache \bin directory. Apache must also be able to find libpq.dll at runtime.

* To build the SQLite3 driver - execute the following four commands, changing the SQLITE3 environment variable to the directory where sqlite3.h and sqlite3.lib are located on your system:
Code:
SET SQLITE3=C:\SQLite
CL /nologo /MD /c /Zi /O2 /I..\include -I..\include\private -I..\..\apr\include -DWIN32 -I"%SQLITE3%" apr_dbd_sqlite3.c -DAPU_DECLARE_EXPORT
LINK /NOLOGO /INCREMENTAL:NO /DEBUG /DLL apr_dbd_sqlite3.obj /LIBPATH:"%SQLITE3%" sqlite3.lib  /LIBPATH:"%APACHE%\lib" libaprutil-1.lib  libapr-1.lib kernel32.lib wsock32.lib
MT /NOLOGO -manifest apr_dbd_sqlite3.dll.manifest -outputresource:apr_dbd_sqlite3.dll;2
Copy apr_dbd_sqlite3.dll to your Apache \bin directory. Apache must also be able to find sqlite3.dll at runtime.

You shoud remember to change srclib\apr-util\include\apu.h back to its original contents before you build Apache again from the source code.

The three drivers built with VS2005 per these instructions can be downloaded at http:/www.tomdonovan.net/download/Apache228_other_dbd_drivers.zip
You can use them with Apache 2.2.8 downloaded from Apache Lounge, but not with Apache from apache.org.

Hope this helps,
-tom-
Edited to change /NOLOGO switch to lower case for CL compile commands


Last edited by tdonovan on Fri 21 Mar '08 15:05; edited 1 time in total
Back to top
Mitron



Joined: 04 Jan 2006
Posts: 63

PostPosted: Fri 21 Mar '08 7:44    Post subject: Reply with quote

Awesome!! That worked like a charm. Smile

BTW, thought I'd mention that this command:
Code:
CL /NOLOGO /MD /c /Zi /O2 /I..\include -I..\include\private -I..\..\apr\include -DWIN32 -I"%MYSQL%\include" apr_dbd_mysql.c -DAPU_DECLARE_EXPORT -DHAVE_MYSQL_H

produced an error complaining about the /NOLOGO command not being recognized, but other than that it seemed to compile just fine. Thanks Tom, you're awesome. Smile
Back to top
tdonovan
Moderator


Joined: 17 Dec 2005
Posts: 611
Location: Milford, MA, USA

PostPosted: Fri 21 Mar '08 15:08    Post subject: Reply with quote

I didn't realize that the /nologo switch was case-sensitive with CL.
I edited the instructions above to correct this.

-tom-
Back to top
bentogoa



Joined: 09 Feb 2007
Posts: 66
Location: GOA

PostPosted: Mon 07 Apr '08 7:56    Post subject: Reply with quote

bin\ApacheMonitor.exe
bin\htdbm.exe

this files dont work when this

Code:
FOR /R %a in (*.exe) DO @if exist %a.manifest mt -nologo -manifest %a.manifest -outputresource:%a;1
FOR /R %a in (*.dll) DO @if exist %a.manifest mt -nologo -manifest %a.manifest -outputresource:%a;2
FOR /R %a in (*.so)  DO @if exist %a.manifest mt -nologo -manifest %a.manifest -outputresource:%a;2


command is given, without this command it works well, but other files like httpd.exe do not work. How to change this command so it does the effect this files?
Back to top


Reply to topic   Topic: Another set of VC++ 2005 command-line build instructions View previous topic :: View next topic
Post new topic   Forum Index -> Building & Member Downloads