1
dnl $Id: acinclude.m4,v 1.271.2.22 2005/07/25 22:31:07 helly Exp $ -*- autoconf -*-
3
dnl This file contains local autoconf functions.
5
dnl PHP_ADD_MAKEFILE_FRAGMENT([srcfile[, ext_srcdir[, ext_builddir]]])
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.
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
19
AC_DEFUN([PHP_PROG_RE2C],[
20
AC_CHECK_PROG(RE2C, re2c, re2c, [exit 0;])
24
dnl PHP_DEFINE(WHAT[, value[, directory]])
26
dnl Creates builddir/include/what.h and in there #define WHAT value
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]
32
dnl PHP_CANONICAL_HOST
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
40
if test -z "$host_alias"; then
41
AC_MSG_ERROR([host_alias is not set!])
45
dnl PHP_INIT_BUILD_SYSTEM
47
AC_DEFUN([PHP_INIT_BUILD_SYSTEM],[
48
AC_REQUIRE([PHP_CANONICAL_HOST])dnl
49
test -d include || mkdir include
52
dnl We need to play tricks here to avoid matching the grep line itself
54
egrep $pattern'.*include/php' $srcdir/configure|sed 's/.*>//'|xargs touch 2>/dev/null
57
dnl PHP_GEN_GLOBAL_MAKEFILE
59
dnl Generates the global makefile.
61
AC_DEFUN([PHP_GEN_GLOBAL_MAKEFILE],[
64
builddir = $abs_builddir
65
top_srcdir = $abs_srcdir
66
top_builddir = $abs_builddir
68
for i in $PHP_VAR_SUBST; do
69
eval echo "$i = \$$i" >> Makefile
72
cat $abs_srcdir/Makefile.global Makefile.fragments Makefile.objects >> Makefile
75
dnl PHP_ADD_SOURCES(source-path, sources[, special-flags[, type]])
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).
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.
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)))
91
dnl _PHP_ASSIGN_BUILD_VARS(type)
92
dnl internal, don't use
93
AC_DEFUN([_PHP_ASSIGN_BUILD_VARS],[
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
103
b_cxx_pre=$php_cxx_pre
105
b_cxx_meta=$php_cxx_meta
107
b_cxx_post=$php_cxx_post
112
dnl PHP_ADD_SOURCES_X(source-path, sources[, special-flags[, target-var[, shared[, special-post-flags]]]])
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
119
AC_DEFUN([PHP_ADD_SOURCES_X],[
120
dnl relative to source- or build-directory?
121
dnl ac_srcdir/ac_bdir include trailing slash
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" ;;
128
dnl how to build .. shared or static?
129
ifelse($5,yes,_PHP_ASSIGN_BUILD_VARS(shared),_PHP_ASSIGN_BUILD_VARS(php))
131
dnl iterate over the sources
135
dnl remove the suffix
141
dnl append to the array which has been dynamically chosen at m4 time
142
$4="[$]$4 [$]ac_bdir[$]ac_obj.lo"
144
dnl choose the right compiler/flags/etc. for the source-file
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" ;;
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
161
dnl Separator into the configure --help display.
163
AC_DEFUN([PHP_HELP_SEPARATOR],[
170
dnl PHP_TARGET_RDYNAMIC
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.
177
dnl If successful, adds -rdynamic to PHP_LDFLAGS.
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"
189
AC_DEFUN([PHP_REMOVE_USR_LIB],[
193
-L/usr/lib|-L/usr/lib/[)] ;;
194
*[)] ac_new_flags="[$]ac_new_flags [$]i" ;;
200
dnl PHP_EVAL_LIBLINE(LINE, SHARED-LIBADD)
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
206
AC_DEFUN([PHP_EVAL_LIBLINE],[
210
ac_ii=`echo $ac_i|cut -c 3-`
211
PHP_ADD_LIBRARY($ac_ii,1,$2)
214
ac_ii=`echo $ac_i|cut -c 3-`
215
PHP_ADD_LIBPATH($ac_ii,$2)
221
dnl PHP_EVAL_INCLINE(LINE)
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.
226
AC_DEFUN([PHP_EVAL_INCLINE],[
230
ac_ii=`echo $ac_i|cut -c 3-`
231
PHP_ADD_INCLUDE($ac_ii)
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,[
244
#include <sys/types.h>
248
#define PATH_MAX 1024
253
char entry[sizeof(struct dirent)+PATH_MAX];
254
struct dirent *pentry = (struct dirent *) &entry;
259
if (readdir_r(dir, (struct dirent *) entry, &pentry) == 0)
264
ac_cv_what_readdir_r=POSIX
268
#include <sys/types.h>
270
int readdir_r(DIR *, struct dirent *);
272
ac_cv_what_readdir_r=old-style
274
ac_cv_what_readdir_r=none
277
ac_cv_what_readdir_r=none
280
case $ac_cv_what_readdir_r in
282
AC_DEFINE(HAVE_POSIX_READDIR_R,1,[whether you have POSIX readdir_r]);;
284
AC_DEFINE(HAVE_OLD_READDIR_R,1,[whether you have old-style readdir_r]);;
289
AC_DEFUN([PHP_SHLIB_SUFFIX_NAME],[
290
AC_REQUIRE([PHP_CANONICAL_HOST])dnl
291
PHP_SUBST(SHLIB_SUFFIX_NAME)
298
SHLIB_SUFFIX_NAME=dylib
303
AC_DEFUN([PHP_DEBUG_MACRO],[
306
CONFIGURE: $CONFIGURE_COMMAND
317
PHP_RPATHS: $PHP_RPATHS
321
cat >conftest.$ac_ext <<X
327
(eval echo \"$ac_link\"; eval $ac_link && ./conftest) >>$1 2>&1
331
AC_DEFUN([PHP_DOES_PWRITE_WORK],[
333
#include <sys/types.h>
334
#include <sys/stat.h>
340
int fd = open("conftest_in", O_WRONLY|O_CREAT, 0600);
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);
358
AC_DEFUN([PHP_DOES_PREAD_WORK],[
359
echo test > conftest_in
361
#include <sys/types.h>
362
#include <sys/stat.h>
369
int fd = open("conftest_in", O_RDONLY);
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);
386
AC_DEFUN([PHP_PWRITE_TEST],[
387
AC_CACHE_CHECK(whether pwrite works,ac_cv_pwrite,[
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
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])
405
AC_DEFUN([PHP_PREAD_TEST],[
406
AC_CACHE_CHECK(whether pread works,ac_cv_pread,[
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
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])
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],[
429
AC_DEFINE(MISSING_LOCALTIME_R_DECL,1,[Whether localtime_r is declared])
431
AC_TRY_COMPILE([#include <time.h>],[struct tm *(*func)() = gmtime_r],[
434
AC_DEFINE(MISSING_GMTIME_R_DECL,1,[Whether gmtime_r is declared])
436
AC_TRY_COMPILE([#include <time.h>],[char *(*func)() = asctime_r],[
439
AC_DEFINE(MISSING_ASCTIME_R_DECL,1,[Whether asctime_r is declared])
441
AC_TRY_COMPILE([#include <time.h>],[char *(*func)() = ctime_r],[
444
AC_DEFINE(MISSING_CTIME_R_DECL,1,[Whether ctime_r is declared])
446
AC_TRY_COMPILE([#include <string.h>],[char *(*func)() = strtok_r],[
449
AC_DEFINE(MISSING_STRTOK_R_DECL,1,[Whether strtok_r is declared])
451
AC_MSG_RESULT([done])
455
dnl PHP_LIBGCC_LIBPATH(gcc)
456
dnl Stores the location of libgcc in libgcc_libpath
458
AC_DEFUN([PHP_LIBGCC_LIBPATH],[
460
libgcc_libpath=`$1 --print-libgcc-file-name|sed 's%/*[^/][^/]*$%%'`
464
AC_DEFUN([PHP_ARG_ANALYZE_EX],[
465
ext_output="yes, shared"
469
$1=`echo "[$]$1"|sed 's/^shared,//'`
484
PHP_ALWAYS_SHARED([$1])
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])])
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.
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)])
504
AC_DEFUN([PHP_REAL_ARG_WITH],[
505
ifelse([$2],,,[AC_MSG_CHECKING([$2])])
506
AC_ARG_WITH($1,[$3],$5=[$]withval,
510
if test "$PHP_ENABLE_ALL" && test "$6" = "yes"; then
514
PHP_ARG_ANALYZE($5,[$2],$6)
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.
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)])
529
AC_DEFUN([PHP_REAL_ARG_ENABLE],[
530
ifelse([$2],,,[AC_MSG_CHECKING([$2])])
531
AC_ARG_ENABLE($1,[$3],$5=[$]enableval,
535
if test "$PHP_ENABLE_ALL" && test "$6" = "yes"; then
539
PHP_ARG_ANALYZE($5,[$2],$6)
542
AC_DEFUN([PHP_MODULE_PTR],[
543
EXTRA_MODULE_PTRS="$EXTRA_MODULE_PTRS $1,"
546
AC_DEFUN([PHP_CONFIG_NICE],[
547
test -f $1 && mv $1 $1.old
552
# Created by configure
556
for var in CFLAGS CXXFLAGS CPPFLAGS LDFLAGS LIBS CC CXX; do
558
if test -n "$val"; then
559
echo "$var='$val' \\" >> $1
563
for arg in [$]0 "[$]@"; do
564
echo "'[$]arg' \\" >> $1
570
AC_DEFUN([PHP_TIME_R_TYPE],[
571
AC_CACHE_CHECK(for type of reentrant time-related functions, ac_cv_time_r_type,[
581
s = gmtime_r(&old, &t);
582
r = (int) asctime_r(&t, buf, 26);
583
if (r == s && s == 0) return (0);
587
ac_cv_time_r_type=hpux
596
s = gmtime_r(&old, &t);
597
p = asctime_r(&t, buf, 26);
598
if (p == buf && s == &t) return (0);
602
ac_cv_time_r_type=irix
604
ac_cv_time_r_type=POSIX
607
ac_cv_time_r_type=POSIX
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]) ;;
616
AC_DEFUN([PHP_SUBST],[
617
PHP_VAR_SUBST="$PHP_VAR_SUBST $1"
620
AC_DEFUN([PHP_SUBST_OLD],[
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)])
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])
636
dnl PHP_CONFIGURE_PART(MESSAGE)
637
dnl Idea borrowed from mm
638
AC_DEFUN([PHP_CONFIGURE_PART],[
640
AC_MSG_RESULT([${T_MD}$1${T_ME}])
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])
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,[
656
LIBS="-R /usr/lib $LIBS"
657
AC_TRY_LINK([], [], php_cv_cc_dashr=yes, php_cv_cc_dashr=no)
659
AC_MSG_RESULT([$php_cv_cc_dashr])
660
if test $php_cv_cc_dashr = "yes"; then
663
AC_MSG_CHECKING([if compiler supports -Wl,-rpath,])
664
AC_CACHE_VAL(php_cv_cc_rpath,[
666
LIBS="-Wl,-rpath,/usr/lib $LIBS"
667
AC_TRY_LINK([], [], php_cv_cc_rpath=yes, php_cv_cc_rpath=no)
669
AC_MSG_RESULT([$php_cv_cc_rpath])
670
if test $php_cv_cc_rpath = "yes"; then
671
ld_runpath_switch=-Wl,-rpath,
673
dnl something innocuous
679
AC_DEFUN([PHP_STRUCT_FLOCK],[
680
AC_CACHE_CHECK(for struct flock,ac_cv_struct_flock,
687
ac_cv_struct_flock=yes
689
ac_cv_struct_flock=no
692
if test "$ac_cv_struct_flock" = "yes" ; then
693
AC_DEFINE(HAVE_STRUCT_FLOCK, 1,[whether you have struct flock])
697
AC_DEFUN([PHP_SOCKLEN_T],[
698
AC_CACHE_CHECK(for socklen_t,ac_cv_socklen_t,
700
#include <sys/types.h>
701
#include <sys/socket.h>
709
if test "$ac_cv_socklen_t" = "yes"; then
710
AC_DEFINE(HAVE_SOCKLEN_T, 1, [Whether you have socklen_t])
715
dnl PHP_SET_SYM_FILE(path)
717
dnl set the path of the file which contains the symbol export list
719
AC_DEFUN([PHP_SET_SYM_FILE],
725
dnl PHP_BUILD_THREAD_SAFE
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.])
734
AC_DEFUN([PHP_REQUIRE_CXX],[
735
if test -z "$php_cxx_done"; then
745
AC_DEFUN([PHP_BUILD_SHARED],[
747
OVERALL_TARGET=libphp5.la
748
php_build_target=shared
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
762
AC_DEFUN([PHP_BUILD_STATIC],[
764
OVERALL_TARGET=libphp5.la
765
php_build_target=static
771
AC_DEFUN([PHP_BUILD_BUNDLE],[
773
OVERALL_TARGET=libs/libphp5.bundle
774
php_build_target=static
778
dnl PHP_BUILD_PROGRAM
780
AC_DEFUN([PHP_BUILD_PROGRAM],[
781
OVERALL_TARGET=[]ifelse($1,,php,$1)
783
php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
784
php_c_post=' && echo > $[@]'
786
php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
787
php_cxx_post=' && echo > $[@]'
791
yes) pic_setting='-prefer-pic';;
792
no) pic_setting='-prefer-non-pic';;
795
shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
796
shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
798
shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
799
shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
803
php_build_target=program
807
dnl PHP_RUN_ONCE(namespace, variable, code)
809
dnl execute code, if variable is not set in namespace
811
AC_DEFUN([PHP_RUN_ONCE],[
813
unique=`echo $2|sed 's/[^a-zA-Z0-9]/_/g'`
815
cmd="echo $ac_n \"\$$1$unique$ac_c\""
816
if test -n "$unique" && test "`eval $cmd`" = "" ; then
823
dnl PHP_EXPAND_PATH(path, variable)
825
dnl expands path to an absolute path and assigns it to variable
827
AC_DEFUN([PHP_EXPAND_PATH],[
828
if test -z "$1" || echo "$1" | grep '^/' >/dev/null ; then
832
ep_dir="`echo $1|sed 's%/*[^/][^/]*/*$%%'`"
834
ep_realdir="`(cd \"$ep_dir\" && pwd)`"
835
$2="$ep_realdir/`basename \"$1\"`"
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"
850
dnl PHP_ADD_LIBPATH(path[, shared-libadd])
852
dnl add a library to linkpath/runpath
854
AC_DEFUN([PHP_ADD_LIBPATH],[
855
if test "$1" != "/usr/lib"; then
856
PHP_EXPAND_PATH($1, ai_p)
858
_PHP_ADD_LIBPATH_GLOBAL([$ai_p])
860
if test "$ext_shared" = "yes"; then
861
$2="$ld_runpath_switch$ai_p -L$ai_p [$]$2"
863
_PHP_ADD_LIBPATH_GLOBAL([$ai_p])
870
dnl PHP_UTILIZE_RPATHS()
872
dnl builds RPATHS/LDFLAGS from PHP_RPATHS
874
AC_DEFUN([PHP_UTILIZE_RPATHS],[
875
OLD_RPATHS=$PHP_RPATHS
878
for i in $OLD_RPATHS; do
879
dnl Can be passed to native cc/libtool
880
PHP_LDFLAGS="$PHP_LDFLAGS -L$i"
882
PHP_RPATHS="$PHP_RPATHS -R $i"
884
NATIVE_RPATHS="$NATIVE_RPATHS $ld_runpath_switch$i"
887
if test "$PHP_RPATH" = "no"; then
894
dnl PHP_ADD_INCLUDE(path [,before])
896
dnl add an include path.
897
dnl if before is 1, add in the beginning of INCLUDES.
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, [
904
INCLUDES="-I$ai_p $INCLUDES"
906
INCLUDES="$INCLUDES -I$ai_p"
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
917
dnl internal, don't use
918
AC_DEFUN([_PHP_ADD_LIBRARY_SKELETON],[
922
_PHP_X_ADD_LIBRARY($1,$2,$5)
924
if test "$ext_shared" = "yes"; then
925
_PHP_X_ADD_LIBRARY($1,$2,$3)
935
dnl PHP_ADD_LIBRARY(library[, append[, shared-libadd]])
937
dnl add a library to the link line
939
AC_DEFUN([PHP_ADD_LIBRARY],[
940
_PHP_ADD_LIBRARY_SKELETON([$1],[$2],[$3],[PHP_ADD_LIBRARY],[LIBS])
944
dnl PHP_ADD_LIBRARY_DEFER(library[, append[, shared-libadd]])
946
dnl add a library to the link line (deferred)
948
AC_DEFUN([PHP_ADD_LIBRARY_DEFER],[
949
_PHP_ADD_LIBRARY_SKELETON([$1],[$2],[$3],[PHP_ADD_LIBRARY_DEFER],[DLIBS])
953
dnl PHP_ADD_LIBRARY_WITH_PATH(library, path[, shared-libadd])
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
959
AC_DEFUN([PHP_ADD_LIBRARY_WITH_PATH],[
961
if test -n "$2"; then
966
if test "$ext_shared" = "yes"; then
968
if test -n "$2"; then
969
PHP_ADD_LIBPATH($2,$3)
972
PHP_ADD_LIBRARY_WITH_PATH($1,$2)
978
dnl PHP_ADD_LIBRARY_DEFER_WITH_PATH(library, path[, shared-libadd])
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
985
AC_DEFUN([PHP_ADD_LIBRARY_DEFER_WITH_PATH],[
987
if test -n "$2"; then
990
PHP_ADD_LIBRARY_DEFER($1)
992
if test "$ext_shared" = "yes"; then
994
if test -n "$2"; then
995
PHP_ADD_LIBPATH($2,$3)
998
PHP_ADD_LIBRARY_DEFER_WITH_PATH($1,$2)
1004
dnl PHP_ADD_FRAMEWORK(framework [,before])
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.
1010
AC_DEFUN([PHP_ADD_FRAMEWORK], [
1011
PHP_RUN_ONCE(FRAMEWORKS, $1, [
1013
PHP_FRAMEWORKS="-framework $1 $PHP_FRAMEWORKS"
1015
PHP_FRAMEWORKS="$PHP_FRAMEWORKS -framework $1"
1021
dnl PHP_ADD_FRAMEWORKPATH(path [,before])
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
1031
AC_DEFUN([PHP_ADD_FRAMEWORKPATH], [
1032
PHP_EXPAND_PATH($1, ai_p)
1033
PHP_RUN_ONCE(FRAMEWORKPATH, $ai_p, [
1035
PHP_FRAMEWORKPATH="-F$ai_p $PHP_FRAMEWORKPATH"
1037
PHP_FRAMEWORKPATH="$PHP_FRAMEWORKPATH -F$ai_p"
1043
dnl PHP_ADD_FRAMEWORK_WITH_PATH(framework, path)
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)
1053
dnl Set libtool variable
1055
AC_DEFUN([PHP_SET_LIBTOOL_VARIABLE],[
1056
if test -z "$LIBTOOL"; then
1057
LIBTOOL='$(SHELL) $(top_builddir)/libtool $1'
1059
LIBTOOL="$LIBTOOL $1"
1064
dnl Check for cc option
1066
AC_DEFUN([PHP_CHECK_CC_OPTION],[
1067
echo "main(){return 0;}" > conftest.$ac_ext
1070
var=`echo $opt|sed 's/[^a-zA-Z0-9]/_/g'`
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
1078
if eval ./conftest 2>/dev/null ; then
1079
eval php_cc_$var=yes
1080
AC_MSG_RESULT([yes])
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])
1107
if test "$ac_cv_regex_t_re_magic" = "yes"; then
1108
AC_DEFINE([HAVE_REGEX_T_RE_MAGIC], [ ], 1)
1111
AC_MSG_CHECKING([which regex library to use])
1112
AC_MSG_RESULT([$REGEX_TYPE])
1117
dnl See if we have broken header files like SunOS has.
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,[ ])
1125
AC_DEFINE(MISSING_FCLOSE_DECL,1,[ ])
1126
AC_MSG_RESULT([missing])
1131
dnl Check for broken sprintf(), C99 conformance
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
1138
ac_cv_broken_sprintf=yes
1140
ac_cv_broken_sprintf=no
1143
if test "$ac_cv_broken_sprintf" = "yes"; then
1144
AC_DEFINE(PHP_BROKEN_SPRINTF, 1, [Whether sprintf is C99 conform])
1146
AC_DEFINE(PHP_BROKEN_SPRINTF, 0, [Whether sprintf is C99 conform])
1151
dnl Check for broken snprintf(), C99 conformance
1153
AC_DEFUN([PHP_AC_BROKEN_SNPRINTF],[
1154
AC_CACHE_CHECK(whether snprintf is broken, ac_cv_broken_snprintf,[
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);
1171
ac_cv_broken_snprintf=no
1173
ac_cv_broken_snprintf=yes
1175
ac_cv_broken_snprintf=no
1178
if test "$ac_cv_broken_snprintf" = "yes"; then
1179
AC_DEFINE(PHP_BROKEN_SNPRINTF, 1, [Whether snprintf is C99 conform])
1181
AC_DEFINE(PHP_BROKEN_SNPRINTF, 0, [Whether snprintf is C99 conform])
1185
dnl PHP_SHARED_MODULE(module-name, object-var, build-dir, cxx)
1187
dnl Basically sets up the link-stage for building module-name
1188
dnl from object_var in build-dir.
1190
AC_DEFUN([PHP_SHARED_MODULE],[
1191
install_modules="install-modules"
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)'
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)'
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)'
1208
PHP_MODULES="$PHP_MODULES \$(phplibdir)/$1.$suffix"
1210
cat >>Makefile.objects<<EOF
1211
\$(phplibdir)/$1.$suffix: $3/$1.$suffix
1212
\$(LIBTOOL) --mode=install cp $3/$1.$suffix \$(phplibdir)
1214
$3/$1.$suffix: \$($2) \$(translit($1,a-z_-,A-Z__)_SHARED_DEPENDENCIES)
1221
dnl PHP_SELECT_SAPI(name, type[, sources [, extra-cflags [, build-target]]])
1223
dnl Selects the SAPI name and type (static, shared, programm)
1224
dnl and optionally also the source-files for the SAPI-specific
1227
AC_DEFUN([PHP_SELECT_SAPI],[
1231
static[)] PHP_BUILD_STATIC;;
1232
shared[)] PHP_BUILD_SHARED;;
1233
bundle[)] PHP_BUILD_BUNDLE;;
1234
program[)] PHP_BUILD_PROGRAM($5);;
1237
ifelse($3,,,[PHP_ADD_SOURCES([sapi/$1],[$3],[$4],[sapi])])
1241
AC_DEFUN([PHP_EXTENSION],[
1242
sources=`$AWK -f $abs_srcdir/build/scan_makefile_in.awk < []PHP_EXT_SRCDIR($1)[]/Makefile.in`
1244
PHP_NEW_EXTENSION($1, $sources, $2, $3)
1246
if test -r "$ext_srcdir/Makefile.frag"; then
1247
PHP_ADD_MAKEFILE_FRAGMENT
1251
AC_DEFUN([PHP_ADD_BUILD_DIR],[
1252
BUILD_DIR="$BUILD_DIR $1"
1255
AC_DEFUN([PHP_GEN_BUILD_DIRS],[
1256
$php_shtool mkdir -p $BUILD_DIR
1260
dnl PHP_NEW_EXTENSION(extname, sources [, shared [,sapi_class[, extra-cflags[, cxx]]]])
1262
dnl Includes an extension in the build.
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
1272
AC_DEFUN([PHP_NEW_EXTENSION],[
1273
ext_builddir=[]PHP_EXT_BUILDDIR($1)
1274
ext_srcdir=[]PHP_EXT_SRCDIR($1)
1276
ifelse($5,,ac_extra=,[ac_extra=`echo "$5"|sed s#@ext_srcdir@#$ext_srcdir#g`])
1278
if test "$3" != "shared" && test "$3" != "yes" && test "$4" != "cli"; then
1279
dnl ---------------------------------------------- Static module
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"
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)
1292
PHP_ADD_LIBRARY_WITH_PATH(php5lib, netware, translit($1,a-z_-,A-Z__)_SHARED_LIBADD)
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)
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"
1306
PHP_ADD_SOURCES(PHP_EXT_DIR($1),$2,$ac_extra,cli)
1308
EXT_CLI_STATIC="$EXT_CLI_STATIC $1"
1310
PHP_ADD_BUILD_DIR($ext_builddir)
1314
dnl Solaris requires main code to be position independent in order
1315
dnl to let shared objects find symbols. Weird. Ugly.
1317
dnl Must be run after all --with-NN options that let the user
1318
dnl choose dynamic extensions, and after the gcc test.
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`
1325
"SunOS 5.6"|"SunOS 5.7"[)]
1327
gcc*|egcs*) CFLAGS="$CFLAGS -fPIC";;
1328
*[)] CFLAGS="$CFLAGS -fpic";;
1330
AC_MSG_RESULT([yes]);;
1332
AC_MSG_RESULT([no]);;
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
1344
AC_DEFUN([PHP_WITH_SHARED],[
1345
PHP_ARG_ANALYZE_EX(withval)
1347
unset ext_shared ext_output
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
1356
dnl Written by Paul Eggert <eggert@twinsun.com>.
1358
AC_DEFUN([PHP_SYS_LFS],
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])
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 ;;
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
1378
case "$ac_result$ac_getconfs" in
1379
yes[)] ac_result=no ;;
1381
case "$ac_result$ac_set" in
1382
yes?*[)] ac_result="yes, but $ac_set is already set, so use its settings"
1384
AC_MSG_RESULT([$ac_result])
1387
for ac_shellvar in $ac_shellvars; do
1388
eval $ac_shellvar=\$ac_test_$ac_shellvar
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])
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"
1412
AC_DEFUN([PHP_DECLARED_TIMEZONE],[
1413
AC_CACHE_CHECK(for declared timezone, ac_cv_declared_timezone,[
1415
#include <sys/types.h>
1417
#ifdef HAVE_SYS_TIME_H
1418
#include <sys/time.h>
1421
time_t foo = (time_t) timezone;
1423
ac_cv_declared_timezone=yes
1425
ac_cv_declared_timezone=no
1427
if test "$ac_cv_declared_timezone" = "yes"; then
1428
AC_DEFINE(HAVE_DECLARED_TIMEZONE, 1, [Whether system headers declare timezone])
1432
AC_DEFUN([PHP_EBCDIC],[
1433
AC_CACHE_CHECK([whether system uses EBCDIC],ac_cv_ebcdic,[
1436
return (unsigned char)'A' != (unsigned char)0xC1;
1445
if test "$ac_cv_ebcdic" = "yes"; then
1446
AC_DEFINE(CHARSET_EBCDIC,1, [Define if system uses EBCDIC])
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`
1457
AC_DEFINE(HAVE_BROKEN_GETCWD,1, [Define if system has broken getcwd])
1458
AC_MSG_RESULT([yes]);;
1460
AC_MSG_RESULT([no]);;
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,[
1469
int main(int argc, char *argv[])
1473
char *filename = "/tmp/phpglibccheck";
1475
fp = fopen(filename, "w");
1480
fputs("foobar", fp);
1483
fp = fopen(filename, "a+");
1484
position = ftell(fp);
1492
[have_broken_glibc_fopen_append=no],
1493
[have_broken_glibc_fopen_append=yes ],
1495
#include <features.h>
1497
#if !__GLIBC_PREREQ(2,2)
1501
[have_broken_glibc_fopen_append=yes],
1502
[have_broken_glibc_fopen_append=no ])
1505
if test "$have_broken_glibc_fopen_append" = "yes"; then
1507
AC_DEFINE(HAVE_BROKEN_GLIBC_FOPEN_APPEND,1, [Define if your glibc borks on fopen with mode a+])
1514
AC_DEFUN([PHP_FOPENCOOKIE],[
1515
AC_CHECK_FUNC(fopencookie, [ have_glibc_fopencookie=yes ])
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
1524
[ cookie_io_functions_t cookie; ],
1525
[ have_cookie_io_functions_t=yes ],
1528
if test "$have_cookie_io_functions_t" = "yes" ; then
1529
cookie_io_functions_t=cookie_io_functions_t
1530
have_fopen_cookie=yes
1532
dnl even newer glibcs have a different seeker definition...
1542
__ssize_t reader(void *cookie, char *buffer, size_t size)
1544
__ssize_t writer(void *cookie, const char *buffer, size_t size)
1546
int closer(void *cookie)
1548
int seeker(void *cookie, __off64_t *position, int whence)
1549
{ ((struct cookiedata*)cookie)->pos = *position; return 0; }
1551
cookie_io_functions_t funcs = {reader, writer, seeker, closer};
1554
struct cookiedata g = { 0 };
1555
FILE *fp = fopencookie(&g, "r", funcs);
1557
if (fp && fseek(fp, 8192, SEEK_SET) == 0 && g.pos == 8192)
1563
[ cookie_io_functions_use_off64_t=yes ],
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
1572
[ _IO_cookie_io_functions_t cookie; ],
1573
[ have_IO_cookie_io_functions_t=yes ],
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
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, [ ])
1594
dnl PHP_CHECK_LIBRARY(library, function [, action-found [, action-not-found [, extra-libs]]])
1596
dnl Wrapper for AC_CHECK_LIB
1598
AC_DEFUN([PHP_CHECK_LIBRARY], [
1599
save_old_LDFLAGS=$LDFLAGS
1602
save_ext_shared=$ext_shared
1604
PHP_EVAL_LIBLINE([$]ac_stuff, LDFLAGS)
1605
AC_CHECK_LIB([$1],[$2],[
1606
LDFLAGS=$save_old_LDFLAGS
1607
ext_shared=$save_ext_shared
1610
LDFLAGS=$save_old_LDFLAGS
1611
ext_shared=$save_ext_shared
1612
unset ac_cv_lib_$1[]_$2
1618
dnl PHP_CHECK_FRAMEWORK(framework, function [, action-found [, action-not-found ]])
1620
dnl El cheapo wrapper for AC_CHECK_LIB
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
1632
LDFLAGS=$save_old_LDFLAGS
1638
dnl PHP_SETUP_KERBEROS(shared-add [, action-found [, action-not-found]])
1640
dnl Common setup macro for kerberos
1642
AC_DEFUN([PHP_SETUP_KERBEROS],[
1644
unset KERBEROS_CFLAGS
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])
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`
1657
if test -n "$KERBEROS_LIBS" && test -n "$KERBEROS_CFLAGS"; then
1659
PHP_EVAL_LIBLINE($KERBEROS_LIBS, $1)
1660
PHP_EVAL_INCLINE($KERBEROS_CFLAGS)
1664
dnl If still not found use old skool method
1665
if test "$found_kerberos" = "no"; then
1667
if test "$PHP_KERBEROS" = "yes"; then
1668
PHP_KERBEROS="/usr/kerberos /usr/local /usr"
1671
for i in $PHP_KERBEROS; do
1672
if test -f $i/lib/libkrb5.a || test -f $i/lib/libkrb5.$SHLIB_SUFFIX_NAME; then
1678
if test "$PHP_KERBEROS_DIR"; then
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)
1689
if test "$found_kerberos" = "yes"; then
1690
ifelse([$2],[],:,[$2])
1691
ifelse([$3],[],,[else $3])
1696
dnl PHP_SETUP_OPENSSL(shared-add [, action-found [, action-not-found]])
1698
dnl Common setup macro for openssl
1700
AC_DEFUN([PHP_SETUP_OPENSSL],[
1702
unset OPENSSL_INCDIR
1703
unset OPENSSL_LIBDIR
1705
dnl Empty variable means 'no'
1706
test -z "$PHP_OPENSSL" && PHP_OPENSSL=no
1707
test -z "$PHP_IMAP_SSL" && PHP_IMAP_SSL=no
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
1716
dnl First try to find pkg-config
1717
if test -z "$PKG_CONFIG"; then
1718
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
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
1725
OPENSSL_LIBS=`$PKG_CONFIG --libs openssl`
1726
OPENSSL_INCS=`$PKG_CONFIG --cflags-only-I openssl`
1727
OPENSSL_INCDIR=`$PKG_CONFIG --variable=includedir openssl`
1729
AC_MSG_ERROR([OpenSSL version 0.9.6 or greater required.])
1732
if test -n "$OPENSSL_LIBS" && test -n "$OPENSSL_INCS"; then
1733
PHP_EVAL_LIBLINE($OPENSSL_LIBS, $1)
1734
PHP_EVAL_INCLINE($OPENSSL_INCS)
1738
dnl If pkg-config fails for some reason, revert to the old method
1739
if test "$found_openssl" = "no"; then
1741
if test "$PHP_OPENSSL_DIR" = "yes"; then
1742
PHP_OPENSSL_DIR="/usr/local/ssl /usr/local /usr /usr/local/openssl"
1745
for i in $PHP_OPENSSL_DIR; do
1746
if test -r $i/include/openssl/evp.h; then
1747
OPENSSL_INCDIR=$i/include
1749
if test -r $i/lib/libssl.a -o -r $i/lib/libssl.$SHLIB_SUFFIX_NAME; then
1750
OPENSSL_LIBDIR=$i/lib
1752
test -n "$OPENSSL_INCDIR" && test -n "$OPENSSL_LIBDIR" && break
1755
if test -z "$OPENSSL_INCDIR"; then
1756
AC_MSG_ERROR([Cannot find OpenSSL's <evp.h>])
1759
if test -z "$OPENSSL_LIBDIR"; then
1760
AC_MSG_ERROR([Cannot find OpenSSL's libraries])
1763
old_CPPFLAGS=$CPPFLAGS
1764
CPPFLAGS=-I$OPENSSL_INCDIR
1765
AC_MSG_CHECKING([for OpenSSL version])
1767
#include <openssl/opensslv.h>
1768
#if OPENSSL_VERSION_NUMBER >= 0x0090600fL
1772
AC_MSG_RESULT([>= 0.9.6])
1774
AC_MSG_ERROR([OpenSSL version 0.9.6 or greater required.])
1776
CPPFLAGS=$old_CPPFLAGS
1778
PHP_ADD_INCLUDE($OPENSSL_INCDIR)
1780
PHP_CHECK_LIBRARY(crypto, CRYPTO_free, [
1781
PHP_ADD_LIBRARY(crypto,,$1)
1783
AC_MSG_ERROR([libcrypto not found!])
1789
LIBS="$LIBS -lcrypto"
1790
PHP_CHECK_LIBRARY(ssl, SSL_CTX_set_ssl_version, [
1793
AC_MSG_ERROR([libssl not found!])
1798
PHP_ADD_LIBRARY(ssl,,$1)
1800
PHP_ADD_LIBPATH($OPENSSL_LIBDIR, $1)
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)
1808
ifelse([$2],[],:,[$2])
1809
ifelse([$3],[],,[else $3])
1814
dnl PHP_SETUP_ICONV(shared-add [, action-found [, action-not-found]])
1816
dnl Common setup macro for iconv
1818
AC_DEFUN([PHP_SETUP_ICONV], [
1822
# Create the directories for a VPATH build:
1823
test -d ext || mkdir ext
1824
test -d ext/iconv || mkdir ext/iconv
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
1835
dnl Check libc first if no path is provided in --with-iconv
1837
if test "$PHP_ICONV" = "yes"; then
1838
AC_CHECK_FUNC(iconv, [
1839
PHP_DEFINE(HAVE_ICONV,1,[ext/iconv])
1842
AC_CHECK_FUNC(libiconv,[
1843
PHP_DEFINE(HAVE_LIBICONV,1,[ext/iconv])
1850
dnl Check external libs for iconv funcs
1852
if test "$found_iconv" = "no"; then
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, [ ])
1858
iconv_lib_name=giconv
1860
elif test -r $i/include/iconv.h; then
1862
iconv_lib_name=iconv
1867
if test -z "$ICONV_DIR"; then
1868
AC_MSG_ERROR([Please specify the install prefix of iconv with --with-iconv=<DIR>])
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
1874
PHP_CHECK_LIBRARY($iconv_lib_name, libiconv, [
1876
PHP_DEFINE(HAVE_LIBICONV,1,[ext/iconv])
1878
PHP_CHECK_LIBRARY($iconv_lib_name, iconv, [
1880
PHP_DEFINE(HAVE_ICONV,1,[ext/iconv])
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)
1897
ifelse([$3],[],,[else $3])
1902
dnl PHP_SETUP_LIBXML(shared-add [, action-found [, action-not-found]])
1904
dnl Common setup macro for libxml
1906
AC_DEFUN([PHP_SETUP_LIBXML], [
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"
1915
if test -x "$XML2_CONFIG"; then
1916
libxml_full_version=`$XML2_CONFIG --version`
1919
set $libxml_full_version
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)
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,
1932
php_cv_libxml_build_works=yes
1935
AC_MSG_ERROR([build test failed. Please check the config.log for details.])
1940
if test "$php_cv_libxml_build_works" = "yes"; then
1941
AC_DEFINE(HAVE_LIBXML, 1, [ ])
1945
AC_MSG_ERROR([libxml2 version 2.5.10 or greater required.])
1947
ifelse([$3],[],,[else $3])
1951
AC_DEFUN([PHP_DEF_HAVE],[AC_DEFINE([HAVE_]translit($1,a-z_-,A-Z__), 1, [ ])])
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
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([$@],[,])))])])
1968
AC_DEFUN([PHP_CHECK_FUNC_LIB],[
1970
unset ac_cv_lib_$2[]_$1
1971
unset ac_cv_lib_$2[]___$1
1973
AC_CHECK_LIB($2, $1, [found=yes], [
1974
AC_CHECK_LIB($2, __$1, [found=yes], [found=no])
1977
if test "$found" = "yes"; then
1980
AC_TRY_RUN([main() { return (0); }],[found=yes],[found=no],[found=no])
1984
if test "$found" = "yes"; then
1990
PHP_CHECK_FUNC_LIB($1,phpshift(phpshift($@)))
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.
2001
AC_DEFUN([PHP_CHECK_FUNC],[
2003
unset ac_cv_func___$1
2006
AC_CHECK_FUNC($1, [found=yes],[ AC_CHECK_FUNC(__$1,[found=yes],[found=no]) ])
2014
*[)] PHP_CHECK_FUNC_LIB($@) ;;
2020
dnl PHP_AP_EXTRACT_VERSION(/path/httpd)
2021
dnl This macro is used to get a comparable
2022
dnl version for apache1/2.
2024
AC_DEFUN([PHP_AP_EXTRACT_VERSION],[
2025
ac_output=`$1 -v 2>&1`
2032
APACHE_VERSION=`expr [$]4 \* 1000000 + [$]5 \* 1000 + [$]6`
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.
2039
AC_DEFUN([PHP_TEST_BUILD], [
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], [])
2072
dnl Replacement macro for AC_C_BIGENDIAN
2074
AC_DEFUN([PHP_C_BIGENDIAN],
2075
[AC_CACHE_CHECK([whether byte ordering is bigendian], ac_cv_c_bigendian_php,
2077
ac_cv_c_bigendian_php=unknown
2083
char *cp = (char *)&one;
2091
], [ac_cv_c_bigendian_php=yes], [ac_cv_c_bigendian_php=no], [ac_cv_c_bigendian_php=unknown])
2093
if test $ac_cv_c_bigendian_php = yes; then
2094
AC_DEFINE(WORDS_BIGENDIAN, [], [Define if processor uses big-endian word])
2099
dnl PHP_CHECK_PDO_INCLUDES([found [, not-found]])
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
2112
if test -n "$pdo_inc_path"; then
2113
ifelse([$1],[],:,[$1])
2115
ifelse([$2],[],[AC_MSG_ERROR([Cannot find php_pdo_driver.h.])],[$2])
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
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.
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.
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.
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.
2142
# serial 46 AC_PROG_LIBTOOL
2144
AC_DEFUN([AC_PROG_LIBTOOL],
2145
[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
2147
# This can be used to rebuild libtool when needed
2148
LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
2150
# Always use our own libtool.
2151
LIBTOOL='$(SHELL) $(top_builddir)/libtool'
2152
AC_SUBST(LIBTOOL)dnl
2154
# Prevent multiple expansion
2155
define([AC_PROG_LIBTOOL], [])
2158
AC_DEFUN([AC_LIBTOOL_SETUP],
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
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
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
2181
if test "$file_magic_cmd" = '$MAGIC_CMD'; then
2187
AC_CHECK_TOOL(RANLIB, ranlib, :)
2188
AC_CHECK_TOOL(STRIP, strip, :)
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)
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
2198
# Some flags need to be propagated to the compiler or linker for good
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
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,
2227
AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
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"
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)
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,
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])])
2250
*-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*)
2251
# old mingw systems require "-dll" to link a DLL, while more recent ones
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" ;;
2267
_LT_AC_LTCONFIG_HACK
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],
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 ;;
2287
if test "x$lt_cv_func_assert_works" = xyes; then
2288
AC_CHECK_HEADERS(assert.h)
2290
])# AC_LIBTOOL_HEADER_ASSERT
2292
# _LT_AC_CHECK_DLFCN
2293
# --------------------
2294
AC_DEFUN([_LT_AC_CHECK_DLFCN],
2295
[AC_CHECK_HEADERS(dlfcn.h)
2296
])# _LT_AC_CHECK_DLFCN
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
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?!! ;)]
2311
# Character class describing NM global symbol codes.
2312
symcode='[[BCDEGRST]]'
2314
# Regexp to match symbols that can be accessed directly from C.
2315
sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
2317
# Transform the above into a raw symbol and a C symbol.
2318
symxfrm='\1 \2\3 \3'
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'"
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'"
2326
# Define system-specific variables.
2331
cygwin* | mingw* | pw32*)
2332
symcode='[[ABCDGISTW]]'
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'"
2339
symcode='[[BCDEGRST]]'
2342
symcode='[[BCDEGQRST]]'
2348
symcode='[[DFNSTU]]'
2352
# Handle CRLF in mingw tool chain
2356
opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
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]]'
2365
# Try without a prefix undercore, then with it.
2366
for ac_symprfx in "" "_"; do
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'"
2371
# Check to see that the pipe works correctly.
2374
cat > conftest.$ac_ext <<EOF
2379
void nm_test_func(){}
2383
int main(){nm_test_var='a';nm_test_func();return(0);}
2386
if AC_TRY_EVAL(ac_compile); then
2387
# Now try to grab the symbols.
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"
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
2406
# Now generate the symbol file.
2407
eval "$lt_cv_global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext'
2409
cat <<EOF >> conftest.$ac_ext
2410
#if defined (__STDC__) && __STDC__
2411
# define lt_ptr void *
2413
# define lt_ptr char *
2417
/* The mapping between symbol names and symbols. */
2422
lt_preloaded_symbols[[]] =
2425
sed "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr) \&\2},/" < "$nlist" >> conftest.$ac_ext
2426
cat <<\EOF >> conftest.$ac_ext
2434
# Now try linking the two files.
2435
mv conftest.$ac_objext conftstm.$ac_objext
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
2444
CFLAGS="$save_CFLAGS"
2446
echo "cannot find nm_test_func in $nlist" >&AC_FD_CC
2449
echo "cannot find nm_test_var in $nlist" >&AC_FD_CC
2452
echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AC_FD_CC
2455
echo "$progname: failed program was:" >&AC_FD_CC
2456
cat conftest.$ac_ext >&5
2458
rm -f conftest* conftst*
2460
# Do not use the global_symbol_pipe unless it works.
2461
if test "$pipe_works" = yes; then
2464
lt_cv_sys_global_symbol_pipe=
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=
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"
2476
if test -z "$global_symbol_pipe$global_symbol_to_cdec$global_symbol_to_c_name_address";
2478
AC_MSG_RESULT(failed)
2482
]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
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`}
2492
*-DOS) lt_cv_sys_path_separator=';' ;;
2493
*) lt_cv_sys_path_separator=':' ;;
2495
PATH_SEPARATOR=$lt_cv_sys_path_separator
2497
])# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
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
2508
# Check that we are running under the correct shell.
2509
SHELL=${CONFIG_SHELL-/bin/sh}
2513
# Remove one level of quotation (which was required for Make).
2514
ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
2519
if test "X[$]1" = X--no-reexec; then
2520
# Discard the --no-reexec flag, and continue.
2522
elif test "X[$]1" = X--fallback-echo; then
2523
# Avoid inline document here, it may be left over
2525
elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
2526
# Yippee, $echo works!
2529
# Restart under the correct shell.
2530
exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
2533
if test "X[$]1" = X--fallback-echo; then
2534
# used as fallback echo
2542
# The HP-UX ksh and POSIX shell print the target directory to stdout
2544
if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
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
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
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'
2569
# So, first we look for a working echo in the user's PATH.
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
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.
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
2597
exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
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
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
2612
SHELL="$CONFIG_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"
2621
# maybe with a smaller string...
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
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+"[$]@"}
2637
# Oops. We lost completely, so just stick with echo.
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.
2649
if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
2650
ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
2655
])# _LT_AC_PROG_ECHO_BACKSLASH
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 :
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"
2678
# define LT_DLGLOBAL RTLD_GLOBAL
2681
# define LT_DLGLOBAL DL_GLOBAL
2683
# define LT_DLGLOBAL 0
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
2691
# define LT_DLLAZY_OR_NOW RTLD_LAZY
2694
# define LT_DLLAZY_OR_NOW DL_LAZY
2697
# define LT_DLLAZY_OR_NOW RTLD_NOW
2700
# define LT_DLLAZY_OR_NOW DL_NOW
2702
# define LT_DLLAZY_OR_NOW 0
2710
extern "C" void exit (int);
2713
void fnord() { int i=42;}
2716
void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
2717
int status = $lt_dlunknown;
2721
if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
2722
else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
2723
/* dlclose (self); */
2729
if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
2730
(./conftest; exit; ) 2>/dev/null
2733
x$lt_dlno_uscore) $1 ;;
2734
x$lt_dlneed_uscore) $2 ;;
2735
x$lt_unknown|x*) $3 ;;
2738
# compilation failed
2743
])# _LT_AC_TRY_DLOPEN_SELF
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
2758
lt_cv_dlopen="load_add_on"
2760
lt_cv_dlopen_self=yes
2763
cygwin* | mingw* | pw32*)
2764
lt_cv_dlopen="LoadLibrary"
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"])
2789
if test "x$lt_cv_dlopen" != xno; then
2795
case $lt_cv_dlopen in
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"
2801
save_LDFLAGS="$LDFLAGS"
2802
eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
2805
LIBS="$lt_cv_dlopen_libs $LIBS"
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)
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)
2824
CPPFLAGS="$save_CPPFLAGS"
2825
LDFLAGS="$save_LDFLAGS"
2830
case $lt_cv_dlopen_self in
2831
yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
2832
*) enable_dlopen_self=unknown ;;
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 ;;
2840
])# AC_LIBTOOL_DLOPEN_SELF
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'
2849
# Same as above, but do not quote variable references.
2850
double_quote_subst='s/\([[\\"\\`\\\\]]\)/\\\1/g'
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'
2860
default_ofile=libtool
2861
can_build_shared=yes
2863
# All known linkers require a `.a' archive for static linking (except M$VC,
2864
# which needs '.lib').
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"
2872
old_CFLAGS="$CFLAGS"
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
2889
if test x"$host" != x"$build"; then
2890
ac_tool_prefix=${host_alias}-
2895
# Transform linux* to *-*-linux-gnu*, to support old configure scripts.
2898
linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
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
2908
export COLLECT_NAMES
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=
2918
if test -n "$RANLIB"; then
2921
old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
2924
old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
2927
old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
2930
# Allow CC to be a program name with arguments.
2934
## FIXME: this should be a separate macro
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
2942
# MS-DOS does not allow filenames that begin with a dot.
2945
rmdir .libs 2>/dev/null
2946
AC_MSG_RESULT($objdir)
2951
## FIXME: this should be a separate macro
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
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=
2966
lt_cv_prog_cc_static=
2967
lt_cv_prog_cc_no_builtin=
2968
lt_cv_prog_cc_can_build_shared=$can_build_shared
2970
if test "$GCC" = yes; then
2971
lt_cv_prog_cc_wl='-Wl,'
2972
lt_cv_prog_cc_static='-static'
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"
2985
# FIXME: we need at least 68020 code to build shared libraries, but
2986
# adding the `-m68020' flag to GCC prevents building anything better,
2988
lt_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4'
2990
beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
2991
# PIC is the default for these OSes.
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'
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'
3004
if test -d /usr/nec; then
3005
lt_cv_prog_cc_pic=-Kconform_pic
3009
lt_cv_prog_cc_pic='-fPIC'
3013
# PORTME Check for PIC flags for the system compiler.
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'
3022
lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp'
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'
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.
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'
3046
lt_cv_prog_cc_pic='-KPIC'
3047
lt_cv_prog_cc_static='-Bstatic'
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'
3057
lt_cv_prog_cc_pic='-Kpic'
3058
lt_cv_prog_cc_static='-dn'
3059
lt_cv_prog_cc_shlib='-belf'
3063
lt_cv_prog_cc_pic='-KPIC'
3064
lt_cv_prog_cc_static='-Bstatic'
3065
lt_cv_prog_cc_wl='-Wl,'
3069
lt_cv_prog_cc_pic='-PIC'
3070
lt_cv_prog_cc_static='-Bstatic'
3071
lt_cv_prog_cc_wl='-Qoption ld '
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,'
3081
lt_cv_prog_cc_pic='-pic'
3082
lt_cv_prog_cc_static='-Bstatic'
3086
if test -d /usr/nec ;then
3087
lt_cv_prog_cc_pic='-Kconform_pic'
3088
lt_cv_prog_cc_static='-Bstatic'
3093
lt_cv_prog_cc_can_build_shared=no
3098
if test -z "$lt_cv_prog_cc_pic"; then
3099
AC_MSG_RESULT([none])
3101
AC_MSG_RESULT([$lt_cv_prog_cc_pic])
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
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
3117
lt_cv_prog_cc_pic_works=yes
3121
lt_cv_prog_cc_pic_works=yes
3125
lt_cv_prog_cc_pic_works=no
3127
CFLAGS="$save_CFLAGS"
3130
if test "X$lt_cv_prog_cc_pic_works" = Xno; then
3132
lt_cv_prog_cc_can_build_shared=no
3134
lt_cv_prog_cc_pic=" $lt_cv_prog_cc_pic"
3137
AC_MSG_RESULT([$lt_cv_prog_cc_pic_works])
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 :
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
3152
## FIXME: this should be a separate macro
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"
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])
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"
3177
## FIXME: this should be a separate macro
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
3185
echo "int some_variable = 0;" > conftest.$ac_ext
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
3193
save_CFLAGS="$CFLAGS"
3194
CFLAGS="$CFLAGS -o out/conftest2.$ac_objext"
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
3202
lt_cv_compiler_c_o=yes
3205
# Append any errors to the config.log.
3206
cat out/conftest.err 1>&AC_FD_CC
3207
lt_cv_compiler_c_o=no
3209
CFLAGS="$save_CFLAGS"
3215
$rm -r conftest 2>/dev/null
3217
compiler_c_o=$lt_cv_compiler_c_o
3218
AC_MSG_RESULT([$compiler_c_o])
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"
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
3235
lt_cv_compiler_o_lo=yes
3238
ac_objext="$save_objext"
3239
CFLAGS="$save_CFLAGS"
3241
compiler_o_lo=$lt_cv_compiler_o_lo
3242
AC_MSG_RESULT([$compiler_o_lo])
3249
## FIXME: this should be a separate macro
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])
3258
ln conftest.a conftest.b 2>/dev/null && hard_links=no
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])
3273
## FIXME: this should be a separate macro
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
3288
compiler_rtti_exceptions=yes
3291
CFLAGS="$save_CFLAGS"
3292
AC_MSG_RESULT([$compiler_rtti_exceptions])
3294
if test "$compiler_rtti_exceptions" = "yes"; then
3295
no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions'
3297
no_builtin_flag=' -fno-builtin'
3303
## FIXME: this should be a separate macro
3305
# See if the linker supports building shared libraries.
3306
AC_MSG_CHECKING([whether the linker ($LD) supports shared libraries])
3308
allow_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
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=
3326
hardcode_shlibpath_var=unsupported
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
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=
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
3361
if test "$with_gnu_ld" = yes; then
3362
# If archive_cmds runs LD, not CC, wlarc should be empty
3365
# See if GNU ld supports shared libraries.
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.
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.
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
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
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'
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
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'
3421
old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib'
3423
# cygwin and mingw dlls have different entry points and sets of symbols
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~
3431
dll_entry=_DllMainCRTStartup@12
3432
dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~
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
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)~'
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'
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;
3465
echo EXPORTS > $output_objdir/$soname-def;
3467
cat $export_symbols | while read symbol; do
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;;
3474
_lt_hint=`expr 1 + \$_lt_hint`;
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'
3486
if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
3487
archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
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'
3496
if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
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.
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'
3517
archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
3520
hardcode_shlibpath_var=no
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'
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'
3538
cygwin* | mingw* | pw32*)
3539
# dlltool doesn't understand --whole-archive et. al.
3540
whole_archive_flag_spec=
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'
3547
whole_archive_flag_spec=
3553
# PORTME fill in a description of your system's linker (not GNU ld)
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
3565
hardcode_direct=unsupported
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'
3577
aix_use_runtimelinking=no
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
3586
aix_use_runtimelinking=yes
3593
exp_sym_flag='-bexport'
3594
no_entry_flag='-bnoentry'
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.
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
3612
# We have reworked collect2
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=
3626
shared_flag='-shared'
3629
if test "$host_cpu" = ia64; then
3630
shared_flag='${wl}-G'
3632
if test "$aix_use_runtimelinking" = yes; then
3633
shared_flag='${wl}-G'
3635
shared_flag='${wl}-bM:SRE'
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"
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"
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'
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
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.
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"`'
3692
darwin* | rhapsody*)
3694
rhapsody* | darwin1.[[012]])
3695
allow_undefined_flag='-undefined suppress'
3698
allow_undefined_flag='-flat_namespace -undefined suppress'
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'
3709
hardcode_shlibpath_var=no
3710
whole_archive_flag_spec='-all_load $convenience'
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
3722
archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
3723
hardcode_libdir_flag_spec='-R$libdir'
3725
hardcode_shlibpath_var=no
3728
# Unfortunately, older versions of FreeBSD 2 do not have this feature.
3730
archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
3732
hardcode_minus_L=yes
3733
hardcode_shlibpath_var=no
3736
# FreeBSD 3 and greater uses gcc -shared to do shared libraries.
3738
archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
3739
hardcode_libdir_flag_spec='-R$libdir'
3741
hardcode_shlibpath_var=no
3744
hpux9* | hpux10* | hpux11*)
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' ;;
3749
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
3750
hardcode_libdir_separator=:
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'
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'
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'
3765
hardcode_libdir_separator=:
3766
link_all_deplibs=yes
3770
if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
3771
archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
3773
archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
3775
hardcode_libdir_flag_spec='-R$libdir'
3777
hardcode_shlibpath_var=no
3781
archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
3783
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
3784
hardcode_libdir_separator=:
3785
hardcode_shlibpath_var=no
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'
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'
3802
archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
3803
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
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'
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'
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'
3825
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
3826
hardcode_libdir_separator=:
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'
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'
3840
#Both c and cxx compiler support -rpath directly
3841
hardcode_libdir_flag_spec='-rpath $libdir'
3843
hardcode_libdir_separator=:
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'
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
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.
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
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' ;;
3896
link_all_deplibs=yes
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'
3905
archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
3907
hardcode_libdir_flag_spec='-L$libdir'
3909
hardcode_minus_L=yes
3910
hardcode_shlibpath_var=no
3914
case $host_vendor in
3916
archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
3917
hardcode_direct=yes # is this really true???
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'
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
3931
runpath_var='LD_RUN_PATH'
3932
hardcode_shlibpath_var=no
3936
archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
3937
hardcode_shlibpath_var=no
3938
export_dynamic_flag_spec='-Bexport'
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
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
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
3964
archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
3967
hardcode_shlibpath_var=no
3968
hardcode_runpath_var=yes
3969
runpath_var=LD_RUN_PATH
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'
3977
archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
3979
runpath_var='LD_RUN_PATH'
3980
hardcode_shlibpath_var=no
3988
AC_MSG_RESULT([$ld_shlibs])
3989
test "$ld_shlibs" = no && can_build_shared=no
3993
## FIXME: this should be a separate macro
3995
# Check hardcoding attributes.
3996
AC_MSG_CHECKING([how to hardcode library paths into programs])
3998
if test -n "$hardcode_libdir_flag_spec" || \
3999
test -n "$runpath_var"; then
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
4011
# We can link without hardcoding, and we can hardcode nonexisting dirs.
4012
hardcode_action=immediate
4015
# We cannot hardcode anything, or else we can only hardcode existing
4017
hardcode_action=unsupported
4019
AC_MSG_RESULT([$hardcode_action])
4023
## FIXME: this should be a separate macro
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])
4038
reload_cmds='$LD$reload_flag -o $output$reload_objs'
4039
test -z "$deplibs_check_method" && deplibs_check_method=unknown
4041
## FIXME: this should be a separate macro
4043
# PORTME Fill in your ld.so characteristics
4044
AC_MSG_CHECKING([dynamic linker characteristics])
4046
libname_spec='lib$name'
4053
shlibpath_overrides_runpath=unknown
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"
4062
library_names_spec='${libname}${release}.so$versuffix $libname.a'
4063
shlibpath_var=LIBPATH
4065
# AIX has no versioning support, so we append a major version to the name.
4066
soname_spec='${libname}${release}.so$major'
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
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.
4085
aix4 | aix4.[[01]] | aix4.[[01]].*)
4086
if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
4088
echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
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'
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'
4110
shlibpath_var=LIBPATH
4112
hardcode_into_libs=yes
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'
4122
library_names_spec='${libname}.so'
4123
dynamic_linker="$host_os ld.so"
4124
shlibpath_var=LIBRARY_PATH
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
4142
cygwin* | mingw* | pw32*)
4143
version_type=windows
4146
case $GCC,$host_os in
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~
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"`
4163
library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
4166
library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll $libname.lib'
4169
dynamic_linker='Win32 ld.exe'
4170
# FIXME: first we should search . and the directory the executable is in
4174
darwin* | rhapsody*)
4175
dynamic_linker="$host_os dyld"
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
4193
objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
4194
version_type=freebsd-$objformat
4195
case $version_type in
4197
library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
4202
library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix'
4206
shlibpath_var=LD_LIBRARY_PATH
4209
shlibpath_overrides_runpath=yes
4212
shlibpath_overrides_runpath=no
4213
hardcode_into_libs=yes
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
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"
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'
4243
irix5* | irix6* | nonstopux*)
4245
nonstopux*) version_type=nonstopux ;;
4246
*) version_type=irix ;;
4250
soname_spec='${libname}${release}.so$major'
4251
library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so'
4253
irix5* | nonstopux*)
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;;
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}"
4271
# No shared lib support for Linux oldld, aout, or coff.
4272
linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
4276
# This must be Linux ELF.
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
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'
4299
# Find out which ABI we are using (multilib Linux x86_64 hack).
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
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}"
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'
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'
4333
shlibpath_var=LD_LIBRARY_PATH
4334
shlibpath_overrides_runpath=yes
4335
hardcode_into_libs=yes
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
4349
if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
4351
openbsd2.[[89]] | openbsd2.[[89]].*)
4352
shlibpath_overrides_runpath=no
4355
shlibpath_overrides_runpath=yes
4359
shlibpath_overrides_runpath=yes
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
4367
libname_spec='$name'
4369
library_names_spec='$libname.dll $libname.a'
4370
dynamic_linker='OS/2 ld.exe'
4371
shlibpath_var=LIBPATH
4374
osf3* | osf4* | osf5*)
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
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
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'
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
4417
sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
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
4424
shlibpath_overrides_runpath=no
4426
export_dynamic_flag_spec='${wl}-Blargedynsym'
4427
runpath_var=LD_RUN_PATH
4435
shlibpath_overrides_runpath=no
4436
sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
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
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
4458
if test -d /usr/nec ;then
4460
library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
4461
soname_spec='$libname.so.$major'
4462
shlibpath_var=LD_LIBRARY_PATH
4470
AC_MSG_RESULT([$dynamic_linker])
4471
test "$dynamic_linker" = no && can_build_shared=no
4475
## FIXME: this should be a separate macro
4477
# Report the final consequences.
4478
AC_MSG_CHECKING([if libtool supports shared libraries])
4479
AC_MSG_RESULT([$can_build_shared])
4483
## FIXME: this should be a separate macro
4485
AC_MSG_CHECKING([whether to build shared libraries])
4486
test "$can_build_shared" = "no" && enable_shared=no
4488
# On AIX, shared libraries and static libraries use the same namespace, and
4489
# are all built from PIC.
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'
4500
if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
4501
test "$enable_shared" = yes && enable_static=no
4505
AC_MSG_RESULT([$enable_shared])
4509
## FIXME: this should be a separate macro
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])
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
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"
4532
AC_LIBTOOL_DLOPEN_SELF
4534
## FIXME: this should be a separate macro
4536
if test "$enable_shared" = yes && test "$GCC" = yes; then
4537
case $archive_cmds in
4539
# FIXME: we may have to deal with multi-command sequences.
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],
4548
echo 'static int dummy;' > conftest.$ac_ext
4550
if AC_TRY_EVAL(ac_compile); then
4553
libobjs=conftest.$ac_objext
4555
wl=$lt_cv_prog_cc_wl
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)
4565
lt_cv_archive_cmds_need_lc=no
4567
lt_cv_archive_cmds_need_lc=yes
4569
allow_undefined_flag=$save_allow_undefined_flag
4571
cat conftest.err 1>&5
4573
AC_MSG_RESULT([$lt_cv_archive_cmds_need_lc])
4577
need_lc=${lt_cv_archive_cmds_need_lc-yes}
4581
## FIXME: this should be a separate macro
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
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"
4596
if test -f "$ltmain"; then
4597
trap "$rm \"${ofile}T\"; exit 1" 1 2 15
4600
echo creating $ofile
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
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\"\`\\\""
4633
eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
4638
cat <<__EOF__ > "${ofile}T"
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.
4645
# Copyright (C) 1996-2000 Free Software Foundation, Inc.
4646
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
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.
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.
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.
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.
4667
# A sed that does not truncate output.
4670
# Sed that helps us avoid accidentally triggering echo(1) options like -n.
4671
Xsed="${SED} -e s/^X//"
4673
# The HP-UX ksh and POSIX shell print the target directory to stdout
4675
if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
4677
# ### BEGIN LIBTOOL CONFIG
4679
# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
4681
# Shell to use when invoking shell scripts.
4684
# Whether or not to build shared libraries.
4685
build_libtool_libs=$enable_shared
4687
# Whether or not to build static libraries.
4688
build_old_libs=$enable_static
4690
# Whether or not to add -lc for building shared libraries.
4691
build_libtool_need_lc=$need_lc
4693
# Whether or not to optimize for fast installation.
4694
fast_install=$enable_fast_install
4697
host_alias=$host_alias
4700
# An echo program that does not interpret backslashes.
4705
AR_FLAGS=$lt_AR_FLAGS
4707
# The default C compiler.
4710
# Is the compiler the GNU C compiler?
4713
# The linker used to build libraries.
4716
# Whether we need hard or soft links.
4719
# A BSD-compatible nm program.
4722
# A symbol stripping program
4725
# Used to examine libraries when file_magic_cmd begins "file"
4726
MAGIC_CMD=$MAGIC_CMD
4728
# Used on cygwin: DLL creation program.
4731
# Used on cygwin: object dumper.
4734
# Used on cygwin: assembler.
4737
# The name of the directory that contains temporary libtool files.
4740
# How to create reloadable object files.
4741
reload_flag=$lt_reload_flag
4742
reload_cmds=$lt_reload_cmds
4744
# How to pass a linker flag through the compiler.
4747
# Object file suffix (normally "o").
4750
# Old archive suffix (normally "a").
4753
# Executable file suffix (normally "").
4756
# Additional compiler flags for building library objects.
4757
pic_flag=$lt_pic_flag
4760
# Does compiler simultaneously support -c and -o options?
4761
compiler_c_o=$lt_compiler_c_o
4763
# Can we write directly to a .lo ?
4764
compiler_o_lo=$lt_compiler_o_lo
4766
# Must we lock files when doing compilation ?
4767
need_locks=$lt_need_locks
4769
# Do we need the lib prefix for modules?
4770
need_lib_prefix=$need_lib_prefix
4772
# Do we need a version for libraries?
4773
need_version=$need_version
4775
# Whether dlopen is supported.
4776
dlopen_support=$enable_dlopen
4778
# Whether dlopen of programs is supported.
4779
dlopen_self=$enable_dlopen_self
4781
# Whether dlopen of statically linked programs is supported.
4782
dlopen_self_static=$enable_dlopen_self_static
4784
# Compiler flag to prevent dynamic linking.
4785
link_static_flag=$lt_link_static_flag
4787
# Compiler flag to turn off builtin functions.
4788
no_builtin_flag=$lt_no_builtin_flag
4790
# Compiler flag to allow reflexive dlopens.
4791
export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
4793
# Compiler flag to generate shared objects directly from archives.
4794
whole_archive_flag_spec=$lt_whole_archive_flag_spec
4796
# Compiler flag to generate thread-safe objects.
4797
thread_safe_flag_spec=$lt_thread_safe_flag_spec
4799
# Library versioning type.
4800
version_type=$version_type
4802
# Format of library name prefix.
4803
libname_spec=$lt_libname_spec
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
4809
# The coded name of the library, if different from the real name.
4810
soname_spec=$lt_soname_spec
4812
# Commands used to build and install an old-style archive.
4814
old_archive_cmds=$lt_old_archive_cmds
4815
old_postinstall_cmds=$lt_old_postinstall_cmds
4816
old_postuninstall_cmds=$lt_old_postuninstall_cmds
4818
# Create an old-style archive from a shared archive.
4819
old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
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
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
4830
# Commands to strip libraries.
4831
old_striplib=$lt_old_striplib
4832
striplib=$lt_striplib
4834
# Method to check whether dependent libraries are shared objects.
4835
deplibs_check_method=$lt_deplibs_check_method
4837
# Command to use when deplibs_check_method == file_magic.
4838
file_magic_cmd=$lt_file_magic_cmd
4840
# Flag that allows shared libraries with undefined symbols to be built.
4841
allow_undefined_flag=$lt_allow_undefined_flag
4843
# Flag that forces no undefined symbols.
4844
no_undefined_flag=$lt_no_undefined_flag
4846
# Commands used to finish a libtool library installation in a directory.
4847
finish_cmds=$lt_finish_cmds
4849
# Same as above, but a single script fragment to be evaled but not shown.
4850
finish_eval=$lt_finish_eval
4852
# Take the output of nm and produce a listing of raw symbols and C names.
4853
global_symbol_pipe=$lt_global_symbol_pipe
4855
# Transform the output of nm in a proper C declaration
4856
global_symbol_to_cdecl=$lt_global_symbol_to_cdecl
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
4861
# This is the shared library runtime path variable.
4862
runpath_var=$runpath_var
4864
# This is the shared library path variable.
4865
shlibpath_var=$shlibpath_var
4867
# Is shlibpath searched before the hard-coded library search path?
4868
shlibpath_overrides_runpath=$shlibpath_overrides_runpath
4870
# How to hardcode a shared library path into an executable.
4871
hardcode_action=$hardcode_action
4873
# Whether we should hardcode library paths into libraries.
4874
hardcode_into_libs=$hardcode_into_libs
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
4880
# Whether we need a single -rpath flag with a separated argument.
4881
hardcode_libdir_separator=$lt_hardcode_libdir_separator
4883
# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
4885
hardcode_direct=$hardcode_direct
4887
# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
4889
hardcode_minus_L=$hardcode_minus_L
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
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"
4899
# Whether libtool must link a program against all its dependency libraries.
4900
link_all_deplibs=$link_all_deplibs
4902
# Compile-time system search path for libraries
4903
sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
4905
# Run-time system search path for libraries
4906
sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
4908
# Fix the shell variable \$srcfile for the compiler.
4909
fix_srcfile_path="$fix_srcfile_path"
4911
# Set to yes if exported symbols are required.
4912
always_export_symbols=$always_export_symbols
4914
# The commands to list exported symbols.
4915
export_symbols_cmds=$lt_export_symbols_cmds
4917
# The commands to extract the exported symbol list from a shared archive.
4918
extract_expsyms_cmds=$lt_extract_expsyms_cmds
4920
# Symbols that should not be listed in the preloaded symbols.
4921
exclude_expsyms=$lt_exclude_expsyms
4923
# Symbols that must always be exported.
4924
include_expsyms=$lt_include_expsyms
4926
# ### END LIBTOOL CONFIG
4932
cat <<\EOF >> "${ofile}T"
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
4939
export COLLECT_NAMES
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>
4956
# #ifndef __CYGWIN__
4957
# # ifdef __CYGWIN32__
4958
# # define __CYGWIN__ __CYGWIN32__
4962
# #ifdef __cplusplus
4965
# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
4966
# #ifdef __cplusplus
4971
# #include <cygwin/cygwin_dll.h>
4972
# DECLARE_CYGWIN_DLL( DllMain );
4974
# HINSTANCE __hDllInstance_base;
4977
# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
4979
# __hDllInstance_base = hInst;
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.
4989
# This file is part of GNU libtool.
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.
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.
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.
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() */
5011
# /* O_BINARY isn't required (or even defined sometimes) under Unix */
5013
# #define O_BINARY 0
5016
# static unsigned int
5017
# pe_get16 (fd, offset)
5021
# unsigned char b[2];
5022
# lseek (fd, offset, SEEK_SET);
5024
# return b[0] + (b[1]<<8);
5027
# static unsigned int
5028
# pe_get32 (fd, offset)
5032
# unsigned char b[4];
5033
# lseek (fd, offset, SEEK_SET);
5035
# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
5038
# static unsigned int
5042
# unsigned char *b = ptr;
5043
# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
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;
5058
# filename = argv[1];
5060
# dll = open(filename, O_RDONLY|O_BINARY);
5064
# dll_name = filename;
5066
# for (i=0; filename[i]; i++)
5067
# if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':')
5068
# dll_name = filename + i +1;
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);
5074
# if (num_entries < 1) /* no exports */
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));
5084
# for (i = 0; i < nsections; i++)
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)
5095
# expptr = fptr + (export_rva - vaddr);
5096
# if (export_rva + export_size > vaddr + vsize)
5097
# export_size = vsize - (export_rva - vaddr);
5102
# expdata = (unsigned char*)malloc(export_size);
5103
# lseek (dll, expptr, SEEK_SET);
5104
# read (dll, expdata, export_size);
5105
# erva = expdata - export_rva;
5107
# nexp = pe_as32 (expdata+24);
5108
# name_rvas = pe_as32 (expdata+32);
5110
# printf ("EXPORTS\n");
5111
# for (i = 0; i<nexp; i++)
5113
# unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
5114
# printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
5119
# /* impgen.c ends here */
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)
5131
mv -f "${ofile}T" "$ofile" || \
5132
(rm -f "$ofile" && cp "${ofile}T" "$ofile" && rm -f "${ofile}T")
5138
])# _LT_AC_LTCONFIG_HACK
5140
# AC_LIBTOOL_DLOPEN - enable checks for dlopen support
5141
AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
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])])
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
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}
5158
yes) enable_shared=yes ;;
5159
no) 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
5172
enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
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)])
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
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}
5192
yes) enable_static=yes ;;
5193
no) 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
5206
enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
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)])
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
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}
5227
yes) enable_fast_install=yes ;;
5228
no) enable_fast_install=no ;;
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
5241
enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
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)])
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
5253
AC_DEFUN([AC_LIBTOOL_PICMODE],
5254
[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
5255
pic_mode=ifelse($#,1,$1,default)])
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,
5264
lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
5267
lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
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
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
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
5308
MAGIC_CMD="$ac_save_MAGIC_CMD"
5311
MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
5312
if test -n "$MAGIC_CMD"; then
5313
AC_MSG_RESULT($MAGIC_CMD)
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)
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
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])
5349
# gcc leaves a trailing carriage return which upsets mingw
5350
ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
5352
ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
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%/%"`
5363
test -z "$LD" && LD="$ac_prog"
5366
# If it fails, then pretend we aren't using GCC.
5370
# If it is relative, then search for the first ld in PATH.
5374
elif test "$with_gnu_ld" = yes; then
5375
AC_MSG_CHECKING([for GNU ld])
5377
AC_MSG_CHECKING([for non-GNU ld])
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
5392
test "$with_gnu_ld" != yes && break
5398
lt_cv_path_LD="$LD" # Let the user override the test with a path.
5401
if test -n "$LD"; then
5406
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
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
5417
lt_cv_prog_gnu_ld=no
5419
with_gnu_ld=$lt_cv_prog_gnu_ld
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"
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.
5452
lt_cv_deplibs_check_method=pass_all
5456
lt_cv_deplibs_check_method=pass_all
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
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'
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'
5474
rhapsody* | darwin1.[[012]])
5475
lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1`
5478
lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
5484
if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
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.*`
5495
lt_cv_deplibs_check_method=pass_all
5500
lt_cv_deplibs_check_method=pass_all
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
5509
irix5* | irix6* | nonstopux*)
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"
5517
*-32|*"-32 ") libmagic=32-bit;;
5518
*-n32|*"-n32 ") libmagic=N32;;
5519
*-64|*"-64 ") libmagic=64-bit;;
5520
*) libmagic=never-match;;
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"
5526
lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
5527
lt_cv_deplibs_check_method=pass_all
5530
# This must be Linux ELF.
5533
alpha* | hppa* | i*86 | mips | mipsel | powerpc* | sparc* | ia64* | s390* | x86_64*)
5534
lt_cv_deplibs_check_method=pass_all ;;
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 )' ;;
5539
lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
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]]+$'
5546
lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so$'
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
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'
5562
lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
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
5574
lt_cv_deplibs_check_method=pass_all
5578
lt_cv_deplibs_check_method=pass_all
5579
lt_cv_file_magic_test_file=/lib/libc.so
5582
sysv5* | sysv4*uw2*)
5583
lt_cv_archive_cmds_need_lc=no
5584
lt_cv_deplibs_check_method=pass_all
5587
sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
5588
case $host_vendor in
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*`
5594
lt_cv_deplibs_check_method=pass_all
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 )'
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
5606
lt_cv_deplibs_check_method=pass_all
5612
file_magic_cmd=$lt_cv_file_magic_cmd
5613
deplibs_check_method=$lt_cv_deplibs_check_method
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.
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"
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"
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
5648
test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
5651
AC_MSG_RESULT([$NM])
5654
# AC_CHECK_LIBM - check for math library
5655
AC_DEFUN([AC_CHECK_LIBM],
5656
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
5659
*-*-beos* | *-*-cygwin* | *-*-pw32*)
5660
# These system don't have libm
5663
AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
5664
AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
5667
AC_CHECK_LIB(m, main, LIBM="-lm")
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" ;;
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...
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])
5713
enable_ltdl_install=yes
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'])
5721
ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
5725
# For backwards non-gettext consistent compatibility...
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])
5738
# This is just to silence aclocal about the macro not being used
5739
ifelse([AC_DISABLE_FAST_INSTALL])
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
############################################################
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
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"
5771
# Create a temporary directory, and hook for its removal unless debugging.
5774
trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
5775
trap '{ (exit 1); exit 1; }' 1 2 13 15
5778
# Create a (secure) tmp directory for tmp files.
5781
tmp=`(umask 077 && mktemp -d -q "$TMPDIR/sedXXXXXX") 2>/dev/null` &&
5782
test -n "$tmp" && test -d "$tmp"
5785
tmp=$TMPDIR/sed$$-$RANDOM
5786
(umask 077 && mkdir $tmp)
5789
echo "$me: cannot create a temporary directory in $TMPDIR" >&2
5790
{ (exit 1); exit 1; }
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"
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}
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
5818
lt_cv_path_SED=$_sed
5824
if test "X$SED" != "X"; then
5829
AC_MSG_RESULT([$SED])