Changeset 19259 for gsdl


Ignore:
Timestamp:
2009-04-25T18:45:58+12:00 (15 years ago)
Author:
davidb
Message:

Revap of Greenstone as a module for Apache. Initial version coded by DL Consulting

Location:
gsdl/trunk/runtime-src/src/recpt
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • gsdl/trunk/runtime-src/src/recpt/Makefile.in

    r18612 r19259  
    2828COMMON_DIR = $(GSDL_DIR)/common-src
    2929RUNTIME_DIR = $(GSDL_DIR)/runtime-src
     30
     31GSDLOS = @gsdlos@
    3032
    3133INDEXERS_DIR = $(COMMON_DIR)/indexers
     
    7173Z3950_INCLUDES =
    7274Z3950_LIBS =
     75endif
     76
     77USE_APACHE_HTTPD=@USE_APACHE_HTTPD@
     78ifeq ($(USE_APACHE_HTTPD), 1)
     79APACHE_OBJS = string_pool.o mod_gsdl.o
     80
     81APXS=$(GSDL_DIR)/apache-httpd/$(GSDLOS)/bin/apxs
     82APXS_CFLAGS=`$(APXS) -q CFLAGS`   
     83APXS_CFLAGS_SHLIB=`$(APXS) -q CFLAGS_SHLIB`   
     84APXS_INCLUDEDIR=`$(APXS) -q INCLUDEDIR`   
     85APXS_LIBEXECDIR=`$(APXS) -q LIBEXECDIR`
     86APXS_LDFLAGS_SHLIB=`$(APXS) -q LDFLAGS_SHLIB`
     87APXS_SYSCONFDIR=`$(APXS) -q SYSCONFDIR`
     88APXS_LIBS_SHLIB=`$(APXS) -q LIBS_SHLIB`
     89APACHE_MODULE = mod_gsdl.so
     90else
     91APACHE_OBJS =
     92APACHE_MODULE = mod_gsdl.so
    7393endif
    7494
     
    95115
    96116
    97 .SUFFIXES:
    98 .SUFFIXES: .cpp .o
    99 .cpp.o:
    100     $(CXXCOMPILE) $<
    101 
    102 
    103117SOURCES = \
    104118    action.cpp \
     
    113127    cgiwrapper.cpp \
    114128    collectoraction.cpp \
     129    configaction.cpp \
    115130        converter.cpp \
    116131    datelistbrowserclass.cpp \
     
    157172    cgiwrapper.o \
    158173    collectoraction.o \
     174    configaction.o \
    159175        converter.o \
    160176    datelistbrowserclass.o \
     
    187203    usersaction.o \
    188204    vlistbrowserclass.o \
    189     wizardaction.o
     205    wizardaction.o 
    190206
    191207LIBRARY = gsdlrecpt.a
     
    208224
    209225# Default target: make both gsdlrecpt.a and the library executable
    210 all: $(LIBRARY) $(EXECUTABLE)
     226all: $(LIBRARY) $(EXECUTABLE) $(APACHE_MODULE)
    211227
    212228gsdlrecpt.a: $(OBJECTS)
     
    218234    $(CXXLINK) $(EXECUTABLE_OBJECTS) $(LIBS)
    219235
     236mod_gsdl.o: mod_gsdl.cpp
     237    $(CXX) -c  $(CXXFLAGS) $(DEFS) $(INCLUDES) -D_APACHE_MOD=2 -fPIC -I$(APXS_INCLUDEDIR) -I. -iquote $(APXS_CFLAGS) $(APXS_CFLAGS_SHLIB) -Wall -o $@ $<
     238
     239mod_gsdl.so: $(APACHE_OBJS) $(LIBRARY)
     240    $(CXX) -fPIC -shared -o $@ $(APACHE_OBJS) $(APXS_LIBS_SHLIB) $(LIBRARY) $(GSDL_LIBS) $(LIBS)
     241
     242
     243.SUFFIXES:
     244.SUFFIXES: .cpp .o
     245.cpp.o:
     246    $(CXXCOMPILE) $<
     247
     248
    220249install: $(EXECUTABLE)
    221250    $(INSTALL) -m 755 -s $(EXECUTABLE) $(GSDL_DIR)/cgi-bin
     251    $(GSDL_DIR)/apache-httpd/$(GSDLOS)/bin/apxs  -i -n gsdl mod_gsdl.so
    222252
    223253clean:
    224     rm -f $(OBJECTS) $(LIBRARY) $(EXECUTABLE)
     254    rm -f $(OBJECTS) $(LIBRARY) $(EXECUTABLE) $(APACHE_MODULE) $(APACHE_OBJS)
    225255
    226256distclean:
  • gsdl/trunk/runtime-src/src/recpt/receptionist.cpp

    r19109 r19259  
    14481448}
    14491449
     1450
    14501451void receptionist::define_general_macros (cgiargsclass &args, outconvertclass &/*outconvert*/,
    14511452                      ostream &logout) {
     
    14571458  disp.setmacro ("httpweb", displayclass::defaultpackage, configinfo.httpweb);
    14581459  disp.setmacro ("httpprefix", displayclass::defaultpackage, configinfo.httpprefix);
    1459 
    14601460
    14611461  text_t compressedoptions = get_compressed_arg(args, logout);
     
    15591559    }
    15601560  }
    1561 
     1561 
    15621562  if (!collection.empty()) {
    15631563    ColInfoResponse_t cinfo;
     
    15661566    if (collectproto != NULL) {
    15671567      collectproto->get_collectinfo (collection, cinfo, err, logout);
     1568
     1569
     1570      // This part of the code used to use "cinfo.httpprefix" regardless
     1571      // of the value it contained.  Since
     1572      // this can come back with an empty (in the case of gsdl_mod), the
     1573      // URL produced was invalid.
     1574      //
     1575      // Changed to test for empty first, and use configinfo.httpprefix as
     1576      // a "backup"
     1577      //
     1578      // Point to consider: since configinfo.httpprefix has been offically
     1579      // set as "httpprefix" in macros, it seems to make more sense to use
     1580      // always use that version and not the cinfo version at all.
     1581
     1582      text_t httpprefix
     1583    = (!cinfo.httpprefix.empty()) ? cinfo.httpprefix : configinfo.httpprefix;
     1584   
    15681585      text_t httpcollection;
    15691586      if (!cinfo.httpdomain.empty()) httpcollection = "http://";
    1570       httpcollection += cinfo.httpdomain + cinfo.httpprefix + "/collect/"
     1587      httpcollection += cinfo.httpdomain + httpprefix + "/collect/"
    15711588    + collection;
    15721589      disp.setmacro ("httpcollection", displayclass::defaultpackage,
    15731590             httpcollection);
     1591     
    15741592      // as of gsdl 2.53, collect.cfg can specify macros
    15751593      if (cinfo.collection_macros.size() > 0) {
Note: See TracChangeset for help on using the changeset viewer.