A hint: This file contains one or more very long lines, so maybe it is better readable using the pure text view mode that shows the contents as wrapped lines within the browser window.
1 dnl $Id: acinclude.m4,v 1.271.2.22 2005/07/25 22:31:07 helly Exp $ -*- autoconf -*- 2 dnl 3 dnl This file contains local autoconf functions. 4 5 dnl PHP_ADD_MAKEFILE_FRAGMENT([srcfile[, ext_srcdir[, ext_builddir]]]) 6 dnl 7 dnl Processes a file called Makefile.frag in the source directory 8 dnl of the most recently added extension. $(srcdir) and $(builddir) 9 dnl are substituted with the proper paths. Can be used to supply 10 dnl custom rules and/or additional targets. 11 dnl 12 AC_DEFUN([PHP_ADD_MAKEFILE_FRAGMENT],[ 13 ifelse($1,,src=$ext_srcdir/Makefile.frag,src=$1) 14 ifelse($2,,ac_srcdir=$ext_srcdir,ac_srcdir=$2) 15 ifelse($3,,ac_builddir=$ext_builddir,ac_builddir=$3) 16 sed -e "s#\$(srcdir)#$ac_srcdir#g" -e "s#\$(builddir)#$ac_builddir#g" $src >> Makefile.fragments 17 ]) 18 19 AC_DEFUN([PHP_PROG_RE2C],[ 20 AC_CHECK_PROG(RE2C, re2c, re2c, [exit 0;]) 21 ]) 22 23 24 dnl PHP_DEFINE(WHAT[, value[, directory]]) 25 dnl 26 dnl Creates builddir/include/what.h and in there #define WHAT value 27 dnl 28 AC_DEFUN([PHP_DEFINE],[ 29 [echo "#define ]$1[]ifelse([$2],,[ 1],[ $2])[" > ]ifelse([$3],,[include],[$3])[/php_]translit($1,A-Z,a-z)[.h] 30 ]) 31 32 dnl PHP_CANONICAL_HOST 33 dnl 34 AC_DEFUN([PHP_CANONICAL_HOST],[ 35 AC_REQUIRE([AC_CANONICAL_HOST])dnl 36 dnl Make sure we do not continue if host_alias is empty. 37 if test -z "$host_alias" && test -n "$host"; then 38 host_alias=$host 39 fi 40 if test -z "$host_alias"; then 41 AC_MSG_ERROR([host_alias is not set!]) 42 fi 43 ]) 44 45 dnl PHP_INIT_BUILD_SYSTEM 46 dnl 47 AC_DEFUN([PHP_INIT_BUILD_SYSTEM],[ 48 AC_REQUIRE([PHP_CANONICAL_HOST])dnl 49 test -d include || mkdir include 50 > Makefile.objects 51 > Makefile.fragments 52 dnl We need to play tricks here to avoid matching the grep line itself 53 pattern=define 54 egrep $pattern'.*include/php' $srcdir/configure|sed 's/.*>//'|xargs touch 2>/dev/null 55 ]) 56 57 dnl PHP_GEN_GLOBAL_MAKEFILE 58 dnl 59 dnl Generates the global makefile. 60 dnl 61 AC_DEFUN([PHP_GEN_GLOBAL_MAKEFILE],[ 62 cat >Makefile <<EOF 63 srcdir = $abs_srcdir 64 builddir = $abs_builddir 65 top_srcdir = $abs_srcdir 66 top_builddir = $abs_builddir 67 EOF 68 for i in $PHP_VAR_SUBST; do 69 eval echo "$i = \$$i" >> Makefile 70 done 71 72 cat $abs_srcdir/Makefile.global Makefile.fragments Makefile.objects >> Makefile 73 ]) 74 75 dnl PHP_ADD_SOURCES(source-path, sources[, special-flags[, type]]) 76 dnl 77 dnl Adds sources which are located relative to source-path to the 78 dnl array of type type. Sources are processed with optional 79 dnl special-flags which are passed to the compiler. Sources 80 dnl can be either written in C or C++ (filenames shall end in .c 81 dnl or .cpp, respectively). 82 dnl 83 dnl Note: If source-path begins with a "/", the "/" is removed and 84 dnl the path is interpreted relative to the top build-directory. 85 dnl 86 dnl which array to append to? 87 AC_DEFUN([PHP_ADD_SOURCES],[ 88 PHP_ADD_SOURCES_X($1, $2, $3, ifelse($4,cli,PHP_CLI_OBJS,ifelse($4,sapi,PHP_SAPI_OBJS,PHP_GLOBAL_OBJS))) 89 ]) 90 dnl 91 dnl _PHP_ASSIGN_BUILD_VARS(type) 92 dnl internal, don't use 93 AC_DEFUN([_PHP_ASSIGN_BUILD_VARS],[ 94 ifelse($1,shared,[ 95 b_c_pre=$shared_c_pre 96 b_cxx_pre=$shared_cxx_pre 97 b_c_meta=$shared_c_meta 98 b_cxx_meta=$shared_cxx_meta 99 b_c_post=$shared_c_post 100 b_cxx_post=$shared_cxx_post 101 ],[ 102 b_c_pre=$php_c_pre 103 b_cxx_pre=$php_cxx_pre 104 b_c_meta=$php_c_meta 105 b_cxx_meta=$php_cxx_meta 106 b_c_post=$php_c_post 107 b_cxx_post=$php_cxx_post 108 ])dnl 109 b_lo=[$]$1_lo 110 ]) 111 112 dnl PHP_ADD_SOURCES_X(source-path, sources[, special-flags[, target-var[, shared[, special-post-flags]]]]) 113 dnl 114 dnl Additional to PHP_ADD_SOURCES (see above), this lets you set the 115 dnl name of the array target-var directly, as well as whether 116 dnl shared objects will be built from the sources. Should not be 117 dnl used directly. 118 dnl 119 AC_DEFUN([PHP_ADD_SOURCES_X],[ 120 dnl relative to source- or build-directory? 121 dnl ac_srcdir/ac_bdir include trailing slash 122 case $1 in 123 ""[)] ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;; 124 /*[)] ac_srcdir=`echo "$1"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;; 125 *[)] ac_srcdir="$abs_srcdir/$1/"; ac_bdir="$1/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;; 126 esac 127 128 dnl how to build .. shared or static? 129 ifelse($5,yes,_PHP_ASSIGN_BUILD_VARS(shared),_PHP_ASSIGN_BUILD_VARS(php)) 130 131 dnl iterate over the sources 132 old_IFS=[$]IFS 133 for ac_src in $2; do 134 135 dnl remove the suffix 136 IFS=. 137 set $ac_src 138 ac_obj=[$]1 139 IFS=$old_IFS 140 141 dnl append to the array which has been dynamically chosen at m4 time 142 $4="[$]$4 [$]ac_bdir[$]ac_obj.lo" 143 144 dnl choose the right compiler/flags/etc. for the source-file 145 case $ac_src in 146 *.c[)] ac_comp="$b_c_pre $3 $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $6$b_c_post" ;; 147 *.s[)] ac_comp="$b_c_pre $3 $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $6$b_c_post" ;; 148 *.S[)] ac_comp="$b_c_pre $3 $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $6$b_c_post" ;; 149 *.cpp|*.cc[)] ac_comp="$b_cxx_pre $3 $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $6$b_cxx_post" ;; 150 esac 151 152 dnl create a rule for the object/source combo 153 cat >>Makefile.objects<<EOF 154 $ac_bdir[$]ac_obj.lo: $ac_srcdir[$]ac_src 155 $ac_comp 156 EOF 157 done 158 ]) 159 160 dnl 161 dnl Separator into the configure --help display. 162 dnl 163 AC_DEFUN([PHP_HELP_SEPARATOR],[ 164 AC_ARG_ENABLE([],[ 165 $1 166 ],[]) 167 ]) 168 169 dnl 170 dnl PHP_TARGET_RDYNAMIC 171 dnl 172 dnl Checks whether -rdynamic is supported by the compiler. This 173 dnl is necessary for some targets to populate the global symbol 174 dnl table. Otherwise, dynamic modules would not be able to resolve 175 dnl PHP-related symbols. 176 dnl 177 dnl If successful, adds -rdynamic to PHP_LDFLAGS. 178 dnl 179 AC_DEFUN([PHP_TARGET_RDYNAMIC],[ 180 if test -n "$GCC"; then 181 dnl we should use a PHP-specific macro here 182 TSRM_CHECK_GCC_ARG(-rdynamic, gcc_rdynamic=yes) 183 if test "$gcc_rdynamic" = "yes"; then 184 PHP_LDFLAGS="$PHP_LDFLAGS -rdynamic" 185 fi 186 fi 187 ]) 188 189 AC_DEFUN([PHP_REMOVE_USR_LIB],[ 190 unset ac_new_flags 191 for i in [$]$1; do 192 case [$]i in 193 -L/usr/lib|-L/usr/lib/[)] ;; 194 *[)] ac_new_flags="[$]ac_new_flags [$]i" ;; 195 esac 196 done 197 $1=[$]ac_new_flags 198 ]) 199 200 dnl PHP_EVAL_LIBLINE(LINE, SHARED-LIBADD) 201 dnl 202 dnl Use this macro, if you need to add libraries and or library search 203 dnl paths to the PHP build system which are only given in compiler 204 dnl notation. 205 dnl 206 AC_DEFUN([PHP_EVAL_LIBLINE],[ 207 for ac_i in $1; do 208 case $ac_i in 209 -l*[)] 210 ac_ii=`echo $ac_i|cut -c 3-` 211 PHP_ADD_LIBRARY($ac_ii,1,$2) 212 ;; 213 -L*[)] 214 ac_ii=`echo $ac_i|cut -c 3-` 215 PHP_ADD_LIBPATH($ac_ii,$2) 216 ;; 217 esac 218 done 219 ]) 220 221 dnl PHP_EVAL_INCLINE(LINE) 222 dnl 223 dnl Use this macro, if you need to add header search paths to the PHP 224 dnl build system which are only given in compiler notation. 225 dnl 226 AC_DEFUN([PHP_EVAL_INCLINE],[ 227 for ac_i in $1; do 228 case $ac_i in 229 -I*[)] 230 ac_ii=`echo $ac_i|cut -c 3-` 231 PHP_ADD_INCLUDE($ac_ii) 232 ;; 233 esac 234 done 235 ]) 236 237 AC_DEFUN([PHP_READDIR_R_TYPE],[ 238 dnl HAVE_READDIR_R is also defined by libmysql 239 AC_CHECK_FUNC(readdir_r,ac_cv_func_readdir_r=yes,ac_cv_func_readdir=no) 240 if test "$ac_cv_func_readdir_r" = "yes"; then 241 AC_CACHE_CHECK(for type of readdir_r, ac_cv_what_readdir_r,[ 242 AC_TRY_RUN([ 243 #define _REENTRANT 244 #include <sys/types.h> 245 #include <dirent.h> 246 247 #ifndef PATH_MAX 248 #define PATH_MAX 1024 249 #endif 250 251 main() { 252 DIR *dir; 253 char entry[sizeof(struct dirent)+PATH_MAX]; 254 struct dirent *pentry = (struct dirent *) &entry; 255 256 dir = opendir("/"); 257 if (!dir) 258 exit(1); 259 if (readdir_r(dir, (struct dirent *) entry, &pentry) == 0) 260 exit(0); 261 exit(1); 262 } 263 ],[ 264 ac_cv_what_readdir_r=POSIX 265 ],[ 266 AC_TRY_CPP([ 267 #define _REENTRANT 268 #include <sys/types.h> 269 #include <dirent.h> 270 int readdir_r(DIR *, struct dirent *); 271 ],[ 272 ac_cv_what_readdir_r=old-style 273 ],[ 274 ac_cv_what_readdir_r=none 275 ]) 276 ],[ 277 ac_cv_what_readdir_r=none 278 ]) 279 ]) 280 case $ac_cv_what_readdir_r in 281 POSIX) 282 AC_DEFINE(HAVE_POSIX_READDIR_R,1,[whether you have POSIX readdir_r]);; 283 old-style) 284 AC_DEFINE(HAVE_OLD_READDIR_R,1,[whether you have old-style readdir_r]);; 285 esac 286 fi 287 ]) 288 289 AC_DEFUN([PHP_SHLIB_SUFFIX_NAME],[ 290 AC_REQUIRE([PHP_CANONICAL_HOST])dnl 291 PHP_SUBST(SHLIB_SUFFIX_NAME) 292 SHLIB_SUFFIX_NAME=so 293 case $host_alias in 294 *hpux*[)] 295 SHLIB_SUFFIX_NAME=sl 296 ;; 297 *darwin*[)] 298 SHLIB_SUFFIX_NAME=dylib 299 ;; 300 esac 301 ]) 302 303 AC_DEFUN([PHP_DEBUG_MACRO],[ 304 DEBUG_LOG=$1 305 cat >$1 <<X 306 CONFIGURE: $CONFIGURE_COMMAND 307 CC: $CC 308 CFLAGS: $CFLAGS 309 CPPFLAGS: $CPPFLAGS 310 CXX: $CXX 311 CXXFLAGS: $CXXFLAGS 312 INCLUDES: $INCLUDES 313 LDFLAGS: $LDFLAGS 314 LIBS: $LIBS 315 DLIBS: $DLIBS 316 SAPI: $PHP_SAPI 317 PHP_RPATHS: $PHP_RPATHS 318 uname -a: `uname -a` 319 320 X 321 cat >conftest.$ac_ext <<X 322 main() 323 { 324 exit(0); 325 } 326 X 327 (eval echo \"$ac_link\"; eval $ac_link && ./conftest) >>$1 2>&1 328 rm -fr conftest* 329 ]) 330 331 AC_DEFUN([PHP_DOES_PWRITE_WORK],[ 332 AC_TRY_RUN([ 333 #include <sys/types.h> 334 #include <sys/stat.h> 335 #include <fcntl.h> 336 #include <unistd.h> 337 #include <errno.h> 338 $1 339 main() { 340 int fd = open("conftest_in", O_WRONLY|O_CREAT, 0600); 341 342 if (fd < 0) exit(1); 343 if (pwrite(fd, "text", 4, 0) != 4) exit(1); 344 /* Linux glibc breakage until 2.2.5 */ 345 if (pwrite(fd, "text", 4, -1) != -1 || errno != EINVAL) exit(1); 346 exit(0); 347 } 348 349 ],[ 350 ac_cv_pwrite=yes 351 ],[ 352 ac_cv_pwrite=no 353 ],[ 354 ac_cv_pwrite=no 355 ]) 356 ]) 357 358 AC_DEFUN([PHP_DOES_PREAD_WORK],[ 359 echo test > conftest_in 360 AC_TRY_RUN([ 361 #include <sys/types.h> 362 #include <sys/stat.h> 363 #include <fcntl.h> 364 #include <unistd.h> 365 #include <errno.h> 366 $1 367 main() { 368 char buf[3]; 369 int fd = open("conftest_in", O_RDONLY); 370 if (fd < 0) exit(1); 371 if (pread(fd, buf, 2, 0) != 2) exit(1); 372 /* Linux glibc breakage until 2.2.5 */ 373 if (pread(fd, buf, 2, -1) != -1 || errno != EINVAL) exit(1); 374 exit(0); 375 } 376 ],[ 377 ac_cv_pread=yes 378 ],[ 379 ac_cv_pread=no 380 ],[ 381 ac_cv_pread=no 382 ]) 383 rm -f conftest_in 384 ]) 385 386 AC_DEFUN([PHP_PWRITE_TEST],[ 387 AC_CACHE_CHECK(whether pwrite works,ac_cv_pwrite,[ 388 PHP_DOES_PWRITE_WORK 389 if test "$ac_cv_pwrite" = "no"; then 390 PHP_DOES_PWRITE_WORK([ssize_t pwrite(int, void *, size_t, off64_t);]) 391 if test "$ac_cv_pwrite" = "yes"; then 392 ac_cv_pwrite=64 393 fi 394 fi 395 ]) 396 397 if test "$ac_cv_pwrite" != "no"; then 398 AC_DEFINE(HAVE_PWRITE, 1, [ ]) 399 if test "$ac_cv_pwrite" = "64"; then 400 AC_DEFINE(PHP_PWRITE_64, 1, [whether pwrite64 is default]) 401 fi 402 fi 403 ]) 404 405 AC_DEFUN([PHP_PREAD_TEST],[ 406 AC_CACHE_CHECK(whether pread works,ac_cv_pread,[ 407 PHP_DOES_PREAD_WORK 408 if test "$ac_cv_pread" = "no"; then 409 PHP_DOES_PREAD_WORK([ssize_t pread(int, void *, size_t, off64_t);]) 410 if test "$ac_cv_pread" = "yes"; then 411 ac_cv_pread=64 412 fi 413 fi 414 ]) 415 416 if test "$ac_cv_pread" != "no"; then 417 AC_DEFINE(HAVE_PREAD, 1, [ ]) 418 if test "$ac_cv_pread" = "64"; then 419 AC_DEFINE(PHP_PREAD_64, 1, [whether pread64 is default]) 420 fi 421 fi 422 ]) 423 424 AC_DEFUN([PHP_MISSING_TIME_R_DECL],[ 425 AC_MSG_CHECKING([for missing declarations of reentrant functions]) 426 AC_TRY_COMPILE([#include <time.h>],[struct tm *(*func)() = localtime_r],[ 427 : 428 ],[ 429 AC_DEFINE(MISSING_LOCALTIME_R_DECL,1,[Whether localtime_r is declared]) 430 ]) 431 AC_TRY_COMPILE([#include <time.h>],[struct tm *(*func)() = gmtime_r],[ 432 : 433 ],[ 434 AC_DEFINE(MISSING_GMTIME_R_DECL,1,[Whether gmtime_r is declared]) 435 ]) 436 AC_TRY_COMPILE([#include <time.h>],[char *(*func)() = asctime_r],[ 437 : 438 ],[ 439 AC_DEFINE(MISSING_ASCTIME_R_DECL,1,[Whether asctime_r is declared]) 440 ]) 441 AC_TRY_COMPILE([#include <time.h>],[char *(*func)() = ctime_r],[ 442 : 443 ],[ 444 AC_DEFINE(MISSING_CTIME_R_DECL,1,[Whether ctime_r is declared]) 445 ]) 446 AC_TRY_COMPILE([#include <string.h>],[char *(*func)() = strtok_r],[ 447 : 448 ],[ 449 AC_DEFINE(MISSING_STRTOK_R_DECL,1,[Whether strtok_r is declared]) 450 ]) 451 AC_MSG_RESULT([done]) 452 ]) 453 454 dnl 455 dnl PHP_LIBGCC_LIBPATH(gcc) 456 dnl Stores the location of libgcc in libgcc_libpath 457 dnl 458 AC_DEFUN([PHP_LIBGCC_LIBPATH],[ 459 changequote({,}) 460 libgcc_libpath=`$1 --print-libgcc-file-name|sed 's%/*[^/][^/]*$%%'` 461 changequote([,]) 462 ]) 463 464 AC_DEFUN([PHP_ARG_ANALYZE_EX],[ 465 ext_output="yes, shared" 466 ext_shared=yes 467 case [$]$1 in 468 shared,*[)] 469 $1=`echo "[$]$1"|sed 's/^shared,//'` 470 ;; 471 shared[)] 472 $1=yes 473 ;; 474 no[)] 475 ext_output=no 476 ext_shared=no 477 ;; 478 *[)] 479 ext_output=yes 480 ext_shared=no 481 ;; 482 esac 483 484 PHP_ALWAYS_SHARED([$1]) 485 ]) 486 487 AC_DEFUN([PHP_ARG_ANALYZE],[ 488 ifelse([$3],yes,[PHP_ARG_ANALYZE_EX([$1])],[ext_output=ifelse([$]$1,,no,[$]$1)]) 489 ifelse([$2],,,[AC_MSG_RESULT([$ext_output])]) 490 ]) 491 492 dnl 493 dnl PHP_ARG_WITH(arg-name, check message, help text[, default-val[, extension-or-not]]) 494 dnl Sets PHP_ARG_NAME either to the user value or to the default value. 495 dnl default-val defaults to no. This will also set the variable ext_shared, 496 dnl and will overwrite any previous variable of that name. 497 dnl If extension-or-not is yes (default), then do the ENABLE_ALL check and run 498 dnl the PHP_ARG_ANALYZE_EX. 499 dnl 500 AC_DEFUN([PHP_ARG_WITH],[ 501 PHP_REAL_ARG_WITH([$1],[$2],[$3],[$4],PHP_[]translit($1,a-z0-9-,A-Z0-9_),[ifelse($5,,yes,$5)]) 502 ]) 503 504 AC_DEFUN([PHP_REAL_ARG_WITH],[ 505 ifelse([$2],,,[AC_MSG_CHECKING([$2])]) 506 AC_ARG_WITH($1,[$3],$5=[$]withval, 507 [ 508 $5=ifelse($4,,no,$4) 509 510 if test "$PHP_ENABLE_ALL" && test "$6" = "yes"; then 511 $5=$PHP_ENABLE_ALL 512 fi 513 ]) 514 PHP_ARG_ANALYZE($5,[$2],$6) 515 ]) 516 517 dnl 518 dnl PHP_ARG_ENABLE(arg-name, check message, help text[, default-val[, extension-or-not]]) 519 dnl Sets PHP_ARG_NAME either to the user value or to the default value. 520 dnl default-val defaults to no. This will also set the variable ext_shared, 521 dnl and will overwrite any previous variable of that name. 522 dnl If extension-or-not is yes (default), then do the ENABLE_ALL check and run 523 dnl the PHP_ARG_ANALYZE_EX. 524 dnl 525 AC_DEFUN([PHP_ARG_ENABLE],[ 526 PHP_REAL_ARG_ENABLE([$1],[$2],[$3],[$4],PHP_[]translit($1,a-z-,A-Z_),[ifelse($5,,yes,$5)]) 527 ]) 528 529 AC_DEFUN([PHP_REAL_ARG_ENABLE],[ 530 ifelse([$2],,,[AC_MSG_CHECKING([$2])]) 531 AC_ARG_ENABLE($1,[$3],$5=[$]enableval, 532 [ 533 $5=ifelse($4,,no,$4) 534 535 if test "$PHP_ENABLE_ALL" && test "$6" = "yes"; then 536 $5=$PHP_ENABLE_ALL 537 fi 538 ]) 539 PHP_ARG_ANALYZE($5,[$2],$6) 540 ]) 541 542 AC_DEFUN([PHP_MODULE_PTR],[ 543 EXTRA_MODULE_PTRS="$EXTRA_MODULE_PTRS $1," 544 ]) 545 546 AC_DEFUN([PHP_CONFIG_NICE],[ 547 test -f $1 && mv $1 $1.old 548 rm -f $1.old 549 cat >$1<<EOF 550 #! /bin/sh 551 # 552 # Created by configure 553 554 EOF 555 556 for var in CFLAGS CXXFLAGS CPPFLAGS LDFLAGS LIBS CC CXX; do 557 eval val=\$$var 558 if test -n "$val"; then 559 echo "$var='$val' \\" >> $1 560 fi 561 done 562 563 for arg in [$]0 "[$]@"; do 564 echo "'[$]arg' \\" >> $1 565 done 566 echo '"[$]@"' >> $1 567 chmod +x $1 568 ]) 569 570 AC_DEFUN([PHP_TIME_R_TYPE],[ 571 AC_CACHE_CHECK(for type of reentrant time-related functions, ac_cv_time_r_type,[ 572 AC_TRY_RUN([ 573 #include <time.h> 574 575 main() { 576 char buf[27]; 577 struct tm t; 578 time_t old = 0; 579 int r, s; 580 581 s = gmtime_r(&old, &t); 582 r = (int) asctime_r(&t, buf, 26); 583 if (r == s && s == 0) return (0); 584 return (1); 585 } 586 ],[ 587 ac_cv_time_r_type=hpux 588 ],[ 589 AC_TRY_RUN([ 590 #include <time.h> 591 main() { 592 struct tm t, *s; 593 time_t old = 0; 594 char buf[27], *p; 595 596 s = gmtime_r(&old, &t); 597 p = asctime_r(&t, buf, 26); 598 if (p == buf && s == &t) return (0); 599 return (1); 600 } 601 ],[ 602 ac_cv_time_r_type=irix 603 ],[ 604 ac_cv_time_r_type=POSIX 605 ]) 606 ],[ 607 ac_cv_time_r_type=POSIX 608 ]) 609 ]) 610 case $ac_cv_time_r_type in 611 hpux[)] AC_DEFINE(PHP_HPUX_TIME_R,1,[Whether you have HP-UX 10.x]) ;; 612 irix[)] AC_DEFINE(PHP_IRIX_TIME_R,1,[Whether you have IRIX-style functions]) ;; 613 esac 614 ]) 615 616 AC_DEFUN([PHP_SUBST],[ 617 PHP_VAR_SUBST="$PHP_VAR_SUBST $1" 618 ]) 619 620 AC_DEFUN([PHP_SUBST_OLD],[ 621 PHP_SUBST($1) 622 AC_SUBST($1) 623 ]) 624 625 AC_DEFUN([PHP_TM_GMTOFF],[ 626 AC_CACHE_CHECK([for tm_gmtoff in struct tm], ac_cv_struct_tm_gmtoff, 627 [AC_TRY_COMPILE([#include <sys/types.h> 628 #include <$ac_cv_struct_tm>], [struct tm tm; tm.tm_gmtoff;], 629 ac_cv_struct_tm_gmtoff=yes, ac_cv_struct_tm_gmtoff=no)]) 630 631 if test "$ac_cv_struct_tm_gmtoff" = yes; then 632 AC_DEFINE(HAVE_TM_GMTOFF,1,[whether you have tm_gmtoff in struct tm]) 633 fi 634 ]) 635 636 dnl PHP_CONFIGURE_PART(MESSAGE) 637 dnl Idea borrowed from mm 638 AC_DEFUN([PHP_CONFIGURE_PART],[ 639 AC_MSG_RESULT() 640 AC_MSG_RESULT([${T_MD}$1${T_ME}]) 641 ]) 642 643 AC_DEFUN([PHP_PROG_SENDMAIL],[ 644 PHP_ALT_PATH=/usr/bin:/usr/sbin:/usr/etc:/etc:/usr/ucblib:/usr/lib 645 AC_PATH_PROG(PROG_SENDMAIL, sendmail,[], $PATH:$PHP_ALT_PATH) 646 if test -n "$PROG_SENDMAIL"; then 647 AC_DEFINE(HAVE_SENDMAIL,1,[whether you have sendmail]) 648 fi 649 ]) 650 651 AC_DEFUN([PHP_RUNPATH_SWITCH],[ 652 dnl check for -R, etc. switch 653 AC_MSG_CHECKING([if compiler supports -R]) 654 AC_CACHE_VAL(php_cv_cc_dashr,[ 655 SAVE_LIBS=$LIBS 656 LIBS="-R /usr/lib $LIBS" 657 AC_TRY_LINK([], [], php_cv_cc_dashr=yes, php_cv_cc_dashr=no) 658 LIBS=$SAVE_LIBS]) 659 AC_MSG_RESULT([$php_cv_cc_dashr]) 660 if test $php_cv_cc_dashr = "yes"; then 661 ld_runpath_switch=-R 662 else 663 AC_MSG_CHECKING([if compiler supports -Wl,-rpath,]) 664 AC_CACHE_VAL(php_cv_cc_rpath,[ 665 SAVE_LIBS=$LIBS 666 LIBS="-Wl,-rpath,/usr/lib $LIBS" 667 AC_TRY_LINK([], [], php_cv_cc_rpath=yes, php_cv_cc_rpath=no) 668 LIBS=$SAVE_LIBS]) 669 AC_MSG_RESULT([$php_cv_cc_rpath]) 670 if test $php_cv_cc_rpath = "yes"; then 671 ld_runpath_switch=-Wl,-rpath, 672 else 673 dnl something innocuous 674 ld_runpath_switch=-L 675 fi 676 fi 677 ]) 678 679 AC_DEFUN([PHP_STRUCT_FLOCK],[ 680 AC_CACHE_CHECK(for struct flock,ac_cv_struct_flock, 681 AC_TRY_COMPILE([ 682 #include <unistd.h> 683 #include <fcntl.h> 684 ], 685 [struct flock x;], 686 [ 687 ac_cv_struct_flock=yes 688 ],[ 689 ac_cv_struct_flock=no 690 ]) 691 ) 692 if test "$ac_cv_struct_flock" = "yes" ; then 693 AC_DEFINE(HAVE_STRUCT_FLOCK, 1,[whether you have struct flock]) 694 fi 695 ]) 696 697 AC_DEFUN([PHP_SOCKLEN_T],[ 698 AC_CACHE_CHECK(for socklen_t,ac_cv_socklen_t, 699 AC_TRY_COMPILE([ 700 #include <sys/types.h> 701 #include <sys/socket.h> 702 ],[ 703 socklen_t x; 704 ],[ 705 ac_cv_socklen_t=yes 706 ],[ 707 ac_cv_socklen_t=no 708 ])) 709 if test "$ac_cv_socklen_t" = "yes"; then 710 AC_DEFINE(HAVE_SOCKLEN_T, 1, [Whether you have socklen_t]) 711 fi 712 ]) 713 714 dnl 715 dnl PHP_SET_SYM_FILE(path) 716 dnl 717 dnl set the path of the file which contains the symbol export list 718 dnl 719 AC_DEFUN([PHP_SET_SYM_FILE], 720 [ 721 PHP_SYM_FILE=$1 722 ]) 723 724 dnl 725 dnl PHP_BUILD_THREAD_SAFE 726 dnl 727 AC_DEFUN([PHP_BUILD_THREAD_SAFE],[ 728 enable_maintainer_zts=yes 729 if test "$pthreads_working" != "yes"; then 730 AC_MSG_ERROR([ZTS currently requires working POSIX threads. We were unable to verify that your system supports Pthreads.]) 731 fi 732 ]) 733 734 AC_DEFUN([PHP_REQUIRE_CXX],[ 735 if test -z "$php_cxx_done"; then 736 AC_PROG_CXX 737 AC_PROG_CXXCPP 738 php_cxx_done=yes 739 fi 740 ]) 741 742 dnl 743 dnl PHP_BUILD_SHARED 744 dnl 745 AC_DEFUN([PHP_BUILD_SHARED],[ 746 PHP_BUILD_PROGRAM 747 OVERALL_TARGET=libphp5.la 748 php_build_target=shared 749 750 php_c_pre=$shared_c_pre 751 php_c_meta=$shared_c_meta 752 php_c_post=$shared_c_post 753 php_cxx_pre=$shared_cxx_pre 754 php_cxx_meta=$shared_cxx_meta 755 php_cxx_post=$shared_cxx_post 756 php_lo=$shared_lo 757 ]) 758 759 dnl 760 dnl PHP_BUILD_STATIC 761 dnl 762 AC_DEFUN([PHP_BUILD_STATIC],[ 763 PHP_BUILD_PROGRAM 764 OVERALL_TARGET=libphp5.la 765 php_build_target=static 766 ]) 767 768 dnl 769 dnl PHP_BUILD_BUNDLE 770 dnl 771 AC_DEFUN([PHP_BUILD_BUNDLE],[ 772 PHP_BUILD_PROGRAM 773 OVERALL_TARGET=libs/libphp5.bundle 774 php_build_target=static 775 ]) 776 777 dnl 778 dnl PHP_BUILD_PROGRAM 779 dnl 780 AC_DEFUN([PHP_BUILD_PROGRAM],[ 781 OVERALL_TARGET=[]ifelse($1,,php,$1) 782 php_c_pre='$(CC)' 783 php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)' 784 php_c_post=' && echo > $[@]' 785 php_cxx_pre='$(CXX)' 786 php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)' 787 php_cxx_post=' && echo > $[@]' 788 php_lo=o 789 790 case $with_pic in 791 yes) pic_setting='-prefer-pic';; 792 no) pic_setting='-prefer-non-pic';; 793 esac 794 795 shared_c_pre='$(LIBTOOL) --mode=compile $(CC)' 796 shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting 797 shared_c_post= 798 shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)' 799 shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting 800 shared_cxx_post= 801 shared_lo=lo 802 803 php_build_target=program 804 ]) 805 806 dnl 807 dnl PHP_RUN_ONCE(namespace, variable, code) 808 dnl 809 dnl execute code, if variable is not set in namespace 810 dnl 811 AC_DEFUN([PHP_RUN_ONCE],[ 812 changequote({,}) 813 unique=`echo $2|sed 's/[^a-zA-Z0-9]/_/g'` 814 changequote([,]) 815 cmd="echo $ac_n \"\$$1$unique$ac_c\"" 816 if test -n "$unique" && test "`eval $cmd`" = "" ; then 817 eval "$1$unique=set" 818 $3 819 fi 820 ]) 821 822 dnl 823 dnl PHP_EXPAND_PATH(path, variable) 824 dnl 825 dnl expands path to an absolute path and assigns it to variable 826 dnl 827 AC_DEFUN([PHP_EXPAND_PATH],[ 828 if test -z "$1" || echo "$1" | grep '^/' >/dev/null ; then 829 $2=$1 830 else 831 changequote({,}) 832 ep_dir="`echo $1|sed 's%/*[^/][^/]*/*$%%'`" 833 changequote([,]) 834 ep_realdir="`(cd \"$ep_dir\" && pwd)`" 835 $2="$ep_realdir/`basename \"$1\"`" 836 fi 837 ]) 838 dnl 839 dnl internal, don't use 840 AC_DEFUN([_PHP_ADD_LIBPATH_GLOBAL],[ 841 PHP_RUN_ONCE(LIBPATH, $1, [ 842 test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$1" 843 LDFLAGS="$LDFLAGS -L$1" 844 PHP_RPATHS="$PHP_RPATHS $1" 845 ]) 846 ])dnl 847 dnl 848 dnl 849 dnl 850 dnl PHP_ADD_LIBPATH(path[, shared-libadd]) 851 dnl 852 dnl add a library to linkpath/runpath 853 dnl 854 AC_DEFUN([PHP_ADD_LIBPATH],[ 855 if test "$1" != "/usr/lib"; then 856 PHP_EXPAND_PATH($1, ai_p) 857 ifelse([$2],,[ 858 _PHP_ADD_LIBPATH_GLOBAL([$ai_p]) 859 ],[ 860 if test "$ext_shared" = "yes"; then 861 $2="$ld_runpath_switch$ai_p -L$ai_p [$]$2" 862 else 863 _PHP_ADD_LIBPATH_GLOBAL([$ai_p]) 864 fi 865 ]) 866 fi 867 ]) 868 869 dnl 870 dnl PHP_UTILIZE_RPATHS() 871 dnl 872 dnl builds RPATHS/LDFLAGS from PHP_RPATHS 873 dnl 874 AC_DEFUN([PHP_UTILIZE_RPATHS],[ 875 OLD_RPATHS=$PHP_RPATHS 876 unset PHP_RPATHS 877 878 for i in $OLD_RPATHS; do 879 dnl Can be passed to native cc/libtool 880 PHP_LDFLAGS="$PHP_LDFLAGS -L$i" 881 dnl Libtool-specific 882 PHP_RPATHS="$PHP_RPATHS -R $i" 883 dnl cc-specific 884 NATIVE_RPATHS="$NATIVE_RPATHS $ld_runpath_switch$i" 885 done 886 887 if test "$PHP_RPATH" = "no"; then 888 unset PHP_RPATHS 889 unset NATIVE_RPATHS 890 fi 891 ]) 892 893 dnl 894 dnl PHP_ADD_INCLUDE(path [,before]) 895 dnl 896 dnl add an include path. 897 dnl if before is 1, add in the beginning of INCLUDES. 898 dnl 899 AC_DEFUN([PHP_ADD_INCLUDE],[ 900 if test "$1" != "/usr/include"; then 901 PHP_EXPAND_PATH($1, ai_p) 902 PHP_RUN_ONCE(INCLUDEPATH, $ai_p, [ 903 if test "$2"; then 904 INCLUDES="-I$ai_p $INCLUDES" 905 else 906 INCLUDES="$INCLUDES -I$ai_p" 907 fi 908 ]) 909 fi 910 ]) 911 dnl 912 dnl internal, don't use 913 AC_DEFUN([_PHP_X_ADD_LIBRARY],[dnl 914 ifelse([$2],,$3="-l$1 [$]$3", $3="[$]$3 -l$1") dnl 915 ])dnl 916 dnl 917 dnl internal, don't use 918 AC_DEFUN([_PHP_ADD_LIBRARY_SKELETON],[ 919 case $1 in 920 c|c_r|pthread*[)] ;; 921 *[)] ifelse($3,,[ 922 _PHP_X_ADD_LIBRARY($1,$2,$5) 923 ],[ 924 if test "$ext_shared" = "yes"; then 925 _PHP_X_ADD_LIBRARY($1,$2,$3) 926 else 927 $4($1,$2) 928 fi 929 ]) ;; 930 esac 931 ])dnl 932 dnl 933 dnl 934 dnl 935 dnl PHP_ADD_LIBRARY(library[, append[, shared-libadd]]) 936 dnl 937 dnl add a library to the link line 938 dnl 939 AC_DEFUN([PHP_ADD_LIBRARY],[ 940 _PHP_ADD_LIBRARY_SKELETON([$1],[$2],[$3],[PHP_ADD_LIBRARY],[LIBS]) 941 ]) 942 943 dnl 944 dnl PHP_ADD_LIBRARY_DEFER(library[, append[, shared-libadd]]) 945 dnl 946 dnl add a library to the link line (deferred) 947 dnl 948 AC_DEFUN([PHP_ADD_LIBRARY_DEFER],[ 949 _PHP_ADD_LIBRARY_SKELETON([$1],[$2],[$3],[PHP_ADD_LIBRARY_DEFER],[DLIBS]) 950 ]) 951 952 dnl 953 dnl PHP_ADD_LIBRARY_WITH_PATH(library, path[, shared-libadd]) 954 dnl 955 dnl add a library to the link line and path to linkpath/runpath. 956 dnl if shared-libadd is not empty and $ext_shared is yes, 957 dnl shared-libadd will be assigned the library information 958 dnl 959 AC_DEFUN([PHP_ADD_LIBRARY_WITH_PATH],[ 960 ifelse($3,,[ 961 if test -n "$2"; then 962 PHP_ADD_LIBPATH($2) 963 fi 964 PHP_ADD_LIBRARY($1) 965 ],[ 966 if test "$ext_shared" = "yes"; then 967 $3="-l$1 [$]$3" 968 if test -n "$2"; then 969 PHP_ADD_LIBPATH($2,$3) 970 fi 971 else 972 PHP_ADD_LIBRARY_WITH_PATH($1,$2) 973 fi 974 ]) 975 ]) 976 977 dnl 978 dnl PHP_ADD_LIBRARY_DEFER_WITH_PATH(library, path[, shared-libadd]) 979 dnl 980 dnl add a library to the link line (deferred) 981 dnl and path to linkpath/runpath (not deferred) 982 dnl if shared-libadd is not empty and $ext_shared is yes, 983 dnl shared-libadd will be assigned the library information 984 dnl 985 AC_DEFUN([PHP_ADD_LIBRARY_DEFER_WITH_PATH],[ 986 ifelse($3,,[ 987 if test -n "$2"; then 988 PHP_ADD_LIBPATH($2) 989 fi 990 PHP_ADD_LIBRARY_DEFER($1) 991 ],[ 992 if test "$ext_shared" = "yes"; then 993 $3="-l$1 [$]$3" 994 if test -n "$2"; then 995 PHP_ADD_LIBPATH($2,$3) 996 fi 997 else 998 PHP_ADD_LIBRARY_DEFER_WITH_PATH($1,$2) 999 fi 1000 ]) 1001 ]) 1002 1003 dnl 1004 dnl PHP_ADD_FRAMEWORK(framework [,before]) 1005 dnl 1006 dnl add a (Darwin / Mac OS X) framework to the link 1007 dnl line. if before is 1, the framework is added 1008 dnl to the beginning of the line. 1009 1010 AC_DEFUN([PHP_ADD_FRAMEWORK], [ 1011 PHP_RUN_ONCE(FRAMEWORKS, $1, [ 1012 if test "$2"; then 1013 PHP_FRAMEWORKS="-framework $1 $PHP_FRAMEWORKS" 1014 else 1015 PHP_FRAMEWORKS="$PHP_FRAMEWORKS -framework $1" 1016 fi 1017 ]) 1018 ]) 1019 1020 dnl 1021 dnl PHP_ADD_FRAMEWORKPATH(path [,before]) 1022 dnl 1023 dnl add a (Darwin / Mac OS X) framework path to the link 1024 dnl and include lines. default paths include (but are 1025 dnl not limited to) /Local/Library/Frameworks and 1026 dnl /System/Library/Frameworks, so these don't need 1027 dnl to be specifically added. if before is 1, the 1028 dnl framework path is added to the beginning of the 1029 dnl relevant lines. 1030 1031 AC_DEFUN([PHP_ADD_FRAMEWORKPATH], [ 1032 PHP_EXPAND_PATH($1, ai_p) 1033 PHP_RUN_ONCE(FRAMEWORKPATH, $ai_p, [ 1034 if test "$2"; then 1035 PHP_FRAMEWORKPATH="-F$ai_p $PHP_FRAMEWORKPATH" 1036 else 1037 PHP_FRAMEWORKPATH="$PHP_FRAMEWORKPATH -F$ai_p" 1038 fi 1039 ]) 1040 ]) 1041 1042 dnl 1043 dnl PHP_ADD_FRAMEWORK_WITH_PATH(framework, path) 1044 dnl 1045 dnl add a (Darwin / Mac OS X) framework path and the 1046 dnl framework itself to the link and include lines. 1047 AC_DEFUN([PHP_ADD_FRAMEWORK_WITH_PATH], [ 1048 PHP_ADD_FRAMEWORKPATH($2) 1049 PHP_ADD_FRAMEWORK($1) 1050 ]) 1051 1052 dnl 1053 dnl Set libtool variable 1054 dnl 1055 AC_DEFUN([PHP_SET_LIBTOOL_VARIABLE],[ 1056 if test -z "$LIBTOOL"; then 1057 LIBTOOL='$(SHELL) $(top_builddir)/libtool $1' 1058 else 1059 LIBTOOL="$LIBTOOL $1" 1060 fi 1061 ]) 1062 1063 dnl 1064 dnl Check for cc option 1065 dnl 1066 AC_DEFUN([PHP_CHECK_CC_OPTION],[ 1067 echo "main(){return 0;}" > conftest.$ac_ext 1068 opt=$1 1069 changequote({,}) 1070 var=`echo $opt|sed 's/[^a-zA-Z0-9]/_/g'` 1071 changequote([,]) 1072 AC_MSG_CHECKING([if compiler supports -$1 really]) 1073 ac_php_compile="${CC-cc} -$opt -o conftest $CFLAGS $CPPFLAGS conftest.$ac_ext 2>&1" 1074 if eval $ac_php_compile 2>&1 | egrep "$opt" > /dev/null 2>&1 ; then 1075 eval php_cc_$var=no 1076 AC_MSG_RESULT([no]) 1077 else 1078 if eval ./conftest 2>/dev/null ; then 1079 eval php_cc_$var=yes 1080 AC_MSG_RESULT([yes]) 1081 else 1082 eval php_cc_$var=no 1083 AC_MSG_RESULT([no]) 1084 fi 1085 fi 1086 rm -rf conftest* 1087 ]) 1088 1089 1090 dnl 1091 dnl PHP_REGEX 1092 dnl 1093 AC_DEFUN([PHP_REGEX],[ 1094 if test "$REGEX_TYPE" = "php"; then 1095 AC_DEFINE(HAVE_REGEX_T_RE_MAGIC, 1, [ ]) 1096 AC_DEFINE(HSREGEX,1,[ ]) 1097 AC_DEFINE(REGEX,1,[ ]) 1098 PHP_ADD_SOURCES(regex, regcomp.c regexec.c regerror.c regfree.c) 1099 elif test "$REGEX_TYPE" = "system"; then 1100 AC_DEFINE(REGEX,0,[ ]) 1101 dnl Check if field re_magic exists in struct regex_t 1102 AC_CACHE_CHECK([whether field re_magic exists in struct regex_t], ac_cv_regex_t_re_magic, [ 1103 AC_TRY_COMPILE([#include <sys/types.h> 1104 #include <regex.h>], [regex_t rt; rt.re_magic;], 1105 [ac_cv_regex_t_re_magic=yes], [ac_cv_regex_t_re_magic=no]) 1106 ]) 1107 if test "$ac_cv_regex_t_re_magic" = "yes"; then 1108 AC_DEFINE([HAVE_REGEX_T_RE_MAGIC], [ ], 1) 1109 fi 1110 fi 1111 AC_MSG_CHECKING([which regex library to use]) 1112 AC_MSG_RESULT([$REGEX_TYPE]) 1113 ]) 1114 1115 1116 dnl 1117 dnl See if we have broken header files like SunOS has. 1118 dnl 1119 AC_DEFUN([PHP_MISSING_FCLOSE_DECL],[ 1120 AC_MSG_CHECKING([for fclose declaration]) 1121 AC_TRY_COMPILE([#include <stdio.h>],[int (*func)() = fclose],[ 1122 AC_DEFINE(MISSING_FCLOSE_DECL,0,[ ]) 1123 AC_MSG_RESULT([ok]) 1124 ],[ 1125 AC_DEFINE(MISSING_FCLOSE_DECL,1,[ ]) 1126 AC_MSG_RESULT([missing]) 1127 ]) 1128 ]) 1129 1130 dnl 1131 dnl Check for broken sprintf(), C99 conformance 1132 dnl 1133 AC_DEFUN([PHP_AC_BROKEN_SPRINTF],[ 1134 AC_CACHE_CHECK(whether sprintf is broken, ac_cv_broken_sprintf,[ 1135 AC_TRY_RUN([main() {char buf[20];exit(sprintf(buf,"testing 123")!=11); }],[ 1136 ac_cv_broken_sprintf=no 1137 ],[ 1138 ac_cv_broken_sprintf=yes 1139 ],[ 1140 ac_cv_broken_sprintf=no 1141 ]) 1142 ]) 1143 if test "$ac_cv_broken_sprintf" = "yes"; then 1144 AC_DEFINE(PHP_BROKEN_SPRINTF, 1, [Whether sprintf is C99 conform]) 1145 else 1146 AC_DEFINE(PHP_BROKEN_SPRINTF, 0, [Whether sprintf is C99 conform]) 1147 fi 1148 ]) 1149 1150 dnl 1151 dnl Check for broken snprintf(), C99 conformance 1152 dnl 1153 AC_DEFUN([PHP_AC_BROKEN_SNPRINTF],[ 1154 AC_CACHE_CHECK(whether snprintf is broken, ac_cv_broken_snprintf,[ 1155 AC_TRY_RUN([ 1156 #define NULL (0L) 1157 main() { 1158 char buf[20]; 1159 int res = 0; 1160 res = res || (snprintf(buf, 2, "marcus") != 6); 1161 res = res || (buf[1] != '\0'); 1162 /* Implementations may consider this as an encoding error */ 1163 snprintf(buf, 0, "boerger"); 1164 /* However, they MUST ignore the pointer */ 1165 res = res || (buf[0] != 'm'); 1166 res = res || (snprintf(NULL, 0, "boerger") != 7); 1167 res = res || (snprintf(buf, sizeof(buf), "%f", 0.12345678) != 8); 1168 exit(res); 1169 } 1170 ],[ 1171 ac_cv_broken_snprintf=no 1172 ],[ 1173 ac_cv_broken_snprintf=yes 1174 ],[ 1175 ac_cv_broken_snprintf=no 1176 ]) 1177 ]) 1178 if test "$ac_cv_broken_snprintf" = "yes"; then 1179 AC_DEFINE(PHP_BROKEN_SNPRINTF, 1, [Whether snprintf is C99 conform]) 1180 else 1181 AC_DEFINE(PHP_BROKEN_SNPRINTF, 0, [Whether snprintf is C99 conform]) 1182 fi 1183 ]) 1184 1185 dnl PHP_SHARED_MODULE(module-name, object-var, build-dir, cxx) 1186 dnl 1187 dnl Basically sets up the link-stage for building module-name 1188 dnl from object_var in build-dir. 1189 dnl 1190 AC_DEFUN([PHP_SHARED_MODULE],[ 1191 install_modules="install-modules" 1192 1193 case $host_alias in 1194 *darwin*[)] 1195 suffix=so 1196 link_cmd='ifelse($4,,[$(CC)],[$(CXX)]) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o [$]@ $(EXTRA_LDFLAGS) $($2) $(translit($1,a-z_-,A-Z__)_SHARED_LIBADD)' 1197 ;; 1198 *netware*[)] 1199 suffix=nlm 1200 link_cmd='$(LIBTOOL) --mode=link ifelse($4,,[$(CC)],[$(CXX)]) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o [$]@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $($2) $(translit($1,a-z_-,A-Z__)_SHARED_LIBADD)' 1201 ;; 1202 *[)] 1203 suffix=la 1204 link_cmd='$(LIBTOOL) --mode=link ifelse($4,,[$(CC)],[$(CXX)]) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o [$]@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $($2) $(translit($1,a-z_-,A-Z__)_SHARED_LIBADD)' 1205 ;; 1206 esac 1207 1208 PHP_MODULES="$PHP_MODULES \$(phplibdir)/$1.$suffix" 1209 PHP_SUBST($2) 1210 cat >>Makefile.objects<<EOF 1211 \$(phplibdir)/$1.$suffix: $3/$1.$suffix 1212 \$(LIBTOOL) --mode=install cp $3/$1.$suffix \$(phplibdir) 1213 1214 $3/$1.$suffix: \$($2) \$(translit($1,a-z_-,A-Z__)_SHARED_DEPENDENCIES) 1215 $link_cmd 1216 1217 EOF 1218 ]) 1219 1220 dnl 1221 dnl PHP_SELECT_SAPI(name, type[, sources [, extra-cflags [, build-target]]]) 1222 dnl 1223 dnl Selects the SAPI name and type (static, shared, programm) 1224 dnl and optionally also the source-files for the SAPI-specific 1225 dnl objects. 1226 dnl 1227 AC_DEFUN([PHP_SELECT_SAPI],[ 1228 PHP_SAPI=$1 1229 1230 case "$2" in 1231 static[)] PHP_BUILD_STATIC;; 1232 shared[)] PHP_BUILD_SHARED;; 1233 bundle[)] PHP_BUILD_BUNDLE;; 1234 program[)] PHP_BUILD_PROGRAM($5);; 1235 esac 1236 1237 ifelse($3,,,[PHP_ADD_SOURCES([sapi/$1],[$3],[$4],[sapi])]) 1238 ]) 1239 1240 dnl deprecated 1241 AC_DEFUN([PHP_EXTENSION],[ 1242 sources=`$AWK -f $abs_srcdir/build/scan_makefile_in.awk < []PHP_EXT_SRCDIR($1)[]/Makefile.in` 1243 1244 PHP_NEW_EXTENSION($1, $sources, $2, $3) 1245 1246 if test -r "$ext_srcdir/Makefile.frag"; then 1247 PHP_ADD_MAKEFILE_FRAGMENT 1248 fi 1249 ]) 1250 1251 AC_DEFUN([PHP_ADD_BUILD_DIR],[ 1252 BUILD_DIR="$BUILD_DIR $1" 1253 ]) 1254 1255 AC_DEFUN([PHP_GEN_BUILD_DIRS],[ 1256 $php_shtool mkdir -p $BUILD_DIR 1257 ]) 1258 1259 dnl 1260 dnl PHP_NEW_EXTENSION(extname, sources [, shared [,sapi_class[, extra-cflags[, cxx]]]]) 1261 dnl 1262 dnl Includes an extension in the build. 1263 dnl 1264 dnl "extname" is the name of the ext/ subdir where the extension resides. 1265 dnl "sources" is a list of files relative to the subdir which are used 1266 dnl to build the extension. 1267 dnl "shared" can be set to "shared" or "yes" to build the extension as 1268 dnl a dynamically loadable library. Optional parameter "sapi_class" can 1269 dnl be set to "cli" to mark extension build only with CLI or CGI sapi's. 1270 dnl extra-cflags are passed to the compiler, with @ext_srcdir@ being 1271 dnl substituted. 1272 AC_DEFUN([PHP_NEW_EXTENSION],[ 1273 ext_builddir=[]PHP_EXT_BUILDDIR($1) 1274 ext_srcdir=[]PHP_EXT_SRCDIR($1) 1275 1276 ifelse($5,,ac_extra=,[ac_extra=`echo "$5"|sed s#@ext_srcdir@#$ext_srcdir#g`]) 1277 1278 if test "$3" != "shared" && test "$3" != "yes" && test "$4" != "cli"; then 1279 dnl ---------------------------------------------- Static module 1280 1281 PHP_ADD_SOURCES(PHP_EXT_DIR($1),$2,$ac_extra,) 1282 EXT_STATIC="$EXT_STATIC $1" 1283 if test "$3" != "nocli"; then 1284 EXT_CLI_STATIC="$EXT_CLI_STATIC $1" 1285 fi 1286 else 1287 if test "$3" = "shared" || test "$3" = "yes"; then 1288 dnl ---------------------------------------------- Shared module 1289 PHP_ADD_SOURCES_X(PHP_EXT_DIR($1),$2,$ac_extra,shared_objects_$1,yes) 1290 case $host_alias in 1291 *netware*) 1292 PHP_ADD_LIBRARY_WITH_PATH(php5lib, netware, translit($1,a-z_-,A-Z__)_SHARED_LIBADD) 1293 ;; 1294 esac 1295 PHP_SHARED_MODULE($1,shared_objects_$1, $ext_builddir, $6) 1296 AC_DEFINE_UNQUOTED([COMPILE_DL_]translit($1,a-z_-,A-Z__), 1, Whether to build $1 as dynamic module) 1297 fi 1298 fi 1299 1300 if test "$3" != "shared" && test "$3" != "yes" && test "$4" = "cli"; then 1301 dnl ---------------------------------------------- CLI static module 1302 if test "$PHP_SAPI" = "cgi"; then 1303 PHP_ADD_SOURCES(PHP_EXT_DIR($1),$2,$ac_extra,) 1304 EXT_STATIC="$EXT_STATIC $1" 1305 else 1306 PHP_ADD_SOURCES(PHP_EXT_DIR($1),$2,$ac_extra,cli) 1307 fi 1308 EXT_CLI_STATIC="$EXT_CLI_STATIC $1" 1309 fi 1310 PHP_ADD_BUILD_DIR($ext_builddir) 1311 ]) 1312 1313 dnl 1314 dnl Solaris requires main code to be position independent in order 1315 dnl to let shared objects find symbols. Weird. Ugly. 1316 dnl 1317 dnl Must be run after all --with-NN options that let the user 1318 dnl choose dynamic extensions, and after the gcc test. 1319 dnl 1320 AC_DEFUN([PHP_SOLARIS_PIC_WEIRDNESS],[ 1321 AC_MSG_CHECKING([whether -fPIC is required]) 1322 if test -n "$EXT_SHARED"; then 1323 os=`uname -sr 2>/dev/null` 1324 case $os in 1325 "SunOS 5.6"|"SunOS 5.7"[)] 1326 case $CC in 1327 gcc*|egcs*) CFLAGS="$CFLAGS -fPIC";; 1328 *[)] CFLAGS="$CFLAGS -fpic";; 1329 esac 1330 AC_MSG_RESULT([yes]);; 1331 *[)] 1332 AC_MSG_RESULT([no]);; 1333 esac 1334 else 1335 AC_MSG_RESULT([no]) 1336 fi 1337 ]) 1338 1339 dnl 1340 dnl Checks whether $withval is "shared" or starts with "shared,XXX" 1341 dnl and sets $shared to "yes" or "no", and removes "shared,?" stuff 1342 dnl from $withval. 1343 dnl 1344 AC_DEFUN([PHP_WITH_SHARED],[ 1345 PHP_ARG_ANALYZE_EX(withval) 1346 shared=$ext_shared 1347 unset ext_shared ext_output 1348 ]) 1349 1350 dnl The problem is that the default compilation flags in Solaris 2.6 won't 1351 dnl let programs access large files; you need to tell the compiler that 1352 dnl you actually want your programs to work on large files. For more 1353 dnl details about this brain damage please see: 1354 dnl http://www.sas.com/standards/large.file/x_open.20Mar96.html 1355 1356 dnl Written by Paul Eggert <eggert@twinsun.com>. 1357 1358 AC_DEFUN([PHP_SYS_LFS], 1359 [dnl 1360 # If available, prefer support for large files unless the user specified 1361 # one of the CPPFLAGS, LDFLAGS, or LIBS variables. 1362 AC_MSG_CHECKING([whether large file support needs explicit enabling]) 1363 ac_getconfs='' 1364 ac_result=yes 1365 ac_set='' 1366 ac_shellvars='CPPFLAGS LDFLAGS LIBS' 1367 for ac_shellvar in $ac_shellvars; do 1368 case $ac_shellvar in 1369 CPPFLAGS[)] ac_lfsvar=LFS_CFLAGS ;; 1370 *[)] ac_lfsvar=LFS_$ac_shellvar ;; 1371 esac 1372 eval test '"${'$ac_shellvar'+set}"' = set && ac_set=$ac_shellvar 1373 (getconf $ac_lfsvar) >/dev/null 2>&1 || { ac_result=no; break; } 1374 ac_getconf=`getconf $ac_lfsvar` 1375 ac_getconfs=$ac_getconfs$ac_getconf 1376 eval ac_test_$ac_shellvar=\$ac_getconf 1377 done 1378 case "$ac_result$ac_getconfs" in 1379 yes[)] ac_result=no ;; 1380 esac 1381 case "$ac_result$ac_set" in 1382 yes?*[)] ac_result="yes, but $ac_set is already set, so use its settings" 1383 esac 1384 AC_MSG_RESULT([$ac_result]) 1385 case $ac_result in 1386 yes[)] 1387 for ac_shellvar in $ac_shellvars; do 1388 eval $ac_shellvar=\$ac_test_$ac_shellvar 1389 done ;; 1390 esac 1391 ]) 1392 1393 AC_DEFUN([PHP_SOCKADDR_SA_LEN],[ 1394 AC_CACHE_CHECK([for field sa_len in struct sockaddr],ac_cv_sockaddr_sa_len,[ 1395 AC_TRY_COMPILE([#include <sys/types.h> 1396 #include <sys/socket.h>], 1397 [struct sockaddr s; s.sa_len;], 1398 [ac_cv_sockaddr_sa_len=yes 1399 AC_DEFINE(HAVE_SOCKADDR_SA_LEN,1,[ ])], 1400 [ac_cv_sockaddr_sa_len=no]) 1401 ]) 1402 ]) 1403 1404 1405 dnl ## PHP_OUTPUT(file) 1406 dnl ## adds "file" to the list of files generated by AC_OUTPUT 1407 dnl ## This macro can be used several times. 1408 AC_DEFUN([PHP_OUTPUT],[ 1409 PHP_OUTPUT_FILES="$PHP_OUTPUT_FILES $1" 1410 ]) 1411 1412 AC_DEFUN([PHP_DECLARED_TIMEZONE],[ 1413 AC_CACHE_CHECK(for declared timezone, ac_cv_declared_timezone,[ 1414 AC_TRY_COMPILE([ 1415 #include <sys/types.h> 1416 #include <time.h> 1417 #ifdef HAVE_SYS_TIME_H 1418 #include <sys/time.h> 1419 #endif 1420 ],[ 1421 time_t foo = (time_t) timezone; 1422 ],[ 1423 ac_cv_declared_timezone=yes 1424 ],[ 1425 ac_cv_declared_timezone=no 1426 ])]) 1427 if test "$ac_cv_declared_timezone" = "yes"; then 1428 AC_DEFINE(HAVE_DECLARED_TIMEZONE, 1, [Whether system headers declare timezone]) 1429 fi 1430 ]) 1431 1432 AC_DEFUN([PHP_EBCDIC],[ 1433 AC_CACHE_CHECK([whether system uses EBCDIC],ac_cv_ebcdic,[ 1434 AC_TRY_RUN( [ 1435 int main(void) { 1436 return (unsigned char)'A' != (unsigned char)0xC1; 1437 } 1438 ],[ 1439 ac_cv_ebcdic=yes 1440 ],[ 1441 ac_cv_ebcdic=no 1442 ],[ 1443 ac_cv_ebcdic=no 1444 ])]) 1445 if test "$ac_cv_ebcdic" = "yes"; then 1446 AC_DEFINE(CHARSET_EBCDIC,1, [Define if system uses EBCDIC]) 1447 fi 1448 ]) 1449 1450 dnl Some systems, notably Solaris, cause getcwd() or realpath to fail if a 1451 dnl component of the path has execute but not read permissions 1452 AC_DEFUN([PHP_BROKEN_GETCWD],[ 1453 AC_MSG_CHECKING([for broken getcwd]) 1454 os=`uname -sr 2>/dev/null` 1455 case $os in 1456 SunOS*[)] 1457 AC_DEFINE(HAVE_BROKEN_GETCWD,1, [Define if system has broken getcwd]) 1458 AC_MSG_RESULT([yes]);; 1459 *[)] 1460 AC_MSG_RESULT([no]);; 1461 esac 1462 ]) 1463 1464 AC_DEFUN([PHP_BROKEN_GLIBC_FOPEN_APPEND],[ 1465 AC_MSG_CHECKING([for broken libc stdio]) 1466 AC_CACHE_VAL(have_broken_glibc_fopen_append,[ 1467 AC_TRY_RUN([ 1468 #include <stdio.h> 1469 int main(int argc, char *argv[]) 1470 { 1471 FILE *fp; 1472 long position; 1473 char *filename = "/tmp/phpglibccheck"; 1474 1475 fp = fopen(filename, "w"); 1476 if (fp == NULL) { 1477 perror("fopen"); 1478 exit(2); 1479 } 1480 fputs("foobar", fp); 1481 fclose(fp); 1482 1483 fp = fopen(filename, "a+"); 1484 position = ftell(fp); 1485 fclose(fp); 1486 unlink(filename); 1487 if (position == 0) 1488 return 1; 1489 return 0; 1490 } 1491 ], 1492 [have_broken_glibc_fopen_append=no], 1493 [have_broken_glibc_fopen_append=yes ], 1494 AC_TRY_COMPILE([ 1495 #include <features.h> 1496 ],[ 1497 #if !__GLIBC_PREREQ(2,2) 1498 choke me 1499 #endif 1500 ], 1501 [have_broken_glibc_fopen_append=yes], 1502 [have_broken_glibc_fopen_append=no ]) 1503 )]) 1504 1505 if test "$have_broken_glibc_fopen_append" = "yes"; then 1506 AC_MSG_RESULT(yes) 1507 AC_DEFINE(HAVE_BROKEN_GLIBC_FOPEN_APPEND,1, [Define if your glibc borks on fopen with mode a+]) 1508 else 1509 AC_MSG_RESULT(no) 1510 fi 1511 ]) 1512 1513 1514 AC_DEFUN([PHP_FOPENCOOKIE],[ 1515 AC_CHECK_FUNC(fopencookie, [ have_glibc_fopencookie=yes ]) 1516 1517 if test "$have_glibc_fopencookie" = "yes" ; then 1518 dnl this comes in two flavors: 1519 dnl newer glibcs (since 2.1.2 ? ) 1520 dnl have a type called cookie_io_functions_t 1521 AC_TRY_COMPILE([ #define _GNU_SOURCE 1522 #include <stdio.h> 1523 ], 1524 [ cookie_io_functions_t cookie; ], 1525 [ have_cookie_io_functions_t=yes ], 1526 [] ) 1527 1528 if test "$have_cookie_io_functions_t" = "yes" ; then 1529 cookie_io_functions_t=cookie_io_functions_t 1530 have_fopen_cookie=yes 1531 1532 dnl even newer glibcs have a different seeker definition... 1533 1534 AC_TRY_RUN([ 1535 #define _GNU_SOURCE 1536 #include <stdio.h> 1537 1538 struct cookiedata { 1539 __off64_t pos; 1540 }; 1541 1542 __ssize_t reader(void *cookie, char *buffer, size_t size) 1543 { return size; } 1544 __ssize_t writer(void *cookie, const char *buffer, size_t size) 1545 { return size; } 1546 int closer(void *cookie) 1547 { return 0; } 1548 int seeker(void *cookie, __off64_t *position, int whence) 1549 { ((struct cookiedata*)cookie)->pos = *position; return 0; } 1550 1551 cookie_io_functions_t funcs = {reader, writer, seeker, closer}; 1552 1553 main() { 1554 struct cookiedata g = { 0 }; 1555 FILE *fp = fopencookie(&g, "r", funcs); 1556 1557 if (fp && fseek(fp, 8192, SEEK_SET) == 0 && g.pos == 8192) 1558 exit(0); 1559 exit(1); 1560 } 1561 1562 ], 1563 [ cookie_io_functions_use_off64_t=yes ], 1564 [ ] ) 1565 1566 else 1567 dnl older glibc versions (up to 2.1.2 ?) 1568 dnl call it _IO_cookie_io_functions_t 1569 AC_TRY_COMPILE([ #define _GNU_SOURCE 1570 #include <stdio.h> 1571 ], 1572 [ _IO_cookie_io_functions_t cookie; ], 1573 [ have_IO_cookie_io_functions_t=yes ], 1574 [] ) 1575 if test "$have_cookie_io_functions_t" = "yes" ; then 1576 cookie_io_functions_t=_IO_cookie_io_functions_t 1577 have_fopen_cookie=yes 1578 fi 1579 fi 1580 1581 if test "$have_fopen_cookie" = "yes" ; then 1582 AC_DEFINE(HAVE_FOPENCOOKIE, 1, [ ]) 1583 AC_DEFINE_UNQUOTED(COOKIE_IO_FUNCTIONS_T, $cookie_io_functions_t, [ ]) 1584 if test "$cookie_io_functions_use_off64_t" = "yes" ; then 1585 AC_DEFINE(COOKIE_SEEKER_USES_OFF64_T, 1, [ ]) 1586 fi 1587 fi 1588 1589 fi 1590 ]) 1591 1592 1593 dnl 1594 dnl PHP_CHECK_LIBRARY(library, function [, action-found [, action-not-found [, extra-libs]]]) 1595 dnl 1596 dnl Wrapper for AC_CHECK_LIB 1597 dnl 1598 AC_DEFUN([PHP_CHECK_LIBRARY], [ 1599 save_old_LDFLAGS=$LDFLAGS 1600 ac_stuff="$5" 1601 1602 save_ext_shared=$ext_shared 1603 ext_shared=yes 1604 PHP_EVAL_LIBLINE([$]ac_stuff, LDFLAGS) 1605 AC_CHECK_LIB([$1],[$2],[ 1606 LDFLAGS=$save_old_LDFLAGS 1607 ext_shared=$save_ext_shared 1608 $3 1609 ],[ 1610 LDFLAGS=$save_old_LDFLAGS 1611 ext_shared=$save_ext_shared 1612 unset ac_cv_lib_$1[]_$2 1613 $4 1614 ])dnl 1615 ]) 1616 1617 dnl 1618 dnl PHP_CHECK_FRAMEWORK(framework, function [, action-found [, action-not-found ]]) 1619 dnl 1620 dnl El cheapo wrapper for AC_CHECK_LIB 1621 dnl 1622 AC_DEFUN([PHP_CHECK_FRAMEWORK], [ 1623 save_old_LDFLAGS=$LDFLAGS 1624 LDFLAGS="-framework $1 $LDFLAGS" 1625 dnl supplying "c" to AC_CHECK_LIB is technically cheating, but 1626 dnl rewriting AC_CHECK_LIB is overkill and this only affects 1627 dnl the "checking.." output anyway. 1628 AC_CHECK_LIB(c,[$2],[ 1629 LDFLAGS=$save_old_LDFLAGS 1630 $3 1631 ],[ 1632 LDFLAGS=$save_old_LDFLAGS 1633 $4 1634 ]) 1635 ]) 1636 1637 dnl 1638 dnl PHP_SETUP_KERBEROS(shared-add [, action-found [, action-not-found]]) 1639 dnl 1640 dnl Common setup macro for kerberos 1641 dnl 1642 AC_DEFUN([PHP_SETUP_KERBEROS],[ 1643 found_kerberos=no 1644 unset KERBEROS_CFLAGS 1645 unset KERBEROS_LIBS 1646 1647 dnl First try to find krb5-config 1648 if test -z "$KRB5_CONFIG"; then 1649 AC_PATH_PROG(KRB5_CONFIG, krb5-config, no, [$PATH:/usr/kerberos/bin:/usr/local/bin]) 1650 fi 1651 1652 dnl If krb5-config is found try using it 1653 if test "$PHP_KERBEROS" = "yes" && test -x "$KRB5_CONFIG"; then 1654 KERBEROS_LIBS=`$KRB5_CONFIG --libs gssapi` 1655 KERBEROS_CFLAGS=`$KRB5_CONFIG --cflags gssapi` 1656 1657 if test -n "$KERBEROS_LIBS" && test -n "$KERBEROS_CFLAGS"; then 1658 found_kerberos=yes 1659 PHP_EVAL_LIBLINE($KERBEROS_LIBS, $1) 1660 PHP_EVAL_INCLINE($KERBEROS_CFLAGS) 1661 fi 1662 fi 1663 1664 dnl If still not found use old skool method 1665 if test "$found_kerberos" = "no"; then 1666 1667 if test "$PHP_KERBEROS" = "yes"; then 1668 PHP_KERBEROS="/usr/kerberos /usr/local /usr" 1669 fi 1670 1671 for i in $PHP_KERBEROS; do 1672 if test -f $i/lib/libkrb5.a || test -f $i/lib/libkrb5.$SHLIB_SUFFIX_NAME; then 1673 PHP_KERBEROS_DIR=$i 1674 break 1675 fi 1676 done 1677 1678 if test "$PHP_KERBEROS_DIR"; then 1679 found_kerberos=yes 1680 PHP_ADD_LIBPATH($PHP_KERBEROS_DIR/lib, $1) 1681 PHP_ADD_LIBRARY(gssapi_krb5, 1, $1) 1682 PHP_ADD_LIBRARY(krb5, 1, $1) 1683 PHP_ADD_LIBRARY(k5crypto, 1, $1) 1684 PHP_ADD_LIBRARY(com_err, 1, $1) 1685 PHP_ADD_INCLUDE($PHP_KERBEROS_DIR/include) 1686 fi 1687 fi 1688 1689 if test "$found_kerberos" = "yes"; then 1690 ifelse([$2],[],:,[$2]) 1691 ifelse([$3],[],,[else $3]) 1692 fi 1693 ]) 1694 1695 dnl 1696 dnl PHP_SETUP_OPENSSL(shared-add [, action-found [, action-not-found]]) 1697 dnl 1698 dnl Common setup macro for openssl 1699 dnl 1700 AC_DEFUN([PHP_SETUP_OPENSSL],[ 1701 found_openssl=no 1702 unset OPENSSL_INCDIR 1703 unset OPENSSL_LIBDIR 1704 1705 dnl Empty variable means 'no' 1706 test -z "$PHP_OPENSSL" && PHP_OPENSSL=no 1707 test -z "$PHP_IMAP_SSL" && PHP_IMAP_SSL=no 1708 1709 dnl Fallbacks for different configure options 1710 if test "$PHP_OPENSSL" != "no"; then 1711 PHP_OPENSSL_DIR=$PHP_OPENSSL 1712 elif test "$PHP_IMAP_SSL" != "no"; then 1713 PHP_OPENSSL_DIR=$PHP_IMAP_SSL 1714 fi 1715 1716 dnl First try to find pkg-config 1717 if test -z "$PKG_CONFIG"; then 1718 AC_PATH_PROG(PKG_CONFIG, pkg-config, no) 1719 fi 1720 1721 dnl If pkg-config is found try using it 1722 if test "$PHP_OPENSSL_DIR" = "yes" && test -x "$PKG_CONFIG" && $PKG_CONFIG --exists openssl; then 1723 if $PKG_CONFIG --atleast-version=0.9.6 openssl; then 1724 found_openssl=yes 1725 OPENSSL_LIBS=`$PKG_CONFIG --libs openssl` 1726 OPENSSL_INCS=`$PKG_CONFIG --cflags-only-I openssl` 1727 OPENSSL_INCDIR=`$PKG_CONFIG --variable=includedir openssl` 1728 else 1729 AC_MSG_ERROR([OpenSSL version 0.9.6 or greater required.]) 1730 fi 1731 1732 if test -n "$OPENSSL_LIBS" && test -n "$OPENSSL_INCS"; then 1733 PHP_EVAL_LIBLINE($OPENSSL_LIBS, $1) 1734 PHP_EVAL_INCLINE($OPENSSL_INCS) 1735 fi 1736 fi 1737 1738 dnl If pkg-config fails for some reason, revert to the old method 1739 if test "$found_openssl" = "no"; then 1740 1741 if test "$PHP_OPENSSL_DIR" = "yes"; then 1742 PHP_OPENSSL_DIR="/usr/local/ssl /usr/local /usr /usr/local/openssl" 1743 fi 1744 1745 for i in $PHP_OPENSSL_DIR; do 1746 if test -r $i/include/openssl/evp.h; then 1747 OPENSSL_INCDIR=$i/include 1748 fi 1749 if test -r $i/lib/libssl.a -o -r $i/lib/libssl.$SHLIB_SUFFIX_NAME; then 1750 OPENSSL_LIBDIR=$i/lib 1751 fi 1752 test -n "$OPENSSL_INCDIR" && test -n "$OPENSSL_LIBDIR" && break 1753 done 1754 1755 if test -z "$OPENSSL_INCDIR"; then 1756 AC_MSG_ERROR([Cannot find OpenSSL's <evp.h>]) 1757 fi 1758 1759 if test -z "$OPENSSL_LIBDIR"; then 1760 AC_MSG_ERROR([Cannot find OpenSSL's libraries]) 1761 fi 1762 1763 old_CPPFLAGS=$CPPFLAGS 1764 CPPFLAGS=-I$OPENSSL_INCDIR 1765 AC_MSG_CHECKING([for OpenSSL version]) 1766 AC_EGREP_CPP(yes,[ 1767 #include <openssl/opensslv.h> 1768 #if OPENSSL_VERSION_NUMBER >= 0x0090600fL 1769 yes 1770 #endif 1771 ],[ 1772 AC_MSG_RESULT([>= 0.9.6]) 1773 ],[ 1774 AC_MSG_ERROR([OpenSSL version 0.9.6 or greater required.]) 1775 ]) 1776 CPPFLAGS=$old_CPPFLAGS 1777 1778 PHP_ADD_INCLUDE($OPENSSL_INCDIR) 1779 1780 PHP_CHECK_LIBRARY(crypto, CRYPTO_free, [ 1781 PHP_ADD_LIBRARY(crypto,,$1) 1782 ],[ 1783 AC_MSG_ERROR([libcrypto not found!]) 1784 ],[ 1785 -L$OPENSSL_LIBDIR 1786 ]) 1787 1788 old_LIBS=$LIBS 1789 LIBS="$LIBS -lcrypto" 1790 PHP_CHECK_LIBRARY(ssl, SSL_CTX_set_ssl_version, [ 1791 found_openssl=yes 1792 ],[ 1793 AC_MSG_ERROR([libssl not found!]) 1794 ],[ 1795 -L$OPENSSL_LIBDIR 1796 ]) 1797 LIBS=$old_LIBS 1798 PHP_ADD_LIBRARY(ssl,,$1) 1799 1800 PHP_ADD_LIBPATH($OPENSSL_LIBDIR, $1) 1801 fi 1802 1803 if test "$found_openssl" = "yes"; then 1804 dnl For apache 1.3.x static build 1805 OPENSSL_INCDIR_OPT=-I$OPENSSL_INCDIR 1806 AC_SUBST(OPENSSL_INCDIR_OPT) 1807 1808 ifelse([$2],[],:,[$2]) 1809 ifelse([$3],[],,[else $3]) 1810 fi 1811 ]) 1812 1813 dnl 1814 dnl PHP_SETUP_ICONV(shared-add [, action-found [, action-not-found]]) 1815 dnl 1816 dnl Common setup macro for iconv 1817 dnl 1818 AC_DEFUN([PHP_SETUP_ICONV], [ 1819 found_iconv=no 1820 unset ICONV_DIR 1821 1822 # Create the directories for a VPATH build: 1823 test -d ext || mkdir ext 1824 test -d ext/iconv || mkdir ext/iconv 1825 1826 echo > ext/iconv/php_have_bsd_iconv.h 1827 echo > ext/iconv/php_have_glibc_iconv.h 1828 echo > ext/iconv/php_have_libiconv.h 1829 echo > ext/iconv/php_have_iconv.h 1830 echo > ext/iconv/php_php_iconv_impl.h 1831 echo > ext/iconv/php_php_iconv_h_path.h 1832 echo > ext/iconv/php_iconv_supports_errno.h 1833 1834 dnl 1835 dnl Check libc first if no path is provided in --with-iconv 1836 dnl 1837 if test "$PHP_ICONV" = "yes"; then 1838 AC_CHECK_FUNC(iconv, [ 1839 PHP_DEFINE(HAVE_ICONV,1,[ext/iconv]) 1840 found_iconv=yes 1841 ],[ 1842 AC_CHECK_FUNC(libiconv,[ 1843 PHP_DEFINE(HAVE_LIBICONV,1,[ext/iconv]) 1844 found_iconv=yes 1845 ]) 1846 ]) 1847 fi 1848 1849 dnl 1850 dnl Check external libs for iconv funcs 1851 dnl 1852 if test "$found_iconv" = "no"; then 1853 1854 for i in $PHP_ICONV /usr/local /usr; do 1855 if test -r $i/include/giconv.h; then 1856 AC_DEFINE(HAVE_GICONV_H, 1, [ ]) 1857 ICONV_DIR=$i 1858 iconv_lib_name=giconv 1859 break 1860 elif test -r $i/include/iconv.h; then 1861 ICONV_DIR=$i 1862 iconv_lib_name=iconv 1863 break 1864 fi 1865 done 1866 1867 if test -z "$ICONV_DIR"; then 1868 AC_MSG_ERROR([Please specify the install prefix of iconv with --with-iconv=<DIR>]) 1869 fi 1870 1871 if test -f $ICONV_DIR/lib/lib$iconv_lib_name.a || 1872 test -f $ICONV_DIR/lib/lib$iconv_lib_name.$SHLIB_SUFFIX_NAME 1873 then 1874 PHP_CHECK_LIBRARY($iconv_lib_name, libiconv, [ 1875 found_iconv=yes 1876 PHP_DEFINE(HAVE_LIBICONV,1,[ext/iconv]) 1877 ], [ 1878 PHP_CHECK_LIBRARY($iconv_lib_name, iconv, [ 1879 found_iconv=yes 1880 PHP_DEFINE(HAVE_ICONV,1,[ext/iconv]) 1881 ], [], [ 1882 -L$ICONV_DIR/lib 1883 ]) 1884 ], [ 1885 -L$ICONV_DIR/lib 1886 ]) 1887 fi 1888 fi 1889 1890 if test "$found_iconv" = "yes"; then 1891 if test -n "$ICONV_DIR"; then 1892 AC_DEFINE(HAVE_ICONV, 1, [ ]) 1893 PHP_ADD_LIBRARY_WITH_PATH($iconv_lib_name, $ICONV_DIR/lib, $1) 1894 PHP_ADD_INCLUDE($ICONV_DIR/include) 1895 fi 1896 $2 1897 ifelse([$3],[],,[else $3]) 1898 fi 1899 ]) 1900 1901 dnl 1902 dnl PHP_SETUP_LIBXML(shared-add [, action-found [, action-not-found]]) 1903 dnl 1904 dnl Common setup macro for libxml 1905 dnl 1906 AC_DEFUN([PHP_SETUP_LIBXML], [ 1907 1908 for i in $PHP_LIBXML_DIR /usr/local /usr; do 1909 if test -x "$i/bin/xml2-config"; then 1910 XML2_CONFIG="$i/bin/xml2-config" 1911 break 1912 fi 1913 done 1914 1915 if test -x "$XML2_CONFIG"; then 1916 libxml_full_version=`$XML2_CONFIG --version` 1917 ac_IFS=$IFS 1918 IFS="." 1919 set $libxml_full_version 1920 IFS=$ac_IFS 1921 LIBXML_VERSION=`expr [$]1 \* 1000000 + [$]2 \* 1000 + [$]3` 1922 if test "$LIBXML_VERSION" -ge "2005010"; then 1923 LIBXML_LIBS=`$XML2_CONFIG --libs` 1924 LIBXML_INCS=`$XML2_CONFIG --cflags` 1925 PHP_EVAL_LIBLINE($LIBXML_LIBS, $1) 1926 PHP_EVAL_INCLINE($LIBXML_INCS) 1927 1928 dnl Check that build works with given libs 1929 AC_CACHE_CHECK(whether libxml build works, php_cv_libxml_build_works, [ 1930 PHP_TEST_BUILD(xmlInitParser, 1931 [ 1932 php_cv_libxml_build_works=yes 1933 ], [ 1934 AC_MSG_RESULT(no) 1935 AC_MSG_ERROR([build test failed. Please check the config.log for details.]) 1936 ], [ 1937 [$]$1 1938 ]) 1939 ]) 1940 if test "$php_cv_libxml_build_works" = "yes"; then 1941 AC_DEFINE(HAVE_LIBXML, 1, [ ]) 1942 fi 1943 $2 1944 else 1945 AC_MSG_ERROR([libxml2 version 2.5.10 or greater required.]) 1946 fi 1947 ifelse([$3],[],,[else $3]) 1948 fi 1949 ]) 1950 1951 AC_DEFUN([PHP_DEF_HAVE],[AC_DEFINE([HAVE_]translit($1,a-z_-,A-Z__), 1, [ ])]) 1952 1953 dnl 1954 dnl PHP_CHECK_FUNC_LIB(func, libs) 1955 dnl This macro checks whether 'func' or '__func' exists 1956 dnl in the specified library. 1957 dnl Defines HAVE_func and HAVE_library if found and adds the library to LIBS. 1958 dnl This should be called in the ACTION-IF-NOT-FOUND part of PHP_CHECK_FUNC 1959 dnl 1960 1961 dnl autoconf undefines the builtin "shift" :-( 1962 dnl If possible, we use the builtin shift anyway, otherwise we use 1963 dnl the ubercool definition I have tested so far with FreeBSD/GNU m4 1964 ifdef([builtin],[builtin(define, phpshift, [builtin(shift, $@)])],[ 1965 define([phpshift],[ifelse(index([$@],[,]),-1,,[substr([$@],incr(index([$@],[,])))])]) 1966 ]) 1967 1968 AC_DEFUN([PHP_CHECK_FUNC_LIB],[ 1969 ifelse($2,,:,[ 1970 unset ac_cv_lib_$2[]_$1 1971 unset ac_cv_lib_$2[]___$1 1972 unset found 1973 AC_CHECK_LIB($2, $1, [found=yes], [ 1974 AC_CHECK_LIB($2, __$1, [found=yes], [found=no]) 1975 ]) 1976 1977 if test "$found" = "yes"; then 1978 ac_libs=$LIBS 1979 LIBS="$LIBS -l$2" 1980 AC_TRY_RUN([main() { return (0); }],[found=yes],[found=no],[found=no]) 1981 LIBS=$ac_libs 1982 fi 1983 1984 if test "$found" = "yes"; then 1985 PHP_ADD_LIBRARY($2) 1986 PHP_DEF_HAVE($1) 1987 PHP_DEF_HAVE(lib$2) 1988 ac_cv_func_$1=yes 1989 else 1990 PHP_CHECK_FUNC_LIB($1,phpshift(phpshift($@))) 1991 fi 1992 ]) 1993 ]) 1994 1995 dnl 1996 dnl PHP_CHECK_FUNC(func, ...) 1997 dnl This macro checks whether 'func' or '__func' exists 1998 dnl in the default libraries and as a fall back in the specified library. 1999 dnl Defines HAVE_func and HAVE_library if found and adds the library to LIBS. 2000 dnl 2001 AC_DEFUN([PHP_CHECK_FUNC],[ 2002 unset ac_cv_func_$1 2003 unset ac_cv_func___$1 2004 unset found 2005 2006 AC_CHECK_FUNC($1, [found=yes],[ AC_CHECK_FUNC(__$1,[found=yes],[found=no]) ]) 2007 2008 case $found in 2009 yes[)] 2010 PHP_DEF_HAVE($1) 2011 ac_cv_func_$1=yes 2012 ;; 2013 ifelse($#,1,,[ 2014 *[)] PHP_CHECK_FUNC_LIB($@) ;; 2015 ]) 2016 esac 2017 ]) 2018 2019 dnl 2020 dnl PHP_AP_EXTRACT_VERSION(/path/httpd) 2021 dnl This macro is used to get a comparable 2022 dnl version for apache1/2. 2023 dnl 2024 AC_DEFUN([PHP_AP_EXTRACT_VERSION],[ 2025 ac_output=`$1 -v 2>&1` 2026 ac_IFS=$IFS 2027 IFS="- /. 2028 " 2029 set $ac_output 2030 IFS=$ac_IFS 2031 2032 APACHE_VERSION=`expr [$]4 \* 1000000 + [$]5 \* 1000 + [$]6` 2033 ]) 2034 2035 dnl 2036 dnl PHP_TEST_BUILD(function, action-if-ok, action-if-not-ok [, extra-libs [, extra-source]]) 2037 dnl This macro checks whether build works and given function exists. 2038 dnl 2039 AC_DEFUN([PHP_TEST_BUILD], [ 2040 old_LIBS=$LIBS 2041 LIBS="$4 $LIBS" 2042 AC_TRY_RUN([ 2043 $5 2044 char $1(); 2045 int main() { 2046 $1(); 2047 return 0; 2048 } 2049 ], [ 2050 LIBS=$old_LIBS 2051 $2 2052 ],[ 2053 LIBS=$old_LIBS 2054 $3 2055 ],[ 2056 LIBS=$old_LIBS 2057 ]) 2058 ]) 2059 2060 dnl This macro is currently a placeholder in the config.m4 file 2061 dnl it is scanned by genif.sh when it builds the internal functions 2062 dnl list, so that modules can be init'd in the correct order 2063 dnl $1 = name of extension, $2 = extension upon which it depends 2064 dnl $3 = optional: if true, it's ok for $2 to have not been configured 2065 dnl default is false and should halt the build. 2066 dnl See ADD_EXTENSION_DEP in win32 build 2067 AC_DEFUN([PHP_ADD_EXTENSION_DEP], []) 2068 2069 2070 dnl 2071 dnl PHP_C_BIGENDIAN 2072 dnl Replacement macro for AC_C_BIGENDIAN 2073 dnl 2074 AC_DEFUN([PHP_C_BIGENDIAN], 2075 [AC_CACHE_CHECK([whether byte ordering is bigendian], ac_cv_c_bigendian_php, 2076 [ 2077 ac_cv_c_bigendian_php=unknown 2078 AC_TRY_RUN( 2079 [ 2080 int main(void) 2081 { 2082 short one = 1; 2083 char *cp = (char *)&one; 2084 2085 if (*cp == 0) { 2086 return(0); 2087 } else { 2088 return(1); 2089 } 2090 } 2091 ], [ac_cv_c_bigendian_php=yes], [ac_cv_c_bigendian_php=no], [ac_cv_c_bigendian_php=unknown]) 2092 ]) 2093 if test $ac_cv_c_bigendian_php = yes; then 2094 AC_DEFINE(WORDS_BIGENDIAN, [], [Define if processor uses big-endian word]) 2095 fi 2096 ]) 2097 2098 dnl 2099 dnl PHP_CHECK_PDO_INCLUDES([found [, not-found]]) 2100 dnl 2101 AC_DEFUN([PHP_CHECK_PDO_INCLUDES],[ 2102 AC_CACHE_CHECK([for PDO includes], pdo_inc_path, [ 2103 AC_MSG_CHECKING([for PDO includes]) 2104 if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then 2105 pdo_inc_path=$abs_srcdir/ext 2106 elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then 2107 pdo_inc_path=$abs_srcdir/ext 2108 elif test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then 2109 pdo_inc_path=$prefix/include/php/ext 2110 fi 2111 ]) 2112 if test -n "$pdo_inc_path"; then 2113 ifelse([$1],[],:,[$1]) 2114 else 2115 ifelse([$2],[],[AC_MSG_ERROR([Cannot find php_pdo_driver.h.])],[$2]) 2116 fi 2117 ]) 2118 # libtool.m4 - Configure libtool for the host system. -*-Shell-script-*- 2119 ## Copyright 1996, 1997, 1998, 1999, 2000, 2001 2120 ## Free Software Foundation, Inc. 2121 ## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 2122 ## 2123 ## This program is free software; you can redistribute it and/or modify 2124 ## it under the terms of the GNU General Public License as published by 2125 ## the Free Software Foundation; either version 2 of the License, or 2126 ## (at your option) any later version. 2127 ## 2128 ## This program is distributed in the hope that it will be useful, but 2129 ## WITHOUT ANY WARRANTY; without even the implied warranty of 2130 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 2131 ## General Public License for more details. 2132 ## 2133 ## You should have received a copy of the GNU General Public License 2134 ## along with this program; if not, write to the Free Software 2135 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 2136 ## 2137 ## As a special exception to the GNU General Public License, if you 2138 ## distribute this file as part of a program that contains a 2139 ## configuration script generated by Autoconf, you may include it under 2140 ## the same distribution terms that you use for the rest of that program. 2141 2142 # serial 46 AC_PROG_LIBTOOL 2143 2144 AC_DEFUN([AC_PROG_LIBTOOL], 2145 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl 2146 2147 # This can be used to rebuild libtool when needed 2148 LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" 2149 2150 # Always use our own libtool. 2151 LIBTOOL='$(SHELL) $(top_builddir)/libtool' 2152 AC_SUBST(LIBTOOL)dnl 2153 2154 # Prevent multiple expansion 2155 define([AC_PROG_LIBTOOL], []) 2156 ]) 2157 2158 AC_DEFUN([AC_LIBTOOL_SETUP], 2159 [AC_PREREQ(2.13)dnl 2160 AC_REQUIRE([AC_ENABLE_SHARED])dnl 2161 AC_REQUIRE([AC_ENABLE_STATIC])dnl 2162 AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl 2163 AC_REQUIRE([AC_CANONICAL_HOST])dnl 2164 AC_REQUIRE([AC_CANONICAL_BUILD])dnl 2165 AC_REQUIRE([AC_PROG_CC])dnl 2166 AC_REQUIRE([AC_PROG_LD])dnl 2167 AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl 2168 AC_REQUIRE([AC_PROG_NM])dnl 2169 AC_REQUIRE([LT_AC_PROG_SED])dnl 2170 2171 AC_REQUIRE([AC_PROG_LN_S])dnl 2172 AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl 2173 AC_REQUIRE([AC_OBJEXT])dnl 2174 AC_REQUIRE([AC_EXEEXT])dnl 2175 dnl 2176 2177 _LT_AC_PROG_ECHO_BACKSLASH 2178 # Only perform the check for file, if the check method requires it 2179 case $deplibs_check_method in 2180 file_magic*) 2181 if test "$file_magic_cmd" = '$MAGIC_CMD'; then 2182 AC_PATH_MAGIC 2183 fi 2184 ;; 2185 esac 2186 2187 AC_CHECK_TOOL(RANLIB, ranlib, :) 2188 AC_CHECK_TOOL(STRIP, strip, :) 2189 2190 ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) 2191 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], 2192 enable_win32_dll=yes, enable_win32_dll=no) 2193 2194 AC_ARG_ENABLE(libtool-lock, 2195 [ --disable-libtool-lock avoid locking (might break parallel builds)]) 2196 test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes 2197 2198 # Some flags need to be propagated to the compiler or linker for good 2199 # libtool support. 2200 case $host in 2201 *-*-irix6*) 2202 # Find out which ABI we are using. 2203 echo '[#]line __oline__ "configure"' > conftest.$ac_ext 2204 if AC_TRY_EVAL(ac_compile); then 2205 case `/usr/bin/file conftest.$ac_objext` in 2206 *32-bit*) 2207 LD="${LD-ld} -32" 2208 ;; 2209 *N32*) 2210 LD="${LD-ld} -n32" 2211 ;; 2212 *64-bit*) 2213 LD="${LD-ld} -64" 2214 ;; 2215 esac 2216 fi 2217 rm -rf conftest* 2218 ;; 2219 2220 *-*-sco3.2v5*) 2221 # On SCO OpenServer 5, we need -belf to get full-featured binaries. 2222 SAVE_CFLAGS="$CFLAGS" 2223 CFLAGS="$CFLAGS -belf" 2224 AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, 2225 [AC_LANG_SAVE 2226 AC_LANG_C 2227 AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) 2228 AC_LANG_RESTORE]) 2229 if test x"$lt_cv_cc_needs_belf" != x"yes"; then 2230 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf 2231 CFLAGS="$SAVE_CFLAGS" 2232 fi 2233 ;; 2234 2235 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], 2236 [*-*-cygwin* | *-*-mingw* | *-*-pw32*) 2237 AC_CHECK_TOOL(DLLTOOL, dlltool, false) 2238 AC_CHECK_TOOL(AS, as, false) 2239 AC_CHECK_TOOL(OBJDUMP, objdump, false) 2240 2241 # recent cygwin and mingw systems supply a stub DllMain which the user 2242 # can override, but on older systems we have to supply one 2243 AC_CACHE_CHECK([if libtool should supply DllMain function], lt_cv_need_dllmain, 2244 [AC_TRY_LINK([], 2245 [extern int __attribute__((__stdcall__)) DllMain(void*, int, void*); 2246 DllMain (0, 0, 0);], 2247 [lt_cv_need_dllmain=no],[lt_cv_need_dllmain=yes])]) 2248 2249 case $host/$CC in 2250 *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*) 2251 # old mingw systems require "-dll" to link a DLL, while more recent ones 2252 # require "-mdll" 2253 SAVE_CFLAGS="$CFLAGS" 2254 CFLAGS="$CFLAGS -mdll" 2255 AC_CACHE_CHECK([how to link DLLs], lt_cv_cc_dll_switch, 2256 [AC_TRY_LINK([], [], [lt_cv_cc_dll_switch=-mdll],[lt_cv_cc_dll_switch=-dll])]) 2257 CFLAGS="$SAVE_CFLAGS" ;; 2258 *-*-cygwin* | *-*-pw32*) 2259 # cygwin systems need to pass --dll to the linker, and not link 2260 # crt.o which will require a WinMain@16 definition. 2261 lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;; 2262 esac 2263 ;; 2264 ]) 2265 esac 2266 2267 _LT_AC_LTCONFIG_HACK 2268 2269 ]) 2270 2271 # AC_LIBTOOL_HEADER_ASSERT 2272 # ------------------------ 2273 AC_DEFUN([AC_LIBTOOL_HEADER_ASSERT], 2274 [AC_CACHE_CHECK([whether $CC supports assert without backlinking], 2275 [lt_cv_func_assert_works], 2276 [case $host in 2277 *-*-solaris*) 2278 if test "$GCC" = yes && test "$with_gnu_ld" != yes; then 2279 case `$CC --version 2>/dev/null` in 2280 [[12]].*) lt_cv_func_assert_works=no ;; 2281 *) lt_cv_func_assert_works=yes ;; 2282 esac 2283 fi 2284 ;; 2285 esac]) 2286 2287 if test "x$lt_cv_func_assert_works" = xyes; then 2288 AC_CHECK_HEADERS(assert.h) 2289 fi 2290 ])# AC_LIBTOOL_HEADER_ASSERT 2291 2292 # _LT_AC_CHECK_DLFCN 2293 # -------------------- 2294 AC_DEFUN([_LT_AC_CHECK_DLFCN], 2295 [AC_CHECK_HEADERS(dlfcn.h) 2296 ])# _LT_AC_CHECK_DLFCN 2297 2298 # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE 2299 # --------------------------------- 2300 AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], 2301 [AC_REQUIRE([AC_CANONICAL_HOST]) 2302 AC_REQUIRE([AC_PROG_NM]) 2303 AC_REQUIRE([AC_OBJEXT]) 2304 # Check for command to grab the raw symbol name followed by C symbol from nm. 2305 AC_MSG_CHECKING([command to parse $NM output]) 2306 AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [dnl 2307 2308 # These are sane defaults that work on at least a few old systems. 2309 # [They come from Ultrix. What could be older than Ultrix?!! ;)] 2310 2311 # Character class describing NM global symbol codes. 2312 symcode='[[BCDEGRST]]' 2313 2314 # Regexp to match symbols that can be accessed directly from C. 2315 sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' 2316 2317 # Transform the above into a raw symbol and a C symbol. 2318 symxfrm='\1 \2\3 \3' 2319 2320 # Transform an extracted symbol line into a proper C declaration 2321 lt_cv_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'" 2322 2323 # Transform an extracted symbol line into symbol name and symbol address 2324 lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" 2325 2326 # Define system-specific variables. 2327 case $host_os in 2328 aix*) 2329 symcode='[[BCDT]]' 2330 ;; 2331 cygwin* | mingw* | pw32*) 2332 symcode='[[ABCDGISTW]]' 2333 ;; 2334 hpux*) # Its linker distinguishes data from code symbols 2335 lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" 2336 lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" 2337 ;; 2338 irix* | nonstopux*) 2339 symcode='[[BCDEGRST]]' 2340 ;; 2341 osf*) 2342 symcode='[[BCDEGQRST]]' 2343 ;; 2344 solaris* | sysv5*) 2345 symcode='[[BDT]]' 2346 ;; 2347 sysv4) 2348 symcode='[[DFNSTU]]' 2349 ;; 2350 esac 2351 2352 # Handle CRLF in mingw tool chain 2353 opt_cr= 2354 case $host_os in 2355 mingw*) 2356 opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp 2357 ;; 2358 esac 2359 2360 # If we're using GNU nm, then use its standard symbol codes. 2361 if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then 2362 symcode='[[ABCDGISTW]]' 2363 fi 2364 2365 # Try without a prefix undercore, then with it. 2366 for ac_symprfx in "" "_"; do 2367 2368 # Write the raw and C identifiers. 2369 lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'" 2370 2371 # Check to see that the pipe works correctly. 2372 pipe_works=no 2373 rm -f conftest* 2374 cat > conftest.$ac_ext <<EOF 2375 #ifdef __cplusplus 2376 extern "C" { 2377 #endif 2378 char nm_test_var; 2379 void nm_test_func(){} 2380 #ifdef __cplusplus 2381 } 2382 #endif 2383 int main(){nm_test_var='a';nm_test_func();return(0);} 2384 EOF 2385 2386 if AC_TRY_EVAL(ac_compile); then 2387 # Now try to grab the symbols. 2388 nlist=conftest.nm 2389 if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then 2390 # Try sorting and uniquifying the output. 2391 if sort "$nlist" | uniq > "$nlist"T; then 2392 mv -f "$nlist"T "$nlist" 2393 else 2394 rm -f "$nlist"T 2395 fi 2396 2397 # Make sure that we snagged all the symbols we need. 2398 if egrep ' nm_test_var$' "$nlist" >/dev/null; then 2399 if egrep ' nm_test_func$' "$nlist" >/dev/null; then 2400 cat <<EOF > conftest.$ac_ext 2401 #ifdef __cplusplus 2402 extern "C" { 2403 #endif 2404 2405 EOF 2406 # Now generate the symbol file. 2407 eval "$lt_cv_global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext' 2408 2409 cat <<EOF >> conftest.$ac_ext 2410 #if defined (__STDC__) && __STDC__ 2411 # define lt_ptr void * 2412 #else 2413 # define lt_ptr char * 2414 # define const 2415 #endif 2416 2417 /* The mapping between symbol names and symbols. */ 2418 const struct { 2419 const char *name; 2420 lt_ptr address; 2421 } 2422 lt_preloaded_symbols[[]] = 2423 { 2424 EOF 2425 sed "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr) \&\2},/" < "$nlist" >> conftest.$ac_ext 2426 cat <<\EOF >> conftest.$ac_ext 2427 {0, (lt_ptr) 0} 2428 }; 2429 2430 #ifdef __cplusplus 2431 } 2432 #endif 2433 EOF 2434 # Now try linking the two files. 2435 mv conftest.$ac_objext conftstm.$ac_objext 2436 save_LIBS="$LIBS" 2437 save_CFLAGS="$CFLAGS" 2438 LIBS="conftstm.$ac_objext" 2439 CFLAGS="$CFLAGS$no_builtin_flag" 2440 if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then 2441 pipe_works=yes 2442 fi 2443 LIBS="$save_LIBS" 2444 CFLAGS="$save_CFLAGS" 2445 else 2446 echo "cannot find nm_test_func in $nlist" >&AC_FD_CC 2447 fi 2448 else 2449 echo "cannot find nm_test_var in $nlist" >&AC_FD_CC 2450 fi 2451 else 2452 echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AC_FD_CC 2453 fi 2454 else 2455 echo "$progname: failed program was:" >&AC_FD_CC 2456 cat conftest.$ac_ext >&5 2457 fi 2458 rm -f conftest* conftst* 2459 2460 # Do not use the global_symbol_pipe unless it works. 2461 if test "$pipe_works" = yes; then 2462 break 2463 else 2464 lt_cv_sys_global_symbol_pipe= 2465 fi 2466 done 2467 ]) 2468 global_symbol_pipe="$lt_cv_sys_global_symbol_pipe" 2469 if test -z "$lt_cv_sys_global_symbol_pipe"; then 2470 global_symbol_to_cdecl= 2471 global_symbol_to_c_name_address= 2472 else 2473 global_symbol_to_cdecl="$lt_cv_global_symbol_to_cdecl" 2474 global_symbol_to_c_name_address="$lt_cv_global_symbol_to_c_name_address" 2475 fi 2476 if test -z "$global_symbol_pipe$global_symbol_to_cdec$global_symbol_to_c_name_address"; 2477 then 2478 AC_MSG_RESULT(failed) 2479 else 2480 AC_MSG_RESULT(ok) 2481 fi 2482 ]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE 2483 2484 # _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR 2485 # --------------------------------- 2486 AC_DEFUN([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR], 2487 [# Find the correct PATH separator. Usually this is `:', but 2488 # DJGPP uses `;' like DOS. 2489 if test "X${PATH_SEPARATOR+set}" != Xset; then 2490 UNAME=${UNAME-`uname 2>/dev/null`} 2491 case X$UNAME in 2492 *-DOS) lt_cv_sys_path_separator=';' ;; 2493 *) lt_cv_sys_path_separator=':' ;; 2494 esac 2495 PATH_SEPARATOR=$lt_cv_sys_path_separator 2496 fi 2497 ])# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR 2498 2499 # _LT_AC_PROG_ECHO_BACKSLASH 2500 # -------------------------- 2501 # Add some code to the start of the generated configure script which 2502 # will find an echo command which doesn't interpret backslashes. 2503 AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], 2504 [ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], 2505 [AC_DIVERT_PUSH(NOTICE)]) 2506 _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR 2507 2508 # Check that we are running under the correct shell. 2509 SHELL=${CONFIG_SHELL-/bin/sh} 2510 2511 case X$ECHO in 2512 X*--fallback-echo) 2513 # Remove one level of quotation (which was required for Make). 2514 ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` 2515 ;; 2516 esac 2517 2518 echo=${ECHO-echo} 2519 if test "X[$]1" = X--no-reexec; then 2520 # Discard the --no-reexec flag, and continue. 2521 shift 2522 elif test "X[$]1" = X--fallback-echo; then 2523 # Avoid inline document here, it may be left over 2524 : 2525 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then 2526 # Yippee, $echo works! 2527 : 2528 else 2529 # Restart under the correct shell. 2530 exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} 2531 fi 2532 2533 if test "X[$]1" = X--fallback-echo; then 2534 # used as fallback echo 2535 shift 2536 cat <<EOF 2537 $* 2538 EOF 2539 exit 0 2540 fi 2541 2542 # The HP-UX ksh and POSIX shell print the target directory to stdout 2543 # if CDPATH is set. 2544 if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi 2545 2546 if test -z "$ECHO"; then 2547 if test "X${echo_test_string+set}" != Xset; then 2548 # find a string as large as possible, as long as the shell can cope with it 2549 for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do 2550 # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... 2551 if (echo_test_string="`eval $cmd`") 2>/dev/null && 2552 echo_test_string="`eval $cmd`" && 2553 (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null 2554 then 2555 break 2556 fi 2557 done 2558 fi 2559 2560 if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && 2561 echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && 2562 test "X$echo_testing_string" = "X$echo_test_string"; then 2563 : 2564 else 2565 # The Solaris, AIX, and Digital Unix default echo programs unquote 2566 # backslashes. This makes it impossible to quote backslashes using 2567 # echo "$something" | sed 's/\\/\\\\/g' 2568 # 2569 # So, first we look for a working echo in the user's PATH. 2570 2571 IFS="${IFS= }"; save_ifs="$IFS"; IFS=$PATH_SEPARATOR 2572 for dir in $PATH /usr/ucb; do 2573 if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && 2574 test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && 2575 echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && 2576 test "X$echo_testing_string" = "X$echo_test_string"; then 2577 echo="$dir/echo" 2578 break 2579 fi 2580 done 2581 IFS="$save_ifs" 2582 2583 if test "X$echo" = Xecho; then 2584 # We didn't find a better echo, so look for alternatives. 2585 if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && 2586 echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && 2587 test "X$echo_testing_string" = "X$echo_test_string"; then 2588 # This shell has a builtin print -r that does the trick. 2589 echo='print -r' 2590 elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && 2591 test "X$CONFIG_SHELL" != X/bin/ksh; then 2592 # If we have ksh, try running configure again with it. 2593 ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} 2594 export ORIGINAL_CONFIG_SHELL 2595 CONFIG_SHELL=/bin/ksh 2596 export CONFIG_SHELL 2597 exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} 2598 else 2599 # Try using printf. 2600 echo='printf %s\n' 2601 if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && 2602 echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && 2603 test "X$echo_testing_string" = "X$echo_test_string"; then 2604 # Cool, printf works 2605 : 2606 elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && 2607 test "X$echo_testing_string" = 'X\t' && 2608 echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && 2609 test "X$echo_testing_string" = "X$echo_test_string"; then 2610 CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL 2611 export CONFIG_SHELL 2612 SHELL="$CONFIG_SHELL" 2613 export SHELL 2614 echo="$CONFIG_SHELL [$]0 --fallback-echo" 2615 elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && 2616 test "X$echo_testing_string" = 'X\t' && 2617 echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && 2618 test "X$echo_testing_string" = "X$echo_test_string"; then 2619 echo="$CONFIG_SHELL [$]0 --fallback-echo" 2620 else 2621 # maybe with a smaller string... 2622 prev=: 2623 2624 for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do 2625 if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null 2626 then 2627 break 2628 fi 2629 prev="$cmd" 2630 done 2631 2632 if test "$prev" != 'sed 50q "[$]0"'; then 2633 echo_test_string=`eval $prev` 2634 export echo_test_string 2635 exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} 2636 else 2637 # Oops. We lost completely, so just stick with echo. 2638 echo=echo 2639 fi 2640 fi 2641 fi 2642 fi 2643 fi 2644 fi 2645 2646 # Copy echo and quote the copy suitably for passing to libtool from 2647 # the Makefile, instead of quoting the original, which is used later. 2648 ECHO=$echo 2649 if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then 2650 ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" 2651 fi 2652 2653 AC_SUBST(ECHO) 2654 AC_DIVERT_POP 2655 ])# _LT_AC_PROG_ECHO_BACKSLASH 2656 2657 # _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, 2658 # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) 2659 # ------------------------------------------------------------------ 2660 AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], 2661 [if test "$cross_compiling" = yes; then : 2662 [$4] 2663 else 2664 AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl 2665 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 2666 lt_status=$lt_dlunknown 2667 cat > conftest.$ac_ext <<EOF 2668 [#line __oline__ "configure" 2669 #include "confdefs.h" 2670 2671 #if HAVE_DLFCN_H 2672 #include <dlfcn.h> 2673 #endif 2674 2675 #include <stdio.h> 2676 2677 #ifdef RTLD_GLOBAL 2678 # define LT_DLGLOBAL RTLD_GLOBAL 2679 #else 2680 # ifdef DL_GLOBAL 2681 # define LT_DLGLOBAL DL_GLOBAL 2682 # else 2683 # define LT_DLGLOBAL 0 2684 # endif 2685 #endif 2686 2687 /* We may have to define LT_DLLAZY_OR_NOW in the command line if we 2688 find out it does not work in some platform. */ 2689 #ifndef LT_DLLAZY_OR_NOW 2690 # ifdef RTLD_LAZY 2691 # define LT_DLLAZY_OR_NOW RTLD_LAZY 2692 # else 2693 # ifdef DL_LAZY 2694 # define LT_DLLAZY_OR_NOW DL_LAZY 2695 # else 2696 # ifdef RTLD_NOW 2697 # define LT_DLLAZY_OR_NOW RTLD_NOW 2698 # else 2699 # ifdef DL_NOW 2700 # define LT_DLLAZY_OR_NOW DL_NOW 2701 # else 2702 # define LT_DLLAZY_OR_NOW 0 2703 # endif 2704 # endif 2705 # endif 2706 # endif 2707 #endif 2708 2709 #ifdef __cplusplus 2710 extern "C" void exit (int); 2711 #endif 2712 2713 void fnord() { int i=42;} 2714 int main () 2715 { 2716 void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); 2717 int status = $lt_dlunknown; 2718 2719 if (self) 2720 { 2721 if (dlsym (self,"fnord")) status = $lt_dlno_uscore; 2722 else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; 2723 /* dlclose (self); */ 2724 } 2725 2726 exit (status); 2727 }] 2728 EOF 2729 if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then 2730 (./conftest; exit; ) 2>/dev/null 2731 lt_status=$? 2732 case x$lt_status in 2733 x$lt_dlno_uscore) $1 ;; 2734 x$lt_dlneed_uscore) $2 ;; 2735 x$lt_unknown|x*) $3 ;; 2736 esac 2737 else : 2738 # compilation failed 2739 $3 2740 fi 2741 fi 2742 rm -fr conftest* 2743 ])# _LT_AC_TRY_DLOPEN_SELF 2744 2745 # AC_LIBTOOL_DLOPEN_SELF 2746 # ------------------- 2747 AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], 2748 [if test "x$enable_dlopen" != xyes; then 2749 enable_dlopen=unknown 2750 enable_dlopen_self=unknown 2751 enable_dlopen_self_static=unknown 2752 else 2753 lt_cv_dlopen=no 2754 lt_cv_dlopen_libs= 2755 2756 case $host_os in 2757 beos*) 2758 lt_cv_dlopen="load_add_on" 2759 lt_cv_dlopen_libs= 2760 lt_cv_dlopen_self=yes 2761 ;; 2762 2763 cygwin* | mingw* | pw32*) 2764 lt_cv_dlopen="LoadLibrary" 2765 lt_cv_dlopen_libs= 2766 ;; 2767 2768 *) 2769 AC_CHECK_FUNC([shl_load], 2770 [lt_cv_dlopen="shl_load"], 2771 [AC_CHECK_LIB([dld], [shl_load], 2772 [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], 2773 [AC_CHECK_FUNC([dlopen], 2774 [lt_cv_dlopen="dlopen"], 2775 [AC_CHECK_LIB([dl], [dlopen], 2776 [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], 2777 [AC_CHECK_LIB([svld], [dlopen], 2778 [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], 2779 [AC_CHECK_LIB([dld], [dld_link], 2780 [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"]) 2781 ]) 2782 ]) 2783 ]) 2784 ]) 2785 ]) 2786 ;; 2787 esac 2788 2789 if test "x$lt_cv_dlopen" != xno; then 2790 enable_dlopen=yes 2791 else 2792 enable_dlopen=no 2793 fi 2794 2795 case $lt_cv_dlopen in 2796 dlopen) 2797 save_CPPFLAGS="$CPPFLAGS" 2798 AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl 2799 test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" 2800 2801 save_LDFLAGS="$LDFLAGS" 2802 eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" 2803 2804 save_LIBS="$LIBS" 2805 LIBS="$lt_cv_dlopen_libs $LIBS" 2806 2807 AC_CACHE_CHECK([whether a program can dlopen itself], 2808 lt_cv_dlopen_self, [dnl 2809 _LT_AC_TRY_DLOPEN_SELF( 2810 lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, 2811 lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) 2812 ]) 2813 2814 if test "x$lt_cv_dlopen_self" = xyes; then 2815 LDFLAGS="$LDFLAGS $link_static_flag" 2816 AC_CACHE_CHECK([whether a statically linked program can dlopen itself], 2817 lt_cv_dlopen_self_static, [dnl 2818 _LT_AC_TRY_DLOPEN_SELF( 2819 lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, 2820 lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) 2821 ]) 2822 fi 2823 2824 CPPFLAGS="$save_CPPFLAGS" 2825 LDFLAGS="$save_LDFLAGS" 2826 LIBS="$save_LIBS" 2827 ;; 2828 esac 2829 2830 case $lt_cv_dlopen_self in 2831 yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; 2832 *) enable_dlopen_self=unknown ;; 2833 esac 2834 2835 case $lt_cv_dlopen_self_static in 2836 yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; 2837 *) enable_dlopen_self_static=unknown ;; 2838 esac 2839 fi 2840 ])# AC_LIBTOOL_DLOPEN_SELF 2841 2842 AC_DEFUN([_LT_AC_LTCONFIG_HACK], 2843 [AC_REQUIRE([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])dnl 2844 # Sed substitution that helps us do robust quoting. It backslashifies 2845 # metacharacters that are still active within double-quoted strings. 2846 Xsed='sed -e s/^X//' 2847 sed_quote_subst='s/\([[\\"\\`$\\\\]]\)/\\\1/g' 2848 2849 # Same as above, but do not quote variable references. 2850 double_quote_subst='s/\([[\\"\\`\\\\]]\)/\\\1/g' 2851 2852 # Sed substitution to delay expansion of an escaped shell variable in a 2853 # double_quote_subst'ed string. 2854 delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' 2855 2856 # Constants: 2857 rm="rm -f" 2858 2859 # Global variables: 2860 default_ofile=libtool 2861 can_build_shared=yes 2862 2863 # All known linkers require a `.a' archive for static linking (except M$VC, 2864 # which needs '.lib'). 2865 libext=a 2866 ltmain="$ac_aux_dir/ltmain.sh" 2867 ofile="$default_ofile" 2868 with_gnu_ld="$lt_cv_prog_gnu_ld" 2869 need_locks="$enable_libtool_lock" 2870 2871 old_CC="$CC" 2872 old_CFLAGS="$CFLAGS" 2873 2874 # Set sane defaults for various variables 2875 test -z "$AR" && AR=ar 2876 test -z "$AR_FLAGS" && AR_FLAGS=cru 2877 test -z "$AS" && AS=as 2878 test -z "$CC" && CC=cc 2879 test -z "$DLLTOOL" && DLLTOOL=dlltool 2880 test -z "$LD" && LD=ld 2881 test -z "$LN_S" && LN_S="ln -s" 2882 test -z "$MAGIC_CMD" && MAGIC_CMD=file 2883 test -z "$NM" && NM=nm 2884 test -z "$OBJDUMP" && OBJDUMP=objdump 2885 test -z "$RANLIB" && RANLIB=: 2886 test -z "$STRIP" && STRIP=: 2887 test -z "$ac_objext" && ac_objext=o 2888 2889 if test x"$host" != x"$build"; then 2890 ac_tool_prefix=${host_alias}- 2891 else 2892 ac_tool_prefix= 2893 fi 2894 2895 # Transform linux* to *-*-linux-gnu*, to support old configure scripts. 2896 case $host_os in 2897 linux-gnu*) ;; 2898 linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'` 2899 esac 2900 2901 case $host_os in 2902 aix3*) 2903 # AIX sometimes has problems with the GCC collect2 program. For some 2904 # reason, if we set the COLLECT_NAMES environment variable, the problems 2905 # vanish in a puff of smoke. 2906 if test "X${COLLECT_NAMES+set}" != Xset; then 2907 COLLECT_NAMES= 2908 export COLLECT_NAMES 2909 fi 2910 ;; 2911 esac 2912 2913 # Determine commands to create old-style static archives. 2914 old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' 2915 old_postinstall_cmds='chmod 644 $oldlib' 2916 old_postuninstall_cmds= 2917 2918 if test -n "$RANLIB"; then 2919 case $host_os in 2920 openbsd*) 2921 old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds" 2922 ;; 2923 *) 2924 old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" 2925 ;; 2926 esac 2927 old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" 2928 fi 2929 2930 # Allow CC to be a program name with arguments. 2931 set dummy $CC 2932 compiler="[$]2" 2933 2934 ## FIXME: this should be a separate macro 2935 ## 2936 AC_MSG_CHECKING([for objdir]) 2937 rm -f .libs 2>/dev/null 2938 mkdir .libs 2>/dev/null 2939 if test -d .libs; then 2940 objdir=.libs 2941 else 2942 # MS-DOS does not allow filenames that begin with a dot. 2943 objdir=_libs 2944 fi 2945 rmdir .libs 2>/dev/null 2946 AC_MSG_RESULT($objdir) 2947 ## 2948 ## END FIXME 2949 2950 2951 ## FIXME: this should be a separate macro 2952 ## 2953 AC_ARG_WITH(pic, 2954 [ --with-pic try to use only PIC/non-PIC objects [default=use both]], 2955 pic_mode="$withval", pic_mode=default) 2956 test -z "$pic_mode" && pic_mode=default 2957 2958 # We assume here that the value for lt_cv_prog_cc_pic will not be cached 2959 # in isolation, and that seeing it set (from the cache) indicates that 2960 # the associated values are set (in the cache) correctly too. 2961 AC_MSG_CHECKING([for $compiler option to produce PIC]) 2962 AC_CACHE_VAL(lt_cv_prog_cc_pic, 2963 [ lt_cv_prog_cc_pic= 2964 lt_cv_prog_cc_shlib= 2965 lt_cv_prog_cc_wl= 2966 lt_cv_prog_cc_static= 2967 lt_cv_prog_cc_no_builtin= 2968 lt_cv_prog_cc_can_build_shared=$can_build_shared 2969 2970 if test "$GCC" = yes; then 2971 lt_cv_prog_cc_wl='-Wl,' 2972 lt_cv_prog_cc_static='-static' 2973 2974 case $host_os in 2975 aix*) 2976 # Below there is a dirty hack to force normal static linking with -ldl 2977 # The problem is because libdl dynamically linked with both libc and 2978 # libC (AIX C++ library), which obviously doesn't included in libraries 2979 # list by gcc. This cause undefined symbols with -static flags. 2980 # This hack allows C programs to be linked with "-static -ldl", but 2981 # not sure about C++ programs. 2982 lt_cv_prog_cc_static="$lt_cv_prog_cc_static ${lt_cv_prog_cc_wl}-lC" 2983 ;; 2984 amigaos*) 2985 # FIXME: we need at least 68020 code to build shared libraries, but 2986 # adding the `-m68020' flag to GCC prevents building anything better, 2987 # like `-m68040'. 2988 lt_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4' 2989 ;; 2990 beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) 2991 # PIC is the default for these OSes. 2992 ;; 2993 darwin* | rhapsody*) 2994 # PIC is the default on this platform 2995 # Common symbols not allowed in MH_DYLIB files 2996 lt_cv_prog_cc_pic='-fno-common' 2997 ;; 2998 cygwin* | mingw* | pw32* | os2*) 2999 # This hack is so that the source file can tell whether it is being 3000 # built for inclusion in a dll (and should export symbols for example). 3001 lt_cv_prog_cc_pic='-DDLL_EXPORT' 3002 ;; 3003 sysv4*MP*) 3004 if test -d /usr/nec; then 3005 lt_cv_prog_cc_pic=-Kconform_pic 3006 fi 3007 ;; 3008 *) 3009 lt_cv_prog_cc_pic='-fPIC' 3010 ;; 3011 esac 3012 else 3013 # PORTME Check for PIC flags for the system compiler. 3014 case $host_os in 3015 aix3* | aix4* | aix5*) 3016 lt_cv_prog_cc_wl='-Wl,' 3017 # All AIX code is PIC. 3018 if test "$host_cpu" = ia64; then 3019 # AIX 5 now supports IA64 processor 3020 lt_cv_prog_cc_static='-Bstatic' 3021 else 3022 lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp' 3023 fi 3024 ;; 3025 3026 hpux9* | hpux10* | hpux11*) 3027 # Is there a better lt_cv_prog_cc_static that works with the bundled CC? 3028 lt_cv_prog_cc_wl='-Wl,' 3029 lt_cv_prog_cc_static="${lt_cv_prog_cc_wl}-a ${lt_cv_prog_cc_wl}archive" 3030 lt_cv_prog_cc_pic='+Z' 3031 ;; 3032 3033 irix5* | irix6* | nonstopux*) 3034 lt_cv_prog_cc_wl='-Wl,' 3035 lt_cv_prog_cc_static='-non_shared' 3036 # PIC (with -KPIC) is the default. 3037 ;; 3038 3039 cygwin* | mingw* | pw32* | os2*) 3040 # This hack is so that the source file can tell whether it is being 3041 # built for inclusion in a dll (and should export symbols for example). 3042 lt_cv_prog_cc_pic='-DDLL_EXPORT' 3043 ;; 3044 3045 newsos6) 3046 lt_cv_prog_cc_pic='-KPIC' 3047 lt_cv_prog_cc_static='-Bstatic' 3048 ;; 3049 3050 osf3* | osf4* | osf5*) 3051 # All OSF/1 code is PIC. 3052 lt_cv_prog_cc_wl='-Wl,' 3053 lt_cv_prog_cc_static='-non_shared' 3054 ;; 3055 3056 sco3.2v5*) 3057 lt_cv_prog_cc_pic='-Kpic' 3058 lt_cv_prog_cc_static='-dn' 3059 lt_cv_prog_cc_shlib='-belf' 3060 ;; 3061 3062 solaris*) 3063 lt_cv_prog_cc_pic='-KPIC' 3064 lt_cv_prog_cc_static='-Bstatic' 3065 lt_cv_prog_cc_wl='-Wl,' 3066 ;; 3067 3068 sunos4*) 3069 lt_cv_prog_cc_pic='-PIC' 3070 lt_cv_prog_cc_static='-Bstatic' 3071 lt_cv_prog_cc_wl='-Qoption ld ' 3072 ;; 3073 3074 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) 3075 lt_cv_prog_cc_pic='-KPIC' 3076 lt_cv_prog_cc_static='-Bstatic' 3077 lt_cv_prog_cc_wl='-Wl,' 3078 ;; 3079 3080 uts4*) 3081 lt_cv_prog_cc_pic='-pic' 3082 lt_cv_prog_cc_static='-Bstatic' 3083 ;; 3084 3085 sysv4*MP*) 3086 if test -d /usr/nec ;then 3087 lt_cv_prog_cc_pic='-Kconform_pic' 3088 lt_cv_prog_cc_static='-Bstatic' 3089 fi 3090 ;; 3091 3092 *) 3093 lt_cv_prog_cc_can_build_shared=no 3094 ;; 3095 esac 3096 fi 3097 ]) 3098 if test -z "$lt_cv_prog_cc_pic"; then 3099 AC_MSG_RESULT([none]) 3100 else 3101 AC_MSG_RESULT([$lt_cv_prog_cc_pic]) 3102 3103 # Check to make sure the pic_flag actually works. 3104 AC_MSG_CHECKING([if $compiler PIC flag $lt_cv_prog_cc_pic works]) 3105 AC_CACHE_VAL(lt_cv_prog_cc_pic_works, [dnl 3106 save_CFLAGS="$CFLAGS" 3107 CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC" 3108 AC_TRY_COMPILE([], [], [dnl 3109 case $host_os in 3110 hpux9* | hpux10* | hpux11*) 3111 # On HP-UX, both CC and GCC only warn that PIC is supported... then 3112 # they create non-PIC objects. So, if there were any warnings, we 3113 # assume that PIC is not supported. 3114 if test -s conftest.err; then 3115 lt_cv_prog_cc_pic_works=no 3116 else 3117 lt_cv_prog_cc_pic_works=yes 3118 fi 3119 ;; 3120 *) 3121 lt_cv_prog_cc_pic_works=yes 3122 ;; 3123 esac 3124 ], [dnl 3125 lt_cv_prog_cc_pic_works=no 3126 ]) 3127 CFLAGS="$save_CFLAGS" 3128 ]) 3129 3130 if test "X$lt_cv_prog_cc_pic_works" = Xno; then 3131 lt_cv_prog_cc_pic= 3132 lt_cv_prog_cc_can_build_shared=no 3133 else 3134 lt_cv_prog_cc_pic=" $lt_cv_prog_cc_pic" 3135 fi 3136 3137 AC_MSG_RESULT([$lt_cv_prog_cc_pic_works]) 3138 fi 3139 ## 3140 ## END FIXME 3141 3142 # Check for any special shared library compilation flags. 3143 if test -n "$lt_cv_prog_cc_shlib"; then 3144 AC_MSG_WARN([\`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries]) 3145 if echo "$old_CC $old_CFLAGS " | egrep -e "[[ ]]$lt_cv_prog_cc_shlib[[ ]]" >/dev/null; then : 3146 else 3147 AC_MSG_WARN([add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure]) 3148 lt_cv_prog_cc_can_build_shared=no 3149 fi 3150 fi 3151 3152 ## FIXME: this should be a separate macro 3153 ## 3154 AC_MSG_CHECKING([if $compiler static flag $lt_cv_prog_cc_static works]) 3155 AC_CACHE_VAL([lt_cv_prog_cc_static_works], [dnl 3156 lt_cv_prog_cc_static_works=no 3157 save_LDFLAGS="$LDFLAGS" 3158 LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static" 3159 AC_TRY_LINK([], [], [lt_cv_prog_cc_static_works=yes]) 3160 LDFLAGS="$save_LDFLAGS" 3161 ]) 3162 3163 # Belt *and* braces to stop my trousers falling down: 3164 test "X$lt_cv_prog_cc_static_works" = Xno && lt_cv_prog_cc_static= 3165 AC_MSG_RESULT([$lt_cv_prog_cc_static_works]) 3166 3167 pic_flag="$lt_cv_prog_cc_pic" 3168 special_shlib_compile_flags="$lt_cv_prog_cc_shlib" 3169 wl="$lt_cv_prog_cc_wl" 3170 link_static_flag="$lt_cv_prog_cc_static" 3171 no_builtin_flag="$lt_cv_prog_cc_no_builtin" 3172 can_build_shared="$lt_cv_prog_cc_can_build_shared" 3173 ## 3174 ## END FIXME 3175 3176 3177 ## FIXME: this should be a separate macro 3178 ## 3179 # Check to see if options -o and -c are simultaneously supported by compiler 3180 AC_MSG_CHECKING([if $compiler supports -c -o file.$ac_objext]) 3181 AC_CACHE_VAL([lt_cv_compiler_c_o], [ 3182 $rm -r conftest 2>/dev/null 3183 mkdir conftest 3184 cd conftest 3185 echo "int some_variable = 0;" > conftest.$ac_ext 3186 mkdir out 3187 # According to Tom Tromey, Ian Lance Taylor reported there are C compilers 3188 # that will create temporary files in the current directory regardless of 3189 # the output directory. Thus, making CWD read-only will cause this test 3190 # to fail, enabling locking or at least warning the user not to do parallel 3191 # builds. 3192 chmod -w . 3193 save_CFLAGS="$CFLAGS" 3194 CFLAGS="$CFLAGS -o out/conftest2.$ac_objext" 3195 compiler_c_o=no 3196 if { (eval echo configure:__oline__: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then 3197 # The compiler can only warn and ignore the option if not recognized 3198 # So say no if there are warnings 3199 if test -s out/conftest.err; then 3200 lt_cv_compiler_c_o=no 3201 else 3202 lt_cv_compiler_c_o=yes 3203 fi 3204 else 3205 # Append any errors to the config.log. 3206 cat out/conftest.err 1>&AC_FD_CC 3207 lt_cv_compiler_c_o=no 3208 fi 3209 CFLAGS="$save_CFLAGS" 3210 chmod u+w . 3211 $rm conftest* out/* 3212 rmdir out 3213 cd .. 3214 rmdir conftest 3215 $rm -r conftest 2>/dev/null 3216 ]) 3217 compiler_c_o=$lt_cv_compiler_c_o 3218 AC_MSG_RESULT([$compiler_c_o]) 3219 3220 if test x"$compiler_c_o" = x"yes"; then 3221 # Check to see if we can write to a .lo 3222 AC_MSG_CHECKING([if $compiler supports -c -o file.lo]) 3223 AC_CACHE_VAL([lt_cv_compiler_o_lo], [ 3224 lt_cv_compiler_o_lo=no 3225 save_CFLAGS="$CFLAGS" 3226 CFLAGS="$CFLAGS -c -o conftest.lo" 3227 save_objext="$ac_objext" 3228 ac_objext=lo 3229 AC_TRY_COMPILE([], [int some_variable = 0;], [dnl 3230 # The compiler can only warn and ignore the option if not recognized 3231 # So say no if there are warnings 3232 if test -s conftest.err; then 3233 lt_cv_compiler_o_lo=no 3234 else 3235 lt_cv_compiler_o_lo=yes 3236 fi 3237 ]) 3238 ac_objext="$save_objext" 3239 CFLAGS="$save_CFLAGS" 3240 ]) 3241 compiler_o_lo=$lt_cv_compiler_o_lo 3242 AC_MSG_RESULT([$compiler_o_lo]) 3243 else 3244 compiler_o_lo=no 3245 fi 3246 ## 3247 ## END FIXME 3248 3249 ## FIXME: this should be a separate macro 3250 ## 3251 # Check to see if we can do hard links to lock some files if needed 3252 hard_links="nottested" 3253 if test "$compiler_c_o" = no && test "$need_locks" != no; then 3254 # do not overwrite the value of need_locks provided by the user 3255 AC_MSG_CHECKING([if we can lock with hard links]) 3256 hard_links=yes 3257 $rm conftest* 3258 ln conftest.a conftest.b 2>/dev/null && hard_links=no 3259 touch conftest.a 3260 ln conftest.a conftest.b 2>&5 || hard_links=no 3261 ln conftest.a conftest.b 2>/dev/null && hard_links=no 3262 AC_MSG_RESULT([$hard_links]) 3263 if test "$hard_links" = no; then 3264 AC_MSG_WARN([\`$CC' does not support \`-c -o', so \`make -j' may be unsafe]) 3265 need_locks=warn 3266 fi 3267 else 3268 need_locks=no 3269 fi 3270 ## 3271 ## END FIXME 3272 3273 ## FIXME: this should be a separate macro 3274 ## 3275 if test "$GCC" = yes; then 3276 # Check to see if options -fno-rtti -fno-exceptions are supported by compiler 3277 AC_MSG_CHECKING([if $compiler supports -fno-rtti -fno-exceptions]) 3278 echo "int some_variable = 0;" > conftest.$ac_ext 3279 save_CFLAGS="$CFLAGS" 3280 CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext" 3281 compiler_rtti_exceptions=no 3282 AC_TRY_COMPILE([], [int some_variable = 0;], [dnl 3283 # The compiler can only warn and ignore the option if not recognized 3284 # So say no if there are warnings 3285 if test -s conftest.err; then 3286 compiler_rtti_exceptions=no 3287 else 3288 compiler_rtti_exceptions=yes 3289 fi 3290 ]) 3291 CFLAGS="$save_CFLAGS" 3292 AC_MSG_RESULT([$compiler_rtti_exceptions]) 3293 3294 if test "$compiler_rtti_exceptions" = "yes"; then 3295 no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions' 3296 else 3297 no_builtin_flag=' -fno-builtin' 3298 fi 3299 fi 3300 ## 3301 ## END FIXME 3302 3303 ## FIXME: this should be a separate macro 3304 ## 3305 # See if the linker supports building shared libraries. 3306 AC_MSG_CHECKING([whether the linker ($LD) supports shared libraries]) 3307 3308 allow_undefined_flag= 3309 no_undefined_flag= 3310 need_lib_prefix=unknown 3311 need_version=unknown 3312 # when you set need_version to no, make sure it does not cause -set_version 3313 # flags to be left without arguments 3314 archive_cmds= 3315 archive_expsym_cmds= 3316 old_archive_from_new_cmds= 3317 old_archive_from_expsyms_cmds= 3318 export_dynamic_flag_spec= 3319 whole_archive_flag_spec= 3320 thread_safe_flag_spec= 3321 hardcode_into_libs=no 3322 hardcode_libdir_flag_spec= 3323 hardcode_libdir_separator= 3324 hardcode_direct=no 3325 hardcode_minus_L=no 3326 hardcode_shlibpath_var=unsupported 3327 runpath_var= 3328 link_all_deplibs=unknown 3329 always_export_symbols=no 3330 export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols' 3331 # include_expsyms should be a list of space-separated symbols to be *always* 3332 # included in the symbol list 3333 include_expsyms= 3334 # exclude_expsyms can be an egrep regular expression of symbols to exclude 3335 # it will be wrapped by ` (' and `)$', so one must not match beginning or 3336 # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', 3337 # as well as any symbol that contains `d'. 3338 exclude_expsyms="_GLOBAL_OFFSET_TABLE_" 3339 # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out 3340 # platforms (ab)use it in PIC code, but their linkers get confused if 3341 # the symbol is explicitly referenced. Since portable code cannot 3342 # rely on this symbol name, it's probably fine to never include it in 3343 # preloaded symbol tables. 3344 extract_expsyms_cmds= 3345 3346 case $host_os in 3347 cygwin* | mingw* | pw32*) 3348 # FIXME: the MSVC++ port hasn't been tested in a loooong time 3349 # When not using gcc, we currently assume that we are using 3350 # Microsoft Visual C++. 3351 if test "$GCC" != yes; then 3352 with_gnu_ld=no 3353 fi 3354 ;; 3355 openbsd*) 3356 with_gnu_ld=no 3357 ;; 3358 esac 3359 3360 ld_shlibs=yes 3361 if test "$with_gnu_ld" = yes; then 3362 # If archive_cmds runs LD, not CC, wlarc should be empty 3363 wlarc='${wl}' 3364 3365 # See if GNU ld supports shared libraries. 3366 case $host_os in 3367 aix3* | aix4* | aix5*) 3368 # On AIX, the GNU linker is very broken 3369 # Note:Check GNU linker on AIX 5-IA64 when/if it becomes available. 3370 ld_shlibs=no 3371 cat <<EOF 1>&2 3372 3373 *** Warning: the GNU linker, at least up to release 2.9.1, is reported 3374 *** to be unable to reliably create shared libraries on AIX. 3375 *** Therefore, libtool is disabling shared libraries support. If you 3376 *** really care for shared libraries, you may want to modify your PATH 3377 *** so that a non-GNU linker is found, and then restart. 3378 3379 EOF 3380 ;; 3381 3382 amigaos*) 3383 archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' 3384 hardcode_libdir_flag_spec='-L$libdir' 3385 hardcode_minus_L=yes 3386 3387 # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports 3388 # that the semantics of dynamic libraries on AmigaOS, at least up 3389 # to version 4, is to share data among multiple programs linked 3390 # with the same dynamic library. Since this doesn't match the 3391 # behavior of shared libraries on other platforms, we can use 3392 # them. 3393 ld_shlibs=no 3394 ;; 3395 3396 beos*) 3397 if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then 3398 allow_undefined_flag=unsupported 3399 # Joseph Beckenbach <jrb3@best.com> says some releases of gcc 3400 # support --undefined. This deserves some investigation. FIXME 3401 archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' 3402 else 3403 ld_shlibs=no 3404 fi 3405 ;; 3406 3407 cygwin* | mingw* | pw32*) 3408 # hardcode_libdir_flag_spec is actually meaningless, as there is 3409 # no search path for DLLs. 3410 hardcode_libdir_flag_spec='-L$libdir' 3411 allow_undefined_flag=unsupported 3412 always_export_symbols=yes 3413 3414 extract_expsyms_cmds='test -f $output_objdir/impgen.c || \ 3415 sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~ 3416 test -f $output_objdir/impgen.exe || (cd $output_objdir && \ 3417 if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \ 3418 else $CC -o impgen impgen.c ; fi)~ 3419 $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def' 3420 3421 old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib' 3422 3423 # cygwin and mingw dlls have different entry points and sets of symbols 3424 # to exclude. 3425 # FIXME: what about values for MSVC? 3426 dll_entry=__cygwin_dll_entry@12 3427 dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~ 3428 case $host_os in 3429 mingw*) 3430 # mingw values 3431 dll_entry=_DllMainCRTStartup@12 3432 dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~ 3433 ;; 3434 esac 3435 3436 # mingw and cygwin differ, and it's simplest to just exclude the union 3437 # of the two symbol sets. 3438 dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12 3439 3440 # recent cygwin and mingw systems supply a stub DllMain which the user 3441 # can override, but on older systems we have to supply one (in ltdll.c) 3442 if test "x$lt_cv_need_dllmain" = "xyes"; then 3443 ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext " 3444 ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $''0 > $output_objdir/$soname-ltdll.c~ 3445 test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~' 3446 else 3447 ltdll_obj= 3448 ltdll_cmds= 3449 fi 3450 3451 # Extract the symbol export list from an `--export-all' def file, 3452 # then regenerate the def file from the symbol export list, so that 3453 # the compiled dll only exports the symbol export list. 3454 # Be careful not to strip the DATA tag left be newer dlltools. 3455 export_symbols_cmds="$ltdll_cmds"' 3456 $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~ 3457 sed -e "1,/EXPORTS/d" -e "s/ @ [[0-9]]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols' 3458 3459 # If the export-symbols file already is a .def file (1st line 3460 # is EXPORTS), use it as is. 3461 # If DATA tags from a recent dlltool are present, honour them! 3462 archive_expsym_cmds='if test "x`sed 1q $export_symbols`" = xEXPORTS; then 3463 cp $export_symbols $output_objdir/$soname-def; 3464 else 3465 echo EXPORTS > $output_objdir/$soname-def; 3466 _lt_hint=1; 3467 cat $export_symbols | while read symbol; do 3468 set dummy \$symbol; 3469 case \[$]# in 3470 2) echo " \[$]2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;; 3471 4) echo " \[$]2 \[$]3 \[$]4 ; " >> $output_objdir/$soname-def; _lt_hint=`expr \$_lt_hint - 1`;; 3472 *) echo " \[$]2 @ \$_lt_hint \[$]3 ; " >> $output_objdir/$soname-def;; 3473 esac; 3474 _lt_hint=`expr 1 + \$_lt_hint`; 3475 done; 3476 fi~ 3477 '"$ltdll_cmds"' 3478 $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~ 3479 $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~ 3480 $CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~ 3481 $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp --output-lib $output_objdir/$libname.dll.a~ 3482 $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags' 3483 ;; 3484 3485 netbsd*) 3486 if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then 3487 archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' 3488 wlarc= 3489 else 3490 archive_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' 3491 archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' 3492 fi 3493 ;; 3494 3495 solaris*) 3496 if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then 3497 ld_shlibs=no 3498 cat <<EOF 1>&2 3499 3500 *** Warning: The releases 2.8.* of the GNU linker cannot reliably 3501 *** create shared libraries on Solaris systems. Therefore, libtool 3502 *** is disabling shared libraries support. We urge you to upgrade GNU 3503 *** binutils to release 2.9.1 or newer. Another option is to modify 3504 *** your PATH or compiler configuration so that the native linker is 3505 *** used, and then restart. 3506 3507 EOF 3508 elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then 3509 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' 3510 archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' 3511 else 3512 ld_shlibs=no 3513 fi 3514 ;; 3515 3516 sunos4*) 3517 archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' 3518 wlarc= 3519 hardcode_direct=yes 3520 hardcode_shlibpath_var=no 3521 ;; 3522 3523 *) 3524 if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then 3525 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' 3526 archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' 3527 else 3528 ld_shlibs=no 3529 fi 3530 ;; 3531 esac 3532 3533 if test "$ld_shlibs" = yes; then 3534 runpath_var=LD_RUN_PATH 3535 hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' 3536 export_dynamic_flag_spec='${wl}--export-dynamic' 3537 case $host_os in 3538 cygwin* | mingw* | pw32*) 3539 # dlltool doesn't understand --whole-archive et. al. 3540 whole_archive_flag_spec= 3541 ;; 3542 *) 3543 # ancient GNU ld didn't support --whole-archive et. al. 3544 if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then 3545 whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' 3546 else 3547 whole_archive_flag_spec= 3548 fi 3549 ;; 3550 esac 3551 fi 3552 else 3553 # PORTME fill in a description of your system's linker (not GNU ld) 3554 case $host_os in 3555 aix3*) 3556 allow_undefined_flag=unsupported 3557 always_export_symbols=yes 3558 archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' 3559 # Note: this linker hardcodes the directories in LIBPATH if there 3560 # are no directories specified by -L. 3561 hardcode_minus_L=yes 3562 if test "$GCC" = yes && test -z "$link_static_flag"; then 3563 # Neither direct hardcoding nor static linking is supported with a 3564 # broken collect2. 3565 hardcode_direct=unsupported 3566 fi 3567 ;; 3568 3569 aix4* | aix5*) 3570 if test "$host_cpu" = ia64; then 3571 # On IA64, the linker does run time linking by default, so we don't 3572 # have to do anything special. 3573 aix_use_runtimelinking=no 3574 exp_sym_flag='-Bexport' 3575 no_entry_flag="" 3576 else 3577 aix_use_runtimelinking=no 3578 3579 # Test if we are trying to use run time linking or normal 3580 # AIX style linking. If -brtl is somewhere in LDFLAGS, we 3581 # need to do runtime linking. 3582 case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) 3583 for ld_flag in $LDFLAGS; do 3584 case $ld_flag in 3585 *-brtl*) 3586 aix_use_runtimelinking=yes 3587 break 3588 ;; 3589 esac 3590 done 3591 esac 3592 3593 exp_sym_flag='-bexport' 3594 no_entry_flag='-bnoentry' 3595 fi 3596 3597 # When large executables or shared objects are built, AIX ld can 3598 # have problems creating the table of contents. If linking a library 3599 # or program results in "error TOC overflow" add -mminimal-toc to 3600 # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not 3601 # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. 3602 3603 hardcode_direct=yes 3604 archive_cmds='' 3605 hardcode_libdir_separator=':' 3606 if test "$GCC" = yes; then 3607 case $host_os in aix4.[[012]]|aix4.[[012]].*) 3608 collect2name=`${CC} -print-prog-name=collect2` 3609 if test -f "$collect2name" && \ 3610 strings "$collect2name" | grep resolve_lib_name >/dev/null 3611 then 3612 # We have reworked collect2 3613 hardcode_direct=yes 3614 else 3615 # We have old collect2 3616 hardcode_direct=unsupported 3617 # It fails to find uninstalled libraries when the uninstalled 3618 # path is not listed in the libpath. Setting hardcode_minus_L 3619 # to unsupported forces relinking 3620 hardcode_minus_L=yes 3621 hardcode_libdir_flag_spec='-L$libdir' 3622 hardcode_libdir_separator= 3623 fi 3624 esac 3625 3626 shared_flag='-shared' 3627 else 3628 # not using gcc 3629 if test "$host_cpu" = ia64; then 3630 shared_flag='${wl}-G' 3631 else 3632 if test "$aix_use_runtimelinking" = yes; then 3633 shared_flag='${wl}-G' 3634 else 3635 shared_flag='${wl}-bM:SRE' 3636 fi 3637 fi 3638 fi 3639 3640 # It seems that -bexpall can do strange things, so it is better to 3641 # generate a list of symbols to export. 3642 always_export_symbols=yes 3643 if test "$aix_use_runtimelinking" = yes; then 3644 # Warning - without using the other runtime loading flags (-brtl), 3645 # -berok will link without error, but may produce a broken library. 3646 allow_undefined_flag='-berok' 3647 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib' 3648 archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" 3649 else 3650 if test "$host_cpu" = ia64; then 3651 hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' 3652 allow_undefined_flag="-z nodefs" 3653 archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname ${wl}-h$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" 3654 else 3655 hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib' 3656 # Warning - without using the other run time loading flags, 3657 # -berok will link without error, but may produce a broken library. 3658 allow_undefined_flag='${wl}-berok' 3659 # This is a bit strange, but is similar to how AIX traditionally builds 3660 # it's shared libraries. 3661 archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"' ~$AR -crlo $objdir/$libname$release.a $objdir/$soname' 3662 fi 3663 fi 3664 ;; 3665 3666 amigaos*) 3667 archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' 3668 hardcode_libdir_flag_spec='-L$libdir' 3669 hardcode_minus_L=yes 3670 # see comment about different semantics on the GNU ld section 3671 ld_shlibs=no 3672 ;; 3673 3674 cygwin* | mingw* | pw32*) 3675 # When not using gcc, we currently assume that we are using 3676 # Microsoft Visual C++. 3677 # hardcode_libdir_flag_spec is actually meaningless, as there is 3678 # no search path for DLLs. 3679 hardcode_libdir_flag_spec=' ' 3680 allow_undefined_flag=unsupported 3681 # Tell ltmain to make .lib files, not .a files. 3682 libext=lib 3683 # FIXME: Setting linknames here is a bad hack. 3684 archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames=' 3685 # The linker will automatically build a .lib file if we build a DLL. 3686 old_archive_from_new_cmds='true' 3687 # FIXME: Should let the user specify the lib program. 3688 old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs' 3689 fix_srcfile_path='`cygpath -w "$srcfile"`' 3690 ;; 3691 3692 darwin* | rhapsody*) 3693 case "$host_os" in 3694 rhapsody* | darwin1.[[012]]) 3695 allow_undefined_flag='-undefined suppress' 3696 ;; 3697 *) # Darwin 1.3 on 3698 allow_undefined_flag='-flat_namespace -undefined suppress' 3699 ;; 3700 esac 3701 # FIXME: Relying on posixy $() will cause problems for 3702 # cross-compilation, but unfortunately the echo tests do not 3703 # yet detect zsh echo's removal of \ escapes. Also zsh mangles 3704 # `"' quotes if we put them in here... so don't! 3705 archive_cmds='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs && $CC $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib ${lib}-master.o $deplibs$linker_flags $(test .$module != .yes && echo -install_name $rpath/$soname $verstring)' 3706 # We need to add '_' to the symbols in $export_symbols first 3707 #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols' 3708 hardcode_direct=yes 3709 hardcode_shlibpath_var=no 3710 whole_archive_flag_spec='-all_load $convenience' 3711 ;; 3712 3713 freebsd1*) 3714 ld_shlibs=no 3715 ;; 3716 3717 # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor 3718 # support. Future versions do this automatically, but an explicit c++rt0.o 3719 # does not break anything, and helps significantly (at the cost of a little 3720 # extra space). 3721 freebsd2.2*) 3722 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' 3723 hardcode_libdir_flag_spec='-R$libdir' 3724 hardcode_direct=yes 3725 hardcode_shlibpath_var=no 3726 ;; 3727 3728 # Unfortunately, older versions of FreeBSD 2 do not have this feature. 3729 freebsd2*) 3730 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' 3731 hardcode_direct=yes 3732 hardcode_minus_L=yes 3733 hardcode_shlibpath_var=no 3734 ;; 3735 3736 # FreeBSD 3 and greater uses gcc -shared to do shared libraries. 3737 freebsd*) 3738 archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' 3739 hardcode_libdir_flag_spec='-R$libdir' 3740 hardcode_direct=yes 3741 hardcode_shlibpath_var=no 3742 ;; 3743 3744 hpux9* | hpux10* | hpux11*) 3745 case $host_os in 3746 hpux9*) archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;; 3747 *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;; 3748 esac 3749 hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' 3750 hardcode_libdir_separator=: 3751 hardcode_direct=yes 3752 hardcode_minus_L=yes # Not in the search PATH, but as the default 3753 # location of the library. 3754 export_dynamic_flag_spec='${wl}-E' 3755 ;; 3756 3757 irix5* | irix6* | nonstopux*) 3758 if test "$GCC" = yes; then 3759 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' 3760 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' 3761 else 3762 archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' 3763 hardcode_libdir_flag_spec='-rpath $libdir' 3764 fi 3765 hardcode_libdir_separator=: 3766 link_all_deplibs=yes 3767 ;; 3768 3769 netbsd*) 3770 if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then 3771 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out 3772 else 3773 archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF 3774 fi 3775 hardcode_libdir_flag_spec='-R$libdir' 3776 hardcode_direct=yes 3777 hardcode_shlibpath_var=no 3778 ;; 3779 3780 newsos6) 3781 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' 3782 hardcode_direct=yes 3783 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' 3784 hardcode_libdir_separator=: 3785 hardcode_shlibpath_var=no 3786 ;; 3787 3788 openbsd*) 3789 hardcode_direct=yes 3790 hardcode_shlibpath_var=no 3791 if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then 3792 archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' 3793 hardcode_libdir_flag_spec='${wl}-rpath,$libdir' 3794 export_dynamic_flag_spec='${wl}-E' 3795 else 3796 case "$host_os" in 3797 openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) 3798 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' 3799 hardcode_libdir_flag_spec='-R$libdir' 3800 ;; 3801 *) 3802 archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' 3803 hardcode_libdir_flag_spec='${wl}-rpath,$libdir' 3804 ;; 3805 esac 3806 fi 3807 ;; 3808 3809 os2*) 3810 hardcode_libdir_flag_spec='-L$libdir' 3811 hardcode_minus_L=yes 3812 allow_undefined_flag=unsupported 3813 archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' 3814 old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' 3815 ;; 3816 3817 osf3*) 3818 if test "$GCC" = yes; then 3819 allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' 3820 archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' 3821 else 3822 allow_undefined_flag=' -expect_unresolved \*' 3823 archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' 3824 fi 3825 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' 3826 hardcode_libdir_separator=: 3827 ;; 3828 3829 osf4* | osf5*) # as osf3* with the addition of -msym flag 3830 if test "$GCC" = yes; then 3831 allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' 3832 archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' 3833 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' 3834 else 3835 allow_undefined_flag=' -expect_unresolved \*' 3836 archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' 3837 archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ 3838 $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' 3839 3840 #Both c and cxx compiler support -rpath directly 3841 hardcode_libdir_flag_spec='-rpath $libdir' 3842 fi 3843 hardcode_libdir_separator=: 3844 ;; 3845 3846 sco3.2v5*) 3847 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' 3848 hardcode_shlibpath_var=no 3849 runpath_var=LD_RUN_PATH 3850 hardcode_runpath_var=yes 3851 export_dynamic_flag_spec='${wl}-Bexport' 3852 ;; 3853 3854 solaris*) 3855 # gcc --version < 3.0 without binutils cannot create self contained 3856 # shared libraries reliably, requiring libgcc.a to resolve some of 3857 # the object symbols generated in some cases. Libraries that use 3858 # assert need libgcc.a to resolve __eprintf, for example. Linking 3859 # a copy of libgcc.a into every shared library to guarantee resolving 3860 # such symbols causes other problems: According to Tim Van Holder 3861 # <tim.van.holder@pandora.be>, C++ libraries end up with a separate 3862 # (to the application) exception stack for one thing. 3863 no_undefined_flag=' -z defs' 3864 if test "$GCC" = yes; then 3865 case `$CC --version 2>/dev/null` in 3866 [[12]].*) 3867 cat <<EOF 1>&2 3868 3869 *** Warning: Releases of GCC earlier than version 3.0 cannot reliably 3870 *** create self contained shared libraries on Solaris systems, without 3871 *** introducing a dependency on libgcc.a. Therefore, libtool is disabling 3872 *** -no-undefined support, which will at least allow you to build shared 3873 *** libraries. However, you may find that when you link such libraries 3874 *** into an application without using GCC, you have to manually add 3875 *** \`gcc --print-libgcc-file-name\` to the link command. We urge you to 3876 *** upgrade to a newer version of GCC. Another option is to rebuild your 3877 *** current GCC to use the GNU linker from GNU binutils 2.9.1 or newer. 3878 3879 EOF 3880 no_undefined_flag= 3881 ;; 3882 esac 3883 fi 3884 # $CC -shared without GNU ld will not create a library from C++ 3885 # object files and a static libstdc++, better avoid it by now 3886 archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' 3887 archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ 3888 $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' 3889 hardcode_libdir_flag_spec='-R$libdir' 3890 hardcode_shlibpath_var=no 3891 case $host_os in 3892 solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; 3893 *) # Supported since Solaris 2.6 (maybe 2.5.1?) 3894 whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; 3895 esac 3896 link_all_deplibs=yes 3897 ;; 3898 3899 sunos4*) 3900 if test "x$host_vendor" = xsequent; then 3901 # Use $CC to link under sequent, because it throws in some extra .o 3902 # files that make .init and .fini sections work. 3903 archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' 3904 else 3905 archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' 3906 fi 3907 hardcode_libdir_flag_spec='-L$libdir' 3908 hardcode_direct=yes 3909 hardcode_minus_L=yes 3910 hardcode_shlibpath_var=no 3911 ;; 3912 3913 sysv4) 3914 case $host_vendor in 3915 sni) 3916 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' 3917 hardcode_direct=yes # is this really true??? 3918 ;; 3919 siemens) 3920 ## LD is ld it makes a PLAMLIB 3921 ## CC just makes a GrossModule. 3922 archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' 3923 reload_cmds='$CC -r -o $output$reload_objs' 3924 hardcode_direct=no 3925 ;; 3926 motorola) 3927 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' 3928 hardcode_direct=no #Motorola manual says yes, but my tests say they lie 3929 ;; 3930 esac 3931 runpath_var='LD_RUN_PATH' 3932 hardcode_shlibpath_var=no 3933 ;; 3934 3935 sysv4.3*) 3936 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' 3937 hardcode_shlibpath_var=no 3938 export_dynamic_flag_spec='-Bexport' 3939 ;; 3940 3941 uts4*) 3942 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' 3943 hardcode_libdir_flag_spec='-L$libdir' 3944 hardcode_shlibpath_var=no 3945 ;; 3946 3947 dgux*) 3948 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' 3949 hardcode_libdir_flag_spec='-L$libdir' 3950 hardcode_shlibpath_var=no 3951 ;; 3952 3953 sysv4*MP*) 3954 if test -d /usr/nec; then 3955 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' 3956 hardcode_shlibpath_var=no 3957 runpath_var=LD_RUN_PATH 3958 hardcode_runpath_var=yes 3959 ld_shlibs=yes 3960 fi 3961 ;; 3962 3963 sysv4.2uw2*) 3964 archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' 3965 hardcode_direct=yes 3966 hardcode_minus_L=no 3967 hardcode_shlibpath_var=no 3968 hardcode_runpath_var=yes 3969 runpath_var=LD_RUN_PATH 3970 ;; 3971 3972 sysv5* | unixware7*) 3973 no_undefined_flag='${wl}-z ${wl}text' 3974 if test "$GCC" = yes; then 3975 archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' 3976 else 3977 archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' 3978 fi 3979 runpath_var='LD_RUN_PATH' 3980 hardcode_shlibpath_var=no 3981 ;; 3982 3983 *) 3984 ld_shlibs=no 3985 ;; 3986 esac 3987 fi 3988 AC_MSG_RESULT([$ld_shlibs]) 3989 test "$ld_shlibs" = no && can_build_shared=no 3990 ## 3991 ## END FIXME 3992 3993 ## FIXME: this should be a separate macro 3994 ## 3995 # Check hardcoding attributes. 3996 AC_MSG_CHECKING([how to hardcode library paths into programs]) 3997 hardcode_action= 3998 if test -n "$hardcode_libdir_flag_spec" || \ 3999 test -n "$runpath_var"; then 4000 4001 # We can hardcode non-existant directories. 4002 if test "$hardcode_direct" != no && 4003 # If the only mechanism to avoid hardcoding is shlibpath_var, we 4004 # have to relink, otherwise we might link with an installed library 4005 # when we should be linking with a yet-to-be-installed one 4006 ## test "$hardcode_shlibpath_var" != no && 4007 test "$hardcode_minus_L" != no; then 4008 # Linking always hardcodes the temporary library directory. 4009 hardcode_action=relink 4010 else 4011 # We can link without hardcoding, and we can hardcode nonexisting dirs. 4012 hardcode_action=immediate 4013 fi 4014 else 4015 # We cannot hardcode anything, or else we can only hardcode existing 4016 # directories. 4017 hardcode_action=unsupported 4018 fi 4019 AC_MSG_RESULT([$hardcode_action]) 4020 ## 4021 ## END FIXME 4022 4023 ## FIXME: this should be a separate macro 4024 ## 4025 striplib= 4026 old_striplib= 4027 AC_MSG_CHECKING([whether stripping libraries is possible]) 4028 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then 4029 test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" 4030 test -z "$striplib" && striplib="$STRIP --strip-unneeded" 4031 AC_MSG_RESULT([yes]) 4032 else 4033 AC_MSG_RESULT([no]) 4034 fi 4035 ## 4036 ## END FIXME 4037 4038 reload_cmds='$LD$reload_flag -o $output$reload_objs' 4039 test -z "$deplibs_check_method" && deplibs_check_method=unknown 4040 4041 ## FIXME: this should be a separate macro 4042 ## 4043 # PORTME Fill in your ld.so characteristics 4044 AC_MSG_CHECKING([dynamic linker characteristics]) 4045 library_names_spec= 4046 libname_spec='lib$name' 4047 soname_spec= 4048 postinstall_cmds= 4049 postuninstall_cmds= 4050 finish_cmds= 4051 finish_eval= 4052 shlibpath_var= 4053 shlibpath_overrides_runpath=unknown 4054 version_type=none 4055 dynamic_linker="$host_os ld.so" 4056 sys_lib_dlsearch_path_spec="/lib /usr/lib" 4057 sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" 4058 4059 case $host_os in 4060 aix3*) 4061 version_type=linux 4062 library_names_spec='${libname}${release}.so$versuffix $libname.a' 4063 shlibpath_var=LIBPATH 4064 4065 # AIX has no versioning support, so we append a major version to the name. 4066 soname_spec='${libname}${release}.so$major' 4067 ;; 4068 4069 aix4* | aix5*) 4070 version_type=linux 4071 need_lib_prefix=no 4072 need_version=no 4073 hardcode_into_libs=yes 4074 if test "$host_cpu" = ia64; then 4075 # AIX 5 supports IA64 4076 library_names_spec='${libname}${release}.so$major ${libname}${release}.so$versuffix $libname.so' 4077 shlibpath_var=LD_LIBRARY_PATH 4078 else 4079 # With GCC up to 2.95.x, collect2 would create an import file 4080 # for dependence libraries. The import file would start with 4081 # the line `#! .'. This would cause the generated library to 4082 # depend on `.', always an invalid library. This was fixed in 4083 # development snapshots of GCC prior to 3.0. 4084 case $host_os in 4085 aix4 | aix4.[[01]] | aix4.[[01]].*) 4086 if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' 4087 echo ' yes ' 4088 echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then 4089 : 4090 else 4091 can_build_shared=no 4092 fi 4093 ;; 4094 esac 4095 # AIX (on Power*) has no versioning support, so currently we can 4096 # not hardcode correct soname into executable. Probably we can 4097 # add versioning support to collect2, so additional links can 4098 # be useful in future. 4099 if test "$aix_use_runtimelinking" = yes; then 4100 # If using run time linking (on AIX 4.2 or later) use lib<name>.so 4101 # instead of lib<name>.a to let people know that these are not 4102 # typical AIX shared libraries. 4103 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' 4104 else 4105 # We preserve .a as extension for shared libraries through AIX4.2 4106 # and later when we are not doing run time linking. 4107 library_names_spec='${libname}${release}.a $libname.a' 4108 soname_spec='${libname}${release}.so$major' 4109 fi 4110 shlibpath_var=LIBPATH 4111 fi 4112 hardcode_into_libs=yes 4113 ;; 4114 4115 amigaos*) 4116 library_names_spec='$libname.ixlibrary $libname.a' 4117 # Create ${libname}_ixlibrary.a entries in /sys/libs. 4118 finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' 4119 ;; 4120 4121 beos*) 4122 library_names_spec='${libname}.so' 4123 dynamic_linker="$host_os ld.so" 4124 shlibpath_var=LIBRARY_PATH 4125 ;; 4126 4127 bsdi4*) 4128 version_type=linux 4129 need_version=no 4130 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' 4131 soname_spec='${libname}${release}.so$major' 4132 finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' 4133 shlibpath_var=LD_LIBRARY_PATH 4134 sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" 4135 sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" 4136 export_dynamic_flag_spec=-rdynamic 4137 # the default ld.so.conf also contains /usr/contrib/lib and 4138 # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow 4139 # libtool to hard-code these into programs 4140 ;; 4141 4142 cygwin* | mingw* | pw32*) 4143 version_type=windows 4144 need_version=no 4145 need_lib_prefix=no 4146 case $GCC,$host_os in 4147 yes,cygwin*) 4148 library_names_spec='$libname.dll.a' 4149 soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll' 4150 postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~ 4151 dldir=$destdir/`dirname \$dlpath`~ 4152 test -d \$dldir || mkdir -p \$dldir~ 4153 $install_prog .libs/$dlname \$dldir/$dlname' 4154 postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~ 4155 dlpath=$dir/\$dldll~ 4156 $rm \$dlpath' 4157 ;; 4158 yes,mingw*) 4159 library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll' 4160 sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g" -e "s,=/,/,g"` 4161 ;; 4162 yes,pw32*) 4163 library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll' 4164 ;; 4165 *) 4166 library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll $libname.lib' 4167 ;; 4168 esac 4169 dynamic_linker='Win32 ld.exe' 4170 # FIXME: first we should search . and the directory the executable is in 4171 shlibpath_var=PATH 4172 ;; 4173 4174 darwin* | rhapsody*) 4175 dynamic_linker="$host_os dyld" 4176 version_type=darwin 4177 need_lib_prefix=no 4178 need_version=no 4179 # FIXME: Relying on posixy $() will cause problems for 4180 # cross-compilation, but unfortunately the echo tests do not 4181 # yet detect zsh echo's removal of \ escapes. 4182 library_names_spec='${libname}${release}${versuffix}.$(test .$module = .yes && echo so || echo dylib) ${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib) ${libname}.$(test .$module = .yes && echo so || echo dylib)' 4183 soname_spec='${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib)' 4184 shlibpath_overrides_runpath=yes 4185 shlibpath_var=DYLD_LIBRARY_PATH 4186 ;; 4187 4188 freebsd1*) 4189 dynamic_linker=no 4190 ;; 4191 4192 freebsd*) 4193 objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` 4194 version_type=freebsd-$objformat 4195 case $version_type in 4196 freebsd-elf*) 4197 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' 4198 need_version=no 4199 need_lib_prefix=no 4200 ;; 4201 freebsd-*) 4202 library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix' 4203 need_version=yes 4204 ;; 4205 esac 4206 shlibpath_var=LD_LIBRARY_PATH 4207 case $host_os in 4208 freebsd2*) 4209 shlibpath_overrides_runpath=yes 4210 ;; 4211 *) 4212 shlibpath_overrides_runpath=no 4213 hardcode_into_libs=yes 4214 ;; 4215 esac 4216 ;; 4217 4218 gnu*) 4219 version_type=linux 4220 need_lib_prefix=no 4221 need_version=no 4222 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so' 4223 soname_spec='${libname}${release}.so$major' 4224 shlibpath_var=LD_LIBRARY_PATH 4225 hardcode_into_libs=yes 4226 ;; 4227 4228 hpux9* | hpux10* | hpux11*) 4229 # Give a soname corresponding to the major version so that dld.sl refuses to 4230 # link against other versions. 4231 dynamic_linker="$host_os dld.sl" 4232 version_type=sunos 4233 need_lib_prefix=no 4234 need_version=no 4235 shlibpath_var=SHLIB_PATH 4236 shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH 4237 library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl' 4238 soname_spec='${libname}${release}.sl$major' 4239 # HP-UX runs *really* slowly unless shared libraries are mode 555. 4240 postinstall_cmds='chmod 555 $lib' 4241 ;; 4242 4243 irix5* | irix6* | nonstopux*) 4244 case $host_os in 4245 nonstopux*) version_type=nonstopux ;; 4246 *) version_type=irix ;; 4247 esac 4248 need_lib_prefix=no 4249 need_version=no 4250 soname_spec='${libname}${release}.so$major' 4251 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so' 4252 case $host_os in 4253 irix5* | nonstopux*) 4254 libsuff= shlibsuff= 4255 ;; 4256 *) 4257 case $LD in # libtool.m4 will add one of these switches to LD 4258 *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;; 4259 *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; 4260 *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;; 4261 *) libsuff= shlibsuff= libmagic=never-match;; 4262 esac 4263 ;; 4264 esac 4265 shlibpath_var=LD_LIBRARY${shlibsuff}_PATH 4266 shlibpath_overrides_runpath=no 4267 sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" 4268 sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" 4269 ;; 4270 4271 # No shared lib support for Linux oldld, aout, or coff. 4272 linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*) 4273 dynamic_linker=no 4274 ;; 4275 4276 # This must be Linux ELF. 4277 linux-gnu*) 4278 version_type=linux 4279 need_lib_prefix=no 4280 need_version=no 4281 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' 4282 soname_spec='${libname}${release}.so$major' 4283 finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' 4284 shlibpath_var=LD_LIBRARY_PATH 4285 shlibpath_overrides_runpath=no 4286 # This implies no fast_install, which is unacceptable. 4287 # Some rework will be needed to allow for fast_install 4288 # before this can be enabled. 4289 hardcode_into_libs=yes 4290 4291 # We used to test for /lib/ld.so.1 and disable shared libraries on 4292 # powerpc, because MkLinux only supported shared libraries with the 4293 # GNU dynamic linker. Since this was broken with cross compilers, 4294 # most powerpc-linux boxes support dynamic linking these days and 4295 # people can always --disable-shared, the test was removed, and we 4296 # assume the GNU/Linux dynamic linker is in use. 4297 dynamic_linker='GNU/Linux ld.so' 4298 4299 # Find out which ABI we are using (multilib Linux x86_64 hack). 4300 libsuff= 4301 case "$host_cpu" in 4302 x86_64*|s390x*) 4303 echo '[#]line __oline__ "configure"' > conftest.$ac_ext 4304 if AC_TRY_EVAL(ac_compile); then 4305 case `/usr/bin/file conftest.$ac_objext` in 4306 *64-bit*) 4307 libsuff=64 4308 ;; 4309 esac 4310 fi 4311 rm -rf conftest* 4312 ;; 4313 *) 4314 ;; 4315 esac 4316 sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff}" 4317 sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" 4318 ;; 4319 4320 netbsd*) 4321 version_type=sunos 4322 need_lib_prefix=no 4323 need_version=no 4324 if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then 4325 library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' 4326 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' 4327 dynamic_linker='NetBSD (a.out) ld.so' 4328 else 4329 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so' 4330 soname_spec='${libname}${release}.so$major' 4331 dynamic_linker='NetBSD ld.elf_so' 4332 fi 4333 shlibpath_var=LD_LIBRARY_PATH 4334 shlibpath_overrides_runpath=yes 4335 hardcode_into_libs=yes 4336 ;; 4337 4338 newsos6) 4339 version_type=linux 4340 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' 4341 shlibpath_var=LD_LIBRARY_PATH 4342 shlibpath_overrides_runpath=yes 4343 ;; 4344 4345 openbsd*) 4346 version_type=sunos 4347 need_lib_prefix=no 4348 need_version=no 4349 if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then 4350 case "$host_os" in 4351 openbsd2.[[89]] | openbsd2.[[89]].*) 4352 shlibpath_overrides_runpath=no 4353 ;; 4354 *) 4355 shlibpath_overrides_runpath=yes 4356 ;; 4357 esac 4358 else 4359 shlibpath_overrides_runpath=yes 4360 fi 4361 library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' 4362 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' 4363 shlibpath_var=LD_LIBRARY_PATH 4364 ;; 4365 4366 os2*) 4367 libname_spec='$name' 4368 need_lib_prefix=no 4369 library_names_spec='$libname.dll $libname.a' 4370 dynamic_linker='OS/2 ld.exe' 4371 shlibpath_var=LIBPATH 4372 ;; 4373 4374 osf3* | osf4* | osf5*) 4375 version_type=osf 4376 need_version=no 4377 soname_spec='${libname}${release}.so$major' 4378 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' 4379 shlibpath_var=LD_LIBRARY_PATH 4380 sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" 4381 sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" 4382 hardcode_into_libs=yes 4383 ;; 4384 4385 sco3.2v5*) 4386 version_type=osf 4387 soname_spec='${libname}${release}.so$major' 4388 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' 4389 shlibpath_var=LD_LIBRARY_PATH 4390 ;; 4391 4392 solaris*) 4393 version_type=linux 4394 need_lib_prefix=no 4395 need_version=no 4396 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' 4397 soname_spec='${libname}${release}.so$major' 4398 shlibpath_var=LD_LIBRARY_PATH 4399 shlibpath_overrides_runpath=yes 4400 hardcode_into_libs=yes 4401 # ldd complains unless libraries are executable 4402 postinstall_cmds='chmod +x $lib' 4403 ;; 4404 4405 sunos4*) 4406 version_type=sunos 4407 library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' 4408 finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' 4409 shlibpath_var=LD_LIBRARY_PATH 4410 shlibpath_overrides_runpath=yes 4411 if test "$with_gnu_ld" = yes; then 4412 need_lib_prefix=no 4413 fi 4414 need_version=yes 4415 ;; 4416 4417 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) 4418 version_type=linux 4419 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' 4420 soname_spec='${libname}${release}.so$major' 4421 shlibpath_var=LD_LIBRARY_PATH 4422 case $host_vendor in 4423 sni) 4424 shlibpath_overrides_runpath=no 4425 need_lib_prefix=no 4426 export_dynamic_flag_spec='${wl}-Blargedynsym' 4427 runpath_var=LD_RUN_PATH 4428 ;; 4429 siemens) 4430 need_lib_prefix=no 4431 ;; 4432 motorola) 4433 need_lib_prefix=no 4434 need_version=no 4435 shlibpath_overrides_runpath=no 4436 sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' 4437 ;; 4438 esac 4439 ;; 4440 4441 uts4*) 4442 version_type=linux 4443 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' 4444 soname_spec='${libname}${release}.so$major' 4445 shlibpath_var=LD_LIBRARY_PATH 4446 ;; 4447 4448 dgux*) 4449 version_type=linux 4450 need_lib_prefix=no 4451 need_version=no 4452 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' 4453 soname_spec='${libname}${release}.so$major' 4454 shlibpath_var=LD_LIBRARY_PATH 4455 ;; 4456 4457 sysv4*MP*) 4458 if test -d /usr/nec ;then 4459 version_type=linux 4460 library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so' 4461 soname_spec='$libname.so.$major' 4462 shlibpath_var=LD_LIBRARY_PATH 4463 fi 4464 ;; 4465 4466 *) 4467 dynamic_linker=no 4468 ;; 4469 esac 4470 AC_MSG_RESULT([$dynamic_linker]) 4471 test "$dynamic_linker" = no && can_build_shared=no 4472 ## 4473 ## END FIXME 4474 4475 ## FIXME: this should be a separate macro 4476 ## 4477 # Report the final consequences. 4478 AC_MSG_CHECKING([if libtool supports shared libraries]) 4479 AC_MSG_RESULT([$can_build_shared]) 4480 ## 4481 ## END FIXME 4482 4483 ## FIXME: this should be a separate macro 4484 ## 4485 AC_MSG_CHECKING([whether to build shared libraries]) 4486 test "$can_build_shared" = "no" && enable_shared=no 4487 4488 # On AIX, shared libraries and static libraries use the same namespace, and 4489 # are all built from PIC. 4490 case "$host_os" in 4491 aix3*) 4492 test "$enable_shared" = yes && enable_static=no 4493 if test -n "$RANLIB"; then 4494 archive_cmds="$archive_cmds~\$RANLIB \$lib" 4495 postinstall_cmds='$RANLIB $lib' 4496 fi 4497 ;; 4498 4499 aix4*) 4500 if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then 4501 test "$enable_shared" = yes && enable_static=no 4502 fi 4503 ;; 4504 esac 4505 AC_MSG_RESULT([$enable_shared]) 4506 ## 4507 ## END FIXME 4508 4509 ## FIXME: this should be a separate macro 4510 ## 4511 AC_MSG_CHECKING([whether to build static libraries]) 4512 # Make sure either enable_shared or enable_static is yes. 4513 test "$enable_shared" = yes || enable_static=yes 4514 AC_MSG_RESULT([$enable_static]) 4515 ## 4516 ## END FIXME 4517 4518 if test "$hardcode_action" = relink; then 4519 # Fast installation is not supported 4520 enable_fast_install=no 4521 elif test "$shlibpath_overrides_runpath" = yes || 4522 test "$enable_shared" = no; then 4523 # Fast installation is not necessary 4524 enable_fast_install=needless 4525 fi 4526 4527 variables_saved_for_relink="PATH $shlibpath_var $runpath_var" 4528 if test "$GCC" = yes; then 4529 variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" 4530 fi 4531 4532 AC_LIBTOOL_DLOPEN_SELF 4533 4534 ## FIXME: this should be a separate macro 4535 ## 4536 if test "$enable_shared" = yes && test "$GCC" = yes; then 4537 case $archive_cmds in 4538 *'~'*) 4539 # FIXME: we may have to deal with multi-command sequences. 4540 ;; 4541 '$CC '*) 4542 # Test whether the compiler implicitly links with -lc since on some 4543 # systems, -lgcc has to come before -lc. If gcc already passes -lc 4544 # to ld, don't add -lc before -lgcc. 4545 AC_MSG_CHECKING([whether -lc should be explicitly linked in]) 4546 AC_CACHE_VAL([lt_cv_archive_cmds_need_lc], 4547 [$rm conftest* 4548 echo 'static int dummy;' > conftest.$ac_ext 4549 4550 if AC_TRY_EVAL(ac_compile); then 4551 soname=conftest 4552 lib=conftest 4553 libobjs=conftest.$ac_objext 4554 deplibs= 4555 wl=$lt_cv_prog_cc_wl 4556 compiler_flags=-v 4557 linker_flags=-v 4558 verstring= 4559 output_objdir=. 4560 libname=conftest 4561 save_allow_undefined_flag=$allow_undefined_flag 4562 allow_undefined_flag= 4563 if AC_TRY_EVAL(archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 4564 then 4565 lt_cv_archive_cmds_need_lc=no 4566 else 4567 lt_cv_archive_cmds_need_lc=yes 4568 fi 4569 allow_undefined_flag=$save_allow_undefined_flag 4570 else 4571 cat conftest.err 1>&5 4572 fi]) 4573 AC_MSG_RESULT([$lt_cv_archive_cmds_need_lc]) 4574 ;; 4575 esac 4576 fi 4577 need_lc=${lt_cv_archive_cmds_need_lc-yes} 4578 ## 4579 ## END FIXME 4580 4581 ## FIXME: this should be a separate macro 4582 ## 4583 # The second clause should only fire when bootstrapping the 4584 # libtool distribution, otherwise you forgot to ship ltmain.sh 4585 # with your package, and you will get complaints that there are 4586 # no rules to generate ltmain.sh. 4587 if test -f "$ltmain"; then 4588 : 4589 else 4590 # If there is no Makefile yet, we rely on a make rule to execute 4591 # `config.status --recheck' to rerun these tests and create the 4592 # libtool script then. 4593 test -f Makefile && make "$ltmain" 4594 fi 4595 4596 if test -f "$ltmain"; then 4597 trap "$rm \"${ofile}T\"; exit 1" 1 2 15 4598 $rm -f "${ofile}T" 4599 4600 echo creating $ofile 4601 4602 # Now quote all the things that may contain metacharacters while being 4603 # careful not to overquote the AC_SUBSTed values. We take copies of the 4604 # variables and quote the copies for generation of the libtool script. 4605 for var in echo old_CC old_CFLAGS SED \ 4606 AR AR_FLAGS CC LD LN_S NM SHELL \ 4607 reload_flag reload_cmds wl \ 4608 pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \ 4609 thread_safe_flag_spec whole_archive_flag_spec libname_spec \ 4610 library_names_spec soname_spec \ 4611 RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \ 4612 old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \ 4613 postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \ 4614 old_striplib striplib file_magic_cmd export_symbols_cmds \ 4615 deplibs_check_method allow_undefined_flag no_undefined_flag \ 4616 finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \ 4617 global_symbol_to_c_name_address \ 4618 hardcode_libdir_flag_spec hardcode_libdir_separator \ 4619 sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ 4620 compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do 4621 4622 case $var in 4623 reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \ 4624 old_postinstall_cmds | old_postuninstall_cmds | \ 4625 export_symbols_cmds | archive_cmds | archive_expsym_cmds | \ 4626 extract_expsyms_cmds | old_archive_from_expsyms_cmds | \ 4627 postinstall_cmds | postuninstall_cmds | \ 4628 finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) 4629 # Double-quote double-evaled strings. 4630 eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" 4631 ;; 4632 *) 4633 eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" 4634 ;; 4635 esac 4636 done 4637 4638 cat <<__EOF__ > "${ofile}T" 4639 #! $SHELL 4640 4641 # `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. 4642 # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) 4643 # NOTE: Changes made to this file will be lost: look at ltmain.sh. 4644 # 4645 # Copyright (C) 1996-2000 Free Software Foundation, Inc. 4646 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 4647 # 4648 # This program is free software; you can redistribute it and/or modify 4649 # it under the terms of the GNU General Public License as published by 4650 # the Free Software Foundation; either version 2 of the License, or 4651 # (at your option) any later version. 4652 # 4653 # This program is distributed in the hope that it will be useful, but 4654 # WITHOUT ANY WARRANTY; without even the implied warranty of 4655 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 4656 # General Public License for more details. 4657 # 4658 # You should have received a copy of the GNU General Public License 4659 # along with this program; if not, write to the Free Software 4660 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 4661 # 4662 # As a special exception to the GNU General Public License, if you 4663 # distribute this file as part of a program that contains a 4664 # configuration script generated by Autoconf, you may include it under 4665 # the same distribution terms that you use for the rest of that program. 4666 4667 # A sed that does not truncate output. 4668 SED=$lt_SED 4669 4670 # Sed that helps us avoid accidentally triggering echo(1) options like -n. 4671 Xsed="${SED} -e s/^X//" 4672 4673 # The HP-UX ksh and POSIX shell print the target directory to stdout 4674 # if CDPATH is set. 4675 if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi 4676 4677 # ### BEGIN LIBTOOL CONFIG 4678 4679 # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: 4680 4681 # Shell to use when invoking shell scripts. 4682 SHELL=$lt_SHELL 4683 4684 # Whether or not to build shared libraries. 4685 build_libtool_libs=$enable_shared 4686 4687 # Whether or not to build static libraries. 4688 build_old_libs=$enable_static 4689 4690 # Whether or not to add -lc for building shared libraries. 4691 build_libtool_need_lc=$need_lc 4692 4693 # Whether or not to optimize for fast installation. 4694 fast_install=$enable_fast_install 4695 4696 # The host system. 4697 host_alias=$host_alias 4698 host=$host 4699 4700 # An echo program that does not interpret backslashes. 4701 echo=$lt_echo 4702 4703 # The archiver. 4704 AR=$lt_AR 4705 AR_FLAGS=$lt_AR_FLAGS 4706 4707 # The default C compiler. 4708 CC=$lt_CC 4709 4710 # Is the compiler the GNU C compiler? 4711 with_gcc=$GCC 4712 4713 # The linker used to build libraries. 4714 LD=$lt_LD 4715 4716 # Whether we need hard or soft links. 4717 LN_S=$lt_LN_S 4718 4719 # A BSD-compatible nm program. 4720 NM=$lt_NM 4721 4722 # A symbol stripping program 4723 STRIP=$STRIP 4724 4725 # Used to examine libraries when file_magic_cmd begins "file" 4726 MAGIC_CMD=$MAGIC_CMD 4727 4728 # Used on cygwin: DLL creation program. 4729 DLLTOOL="$DLLTOOL" 4730 4731 # Used on cygwin: object dumper. 4732 OBJDUMP="$OBJDUMP" 4733 4734 # Used on cygwin: assembler. 4735 AS="$AS" 4736 4737 # The name of the directory that contains temporary libtool files. 4738 objdir=$objdir 4739 4740 # How to create reloadable object files. 4741 reload_flag=$lt_reload_flag 4742 reload_cmds=$lt_reload_cmds 4743 4744 # How to pass a linker flag through the compiler. 4745 wl=$lt_wl 4746 4747 # Object file suffix (normally "o"). 4748 objext="$ac_objext" 4749 4750 # Old archive suffix (normally "a"). 4751 libext="$libext" 4752 4753 # Executable file suffix (normally ""). 4754 exeext="$exeext" 4755 4756 # Additional compiler flags for building library objects. 4757 pic_flag=$lt_pic_flag 4758 pic_mode=$pic_mode 4759 4760 # Does compiler simultaneously support -c and -o options? 4761 compiler_c_o=$lt_compiler_c_o 4762 4763 # Can we write directly to a .lo ? 4764 compiler_o_lo=$lt_compiler_o_lo 4765 4766 # Must we lock files when doing compilation ? 4767 need_locks=$lt_need_locks 4768 4769 # Do we need the lib prefix for modules? 4770 need_lib_prefix=$need_lib_prefix 4771 4772 # Do we need a version for libraries? 4773 need_version=$need_version 4774 4775 # Whether dlopen is supported. 4776 dlopen_support=$enable_dlopen 4777 4778 # Whether dlopen of programs is supported. 4779 dlopen_self=$enable_dlopen_self 4780 4781 # Whether dlopen of statically linked programs is supported. 4782 dlopen_self_static=$enable_dlopen_self_static 4783 4784 # Compiler flag to prevent dynamic linking. 4785 link_static_flag=$lt_link_static_flag 4786 4787 # Compiler flag to turn off builtin functions. 4788 no_builtin_flag=$lt_no_builtin_flag 4789 4790 # Compiler flag to allow reflexive dlopens. 4791 export_dynamic_flag_spec=$lt_export_dynamic_flag_spec 4792 4793 # Compiler flag to generate shared objects directly from archives. 4794 whole_archive_flag_spec=$lt_whole_archive_flag_spec 4795 4796 # Compiler flag to generate thread-safe objects. 4797 thread_safe_flag_spec=$lt_thread_safe_flag_spec 4798 4799 # Library versioning type. 4800 version_type=$version_type 4801 4802 # Format of library name prefix. 4803 libname_spec=$lt_libname_spec 4804 4805 # List of archive names. First name is the real one, the rest are links. 4806 # The last name is the one that the linker finds with -lNAME. 4807 library_names_spec=$lt_library_names_spec 4808 4809 # The coded name of the library, if different from the real name. 4810 soname_spec=$lt_soname_spec 4811 4812 # Commands used to build and install an old-style archive. 4813 RANLIB=$lt_RANLIB 4814 old_archive_cmds=$lt_old_archive_cmds 4815 old_postinstall_cmds=$lt_old_postinstall_cmds 4816 old_postuninstall_cmds=$lt_old_postuninstall_cmds 4817 4818 # Create an old-style archive from a shared archive. 4819 old_archive_from_new_cmds=$lt_old_archive_from_new_cmds 4820 4821 # Create a temporary old-style archive to link instead of a shared archive. 4822 old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds 4823 4824 # Commands used to build and install a shared archive. 4825 archive_cmds=$lt_archive_cmds 4826 archive_expsym_cmds=$lt_archive_expsym_cmds 4827 postinstall_cmds=$lt_postinstall_cmds 4828 postuninstall_cmds=$lt_postuninstall_cmds 4829 4830 # Commands to strip libraries. 4831 old_striplib=$lt_old_striplib 4832 striplib=$lt_striplib 4833 4834 # Method to check whether dependent libraries are shared objects. 4835 deplibs_check_method=$lt_deplibs_check_method 4836 4837 # Command to use when deplibs_check_method == file_magic. 4838 file_magic_cmd=$lt_file_magic_cmd 4839 4840 # Flag that allows shared libraries with undefined symbols to be built. 4841 allow_undefined_flag=$lt_allow_undefined_flag 4842 4843 # Flag that forces no undefined symbols. 4844 no_undefined_flag=$lt_no_undefined_flag 4845 4846 # Commands used to finish a libtool library installation in a directory. 4847 finish_cmds=$lt_finish_cmds 4848 4849 # Same as above, but a single script fragment to be evaled but not shown. 4850 finish_eval=$lt_finish_eval 4851 4852 # Take the output of nm and produce a listing of raw symbols and C names. 4853 global_symbol_pipe=$lt_global_symbol_pipe 4854 4855 # Transform the output of nm in a proper C declaration 4856 global_symbol_to_cdecl=$lt_global_symbol_to_cdecl 4857 4858 # Transform the output of nm in a C name address pair 4859 global_symbol_to_c_name_address=$lt_global_symbol_to_c_name_address 4860 4861 # This is the shared library runtime path variable. 4862 runpath_var=$runpath_var 4863 4864 # This is the shared library path variable. 4865 shlibpath_var=$shlibpath_var 4866 4867 # Is shlibpath searched before the hard-coded library search path? 4868 shlibpath_overrides_runpath=$shlibpath_overrides_runpath 4869 4870 # How to hardcode a shared library path into an executable. 4871 hardcode_action=$hardcode_action 4872 4873 # Whether we should hardcode library paths into libraries. 4874 hardcode_into_libs=$hardcode_into_libs 4875 4876 # Flag to hardcode \$libdir into a binary during linking. 4877 # This must work even if \$libdir does not exist. 4878 hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec 4879 4880 # Whether we need a single -rpath flag with a separated argument. 4881 hardcode_libdir_separator=$lt_hardcode_libdir_separator 4882 4883 # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the 4884 # resulting binary. 4885 hardcode_direct=$hardcode_direct 4886 4887 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the 4888 # resulting binary. 4889 hardcode_minus_L=$hardcode_minus_L 4890 4891 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into 4892 # the resulting binary. 4893 hardcode_shlibpath_var=$hardcode_shlibpath_var 4894 4895 # Variables whose values should be saved in libtool wrapper scripts and 4896 # restored at relink time. 4897 variables_saved_for_relink="$variables_saved_for_relink" 4898 4899 # Whether libtool must link a program against all its dependency libraries. 4900 link_all_deplibs=$link_all_deplibs 4901 4902 # Compile-time system search path for libraries 4903 sys_lib_search_path_spec=$lt_sys_lib_search_path_spec 4904 4905 # Run-time system search path for libraries 4906 sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec 4907 4908 # Fix the shell variable \$srcfile for the compiler. 4909 fix_srcfile_path="$fix_srcfile_path" 4910 4911 # Set to yes if exported symbols are required. 4912 always_export_symbols=$always_export_symbols 4913 4914 # The commands to list exported symbols. 4915 export_symbols_cmds=$lt_export_symbols_cmds 4916 4917 # The commands to extract the exported symbol list from a shared archive. 4918 extract_expsyms_cmds=$lt_extract_expsyms_cmds 4919 4920 # Symbols that should not be listed in the preloaded symbols. 4921 exclude_expsyms=$lt_exclude_expsyms 4922 4923 # Symbols that must always be exported. 4924 include_expsyms=$lt_include_expsyms 4925 4926 # ### END LIBTOOL CONFIG 4927 4928 __EOF__ 4929 4930 case $host_os in 4931 aix3*) 4932 cat <<\EOF >> "${ofile}T" 4933 4934 # AIX sometimes has problems with the GCC collect2 program. For some 4935 # reason, if we set the COLLECT_NAMES environment variable, the problems 4936 # vanish in a puff of smoke. 4937 if test "X${COLLECT_NAMES+set}" != Xset; then 4938 COLLECT_NAMES= 4939 export COLLECT_NAMES 4940 fi 4941 EOF 4942 ;; 4943 esac 4944 4945 case $host_os in 4946 cygwin* | mingw* | pw32* | os2*) 4947 cat <<'EOF' >> "${ofile}T" 4948 # This is a source program that is used to create dlls on Windows 4949 # Don't remove nor modify the starting and closing comments 4950 # /* ltdll.c starts here */ 4951 # #define WIN32_LEAN_AND_MEAN 4952 # #include <windows.h> 4953 # #undef WIN32_LEAN_AND_MEAN 4954 # #include <stdio.h> 4955 # 4956 # #ifndef __CYGWIN__ 4957 # # ifdef __CYGWIN32__ 4958 # # define __CYGWIN__ __CYGWIN32__ 4959 # # endif 4960 # #endif 4961 # 4962 # #ifdef __cplusplus 4963 # extern "C" { 4964 # #endif 4965 # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); 4966 # #ifdef __cplusplus 4967 # } 4968 # #endif 4969 # 4970 # #ifdef __CYGWIN__ 4971 # #include <cygwin/cygwin_dll.h> 4972 # DECLARE_CYGWIN_DLL( DllMain ); 4973 # #endif 4974 # HINSTANCE __hDllInstance_base; 4975 # 4976 # BOOL APIENTRY 4977 # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) 4978 # { 4979 # __hDllInstance_base = hInst; 4980 # return TRUE; 4981 # } 4982 # /* ltdll.c ends here */ 4983 # This is a source program that is used to create import libraries 4984 # on Windows for dlls which lack them. Don't remove nor modify the 4985 # starting and closing comments 4986 # /* impgen.c starts here */ 4987 # /* Copyright (C) 1999-2000 Free Software Foundation, Inc. 4988 # 4989 # This file is part of GNU libtool. 4990 # 4991 # This program is free software; you can redistribute it and/or modify 4992 # it under the terms of the GNU General Public License as published by 4993 # the Free Software Foundation; either version 2 of the License, or 4994 # (at your option) any later version. 4995 # 4996 # This program is distributed in the hope that it will be useful, 4997 # but WITHOUT ANY WARRANTY; without even the implied warranty of 4998 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 4999 # GNU General Public License for more details. 5000 # 5001 # You should have received a copy of the GNU General Public License 5002 # along with this program; if not, write to the Free Software 5003 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 5004 # */ 5005 # 5006 # #include <stdio.h> /* for printf() */ 5007 # #include <unistd.h> /* for open(), lseek(), read() */ 5008 # #include <fcntl.h> /* for O_RDONLY, O_BINARY */ 5009 # #include <string.h> /* for strdup() */ 5010 # 5011 # /* O_BINARY isn't required (or even defined sometimes) under Unix */ 5012 # #ifndef O_BINARY 5013 # #define O_BINARY 0 5014 # #endif 5015 # 5016 # static unsigned int 5017 # pe_get16 (fd, offset) 5018 # int fd; 5019 # int offset; 5020 # { 5021 # unsigned char b[2]; 5022 # lseek (fd, offset, SEEK_SET); 5023 # read (fd, b, 2); 5024 # return b[0] + (b[1]<<8); 5025 # } 5026 # 5027 # static unsigned int 5028 # pe_get32 (fd, offset) 5029 # int fd; 5030 # int offset; 5031 # { 5032 # unsigned char b[4]; 5033 # lseek (fd, offset, SEEK_SET); 5034 # read (fd, b, 4); 5035 # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); 5036 # } 5037 # 5038 # static unsigned int 5039 # pe_as32 (ptr) 5040 # void *ptr; 5041 # { 5042 # unsigned char *b = ptr; 5043 # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); 5044 # } 5045 # 5046 # int 5047 # main (argc, argv) 5048 # int argc; 5049 # char *argv[]; 5050 # { 5051 # int dll; 5052 # unsigned long pe_header_offset, opthdr_ofs, num_entries, i; 5053 # unsigned long export_rva, export_size, nsections, secptr, expptr; 5054 # unsigned long name_rvas, nexp; 5055 # unsigned char *expdata, *erva; 5056 # char *filename, *dll_name; 5057 # 5058 # filename = argv[1]; 5059 # 5060 # dll = open(filename, O_RDONLY|O_BINARY); 5061 # if (dll < 1) 5062 # return 1; 5063 # 5064 # dll_name = filename; 5065 # 5066 # for (i=0; filename[i]; i++) 5067 # if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':') 5068 # dll_name = filename + i +1; 5069 # 5070 # pe_header_offset = pe_get32 (dll, 0x3c); 5071 # opthdr_ofs = pe_header_offset + 4 + 20; 5072 # num_entries = pe_get32 (dll, opthdr_ofs + 92); 5073 # 5074 # if (num_entries < 1) /* no exports */ 5075 # return 1; 5076 # 5077 # export_rva = pe_get32 (dll, opthdr_ofs + 96); 5078 # export_size = pe_get32 (dll, opthdr_ofs + 100); 5079 # nsections = pe_get16 (dll, pe_header_offset + 4 +2); 5080 # secptr = (pe_header_offset + 4 + 20 + 5081 # pe_get16 (dll, pe_header_offset + 4 + 16)); 5082 # 5083 # expptr = 0; 5084 # for (i = 0; i < nsections; i++) 5085 # { 5086 # char sname[8]; 5087 # unsigned long secptr1 = secptr + 40 * i; 5088 # unsigned long vaddr = pe_get32 (dll, secptr1 + 12); 5089 # unsigned long vsize = pe_get32 (dll, secptr1 + 16); 5090 # unsigned long fptr = pe_get32 (dll, secptr1 + 20); 5091 # lseek(dll, secptr1, SEEK_SET); 5092 # read(dll, sname, 8); 5093 # if (vaddr <= export_rva && vaddr+vsize > export_rva) 5094 # { 5095 # expptr = fptr + (export_rva - vaddr); 5096 # if (export_rva + export_size > vaddr + vsize) 5097 # export_size = vsize - (export_rva - vaddr); 5098 # break; 5099 # } 5100 # } 5101 # 5102 # expdata = (unsigned char*)malloc(export_size); 5103 # lseek (dll, expptr, SEEK_SET); 5104 # read (dll, expdata, export_size); 5105 # erva = expdata - export_rva; 5106 # 5107 # nexp = pe_as32 (expdata+24); 5108 # name_rvas = pe_as32 (expdata+32); 5109 # 5110 # printf ("EXPORTS\n"); 5111 # for (i = 0; i<nexp; i++) 5112 # { 5113 # unsigned long name_rva = pe_as32 (erva+name_rvas+i*4); 5114 # printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i); 5115 # } 5116 # 5117 # return 0; 5118 # } 5119 # /* impgen.c ends here */ 5120 5121 EOF 5122 ;; 5123 esac 5124 5125 # We use sed instead of cat because bash on DJGPP gets confused if 5126 # if finds mixed CR/LF and LF-only lines. Since sed operates in 5127 # text mode, it properly converts lines to CR/LF. This bash problem 5128 # is reportedly fixed, but why not run on old versions too? 5129 sed '$q' "$ltmain" >> "${ofile}T" || (rm -f "${ofile}T"; exit 1) 5130 5131 mv -f "${ofile}T" "$ofile" || \ 5132 (rm -f "$ofile" && cp "${ofile}T" "$ofile" && rm -f "${ofile}T") 5133 chmod +x "$ofile" 5134 fi 5135 ## 5136 ## END FIXME 5137 5138 ])# _LT_AC_LTCONFIG_HACK 5139 5140 # AC_LIBTOOL_DLOPEN - enable checks for dlopen support 5141 AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])]) 5142 5143 # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's 5144 AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])]) 5145 5146 # AC_ENABLE_SHARED - implement the --enable-shared flag 5147 # Usage: AC_ENABLE_SHARED[(DEFAULT)] 5148 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to 5149 # `yes'. 5150 AC_DEFUN([AC_ENABLE_SHARED], 5151 [define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl 5152 AC_ARG_ENABLE(shared, 5153 changequote(<<, >>)dnl 5154 << --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT], 5155 changequote([, ])dnl 5156 [p=${PACKAGE-default} 5157 case $enableval in 5158 yes) enable_shared=yes ;; 5159 no) enable_shared=no ;; 5160 *) 5161 enable_shared=no 5162 # Look at the argument we got. We use all the common list separators. 5163 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," 5164 for pkg in $enableval; do 5165 if test "X$pkg" = "X$p"; then 5166 enable_shared=yes 5167 fi 5168 done 5169 IFS="$ac_save_ifs" 5170 ;; 5171 esac], 5172 enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl 5173 ]) 5174 5175 # AC_DISABLE_SHARED - set the default shared flag to --disable-shared 5176 AC_DEFUN([AC_DISABLE_SHARED], 5177 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl 5178 AC_ENABLE_SHARED(no)]) 5179 5180 # AC_ENABLE_STATIC - implement the --enable-static flag 5181 # Usage: AC_ENABLE_STATIC[(DEFAULT)] 5182 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to 5183 # `yes'. 5184 AC_DEFUN([AC_ENABLE_STATIC], 5185 [define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl 5186 AC_ARG_ENABLE(static, 5187 changequote(<<, >>)dnl 5188 << --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT], 5189 changequote([, ])dnl 5190 [p=${PACKAGE-default} 5191 case $enableval in 5192 yes) enable_static=yes ;; 5193 no) enable_static=no ;; 5194 *) 5195 enable_static=no 5196 # Look at the argument we got. We use all the common list separators. 5197 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," 5198 for pkg in $enableval; do 5199 if test "X$pkg" = "X$p"; then 5200 enable_static=yes 5201 fi 5202 done 5203 IFS="$ac_save_ifs" 5204 ;; 5205 esac], 5206 enable_static=AC_ENABLE_STATIC_DEFAULT)dnl 5207 ]) 5208 5209 # AC_DISABLE_STATIC - set the default static flag to --disable-static 5210 AC_DEFUN([AC_DISABLE_STATIC], 5211 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl 5212 AC_ENABLE_STATIC(no)]) 5213 5214 5215 # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag 5216 # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)] 5217 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to 5218 # `yes'. 5219 AC_DEFUN([AC_ENABLE_FAST_INSTALL], 5220 [define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl 5221 AC_ARG_ENABLE(fast-install, 5222 changequote(<<, >>)dnl 5223 << --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT], 5224 changequote([, ])dnl 5225 [p=${PACKAGE-default} 5226 case $enableval in 5227 yes) enable_fast_install=yes ;; 5228 no) enable_fast_install=no ;; 5229 *) 5230 enable_fast_install=no 5231 # Look at the argument we got. We use all the common list separators. 5232 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," 5233 for pkg in $enableval; do 5234 if test "X$pkg" = "X$p"; then 5235 enable_fast_install=yes 5236 fi 5237 done 5238 IFS="$ac_save_ifs" 5239 ;; 5240 esac], 5241 enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl 5242 ]) 5243 5244 # AC_DISABLE_FAST_INSTALL - set the default to --disable-fast-install 5245 AC_DEFUN([AC_DISABLE_FAST_INSTALL], 5246 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl 5247 AC_ENABLE_FAST_INSTALL(no)]) 5248 5249 # AC_LIBTOOL_PICMODE - implement the --with-pic flag 5250 # Usage: AC_LIBTOOL_PICMODE[(MODE)] 5251 # Where MODE is either `yes' or `no'. If omitted, it defaults to 5252 # `both'. 5253 AC_DEFUN([AC_LIBTOOL_PICMODE], 5254 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl 5255 pic_mode=ifelse($#,1,$1,default)]) 5256 5257 5258 # AC_PATH_TOOL_PREFIX - find a file program which can recognise shared library 5259 AC_DEFUN([AC_PATH_TOOL_PREFIX], 5260 [AC_MSG_CHECKING([for $1]) 5261 AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, 5262 [case $MAGIC_CMD in 5263 /*) 5264 lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. 5265 ;; 5266 ?:/*) 5267 lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path. 5268 ;; 5269 *) 5270 ac_save_MAGIC_CMD="$MAGIC_CMD" 5271 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" 5272 dnl $ac_dummy forces splitting on constant user-supplied paths. 5273 dnl POSIX.2 word splitting is done only on the output of word expansions, 5274 dnl not every word. This closes a longstanding sh security hole. 5275 ac_dummy="ifelse([$2], , $PATH, [$2])" 5276 for ac_dir in $ac_dummy; do 5277 test -z "$ac_dir" && ac_dir=. 5278 if test -f $ac_dir/$1; then 5279 lt_cv_path_MAGIC_CMD="$ac_dir/$1" 5280 if test -n "$file_magic_test_file"; then 5281 case $deplibs_check_method in 5282 "file_magic "*) 5283 file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" 5284 MAGIC_CMD="$lt_cv_path_MAGIC_CMD" 5285 if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | 5286 egrep "$file_magic_regex" > /dev/null; then 5287 : 5288 else 5289 cat <<EOF 1>&2 5290 5291 *** Warning: the command libtool uses to detect shared libraries, 5292 *** $file_magic_cmd, produces output that libtool cannot recognize. 5293 *** The result is that libtool may fail to recognize shared libraries 5294 *** as such. This will affect the creation of libtool libraries that 5295 *** depend on shared libraries, but programs linked with such libtool 5296 *** libraries will work regardless of this problem. Nevertheless, you 5297 *** may want to report the problem to your system manager and/or to 5298 *** bug-libtool@gnu.org 5299 5300 EOF 5301 fi ;; 5302 esac 5303 fi 5304 break 5305 fi 5306 done 5307 IFS="$ac_save_ifs" 5308 MAGIC_CMD="$ac_save_MAGIC_CMD" 5309 ;; 5310 esac]) 5311 MAGIC_CMD="$lt_cv_path_MAGIC_CMD" 5312 if test -n "$MAGIC_CMD"; then 5313 AC_MSG_RESULT($MAGIC_CMD) 5314 else 5315 AC_MSG_RESULT(no) 5316 fi 5317 ]) 5318 5319 5320 # AC_PATH_MAGIC - find a file program which can recognise a shared library 5321 AC_DEFUN([AC_PATH_MAGIC], 5322 [AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl 5323 AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin:$PATH) 5324 if test -z "$lt_cv_path_MAGIC_CMD"; then 5325 if test -n "$ac_tool_prefix"; then 5326 AC_PATH_TOOL_PREFIX(file, /usr/bin:$PATH) 5327 else 5328 MAGIC_CMD=: 5329 fi 5330 fi 5331 ]) 5332 5333 5334 # AC_PROG_LD - find the path to the GNU or non-GNU linker 5335 AC_DEFUN([AC_PROG_LD], 5336 [AC_ARG_WITH(gnu-ld, 5337 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], 5338 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) 5339 AC_REQUIRE([AC_PROG_CC])dnl 5340 AC_REQUIRE([AC_CANONICAL_HOST])dnl 5341 AC_REQUIRE([AC_CANONICAL_BUILD])dnl 5342 AC_REQUIRE([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR])dnl 5343 ac_prog=ld 5344 if test "$GCC" = yes; then 5345 # Check if gcc -print-prog-name=ld gives a path. 5346 AC_MSG_CHECKING([for ld used by GCC]) 5347 case $host in 5348 *-*-mingw*) 5349 # gcc leaves a trailing carriage return which upsets mingw 5350 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; 5351 *) 5352 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; 5353 esac 5354 case $ac_prog in 5355 # Accept absolute paths. 5356 [[\\/]]* | [[A-Za-z]]:[[\\/]]*) 5357 re_direlt='/[[^/]][[^/]]*/\.\./' 5358 # Canonicalize the path of ld 5359 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` 5360 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do 5361 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` 5362 done 5363 test -z "$LD" && LD="$ac_prog" 5364 ;; 5365 "") 5366 # If it fails, then pretend we aren't using GCC. 5367 ac_prog=ld 5368 ;; 5369 *) 5370 # If it is relative, then search for the first ld in PATH. 5371 with_gnu_ld=unknown 5372 ;; 5373 esac 5374 elif test "$with_gnu_ld" = yes; then 5375 AC_MSG_CHECKING([for GNU ld]) 5376 else 5377 AC_MSG_CHECKING([for non-GNU ld]) 5378 fi 5379 AC_CACHE_VAL(lt_cv_path_LD, 5380 [if test -z "$LD"; then 5381 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR 5382 for ac_dir in $PATH; do 5383 test -z "$ac_dir" && ac_dir=. 5384 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then 5385 lt_cv_path_LD="$ac_dir/$ac_prog" 5386 # Check to see if the program is GNU ld. I'd rather use --version, 5387 # but apparently some GNU ld's only accept -v. 5388 # Break only if it was the GNU/non-GNU ld that we prefer. 5389 if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then 5390 test "$with_gnu_ld" != no && break 5391 else 5392 test "$with_gnu_ld" != yes && break 5393 fi 5394 fi 5395 done 5396 IFS="$ac_save_ifs" 5397 else 5398 lt_cv_path_LD="$LD" # Let the user override the test with a path. 5399 fi]) 5400 LD="$lt_cv_path_LD" 5401 if test -n "$LD"; then 5402 AC_MSG_RESULT($LD) 5403 else 5404 AC_MSG_RESULT(no) 5405 fi 5406 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) 5407 AC_PROG_LD_GNU 5408 ]) 5409 5410 # AC_PROG_LD_GNU - 5411 AC_DEFUN([AC_PROG_LD_GNU], 5412 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld, 5413 [# I'd rather use --version here, but apparently some GNU ld's only accept -v. 5414 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then 5415 lt_cv_prog_gnu_ld=yes 5416 else 5417 lt_cv_prog_gnu_ld=no 5418 fi]) 5419 with_gnu_ld=$lt_cv_prog_gnu_ld 5420 ]) 5421 5422 # AC_PROG_LD_RELOAD_FLAG - find reload flag for linker 5423 # -- PORTME Some linkers may need a different reload flag. 5424 AC_DEFUN([AC_PROG_LD_RELOAD_FLAG], 5425 [AC_CACHE_CHECK([for $LD option to reload object files], lt_cv_ld_reload_flag, 5426 [lt_cv_ld_reload_flag='-r']) 5427 reload_flag=$lt_cv_ld_reload_flag 5428 test -n "$reload_flag" && reload_flag=" $reload_flag" 5429 ]) 5430 5431 # AC_DEPLIBS_CHECK_METHOD - how to check for library dependencies 5432 # -- PORTME fill in with the dynamic library characteristics 5433 AC_DEFUN([AC_DEPLIBS_CHECK_METHOD], 5434 [AC_CACHE_CHECK([how to recognise dependent libraries], 5435 lt_cv_deplibs_check_method, 5436 [lt_cv_file_magic_cmd='$MAGIC_CMD' 5437 lt_cv_file_magic_test_file= 5438 lt_cv_deplibs_check_method='unknown' 5439 # Need to set the preceding variable on all platforms that support 5440 # interlibrary dependencies. 5441 # 'none' -- dependencies not supported. 5442 # `unknown' -- same as none, but documents that we really don't know. 5443 # 'pass_all' -- all dependencies passed with no checks. 5444 # 'test_compile' -- check by making test program. 5445 # 'file_magic [[regex]]' -- check by looking for files in library path 5446 # which responds to the $file_magic_cmd with a given egrep regex. 5447 # If you have `file' or equivalent on your system and you're not sure 5448 # whether `pass_all' will *always* work, you probably want this one. 5449 5450 case $host_os in 5451 aix4* | aix5*) 5452 lt_cv_deplibs_check_method=pass_all 5453 ;; 5454 5455 beos*) 5456 lt_cv_deplibs_check_method=pass_all 5457 ;; 5458 5459 bsdi4*) 5460 lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' 5461 lt_cv_file_magic_cmd='/usr/bin/file -L' 5462 lt_cv_file_magic_test_file=/shlib/libc.so 5463 ;; 5464 5465 cygwin* | mingw* | pw32*) 5466 lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' 5467 lt_cv_file_magic_cmd='$OBJDUMP -f' 5468 ;; 5469 5470 darwin* | rhapsody*) 5471 lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library' 5472 lt_cv_file_magic_cmd='/usr/bin/file -L' 5473 case "$host_os" in 5474 rhapsody* | darwin1.[[012]]) 5475 lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1` 5476 ;; 5477 *) # Darwin 1.3 on 5478 lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib' 5479 ;; 5480 esac 5481 ;; 5482 5483 freebsd*) 5484 if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then 5485 case $host_cpu in 5486 i*86 ) 5487 # Not sure whether the presence of OpenBSD here was a mistake. 5488 # Let's accept both of them until this is cleared up. 5489 lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[[3-9]]86 (compact )?demand paged shared library' 5490 lt_cv_file_magic_cmd=/usr/bin/file 5491 lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` 5492 ;; 5493 esac 5494 else 5495 lt_cv_deplibs_check_method=pass_all 5496 fi 5497 ;; 5498 5499 gnu*) 5500 lt_cv_deplibs_check_method=pass_all 5501 ;; 5502 5503 hpux10.20*|hpux11*) 5504 lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' 5505 lt_cv_file_magic_cmd=/usr/bin/file 5506 lt_cv_file_magic_test_file=/usr/lib/libc.sl 5507 ;; 5508 5509 irix5* | irix6* | nonstopux*) 5510 case $host_os in 5511 irix5* | nonstopux*) 5512 # this will be overridden with pass_all, but let us keep it just in case 5513 lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" 5514 ;; 5515 *) 5516 case $LD in 5517 *-32|*"-32 ") libmagic=32-bit;; 5518 *-n32|*"-n32 ") libmagic=N32;; 5519 *-64|*"-64 ") libmagic=64-bit;; 5520 *) libmagic=never-match;; 5521 esac 5522 # this will be overridden with pass_all, but let us keep it just in case 5523 lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[[1234]] dynamic lib MIPS - version 1" 5524 ;; 5525 esac 5526 lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*` 5527 lt_cv_deplibs_check_method=pass_all 5528 ;; 5529 5530 # This must be Linux ELF. 5531 linux-gnu*) 5532 case $host_cpu in 5533 alpha* | hppa* | i*86 | mips | mipsel | powerpc* | sparc* | ia64* | s390* | x86_64*) 5534 lt_cv_deplibs_check_method=pass_all ;; 5535 *) 5536 # glibc up to 2.1.1 does not perform some relocations on ARM 5537 lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; 5538 esac 5539 lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` 5540 ;; 5541 5542 netbsd*) 5543 if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then 5544 lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so\.[[0-9]]+\.[[0-9]]+$' 5545 else 5546 lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so$' 5547 fi 5548 ;; 5549 5550 newos6*) 5551 lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' 5552 lt_cv_file_magic_cmd=/usr/bin/file 5553 lt_cv_file_magic_test_file=/usr/lib/libnls.so 5554 ;; 5555 5556 openbsd*) 5557 lt_cv_file_magic_cmd=/usr/bin/file 5558 lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` 5559 if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then 5560 lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object' 5561 else 5562 lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library' 5563 fi 5564 ;; 5565 5566 osf3* | osf4* | osf5*) 5567 # this will be overridden with pass_all, but let us keep it just in case 5568 lt_cv_deplibs_check_method='file_magic COFF format alpha shared library' 5569 lt_cv_file_magic_test_file=/shlib/libc.so 5570 lt_cv_deplibs_check_method=pass_all 5571 ;; 5572 5573 sco3.2v5*) 5574 lt_cv_deplibs_check_method=pass_all 5575 ;; 5576 5577 solaris*) 5578 lt_cv_deplibs_check_method=pass_all 5579 lt_cv_file_magic_test_file=/lib/libc.so 5580 ;; 5581 5582 sysv5* | sysv4*uw2*) 5583 lt_cv_archive_cmds_need_lc=no 5584 lt_cv_deplibs_check_method=pass_all 5585 ;; 5586 5587 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) 5588 case $host_vendor in 5589 motorola) 5590 lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' 5591 lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` 5592 ;; 5593 ncr) 5594 lt_cv_deplibs_check_method=pass_all 5595 ;; 5596 sequent) 5597 lt_cv_file_magic_cmd='/bin/file' 5598 lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' 5599 ;; 5600 sni) 5601 lt_cv_file_magic_cmd='/bin/file' 5602 lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" 5603 lt_cv_file_magic_test_file=/lib/libc.so 5604 ;; 5605 siemens) 5606 lt_cv_deplibs_check_method=pass_all 5607 ;; 5608 esac 5609 ;; 5610 esac 5611 ]) 5612 file_magic_cmd=$lt_cv_file_magic_cmd 5613 deplibs_check_method=$lt_cv_deplibs_check_method 5614 ]) 5615 5616 5617 # AC_PROG_NM - find the path to a BSD-compatible name lister 5618 AC_DEFUN([AC_PROG_NM], 5619 [AC_REQUIRE([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR])dnl 5620 AC_MSG_CHECKING([for BSD-compatible nm]) 5621 AC_CACHE_VAL(lt_cv_path_NM, 5622 [if test -n "$NM"; then 5623 # Let the user override the test. 5624 lt_cv_path_NM="$NM" 5625 else 5626 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR 5627 for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do 5628 test -z "$ac_dir" && ac_dir=. 5629 tmp_nm=$ac_dir/${ac_tool_prefix}nm 5630 if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then 5631 # Check to see if the nm accepts a BSD-compat flag. 5632 # Adding the `sed 1q' prevents false positives on HP-UX, which says: 5633 # nm: unknown option "B" ignored 5634 # Tru64's nm complains that /dev/null is an invalid object file 5635 if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then 5636 lt_cv_path_NM="$tmp_nm -B" 5637 break 5638 elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then 5639 lt_cv_path_NM="$tmp_nm -p" 5640 break 5641 else 5642 lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but 5643 continue # so that we can try to find one that supports BSD flags 5644 fi 5645 fi 5646 done 5647 IFS="$ac_save_ifs" 5648 test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm 5649 fi]) 5650 NM="$lt_cv_path_NM" 5651 AC_MSG_RESULT([$NM]) 5652 ]) 5653 5654 # AC_CHECK_LIBM - check for math library 5655 AC_DEFUN([AC_CHECK_LIBM], 5656 [AC_REQUIRE([AC_CANONICAL_HOST])dnl 5657 LIBM= 5658 case $host in 5659 *-*-beos* | *-*-cygwin* | *-*-pw32*) 5660 # These system don't have libm 5661 ;; 5662 *-ncr-sysv4.3*) 5663 AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") 5664 AC_CHECK_LIB(m, main, LIBM="$LIBM -lm") 5665 ;; 5666 *) 5667 AC_CHECK_LIB(m, main, LIBM="-lm") 5668 ;; 5669 esac 5670 ]) 5671 5672 # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for 5673 # the libltdl convenience library and LTDLINCL to the include flags for 5674 # the libltdl header and adds --enable-ltdl-convenience to the 5675 # configure arguments. Note that LIBLTDL and LTDLINCL are not 5676 # AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If DIR is not 5677 # provided, it is assumed to be `libltdl'. LIBLTDL will be prefixed 5678 # with '${top_builddir}/' and LTDLINCL will be prefixed with 5679 # '${top_srcdir}/' (note the single quotes!). If your package is not 5680 # flat and you're not using automake, define top_builddir and 5681 # top_srcdir appropriately in the Makefiles. 5682 AC_DEFUN([AC_LIBLTDL_CONVENIENCE], 5683 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl 5684 case $enable_ltdl_convenience in 5685 no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; 5686 "") enable_ltdl_convenience=yes 5687 ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; 5688 esac 5689 LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la 5690 LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) 5691 # For backwards non-gettext consistent compatibility... 5692 INCLTDL="$LTDLINCL" 5693 ]) 5694 5695 # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for 5696 # the libltdl installable library and LTDLINCL to the include flags for 5697 # the libltdl header and adds --enable-ltdl-install to the configure 5698 # arguments. Note that LIBLTDL and LTDLINCL are not AC_SUBSTed, nor is 5699 # AC_CONFIG_SUBDIRS called. If DIR is not provided and an installed 5700 # libltdl is not found, it is assumed to be `libltdl'. LIBLTDL will 5701 # be prefixed with '${top_builddir}/' and LTDLINCL will be prefixed 5702 # with '${top_srcdir}/' (note the single quotes!). If your package is 5703 # not flat and you're not using automake, define top_builddir and 5704 # top_srcdir appropriately in the Makefiles. 5705 # In the future, this macro may have to be called after AC_PROG_LIBTOOL. 5706 AC_DEFUN([AC_LIBLTDL_INSTALLABLE], 5707 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl 5708 AC_CHECK_LIB(ltdl, main, 5709 [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], 5710 [if test x"$enable_ltdl_install" = xno; then 5711 AC_MSG_WARN([libltdl not installed, but installation disabled]) 5712 else 5713 enable_ltdl_install=yes 5714 fi 5715 ]) 5716 if test x"$enable_ltdl_install" = x"yes"; then 5717 ac_configure_args="$ac_configure_args --enable-ltdl-install" 5718 LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la 5719 LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) 5720 else 5721 ac_configure_args="$ac_configure_args --enable-ltdl-install=no" 5722 LIBLTDL="-lltdl" 5723 LTDLINCL= 5724 fi 5725 # For backwards non-gettext consistent compatibility... 5726 INCLTDL="$LTDLINCL" 5727 ]) 5728 5729 # old names 5730 AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) 5731 AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) 5732 AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) 5733 AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) 5734 AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) 5735 AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) 5736 AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) 5737 5738 # This is just to silence aclocal about the macro not being used 5739 ifelse([AC_DISABLE_FAST_INSTALL]) 5740 5741 ############################################################ 5742 # NOTE: This macro has been submitted for inclusion into # 5743 # GNU Autoconf as AC_PROG_SED. When it is available in # 5744 # a released version of Autoconf we should remove this # 5745 # macro and use it instead. # 5746 ############################################################ 5747 # LT_AC_PROG_SED 5748 # -------------- 5749 # Check for a fully-functional sed program, that truncates 5750 # as few characters as possible. Prefer GNU sed if found. 5751 AC_DEFUN([LT_AC_PROG_SED], 5752 [AC_MSG_CHECKING([for a sed that does not truncate output]) 5753 AC_CACHE_VAL(lt_cv_path_SED, 5754 [# Loop through the user's path and test for sed and gsed. 5755 # Then use that list of sed's as ones to test for truncation. 5756 as_executable_p="test -f" 5757 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 5758 for as_dir in $PATH 5759 do 5760 IFS=$as_save_IFS 5761 test -z "$as_dir" && as_dir=. 5762 for ac_prog in sed gsed; do 5763 for ac_exec_ext in '' $ac_executable_extensions; do 5764 if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then 5765 _sed_list="$_sed_list $as_dir/$ac_prog$ac_exec_ext" 5766 fi 5767 done 5768 done 5769 done 5770 5771 # Create a temporary directory, and hook for its removal unless debugging. 5772 $debug || 5773 { 5774 trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 5775 trap '{ (exit 1); exit 1; }' 1 2 13 15 5776 } 5777 5778 # Create a (secure) tmp directory for tmp files. 5779 : ${TMPDIR=/tmp} 5780 { 5781 tmp=`(umask 077 && mktemp -d -q "$TMPDIR/sedXXXXXX") 2>/dev/null` && 5782 test -n "$tmp" && test -d "$tmp" 5783 } || 5784 { 5785 tmp=$TMPDIR/sed$$-$RANDOM 5786 (umask 077 && mkdir $tmp) 5787 } || 5788 { 5789 echo "$me: cannot create a temporary directory in $TMPDIR" >&2 5790 { (exit 1); exit 1; } 5791 } 5792 _max=0 5793 _count=0 5794 # Add /usr/xpg4/bin/sed as it is typically found on Solaris 5795 # along with /bin/sed that truncates output. 5796 for _sed in $_sed_list /usr/xpg4/bin/sed; do 5797 test ! -f ${_sed} && break 5798 cat /dev/null > "$tmp/sed.in" 5799 _count=0 5800 echo ${ECHO_N-$ac_n} "0123456789${ECHO_C-$ac_c}" >"$tmp/sed.in" 5801 # Check for GNU sed and select it if it is found. 5802 if "${_sed}" --version 2>&1 < /dev/null | egrep '(GNU)' > /dev/null; then 5803 lt_cv_path_SED=${_sed} 5804 break 5805 fi 5806 while true; do 5807 cat "$tmp/sed.in" "$tmp/sed.in" >"$tmp/sed.tmp" 5808 mv "$tmp/sed.tmp" "$tmp/sed.in" 5809 cp "$tmp/sed.in" "$tmp/sed.nl" 5810 echo >>"$tmp/sed.nl" 5811 ${_sed} -e 's/a$//' < "$tmp/sed.nl" >"$tmp/sed.out" || break 5812 cmp -s "$tmp/sed.out" "$tmp/sed.nl" || break 5813 # 40000 chars as input seems more than enough 5814 test $_count -gt 10 && break 5815 _count=`expr $_count + 1` 5816 if test $_count -gt $_max; then 5817 _max=$_count 5818 lt_cv_path_SED=$_sed 5819 fi 5820 done 5821 done 5822 rm -rf "$tmp" 5823 ]) 5824 if test "X$SED" != "X"; then 5825 lt_cv_path_SED=$SED 5826 else 5827 SED=$lt_cv_path_SED 5828 fi 5829 AC_MSG_RESULT([$SED]) 5830 ])