From 172a83d72491f90f6191be1040ef8b2e1789bd2e Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 13 May 2006 19:14:12 +0000 Subject: r15573: Fix build of systems that have iconv headers in non-standard locations Split of system/locale.h header from system/iconv.h Previously, iconv wasn't being used on these systems (This used to be commit aa6d66fda69779d1c2948a1aca85dbd5208f1cba) --- source4/include/system/config.m4 | 2 +- source4/include/system/iconv.h | 8 -------- source4/include/system/locale.h | 29 +++++++++++++++++++++++++++++ source4/kdc/hdb-ldb.c | 1 - source4/lib/charset/util_unistr.c | 2 +- source4/lib/ldb/include/includes.h | 2 +- source4/lib/replace/replace.c | 1 - source4/lib/samba3/group.c | 1 - source4/lib/samba3/smbpasswd.c | 2 +- source4/lib/samba3/tdbsam.c | 1 - source4/lib/socket/access.c | 2 +- source4/lib/tdb/tools/tdbdump.c | 2 +- source4/lib/util/genrand.c | 2 +- source4/lib/util/util.c | 2 +- source4/lib/util/util_str.c | 2 +- source4/libcli/ldap/ldap.c | 1 - source4/libcli/ldap/ldap_controls.c | 1 - source4/libcli/nbt/nbtname.c | 2 +- source4/libcli/security/sddl.c | 2 +- source4/ntvfs/posix/pvfs_shortname.c | 2 +- source4/param/loadparm.c | 2 +- source4/param/params.c | 2 +- source4/param/util.c | 1 - source4/torture/basic/utable.c | 2 +- source4/torture/local/config.mk | 1 + source4/utils/ndrdump.c | 2 +- source4/utils/nmblookup.c | 2 +- 27 files changed, 47 insertions(+), 32 deletions(-) create mode 100644 source4/include/system/locale.h diff --git a/source4/include/system/config.m4 b/source4/include/system/config.m4 index 2c62b571e0..8e7448bbe4 100644 --- a/source4/include/system/config.m4 +++ b/source4/include/system/config.m4 @@ -30,7 +30,7 @@ AC_CHECK_HEADERS(sys/capability.h) # passwd AC_CHECK_HEADERS(grp.h sys/id.h compat.h shadow.h sys/priv.h pwd.h sys/security.h) -# iconv +# locale AC_CHECK_HEADERS(ctype.h locale.h) # glob diff --git a/source4/include/system/iconv.h b/source4/include/system/iconv.h index d9111bb07e..96500dbfac 100644 --- a/source4/include/system/iconv.h +++ b/source4/include/system/iconv.h @@ -27,14 +27,6 @@ #include #endif -#ifdef HAVE_CTYPE_H -#include -#endif - -#ifdef HAVE_LOCALE_H -#include -#endif - /* needed for some systems without iconv. Doesn't really matter what error code we use */ #ifndef EILSEQ diff --git a/source4/include/system/locale.h b/source4/include/system/locale.h new file mode 100644 index 0000000000..e4be4a128b --- /dev/null +++ b/source4/include/system/locale.h @@ -0,0 +1,29 @@ +/* + Unix SMB/CIFS implementation. + + locale include wrappers + + Copyright (C) Andrew Tridgell 2004 + + 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 2 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, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#ifdef HAVE_CTYPE_H +#include +#endif + +#ifdef HAVE_LOCALE_H +#include +#endif diff --git a/source4/kdc/hdb-ldb.c b/source4/kdc/hdb-ldb.c index 217afab40a..c1ed262f7d 100644 --- a/source4/kdc/hdb-ldb.c +++ b/source4/kdc/hdb-ldb.c @@ -38,7 +38,6 @@ #include "hdb.h" #include "lib/ldb/include/ldb.h" #include "lib/ldb/include/ldb_errors.h" -#include "system/iconv.h" #include "librpc/gen_ndr/netlogon.h" #include "auth/auth.h" #include "auth/auth_sam.h" diff --git a/source4/lib/charset/util_unistr.c b/source4/lib/charset/util_unistr.c index 1eb198d6f9..80c1d3b125 100644 --- a/source4/lib/charset/util_unistr.c +++ b/source4/lib/charset/util_unistr.c @@ -20,7 +20,7 @@ */ #include "includes.h" -#include "system/iconv.h" +#include "system/locale.h" /** * @file diff --git a/source4/lib/ldb/include/includes.h b/source4/lib/ldb/include/includes.h index 26309df381..827290342f 100644 --- a/source4/lib/ldb/include/includes.h +++ b/source4/lib/ldb/include/includes.h @@ -7,7 +7,7 @@ #ifdef _SAMBA_BUILD_ #include "system/filesys.h" -#include "system/iconv.h" +#include "system/locale.h" #include "system/time.h" /* tell ldb we have the internal ldap code */ diff --git a/source4/lib/replace/replace.c b/source4/lib/replace/replace.c index 415ea2f129..337a54f24f 100644 --- a/source4/lib/replace/replace.c +++ b/source4/lib/replace/replace.c @@ -23,7 +23,6 @@ #include "system/time.h" #include "system/network.h" #include "system/filesys.h" -#include "system/iconv.h" void replace_dummy(void); void replace_dummy(void) {} diff --git a/source4/lib/samba3/group.c b/source4/lib/samba3/group.c index 13b21ed21f..0860c36e1f 100644 --- a/source4/lib/samba3/group.c +++ b/source4/lib/samba3/group.c @@ -20,7 +20,6 @@ */ #include "includes.h" -#include "system/iconv.h" #include "lib/samba3/samba3.h" #include "lib/tdb/include/tdbutil.h" #include "system/filesys.h" diff --git a/source4/lib/samba3/smbpasswd.c b/source4/lib/samba3/smbpasswd.c index e6c52966d9..acba763371 100644 --- a/source4/lib/samba3/smbpasswd.c +++ b/source4/lib/samba3/smbpasswd.c @@ -54,8 +54,8 @@ */ #include "includes.h" +#include "system/locale.h" #include "lib/samba3/samba3.h" -#include "system/iconv.h" /*! Convert 32 hex characters into a 16 byte array. */ diff --git a/source4/lib/samba3/tdbsam.c b/source4/lib/samba3/tdbsam.c index 80f1448d9c..148a3c90f5 100644 --- a/source4/lib/samba3/tdbsam.c +++ b/source4/lib/samba3/tdbsam.c @@ -21,7 +21,6 @@ */ #include "includes.h" -#include "system/iconv.h" #include "system/filesys.h" #include "lib/tdb/include/tdbutil.h" #include "lib/samba3/samba3.h" diff --git a/source4/lib/socket/access.c b/source4/lib/socket/access.c index 8e57ca5aff..dcad89e3a9 100644 --- a/source4/lib/socket/access.c +++ b/source4/lib/socket/access.c @@ -33,8 +33,8 @@ #include "includes.h" #include "system/network.h" -#include "system/iconv.h" #include "lib/socket/socket.h" +#include "system/locale.h" #define FAIL (-1) #define ALLONES ((uint32_t)0xFFFFFFFF) diff --git a/source4/lib/tdb/tools/tdbdump.c b/source4/lib/tdb/tools/tdbdump.c index 9122551a0a..74ba64fdd9 100644 --- a/source4/lib/tdb/tools/tdbdump.c +++ b/source4/lib/tdb/tools/tdbdump.c @@ -38,7 +38,7 @@ #include "includes.h" #include "lib/tdb/include/tdb.h" -#include "system/iconv.h" +#include "system/locale.h" #include "system/filesys.h" #endif diff --git a/source4/lib/util/genrand.c b/source4/lib/util/genrand.c index 5bdf1f7e08..8424ad8fd7 100644 --- a/source4/lib/util/genrand.c +++ b/source4/lib/util/genrand.c @@ -21,9 +21,9 @@ */ #include "includes.h" -#include "system/iconv.h" #include "system/filesys.h" #include "lib/crypto/crypto.h" +#include "system/locale.h" /** * @file diff --git a/source4/lib/util/util.c b/source4/lib/util/util.c index c674ed23b4..5948cd7ecb 100644 --- a/source4/lib/util/util.c +++ b/source4/lib/util/util.c @@ -24,8 +24,8 @@ #include "includes.h" #include "system/network.h" -#include "system/iconv.h" #include "system/filesys.h" +#include "system/locale.h" /** * @file diff --git a/source4/lib/util/util_str.c b/source4/lib/util/util_str.c index ec6a1cbbea..62869198c3 100644 --- a/source4/lib/util/util_str.c +++ b/source4/lib/util/util_str.c @@ -26,7 +26,7 @@ #include "smb.h" #include "pstring.h" #include "lib/ldb/include/ldb.h" -#include "system/iconv.h" +#include "system/locale.h" /** * @file diff --git a/source4/libcli/ldap/ldap.c b/source4/libcli/ldap/ldap.c index c1fc461b5f..6f475478b1 100644 --- a/source4/libcli/ldap/ldap.c +++ b/source4/libcli/ldap/ldap.c @@ -24,7 +24,6 @@ */ #include "includes.h" -#include "system/iconv.h" #include "libcli/util/asn_1.h" #include "libcli/ldap/ldap.h" diff --git a/source4/libcli/ldap/ldap_controls.c b/source4/libcli/ldap/ldap_controls.c index f4f54ec2e2..ee8f9d4bb1 100644 --- a/source4/libcli/ldap/ldap_controls.c +++ b/source4/libcli/ldap/ldap_controls.c @@ -21,7 +21,6 @@ */ #include "includes.h" -#include "system/iconv.h" #include "libcli/util/asn_1.h" #include "libcli/ldap/ldap.h" #include "lib/ldb/include/ldb.h" diff --git a/source4/libcli/nbt/nbtname.c b/source4/libcli/nbt/nbtname.c index 25fd669789..871e29794d 100644 --- a/source4/libcli/nbt/nbtname.c +++ b/source4/libcli/nbt/nbtname.c @@ -25,9 +25,9 @@ */ #include "includes.h" -#include "system/iconv.h" #include "librpc/gen_ndr/ndr_nbt.h" #include "librpc/gen_ndr/ndr_misc.h" +#include "system/locale.h" /* don't allow an unlimited number of name components */ #define MAX_COMPONENTS 10 diff --git a/source4/libcli/security/sddl.c b/source4/libcli/security/sddl.c index 97e811f151..14dd7e0917 100644 --- a/source4/libcli/security/sddl.c +++ b/source4/libcli/security/sddl.c @@ -21,9 +21,9 @@ */ #include "includes.h" -#include "system/iconv.h" #include "libcli/security/security.h" #include "librpc/gen_ndr/ndr_misc.h" +#include "system/locale.h" struct flag_map { const char *name; diff --git a/source4/ntvfs/posix/pvfs_shortname.c b/source4/ntvfs/posix/pvfs_shortname.c index eb797dc7aa..8e26db3ed5 100644 --- a/source4/ntvfs/posix/pvfs_shortname.c +++ b/source4/ntvfs/posix/pvfs_shortname.c @@ -21,8 +21,8 @@ */ #include "includes.h" +#include "system/locale.h" #include "vfs_posix.h" -#include "system/iconv.h" /* this mangling scheme uses the following format diff --git a/source4/param/loadparm.c b/source4/param/loadparm.c index b6dec9be9d..c46cf51f4b 100644 --- a/source4/param/loadparm.c +++ b/source4/param/loadparm.c @@ -58,7 +58,7 @@ #include "dynconfig.h" #include "pstring.h" #include "system/time.h" -#include "system/iconv.h" +#include "system/locale.h" #include "librpc/gen_ndr/svcctl.h" #include "librpc/gen_ndr/samr.h" #include "smb_server/smb_server.h" diff --git a/source4/param/params.c b/source4/param/params.c index 0ce416c00a..1680df4e4f 100644 --- a/source4/param/params.c +++ b/source4/param/params.c @@ -80,7 +80,7 @@ */ #include "includes.h" -#include "system/iconv.h" +#include "system/locale.h" /* -------------------------------------------------------------------------- ** * Constants... diff --git a/source4/param/util.c b/source4/param/util.c index dc605191fe..af97903277 100644 --- a/source4/param/util.c +++ b/source4/param/util.c @@ -25,7 +25,6 @@ #include "includes.h" #include "dynconfig.h" #include "system/network.h" -#include "system/iconv.h" #include "system/filesys.h" /** diff --git a/source4/torture/basic/utable.c b/source4/torture/basic/utable.c index 9e8ee6ced8..7a2b3874e0 100644 --- a/source4/torture/basic/utable.c +++ b/source4/torture/basic/utable.c @@ -20,8 +20,8 @@ #include "includes.h" #include "torture/torture.h" -#include "system/iconv.h" #include "system/filesys.h" +#include "system/locale.h" #include "libcli/libcli.h" #include "torture/util.h" #include "pstring.h" diff --git a/source4/torture/local/config.mk b/source4/torture/local/config.mk index 28d231ebe5..b98c3b3516 100644 --- a/source4/torture/local/config.mk +++ b/source4/torture/local/config.mk @@ -21,6 +21,7 @@ PUBLIC_DEPENDENCIES = \ RPC_NDR_ECHO \ LIBCLI_SMB \ MESSAGING \ + ICONV \ registry # End SUBSYSTEM TORTURE_LOCAL ################################# diff --git a/source4/utils/ndrdump.c b/source4/utils/ndrdump.c index 117029b6bc..86a32e9d5b 100644 --- a/source4/utils/ndrdump.c +++ b/source4/utils/ndrdump.c @@ -20,8 +20,8 @@ #include "includes.h" #include "lib/cmdline/popt_common.h" -#include "system/iconv.h" #include "system/filesys.h" +#include "system/locale.h" #include "librpc/rpc/dcerpc.h" #include "librpc/rpc/dcerpc_table.h" diff --git a/source4/utils/nmblookup.c b/source4/utils/nmblookup.c index 400201f083..b9057d4934 100644 --- a/source4/utils/nmblookup.c +++ b/source4/utils/nmblookup.c @@ -24,9 +24,9 @@ #include "includes.h" #include "lib/cmdline/popt_common.h" -#include "system/iconv.h" #include "lib/socket/socket.h" #include "system/network.h" +#include "system/locale.h" #include "netif/netif.h" #include "librpc/gen_ndr/nbt.h" #include "libcli/nbt/libnbt.h" -- cgit