# httpd-dev mailing list archives

##### Site index · List index
Message view
Top
Subject re: another attempt at one makefile for all Win32 compilations
Date Mon, 20 Mar 2000 02:45:12 GMT

From: Jeff Trawick <trawickj@bellsouth.net>

> This has the same user interface as the old Makefile.nt (i.e., specify the
> same targets as before and magic will happen).
>
> Can someone try this on NT/Win2K and/or with VC++ 6.0?  It works fine
> for me with Win98 SE + VC++ 5.0.
>
> Still to do...

Alright here are my thoughts on the 2.0 Windows makefile (just forget altogether 1.3 though
a remake of the makefile for it will help since support will be around for a long time).

Try all this on NT/Win2k/Win98/Win95.

Name it makefile.win not makefile.nt and include all Windows for now - maybe later even service
pack defines. :)

All make programs are different (from company to company and sometimes year to year) so perhaps
Apache should use Mingw32 (www.mingw.org) make.exe (it's a GNU pure Win32 - no added Unix-like
DLLs) make.exe (source and all). Needs testing - defaults to Win32 gcc.exe for compiler etc.
Uses no cygwin.dll (fake Unix on Windows stuff to confuse Windows people - no different paths
and terms to start with. :) Though it is written mostly by Unix/Windows programmers so there
might be path confusion issue - but there is source to check on it all.

Yes VC people can still use their IDE and Borland people can still use their IDE and LCCWIN
people can still use their IDE and so on but all Apache Win users should use the same make
perhaps Mingw Windows GNU make.exe when calling make.exe -fmakefile.win on the commandline.
(All different compilers/tools should work with a few defines in the makefile.)

See just like Unix - a Windows (with no Unix stuff) GNU comparable make.exe. This way even
the Unix people can help Windows people do the defines/rules/etc. properly for GNU make.exe
Windows version. I have seen version 3.77 - maybe a newer version is even out there.  Or since
Borland's make is free - use it for Apache - just default to a free one for all Windows developers.
But Borland's is free today (no source) but tomorrow who knows what will happen with the tools.
So maybe something like Mingw GNU is better.

It's at www.mingw.org  (a GNU Win32 non Unix compiler and tools - adding Win32 azh/bash/sid/whatever
and (other Unix ports to Win32 - using only the MS DLLs) and etc. but Windows people wishing
to compile Apache right now don't need any of this to confuse them. Just use the same make.exe
and add a little bit of tools at a time!  There are even Windows help files (.hlp) on the
net for this make and other tools out there.

Another great tool at www.mingw.org (a GNU open source Win32 tools development place) is redir.exe
(and source).  This catches the error stream and output stream to files when called on the
commandline.  For Win9x they can compile Apache like this:

redir -e make-err.txt -o make-out.txt make.exe -f makefile.win

(use your make Nmake.exe or whatever - Win9x works best by defining defines via a bat file
first instead of on the commandline when using redir.exe or at anytime).

and have a nice list of errors and a nice list of output statements and not wonder where they
all went because for years us Windows people thought we made no errors. :)

In the meantime for Win9x try this:

Leave the set LONG=Release etc. stuff in or comment it out. Try it with all OSs. If it does
nothing then below might help.  I like the word CC_MODE instead of LONG. But really for Win9x
use a bat file first to define environment variables used in any program.

_release:
set LONG=Release

# Need some command. Use dummy echo command.
@echo Checking/setting on a compile mode Release setup.
!IF "$(LONG)" == "" && "$(LONG)" != "Release"
LONG = Release
!MESSAGE You may want to see win-make.txt and apsetup.bat for more information.
!ENDIF

_debug:
set LONG=Debug

# Need some command. Use dummy echo command.
@echo Checking/setting on a compile mode Debug setup.
!IF "$(LONG)" == "" && "$(LONG)" != "Debug"
LONG = Debug
!MESSAGE You may want to see win-make.txt and apsetup.bat for more information.
!ENDIF

If you really want to you can also add something like the above for SHORT too. I would comment
out the set LONG=Release for Win9x and etc. since the if catches some errors but the real
way for Win9x is a bat file before calling make if you want to use environment varables and
%LONG% is an environment variable. An DEV_OS define would be helpful too for using set on
NT/W2k and not Win9x.

Then later on all keep or change CFG="ApacheOS - Win32 %LONG%"  to CFG="ApacheOS - Win32 \$(LONG)"
and it will work on any Windows OS or shell - opps never say any or never. ;) Here we have
switched to a make define if the use of a complete environment define is not available. But
if the environment define is made before calling Make.exe then the environment variable define
will be used in the Make.exe unless Make.exe redefines it.  So the best way to define enviroment
variables for good old Win9x is a bat file before calling Make.exe. Then in the same console/window
Each console/window will have different enviroment variables defined.

Apache needs a Windows apsetup.bat and a Windows information file like win-make.txt a file
with info on paths to products and what defines are used and what they really mean. I wish
I had this - is there a list somewhere?

rem ---------- win-make.txt -------

Info on setting up paths to compilers.
Web address for products.
Make.exe info.
C_MODE=Release   this means a none debug version.
C_MODE=Debug      adds debug infro to files.
CC=cl.exe                  CC means compiler here it is set to Microsoft's any version.
CC=bcc32.exe          CC means compiler here it is set for Borland's 5.5.
AP_VERSION=2.0a1   AP_VERSION is what Apache Server version being made.
DEV_OS=98            DEV_OS is set to making the server via Win98 OS. Can be
used for running OS commands in make.
RUN_OS=95            RUN_OS means the server will run on Win95 OS.
CFLAGS=                All compiler options - whether Release or Debug.

/YX                           Microsoft's compiler meaning  automates precomiled headers.
-H                             BCC 5.5 compiler meaning automates precompiled headers.
-?                              Mingw32 - not sure it uses precompiled headers (yet)

others etc.

What the Windows OS defines are      WIN95=???    WIN98=???
Import/export info (real dll usage info).
Precompiled headers info - yes it needs to be put back in.
What Apache Server defines. They are all over the place.
What is the 2.0 Apache Windows server idea/style -
One process and main thread calling other threads
Muti processes - mutil threads.
One process calls another process.
One process calls another process with multi threads.
Console mode only or Winmain (a window) that also calls a console for the server.
etc.  Explain what way and why.
Any other needed/desired info.

None of the above needs to be really a long story for now but some general info on all this
is needed right away.

rem ---------- end of win-make.txt ---------

rem ------- APSETUP.BAT ------
@echo Setting up envrionment variables for compiling Apache Server Win32 Version.
@echo Please make sure you have your path set to the location of these products below.
@echo If you need more information see win-make.txt.

Rem remove the rem in front of the version you WANT to run
Rem add the rem in front of the version you do NOT want to run

Rem define compiler used.
REM Borland's 5.5 below
Rem set CC= bcc32.exe

Rem Microsoft below
set CC=cl.exe

Rem LCCWin below
Rem set CC=lccwin.exe

Rem Mingw32 below
Rem set CC=gcc.exe

Rem Cygwin below (A bit of Unix mixed with a lot of bits of Windows)
Rem set CC=whatever  There is a Cygwin Windows Apache version out there now.

Rem add more compilers here
Rem Watcom, etc.

Rem setup compile mode - debug or no debug (called Release)

Rem Release mode
set LONG=Release

Rem Debug mode
Rem set LONG=Debug

Rem List other sets need below.

Rem all done defining needed environment varables for developing Apache Server
@echo Apache Server Windows environment variables are now set for make.exe
@echo If path\to\compiler and other make tools has not been set see win-make.txt.
@echo If path\tocompiler and other make tools has been set then type:
@echo make.exe -f makefile.win

rem ------------ end of apsetup.bat -----------

Other ideas later if you want 'em. Maybe even if you don't ;)
JLW


Mime
View raw message