1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

LIBDIR and LOCKDIR are dynamically configured too.

(This used to be commit 868999ad3c)
This commit is contained in:
Martin Pool 2001-11-19 03:35:27 +00:00
parent 4ea31fb675
commit caef2d2884
7 changed files with 36 additions and 18 deletions

View File

@ -72,15 +72,17 @@ man_langs = "@manlangs@"
PASSWD_FLAGS = -DSMB_PASSWD_FILE=\"$(SMB_PASSWD_FILE)\" -DPRIVATE_DIR=\"$(PRIVATE_DIR)\"
FLAGS1 = $(CFLAGS) -Iinclude -I$(srcdir)/include -I$(srcdir)/ubiqx -I$(srcdir)/smbwrapper $(CPPFLAGS) -I. -I$(srcdir)
FLAGS2 =
FLAGS3 = -DSWATDIR=\"$(SWATDIR)\" -DLOCKDIR=\"$(LOCKDIR)\"
FLAGS4 = -DDRIVERFILE=\"$(DRIVERFILE)\" -DFORMSFILE=\"$(FORMSFILE)\" -DNTDRIVERSDIR=\"$(NTDRIVERSDIR)\" -DLIBDIR=\"$(LIBDIR)\"
FLAGS5 = $(FLAGS1) $(FLAGS2) $(FLAGS3) $(FLAGS4) -DHAVE_INCLUDES_H
FLAGS3 =
FLAGS4 = -DDRIVERFILE=\"$(DRIVERFILE)\" -DFORMSFILE=\"$(FORMSFILE)\" -DNTDRIVERSDIR=\"$(NTDRIVERSDIR)\"
FLAGS5 = $(FLAGS1) $(FLAGS2) $(FLAGS3) $(FLAGS4)
FLAGS = $(ISA) $(FLAGS5) $(PASSWD_FLAGS)
FLAGS32 = $(ISA32) $(FLAGS5) $(PASSWD_FLAGS)
PATH_FLAGS1 = -DCONFIGFILE=\"$(CONFIGFILE)\" -DSBINDIR=\"$(SBINDIR)\"
PATH_FLAGS2 = $(PATH_FLAGS1) -DBINDIR=\"$(BINDIR)\" -DLOGFILEBASE=\"$(LOGFILEBASE)\"
PATH_FLAGS = $(PATH_FLAGS2) -DLMHOSTSFILE=\"$(LMHOSTSFILE)\"
PATH_FLAGS2 = $(PATH_FLAGS1) -DBINDIR=\"$(BINDIR)\"
PATH_FLAGS3 = $(PATH_FLAGS2) -DLMHOSTSFILE=\"$(LMHOSTSFILE)\"
PATH_FLAGS4 = $(PATH_FLAGS3) -DSWATDIR=\"$(SWATDIR)\" -DLOCKDIR=\"$(LOCKDIR)\"
PATH_FLAGS = $(PATH_FLAGS4) -DLIBDIR=\"$(LIBDIR)\" -DLOGFILEBASE=\"$(LOGFILEBASE)\"
WINBIND_PROGS = bin/wbinfo
WINBIND_SPROGS = bin/winbindd

View File

@ -34,6 +34,9 @@
* they can for example consistently be set across the whole of Samba
* by command-line parameters, config file entries, or environment
* variables.
*
* @todo Perhaps eventually these should be merged into the parameter
* table? There's kind of a chicken-and-egg situation there...
**/
char const *dyn_SBINDIR = SBINDIR,
@ -45,3 +48,17 @@ pstring dyn_CONFIGFILE = CONFIGFILE; /**< Location of smb.conf file. **/
pstring dyn_LOGFILEBASE; /**< Log file directory. **/
pstring dyn_LMHOSTSFILE; /**< Statically configured LanMan hosts. **/
/**
* @brief Samba library directory.
*
* @sa lib_path() to get the path to a file inside the LIBDIR.
**/
pstring dyn_LIBDIR;
/**
* @brief Directory holding lock files.
*
* Not writable, but used to set a default in the parameter table.
**/
const pstring dyn_LOCKDIR;

View File

@ -29,3 +29,4 @@ extern char const *dyn_SBINDIR,
extern pstring dyn_CONFIGFILE;
extern pstring dyn_LOGFILEBASE, dyn_LMHOSTSFILE;
extern pstring dyn_LIBDIR, dyn_LOCKDIR;

View File

@ -72,11 +72,6 @@
/* wchar separators for lists */
#define LIST_SEP_W wchar_list_sep
#ifndef LOCKDIR
/* this should have been set in the Makefile */
#define LOCKDIR "/tmp/samba"
#endif
/* this is where browse lists are kept in the lock dir */
#define SERVER_LIST "browse.dat"

View File

@ -1782,13 +1782,18 @@ char *lock_path(char *name)
return fname;
}
/*****************************************************************
a useful function for returning a path in the Samba lib directory
*****************************************************************/
/**
* @brief Returns an absolute path to a file in the Samba lib directory.
*
* @param name File to find, relative to LIBDIR.
*
* @retval Pointer to a static #pstring containing the full path.
**/
char *lib_path(char *name)
{
static pstring fname;
snprintf(fname, sizeof(fname), "%s/%s", LIBDIR, name);
snprintf(fname, sizeof(fname), "%s/%s", dyn_LIBDIR, name);
return fname;
}

View File

@ -1199,7 +1199,7 @@ static void init_globals(void)
string_set(&Globals.szWorkGroup, WORKGROUP);
string_set(&Globals.szPasswdProgram, "");
string_set(&Globals.szPrintcapname, PRINTCAP_NAME);
string_set(&Globals.szLockDir, LOCKDIR);
string_set(&Globals.szLockDir, dyn_LOCKDIR);
string_set(&Globals.szSocketAddress, "0.0.0.0");
pstrcpy(s, "Samba ");
pstrcat(s, VERSION);

View File

@ -194,9 +194,7 @@ void build_options(BOOL screen)
#endif
output(screen," SBINDIR: %s\n", dyn_SBINDIR);
output(screen," BINDIR: %s\n", dyn_BINDIR);
#ifdef LOCKDIR
output(screen," LOCKDIR: %s\n",LOCKDIR);
#endif
output(screen," LOCKDIR: %s\n",dyn_LOCKDIR);
#ifdef DRIVERFILE
output(screen," DRIVERFILE: %s\n",DRIVERFILE);
#endif