Revert "build: Put lockdir and cachedir in FHS-like locations by default"
[sfrench/samba-autobuild/.git] / dynconfig / wscript
index 35af13db7ece13805436c976a757595676a02bfc..ccb181c1024d08540b1ca1a9d8cb0db03dbaecb8 100755 (executable)
@@ -9,8 +9,8 @@ dir_options = {
     'with-privatedir'                     : [ '${PREFIX}/private', 'Where to put sam.ldb and other private files' ],
     'with-sockets-dir'                    : [ '${LOCALSTATEDIR}/run', 'sockets directory' ],
     'with-winbindd-privileged-socket-dir' : [ '${LOCALSTATEDIR}/lib/winbindd_privileged', 'winbind privileged socket directory'],
-    'with-lockdir'                        : [ '${LOCALSTATEDIR}/lock', 'where to put short term disposable state files' ],
-    'with-cachedir'                       : [ '${LOCALSTATEDIR}/cache', 'where to put cache files' ],
+    'with-lockdir'                        : [ '${LOCALSTATEDIR}/locks', 'where to put short term disposable state files' ],
+    'with-cachedir'                       : [ '${LOCALSTATEDIR}/locks', 'where to put cache files' ],
     'with-logfilebase'                    : [ '${LOCALSTATEDIR}', 'Where to put log files' ],
     'with-pammodulesdir'                  : [ '${LIBDIR}', 'Which directory to use for PAM modules' ],
     'with-statedir'                       : [ '${LOCALSTATEDIR}/locks', 'where to put persistent state files' ],
@@ -107,9 +107,12 @@ Build.BuildContext.dynconfig_cflags = dynconfig_cflags
 
 def build(bld):
     cflags = bld.dynconfig_cflags()
+    version_header = 'version.h'
+    if not os.getenv('TOPLEVEL_BUILD'):
+        version_header = 'include/version.h'
     bld.SAMBA_SUBSYSTEM('DYNCONFIG',
                         'dynconfig.c',
                         deps='replace talloc',
-                        public_headers=os_path_relpath(os.path.join(Options.launch_dir, 'version.h'), bld.curdir),
+                        public_headers=os_path_relpath(os.path.join(Options.launch_dir, version_header), bld.curdir),
                         header_path='samba',
                         cflags=cflags)