File: configure.ac

package info (click to toggle)
posh 0.14.3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,108 kB
  • sloc: ansic: 14,639; xml: 1,604; perl: 964; sh: 110; makefile: 36
file content (237 lines) | stat: -rw-r--r-- 7,097 bytes parent folder | download
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
dnl
dnl Process this file with autoconf to produce a configure script
dnl
AC_INIT([Debian posh],[POSH_VERSION],[clint@debian.org],[posh])
AC_PREREQ([2.72])
AM_INIT_AUTOMAKE([subdir-objects])
AC_CONFIG_HEADERS([config.h])
AC_USE_SYSTEM_EXTENSIONS
AC_PROG_MAKE_SET

dnl
dnl
AC_PROG_CC
AC_PROG_CPP
dnl
dnl  Set up command line options (--enable/--disable)
dnl
def_path_unix="/bin:/usr/bin:/usr/ucb"
def_path_os2="c:/usr/bin;c:/os2;/os2"
enable_shell=posh
AC_ARG_ENABLE(path,
[  --enable-path=PaTh      (NOTE: this value isn't used if confstr() and _CS_PATH
                          are available, or if <paths.h> defines _PATH_DEFPATH)
                          Use PaTh if PATH isn't specified in the environment
                          when the shell starts.  A value without . in it is
                          safest.
                          The default value is \"/bin:/usr/bin:/usr/ucb\".],,
                enable_path=default)
case $enable_path:$ksh_cv_os_type in
 default:OS2_EMX) enable_path="$def_path_os2" ;;
 default:*) enable_path="$def_path_unix" ;;
esac
case $enable_path in
  \"*\") ;;
  *)
    enable_path="\"$enable_path\""
    ;;
esac
AC_DEFINE_UNQUOTED(DEFAULT_PATH, $enable_path, [default hardcoded PATH])
dnl
dnl
dnl
dnl  Specify what kind of shell we are to build.  Options are ksh and sh.
dnl  This must be before most other options, as it controls their default
dnl  behaviour.
dnl
SHELL_PROG=posh
AC_SUBST(SHELL_PROG)
dnl
dnl
dnl
dnl
dnl
dnl
dnl
AC_ARG_ENABLE(posixly_correct,
[  --enable-posixly-correct Enable if you want POSIX behavior by default
                          (otherwise, posix behavior is only turned on if the
                          environment variable POSIXLY_CORRECT is present or by
                          using \"set -o posix\"; it can be turned off with
                          \"set +o posix\").  See the POSIX Mode section in the
                          man page for details on what this option affects.
                          NOTE:  posix mode is not compatable with some bourne
                          sh/at&t ksh scripts.])
case $enable_posixly_correct:$enable_shell in
  yes:*) enable_posixly_correct=yes; AC_DEFINE(POSIXLY_CORRECT, 1, [POSIX behavior]) ;;
  no:*|:*) enable_posixly_correct=no;;
  *) AC_MSG_ERROR(bad --enable-posixly_correct argument)
esac
dnl
dnl
AC_ARG_ENABLE(default-env,
[  --enable-default-env=FILE Include FILE if ENV parameter is not set when
                          the shell starts.  This can be useful when used with
                          rsh(1), which creates a non-login shell (ie, profile
                          isn't read, so there is no opertunity to set ENV).
                          Setting ENV to null disables the inclusion of
                          DEFAULT_ENV.  NOTE: This is a non-standard feature
                          (ie, at&t ksh has no default environment).],,
  enable_default_env=no)
if test X"$enable_default_env" != Xno; then
  # The [a-zA-Z]:/ is for os2 types...
  case $enable_default_env in
    /*|[[a-zA-Z]]:/*)
      enable_default_env="\"$enable_default_env\""
      ;;
    \"/*\"|\"[[a-zA-Z]]:/*\")
      ;;
    *)
      AC_MSG_ERROR(--enable-default-env argument must be an absolute path (was $enable_default_env))
      ;;
  esac
  AC_DEFINE_UNQUOTED(DEFAULT_ENV, $enable_default_env, [enable default environment])
fi
dnl
dnl
dnl Don't want silly documented - its silly
AC_ARG_ENABLE(silly,[  --enable-silly          [A silly option]])
case $enable_silly:$enable_shell in
  yes:*) enable_silly=yes; AC_DEFINE(SILLY, 1, [oookay]) ;;
  no:*|:*) enable_silly=no;;
  *) AC_MSG_ERROR(bad --enable-silly argument)
esac
dnl
dnl
dnl don't want swtch documented - its ancient and probably doesn't work
AC_ARG_ENABLE(swtch,
[  --enable-swtch          For use with shell layers (shl(1)).  This has not
                          been tested for some time.])
case $enable_swtch:$enable_shell in
  yes:*) enable_swtch=yes; AC_DEFINE(SWTCH, 1, [swtch]) ;;
  no:*|:*) enable_swtch=no;;
  *) AC_MSG_ERROR(bad --enable-swtch argument)
esac
dnl
dnl
dnl  Start of auto-configuration stuff...
dnl
dnl
dnl A hack to turn on warning messages for gcc - Warn-flags is not in
dnl the distribution since not everyone wants to see this stuff.
dnl (Warn-flags contains: -Wall)
if test X"$GCC" = Xyes && test -f $srcdir/Warn-flags; then
  CFLAGS="${CFLAGS+$CFLAGS }`cat $srcdir/Warn-flags`"
fi

dnl
dnl If LDSTATIC set in environment, pass it on to the Makefile and use it when
dnl doing compile checks to ensure we are checking the right thing.
AC_SUBST(LDSTATIC)LDSTATIC=${LDSTATIC-}
test X"$LDSTATIC" != X && LDFLAGS="${LDFLAGS+$LDFLAGS }$LDSTATIC"
dnl
dnl Executable suffix - normally empty; .exe on os2.
AC_SUBST(ac_exe_suffix)dnl

dnl
dnl Program name munging stuff (prefix, suffix, transform)
dnl AC_ARG_PROGRAM
dnl
dnl
dnl Headers
dnl
AC_HEADER_DIRENT
dnl KSH_TERM_CHECK
AC_SYS_POSIX_TERMIOS
AC_CHECK_HEADERS(stddef.h stdlib.h memory.h fcntl.h limits.h paths.h \
	sys/param.h sys/resource.h values.h ulimit.h sys/time.h unistd.h \
	termio.h termios.h)
AC_CHECK_HEADERS_ONCE([sys/time.h])

AC_HEADER_SYS_WAIT
dnl
dnl
dnl Typedefs
dnl
dnl (don't use AC_TYPE_XXX() 'cause it doesn't check word boundaries)
AC_CHECK_TYPE(off_t)
AC_CHECK_TYPE(mode_t)
AC_CHECK_TYPE(pid_t)
AC_CHECK_TYPE(uid_t)
dnl if test $ac_cv_type_uid_t = no; then
dnl   AC_DEFINE(gid_t, int)
dnl fi
define([AC_PROVIDE_AC_TYPE_UID_T],)

AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(long)
dnl sh.h sets INT32 to int or long as appropriate.  Some burnt systems, such
dnl as NeXT's, clock_t is in sys/time.h (in non-posix mode).
dnl KSH_CHECK_H_TYPE(clock_t, [[for clock_t in any of <sys/types.h>, <sys/times.h> and <sys/time.h>]],
dnl   [
dnl #ifdef HAVE_SYS_TIME_H
dnl #include <sys/time.h>
dnl #endif /* HAVE_SYS_TIME_H */
dnl #include <sys/times.h>
dnl 	], INT32)
dnl KSH_CHECK_H_TYPE(sigset_t, for sigset_t in <sys/types.h> and <signal.h>,
dnl   [#include <signal.h>], unsigned)
dnl KSH_RLIM_CHECK
AC_CHECK_TYPE(sigset_t)
AC_CHECK_TYPE(rlim_t)
dnl
dnl
dnl Library functions
dnl
AC_CHECK_FUNCS(confstr dup2 flock getcwd getwd killpg nice \
	setrlimit sysconf tcsetpgrp \
	ulimit waitpid wait3 lstat setpgrp tcsetattr \
	get_current_dir_name canonicalize_file_name)
AC_FUNC_MMAP
AC_FUNC_SETPGRP
AC_FUNC_STAT
AC_FUNC_LSTAT
dnl KSH_SYS_ERRLIST
dnl KSH_SYS_SIGLIST
dnl KSH_TIME_DECLARED
dnl KSH_TIMES_CHECK
dnl
dnl
dnl Structures
dnl
AC_HEADER_STAT
dnl
dnl
dnl Compiler characteristics
dnl
AC_C_CONST
dnl KSH_C_VOID
dnl KSH_C_VOLATILE
dnl KSH_C_PROTOTYPES
dnl KSH_C_FUNC_ATTR
dnl
dnl
dnl System services
dnl
AC_SYS_INTERPRETER
if test $ac_cv_sys_interpreter = no;
  then AC_DEFINE(SHARPBANG, 1, [sharpbang])
fi
AC_PROG_INSTALL
dnl
dnl
dnl  Misc ksh tests
dnl
dnl KSH_DUP2_CLEXEC_CHECK
dnl KSH_SIGNAL_CHECK
dnl KSH_OPENDIR_CHECK
dnl KSH_DEV_FD
dnl
dnl
dnl Take replace value of LDSTATIC in LDFLAGS with reference to make variable
if test X"$LDSTATIC" != X; then
  LDFLAGS=`echo -- "$LDFLAGS" | sed -e 's/^-- //' -e 's?$LDSTATIC?\$(LDSTATIC)?'`
fi
dnl
AC_CONFIG_FILES(Makefile src/Makefile tests/Makefile)
AC_OUTPUT