Kaydet (Commit) 55f0cf33 authored tarafından Neil Schemenauer's avatar Neil Schemenauer

- build now happens in toplevel directory, add subdir paths to filenames

- change EXE to EXTEXT, there is an autoconf macro for it
- use PROG_INSTALL macro rather than always using install-sh
- add option to disable signal module (simplifies the makefile)
- create subdirs for object files (when building out of src dir)
- don't generate subdir makefiles
- generate "boot" makefile
üst fa004ad3
...@@ -82,7 +82,6 @@ then ...@@ -82,7 +82,6 @@ then
fi fi
AC_MSG_RESULT($MACHDEP) 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], [
...@@ -131,7 +130,7 @@ AC_MSG_RESULT($without_gcc) ...@@ -131,7 +130,7 @@ AC_MSG_RESULT($without_gcc)
AC_SUBST(CXX) AC_SUBST(CXX)
AC_SUBST(MAINOBJ) AC_SUBST(MAINOBJ)
MAINOBJ=python.o MAINOBJ=Modules/python.o
AC_MSG_CHECKING(for --with-cxx=<compiler>) AC_MSG_CHECKING(for --with-cxx=<compiler>)
AC_ARG_WITH(cxx, [ --with-cxx=<compiler> enable C++ support],[ AC_ARG_WITH(cxx, [ --with-cxx=<compiler> enable C++ support],[
check_cxx=no check_cxx=no
...@@ -139,7 +138,7 @@ AC_ARG_WITH(cxx, [ --with-cxx=<compiler> enable C++ support],[ ...@@ -139,7 +138,7 @@ AC_ARG_WITH(cxx, [ --with-cxx=<compiler> enable C++ support],[
no) CXX= no) CXX=
with_cxx=no;; with_cxx=no;;
*) CXX=$withval *) CXX=$withval
MAINOBJ=ccpython.o MAINOBJ=Modules/ccpython.o
with_cxx=$withval;; with_cxx=$withval;;
esac], [ esac], [
with_cxx=no with_cxx=no
...@@ -163,7 +162,6 @@ then ...@@ -163,7 +162,6 @@ then
fi fi
fi fi
# If the user switches compilers, we can't believe the cache # If the user switches compilers, we can't believe the cache
if test ! -z "$ac_cv_prog_CC" -a ! -z "$CC" -a "$CC" != "$ac_cv_prog_CC" if test ! -z "$ac_cv_prog_CC" -a ! -z "$CC" -a "$CC" != "$ac_cv_prog_CC"
then then
...@@ -172,15 +170,7 @@ then ...@@ -172,15 +170,7 @@ then
fi fi
AC_PROG_CC AC_PROG_CC
AC_SUBST(EXE) AC_EXEEXT
AC_MSG_CHECKING(for --with-suffix)
AC_ARG_WITH(suffix, [ --with-suffix=.exe set executable suffix],[
case $withval in
no) EXE=;;
yes) EXE=.exe;;
*) EXE=$withval;;
esac])
AC_MSG_RESULT($EXE)
case $MACHDEP in case $MACHDEP in
bsdos*) bsdos*)
...@@ -205,10 +195,9 @@ esac ...@@ -205,10 +195,9 @@ esac
# without shared libraries, LDLIBRARY is the same as LIBRARY (defined in # without shared libraries, LDLIBRARY is the same as LIBRARY (defined in
# the Makefiles). On Cygwin LDLIBRARY is the import library, DLLLIBRARY is the # the Makefiles). On Cygwin LDLIBRARY is the import library, DLLLIBRARY is the
# shared (i.e., DLL) library. # shared (i.e., DLL) library.
AC_SUBST(MAKE_LDLIBRARY)
AC_SUBST(LDLIBRARY) AC_SUBST(LDLIBRARY)
AC_SUBST(DLLLIBRARY) AC_SUBST(DLLLIBRARY)
LDLIBRARY='' LDLIBRARY='$(LIBRARY)'
DLLLIBRARY='' DLLLIBRARY=''
# LINKCC is the command that links the python executable -- default is $(CC). # LINKCC is the command that links the python executable -- default is $(CC).
...@@ -254,39 +243,15 @@ beos*) ...@@ -254,39 +243,15 @@ beos*)
;; ;;
cygwin*) cygwin*)
LDLIBRARY='libpython$(VERSION).dll.a' LDLIBRARY='libpython$(VERSION).dll.a'
DLLLIBRARY='$(basename $(LDLIBRARY))' DLLLIBRARY='libpython$(VERSION).dll'
;; ;;
esac esac
AC_MSG_RESULT($LDLIBRARY) AC_MSG_RESULT($LDLIBRARY)
# If LDLIBRARY is different from LIBRARY, emit a rule to build it.
if test -z "$LDLIBRARY"
then
LDLIBRARY='libpython$(VERSION).a'
MAKE_LDLIBRARY="true"
else
case $MACHDEP in
cygwin*) MAKE_LDLIBRARY='$(MAKE) -C Modules ../$(DLLLIBRARY)';;
*) MAKE_LDLIBRARY='$(MAKE) $(LDLIBRARY)';;
esac
fi
AC_PROG_RANLIB AC_PROG_RANLIB
AC_SUBST(AR) AC_SUBST(AR)
AC_CHECK_PROGS(AR, ar aal, ar) AC_CHECK_PROGS(AR, ar aal, ar)
AC_SUBST(INSTALL) AC_PROG_INSTALL
AC_SUBST(INSTALL_PROGRAM)
AC_SUBST(INSTALL_DATA)
# Install just never works :-(
if test -z "$INSTALL"
then
INSTALL=cp
INSTALL_PROGRAM=cp
INSTALL_DATA=cp
else
INSTALL_PROGRAM="$INSTALL"
INSTALL_DATA="$INSTALL -m 644"
fi
# Not every filesystem supports hard links # Not every filesystem supports hard links
AC_SUBST(LN) AC_SUBST(LN)
...@@ -298,7 +263,7 @@ if test -z "$LN" ; then ...@@ -298,7 +263,7 @@ if test -z "$LN" ; then
esac esac
fi fi
# Optimizer/debugger flags passed between Makefiles # Optimizer/debugger flags
AC_SUBST(OPT) AC_SUBST(OPT)
if test -z "$OPT" if test -z "$OPT"
then then
...@@ -756,6 +721,27 @@ AC_CHECK_LIB(crypt, crypt, ...@@ -756,6 +721,27 @@ AC_CHECK_LIB(crypt, crypt,
[USE_CRYPT_MODULE="#" [USE_CRYPT_MODULE="#"
HAVE_LIBCRYPT=""]) HAVE_LIBCRYPT=""])
# Determine if signalmodule should be used.
AC_SUBST(USE_SIGNAL_MODULE)
AC_SUBST(SIGNAL_OBJS)
AC_MSG_CHECKING(for --with-signal-module)
AC_ARG_WITH(signal-module,
[ --with-signal-module disable/enable signal module])
if test -z "$with_signal_module"
then with_signal_module="yes"
fi
AC_MSG_RESULT($with_signal_module)
if test "${with_signal_module}" = "yes"; then
USE_SIGNAL_MODULE=""
SIGNAL_OBJS=""
else
USE_SIGNAL_MODULE="#"
SIGNAL_OBJS="Parser/intrcheck.o Python/sigcheck.o"
fi
# This is used to generate Setup.config # This is used to generate Setup.config
AC_SUBST(USE_THREAD_MODULE) AC_SUBST(USE_THREAD_MODULE)
USE_THREAD_MODULE="" USE_THREAD_MODULE=""
...@@ -798,7 +784,7 @@ else ...@@ -798,7 +784,7 @@ else
AC_DEFINE(_REENTRANT) AC_DEFINE(_REENTRANT)
AC_CHECK_HEADER(mach/cthreads.h, [AC_DEFINE(WITH_THREAD) AC_CHECK_HEADER(mach/cthreads.h, [AC_DEFINE(WITH_THREAD)
AC_DEFINE(C_THREADS) AC_DEFINE(C_THREADS)
LIBOBJS="$LIBOBJS thread.o"],[ LIBOBJS="$LIBOBJS Python/thread.o"],[
AC_MSG_CHECKING(for --with-pth) AC_MSG_CHECKING(for --with-pth)
AC_ARG_WITH(pth, AC_ARG_WITH(pth,
[ --with-pth use GNU pth threading libraries], [ [ --with-pth use GNU pth threading libraries], [
...@@ -806,51 +792,51 @@ else ...@@ -806,51 +792,51 @@ else
AC_DEFINE(WITH_THREAD) AC_DEFINE(WITH_THREAD)
AC_DEFINE(HAVE_PTH) AC_DEFINE(HAVE_PTH)
LIBS="-lpth $LIBS" LIBS="-lpth $LIBS"
LIBOBJS="$LIBOBJS thread.o"],[ LIBOBJS="$LIBOBJS Python/thread.o"],[
AC_MSG_RESULT(no) AC_MSG_RESULT(no)
AC_CHECK_LIB(pthread, pthread_create, [AC_DEFINE(WITH_THREAD) AC_CHECK_LIB(pthread, pthread_create, [AC_DEFINE(WITH_THREAD)
AC_DEFINE(_POSIX_THREADS) AC_DEFINE(_POSIX_THREADS)
LIBS="-lpthread $LIBS" LIBS="-lpthread $LIBS"
LIBOBJS="$LIBOBJS thread.o"],[ LIBOBJS="$LIBOBJS Python/thread.o"],[
AC_CHECK_FUNC(pthread_detach, [AC_DEFINE(WITH_THREAD) AC_CHECK_FUNC(pthread_detach, [AC_DEFINE(WITH_THREAD)
case $ac_sys_system in case $ac_sys_system in
Darwin*) ;; Darwin*) ;;
*) AC_DEFINE(_POSIX_THREADS);; *) AC_DEFINE(_POSIX_THREADS);;
esac esac
LIBOBJS="$LIBOBJS thread.o"],[ LIBOBJS="$LIBOBJS Python/thread.o"],[
AC_CHECK_HEADER(kernel/OS.h, [AC_DEFINE(WITH_THREAD) AC_CHECK_HEADER(kernel/OS.h, [AC_DEFINE(WITH_THREAD)
AC_DEFINE(BEOS_THREADS) AC_DEFINE(BEOS_THREADS)
LIBOBJS="$LIBOBJS thread.o"],[ LIBOBJS="$LIBOBJS Python/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"
LIBOBJS="$LIBOBJS thread.o"], [ LIBOBJS="$LIBOBJS Python/thread.o"], [
AC_CHECK_LIB(c_r, pthread_create, [AC_DEFINE(WITH_THREAD) AC_CHECK_LIB(c_r, pthread_create, [AC_DEFINE(WITH_THREAD)
AC_DEFINE(_POSIX_THREADS) AC_DEFINE(_POSIX_THREADS)
LIBS="$LIBS -lc_r" LIBS="$LIBS -lc_r"
LIBOBJS="$LIBOBJS thread.o"], [ LIBOBJS="$LIBOBJS Python/thread.o"], [
AC_CHECK_LIB(thread, __d6_pthread_create, [AC_DEFINE(WITH_THREAD) AC_CHECK_LIB(thread, __d6_pthread_create, [AC_DEFINE(WITH_THREAD)
AC_DEFINE(_POSIX_THREADS) AC_DEFINE(_POSIX_THREADS)
LIBS="$LIBS -lthread" LIBS="$LIBS -lthread"
LIBOBJS="$LIBOBJS thread.o"], [ LIBOBJS="$LIBOBJS Python/thread.o"], [
AC_CHECK_LIB(pthread, __pthread_create_system, [AC_DEFINE(WITH_THREAD) AC_CHECK_LIB(pthread, __pthread_create_system, [AC_DEFINE(WITH_THREAD)
AC_DEFINE(_POSIX_THREADS) AC_DEFINE(_POSIX_THREADS)
LIBS="$LIBS -lpthread" LIBS="$LIBS -lpthread"
LIBOBJS="$LIBOBJS thread.o"], [ LIBOBJS="$LIBOBJS Python/thread.o"], [
AC_CHECK_LIB(cma, pthread_create, [AC_DEFINE(WITH_THREAD) AC_CHECK_LIB(cma, pthread_create, [AC_DEFINE(WITH_THREAD)
AC_DEFINE(_POSIX_THREADS) AC_DEFINE(_POSIX_THREADS)
LIBS="$LIBS -lcma" LIBS="$LIBS -lcma"
LIBOBJS="$LIBOBJS thread.o"],[ LIBOBJS="$LIBOBJS Python/thread.o"],[
USE_THREAD_MODULE="#"]) USE_THREAD_MODULE="#"])
])])])])])])])])]) ])])])])])])])])])
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 Python/thread.o"
USE_THREAD_MODULE=""]) USE_THREAD_MODULE=""])
AC_CHECK_LIB(thread, thr_create, [AC_DEFINE(WITH_THREAD) AC_CHECK_LIB(thread, thr_create, [AC_DEFINE(WITH_THREAD)
LIBS="$LIBS -lthread" LIBS="$LIBS -lthread"
LIBOBJS="$LIBOBJS thread.o" LIBOBJS="$LIBOBJS Python/thread.o"
USE_THREAD_MODULE=""]) USE_THREAD_MODULE=""])
if test "$USE_THREAD_MODULE" != "#" if test "$USE_THREAD_MODULE" != "#"
...@@ -1387,22 +1373,35 @@ cat >> confdefs.h <<\EOF ...@@ -1387,22 +1373,35 @@ cat >> confdefs.h <<\EOF
EOF EOF
AC_CHECK_TYPE(socklen_t, int) AC_CHECK_TYPE(socklen_t, int)
AC_MSG_CHECKING(for Modules/Setup) #AC_MSG_CHECKING(for Modules/Setup)
if test ! -f Modules/Setup ; then #if test ! -f Modules/Setup ; then
if test ! -d Modules ; then # if test ! -d Modules ; then
mkdir Modules # mkdir Modules
# fi
# cp "$srcdir/Modules/Setup.dist" Modules/Setup
# AC_MSG_RESULT(creating)
#else
# AC_MSG_RESULT(already exists)
#fi
AC_SUBST(SRCDIRS)
SRCDIRS="Parser Grammar Objects Python Modules"
AC_MSG_CHECKING(for build directoris)
for dir in $SRCDIRS; do
if test ! -d $dir; then
mkdir $dir
fi fi
cp "$srcdir/Modules/Setup.dist" Modules/Setup done
AC_MSG_RESULT(creating) AC_MSG_RESULT(done)
else
AC_MSG_RESULT(already exists)
fi
# generate output files # generate output files
AC_OUTPUT(Makefile setup.cfg \ echo "creating Makefile"
Objects/Makefile \
Parser/Makefile \ # "boot" Makefile
Grammar/Makefile \ cat >Makefile <<\EOF
Python/Makefile \ # This file is automaticly generated by configure.
Modules/Makefile.pre \ all:
Modules/Setup.config) \$(MAKE) -f Makefile.pre Makefile
EOF
AC_OUTPUT(Makefile.pre Modules/Setup.config setup.cfg)
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