aboutsummaryrefslogtreecommitdiff
blob: 34bb8224b07a846c2da7a32a24ccc763cc2b5c94 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
dnl Process this file with autoconf to produce a configure script.
AC_INIT(portage, cvs, dev-portage@gentoo.org)
AM_INIT_AUTOMAKE
dnl AM_CONFIG_HEADER(config.h)

dnl Checks for programs.
dnl store clfags prior, otherwise it's not propogaed.
if test x$CFLAGS != x
then
CFLAGS=$CFLAGS
fi

AC_PREFIX_DEFAULT([/usr])
AC_PROG_CC
AC_PROG_INSTALL

dnl Checks for libraries.
dnl Replace `main' with a function in -lc:
AC_CHECK_LIB(c, main)
dnl Replace `main' with a function in -ldl:
AC_CHECK_LIB(dl, main)
dnl Replace `main' with a function in -lgcc:
AC_CHECK_LIB(gcc, main)
dnl Replace `main' with a function in -lpthread:
AC_CHECK_LIB(pthread, main)

dnl Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(fcntl.h limits.h strings.h sys/file.h sys/time.h unistd.h)

dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_UID_T
AC_TYPE_MODE_T
AC_TYPE_SIZE_T

dnl Checks for library functions.
AC_FUNC_ALLOCA
AC_TYPE_SIGNAL
AC_CHECK_FUNCS(getcwd mkdir regcomp rmdir strdup strerror strspn strstr)

AC_ARG_ENABLE(tbz2tool,
AC_HELP_STRING([--enable-tbz2tool],[build tbz2tool, tool for creating binpkgs (default yes)]),
[case "${enableval}" in
  yes)  enable_tbz2tool=true;;
  no)	enable_tbz2tool=false;;
  *)	AC_MSG_ERROR(bad value ${enableval} for --enable-tbz2tool);;
esac],
[enable_tbz2tool=true])

AC_ARG_ENABLE(filter-env,
AC_HELP_STRING([--enable-filter-env],[build filter-env, tool for filtering bash progs/env (default yes)]),
[case "${enableval}" in
  yes)	enable_filter_env=true;;
  no)	enable_filter_env=false;;
  *)	AC_MSG_ERROR(bad value ${enableval} for --enable-filter-env);;
esac],
[enable_filter_env=true])

AC_ARG_ENABLE(missingos,
AC_HELP_STRING([--enable-missingos],[build compatibility missingos code for python 2.2 (default auto)]),
[case "${enableval}" in
  yes)	enable_missingos=true;;
  no)	enable_missingos=false;;
  auto)	enable_missingos=auto;;
  *)	AC_MSG_ERROR(bad value ${enableval} for --enable-missingos);;
esac],
[enable_missingos=auto])

AC_ARG_ENABLE(just-compiled-sources,
AC_HELP_STRING([--enable-just-compiled-sources],[install just the bytecode, not the sources (default no)]),
[case "${enableval}" in
  yes)	enable_py_sources=false;;
  no)	enable_py_sources=true;;
  *)	AC_MSG_ERROR(bad value ${enableval} for --enable-just-compiled-sources);;
esac],
[enable_py_sources=true])

if test x$enable_missingos = xauto
then
  pyver=[`python -c 'import sys;print sys.version[0:3]';`]
  case ${pyver} in
    2.4)  ;;
    2.3)  ;;
    2.2)  enable_missingos=true;;
    *)    AC_MSG_WARN([unable to determine python version, ${pyver}]);;
  esac
fi

AC_CONFIG_FILES([ Makefile ])
AC_CONFIG_FILES([ src/Makefile ])
AC_CONFIG_FILES([ src/filter-env/Makefile ])
AC_CONFIG_FILES([ man/Makefile ])
AC_CONFIG_FILES([ src/python-missingos/Makefile ])
AC_CONFIG_FILES([ bin/Makefile ])
AC_CONFIG_FILES([ pym/Makefile ])

AC_SUBST(PORTAGE_BASE,"/usr/lib/portage")
AM_CONDITIONAL(INSTALL_PYTHON_SOURCES, test x$enable_py_sources = xtrue)
AM_CONDITIONAL(BUILD_TBZ2TOOL, test x$enable_tbz2tool = xtrue)
AM_CONDITIONAL(BUILD_MISSINGOS, test x$enable_missingos = xtrue)
AM_CONDITIONAL(BUILD_FILTER_ENV, test x$enable_filter_env = xtrue)
AC_OUTPUT