apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe, Jr." <wr...@rowe-clan.net>
Subject Re: APR nmake makefiles
Date Mon, 27 Jun 2005 18:37:37 GMT
Mladen;

  I'd prefer you don't commit this, *yet*.  I agree the build
system needs refactoring.  But also believe that more cruft in
the tree will only confuse users.  And your specific solution
does not lend itself to being maintained, particularly by the
unix hackers in the room :-/

  Question; do we want to adopt (finish adopting) svn's build
system coded in python?  If we can get to a point where .dsp,
nmake files, and all the rest can even be generated on unix
(still, a dos-style .zip thrown up on /dist/apr/), this would
all be goodness.

  I won't have time in the July, but if anyone wants to offer
this up with some docs, I think we could move in that direction.
Especially since I'm much more irritiated by the new python
dependency of unix than I would be for win32.

  So I'll either devote energy to stripping back out all 
the bogus python dependencies in building from svn on unix 
(an obstacle to the non-penguin world), or stack on more 
dependencies on python for win32 :-)

Bill


At 01:07 PM 6/27/2005, Mladen Turk wrote:
>Hi,
>
>Here is a small contribution to the APR that enables
>one to use the Platform SDK to build the APR.
>
>The invocation is quite simple:
>nmake -f NMAKEmakefile DLL=1 DEBUG=1
>
>Will build the DLL library version of APR.
>Depending on the CPU it will be build inside:
>WINNT_I386_DLL_DEBUG
>or..
>WINNT_AMD64_DLL_DEBUG
>
>I know it's different from standard Debug/Lib directories,
>but it gives more options and different CPU/ARCH targets
>without the need to kill yourself with backups and
>launching 'msdev /usenenv' all the time :).
>
>One other option is to use the TARGETOS
>nmake -f NMAKEmakefile DLL=1 DEBUG=1 TARGETOS=WIN9X
>will build the
>WIN9X_I386_DLL_DEBUG target.
>
>Is this make sense?
>I don't wish to commit anything useless.
>If It does, I plan to do the same for apr-util and iconv.
>
>Regards,
>Mladen.
>
>
># Copyright 2001-2005 The Apache Software Foundation or its licensors, as
># applicable.
>#
># Licensed under the Apache License, Version 2.0 (the "License");
># you may not use this file except in compliance with the License.
># You may obtain a copy of the License at
>#
>#     http://www.apache.org/licenses/LICENSE-2.0
>#
># Unless required by applicable law or agreed to in writing, software
># distributed under the License is distributed on an "AS IS" BASIS,
># WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
># See the License for the specific language governing permissions and
># limitations under the License.
>#
># ====================================================================
>#
># NMAKEcommon.inc Master makefile definitions.
>#                 This file defines CPU architecture and basic compiler
>#                 and linker parameters.
># Common params:
>#                 CPU       Compile for specified CPU. Supported CPU's are:
>#                           i386
>#                           AMD64
>#                           IA64
>#                           If not specified it will default to the
>#                           PROCESSOR_ARCHITECTURE environment variable
>#                           or to the i386 if not specified.
>#                 TARGETOS  Compile for specified Windows version
>#                           WINNT   for Windows 2000 and up(default)
>#                           WINXP   for Windows XP and up
>#                           WIN2003 for Windows 2003 and up
>#                           Deprecated targets (may not even compile):
>#                               NT4     for Windows NT4 and up
>#                               WIN9X   for Windows 95, 98 and Me
>#                 CONFIG    Build configuration
>#                           RETAIL or RELEASE (default)
>#                           DEBUG
>#                 TARGET    Build application target
>#                           EXE Console executable (default)
>#                           GUI Windows GUI executable
>#                           DLL Dynamic Link Library
>#                           LIB Static library
># Environment variables  used:
>#                 CFLAGS    Added to the common CFLAGS
>#                 CPPFLAGS  Added to the common CPPFLAGS
>#                 LIBS      Added to the common LIBS
>#                 INCLUDES  Added to the common INCLUDES
>#
># Originally contributed by Mladen Turk <mturk jboss.com>
>#
># ====================================================================
>#
>
>!IF !DEFINED(CC) || "$(CC)" == ""
>CC = cl.exe
>!ENDIF
>
>!IF !DEFINED(LINK) || "$(LINK)" == ""
>LINK = link.exe
>!ENDIF
>
>!IF !DEFINED(RC) || "$(RC)" == ""
>RC = rc.exe
>!ENDIF
>
># Read the PROCESSOR_ARCHITECTURE environment value for a CPU type
>
>!IF !DEFINED(CPU) || "$(CPU)" == ""
>!IF "$(PROCESSOR_ARCHITECTURE)" == ""
>CPU=I386
>!ELSE
>CPU = $(PROCESSOR_ARCHITECTURE)
>!ENDIF
>!ENDIF
>
>!IF "$(CPU)" == "i386"
>CPU=I386
>!ENDIF
>
>!IF "$(CPU)" == "x86"
>CPU=I386
>!ENDIF
>
>!IF "$(CPU)" != "I386"
>!IF "$(CPU)" != "AMD64"
>!IF "$(CPU)" != "IA64"
>!ERROR Must specify CPU environment variable (I386, AMD64, IA64)
>!ENDIF
>!ENDIF
>!ENDIF
>
>!IF !DEFINED(TARGET) || "$(TARGET)" == ""
>TARGET=EXE
>!ENDIF
>
>!IF "$(TARGET)" != "EXE"
>!IF "$(TARGET)" != "GUI"
>!IF "$(TARGET)" != "DLL"
>!IF "$(TARGET)" != "LIB"
>!ERROR Must specify TARGET environment variable (EXE, GUI, DLL, LIB)
>!ENDIF
>!ENDIF
>!ENDIF
>!ENDIF
>
>!IF !DEFINED(TARGETOS) || "$(TARGETOS)" == ""
>TARGETOS=WINNT
>!ENDIF
>
>
>!IF "$(TARGETOS)" != "WINNT"
>!IF "$(TARGETOS)" != "WINXP"
>!IF "$(TARGETOS)" != "WIN2003"
>!IF "$(TARGETOS)" != "NT4"
>!IF "$(TARGETOS)" != "WIN9X"
>!ERROR Must specify TARGETOS environment variable (WINNT, WINXP, WIN2003, NT4, WIN9X)
>!ENDIF
>!ENDIF
>!ENDIF
>!ENDIF
>!ENDIF
>
>!IF "$(TARGETOS)" == "WINNT"
>NMAKE_WINVER = 0x0500
>!ELSEIF "$(TARGETOS)" == "WINXP"
>NMAKE_WINVER = 0x0501
>!ELSEIF "$(TARGETOS)" == "WIN2003"
>NMAKE_WINVER = 0x0502
>!ELSEIF "$(TARGETOS)" == "NT4"
>NMAKE_WINVER = 0x0400
>!ENDIF
>
>!IF !DEFINED(NMAKE_WINVER) || "$(NMAKE_WINVER)" == ""
>NMAKE_WINVER = 0x0400
>NMAKE_WINNT  = -D_WIN95 -D_WIN32_WINDOWS=$(NMAKE_WINVER)
>!ELSE
>NMAKE_WINNT  = -D_WINNT -D_WIN32_WINNT=$(NMAKE_WINVER)
>!ENDIF
>
>!IF !DEFINED(CONFIG) || "$(CONFIG)" == ""
>CONFIG=RELEASE
>!ENDIF
>
>!IFDEF RELEASE
>CONFIG=RELEASE
>!ENDIF
>
>!IFDEF DEBUG
>CONFIG=DEBUG
>!ENDIF
>
>!IFDEF NODEBUG
>CONFIG=RELEASE
>!ENDIF
>
>!IF "$(CONFIG)" != "RELEASE"
>!IF "$(CONFIG)" != "DEBUG"
>!ERROR Must specify CONFIG environment variable (RELEASE, DEBUG)
>!ENDIF
>!ENDIF
>
># Common flags for all platforms
>CMN_CFLAGS =  -c -nologo -DWIN32 -D_WIN32 -D_WINDOWS $(NMAKE_WINNT)
>
>!IF "$(CPU)" == "I386"
>CPU_CFLAGS = -D_X86_=1 -W3
>!ELSEIF "$(CPU)" == "AMD64"
>CPU_CFLAGS = -D_AMD64_=1 -DWIN64 -D_WIN64 -Wp64 -W3 /FIPRE64PRA.H
>!ELSEIF "$(CPU)" == "IA64"
>CPU_CFLAGS = -D_IA64_=1 -DWIN64 -D_WIN64 -Wp64 -W3 -Ap64 /FIPRE64PRA.H
>!ENDIF
>
>!IF "$(CONFIG)" == "RELEASE"
>OPT_CFLAGS = -O2 -Oy- -Zi -DNDEBUG
>!ELSE
>OPT_CFLAGS = -Od -Zi -DDEBUG -D_DEBUG
>!ENDIF
>
>!IF "$(CONFIG)" == "RELEASE"
>CRT_CFLAGS = -D_MT -MD
>!ELSE
>CRT_CFLAGS = -D_MT -MDd
>!ENDIF
>
>CFLAGS = $(CMN_CFLAGS) $(CPU_CFLAGS) $(OPT_CFLAGS) $(CRT_CFLAGS) $(CFLAGS)
>
>!IF DEFINED(EXTRA_CFLAGS)
>CFLAGS = $(CFLAGS) $(EXTRA_CFLAGS)
>!ENDIF
>
>
># Linker section
>LIBS = kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib
$(LIBS)
>!IF "$(CPU)" == "AMD64" || "$(CPU)" == "IA64"
>LIBS = $(LIBS) bufferoverflowu.lib 
>!ENDIF
>
>!IF DEFINED(EXTRA_LIBS)
>LIBS = $(LIBS) $(EXTRA_LIBS)
>!ENDIF
>
>COMMON_LFLAGS = /NOLOGO
>
># Always add debugging to the linker
>OPT_LFLAGS = /INCREMENTAL:NO /DEBUG
>!IF "$(CONFIG)" == "RELEASE"
>OPT_LFLAGS = /OPT:REF
>!ENDIF
>
>!IF "$(TARGET)" == "EXE"
>LFLAGS = $(COMMON_LFLAGS) /SUBSYSTEM:CONSOLE /MACHINE:$(CPU)
>!ELSEIF "$(TARGET)" == "GUI"
>LFLAGS = $(COMMON_LFLAGS) /SUBSYSTEM:WINDOWS /MACHINE:$(CPU)
>!ELSEIF "$(TARGET)" == "DLL"
>LFLAGS = $(COMMON_LFLAGS) /DLL /SUBSYSTEM:WINDOWS /MACHINE:$(CPU)
>!ELSEIF "$(TARGET)" == "LIB"
>LFLAGS = -lib $(COMMON_LFLAGS)
>!ENDIF
>
>!IF DEFINED(EXTRA_LFLAGS)
>LFLAGS = $(LFLAGS) $(EXTRA_LFLAGS)
>!ENDIF
>
>!IF "$(TARGET)" != "LIB"
>LFLAGS = $(LFLAGS) $(OPT_LFLAGS)
>!ENDIF
>
># Resource compiler flags
>
>BASE_RCFLAGS=/l 0x409
>!IF "$(CONFIG)" == "RELEASE"
>BASE_RCFLAGS = $(BASE_RCFLAGS) /d "NDEBUG"
>!ELSE
>BASE_RCFLAGS = $(BASE_RCFLAGS) /d "_DEBUG" /d "DEBUG"
>!ENDIF
>RCFLAGS = $(BASE_RCFLAGS) $(RCFLAGS)
>
># Build Target dir e.g. WINNT_I386_RELEASE_DLL
>BUILDIR = $(TARGETOS)_$(CPU)_$(TARGET)_$(CONFIG)
>
>!IF "$(OS)" == "Windows_NT"
>CLEANTARGET=if exist "$(BUILDIR)/$(NULL)" rd /s /q $(BUILDIR)
>!ELSE
>CLEANTARGET=deltree /y $(BUILDIR)
>!ENDIF
>
>MAKETARGET=if not exist "$(BUILDIR)/$(NULL)" mkdir $(BUILDIR)
>
># Copyright 2001-2005 The Apache Software Foundation or its licensors, as
># applicable.
>#
># Licensed under the Apache License, Version 2.0 (the "License");
># you may not use this file except in compliance with the License.
># You may obtain a copy of the License at
>#
>#     http://www.apache.org/licenses/LICENSE-2.0
>#
># Unless required by applicable law or agreed to in writing, software
># distributed under the License is distributed on an "AS IS" BASIS,
># WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
># See the License for the specific language governing permissions and
># limitations under the License.
>#
># ====================================================================
>#
># NMAKEmakefile   Master APR makefile.
># Usage:
>#                 DLL=1     Build DLL version
>#                 DEBUG=1   Build DEBUG version of APR
>#
># Originally contributed by Mladen Turk <mturk jboss.com>
>#
># ====================================================================
>#
>
>!IFDEF DLL
>CFLAGS = -DAPR_DECLARE_EXPORT $(CFLAGS)
>TARGET = DLL
>!ELSE
>CFLAGS = -DAPR_DECLARE_STATIC $(CFLAGS)
>TARGET = LIB
>!ENDIF
>!include <build/NMAKEcommon.inc>
>
>INCLUDES = -I./include -I./include/arch -I./include/arch/win32 -I./include/arch/unix
>PDBFLAGS = -Fo$(BUILDIR)\ -Fd$(BUILDIR)\apr_src
>OBJECTS = \
>        $(BUILDIR)\apr_atomic.obj \
>        $(BUILDIR)\dso.obj \
>        $(BUILDIR)\copy.obj \
>        $(BUILDIR)\dir.obj \
>        $(BUILDIR)\fileacc.obj \
>        $(BUILDIR)\filedup.obj \
>        $(BUILDIR)\filepath.obj \
>        $(BUILDIR)\filepath_util.obj \
>        $(BUILDIR)\filestat.obj \
>        $(BUILDIR)\filesys.obj \
>        $(BUILDIR)\flock.obj \
>        $(BUILDIR)\fullrw.obj \
>        $(BUILDIR)\mktemp.obj \
>        $(BUILDIR)\open.obj \
>        $(BUILDIR)\pipe.obj \
>        $(BUILDIR)\readwrite.obj \
>        $(BUILDIR)\seek.obj \
>        $(BUILDIR)\tempdir.obj \
>        $(BUILDIR)\proc_mutex.obj \
>        $(BUILDIR)\thread_cond.obj \
>        $(BUILDIR)\thread_mutex.obj \
>        $(BUILDIR)\thread_rwlock.obj \
>        $(BUILDIR)\apr_pools.obj \
>        $(BUILDIR)\charset.obj \
>        $(BUILDIR)\env.obj \
>        $(BUILDIR)\errorcodes.obj \
>        $(BUILDIR)\getopt.obj \
>        $(BUILDIR)\internal.obj \
>        $(BUILDIR)\misc.obj \
>        $(BUILDIR)\otherchild.obj \
>        $(BUILDIR)\rand.obj \
>        $(BUILDIR)\start.obj \
>        $(BUILDIR)\utf8.obj \
>        $(BUILDIR)\version.obj \
>        $(BUILDIR)\common.obj \
>        $(BUILDIR)\mmap.obj \
>        $(BUILDIR)\inet_ntop.obj \
>        $(BUILDIR)\inet_pton.obj \
>        $(BUILDIR)\select.obj \
>        $(BUILDIR)\multicast.obj \
>        $(BUILDIR)\sendrecv.obj \
>        $(BUILDIR)\sockaddr.obj \
>        $(BUILDIR)\sockets.obj \
>        $(BUILDIR)\sockopt.obj \
>        $(BUILDIR)\apr_getpass.obj \
>        $(BUILDIR)\apr_random.obj \
>        $(BUILDIR)\sha2.obj \
>        $(BUILDIR)\sha2_glue.obj \
>        $(BUILDIR)\shm.obj \
>        $(BUILDIR)\apr_cpystrn.obj \
>        $(BUILDIR)\apr_fnmatch.obj \
>        $(BUILDIR)\apr_snprintf.obj \
>        $(BUILDIR)\apr_strings.obj \
>        $(BUILDIR)\apr_strnatcmp.obj \
>        $(BUILDIR)\apr_strtok.obj \
>        $(BUILDIR)\apr_hash.obj \
>        $(BUILDIR)\apr_tables.obj \
>        $(BUILDIR)\proc.obj \
>        $(BUILDIR)\signals.obj \
>        $(BUILDIR)\thread.obj \
>        $(BUILDIR)\threadpriv.obj \
>        $(BUILDIR)\access.obj \
>        $(BUILDIR)\time.obj \
>        $(BUILDIR)\timestr.obj \
>        $(BUILDIR)\groupinfo.obj \
>        $(BUILDIR)\userinfo.obj
>
>
>!IFDEF DLL
>BUILDLIB = $(BUILDIR)\libapr-1.dll
>BUILDPDB = $(BUILDIR)\libapr-1.pdb
>BUILDRES = $(BUILDIR)\libapr-1.res
>!ELSE
>BUILDLIB = $(BUILDIR)\apr-1.lib
>!ENDIF
>
>all : $(BUILDIR) $(BUILDLIB) 
>
>$(BUILDIR) :
>        @$(MAKETARGET)
>
>{./atomic/win32}.c{$(BUILDIR)}.obj:
>        $(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $<
>
>{./dso/win32}.c{$(BUILDIR)}.obj:
>        $(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $<
>
>{./file_io/unix}.c{$(BUILDIR)}.obj:
>        $(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $<
>
>{./file_io/win32}.c{$(BUILDIR)}.obj:
>        $(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $<
>
>{./locks/win32}.c{$(BUILDIR)}.obj:
>        $(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $<
>
>{./memory/unix}.c{$(BUILDIR)}.obj:
>        $(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $<
>
>{./misc/unix}.c{$(BUILDIR)}.obj:
>        $(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $<
>
>{./misc/win32}.c{$(BUILDIR)}.obj:
>        $(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $<
>
>{./mmap/unix}.c{$(BUILDIR)}.obj:
>        $(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $<
>
>{./mmap/win32}.c{$(BUILDIR)}.obj:
>        $(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $<
>
>{./network_io/unix}.c{$(BUILDIR)}.obj:
>        $(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $<
>
>{./network_io/win32}.c{$(BUILDIR)}.obj:
>        $(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $<
>
>{./passwd}.c{$(BUILDIR)}.obj:
>        $(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $<
>
>{./poll/unix}.c{$(BUILDIR)}.obj:
>        $(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $<
>
>{./random/unix}.c{$(BUILDIR)}.obj:
>        $(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $<
>
>{./shmem/win32}.c{$(BUILDIR)}.obj:
>        $(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $<
>
>{./strings}.c{$(BUILDIR)}.obj:
>        $(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $<
>
>{./tables}.c{$(BUILDIR)}.obj:
>        $(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $<
>
>{./threadproc/win32}.c{$(BUILDIR)}.obj:
>        $(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $<
>
>{./time/win32}.c{$(BUILDIR)}.obj:
>        $(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $<
>
>{./user/win32}.c{$(BUILDIR)}.obj:
>        $(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $<
>
>$(OBJECTS): ./include/*.h ./include/arch/*.h ./include/arch/win32/*.h ./include/arch/unix/*.h
>
>!IFDEF DLL
>$(BUILDRES): libapr.rc ./include/*.h 
>        $(RC) $(RCFLAGS) /i "./include" /d "APR_VERSION_ONLY" /fo $(BUILDRES) libapr.rc
>$(BUILDLIB): $(BUILDIR) $(OBJECTS) $(BUILDRES)
>        $(LINK) $(LFLAGS) $(OBJECTS) $(BUILDRES) $(LIBS) /pdb:$(BUILDPDB) /out:$(BUILDLIB)
>!ELSE
>$(BUILDLIB): $(BUILDIR) $(OBJECTS)
>        $(LINK) $(LFLAGS) $(OBJECTS) /out:$(BUILDLIB)
>!ENDIF
>
>clean:
>        @$(CLEANTARGET)



Mime
View raw message