From 7752c2db540a9964268fb4280fd50bce2e495dce Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Thu, 3 Nov 2005 14:45:15 +0000 Subject: [PATCH] Added makefile for MS VS. Compiles OK for Visual Studio 2003 / 7.1. We still need to properly port the thread_pool_observer object _ due to the use of UNIX pipes. --- src/filter.hpp | 3 +- src/filter_backend_test.cpp | 4 +- src/filter_virt_db.cpp | 4 +- src/filter_z3950_client.cpp | 3 +- src/router.hpp | 3 +- win/makefile | 301 +++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 313 insertions(+), 5 deletions(-) create mode 100644 win/makefile diff --git a/src/filter.hpp b/src/filter.hpp index 92a2392..29f5216 100644 --- a/src/filter.hpp +++ b/src/filter.hpp @@ -1,4 +1,4 @@ -/* $Id: filter.hpp,v 1.8 2005-10-31 09:40:18 marc Exp $ +/* $Id: filter.hpp,v 1.9 2005-11-03 14:45:15 adam Exp $ Copyright (c) 2005, Index Data. %LICENSE% @@ -7,6 +7,7 @@ #ifndef FILTER_HPP #define FILTER_HPP +#include #include #include diff --git a/src/filter_backend_test.cpp b/src/filter_backend_test.cpp index 998e69e..737ffd2 100644 --- a/src/filter_backend_test.cpp +++ b/src/filter_backend_test.cpp @@ -1,4 +1,4 @@ -/* $Id: filter_backend_test.cpp,v 1.8 2005-10-30 18:51:20 adam Exp $ +/* $Id: filter_backend_test.cpp,v 1.9 2005-11-03 14:45:16 adam Exp $ Copyright (c) 2005, Index Data. %LICENSE% @@ -42,6 +42,8 @@ namespace yp2 { } } +using namespace yp2; + yf::Backend_test::Backend_test() : m_p(new Backend_test::Rep) { m_p->m_support_named_result_sets = false; } diff --git a/src/filter_virt_db.cpp b/src/filter_virt_db.cpp index f39b4f5..4190cfa 100644 --- a/src/filter_virt_db.cpp +++ b/src/filter_virt_db.cpp @@ -1,4 +1,4 @@ -/* $Id: filter_virt_db.cpp,v 1.12 2005-10-30 18:51:20 adam Exp $ +/* $Id: filter_virt_db.cpp,v 1.13 2005-11-03 14:45:16 adam Exp $ Copyright (c) 2005, Index Data. %LICENSE% @@ -69,6 +69,8 @@ namespace yp2 { } } +using namespace yp2; + yf::Virt_db_set::Virt_db_set(yp2::Session &id, std::string setname, std::string vhost, bool named_result_sets) : m_backend_session(id), m_backend_setname(setname), m_vhost(vhost), diff --git a/src/filter_z3950_client.cpp b/src/filter_z3950_client.cpp index b3aae8d..190275b 100644 --- a/src/filter_z3950_client.cpp +++ b/src/filter_z3950_client.cpp @@ -1,4 +1,4 @@ -/* $Id: filter_z3950_client.cpp,v 1.9 2005-10-30 18:51:21 adam Exp $ +/* $Id: filter_z3950_client.cpp,v 1.10 2005-11-03 14:45:16 adam Exp $ Copyright (c) 2005, Index Data. %LICENSE% @@ -70,6 +70,7 @@ namespace yp2 { } } +using namespace yp2; yf::Z3950Client::Assoc::Assoc(yazpp_1::SocketManager *socket_manager, yazpp_1::IPDU_Observable *PDU_Observable, diff --git a/src/router.hpp b/src/router.hpp index aae892c..38f1ae8 100644 --- a/src/router.hpp +++ b/src/router.hpp @@ -1,4 +1,4 @@ -/* $Id: router.hpp,v 1.4 2005-10-26 10:21:03 marc Exp $ +/* $Id: router.hpp,v 1.5 2005-11-03 14:45:16 adam Exp $ Copyright (c) 2005, Index Data. %LICENSE% @@ -7,6 +7,7 @@ #ifndef ROUTER_HPP #define ROUTER_HPP +#include #include #include diff --git a/win/makefile b/win/makefile new file mode 100644 index 0000000..238fe39 --- /dev/null +++ b/win/makefile @@ -0,0 +1,301 @@ +# Copyright (C) 2005, Index Data ApS +# All rights reserved. +# $Id: makefile,v 1.1 2005-11-03 14:45:16 adam Exp $ + +# MS NMAKE makefile for yp2 + +# Parameters that we customize often. +DEBUG=0 # 0 for release, 1 for debug + +# YAZ and YAZ++ directories +YAZ_DIR=..\..\yaz +YAZPP_DIR=..\..\yaz++ + +# Boost +BOOST=\boost +BOOSTVER=1_33 + +# libxml2 + libxslt + associates +ZLIB_DIR=\zlib-1.2.3.win32 +ICONV_DIR=\iconv-1.9.1.win32 +LIBXML2_DIR=\libxml2-2.6.20.win32 +LIBXSLT_DIR=\libxslt-1.1.14.win32 + +# The targets + +default: all + +all: dirs config yaz yazpp libxslt dll progs + +progs: ex_libxml2_conf + +NSIS="c:\program files\nsis\makensis.exe" + +nsis: all + $(NSIS) yp2.nsi + +# Directories +# The current directory is supposed to be something like +# ..../yaz/win, everything is relative to that +ROOTDIR=.. # The home of our project + +INCLDIR=$(ROOTDIR)\include # our includes +LIBDIR=$(ROOTDIR)\lib # We produce .lib, .exp etc there +BINDIR=$(ROOTDIR)\bin # We produce exes and dlls there +WINDIR=$(ROOTDIR)\win # all these Win make things +OBJDIR=$(WINDIR)\obj # where we store intermediate files +SRCDIR=$(ROOTDIR)\src # for the case we move them under src + +TMPDIR=$(ROOTDIR)\win\tmp +TMP=$(TMPDIR) + +########################################################### +############### Targets - what to make +########################################################### + +PROJECT_DLL=$(BINDIR)\yp2.dll +PROJECT_IMPLIB=$(LIBDIR)\yp2.lib +EX_FILTER_FRONTEND_NET=$(BINDIR)\ex_filter_frontend_net.exe +EX_LIBXML2_CONF=$(BINDIR)\ex_libxml2_conf.exe + +# shortcut names defined here +dll: $(PROJECT_DLL) +ex_filter_frontend_net: $(EX_FILTER_FRONTEND_NET) +ex_libxml2_conf: $(EX_LIBXML2_CONF) + +########################################################### +############### Compiler and linker options +########################################################### + +# YAZ includes & libs +YAZ_LIB="$(YAZ_DIR)\lib\yaz.lib" +YAZ_DEF=/DYAZ_USE_NEW_LOG=1 /I"$(YAZ_DIR)\include" + +# Copy yaz.dll to our bin +yaz: $(BINDIR)\yaz.dll +$(BINDIR)\yaz.dll: $(YAZ_DIR)\bin\yaz.dll + copy "$(YAZ_DIR)\bin\yaz.dll" $(BINDIR) + +# YAZ++ includes & libs +YAZPP_LIB="$(YAZPP_DIR)\lib\yazpp.lib" +YAZPP_DEF=/I"$(YAZPP_DIR)\include" + +# Copy yazpp.dll to our bin +yazpp: $(BINDIR)\yazpp.dll +$(BINDIR)\yazpp.dll: $(YAZPP_DIR)\bin\yazpp.dll + copy "$(YAZPP_DIR)\bin\yazpp.dll" $(BINDIR) + +# Copy libxslt and associates to our bin directory +libxslt: $(BINDIR)\libxslt.dll + +$(BINDIR)\libxslt.dll: $(LIBXSLT_DIR)\bin\libxslt.dll + copy $(ICONV_DIR)\bin\iconv.dll $(BINDIR) + copy $(LIBXML2_DIR)\bin\libxml2.dll $(BINDIR) + copy $(LIBXSLT_DIR)\bin\libxslt.dll $(BINDIR) + +config: $(SRCDIR)\config.hpp + +$(SRCDIR)\config.hpp: + echo /*windows*/ >$(SRCDIR)\config.hpp + +# Boost +# +BOOST_DEF = /I"$(BOOST)\include\boost-$(BOOSTVER)" +BOOST_LIB = \ + "$(BOOST)\lib\libboost_date_time-vc71-mt-$(BOOSTVER).lib" \ + "$(BOOST)\lib\libboost_program_options-vc71-mt-$(BOOSTVER).lib" \ + "$(BOOST)\lib\libboost_thread-vc71-mt-$(BOOSTVER).lib" + + +LIBXSLT_DEF = \ + /I"$(ICONV_DIR)\include" \ + /I"$(LIBXML2_DIR)\include" \ + /I"$(LIBXSLT_DIR)\include" + +LIBXSLT_LIB = \ + "$(ICONV_DIR)\lib\iconv.lib" \ + "$(LIBXML2_DIR)\lib\libxml2.lib" \ + "$(LIBXSLT_DIR)\lib\libxslt.lib" + +COMMON_C_OPTIONS= \ + /nologo /W3 /GX /FD /c \ + $(YAZ_DEF) \ + $(YAZPP_DEF) \ + $(BOOST_DEF) \ + $(LIBXSLT_DEF) \ + /D "_WINDOWS" \ + /D "WIN32" \ + /D "HAVE_WCHAR_H=1" \ + /EHsc \ + /FR"$(OBJDIR)\\" \ + /Fo"$(OBJDIR)\\" \ + /Fd"$(OBJDIR)\\" \ + /I"$(ROOTDIR)\include" + +DEBUG_C_OPTIONS= \ + /D "_DEBUG" \ + /MDd /Od /YX /Zi /Gm + +RELEASE_C_OPTIONS= \ + /D "NDEBUG" \ + /MD /O2 + +# /W3 = warning level +# /GX = Enable exception handling +# /FD = Generate file dependencies (what ever they are) +# /c = compile without linking +# /FR = Generate browse info (.sbr file that gets combined into .bsc) +# /Fo = object file name (or at least path) +# /Fd = debug database name (or path) +# /MD = Runtime library: Multithread DLL +# /MDd = Runtime library: Multithread DLL (debug) +# /Od = Disable optimising (debug) +# /O2 = Optimize for speed +# /YX = Automatic use of precomipled headers +# /Gm = Minimal rebuild (some cpp class stuff) +# /Zi = Program database for debuggers +# /ZI = Pgm database with special "edit&continue" stuff - not available in C5 + + +### Linker options +LINK=link.exe + +LINK_LIBS= kernel32.lib user32.lib gdi32.lib \ + advapi32.lib uuid.lib \ + wsock32.lib advapi32.lib \ + $(BOOST_LIB) \ + $(YAZ_LIB) $(YAZPP_LIB) $(ICONV_LIB) $(LIBXSLT_LIB) + +COMMON_LNK_OPTIONS= /nologo \ + /subsystem:windows \ + /machine:i386 \ + /incremental:no + +DEBUG_LNK_OPTIONS= /debug + +RELEASE_LNK_OPTIONS= + +DLL_LINK_OPTIONS= /dll +PROG_LINK_OPTIONS = /subsystem:console + +# Final opt variables +!if $(DEBUG) +COPT= $(COMMON_C_OPTIONS) $(DEBUG_C_OPTIONS) +RCOPT= $(COMMON_RC_OPTIONS) $(DEBUG_RC_OPTIONS) +LNKOPT= $(COMMON_LNK_OPTIONS) $(DEBUG_LNK_OPTIONS) + +!else +COPT= $(COMMON_C_OPTIONS) $(RELEASE_C_OPTIONS) +RCOPT= $(COMMON_RC_OPTIONS) $(RELEASE_RC_OPTIONS) +LNKOPT= $(COMMON_LNK_OPTIONS) $(RELEASE_LNK_OPTIONS) +!endif + +########################################################### +############### Source and object modules +########################################################### + +PROJECT_DLL_OBJS = \ + $(OBJDIR)\session.obj \ + $(OBJDIR)\router_chain.obj \ + $(OBJDIR)\router_flexml.obj \ + $(OBJDIR)\filter.obj \ + $(OBJDIR)\filter_log.obj \ + $(OBJDIR)\filter_virt_db.obj \ + $(OBJDIR)\filter_z3950_client.obj \ + $(OBJDIR)\filter_backend_test.obj \ + $(OBJDIR)\util.obj + +# $(OBJDIR)\thread_pool_observer.obj +#$(OBJDIR)\filter_frontend_net.obj \ + + +EX_FILTER_FRONTEND_NET_OBJS = $(OBJDIR)\ex_filter_frontend_net.obj +EX_LIBXML2_CONF_OBJS = $(OBJDIR)\ex_libxml2_conf.obj + +########################################################### +############### Compiling +########################################################### + +# Note: This defines where to look for the necessary +# source files. Funny way of doing it, but it works. + +{$(SRCDIR)}.cpp{$(OBJDIR)}.obj: + $(CPP) $(COPT) $< + +########################################################### +############### Resources +########################################################### + +### The RC compiler (resource files) +RSC=rc.exe +COMMON_RC_OPTIONS= /l 0x406 /i"$(ROOTDIR)" +DEBUG_RC_OPTIONS=/d "_DEBUG" +RELEASE_RC_OPTIONS=/d "NDEBUG" + +PROJECT_RES=$(OBJDIR)\yp2.res +PROJECT_RC=$(WINDIR)\yp2.rc + +!if $(DEBUG) +RSOPT=/d_DEBUG +!else +RSOPT=/d_NDEBUG +!endif + +$(PROJECT_RES): $(PROJECT_RC) + $(RSC) $(RSOPT) /fo"$(PROJECT_RES)" $(PROJECT_RC) + +########################################################### +############### Linking +########################################################### + +$(PROJECT_DLL) $(PROJECT_IMPLIB): "$(BINDIR)" $(PROJECT_DLL_OBJS) + @echo Linking $(PROJECT_DLL) + $(LINK) @<< + $(LNKOPT) + $(LINK_LIBS) + $(DLL_LINK_OPTIONS) + $(PROJECT_DLL_OBJS) + /out:"$(PROJECT_DLL)" + /implib:"$(PROJECT_IMPLIB)" +<< + +$(EX_FILTER_FRONTEND_NET) : "$(BINDIR)" $(EX_FILTER_FRONTEND_OBJS) $(PROJECT_IMPLIB) + @echo Linking $(EX_FILTER_FRONTEND_NET) + $(LINK) @<< + $(LNKOPT) + $(PROG_LINK_OPTIONS) + $(LINK_LIBS) + $(PROJECT_IMPLIB) + $(EX_FILTER_FRONTEND_NET_OBJS) + /out:$(EX_FILTER_FRONTEND_NET) +<< + +$(EX_LIBXML2_CONF) : "$(BINDIR)" $(EX_LIBXML2_CONF_OBJS) $(PROJECT_IMPLIB) + @echo Linking $(EX_LIBXML2_CONF) + $(LINK) @<< + $(LNKOPT) + $(PROG_LINK_OPTIONS) + $(LINK_LIBS) + $(PROJECT_IMPLIB) + $(EX_LIBXML2_CONF_OBJS) + /out:$(EX_LIBXML2_CONF) +<< + + +############## clean +clean: + -del $(BINDIR)\*.exe + -del $(BINDIR)\*.dll + -del $(TMPDIR)\*. + -del $(LIBDIR)\*.MAP + -del $(LIBDIR)\*.LIB + -del $(OBJDIR)\*.OBJ + +realclean: clean + -del $(ZOOMDIR)\zoom.h + +dirs: $(OBJDIR) $(WINDIR) $(LIBDIR) $(BINDIR) $(TMPDIR) + +$(OBJDIR) $(WINDIR) $(LIBDIR) $(BINDIR) $(TMPDIR): + if not exist "$@/$(NUL)" mkdir "$@" + -- 1.7.10.4