FreeBSD 4.0 support now in
Benjamin Kosnik
bkoz@cygnus.com
Wed May 10 19:35:00 GMT 2000
> The reason is that _A, etc were changed to _CTYPE_A, etc on the 4.0
> branch to help alleviate problems with C++ headers. ;-)
Ha ha.
> FYI: In order to see how general this config/bsd tree is with my
> patch, I studied the CVSWEB archives from OpenBSD
> ( http://www.openbsd.org/cgi-bin/cvsweb/src/include/ctype.h ) and NetBSD
> ( http://cvsweb.netbsd.org/cgi-bin/cvsweb.cgi/basesrc/include/ctype.h -
> shame on them for intentionally deleting older versions ;-). I must
> mention that both use a ctype.h scheme circa BSD4.3 not BSD4.4 that
> would appear to match the test for newlib not bsd (in fact, I had to
> explicitly check for the existence of __istype or I was afraid they
> would match my new test but fail since they use a _ctype_ table
> directly not a __istype macro). So maybe that directory needs to be
> explicitly named config/freebsd or config/bsd4.4 instead of
> config/bsd.
the usual approach (taken with solaris) is a bsd toplevel dir and then
freebsd4.0 (bsd4.4?)
freebsd3.4 (bsd4.3?)
subdirs.
I don't understand the bsd naming conventions, so perhaps you can explain
the bizarre naming schemes between openBSD, freeBSD, BSD, etc.
I any case, it looks like you can duck around this as the only file that
differs is ctype_base.h. In that case, the macro type solution you
proposed is probably best.
> The remaining failure is in 27_io/ostream_inserter_arith.cc and has
> something to do with
hmm. didn't notice this on 4.0.......
> [Due to size of patch, I will not include the generated files. Also,
> my automake 1.4 appears to gratuitously change the layout of
> Makefile.in w.r.t. their checked in versions. If Makefile.in
> really doesn't change after regen, please remove last line
> of the ChangeLog entry. Finally, I don't see how I could have
> broken your 4.0 work, but for the record I've only tested on FreeBSD3.4.]
>
> 2000-05-10 Loren J. Rittle <ljrittle@acm.org>
>
> * config/bsd/bits/ctype_base.h: Add support for plain BSD4.4.
> * acinclude.m4 (GLIBCPP_CHECK_CTYPE): Enhance bsd tests.
> * aclocal.m4: Regenerate.
> * configure: Regenerate.
> * */Makefile.in: Regenerate.
>
> Index: acinclude.m4
> ===================================================================
> RCS file: /cvs/gcc/egcs/libstdc++-v3/acinclude.m4,v
> retrieving revision 1.7
> diff -p -r1.7 acinclude.m4
> *** acinclude.m4 2000/05/10 00:23:47 1.7
> --- acinclude.m4 2000/05/11 00:05:22
> *************** AC_DEFUN(GLIBCPP_CHECK_CTYPE, [
> *** 311,323 ****
> ctype_default=no
> fi
>
> dnl Test for <ctype> functionality -- BSD
> AC_MSG_CHECKING([<ctype> for bsd ])
> AC_TRY_COMPILE([#include <ctype.h>],
> [int
> foo (int a)
> ! { return _CTYPE_S + _CTYPE_R + _CTYPE_C + _CTYPE_U + _CTYPE_L + _CTYPE_A \
> ! + _CTYPE_D + _CTYPE_P + _CTYPE_X + _CTYPE_G ;}], \
> ctype_bsd=yes, ctype_bsd=no)
> AC_MSG_RESULT($ctype_bsd)
> if test $ctype_bsd = "yes"; then
> --- 311,337 ----
> ctype_default=no
> fi
>
> + dnl Test for <ctype> functionality -- FreeBSD4
> + AC_MSG_CHECKING([<ctype> for freebsd4 ])
> + AC_TRY_COMPILE([#include <ctype.h>],
> + [int
> + foo (int a)
> + { return _CTYPE_S + _CTYPE_R + _CTYPE_C + _CTYPE_U + _CTYPE_L + _CTYPE_A \
> + + _CTYPE_D + _CTYPE_P + _CTYPE_X + _CTYPE_G + __istype (a, 0);}], \
> + ctype_freebsd=yes, ctype_freebsd=no)
> + AC_MSG_RESULT($ctype_freebsd)
> + if test $ctype_freebsd = "yes"; then
> + ctype_include_dir="config/bsd"
> + ctype_default=no
> + fi
> +
> dnl Test for <ctype> functionality -- BSD
> AC_MSG_CHECKING([<ctype> for bsd ])
> AC_TRY_COMPILE([#include <ctype.h>],
> [int
> foo (int a)
> ! { return _S + _R + _C + _U + _L + _A \
> ! + _D + _P + _X + _G + __istype (a, 0);}], \
> ctype_bsd=yes, ctype_bsd=no)
> AC_MSG_RESULT($ctype_bsd)
> if test $ctype_bsd = "yes"; then
let's adopt a consistent naming scheme for the versions, ok? This will
require your input.... i would prefer to base off of the BSD4.x version
numbers, not free/open/whatever BSD numbering.
> Index: config/bsd/bits/ctype_base.h
> ===================================================================
> RCS file: /cvs/gcc/egcs/libstdc++-v3/config/bsd/bits/ctype_base.h,v
> retrieving revision 1.1
> diff -p -r1.1 ctype_base.h
> *** ctype_base.h 2000/05/10 00:21:45 1.1
> --- ctype_base.h 2000/05/11 00:05:22
> ***************
> *** 31,37 ****
> // ISO C++ 14882: 22.1 Locales
> //
>
> ! // Information as gleaned from /usr/include/ctype.h on FreeBSD 4.0
>
> struct ctype_base
> {
> --- 31,40 ----
> // ISO C++ 14882: 22.1 Locales
> //
>
> ! // Information as gleaned from /usr/include/ctype.h on FreeBSD 3.4, 4.0
> ! // and all versions of the CVS managed file at:
> ! // :pserver:anoncvs@anoncvs.freebsd.org:/home/ncvs/src/include/ctype.h
> ! // which should cover more classic BSD configurations
>
> struct ctype_base
> {
> ***************
> *** 41,46 ****
> --- 44,51 ----
>
> enum
> {
> + #ifdef _CTYPE_S
isn't there some other macro you can use that relates to the actual BSD
version number.......
> + // FreeBSD 4.0 uses this style of define.
> space = _CTYPE_S,
> print = _CTYPE_R,
> cntrl = _CTYPE_C,
> ***************
> *** 52,57 ****
> --- 57,76 ----
> xdigit = _CTYPE_X,
> alnum = _CTYPE_A | _CTYPE_D,
> graph = _CTYPE_G
> + #else
> + // Classic BSD uses this style of define.
> + space = _S,
> + print = _R,
> + cntrl = _C,
> + upper = _U,
> + lower = _L,
> + alpha = _A,
> + digit = _D,
> + punct = _P,
> + xdigit = _X,
> + alnum = _A | _D,
> + graph = _G
> + #endif
> };
> };
>
>
More information about the Libstdc++
mailing list