gxx_include_dir='${prefix}/include/g++'
fi
+# Enable threads
+# Pass with no value to take the default
+# Pass with a value to specify a thread package
+AC_ARG_ENABLE(threads,
+[ --enable-threads enable thread usage for target GCC.
+ --enable-threads=LIB use LIB thread package for target GCC.],
+if [[[ x$enable_threads = xno ]]]; then
+ enable_threads=''
+fi,
+enable_threads='')
+
+# Check if a valid thread package
+case x${enable_threads} in
+ x | xno)
+ # No threads
+ thread_file='single'
+ ;;
+ xyes)
+ # default
+ thread_file=''
+ ;;
+ xdecosf1 | xirix | xmach | xos2 | xposix | xpthreads | xsingle | \
+ xsolaris | xwin32)
+ thread_file=$enable_threads
+ ;;
+ *)
+ echo "$enable_threads is an unknown thread package" 1>&2
+ exit 1
+ ;;
+esac
+
# Determine the host, build, and target systems
AC_CANONICAL_SYSTEM
truncate_target=
# Set this if gdb needs a dir command with `dirname $out_file`
gdb_needs_out_file_path=
- # Set this to the tag of the Objective-C runtime thread file to compile
- # It may be set (in the absence of autoconf configuration) by
- # --enable-objcthreads=posix (for instance) where it's not
- # well defined as is the case for Linux.
- objc_thread_file=
- case x${enable_objcthreads-x} in
- x | xyes)
- echo "\`--enable-objcthreads' must be passed a value." 1>&2
- exit 1 ;;
- esac
# Set this if the build machine requires executables to have a
# file name suffix.
exeext=
alpha-*-linux*ecoff*)
tm_file="${tm_file} alpha/linux.h"
xm_file="${xm_file} alpha/xm-linux.h"
- objc_thread_file=${enable_objcthreads-single}
target_cpu_default=4
xmake_file=none
fixincludes=Makefile.in
then
extra_programs=ld.exe
fi
- objc_thread_file=${enable_objcthreads-win32}
+ if [[ x$thread_file = x ]]; then
+ thread_file='win32'
+ fi
;;
alpha-dec-vms*)
tm_file=alpha/vms.h
tmake_file=i386/t-next
xmake_file=i386/x-next
extra_objs=nextstep.o
- objc_thread_file=${enable_objcthreads-mach}
+ if [[ x$thread_file = x ]]; then
+ thread_file='mach'
+ fi
;;
i[[3456]]86-sequent-bsd*) # 80386 from Sequent
use_collect2=yes
fixincludes=Makefile.in #On Linux, the headers are ok already.
broken_install=yes
gnu_ld=yes
- objc_thread_file=${enable_objcthreads-single}
;;
i[[3456]]86-*-linux*aout*) # Intel 80386's running Linux
xm_file=i386/xm-linux.h # with a.out format
fixincludes=Makefile.in #On Linux, the headers are ok already.
broken_install=yes
gnu_ld=yes
- objc_thread_file=${enable_objcthreads-single}
;;
i[[3456]]86-*-linux*) # Intel 80386's running Linux
xm_file=i386/xm-linux.h # with ELF format
fixincludes=Makefile.in #On Linux, the headers are ok already.
broken_install=yes
gnu_ld=yes
- objc_thread_file=${enable_objcthreads-single}
;;
i[[3456]]86-*-gnu*)
;;
xmake_file=x-svr4
fixincludes=fixinc.svr4
broken_install=yes
- objc_thread_file=${enable_objcthreads-solaris}
+ if [[ x$thread_file = x ]]; then
+ thread_file='solaris'
+ fi
;;
i[[3456]]86-*-sysv4*) # Intel 80386's running system V.4
xm_file=i386/xm-sysv4.h
xmake_file=i386/x-cygwin32
extra_objs=winnt.o
fixincludes=Makefile.in
- objc_thread_file=${enable_objcthreads-win32}
+ if [[ x$thread_file = x ]]; then
+ thread_file='win32'
+ fi
exeext=.exe
;;
i[[3456]]86-*-mingw32)
extra_objs=winnt.o
xmake_file=i386/x-cygwin32
fixincludes=Makefile.in
- objc_thread_file=${enable_objcthreads-win32}
+ if [[ x$thread_file = x ]]; then
+ thread_file='win32'
+ fi
exeext=.exe
;;
i[[3456]]86-*-winnt3*)
then
extra_programs=ld.exe
fi
- objc_thread_file=${enable_objcthreads-win32}
+ if [[ x$thread_file = x ]]; then
+ thread_file='win32'
+ fi
;;
i[[3456]]86-dg-dgux)
xm_file=i386/xm-dgux.h
xmake_file=m68k/x-next
extra_objs=nextstep.o
extra_headers=math-68881.h
- objc_thread_file=${enable_objcthreads-mach}
+ if [[ x$thread_file = x ]]; then
+ thread_file='mach'
+ fi
;;
m68k-sun-sunos3*)
if [[ x$with_fp = xno ]]
fixincludes=Makefile.in #On Linux, the headers are ok already.
extra_headers=math-68881.h
gnu_ld=yes
- objc_thread_file=${enable_objcthreads-single}
;;
m68k-*-linux*) # Motorola m68k's running Linux
xm_file=m68k/xm-linux.h # with ELF format
fixincludes=Makefile.in #On Linux, the headers are ok already.
extra_headers=math-68881.h
gnu_ld=yes
- objc_thread_file=${enable_objcthreads-single}
;;
m68k-*-psos*)
tmake_file=m68k/t-m68kbare
fixincludes=fixinc.irix
xmake_file=mips/x-iris6
tmake_file=mips/t-iris6
- objc_thread_file=${enable_objcthreads-irix}
+ if [[ x$thread_file = x ]]; then
+ thread_file='irix'
+ fi
;;
mips-sgi-irix5cross64) # Irix5 host, Irix 6 target, cross64
tm_file=mips/cross64.h
tmake_file=mips/t-cross64
# See comment in mips/iris[56].h files.
use_collect2=yes
- objc_thread_file=${enable_objcthreads-irix}
+ if [[ x$thread_file = x ]]; then
+ thread_file='irix'
+ fi
;;
mips-sni-sysv4)
if [[ x$gas = xyes ]]
tmake_file=mips/t-mips-gas
# See comment in mips/iris5.h file.
use_collect2=yes
- objc_thread_file=${enable_objcthreads-irix}
+ if [[ x$thread_file = x ]]; then
+ thread_file='irix'
+ fi
;;
mips-sgi-irix4loser*) # Mostly like a MIPS.
tm_file=mips/iris4loser.h
then
use_collect2=yes
fi
- objc_thread_file=${enable_objcthreads-irix}
+ if [[ x$thread_file = x ]]; then
+ thread_file='irix'
+ fi
;;
mips-sgi-irix4*) # Mostly like a MIPS.
tm_file=mips/iris4.h
then
use_collect2=yes
fi
- objc_thread_file=${enable_objcthreads-irix}
+ if [[ x$thread_file = x ]]; then
+ thread_file='irix'
+ fi
;;
mips-sgi-*) # Mostly like a MIPS.
tm_file=mips/iris3.h
fi
xmake_file=rs6000/x-sysv4
fixincludes=Makefile.in
- objc_thread_file=${enable_objcthreads-single}
extra_headers=ppc-asm.h
;;
powerpc-*-vxworks*)
tmake_file=rs6000/t-winnt
# extra_objs=pe.o
fixincludes=Makefile.in
- objc_thread_file=${enable_objcthreads-win32}
+ if [[ x$thread_file = x ]]; then
+ thread_file='win32'
+ fi
extra_headers=ppc-asm.h
;;
powerpcle-*-pe | powerpcle-*-cygwin32)
xmake_file=rs6000/x-cygwin32
# extra_objs=pe.o
fixincludes=Makefile.in
- objc_thread_file=${enable_objcthreads-win32}
+ if [[ x$thread_file = x ]]; then
+ thread_file='win32'
+ fi
exeext=.exe
extra_headers=ppc-asm.h
;;
fixincludes=Makefile.in #On Linux, the headers are ok already.
broken_install=yes
gnu_ld=yes
- objc_thread_file=${enable_objcthreads-single}
;;
sparc-*-linux*) # Sparc's running Linux, ELF
xm_file=sparc/xm-linux.h
# Don't use it. Linux uses a slightly different one.
# The real one comes with the Linux C library.
#extra_parts="crtbegin.o crtend.o"
- objc_thread_file=${enable_objcthreads-single}
;;
sparc-*-lynxos*)
if [[ x$gas = xyes ]]
extra_parts="crt1.o crti.o crtn.o gcrt1.o gmon.o crtbegin.o crtend.o"
fixincludes=fixinc.svr4
broken_install=yes
- objc_thread_file=${enable_objcthreads-solaris}
+ if [[ x$thread_file = x ]]; then
+ thread_file='solaris'
+ fi
;;
sparc-*-sunos4.0*)
tm_file=sparc/sunos4.h
fi
fi
-if [[ x$objc_thread_file = x ]]
-then objc_thread_file=${enable_objcthreads-single}
+if [[ x$thread_file = x ]]
+then thread_file='single'
fi
-echo "Using \`$srcdir/objc/thr-${objc_thread_file}.c' as Objective-C Runtime thread file."
# Set up the header files.
# $links is the list of header files to create.
AC_SUBST(host_xm_file_list)
AC_SUBST(lang_specs_files)
AC_SUBST(lang_options_files)
-AC_SUBST(objc_thread_file)
+AC_SUBST(thread_file)
AC_SUBST(version)
AC_SUBST(local_prefix)
AC_SUBST(gxx_include_dir)
host_xm_file_sub='${host_xm_file_sub}'
lang_specs_files='${lang_specs_files}'
lang_options_files='${lang_options_files}'
-objc_thread_file='${objc_thread_file}'
+thread_file='${thread_file}'
version='${version}'
local_prefix='${local_prefix}'
gxx_include_dir='${gxx_include_dir}'