ICU-205 Merge in the FreeBSD port for conversion interface only.

X-SVN-Rev: 475
This commit is contained in:
Helena Chapman 1999-12-29 01:09:27 +00:00
parent 7f73adbf34
commit 9c67fb547b
3 changed files with 83 additions and 0 deletions

View file

@ -17,6 +17,7 @@ case "${host}" in
icu_cv_host_frag=$srcdir/config/mh-solaris
fi ;;
*-*-linux*) icu_cv_host_frag=$srcdir/config/mh-linux ;;
*-*-freebsd*) icu_cv_host_frag=$srcdir/config/mh-freebsd ;;
*-*-aix*) icu_cv_host_frag=$srcdir/config/mh-aix ;;
*-*-hpux*)
case "$CXX" in
@ -41,3 +42,24 @@ else
$1_TRUE='#'
$1_FALSE=
fi])
dnl FreeBSD -pthread check - Jonathan McDowell <noodles@earth.li>
AC_DEFUN(AC_PTHREAD_FREEBSD,
[AC_MSG_CHECKING([if we need -pthread for threads])
AC_CACHE_VAL(ac_ldflag_pthread,
[ac_save_LDFLAGS="$LDFLAGS"
LDFLAGS="-pthread $LDFLAGS"
AC_TRY_LINK(
[
char pthread_create();
],
pthread_create();,
eval "ac_ldflag_pthread=yes",
eval "ac_ldflag_pthread=no"),
LIBS="$ac_save_LDFLAGS"
])
if eval "test \"`echo $ac_ldflag_pthread`\" = yes"; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi])

View file

@ -0,0 +1,52 @@
## -*-makefile-*-
## FreeBSD-specific setup
## Commands to generate dependency files
GEN_DEPS.c= $(CC) -E -MM $(DEFS) $(CPPFLAGS)
GEN_DEPS.cc= $(CXX) -E -MM $(DEFS) $(CPPFLAGS)
## Commands to compile
COMPILE.c= $(CC) -fPIC $(DEFS) $(CPPFLAGS) $(CFLAGS) -c
COMPILE.cc= $(CXX) -fPIC $(DEFS) $(CPPFLAGS) $(CXXFLAGS) -c
## Commands to link
LINK.c= $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS)
LINK.cc= $(CXX) $(DEFS) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS)
## Commands to make a shared library
SHLIB.c= $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -shared
SHLIB.cc= $(CXX) $(DEFS) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -shared
## Compiler switch to embed a runtime search path
LD_RPATH=
LD_RPATH_PRE= -Wl,-rpath,
## Shared object suffix
SO= so
## Link commands to link to ICU libs
LIBICU-UC= -L$(top_builddir)/common -licu-uc
LIBICU-I18N= -L$(top_builddir)/i18n -licu-i18n
LIBCTESTFW= -L$(top_builddir)/tools/ctestfw -lctestfw
## Compilation rules
%.o : $(srcdir)/%.c
$(COMPILE.c) -o $@ $<
%.o : $(srcdir)/%.cpp
$(COMPILE.cc) -o $@ $<
## Dependency rules
%.d : $(srcdir)/%.c
@echo "Generating dependency information for $<"
@$(SHELL) -ec '$(GEN_DEPS.c) $< \
| sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \
[ -s $@ ] || rm -f $@'
%.d : $(srcdir)/%.cpp
@echo "Generating dependency information for $<"
@$(SHELL) -ec '$(GEN_DEPS.cc) $< \
| sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \
[ -s $@ ] || rm -f $@'
## End FreeBSD-specific setup

View file

@ -52,6 +52,7 @@ ICU_USE_THREADS=0
if test $threads = true; then
dnl special pthread handling
dnl AIX uses pthreads instead of pthread, and HP/UX uses cma
dnl FreeBSD users -pthread
AC_CHECK_LIB(pthread, pthread_create)
if test $ac_cv_lib_pthread_pthread_create = yes; then
@ -69,6 +70,12 @@ if test $threads = true; then
ICU_USE_THREADS=1
fi
fi
if test $ac_cv_lib_pthread_pthread_create = no; then
AC_PTHREAD_FREEBSD
fi
dnl FreeBSD needs a WCS library.
AC_CHECK_LIB(wcs, wcscpy)
AC_CHECK_FUNC(pthread_mutex_create)
fi
@ -215,6 +222,7 @@ dnl Platform-specific Makefile setup
case "${host}" in
*-*-solaris*) platform=SOLARIS ;;
*-*-linux*) platform=LINUX ;;
*-*-freebsd*) platform=LINUX ;;
*-*-aix*) platform=AIX ;;
*-*-hpux*) platform=HPUX ;;
*-*-os390*) platform=OS390 ;;
@ -228,6 +236,7 @@ dnl Handle -rpath options for shared library paths
case "${host}" in
*-*-solaris*) ld_rpath_suf=":" ;;
*-*-linux*) ld_rpath_suf=" " ;;
*-*-freebsd*) ld_rpath_suf=" " ;;
*-*-aix*) ld_rpath_suf="" ;;
*-*-hpux*) ld_rpath_suf=":" ;;
*-*-os390*) ld_rpath_suf=" " ;;