heimdal_build: Put version objects in a separate subsystem.
authorJelmer Vernooij <jelmer@samba.org>
Fri, 15 Oct 2010 23:49:41 +0000 (01:49 +0200)
committerJelmer Vernooij <jelmer@samba.org>
Sat, 16 Oct 2010 01:32:06 +0000 (01:32 +0000)
source4/heimdal_build/replace.c
source4/heimdal_build/version.c [new file with mode: 0644]
source4/heimdal_build/wscript_build
source4/heimdal_build/wscript_configure

index 8c3def7dcac67c7b98a0edc7d71725c82e4b5f47..51393f6e6878d51c4b4f61314acac4dd1da86787 100644 (file)
@@ -83,7 +83,3 @@
        return -1;
 }
 #endif
-
-const char *heimdal_version = "samba-internal-heimdal";
-const char *heimdal_long_version = "samba-interal-heimdal";
-
diff --git a/source4/heimdal_build/version.c b/source4/heimdal_build/version.c
new file mode 100644 (file)
index 0000000..8cceff1
--- /dev/null
@@ -0,0 +1,27 @@
+/* 
+   Unix SMB/CIFS implementation.
+
+   some replacement functions for parts of roken that don't fit easily into 
+   our build system
+
+   Copyright (C) Andrew Tridgell 2005
+   
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+   
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+   
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "config.h"
+
+const char *heimdal_version = "samba-internal-heimdal";
+const char *heimdal_long_version = "samba-interal-heimdal";
+
index c01af72dd5252b901a9a30beb94a12a266c063d4..06bb3706ffe4d1cf69ecfd18aff207f208215d98 100644 (file)
@@ -540,9 +540,6 @@ if not bld.CONFIG_SET('USING_SYSTEM_ROKEN'):
             cflags='-DPACKAGE="Samba"',
             install=False
         )
-else:
-    HEIMDAL_SUBSYSTEM('ROKEN_HOSTCC', '', use_hostcc=True, use_global_deps=False, deps='roken',
-        group='compiler_libraries')
 
 HEIMDAL_LIBRARY('kdc',
                     source='../heimdal/kdc/default_config.c ../heimdal/kdc/kerberos5.c ../heimdal/kdc/krb5tgs.c ../heimdal/kdc/pkinit.c ../heimdal/kdc/log.c ../heimdal/kdc/misc.c ../heimdal/kdc/kaserver.c ../heimdal/kdc/digest.c ../heimdal/kdc/process.c ../heimdal/kdc/windc.c ../heimdal/kdc/kx509.c',
@@ -768,42 +765,54 @@ if not bld.CONFIG_SET('USING_SYSTEM_COM_ERR'):
         vnum='0.25',
         )
 
+HEIMDAL_SUBSYSTEM('HEIMDAL_VERS_HOSTCC',
+       '../heimdal/lib/vers/print_version.c ../heimdal_build/version.c',
+        group='build_compilers',
+       deps='LIBREPLACE_HOSTCC ROKEN_HOSTCC',
+       use_global_deps=False,
+       use_hostcc=True)
+
+HEIMDAL_SUBSYSTEM('HEIMDAL_VERS',
+       '../heimdal/lib/vers/print_version.c ../heimdal_build/version.c',
+        group='build_compilers',
+        deps='roken')
+
 # here is the asn1 compiler build rule
 HEIMDAL_BINARY('asn1_compile',
-    '../heimdal/lib/asn1/main.c ../heimdal/lib/asn1/gen.c ../heimdal/lib/asn1/gen_copy.c ../heimdal/lib/asn1/gen_decode.c ../heimdal/lib/asn1/gen_encode.c ../heimdal/lib/asn1/gen_free.c ../heimdal/lib/asn1/gen_glue.c ../heimdal/lib/asn1/gen_length.c ../heimdal/lib/asn1/gen_seq.c ../heimdal/lib/asn1/gen_template.c ../heimdal/lib/asn1/hash.c ../heimdal/lib/asn1/symbol.c ../heimdal/lib/asn1/asn1parse.c ../heimdal/lib/asn1/lex.c ../heimdal/lib/vers/print_version.c',
+    '../heimdal/lib/asn1/main.c ../heimdal/lib/asn1/gen.c ../heimdal/lib/asn1/gen_copy.c ../heimdal/lib/asn1/gen_decode.c ../heimdal/lib/asn1/gen_encode.c ../heimdal/lib/asn1/gen_free.c ../heimdal/lib/asn1/gen_glue.c ../heimdal/lib/asn1/gen_length.c ../heimdal/lib/asn1/gen_seq.c ../heimdal/lib/asn1/gen_template.c ../heimdal/lib/asn1/hash.c ../heimdal/lib/asn1/symbol.c ../heimdal/lib/asn1/asn1parse.c ../heimdal/lib/asn1/lex.c',
     use_hostcc=True,
         use_global_deps=False,
         cflags='-DSOCKET_WRAPPER_DISABLE=1 -DNSS_WRAPPER_DISABLE=1 -D_SAMBA_HOSTCC_',
         includes='../heimdal/lib/asn1',
         group='build_compilers',
-        deps='ROKEN_HOSTCC LIBREPLACE_HOSTCC',
+        deps='ROKEN_HOSTCC LIBREPLACE_HOSTCC HEIMDAL_VERS_HOSTCC',
         install=False
     )
 
 
 if not bld.CONFIG_SET('USING_SYSTEM_COMPILE_ET'):
     HEIMDAL_BINARY('compile_et',
-        '../heimdal/lib/vers/print_version.c ../heimdal/lib/com_err/parse.c ../heimdal/lib/com_err/lex.c ../heimdal/lib/com_err/compile_et.c',
+        '../heimdal/lib/com_err/parse.c ../heimdal/lib/com_err/lex.c ../heimdal/lib/com_err/compile_et.c',
         use_hostcc=True,
         use_global_deps=False,
         includes='../heimdal/lib/com_err',
         group='build_compilers',
         cflags='-DSOCKET_WRAPPER_DISABLE=1 -DNSS_WRAPPER_DISABLE=1 -D_SAMBA_HOSTCC_',
-        deps='ROKEN_HOSTCC LIBREPLACE_HOSTCC',
+        deps='ROKEN_HOSTCC LIBREPLACE_HOSTCC HEIMDAL_VERS_HOSTCC',
         install=False
         )
     bld.env['COMPILE_ET'] = os.path.join(bld.env['BUILD_DIRECTORY'], 'compile_et')
 
 HEIMDAL_BINARY('samba4kinit',
-    '../heimdal/kuser/kinit.c ../heimdal/lib/vers/print_version.c',
-        deps='krb5 heimntlm roken',
+    '../heimdal/kuser/kinit.c',
+        deps='krb5 heimntlm roken HEIMDAL_VERS',
         install=False
     )
 
 
 HEIMDAL_BINARY('samba4kpasswd',
-    '../heimdal/kpasswd/kpasswd.c ../heimdal/lib/vers/print_version.c',
-        deps='krb5 heimntlm roken',
+    '../heimdal/kpasswd/kpasswd.c',
+        deps='krb5 heimntlm roken HEIMDAL_VERS',
         install=False
     )
 
index b51bc71661e68fc85de4f56b40782cddc54f2da3..e8f50841c6d6487153a34cbe99ceba1a58ce3148 100644 (file)
@@ -65,19 +65,23 @@ conf.DEFINE('SAMBA4_INTERNAL_HEIMDAL', 1)
 if conf.CHECK_BUNDLED_SYSTEM('com_err', checkfunctions='com_right_r com_err', headers='com_err.h'):
     conf.define('USING_SYSTEM_COM_ERR', 1)
 
-def check_bundled_heimdal_lib(name, functions='', headers='', onlyif=None):
+def check_system_heimdal_lib(name, functions='', headers='', onlyif=None):
     # Only use system library if the user requested the bundled one not be used.
     if conf.LIB_MAY_BE_BUNDLED(name):
-        return
+        return False
     setattr(conf.env, "CPPPATH_%s" % name.upper(), ["/usr/include/heimdal"])
     setattr(conf.env, "LIBPATH_%s" % name.upper(), ["/usr/lib/heimdal"])
     conf.CHECK_BUNDLED_SYSTEM(name, checkfunctions=functions, headers=headers,
         onlyif=onlyif)
     conf.define('USING_SYSTEM_%s' % name.upper(), 1)
-
-
-check_bundled_heimdal_lib("roken")
-check_bundled_heimdal_lib("wind", "wind_stringprep", "wind.h", onlyif="roken")
+    return True
+
+if check_system_heimdal_lib("roken"):
+    conf.env.CPPPATH_ROKEN_HOSTCC = conf.env.CPPPATH_ROKEN
+    conf.env.LIBPATH_ROKEN_HOSTCC = conf.env.LIBPATH_ROKEN
+    conf.env.LIB_ROKEN_HOSTCC = "roken"
+    conf.SET_TARGET_TYPE("ROKEN_HOSTCC", 'SYSLIB')
+check_system_heimdal_lib("wind", "wind_stringprep", "wind.h", onlyif="roken")
 
 # disable trying to use an external compile_et until we have a configure
 # test that checks that the system one actually works. On some systems it