File: configure.in

package info (click to toggle)
wml 2.0.11-1
  • links: PTS
  • area: main
  • in suites: etch-m68k
  • size: 13,668 kB
  • ctags: 5,794
  • sloc: ansic: 54,590; sh: 17,145; perl: 14,812; makefile: 2,295; yacc: 445
file content (280 lines) | stat: -rw-r--r-- 6,952 bytes parent folder | download | duplicates (2)
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
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
dnl ##
dnl ##  configure.in -- GNU autoconf configuration spec
dnl ##  Copyright (c) Ralf S. Engelschall, <rse@engelschall.com>
dnl ##
dnl ##  Process this file with ``autoconf'' to produce a configure script.
dnl ##

dnl #
dnl #   standard autoconf prolog
dnl #

AC_PREREQ(2.10)dnl
AC_REVISION($Revision: 1.14 $)
AC_INIT(README)
AC_CONFIG_HEADER(config_ac.h)dnl
AC_PREFIX_DEFAULT(/usr/local)

shtool=./etc/shtool
TERM_BOLD=`$shtool echo -e %B 2>/dev/null`
TERM_NORM=`$shtool echo -e %b 2>/dev/null`

dnl ##  version id
EPERL_VERSION="`$shtool version -lc -d long eperl_version.c`"
echo "${TERM_BOLD}Configuring for ePerl ${EPERL_VERSION}${TERM_NORM}"

dnl #
dnl #   libdir adjustment
dnl #

test "x$prefix" = xNONE && prefix=$ac_default_prefix
eval "dir=$prefix"
case $dir in
    *eperl* ) libsubdir= ;;
          * ) libsubdir="/eperl" ;;
esac
AC_SUBST(libsubdir)

tmpdir=${TMPDIR-/tmp}
AC_SUBST(tmpdir)

dnl #
dnl #   latest find Perl interpreter
dnl #

AC_CONFIGURE_PART(CHECK: Configuration of Perl Language)
AC_MSG_CHECKING([for Perl language])
AC_ARG_WITH(perl,dnl
[  --with-perl=PATH        force the usage of a specific Perl 5 interpreter],[
dnl [[
perlprog=$with_perl
perlvers=`$perlprog -e 'printf "%.3f",$]'`
dnl ]
],[
perlvers=
for dir in `echo $PATH | sed -e 's/:/ /g'` $tmpdir; do
    for perl in perl5 perl miniperl; do
         if test -f "$dir/$perl"; then
             if test -x "$dir/$perl"; then
                 perlprog="$dir/$perl"
                 if $perlprog -e 'require 5.003'; then
dnl [[
                     perlvers=`$perlprog -e 'printf "%.3f",$]'`
dnl ]
                     break 2
                 fi
             fi
         fi
    done
done
])dnl
PATH_PERL=$perlprog
AC_MSG_RESULT([$perlprog v$perlvers])
if $perlprog -e 'require 5.003'; then
    :
else
    echo ""
    echo "Latest Perl found on your system is $perlvers,"
    echo "but at least Perl version 5.003 is required."
    echo "In case the newer one is not in PATH, just use"
    echo "the option --with-perl=/path/to/bin/perl to"
    echo "provide the correct executable."
    echo ""
    AC_ERROR([Perl version too old]) 
fi
AC_SUBST(PATH_PERL)
AC_SUBST(perlprog)
AC_SUBST(perlvers)
perl_prog=$perlprog
perl_vers=$perlvers
AC_SUBST(perl_prog)
AC_SUBST(perl_vers)
if test -f $PATH_PERL; then
    :
else
    AC_ERROR([required program ``perl'' not found])
fi


dnl #
dnl #   determine Perl parameters
dnl #

AC_MSG_CHECKING([for Perl knowledge of system])
perl_osname="`$perl_prog -e 'use Config; print $Config{osname}'`";
perl_osvers="`$perl_prog -e 'use Config; print $Config{osvers}'`";
perl_os="$perl_osname-$perl_osvers"
AC_SUBST(perl_osname)
AC_SUBST(perl_osvers)
AC_SUBST(perl_os)
AC_MSG_RESULT([$perl_os])

AC_MSG_CHECKING([for Perl standard compiler])
perl_cc="`$perl_prog -e 'use Config; print $Config{cc}'`";
if test ".$CC" = .; then
    CC=$perl_cc
    export CC
    AC_MSG_RESULT([$perl_cc])
else
    perl_cc=$CC
    AC_MSG_RESULT([$perl_cc (OVERWRITTEN)])
fi
AC_SUBST(perl_cc)

AC_MSG_CHECKING([for Perl standard optimization flags])
perl_optimize="`$perl_prog -e 'use Config; print $Config{optimize}'`";
AC_MSG_RESULT([$perl_optimize])
AC_SUBST(perl_optimize)

AC_MSG_CHECKING([for Perl standard compilation flags])
perl_ccflags="`$perl_prog -e 'use Config; print $Config{ccflags}'`";
case $perl_os in
    *hpux*    ) perl_ccflags="$perl_ccflags -Wp,-H32768" ;;
    *irix-5.* ) perl_ccflags="`echo $perl_ccflags | sed -e 's/-D_POSIX_SOURCE//'`" ;;
esac
AC_MSG_RESULT([$perl_ccflags])
AC_SUBST(perl_ccflags)

AC_MSG_CHECKING([for Perl standard link flags])
perl_ldflags="`$perl_prog -e 'use Config; print $Config{ldflags}'`";
case $perl_os in
    *irix-6.* ) perl_ldflags="$perl_ldflags '-Wl,-woff 85'" ;;
esac
AC_MSG_RESULT([$perl_ldflags])
AC_SUBST(perl_ldflags)

AC_MSG_CHECKING([for Perl library files])
perl_libs="`$perl_prog -e 'use Config; print $Config{libs}'`"
AC_MSG_RESULT([$perl_libs])
AC_SUBST(perl_libs)

AC_MSG_CHECKING([for Perl architecture directory])
perl_archlib="`$perlprog -e 'use Config; print $Config{archlib}'`";
AC_MSG_RESULT([$perl_archlib])
AC_SUBST(perl_archlib)

AC_MSG_CHECKING([for Perl dynamic loading support])
usedl="`$perlprog -e 'use Config; print $Config{usedl}'`";
case $usedl in
    define )
        rc=yes
        AC_DEFINE(HAVE_PERL_DYNALOADER)
        perl_dla=$perl_archlib/auto/DynaLoader/DynaLoader.a
        ;;
    * )
        rc=no
        perl_dla=
        ;;
esac
AC_SUBST(perl_dla)
AC_MSG_RESULT([$rc])

AC_MSG_CHECKING([for Perl dynamic loading compilation flags])
perl_cccdlflags="`$perlprog -e 'use Config; print $Config{cccdlflags}'`";
case $perl_cccdlflags in
    " " ) x="none" ;;
    * )   x="$perl_cccdlflags" ;;
esac
AC_MSG_RESULT([$x])
AC_SUBST(perl_cccdlflags)

AC_MSG_CHECKING([for Perl dynamic loading link flags])
perl_ccdlflags="`$perlprog -e 'use Config; print $Config{ccdlflags}'`";
case $perl_os in
    *aix* ) perl_ccdlflags="`echo $perl_ccdlflags | sed -e 's;-bE:perl.exp;-bE:${perl_archlib}/CORE/perl.exp;'`" ;;
esac
case $perl_ccdlflags in
    " " ) x="none" ;;
    * )   x="$perl_ccdlflags" ;;
esac
AC_MSG_RESULT([$x])
AC_SUBST(perl_ccdlflags)


dnl #
dnl #   determine build tools and parameters
dnl #

AC_CONFIGURE_PART(CHECK: System Build Environment)
AC_BUILD_USER
AC_BUILD_TIME
AC_PROG_CC
AC_PROG_RANLIB
AC_EXEEXT
AC_PROGRAM_CHECK(AR, ar, ar,)
AC_PROGRAM_CHECK(SIZE, size, size,)
case $perl_os in
    *irix* ) SIZE="$SIZE -B" ;;
esac

AC_MSG_CHECKING(for compilation debug mode)
AC_ARG_ENABLE(debug,dnl
[  --enable-debug          to enable the debugging options for compilation],
if test ".$ac_cv_prog_gcc" = ".yes"; then
    CFLAGS="-Wall -g -ggdb3"
    LDFLAGS="-g -ggdb3"
else
    CFLAGS="-g"
    LDFLAGS="-g"
fi
x="enabled"
debug=on
AC_DEFINE(DEBUG_ENABLED)
,
CFLAGS=""
LDFLAGS=""
x=disabled
debug=off
)dnl
AC_SUBST(debug)
AC_MSG_RESULT([$x])

if test "$debug" = "on"; then
    AC_MSG_CHECKING(for dmalloc library)
    dmalloc=""
    x=no
    if test -f /sw/include/dmalloc.h; then
        if test -f /sw/shlib/libdmalloc.a; then
            AC_DEFINE(HAVE_DMALLOC)
            CFLAGS="$CFLAGS -I/sw/include"
            LDFLAGS="$LDFLAGS -L/sw/shlib"
            dmalloc="-ldmalloc"
            x=yes
        fi
    fi
    AC_SUBST(dmalloc)
    AC_MSG_RESULT([$x])
fi

AC_SET_MAKE

dnl #
dnl #   determine system parameters
dnl #

AC_CONFIGURE_PART(CHECK: Characteristic of System Headers and Libraries)
AC_CONST
AC_STDC_HEADERS
AC_HAVE_HEADERS(stdio.h stdarg.h stdlib.h string.h ctype.h dnl
                unistd.h time.h signal.h pwd.h grp.h dnl
                sys/types.h sys/stat.h sys/param.h dnl
                sys/socket.h netinet/in.h netdb.h)
AC_CHECK_TYPE(bool, char)
AC_CHECK_FUNCS(memmove)
AC_CHECK_FUNCS(seteuid)
AC_CHECK_FUNCS(setegid)
AC_CHECK_FUNCS(strdup)


dnl #
dnl #   finally: source file substitution...
dnl #

AC_CONFIGURE_PART(RESULT: Sourcefile Substitution)
AC_OUTPUT(dnl
Makefile dnl
config_sc.h dnl
,dnl
)dnl

dnl ##EOF##