httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe, Jr." <>
Subject [patch 2.0] htdigest Linkage mechanisims
Date Thu, 30 Mar 2000 00:15:30 GMT
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/"

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
  # 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" <sys/types.h> "ap.h" "ap_md5.h"

And third, after applying the apr/aprlib stuff I posted last night, the 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

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?



View raw message