home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / pyth_os2.zip / python-1.0.2 / configure.in < prev    next >
Text File  |  1994-05-04  |  5KB  |  175 lines

  1. dnl Process this file with autoconf to produce a configure script.
  2. AC_REVISION($Revision: 1.2.4.16 $)dnl
  3. AC_INIT(Include/object.h)
  4. AC_PREFIX(python)
  5. AC_CONFIG_HEADER(config.h)dnl
  6. # Don't suppress compiler output when --verbose is specified
  7. test -n "$verbose" &&
  8.     ac_compile=`echo "$ac_compile" | sed "s|>/dev/null 2>&1||"`
  9. test -n "$verbose" && echo "    ac_compile='$ac_compile'"
  10.  
  11. # checks for alternative programs
  12. AC_PROG_CC
  13. AC_PROG_INSTALL
  14. AC_PROG_RANLIB
  15. AC_SUBST(AR)
  16. AC_PROGRAMS_CHECK(AR, ar aal, ar)
  17.  
  18. # checks for UNIX variants that set C preprocessor variables
  19. AC_AIX
  20. AC_ISC_POSIX
  21. AC_MINIX
  22. dnl DYNIX test runs compile so must be last
  23. AC_DYNIX_SEQ
  24. echo checking for NeXT
  25. AC_TEST_PROGRAM([
  26. #ifdef _NEXT_SOURCE
  27. main() { exit(0); }
  28. #endif
  29. ], AC_DEFINE(_POSIX_SOURCE))
  30.  
  31. # checks for header files
  32. AC_STDC_HEADERS
  33. AC_HAVE_HEADERS(dlfcn.h fcntl.h signal.h stdarg.h stdlib.h thread.h unistd.h utime.h sys/audioio.h sys/param.h sys/select.h sys/time.h sys/times.h sys/un.h sys/utsname.h)
  34. AC_DIR_HEADER
  35.  
  36. # checks for typedefs
  37. AC_MODE_T
  38. AC_OFF_T
  39. AC_PID_T
  40. AC_RETSIGTYPE
  41. AC_SIZE_T
  42. AC_UID_T
  43.  
  44. # checks for libraries
  45. AC_HAVE_LIBRARY(dl)
  46.  
  47. echo checking for --with-svr4
  48. AC_WITH(svr4, [
  49. AC_HAVE_LIBRARY(socket)
  50. AC_HAVE_LIBRARY(inet)
  51. AC_HAVE_LIBRARY(nsl)
  52. ])
  53.  
  54. echo checking for --with-readline
  55. AC_WITH(readline, [AC_DEFINE(WITH_READLINE)
  56. if test -d "$withval"
  57. then LIBS="$LIBS -L$withval"
  58. else echo proper usage is --with-readline=DIRECTORY 1>&2; exit 1
  59. fi
  60. termcap=
  61. AC_HAVE_LIBRARY(termcap, [termcap=termcap], [AC_HAVE_LIBRARY(termlib, [termcap=termlib])])
  62. if test ! -z "$termcap"
  63. then LIBS="$LIBS -lreadline -l$termcap"
  64. else echo no working termcap/termlib, do not use --with-readline 1>&2; exit 1
  65. fi])
  66.  
  67. echo checking for --with-thread
  68. AC_WITH(thread, [
  69. AC_HAVE_LIBRARY(mpc, [AC_DEFINE(WITH_THREAD)
  70. LIBS="$LIBS -lmpc"
  71. LIBOBJS="$LIBOBJS thread.o"])
  72. AC_HAVE_LIBRARY(thread, [AC_DEFINE(WITH_THREAD)
  73. LIBS="$LIBS -lthread"
  74. LIBOBJS="$LIBOBJS thread.o"])
  75. ])
  76.  
  77. # -I${DLINCLDIR} is added to the compile rule for import.o
  78. AC_SUBST(DLINCLDIR)
  79. DLINCLDIR=/
  80.  
  81. echo checking for --with-sgi-dl
  82. AC_WITH(sgi-dl, [AC_DEFINE(WITH_SGI_DL)
  83. dldir=$withval
  84. if test -d "$dldir"
  85. then LIBS="$LIBS -L$dldir"
  86. else echo proper usage is --with-sgi-dl=DIRECTORY 1>&2; exit 1
  87. fi
  88. DLINCLDIR=${dldir}
  89. LIBS="$LIBS -ldl -lmld"])
  90.  
  91. echo checking for --with-dl-dld
  92. AC_WITH(dl-dld, [AC_DEFINE(WITH_DL_DLD)
  93. dldir=`echo "$withval" | sed 's/,.*//'`
  94. dlddir=`echo "$withval" | sed 's/.*,//'`
  95. if test -d "$dldir" -a -d "$dlddir"
  96. then LIBS="$LIBS -L$dldir -L$dlddir"
  97. else echo proper usage is --with-dl-dld=DL_DIRECTORY,DLD_DIRECTORY 1>&2; exit 1
  98. fi
  99. DLINCLDIR=${dldir}
  100. LIBS="$LIBS -ldl -ldld"])
  101.  
  102. # checks for library functions
  103. AC_HAVE_FUNCS(clock dlopen ftime gettimeofday getpeername getpgrp getpid getwd lstat nice readlink select setsid setpgid setpgrp setvbuf siginterrupt symlink tcgetpgrp tcsetpgrp times uname waitpid)
  104. AC_REPLACE_FUNCS(dup2 getcwd strerror strtod memmove)
  105. AC_FUNC_CHECK(getpgrp, AC_COMPILE_CHECK([argument to getpgrp], [#include <unistd.h>], [getpgrp(0);], AC_DEFINE(GETPGRP_HAVE_ARG)))
  106.  
  107. # checks for structures
  108. AC_TIME_WITH_SYS_TIME
  109. AC_STRUCT_TM
  110. AC_TIMEZONE
  111. AC_COMPILE_CHECK([whether we have altzone], [#include <time.h>], [return altzone;], AC_DEFINE(HAVE_ALTZONE))
  112. AC_COMPILE_CHECK([whether sys/select.h and sys/time.h may both be included], [
  113. #include <sys/types.h>
  114. #include <sys/select.h>
  115. #include <sys/time.h>
  116. ], [;], [AC_DEFINE(SYS_SELECT_WITH_SYS_TIME)])
  117.  
  118. # checks for compiler characteristics
  119.  
  120. AC_CHAR_UNSIGNED
  121.  
  122. AC_CONST
  123.  
  124. AC_COMPILE_CHECK([wheter we have signed char], [], [signed char c;], [], AC_DEFINE(signed, []))
  125.  
  126. echo checking for prototypes
  127. AC_TEST_PROGRAM([
  128. int foo(int x) { return 0; }
  129. int main() { return foo(10); }
  130. ], AC_DEFINE(HAVE_PROTOTYPES) have_prototypes=1)
  131.  
  132. echo checking for variable length prototypes and stdarg.h
  133. AC_TEST_PROGRAM([
  134. #include <stdarg.h>
  135. int foo(int x, ...) { return 0; }
  136. int main() { return foo(10, 11, 12); }
  137. ], AC_DEFINE(HAVE_STDARG_PROTOTYPES) have_prototypes=1)
  138. if test "$have_prototypes"; then
  139. AC_COMPILE_CHECK(["bad exec* prototypes"], [#include <unistd.h>], [char **t;execve("@",t,t);], , AC_DEFINE(BAD_EXEC_PROTOTYPES))
  140. fi
  141.  
  142. echo checking for bad static forward
  143. AC_TEST_PROGRAM([
  144. struct s { int a; int b; };
  145. static struct s foo;
  146. int foobar() { return !foo.a; }
  147. static struct s foo = { 1, 2 };
  148. main() { exit(foobar()); }
  149. ], , AC_DEFINE(BAD_STATIC_FORWARD))
  150.  
  151. # checks for system services
  152. # (none yet)
  153.  
  154. # other checks for UNIX variants
  155. AC_IRIX_SUN
  156. AC_XENIX_DIR
  157.  
  158. # check for --with-libm=...
  159. AC_SUBST(LIBM)
  160. LIBM=-lm
  161. AC_WITH(libm, [if test "$withval" != yes
  162. then LIBM=$withval
  163. else echo proper usage is --with-libm=STRING 1>&2; exit 1
  164. fi])
  165.  
  166. # check for --with-libc=...
  167. AC_SUBST(LIBC)
  168. AC_WITH(libc, [if test "$withval" != yes
  169. then LIBC=$withval
  170. else echo proper usage is --with-libc=STRING 1>&2; exit 1
  171. fi])
  172.  
  173. # generate output files
  174. AC_OUTPUT(Makefile Objects/Makefile Parser/Makefile Python/Makefile Modules/Makefile.pre)
  175.