Bug 244 - Where is charset modules?
Summary: Where is charset modules?
Status: CLOSED FIXED
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: Extended Characters (show other bugs)
Version: 3.0.0preX
Hardware: All FreeBSD
: P2 normal
Target Milestone: none
Assignee: Alexander Bokovoy
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-07-21 23:19 UTC by Pavel V.Zheltobryukhov
Modified: 2005-11-14 09:26 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pavel V.Zheltobryukhov 2003-07-21 23:19:26 UTC
I build Samba3.0.0beta2 from FreeBSD ports collection. After building I didn't found any
charset modules in /usr/local/etc/charsets.Messages in logs looks like

[2003/07/21 14:17:57, 0] lib/module.c:smb_load_module(40)
  Error loading module '/usr/local/etc/charset/KOI8-R.so': Cannot open 
"/usr/local/etc/charset/KOI8-R.so"


I didn't found any sources for this modules
in tar.bz2 file. How I can set unix charset for KOI8-R and dos charset for CP866?
Comment 1 Björn Jacke 2003-07-22 01:44:16 UTC
charset conversion is done via iconv. This should be part of your glibc or if
you don't use glibc  - libiconv. The modules are not part of samba.
Comment 2 Pavel V.Zheltobryukhov 2003-07-22 02:39:53 UTC
I rebuild Samba with libiconv, but when I try

unix charset = KOI8-R
display charset = KOI8-R
dos charset = 866

smbd and nmbd was core dumped after restarting samba

Comment 3 Alexander Bokovoy 2003-07-22 03:22:50 UTC
set
 dos charset = CP866
in Samba 3.0 all charset names should be the same as charset names in underlying
iconv library.
Comment 4 Pavel V.Zheltobryukhov 2003-07-22 04:00:19 UTC
Of course, 
dos charset = CP866 
Sorry, I made the mistake when wrote the comment

Comment 5 Alexander Bokovoy 2003-07-22 04:50:38 UTC
Can you show us result of configure script run? How it detects your iconv library?
Comment 6 Pavel V.Zheltobryukhov 2003-07-22 05:32:55 UTC
I found very interesting results  - configure script didn't detect iconv! in FreeBSD4.8 I have no giconv.h but have iconv.h in /usr/local/include 
libiconv package installed too

configure:18904: checking for iconv in /usr
configure:18931: cc -o conftest -O -pipe  -I/usr/local/include -I/usr/include -L/usr/lib conftest.c  >&5
configure:18912: giconv.h: No such file or directory
configure: In function `main':
configure:18922: syntax error before `cd'
configure:18923: `cd' undeclared (first use in this function)
configure:18923: (Each undeclared identifier is reported only once
configure:18923: for each function it appears in.)
configure:18934: $? = 1
configure: failed program was:
#line 18910 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <giconv.h>
#ifdef F77_DUMMY_MAIN
#  ifdef __cplusplus
     extern "C"
#  endif
   int F77_DUMMY_MAIN() { return 1; }
#endif
int
main ()
{
iconv_t cd = iconv_open("","");
       iconv(cd,NULL,NULL,NULL,NULL);
       iconv_close(cd);
  ;
  return 0;
}
configure:18973: cc -o conftest -O -pipe  -I/usr/local/include -I/usr/include -L/usr/lib conftest.c  >&5
/tmp/ccLBfFr8.o: In function `main':
/tmp/ccLBfFr8.o(.text+0x15): undefined reference to `libiconv_open'
/tmp/ccLBfFr8.o(.text+0x28): undefined reference to `libiconv'
/tmp/ccLBfFr8.o(.text+0x34): undefined reference to `libiconv_close'
configure:18976: $? = 1
configure: failed program was:
#line 18952 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <iconv.h>
#ifdef F77_DUMMY_MAIN
#  ifdef __cplusplus
     extern "C"
#  endif
   int F77_DUMMY_MAIN() { return 1; }
#endif
int
main ()
{
iconv_t cd = iconv_open("","");
         iconv(cd,NULL,NULL,NULL,NULL);
         iconv_close(cd);
  ;
  return 0;
}
configure:19016: cc -o conftest -O -pipe  -I/usr/local/include -I/usr/include -L/usr/lib conftest.c  -lgiconv >&5
configure:18997: giconv.h: No such file or directory
configure: In function `main':
configure:19007: syntax error before `cd'
configure:19008: `cd' undeclared (first use in this function)
configure:19008: (Each undeclared identifier is reported only once
configure:19008: for each function it appears in.)
configure:19019: $? = 1
configure: failed program was:
#line 18995 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <giconv.h>
#ifdef F77_DUMMY_MAIN
#  ifdef __cplusplus
     extern "C"
#  endif
   int F77_DUMMY_MAIN() { return 1; }
#endif
int
main ()
{
iconv_t cd = iconv_open("","");
             iconv(cd,NULL,NULL,NULL,NULL);
             iconv_close(cd);
  ;
  return 0;
}
configure:19062: cc -o conftest -O -pipe  -I/usr/local/include -I/usr/include -L/usr/lib conftest.c  -liconv >&5
/usr/libexec/elf/ld: cannot find -liconv
configure:19065: $? = 1
configure: failed program was:
#line 19041 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <iconv.h>
#ifdef F77_DUMMY_MAIN
#  ifdef __cplusplus
     extern "C"
#  endif
   int F77_DUMMY_MAIN() { return 1; }
#endif
int
main ()
{
iconv_t cd = iconv_open("","");
           iconv(cd,NULL,NULL,NULL,NULL);
           iconv_close(cd);
  ;
  return 0;
}
configure:19106: result: no
configure:19144: checking for working iconv
configure:19166: cc -o conftest -O -pipe  -I/usr/local/include   -L/usr/local/lib conftest.c   >&5
/tmp/ccj09yVl.o: In function `main':
/tmp/ccj09yVl.o(.text+0x14): undefined reference to `libiconv_open'
configure:19169: $? = 1
configure: program exited with status 1
configure: failed program was:
#line 19154 "configure"
#include "confdefs.h"

#include <iconv.h>
main() {
       iconv_t cd = iconv_open("ASCII", "UCS-2LE");
       if (cd == 0 || cd == (iconv_t)-1) return -1;
       return 0;
}

configure:19187: result: no
configure:19198: WARNING: Sufficient support for iconv function was not found.
    Install libiconv from http://freshmeat.net/projects/libiconv/ for better charset compatibility!
configure:19205: checking for Linux kernel oplocks
configure:19230: cc -o conftest -O -pipe  -I/usr/local/include   -L/usr/local/lib conftest.c   >&5
configure:19233: $? = 0
configure:19235: ./conftest
configure:19238: $? = 1
configure: program exited with status 1
configure: failed program was:
#line 19215 "configure"
#include "confdefs.h"

and cache variables

jm_cv_giconv=no
jm_cv_lib_iconv=no
jm_cv_func_iconv=no
------------------------cut-here----------------------------------

Comment 7 Pavel V.Zheltobryukhov 2003-07-22 07:20:59 UTC
May be, it is not a Samba bug, but FreeBSD port bug
I edit Makefile in samba-devel port (/usr/ports/net/samba-devel/Makefile) to define
the path to libiconv libraries and rebuild it again
configure script found my libiconv libraries and I have no more messages 
about missing modules. 

After that my charset options work!






Comment 8 Tim Potter 2003-07-22 17:21:18 UTC
Pavel, can you try using the --with-libiconv option to ./configure without
having to change the Makefile?

I.e ./configure --with-libiconv=/usr/local/iconv

or wherever your iconv library is.
Comment 9 Pavel V.Zheltobryukhov 2003-07-23 03:19:46 UTC
I don't change Makefile in Samba sources - I edit the Makefile in FreeBSD port. This file required for applying additional patches from FreeBSD comitter team, building package and it registration in system. The BASEDIR parameter for libiconv was not defined in this Makefile and it's default value 'auto' doesn't work properly. As Tim Potter wrote above, I define this parameter in port Makefile (a part of this file shown below)

.if defined(WITH_LIBICONV)
LIB_DEPENDS+=iconv.3:${PORTSDIR}/converters/libiconv
CONFIGURE_ARGS+=--with-libiconv=${PREFIX}
#My changes above ^^^^^^^^^^^^^^ 
#CONFIGURE_ARGS+=--with-libiconv
# In original Makefile path to libiconv not defined 
.endif

and it equal to 
./configure --with-libiconv=BASEDIR, where BASEDIR=PREFIX=/usr/local

I think that is all FreeBSD port maintainer bug, and you can change resolution to FIXED

Comment 10 Alexander Bokovoy 2003-07-23 03:25:40 UTC
Changed resolution to fixed by initiator's request as this appeared to be a bug
in FreeBSD ports collection for Samba port makefile.
Comment 11 Gerald (Jerry) Carter (dead mail address) 2005-02-07 08:40:38 UTC
originally reported against 3.0.0beta2.  CLeaning out 
non-production release versions.
Comment 12 Gerald (Jerry) Carter (dead mail address) 2005-08-24 10:16:50 UTC
sorry for the same, cleaning up the database to prevent unecessary reopens of bugs.
Comment 13 Gerald (Jerry) Carter (dead mail address) 2005-11-14 09:26:21 UTC
database cleanup