Commit 28b7c579 authored by Guido van Rossum's avatar Guido van Rossum

Changes for NeXT. Some improvements to long lines.

parent b66f7539
...@@ -4,6 +4,44 @@ AC_PREREQ(2.0) ...@@ -4,6 +4,44 @@ AC_PREREQ(2.0)
AC_INIT(Include/object.h) AC_INIT(Include/object.h)
AC_CONFIG_HEADER(config.h) AC_CONFIG_HEADER(config.h)
# NEXTSTEP stuff
AC_MSG_CHECKING(for --with-next-archs)
AC_ARG_WITH(next-archs,
[--with-next-archs='arch1 arch2 ..' build MAB binary], [
if test -n "$withval"; then
ac_sys_cpu=_`/usr/lib/arch_tool -choose_obj_dir $withval`
ac_arch_flags=`/usr/lib/arch_tool -archify_list $withval`
else
ac_sys_cpu=_`arch`
fi
], [])
AC_MSG_RESULT($with_next_archs)
# Set name for machine-dependent library files
AC_SUBST(MACHDEP)
AC_MSG_CHECKING(MACHDEP)
if test -z "$MACHDEP"
then
if test -f /usr/lib/NextStep/software_version; then
set X `hostinfo | grep 'NeXT Mach.*:' | \
sed -e 's/://' -e 's/\./_/'` && \
ac_sys_system=next && ac_sys_release=$4
MACHDEP="$ac_sys_system$ac_sys_release$ac_sys_cpu"
else
ac_sys_system=`uname -s`
ac_sys_release=`uname -r`
ac_md_system=`echo $ac_sys_system |
tr -d '[/ ]' | tr '[[A-Z]]' '[[a-z]]'`
ac_md_release=`echo $ac_sys_release |
tr -d '[/ ]' | sed 's/\..*//'`
MACHDEP="$ac_md_system$ac_md_release"
fi
case MACHDEP in
'') MACHDEP=unknown;;
esac
fi
AC_MSG_RESULT($MACHDEP)
# checks for alternative programs # checks for alternative programs
AC_MSG_CHECKING(for --without-gcc) AC_MSG_CHECKING(for --without-gcc)
AC_ARG_WITH(gcc, [--without-gcc never use gcc], [ AC_ARG_WITH(gcc, [--without-gcc never use gcc], [
...@@ -15,7 +53,7 @@ AC_ARG_WITH(gcc, [--without-gcc never use gcc], [ ...@@ -15,7 +53,7 @@ AC_ARG_WITH(gcc, [--without-gcc never use gcc], [
*) CC=$withval *) CC=$withval
without_gcc=$withval;; without_gcc=$withval;;
esac], [ esac], [
case `uname -s` in case $ac_sys_system in
OSF1) CC=cc OSF1) CC=cc
without_gcc=;; without_gcc=;;
*) without_gcc=no;; *) without_gcc=no;;
...@@ -46,10 +84,20 @@ else ...@@ -46,10 +84,20 @@ else
INSTALL_PROGRAM="$INSTALL" INSTALL_PROGRAM="$INSTALL"
INSTALL_DATA="$INSTALL -m 644" INSTALL_DATA="$INSTALL -m 644"
fi fi
AC_SUBST(OPT)
# Optimizer/debugger flags passed between Makefiles # Optimizer/debugger flags passed between Makefiles
AC_SUBST(OPT)
if test -z "$OPT" if test -z "$OPT"
then OPT=-O then
case $ac_sys_system in
NeXT|next) \
if test -n "$ac_arch_flags"; then
OPT="-g -Wall -O3 -fomit-frame-pointer $ac_arch_flags";
else
OPT="-g -Wall -O3 -fomit-frame-pointer";
fi;;
*) OPT="-O";;
esac
fi fi
# checks for UNIX variants that set C preprocessor variables # checks for UNIX variants that set C preprocessor variables
...@@ -77,31 +125,12 @@ AC_TYPE_SIGNAL ...@@ -77,31 +125,12 @@ AC_TYPE_SIGNAL
AC_TYPE_SIZE_T AC_TYPE_SIZE_T
AC_TYPE_UID_T AC_TYPE_UID_T
# Set name for machine-dependent library files
AC_SUBST(MACHDEP)
AC_MSG_CHECKING(MACHDEP)
if test -z "$MACHDEP"
then
ac_sys_system=`uname -s | tr -d '[/ ]' | tr '[[A-Z]]' '[[a-z]]'`
ac_sys_release=`uname -r | tr -d '[/ ]' | sed 's/\..*//'`
ac_sys_cpu=`(uname -p 2>/dev/null || uname -m) |
tr '[[A-Z]]' '[[a-z]]'`
## MACHDEP="$ac_sys_system$ac_sys_release$ac_sys_cpu"
MACHDEP="$ac_sys_system$ac_sys_release"
case MACHDEP in
'') MACHDEP=unknown;;
esac
fi
AC_MSG_RESULT($MACHDEP)
# Set info about shared libraries. # Set info about shared libraries.
# XXX This should try things out instead of testing uname!
AC_SUBST(SO) AC_SUBST(SO)
AC_SUBST(LDSHARED) AC_SUBST(LDSHARED)
AC_SUBST(CCSHARED) AC_SUBST(CCSHARED)
AC_SUBST(LINKFORSHARED) AC_SUBST(LINKFORSHARED)
ac_sys_system=`uname -s`
ac_sys_release=`uname -r`
# SO is the extension of shared libraries `(including the dot!) # SO is the extension of shared libraries `(including the dot!)
# -- usually .so, .sl on HP-UX # -- usually .so, .sl on HP-UX
AC_MSG_CHECKING(SO) AC_MSG_CHECKING(SO)
...@@ -109,6 +138,7 @@ if test -z "$SO" ...@@ -109,6 +138,7 @@ if test -z "$SO"
then then
case $ac_sys_system in case $ac_sys_system in
hp*|HP*) SO=.sl;; hp*|HP*) SO=.sl;;
NeXT|next) SO=.a;; # no shared libs on NeXT 3.3 and less
*) SO=.so;; *) SO=.so;;
esac esac
fi fi
...@@ -127,6 +157,7 @@ then ...@@ -127,6 +157,7 @@ then
DYNIX/ptx*) LDSHARED="ld -G";; DYNIX/ptx*) LDSHARED="ld -G";;
Linux*) LDSHARED="gcc -shared";; Linux*) LDSHARED="gcc -shared";;
FreeBSD*) LDSHARED="ld -Bshareable";; FreeBSD*) LDSHARED="ld -Bshareable";;
NeXT|next/3*) LDSHARED="ld -u libsys_s";;
*) LDSHARED="ld";; *) LDSHARED="ld";;
esac esac
fi fi
...@@ -206,6 +237,9 @@ AC_MSG_RESULT($withval) ...@@ -206,6 +237,9 @@ AC_MSG_RESULT($withval)
if test -d "$withval" if test -d "$withval"
then LIBS="$LIBS -L$withval" then LIBS="$LIBS -L$withval"
fi fi
AC_CHECK_HEADER(mach/cthreads.h, [AC_DEFINE(WITH_THREAD)
AC_DEFINE(C_THREADS)
LIBOBJS="$LIBOBJS thread.o"],[
AC_CHECK_LIB(pthreads, pthread_create, [AC_DEFINE(WITH_THREAD) AC_CHECK_LIB(pthreads, pthread_create, [AC_DEFINE(WITH_THREAD)
AC_DEFINE(_POSIX_THREADS) AC_DEFINE(_POSIX_THREADS)
LIBS="$LIBS -lpthreads" LIBS="$LIBS -lpthreads"
...@@ -214,7 +248,7 @@ AC_CHECK_LIB(pthread, pthread_create, [AC_DEFINE(WITH_THREAD) ...@@ -214,7 +248,7 @@ AC_CHECK_LIB(pthread, pthread_create, [AC_DEFINE(WITH_THREAD)
AC_DEFINE(_POSIX_THREADS) AC_DEFINE(_POSIX_THREADS)
LIBS="$LIBS -lpthread" LIBS="$LIBS -lpthread"
LIBOBJS="$LIBOBJS thread.o"]) LIBOBJS="$LIBOBJS thread.o"])
]) ])])
AC_CHECK_LIB(mpc, usconfig, [AC_DEFINE(WITH_THREAD) AC_CHECK_LIB(mpc, usconfig, [AC_DEFINE(WITH_THREAD)
LIBS="$LIBS -lmpc" LIBS="$LIBS -lmpc"
LIBOBJS="$LIBOBJS thread.o"]) LIBOBJS="$LIBOBJS thread.o"])
...@@ -258,7 +292,7 @@ AC_CHECK_FUNCS(chown clock dlopen flock ftime ftruncate \ ...@@ -258,7 +292,7 @@ AC_CHECK_FUNCS(chown clock dlopen flock ftime ftruncate \
link lstat mkfifo nice plock putenv readlink \ link lstat mkfifo nice plock putenv readlink \
select setgid setuid setsid setpgid setpgrp setvbuf \ select setgid setuid setsid setpgid setpgrp setvbuf \
sigaction siginterrupt sigrelse strftime symlink \ sigaction siginterrupt sigrelse strftime symlink \
tcgetpgrp tcsetpgrp times truncate uname waitpid) \ tcgetpgrp tcsetpgrp times truncate uname waitpid)
AC_REPLACE_FUNCS(dup2 getcwd strerror memmove) AC_REPLACE_FUNCS(dup2 getcwd strerror memmove)
AC_CHECK_FUNC(getpgrp, AC_TRY_COMPILE([#include <unistd.h>], [getpgrp(0);], AC_DEFINE(GETPGRP_HAVE_ARG))) AC_CHECK_FUNC(getpgrp, AC_TRY_COMPILE([#include <unistd.h>], [getpgrp(0);], AC_DEFINE(GETPGRP_HAVE_ARG)))
AC_CHECK_FUNC(setpgrp, AC_TRY_COMPILE([#include <unistd.h>], [setpgrp(0,0);], AC_DEFINE(SETPGRP_HAVE_ARG))) AC_CHECK_FUNC(setpgrp, AC_TRY_COMPILE([#include <unistd.h>], [setpgrp(0,0);], AC_DEFINE(SETPGRP_HAVE_ARG)))
...@@ -402,4 +436,8 @@ test $ac_cv_func_getopt = no && LIBOBJS="$LIBOBJS getopt.o" ...@@ -402,4 +436,8 @@ test $ac_cv_func_getopt = no && LIBOBJS="$LIBOBJS getopt.o"
AC_SUBST(LIBOBJS)dnl AC_SUBST(LIBOBJS)dnl
# generate output files # generate output files
AC_OUTPUT(Makefile Objects/Makefile Parser/Makefile Python/Makefile Modules/Makefile.pre) AC_OUTPUT(Makefile \
Objects/Makefile \
Parser/Makefile \
Python/Makefile \
Modules/Makefile.pre)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment