SubDir TOP core ;

Build core : global.cpp scope.cpp string.cpp
    buffer.cpp list.cpp map.cpp dict.cpp table.cpp allocator.cpp
    md5.cpp file.cpp logger.cpp log.cpp configuration.cpp
    stringlist.cpp entropy.cpp filter.cpp stderrlogger.cpp
    cache.cpp
    ;

Build encodings : ustring.cpp ustringlist.cpp ;

PGUSER ?= "" ;

# just for configuration.cpp, we want to propagagate the compile-time
# settings so they can be used and logged at runtime.
ObjectDefines configuration.cpp :
     BINDIR='\"$(BINDIR)\"'
     SBINDIR='\"$(SBINDIR)\"'
     MANDIR='\"$(MANDIR)\"'
     LIBDIR='\"$(LIBDIR)\"'
     INITDIR='\"$(INITDIR)\"'
     JAILDIR='\"$(JAILDIR)\"'
     MESSAGEDIR='\"$(MESSAGEDIR)\"'
     CONFIGDIR='\"$(CONFIGDIR)\"'
     PIDFILEDIR='\"$(PIDFILEDIR)\"'
     LOGFILE='\"$(LOGFILE)\"'
     LOGFILEMODE='\"$(LOGFILEMODE)\"'
     DBADDRESS='\"$(DBADDRESS)\"'
     PGUSER='\"$(PGUSER)\"'
     AOXUSER='\"$(AOXUSER)\"'
     AOXGROUP='\"$(AOXGROUP)\"'
     DBOWNER='\"$(DBOWNER)\"'
     DBNAME='\"$(DBNAME)\"'
     DBSCHEMA='\"$(DBSCHEMA)\"'
     VERSION='\"$(VERSION)\"' ;

# make sure configuration.o is rebuilt when the settings change. a bit hacky.
NoCare <>Jamsettings ;
Depends [ FGristFiles configuration.o ] : <>Jamsettings ;
# and the version
NoCare <>Jamrules ;
Depends [ FGristFiles configuration.o ] : <>Jamrules ;

# assumedly, everything which includes this file wants to include the
# headers in this directory.

HDRS += [ FDirName $(TOP) core ] ;
