This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

pthreads.h


One cannot use autoconf to determine characteristics of the target
system with code like:

# Check for thread headers.
AC_CHECK_HEADER(thread.h, [have_thread_h=yes], [have_thread_h=])
AC_CHECK_HEADER(pthread.h, [have_pthread_h=yes], [have_pthread_h=])

	sparc-*-solaris2*)
		tm_file=sparc/sol2.h
		xm_file=sparc/xm-sol2.h
		tmake_file=sparc/t-sol2
		xmake_file=sparc/x-sysv4
		extra_parts="crt1.o crti.o crtn.o gcrt1.o gmon.o crtbegin.o crtend.o"
		fixincludes=fixinc.svr4
		float_format=i128
		broken_install=yes
		if [[ x${enable_threads} = x ]]; then
		    enable_threads=$have_pthread_h
		    if [[ x${enable_threads} = x ]]; then
			enable_threads=$have_thread_h
		    fi
		fi
		if [[ x${enable_threads} = xyes ]]; then
		    if [[ x${have_pthread_h} = xyes ]]; then
			thread_file='posix'
		    else
			thread_file='solaris'
		    fi
		fi

unless one is doing a native build.  For a cross compile, you can
autoconf using the cross compiler, but you need one before you can
build one, so you default to not having threads, build up the
compiler, then figure out that you have threads, and then recompile
the compiler...  :-)

Maybe we need an autoconf macro that can just check for the existence
of a file in a list of directories.  You could then use that directly,
before compiler build.

Another solution, is to just assume that a header is available.  For
example, if all solaris machines have a working thread.h file, then
just always enable threads and expect that file.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]