[1] | 1 | dnl aclocal.m4 generated automatically by aclocal 1.3
|
---|
| 2 |
|
---|
| 3 | dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
|
---|
| 4 | dnl This Makefile.in is free software; the Free Software Foundation
|
---|
| 5 | dnl gives unlimited permission to copy and/or distribute it,
|
---|
| 6 | dnl with or without modifications, as long as this notice is preserved.
|
---|
| 7 |
|
---|
| 8 | dnl This program is distributed in the hope that it will be useful,
|
---|
| 9 | dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
---|
| 10 | dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
---|
| 11 | dnl PARTICULAR PURPOSE.
|
---|
| 12 |
|
---|
| 13 | #
|
---|
| 14 | # Check to make sure that the build environment is sane.
|
---|
| 15 | #
|
---|
| 16 | AC_DEFUN([AM_INIT_AUTOMAKE],
|
---|
| 17 | [
|
---|
[43] | 18 | AC_REQUIRE([AC_PROG_INSTALL])
|
---|
[1] | 19 | PACKAGE=[$1]
|
---|
| 20 | AC_SUBST(PACKAGE)
|
---|
| 21 | VERSION=[$2]
|
---|
| 22 | AC_SUBST(VERSION)
|
---|
| 23 | dnl test to see if srcdir already configured
|
---|
| 24 | if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
|
---|
| 25 | AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
|
---|
| 26 | fi
|
---|
| 27 | ifelse([$3],,
|
---|
| 28 | AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
|
---|
| 29 | AC_DEFINE_UNQUOTED(VERSION, "$VERSION"))
|
---|
| 30 | AC_REQUIRE([AC_PROG_MAKE_SET])])
|
---|
| 31 |
|
---|
| 32 |
|
---|
| 33 | # Define a conditional.
|
---|
| 34 |
|
---|
| 35 | AC_DEFUN([AM_CONDITIONAL],
|
---|
| 36 | [AC_SUBST($1_TRUE)
|
---|
| 37 | AC_SUBST($1_FALSE)
|
---|
| 38 | if $2; then
|
---|
| 39 | $1_TRUE=
|
---|
| 40 | $1_FALSE='#'
|
---|
| 41 | else
|
---|
| 42 | $1_TRUE='#'
|
---|
| 43 | $1_FALSE=
|
---|
| 44 | fi])
|
---|
| 45 |
|
---|
| 46 |
|
---|
| 47 | AC_DEFUN([sh_run_prog],
|
---|
| 48 | [if test "$cross_compiling" = "yes"; then
|
---|
| 49 | AC_MSG_ERROR([Can not probe non-portable values when cross compiling])
|
---|
| 50 | fi
|
---|
| 51 | cat > conftest.$ac_ext <<EOF
|
---|
| 52 | [#]line __oline__ "configure"
|
---|
| 53 | #include "confdefs.h"
|
---|
| 54 | ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus
|
---|
| 55 | extern "C" void exit(int);
|
---|
| 56 | #endif
|
---|
| 57 | ])
|
---|
| 58 | [$1]
|
---|
| 59 | EOF
|
---|
| 60 | if AC_TRY_EVAL(ac_link) && test -s conftest && $2=`(./conftest 2>/dev/null)`
|
---|
| 61 | then
|
---|
| 62 | dnl Don't remove the temporary files here, so they can be examined.
|
---|
| 63 | ifelse([$3], , :, [$3])
|
---|
| 64 | else
|
---|
| 65 | echo "configure: failed program was:" >&AC_FD_CC
|
---|
| 66 | cat conftest.$ac_ext >&AC_FD_CC
|
---|
| 67 | ifelse([$4], , , [ rm -fr conftest*
|
---|
| 68 | $4
|
---|
| 69 | ])
|
---|
| 70 | fi
|
---|
| 71 | rm -fr conftest* ])
|
---|
| 72 |
|
---|
| 73 | dnl fs type number of the proc filing system
|
---|
| 74 | AC_DEFUN([sh_procfs_id],
|
---|
| 75 | [AC_MSG_CHECKING([f_type of /proc])
|
---|
| 76 | AC_CACHE_VAL([sh_cv_proc_fstype],
|
---|
| 77 | [sh_run_prog(
|
---|
| 78 | changequote(<<, >>)dnl
|
---|
| 79 | <<#include <stdio.h>
|
---|
| 80 | #ifdef HAVE_STDLIB_H
|
---|
| 81 | #include <stdlib.h>
|
---|
| 82 | #endif /* HAVE_STDLIB_H */
|
---|
| 83 | #ifdef HAVE_UNISTD_H
|
---|
| 84 | #include <unistd.h>
|
---|
| 85 | #endif /* HAVE_UNISTD_H */
|
---|
| 86 | #ifdef HAVE_SYS_VFS_H
|
---|
| 87 | #include <sys/vfs.h>
|
---|
| 88 | #endif
|
---|
| 89 | #ifndef Q
|
---|
| 90 | #define __Q(x) #x
|
---|
| 91 | #define Q(x) __Q(x)
|
---|
| 92 | #endif
|
---|
| 93 | int main(void)
|
---|
| 94 | {
|
---|
| 95 | struct statfs fsbuf;
|
---|
| 96 | long ft;
|
---|
| 97 | if (statfs("/", &fsbuf)!=0)
|
---|
| 98 | exit(1);
|
---|
| 99 | ft=fsbuf.f_type;
|
---|
| 100 | if (statfs("/proc/1", &fsbuf)!=0)
|
---|
| 101 | exit(1);
|
---|
| 102 | if (ft!=fsbuf.f_type)
|
---|
| 103 | printf("0x%08lx", fsbuf.f_type);
|
---|
| 104 | else
|
---|
| 105 | puts("statfs useless");
|
---|
| 106 | exit(0);
|
---|
| 107 | } >>
|
---|
| 108 | changequote([, ]), sh_cv_proc_fstype,, sh_cv_proc_fstype="a fatal error occured")])
|
---|
| 109 | AC_MSG_RESULT($sh_cv_proc_fstype)
|
---|
| 110 | if test "${sh_cv_proc_fstype}" = "a fatal error occured"; then
|
---|
| 111 | $1=$2
|
---|
| 112 | $4
|
---|
| 113 | else if test "${sh_cv_proc_fstype}" = "statfs useless"; then
|
---|
| 114 | $1=$2
|
---|
| 115 | $4
|
---|
| 116 | else
|
---|
| 117 | $1=$sh_cv_proc_fstype
|
---|
| 118 | $3
|
---|
| 119 | fi; fi ])
|
---|
| 120 |
|
---|
| 121 | # Check whether mlock is broken (hpux 10.20 raises a SIGBUS if mlock
|
---|
| 122 | # is not called from uid 0 (not tested whether uid 0 works)
|
---|
| 123 | dnl AC_CHECK_MLOCK
|
---|
| 124 | dnl
|
---|
| 125 | define([AC_CHECK_MLOCK],
|
---|
| 126 | [ AC_CHECK_FUNCS(mlock)
|
---|
| 127 | if test "$ac_cv_func_mlock" = "yes"; then
|
---|
| 128 | AC_MSG_CHECKING(whether mlock is broken)
|
---|
| 129 | AC_CACHE_VAL(ac_cv_have_broken_mlock,
|
---|
| 130 | AC_TRY_RUN([
|
---|
| 131 | #include <stdlib.h>
|
---|
| 132 | #include <unistd.h>
|
---|
| 133 | #include <errno.h>
|
---|
| 134 | #include <sys/mman.h>
|
---|
| 135 | #include <sys/types.h>
|
---|
| 136 | #include <fcntl.h>
|
---|
| 137 |
|
---|
| 138 | int main()
|
---|
| 139 | {
|
---|
| 140 | char *pool;
|
---|
| 141 | int err;
|
---|
| 142 | long int pgsize = getpagesize();
|
---|
| 143 |
|
---|
| 144 | pool = malloc( 4096 + pgsize );
|
---|
| 145 | if( !pool )
|
---|
| 146 | return 2;
|
---|
| 147 | pool += (pgsize - ((long int)pool % pgsize));
|
---|
| 148 |
|
---|
| 149 | err = mlock( pool, 4096 );
|
---|
| 150 | if( !err || errno == EPERM )
|
---|
| 151 | return 0; /* okay */
|
---|
| 152 |
|
---|
| 153 | return 1; /* hmmm */
|
---|
| 154 | }
|
---|
| 155 |
|
---|
| 156 | ],
|
---|
| 157 | ac_cv_have_broken_mlock="no",
|
---|
| 158 | ac_cv_have_broken_mlock="yes",
|
---|
| 159 | ac_cv_have_broken_mlock="assume-no"
|
---|
| 160 | )
|
---|
| 161 | )
|
---|
| 162 | if test "$ac_cv_have_broken_mlock" = "yes"; then
|
---|
| 163 | AC_DEFINE(HAVE_BROKEN_MLOCK)
|
---|
| 164 | AC_MSG_RESULT(yes)
|
---|
| 165 | else
|
---|
| 166 | if test "$ac_cv_have_broken_mlock" = "no"; then
|
---|
| 167 | AC_MSG_RESULT(no)
|
---|
| 168 | else
|
---|
| 169 | AC_MSG_RESULT(assuming no)
|
---|
| 170 | fi
|
---|
| 171 | fi
|
---|
| 172 | fi
|
---|
| 173 | ])
|
---|
| 174 |
|
---|
| 175 | dnl @synopsis AC_FUNC_VSNPRINTF
|
---|
| 176 | dnl
|
---|
| 177 | dnl Check whether there is a reasonably sane vsnprintf() function installed.
|
---|
| 178 | dnl "Reasonably sane" in this context means never clobbering memory beyond
|
---|
| 179 | dnl the buffer supplied, and having a sensible return value. It is
|
---|
| 180 | dnl explicitly allowed not to NUL-terminate the return value, however.
|
---|
| 181 | dnl
|
---|
| 182 | dnl @version $Id: ac_func_vsnprintf.m4,v 1.1 2001/07/26 02:00:21 guidod Exp $
|
---|
| 183 | dnl @author Gaute Strokkenes <gs234@cam.ac.uk>
|
---|
| 184 | dnl
|
---|
| 185 | AC_DEFUN([SL_CHECK_VSNPRINTF],
|
---|
| 186 | [AC_CACHE_CHECK(for working vsnprintf,
|
---|
| 187 | ac_cv_func_vsnprintf,
|
---|
| 188 | [AC_TRY_RUN(
|
---|
| 189 | [#include <stdio.h>
|
---|
| 190 | #include <stdarg.h>
|
---|
| 191 |
|
---|
| 192 | int
|
---|
| 193 | doit(char * s, ...)
|
---|
| 194 | {
|
---|
| 195 | char buffer[32];
|
---|
| 196 | va_list args;
|
---|
| 197 | int r;
|
---|
| 198 |
|
---|
| 199 | buffer[5] = 'X';
|
---|
| 200 |
|
---|
| 201 | va_start(args, s);
|
---|
| 202 | r = vsnprintf(buffer, 5, s, args);
|
---|
| 203 | va_end(args);
|
---|
| 204 |
|
---|
| 205 | /* -1 is pre-C99, 7 is C99. R.W. 17.01.2003 disallow -1 */
|
---|
| 206 |
|
---|
| 207 | if (r != 7)
|
---|
| 208 | exit(1);
|
---|
| 209 |
|
---|
| 210 | /* We deliberately do not care if the result is NUL-terminated or
|
---|
| 211 | not, since this is easy to work around like this. */
|
---|
| 212 |
|
---|
| 213 | buffer[4] = 0;
|
---|
| 214 |
|
---|
| 215 | /* Simple sanity check. */
|
---|
| 216 |
|
---|
| 217 | if (strcmp(buffer, "1234"))
|
---|
| 218 | exit(1);
|
---|
| 219 |
|
---|
| 220 | if (buffer[5] != 'X')
|
---|
| 221 | exit(1);
|
---|
| 222 |
|
---|
| 223 | exit(0);
|
---|
| 224 | }
|
---|
| 225 |
|
---|
| 226 | int
|
---|
| 227 | main(void)
|
---|
| 228 | {
|
---|
| 229 | doit("1234567");
|
---|
| 230 | exit(1);
|
---|
| 231 | }], ac_cv_func_vsnprintf=yes, ac_cv_func_vsnprintf=no, ac_cv_func_vsnprintf=no)])
|
---|
| 232 | dnl Note that the default is to be pessimistic in the case
|
---|
| 233 | dnl of cross compilation.
|
---|
| 234 | dnl If you know that the target has a sensible vsnprintf(),
|
---|
| 235 | dnl you can get around this
|
---|
| 236 | dnl by setting ac_func_vsnprintf to yes, as described in the Autoconf manual.
|
---|
| 237 | if test $ac_cv_func_vsnprintf = yes; then
|
---|
| 238 | :
|
---|
| 239 | else
|
---|
| 240 | AC_DEFINE(HAVE_BROKEN_VSNPRINTF, 1,
|
---|
| 241 | [Define if you have a broken version of the `vsnprintf' function.])
|
---|
| 242 | fi
|
---|
| 243 | ])# AC_FUNC_VSNPRINTF
|
---|
| 244 |
|
---|
| 245 | dnl SH_CHECK_TYPEDEF(TYPE, HAVE_NAME)
|
---|
| 246 | dnl Check whether a typedef exists and create a #define $2 if it exists
|
---|
| 247 | dnl
|
---|
| 248 | AC_DEFUN([SH_CHECK_TYPEDEF],
|
---|
| 249 | [ AC_MSG_CHECKING(for $1 typedef)
|
---|
| 250 | sh_cv_typedef_foo=`echo sh_cv_typedef_$1 | sed -e 's% %_%g'`
|
---|
| 251 | AC_CACHE_VAL( $sh_cv_typedef_foo,
|
---|
[156] | 252 | [AC_TRY_COMPILE([
|
---|
| 253 | #include <stdlib.h>
|
---|
| 254 | #include <sys/types.h>
|
---|
| 255 | #ifdef HAVE_STDINT_H
|
---|
| 256 | #include <stdint.h>
|
---|
| 257 | #endif
|
---|
| 258 | #ifdef HAVE_INTTYPES_H
|
---|
| 259 | #include <inttypes.h>
|
---|
| 260 | #endif], [
|
---|
[1] | 261 | #undef $1
|
---|
| 262 | int a = sizeof($1);
|
---|
| 263 | ], sh_cv_typedef=yes, sh_cv_typedef=no )])
|
---|
| 264 | AC_MSG_RESULT($sh_cv_typedef)
|
---|
| 265 | if test "$sh_cv_typedef" = yes; then
|
---|
| 266 | AC_DEFINE($2)
|
---|
| 267 | sh_$2=yes
|
---|
| 268 | else
|
---|
| 269 | sh_$2=no
|
---|
| 270 | fi
|
---|
| 271 | ])
|
---|
| 272 |
|
---|
| 273 |
|
---|
| 274 |
|
---|
| 275 | dnl **********************
|
---|
| 276 | dnl *** va_copy checks ***
|
---|
| 277 | dnl **********************
|
---|
| 278 | AC_DEFUN([SL_CHECK_VA_COPY],
|
---|
| 279 | [AC_MSG_CHECKING(for va_copy())
|
---|
| 280 | AC_CACHE_VAL(sh_cv_va_copy,[
|
---|
| 281 | AC_TRY_RUN([
|
---|
| 282 | #include <stdarg.h>
|
---|
| 283 | void f (int i, ...) {
|
---|
| 284 | va_list args1, args2;
|
---|
| 285 | va_start (args1, i);
|
---|
| 286 | va_copy (args2, args1);
|
---|
| 287 | if (va_arg (args2, int) != 42)
|
---|
| 288 | exit (1);
|
---|
| 289 | if (va_arg (args1, int) != 42)
|
---|
| 290 | exit (1);
|
---|
| 291 | va_end (args1); va_end (args2);
|
---|
| 292 | }
|
---|
| 293 | int main() {
|
---|
| 294 | f (0, 42);
|
---|
| 295 | return 0;
|
---|
| 296 | }],
|
---|
| 297 | sh_cv_va_copy=yes
|
---|
| 298 | ,
|
---|
| 299 | sh_cv_va_copy=no
|
---|
| 300 | ,
|
---|
| 301 | sh_cv_va_copy=no)
|
---|
| 302 | ])
|
---|
| 303 | AC_MSG_RESULT($sh_cv_va_copy)
|
---|
| 304 | AC_MSG_CHECKING(for __va_copy())
|
---|
| 305 | AC_CACHE_VAL(sh_cv___va_copy,[
|
---|
| 306 | AC_TRY_RUN([
|
---|
| 307 | #include <stdarg.h>
|
---|
| 308 | void f (int i, ...) {
|
---|
| 309 | va_list args1, args2;
|
---|
| 310 | va_start (args1, i);
|
---|
| 311 | __va_copy (args2, args1);
|
---|
| 312 | if (va_arg (args2, int) != 42)
|
---|
| 313 | exit (1);
|
---|
| 314 | if (va_arg (args1, int) != 42)
|
---|
| 315 | exit (1);
|
---|
| 316 | va_end (args1); va_end (args2);
|
---|
| 317 | }
|
---|
| 318 | int main() {
|
---|
| 319 | f (0, 42);
|
---|
| 320 | return 0;
|
---|
| 321 | }],
|
---|
| 322 | sh_cv___va_copy=yes
|
---|
| 323 | ,
|
---|
| 324 | sh_cv___va_copy=no
|
---|
| 325 | ,
|
---|
| 326 | sh_cv___va_copy=no)
|
---|
| 327 | ])
|
---|
| 328 | AC_MSG_RESULT($sh_cv___va_copy)
|
---|
| 329 | AC_MSG_CHECKING(whether va_lists can be copied by value)
|
---|
| 330 | AC_CACHE_VAL(sh_cv_va_val_copy,[
|
---|
| 331 | AC_TRY_RUN([
|
---|
| 332 | #include <stdarg.h>
|
---|
| 333 | void f (int i, ...) {
|
---|
| 334 | va_list args1, args2;
|
---|
| 335 | va_start (args1, i);
|
---|
| 336 | args2 = args1;
|
---|
| 337 | if (va_arg (args2, int) != 42)
|
---|
| 338 | exit (1);
|
---|
| 339 | if (va_arg (args1, int) != 42)
|
---|
| 340 | exit (1);
|
---|
| 341 | va_end (args1); va_end (args2);
|
---|
| 342 | }
|
---|
| 343 | int main() {
|
---|
| 344 | f (0, 42);
|
---|
| 345 | return 0;
|
---|
| 346 | }],
|
---|
| 347 | sh_cv_va_val_copy=yes
|
---|
| 348 | ,
|
---|
| 349 | sh_cv_va_val_copy=no
|
---|
| 350 | ,
|
---|
| 351 | sh_cv_va_val_copy=no)
|
---|
| 352 | ])
|
---|
| 353 | if test "x$sh_cv_va_copy" = "xyes"; then
|
---|
| 354 | AC_DEFINE(VA_COPY, va_copy)
|
---|
| 355 | else if test "x$sh_cv___va_copy" = "xyes"; then
|
---|
| 356 | AC_DEFINE(VA_COPY, __va_copy)
|
---|
| 357 | fi
|
---|
| 358 | fi
|
---|
| 359 | if test "x$sh_cv_va_val_copy" = "xno"; then
|
---|
| 360 | AC_DEFINE(VA_COPY_AS_ARRAY)
|
---|
| 361 | fi
|
---|
| 362 | AC_MSG_RESULT($sh_cv_va_val_copy)
|
---|
| 363 | ])
|
---|
| 364 |
|
---|
| 365 |
|
---|
| 366 | dnl SH_INIT_PARSE_ARGS()
|
---|
| 367 | m4_define([SH_INIT_PARSE_ARGS],
|
---|
| 368 | [
|
---|
| 369 | m4_divert_push([PARSE_ARGS])dnl
|
---|
| 370 |
|
---|
| 371 | as_cr_letters='abcdefghijklmnopqrstuvwxyz'
|
---|
| 372 | as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
|
---|
| 373 | as_cr_Letters=$as_cr_letters$as_cr_LETTERS
|
---|
| 374 | as_cr_digits='0123456789'
|
---|
| 375 | as_cr_alnum=$as_cr_Letters$as_cr_digits
|
---|
| 376 |
|
---|
| 377 | # Sed expression to map a string onto a valid CPP name.
|
---|
| 378 | as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[[^_$as_cr_alnum]]%_%g"
|
---|
| 379 |
|
---|
| 380 | as_tr_sh="eval sed 'y%*+%pp%;s%[[^_$as_cr_alnum]]%_%g'"
|
---|
| 381 | # IFS
|
---|
| 382 | # We need space, tab and new line, in precisely that order.
|
---|
| 383 | as_nl='
|
---|
| 384 | '
|
---|
| 385 | IFS=" $as_nl"
|
---|
| 386 |
|
---|
| 387 | # CDPATH.
|
---|
| 388 | $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=$PATH_SEPARATOR; export CDPATH; }
|
---|
| 389 |
|
---|
| 390 |
|
---|
| 391 | # Initialize some variables set by options.
|
---|
| 392 | ac_init_help=
|
---|
| 393 | ac_init_version=false
|
---|
| 394 | # The variables have the same names as the options, with
|
---|
| 395 | # dashes changed to underlines.
|
---|
| 396 | cache_file=/dev/null
|
---|
| 397 | AC_SUBST(exec_prefix, NONE)dnl
|
---|
| 398 | no_create=
|
---|
| 399 | no_recursion=
|
---|
| 400 | AC_SUBST(prefix, NONE)dnl
|
---|
| 401 | program_prefix=NONE
|
---|
| 402 | program_suffix=NONE
|
---|
| 403 | AC_SUBST(program_transform_name, [s,x,x,])dnl
|
---|
| 404 | silent=
|
---|
| 405 | site=
|
---|
| 406 | srcdir=
|
---|
| 407 | verbose=
|
---|
| 408 | x_includes=NONE
|
---|
| 409 | x_libraries=NONE
|
---|
| 410 | DESTDIR=
|
---|
[441] | 411 | SH_ENABLE_OPTS="asm ssp db-reload xml-log message-queue login-watch process-check port-check mounts-check logfile-monitor userfiles debug ptrace static network udp nocl stealth micro-stealth install-name identity khide suidcheck base largefile mail external-scripts encrypt srp dnmalloc ipv6 shellexpand suid"
|
---|
[191] | 412 | SH_WITH_OPTS="prelude libprelude-prefix database libwrap cflags libs console altconsole timeserver alttimeserver rnd egd-socket port logserver altlogserver kcheck gpg keyid checksum fp recipient sender trusted tmp-dir config-file log-file pid-file state-dir data-file html-file"
|
---|
[1] | 413 |
|
---|
| 414 | # Installation directory options.
|
---|
| 415 | # These are left unexpanded so users can "make install exec_prefix=/foo"
|
---|
| 416 | # and all the variables that are supposed to be based on exec_prefix
|
---|
| 417 | # by default will actually change.
|
---|
| 418 | dnl Use braces instead of parens because sh, perl, etc. also accept them.
|
---|
| 419 | sbindir='${exec_prefix}/sbin'
|
---|
| 420 | sysconfdir='${prefix}/etc'
|
---|
| 421 | localstatedir='${prefix}/var'
|
---|
| 422 | mandir='${prefix}/share/man'
|
---|
| 423 |
|
---|
| 424 | AC_SUBST([sbindir], ['${exec_prefix}/sbin'])dnl
|
---|
| 425 | AC_SUBST([sysconfdir], ['${prefix}/etc'])dnl
|
---|
| 426 | AC_SUBST([localstatedir], ['${prefix}/var'])dnl
|
---|
| 427 | AC_SUBST([mandir], ['${prefix}/share/man'])dnl
|
---|
| 428 |
|
---|
| 429 |
|
---|
| 430 | # Initialize some other variables.
|
---|
| 431 | subdirs=
|
---|
| 432 | MFLAGS= MAKEFLAGS=
|
---|
| 433 | SHELL=${CONFIG_SHELL-/bin/sh}
|
---|
| 434 | # Maximum number of lines to put in a shell here document.
|
---|
| 435 | ac_max_here_lines=12
|
---|
| 436 |
|
---|
| 437 | ac_prev=
|
---|
| 438 | for ac_option
|
---|
| 439 | do
|
---|
| 440 |
|
---|
| 441 | # If the previous option needs an argument, assign it.
|
---|
| 442 | if test -n "$ac_prev"; then
|
---|
| 443 | eval "$ac_prev=\$ac_option"
|
---|
| 444 | ac_prev=
|
---|
| 445 | continue
|
---|
| 446 | fi
|
---|
| 447 |
|
---|
| 448 | case "$ac_option" in
|
---|
| 449 | changequote(, )dnl
|
---|
| 450 | *=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
|
---|
| 451 | changequote([, ])dnl
|
---|
| 452 | *) ac_optarg= ;;
|
---|
| 453 | esac
|
---|
| 454 |
|
---|
| 455 | # Accept the important Cygnus configure options, so we can diagnose typos.
|
---|
| 456 |
|
---|
| 457 | case "$ac_option" in
|
---|
| 458 |
|
---|
| 459 | -build | --build | --buil | --bui | --bu)
|
---|
| 460 | ac_prev=build_alias ;;
|
---|
| 461 | -build=* | --build=* | --buil=* | --bui=* | --bu=*)
|
---|
| 462 | build_alias="$ac_optarg" ;;
|
---|
| 463 |
|
---|
| 464 | -cache-file | --cache-file | --cache-fil | --cache-fi \
|
---|
| 465 | | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
|
---|
| 466 | ac_prev=cache_file ;;
|
---|
| 467 | -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
|
---|
| 468 | | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
|
---|
| 469 | cache_file="$ac_optarg" ;;
|
---|
| 470 |
|
---|
| 471 | --config-cache | -C)
|
---|
| 472 | cache_file=config.cache ;;
|
---|
| 473 |
|
---|
| 474 | -disable-* | --disable-*)
|
---|
| 475 | ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
|
---|
| 476 | # Reject names that are not valid shell variable names.
|
---|
| 477 | expr "x$ac_feature" : "[.*[^-_$as_cr_alnum]]" >/dev/null &&
|
---|
| 478 | AC_MSG_ERROR([invalid feature name: $ac_feature])
|
---|
| 479 | ac_feature=`echo $ac_feature | sed 's/-/_/g'`
|
---|
| 480 | ac_enable_check_opt=no
|
---|
| 481 | for f in ${SH_ENABLE_OPTS}
|
---|
| 482 | do
|
---|
| 483 | f=`echo $f | sed 's/-/_/g'`
|
---|
| 484 | if test x${f} = x"${ac_feature}"
|
---|
| 485 | then
|
---|
| 486 | ac_enable_check_opt=yes
|
---|
| 487 | fi
|
---|
| 488 | done
|
---|
| 489 | if test x${ac_enable_check_opt} = xno
|
---|
| 490 | then
|
---|
| 491 | AC_MSG_ERROR([unrecognized option: $ac_option
|
---|
| 492 | Try `$[0] --help' for more information.])
|
---|
| 493 | fi
|
---|
| 494 | eval "enable_$ac_feature=no" ;;
|
---|
| 495 |
|
---|
| 496 | -enable-* | --enable-*)
|
---|
| 497 | ac_feature=`expr "x$ac_option" : 'x-*enable-\([[^=]]*\)'`
|
---|
| 498 | # Reject names that are not valid shell variable names.
|
---|
| 499 | expr "x$ac_feature" : "[.*[^-_$as_cr_alnum]]" >/dev/null &&
|
---|
| 500 | AC_MSG_ERROR([invalid feature name: $ac_feature])
|
---|
| 501 | ac_feature=`echo $ac_feature | sed 's/-/_/g'`
|
---|
| 502 | case $ac_option in
|
---|
| 503 | *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
|
---|
| 504 | *) ac_optarg=yes ;;
|
---|
| 505 | esac
|
---|
| 506 | ac_enable_check_opt=no
|
---|
| 507 | for f in ${SH_ENABLE_OPTS}
|
---|
| 508 | do
|
---|
| 509 | f=`echo $f | sed 's/-/_/g'`
|
---|
| 510 | if test x${f} = x"${ac_feature}"
|
---|
| 511 | then
|
---|
| 512 | ac_enable_check_opt=yes
|
---|
| 513 | fi
|
---|
| 514 | done
|
---|
| 515 | if test x${ac_enable_check_opt} = xno
|
---|
| 516 | then
|
---|
| 517 | AC_MSG_ERROR([unrecognized option: $ac_option
|
---|
| 518 | Try `$[0] --help' for more information.])
|
---|
| 519 | fi
|
---|
| 520 | eval "enable_$ac_feature='$ac_optarg'" ;;
|
---|
| 521 |
|
---|
| 522 | -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
|
---|
| 523 | | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
|
---|
| 524 | | --exec | --exe | --ex)
|
---|
| 525 | ac_prev=exec_prefix
|
---|
| 526 | ac_exec_prefix_set="yes"
|
---|
| 527 | ;;
|
---|
| 528 | -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
|
---|
| 529 | | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
|
---|
| 530 | | --exec=* | --exe=* | --ex=*)
|
---|
| 531 | exec_prefix="$ac_optarg"
|
---|
| 532 | ac_exec_prefix_set="yes"
|
---|
| 533 | ;;
|
---|
| 534 |
|
---|
| 535 | -gas | --gas | --ga | --g)
|
---|
| 536 | # Obsolete; use --with-gas.
|
---|
| 537 | with_gas=yes ;;
|
---|
| 538 |
|
---|
| 539 | -help | --help | --hel | --he | -h)
|
---|
| 540 | ac_init_help=long ;;
|
---|
| 541 | -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
|
---|
| 542 | ac_init_help=recursive ;;
|
---|
| 543 | -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
|
---|
| 544 | ac_init_help=short ;;
|
---|
| 545 |
|
---|
| 546 | -host | --host | --hos | --ho)
|
---|
| 547 | ac_prev=host_alias ;;
|
---|
| 548 | -host=* | --host=* | --hos=* | --ho=*)
|
---|
| 549 | host_alias="$ac_optarg" ;;
|
---|
| 550 |
|
---|
| 551 | -localstatedir | --localstatedir | --localstatedi | --localstated \
|
---|
| 552 | | --localstate | --localstat | --localsta | --localst \
|
---|
| 553 | | --locals | --local | --loca | --loc | --lo)
|
---|
| 554 | ac_prev=localstatedir
|
---|
| 555 | ac_localstatedir_set="yes"
|
---|
| 556 | ;;
|
---|
| 557 | -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
|
---|
| 558 | | --localstate=* | --localstat=* | --localsta=* | --localst=* \
|
---|
| 559 | | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
|
---|
| 560 | localstatedir="$ac_optarg"
|
---|
| 561 | ac_localstatedir_set="yes"
|
---|
| 562 | ;;
|
---|
| 563 |
|
---|
| 564 | -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
|
---|
| 565 | ac_prev=mandir
|
---|
| 566 | ac_mandir_set="yes"
|
---|
| 567 | ;;
|
---|
| 568 | -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
|
---|
| 569 | mandir="$ac_optarg"
|
---|
| 570 | ac_mandir_set="yes"
|
---|
| 571 | ;;
|
---|
| 572 |
|
---|
| 573 | -nfp | --nfp | --nf)
|
---|
| 574 | # Obsolete; use --without-fp.
|
---|
| 575 | with_fp=no ;;
|
---|
| 576 |
|
---|
| 577 | -no-create | --no-create | --no-creat | --no-crea | --no-cre \
|
---|
| 578 | | --no-cr | --no-c | -n)
|
---|
| 579 | no_create=yes ;;
|
---|
| 580 |
|
---|
| 581 | -no-recursion | --no-recursion | --no-recursio | --no-recursi \
|
---|
| 582 | | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
|
---|
| 583 | no_recursion=yes ;;
|
---|
| 584 |
|
---|
| 585 | -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
|
---|
| 586 | ac_prev=prefix
|
---|
| 587 | ac_prefix_set="yes"
|
---|
| 588 | ;;
|
---|
| 589 | -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
|
---|
| 590 | prefix="$ac_optarg"
|
---|
| 591 | ac_prefix_set="yes"
|
---|
| 592 | ;;
|
---|
| 593 |
|
---|
| 594 | -q | -quiet | --quiet | --quie | --qui | --qu | --q \
|
---|
| 595 | | -silent | --silent | --silen | --sile | --sil)
|
---|
| 596 | silent=yes ;;
|
---|
| 597 |
|
---|
| 598 | -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
|
---|
| 599 | ac_prev=sbindir
|
---|
| 600 | ac_sbindir_set="yes"
|
---|
| 601 | ;;
|
---|
| 602 | -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
|
---|
| 603 | | --sbi=* | --sb=*)
|
---|
| 604 | sbindir="$ac_optarg"
|
---|
| 605 | ac_sbindir_set="yes"
|
---|
| 606 | ;;
|
---|
| 607 |
|
---|
| 608 | -bindir | --bindir | --bindi | --bind | --bin | --bi | --b)
|
---|
| 609 | echo "WARNING: bindir will be ignored, use sbindir"
|
---|
| 610 | ;;
|
---|
| 611 | -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* \
|
---|
| 612 | | --bi=* | --b=*)
|
---|
| 613 | echo "WARNING: bindir will be ignored, use sbindir"
|
---|
| 614 | ;;
|
---|
| 615 |
|
---|
| 616 | -datadir | --datadir)
|
---|
| 617 | echo "WARNING: datadir will be ignored"
|
---|
| 618 | ;;
|
---|
| 619 | -datadir=* | --datadir=*)
|
---|
| 620 | echo "WARNING: datadir will be ignored"
|
---|
| 621 | ;;
|
---|
| 622 |
|
---|
| 623 | -includedir | --includedir)
|
---|
| 624 | echo "WARNING: includedir will be ignored"
|
---|
| 625 | ;;
|
---|
| 626 | -includedir=* | --includedir=*)
|
---|
| 627 | echo "WARNING: includedir will be ignored"
|
---|
| 628 | ;;
|
---|
| 629 |
|
---|
| 630 | -infodir | --infodir)
|
---|
| 631 | echo "WARNING: infodir will be ignored"
|
---|
| 632 | ;;
|
---|
| 633 | -infodir=* | --infodir=*)
|
---|
| 634 | echo "WARNING: infodir will be ignored"
|
---|
| 635 | ;;
|
---|
| 636 |
|
---|
| 637 | -libdir | --libdir)
|
---|
| 638 | echo "WARNING: libdir will be ignored"
|
---|
| 639 | ;;
|
---|
| 640 | -libdir=* | --libdir=*)
|
---|
| 641 | echo "WARNING: libdir will be ignored"
|
---|
| 642 | ;;
|
---|
| 643 |
|
---|
| 644 | -libexecdir | --libexecdir)
|
---|
| 645 | echo "WARNING: libexecdir will be ignored"
|
---|
| 646 | ;;
|
---|
| 647 | -libexecdir=* | --libexecdir=*)
|
---|
| 648 | echo "WARNING: libexecdir will be ignored"
|
---|
| 649 | ;;
|
---|
| 650 |
|
---|
| 651 | -sharedstatedir | --sharedstatedir)
|
---|
| 652 | echo "WARNING: sharedstatedir will be ignored"
|
---|
| 653 | ;;
|
---|
| 654 | -sharedstatedir=* | --sharedstatedir=*)
|
---|
| 655 | echo "WARNING: sharedstatedir will be ignored"
|
---|
| 656 | ;;
|
---|
| 657 |
|
---|
| 658 | -site | --site | --sit)
|
---|
| 659 | ac_prev=site ;;
|
---|
| 660 | -site=* | --site=* | --sit=*)
|
---|
| 661 | site="$ac_optarg" ;;
|
---|
| 662 |
|
---|
| 663 | -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
|
---|
| 664 | ac_prev=srcdir ;;
|
---|
| 665 | -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
|
---|
| 666 | srcdir="$ac_optarg" ;;
|
---|
| 667 |
|
---|
| 668 | -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
|
---|
| 669 | | --syscon | --sysco | --sysc | --sys | --sy)
|
---|
| 670 | ac_prev=sysconfdir
|
---|
| 671 | ac_sysconfdir_set="yes"
|
---|
| 672 | ;;
|
---|
| 673 | -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
|
---|
| 674 | | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
|
---|
| 675 | sysconfdir="$ac_optarg"
|
---|
| 676 | ac_sysconfdir_set="yes"
|
---|
| 677 | ;;
|
---|
| 678 |
|
---|
| 679 | -target | --target | --targe | --targ | --tar | --ta | --t)
|
---|
| 680 | ac_prev=target_alias ;;
|
---|
| 681 | -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
|
---|
| 682 | target_alias="$ac_optarg" ;;
|
---|
| 683 |
|
---|
| 684 | -v | -verbose | --verbose | --verbos | --verbo | --verb)
|
---|
| 685 | verbose=yes ;;
|
---|
| 686 |
|
---|
| 687 | -version | --version | --versio | --versi | --vers)
|
---|
| 688 | ac_init_version=: ;;
|
---|
| 689 |
|
---|
| 690 |
|
---|
| 691 | -with-* | --with-*)
|
---|
| 692 | ac_package=`expr "x$ac_option" : 'x-*with-\([[^=]]*\)'`
|
---|
| 693 | # Reject names that are not valid shell variable names.
|
---|
| 694 | expr "x$ac_package" : "[.*[^-_$as_cr_alnum]]" >/dev/null &&
|
---|
| 695 | AC_MSG_ERROR([invalid package name: $ac_package])
|
---|
| 696 | ac_package=`echo $ac_package| sed 's/-/_/g'`
|
---|
| 697 | case $ac_option in
|
---|
| 698 | *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
|
---|
| 699 | *) ac_optarg=yes ;;
|
---|
| 700 | esac
|
---|
| 701 | ac_with_check_opt=no
|
---|
| 702 | for f in ${SH_WITH_OPTS}
|
---|
| 703 | do
|
---|
| 704 | f=`echo $f | sed 's/-/_/g'`
|
---|
| 705 | if test x${f} = x"${ac_package}"
|
---|
| 706 | then
|
---|
| 707 | ac_with_check_opt=yes
|
---|
| 708 | fi
|
---|
| 709 | done
|
---|
| 710 | if test x${ac_with_check_opt} = xno
|
---|
| 711 | then
|
---|
| 712 | AC_MSG_ERROR([unrecognized option: $ac_option
|
---|
| 713 | Try `$[0] --help' for more information.])
|
---|
| 714 | fi
|
---|
| 715 | eval "with_$ac_package='$ac_optarg'" ;;
|
---|
| 716 |
|
---|
| 717 | -without-* | --without-*)
|
---|
| 718 | ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
|
---|
| 719 | # Reject names that are not valid shell variable names.
|
---|
| 720 | expr "x$ac_package" : "[.*[^-_$as_cr_alnum]]" >/dev/null &&
|
---|
| 721 | AC_MSG_ERROR([invalid package name: $ac_package])
|
---|
| 722 | ac_package=`echo $ac_package | sed 's/-/_/g'`
|
---|
| 723 | ac_with_check_opt=no
|
---|
| 724 | for f in ${SH_WITH_OPTS}
|
---|
| 725 | do
|
---|
| 726 | f=`echo $f | sed 's/-/_/g'`
|
---|
| 727 | if test x${f} = x"${ac_package}"
|
---|
| 728 | then
|
---|
| 729 | ac_with_check_opt=yes
|
---|
| 730 | fi
|
---|
| 731 | done
|
---|
| 732 | if test x${ac_with_check_opt} = xno
|
---|
| 733 | then
|
---|
| 734 | AC_MSG_ERROR([unrecognized option: $ac_option
|
---|
| 735 | Try `$[0] --help' for more information.])
|
---|
| 736 | fi
|
---|
| 737 | eval "with_$ac_package=no" ;;
|
---|
| 738 |
|
---|
| 739 |
|
---|
| 740 | -*) AC_MSG_ERROR([unrecognized option: $ac_option
|
---|
| 741 | Try `$[0] --help' for more information.])
|
---|
| 742 | ;;
|
---|
| 743 |
|
---|
| 744 | *=*)
|
---|
| 745 | ac_envvar=`expr "x$ac_option" : 'x\([[^=]]*\)='`
|
---|
| 746 | # Reject names that are not valid shell variable names.
|
---|
| 747 | expr "x$ac_envvar" : "[.*[^_$as_cr_alnum]]" >/dev/null &&
|
---|
| 748 | AC_MSG_ERROR([invalid variable name: $ac_envvar])
|
---|
| 749 | ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
|
---|
| 750 | eval "$ac_envvar='$ac_optarg'"
|
---|
| 751 | export $ac_envvar ;;
|
---|
| 752 |
|
---|
| 753 | *)
|
---|
| 754 | # FIXME: should be removed in autoconf 3.0.
|
---|
| 755 | AC_MSG_WARN([you should use --build, --host, --target])
|
---|
| 756 | expr "x$ac_option" : "[.*[^-._$as_cr_alnum]]" >/dev/null &&
|
---|
| 757 | AC_MSG_WARN([invalid host type: $ac_option])
|
---|
| 758 | : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
|
---|
| 759 | ;;
|
---|
| 760 |
|
---|
| 761 |
|
---|
| 762 | esac
|
---|
| 763 | done
|
---|
| 764 |
|
---|
| 765 | if test -n "$ac_prev"; then
|
---|
| 766 | AC_MSG_ERROR(missing argument to --`echo $ac_prev | sed 's/_/-/g'`)
|
---|
| 767 | fi
|
---|
| 768 |
|
---|
| 769 | # Be sure to have absolute paths.
|
---|
| 770 | for ac_var in prefix exec_prefix
|
---|
| 771 | do
|
---|
| 772 | eval ac_val=$`echo $ac_var`
|
---|
| 773 | case $ac_val in
|
---|
| 774 | [[\\/$]]* | ?:[[\\/]]* | NONE | '' | OPT | USR ) ;;
|
---|
| 775 | *) AC_MSG_ERROR([expected an absolute directory name for --$ac_var: $ac_val]);;
|
---|
| 776 | esac
|
---|
| 777 | done
|
---|
| 778 |
|
---|
| 779 | # Be sure to have absolute paths.
|
---|
| 780 | for ac_var in sbindir sysconfdir localstatedir mandir
|
---|
| 781 | do
|
---|
| 782 | eval ac_val=$`echo $ac_var`
|
---|
| 783 | case $ac_val in
|
---|
| 784 | [[\\/$]]* | ?:[[\\/]]* ) ;;
|
---|
| 785 | *) AC_MSG_ERROR([expected an absolute directory name for --$ac_var: $ac_val]);;
|
---|
| 786 | esac
|
---|
| 787 | done
|
---|
| 788 |
|
---|
| 789 | # There might be people who depend on the old broken behavior: `$host'
|
---|
| 790 | # used to hold the argument of --host etc.
|
---|
| 791 | # FIXME: To remove some day.
|
---|
| 792 | build=$build_alias
|
---|
| 793 | host=$host_alias
|
---|
| 794 | target=$target_alias
|
---|
| 795 |
|
---|
| 796 | # FIXME: To remove some day.
|
---|
| 797 | if test "x$host_alias" != x; then
|
---|
| 798 | if test "x$build_alias" = x; then
|
---|
| 799 | cross_compiling=maybe
|
---|
| 800 | AC_MSG_WARN([If you wanted to set the --build type, don't use --host.
|
---|
| 801 | If a cross compiler is detected then cross compile mode will be used.])
|
---|
| 802 | elif test "x$build_alias" != "x$host_alias"; then
|
---|
| 803 | cross_compiling=yes
|
---|
| 804 | fi
|
---|
| 805 | fi
|
---|
| 806 |
|
---|
| 807 | ac_tool_prefix=
|
---|
| 808 | test -n "$host_alias" && ac_tool_prefix=$host_alias-
|
---|
| 809 |
|
---|
| 810 | test "$silent" = yes && exec AS_MESSAGE_FD>/dev/null
|
---|
| 811 |
|
---|
| 812 | m4_divert_pop([PARSE_ARGS])dnl
|
---|
| 813 | ])# SH_INIT_PARSE_ARGS
|
---|
| 814 |
|
---|
| 815 | m4_define([SH_INIT_HELP],
|
---|
| 816 | [m4_divert_push([HELP_BEGIN])dnl
|
---|
| 817 |
|
---|
| 818 | #
|
---|
| 819 | # Report the --help message.
|
---|
| 820 | #
|
---|
| 821 | if test "$ac_init_help" = "long"; then
|
---|
| 822 | # Omit some internal or obsolete options to make the list less imposing.
|
---|
| 823 | # This message is too long to be a string in the A/UX 3.1 sh.
|
---|
| 824 | cat <<_ACEOF
|
---|
| 825 | \`configure' configures m4_ifset([AC_PACKAGE_STRING],
|
---|
| 826 | [AC_PACKAGE_STRING],
|
---|
| 827 | [this package]) to adapt to many kinds of systems.
|
---|
| 828 |
|
---|
| 829 | Usage: $[0] [[OPTION]]... [[VAR=VALUE]]...
|
---|
| 830 |
|
---|
| 831 | [To assign environment variables (e.g., CC, CFLAGS...), specify them as
|
---|
| 832 | VAR=VALUE. See below for descriptions of some of the useful variables.
|
---|
| 833 |
|
---|
| 834 | Defaults for the options are specified in brackets.
|
---|
| 835 |
|
---|
| 836 | Configuration:
|
---|
| 837 | -h, --help display this help and exit
|
---|
| 838 | --help=short display options specific to this package
|
---|
| 839 | --help=recursive display the short help of all the included packages
|
---|
| 840 | -V, --version display version information and exit
|
---|
| 841 | -q, --quiet, --silent do not print \`checking...' messages
|
---|
| 842 | --cache-file=FILE cache test results in FILE [disabled]
|
---|
| 843 | -C, --config-cache alias for \`--cache-file=config.cache'
|
---|
| 844 | -n, --no-create do not create output files
|
---|
| 845 | --srcdir=DIR find the sources in DIR [configure dir or \`..']
|
---|
| 846 |
|
---|
| 847 | _ACEOF
|
---|
| 848 |
|
---|
| 849 | cat <<_ACEOF
|
---|
| 850 | Installation directories:
|
---|
| 851 | --prefix=PREFIX install architecture-independent files in PREFIX
|
---|
| 852 | [$ac_default_prefix]
|
---|
| 853 | --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
|
---|
| 854 | [PREFIX]
|
---|
| 855 |
|
---|
| 856 | By default, \`make install' will install binaries in \`/usr/local/sbin',
|
---|
| 857 | the config file in \`/etc', manpage in \`/usr/local/share/man', and state
|
---|
| 858 | data in \`/var/lib/INSTALL_NAME' (FSH layout). You can specify other
|
---|
| 859 | FSH compliant layouts with \`--prefix=OPT' or \`--prefix=USR', or you
|
---|
| 860 | can specify a directory with \`--prefix=DIR' to install in \`DIR/sbin',
|
---|
| 861 | \`DIR/etc', etc.
|
---|
| 862 |
|
---|
| 863 | For better control, use the options below.
|
---|
| 864 |
|
---|
| 865 | Fine tuning of the installation directories:
|
---|
| 866 | --sbindir=DIR system admin executables [EPREFIX/sbin]
|
---|
| 867 | --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
|
---|
| 868 | --localstatedir=DIR modifiable single-machine data [PREFIX/var]
|
---|
| 869 | --mandir=DIR man documentation [PREFIX/man]
|
---|
| 870 |
|
---|
| 871 | For even finer tuning, paths can be specified for individual files (see below)
|
---|
| 872 |
|
---|
| 873 | _ACEOF
|
---|
| 874 |
|
---|
| 875 | cat <<\_ACEOF]
|
---|
| 876 | m4_divert_pop([HELP_BEGIN])dnl
|
---|
| 877 | dnl The order of the diversions here is
|
---|
| 878 | dnl - HELP_BEGIN
|
---|
| 879 | dnl which may be prolongated by extra generic options such as with X or
|
---|
| 880 | dnl AC_ARG_PROGRAM. Displayed only in long --help.
|
---|
| 881 | dnl
|
---|
| 882 | dnl - HELP_CANON
|
---|
| 883 | dnl Support for cross compilation (--build, --host and --target).
|
---|
| 884 | dnl Display only in long --help.
|
---|
| 885 | dnl
|
---|
| 886 | dnl - HELP_ENABLE
|
---|
| 887 | dnl which starts with the trailer of the HELP_BEGIN, HELP_CANON section,
|
---|
| 888 | dnl then implements the header of the non generic options.
|
---|
| 889 | dnl
|
---|
| 890 | dnl - HELP_WITH
|
---|
| 891 | dnl
|
---|
| 892 | dnl - HELP_VAR
|
---|
| 893 | dnl
|
---|
| 894 | dnl - HELP_VAR_END
|
---|
| 895 | dnl
|
---|
| 896 | dnl - HELP_END
|
---|
| 897 | dnl initialized below, in which we dump the trailer (handling of the
|
---|
| 898 | dnl recursion for instance).
|
---|
| 899 | m4_divert_push([HELP_ENABLE])dnl
|
---|
| 900 | _ACEOF
|
---|
| 901 | fi
|
---|
| 902 |
|
---|
| 903 | if test -n "$ac_init_help"; then
|
---|
| 904 | m4_ifset([AC_PACKAGE_STRING],
|
---|
| 905 | [ case $ac_init_help in
|
---|
| 906 | short | recursive ) echo "Configuration of AC_PACKAGE_STRING:";;
|
---|
| 907 | esac])
|
---|
| 908 | cat <<\_ACEOF
|
---|
| 909 | m4_divert_pop([HELP_ENABLE])dnl
|
---|
| 910 | m4_divert_push([HELP_END])dnl
|
---|
| 911 | m4_ifset([AC_PACKAGE_BUGREPORT], [
|
---|
| 912 | Report bugs to <AC_PACKAGE_BUGREPORT>.])
|
---|
| 913 | _ACEOF
|
---|
| 914 | fi
|
---|
| 915 |
|
---|
| 916 | if test "$ac_init_help" = "recursive"; then
|
---|
| 917 | # If there are subdirs, report their specific --help.
|
---|
| 918 | ac_popdir=`pwd`
|
---|
| 919 | for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
|
---|
| 920 | test -d $ac_dir || continue
|
---|
| 921 | _AC_SRCPATHS(["$ac_dir"])
|
---|
| 922 | cd $ac_dir
|
---|
| 923 | # Check for guested configure; otherwise get Cygnus style configure.
|
---|
| 924 | if test -f $ac_srcdir/configure.gnu; then
|
---|
| 925 | echo
|
---|
| 926 | $SHELL $ac_srcdir/configure.gnu --help=recursive
|
---|
| 927 | elif test -f $ac_srcdir/configure; then
|
---|
| 928 | echo
|
---|
| 929 | $SHELL $ac_srcdir/configure --help=recursive
|
---|
| 930 | elif test -f $ac_srcdir/configure.ac ||
|
---|
| 931 | test -f $ac_srcdir/configure.in; then
|
---|
| 932 | echo
|
---|
| 933 | $ac_configure --help
|
---|
| 934 | else
|
---|
| 935 | AC_MSG_WARN([no configuration information is in $ac_dir])
|
---|
| 936 | fi
|
---|
| 937 | cd $ac_popdir
|
---|
| 938 | done
|
---|
| 939 | fi
|
---|
| 940 |
|
---|
| 941 | test -n "$ac_init_help" && exit 0
|
---|
| 942 | m4_divert_pop([HELP_END])dnl
|
---|
| 943 | ])# SH_INIT_HELP
|
---|
| 944 |
|
---|
| 945 |
|
---|
| 946 |
|
---|
| 947 |
|
---|
| 948 |
|
---|
| 949 |
|
---|
| 950 |
|
---|
| 951 |
|
---|
| 952 | # Check whether sa_sigaction works.
|
---|
| 953 | # Rainer Wichmann <support@la-samhna.de>, 2003.
|
---|
| 954 | #
|
---|
| 955 | # This file can be copied and used freely without restrictions. It can
|
---|
| 956 | # be used in projects which are not available under the GNU Public License.
|
---|
| 957 |
|
---|
| 958 | # serial 1
|
---|
| 959 |
|
---|
| 960 | AC_DEFUN([AM_SA_SIGACTION_WORKS],
|
---|
| 961 | [
|
---|
| 962 | am_cv_val_SA_SIGACTION=no
|
---|
| 963 | AC_CHECK_HEADER(signal.h,
|
---|
| 964 | [
|
---|
| 965 | AM_SI_USER
|
---|
| 966 | AM_SA_SIGINFO
|
---|
| 967 | if test $am_cv_val_SI_USER = yes && test $am_cv_val_SA_SIGINFO = yes
|
---|
| 968 | then
|
---|
| 969 | AC_TRY_RUN([
|
---|
| 970 | #include <signal.h>
|
---|
| 971 | #include <setjmp.h>
|
---|
| 972 | #include <stdio.h>
|
---|
| 973 | #include <stdlib.h>
|
---|
| 974 |
|
---|
| 975 | volatile int xnum = 0;
|
---|
| 976 | volatile int xcode = 0;
|
---|
| 977 | jmp_buf Buf;
|
---|
| 978 | int xsig = SIGSEGV;
|
---|
| 979 |
|
---|
| 980 | void sighandler (int xsignam, siginfo_t * xsiginfo, void * xsigadd)
|
---|
| 981 | {
|
---|
| 982 | static sigset_t x;
|
---|
| 983 |
|
---|
| 984 | if (xsiginfo == NULL)
|
---|
| 985 | exit(__LINE__);
|
---|
| 986 | if (xsiginfo->si_signo != xsignam)
|
---|
| 987 | exit(__LINE__);
|
---|
| 988 | ++xnum;
|
---|
| 989 | xcode = xsiginfo->si_code;
|
---|
| 990 | sigemptyset (&x);
|
---|
| 991 | sigprocmask(SIG_SETMASK, &x, NULL);
|
---|
| 992 | longjmp ( Buf, 1);
|
---|
| 993 | }
|
---|
| 994 |
|
---|
| 995 | int main ()
|
---|
| 996 | {
|
---|
| 997 | struct sigaction newact;
|
---|
| 998 |
|
---|
| 999 | newact.sa_sigaction = sighandler;
|
---|
| 1000 | sigemptyset (&newact.sa_mask);
|
---|
| 1001 | newact.sa_flags = SA_SIGINFO;
|
---|
| 1002 | if (0 != sigaction (xsig, &newact, NULL))
|
---|
| 1003 | exit (__LINE__);
|
---|
| 1004 | if(setjmp ( Buf)) {
|
---|
| 1005 | if (xnum > 1)
|
---|
| 1006 | goto Third;
|
---|
| 1007 | goto Second;
|
---|
| 1008 | }
|
---|
| 1009 | memcpy((void *) 0x0, "test", 5);
|
---|
| 1010 | Second:
|
---|
| 1011 | if (xcode == SI_USER)
|
---|
| 1012 | exit (__LINE__);
|
---|
| 1013 | raise(xsig);
|
---|
| 1014 | Third:
|
---|
| 1015 | if (xcode != SI_USER)
|
---|
| 1016 | exit (__LINE__);
|
---|
| 1017 | if (xnum != 2)
|
---|
| 1018 | exit (__LINE__);
|
---|
| 1019 | return (0);
|
---|
| 1020 | }], am_cv_val_SA_SIGACTION=yes, am_cv_val_SA_SIGACTION=no, am_cv_val_SA_SIGACTION=no)
|
---|
| 1021 | fi
|
---|
| 1022 | ])
|
---|
| 1023 | AC_MSG_CHECKING([whether sa_sigaction is supported])
|
---|
| 1024 | if test $am_cv_val_SA_SIGACTION = yes
|
---|
| 1025 | then
|
---|
| 1026 | AC_MSG_RESULT(yes)
|
---|
| 1027 | AC_DEFINE([SA_SIGACTION_WORKS], 1, [Define if sa_sigaction works])
|
---|
| 1028 | else
|
---|
| 1029 | AC_MSG_RESULT(no)
|
---|
| 1030 | fi
|
---|
| 1031 | ])
|
---|
| 1032 |
|
---|
| 1033 | # Check whether SI_USER is available in <signal.h>.
|
---|
| 1034 | # Rainer Wichmann <support@la-samhna.de>, 2003.
|
---|
| 1035 | #
|
---|
| 1036 | # This file can be copied and used freely without restrictions. It can
|
---|
| 1037 | # be used in projects which are not available under the GNU Public License.
|
---|
| 1038 |
|
---|
| 1039 | # serial 1
|
---|
| 1040 |
|
---|
| 1041 |
|
---|
| 1042 | AC_DEFUN([AM_SI_USER],
|
---|
| 1043 | [if test $ac_cv_header_signal_h = yes; then
|
---|
| 1044 | AC_CACHE_CHECK([for SI_USER in signal.h], am_cv_val_SI_USER,
|
---|
| 1045 | [AC_TRY_LINK([#include <signal.h>], [return SI_USER],
|
---|
| 1046 | am_cv_val_SI_USER=yes, am_cv_val_SI_USER=no)])
|
---|
| 1047 | if test $am_cv_val_SI_USER = yes; then
|
---|
| 1048 | AC_DEFINE([HAVE_SI_USER], 1, [Define if you have SI_USER])
|
---|
| 1049 | fi
|
---|
| 1050 | fi])
|
---|
| 1051 |
|
---|
| 1052 | # Check whether SA_SIGINFO is available in <signal.h>.
|
---|
| 1053 | # Rainer Wichmann <support@la-samhna.de>, 2003.
|
---|
| 1054 | #
|
---|
| 1055 | # This file can be copied and used freely without restrictions. It can
|
---|
| 1056 | # be used in projects which are not available under the GNU Public License.
|
---|
| 1057 |
|
---|
| 1058 | # serial 1
|
---|
| 1059 |
|
---|
| 1060 |
|
---|
| 1061 | AC_DEFUN([AM_SA_SIGINFO],
|
---|
| 1062 | [if test $ac_cv_header_signal_h = yes; then
|
---|
| 1063 | AC_CACHE_CHECK([for SA_SIGINFO in signal.h], am_cv_val_SA_SIGINFO,
|
---|
| 1064 | [AC_TRY_LINK([#include <signal.h>], [return SA_SIGINFO],
|
---|
| 1065 | am_cv_val_SA_SIGINFO=yes, am_cv_val_SA_SIGINFO=no)])
|
---|
| 1066 | if test $am_cv_val_SA_SIGINFO = yes; then
|
---|
| 1067 | AC_DEFINE([HAVE_SA_SIGINFO], 1, [Define if you have SA_SIGINFO])
|
---|
| 1068 | fi
|
---|
| 1069 | fi])
|
---|
| 1070 |
|
---|
| 1071 | dnl
|
---|
| 1072 | dnl Useful macros for autoconf to check for ssp-patched gcc
|
---|
| 1073 | dnl 1.0 - September 2003 - Tiago Sousa <mirage@kaotik.org>
|
---|
[120] | 1074 | dnl 1.1 - August 2006 - Ted Percival <ted@midg3t.net>
|
---|
| 1075 | dnl * Stricter language checking (C or C++)
|
---|
| 1076 | dnl * Adds GCC_STACK_PROTECT_LIB to add -lssp to LDFLAGS as necessary
|
---|
| 1077 | dnl * Caches all results
|
---|
| 1078 | dnl * Uses macros to ensure correct ouput in quiet/silent mode
|
---|
| 1079 | dnl 1.2 - April 2007 - Ted Percival <ted@midg3t.net>
|
---|
| 1080 | dnl * Added GCC_STACK_PROTECTOR macro for simpler (one-line) invocation
|
---|
| 1081 | dnl * GCC_STACK_PROTECT_LIB now adds -lssp to LIBS rather than LDFLAGS
|
---|
[1] | 1082 | dnl
|
---|
| 1083 | dnl About ssp:
|
---|
| 1084 | dnl GCC extension for protecting applications from stack-smashing attacks
|
---|
| 1085 | dnl http://www.research.ibm.com/trl/projects/security/ssp/
|
---|
| 1086 | dnl
|
---|
| 1087 | dnl Usage:
|
---|
[120] | 1088 | dnl Most people will simply call GCC_STACK_PROTECTOR.
|
---|
| 1089 | dnl If you only use one of C or C++, you can save time by only calling the
|
---|
| 1090 | dnl macro appropriate for that language. In that case you should also call
|
---|
| 1091 | dnl GCC_STACK_PROTECT_LIB first.
|
---|
[1] | 1092 | dnl
|
---|
[120] | 1093 | dnl GCC_STACK_PROTECTOR
|
---|
| 1094 | dnl Tries to turn on stack protection for C and C++ by calling the following
|
---|
| 1095 | dnl three macros with the right languages.
|
---|
| 1096 | dnl
|
---|
[1] | 1097 | dnl GCC_STACK_PROTECT_CC
|
---|
| 1098 | dnl checks -fstack-protector with the C compiler, if it exists then updates
|
---|
| 1099 | dnl CFLAGS and defines ENABLE_SSP_CC
|
---|
| 1100 | dnl
|
---|
[120] | 1101 | dnl GCC_STACK_PROTECT_CXX
|
---|
| 1102 | dnl checks -fstack-protector with the C++ compiler, if it exists then updates
|
---|
| 1103 | dnl CXXFLAGS and defines ENABLE_SSP_CXX
|
---|
| 1104 | dnl
|
---|
| 1105 | dnl GCC_STACK_PROTECT_LIB
|
---|
| 1106 | dnl adds -lssp to LIBS if it is available
|
---|
| 1107 | dnl ssp is usually provided as part of libc, but was previously a separate lib
|
---|
| 1108 | dnl It does not hurt to add -lssp even if libc provides SSP - in that case
|
---|
| 1109 | dnl libssp will simply be ignored.
|
---|
| 1110 | dnl
|
---|
| 1111 |
|
---|
| 1112 | AC_DEFUN([GCC_STACK_PROTECT_LIB],[
|
---|
| 1113 | AC_CACHE_CHECK([whether libssp exists], ssp_cv_lib,
|
---|
| 1114 | [ssp_old_libs="$LIBS"
|
---|
| 1115 | LIBS="$LIBS -lssp"
|
---|
| 1116 | AC_TRY_LINK(,, ssp_cv_lib=yes, ssp_cv_lib=no)
|
---|
| 1117 | LIBS="$ssp_old_libs"
|
---|
| 1118 | ])
|
---|
| 1119 | if test $ssp_cv_lib = yes; then
|
---|
| 1120 | LIBS="$LIBS -lssp"
|
---|
| 1121 | fi
|
---|
| 1122 | ])
|
---|
| 1123 |
|
---|
[1] | 1124 | AC_DEFUN([GCC_STACK_PROTECT_CC],[
|
---|
[120] | 1125 | AC_LANG_ASSERT(C)
|
---|
| 1126 | if test "X$CC" != "X"; then
|
---|
[170] | 1127 | AC_CACHE_CHECK([whether ${CC} accepts -fstack-protector-all],
|
---|
[120] | 1128 | ssp_cv_cc,
|
---|
| 1129 | [ssp_old_cflags="$CFLAGS"
|
---|
[153] | 1130 | CFLAGS="$CFLAGS -fstack-protector-all"
|
---|
[120] | 1131 | AC_TRY_COMPILE(,, ssp_cv_cc=yes, ssp_cv_cc=no)
|
---|
| 1132 | CFLAGS="$ssp_old_cflags"
|
---|
| 1133 | ])
|
---|
[153] | 1134 | if test $ssp_cv_cc = no; then
|
---|
| 1135 | AC_CACHE_CHECK([whether ${CC} accepts -fstack-protector],
|
---|
| 1136 | ssp_cv_cc,
|
---|
| 1137 | [ssp_old_cflags="$CFLAGS"
|
---|
[170] | 1138 | CFLAGS="$CFLAGS -fstack-protector"
|
---|
[153] | 1139 | AC_TRY_COMPILE(,, ssp_cv_cc=yes, ssp_cv_cc=no)
|
---|
| 1140 | CFLAGS="$ssp_old_cflags"
|
---|
| 1141 | ])
|
---|
| 1142 | if test $ssp_cv_cc = yes; then
|
---|
[170] | 1143 | CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -fstack-protector"
|
---|
[192] | 1144 | LDFLAGS="$LDFLAGS -fstack-protector"
|
---|
[153] | 1145 | AC_DEFINE([ENABLE_SSP_CC], 1, [Define if SSP C support is enabled.])
|
---|
| 1146 | fi
|
---|
| 1147 | else
|
---|
| 1148 | if test $ssp_cv_cc = yes; then
|
---|
[170] | 1149 | CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -fstack-protector-all"
|
---|
[192] | 1150 | LDFLAGS="$LDFLAGS -fstack-protector-all"
|
---|
[153] | 1151 | AC_DEFINE([ENABLE_SSP_CC], 1, [Define if SSP C support is enabled.])
|
---|
| 1152 | fi
|
---|
[1] | 1153 | fi
|
---|
| 1154 | fi
|
---|
| 1155 | ])
|
---|
| 1156 |
|
---|
[120] | 1157 | AC_DEFUN([GCC_STACK_PROTECT_CXX],[
|
---|
| 1158 | AC_LANG_ASSERT(C++)
|
---|
| 1159 | if test "X$CXX" != "X"; then
|
---|
| 1160 | AC_CACHE_CHECK([whether ${CXX} accepts -fstack-protector],
|
---|
| 1161 | ssp_cv_cxx,
|
---|
| 1162 | [ssp_old_cxxflags="$CXXFLAGS"
|
---|
| 1163 | CXXFLAGS="$CXXFLAGS -fstack-protector"
|
---|
| 1164 | AC_TRY_COMPILE(,, ssp_cv_cxx=yes, ssp_cv_cxx=no)
|
---|
| 1165 | CXXFLAGS="$ssp_old_cxxflags"
|
---|
| 1166 | ])
|
---|
| 1167 | if test $ssp_cv_cxx = yes; then
|
---|
| 1168 | CXXFLAGS="$CXXFLAGS -fstack-protector"
|
---|
| 1169 | AC_DEFINE([ENABLE_SSP_CXX], 1, [Define if SSP C++ support is enabled.])
|
---|
| 1170 | fi
|
---|
| 1171 | fi
|
---|
| 1172 | ])
|
---|
| 1173 |
|
---|
| 1174 | AC_DEFUN([GCC_STACK_PROTECTOR],[
|
---|
| 1175 | GCC_STACK_PROTECT_LIB
|
---|
| 1176 |
|
---|
| 1177 | AC_LANG_PUSH([C])
|
---|
| 1178 | GCC_STACK_PROTECT_CC
|
---|
| 1179 | AC_LANG_POP([C])
|
---|
| 1180 |
|
---|
| 1181 | AC_LANG_PUSH([C++])
|
---|
| 1182 | GCC_STACK_PROTECT_CXX
|
---|
| 1183 | AC_LANG_POP([C++])
|
---|
| 1184 | ])
|
---|
| 1185 |
|
---|
| 1186 |
|
---|
[171] | 1187 | AC_DEFUN([GCC_PIE_CC],[
|
---|
| 1188 | AC_LANG_ASSERT(C)
|
---|
| 1189 | if test "X$CC" != "X"; then
|
---|
| 1190 | AC_CACHE_CHECK([whether ${CC} accepts -pie -fPIE],
|
---|
| 1191 | pie_cv_cc,
|
---|
| 1192 | [pie_old_cflags="$CFLAGS"
|
---|
| 1193 | CFLAGS="$CFLAGS -pie -fPIE"
|
---|
| 1194 | AC_TRY_COMPILE(,, pie_cv_cc=yes, pie_cv_cc=no)
|
---|
| 1195 | CFLAGS="$pie_old_cflags"
|
---|
| 1196 | ])
|
---|
| 1197 | if test $pie_cv_cc = yes; then
|
---|
[290] | 1198 | case "$host_os" in
|
---|
| 1199 | *cygwin*)
|
---|
| 1200 | ;;
|
---|
| 1201 | *)
|
---|
[171] | 1202 | PIE_CFLAGS="-fPIE"
|
---|
| 1203 | PIE_LDFLAGS="-pie"
|
---|
[290] | 1204 | ;;
|
---|
| 1205 | esac
|
---|
[171] | 1206 | fi
|
---|
| 1207 | fi
|
---|
| 1208 | ])
|
---|
[120] | 1209 |
|
---|
[227] | 1210 | AC_DEFUN([GCC_STACK_CHECK_CC],[
|
---|
| 1211 | AC_LANG_ASSERT(C)
|
---|
| 1212 | if test "X$CC" != "X"; then
|
---|
| 1213 | AC_CACHE_CHECK([whether ${CC} accepts -fstack-check],
|
---|
| 1214 | stackcheck_cv_cc,
|
---|
| 1215 | [stackcheck_old_cflags="$CFLAGS"
|
---|
| 1216 | CFLAGS="$CFLAGS -fstack-check"
|
---|
| 1217 | AC_TRY_COMPILE(,, stackcheck_cv_cc=yes, stackcheck_cv_cc=no)
|
---|
| 1218 | CFLAGS="$stackcheck_old_cflags"
|
---|
| 1219 | ])
|
---|
| 1220 | if test $stackcheck_cv_cc = yes; then
|
---|
| 1221 | CFLAGS="$CFLAGS -fstack-check"
|
---|
| 1222 | fi
|
---|
| 1223 | fi
|
---|
| 1224 | ])
|
---|
| 1225 |
|
---|
[202] | 1226 | AC_DEFUN([GCC_WEMPTY_BODY],[
|
---|
| 1227 | AC_LANG_ASSERT(C)
|
---|
| 1228 | if test "X$CC" != "X"; then
|
---|
| 1229 | AC_CACHE_CHECK([whether ${CC} accepts -Wno-empty-body],
|
---|
[236] | 1230 | empty_cv_body,
|
---|
[202] | 1231 | [empty_body_cflags="$CFLAGS"
|
---|
| 1232 | CFLAGS="$CFLAGS -Wno-empty-body"
|
---|
[236] | 1233 | AC_TRY_COMPILE(,, empty_cv_body=yes, empty_cv_body=no)
|
---|
[202] | 1234 | CFLAGS="$empty_body_cflags"
|
---|
| 1235 | ])
|
---|
[236] | 1236 | if test $empty_cv_body = yes; then
|
---|
[202] | 1237 | CFLAGS="$CFLAGS -Wno-empty-body"
|
---|
| 1238 | fi
|
---|
| 1239 | fi
|
---|
| 1240 | ])
|
---|
| 1241 |
|
---|
[1] | 1242 | AC_DEFUN([SAMHAIN_POSIX],[
|
---|
| 1243 | AC_MSG_CHECKING([whether _POSIX_SOURCE is necessary])
|
---|
| 1244 | AC_TRY_COMPILE([#include <stdio.h>
|
---|
| 1245 | void fileno(int);int fdopen(int, char *); ],,
|
---|
| 1246 | [
|
---|
| 1247 | AC_MSG_RESULT(yes)
|
---|
| 1248 | AC_DEFINE([_POSIX_SOURCE],1,[Define if POSIX functions are required])
|
---|
| 1249 | ],
|
---|
| 1250 | [AC_MSG_RESULT(no)])
|
---|
| 1251 | ])dnl
|
---|
| 1252 |
|
---|
[18] | 1253 | dnl checks for a known 64 bit programming environment
|
---|
| 1254 | dnl AC_RUN_IFELSE(PROGRAM,
|
---|
| 1255 | dnl [ACTION-IF-TRUE], [ACTION-IF-FALSE],
|
---|
| 1256 | dnl [ACTION-IF-CROSS-COMPILING = RUNTIME-ERROR])
|
---|
| 1257 | dnl
|
---|
| 1258 | AC_DEFUN([SAMHAIN_PRG_ENV],[
|
---|
| 1259 | AC_MSG_CHECKING([for a known 64 bit programming environment])
|
---|
| 1260 | # Compile and run a program that determines the programming environment
|
---|
| 1261 | AC_RUN_IFELSE([
|
---|
| 1262 | AC_LANG_SOURCE([[
|
---|
| 1263 | #include <stdio.h>
|
---|
| 1264 | int main(int argc,char **argv)
|
---|
| 1265 | {
|
---|
| 1266 | if (argc > 1) {
|
---|
| 1267 | #if defined(__arch64__)
|
---|
| 1268 | printf("__arch64__\n");
|
---|
| 1269 | #elif defined(__ia64__)
|
---|
| 1270 | printf("__ia64__\n");
|
---|
| 1271 | #elif defined(__x86_64__)
|
---|
| 1272 | printf("__x86_64__\n");
|
---|
| 1273 | #elif defined(__LP64__)
|
---|
| 1274 | printf("__LP64__\n");
|
---|
| 1275 | #elif defined(__64BIT__)
|
---|
| 1276 | printf("__64BIT__\n");
|
---|
| 1277 | #elif defined(_LP64)
|
---|
| 1278 | printf("_LP64\n");
|
---|
| 1279 | #elif defined(_M_IA64)
|
---|
| 1280 | printf("_M_IA64\n");
|
---|
| 1281 | #elif defined(_MIPS_SZLONG) && (_MIPS_SZLONG == 64)
|
---|
| 1282 | printf("_MIPS_64\n");
|
---|
| 1283 | #else
|
---|
| 1284 | choke me
|
---|
| 1285 | #endif
|
---|
| 1286 | }
|
---|
| 1287 | return 0;
|
---|
| 1288 | }
|
---|
| 1289 | ]])
|
---|
| 1290 | ],[
|
---|
| 1291 | # Program compiled and ran, so get version by adding argument.
|
---|
| 1292 | samhain_prg_ENV=`./conftest$ac_exeext x`
|
---|
| 1293 | samhain_64=yes
|
---|
| 1294 | AC_MSG_RESULT([$samhain_prg_ENV])
|
---|
| 1295 | ],[
|
---|
| 1296 | AC_MSG_RESULT([none])
|
---|
| 1297 | ],[
|
---|
| 1298 | AC_MSG_RESULT([none])
|
---|
| 1299 | ])
|
---|
| 1300 | ])dnl
|
---|
| 1301 |
|
---|
| 1302 | AC_DEFUN([SAMHAIN_X86_64],[
|
---|
| 1303 | AC_MSG_CHECKING([for x86_64])
|
---|
| 1304 | AC_TRY_RUN([
|
---|
| 1305 | int main() {
|
---|
| 1306 | __asm__ volatile (
|
---|
| 1307 | "movq %rax, %rax"
|
---|
| 1308 | );
|
---|
| 1309 | return 0;
|
---|
| 1310 | }
|
---|
| 1311 | ],
|
---|
| 1312 | [
|
---|
| 1313 | AC_MSG_RESULT(yes)
|
---|
| 1314 | samhain_64=yes
|
---|
| 1315 | tiger_src=sh_tiger1_64.c
|
---|
[441] | 1316 | samhain_64_asm=yes
|
---|
[18] | 1317 | ],
|
---|
| 1318 | [
|
---|
| 1319 | AC_MSG_RESULT([no])
|
---|
| 1320 | ],[
|
---|
| 1321 | AC_MSG_RESULT([no])
|
---|
| 1322 | ])
|
---|
| 1323 | ])dnl
|
---|
| 1324 |
|
---|
| 1325 |
|
---|
| 1326 | AC_DEFUN([SAMHAIN_64],[
|
---|
| 1327 | samhain_64=no
|
---|
| 1328 | tiger_src=sh_tiger1.c
|
---|
[441] | 1329 | samhain_64_asm=no
|
---|
[18] | 1330 | #
|
---|
| 1331 | # if sizeof(unsigned long) = 4, try compiler macros for 64bit
|
---|
| 1332 | #
|
---|
| 1333 | if test "x$ac_cv_sizeof_unsigned_long" = x4; then
|
---|
| 1334 | if test "x$ac_cv_sizeof_unsigned_long_long" = x8; then
|
---|
| 1335 | SAMHAIN_PRG_ENV
|
---|
| 1336 | if test "x$samhain_64" = xyes; then
|
---|
| 1337 | tiger_src=sh_tiger1_64.c
|
---|
| 1338 | fi
|
---|
| 1339 | #
|
---|
| 1340 | # if GCC and __i386__, use precompiled assembler
|
---|
| 1341 | #
|
---|
| 1342 | if test "x$GCC" = xyes; then
|
---|
[61] | 1343 | AC_MSG_CHECKING([for non-apple non-cygwin i386])
|
---|
[18] | 1344 | samhain_i386=no
|
---|
[47] | 1345 | $CC -E -dM - < /dev/null | egrep '__i386__' >/dev/null 2>&1
|
---|
| 1346 | if test $? = 0; then
|
---|
[378] | 1347 | case "$host_os" in
|
---|
| 1348 | *linux*)
|
---|
| 1349 | # apples gcc does not understand the assembly we provide
|
---|
| 1350 | $CC -E -dM - < /dev/null | egrep '(__sun__|__APPLE__|__CYGWIN__)' >/dev/null 2>&1 || samhain_i386=yes
|
---|
| 1351 | ;;
|
---|
| 1352 | *)
|
---|
| 1353 | ;;
|
---|
| 1354 | esac
|
---|
[47] | 1355 | fi
|
---|
[201] | 1356 | AC_MSG_RESULT([$samhain_i386])
|
---|
[18] | 1357 | if test "x$samhain_i386" = xyes; then
|
---|
[201] | 1358 | GCC_PIE_CC
|
---|
| 1359 | if test $pie_cv_cc = yes; then
|
---|
| 1360 | tiger_src=sh_tiger1.s
|
---|
| 1361 | AC_DEFINE([TIGER_32_BIT_S],1,[Define to use tiger 32 bit i386 assembler])
|
---|
| 1362 | fi
|
---|
[18] | 1363 | fi
|
---|
| 1364 | fi
|
---|
| 1365 | #
|
---|
| 1366 | #
|
---|
| 1367 | #
|
---|
| 1368 | else
|
---|
| 1369 | samhain_64=no
|
---|
| 1370 | tiger_src=sh_tiger1.c
|
---|
| 1371 | fi
|
---|
| 1372 | else
|
---|
| 1373 | #
|
---|
| 1374 | # sizeof(unsigned long) = 8
|
---|
| 1375 | #
|
---|
| 1376 | tiger_src=sh_tiger1_64.c
|
---|
| 1377 | samhain_64=yes
|
---|
| 1378 | #
|
---|
| 1379 | # check for x86_64 (enables assembly optimizations)
|
---|
| 1380 | #
|
---|
| 1381 | if test "x$GCC" = xyes; then
|
---|
[415] | 1382 | case "$host_os" in
|
---|
| 1383 | *linux*)
|
---|
| 1384 | SAMHAIN_X86_64
|
---|
| 1385 | ;;
|
---|
| 1386 | *bsd*)
|
---|
| 1387 | SAMHAIN_X86_64
|
---|
| 1388 | ;;
|
---|
| 1389 | *)
|
---|
| 1390 | SAMHAIN_X86_64
|
---|
| 1391 | ;;
|
---|
| 1392 | esac
|
---|
[18] | 1393 | fi
|
---|
| 1394 | fi
|
---|
| 1395 | if test "x$samhain_64" = xyes; then
|
---|
| 1396 | AC_DEFINE([TIGER_64_BIT],1,[Define to use tiger 64 bit implementation])
|
---|
| 1397 | fi
|
---|
| 1398 | AC_MSG_CHECKING([for 64 bit environment])
|
---|
| 1399 | AC_MSG_RESULT([$samhain_64])
|
---|
| 1400 | AC_MSG_CHECKING([for tiger source to use])
|
---|
| 1401 | AC_MSG_RESULT([$tiger_src])
|
---|
| 1402 | AC_SUBST(tiger_src)
|
---|
| 1403 | ])dnl
|
---|
| 1404 |
|
---|
[68] | 1405 | AC_DEFUN([sh_CHECK_POSIX_ACL],
|
---|
| 1406 | [
|
---|
| 1407 | AC_CHECK_HEADERS(sys/acl.h)
|
---|
| 1408 | if test $ac_cv_header_sys_acl_h = yes; then
|
---|
[18] | 1409 |
|
---|
[68] | 1410 | AC_CHECK_LIB([acl], [acl_get_file], sh_lacl=yes, sh_lacl=no)
|
---|
| 1411 | if test x"$sh_lacl" = xyes; then
|
---|
| 1412 | LIBACL=-lacl
|
---|
| 1413 | else
|
---|
| 1414 | LIBACL=
|
---|
| 1415 | fi
|
---|
| 1416 |
|
---|
| 1417 | OLDLIBS="$LIBS"
|
---|
| 1418 | LIBS="$LIBS $LIBACL"
|
---|
| 1419 | AC_CHECK_FUNCS([acl_free acl_get_file acl_get_fd],
|
---|
| 1420 | [sh_facl=yes],[sh_facl=no])
|
---|
| 1421 | LIBS="$OLDLIBS"
|
---|
| 1422 |
|
---|
| 1423 | if test x"$sh_facl" = xyes; then
|
---|
| 1424 | AC_DEFINE(USE_ACL, 1, [Define if you want ACL support.])
|
---|
| 1425 | LIBS="$LIBS $LIBACL"
|
---|
| 1426 | fi
|
---|
| 1427 | fi
|
---|
| 1428 | ])
|
---|
| 1429 |
|
---|
| 1430 | AC_DEFUN([sh_CHECK_XATTR],
|
---|
| 1431 | [
|
---|
| 1432 | AC_CHECK_HEADERS(attr/xattr.h)
|
---|
| 1433 | if test $ac_cv_header_attr_xattr_h = yes; then
|
---|
| 1434 |
|
---|
| 1435 | AC_CHECK_LIB([attr], [getxattr], sh_lattr=yes, sh_lattr=no)
|
---|
| 1436 | if test x"$sh_lattr" = xyes; then
|
---|
| 1437 | LIBATTR=-lattr
|
---|
| 1438 | else
|
---|
| 1439 | LIBATTR=
|
---|
| 1440 | fi
|
---|
| 1441 |
|
---|
| 1442 | OLDLIBS="$LIBS"
|
---|
| 1443 | LIBS="$LIBS $LIBATTR"
|
---|
| 1444 | AC_CHECK_FUNCS([getxattr lgetxattr fgetxattr],
|
---|
| 1445 | [sh_fattr=yes],[sh_fattr=no])
|
---|
| 1446 | LIBS="$OLDLIBS"
|
---|
| 1447 |
|
---|
| 1448 | if test x"$sh_fattr" = xyes; then
|
---|
| 1449 | AC_DEFINE(USE_XATTR, 1, [Define if you want extended attributes support.])
|
---|
| 1450 | LIBS="$LIBS $LIBATTR"
|
---|
| 1451 | fi
|
---|
| 1452 | fi
|
---|
| 1453 | ])
|
---|
| 1454 |
|
---|
[1] | 1455 | dnl Autoconf macros for libprelude
|
---|
| 1456 | dnl $id$
|
---|
| 1457 |
|
---|
| 1458 | # Modified for LIBPRELUDE -- Yoann Vandoorselaere
|
---|
| 1459 | # Modified for LIBGNUTLS -- nmav
|
---|
| 1460 | # Configure paths for LIBGCRYPT
|
---|
| 1461 | # Shamelessly stolen from the one of XDELTA by Owen Taylor
|
---|
| 1462 | # Werner Koch 99-12-09
|
---|
| 1463 |
|
---|
| 1464 | dnl AM_PATH_LIBPRELUDE([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
|
---|
| 1465 | dnl Test for libprelude, and define LIBPRELUDE_PREFIX, LIBPRELUDE_CFLAGS, LIBPRELUDE_PTHREAD_CFLAGS,
|
---|
| 1466 | dnl LIBPRELUDE_LDFLAGS, and LIBPRELUDE_LIBS
|
---|
| 1467 | dnl
|
---|
| 1468 | AC_DEFUN([AM_PATH_LIBPRELUDE],
|
---|
| 1469 | [dnl
|
---|
| 1470 | dnl Get the cflags and libraries from the libprelude-config script
|
---|
| 1471 | dnl
|
---|
| 1472 | dnl AC_ARG_WITH(libprelude-prefix,
|
---|
| 1473 | dnl [ --with-libprelude-prefix=PFX Prefix where libprelude is installed (optional)],
|
---|
| 1474 | dnl libprelude_config_prefix="$withval", libprelude_config_prefix="")
|
---|
| 1475 | dnl
|
---|
| 1476 | dnl if test x$libprelude_config_prefix != x ; then
|
---|
| 1477 | dnl if test x${LIBPRELUDE_CONFIG+set} != xset ; then
|
---|
| 1478 | dnl LIBPRELUDE_CONFIG=$libprelude_config_prefix/bin/libprelude-config
|
---|
| 1479 | dnl fi
|
---|
| 1480 | dnl fi
|
---|
| 1481 | dnl
|
---|
| 1482 | dnl AC_PATH_PROG(LIBPRELUDE_CONFIG, libprelude-config, no)
|
---|
| 1483 | min_libprelude_version=ifelse([$1], ,0.1.0,$1)
|
---|
| 1484 | AC_MSG_CHECKING(for libprelude - version >= $min_libprelude_version)
|
---|
| 1485 | no_libprelude=""
|
---|
| 1486 | if test "$LIBPRELUDE_CONFIG" = "no" ; then
|
---|
| 1487 | no_libprelude=yes
|
---|
| 1488 | else
|
---|
| 1489 | LIBPRELUDE_CFLAGS=`$LIBPRELUDE_CONFIG $libprelude_config_args --cflags`
|
---|
| 1490 | LIBPRELUDE_PTHREAD_CFLAGS=`$LIBPRELUDE_CONFIG $libprelude_config_args --pthread-cflags`
|
---|
| 1491 | LIBPRELUDE_LDFLAGS=`$LIBPRELUDE_CONFIG $libprelude_config_args --ldflags`
|
---|
| 1492 | LIBPRELUDE_LIBS=`$LIBPRELUDE_CONFIG $libprelude_config_args --libs`
|
---|
| 1493 | LIBPRELUDE_PREFIX=`$LIBPRELUDE_CONFIG $libprelude_config_args --prefix`
|
---|
| 1494 | LIBPRELUDE_CONFIG_PREFIX=`$LIBPRELUDE_CONFIG $libprelude_config_args --config-prefix`
|
---|
| 1495 | libprelude_config_version=`$LIBPRELUDE_CONFIG $libprelude_config_args --version`
|
---|
| 1496 |
|
---|
| 1497 |
|
---|
| 1498 | ac_save_CFLAGS="$CFLAGS"
|
---|
| 1499 | ac_save_LDFLAGS="$LDFLAGS"
|
---|
| 1500 | ac_save_LIBS="$LIBS"
|
---|
| 1501 | CFLAGS="$CFLAGS $LIBPRELUDE_CFLAGS"
|
---|
| 1502 | LDFLAGS="$LDFLAGS $LIBPRELUDE_LDFLAGS"
|
---|
| 1503 | LIBS="$LIBS $LIBPRELUDE_LIBS"
|
---|
| 1504 | dnl
|
---|
| 1505 | dnl Now check if the installed libprelude is sufficiently new. Also sanity
|
---|
| 1506 | dnl checks the results of libprelude-config to some extent
|
---|
| 1507 | dnl
|
---|
| 1508 | rm -f conf.libpreludetest
|
---|
| 1509 | AC_TRY_RUN([
|
---|
| 1510 | #include <stdio.h>
|
---|
| 1511 | #include <stdlib.h>
|
---|
| 1512 | #include <string.h>
|
---|
| 1513 | #include <libprelude/prelude.h>
|
---|
| 1514 |
|
---|
| 1515 | int
|
---|
| 1516 | main ()
|
---|
| 1517 | {
|
---|
| 1518 | system ("touch conf.libpreludetest");
|
---|
| 1519 |
|
---|
| 1520 | if( strcmp( prelude_check_version(NULL), "$libprelude_config_version" ) )
|
---|
| 1521 | {
|
---|
| 1522 | printf("\n*** 'libprelude-config --version' returned %s, but LIBPRELUDE (%s)\n",
|
---|
| 1523 | "$libprelude_config_version", prelude_check_version(NULL) );
|
---|
| 1524 | printf("*** was found! If libprelude-config was correct, then it is best\n");
|
---|
| 1525 | printf("*** to remove the old version of LIBPRELUDE. You may also be able to fix the error\n");
|
---|
| 1526 | printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
|
---|
| 1527 | printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
|
---|
| 1528 | printf("*** required on your system.\n");
|
---|
| 1529 | printf("*** If libprelude-config was wrong, set the environment variable LIBPRELUDE_CONFIG\n");
|
---|
| 1530 | printf("*** to point to the correct copy of libprelude-config, and remove the file config.cache\n");
|
---|
| 1531 | printf("*** before re-running configure\n");
|
---|
| 1532 | }
|
---|
| 1533 | else if ( strcmp(prelude_check_version(NULL), LIBPRELUDE_VERSION ) )
|
---|
| 1534 | {
|
---|
| 1535 | printf("\n*** LIBPRELUDE header file (version %s) does not match\n", LIBPRELUDE_VERSION);
|
---|
| 1536 | printf("*** library (version %s)\n", prelude_check_version(NULL) );
|
---|
| 1537 | }
|
---|
| 1538 | else
|
---|
| 1539 | {
|
---|
| 1540 | if ( prelude_check_version( "$min_libprelude_version" ) )
|
---|
| 1541 | {
|
---|
| 1542 | return 0;
|
---|
| 1543 | }
|
---|
| 1544 | else
|
---|
| 1545 | {
|
---|
| 1546 | printf("no\n*** An old version of LIBPRELUDE (%s) was found.\n",
|
---|
| 1547 | prelude_check_version(NULL) );
|
---|
| 1548 | printf("*** You need a version of LIBPRELUDE newer than %s. The latest version of\n",
|
---|
| 1549 | "$min_libprelude_version" );
|
---|
| 1550 | printf("*** LIBPRELUDE is always available from http://www.prelude-ids.org/download/releases.\n");
|
---|
| 1551 | printf("*** \n");
|
---|
| 1552 | printf("*** If you have already installed a sufficiently new version, this error\n");
|
---|
| 1553 | printf("*** probably means that the wrong copy of the libprelude-config shell script is\n");
|
---|
| 1554 | printf("*** being found. The easiest way to fix this is to remove the old version\n");
|
---|
| 1555 | printf("*** of LIBPRELUDE, but you can also set the LIBPRELUDE_CONFIG environment to point to the\n");
|
---|
| 1556 | printf("*** correct copy of libprelude-config. (In this case, you will have to\n");
|
---|
| 1557 | printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
|
---|
| 1558 | printf("*** so that the correct libraries are found at run-time))\n");
|
---|
| 1559 | }
|
---|
| 1560 | }
|
---|
| 1561 | return 1;
|
---|
| 1562 | }
|
---|
| 1563 | ],, no_libprelude=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
|
---|
| 1564 | CFLAGS="$ac_save_CFLAGS"
|
---|
| 1565 | LIBS="$ac_save_LIBS"
|
---|
| 1566 | LDFLAGS="$ac_save_LDFLAGS"
|
---|
| 1567 | fi
|
---|
| 1568 |
|
---|
| 1569 | if test "x$no_libprelude" = x ; then
|
---|
| 1570 | AC_MSG_RESULT(yes)
|
---|
| 1571 | ifelse([$2], , :, [$2])
|
---|
| 1572 | else
|
---|
| 1573 | if test -f conf.libpreludetest ; then
|
---|
| 1574 | :
|
---|
| 1575 | else
|
---|
| 1576 | AC_MSG_RESULT(no)
|
---|
| 1577 | fi
|
---|
| 1578 | if test "$LIBPRELUDE_CONFIG" = "no" ; then
|
---|
| 1579 | echo "*** The libprelude-config script installed by LIBPRELUDE could not be found"
|
---|
| 1580 | echo "*** If LIBPRELUDE was installed in PREFIX, make sure PREFIX/bin is in"
|
---|
| 1581 | echo "*** your path, or set the LIBPRELUDE_CONFIG environment variable to the"
|
---|
| 1582 | echo "*** full path to libprelude-config."
|
---|
| 1583 | else
|
---|
| 1584 | if test -f conf.libpreludetest ; then
|
---|
| 1585 | :
|
---|
| 1586 | else
|
---|
| 1587 | echo "*** Could not run libprelude test program, checking why..."
|
---|
| 1588 | CFLAGS="$CFLAGS $LIBPRELUDE_CFLAGS"
|
---|
| 1589 | LDFLAGS="$LDFLAGS $LIBPRELUDE_LDFLAGS"
|
---|
| 1590 | LIBS="$LIBS $LIBPRELUDE_LIBS"
|
---|
| 1591 | AC_TRY_LINK([
|
---|
| 1592 | #include <stdio.h>
|
---|
| 1593 | #include <stdlib.h>
|
---|
| 1594 | #include <string.h>
|
---|
| 1595 | #include <libprelude/prelude.h>
|
---|
| 1596 | ], [ return !!prelude_check_version(NULL); ],
|
---|
| 1597 | [ echo "*** The test program compiled, but did not run. This usually means"
|
---|
| 1598 | echo "*** that the run-time linker is not finding LIBPRELUDE or finding the wrong"
|
---|
| 1599 | echo "*** version of LIBPRELUDE. If it is not finding LIBPRELUDE, you'll need to set your"
|
---|
| 1600 | echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
|
---|
| 1601 | echo "*** to the installed location Also, make sure you have run ldconfig if that"
|
---|
| 1602 | echo "*** is required on your system"
|
---|
| 1603 | echo "***"
|
---|
| 1604 | echo "*** If you have an old version installed, it is best to remove it, although"
|
---|
| 1605 | echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
|
---|
| 1606 | echo "***" ],
|
---|
| 1607 | [ echo "*** The test program failed to compile or link. See the file config.log for the"
|
---|
| 1608 | echo "*** exact error that occured. This usually means LIBPRELUDE was incorrectly installed"
|
---|
| 1609 | echo "*** or that you have moved LIBPRELUDE since it was installed. In the latter case, you"
|
---|
| 1610 | echo "*** may want to edit the libprelude-config script: $LIBPRELUDE_CONFIG" ])
|
---|
| 1611 | CFLAGS="$ac_save_CFLAGS"
|
---|
| 1612 | LDFLAGS="$ac_save_LDFLAGS"
|
---|
| 1613 | LIBS="$ac_save_LIBS"
|
---|
| 1614 | fi
|
---|
| 1615 | fi
|
---|
| 1616 | LIBPRELUDE_CFLAGS=""
|
---|
| 1617 | LIBPRELUDE_LDFLAGS=""
|
---|
| 1618 | LIBPRELUDE_LIBS=""
|
---|
| 1619 | ifelse([$3], , :, [$3])
|
---|
| 1620 | fi
|
---|
| 1621 | rm -f conf.libpreludetest
|
---|
| 1622 | AC_SUBST(LIBPRELUDE_CFLAGS)
|
---|
| 1623 | AC_SUBST(LIBPRELUDE_PTHREAD_CFLAGS)
|
---|
| 1624 | AC_SUBST(LIBPRELUDE_LDFLAGS)
|
---|
| 1625 | AC_SUBST(LIBPRELUDE_LIBS)
|
---|
| 1626 | AC_SUBST(LIBPRELUDE_PREFIX)
|
---|
| 1627 | AC_SUBST(LIBPRELUDE_CONFIG_PREFIX)
|
---|
| 1628 | ])
|
---|
| 1629 |
|
---|
[129] | 1630 |
|
---|
| 1631 | ##### http://autoconf-archive.cryp.to/acx_pthread.html
|
---|
| 1632 | #
|
---|
| 1633 | # SYNOPSIS
|
---|
| 1634 | #
|
---|
| 1635 | # ACX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
|
---|
| 1636 | #
|
---|
| 1637 | # DESCRIPTION
|
---|
| 1638 | #
|
---|
| 1639 | # This macro figures out how to build C programs using POSIX threads.
|
---|
| 1640 | # It sets the PTHREAD_LIBS output variable to the threads library and
|
---|
| 1641 | # linker flags, and the PTHREAD_CFLAGS output variable to any special
|
---|
| 1642 | # C compiler flags that are needed. (The user can also force certain
|
---|
| 1643 | # compiler flags/libs to be tested by setting these environment
|
---|
| 1644 | # variables.)
|
---|
| 1645 | #
|
---|
| 1646 | # Also sets PTHREAD_CC to any special C compiler that is needed for
|
---|
| 1647 | # multi-threaded programs (defaults to the value of CC otherwise).
|
---|
| 1648 | # (This is necessary on AIX to use the special cc_r compiler alias.)
|
---|
| 1649 | #
|
---|
| 1650 | # NOTE: You are assumed to not only compile your program with these
|
---|
| 1651 | # flags, but also link it with them as well. e.g. you should link
|
---|
| 1652 | # with $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS
|
---|
| 1653 | # $LIBS
|
---|
| 1654 | #
|
---|
| 1655 | # If you are only building threads programs, you may wish to use
|
---|
| 1656 | # these variables in your default LIBS, CFLAGS, and CC:
|
---|
| 1657 | #
|
---|
| 1658 | # LIBS="$PTHREAD_LIBS $LIBS"
|
---|
| 1659 | # CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
---|
| 1660 | # CC="$PTHREAD_CC"
|
---|
| 1661 | #
|
---|
| 1662 | # In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute
|
---|
| 1663 | # constant has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to
|
---|
| 1664 | # that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
|
---|
| 1665 | #
|
---|
| 1666 | # ACTION-IF-FOUND is a list of shell commands to run if a threads
|
---|
| 1667 | # library is found, and ACTION-IF-NOT-FOUND is a list of commands to
|
---|
| 1668 | # run it if it is not found. If ACTION-IF-FOUND is not specified, the
|
---|
| 1669 | # default action will define HAVE_PTHREAD.
|
---|
| 1670 | #
|
---|
| 1671 | # Please let the authors know if this macro fails on any platform, or
|
---|
| 1672 | # if you have any other suggestions or comments. This macro was based
|
---|
| 1673 | # on work by SGJ on autoconf scripts for FFTW (http://www.fftw.org/)
|
---|
| 1674 | # (with help from M. Frigo), as well as ac_pthread and hb_pthread
|
---|
| 1675 | # macros posted by Alejandro Forero Cuervo to the autoconf macro
|
---|
| 1676 | # repository. We are also grateful for the helpful feedback of
|
---|
| 1677 | # numerous users.
|
---|
| 1678 | #
|
---|
| 1679 | # LAST MODIFICATION
|
---|
| 1680 | #
|
---|
| 1681 | # 2007-07-29
|
---|
| 1682 | #
|
---|
| 1683 | # COPYLEFT
|
---|
| 1684 | #
|
---|
| 1685 | # Copyright (c) 2007 Steven G. Johnson <stevenj@alum.mit.edu>
|
---|
| 1686 | #
|
---|
| 1687 | # This program is free software: you can redistribute it and/or
|
---|
| 1688 | # modify it under the terms of the GNU General Public License as
|
---|
| 1689 | # published by the Free Software Foundation, either version 3 of the
|
---|
| 1690 | # License, or (at your option) any later version.
|
---|
| 1691 | #
|
---|
| 1692 | # This program is distributed in the hope that it will be useful, but
|
---|
| 1693 | # WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 1694 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
| 1695 | # General Public License for more details.
|
---|
| 1696 | #
|
---|
| 1697 | # You should have received a copy of the GNU General Public License
|
---|
| 1698 | # along with this program. If not, see
|
---|
| 1699 | # <http://www.gnu.org/licenses/>.
|
---|
| 1700 | #
|
---|
| 1701 | # As a special exception, the respective Autoconf Macro's copyright
|
---|
| 1702 | # owner gives unlimited permission to copy, distribute and modify the
|
---|
| 1703 | # configure scripts that are the output of Autoconf when processing
|
---|
| 1704 | # the Macro. You need not follow the terms of the GNU General Public
|
---|
| 1705 | # License when using or distributing such scripts, even though
|
---|
| 1706 | # portions of the text of the Macro appear in them. The GNU General
|
---|
| 1707 | # Public License (GPL) does govern all other use of the material that
|
---|
| 1708 | # constitutes the Autoconf Macro.
|
---|
| 1709 | #
|
---|
| 1710 | # This special exception to the GPL applies to versions of the
|
---|
| 1711 | # Autoconf Macro released by the Autoconf Macro Archive. When you
|
---|
| 1712 | # make and distribute a modified version of the Autoconf Macro, you
|
---|
| 1713 | # may extend this special exception to the GPL to apply to your
|
---|
| 1714 | # modified version as well.
|
---|
| 1715 |
|
---|
| 1716 | AC_DEFUN([ACX_PTHREAD], [
|
---|
| 1717 | AC_REQUIRE([AC_CANONICAL_HOST])
|
---|
| 1718 | AC_LANG_SAVE
|
---|
| 1719 | AC_LANG_C
|
---|
| 1720 | acx_pthread_ok=no
|
---|
| 1721 |
|
---|
| 1722 | # We used to check for pthread.h first, but this fails if pthread.h
|
---|
| 1723 | # requires special compiler flags (e.g. on True64 or Sequent).
|
---|
| 1724 | # It gets checked for in the link test anyway.
|
---|
| 1725 |
|
---|
| 1726 | # First of all, check if the user has set any of the PTHREAD_LIBS,
|
---|
| 1727 | # etcetera environment variables, and if threads linking works using
|
---|
| 1728 | # them:
|
---|
| 1729 | if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
|
---|
| 1730 | save_CFLAGS="$CFLAGS"
|
---|
| 1731 | CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
---|
| 1732 | save_LIBS="$LIBS"
|
---|
| 1733 | LIBS="$PTHREAD_LIBS $LIBS"
|
---|
| 1734 | AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS])
|
---|
| 1735 | AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes)
|
---|
| 1736 | AC_MSG_RESULT($acx_pthread_ok)
|
---|
| 1737 | if test x"$acx_pthread_ok" = xno; then
|
---|
| 1738 | PTHREAD_LIBS=""
|
---|
| 1739 | PTHREAD_CFLAGS=""
|
---|
| 1740 | fi
|
---|
| 1741 | LIBS="$save_LIBS"
|
---|
| 1742 | CFLAGS="$save_CFLAGS"
|
---|
| 1743 | fi
|
---|
| 1744 |
|
---|
| 1745 | # We must check for the threads library under a number of different
|
---|
| 1746 | # names; the ordering is very important because some systems
|
---|
| 1747 | # (e.g. DEC) have both -lpthread and -lpthreads, where one of the
|
---|
| 1748 | # libraries is broken (non-POSIX).
|
---|
| 1749 |
|
---|
| 1750 | # Create a list of thread flags to try. Items starting with a "-" are
|
---|
| 1751 | # C compiler flags, and other items are library names, except for "none"
|
---|
| 1752 | # which indicates that we try without any flags at all, and "pthread-config"
|
---|
| 1753 | # which is a program returning the flags for the Pth emulation library.
|
---|
| 1754 |
|
---|
| 1755 | acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
|
---|
| 1756 |
|
---|
| 1757 | # The ordering *is* (sometimes) important. Some notes on the
|
---|
| 1758 | # individual items follow:
|
---|
| 1759 |
|
---|
| 1760 | # pthreads: AIX (must check this before -lpthread)
|
---|
| 1761 | # none: in case threads are in libc; should be tried before -Kthread and
|
---|
| 1762 | # other compiler flags to prevent continual compiler warnings
|
---|
| 1763 | # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
|
---|
| 1764 | # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
|
---|
| 1765 | # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
|
---|
| 1766 | # -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
|
---|
| 1767 | # -pthreads: Solaris/gcc
|
---|
| 1768 | # -mthreads: Mingw32/gcc, Lynx/gcc
|
---|
| 1769 | # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
|
---|
| 1770 | # doesn't hurt to check since this sometimes defines pthreads too;
|
---|
| 1771 | # also defines -D_REENTRANT)
|
---|
| 1772 | # ... -mt is also the pthreads flag for HP/aCC
|
---|
| 1773 | # pthread: Linux, etcetera
|
---|
| 1774 | # --thread-safe: KAI C++
|
---|
| 1775 | # pthread-config: use pthread-config program (for GNU Pth library)
|
---|
| 1776 |
|
---|
| 1777 | case "${host_cpu}-${host_os}" in
|
---|
| 1778 | *solaris*)
|
---|
| 1779 |
|
---|
| 1780 | # On Solaris (at least, for some versions), libc contains stubbed
|
---|
| 1781 | # (non-functional) versions of the pthreads routines, so link-based
|
---|
| 1782 | # tests will erroneously succeed. (We need to link with -pthreads/-mt/
|
---|
| 1783 | # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather
|
---|
| 1784 | # a function called by this macro, so we could check for that, but
|
---|
| 1785 | # who knows whether they'll stub that too in a future libc.) So,
|
---|
| 1786 | # we'll just look for -pthreads and -lpthread first:
|
---|
| 1787 |
|
---|
| 1788 | acx_pthread_flags="-pthreads pthread -mt -pthread $acx_pthread_flags"
|
---|
| 1789 | ;;
|
---|
| 1790 | esac
|
---|
| 1791 |
|
---|
| 1792 | if test x"$acx_pthread_ok" = xno; then
|
---|
| 1793 | for flag in $acx_pthread_flags; do
|
---|
| 1794 |
|
---|
| 1795 | case $flag in
|
---|
| 1796 | none)
|
---|
| 1797 | AC_MSG_CHECKING([whether pthreads work without any flags])
|
---|
| 1798 | ;;
|
---|
| 1799 |
|
---|
[138] | 1800 | -pthread)
|
---|
| 1801 | AC_MSG_CHECKING([whether pthreads work with $flag])
|
---|
| 1802 | PTHREAD_CFLAGS="$flag"
|
---|
| 1803 | ;;
|
---|
| 1804 |
|
---|
[129] | 1805 | -*)
|
---|
| 1806 | AC_MSG_CHECKING([whether pthreads work with $flag])
|
---|
| 1807 | PTHREAD_CFLAGS="$flag"
|
---|
| 1808 | ;;
|
---|
| 1809 |
|
---|
| 1810 | pthread-config)
|
---|
| 1811 | AC_CHECK_PROG(acx_pthread_config, pthread-config, yes, no)
|
---|
| 1812 | if test x"$acx_pthread_config" = xno; then continue; fi
|
---|
| 1813 | PTHREAD_CFLAGS="`pthread-config --cflags`"
|
---|
| 1814 | PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
|
---|
| 1815 | ;;
|
---|
| 1816 |
|
---|
| 1817 | *)
|
---|
| 1818 | AC_MSG_CHECKING([for the pthreads library -l$flag])
|
---|
| 1819 | PTHREAD_LIBS="-l$flag"
|
---|
| 1820 | ;;
|
---|
| 1821 | esac
|
---|
| 1822 |
|
---|
| 1823 | save_LIBS="$LIBS"
|
---|
| 1824 | save_CFLAGS="$CFLAGS"
|
---|
[138] | 1825 | save_LDFLAGS="$LDFLAGS"
|
---|
[129] | 1826 | LIBS="$PTHREAD_LIBS $LIBS"
|
---|
| 1827 | CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
---|
[153] | 1828 | LDFLAGS="$LDFLAGS $PTHREAD_CFLAGS"
|
---|
[129] | 1829 |
|
---|
| 1830 | # Check for various functions. We must include pthread.h,
|
---|
| 1831 | # since some functions may be macros. (On the Sequent, we
|
---|
| 1832 | # need a special flag -Kthread to make this header compile.)
|
---|
| 1833 | # We check for pthread_join because it is in -lpthread on IRIX
|
---|
| 1834 | # while pthread_create is in libc. We check for pthread_attr_init
|
---|
| 1835 | # due to DEC craziness with -lpthreads. We check for
|
---|
| 1836 | # pthread_cleanup_push because it is one of the few pthread
|
---|
| 1837 | # functions on Solaris that doesn't have a non-functional libc stub.
|
---|
| 1838 | # We try pthread_create on general principles.
|
---|
| 1839 | AC_TRY_LINK([#include <pthread.h>],
|
---|
| 1840 | [pthread_t th; pthread_join(th, 0);
|
---|
| 1841 | pthread_attr_init(0); pthread_cleanup_push(0, 0);
|
---|
| 1842 | pthread_create(0,0,0,0); pthread_cleanup_pop(0); ],
|
---|
| 1843 | [acx_pthread_ok=yes])
|
---|
| 1844 |
|
---|
| 1845 | LIBS="$save_LIBS"
|
---|
[138] | 1846 | LDFLAGS="$save_LDFLAGS"
|
---|
[129] | 1847 | CFLAGS="$save_CFLAGS"
|
---|
| 1848 |
|
---|
| 1849 | AC_MSG_RESULT($acx_pthread_ok)
|
---|
| 1850 | if test "x$acx_pthread_ok" = xyes; then
|
---|
| 1851 | break;
|
---|
| 1852 | fi
|
---|
| 1853 |
|
---|
| 1854 | PTHREAD_LIBS=""
|
---|
| 1855 | PTHREAD_CFLAGS=""
|
---|
| 1856 | done
|
---|
| 1857 | fi
|
---|
| 1858 |
|
---|
| 1859 | # Various other checks:
|
---|
| 1860 | if test "x$acx_pthread_ok" = xyes; then
|
---|
| 1861 | save_LIBS="$LIBS"
|
---|
| 1862 | LIBS="$PTHREAD_LIBS $LIBS"
|
---|
| 1863 | save_CFLAGS="$CFLAGS"
|
---|
| 1864 | CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
---|
| 1865 |
|
---|
| 1866 | # Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
|
---|
| 1867 | AC_MSG_CHECKING([for joinable pthread attribute])
|
---|
| 1868 | attr_name=unknown
|
---|
| 1869 | for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
|
---|
| 1870 | AC_TRY_LINK([#include <pthread.h>], [int attr=$attr; return attr;],
|
---|
| 1871 | [attr_name=$attr; break])
|
---|
| 1872 | done
|
---|
| 1873 | AC_MSG_RESULT($attr_name)
|
---|
| 1874 | if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then
|
---|
| 1875 | AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name,
|
---|
| 1876 | [Define to necessary symbol if this constant
|
---|
| 1877 | uses a non-standard name on your system.])
|
---|
| 1878 | fi
|
---|
| 1879 |
|
---|
[144] | 1880 | # Solaris lossage: default is obsolete semantics for getpwnam_r,
|
---|
| 1881 | # getpwuid_r, getgrgid_r, unless _POSIX_PTHREAD_SEMANTICS is defined
|
---|
[129] | 1882 | AC_MSG_CHECKING([if more special flags are required for pthreads])
|
---|
| 1883 | flag=no
|
---|
| 1884 | case "${host_cpu}-${host_os}" in
|
---|
| 1885 | *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";;
|
---|
[144] | 1886 | *-osf* | *-hpux*) flag="-D_REENTRANT";;
|
---|
| 1887 | *solaris*) flag="-D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT";;
|
---|
[129] | 1888 | esac
|
---|
| 1889 | AC_MSG_RESULT(${flag})
|
---|
| 1890 | if test "x$flag" != xno; then
|
---|
| 1891 | PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
|
---|
| 1892 | fi
|
---|
| 1893 |
|
---|
[139] | 1894 | # Detect PTHREAD_MUTEX_RECURSIVE
|
---|
| 1895 | AC_MSG_CHECKING([for recursive mutexes])
|
---|
| 1896 | mutex_recursive=no
|
---|
| 1897 | AC_TRY_LINK([
|
---|
| 1898 | #define _XOPEN_SOURCE 500
|
---|
| 1899 | #include <pthread.h>], [
|
---|
| 1900 | pthread_mutexattr_t mta;
|
---|
| 1901 | pthread_mutexattr_settype(&mta, PTHREAD_MUTEX_RECURSIVE);
|
---|
| 1902 | return 0;],[mutex_recursive=yes])
|
---|
| 1903 | if test "x$mutex_recursive" = "xyes"
|
---|
| 1904 | then
|
---|
| 1905 | AC_DEFINE(HAVE_PTHREAD_MUTEX_RECURSIVE,1,[Define if you have recursive mutexes.])
|
---|
| 1906 | fi
|
---|
| 1907 | AC_MSG_RESULT($mutex_recursive)
|
---|
| 1908 |
|
---|
[129] | 1909 | LIBS="$save_LIBS"
|
---|
| 1910 | CFLAGS="$save_CFLAGS"
|
---|
| 1911 |
|
---|
| 1912 | # More AIX lossage: must compile with xlc_r or cc_r
|
---|
| 1913 | if test x"$GCC" != xyes; then
|
---|
| 1914 | AC_CHECK_PROGS(PTHREAD_CC, xlc_r cc_r, ${CC})
|
---|
| 1915 | else
|
---|
| 1916 | PTHREAD_CC=$CC
|
---|
| 1917 | fi
|
---|
| 1918 | else
|
---|
| 1919 | PTHREAD_CC="$CC"
|
---|
| 1920 | fi
|
---|
| 1921 |
|
---|
[171] | 1922 | if test x"$acx_pthread_ok" = xyes; then
|
---|
| 1923 | PTHREAD_CFLAGS="${PTHREAD_CFLAGS} -DUSE_MALLOC_LOCK=1"
|
---|
| 1924 | fi
|
---|
| 1925 |
|
---|
[129] | 1926 | AC_SUBST(PTHREAD_LIBS)
|
---|
| 1927 | AC_SUBST(PTHREAD_CFLAGS)
|
---|
[138] | 1928 | AC_SUBST(PTHREAD_LDFLAGS)
|
---|
[129] | 1929 | AC_SUBST(PTHREAD_CC)
|
---|
| 1930 |
|
---|
| 1931 | # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
|
---|
| 1932 | if test x"$acx_pthread_ok" = xyes; then
|
---|
| 1933 | ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1])
|
---|
| 1934 | :
|
---|
| 1935 | else
|
---|
| 1936 | acx_pthread_ok=no
|
---|
| 1937 | $2
|
---|
| 1938 | fi
|
---|
| 1939 | AC_LANG_RESTORE
|
---|
| 1940 | ])dnl ACX_PTHREAD
|
---|
| 1941 |
|
---|
[168] | 1942 |
|
---|
| 1943 |
|
---|
| 1944 |
|
---|
| 1945 | dnl Copyright © 2004 Loic Dachary <loic@senga.org>
|
---|
| 1946 | dnl
|
---|
| 1947 | dnl This program is free software; you can redistribute it and/or modify
|
---|
| 1948 | dnl it under the terms of the GNU General Public License as published by
|
---|
| 1949 | dnl the Free Software Foundation; either version 2 of the License, or (at
|
---|
| 1950 | dnl your option) any later version.
|
---|
| 1951 | dnl
|
---|
| 1952 | dnl Use ZLIB_HOME instead of option
|
---|
| 1953 |
|
---|
| 1954 | AC_DEFUN([CHECK_ZLIB],[
|
---|
| 1955 |
|
---|
| 1956 | if test "x${ZLIB_HOME}" = "x"; then
|
---|
| 1957 | ZLIB_HOME=/usr/local
|
---|
| 1958 | if test ! -f "${ZLIB_HOME}/include/zlib.h"
|
---|
| 1959 | then
|
---|
| 1960 | ZLIB_HOME=/usr
|
---|
| 1961 | fi
|
---|
| 1962 | fi
|
---|
| 1963 |
|
---|
| 1964 | zlib_found=no
|
---|
| 1965 |
|
---|
| 1966 | ZLIB_OLD_LDFLAGS=$LDFLAGS
|
---|
| 1967 | ZLIB_OLD_CPPFLAGS=$LDFLAGS
|
---|
| 1968 | if test "x${ZLIB_HOME}" = "x/usr"; then
|
---|
| 1969 | :
|
---|
| 1970 | else
|
---|
| 1971 | LDFLAGS="$LDFLAGS -L${ZLIB_HOME}/lib"
|
---|
| 1972 | CPPFLAGS="$CPPFLAGS -I${ZLIB_HOME}/include"
|
---|
| 1973 | fi
|
---|
| 1974 | AC_LANG_SAVE
|
---|
| 1975 | AC_LANG_C
|
---|
| 1976 | AC_CHECK_LIB(z, inflateEnd, [zlib_cv_libz=yes], [zlib_cv_libz=no])
|
---|
| 1977 | AC_CHECK_HEADER(zlib.h, [zlib_cv_zlib_h=yes], [zlib_cv_zlib_h=no])
|
---|
| 1978 | AC_LANG_RESTORE
|
---|
| 1979 | if test "$zlib_cv_libz" = "yes" -a "$zlib_cv_zlib_h" = "yes"
|
---|
| 1980 | then
|
---|
| 1981 | #
|
---|
| 1982 | # If both library and header were found, use them
|
---|
| 1983 | #
|
---|
| 1984 | AC_CHECK_LIB(z, inflateEnd)
|
---|
| 1985 | AC_MSG_CHECKING([zlib in ${ZLIB_HOME}])
|
---|
| 1986 | AC_MSG_RESULT(ok)
|
---|
[171] | 1987 | AC_CHECK_FUNCS([compressBound])
|
---|
[168] | 1988 | zlib_found=yes
|
---|
| 1989 | else
|
---|
| 1990 | #
|
---|
| 1991 | # If either header or library was not found, revert and bomb
|
---|
| 1992 | #
|
---|
| 1993 | AC_MSG_CHECKING(zlib in ${ZLIB_HOME})
|
---|
| 1994 | LDFLAGS="$ZLIB_OLD_LDFLAGS"
|
---|
| 1995 | CPPFLAGS="$ZLIB_OLD_CPPFLAGS"
|
---|
| 1996 | AC_MSG_RESULT(failed)
|
---|
[169] | 1997 | AC_MSG_WARN([zlib not found in ZLIB_HOME, /usr/local, or /usr])
|
---|
[168] | 1998 | fi
|
---|
| 1999 |
|
---|
| 2000 | ])
|
---|
| 2001 |
|
---|
[171] | 2002 | # SH_PROG_LD
|
---|
| 2003 | # ----------
|
---|
| 2004 | # find the pathname to the GNU or non-GNU linker
|
---|
| 2005 | AC_DEFUN([SH_PROG_LD],
|
---|
| 2006 | [
|
---|
| 2007 | AC_REQUIRE([AC_PROG_CC])dnl
|
---|
| 2008 | AC_REQUIRE([AC_CANONICAL_HOST])dnl
|
---|
| 2009 | AC_REQUIRE([AC_CANONICAL_BUILD])dnl
|
---|
| 2010 | ac_prog=ld
|
---|
| 2011 | if test "$GCC" = yes; then
|
---|
| 2012 | # Check if gcc -print-prog-name=ld gives a path.
|
---|
| 2013 | AC_MSG_CHECKING([for ld used by $CC])
|
---|
| 2014 | case $host in
|
---|
| 2015 | *-*-mingw*)
|
---|
| 2016 | # gcc leaves a trailing carriage return which upsets mingw
|
---|
| 2017 | ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
|
---|
| 2018 | *)
|
---|
| 2019 | ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
|
---|
| 2020 | esac
|
---|
| 2021 | case $ac_prog in
|
---|
| 2022 | # Accept absolute paths.
|
---|
| 2023 | [[\\/]]* | ?:[[\\/]]*)
|
---|
| 2024 | re_direlt='/[[^/]][[^/]]*/\.\./'
|
---|
| 2025 | # Canonicalize the pathname of ld
|
---|
| 2026 | ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
|
---|
| 2027 | while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
|
---|
| 2028 | ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
|
---|
| 2029 | done
|
---|
| 2030 | test -z "$LD" && LD="$ac_prog"
|
---|
| 2031 | ;;
|
---|
| 2032 | "")
|
---|
| 2033 | # If it fails, then pretend we aren't using GCC.
|
---|
| 2034 | ac_prog=ld
|
---|
| 2035 | ;;
|
---|
| 2036 | *)
|
---|
| 2037 | # If it is relative, then search for the first ld in PATH.
|
---|
| 2038 | with_gnu_ld=unknown
|
---|
| 2039 | ;;
|
---|
| 2040 | esac
|
---|
| 2041 | else
|
---|
| 2042 | AC_MSG_CHECKING([for ld])
|
---|
| 2043 | fi
|
---|
| 2044 | AC_CACHE_VAL(lt_cv_path_LD,
|
---|
| 2045 | [if test -z "$LD"; then
|
---|
| 2046 | lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
|
---|
| 2047 | for ac_dir in $PATH; do
|
---|
| 2048 | IFS="$lt_save_ifs"
|
---|
| 2049 | test -z "$ac_dir" && ac_dir=.
|
---|
| 2050 | if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
|
---|
| 2051 | lt_cv_path_LD="$ac_dir/$ac_prog"
|
---|
| 2052 | # Check to see if the program is GNU ld. I'd rather use --version,
|
---|
| 2053 | # but apparently some variants of GNU ld only accept -v.
|
---|
| 2054 | # Break only if it was the GNU/non-GNU ld that we prefer.
|
---|
| 2055 | case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
|
---|
| 2056 | *GNU* | *'with BFD'*)
|
---|
| 2057 | with_gnu_ld=yes
|
---|
| 2058 | ;;
|
---|
| 2059 | *)
|
---|
| 2060 | with_gnu_ld=no
|
---|
| 2061 | ;;
|
---|
| 2062 | esac
|
---|
| 2063 | fi
|
---|
| 2064 | done
|
---|
| 2065 | IFS="$lt_save_ifs"
|
---|
| 2066 | else
|
---|
| 2067 | lt_cv_path_LD="$LD" # Let the user override the test with a path.
|
---|
| 2068 | fi])
|
---|
| 2069 | LD="$lt_cv_path_LD"
|
---|
| 2070 | if test -n "$LD"; then
|
---|
| 2071 | AC_MSG_RESULT($LD)
|
---|
| 2072 | else
|
---|
| 2073 | AC_MSG_RESULT(no)
|
---|
| 2074 | fi
|
---|
| 2075 | test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
|
---|
| 2076 | AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
|
---|
| 2077 | [# I'd rather use --version here, but apparently some GNU lds only accept -v.
|
---|
| 2078 | case `$LD -v 2>&1 </dev/null` in
|
---|
| 2079 | *GNU* | *'with BFD'*)
|
---|
| 2080 | lt_cv_prog_gnu_ld=yes
|
---|
| 2081 | ;;
|
---|
| 2082 | *)
|
---|
| 2083 | lt_cv_prog_gnu_ld=no
|
---|
| 2084 | ;;
|
---|
| 2085 | esac])
|
---|
| 2086 | with_gnu_ld=$lt_cv_prog_gnu_ld
|
---|
| 2087 | ])# AC_PROG_LD_GNU
|
---|
[168] | 2088 |
|
---|
[238] | 2089 | # SH_STRFTIME_Z
|
---|
| 2090 | # -------------
|
---|
| 2091 | # check whether strftime supports %z
|
---|
| 2092 | AC_DEFUN([SH_STRFTIME_Z],
|
---|
| 2093 | [
|
---|
| 2094 | AC_MSG_CHECKING([whether strftime supports %z])
|
---|
| 2095 | AC_TRY_RUN([
|
---|
| 2096 | #include <time.h>
|
---|
| 2097 | #include <string.h>
|
---|
| 2098 | int main()
|
---|
| 2099 | {
|
---|
| 2100 | struct tm tm;
|
---|
| 2101 | char tt[64];
|
---|
| 2102 | memset(&tm, 0, sizeof(tm));
|
---|
| 2103 | strftime(tt, sizeof(tt), "%z", &tm);
|
---|
| 2104 |
|
---|
| 2105 | if (strlen(tt) != 5) return 1;
|
---|
| 2106 | return 0;
|
---|
| 2107 | }
|
---|
| 2108 | ],
|
---|
| 2109 | [
|
---|
| 2110 | AC_MSG_RESULT([yes])
|
---|
| 2111 | AC_DEFINE(HAVE_STRFTIME_Z, 1, [strftime supports %z])
|
---|
| 2112 | ],
|
---|
| 2113 | [
|
---|
| 2114 | AC_MSG_RESULT([no])
|
---|
| 2115 | ],[
|
---|
| 2116 | AC_MSG_RESULT([no])
|
---|
| 2117 | ])])
|
---|
| 2118 |
|
---|
[440] | 2119 | AC_DEFUN([SH_GCC_VERSION], [
|
---|
| 2120 | GCC_VERSION=""
|
---|
| 2121 | gcc_VERSION_MAJOR=0
|
---|
| 2122 | gcc_VERSION_MINOR=0
|
---|
| 2123 | AC_MSG_CHECKING([for gcc version])
|
---|
| 2124 | if test "x$GCC" = "xyes"
|
---|
| 2125 | then
|
---|
| 2126 | $CC -dumpversion >/dev/null 2>&1
|
---|
| 2127 | if test $? -eq 0
|
---|
| 2128 | then
|
---|
| 2129 | GCC_VERSION=`$CC -dumpversion`
|
---|
| 2130 | gcc_VERSION_MAJOR=`echo $GCC_VERSION | cut -d'.' -f1`
|
---|
| 2131 | gcc_VERSION_MINOR=`echo $GCC_VERSION | cut -d'.' -f2`
|
---|
| 2132 | AC_DEFINE_UNQUOTED(GCC_VERSION_MAJOR, [${gcc_VERSION_MAJOR}], [gcc version major])
|
---|
| 2133 | AC_DEFINE_UNQUOTED(GCC_VERSION_MINOR, [${gcc_VERSION_MINOR}], [gcc version minor])
|
---|
| 2134 | AC_MSG_RESULT([$GCC_VERSION])
|
---|
| 2135 | else
|
---|
| 2136 | AC_MSG_RESULT([$CC -dumpversion working])
|
---|
| 2137 | fi
|
---|
| 2138 | else
|
---|
| 2139 | AC_MSG_RESULT([compiler is not gcc])
|
---|
| 2140 | fi
|
---|
| 2141 | ])
|
---|
[238] | 2142 |
|
---|
| 2143 |
|
---|
| 2144 |
|
---|
[1] | 2145 | dnl *-*wedit:notab*-* Please keep this as the last line.
|
---|
| 2146 |
|
---|