[Python-checkins] CVS: python/dist/src configure,1.168,1.169 configure.in,1.176,1.177

Thomas Wouters python-dev@python.org
Fri, 3 Nov 2000 00:18:40 -0800


Update of /cvsroot/python/python/dist/src
In directory slayer.i.sourceforge.net:/tmp/cvs-serv27629

Modified Files:
	configure configure.in 
Log Message:

Move our own getopt() implementation to _PyOS_GetOpt(), and use it
regardless of whether the system getopt() does what we want. This avoids the
hassle with prototypes and externs, and the check to see if the system
getopt() does what we want. Prefix optind, optarg and opterr with _PyOS_ to
avoid name clashes. Add new include file to define the right symbols. Fix
Demo/pyserv/pyserv.c to include getopt.h itself, instead of relying on
Python to provide it.



Index: configure
===================================================================
RCS file: /cvsroot/python/python/dist/src/configure,v
retrieving revision 1.168
retrieving revision 1.169
diff -C2 -r1.168 -r1.169
*** configure	2000/11/02 19:33:53	1.168
--- configure	2000/11/03 08:18:36	1.169
***************
*** 4840,4844 ****
  
  /* Ultrix mips cc rejects this.  */
! typedef int charset[2]; const charset x;
  /* SunOS 4.1.1 cc rejects this.  */
  char const *const *ccp;
--- 4840,4844 ----
  
  /* Ultrix mips cc rejects this.  */
! typedef int charset[2]; const charset x = {0,0};
  /* SunOS 4.1.1 cc rejects this.  */
  char const *const *ccp;
***************
*** 4915,4919 ****
  
  int main() {
! } $ac_kw foo() {
  ; return 0; }
  EOF
--- 4915,4919 ----
  
  int main() {
! } int $ac_kw foo() {
  ; return 0; }
  EOF
***************
*** 5626,5670 ****
  LIBS=$LIBS_SAVE
  
- # check for getopt
- echo $ac_n "checking for genuine getopt""... $ac_c" 1>&6
- echo "configure:5631: checking for genuine getopt" >&5
- if eval "test \"`echo '$''{'ac_cv_func_getopt'+set}'`\" = set"; then
-   echo $ac_n "(cached) $ac_c" 1>&6
- else
-   if test "$cross_compiling" = yes; then
-   ac_cv_func_getopt=no
- else
-   cat > conftest.$ac_ext <<EOF
- #line 5639 "configure"
- #include "confdefs.h"
- #include <stdio.h>
- extern int optind, opterr, getopt();
- extern char* optarg;
- int main() {
- 	char* av[] = { "testprog", "parameter", "-fFlag", NULL };
- 	opterr = 0;
- 	if (getopt(3, av, "f:") == 'f') { exit(1); }
- 	exit(0);
- }
- EOF
- if { (eval echo configure:5651: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
- then
-   ac_cv_func_getopt=yes
- else
-   echo "configure: failed program was:" >&5
-   cat conftest.$ac_ext >&5
-   rm -fr conftest*
-   ac_cv_func_getopt=no
- fi
- rm -fr conftest*
- fi
- 
- fi
- echo "$ac_t""$ac_cv_func_getopt" 1>&6
- test $ac_cv_func_getopt = no && LIBOBJS="$LIBOBJS getopt.o"
- 
  # check whether malloc(0) returns NULL or not
  echo $ac_n "checking what malloc(0) returns""... $ac_c" 1>&6
! echo "configure:5669: checking what malloc(0) returns" >&5
  if eval "test \"`echo '$''{'ac_cv_malloc_zero'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
--- 5626,5632 ----
  LIBS=$LIBS_SAVE
  
  # check whether malloc(0) returns NULL or not
  echo $ac_n "checking what malloc(0) returns""... $ac_c" 1>&6
! echo "configure:5631: checking what malloc(0) returns" >&5
  if eval "test \"`echo '$''{'ac_cv_malloc_zero'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
***************
*** 5674,5678 ****
  else
    cat > conftest.$ac_ext <<EOF
! #line 5677 "configure"
  #include "confdefs.h"
  #include <stdio.h>
--- 5636,5640 ----
  else
    cat > conftest.$ac_ext <<EOF
! #line 5639 "configure"
  #include "confdefs.h"
  #include <stdio.h>
***************
*** 5693,5697 ****
  }
  EOF
! if { (eval echo configure:5696: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
  then
    ac_cv_malloc_zero=nonnull
--- 5655,5659 ----
  }
  EOF
! if { (eval echo configure:5658: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
  then
    ac_cv_malloc_zero=nonnull
***************
*** 5719,5733 ****
  ac_safe=`echo "wchar.h" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking for wchar.h""... $ac_c" 1>&6
! echo "configure:5722: checking for wchar.h" >&5
  if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 5727 "configure"
  #include "confdefs.h"
  #include <wchar.h>
  EOF
  ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
! { (eval echo configure:5732: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
  if test -z "$ac_err"; then
--- 5681,5695 ----
  ac_safe=`echo "wchar.h" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking for wchar.h""... $ac_c" 1>&6
! echo "configure:5684: checking for wchar.h" >&5
  if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 5689 "configure"
  #include "confdefs.h"
  #include <wchar.h>
  EOF
  ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
! { (eval echo configure:5694: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
  if test -z "$ac_err"; then
***************
*** 5759,5768 ****
  usable_wchar_t="unkown"
  echo $ac_n "checking for usable wchar_t""... $ac_c" 1>&6
! echo "configure:5762: checking for usable wchar_t" >&5
  if test "$cross_compiling" = yes; then
      { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
  else
    cat > conftest.$ac_ext <<EOF
! #line 5767 "configure"
  #include "confdefs.h"
  
--- 5721,5730 ----
  usable_wchar_t="unkown"
  echo $ac_n "checking for usable wchar_t""... $ac_c" 1>&6
! echo "configure:5724: checking for usable wchar_t" >&5
  if test "$cross_compiling" = yes; then
      { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
  else
    cat > conftest.$ac_ext <<EOF
! #line 5729 "configure"
  #include "confdefs.h"
  
***************
*** 5778,5782 ****
  
  EOF
! if { (eval echo configure:5781: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
  then
    cat >> confdefs.h <<\EOF
--- 5740,5744 ----
  
  EOF
! if { (eval echo configure:5743: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
  then
    cat >> confdefs.h <<\EOF
***************
*** 5797,5801 ****
  # check for endianness
  echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
! echo "configure:5800: checking whether byte ordering is bigendian" >&5
  if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
--- 5759,5763 ----
  # check for endianness
  echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
! echo "configure:5762: checking whether byte ordering is bigendian" >&5
  if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
***************
*** 5804,5808 ****
  # See if sys/param.h defines the BYTE_ORDER macro.
  cat > conftest.$ac_ext <<EOF
! #line 5807 "configure"
  #include "confdefs.h"
  #include <sys/types.h>
--- 5766,5770 ----
  # See if sys/param.h defines the BYTE_ORDER macro.
  cat > conftest.$ac_ext <<EOF
! #line 5769 "configure"
  #include "confdefs.h"
  #include <sys/types.h>
***************
*** 5815,5823 ****
  ; return 0; }
  EOF
! if { (eval echo configure:5818: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    # It does; now see whether it defined to BIG_ENDIAN or not.
  cat > conftest.$ac_ext <<EOF
! #line 5822 "configure"
  #include "confdefs.h"
  #include <sys/types.h>
--- 5777,5785 ----
  ; return 0; }
  EOF
! if { (eval echo configure:5780: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    # It does; now see whether it defined to BIG_ENDIAN or not.
  cat > conftest.$ac_ext <<EOF
! #line 5784 "configure"
  #include "confdefs.h"
  #include <sys/types.h>
***************
*** 5830,5834 ****
  ; return 0; }
  EOF
! if { (eval echo configure:5833: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    ac_cv_c_bigendian=yes
--- 5792,5796 ----
  ; return 0; }
  EOF
! if { (eval echo configure:5795: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    ac_cv_c_bigendian=yes
***************
*** 5850,5854 ****
  else
    cat > conftest.$ac_ext <<EOF
! #line 5853 "configure"
  #include "confdefs.h"
  main () {
--- 5812,5816 ----
  else
    cat > conftest.$ac_ext <<EOF
! #line 5815 "configure"
  #include "confdefs.h"
  main () {
***************
*** 5863,5867 ****
  }
  EOF
! if { (eval echo configure:5866: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
  then
    ac_cv_c_bigendian=no
--- 5825,5829 ----
  }
  EOF
! if { (eval echo configure:5828: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
  then
    ac_cv_c_bigendian=no
***************
*** 5890,5894 ****
  # or fills with zeros (like the Cray J90, according to Tim Peters).
  echo $ac_n "checking whether right shift extends the sign bit""... $ac_c" 1>&6
! echo "configure:5893: checking whether right shift extends the sign bit" >&5
  if eval "test \"`echo '$''{'ac_cv_rshift_extends_sign'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
--- 5852,5856 ----
  # or fills with zeros (like the Cray J90, according to Tim Peters).
  echo $ac_n "checking whether right shift extends the sign bit""... $ac_c" 1>&6
! echo "configure:5855: checking whether right shift extends the sign bit" >&5
  if eval "test \"`echo '$''{'ac_cv_rshift_extends_sign'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
***************
*** 5899,5903 ****
  else
    cat > conftest.$ac_ext <<EOF
! #line 5902 "configure"
  #include "confdefs.h"
  
--- 5861,5865 ----
  else
    cat > conftest.$ac_ext <<EOF
! #line 5864 "configure"
  #include "confdefs.h"
  
***************
*** 5908,5912 ****
  
  EOF
! if { (eval echo configure:5911: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
  then
    ac_cv_rshift_extends_sign=yes
--- 5870,5874 ----
  
  EOF
! if { (eval echo configure:5873: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
  then
    ac_cv_rshift_extends_sign=yes
***************
*** 5940,5949 ****
  EOF
  echo $ac_n "checking for socklen_t""... $ac_c" 1>&6
! echo "configure:5943: checking for socklen_t" >&5
  if eval "test \"`echo '$''{'ac_cv_type_socklen_t'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 5948 "configure"
  #include "confdefs.h"
  #include <sys/types.h>
--- 5902,5911 ----
  EOF
  echo $ac_n "checking for socklen_t""... $ac_c" 1>&6
! echo "configure:5905: checking for socklen_t" >&5
  if eval "test \"`echo '$''{'ac_cv_type_socklen_t'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 5910 "configure"
  #include "confdefs.h"
  #include <sys/types.h>
***************
*** 5974,5978 ****
  
  echo $ac_n "checking for Modules/Setup""... $ac_c" 1>&6
! echo "configure:5977: checking for Modules/Setup" >&5
  if test ! -f Modules/Setup ; then
      if test ! -d Modules ; then
--- 5936,5940 ----
  
  echo $ac_n "checking for Modules/Setup""... $ac_c" 1>&6
! echo "configure:5939: checking for Modules/Setup" >&5
  if test ! -f Modules/Setup ; then
      if test ! -d Modules ; then

Index: configure.in
===================================================================
RCS file: /cvsroot/python/python/dist/src/configure.in,v
retrieving revision 1.176
retrieving revision 1.177
diff -C2 -r1.176 -r1.177
*** configure.in	2000/11/02 17:52:56	1.176
--- configure.in	2000/11/03 08:18:36	1.177
***************
*** 1205,1224 ****
  LIBS=$LIBS_SAVE
  
- # check for getopt
- AC_MSG_CHECKING(for genuine getopt)
- AC_CACHE_VAL(ac_cv_func_getopt,
- [AC_TRY_RUN([#include <stdio.h>
- extern int optind, opterr, getopt();
- extern char* optarg;
- int main() {
- 	char* av[] = { "testprog", "parameter", "-fFlag", NULL };
- 	opterr = 0;
- 	if (getopt(3, av, "f:") == 'f') { exit(1); }
- 	exit(0);
- }], ac_cv_func_getopt=yes, ac_cv_func_getopt=no, ac_cv_func_getopt=no)])dnl
- AC_MSG_RESULT($ac_cv_func_getopt)
- test $ac_cv_func_getopt = no && LIBOBJS="$LIBOBJS getopt.o"
- AC_SUBST(LIBOBJS)dnl
- 
  # check whether malloc(0) returns NULL or not
  AC_MSG_CHECKING(what malloc(0) returns)
--- 1205,1208 ----