Return-Path: Delivered-To: apmail-new-httpd-archive@apache.org Received: (qmail 53642 invoked by uid 500); 30 Mar 2000 00:15:44 -0000 Mailing-List: contact new-httpd-help@apache.org; run by ezmlm Precedence: bulk X-No-Archive: yes Reply-To: new-httpd@apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list new-httpd@apache.org Received: (qmail 53629 invoked from network); 30 Mar 2000 00:15:43 -0000 From: "William A. Rowe, Jr." To: Subject: [patch 2.0] htdigest Linkage mechanisims Date: Wed, 29 Mar 2000 18:15:30 -0600 Message-ID: <000001bf99dd$107ca6d0$345985d0@corecomm.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0001_01BF99AA.C5E3BD70" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0 Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N This is a multi-part message in MIME format. ------=_NextPart_000_0001_01BF99AA.C5E3BD70 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Perhaps it's time for a walk through of the matter, (like people keep saying, code is the meat) so let's take a simple patch, htdigest, which won't compile today anyway. I hope this explains the whys of my approach with a -real world- example. First the project... the primary change is the target config names... Debug -> Standalone Debug Release -> Standalone Release and change some targets to agree with a build/win32 tree... # PROP Output_Dir "../build/win32/release/support/htdigest" # PROP Intermediate_Dir "../build/win32/release/support/htdigest/obj" We change some compiler directives [don't know why /D "_MBCS" was in there in the first place; left it alone] Multithreaded is added to agree with all apr build, and add apr include... # ADD CPP + /MT + /I "../lib/apr/include" For the linker, we kill the list of unused libraries... # ADD LINK32 - user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kill the explicit target now that it _agrees_ with the target path # ADD LINK32 - /out:"release/htdigest.exe" add the libraries that are _actually used... # ADD LINK32 + libcmt.lib oldnames.lib apr.lib ws2_32.lib tell the linker that's all the libraries... # ADD LINK32 + /nodefaultlib add the map output for debugging gp faults and user bug reports... # ADD LINK32 + /map:"../build/win32/release/support/htdigest/htdigest.map" and add the lib path to locate apr.lib, but notice this is NOT the release/apr/dll, but the Standalone Release target of the aprlib I posted yesterday... # ADD LINK32 + /libpath:"../build/win32/release/apr/lib" and last, kill the apr library's targets from this compilation: SOURCE= - ..\ap\ap_cpystrn.c - ..\ap\ap_getpass.c - ..\ap\ap_md5c.c The debug path is similar, I won't waste the bandwidth, nor will I diff the make file, since you can generate one yourself. diff'ing generated makes, I've decided, is a joke. Second, we change the includes for htdigest.c to see apr and apr alone. + "apr.h" "apr_md5.h" "stdlib.h" - "ap_config.h" "ap.h" "ap_md5.h" And third, after applying the apr/aprlib stuff I posted last night, the Makefile.win inherits two new targets. apr - Win32 is needed to build aprlib - Win32, it's the object .lib created by apr.dsp is then bound into the dll by aprlib.dsp. And apr - Win32 Standalone is built for support/ projects, and is never bound to a dll. RECURSE=0 warns the compiler, even when the projects are dependent on each other in the .dsw workspace, that we know what we are doing and will build them ourselves in our own preferred sequence. That's the bigger picture. Notice we DIDN'T add /D APR_IMPORT_DLL to htdigest, since we link to the static apr.lib target. Changes to Apache and the modules are similar to this, but they define the APR_IMPORT_DLL tag to bind to the dynamic aprlib.dll target. Greg suggested that the names Static Debug/Release might be clearer as Standalone Debug/Release, and I have no opinion either way. Thoughts? Regards, Bill ------=_NextPart_000_0001_01BF99AA.C5E3BD70 Content-Type: application/octet-stream; name="htdigest.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="htdigest.diff" Index: apache-2.0/src/support/htdigest.dsp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/apache/apache-2.0/src/support/htdigest.dsp,v retrieving revision 1.2 diff -u -r1.2 htdigest.dsp --- htdigest.dsp 2000/03/21 23:26:49 1.2 +++ htdigest.dsp 2000/03/29 23:24:04 @@ -4,7 +4,7 @@ =20 # TARGTYPE "Win32 (x86) Console Application" 0x0103 =20 -CFG=3Dhtdigest - Win32 Debug +CFG=3Dhtdigest - Win32 Standalone Debug !MESSAGE This is not a valid makefile. To build this project using = NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE=20 @@ -13,13 +13,14 @@ !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE=20 -!MESSAGE NMAKE /f "htdigest.mak" CFG=3D"htdigest - Win32 Debug" +!MESSAGE NMAKE /f "htdigest.mak" CFG=3D"htdigest - Win32 Standalone = Debug" !MESSAGE=20 !MESSAGE Possible choices for configuration are: !MESSAGE=20 -!MESSAGE "htdigest - Win32 Release" (based on\ +!MESSAGE "htdigest - Win32 Standalone Release" (based on\ "Win32 (x86) Console Application") -!MESSAGE "htdigest - Win32 Debug" (based on "Win32 (x86) Console = Application") +!MESSAGE "htdigest - Win32 Standalone Debug" (based on\ + "Win32 (x86) Console Application") !MESSAGE=20 =20 # Begin Project @@ -28,7 +29,7 @@ CPP=3Dcl.exe RSC=3Drc.exe =20 -!IF "$(CFG)" =3D=3D "htdigest - Win32 Release" +!IF "$(CFG)" =3D=3D "htdigest - Win32 Standalone Release" =20 # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 @@ -37,12 +38,12 @@ # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 -# PROP Output_Dir "" -# PROP Intermediate_Dir "" +# PROP Output_Dir "../build/win32/release/support/htdigest" +# PROP Intermediate_Dir "../build/win32/release/support/htdigest/obj" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" = /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /GX /O2 /I "..\include" /D "WIN32" /D "NDEBUG" /D = "_CONSOLE" /D "_MBCS" /FD /c +# ADD CPP /nologo /MT /W3 /GX /O2 /I "../include" /I = "../lib/apr/include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD = /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" @@ -51,10 +52,10 @@ # ADD BSC32 /nologo LINK32=3Dlink.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib = comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib = odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib = comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib = odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 = /out:"release/htdigest.exe" +# ADD LINK32 libcmt.lib oldnames.lib apr.lib kernel32.lib ws2_32.lib = /nologo /subsystem:console = /map:"../build/win32/release/support/htdigest/htdigest.map" = /machine:I386 /nodefaultlib /libpath:"../build/win32/release/apr/lib" # SUBTRACT LINK32 /pdb:none =20 -!ELSEIF "$(CFG)" =3D=3D "htdigest - Win32 Debug" +!ELSEIF "$(CFG)" =3D=3D "htdigest - Win32 Standalone Debug" =20 # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 @@ -63,13 +64,13 @@ # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 -# PROP Output_Dir "" -# PROP Intermediate_Dir "" +# PROP Output_Dir "../build/win32/debug/support/htdigest" +# PROP Intermediate_Dir "../build/win32/debug/support/htdigest/obj" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D = "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "..\include" /D "WIN32" /D = "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c -# SUBTRACT CPP /YX +# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "../include" /I = "../lib/apr/include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD = /c +# SUBTRACT CPP /Fr /YX # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=3Dbscmake.exe @@ -77,26 +78,15 @@ # ADD BSC32 /nologo LINK32=3Dlink.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib = comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib = odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 = /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib = comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib = odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 = /out:"debug/htdigest.exe" /pdbtype:sept +# ADD LINK32 libcmtd.lib oldnames.lib apr.lib kernel32.lib ws2_32.lib = /nologo /subsystem:console /debug /machine:I386 /nodefaultlib = /pdbtype:sept /libpath:"../build/win32/debug/apr/lib" +# SUBTRACT LINK32 /map =20 !ENDIF=20 =20 # Begin Target - -# Name "htdigest - Win32 Release" -# Name "htdigest - Win32 Debug" -# Begin Source File - -SOURCE=3D..\ap\ap_cpystrn.c -# End Source File -# Begin Source File - -SOURCE=3D..\ap\ap_getpass.c -# End Source File -# Begin Source File =20 -SOURCE=3D..\ap\ap_md5c.c -# End Source File +# Name "htdigest - Win32 Standalone Release" +# Name "htdigest - Win32 Standalone Debug" # Begin Source File =20 SOURCE=3D.\htdigest.c Index: apache-2.0/src/support/htdigest.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/apache/apache-2.0/src/support/htdigest.c,v retrieving revision 1.4 diff -u -r1.4 htdigest.c --- htdigest.c 2000/03/10 00:07:36 1.4 +++ htdigest.c 2000/03/29 23:24:05 @@ -66,11 +66,10 @@ * by Alexei Kosut, based on htpasswd.c, by Rob McCool */ =20 +#include "apr.h" #include "apr_lib.h" -#include "ap_config.h" -#include -#include "ap.h" -#include "ap_md5.h" +#include "apr_md5.h" +#include "stdlib.h" #if defined(MPE) || defined(QNX) || defined(WIN32) || defined(__TANDEM) = || defined(BEOS) #include #else @@ -140,7 +139,7 @@ static void add_password(char *user, char *realm, FILE *f) { char *pw; - AP_MD5_CTX context; + APR_MD5_CTX context; unsigned char digest[16]; char string[MAX_STRING_LEN]; char pwin[MAX_STRING_LEN]; Index: apache-2.0/src/Makefile.win =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/apache/apache-2.0/src/Makefile.win,v retrieving revision 1.4 diff -u -r1.4 Makefile.win --- Makefile.win 2000/03/24 04:45:27 1.4 +++ Makefile.win 2000/03/30 00:02:49 @@ -51,7 +51,9 @@ _build: echo Building Win32 $(LONG) targets ($(SHORT) suffixes) cd lib\apr - nmake /nologo CFG=3D"aprlib - Win32 $(LONG)" -f aprlib.mak + nmake /nologo CFG=3D"apr - Win32 $(LONG)" -f apr.mak RECURSE=3D0 + nmake /nologo CFG=3D"aprlib - Win32 $(LONG)" -f aprlib.mak = RECURSE=3D0 + nmake /nologo CFG=3D"apr - Win32 Standalone $(LONG)" -f apr.mak = RECURSE=3D0 cd ..\.. cd regex nmake /nologo CFG=3D"regex - Win32 $(LONG)" -f regex.mak @@ -61,7 +63,7 @@ cd .. cd support nmake /nologo CFG=3D"htpasswd - Win32 $(LONG)" -f htpasswd.mak -# nmake /nologo CFG=3D"htdigest - Win32 $(LONG)" -f htdigest.mak + nmake /nologo CFG=3D"htdigest - Win32 Standalone $(LONG)" -f = htdigest.mak RECURSE=3D0 nmake /nologo CFG=3D"rotatelogs - Win32 $(LONG)" -f rotatelogs.mak cd .. cd main Index: apache-2.0/src/Makefile.win =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/apache/apache-2.0/src/Makefile.win,v retrieving revision 1.4 diff -u -r1.4 Makefile.win --- Makefile.win 2000/03/24 04:45:27 1.4 +++ Makefile.win 2000/03/30 00:10:13 @@ -51,7 +51,9 @@ _build: echo Building Win32 $(LONG) targets ($(SHORT) suffixes) cd lib\apr - nmake /nologo CFG=3D"aprlib - Win32 $(LONG)" -f aprlib.mak + nmake /nologo CFG=3D"apr - Win32 $(LONG)" -f apr.mak RECURSE=3D0 + nmake /nologo CFG=3D"aprlib - Win32 $(LONG)" -f aprlib.mak = RECURSE=3D0 + nmake /nologo CFG=3D"apr - Win32 Standalone $(LONG)" -f apr.mak = RECURSE=3D0 cd ..\.. cd regex nmake /nologo CFG=3D"regex - Win32 $(LONG)" -f regex.mak @@ -61,7 +63,7 @@ cd .. cd support nmake /nologo CFG=3D"htpasswd - Win32 $(LONG)" -f htpasswd.mak -# nmake /nologo CFG=3D"htdigest - Win32 $(LONG)" -f htdigest.mak + nmake /nologo CFG=3D"htdigest - Win32 Standalone $(LONG)" -f = htdigest.mak RECURSE=3D0 nmake /nologo CFG=3D"rotatelogs - Win32 $(LONG)" -f rotatelogs.mak cd .. cd main @@ -114,7 +116,9 @@ =20 _clean: cd lib\apr - nmake /nologo CFG=3D"aprlib - Win32 $(LONG)" -f aprlib.mak clean + nmake /nologo CFG=3D"apr - Win32 $(LONG)" -f apr.mak RECURSE=3D0 = clean + nmake /nologo CFG=3D"aprlib - Win32 $(LONG)" -f aprlib.mak = RECURSE=3D0 clean + nmake /nologo CFG=3D"apr - Win32 Standalone $(LONG)" -f apr.mak = RECURSE=3D0 clean cd ..\.. cd regex nmake /nologo CFG=3D"regex - Win32 $(LONG)" -f regex.mak clean @@ -124,7 +128,7 @@ cd .. cd support nmake /nologo CFG=3D"htpasswd - Win32 $(LONG)" -f htpasswd.mak clean - nmake /nologo CFG=3D"htdigest - Win32 $(LONG)" -f htdigest.mak clean + nmake /nologo CFG=3D"htdigest - Win32 $(LONG)" -f htdigest.mak = RECURSE=3D0 clean nmake /nologo CFG=3D"rotatelogs - Win32 $(LONG)" -f rotatelogs.mak = clean cd .. cd main ------=_NextPart_000_0001_01BF99AA.C5E3BD70--