[Python-checkins] python/dist/src Makefile.pre.in,1.107,1.108 configure,1.372,1.373 configure.in,1.383,1.384 setup.py,1.131,1.132

montanaro@users.sourceforge.net montanaro@users.sourceforge.net
Wed, 01 Jan 2003 12:07:53 -0800


Update of /cvsroot/python/python/dist/src
In directory sc8-pr-cvs1:/tmp/cvs-serv24833

Modified Files:
	Makefile.pre.in configure configure.in setup.py 
Log Message:
Split OPT make variable into OPT and BASECFLAGS.  The latter contains those
compiler flags which are necessary to get a clean compile.  The former is
for user-specified optimizer, debug, trace fiddling.  See patch 640843.

Add /sw/lib and /sw/include to setup.py search paths on Darwin to take
advantage of fink goodies.

Add scriptsinstall target to Makefile to install certain scripts from
Tools/scripts directory.


Index: Makefile.pre.in
===================================================================
RCS file: /cvsroot/python/python/dist/src/Makefile.pre.in,v
retrieving revision 1.107
retrieving revision 1.108
diff -C2 -d -r1.107 -r1.108
*** Makefile.pre.in	31 Dec 2002 13:48:28 -0000	1.107
--- Makefile.pre.in	1 Jan 2003 20:07:42 -0000	1.108
***************
*** 55,59 ****
  # Compiler options
  OPT=		@OPT@
! CFLAGS=		$(OPT)
  CPPFLAGS=	-I. -I$(srcdir)/Include
  LDFLAGS=	@LDFLAGS@
--- 55,60 ----
  # Compiler options
  OPT=		@OPT@
! BASECFLAGS=	@BASECFLAGS@
! CFLAGS=		$(BASECFLAGS) $(OPT)
  CPPFLAGS=	-I. -I$(srcdir)/Include
  LDFLAGS=	@LDFLAGS@
***************
*** 844,847 ****
--- 845,855 ----
  	--install-scripts=$(BINDIR) \
  	--install-platlib=$(DESTSHARED)
+ 
+ # This installs a few of the useful scripts in Tools/scripts
+ scriptsinstall:
+ 	SRCDIR=$(srcdir) \
+ 	./$(BUILDPYTHON) $(srcdir)/Tools/scripts/setup.py install \
+ 	--prefix=$(prefix) \
+ 	--install-scripts=$(BINDIR)
  
  # Build the toplevel Makefile

Index: configure
===================================================================
RCS file: /cvsroot/python/python/dist/src/configure,v
retrieving revision 1.372
retrieving revision 1.373
diff -C2 -d -r1.372 -r1.373
*** configure	1 Jan 2003 09:51:07 -0000	1.372
--- configure	1 Jan 2003 20:07:43 -0000	1.373
***************
*** 1,6 ****
  #! /bin/sh
! # From configure.in Revision: 1.382 .
  # Guess values for system-dependent variables and create Makefiles.
! # Generated by GNU Autoconf 2.53 for python 2.3.
  #
  # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
--- 1,6 ----
  #! /bin/sh
! # From configure.in Revision: 1.383 .
  # Guess values for system-dependent variables and create Makefiles.
[...4685 lines suppressed...]
!       as_dirs="$as_dir $as_dirs"
!       as_dir=`(dirname "$as_dir") 2>/dev/null ||
! $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
!          X"$as_dir" : 'X\(//\)[^/]' \| \
!          X"$as_dir" : 'X\(//\)$' \| \
!          X"$as_dir" : 'X\(/\)' \| \
!          .     : '\(.\)' 2>/dev/null ||
! echo X"$as_dir" |
!     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
!   	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
!   	  /^X\(\/\/\)$/{ s//\1/; q; }
!   	  /^X\(\/\).*/{ s//\1/; q; }
!   	  s/.*/./; q'`
!     done
!     test ! -n "$as_dirs" || mkdir $as_dirs
!   fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
! echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
!    { (exit 1); exit 1; }; }; }
  
        rm -f $ac_file

Index: configure.in
===================================================================
RCS file: /cvsroot/python/python/dist/src/configure.in,v
retrieving revision 1.383
retrieving revision 1.384
diff -C2 -d -r1.383 -r1.384
*** configure.in	1 Jan 2003 09:51:10 -0000	1.383
--- configure.in	1 Jan 2003 20:07:47 -0000	1.384
***************
*** 169,172 ****
--- 169,181 ----
  
  # checks for alternative programs
+ 
+ # compiler flags are generated in two sets, BASECFLAGS and OPT.  OPT is just
+ # for debug/optimization stuff.  BASECFLAGS is for flags that are required
+ # just to get things to compile and link.  Users are free to override OPT
+ # when running configure or make.  The build should not break if they do.
+ # BASECFLAGS should generally not be messed with, however.
+ 
+ # XXX shouldn't some/most/all of this code be merged with the stuff later
+ # on that fiddles with OPT and BASECFLAGS?
  AC_MSG_CHECKING(for --without-gcc)
  AC_ARG_WITH(gcc,
***************
*** 189,193 ****
  			CC=mwcc
  			without_gcc=yes
! 			OPT="-O -export pragma"
  			LDFLAGS="$LDFLAGS -nodup"
  			;;
--- 198,203 ----
  			CC=mwcc
  			without_gcc=yes
! 			BASECFLAGS="$BASECFLAGS -export pragma"
! 			OPT="$OPT -O"
  			LDFLAGS="$LDFLAGS -nodup"
  			;;
***************
*** 195,199 ****
  			CC=gcc
  			without_gcc=no
! 			OPT=-O
  			;;
  		*)
--- 205,209 ----
  			CC=gcc
  			without_gcc=no
! 			OPT="$OPT -O"
  			;;
  		*)
***************
*** 485,489 ****
    dguxR4)
          LDLIBRARY='libpython$(VERSION).so'
!         OPT="$OPT -pic"
          ;;
    esac
--- 495,499 ----
    dguxR4)
          LDLIBRARY='libpython$(VERSION).so'
!         BASECFLAGS="$BASECFLAGS -pic"
          ;;
    esac
***************
*** 532,542 ****
  [AC_MSG_RESULT(no)])
  
  # Optimizer/debugger flags
  AC_SUBST(OPT)
  if test -z "$OPT"
  then
! 	case $GCC in
! 	yes)
! 		case $ac_cv_prog_cc_g in
  	yes)
  	    if test "$Py_DEBUG" = 'true' ; then
--- 542,566 ----
  [AC_MSG_RESULT(no)])
  
+ # XXX Shouldn't the code above that fiddles with BASECFLAGS and OPT be
+ # merged with this chunk of code?
+ 
  # Optimizer/debugger flags
+ # ------------------------
+ # (The following bit of code is complicated enough - please keep things
+ # indented properly.  Just pretend you're editing Python code. ;-)
+ 
+ # There are two parallel sets of case statements below, one that checks to
+ # see if OPT was set and one that does BASECFLAGS setting based upon
+ # compiler and platform.  BASECFLAGS tweaks need to be made even if the
+ # user set OPT.
+ 
+ # tweak OPT based on compiler and platform, only if the user didn't set
+ # it on the command line
  AC_SUBST(OPT)
  if test -z "$OPT"
  then
!     case $GCC in
!     yes)
! 	case $ac_cv_prog_cc_g in
  	yes)
  	    if test "$Py_DEBUG" = 'true' ; then
***************
*** 546,574 ****
  	    else
  		OPT="-g -O3 -Wall -Wstrict-prototypes"
! 	    fi;;
  	*)
! 	    OPT="-O3 -Wall -Wstrict-prototypes";;
  	esac
  	case $ac_sys_system in
! 	    SCO_SV*) OPT="$OPT -m486 -DSCO5";;
! 	esac
  	;;
      *)
! 	case $ac_sys_system in
! 	OpenUNIX*|UnixWare*)
! 	    OPT="-O -K pentium,host,inline,loop_unroll,alloca ";;
! 	SCO_SV*)
! 	    CFLAGS="$CFLAGS -belf"
! 	    OPT="-belf -O -Ki486 -DSCO5";;
! 	*)
! 	    OPT="-O";;
! 	esac
      esac
      case $ac_sys_system in
!     Darwin*)
!     	OPT="$OPT -Wno-long-double -no-cpp-precomp";;
      esac
  fi
  
  if test "$Py_DEBUG" = 'true'; then
    :
--- 570,627 ----
  	    else
  		OPT="-g -O3 -Wall -Wstrict-prototypes"
! 	    fi
! 	    ;;
  	*)
! 	    OPT="-O3 -Wall -Wstrict-prototypes"
! 	    ;;
  	esac
  	case $ac_sys_system in
! 	    SCO_SV*) OPT="$OPT -m486 -DSCO5"
! 	    ;;
!         esac
  	;;
+ 
      *)
! 	OPT="-O"
! 	;;
      esac
+ 
+     # The current (beta) Monterey compiler dies with optimizations
+     # XXX what is Monterey? Does it still die w/ -O? Can we get rid of this?
      case $ac_sys_system in
! 	Monterey*)
! 	    OPT=""
! 	    ;;
      esac
+ 
  fi
  
+ AC_SUBST(BASECFLAGS)
+ # tweak BASECFLAGS based on compiler and platform
+ case $GCC in
+ yes)
+     case $ac_sys_system in
+ 	SCO_SV*)
+ 	    BASECFLAGS="$BASECFLAGS -m486 -DSCO5"
+ 	    ;;
+ 	# is there any other compiler on Darwin besides gcc?
+ 	Darwin*)
+ 	    BASECFLAGS="$BASECFLAGS -Wno-long-double -no-cpp-precomp"
+ 	    ;;
+     esac
+     ;;
+ 
+ *)
+     case $ac_sys_system in
+     OpenUNIX*|UnixWare*)
+ 	BASECFLAGS="$BASECFLAGS -K pentium,host,inline,loop_unroll,alloca "
+ 	;;
+     SCO_SV*)
+ 	BASECFLAGS="$BASECFLAGS -belf -Ki486 -DSCO5"
+ 	;;
+     esac
+     ;;
+ esac
+ 
  if test "$Py_DEBUG" = 'true'; then
    :
***************
*** 577,588 ****
  fi
  
- # The current (beta) Monterey compiler dies with optimizations
- case $ac_sys_system in
- Monterey*) OPT="";;
- esac
- 
  if test "$ac_arch_flags"
  then
! 	OPT="$OPT $ac_arch_flags"
  fi
  
--- 630,636 ----
  fi
  
  if test "$ac_arch_flags"
  then
! 	BASECFLAGS="$BASECFLAGS $ac_arch_flags"
  fi
  
***************
*** 599,604 ****
  if test $ac_cv_opt_olimit_ok = yes; then
      case $ac_sys_system in
!       Darwin*) OPT="$OPT" ;;
!       *) OPT="$OPT -OPT:Olimit=0";;
      esac
  else
--- 647,658 ----
  if test $ac_cv_opt_olimit_ok = yes; then
      case $ac_sys_system in
! 	# XXX is this branch needed? On MacOSX 10.2.2 the result of the
! 	# olimit_ok test is "no".  Is it "yes" in some other Darwin-esque
! 	# environment?
!         Darwin*)
! 	    ;;
!         *)
! 	    BASECFLAGS="$BASECFLAGS -OPT:Olimit=0"
! 	    ;;
      esac
  else
***************
*** 614,618 ****
    AC_MSG_RESULT($ac_cv_olimit_ok)
    if test $ac_cv_olimit_ok = yes; then
!     OPT="$OPT -Olimit 1500"
    fi
  fi
--- 668,672 ----
    AC_MSG_RESULT($ac_cv_olimit_ok)
    if test $ac_cv_olimit_ok = yes; then
!     BASECFLAGS="$BASECFLAGS -Olimit 1500"
    fi
  fi
***************
*** 940,944 ****
  if test "$enable_framework"
  then
! 	OPT="$OPT -fno-common -dynamic"
  	# -F. is needed to allow linking to the framework while 
  	# in the build location.
--- 994,998 ----
  if test "$enable_framework"
  then
! 	BASECFLAGS="$BASECFLAGS -fno-common -dynamic"
  	# -F. is needed to allow linking to the framework while 
  	# in the build location.
***************
*** 1546,1550 ****
  				ipv6lib=inet6
  				ipv6libdir=/usr/inet6/lib
! 				OPT="-I/usr/inet6/include $OPT"
  			fi
  			;;
--- 1600,1604 ----
  				ipv6lib=inet6
  				ipv6libdir=/usr/inet6/lib
! 				BASECFLAGS="-I/usr/inet6/include $BASECFLAGS"
  			fi
  			;;
***************
*** 1576,1580 ****
  				ipv6lib=v6;
  				ipv6libdir=/usr/local/v6/lib;
! 				OPT="-I/usr/local/v6/include $OPT"])
  			;;
  		zeta)
--- 1630,1634 ----
  				ipv6lib=v6;
  				ipv6libdir=/usr/local/v6/lib;
! 				BASECFLAGS="-I/usr/local/v6/include $BASECFLAGS"])
  			;;
  		zeta)

Index: setup.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/setup.py,v
retrieving revision 1.131
retrieving revision 1.132
diff -C2 -d -r1.131 -r1.132
*** setup.py	31 Dec 2002 20:30:46 -0000	1.131
--- setup.py	1 Jan 2003 20:07:48 -0000	1.132
***************
*** 174,179 ****
          # compilers
          if compiler is not None:
!             (ccshared,opt) = sysconfig.get_config_vars('CCSHARED','OPT')
!             args['compiler_so'] = compiler + ' ' + opt + ' ' + ccshared
          if linker_so is not None:
              args['linker_so'] = linker_so
--- 174,179 ----
          # compilers
          if compiler is not None:
!             (ccshared,opt,base) = sysconfig.get_config_vars('CCSHARED','OPT','BASECFLAGS')
!             args['compiler_so'] = compiler + ' ' + opt + ' ' + ccshared + ' ' + base
          if linker_so is not None:
              args['linker_so'] = linker_so
***************
*** 252,255 ****
--- 252,261 ----
          add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
          add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
+ 
+         # fink installs lots of goodies in /sw/... - make sure we
+         # check there
+         if sys.platform == "darwin":
+             add_dir_to_list(self.compiler.library_dirs, '/sw/lib')
+             add_dir_to_list(self.compiler.include_dirs, '/sw/include')
  
          if os.path.normpath(sys.prefix) != '/usr':