Codebase list libatasmart / upstream/0.19
Imported Upstream version 0.19 Michael Biebl 11 years ago
29 changed file(s) with 16136 addition(s) and 15381 deletion(s). Raw diff Collapse all Expand all
1414 # You should have received a copy of the GNU Lesser General Public
1515 # License along with libatasmart. If not, If not, see
1616 # <http://www.gnu.org/licenses/>.
17
18 AM_CFLAGS = $(WARNINGFLAGS)
19 AM_LDFLAGS = $(GCLDFLAGS)
1720
1821 dist_doc_DATA = README
1922
0 # Makefile.in generated by automake 1.11.1 from Makefile.am.
0 # Makefile.in generated by automake 1.11.3 from Makefile.am.
11 # @configure_input@
22
33 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
4 # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
5 # Inc.
4 # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
5 # Foundation, Inc.
66 # This Makefile.in is free software; the Free Software Foundation
77 # gives unlimited permission to copy and/or distribute it,
88 # with or without modifications, as long as this notice is preserved.
5959 DIST_COMMON = README $(am__configure_deps) $(dist_doc_DATA) \
6060 $(include_HEADERS) $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
6161 $(srcdir)/config.h.in $(srcdir)/libatasmart.pc.in \
62 $(top_srcdir)/configure compile config.guess config.rpath \
63 config.sub depcomp install-sh ltmain.sh missing
62 $(top_srcdir)/configure build-aux/compile \
63 build-aux/config.guess build-aux/config.sub build-aux/depcomp \
64 build-aux/install-sh build-aux/ltmain.sh build-aux/missing
6465 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
6566 am__aclocal_m4_deps = $(top_srcdir)/m4/attributes.m4 \
6667 $(top_srcdir)/m4/ax_cc_for_build.m4 \
9697 am__base_list = \
9798 sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
9899 sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
100 am__uninstall_files_from_dir = { \
101 test -z "$$files" \
102 || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
103 || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
104 $(am__cd) "$$dir" && rm -f $$files; }; \
105 }
99106 am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(sbindir)" \
100107 "$(DESTDIR)$(docdir)" "$(DESTDIR)$(pkgconfigdir)" \
101108 "$(DESTDIR)$(vapidir)" "$(DESTDIR)$(includedir)"
104111 libatasmart_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
105112 am_libatasmart_la_OBJECTS = libatasmart_la-atasmart.strpool.lo
106113 libatasmart_la_OBJECTS = $(am_libatasmart_la_OBJECTS)
107 AM_V_lt = $(am__v_lt_$(V))
108 am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
114 AM_V_lt = $(am__v_lt_@AM_V@)
115 am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
109116 am__v_lt_0 = --silent
110117 libatasmart_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
111118 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
119126 sktest_OBJECTS = sktest.$(OBJEXT)
120127 sktest_DEPENDENCIES = libatasmart.la
121128 DEFAULT_INCLUDES = -I.@am__isrc@
122 depcomp = $(SHELL) $(top_srcdir)/depcomp
129 depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
123130 am__depfiles_maybe = depfiles
124131 am__mv = mv -f
125132 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
128135 $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
129136 $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
130137 $(AM_CFLAGS) $(CFLAGS)
131 AM_V_CC = $(am__v_CC_$(V))
132 am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
138 AM_V_CC = $(am__v_CC_@AM_V@)
139 am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
133140 am__v_CC_0 = @echo " CC " $@;
134 AM_V_at = $(am__v_at_$(V))
135 am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
141 AM_V_at = $(am__v_at_@AM_V@)
142 am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
136143 am__v_at_0 = @
137144 CCLD = $(CC)
138145 LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
139146 $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
140147 $(AM_LDFLAGS) $(LDFLAGS) -o $@
141 AM_V_CCLD = $(am__v_CCLD_$(V))
142 am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
148 AM_V_CCLD = $(am__v_CCLD_@AM_V@)
149 am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
143150 am__v_CCLD_0 = @echo " CCLD " $@;
144 AM_V_GEN = $(am__v_GEN_$(V))
145 am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
151 AM_V_GEN = $(am__v_GEN_@AM_V@)
152 am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
146153 am__v_GEN_0 = @echo " GEN " $@;
147154 SOURCES = $(libatasmart_la_SOURCES) $(skdump_SOURCES) sktest.c
148155 DIST_SOURCES = $(libatasmart_la_SOURCES) $(skdump_SOURCES) sktest.c
167174 distdir = $(PACKAGE)-$(VERSION)
168175 top_distdir = $(distdir)
169176 am__remove_distdir = \
170 { test ! -d "$(distdir)" \
171 || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
172 && rm -fr "$(distdir)"; }; }
177 if test -d "$(distdir)"; then \
178 find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
179 && rm -rf "$(distdir)" \
180 || { sleep 5 && rm -rf "$(distdir)"; }; \
181 else :; fi
173182 am__relativize = \
174183 dir0=`pwd`; \
175184 sed_first='s,^\([^/]*\)/.*$$,\1,'; \
195204 dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
196205 done; \
197206 reldir="$$dir2"
198 DIST_ARCHIVES = $(distdir).tar.gz
199207 GZIP_ENV = --best
208 DIST_ARCHIVES = $(distdir).tar.xz
200209 distuninstallcheck_listfiles = find . -type f -print
210 am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
211 | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
201212 distcleancheck_listfiles = find . -type f -print
202213 ACLOCAL = @ACLOCAL@
203214 AMTAR = @AMTAR@
228239 EXEEXT = @EXEEXT@
229240 EXEEXT_FOR_BUILD = @EXEEXT_FOR_BUILD@
230241 FGREP = @FGREP@
242 GCLDFLAGS = @GCLDFLAGS@
231243 GREP = @GREP@
232244 INSTALL = @INSTALL@
233245 INSTALL_DATA = @INSTALL_DATA@
271283 SHELL = @SHELL@
272284 STRIP = @STRIP@
273285 VERSION = @VERSION@
286 WARNINGFLAGS = @WARNINGFLAGS@
274287 abs_builddir = @abs_builddir@
275288 abs_srcdir = @abs_srcdir@
276289 abs_top_builddir = @abs_top_builddir@
323336 top_build_prefix = @top_build_prefix@
324337 top_builddir = @top_builddir@
325338 top_srcdir = @top_srcdir@
339 AM_CFLAGS = $(WARNINGFLAGS)
340 AM_LDFLAGS = $(GCLDFLAGS)
326341 dist_doc_DATA = README
327342 EXTRA_DIST = \
328343 autogen.sh \
400415
401416 .SUFFIXES:
402417 .SUFFIXES: .c .lo .o .obj
403 am--refresh:
418 am--refresh: Makefile
404419 @:
405420 $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
406421 @for dep in $?; do \
436451 $(am__aclocal_m4_deps):
437452
438453 config.h: stamp-h1
439 @if test ! -f $@; then \
440 rm -f stamp-h1; \
441 $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \
442 else :; fi
454 @if test ! -f $@; then rm -f stamp-h1; else :; fi
455 @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi
443456
444457 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
445458 @rm -f stamp-h1
484497 echo "rm -f \"$${dir}/so_locations\""; \
485498 rm -f "$${dir}/so_locations"; \
486499 done
487 libatasmart.la: $(libatasmart_la_OBJECTS) $(libatasmart_la_DEPENDENCIES)
500 libatasmart.la: $(libatasmart_la_OBJECTS) $(libatasmart_la_DEPENDENCIES) $(EXTRA_libatasmart_la_DEPENDENCIES)
488501 $(AM_V_CCLD)$(libatasmart_la_LINK) -rpath $(libdir) $(libatasmart_la_OBJECTS) $(libatasmart_la_LIBADD) $(LIBS)
489502 install-sbinPROGRAMS: $(sbin_PROGRAMS)
490503 @$(NORMAL_INSTALL)
529542 list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
530543 echo " rm -f" $$list; \
531544 rm -f $$list
532 skdump$(EXEEXT): $(skdump_OBJECTS) $(skdump_DEPENDENCIES)
545 skdump$(EXEEXT): $(skdump_OBJECTS) $(skdump_DEPENDENCIES) $(EXTRA_skdump_DEPENDENCIES)
533546 @rm -f skdump$(EXEEXT)
534547 $(AM_V_CCLD)$(LINK) $(skdump_OBJECTS) $(skdump_LDADD) $(LIBS)
535 sktest$(EXEEXT): $(sktest_OBJECTS) $(sktest_DEPENDENCIES)
548 sktest$(EXEEXT): $(sktest_OBJECTS) $(sktest_DEPENDENCIES) $(EXTRA_sktest_DEPENDENCIES)
536549 @rm -f sktest$(EXEEXT)
537550 $(AM_V_CCLD)$(LINK) $(sktest_OBJECTS) $(sktest_LDADD) $(LIBS)
538551
549562 .c.o:
550563 @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
551564 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
552 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
553 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
565 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
554566 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
555 @am__fastdepCC_FALSE@ $(COMPILE) -c $<
567 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $<
556568
557569 .c.obj:
558570 @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
559571 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
560 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
561 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
572 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
562573 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
563 @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
574 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
564575
565576 .c.lo:
566577 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
567578 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
568 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
569 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
579 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
570580 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
571 @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
581 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
572582
573583 libatasmart_la-atasmart.strpool.lo: atasmart.strpool.c
574584 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libatasmart_la_CFLAGS) $(CFLAGS) -MT libatasmart_la-atasmart.strpool.lo -MD -MP -MF $(DEPDIR)/libatasmart_la-atasmart.strpool.Tpo -c -o libatasmart_la-atasmart.strpool.lo `test -f 'atasmart.strpool.c' || echo '$(srcdir)/'`atasmart.strpool.c
575585 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libatasmart_la-atasmart.strpool.Tpo $(DEPDIR)/libatasmart_la-atasmart.strpool.Plo
576 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
577 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='atasmart.strpool.c' object='libatasmart_la-atasmart.strpool.lo' libtool=yes @AMDEPBACKSLASH@
586 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='atasmart.strpool.c' object='libatasmart_la-atasmart.strpool.lo' libtool=yes @AMDEPBACKSLASH@
578587 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
579 @am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libatasmart_la_CFLAGS) $(CFLAGS) -c -o libatasmart_la-atasmart.strpool.lo `test -f 'atasmart.strpool.c' || echo '$(srcdir)/'`atasmart.strpool.c
588 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libatasmart_la_CFLAGS) $(CFLAGS) -c -o libatasmart_la-atasmart.strpool.lo `test -f 'atasmart.strpool.c' || echo '$(srcdir)/'`atasmart.strpool.c
580589
581590 mostlyclean-libtool:
582591 -rm -f *.lo
603612 @$(NORMAL_UNINSTALL)
604613 @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \
605614 files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
606 test -n "$$files" || exit 0; \
607 echo " ( cd '$(DESTDIR)$(docdir)' && rm -f" $$files ")"; \
608 cd "$(DESTDIR)$(docdir)" && rm -f $$files
615 dir='$(DESTDIR)$(docdir)'; $(am__uninstall_files_from_dir)
609616 install-pkgconfigDATA: $(pkgconfig_DATA)
610617 @$(NORMAL_INSTALL)
611618 test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)"
623630 @$(NORMAL_UNINSTALL)
624631 @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
625632 files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
626 test -n "$$files" || exit 0; \
627 echo " ( cd '$(DESTDIR)$(pkgconfigdir)' && rm -f" $$files ")"; \
628 cd "$(DESTDIR)$(pkgconfigdir)" && rm -f $$files
633 dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir)
629634 install-vapiDATA: $(vapi_DATA)
630635 @$(NORMAL_INSTALL)
631636 test -z "$(vapidir)" || $(MKDIR_P) "$(DESTDIR)$(vapidir)"
643648 @$(NORMAL_UNINSTALL)
644649 @list='$(vapi_DATA)'; test -n "$(vapidir)" || list=; \
645650 files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
646 test -n "$$files" || exit 0; \
647 echo " ( cd '$(DESTDIR)$(vapidir)' && rm -f" $$files ")"; \
648 cd "$(DESTDIR)$(vapidir)" && rm -f $$files
651 dir='$(DESTDIR)$(vapidir)'; $(am__uninstall_files_from_dir)
649652 install-includeHEADERS: $(include_HEADERS)
650653 @$(NORMAL_INSTALL)
651654 test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)"
663666 @$(NORMAL_UNINSTALL)
664667 @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
665668 files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
666 test -n "$$files" || exit 0; \
667 echo " ( cd '$(DESTDIR)$(includedir)' && rm -f" $$files ")"; \
668 cd "$(DESTDIR)$(includedir)" && rm -f $$files
669 dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir)
669670
670671 # This directory's subdirectories are mostly independent; you can cd
671672 # into them and run `make' without going through this Makefile.
874875 $(am__remove_distdir)
875876
876877 dist-bzip2: distdir
877 tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
878 tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
879 $(am__remove_distdir)
880
881 dist-lzip: distdir
882 tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
878883 $(am__remove_distdir)
879884
880885 dist-lzma: distdir
881886 tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
882887 $(am__remove_distdir)
883
884888 dist-xz: distdir
885 tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz
889 tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
886890 $(am__remove_distdir)
887891
888892 dist-tarZ: distdir
899903 $(am__remove_distdir)
900904
901905 dist dist-all: distdir
902 tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
906 tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
903907 $(am__remove_distdir)
904908
905909 # This target untars the dist file and tries a VPATH configuration. Then
913917 bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
914918 *.tar.lzma*) \
915919 lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
920 *.tar.lz*) \
921 lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
916922 *.tar.xz*) \
917923 xz -dc $(distdir).tar.xz | $(am__untar) ;;\
918924 *.tar.Z*) \
932938 && am__cwd=`pwd` \
933939 && $(am__cd) $(distdir)/_build \
934940 && ../configure --srcdir=.. --prefix="$$dc_install_base" \
941 $(AM_DISTCHECK_CONFIGURE_FLAGS) \
935942 $(DISTCHECK_CONFIGURE_FLAGS) \
936943 && $(MAKE) $(AM_MAKEFLAGS) \
937944 && $(MAKE) $(AM_MAKEFLAGS) dvi \
960967 list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
961968 sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
962969 distuninstallcheck:
963 @$(am__cd) '$(distuninstallcheck_dir)' \
964 && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
970 @test -n '$(distuninstallcheck_dir)' || { \
971 echo 'ERROR: trying to run $@ with an empty' \
972 '$$(distuninstallcheck_dir)' >&2; \
973 exit 1; \
974 }; \
975 $(am__cd) '$(distuninstallcheck_dir)' || { \
976 echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
977 exit 1; \
978 }; \
979 test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
965980 || { echo "ERROR: files left after uninstall:" ; \
966981 if test -n "$(DESTDIR)"; then \
967982 echo " (check DESTDIR support)"; \
9981013
9991014 installcheck: installcheck-recursive
10001015 install-strip:
1001 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
1002 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
1003 `test -z '$(STRIP)' || \
1004 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
1016 if test -z '$(STRIP)'; then \
1017 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
1018 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
1019 install; \
1020 else \
1021 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
1022 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
1023 "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
1024 fi
10051025 mostlyclean-generic:
10061026
10071027 clean-generic:
11001120 .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
11011121 all all-am am--refresh check check-am clean clean-generic \
11021122 clean-libLTLIBRARIES clean-libtool clean-sbinPROGRAMS ctags \
1103 ctags-recursive dist dist-all dist-bzip2 dist-gzip dist-lzma \
1104 dist-shar dist-tarZ dist-xz dist-zip distcheck distclean \
1105 distclean-compile distclean-generic distclean-hdr \
1123 ctags-recursive dist dist-all dist-bzip2 dist-gzip dist-lzip \
1124 dist-lzma dist-shar dist-tarZ dist-xz dist-zip distcheck \
1125 distclean distclean-compile distclean-generic distclean-hdr \
11061126 distclean-libtool distclean-tags distcleancheck distdir \
11071127 distuninstallcheck dvi dvi-am html html-am info info-am \
11081128 install install-am install-data install-data-am \
0 # generated automatically by aclocal 1.11.1 -*- Autoconf -*-
0 # generated automatically by aclocal 1.11.3 -*- Autoconf -*-
11
22 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
3 # 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
3 # 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation,
4 # Inc.
45 # This file is free software; the Free Software Foundation
56 # gives unlimited permission to copy and/or distribute it,
67 # with or without modifications, as long as this notice is preserved.
176177 fi[]dnl
177178 ])# PKG_CHECK_MODULES
178179
179 # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
180 #
181 # This file is free software; the Free Software Foundation
182 # gives unlimited permission to copy and/or distribute it,
183 # with or without modifications, as long as this notice is preserved.
180 # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software
181 # Foundation, Inc.
182 #
183 # This file is free software; the Free Software Foundation
184 # gives unlimited permission to copy and/or distribute it,
185 # with or without modifications, as long as this notice is preserved.
186
187 # serial 1
184188
185189 # AM_AUTOMAKE_VERSION(VERSION)
186190 # ----------------------------
191195 [am__api_version='1.11'
192196 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
193197 dnl require some minimum version. Point them to the right macro.
194 m4_if([$1], [1.11.1], [],
198 m4_if([$1], [1.11.3], [],
195199 [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
196200 ])
197201
207211 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
208212 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
209213 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
210 [AM_AUTOMAKE_VERSION([1.11.1])dnl
214 [AM_AUTOMAKE_VERSION([1.11.3])dnl
211215 m4_ifndef([AC_AUTOCONF_VERSION],
212216 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
213217 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
214218
215219 # AM_AUX_DIR_EXPAND -*- Autoconf -*-
216220
217 # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
218 #
219 # This file is free software; the Free Software Foundation
220 # gives unlimited permission to copy and/or distribute it,
221 # with or without modifications, as long as this notice is preserved.
221 # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
222 #
223 # This file is free software; the Free Software Foundation
224 # gives unlimited permission to copy and/or distribute it,
225 # with or without modifications, as long as this notice is preserved.
226
227 # serial 1
222228
223229 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
224230 # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
301307 Usually this means the macro was only invoked conditionally.]])
302308 fi])])
303309
304 # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
305 # Free Software Foundation, Inc.
306 #
307 # This file is free software; the Free Software Foundation
308 # gives unlimited permission to copy and/or distribute it,
309 # with or without modifications, as long as this notice is preserved.
310
311 # serial 10
310 # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009,
311 # 2010, 2011 Free Software Foundation, Inc.
312 #
313 # This file is free software; the Free Software Foundation
314 # gives unlimited permission to copy and/or distribute it,
315 # with or without modifications, as long as this notice is preserved.
316
317 # serial 12
312318
313319 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
314320 # written in clear, in which case automake, when reading aclocal.m4,
348354 # instance it was reported that on HP-UX the gcc test will end up
349355 # making a dummy file named `D' -- because `-MD' means `put the output
350356 # in D'.
357 rm -rf conftest.dir
351358 mkdir conftest.dir
352359 # Copy depcomp to subdir because otherwise we won't find it if we're
353360 # using a relative directory.
412419 break
413420 fi
414421 ;;
415 msvisualcpp | msvcmsys)
422 msvc7 | msvc7msys | msvisualcpp | msvcmsys)
416423 # This compiler won't grok `-c -o', but also, the minuso test has
417424 # not run yet. These depmodes are late enough in the game, and
418425 # so weak that their functioning should not be impacted.
477484 if test "x$enable_dependency_tracking" != xno; then
478485 am_depcomp="$ac_aux_dir/depcomp"
479486 AMDEPBACKSLASH='\'
487 am__nodep='_no'
480488 fi
481489 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
482490 AC_SUBST([AMDEPBACKSLASH])dnl
483491 _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
492 AC_SUBST([am__nodep])dnl
493 _AM_SUBST_NOTMAKE([am__nodep])dnl
484494 ])
485495
486496 # Generate code to set up dependency tracking. -*- Autoconf -*-
702712 done
703713 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
704714
705 # Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc.
706 #
707 # This file is free software; the Free Software Foundation
708 # gives unlimited permission to copy and/or distribute it,
709 # with or without modifications, as long as this notice is preserved.
715 # Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation,
716 # Inc.
717 #
718 # This file is free software; the Free Software Foundation
719 # gives unlimited permission to copy and/or distribute it,
720 # with or without modifications, as long as this notice is preserved.
721
722 # serial 1
710723
711724 # AM_PROG_INSTALL_SH
712725 # ------------------
874887 fi
875888 ])
876889
877 # Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
878 #
879 # This file is free software; the Free Software Foundation
880 # gives unlimited permission to copy and/or distribute it,
881 # with or without modifications, as long as this notice is preserved.
890 # Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation,
891 # Inc.
892 #
893 # This file is free software; the Free Software Foundation
894 # gives unlimited permission to copy and/or distribute it,
895 # with or without modifications, as long as this notice is preserved.
896
897 # serial 1
882898
883899 # AM_PROG_MKDIR_P
884900 # ---------------
902918
903919 # Helper functions for option handling. -*- Autoconf -*-
904920
905 # Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc.
906 #
907 # This file is free software; the Free Software Foundation
908 # gives unlimited permission to copy and/or distribute it,
909 # with or without modifications, as long as this notice is preserved.
910
911 # serial 4
921 # Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software
922 # Foundation, Inc.
923 #
924 # This file is free software; the Free Software Foundation
925 # gives unlimited permission to copy and/or distribute it,
926 # with or without modifications, as long as this notice is preserved.
927
928 # serial 5
912929
913930 # _AM_MANGLE_OPTION(NAME)
914931 # -----------------------
916933 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
917934
918935 # _AM_SET_OPTION(NAME)
919 # ------------------------------
936 # --------------------
920937 # Set option NAME. Presently that only means defining a flag for this option.
921938 AC_DEFUN([_AM_SET_OPTION],
922939 [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
923940
924941 # _AM_SET_OPTIONS(OPTIONS)
925 # ----------------------------------
942 # ------------------------
926943 # OPTIONS is a space-separated list of Automake options.
927944 AC_DEFUN([_AM_SET_OPTIONS],
928945 [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
933950 AC_DEFUN([_AM_IF_OPTION],
934951 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
935952
936 # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
937 #
938 # This file is free software; the Free Software Foundation
939 # gives unlimited permission to copy and/or distribute it,
940 # with or without modifications, as long as this notice is preserved.
953 # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
954 #
955 # This file is free software; the Free Software Foundation
956 # gives unlimited permission to copy and/or distribute it,
957 # with or without modifications, as long as this notice is preserved.
958
959 # serial 1
941960
942961 # AM_RUN_LOG(COMMAND)
943962 # -------------------
10151034 fi
10161035 AC_MSG_RESULT(yes)])
10171036
1018 # Copyright (C) 2009 Free Software Foundation, Inc.
1019 #
1020 # This file is free software; the Free Software Foundation
1021 # gives unlimited permission to copy and/or distribute it,
1022 # with or without modifications, as long as this notice is preserved.
1023
1024 # serial 1
1037 # Copyright (C) 2009, 2011 Free Software Foundation, Inc.
1038 #
1039 # This file is free software; the Free Software Foundation
1040 # gives unlimited permission to copy and/or distribute it,
1041 # with or without modifications, as long as this notice is preserved.
1042
1043 # serial 2
10251044
10261045 # AM_SILENT_RULES([DEFAULT])
10271046 # --------------------------
10361055 no) AM_DEFAULT_VERBOSITY=1;;
10371056 *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
10381057 esac
1058 dnl
1059 dnl A few `make' implementations (e.g., NonStop OS and NextStep)
1060 dnl do not support nested variable expansions.
1061 dnl See automake bug#9928 and bug#10237.
1062 am_make=${MAKE-make}
1063 AC_CACHE_CHECK([whether $am_make supports nested variables],
1064 [am_cv_make_support_nested_variables],
1065 [if AS_ECHO([['TRUE=$(BAR$(V))
1066 BAR0=false
1067 BAR1=true
1068 V=1
1069 am__doit:
1070 @$(TRUE)
1071 .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
1072 am_cv_make_support_nested_variables=yes
1073 else
1074 am_cv_make_support_nested_variables=no
1075 fi])
1076 if test $am_cv_make_support_nested_variables = yes; then
1077 dnl Using `$V' instead of `$(V)' breaks IRIX make.
1078 AM_V='$(V)'
1079 AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
1080 else
1081 AM_V=$AM_DEFAULT_VERBOSITY
1082 AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
1083 fi
1084 AC_SUBST([AM_V])dnl
1085 AM_SUBST_NOTMAKE([AM_V])dnl
1086 AC_SUBST([AM_DEFAULT_V])dnl
1087 AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
10391088 AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
10401089 AM_BACKSLASH='\'
10411090 AC_SUBST([AM_BACKSLASH])dnl
10421091 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
10431092 ])
10441093
1045 # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
1046 #
1047 # This file is free software; the Free Software Foundation
1048 # gives unlimited permission to copy and/or distribute it,
1049 # with or without modifications, as long as this notice is preserved.
1094 # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
1095 #
1096 # This file is free software; the Free Software Foundation
1097 # gives unlimited permission to copy and/or distribute it,
1098 # with or without modifications, as long as this notice is preserved.
1099
1100 # serial 1
10501101
10511102 # AM_PROG_INSTALL_STRIP
10521103 # ---------------------
10701121 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
10711122 AC_SUBST([INSTALL_STRIP_PROGRAM])])
10721123
1073 # Copyright (C) 2006, 2008 Free Software Foundation, Inc.
1074 #
1075 # This file is free software; the Free Software Foundation
1076 # gives unlimited permission to copy and/or distribute it,
1077 # with or without modifications, as long as this notice is preserved.
1078
1079 # serial 2
1124 # Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc.
1125 #
1126 # This file is free software; the Free Software Foundation
1127 # gives unlimited permission to copy and/or distribute it,
1128 # with or without modifications, as long as this notice is preserved.
1129
1130 # serial 3
10801131
10811132 # _AM_SUBST_NOTMAKE(VARIABLE)
10821133 # ---------------------------
10851136 AC_DEFUN([_AM_SUBST_NOTMAKE])
10861137
10871138 # AM_SUBST_NOTMAKE(VARIABLE)
1088 # ---------------------------
1139 # --------------------------
10891140 # Public sister of _AM_SUBST_NOTMAKE.
10901141 AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
10911142
10921143 # Check how to create a tarball. -*- Autoconf -*-
10931144
1094 # Copyright (C) 2004, 2005 Free Software Foundation, Inc.
1145 # Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc.
10951146 #
10961147 # This file is free software; the Free Software Foundation
10971148 # gives unlimited permission to copy and/or distribute it,
11131164 # a tarball read from stdin.
11141165 # $(am__untar) < result.tar
11151166 AC_DEFUN([_AM_PROG_TAR],
1116 [# Always define AMTAR for backward compatibility.
1117 AM_MISSING_PROG([AMTAR], [tar])
1167 [# Always define AMTAR for backward compatibility. Yes, it's still used
1168 # in the wild :-( We should find a proper way to deprecate it ...
1169 AC_SUBST([AMTAR], ['$${TAR-tar}'])
11181170 m4_if([$1], [v7],
1119 [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
1171 [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
11201172 [m4_case([$1], [ustar],, [pax],,
11211173 [m4_fatal([Unknown tar format])])
11221174 AC_MSG_CHECKING([how to create a $1 tar archive])
13141314 [170] = { "available-reserved-space", SK_SMART_ATTRIBUTE_UNIT_PERCENT, NULL },
13151315 [171] = { "program-fail-count", SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
13161316 [172] = { "erase-fail-count", SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
1317 [175] = { "program-fail-count-chip", SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
1318 [176] = { "erase-fail-count-chip", SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
1319 [177] = { "wear-leveling-count", SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
1320 [178] = { "used-reserved-blocks-chip", SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
1321 [179] = { "used-reserved-blocks-total", SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
1322 [180] = { "unused-reserved-blocks", SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
1323 [181] = { "program-fail-count-total", SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
1324 [182] = { "erase-fail-count-total", SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
1325 [183] = { "runtime-bad-block-total", SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
13171326 [184] = { "end-to-end-error", SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
13181327 [187] = { "reported-uncorrect", SK_SMART_ATTRIBUTE_UNIT_SECTORS, verify_sectors },
13191328 [188] = { "command-timeout", SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
15661575 }, {
15671576
15681577 /*** Intel */
1569 "^INTEL SSDSA2CW[0-9]{3}G3$",
1578 "^INTEL SSDSA2(CT|BT|CW|BW)[0-9]{3}G3.*$", /* 320 Series */
15701579 NULL,
15711580 SK_SMART_QUIRK_3_UNUSED|
15721581 SK_SMART_QUIRK_4_UNUSED|
0 /* Saved 140 relocations, saved 7 strings (90 b) due to suffix compression. */
0 /* Saved 149 relocations, saved 7 strings (90 b) due to suffix compression. */
11 static const char _strpool_[] =
22 "16 Byte SCSI ATA SAT Passthru\0"
33 "12 Byte SCSI ATA SAT Passthru\0"
5050 "available-reserved-space\0" ***/
5151 "program-fail-count\0"
5252 "erase-fail-count\0"
53 "program-fail-count-chip\0"
54 "erase-fail-count-chip\0"
55 "wear-leveling-count\0"
56 "used-reserved-blocks-chip\0"
57 "used-reserved-blocks-total\0"
58 "unused-reserved-blocks\0"
59 "program-fail-count-total\0"
60 "erase-fail-count-total\0"
61 "runtime-bad-block-total\0"
5362 "end-to-end-error\0"
5463 "reported-uncorrect\0"
5564 "command-timeout\0"
14581467 static const SkSmartAttributeInfo const attribute_info[256] = {
14591468 [1] = { ((const char*) 1501), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
14601469 [2] = { ((const char*) 1521), SK_SMART_ATTRIBUTE_UNIT_UNKNOWN, NULL },
1461 [3] = { ((const char*) 2919), SK_SMART_ATTRIBUTE_UNIT_MSECONDS, verify_short_time },
1462 [4] = { ((const char*) 2932), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
1470 [3] = { ((const char*) 3133), SK_SMART_ATTRIBUTE_UNIT_MSECONDS, verify_short_time },
1471 [4] = { ((const char*) 3146), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
14631472 [5] = { ((const char*) 1544), SK_SMART_ATTRIBUTE_UNIT_SECTORS, verify_sectors },
14641473 [6] = { ((const char*) 1569), SK_SMART_ATTRIBUTE_UNIT_UNKNOWN, NULL },
14651474 [7] = { ((const char*) 1589), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
14691478 [11] = { ((const char*) 1659), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
14701479 [12] = { ((const char*) 1683), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
14711480 [13] = { ((const char*) 1701), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
1472 [170] = { ((const char*) 3183), SK_SMART_ATTRIBUTE_UNIT_PERCENT, NULL },
1481 [170] = { ((const char*) 3397), SK_SMART_ATTRIBUTE_UNIT_PERCENT, NULL },
14731482 [171] = { ((const char*) 1722), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
14741483 [172] = { ((const char*) 1741), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
1475 [184] = { ((const char*) 1758), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
1476 [187] = { ((const char*) 1775), SK_SMART_ATTRIBUTE_UNIT_SECTORS, verify_sectors },
1477 [188] = { ((const char*) 1794), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
1478 [189] = { ((const char*) 1810), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
1479 [190] = { ((const char*) 1826), SK_SMART_ATTRIBUTE_UNIT_MKELVIN, verify_temperature },
1480 [191] = { ((const char*) 1854), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
1481 [192] = { ((const char*) 1873), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
1482 [193] = { ((const char*) 1897), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
1483 [194] = { ((const char*) 1914), SK_SMART_ATTRIBUTE_UNIT_MKELVIN, verify_temperature },
1484 [195] = { ((const char*) 1936), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
1485 [196] = { ((const char*) 1959), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
1486 [197] = { ((const char*) 1983), SK_SMART_ATTRIBUTE_UNIT_SECTORS, verify_sectors },
1487 [198] = { ((const char*) 2006), SK_SMART_ATTRIBUTE_UNIT_SECTORS, verify_sectors },
1488 [199] = { ((const char*) 2028), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
1489 [200] = { ((const char*) 2049), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
1490 [201] = { ((const char*) 2071), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
1491 [202] = { ((const char*) 2092), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
1492 [203] = { ((const char*) 2110), SK_SMART_ATTRIBUTE_UNIT_UNKNOWN, NULL },
1493 [204] = { ((const char*) 2125), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
1494 [205] = { ((const char*) 2148), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
1495 [206] = { ((const char*) 2170), SK_SMART_ATTRIBUTE_UNIT_UNKNOWN, NULL },
1496 [207] = { ((const char*) 2184), SK_SMART_ATTRIBUTE_UNIT_UNKNOWN, NULL },
1497 [208] = { ((const char*) 2202), SK_SMART_ATTRIBUTE_UNIT_UNKNOWN, NULL },
1498 [209] = { ((const char*) 2212), SK_SMART_ATTRIBUTE_UNIT_UNKNOWN, NULL },
1499 [220] = { ((const char*) 2237), SK_SMART_ATTRIBUTE_UNIT_UNKNOWN, NULL },
1500 [221] = { ((const char*) 2248), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
1501 [222] = { ((const char*) 2269), SK_SMART_ATTRIBUTE_UNIT_MSECONDS, verify_long_time },
1502 [223] = { ((const char*) 2282), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
1503 [224] = { ((const char*) 2299), SK_SMART_ATTRIBUTE_UNIT_UNKNOWN, NULL },
1504 [225] = { ((const char*) 2313), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
1505 [226] = { ((const char*) 2332), SK_SMART_ATTRIBUTE_UNIT_MSECONDS, verify_short_time },
1506 [227] = { ((const char*) 2345), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
1507 [228] = { ((const char*) 2360), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
1508 [230] = { ((const char*) 2386), SK_SMART_ATTRIBUTE_UNIT_UNKNOWN, NULL },
1509 [231] = { ((const char*) 1834), SK_SMART_ATTRIBUTE_UNIT_MKELVIN, verify_temperature },
1484 [175] = { ((const char*) 1758), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
1485 [176] = { ((const char*) 1782), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
1486 [177] = { ((const char*) 1804), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
1487 [178] = { ((const char*) 1824), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
1488 [179] = { ((const char*) 1850), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
1489 [180] = { ((const char*) 1877), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
1490 [181] = { ((const char*) 1900), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
1491 [182] = { ((const char*) 1925), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
1492 [183] = { ((const char*) 1948), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
1493 [184] = { ((const char*) 1972), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
1494 [187] = { ((const char*) 1989), SK_SMART_ATTRIBUTE_UNIT_SECTORS, verify_sectors },
1495 [188] = { ((const char*) 2008), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
1496 [189] = { ((const char*) 2024), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
1497 [190] = { ((const char*) 2040), SK_SMART_ATTRIBUTE_UNIT_MKELVIN, verify_temperature },
1498 [191] = { ((const char*) 2068), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
1499 [192] = { ((const char*) 2087), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
1500 [193] = { ((const char*) 2111), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
1501 [194] = { ((const char*) 2128), SK_SMART_ATTRIBUTE_UNIT_MKELVIN, verify_temperature },
1502 [195] = { ((const char*) 2150), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
1503 [196] = { ((const char*) 2173), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
1504 [197] = { ((const char*) 2197), SK_SMART_ATTRIBUTE_UNIT_SECTORS, verify_sectors },
1505 [198] = { ((const char*) 2220), SK_SMART_ATTRIBUTE_UNIT_SECTORS, verify_sectors },
1506 [199] = { ((const char*) 2242), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
1507 [200] = { ((const char*) 2263), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
1508 [201] = { ((const char*) 2285), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
1509 [202] = { ((const char*) 2306), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
1510 [203] = { ((const char*) 2324), SK_SMART_ATTRIBUTE_UNIT_UNKNOWN, NULL },
1511 [204] = { ((const char*) 2339), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
1512 [205] = { ((const char*) 2362), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
1513 [206] = { ((const char*) 2384), SK_SMART_ATTRIBUTE_UNIT_UNKNOWN, NULL },
1514 [207] = { ((const char*) 2398), SK_SMART_ATTRIBUTE_UNIT_UNKNOWN, NULL },
1515 [208] = { ((const char*) 2416), SK_SMART_ATTRIBUTE_UNIT_UNKNOWN, NULL },
1516 [209] = { ((const char*) 2426), SK_SMART_ATTRIBUTE_UNIT_UNKNOWN, NULL },
1517 [220] = { ((const char*) 2451), SK_SMART_ATTRIBUTE_UNIT_UNKNOWN, NULL },
1518 [221] = { ((const char*) 2462), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
1519 [222] = { ((const char*) 2483), SK_SMART_ATTRIBUTE_UNIT_MSECONDS, verify_long_time },
1520 [223] = { ((const char*) 2496), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
1521 [224] = { ((const char*) 2513), SK_SMART_ATTRIBUTE_UNIT_UNKNOWN, NULL },
1522 [225] = { ((const char*) 2527), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
1523 [226] = { ((const char*) 2546), SK_SMART_ATTRIBUTE_UNIT_MSECONDS, verify_short_time },
1524 [227] = { ((const char*) 2559), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
1525 [228] = { ((const char*) 2574), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
1526 [230] = { ((const char*) 2600), SK_SMART_ATTRIBUTE_UNIT_UNKNOWN, NULL },
1527 [231] = { ((const char*) 2048), SK_SMART_ATTRIBUTE_UNIT_MKELVIN, verify_temperature },
15101528
15111529 /* http://www.adtron.com/pdf/SMART_for_XceedLite_SATA_RevA.pdf */
1512 [232] = { ((const char*) 2401), SK_SMART_ATTRIBUTE_UNIT_PERCENT, NULL },
1513 [233] = { ((const char*) 2421), SK_SMART_ATTRIBUTE_UNIT_UNKNOWN, NULL },
1514 [234] = { ((const char*) 2440), SK_SMART_ATTRIBUTE_UNIT_SECTORS, NULL },
1515 [235] = { ((const char*) 2464), SK_SMART_ATTRIBUTE_UNIT_UNKNOWN, NULL },
1516
1517 [240] = { ((const char*) 2480), SK_SMART_ATTRIBUTE_UNIT_MSECONDS, verify_long_time },
1518 [241] = { ((const char*) 3097), SK_SMART_ATTRIBUTE_UNIT_MB, NULL },
1519 [242] = { ((const char*) 2498), SK_SMART_ATTRIBUTE_UNIT_MB, NULL },
1520 [250] = { ((const char*) 2514), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL }
1530 [232] = { ((const char*) 2615), SK_SMART_ATTRIBUTE_UNIT_PERCENT, NULL },
1531 [233] = { ((const char*) 2635), SK_SMART_ATTRIBUTE_UNIT_UNKNOWN, NULL },
1532 [234] = { ((const char*) 2654), SK_SMART_ATTRIBUTE_UNIT_SECTORS, NULL },
1533 [235] = { ((const char*) 2678), SK_SMART_ATTRIBUTE_UNIT_UNKNOWN, NULL },
1534
1535 [240] = { ((const char*) 2694), SK_SMART_ATTRIBUTE_UNIT_MSECONDS, verify_long_time },
1536 [241] = { ((const char*) 3311), SK_SMART_ATTRIBUTE_UNIT_MB, NULL },
1537 [242] = { ((const char*) 2712), SK_SMART_ATTRIBUTE_UNIT_MB, NULL },
1538 [250] = { ((const char*) 2728), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL }
15211539 };
15221540 /* %STRINGPOOLSTOP% */
15231541
15481566
15491567 /* %STRINGPOOLSTART% */
15501568 static const char *quirk_name[] = {
1551 ((const char*) 2536),
1552 ((const char*) 2553),
1553 ((const char*) 2570),
1554 ((const char*) 2591),
1555 ((const char*) 2619),
1556 ((const char*) 2634),
1557 ((const char*) 2649),
1558 ((const char*) 2661),
1559 ((const char*) 2681),
1560 ((const char*) 2701),
1561 ((const char*) 2711),
1562 ((const char*) 2721),
1563 ((const char*) 2733),
1564 ((const char*) 2745),
1565 ((const char*) 2757),
1569 ((const char*) 2750),
1570 ((const char*) 2767),
15661571 ((const char*) 2784),
1567 ((const char*) 2810),
1568 ((const char*) 2831),
1569 ((const char*) 2840),
1570 ((const char*) 2866),
1571 ((const char*) 2892),
1572 ((const char*) 2910),
1572 ((const char*) 2805),
1573 ((const char*) 2833),
1574 ((const char*) 2848),
1575 ((const char*) 2863),
1576 ((const char*) 2875),
1577 ((const char*) 2895),
1578 ((const char*) 2915),
1579 ((const char*) 2925),
1580 ((const char*) 2935),
1581 ((const char*) 2947),
1582 ((const char*) 2959),
1583 ((const char*) 2971),
1584 ((const char*) 2998),
1585 ((const char*) 3024),
1586 ((const char*) 3045),
1587 ((const char*) 3054),
1588 ((const char*) 3080),
1589 ((const char*) 3106),
1590 ((const char*) 3124),
15731591 NULL
15741592 };
15751593 /* %STRINGPOOLSTOP% */
17241742 }, {
17251743
17261744 /*** Intel */
1727 "^INTEL SSDSA2CW[0-9]{3}G3$",
1745 "^INTEL SSDSA2(CT|BT|CW|BW)[0-9]{3}G3.*$", /* 320 Series */
17281746 NULL,
17291747 SK_SMART_QUIRK_3_UNUSED|
17301748 SK_SMART_QUIRK_4_UNUSED|
18201838 /* %STRINGPOOLSTART% */
18211839 if (quirk & SK_SMART_QUIRK_3_UNUSED) {
18221840 static const SkSmartAttributeInfo a = {
1823 ((const char*) 2919), SK_SMART_ATTRIBUTE_UNIT_UNKNOWN, NULL
1841 ((const char*) 3133), SK_SMART_ATTRIBUTE_UNIT_UNKNOWN, NULL
18241842 };
18251843 return &a;
18261844 }
18321850 /* %STRINGPOOLSTART% */
18331851 if (quirk & SK_SMART_QUIRK_4_UNUSED) {
18341852 static const SkSmartAttributeInfo a = {
1835 ((const char*) 2932), SK_SMART_ATTRIBUTE_UNIT_UNKNOWN, NULL
1853 ((const char*) 3146), SK_SMART_ATTRIBUTE_UNIT_UNKNOWN, NULL
18361854 };
18371855 return &a;
18381856 }
18501868 /* %STRINGPOOLSTART% */
18511869 if (quirk & SK_SMART_QUIRK_9_POWERONMINUTES) {
18521870 static const SkSmartAttributeInfo a = {
1853 ((const char*) 2949), SK_SMART_ATTRIBUTE_UNIT_MSECONDS, verify_long_time
1871 ((const char*) 3163), SK_SMART_ATTRIBUTE_UNIT_MSECONDS, verify_long_time
18541872 };
18551873 return &a;
18561874
18571875 } else if (quirk & SK_SMART_QUIRK_9_POWERONSECONDS) {
18581876 static const SkSmartAttributeInfo a = {
1859 ((const char*) 2966), SK_SMART_ATTRIBUTE_UNIT_MSECONDS, verify_long_time
1877 ((const char*) 3180), SK_SMART_ATTRIBUTE_UNIT_MSECONDS, verify_long_time
18601878 };
18611879 return &a;
18621880
18631881 } else if (quirk & SK_SMART_QUIRK_9_POWERONHALFMINUTES) {
18641882 static const SkSmartAttributeInfo a = {
1865 ((const char*) 2983), SK_SMART_ATTRIBUTE_UNIT_MSECONDS, verify_long_time
1883 ((const char*) 3197), SK_SMART_ATTRIBUTE_UNIT_MSECONDS, verify_long_time
18661884 };
18671885 return &a;
18681886 } else if (quirk & SK_SMART_QUIRK_9_UNKNOWN)
18811899 /* %STRINGPOOLSTART% */
18821900 if (quirk & SK_SMART_QUIRK_192_EMERGENCYRETRACTCYCLECT) {
18831901 static const SkSmartAttributeInfo a = {
1884 ((const char*) 3005), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL
1902 ((const char*) 3219), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL
18851903 };
18861904 return &a;
18871905 }
18931911 /* %STRINGPOOLSTART% */
18941912 if (quirk & SK_SMART_QUIRK_194_10XCELSIUS) {
18951913 static const SkSmartAttributeInfo a = {
1896 ((const char*) 3035), SK_SMART_ATTRIBUTE_UNIT_MKELVIN, verify_temperature
1914 ((const char*) 3249), SK_SMART_ATTRIBUTE_UNIT_MKELVIN, verify_temperature
18971915 };
18981916 return &a;
18991917 } else if (quirk & SK_SMART_QUIRK_194_UNKNOWN)
19181936 /* %STRINGPOOLSTART% */
19191937 if (quirk & SK_SMART_QUIRK_200_WRITEERRORCOUNT) {
19201938 static const SkSmartAttributeInfo a = {
1921 ((const char*) 3061), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL
1939 ((const char*) 3275), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL
19221940 };
19231941 return &a;
19241942 }
19301948 /* %STRINGPOOLSTART% */
19311949 if (quirk & SK_SMART_QUIRK_201_DETECTEDTACOUNT) {
19321950 static const SkSmartAttributeInfo a = {
1933 ((const char*) 3079), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL
1951 ((const char*) 3293), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL
19341952 };
19351953 return &a;
19361954 }
19421960 /* %STRINGPOOLSTART% */
19431961 if (quirk & SK_SMART_QUIRK_225_TOTALLBASWRITTEN) {
19441962 static const SkSmartAttributeInfo a = {
1945 ((const char*) 3097), SK_SMART_ATTRIBUTE_UNIT_MB, NULL
1963 ((const char*) 3311), SK_SMART_ATTRIBUTE_UNIT_MB, NULL
19461964 };
19471965 return &a;
19481966 }
19541972 /* %STRINGPOOLSTART% */
19551973 if (quirk & SK_SMART_QUIRK_226_TIMEWORKLOADMEDIAWEAR) {
19561974 static const SkSmartAttributeInfo a = {
1957 ((const char*) 3116), SK_SMART_ATTRIBUTE_UNIT_SMALL_PERCENT, NULL
1975 ((const char*) 3330), SK_SMART_ATTRIBUTE_UNIT_SMALL_PERCENT, NULL
19581976 };
19591977 return &a;
19601978 }
19661984 /* %STRINGPOOLSTART% */
19671985 if (quirk & SK_SMART_QUIRK_227_TIMEWORKLOADHOSTREADS) {
19681986 static const SkSmartAttributeInfo a = {
1969 ((const char*) 3142), SK_SMART_ATTRIBUTE_UNIT_SMALL_PERCENT, NULL
1987 ((const char*) 3356), SK_SMART_ATTRIBUTE_UNIT_SMALL_PERCENT, NULL
19701988 };
19711989 return &a;
19721990 }
19781996 /* %STRINGPOOLSTART% */
19791997 if (quirk & SK_SMART_QUIRK_228_WORKLOADTIMER) {
19801998 static const SkSmartAttributeInfo a = {
1981 ((const char*) 3168), SK_SMART_ATTRIBUTE_UNIT_MSECONDS, NULL
1999 ((const char*) 3382), SK_SMART_ATTRIBUTE_UNIT_MSECONDS, NULL
19822000 };
19832001 return &a;
19842002 }
19902008 /* %STRINGPOOLSTART% */
19912009 if (quirk & SK_SMART_QUIRK_232_AVAILABLERESERVEDSPACE) {
19922010 static const SkSmartAttributeInfo a = {
1993 ((const char*) 3183), SK_SMART_ATTRIBUTE_UNIT_PERCENT, NULL
2011 ((const char*) 3397), SK_SMART_ATTRIBUTE_UNIT_PERCENT, NULL
19942012 };
19952013 return &a;
19962014 }
20012019 /* %STRINGPOOLSTART% */
20022020 if (quirk & SK_SMART_QUIRK_233_MEDIAWEAROUTINDICATOR) {
20032021 static const SkSmartAttributeInfo a = {
2004 ((const char*) 3208), SK_SMART_ATTRIBUTE_UNIT_PERCENT, NULL
2022 ((const char*) 3422), SK_SMART_ATTRIBUTE_UNIT_PERCENT, NULL
20052023 };
20062024 return &a;
20072025 }
21962214 const char * const map[] = {
21972215 [SK_SMART_ATTRIBUTE_UNIT_UNKNOWN] = NULL,
21982216 [SK_SMART_ATTRIBUTE_UNIT_NONE] = ((const char*) 30),
2199 [SK_SMART_ATTRIBUTE_UNIT_MSECONDS] = ((const char*) 3232),
2200 [SK_SMART_ATTRIBUTE_UNIT_SECTORS] = ((const char*) 3235),
2201 [SK_SMART_ATTRIBUTE_UNIT_MKELVIN] = ((const char*) 3243),
2202 [SK_SMART_ATTRIBUTE_UNIT_PERCENT] = ((const char*) 3246),
2203 [SK_SMART_ATTRIBUTE_UNIT_SMALL_PERCENT] = ((const char*) 3246),
2204 [SK_SMART_ATTRIBUTE_UNIT_MB] = ((const char*) 3248)
2217 [SK_SMART_ATTRIBUTE_UNIT_MSECONDS] = ((const char*) 3446),
2218 [SK_SMART_ATTRIBUTE_UNIT_SECTORS] = ((const char*) 3449),
2219 [SK_SMART_ATTRIBUTE_UNIT_MKELVIN] = ((const char*) 3457),
2220 [SK_SMART_ATTRIBUTE_UNIT_PERCENT] = ((const char*) 3460),
2221 [SK_SMART_ATTRIBUTE_UNIT_SMALL_PERCENT] = ((const char*) 3460),
2222 [SK_SMART_ATTRIBUTE_UNIT_MB] = ((const char*) 3462)
22052223 };
22062224 /* %STRINGPOOLSTOP% */
22072225
23882406
23892407 /* %STRINGPOOLSTART% */
23902408 const char * const map[] = {
2391 [SK_SMART_OVERALL_GOOD] = ((const char*) 3251),
2392 [SK_SMART_OVERALL_BAD_ATTRIBUTE_IN_THE_PAST] = ((const char*) 3256),
2393 [SK_SMART_OVERALL_BAD_SECTOR] = ((const char*) 3282),
2394 [SK_SMART_OVERALL_BAD_ATTRIBUTE_NOW] = ((const char*) 3293),
2395 [SK_SMART_OVERALL_BAD_SECTOR_MANY] = ((const char*) 3311),
2396 [SK_SMART_OVERALL_BAD_STATUS] = ((const char*) 3327),
2409 [SK_SMART_OVERALL_GOOD] = ((const char*) 3465),
2410 [SK_SMART_OVERALL_BAD_ATTRIBUTE_IN_THE_PAST] = ((const char*) 3470),
2411 [SK_SMART_OVERALL_BAD_SECTOR] = ((const char*) 3496),
2412 [SK_SMART_OVERALL_BAD_ATTRIBUTE_NOW] = ((const char*) 3507),
2413 [SK_SMART_OVERALL_BAD_SECTOR_MANY] = ((const char*) 3525),
2414 [SK_SMART_OVERALL_BAD_STATUS] = ((const char*) 3541),
23972415 };
23982416 /* %STRINGPOOLSTOP% */
23992417
1717 # License along with libatasmart; If not, see
1818 # <http://www.gnu.org/licenses/>.
1919
20 AM_VERSION=1.11
21 AC_VERSION=2.63
20 if [ -f .git/hooks/pre-commit.sample -a ! -f .git/hooks/pre-commit ] ; then
21 cp -p .git/hooks/pre-commit.sample .git/hooks/pre-commit && \
22 chmod +x .git/hooks/pre-commit && \
23 echo "Activated pre-commit hook."
24 fi
2225
23 run_versioned() {
24 local P
25 local V
26 autoreconf --force --install --symlink
2627
27 V=$(echo "$2" | sed -e 's,\.,,g')
28
29 if [ -e "`which $1$V 2> /dev/null`" ] ; then
30 P="$1$V"
31 else
32 if [ -e "`which $1-$2 2> /dev/null`" ] ; then
33 P="$1-$2"
34 else
35 P="$1"
36 fi
37 fi
38
39 shift 2
40 "$P" "$@"
28 libdir() {
29 echo $(cd $1/$(gcc -print-multi-os-directory); pwd)
4130 }
4231
43 set -ex
32 args="\
33 --sysconfdir=/etc \
34 --localstatedir=/var \
35 --libdir=$(libdir /usr/lib) \
36 --libexecdir=/usr/lib"
4437
45 if [ -f .git/hooks/pre-commit.sample -a ! -f .git/hooks/pre-commit ] ; then
46 cp -p .git/hooks/pre-commit.sample .git/hooks/pre-commit && \
47 chmod +x .git/hooks/pre-commit && \
48 echo "Activated pre-commit hook."
38 if [ "x$1" == "xc" ]; then
39 ./configure CFLAGS='-g -O0 -Wp,-U_FORTIFY_SOURCE' $args
40 make clean
41 else
42 echo
43 echo "----------------------------------------------------------------"
44 echo "Initialized build system. For a common configuration please run:"
45 echo "----------------------------------------------------------------"
46 echo
47 echo "./configure CFLAGS='-g -O0 -Wp,-U_FORTIFY_SOURCE' $args"
48 echo
4949 fi
50
51 if type -p colorgcc > /dev/null ; then
52 export CC=colorgcc
53 fi
54
55 libdir() {
56 echo $(cd $1/$(gcc -print-multi-os-directory); pwd)
57 }
58
59 if [ "x$1" = "xam" ] ; then
60 run_versioned automake "$AM_VERSION" -a -c --foreign
61 ./config.status
62 else
63 rm -rf autom4te.cache
64 rm -f config.cache
65
66 libtoolize -c --force
67 run_versioned aclocal "$AM_VERSION" -I m4
68 run_versioned autoconf "$AC_VERSION" -Wall
69 run_versioned autoheader "$AC_VERSION"
70 run_versioned automake "$AM_VERSION" --copy --foreign --add-missing
71
72 if [ "x$1" != "xac" ]; then
73 CFLAGS="$CFLAGS -g -O0" ./configure \
74 --sysconfdir=/etc \
75 --localstatedir=/var \
76 --libexecdir=/usr/lib \
77 --libdir=$(libdir /usr/local/lib) \
78 "$@"
79 make clean
80 fi
81 fi
0 #! /bin/sh
1 # Wrapper for compilers which do not understand '-c -o'.
2
3 scriptversion=2012-01-04.17; # UTC
4
5 # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009, 2010, 2012 Free
6 # Software Foundation, Inc.
7 # Written by Tom Tromey <tromey@cygnus.com>.
8 #
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 2, or (at your option)
12 # any later version.
13 #
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
18 #
19 # You should have received a copy of the GNU General Public License
20 # along with this program. If not, see <http://www.gnu.org/licenses/>.
21
22 # As a special exception to the GNU General Public License, if you
23 # distribute this file as part of a program that contains a
24 # configuration script generated by Autoconf, you may include it under
25 # the same distribution terms that you use for the rest of that program.
26
27 # This file is maintained in Automake, please report
28 # bugs to <bug-automake@gnu.org> or send patches to
29 # <automake-patches@gnu.org>.
30
31 nl='
32 '
33
34 # We need space, tab and new line, in precisely that order. Quoting is
35 # there to prevent tools from complaining about whitespace usage.
36 IFS=" "" $nl"
37
38 file_conv=
39
40 # func_file_conv build_file lazy
41 # Convert a $build file to $host form and store it in $file
42 # Currently only supports Windows hosts. If the determined conversion
43 # type is listed in (the comma separated) LAZY, no conversion will
44 # take place.
45 func_file_conv ()
46 {
47 file=$1
48 case $file in
49 / | /[!/]*) # absolute file, and not a UNC file
50 if test -z "$file_conv"; then
51 # lazily determine how to convert abs files
52 case `uname -s` in
53 MINGW*)
54 file_conv=mingw
55 ;;
56 CYGWIN*)
57 file_conv=cygwin
58 ;;
59 *)
60 file_conv=wine
61 ;;
62 esac
63 fi
64 case $file_conv/,$2, in
65 *,$file_conv,*)
66 ;;
67 mingw/*)
68 file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
69 ;;
70 cygwin/*)
71 file=`cygpath -m "$file" || echo "$file"`
72 ;;
73 wine/*)
74 file=`winepath -w "$file" || echo "$file"`
75 ;;
76 esac
77 ;;
78 esac
79 }
80
81 # func_cl_wrapper cl arg...
82 # Adjust compile command to suit cl
83 func_cl_wrapper ()
84 {
85 # Assume a capable shell
86 lib_path=
87 shared=:
88 linker_opts=
89 for arg
90 do
91 if test -n "$eat"; then
92 eat=
93 else
94 case $1 in
95 -o)
96 # configure might choose to run compile as 'compile cc -o foo foo.c'.
97 eat=1
98 case $2 in
99 *.o | *.[oO][bB][jJ])
100 func_file_conv "$2"
101 set x "$@" -Fo"$file"
102 shift
103 ;;
104 *)
105 func_file_conv "$2"
106 set x "$@" -Fe"$file"
107 shift
108 ;;
109 esac
110 ;;
111 -I*)
112 func_file_conv "${1#-I}" mingw
113 set x "$@" -I"$file"
114 shift
115 ;;
116 -l*)
117 lib=${1#-l}
118 found=no
119 save_IFS=$IFS
120 IFS=';'
121 for dir in $lib_path $LIB
122 do
123 IFS=$save_IFS
124 if $shared && test -f "$dir/$lib.dll.lib"; then
125 found=yes
126 set x "$@" "$dir/$lib.dll.lib"
127 break
128 fi
129 if test -f "$dir/$lib.lib"; then
130 found=yes
131 set x "$@" "$dir/$lib.lib"
132 break
133 fi
134 done
135 IFS=$save_IFS
136
137 test "$found" != yes && set x "$@" "$lib.lib"
138 shift
139 ;;
140 -L*)
141 func_file_conv "${1#-L}"
142 if test -z "$lib_path"; then
143 lib_path=$file
144 else
145 lib_path="$lib_path;$file"
146 fi
147 linker_opts="$linker_opts -LIBPATH:$file"
148 ;;
149 -static)
150 shared=false
151 ;;
152 -Wl,*)
153 arg=${1#-Wl,}
154 save_ifs="$IFS"; IFS=','
155 for flag in $arg; do
156 IFS="$save_ifs"
157 linker_opts="$linker_opts $flag"
158 done
159 IFS="$save_ifs"
160 ;;
161 -Xlinker)
162 eat=1
163 linker_opts="$linker_opts $2"
164 ;;
165 -*)
166 set x "$@" "$1"
167 shift
168 ;;
169 *.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
170 func_file_conv "$1"
171 set x "$@" -Tp"$file"
172 shift
173 ;;
174 *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
175 func_file_conv "$1" mingw
176 set x "$@" "$file"
177 shift
178 ;;
179 *)
180 set x "$@" "$1"
181 shift
182 ;;
183 esac
184 fi
185 shift
186 done
187 if test -n "$linker_opts"; then
188 linker_opts="-link$linker_opts"
189 fi
190 exec "$@" $linker_opts
191 exit 1
192 }
193
194 eat=
195
196 case $1 in
197 '')
198 echo "$0: No command. Try '$0 --help' for more information." 1>&2
199 exit 1;
200 ;;
201 -h | --h*)
202 cat <<\EOF
203 Usage: compile [--help] [--version] PROGRAM [ARGS]
204
205 Wrapper for compilers which do not understand '-c -o'.
206 Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
207 arguments, and rename the output as expected.
208
209 If you are trying to build a whole package this is not the
210 right script to run: please start by reading the file 'INSTALL'.
211
212 Report bugs to <bug-automake@gnu.org>.
213 EOF
214 exit $?
215 ;;
216 -v | --v*)
217 echo "compile $scriptversion"
218 exit $?
219 ;;
220 cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
221 func_cl_wrapper "$@" # Doesn't return...
222 ;;
223 esac
224
225 ofile=
226 cfile=
227
228 for arg
229 do
230 if test -n "$eat"; then
231 eat=
232 else
233 case $1 in
234 -o)
235 # configure might choose to run compile as 'compile cc -o foo foo.c'.
236 # So we strip '-o arg' only if arg is an object.
237 eat=1
238 case $2 in
239 *.o | *.obj)
240 ofile=$2
241 ;;
242 *)
243 set x "$@" -o "$2"
244 shift
245 ;;
246 esac
247 ;;
248 *.c)
249 cfile=$1
250 set x "$@" "$1"
251 shift
252 ;;
253 *)
254 set x "$@" "$1"
255 shift
256 ;;
257 esac
258 fi
259 shift
260 done
261
262 if test -z "$ofile" || test -z "$cfile"; then
263 # If no '-o' option was seen then we might have been invoked from a
264 # pattern rule where we don't need one. That is ok -- this is a
265 # normal compilation that the losing compiler can handle. If no
266 # '.c' file was seen then we are probably linking. That is also
267 # ok.
268 exec "$@"
269 fi
270
271 # Name of file we expect compiler to create.
272 cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
273
274 # Create the lock directory.
275 # Note: use '[/\\:.-]' here to ensure that we don't use the same name
276 # that we are using for the .o file. Also, base the name on the expected
277 # object file name, since that is what matters with a parallel build.
278 lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
279 while true; do
280 if mkdir "$lockdir" >/dev/null 2>&1; then
281 break
282 fi
283 sleep 1
284 done
285 # FIXME: race condition here if user kills between mkdir and trap.
286 trap "rmdir '$lockdir'; exit 1" 1 2 15
287
288 # Run the compile.
289 "$@"
290 ret=$?
291
292 if test -f "$cofile"; then
293 test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
294 elif test -f "${cofile}bj"; then
295 test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
296 fi
297
298 rmdir "$lockdir"
299 exit $ret
300
301 # Local Variables:
302 # mode: shell-script
303 # sh-indentation: 2
304 # eval: (add-hook 'write-file-hooks 'time-stamp)
305 # time-stamp-start: "scriptversion="
306 # time-stamp-format: "%:y-%02m-%02d.%02H"
307 # time-stamp-time-zone: "UTC"
308 # time-stamp-end: "; # UTC"
309 # End:
0 #! /bin/sh
1 # Attempt to guess a canonical system name.
2 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
3 # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
4 # 2011, 2012 Free Software Foundation, Inc.
5
6 timestamp='2012-01-01'
7
8 # This file is free software; you can redistribute it and/or modify it
9 # under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
12 #
13 # This program is distributed in the hope that it will be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 # General Public License for more details.
17 #
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
21 # 02110-1301, USA.
22 #
23 # As a special exception to the GNU General Public License, if you
24 # distribute this file as part of a program that contains a
25 # configuration script generated by Autoconf, you may include it under
26 # the same distribution terms that you use for the rest of that program.
27
28
29 # Originally written by Per Bothner. Please send patches (context
30 # diff format) to <config-patches@gnu.org> and include a ChangeLog
31 # entry.
32 #
33 # This script attempts to guess a canonical system name similar to
34 # config.sub. If it succeeds, it prints the system name on stdout, and
35 # exits with 0. Otherwise, it exits with 1.
36 #
37 # You can get the latest version of this script from:
38 # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
39
40 me=`echo "$0" | sed -e 's,.*/,,'`
41
42 usage="\
43 Usage: $0 [OPTION]
44
45 Output the configuration name of the system \`$me' is run on.
46
47 Operation modes:
48 -h, --help print this help, then exit
49 -t, --time-stamp print date of last modification, then exit
50 -v, --version print version number, then exit
51
52 Report bugs and patches to <config-patches@gnu.org>."
53
54 version="\
55 GNU config.guess ($timestamp)
56
57 Originally written by Per Bothner.
58 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
59 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
60 Free Software Foundation, Inc.
61
62 This is free software; see the source for copying conditions. There is NO
63 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
64
65 help="
66 Try \`$me --help' for more information."
67
68 # Parse command line
69 while test $# -gt 0 ; do
70 case $1 in
71 --time-stamp | --time* | -t )
72 echo "$timestamp" ; exit ;;
73 --version | -v )
74 echo "$version" ; exit ;;
75 --help | --h* | -h )
76 echo "$usage"; exit ;;
77 -- ) # Stop option processing
78 shift; break ;;
79 - ) # Use stdin as input.
80 break ;;
81 -* )
82 echo "$me: invalid option $1$help" >&2
83 exit 1 ;;
84 * )
85 break ;;
86 esac
87 done
88
89 if test $# != 0; then
90 echo "$me: too many arguments$help" >&2
91 exit 1
92 fi
93
94 trap 'exit 1' 1 2 15
95
96 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a
97 # compiler to aid in system detection is discouraged as it requires
98 # temporary files to be created and, as you can see below, it is a
99 # headache to deal with in a portable fashion.
100
101 # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
102 # use `HOST_CC' if defined, but it is deprecated.
103
104 # Portable tmp directory creation inspired by the Autoconf team.
105
106 set_cc_for_build='
107 trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
108 trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
109 : ${TMPDIR=/tmp} ;
110 { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
111 { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
112 { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
113 { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
114 dummy=$tmp/dummy ;
115 tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
116 case $CC_FOR_BUILD,$HOST_CC,$CC in
117 ,,) echo "int x;" > $dummy.c ;
118 for c in cc gcc c89 c99 ; do
119 if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
120 CC_FOR_BUILD="$c"; break ;
121 fi ;
122 done ;
123 if test x"$CC_FOR_BUILD" = x ; then
124 CC_FOR_BUILD=no_compiler_found ;
125 fi
126 ;;
127 ,,*) CC_FOR_BUILD=$CC ;;
128 ,*,*) CC_FOR_BUILD=$HOST_CC ;;
129 esac ; set_cc_for_build= ;'
130
131 # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
132 # (ghazi@noc.rutgers.edu 1994-08-24)
133 if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
134 PATH=$PATH:/.attbin ; export PATH
135 fi
136
137 UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
138 UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
139 UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
140 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
141
142 # Note: order is significant - the case branches are not exclusive.
143
144 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
145 *:NetBSD:*:*)
146 # NetBSD (nbsd) targets should (where applicable) match one or
147 # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
148 # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
149 # switched to ELF, *-*-netbsd* would select the old
150 # object file format. This provides both forward
151 # compatibility and a consistent mechanism for selecting the
152 # object file format.
153 #
154 # Note: NetBSD doesn't particularly care about the vendor
155 # portion of the name. We always set it to "unknown".
156 sysctl="sysctl -n hw.machine_arch"
157 UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
158 /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
159 case "${UNAME_MACHINE_ARCH}" in
160 armeb) machine=armeb-unknown ;;
161 arm*) machine=arm-unknown ;;
162 sh3el) machine=shl-unknown ;;
163 sh3eb) machine=sh-unknown ;;
164 sh5el) machine=sh5le-unknown ;;
165 *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
166 esac
167 # The Operating System including object format, if it has switched
168 # to ELF recently, or will in the future.
169 case "${UNAME_MACHINE_ARCH}" in
170 arm*|i386|m68k|ns32k|sh3*|sparc|vax)
171 eval $set_cc_for_build
172 if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
173 | grep -q __ELF__
174 then
175 # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
176 # Return netbsd for either. FIX?
177 os=netbsd
178 else
179 os=netbsdelf
180 fi
181 ;;
182 *)
183 os=netbsd
184 ;;
185 esac
186 # The OS release
187 # Debian GNU/NetBSD machines have a different userland, and
188 # thus, need a distinct triplet. However, they do not need
189 # kernel version information, so it can be replaced with a
190 # suitable tag, in the style of linux-gnu.
191 case "${UNAME_VERSION}" in
192 Debian*)
193 release='-gnu'
194 ;;
195 *)
196 release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
197 ;;
198 esac
199 # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
200 # contains redundant information, the shorter form:
201 # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
202 echo "${machine}-${os}${release}"
203 exit ;;
204 *:OpenBSD:*:*)
205 UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
206 echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
207 exit ;;
208 *:ekkoBSD:*:*)
209 echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
210 exit ;;
211 *:SolidBSD:*:*)
212 echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
213 exit ;;
214 macppc:MirBSD:*:*)
215 echo powerpc-unknown-mirbsd${UNAME_RELEASE}
216 exit ;;
217 *:MirBSD:*:*)
218 echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
219 exit ;;
220 alpha:OSF1:*:*)
221 case $UNAME_RELEASE in
222 *4.0)
223 UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
224 ;;
225 *5.*)
226 UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
227 ;;
228 esac
229 # According to Compaq, /usr/sbin/psrinfo has been available on
230 # OSF/1 and Tru64 systems produced since 1995. I hope that
231 # covers most systems running today. This code pipes the CPU
232 # types through head -n 1, so we only detect the type of CPU 0.
233 ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
234 case "$ALPHA_CPU_TYPE" in
235 "EV4 (21064)")
236 UNAME_MACHINE="alpha" ;;
237 "EV4.5 (21064)")
238 UNAME_MACHINE="alpha" ;;
239 "LCA4 (21066/21068)")
240 UNAME_MACHINE="alpha" ;;
241 "EV5 (21164)")
242 UNAME_MACHINE="alphaev5" ;;
243 "EV5.6 (21164A)")
244 UNAME_MACHINE="alphaev56" ;;
245 "EV5.6 (21164PC)")
246 UNAME_MACHINE="alphapca56" ;;
247 "EV5.7 (21164PC)")
248 UNAME_MACHINE="alphapca57" ;;
249 "EV6 (21264)")
250 UNAME_MACHINE="alphaev6" ;;
251 "EV6.7 (21264A)")
252 UNAME_MACHINE="alphaev67" ;;
253 "EV6.8CB (21264C)")
254 UNAME_MACHINE="alphaev68" ;;
255 "EV6.8AL (21264B)")
256 UNAME_MACHINE="alphaev68" ;;
257 "EV6.8CX (21264D)")
258 UNAME_MACHINE="alphaev68" ;;
259 "EV6.9A (21264/EV69A)")
260 UNAME_MACHINE="alphaev69" ;;
261 "EV7 (21364)")
262 UNAME_MACHINE="alphaev7" ;;
263 "EV7.9 (21364A)")
264 UNAME_MACHINE="alphaev79" ;;
265 esac
266 # A Pn.n version is a patched version.
267 # A Vn.n version is a released version.
268 # A Tn.n version is a released field test version.
269 # A Xn.n version is an unreleased experimental baselevel.
270 # 1.2 uses "1.2" for uname -r.
271 echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
272 # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
273 exitcode=$?
274 trap '' 0
275 exit $exitcode ;;
276 Alpha\ *:Windows_NT*:*)
277 # How do we know it's Interix rather than the generic POSIX subsystem?
278 # Should we change UNAME_MACHINE based on the output of uname instead
279 # of the specific Alpha model?
280 echo alpha-pc-interix
281 exit ;;
282 21064:Windows_NT:50:3)
283 echo alpha-dec-winnt3.5
284 exit ;;
285 Amiga*:UNIX_System_V:4.0:*)
286 echo m68k-unknown-sysv4
287 exit ;;
288 *:[Aa]miga[Oo][Ss]:*:*)
289 echo ${UNAME_MACHINE}-unknown-amigaos
290 exit ;;
291 *:[Mm]orph[Oo][Ss]:*:*)
292 echo ${UNAME_MACHINE}-unknown-morphos
293 exit ;;
294 *:OS/390:*:*)
295 echo i370-ibm-openedition
296 exit ;;
297 *:z/VM:*:*)
298 echo s390-ibm-zvmoe
299 exit ;;
300 *:OS400:*:*)
301 echo powerpc-ibm-os400
302 exit ;;
303 arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
304 echo arm-acorn-riscix${UNAME_RELEASE}
305 exit ;;
306 arm:riscos:*:*|arm:RISCOS:*:*)
307 echo arm-unknown-riscos
308 exit ;;
309 SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
310 echo hppa1.1-hitachi-hiuxmpp
311 exit ;;
312 Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
313 # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
314 if test "`(/bin/universe) 2>/dev/null`" = att ; then
315 echo pyramid-pyramid-sysv3
316 else
317 echo pyramid-pyramid-bsd
318 fi
319 exit ;;
320 NILE*:*:*:dcosx)
321 echo pyramid-pyramid-svr4
322 exit ;;
323 DRS?6000:unix:4.0:6*)
324 echo sparc-icl-nx6
325 exit ;;
326 DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
327 case `/usr/bin/uname -p` in
328 sparc) echo sparc-icl-nx7; exit ;;
329 esac ;;
330 s390x:SunOS:*:*)
331 echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
332 exit ;;
333 sun4H:SunOS:5.*:*)
334 echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
335 exit ;;
336 sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
337 echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
338 exit ;;
339 i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
340 echo i386-pc-auroraux${UNAME_RELEASE}
341 exit ;;
342 i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
343 eval $set_cc_for_build
344 SUN_ARCH="i386"
345 # If there is a compiler, see if it is configured for 64-bit objects.
346 # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
347 # This test works for both compilers.
348 if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
349 if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
350 (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
351 grep IS_64BIT_ARCH >/dev/null
352 then
353 SUN_ARCH="x86_64"
354 fi
355 fi
356 echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
357 exit ;;
358 sun4*:SunOS:6*:*)
359 # According to config.sub, this is the proper way to canonicalize
360 # SunOS6. Hard to guess exactly what SunOS6 will be like, but
361 # it's likely to be more like Solaris than SunOS4.
362 echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
363 exit ;;
364 sun4*:SunOS:*:*)
365 case "`/usr/bin/arch -k`" in
366 Series*|S4*)
367 UNAME_RELEASE=`uname -v`
368 ;;
369 esac
370 # Japanese Language versions have a version number like `4.1.3-JL'.
371 echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
372 exit ;;
373 sun3*:SunOS:*:*)
374 echo m68k-sun-sunos${UNAME_RELEASE}
375 exit ;;
376 sun*:*:4.2BSD:*)
377 UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
378 test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
379 case "`/bin/arch`" in
380 sun3)
381 echo m68k-sun-sunos${UNAME_RELEASE}
382 ;;
383 sun4)
384 echo sparc-sun-sunos${UNAME_RELEASE}
385 ;;
386 esac
387 exit ;;
388 aushp:SunOS:*:*)
389 echo sparc-auspex-sunos${UNAME_RELEASE}
390 exit ;;
391 # The situation for MiNT is a little confusing. The machine name
392 # can be virtually everything (everything which is not
393 # "atarist" or "atariste" at least should have a processor
394 # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
395 # to the lowercase version "mint" (or "freemint"). Finally
396 # the system name "TOS" denotes a system which is actually not
397 # MiNT. But MiNT is downward compatible to TOS, so this should
398 # be no problem.
399 atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
400 echo m68k-atari-mint${UNAME_RELEASE}
401 exit ;;
402 atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
403 echo m68k-atari-mint${UNAME_RELEASE}
404 exit ;;
405 *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
406 echo m68k-atari-mint${UNAME_RELEASE}
407 exit ;;
408 milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
409 echo m68k-milan-mint${UNAME_RELEASE}
410 exit ;;
411 hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
412 echo m68k-hades-mint${UNAME_RELEASE}
413 exit ;;
414 *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
415 echo m68k-unknown-mint${UNAME_RELEASE}
416 exit ;;
417 m68k:machten:*:*)
418 echo m68k-apple-machten${UNAME_RELEASE}
419 exit ;;
420 powerpc:machten:*:*)
421 echo powerpc-apple-machten${UNAME_RELEASE}
422 exit ;;
423 RISC*:Mach:*:*)
424 echo mips-dec-mach_bsd4.3
425 exit ;;
426 RISC*:ULTRIX:*:*)
427 echo mips-dec-ultrix${UNAME_RELEASE}
428 exit ;;
429 VAX*:ULTRIX*:*:*)
430 echo vax-dec-ultrix${UNAME_RELEASE}
431 exit ;;
432 2020:CLIX:*:* | 2430:CLIX:*:*)
433 echo clipper-intergraph-clix${UNAME_RELEASE}
434 exit ;;
435 mips:*:*:UMIPS | mips:*:*:RISCos)
436 eval $set_cc_for_build
437 sed 's/^ //' << EOF >$dummy.c
438 #ifdef __cplusplus
439 #include <stdio.h> /* for printf() prototype */
440 int main (int argc, char *argv[]) {
441 #else
442 int main (argc, argv) int argc; char *argv[]; {
443 #endif
444 #if defined (host_mips) && defined (MIPSEB)
445 #if defined (SYSTYPE_SYSV)
446 printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
447 #endif
448 #if defined (SYSTYPE_SVR4)
449 printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
450 #endif
451 #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
452 printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
453 #endif
454 #endif
455 exit (-1);
456 }
457 EOF
458 $CC_FOR_BUILD -o $dummy $dummy.c &&
459 dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
460 SYSTEM_NAME=`$dummy $dummyarg` &&
461 { echo "$SYSTEM_NAME"; exit; }
462 echo mips-mips-riscos${UNAME_RELEASE}
463 exit ;;
464 Motorola:PowerMAX_OS:*:*)
465 echo powerpc-motorola-powermax
466 exit ;;
467 Motorola:*:4.3:PL8-*)
468 echo powerpc-harris-powermax
469 exit ;;
470 Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
471 echo powerpc-harris-powermax
472 exit ;;
473 Night_Hawk:Power_UNIX:*:*)
474 echo powerpc-harris-powerunix
475 exit ;;
476 m88k:CX/UX:7*:*)
477 echo m88k-harris-cxux7
478 exit ;;
479 m88k:*:4*:R4*)
480 echo m88k-motorola-sysv4
481 exit ;;
482 m88k:*:3*:R3*)
483 echo m88k-motorola-sysv3
484 exit ;;
485 AViiON:dgux:*:*)
486 # DG/UX returns AViiON for all architectures
487 UNAME_PROCESSOR=`/usr/bin/uname -p`
488 if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
489 then
490 if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
491 [ ${TARGET_BINARY_INTERFACE}x = x ]
492 then
493 echo m88k-dg-dgux${UNAME_RELEASE}
494 else
495 echo m88k-dg-dguxbcs${UNAME_RELEASE}
496 fi
497 else
498 echo i586-dg-dgux${UNAME_RELEASE}
499 fi
500 exit ;;
501 M88*:DolphinOS:*:*) # DolphinOS (SVR3)
502 echo m88k-dolphin-sysv3
503 exit ;;
504 M88*:*:R3*:*)
505 # Delta 88k system running SVR3
506 echo m88k-motorola-sysv3
507 exit ;;
508 XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
509 echo m88k-tektronix-sysv3
510 exit ;;
511 Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
512 echo m68k-tektronix-bsd
513 exit ;;
514 *:IRIX*:*:*)
515 echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
516 exit ;;
517 ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
518 echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
519 exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
520 i*86:AIX:*:*)
521 echo i386-ibm-aix
522 exit ;;
523 ia64:AIX:*:*)
524 if [ -x /usr/bin/oslevel ] ; then
525 IBM_REV=`/usr/bin/oslevel`
526 else
527 IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
528 fi
529 echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
530 exit ;;
531 *:AIX:2:3)
532 if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
533 eval $set_cc_for_build
534 sed 's/^ //' << EOF >$dummy.c
535 #include <sys/systemcfg.h>
536
537 main()
538 {
539 if (!__power_pc())
540 exit(1);
541 puts("powerpc-ibm-aix3.2.5");
542 exit(0);
543 }
544 EOF
545 if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
546 then
547 echo "$SYSTEM_NAME"
548 else
549 echo rs6000-ibm-aix3.2.5
550 fi
551 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
552 echo rs6000-ibm-aix3.2.4
553 else
554 echo rs6000-ibm-aix3.2
555 fi
556 exit ;;
557 *:AIX:*:[4567])
558 IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
559 if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
560 IBM_ARCH=rs6000
561 else
562 IBM_ARCH=powerpc
563 fi
564 if [ -x /usr/bin/oslevel ] ; then
565 IBM_REV=`/usr/bin/oslevel`
566 else
567 IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
568 fi
569 echo ${IBM_ARCH}-ibm-aix${IBM_REV}
570 exit ;;
571 *:AIX:*:*)
572 echo rs6000-ibm-aix
573 exit ;;
574 ibmrt:4.4BSD:*|romp-ibm:BSD:*)
575 echo romp-ibm-bsd4.4
576 exit ;;
577 ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
578 echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
579 exit ;; # report: romp-ibm BSD 4.3
580 *:BOSX:*:*)
581 echo rs6000-bull-bosx
582 exit ;;
583 DPX/2?00:B.O.S.:*:*)
584 echo m68k-bull-sysv3
585 exit ;;
586 9000/[34]??:4.3bsd:1.*:*)
587 echo m68k-hp-bsd
588 exit ;;
589 hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
590 echo m68k-hp-bsd4.4
591 exit ;;
592 9000/[34678]??:HP-UX:*:*)
593 HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
594 case "${UNAME_MACHINE}" in
595 9000/31? ) HP_ARCH=m68000 ;;
596 9000/[34]?? ) HP_ARCH=m68k ;;
597 9000/[678][0-9][0-9])
598 if [ -x /usr/bin/getconf ]; then
599 sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
600 sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
601 case "${sc_cpu_version}" in
602 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
603 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
604 532) # CPU_PA_RISC2_0
605 case "${sc_kernel_bits}" in
606 32) HP_ARCH="hppa2.0n" ;;
607 64) HP_ARCH="hppa2.0w" ;;
608 '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
609 esac ;;
610 esac
611 fi
612 if [ "${HP_ARCH}" = "" ]; then
613 eval $set_cc_for_build
614 sed 's/^ //' << EOF >$dummy.c
615
616 #define _HPUX_SOURCE
617 #include <stdlib.h>
618 #include <unistd.h>
619
620 int main ()
621 {
622 #if defined(_SC_KERNEL_BITS)
623 long bits = sysconf(_SC_KERNEL_BITS);
624 #endif
625 long cpu = sysconf (_SC_CPU_VERSION);
626
627 switch (cpu)
628 {
629 case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
630 case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
631 case CPU_PA_RISC2_0:
632 #if defined(_SC_KERNEL_BITS)
633 switch (bits)
634 {
635 case 64: puts ("hppa2.0w"); break;
636 case 32: puts ("hppa2.0n"); break;
637 default: puts ("hppa2.0"); break;
638 } break;
639 #else /* !defined(_SC_KERNEL_BITS) */
640 puts ("hppa2.0"); break;
641 #endif
642 default: puts ("hppa1.0"); break;
643 }
644 exit (0);
645 }
646 EOF
647 (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
648 test -z "$HP_ARCH" && HP_ARCH=hppa
649 fi ;;
650 esac
651 if [ ${HP_ARCH} = "hppa2.0w" ]
652 then
653 eval $set_cc_for_build
654
655 # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
656 # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
657 # generating 64-bit code. GNU and HP use different nomenclature:
658 #
659 # $ CC_FOR_BUILD=cc ./config.guess
660 # => hppa2.0w-hp-hpux11.23
661 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
662 # => hppa64-hp-hpux11.23
663
664 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
665 grep -q __LP64__
666 then
667 HP_ARCH="hppa2.0w"
668 else
669 HP_ARCH="hppa64"
670 fi
671 fi
672 echo ${HP_ARCH}-hp-hpux${HPUX_REV}
673 exit ;;
674 ia64:HP-UX:*:*)
675 HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
676 echo ia64-hp-hpux${HPUX_REV}
677 exit ;;
678 3050*:HI-UX:*:*)
679 eval $set_cc_for_build
680 sed 's/^ //' << EOF >$dummy.c
681 #include <unistd.h>
682 int
683 main ()
684 {
685 long cpu = sysconf (_SC_CPU_VERSION);
686 /* The order matters, because CPU_IS_HP_MC68K erroneously returns
687 true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
688 results, however. */
689 if (CPU_IS_PA_RISC (cpu))
690 {
691 switch (cpu)
692 {
693 case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
694 case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
695 case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
696 default: puts ("hppa-hitachi-hiuxwe2"); break;
697 }
698 }
699 else if (CPU_IS_HP_MC68K (cpu))
700 puts ("m68k-hitachi-hiuxwe2");
701 else puts ("unknown-hitachi-hiuxwe2");
702 exit (0);
703 }
704 EOF
705 $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
706 { echo "$SYSTEM_NAME"; exit; }
707 echo unknown-hitachi-hiuxwe2
708 exit ;;
709 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
710 echo hppa1.1-hp-bsd
711 exit ;;
712 9000/8??:4.3bsd:*:*)
713 echo hppa1.0-hp-bsd
714 exit ;;
715 *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
716 echo hppa1.0-hp-mpeix
717 exit ;;
718 hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
719 echo hppa1.1-hp-osf
720 exit ;;
721 hp8??:OSF1:*:*)
722 echo hppa1.0-hp-osf
723 exit ;;
724 i*86:OSF1:*:*)
725 if [ -x /usr/sbin/sysversion ] ; then
726 echo ${UNAME_MACHINE}-unknown-osf1mk
727 else
728 echo ${UNAME_MACHINE}-unknown-osf1
729 fi
730 exit ;;
731 parisc*:Lites*:*:*)
732 echo hppa1.1-hp-lites
733 exit ;;
734 C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
735 echo c1-convex-bsd
736 exit ;;
737 C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
738 if getsysinfo -f scalar_acc
739 then echo c32-convex-bsd
740 else echo c2-convex-bsd
741 fi
742 exit ;;
743 C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
744 echo c34-convex-bsd
745 exit ;;
746 C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
747 echo c38-convex-bsd
748 exit ;;
749 C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
750 echo c4-convex-bsd
751 exit ;;
752 CRAY*Y-MP:*:*:*)
753 echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
754 exit ;;
755 CRAY*[A-Z]90:*:*:*)
756 echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
757 | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
758 -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
759 -e 's/\.[^.]*$/.X/'
760 exit ;;
761 CRAY*TS:*:*:*)
762 echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
763 exit ;;
764 CRAY*T3E:*:*:*)
765 echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
766 exit ;;
767 CRAY*SV1:*:*:*)
768 echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
769 exit ;;
770 *:UNICOS/mp:*:*)
771 echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
772 exit ;;
773 F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
774 FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
775 FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
776 FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
777 echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
778 exit ;;
779 5000:UNIX_System_V:4.*:*)
780 FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
781 FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
782 echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
783 exit ;;
784 i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
785 echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
786 exit ;;
787 sparc*:BSD/OS:*:*)
788 echo sparc-unknown-bsdi${UNAME_RELEASE}
789 exit ;;
790 *:BSD/OS:*:*)
791 echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
792 exit ;;
793 *:FreeBSD:*:*)
794 UNAME_PROCESSOR=`/usr/bin/uname -p`
795 case ${UNAME_PROCESSOR} in
796 amd64)
797 echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
798 *)
799 echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
800 esac
801 exit ;;
802 i*:CYGWIN*:*)
803 echo ${UNAME_MACHINE}-pc-cygwin
804 exit ;;
805 *:MINGW*:*)
806 echo ${UNAME_MACHINE}-pc-mingw32
807 exit ;;
808 i*:MSYS*:*)
809 echo ${UNAME_MACHINE}-pc-msys
810 exit ;;
811 i*:windows32*:*)
812 # uname -m includes "-pc" on this system.
813 echo ${UNAME_MACHINE}-mingw32
814 exit ;;
815 i*:PW*:*)
816 echo ${UNAME_MACHINE}-pc-pw32
817 exit ;;
818 *:Interix*:*)
819 case ${UNAME_MACHINE} in
820 x86)
821 echo i586-pc-interix${UNAME_RELEASE}
822 exit ;;
823 authenticamd | genuineintel | EM64T)
824 echo x86_64-unknown-interix${UNAME_RELEASE}
825 exit ;;
826 IA64)
827 echo ia64-unknown-interix${UNAME_RELEASE}
828 exit ;;
829 esac ;;
830 [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
831 echo i${UNAME_MACHINE}-pc-mks
832 exit ;;
833 8664:Windows_NT:*)
834 echo x86_64-pc-mks
835 exit ;;
836 i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
837 # How do we know it's Interix rather than the generic POSIX subsystem?
838 # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
839 # UNAME_MACHINE based on the output of uname instead of i386?
840 echo i586-pc-interix
841 exit ;;
842 i*:UWIN*:*)
843 echo ${UNAME_MACHINE}-pc-uwin
844 exit ;;
845 amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
846 echo x86_64-unknown-cygwin
847 exit ;;
848 p*:CYGWIN*:*)
849 echo powerpcle-unknown-cygwin
850 exit ;;
851 prep*:SunOS:5.*:*)
852 echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
853 exit ;;
854 *:GNU:*:*)
855 # the GNU system
856 echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
857 exit ;;
858 *:GNU/*:*:*)
859 # other systems with GNU libc and userland
860 echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
861 exit ;;
862 i*86:Minix:*:*)
863 echo ${UNAME_MACHINE}-pc-minix
864 exit ;;
865 alpha:Linux:*:*)
866 case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
867 EV5) UNAME_MACHINE=alphaev5 ;;
868 EV56) UNAME_MACHINE=alphaev56 ;;
869 PCA56) UNAME_MACHINE=alphapca56 ;;
870 PCA57) UNAME_MACHINE=alphapca56 ;;
871 EV6) UNAME_MACHINE=alphaev6 ;;
872 EV67) UNAME_MACHINE=alphaev67 ;;
873 EV68*) UNAME_MACHINE=alphaev68 ;;
874 esac
875 objdump --private-headers /bin/sh | grep -q ld.so.1
876 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
877 echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
878 exit ;;
879 arm*:Linux:*:*)
880 eval $set_cc_for_build
881 if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
882 | grep -q __ARM_EABI__
883 then
884 echo ${UNAME_MACHINE}-unknown-linux-gnu
885 else
886 if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
887 | grep -q __ARM_PCS_VFP
888 then
889 echo ${UNAME_MACHINE}-unknown-linux-gnueabi
890 else
891 echo ${UNAME_MACHINE}-unknown-linux-gnueabihf
892 fi
893 fi
894 exit ;;
895 avr32*:Linux:*:*)
896 echo ${UNAME_MACHINE}-unknown-linux-gnu
897 exit ;;
898 cris:Linux:*:*)
899 echo ${UNAME_MACHINE}-axis-linux-gnu
900 exit ;;
901 crisv32:Linux:*:*)
902 echo ${UNAME_MACHINE}-axis-linux-gnu
903 exit ;;
904 frv:Linux:*:*)
905 echo ${UNAME_MACHINE}-unknown-linux-gnu
906 exit ;;
907 hexagon:Linux:*:*)
908 echo ${UNAME_MACHINE}-unknown-linux-gnu
909 exit ;;
910 i*86:Linux:*:*)
911 LIBC=gnu
912 eval $set_cc_for_build
913 sed 's/^ //' << EOF >$dummy.c
914 #ifdef __dietlibc__
915 LIBC=dietlibc
916 #endif
917 EOF
918 eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
919 echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
920 exit ;;
921 ia64:Linux:*:*)
922 echo ${UNAME_MACHINE}-unknown-linux-gnu
923 exit ;;
924 m32r*:Linux:*:*)
925 echo ${UNAME_MACHINE}-unknown-linux-gnu
926 exit ;;
927 m68*:Linux:*:*)
928 echo ${UNAME_MACHINE}-unknown-linux-gnu
929 exit ;;
930 mips:Linux:*:* | mips64:Linux:*:*)
931 eval $set_cc_for_build
932 sed 's/^ //' << EOF >$dummy.c
933 #undef CPU
934 #undef ${UNAME_MACHINE}
935 #undef ${UNAME_MACHINE}el
936 #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
937 CPU=${UNAME_MACHINE}el
938 #else
939 #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
940 CPU=${UNAME_MACHINE}
941 #else
942 CPU=
943 #endif
944 #endif
945 EOF
946 eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
947 test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
948 ;;
949 or32:Linux:*:*)
950 echo ${UNAME_MACHINE}-unknown-linux-gnu
951 exit ;;
952 padre:Linux:*:*)
953 echo sparc-unknown-linux-gnu
954 exit ;;
955 parisc64:Linux:*:* | hppa64:Linux:*:*)
956 echo hppa64-unknown-linux-gnu
957 exit ;;
958 parisc:Linux:*:* | hppa:Linux:*:*)
959 # Look for CPU level
960 case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
961 PA7*) echo hppa1.1-unknown-linux-gnu ;;
962 PA8*) echo hppa2.0-unknown-linux-gnu ;;
963 *) echo hppa-unknown-linux-gnu ;;
964 esac
965 exit ;;
966 ppc64:Linux:*:*)
967 echo powerpc64-unknown-linux-gnu
968 exit ;;
969 ppc:Linux:*:*)
970 echo powerpc-unknown-linux-gnu
971 exit ;;
972 s390:Linux:*:* | s390x:Linux:*:*)
973 echo ${UNAME_MACHINE}-ibm-linux
974 exit ;;
975 sh64*:Linux:*:*)
976 echo ${UNAME_MACHINE}-unknown-linux-gnu
977 exit ;;
978 sh*:Linux:*:*)
979 echo ${UNAME_MACHINE}-unknown-linux-gnu
980 exit ;;
981 sparc:Linux:*:* | sparc64:Linux:*:*)
982 echo ${UNAME_MACHINE}-unknown-linux-gnu
983 exit ;;
984 tile*:Linux:*:*)
985 echo ${UNAME_MACHINE}-unknown-linux-gnu
986 exit ;;
987 vax:Linux:*:*)
988 echo ${UNAME_MACHINE}-dec-linux-gnu
989 exit ;;
990 x86_64:Linux:*:*)
991 echo ${UNAME_MACHINE}-unknown-linux-gnu
992 exit ;;
993 xtensa*:Linux:*:*)
994 echo ${UNAME_MACHINE}-unknown-linux-gnu
995 exit ;;
996 i*86:DYNIX/ptx:4*:*)
997 # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
998 # earlier versions are messed up and put the nodename in both
999 # sysname and nodename.
1000 echo i386-sequent-sysv4
1001 exit ;;
1002 i*86:UNIX_SV:4.2MP:2.*)
1003 # Unixware is an offshoot of SVR4, but it has its own version
1004 # number series starting with 2...
1005 # I am not positive that other SVR4 systems won't match this,
1006 # I just have to hope. -- rms.
1007 # Use sysv4.2uw... so that sysv4* matches it.
1008 echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
1009 exit ;;
1010 i*86:OS/2:*:*)
1011 # If we were able to find `uname', then EMX Unix compatibility
1012 # is probably installed.
1013 echo ${UNAME_MACHINE}-pc-os2-emx
1014 exit ;;
1015 i*86:XTS-300:*:STOP)
1016 echo ${UNAME_MACHINE}-unknown-stop
1017 exit ;;
1018 i*86:atheos:*:*)
1019 echo ${UNAME_MACHINE}-unknown-atheos
1020 exit ;;
1021 i*86:syllable:*:*)
1022 echo ${UNAME_MACHINE}-pc-syllable
1023 exit ;;
1024 i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
1025 echo i386-unknown-lynxos${UNAME_RELEASE}
1026 exit ;;
1027 i*86:*DOS:*:*)
1028 echo ${UNAME_MACHINE}-pc-msdosdjgpp
1029 exit ;;
1030 i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
1031 UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
1032 if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
1033 echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
1034 else
1035 echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
1036 fi
1037 exit ;;
1038 i*86:*:5:[678]*)
1039 # UnixWare 7.x, OpenUNIX and OpenServer 6.
1040 case `/bin/uname -X | grep "^Machine"` in
1041 *486*) UNAME_MACHINE=i486 ;;
1042 *Pentium) UNAME_MACHINE=i586 ;;
1043 *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
1044 esac
1045 echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
1046 exit ;;
1047 i*86:*:3.2:*)
1048 if test -f /usr/options/cb.name; then
1049 UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
1050 echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
1051 elif /bin/uname -X 2>/dev/null >/dev/null ; then
1052 UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
1053 (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
1054 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
1055 && UNAME_MACHINE=i586
1056 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
1057 && UNAME_MACHINE=i686
1058 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
1059 && UNAME_MACHINE=i686
1060 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
1061 else
1062 echo ${UNAME_MACHINE}-pc-sysv32
1063 fi
1064 exit ;;
1065 pc:*:*:*)
1066 # Left here for compatibility:
1067 # uname -m prints for DJGPP always 'pc', but it prints nothing about
1068 # the processor, so we play safe by assuming i586.
1069 # Note: whatever this is, it MUST be the same as what config.sub
1070 # prints for the "djgpp" host, or else GDB configury will decide that
1071 # this is a cross-build.
1072 echo i586-pc-msdosdjgpp
1073 exit ;;
1074 Intel:Mach:3*:*)
1075 echo i386-pc-mach3
1076 exit ;;
1077 paragon:*:*:*)
1078 echo i860-intel-osf1
1079 exit ;;
1080 i860:*:4.*:*) # i860-SVR4
1081 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
1082 echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
1083 else # Add other i860-SVR4 vendors below as they are discovered.
1084 echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
1085 fi
1086 exit ;;
1087 mini*:CTIX:SYS*5:*)
1088 # "miniframe"
1089 echo m68010-convergent-sysv
1090 exit ;;
1091 mc68k:UNIX:SYSTEM5:3.51m)
1092 echo m68k-convergent-sysv
1093 exit ;;
1094 M680?0:D-NIX:5.3:*)
1095 echo m68k-diab-dnix
1096 exit ;;
1097 M68*:*:R3V[5678]*:*)
1098 test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
1099 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
1100 OS_REL=''
1101 test -r /etc/.relid \
1102 && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1103 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1104 && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1105 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1106 && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1107 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
1108 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1109 && { echo i486-ncr-sysv4; exit; } ;;
1110 NCR*:*:4.2:* | MPRAS*:*:4.2:*)
1111 OS_REL='.3'
1112 test -r /etc/.relid \
1113 && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1114 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1115 && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1116 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1117 && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
1118 /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
1119 && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1120 m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
1121 echo m68k-unknown-lynxos${UNAME_RELEASE}
1122 exit ;;
1123 mc68030:UNIX_System_V:4.*:*)
1124 echo m68k-atari-sysv4
1125 exit ;;
1126 TSUNAMI:LynxOS:2.*:*)
1127 echo sparc-unknown-lynxos${UNAME_RELEASE}
1128 exit ;;
1129 rs6000:LynxOS:2.*:*)
1130 echo rs6000-unknown-lynxos${UNAME_RELEASE}
1131 exit ;;
1132 PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
1133 echo powerpc-unknown-lynxos${UNAME_RELEASE}
1134 exit ;;
1135 SM[BE]S:UNIX_SV:*:*)
1136 echo mips-dde-sysv${UNAME_RELEASE}
1137 exit ;;
1138 RM*:ReliantUNIX-*:*:*)
1139 echo mips-sni-sysv4
1140 exit ;;
1141 RM*:SINIX-*:*:*)
1142 echo mips-sni-sysv4
1143 exit ;;
1144 *:SINIX-*:*:*)
1145 if uname -p 2>/dev/null >/dev/null ; then
1146 UNAME_MACHINE=`(uname -p) 2>/dev/null`
1147 echo ${UNAME_MACHINE}-sni-sysv4
1148 else
1149 echo ns32k-sni-sysv
1150 fi
1151 exit ;;
1152 PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
1153 # says <Richard.M.Bartel@ccMail.Census.GOV>
1154 echo i586-unisys-sysv4
1155 exit ;;
1156 *:UNIX_System_V:4*:FTX*)
1157 # From Gerald Hewes <hewes@openmarket.com>.
1158 # How about differentiating between stratus architectures? -djm
1159 echo hppa1.1-stratus-sysv4
1160 exit ;;
1161 *:*:*:FTX*)
1162 # From seanf@swdc.stratus.com.
1163 echo i860-stratus-sysv4
1164 exit ;;
1165 i*86:VOS:*:*)
1166 # From Paul.Green@stratus.com.
1167 echo ${UNAME_MACHINE}-stratus-vos
1168 exit ;;
1169 *:VOS:*:*)
1170 # From Paul.Green@stratus.com.
1171 echo hppa1.1-stratus-vos
1172 exit ;;
1173 mc68*:A/UX:*:*)
1174 echo m68k-apple-aux${UNAME_RELEASE}
1175 exit ;;
1176 news*:NEWS-OS:6*:*)
1177 echo mips-sony-newsos6
1178 exit ;;
1179 R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
1180 if [ -d /usr/nec ]; then
1181 echo mips-nec-sysv${UNAME_RELEASE}
1182 else
1183 echo mips-unknown-sysv${UNAME_RELEASE}
1184 fi
1185 exit ;;
1186 BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
1187 echo powerpc-be-beos
1188 exit ;;
1189 BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
1190 echo powerpc-apple-beos
1191 exit ;;
1192 BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
1193 echo i586-pc-beos
1194 exit ;;
1195 BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
1196 echo i586-pc-haiku
1197 exit ;;
1198 SX-4:SUPER-UX:*:*)
1199 echo sx4-nec-superux${UNAME_RELEASE}
1200 exit ;;
1201 SX-5:SUPER-UX:*:*)
1202 echo sx5-nec-superux${UNAME_RELEASE}
1203 exit ;;
1204 SX-6:SUPER-UX:*:*)
1205 echo sx6-nec-superux${UNAME_RELEASE}
1206 exit ;;
1207 SX-7:SUPER-UX:*:*)
1208 echo sx7-nec-superux${UNAME_RELEASE}
1209 exit ;;
1210 SX-8:SUPER-UX:*:*)
1211 echo sx8-nec-superux${UNAME_RELEASE}
1212 exit ;;
1213 SX-8R:SUPER-UX:*:*)
1214 echo sx8r-nec-superux${UNAME_RELEASE}
1215 exit ;;
1216 Power*:Rhapsody:*:*)
1217 echo powerpc-apple-rhapsody${UNAME_RELEASE}
1218 exit ;;
1219 *:Rhapsody:*:*)
1220 echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
1221 exit ;;
1222 *:Darwin:*:*)
1223 UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
1224 case $UNAME_PROCESSOR in
1225 i386)
1226 eval $set_cc_for_build
1227 if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
1228 if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
1229 (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
1230 grep IS_64BIT_ARCH >/dev/null
1231 then
1232 UNAME_PROCESSOR="x86_64"
1233 fi
1234 fi ;;
1235 unknown) UNAME_PROCESSOR=powerpc ;;
1236 esac
1237 echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
1238 exit ;;
1239 *:procnto*:*:* | *:QNX:[0123456789]*:*)
1240 UNAME_PROCESSOR=`uname -p`
1241 if test "$UNAME_PROCESSOR" = "x86"; then
1242 UNAME_PROCESSOR=i386
1243 UNAME_MACHINE=pc
1244 fi
1245 echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
1246 exit ;;
1247 *:QNX:*:4*)
1248 echo i386-pc-qnx
1249 exit ;;
1250 NEO-?:NONSTOP_KERNEL:*:*)
1251 echo neo-tandem-nsk${UNAME_RELEASE}
1252 exit ;;
1253 NSE-?:NONSTOP_KERNEL:*:*)
1254 echo nse-tandem-nsk${UNAME_RELEASE}
1255 exit ;;
1256 NSR-?:NONSTOP_KERNEL:*:*)
1257 echo nsr-tandem-nsk${UNAME_RELEASE}
1258 exit ;;
1259 *:NonStop-UX:*:*)
1260 echo mips-compaq-nonstopux
1261 exit ;;
1262 BS2000:POSIX*:*:*)
1263 echo bs2000-siemens-sysv
1264 exit ;;
1265 DS/*:UNIX_System_V:*:*)
1266 echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
1267 exit ;;
1268 *:Plan9:*:*)
1269 # "uname -m" is not consistent, so use $cputype instead. 386
1270 # is converted to i386 for consistency with other x86
1271 # operating systems.
1272 if test "$cputype" = "386"; then
1273 UNAME_MACHINE=i386
1274 else
1275 UNAME_MACHINE="$cputype"
1276 fi
1277 echo ${UNAME_MACHINE}-unknown-plan9
1278 exit ;;
1279 *:TOPS-10:*:*)
1280 echo pdp10-unknown-tops10
1281 exit ;;
1282 *:TENEX:*:*)
1283 echo pdp10-unknown-tenex
1284 exit ;;
1285 KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
1286 echo pdp10-dec-tops20
1287 exit ;;
1288 XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
1289 echo pdp10-xkl-tops20
1290 exit ;;
1291 *:TOPS-20:*:*)
1292 echo pdp10-unknown-tops20
1293 exit ;;
1294 *:ITS:*:*)
1295 echo pdp10-unknown-its
1296 exit ;;
1297 SEI:*:*:SEIUX)
1298 echo mips-sei-seiux${UNAME_RELEASE}
1299 exit ;;
1300 *:DragonFly:*:*)
1301 echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
1302 exit ;;
1303 *:*VMS:*:*)
1304 UNAME_MACHINE=`(uname -p) 2>/dev/null`
1305 case "${UNAME_MACHINE}" in
1306 A*) echo alpha-dec-vms ; exit ;;
1307 I*) echo ia64-dec-vms ; exit ;;
1308 V*) echo vax-dec-vms ; exit ;;
1309 esac ;;
1310 *:XENIX:*:SysV)
1311 echo i386-pc-xenix
1312 exit ;;
1313 i*86:skyos:*:*)
1314 echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
1315 exit ;;
1316 i*86:rdos:*:*)
1317 echo ${UNAME_MACHINE}-pc-rdos
1318 exit ;;
1319 i*86:AROS:*:*)
1320 echo ${UNAME_MACHINE}-pc-aros
1321 exit ;;
1322 esac
1323
1324 #echo '(No uname command or uname output not recognized.)' 1>&2
1325 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
1326
1327 eval $set_cc_for_build
1328 cat >$dummy.c <<EOF
1329 #ifdef _SEQUENT_
1330 # include <sys/types.h>
1331 # include <sys/utsname.h>
1332 #endif
1333 main ()
1334 {
1335 #if defined (sony)
1336 #if defined (MIPSEB)
1337 /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
1338 I don't know.... */
1339 printf ("mips-sony-bsd\n"); exit (0);
1340 #else
1341 #include <sys/param.h>
1342 printf ("m68k-sony-newsos%s\n",
1343 #ifdef NEWSOS4
1344 "4"
1345 #else
1346 ""
1347 #endif
1348 ); exit (0);
1349 #endif
1350 #endif
1351
1352 #if defined (__arm) && defined (__acorn) && defined (__unix)
1353 printf ("arm-acorn-riscix\n"); exit (0);
1354 #endif
1355
1356 #if defined (hp300) && !defined (hpux)
1357 printf ("m68k-hp-bsd\n"); exit (0);
1358 #endif
1359
1360 #if defined (NeXT)
1361 #if !defined (__ARCHITECTURE__)
1362 #define __ARCHITECTURE__ "m68k"
1363 #endif
1364 int version;
1365 version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
1366 if (version < 4)
1367 printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
1368 else
1369 printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
1370 exit (0);
1371 #endif
1372
1373 #if defined (MULTIMAX) || defined (n16)
1374 #if defined (UMAXV)
1375 printf ("ns32k-encore-sysv\n"); exit (0);
1376 #else
1377 #if defined (CMU)
1378 printf ("ns32k-encore-mach\n"); exit (0);
1379 #else
1380 printf ("ns32k-encore-bsd\n"); exit (0);
1381 #endif
1382 #endif
1383 #endif
1384
1385 #if defined (__386BSD__)
1386 printf ("i386-pc-bsd\n"); exit (0);
1387 #endif
1388
1389 #if defined (sequent)
1390 #if defined (i386)
1391 printf ("i386-sequent-dynix\n"); exit (0);
1392 #endif
1393 #if defined (ns32000)
1394 printf ("ns32k-sequent-dynix\n"); exit (0);
1395 #endif
1396 #endif
1397
1398 #if defined (_SEQUENT_)
1399 struct utsname un;
1400
1401 uname(&un);
1402
1403 if (strncmp(un.version, "V2", 2) == 0) {
1404 printf ("i386-sequent-ptx2\n"); exit (0);
1405 }
1406 if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
1407 printf ("i386-sequent-ptx1\n"); exit (0);
1408 }
1409 printf ("i386-sequent-ptx\n"); exit (0);
1410
1411 #endif
1412
1413 #if defined (vax)
1414 # if !defined (ultrix)
1415 # include <sys/param.h>
1416 # if defined (BSD)
1417 # if BSD == 43
1418 printf ("vax-dec-bsd4.3\n"); exit (0);
1419 # else
1420 # if BSD == 199006
1421 printf ("vax-dec-bsd4.3reno\n"); exit (0);
1422 # else
1423 printf ("vax-dec-bsd\n"); exit (0);
1424 # endif
1425 # endif
1426 # else
1427 printf ("vax-dec-bsd\n"); exit (0);
1428 # endif
1429 # else
1430 printf ("vax-dec-ultrix\n"); exit (0);
1431 # endif
1432 #endif
1433
1434 #if defined (alliant) && defined (i860)
1435 printf ("i860-alliant-bsd\n"); exit (0);
1436 #endif
1437
1438 exit (1);
1439 }
1440 EOF
1441
1442 $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
1443 { echo "$SYSTEM_NAME"; exit; }
1444
1445 # Apollos put the system type in the environment.
1446
1447 test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
1448
1449 # Convex versions that predate uname can use getsysinfo(1)
1450
1451 if [ -x /usr/convex/getsysinfo ]
1452 then
1453 case `getsysinfo -f cpu_type` in
1454 c1*)
1455 echo c1-convex-bsd
1456 exit ;;
1457 c2*)
1458 if getsysinfo -f scalar_acc
1459 then echo c32-convex-bsd
1460 else echo c2-convex-bsd
1461 fi
1462 exit ;;
1463 c34*)
1464 echo c34-convex-bsd
1465 exit ;;
1466 c38*)
1467 echo c38-convex-bsd
1468 exit ;;
1469 c4*)
1470 echo c4-convex-bsd
1471 exit ;;
1472 esac
1473 fi
1474
1475 cat >&2 <<EOF
1476 $0: unable to guess system type
1477
1478 This script, last modified $timestamp, has failed to recognize
1479 the operating system you are using. It is advised that you
1480 download the most up to date version of the config scripts from
1481
1482 http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
1483 and
1484 http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
1485
1486 If the version you run ($0) is already up to date, please
1487 send the following data and any information you think might be
1488 pertinent to <config-patches@gnu.org> in order to provide the needed
1489 information to handle your system.
1490
1491 config.guess timestamp = $timestamp
1492
1493 uname -m = `(uname -m) 2>/dev/null || echo unknown`
1494 uname -r = `(uname -r) 2>/dev/null || echo unknown`
1495 uname -s = `(uname -s) 2>/dev/null || echo unknown`
1496 uname -v = `(uname -v) 2>/dev/null || echo unknown`
1497
1498 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
1499 /bin/uname -X = `(/bin/uname -X) 2>/dev/null`
1500
1501 hostinfo = `(hostinfo) 2>/dev/null`
1502 /bin/universe = `(/bin/universe) 2>/dev/null`
1503 /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
1504 /bin/arch = `(/bin/arch) 2>/dev/null`
1505 /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
1506 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
1507
1508 UNAME_MACHINE = ${UNAME_MACHINE}
1509 UNAME_RELEASE = ${UNAME_RELEASE}
1510 UNAME_SYSTEM = ${UNAME_SYSTEM}
1511 UNAME_VERSION = ${UNAME_VERSION}
1512 EOF
1513
1514 exit 1
1515
1516 # Local variables:
1517 # eval: (add-hook 'write-file-hooks 'time-stamp)
1518 # time-stamp-start: "timestamp='"
1519 # time-stamp-format: "%:y-%02m-%02d"
1520 # time-stamp-end: "'"
1521 # End:
0 #! /bin/sh
1 # Configuration validation subroutine script.
2 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
3 # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
4 # 2011, 2012 Free Software Foundation, Inc.
5
6 timestamp='2012-01-01'
7
8 # This file is (in principle) common to ALL GNU software.
9 # The presence of a machine in this file suggests that SOME GNU software
10 # can handle that machine. It does not imply ALL GNU software can.
11 #
12 # This file is free software; you can redistribute it and/or modify
13 # it under the terms of the GNU General Public License as published by
14 # the Free Software Foundation; either version 2 of the License, or
15 # (at your option) any later version.
16 #
17 # This program is distributed in the hope that it will be useful,
18 # but WITHOUT ANY WARRANTY; without even the implied warranty of
19 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 # GNU General Public License for more details.
21 #
22 # You should have received a copy of the GNU General Public License
23 # along with this program; if not, write to the Free Software
24 # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
25 # 02110-1301, USA.
26 #
27 # As a special exception to the GNU General Public License, if you
28 # distribute this file as part of a program that contains a
29 # configuration script generated by Autoconf, you may include it under
30 # the same distribution terms that you use for the rest of that program.
31
32
33 # Please send patches to <config-patches@gnu.org>. Submit a context
34 # diff and a properly formatted GNU ChangeLog entry.
35 #
36 # Configuration subroutine to validate and canonicalize a configuration type.
37 # Supply the specified configuration type as an argument.
38 # If it is invalid, we print an error message on stderr and exit with code 1.
39 # Otherwise, we print the canonical config type on stdout and succeed.
40
41 # You can get the latest version of this script from:
42 # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
43
44 # This file is supposed to be the same for all GNU packages
45 # and recognize all the CPU types, system types and aliases
46 # that are meaningful with *any* GNU software.
47 # Each package is responsible for reporting which valid configurations
48 # it does not support. The user should be able to distinguish
49 # a failure to support a valid configuration from a meaningless
50 # configuration.
51
52 # The goal of this file is to map all the various variations of a given
53 # machine specification into a single specification in the form:
54 # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
55 # or in some cases, the newer four-part form:
56 # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
57 # It is wrong to echo any other type of specification.
58
59 me=`echo "$0" | sed -e 's,.*/,,'`
60
61 usage="\
62 Usage: $0 [OPTION] CPU-MFR-OPSYS
63 $0 [OPTION] ALIAS
64
65 Canonicalize a configuration name.
66
67 Operation modes:
68 -h, --help print this help, then exit
69 -t, --time-stamp print date of last modification, then exit
70 -v, --version print version number, then exit
71
72 Report bugs and patches to <config-patches@gnu.org>."
73
74 version="\
75 GNU config.sub ($timestamp)
76
77 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
78 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
79 Free Software Foundation, Inc.
80
81 This is free software; see the source for copying conditions. There is NO
82 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
83
84 help="
85 Try \`$me --help' for more information."
86
87 # Parse command line
88 while test $# -gt 0 ; do
89 case $1 in
90 --time-stamp | --time* | -t )
91 echo "$timestamp" ; exit ;;
92 --version | -v )
93 echo "$version" ; exit ;;
94 --help | --h* | -h )
95 echo "$usage"; exit ;;
96 -- ) # Stop option processing
97 shift; break ;;
98 - ) # Use stdin as input.
99 break ;;
100 -* )
101 echo "$me: invalid option $1$help"
102 exit 1 ;;
103
104 *local*)
105 # First pass through any local machine types.
106 echo $1
107 exit ;;
108
109 * )
110 break ;;
111 esac
112 done
113
114 case $# in
115 0) echo "$me: missing argument$help" >&2
116 exit 1;;
117 1) ;;
118 *) echo "$me: too many arguments$help" >&2
119 exit 1;;
120 esac
121
122 # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
123 # Here we must recognize all the valid KERNEL-OS combinations.
124 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
125 case $maybe_os in
126 nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
127 linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
128 knetbsd*-gnu* | netbsd*-gnu* | \
129 kopensolaris*-gnu* | \
130 storm-chaos* | os2-emx* | rtmk-nova*)
131 os=-$maybe_os
132 basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
133 ;;
134 *)
135 basic_machine=`echo $1 | sed 's/-[^-]*$//'`
136 if [ $basic_machine != $1 ]
137 then os=`echo $1 | sed 's/.*-/-/'`
138 else os=; fi
139 ;;
140 esac
141
142 ### Let's recognize common machines as not being operating systems so
143 ### that things like config.sub decstation-3100 work. We also
144 ### recognize some manufacturers as not being operating systems, so we
145 ### can provide default operating systems below.
146 case $os in
147 -sun*os*)
148 # Prevent following clause from handling this invalid input.
149 ;;
150 -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
151 -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
152 -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
153 -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
154 -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
155 -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
156 -apple | -axis | -knuth | -cray | -microblaze)
157 os=
158 basic_machine=$1
159 ;;
160 -bluegene*)
161 os=-cnk
162 ;;
163 -sim | -cisco | -oki | -wec | -winbond)
164 os=
165 basic_machine=$1
166 ;;
167 -scout)
168 ;;
169 -wrs)
170 os=-vxworks
171 basic_machine=$1
172 ;;
173 -chorusos*)
174 os=-chorusos
175 basic_machine=$1
176 ;;
177 -chorusrdb)
178 os=-chorusrdb
179 basic_machine=$1
180 ;;
181 -hiux*)
182 os=-hiuxwe2
183 ;;
184 -sco6)
185 os=-sco5v6
186 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
187 ;;
188 -sco5)
189 os=-sco3.2v5
190 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
191 ;;
192 -sco4)
193 os=-sco3.2v4
194 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
195 ;;
196 -sco3.2.[4-9]*)
197 os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
198 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
199 ;;
200 -sco3.2v[4-9]*)
201 # Don't forget version if it is 3.2v4 or newer.
202 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
203 ;;
204 -sco5v6*)
205 # Don't forget version if it is 3.2v4 or newer.
206 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
207 ;;
208 -sco*)
209 os=-sco3.2v2
210 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
211 ;;
212 -udk*)
213 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
214 ;;
215 -isc)
216 os=-isc2.2
217 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
218 ;;
219 -clix*)
220 basic_machine=clipper-intergraph
221 ;;
222 -isc*)
223 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
224 ;;
225 -lynx*)
226 os=-lynxos
227 ;;
228 -ptx*)
229 basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
230 ;;
231 -windowsnt*)
232 os=`echo $os | sed -e 's/windowsnt/winnt/'`
233 ;;
234 -psos*)
235 os=-psos
236 ;;
237 -mint | -mint[0-9]*)
238 basic_machine=m68k-atari
239 os=-mint
240 ;;
241 esac
242
243 # Decode aliases for certain CPU-COMPANY combinations.
244 case $basic_machine in
245 # Recognize the basic CPU types without company name.
246 # Some are omitted here because they have special meanings below.
247 1750a | 580 \
248 | a29k \
249 | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
250 | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
251 | am33_2.0 \
252 | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
253 | be32 | be64 \
254 | bfin \
255 | c4x | clipper \
256 | d10v | d30v | dlx | dsp16xx \
257 | epiphany \
258 | fido | fr30 | frv \
259 | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
260 | hexagon \
261 | i370 | i860 | i960 | ia64 \
262 | ip2k | iq2000 \
263 | le32 | le64 \
264 | lm32 \
265 | m32c | m32r | m32rle | m68000 | m68k | m88k \
266 | maxq | mb | microblaze | mcore | mep | metag \
267 | mips | mipsbe | mipseb | mipsel | mipsle \
268 | mips16 \
269 | mips64 | mips64el \
270 | mips64octeon | mips64octeonel \
271 | mips64orion | mips64orionel \
272 | mips64r5900 | mips64r5900el \
273 | mips64vr | mips64vrel \
274 | mips64vr4100 | mips64vr4100el \
275 | mips64vr4300 | mips64vr4300el \
276 | mips64vr5000 | mips64vr5000el \
277 | mips64vr5900 | mips64vr5900el \
278 | mipsisa32 | mipsisa32el \
279 | mipsisa32r2 | mipsisa32r2el \
280 | mipsisa64 | mipsisa64el \
281 | mipsisa64r2 | mipsisa64r2el \
282 | mipsisa64sb1 | mipsisa64sb1el \
283 | mipsisa64sr71k | mipsisa64sr71kel \
284 | mipstx39 | mipstx39el \
285 | mn10200 | mn10300 \
286 | moxie \
287 | mt \
288 | msp430 \
289 | nds32 | nds32le | nds32be \
290 | nios | nios2 \
291 | ns16k | ns32k \
292 | open8 \
293 | or32 \
294 | pdp10 | pdp11 | pj | pjl \
295 | powerpc | powerpc64 | powerpc64le | powerpcle \
296 | pyramid \
297 | rl78 | rx \
298 | score \
299 | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
300 | sh64 | sh64le \
301 | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
302 | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
303 | spu \
304 | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
305 | ubicom32 \
306 | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
307 | we32k \
308 | x86 | xc16x | xstormy16 | xtensa \
309 | z8k | z80)
310 basic_machine=$basic_machine-unknown
311 ;;
312 c54x)
313 basic_machine=tic54x-unknown
314 ;;
315 c55x)
316 basic_machine=tic55x-unknown
317 ;;
318 c6x)
319 basic_machine=tic6x-unknown
320 ;;
321 m6811 | m68hc11 | m6812 | m68hc12 | picochip)
322 basic_machine=$basic_machine-unknown
323 os=-none
324 ;;
325 m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
326 ;;
327 ms1)
328 basic_machine=mt-unknown
329 ;;
330
331 strongarm | thumb | xscale)
332 basic_machine=arm-unknown
333 ;;
334
335 xscaleeb)
336 basic_machine=armeb-unknown
337 ;;
338
339 xscaleel)
340 basic_machine=armel-unknown
341 ;;
342
343 # We use `pc' rather than `unknown'
344 # because (1) that's what they normally are, and
345 # (2) the word "unknown" tends to confuse beginning users.
346 i*86 | x86_64)
347 basic_machine=$basic_machine-pc
348 ;;
349 # Object if more than one company name word.
350 *-*-*)
351 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
352 exit 1
353 ;;
354 # Recognize the basic CPU types with company name.
355 580-* \
356 | a29k-* \
357 | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
358 | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
359 | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
360 | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
361 | avr-* | avr32-* \
362 | be32-* | be64-* \
363 | bfin-* | bs2000-* \
364 | c[123]* | c30-* | [cjt]90-* | c4x-* \
365 | clipper-* | craynv-* | cydra-* \
366 | d10v-* | d30v-* | dlx-* \
367 | elxsi-* \
368 | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
369 | h8300-* | h8500-* \
370 | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
371 | hexagon-* \
372 | i*86-* | i860-* | i960-* | ia64-* \
373 | ip2k-* | iq2000-* \
374 | le32-* | le64-* \
375 | lm32-* \
376 | m32c-* | m32r-* | m32rle-* \
377 | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
378 | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
379 | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
380 | mips16-* \
381 | mips64-* | mips64el-* \
382 | mips64octeon-* | mips64octeonel-* \
383 | mips64orion-* | mips64orionel-* \
384 | mips64r5900-* | mips64r5900el-* \
385 | mips64vr-* | mips64vrel-* \
386 | mips64vr4100-* | mips64vr4100el-* \
387 | mips64vr4300-* | mips64vr4300el-* \
388 | mips64vr5000-* | mips64vr5000el-* \
389 | mips64vr5900-* | mips64vr5900el-* \
390 | mipsisa32-* | mipsisa32el-* \
391 | mipsisa32r2-* | mipsisa32r2el-* \
392 | mipsisa64-* | mipsisa64el-* \
393 | mipsisa64r2-* | mipsisa64r2el-* \
394 | mipsisa64sb1-* | mipsisa64sb1el-* \
395 | mipsisa64sr71k-* | mipsisa64sr71kel-* \
396 | mipstx39-* | mipstx39el-* \
397 | mmix-* \
398 | mt-* \
399 | msp430-* \
400 | nds32-* | nds32le-* | nds32be-* \
401 | nios-* | nios2-* \
402 | none-* | np1-* | ns16k-* | ns32k-* \
403 | open8-* \
404 | orion-* \
405 | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
406 | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
407 | pyramid-* \
408 | rl78-* | romp-* | rs6000-* | rx-* \
409 | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
410 | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
411 | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
412 | sparclite-* \
413 | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
414 | tahoe-* \
415 | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
416 | tile*-* \
417 | tron-* \
418 | ubicom32-* \
419 | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
420 | vax-* \
421 | we32k-* \
422 | x86-* | x86_64-* | xc16x-* | xps100-* \
423 | xstormy16-* | xtensa*-* \
424 | ymp-* \
425 | z8k-* | z80-*)
426 ;;
427 # Recognize the basic CPU types without company name, with glob match.
428 xtensa*)
429 basic_machine=$basic_machine-unknown
430 ;;
431 # Recognize the various machine names and aliases which stand
432 # for a CPU type and a company and sometimes even an OS.
433 386bsd)
434 basic_machine=i386-unknown
435 os=-bsd
436 ;;
437 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
438 basic_machine=m68000-att
439 ;;
440 3b*)
441 basic_machine=we32k-att
442 ;;
443 a29khif)
444 basic_machine=a29k-amd
445 os=-udi
446 ;;
447 abacus)
448 basic_machine=abacus-unknown
449 ;;
450 adobe68k)
451 basic_machine=m68010-adobe
452 os=-scout
453 ;;
454 alliant | fx80)
455 basic_machine=fx80-alliant
456 ;;
457 altos | altos3068)
458 basic_machine=m68k-altos
459 ;;
460 am29k)
461 basic_machine=a29k-none
462 os=-bsd
463 ;;
464 amd64)
465 basic_machine=x86_64-pc
466 ;;
467 amd64-*)
468 basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
469 ;;
470 amdahl)
471 basic_machine=580-amdahl
472 os=-sysv
473 ;;
474 amiga | amiga-*)
475 basic_machine=m68k-unknown
476 ;;
477 amigaos | amigados)
478 basic_machine=m68k-unknown
479 os=-amigaos
480 ;;
481 amigaunix | amix)
482 basic_machine=m68k-unknown
483 os=-sysv4
484 ;;
485 apollo68)
486 basic_machine=m68k-apollo
487 os=-sysv
488 ;;
489 apollo68bsd)
490 basic_machine=m68k-apollo
491 os=-bsd
492 ;;
493 aros)
494 basic_machine=i386-pc
495 os=-aros
496 ;;
497 aux)
498 basic_machine=m68k-apple
499 os=-aux
500 ;;
501 balance)
502 basic_machine=ns32k-sequent
503 os=-dynix
504 ;;
505 blackfin)
506 basic_machine=bfin-unknown
507 os=-linux
508 ;;
509 blackfin-*)
510 basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
511 os=-linux
512 ;;
513 bluegene*)
514 basic_machine=powerpc-ibm
515 os=-cnk
516 ;;
517 c54x-*)
518 basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
519 ;;
520 c55x-*)
521 basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
522 ;;
523 c6x-*)
524 basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
525 ;;
526 c90)
527 basic_machine=c90-cray
528 os=-unicos
529 ;;
530 cegcc)
531 basic_machine=arm-unknown
532 os=-cegcc
533 ;;
534 convex-c1)
535 basic_machine=c1-convex
536 os=-bsd
537 ;;
538 convex-c2)
539 basic_machine=c2-convex
540 os=-bsd
541 ;;
542 convex-c32)
543 basic_machine=c32-convex
544 os=-bsd
545 ;;
546 convex-c34)
547 basic_machine=c34-convex
548 os=-bsd
549 ;;
550 convex-c38)
551 basic_machine=c38-convex
552 os=-bsd
553 ;;
554 cray | j90)
555 basic_machine=j90-cray
556 os=-unicos
557 ;;
558 craynv)
559 basic_machine=craynv-cray
560 os=-unicosmp
561 ;;
562 cr16 | cr16-*)
563 basic_machine=cr16-unknown
564 os=-elf
565 ;;
566 crds | unos)
567 basic_machine=m68k-crds
568 ;;
569 crisv32 | crisv32-* | etraxfs*)
570 basic_machine=crisv32-axis
571 ;;
572 cris | cris-* | etrax*)
573 basic_machine=cris-axis
574 ;;
575 crx)
576 basic_machine=crx-unknown
577 os=-elf
578 ;;
579 da30 | da30-*)
580 basic_machine=m68k-da30
581 ;;
582 decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
583 basic_machine=mips-dec
584 ;;
585 decsystem10* | dec10*)
586 basic_machine=pdp10-dec
587 os=-tops10
588 ;;
589 decsystem20* | dec20*)
590 basic_machine=pdp10-dec
591 os=-tops20
592 ;;
593 delta | 3300 | motorola-3300 | motorola-delta \
594 | 3300-motorola | delta-motorola)
595 basic_machine=m68k-motorola
596 ;;
597 delta88)
598 basic_machine=m88k-motorola
599 os=-sysv3
600 ;;
601 dicos)
602 basic_machine=i686-pc
603 os=-dicos
604 ;;
605 djgpp)
606 basic_machine=i586-pc
607 os=-msdosdjgpp
608 ;;
609 dpx20 | dpx20-*)
610 basic_machine=rs6000-bull
611 os=-bosx
612 ;;
613 dpx2* | dpx2*-bull)
614 basic_machine=m68k-bull
615 os=-sysv3
616 ;;
617 ebmon29k)
618 basic_machine=a29k-amd
619 os=-ebmon
620 ;;
621 elxsi)
622 basic_machine=elxsi-elxsi
623 os=-bsd
624 ;;
625 encore | umax | mmax)
626 basic_machine=ns32k-encore
627 ;;
628 es1800 | OSE68k | ose68k | ose | OSE)
629 basic_machine=m68k-ericsson
630 os=-ose
631 ;;
632 fx2800)
633 basic_machine=i860-alliant
634 ;;
635 genix)
636 basic_machine=ns32k-ns
637 ;;
638 gmicro)
639 basic_machine=tron-gmicro
640 os=-sysv
641 ;;
642 go32)
643 basic_machine=i386-pc
644 os=-go32
645 ;;
646 h3050r* | hiux*)
647 basic_machine=hppa1.1-hitachi
648 os=-hiuxwe2
649 ;;
650 h8300hms)
651 basic_machine=h8300-hitachi
652 os=-hms
653 ;;
654 h8300xray)
655 basic_machine=h8300-hitachi
656 os=-xray
657 ;;
658 h8500hms)
659 basic_machine=h8500-hitachi
660 os=-hms
661 ;;
662 harris)
663 basic_machine=m88k-harris
664 os=-sysv3
665 ;;
666 hp300-*)
667 basic_machine=m68k-hp
668 ;;
669 hp300bsd)
670 basic_machine=m68k-hp
671 os=-bsd
672 ;;
673 hp300hpux)
674 basic_machine=m68k-hp
675 os=-hpux
676 ;;
677 hp3k9[0-9][0-9] | hp9[0-9][0-9])
678 basic_machine=hppa1.0-hp
679 ;;
680 hp9k2[0-9][0-9] | hp9k31[0-9])
681 basic_machine=m68000-hp
682 ;;
683 hp9k3[2-9][0-9])
684 basic_machine=m68k-hp
685 ;;
686 hp9k6[0-9][0-9] | hp6[0-9][0-9])
687 basic_machine=hppa1.0-hp
688 ;;
689 hp9k7[0-79][0-9] | hp7[0-79][0-9])
690 basic_machine=hppa1.1-hp
691 ;;
692 hp9k78[0-9] | hp78[0-9])
693 # FIXME: really hppa2.0-hp
694 basic_machine=hppa1.1-hp
695 ;;
696 hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
697 # FIXME: really hppa2.0-hp
698 basic_machine=hppa1.1-hp
699 ;;
700 hp9k8[0-9][13679] | hp8[0-9][13679])
701 basic_machine=hppa1.1-hp
702 ;;
703 hp9k8[0-9][0-9] | hp8[0-9][0-9])
704 basic_machine=hppa1.0-hp
705 ;;
706 hppa-next)
707 os=-nextstep3
708 ;;
709 hppaosf)
710 basic_machine=hppa1.1-hp
711 os=-osf
712 ;;
713 hppro)
714 basic_machine=hppa1.1-hp
715 os=-proelf
716 ;;
717 i370-ibm* | ibm*)
718 basic_machine=i370-ibm
719 ;;
720 i*86v32)
721 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
722 os=-sysv32
723 ;;
724 i*86v4*)
725 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
726 os=-sysv4
727 ;;
728 i*86v)
729 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
730 os=-sysv
731 ;;
732 i*86sol2)
733 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
734 os=-solaris2
735 ;;
736 i386mach)
737 basic_machine=i386-mach
738 os=-mach
739 ;;
740 i386-vsta | vsta)
741 basic_machine=i386-unknown
742 os=-vsta
743 ;;
744 iris | iris4d)
745 basic_machine=mips-sgi
746 case $os in
747 -irix*)
748 ;;
749 *)
750 os=-irix4
751 ;;
752 esac
753 ;;
754 isi68 | isi)
755 basic_machine=m68k-isi
756 os=-sysv
757 ;;
758 m68knommu)
759 basic_machine=m68k-unknown
760 os=-linux
761 ;;
762 m68knommu-*)
763 basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
764 os=-linux
765 ;;
766 m88k-omron*)
767 basic_machine=m88k-omron
768 ;;
769 magnum | m3230)
770 basic_machine=mips-mips
771 os=-sysv
772 ;;
773 merlin)
774 basic_machine=ns32k-utek
775 os=-sysv
776 ;;
777 microblaze)
778 basic_machine=microblaze-xilinx
779 ;;
780 mingw32)
781 basic_machine=i386-pc
782 os=-mingw32
783 ;;
784 mingw32ce)
785 basic_machine=arm-unknown
786 os=-mingw32ce
787 ;;
788 miniframe)
789 basic_machine=m68000-convergent
790 ;;
791 *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
792 basic_machine=m68k-atari
793 os=-mint
794 ;;
795 mips3*-*)
796 basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
797 ;;
798 mips3*)
799 basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
800 ;;
801 monitor)
802 basic_machine=m68k-rom68k
803 os=-coff
804 ;;
805 morphos)
806 basic_machine=powerpc-unknown
807 os=-morphos
808 ;;
809 msdos)
810 basic_machine=i386-pc
811 os=-msdos
812 ;;
813 ms1-*)
814 basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
815 ;;
816 msys)
817 basic_machine=i386-pc
818 os=-msys
819 ;;
820 mvs)
821 basic_machine=i370-ibm
822 os=-mvs
823 ;;
824 nacl)
825 basic_machine=le32-unknown
826 os=-nacl
827 ;;
828 ncr3000)
829 basic_machine=i486-ncr
830 os=-sysv4
831 ;;
832 netbsd386)
833 basic_machine=i386-unknown
834 os=-netbsd
835 ;;
836 netwinder)
837 basic_machine=armv4l-rebel
838 os=-linux
839 ;;
840 news | news700 | news800 | news900)
841 basic_machine=m68k-sony
842 os=-newsos
843 ;;
844 news1000)
845 basic_machine=m68030-sony
846 os=-newsos
847 ;;
848 news-3600 | risc-news)
849 basic_machine=mips-sony
850 os=-newsos
851 ;;
852 necv70)
853 basic_machine=v70-nec
854 os=-sysv
855 ;;
856 next | m*-next )
857 basic_machine=m68k-next
858 case $os in
859 -nextstep* )
860 ;;
861 -ns2*)
862 os=-nextstep2
863 ;;
864 *)
865 os=-nextstep3
866 ;;
867 esac
868 ;;
869 nh3000)
870 basic_machine=m68k-harris
871 os=-cxux
872 ;;
873 nh[45]000)
874 basic_machine=m88k-harris
875 os=-cxux
876 ;;
877 nindy960)
878 basic_machine=i960-intel
879 os=-nindy
880 ;;
881 mon960)
882 basic_machine=i960-intel
883 os=-mon960
884 ;;
885 nonstopux)
886 basic_machine=mips-compaq
887 os=-nonstopux
888 ;;
889 np1)
890 basic_machine=np1-gould
891 ;;
892 neo-tandem)
893 basic_machine=neo-tandem
894 ;;
895 nse-tandem)
896 basic_machine=nse-tandem
897 ;;
898 nsr-tandem)
899 basic_machine=nsr-tandem
900 ;;
901 op50n-* | op60c-*)
902 basic_machine=hppa1.1-oki
903 os=-proelf
904 ;;
905 openrisc | openrisc-*)
906 basic_machine=or32-unknown
907 ;;
908 os400)
909 basic_machine=powerpc-ibm
910 os=-os400
911 ;;
912 OSE68000 | ose68000)
913 basic_machine=m68000-ericsson
914 os=-ose
915 ;;
916 os68k)
917 basic_machine=m68k-none
918 os=-os68k
919 ;;
920 pa-hitachi)
921 basic_machine=hppa1.1-hitachi
922 os=-hiuxwe2
923 ;;
924 paragon)
925 basic_machine=i860-intel
926 os=-osf
927 ;;
928 parisc)
929 basic_machine=hppa-unknown
930 os=-linux
931 ;;
932 parisc-*)
933 basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
934 os=-linux
935 ;;
936 pbd)
937 basic_machine=sparc-tti
938 ;;
939 pbb)
940 basic_machine=m68k-tti
941 ;;
942 pc532 | pc532-*)
943 basic_machine=ns32k-pc532
944 ;;
945 pc98)
946 basic_machine=i386-pc
947 ;;
948 pc98-*)
949 basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
950 ;;
951 pentium | p5 | k5 | k6 | nexgen | viac3)
952 basic_machine=i586-pc
953 ;;
954 pentiumpro | p6 | 6x86 | athlon | athlon_*)
955 basic_machine=i686-pc
956 ;;
957 pentiumii | pentium2 | pentiumiii | pentium3)
958 basic_machine=i686-pc
959 ;;
960 pentium4)
961 basic_machine=i786-pc
962 ;;
963 pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
964 basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
965 ;;
966 pentiumpro-* | p6-* | 6x86-* | athlon-*)
967 basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
968 ;;
969 pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
970 basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
971 ;;
972 pentium4-*)
973 basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
974 ;;
975 pn)
976 basic_machine=pn-gould
977 ;;
978 power) basic_machine=power-ibm
979 ;;
980 ppc | ppcbe) basic_machine=powerpc-unknown
981 ;;
982 ppc-* | ppcbe-*)
983 basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
984 ;;
985 ppcle | powerpclittle | ppc-le | powerpc-little)
986 basic_machine=powerpcle-unknown
987 ;;
988 ppcle-* | powerpclittle-*)
989 basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
990 ;;
991 ppc64) basic_machine=powerpc64-unknown
992 ;;
993 ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
994 ;;
995 ppc64le | powerpc64little | ppc64-le | powerpc64-little)
996 basic_machine=powerpc64le-unknown
997 ;;
998 ppc64le-* | powerpc64little-*)
999 basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
1000 ;;
1001 ps2)
1002 basic_machine=i386-ibm
1003 ;;
1004 pw32)
1005 basic_machine=i586-unknown
1006 os=-pw32
1007 ;;
1008 rdos)
1009 basic_machine=i386-pc
1010 os=-rdos
1011 ;;
1012 rom68k)
1013 basic_machine=m68k-rom68k
1014 os=-coff
1015 ;;
1016 rm[46]00)
1017 basic_machine=mips-siemens
1018 ;;
1019 rtpc | rtpc-*)
1020 basic_machine=romp-ibm
1021 ;;
1022 s390 | s390-*)
1023 basic_machine=s390-ibm
1024 ;;
1025 s390x | s390x-*)
1026 basic_machine=s390x-ibm
1027 ;;
1028 sa29200)
1029 basic_machine=a29k-amd
1030 os=-udi
1031 ;;
1032 sb1)
1033 basic_machine=mipsisa64sb1-unknown
1034 ;;
1035 sb1el)
1036 basic_machine=mipsisa64sb1el-unknown
1037 ;;
1038 sde)
1039 basic_machine=mipsisa32-sde
1040 os=-elf
1041 ;;
1042 sei)
1043 basic_machine=mips-sei
1044 os=-seiux
1045 ;;
1046 sequent)
1047 basic_machine=i386-sequent
1048 ;;
1049 sh)
1050 basic_machine=sh-hitachi
1051 os=-hms
1052 ;;
1053 sh5el)
1054 basic_machine=sh5le-unknown
1055 ;;
1056 sh64)
1057 basic_machine=sh64-unknown
1058 ;;
1059 sparclite-wrs | simso-wrs)
1060 basic_machine=sparclite-wrs
1061 os=-vxworks
1062 ;;
1063 sps7)
1064 basic_machine=m68k-bull
1065 os=-sysv2
1066 ;;
1067 spur)
1068 basic_machine=spur-unknown
1069 ;;
1070 st2000)
1071 basic_machine=m68k-tandem
1072 ;;
1073 stratus)
1074 basic_machine=i860-stratus
1075 os=-sysv4
1076 ;;
1077 strongarm-* | thumb-*)
1078 basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
1079 ;;
1080 sun2)
1081 basic_machine=m68000-sun
1082 ;;
1083 sun2os3)
1084 basic_machine=m68000-sun
1085 os=-sunos3
1086 ;;
1087 sun2os4)
1088 basic_machine=m68000-sun
1089 os=-sunos4
1090 ;;
1091 sun3os3)
1092 basic_machine=m68k-sun
1093 os=-sunos3
1094 ;;
1095 sun3os4)
1096 basic_machine=m68k-sun
1097 os=-sunos4
1098 ;;
1099 sun4os3)
1100 basic_machine=sparc-sun
1101 os=-sunos3
1102 ;;
1103 sun4os4)
1104 basic_machine=sparc-sun
1105 os=-sunos4
1106 ;;
1107 sun4sol2)
1108 basic_machine=sparc-sun
1109 os=-solaris2
1110 ;;
1111 sun3 | sun3-*)
1112 basic_machine=m68k-sun
1113 ;;
1114 sun4)
1115 basic_machine=sparc-sun
1116 ;;
1117 sun386 | sun386i | roadrunner)
1118 basic_machine=i386-sun
1119 ;;
1120 sv1)
1121 basic_machine=sv1-cray
1122 os=-unicos
1123 ;;
1124 symmetry)
1125 basic_machine=i386-sequent
1126 os=-dynix
1127 ;;
1128 t3e)
1129 basic_machine=alphaev5-cray
1130 os=-unicos
1131 ;;
1132 t90)
1133 basic_machine=t90-cray
1134 os=-unicos
1135 ;;
1136 tile*)
1137 basic_machine=$basic_machine-unknown
1138 os=-linux-gnu
1139 ;;
1140 tx39)
1141 basic_machine=mipstx39-unknown
1142 ;;
1143 tx39el)
1144 basic_machine=mipstx39el-unknown
1145 ;;
1146 toad1)
1147 basic_machine=pdp10-xkl
1148 os=-tops20
1149 ;;
1150 tower | tower-32)
1151 basic_machine=m68k-ncr
1152 ;;
1153 tpf)
1154 basic_machine=s390x-ibm
1155 os=-tpf
1156 ;;
1157 udi29k)
1158 basic_machine=a29k-amd
1159 os=-udi
1160 ;;
1161 ultra3)
1162 basic_machine=a29k-nyu
1163 os=-sym1
1164 ;;
1165 v810 | necv810)
1166 basic_machine=v810-nec
1167 os=-none
1168 ;;
1169 vaxv)
1170 basic_machine=vax-dec
1171 os=-sysv
1172 ;;
1173 vms)
1174 basic_machine=vax-dec
1175 os=-vms
1176 ;;
1177 vpp*|vx|vx-*)
1178 basic_machine=f301-fujitsu
1179 ;;
1180 vxworks960)
1181 basic_machine=i960-wrs
1182 os=-vxworks
1183 ;;
1184 vxworks68)
1185 basic_machine=m68k-wrs
1186 os=-vxworks
1187 ;;
1188 vxworks29k)
1189 basic_machine=a29k-wrs
1190 os=-vxworks
1191 ;;
1192 w65*)
1193 basic_machine=w65-wdc
1194 os=-none
1195 ;;
1196 w89k-*)
1197 basic_machine=hppa1.1-winbond
1198 os=-proelf
1199 ;;
1200 xbox)
1201 basic_machine=i686-pc
1202 os=-mingw32
1203 ;;
1204 xps | xps100)
1205 basic_machine=xps100-honeywell
1206 ;;
1207 xscale-* | xscalee[bl]-*)
1208 basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
1209 ;;
1210 ymp)
1211 basic_machine=ymp-cray
1212 os=-unicos
1213 ;;
1214 z8k-*-coff)
1215 basic_machine=z8k-unknown
1216 os=-sim
1217 ;;
1218 z80-*-coff)
1219 basic_machine=z80-unknown
1220 os=-sim
1221 ;;
1222 none)
1223 basic_machine=none-none
1224 os=-none
1225 ;;
1226
1227 # Here we handle the default manufacturer of certain CPU types. It is in
1228 # some cases the only manufacturer, in others, it is the most popular.
1229 w89k)
1230 basic_machine=hppa1.1-winbond
1231 ;;
1232 op50n)
1233 basic_machine=hppa1.1-oki
1234 ;;
1235 op60c)
1236 basic_machine=hppa1.1-oki
1237 ;;
1238 romp)
1239 basic_machine=romp-ibm
1240 ;;
1241 mmix)
1242 basic_machine=mmix-knuth
1243 ;;
1244 rs6000)
1245 basic_machine=rs6000-ibm
1246 ;;
1247 vax)
1248 basic_machine=vax-dec
1249 ;;
1250 pdp10)
1251 # there are many clones, so DEC is not a safe bet
1252 basic_machine=pdp10-unknown
1253 ;;
1254 pdp11)
1255 basic_machine=pdp11-dec
1256 ;;
1257 we32k)
1258 basic_machine=we32k-att
1259 ;;
1260 sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
1261 basic_machine=sh-unknown
1262 ;;
1263 sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
1264 basic_machine=sparc-sun
1265 ;;
1266 cydra)
1267 basic_machine=cydra-cydrome
1268 ;;
1269 orion)
1270 basic_machine=orion-highlevel
1271 ;;
1272 orion105)
1273 basic_machine=clipper-highlevel
1274 ;;
1275 mac | mpw | mac-mpw)
1276 basic_machine=m68k-apple
1277 ;;
1278 pmac | pmac-mpw)
1279 basic_machine=powerpc-apple
1280 ;;
1281 *-unknown)
1282 # Make sure to match an already-canonicalized machine name.
1283 ;;
1284 *)
1285 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
1286 exit 1
1287 ;;
1288 esac
1289
1290 # Here we canonicalize certain aliases for manufacturers.
1291 case $basic_machine in
1292 *-digital*)
1293 basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
1294 ;;
1295 *-commodore*)
1296 basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
1297 ;;
1298 *)
1299 ;;
1300 esac
1301
1302 # Decode manufacturer-specific aliases for certain operating systems.
1303
1304 if [ x"$os" != x"" ]
1305 then
1306 case $os in
1307 # First match some system type aliases
1308 # that might get confused with valid system types.
1309 # -solaris* is a basic system type, with this one exception.
1310 -auroraux)
1311 os=-auroraux
1312 ;;
1313 -solaris1 | -solaris1.*)
1314 os=`echo $os | sed -e 's|solaris1|sunos4|'`
1315 ;;
1316 -solaris)
1317 os=-solaris2
1318 ;;
1319 -svr4*)
1320 os=-sysv4
1321 ;;
1322 -unixware*)
1323 os=-sysv4.2uw
1324 ;;
1325 -gnu/linux*)
1326 os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
1327 ;;
1328 # First accept the basic system types.
1329 # The portable systems comes first.
1330 # Each alternative MUST END IN A *, to match a version number.
1331 # -sysv* is not here because it comes later, after sysvr4.
1332 -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
1333 | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
1334 | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
1335 | -sym* | -kopensolaris* \
1336 | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
1337 | -aos* | -aros* \
1338 | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
1339 | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
1340 | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
1341 | -openbsd* | -solidbsd* \
1342 | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
1343 | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
1344 | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
1345 | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
1346 | -chorusos* | -chorusrdb* | -cegcc* \
1347 | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
1348 | -mingw32* | -linux-gnu* | -linux-android* \
1349 | -linux-newlib* | -linux-uclibc* \
1350 | -uxpv* | -beos* | -mpeix* | -udk* \
1351 | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
1352 | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
1353 | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
1354 | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
1355 | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
1356 | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
1357 | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
1358 # Remember, each alternative MUST END IN *, to match a version number.
1359 ;;
1360 -qnx*)
1361 case $basic_machine in
1362 x86-* | i*86-*)
1363 ;;
1364 *)
1365 os=-nto$os
1366 ;;
1367 esac
1368 ;;
1369 -nto-qnx*)
1370 ;;
1371 -nto*)
1372 os=`echo $os | sed -e 's|nto|nto-qnx|'`
1373 ;;
1374 -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
1375 | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
1376 | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
1377 ;;
1378 -mac*)
1379 os=`echo $os | sed -e 's|mac|macos|'`
1380 ;;
1381 -linux-dietlibc)
1382 os=-linux-dietlibc
1383 ;;
1384 -linux*)
1385 os=`echo $os | sed -e 's|linux|linux-gnu|'`
1386 ;;
1387 -sunos5*)
1388 os=`echo $os | sed -e 's|sunos5|solaris2|'`
1389 ;;
1390 -sunos6*)
1391 os=`echo $os | sed -e 's|sunos6|solaris3|'`
1392 ;;
1393 -opened*)
1394 os=-openedition
1395 ;;
1396 -os400*)
1397 os=-os400
1398 ;;
1399 -wince*)
1400 os=-wince
1401 ;;
1402 -osfrose*)
1403 os=-osfrose
1404 ;;
1405 -osf*)
1406 os=-osf
1407 ;;
1408 -utek*)
1409 os=-bsd
1410 ;;
1411 -dynix*)
1412 os=-bsd
1413 ;;
1414 -acis*)
1415 os=-aos
1416 ;;
1417 -atheos*)
1418 os=-atheos
1419 ;;
1420 -syllable*)
1421 os=-syllable
1422 ;;
1423 -386bsd)
1424 os=-bsd
1425 ;;
1426 -ctix* | -uts*)
1427 os=-sysv
1428 ;;
1429 -nova*)
1430 os=-rtmk-nova
1431 ;;
1432 -ns2 )
1433 os=-nextstep2
1434 ;;
1435 -nsk*)
1436 os=-nsk
1437 ;;
1438 # Preserve the version number of sinix5.
1439 -sinix5.*)
1440 os=`echo $os | sed -e 's|sinix|sysv|'`
1441 ;;
1442 -sinix*)
1443 os=-sysv4
1444 ;;
1445 -tpf*)
1446 os=-tpf
1447 ;;
1448 -triton*)
1449 os=-sysv3
1450 ;;
1451 -oss*)
1452 os=-sysv3
1453 ;;
1454 -svr4)
1455 os=-sysv4
1456 ;;
1457 -svr3)
1458 os=-sysv3
1459 ;;
1460 -sysvr4)
1461 os=-sysv4
1462 ;;
1463 # This must come after -sysvr4.
1464 -sysv*)
1465 ;;
1466 -ose*)
1467 os=-ose
1468 ;;
1469 -es1800*)
1470 os=-ose
1471 ;;
1472 -xenix)
1473 os=-xenix
1474 ;;
1475 -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
1476 os=-mint
1477 ;;
1478 -aros*)
1479 os=-aros
1480 ;;
1481 -kaos*)
1482 os=-kaos
1483 ;;
1484 -zvmoe)
1485 os=-zvmoe
1486 ;;
1487 -dicos*)
1488 os=-dicos
1489 ;;
1490 -nacl*)
1491 ;;
1492 -none)
1493 ;;
1494 *)
1495 # Get rid of the `-' at the beginning of $os.
1496 os=`echo $os | sed 's/[^-]*-//'`
1497 echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
1498 exit 1
1499 ;;
1500 esac
1501 else
1502
1503 # Here we handle the default operating systems that come with various machines.
1504 # The value should be what the vendor currently ships out the door with their
1505 # machine or put another way, the most popular os provided with the machine.
1506
1507 # Note that if you're going to try to match "-MANUFACTURER" here (say,
1508 # "-sun"), then you have to tell the case statement up towards the top
1509 # that MANUFACTURER isn't an operating system. Otherwise, code above
1510 # will signal an error saying that MANUFACTURER isn't an operating
1511 # system, and we'll never get to this point.
1512
1513 case $basic_machine in
1514 score-*)
1515 os=-elf
1516 ;;
1517 spu-*)
1518 os=-elf
1519 ;;
1520 *-acorn)
1521 os=-riscix1.2
1522 ;;
1523 arm*-rebel)
1524 os=-linux
1525 ;;
1526 arm*-semi)
1527 os=-aout
1528 ;;
1529 c4x-* | tic4x-*)
1530 os=-coff
1531 ;;
1532 tic54x-*)
1533 os=-coff
1534 ;;
1535 tic55x-*)
1536 os=-coff
1537 ;;
1538 tic6x-*)
1539 os=-coff
1540 ;;
1541 # This must come before the *-dec entry.
1542 pdp10-*)
1543 os=-tops20
1544 ;;
1545 pdp11-*)
1546 os=-none
1547 ;;
1548 *-dec | vax-*)
1549 os=-ultrix4.2
1550 ;;
1551 m68*-apollo)
1552 os=-domain
1553 ;;
1554 i386-sun)
1555 os=-sunos4.0.2
1556 ;;
1557 m68000-sun)
1558 os=-sunos3
1559 ;;
1560 m68*-cisco)
1561 os=-aout
1562 ;;
1563 mep-*)
1564 os=-elf
1565 ;;
1566 mips*-cisco)
1567 os=-elf
1568 ;;
1569 mips*-*)
1570 os=-elf
1571 ;;
1572 or32-*)
1573 os=-coff
1574 ;;
1575 *-tti) # must be before sparc entry or we get the wrong os.
1576 os=-sysv3
1577 ;;
1578 sparc-* | *-sun)
1579 os=-sunos4.1.1
1580 ;;
1581 *-be)
1582 os=-beos
1583 ;;
1584 *-haiku)
1585 os=-haiku
1586 ;;
1587 *-ibm)
1588 os=-aix
1589 ;;
1590 *-knuth)
1591 os=-mmixware
1592 ;;
1593 *-wec)
1594 os=-proelf
1595 ;;
1596 *-winbond)
1597 os=-proelf
1598 ;;
1599 *-oki)
1600 os=-proelf
1601 ;;
1602 *-hp)
1603 os=-hpux
1604 ;;
1605 *-hitachi)
1606 os=-hiux
1607 ;;
1608 i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
1609 os=-sysv
1610 ;;
1611 *-cbm)
1612 os=-amigaos
1613 ;;
1614 *-dg)
1615 os=-dgux
1616 ;;
1617 *-dolphin)
1618 os=-sysv3
1619 ;;
1620 m68k-ccur)
1621 os=-rtu
1622 ;;
1623 m88k-omron*)
1624 os=-luna
1625 ;;
1626 *-next )
1627 os=-nextstep
1628 ;;
1629 *-sequent)
1630 os=-ptx
1631 ;;
1632 *-crds)
1633 os=-unos
1634 ;;
1635 *-ns)
1636 os=-genix
1637 ;;
1638 i370-*)
1639 os=-mvs
1640 ;;
1641 *-next)
1642 os=-nextstep3
1643 ;;
1644 *-gould)
1645 os=-sysv
1646 ;;
1647 *-highlevel)
1648 os=-bsd
1649 ;;
1650 *-encore)
1651 os=-bsd
1652 ;;
1653 *-sgi)
1654 os=-irix
1655 ;;
1656 *-siemens)
1657 os=-sysv4
1658 ;;
1659 *-masscomp)
1660 os=-rtu
1661 ;;
1662 f30[01]-fujitsu | f700-fujitsu)
1663 os=-uxpv
1664 ;;
1665 *-rom68k)
1666 os=-coff
1667 ;;
1668 *-*bug)
1669 os=-coff
1670 ;;
1671 *-apple)
1672 os=-macos
1673 ;;
1674 *-atari*)
1675 os=-mint
1676 ;;
1677 *)
1678 os=-none
1679 ;;
1680 esac
1681 fi
1682
1683 # Here we handle the case where we know the os, and the CPU type, but not the
1684 # manufacturer. We pick the logical manufacturer.
1685 vendor=unknown
1686 case $basic_machine in
1687 *-unknown)
1688 case $os in
1689 -riscix*)
1690 vendor=acorn
1691 ;;
1692 -sunos*)
1693 vendor=sun
1694 ;;
1695 -cnk*|-aix*)
1696 vendor=ibm
1697 ;;
1698 -beos*)
1699 vendor=be
1700 ;;
1701 -hpux*)
1702 vendor=hp
1703 ;;
1704 -mpeix*)
1705 vendor=hp
1706 ;;
1707 -hiux*)
1708 vendor=hitachi
1709 ;;
1710 -unos*)
1711 vendor=crds
1712 ;;
1713 -dgux*)
1714 vendor=dg
1715 ;;
1716 -luna*)
1717 vendor=omron
1718 ;;
1719 -genix*)
1720 vendor=ns
1721 ;;
1722 -mvs* | -opened*)
1723 vendor=ibm
1724 ;;
1725 -os400*)
1726 vendor=ibm
1727 ;;
1728 -ptx*)
1729 vendor=sequent
1730 ;;
1731 -tpf*)
1732 vendor=ibm
1733 ;;
1734 -vxsim* | -vxworks* | -windiss*)
1735 vendor=wrs
1736 ;;
1737 -aux*)
1738 vendor=apple
1739 ;;
1740 -hms*)
1741 vendor=hitachi
1742 ;;
1743 -mpw* | -macos*)
1744 vendor=apple
1745 ;;
1746 -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
1747 vendor=atari
1748 ;;
1749 -vos*)
1750 vendor=stratus
1751 ;;
1752 esac
1753 basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
1754 ;;
1755 esac
1756
1757 echo $basic_machine$os
1758 exit
1759
1760 # Local variables:
1761 # eval: (add-hook 'write-file-hooks 'time-stamp)
1762 # time-stamp-start: "timestamp='"
1763 # time-stamp-format: "%:y-%02m-%02d"
1764 # time-stamp-end: "'"
1765 # End:
0 #! /bin/sh
1 # depcomp - compile a program generating dependencies as side-effects
2
3 scriptversion=2011-12-04.11; # UTC
4
5 # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010,
6 # 2011 Free Software Foundation, Inc.
7
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2, or (at your option)
11 # any later version.
12
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
17
18 # You should have received a copy of the GNU General Public License
19 # along with this program. If not, see <http://www.gnu.org/licenses/>.
20
21 # As a special exception to the GNU General Public License, if you
22 # distribute this file as part of a program that contains a
23 # configuration script generated by Autoconf, you may include it under
24 # the same distribution terms that you use for the rest of that program.
25
26 # Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
27
28 case $1 in
29 '')
30 echo "$0: No command. Try \`$0 --help' for more information." 1>&2
31 exit 1;
32 ;;
33 -h | --h*)
34 cat <<\EOF
35 Usage: depcomp [--help] [--version] PROGRAM [ARGS]
36
37 Run PROGRAMS ARGS to compile a file, generating dependencies
38 as side-effects.
39
40 Environment variables:
41 depmode Dependency tracking mode.
42 source Source file read by `PROGRAMS ARGS'.
43 object Object file output by `PROGRAMS ARGS'.
44 DEPDIR directory where to store dependencies.
45 depfile Dependency file to output.
46 tmpdepfile Temporary file to use when outputting dependencies.
47 libtool Whether libtool is used (yes/no).
48
49 Report bugs to <bug-automake@gnu.org>.
50 EOF
51 exit $?
52 ;;
53 -v | --v*)
54 echo "depcomp $scriptversion"
55 exit $?
56 ;;
57 esac
58
59 if test -z "$depmode" || test -z "$source" || test -z "$object"; then
60 echo "depcomp: Variables source, object and depmode must be set" 1>&2
61 exit 1
62 fi
63
64 # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
65 depfile=${depfile-`echo "$object" |
66 sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
67 tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
68
69 rm -f "$tmpdepfile"
70
71 # Some modes work just like other modes, but use different flags. We
72 # parameterize here, but still list the modes in the big case below,
73 # to make depend.m4 easier to write. Note that we *cannot* use a case
74 # here, because this file can only contain one case statement.
75 if test "$depmode" = hp; then
76 # HP compiler uses -M and no extra arg.
77 gccflag=-M
78 depmode=gcc
79 fi
80
81 if test "$depmode" = dashXmstdout; then
82 # This is just like dashmstdout with a different argument.
83 dashmflag=-xM
84 depmode=dashmstdout
85 fi
86
87 cygpath_u="cygpath -u -f -"
88 if test "$depmode" = msvcmsys; then
89 # This is just like msvisualcpp but w/o cygpath translation.
90 # Just convert the backslash-escaped backslashes to single forward
91 # slashes to satisfy depend.m4
92 cygpath_u='sed s,\\\\,/,g'
93 depmode=msvisualcpp
94 fi
95
96 if test "$depmode" = msvc7msys; then
97 # This is just like msvc7 but w/o cygpath translation.
98 # Just convert the backslash-escaped backslashes to single forward
99 # slashes to satisfy depend.m4
100 cygpath_u='sed s,\\\\,/,g'
101 depmode=msvc7
102 fi
103
104 case "$depmode" in
105 gcc3)
106 ## gcc 3 implements dependency tracking that does exactly what
107 ## we want. Yay! Note: for some reason libtool 1.4 doesn't like
108 ## it if -MD -MP comes after the -MF stuff. Hmm.
109 ## Unfortunately, FreeBSD c89 acceptance of flags depends upon
110 ## the command line argument order; so add the flags where they
111 ## appear in depend2.am. Note that the slowdown incurred here
112 ## affects only configure: in makefiles, %FASTDEP% shortcuts this.
113 for arg
114 do
115 case $arg in
116 -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
117 *) set fnord "$@" "$arg" ;;
118 esac
119 shift # fnord
120 shift # $arg
121 done
122 "$@"
123 stat=$?
124 if test $stat -eq 0; then :
125 else
126 rm -f "$tmpdepfile"
127 exit $stat
128 fi
129 mv "$tmpdepfile" "$depfile"
130 ;;
131
132 gcc)
133 ## There are various ways to get dependency output from gcc. Here's
134 ## why we pick this rather obscure method:
135 ## - Don't want to use -MD because we'd like the dependencies to end
136 ## up in a subdir. Having to rename by hand is ugly.
137 ## (We might end up doing this anyway to support other compilers.)
138 ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
139 ## -MM, not -M (despite what the docs say).
140 ## - Using -M directly means running the compiler twice (even worse
141 ## than renaming).
142 if test -z "$gccflag"; then
143 gccflag=-MD,
144 fi
145 "$@" -Wp,"$gccflag$tmpdepfile"
146 stat=$?
147 if test $stat -eq 0; then :
148 else
149 rm -f "$tmpdepfile"
150 exit $stat
151 fi
152 rm -f "$depfile"
153 echo "$object : \\" > "$depfile"
154 alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
155 ## The second -e expression handles DOS-style file names with drive letters.
156 sed -e 's/^[^:]*: / /' \
157 -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
158 ## This next piece of magic avoids the `deleted header file' problem.
159 ## The problem is that when a header file which appears in a .P file
160 ## is deleted, the dependency causes make to die (because there is
161 ## typically no way to rebuild the header). We avoid this by adding
162 ## dummy dependencies for each header file. Too bad gcc doesn't do
163 ## this for us directly.
164 tr ' ' '
165 ' < "$tmpdepfile" |
166 ## Some versions of gcc put a space before the `:'. On the theory
167 ## that the space means something, we add a space to the output as
168 ## well. hp depmode also adds that space, but also prefixes the VPATH
169 ## to the object. Take care to not repeat it in the output.
170 ## Some versions of the HPUX 10.20 sed can't process this invocation
171 ## correctly. Breaking it into two sed invocations is a workaround.
172 sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
173 | sed -e 's/$/ :/' >> "$depfile"
174 rm -f "$tmpdepfile"
175 ;;
176
177 hp)
178 # This case exists only to let depend.m4 do its work. It works by
179 # looking at the text of this script. This case will never be run,
180 # since it is checked for above.
181 exit 1
182 ;;
183
184 sgi)
185 if test "$libtool" = yes; then
186 "$@" "-Wp,-MDupdate,$tmpdepfile"
187 else
188 "$@" -MDupdate "$tmpdepfile"
189 fi
190 stat=$?
191 if test $stat -eq 0; then :
192 else
193 rm -f "$tmpdepfile"
194 exit $stat
195 fi
196 rm -f "$depfile"
197
198 if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
199 echo "$object : \\" > "$depfile"
200
201 # Clip off the initial element (the dependent). Don't try to be
202 # clever and replace this with sed code, as IRIX sed won't handle
203 # lines with more than a fixed number of characters (4096 in
204 # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
205 # the IRIX cc adds comments like `#:fec' to the end of the
206 # dependency line.
207 tr ' ' '
208 ' < "$tmpdepfile" \
209 | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
210 tr '
211 ' ' ' >> "$depfile"
212 echo >> "$depfile"
213
214 # The second pass generates a dummy entry for each header file.
215 tr ' ' '
216 ' < "$tmpdepfile" \
217 | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
218 >> "$depfile"
219 else
220 # The sourcefile does not contain any dependencies, so just
221 # store a dummy comment line, to avoid errors with the Makefile
222 # "include basename.Plo" scheme.
223 echo "#dummy" > "$depfile"
224 fi
225 rm -f "$tmpdepfile"
226 ;;
227
228 aix)
229 # The C for AIX Compiler uses -M and outputs the dependencies
230 # in a .u file. In older versions, this file always lives in the
231 # current directory. Also, the AIX compiler puts `$object:' at the
232 # start of each line; $object doesn't have directory information.
233 # Version 6 uses the directory in both cases.
234 dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
235 test "x$dir" = "x$object" && dir=
236 base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
237 if test "$libtool" = yes; then
238 tmpdepfile1=$dir$base.u
239 tmpdepfile2=$base.u
240 tmpdepfile3=$dir.libs/$base.u
241 "$@" -Wc,-M
242 else
243 tmpdepfile1=$dir$base.u
244 tmpdepfile2=$dir$base.u
245 tmpdepfile3=$dir$base.u
246 "$@" -M
247 fi
248 stat=$?
249
250 if test $stat -eq 0; then :
251 else
252 rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
253 exit $stat
254 fi
255
256 for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
257 do
258 test -f "$tmpdepfile" && break
259 done
260 if test -f "$tmpdepfile"; then
261 # Each line is of the form `foo.o: dependent.h'.
262 # Do two passes, one to just change these to
263 # `$object: dependent.h' and one to simply `dependent.h:'.
264 sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
265 # That's a tab and a space in the [].
266 sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
267 else
268 # The sourcefile does not contain any dependencies, so just
269 # store a dummy comment line, to avoid errors with the Makefile
270 # "include basename.Plo" scheme.
271 echo "#dummy" > "$depfile"
272 fi
273 rm -f "$tmpdepfile"
274 ;;
275
276 icc)
277 # Intel's C compiler understands `-MD -MF file'. However on
278 # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
279 # ICC 7.0 will fill foo.d with something like
280 # foo.o: sub/foo.c
281 # foo.o: sub/foo.h
282 # which is wrong. We want:
283 # sub/foo.o: sub/foo.c
284 # sub/foo.o: sub/foo.h
285 # sub/foo.c:
286 # sub/foo.h:
287 # ICC 7.1 will output
288 # foo.o: sub/foo.c sub/foo.h
289 # and will wrap long lines using \ :
290 # foo.o: sub/foo.c ... \
291 # sub/foo.h ... \
292 # ...
293
294 "$@" -MD -MF "$tmpdepfile"
295 stat=$?
296 if test $stat -eq 0; then :
297 else
298 rm -f "$tmpdepfile"
299 exit $stat
300 fi
301 rm -f "$depfile"
302 # Each line is of the form `foo.o: dependent.h',
303 # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
304 # Do two passes, one to just change these to
305 # `$object: dependent.h' and one to simply `dependent.h:'.
306 sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
307 # Some versions of the HPUX 10.20 sed can't process this invocation
308 # correctly. Breaking it into two sed invocations is a workaround.
309 sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
310 sed -e 's/$/ :/' >> "$depfile"
311 rm -f "$tmpdepfile"
312 ;;
313
314 hp2)
315 # The "hp" stanza above does not work with aCC (C++) and HP's ia64
316 # compilers, which have integrated preprocessors. The correct option
317 # to use with these is +Maked; it writes dependencies to a file named
318 # 'foo.d', which lands next to the object file, wherever that
319 # happens to be.
320 # Much of this is similar to the tru64 case; see comments there.
321 dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
322 test "x$dir" = "x$object" && dir=
323 base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
324 if test "$libtool" = yes; then
325 tmpdepfile1=$dir$base.d
326 tmpdepfile2=$dir.libs/$base.d
327 "$@" -Wc,+Maked
328 else
329 tmpdepfile1=$dir$base.d
330 tmpdepfile2=$dir$base.d
331 "$@" +Maked
332 fi
333 stat=$?
334 if test $stat -eq 0; then :
335 else
336 rm -f "$tmpdepfile1" "$tmpdepfile2"
337 exit $stat
338 fi
339
340 for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
341 do
342 test -f "$tmpdepfile" && break
343 done
344 if test -f "$tmpdepfile"; then
345 sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
346 # Add `dependent.h:' lines.
347 sed -ne '2,${
348 s/^ *//
349 s/ \\*$//
350 s/$/:/
351 p
352 }' "$tmpdepfile" >> "$depfile"
353 else
354 echo "#dummy" > "$depfile"
355 fi
356 rm -f "$tmpdepfile" "$tmpdepfile2"
357 ;;
358
359 tru64)
360 # The Tru64 compiler uses -MD to generate dependencies as a side
361 # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
362 # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
363 # dependencies in `foo.d' instead, so we check for that too.
364 # Subdirectories are respected.
365 dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
366 test "x$dir" = "x$object" && dir=
367 base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
368
369 if test "$libtool" = yes; then
370 # With Tru64 cc, shared objects can also be used to make a
371 # static library. This mechanism is used in libtool 1.4 series to
372 # handle both shared and static libraries in a single compilation.
373 # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
374 #
375 # With libtool 1.5 this exception was removed, and libtool now
376 # generates 2 separate objects for the 2 libraries. These two
377 # compilations output dependencies in $dir.libs/$base.o.d and
378 # in $dir$base.o.d. We have to check for both files, because
379 # one of the two compilations can be disabled. We should prefer
380 # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
381 # automatically cleaned when .libs/ is deleted, while ignoring
382 # the former would cause a distcleancheck panic.
383 tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
384 tmpdepfile2=$dir$base.o.d # libtool 1.5
385 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
386 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
387 "$@" -Wc,-MD
388 else
389 tmpdepfile1=$dir$base.o.d
390 tmpdepfile2=$dir$base.d
391 tmpdepfile3=$dir$base.d
392 tmpdepfile4=$dir$base.d
393 "$@" -MD
394 fi
395
396 stat=$?
397 if test $stat -eq 0; then :
398 else
399 rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
400 exit $stat
401 fi
402
403 for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
404 do
405 test -f "$tmpdepfile" && break
406 done
407 if test -f "$tmpdepfile"; then
408 sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
409 # That's a tab and a space in the [].
410 sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
411 else
412 echo "#dummy" > "$depfile"
413 fi
414 rm -f "$tmpdepfile"
415 ;;
416
417 msvc7)
418 if test "$libtool" = yes; then
419 showIncludes=-Wc,-showIncludes
420 else
421 showIncludes=-showIncludes
422 fi
423 "$@" $showIncludes > "$tmpdepfile"
424 stat=$?
425 grep -v '^Note: including file: ' "$tmpdepfile"
426 if test "$stat" = 0; then :
427 else
428 rm -f "$tmpdepfile"
429 exit $stat
430 fi
431 rm -f "$depfile"
432 echo "$object : \\" > "$depfile"
433 # The first sed program below extracts the file names and escapes
434 # backslashes for cygpath. The second sed program outputs the file
435 # name when reading, but also accumulates all include files in the
436 # hold buffer in order to output them again at the end. This only
437 # works with sed implementations that can handle large buffers.
438 sed < "$tmpdepfile" -n '
439 /^Note: including file: *\(.*\)/ {
440 s//\1/
441 s/\\/\\\\/g
442 p
443 }' | $cygpath_u | sort -u | sed -n '
444 s/ /\\ /g
445 s/\(.*\)/ \1 \\/p
446 s/.\(.*\) \\/\1:/
447 H
448 $ {
449 s/.*/ /
450 G
451 p
452 }' >> "$depfile"
453 rm -f "$tmpdepfile"
454 ;;
455
456 msvc7msys)
457 # This case exists only to let depend.m4 do its work. It works by
458 # looking at the text of this script. This case will never be run,
459 # since it is checked for above.
460 exit 1
461 ;;
462
463 #nosideeffect)
464 # This comment above is used by automake to tell side-effect
465 # dependency tracking mechanisms from slower ones.
466
467 dashmstdout)
468 # Important note: in order to support this mode, a compiler *must*
469 # always write the preprocessed file to stdout, regardless of -o.
470 "$@" || exit $?
471
472 # Remove the call to Libtool.
473 if test "$libtool" = yes; then
474 while test "X$1" != 'X--mode=compile'; do
475 shift
476 done
477 shift
478 fi
479
480 # Remove `-o $object'.
481 IFS=" "
482 for arg
483 do
484 case $arg in
485 -o)
486 shift
487 ;;
488 $object)
489 shift
490 ;;
491 *)
492 set fnord "$@" "$arg"
493 shift # fnord
494 shift # $arg
495 ;;
496 esac
497 done
498
499 test -z "$dashmflag" && dashmflag=-M
500 # Require at least two characters before searching for `:'
501 # in the target name. This is to cope with DOS-style filenames:
502 # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
503 "$@" $dashmflag |
504 sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
505 rm -f "$depfile"
506 cat < "$tmpdepfile" > "$depfile"
507 tr ' ' '
508 ' < "$tmpdepfile" | \
509 ## Some versions of the HPUX 10.20 sed can't process this invocation
510 ## correctly. Breaking it into two sed invocations is a workaround.
511 sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
512 rm -f "$tmpdepfile"
513 ;;
514
515 dashXmstdout)
516 # This case only exists to satisfy depend.m4. It is never actually
517 # run, as this mode is specially recognized in the preamble.
518 exit 1
519 ;;
520
521 makedepend)
522 "$@" || exit $?
523 # Remove any Libtool call
524 if test "$libtool" = yes; then
525 while test "X$1" != 'X--mode=compile'; do
526 shift
527 done
528 shift
529 fi
530 # X makedepend
531 shift
532 cleared=no eat=no
533 for arg
534 do
535 case $cleared in
536 no)
537 set ""; shift
538 cleared=yes ;;
539 esac
540 if test $eat = yes; then
541 eat=no
542 continue
543 fi
544 case "$arg" in
545 -D*|-I*)
546 set fnord "$@" "$arg"; shift ;;
547 # Strip any option that makedepend may not understand. Remove
548 # the object too, otherwise makedepend will parse it as a source file.
549 -arch)
550 eat=yes ;;
551 -*|$object)
552 ;;
553 *)
554 set fnord "$@" "$arg"; shift ;;
555 esac
556 done
557 obj_suffix=`echo "$object" | sed 's/^.*\././'`
558 touch "$tmpdepfile"
559 ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
560 rm -f "$depfile"
561 # makedepend may prepend the VPATH from the source file name to the object.
562 # No need to regex-escape $object, excess matching of '.' is harmless.
563 sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
564 sed '1,2d' "$tmpdepfile" | tr ' ' '
565 ' | \
566 ## Some versions of the HPUX 10.20 sed can't process this invocation
567 ## correctly. Breaking it into two sed invocations is a workaround.
568 sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
569 rm -f "$tmpdepfile" "$tmpdepfile".bak
570 ;;
571
572 cpp)
573 # Important note: in order to support this mode, a compiler *must*
574 # always write the preprocessed file to stdout.
575 "$@" || exit $?
576
577 # Remove the call to Libtool.
578 if test "$libtool" = yes; then
579 while test "X$1" != 'X--mode=compile'; do
580 shift
581 done
582 shift
583 fi
584
585 # Remove `-o $object'.
586 IFS=" "
587 for arg
588 do
589 case $arg in
590 -o)
591 shift
592 ;;
593 $object)
594 shift
595 ;;
596 *)
597 set fnord "$@" "$arg"
598 shift # fnord
599 shift # $arg
600 ;;
601 esac
602 done
603
604 "$@" -E |
605 sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
606 -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
607 sed '$ s: \\$::' > "$tmpdepfile"
608 rm -f "$depfile"
609 echo "$object : \\" > "$depfile"
610 cat < "$tmpdepfile" >> "$depfile"
611 sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
612 rm -f "$tmpdepfile"
613 ;;
614
615 msvisualcpp)
616 # Important note: in order to support this mode, a compiler *must*
617 # always write the preprocessed file to stdout.
618 "$@" || exit $?
619
620 # Remove the call to Libtool.
621 if test "$libtool" = yes; then
622 while test "X$1" != 'X--mode=compile'; do
623 shift
624 done
625 shift
626 fi
627
628 IFS=" "
629 for arg
630 do
631 case "$arg" in
632 -o)
633 shift
634 ;;
635 $object)
636 shift
637 ;;
638 "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
639 set fnord "$@"
640 shift
641 shift
642 ;;
643 *)
644 set fnord "$@" "$arg"
645 shift
646 shift
647 ;;
648 esac
649 done
650 "$@" -E 2>/dev/null |
651 sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
652 rm -f "$depfile"
653 echo "$object : \\" > "$depfile"
654 sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
655 echo " " >> "$depfile"
656 sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
657 rm -f "$tmpdepfile"
658 ;;
659
660 msvcmsys)
661 # This case exists only to let depend.m4 do its work. It works by
662 # looking at the text of this script. This case will never be run,
663 # since it is checked for above.
664 exit 1
665 ;;
666
667 none)
668 exec "$@"
669 ;;
670
671 *)
672 echo "Unknown depmode $depmode" 1>&2
673 exit 1
674 ;;
675 esac
676
677 exit 0
678
679 # Local Variables:
680 # mode: shell-script
681 # sh-indentation: 2
682 # eval: (add-hook 'write-file-hooks 'time-stamp)
683 # time-stamp-start: "scriptversion="
684 # time-stamp-format: "%:y-%02m-%02d.%02H"
685 # time-stamp-time-zone: "UTC"
686 # time-stamp-end: "; # UTC"
687 # End:
0 #!/bin/sh
1 # install - install a program, script, or datafile
2
3 scriptversion=2011-01-19.21; # UTC
4
5 # This originates from X11R5 (mit/util/scripts/install.sh), which was
6 # later released in X11R6 (xc/config/util/install.sh) with the
7 # following copyright and license.
8 #
9 # Copyright (C) 1994 X Consortium
10 #
11 # Permission is hereby granted, free of charge, to any person obtaining a copy
12 # of this software and associated documentation files (the "Software"), to
13 # deal in the Software without restriction, including without limitation the
14 # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
15 # sell copies of the Software, and to permit persons to whom the Software is
16 # furnished to do so, subject to the following conditions:
17 #
18 # The above copyright notice and this permission notice shall be included in
19 # all copies or substantial portions of the Software.
20 #
21 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24 # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
25 # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
26 # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27 #
28 # Except as contained in this notice, the name of the X Consortium shall not
29 # be used in advertising or otherwise to promote the sale, use or other deal-
30 # ings in this Software without prior written authorization from the X Consor-
31 # tium.
32 #
33 #
34 # FSF changes to this file are in the public domain.
35 #
36 # Calling this script install-sh is preferred over install.sh, to prevent
37 # `make' implicit rules from creating a file called install from it
38 # when there is no Makefile.
39 #
40 # This script is compatible with the BSD install script, but was written
41 # from scratch.
42
43 nl='
44 '
45 IFS=" "" $nl"
46
47 # set DOITPROG to echo to test this script
48
49 # Don't use :- since 4.3BSD and earlier shells don't like it.
50 doit=${DOITPROG-}
51 if test -z "$doit"; then
52 doit_exec=exec
53 else
54 doit_exec=$doit
55 fi
56
57 # Put in absolute file names if you don't have them in your path;
58 # or use environment vars.
59
60 chgrpprog=${CHGRPPROG-chgrp}
61 chmodprog=${CHMODPROG-chmod}
62 chownprog=${CHOWNPROG-chown}
63 cmpprog=${CMPPROG-cmp}
64 cpprog=${CPPROG-cp}
65 mkdirprog=${MKDIRPROG-mkdir}
66 mvprog=${MVPROG-mv}
67 rmprog=${RMPROG-rm}
68 stripprog=${STRIPPROG-strip}
69
70 posix_glob='?'
71 initialize_posix_glob='
72 test "$posix_glob" != "?" || {
73 if (set -f) 2>/dev/null; then
74 posix_glob=
75 else
76 posix_glob=:
77 fi
78 }
79 '
80
81 posix_mkdir=
82
83 # Desired mode of installed file.
84 mode=0755
85
86 chgrpcmd=
87 chmodcmd=$chmodprog
88 chowncmd=
89 mvcmd=$mvprog
90 rmcmd="$rmprog -f"
91 stripcmd=
92
93 src=
94 dst=
95 dir_arg=
96 dst_arg=
97
98 copy_on_change=false
99 no_target_directory=
100
101 usage="\
102 Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
103 or: $0 [OPTION]... SRCFILES... DIRECTORY
104 or: $0 [OPTION]... -t DIRECTORY SRCFILES...
105 or: $0 [OPTION]... -d DIRECTORIES...
106
107 In the 1st form, copy SRCFILE to DSTFILE.
108 In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
109 In the 4th, create DIRECTORIES.
110
111 Options:
112 --help display this help and exit.
113 --version display version info and exit.
114
115 -c (ignored)
116 -C install only if different (preserve the last data modification time)
117 -d create directories instead of installing files.
118 -g GROUP $chgrpprog installed files to GROUP.
119 -m MODE $chmodprog installed files to MODE.
120 -o USER $chownprog installed files to USER.
121 -s $stripprog installed files.
122 -t DIRECTORY install into DIRECTORY.
123 -T report an error if DSTFILE is a directory.
124
125 Environment variables override the default commands:
126 CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
127 RMPROG STRIPPROG
128 "
129
130 while test $# -ne 0; do
131 case $1 in
132 -c) ;;
133
134 -C) copy_on_change=true;;
135
136 -d) dir_arg=true;;
137
138 -g) chgrpcmd="$chgrpprog $2"
139 shift;;
140
141 --help) echo "$usage"; exit $?;;
142
143 -m) mode=$2
144 case $mode in
145 *' '* | *' '* | *'
146 '* | *'*'* | *'?'* | *'['*)
147 echo "$0: invalid mode: $mode" >&2
148 exit 1;;
149 esac
150 shift;;
151
152 -o) chowncmd="$chownprog $2"
153 shift;;
154
155 -s) stripcmd=$stripprog;;
156
157 -t) dst_arg=$2
158 # Protect names problematic for `test' and other utilities.
159 case $dst_arg in
160 -* | [=\(\)!]) dst_arg=./$dst_arg;;
161 esac
162 shift;;
163
164 -T) no_target_directory=true;;
165
166 --version) echo "$0 $scriptversion"; exit $?;;
167
168 --) shift
169 break;;
170
171 -*) echo "$0: invalid option: $1" >&2
172 exit 1;;
173
174 *) break;;
175 esac
176 shift
177 done
178
179 if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
180 # When -d is used, all remaining arguments are directories to create.
181 # When -t is used, the destination is already specified.
182 # Otherwise, the last argument is the destination. Remove it from $@.
183 for arg
184 do
185 if test -n "$dst_arg"; then
186 # $@ is not empty: it contains at least $arg.
187 set fnord "$@" "$dst_arg"
188 shift # fnord
189 fi
190 shift # arg
191 dst_arg=$arg
192 # Protect names problematic for `test' and other utilities.
193 case $dst_arg in
194 -* | [=\(\)!]) dst_arg=./$dst_arg;;
195 esac
196 done
197 fi
198
199 if test $# -eq 0; then
200 if test -z "$dir_arg"; then
201 echo "$0: no input file specified." >&2
202 exit 1
203 fi
204 # It's OK to call `install-sh -d' without argument.
205 # This can happen when creating conditional directories.
206 exit 0
207 fi
208
209 if test -z "$dir_arg"; then
210 do_exit='(exit $ret); exit $ret'
211 trap "ret=129; $do_exit" 1
212 trap "ret=130; $do_exit" 2
213 trap "ret=141; $do_exit" 13
214 trap "ret=143; $do_exit" 15
215
216 # Set umask so as not to create temps with too-generous modes.
217 # However, 'strip' requires both read and write access to temps.
218 case $mode in
219 # Optimize common cases.
220 *644) cp_umask=133;;
221 *755) cp_umask=22;;
222
223 *[0-7])
224 if test -z "$stripcmd"; then
225 u_plus_rw=
226 else
227 u_plus_rw='% 200'
228 fi
229 cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
230 *)
231 if test -z "$stripcmd"; then
232 u_plus_rw=
233 else
234 u_plus_rw=,u+rw
235 fi
236 cp_umask=$mode$u_plus_rw;;
237 esac
238 fi
239
240 for src
241 do
242 # Protect names problematic for `test' and other utilities.
243 case $src in
244 -* | [=\(\)!]) src=./$src;;
245 esac
246
247 if test -n "$dir_arg"; then
248 dst=$src
249 dstdir=$dst
250 test -d "$dstdir"
251 dstdir_status=$?
252 else
253
254 # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
255 # might cause directories to be created, which would be especially bad
256 # if $src (and thus $dsttmp) contains '*'.
257 if test ! -f "$src" && test ! -d "$src"; then
258 echo "$0: $src does not exist." >&2
259 exit 1
260 fi
261
262 if test -z "$dst_arg"; then
263 echo "$0: no destination specified." >&2
264 exit 1
265 fi
266 dst=$dst_arg
267
268 # If destination is a directory, append the input filename; won't work
269 # if double slashes aren't ignored.
270 if test -d "$dst"; then
271 if test -n "$no_target_directory"; then
272 echo "$0: $dst_arg: Is a directory" >&2
273 exit 1
274 fi
275 dstdir=$dst
276 dst=$dstdir/`basename "$src"`
277 dstdir_status=0
278 else
279 # Prefer dirname, but fall back on a substitute if dirname fails.
280 dstdir=`
281 (dirname "$dst") 2>/dev/null ||
282 expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
283 X"$dst" : 'X\(//\)[^/]' \| \
284 X"$dst" : 'X\(//\)$' \| \
285 X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
286 echo X"$dst" |
287 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
288 s//\1/
289 q
290 }
291 /^X\(\/\/\)[^/].*/{
292 s//\1/
293 q
294 }
295 /^X\(\/\/\)$/{
296 s//\1/
297 q
298 }
299 /^X\(\/\).*/{
300 s//\1/
301 q
302 }
303 s/.*/./; q'
304 `
305
306 test -d "$dstdir"
307 dstdir_status=$?
308 fi
309 fi
310
311 obsolete_mkdir_used=false
312
313 if test $dstdir_status != 0; then
314 case $posix_mkdir in
315 '')
316 # Create intermediate dirs using mode 755 as modified by the umask.
317 # This is like FreeBSD 'install' as of 1997-10-28.
318 umask=`umask`
319 case $stripcmd.$umask in
320 # Optimize common cases.
321 *[2367][2367]) mkdir_umask=$umask;;
322 .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
323
324 *[0-7])
325 mkdir_umask=`expr $umask + 22 \
326 - $umask % 100 % 40 + $umask % 20 \
327 - $umask % 10 % 4 + $umask % 2
328 `;;
329 *) mkdir_umask=$umask,go-w;;
330 esac
331
332 # With -d, create the new directory with the user-specified mode.
333 # Otherwise, rely on $mkdir_umask.
334 if test -n "$dir_arg"; then
335 mkdir_mode=-m$mode
336 else
337 mkdir_mode=
338 fi
339
340 posix_mkdir=false
341 case $umask in
342 *[123567][0-7][0-7])
343 # POSIX mkdir -p sets u+wx bits regardless of umask, which
344 # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
345 ;;
346 *)
347 tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
348 trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
349
350 if (umask $mkdir_umask &&
351 exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
352 then
353 if test -z "$dir_arg" || {
354 # Check for POSIX incompatibilities with -m.
355 # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
356 # other-writeable bit of parent directory when it shouldn't.
357 # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
358 ls_ld_tmpdir=`ls -ld "$tmpdir"`
359 case $ls_ld_tmpdir in
360 d????-?r-*) different_mode=700;;
361 d????-?--*) different_mode=755;;
362 *) false;;
363 esac &&
364 $mkdirprog -m$different_mode -p -- "$tmpdir" && {
365 ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
366 test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
367 }
368 }
369 then posix_mkdir=:
370 fi
371 rmdir "$tmpdir/d" "$tmpdir"
372 else
373 # Remove any dirs left behind by ancient mkdir implementations.
374 rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
375 fi
376 trap '' 0;;
377 esac;;
378 esac
379
380 if
381 $posix_mkdir && (
382 umask $mkdir_umask &&
383 $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
384 )
385 then :
386 else
387
388 # The umask is ridiculous, or mkdir does not conform to POSIX,
389 # or it failed possibly due to a race condition. Create the
390 # directory the slow way, step by step, checking for races as we go.
391
392 case $dstdir in
393 /*) prefix='/';;
394 [-=\(\)!]*) prefix='./';;
395 *) prefix='';;
396 esac
397
398 eval "$initialize_posix_glob"
399
400 oIFS=$IFS
401 IFS=/
402 $posix_glob set -f
403 set fnord $dstdir
404 shift
405 $posix_glob set +f
406 IFS=$oIFS
407
408 prefixes=
409
410 for d
411 do
412 test X"$d" = X && continue
413
414 prefix=$prefix$d
415 if test -d "$prefix"; then
416 prefixes=
417 else
418 if $posix_mkdir; then
419 (umask=$mkdir_umask &&
420 $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
421 # Don't fail if two instances are running concurrently.
422 test -d "$prefix" || exit 1
423 else
424 case $prefix in
425 *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
426 *) qprefix=$prefix;;
427 esac
428 prefixes="$prefixes '$qprefix'"
429 fi
430 fi
431 prefix=$prefix/
432 done
433
434 if test -n "$prefixes"; then
435 # Don't fail if two instances are running concurrently.
436 (umask $mkdir_umask &&
437 eval "\$doit_exec \$mkdirprog $prefixes") ||
438 test -d "$dstdir" || exit 1
439 obsolete_mkdir_used=true
440 fi
441 fi
442 fi
443
444 if test -n "$dir_arg"; then
445 { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
446 { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
447 { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
448 test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
449 else
450
451 # Make a couple of temp file names in the proper directory.
452 dsttmp=$dstdir/_inst.$$_
453 rmtmp=$dstdir/_rm.$$_
454
455 # Trap to clean up those temp files at exit.
456 trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
457
458 # Copy the file name to the temp name.
459 (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
460
461 # and set any options; do chmod last to preserve setuid bits.
462 #
463 # If any of these fail, we abort the whole thing. If we want to
464 # ignore errors from any of these, just make sure not to ignore
465 # errors from the above "$doit $cpprog $src $dsttmp" command.
466 #
467 { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
468 { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
469 { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
470 { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
471
472 # If -C, don't bother to copy if it wouldn't change the file.
473 if $copy_on_change &&
474 old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
475 new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
476
477 eval "$initialize_posix_glob" &&
478 $posix_glob set -f &&
479 set X $old && old=:$2:$4:$5:$6 &&
480 set X $new && new=:$2:$4:$5:$6 &&
481 $posix_glob set +f &&
482
483 test "$old" = "$new" &&
484 $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
485 then
486 rm -f "$dsttmp"
487 else
488 # Rename the file to the real destination.
489 $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
490
491 # The rename failed, perhaps because mv can't rename something else
492 # to itself, or perhaps because mv is so ancient that it does not
493 # support -f.
494 {
495 # Now remove or move aside any old file at destination location.
496 # We try this two ways since rm can't unlink itself on some
497 # systems and the destination file might be busy for other
498 # reasons. In this case, the final cleanup might fail but the new
499 # file should still install successfully.
500 {
501 test ! -f "$dst" ||
502 $doit $rmcmd -f "$dst" 2>/dev/null ||
503 { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
504 { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
505 } ||
506 { echo "$0: cannot unlink or rename $dst" >&2
507 (exit 1); exit 1
508 }
509 } &&
510
511 # Now rename the file to the real destination.
512 $doit $mvcmd "$dsttmp" "$dst"
513 }
514 fi || exit 1
515
516 trap '' 0
517 fi
518 done
519
520 # Local variables:
521 # eval: (add-hook 'write-file-hooks 'time-stamp)
522 # time-stamp-start: "scriptversion="
523 # time-stamp-format: "%:y-%02m-%02d.%02H"
524 # time-stamp-time-zone: "UTC"
525 # time-stamp-end: "; # UTC"
526 # End:
0
1 # libtool (GNU libtool) 2.4.2
2 # Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
3
4 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
5 # 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
6 # This is free software; see the source for copying conditions. There is NO
7 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
8
9 # GNU Libtool is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 2 of the License, or
12 # (at your option) any later version.
13 #
14 # As a special exception to the GNU General Public License,
15 # if you distribute this file as part of a program or library that
16 # is built using GNU Libtool, you may include this file under the
17 # same distribution terms that you use for the rest of that program.
18 #
19 # GNU Libtool is distributed in the hope that it will be useful, but
20 # WITHOUT ANY WARRANTY; without even the implied warranty of
21 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 # General Public License for more details.
23 #
24 # You should have received a copy of the GNU General Public License
25 # along with GNU Libtool; see the file COPYING. If not, a copy
26 # can be downloaded from http://www.gnu.org/licenses/gpl.html,
27 # or obtained by writing to the Free Software Foundation, Inc.,
28 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
29
30 # Usage: $progname [OPTION]... [MODE-ARG]...
31 #
32 # Provide generalized library-building support services.
33 #
34 # --config show all configuration variables
35 # --debug enable verbose shell tracing
36 # -n, --dry-run display commands without modifying any files
37 # --features display basic configuration information and exit
38 # --mode=MODE use operation mode MODE
39 # --preserve-dup-deps don't remove duplicate dependency libraries
40 # --quiet, --silent don't print informational messages
41 # --no-quiet, --no-silent
42 # print informational messages (default)
43 # --no-warn don't display warning messages
44 # --tag=TAG use configuration variables from tag TAG
45 # -v, --verbose print more informational messages than default
46 # --no-verbose don't print the extra informational messages
47 # --version print version information
48 # -h, --help, --help-all print short, long, or detailed help message
49 #
50 # MODE must be one of the following:
51 #
52 # clean remove files from the build directory
53 # compile compile a source file into a libtool object
54 # execute automatically set library path, then run a program
55 # finish complete the installation of libtool libraries
56 # install install libraries or executables
57 # link create a library or an executable
58 # uninstall remove libraries from an installed directory
59 #
60 # MODE-ARGS vary depending on the MODE. When passed as first option,
61 # `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that.
62 # Try `$progname --help --mode=MODE' for a more detailed description of MODE.
63 #
64 # When reporting a bug, please describe a test case to reproduce it and
65 # include the following information:
66 #
67 # host-triplet: $host
68 # shell: $SHELL
69 # compiler: $LTCC
70 # compiler flags: $LTCFLAGS
71 # linker: $LD (gnu? $with_gnu_ld)
72 # $progname: (GNU libtool) 2.4.2
73 # automake: $automake_version
74 # autoconf: $autoconf_version
75 #
76 # Report bugs to <bug-libtool@gnu.org>.
77 # GNU libtool home page: <http://www.gnu.org/software/libtool/>.
78 # General help using GNU software: <http://www.gnu.org/gethelp/>.
79
80 PROGRAM=libtool
81 PACKAGE=libtool
82 VERSION=2.4.2
83 TIMESTAMP=""
84 package_revision=1.3337
85
86 # Be Bourne compatible
87 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
88 emulate sh
89 NULLCMD=:
90 # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
91 # is contrary to our usage. Disable this feature.
92 alias -g '${1+"$@"}'='"$@"'
93 setopt NO_GLOB_SUBST
94 else
95 case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
96 fi
97 BIN_SH=xpg4; export BIN_SH # for Tru64
98 DUALCASE=1; export DUALCASE # for MKS sh
99
100 # A function that is used when there is no print builtin or printf.
101 func_fallback_echo ()
102 {
103 eval 'cat <<_LTECHO_EOF
104 $1
105 _LTECHO_EOF'
106 }
107
108 # NLS nuisances: We save the old values to restore during execute mode.
109 lt_user_locale=
110 lt_safe_locale=
111 for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
112 do
113 eval "if test \"\${$lt_var+set}\" = set; then
114 save_$lt_var=\$$lt_var
115 $lt_var=C
116 export $lt_var
117 lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
118 lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
119 fi"
120 done
121 LC_ALL=C
122 LANGUAGE=C
123 export LANGUAGE LC_ALL
124
125 $lt_unset CDPATH
126
127
128 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
129 # is ksh but when the shell is invoked as "sh" and the current value of
130 # the _XPG environment variable is not equal to 1 (one), the special
131 # positional parameter $0, within a function call, is the name of the
132 # function.
133 progpath="$0"
134
135
136
137 : ${CP="cp -f"}
138 test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
139 : ${MAKE="make"}
140 : ${MKDIR="mkdir"}
141 : ${MV="mv -f"}
142 : ${RM="rm -f"}
143 : ${SHELL="${CONFIG_SHELL-/bin/sh}"}
144 : ${Xsed="$SED -e 1s/^X//"}
145
146 # Global variables:
147 EXIT_SUCCESS=0
148 EXIT_FAILURE=1
149 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing.
150 EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake.
151
152 exit_status=$EXIT_SUCCESS
153
154 # Make sure IFS has a sensible default
155 lt_nl='
156 '
157 IFS=" $lt_nl"
158
159 dirname="s,/[^/]*$,,"
160 basename="s,^.*/,,"
161
162 # func_dirname file append nondir_replacement
163 # Compute the dirname of FILE. If nonempty, add APPEND to the result,
164 # otherwise set result to NONDIR_REPLACEMENT.
165 func_dirname ()
166 {
167 func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
168 if test "X$func_dirname_result" = "X${1}"; then
169 func_dirname_result="${3}"
170 else
171 func_dirname_result="$func_dirname_result${2}"
172 fi
173 } # func_dirname may be replaced by extended shell implementation
174
175
176 # func_basename file
177 func_basename ()
178 {
179 func_basename_result=`$ECHO "${1}" | $SED "$basename"`
180 } # func_basename may be replaced by extended shell implementation
181
182
183 # func_dirname_and_basename file append nondir_replacement
184 # perform func_basename and func_dirname in a single function
185 # call:
186 # dirname: Compute the dirname of FILE. If nonempty,
187 # add APPEND to the result, otherwise set result
188 # to NONDIR_REPLACEMENT.
189 # value returned in "$func_dirname_result"
190 # basename: Compute filename of FILE.
191 # value retuned in "$func_basename_result"
192 # Implementation must be kept synchronized with func_dirname
193 # and func_basename. For efficiency, we do not delegate to
194 # those functions but instead duplicate the functionality here.
195 func_dirname_and_basename ()
196 {
197 # Extract subdirectory from the argument.
198 func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
199 if test "X$func_dirname_result" = "X${1}"; then
200 func_dirname_result="${3}"
201 else
202 func_dirname_result="$func_dirname_result${2}"
203 fi
204 func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
205 } # func_dirname_and_basename may be replaced by extended shell implementation
206
207
208 # func_stripname prefix suffix name
209 # strip PREFIX and SUFFIX off of NAME.
210 # PREFIX and SUFFIX must not contain globbing or regex special
211 # characters, hashes, percent signs, but SUFFIX may contain a leading
212 # dot (in which case that matches only a dot).
213 # func_strip_suffix prefix name
214 func_stripname ()
215 {
216 case ${2} in
217 .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
218 *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
219 esac
220 } # func_stripname may be replaced by extended shell implementation
221
222
223 # These SED scripts presuppose an absolute path with a trailing slash.
224 pathcar='s,^/\([^/]*\).*$,\1,'
225 pathcdr='s,^/[^/]*,,'
226 removedotparts=':dotsl
227 s@/\./@/@g
228 t dotsl
229 s,/\.$,/,'
230 collapseslashes='s@/\{1,\}@/@g'
231 finalslash='s,/*$,/,'
232
233 # func_normal_abspath PATH
234 # Remove doubled-up and trailing slashes, "." path components,
235 # and cancel out any ".." path components in PATH after making
236 # it an absolute path.
237 # value returned in "$func_normal_abspath_result"
238 func_normal_abspath ()
239 {
240 # Start from root dir and reassemble the path.
241 func_normal_abspath_result=
242 func_normal_abspath_tpath=$1
243 func_normal_abspath_altnamespace=
244 case $func_normal_abspath_tpath in
245 "")
246 # Empty path, that just means $cwd.
247 func_stripname '' '/' "`pwd`"
248 func_normal_abspath_result=$func_stripname_result
249 return
250 ;;
251 # The next three entries are used to spot a run of precisely
252 # two leading slashes without using negated character classes;
253 # we take advantage of case's first-match behaviour.
254 ///*)
255 # Unusual form of absolute path, do nothing.
256 ;;
257 //*)
258 # Not necessarily an ordinary path; POSIX reserves leading '//'
259 # and for example Cygwin uses it to access remote file shares
260 # over CIFS/SMB, so we conserve a leading double slash if found.
261 func_normal_abspath_altnamespace=/
262 ;;
263 /*)
264 # Absolute path, do nothing.
265 ;;
266 *)
267 # Relative path, prepend $cwd.
268 func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
269 ;;
270 esac
271 # Cancel out all the simple stuff to save iterations. We also want
272 # the path to end with a slash for ease of parsing, so make sure
273 # there is one (and only one) here.
274 func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
275 -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
276 while :; do
277 # Processed it all yet?
278 if test "$func_normal_abspath_tpath" = / ; then
279 # If we ascended to the root using ".." the result may be empty now.
280 if test -z "$func_normal_abspath_result" ; then
281 func_normal_abspath_result=/
282 fi
283 break
284 fi
285 func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
286 -e "$pathcar"`
287 func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
288 -e "$pathcdr"`
289 # Figure out what to do with it
290 case $func_normal_abspath_tcomponent in
291 "")
292 # Trailing empty path component, ignore it.
293 ;;
294 ..)
295 # Parent dir; strip last assembled component from result.
296 func_dirname "$func_normal_abspath_result"
297 func_normal_abspath_result=$func_dirname_result
298 ;;
299 *)
300 # Actual path component, append it.
301 func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent
302 ;;
303 esac
304 done
305 # Restore leading double-slash if one was found on entry.
306 func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
307 }
308
309 # func_relative_path SRCDIR DSTDIR
310 # generates a relative path from SRCDIR to DSTDIR, with a trailing
311 # slash if non-empty, suitable for immediately appending a filename
312 # without needing to append a separator.
313 # value returned in "$func_relative_path_result"
314 func_relative_path ()
315 {
316 func_relative_path_result=
317 func_normal_abspath "$1"
318 func_relative_path_tlibdir=$func_normal_abspath_result
319 func_normal_abspath "$2"
320 func_relative_path_tbindir=$func_normal_abspath_result
321
322 # Ascend the tree starting from libdir
323 while :; do
324 # check if we have found a prefix of bindir
325 case $func_relative_path_tbindir in
326 $func_relative_path_tlibdir)
327 # found an exact match
328 func_relative_path_tcancelled=
329 break
330 ;;
331 $func_relative_path_tlibdir*)
332 # found a matching prefix
333 func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
334 func_relative_path_tcancelled=$func_stripname_result
335 if test -z "$func_relative_path_result"; then
336 func_relative_path_result=.
337 fi
338 break
339 ;;
340 *)
341 func_dirname $func_relative_path_tlibdir
342 func_relative_path_tlibdir=${func_dirname_result}
343 if test "x$func_relative_path_tlibdir" = x ; then
344 # Have to descend all the way to the root!
345 func_relative_path_result=../$func_relative_path_result
346 func_relative_path_tcancelled=$func_relative_path_tbindir
347 break
348 fi
349 func_relative_path_result=../$func_relative_path_result
350 ;;
351 esac
352 done
353
354 # Now calculate path; take care to avoid doubling-up slashes.
355 func_stripname '' '/' "$func_relative_path_result"
356 func_relative_path_result=$func_stripname_result
357 func_stripname '/' '/' "$func_relative_path_tcancelled"
358 if test "x$func_stripname_result" != x ; then
359 func_relative_path_result=${func_relative_path_result}/${func_stripname_result}
360 fi
361
362 # Normalisation. If bindir is libdir, return empty string,
363 # else relative path ending with a slash; either way, target
364 # file name can be directly appended.
365 if test ! -z "$func_relative_path_result"; then
366 func_stripname './' '' "$func_relative_path_result/"
367 func_relative_path_result=$func_stripname_result
368 fi
369 }
370
371 # The name of this program:
372 func_dirname_and_basename "$progpath"
373 progname=$func_basename_result
374
375 # Make sure we have an absolute path for reexecution:
376 case $progpath in
377 [\\/]*|[A-Za-z]:\\*) ;;
378 *[\\/]*)
379 progdir=$func_dirname_result
380 progdir=`cd "$progdir" && pwd`
381 progpath="$progdir/$progname"
382 ;;
383 *)
384 save_IFS="$IFS"
385 IFS=${PATH_SEPARATOR-:}
386 for progdir in $PATH; do
387 IFS="$save_IFS"
388 test -x "$progdir/$progname" && break
389 done
390 IFS="$save_IFS"
391 test -n "$progdir" || progdir=`pwd`
392 progpath="$progdir/$progname"
393 ;;
394 esac
395
396 # Sed substitution that helps us do robust quoting. It backslashifies
397 # metacharacters that are still active within double-quoted strings.
398 Xsed="${SED}"' -e 1s/^X//'
399 sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
400
401 # Same as above, but do not quote variable references.
402 double_quote_subst='s/\(["`\\]\)/\\\1/g'
403
404 # Sed substitution that turns a string into a regex matching for the
405 # string literally.
406 sed_make_literal_regex='s,[].[^$\\*\/],\\&,g'
407
408 # Sed substitution that converts a w32 file name or path
409 # which contains forward slashes, into one that contains
410 # (escaped) backslashes. A very naive implementation.
411 lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
412
413 # Re-`\' parameter expansions in output of double_quote_subst that were
414 # `\'-ed in input to the same. If an odd number of `\' preceded a '$'
415 # in input to double_quote_subst, that '$' was protected from expansion.
416 # Since each input `\' is now two `\'s, look for any number of runs of
417 # four `\'s followed by two `\'s and then a '$'. `\' that '$'.
418 bs='\\'
419 bs2='\\\\'
420 bs4='\\\\\\\\'
421 dollar='\$'
422 sed_double_backslash="\
423 s/$bs4/&\\
424 /g
425 s/^$bs2$dollar/$bs&/
426 s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
427 s/\n//g"
428
429 # Standard options:
430 opt_dry_run=false
431 opt_help=false
432 opt_quiet=false
433 opt_verbose=false
434 opt_warning=:
435
436 # func_echo arg...
437 # Echo program name prefixed message, along with the current mode
438 # name if it has been set yet.
439 func_echo ()
440 {
441 $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
442 }
443
444 # func_verbose arg...
445 # Echo program name prefixed message in verbose mode only.
446 func_verbose ()
447 {
448 $opt_verbose && func_echo ${1+"$@"}
449
450 # A bug in bash halts the script if the last line of a function
451 # fails when set -e is in force, so we need another command to
452 # work around that:
453 :
454 }
455
456 # func_echo_all arg...
457 # Invoke $ECHO with all args, space-separated.
458 func_echo_all ()
459 {
460 $ECHO "$*"
461 }
462
463 # func_error arg...
464 # Echo program name prefixed message to standard error.
465 func_error ()
466 {
467 $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2
468 }
469
470 # func_warning arg...
471 # Echo program name prefixed warning message to standard error.
472 func_warning ()
473 {
474 $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
475
476 # bash bug again:
477 :
478 }
479
480 # func_fatal_error arg...
481 # Echo program name prefixed message to standard error, and exit.
482 func_fatal_error ()
483 {
484 func_error ${1+"$@"}
485 exit $EXIT_FAILURE
486 }
487
488 # func_fatal_help arg...
489 # Echo program name prefixed message to standard error, followed by
490 # a help hint, and exit.
491 func_fatal_help ()
492 {
493 func_error ${1+"$@"}
494 func_fatal_error "$help"
495 }
496 help="Try \`$progname --help' for more information." ## default
497
498
499 # func_grep expression filename
500 # Check whether EXPRESSION matches any line of FILENAME, without output.
501 func_grep ()
502 {
503 $GREP "$1" "$2" >/dev/null 2>&1
504 }
505
506
507 # func_mkdir_p directory-path
508 # Make sure the entire path to DIRECTORY-PATH is available.
509 func_mkdir_p ()
510 {
511 my_directory_path="$1"
512 my_dir_list=
513
514 if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
515
516 # Protect directory names starting with `-'
517 case $my_directory_path in
518 -*) my_directory_path="./$my_directory_path" ;;
519 esac
520
521 # While some portion of DIR does not yet exist...
522 while test ! -d "$my_directory_path"; do
523 # ...make a list in topmost first order. Use a colon delimited
524 # list incase some portion of path contains whitespace.
525 my_dir_list="$my_directory_path:$my_dir_list"
526
527 # If the last portion added has no slash in it, the list is done
528 case $my_directory_path in */*) ;; *) break ;; esac
529
530 # ...otherwise throw away the child directory and loop
531 my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"`
532 done
533 my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'`
534
535 save_mkdir_p_IFS="$IFS"; IFS=':'
536 for my_dir in $my_dir_list; do
537 IFS="$save_mkdir_p_IFS"
538 # mkdir can fail with a `File exist' error if two processes
539 # try to create one of the directories concurrently. Don't
540 # stop in that case!
541 $MKDIR "$my_dir" 2>/dev/null || :
542 done
543 IFS="$save_mkdir_p_IFS"
544
545 # Bail out if we (or some other process) failed to create a directory.
546 test -d "$my_directory_path" || \
547 func_fatal_error "Failed to create \`$1'"
548 fi
549 }
550
551
552 # func_mktempdir [string]
553 # Make a temporary directory that won't clash with other running
554 # libtool processes, and avoids race conditions if possible. If
555 # given, STRING is the basename for that directory.
556 func_mktempdir ()
557 {
558 my_template="${TMPDIR-/tmp}/${1-$progname}"
559
560 if test "$opt_dry_run" = ":"; then
561 # Return a directory name, but don't create it in dry-run mode
562 my_tmpdir="${my_template}-$$"
563 else
564
565 # If mktemp works, use that first and foremost
566 my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
567
568 if test ! -d "$my_tmpdir"; then
569 # Failing that, at least try and use $RANDOM to avoid a race
570 my_tmpdir="${my_template}-${RANDOM-0}$$"
571
572 save_mktempdir_umask=`umask`
573 umask 0077
574 $MKDIR "$my_tmpdir"
575 umask $save_mktempdir_umask
576 fi
577
578 # If we're not in dry-run mode, bomb out on failure
579 test -d "$my_tmpdir" || \
580 func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
581 fi
582
583 $ECHO "$my_tmpdir"
584 }
585
586
587 # func_quote_for_eval arg
588 # Aesthetically quote ARG to be evaled later.
589 # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
590 # is double-quoted, suitable for a subsequent eval, whereas
591 # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
592 # which are still active within double quotes backslashified.
593 func_quote_for_eval ()
594 {
595 case $1 in
596 *[\\\`\"\$]*)
597 func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;;
598 *)
599 func_quote_for_eval_unquoted_result="$1" ;;
600 esac
601
602 case $func_quote_for_eval_unquoted_result in
603 # Double-quote args containing shell metacharacters to delay
604 # word splitting, command substitution and and variable
605 # expansion for a subsequent eval.
606 # Many Bourne shells cannot handle close brackets correctly
607 # in scan sets, so we specify it separately.
608 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
609 func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
610 ;;
611 *)
612 func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
613 esac
614 }
615
616
617 # func_quote_for_expand arg
618 # Aesthetically quote ARG to be evaled later; same as above,
619 # but do not quote variable references.
620 func_quote_for_expand ()
621 {
622 case $1 in
623 *[\\\`\"]*)
624 my_arg=`$ECHO "$1" | $SED \
625 -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
626 *)
627 my_arg="$1" ;;
628 esac
629
630 case $my_arg in
631 # Double-quote args containing shell metacharacters to delay
632 # word splitting and command substitution for a subsequent eval.
633 # Many Bourne shells cannot handle close brackets correctly
634 # in scan sets, so we specify it separately.
635 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
636 my_arg="\"$my_arg\""
637 ;;
638 esac
639
640 func_quote_for_expand_result="$my_arg"
641 }
642
643
644 # func_show_eval cmd [fail_exp]
645 # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
646 # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
647 # is given, then evaluate it.
648 func_show_eval ()
649 {
650 my_cmd="$1"
651 my_fail_exp="${2-:}"
652
653 ${opt_silent-false} || {
654 func_quote_for_expand "$my_cmd"
655 eval "func_echo $func_quote_for_expand_result"
656 }
657
658 if ${opt_dry_run-false}; then :; else
659 eval "$my_cmd"
660 my_status=$?
661 if test "$my_status" -eq 0; then :; else
662 eval "(exit $my_status); $my_fail_exp"
663 fi
664 fi
665 }
666
667
668 # func_show_eval_locale cmd [fail_exp]
669 # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
670 # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
671 # is given, then evaluate it. Use the saved locale for evaluation.
672 func_show_eval_locale ()
673 {
674 my_cmd="$1"
675 my_fail_exp="${2-:}"
676
677 ${opt_silent-false} || {
678 func_quote_for_expand "$my_cmd"
679 eval "func_echo $func_quote_for_expand_result"
680 }
681
682 if ${opt_dry_run-false}; then :; else
683 eval "$lt_user_locale
684 $my_cmd"
685 my_status=$?
686 eval "$lt_safe_locale"
687 if test "$my_status" -eq 0; then :; else
688 eval "(exit $my_status); $my_fail_exp"
689 fi
690 fi
691 }
692
693 # func_tr_sh
694 # Turn $1 into a string suitable for a shell variable name.
695 # Result is stored in $func_tr_sh_result. All characters
696 # not in the set a-zA-Z0-9_ are replaced with '_'. Further,
697 # if $1 begins with a digit, a '_' is prepended as well.
698 func_tr_sh ()
699 {
700 case $1 in
701 [0-9]* | *[!a-zA-Z0-9_]*)
702 func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'`
703 ;;
704 * )
705 func_tr_sh_result=$1
706 ;;
707 esac
708 }
709
710
711 # func_version
712 # Echo version message to standard output and exit.
713 func_version ()
714 {
715 $opt_debug
716
717 $SED -n '/(C)/!b go
718 :more
719 /\./!{
720 N
721 s/\n# / /
722 b more
723 }
724 :go
725 /^# '$PROGRAM' (GNU /,/# warranty; / {
726 s/^# //
727 s/^# *$//
728 s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
729 p
730 }' < "$progpath"
731 exit $?
732 }
733
734 # func_usage
735 # Echo short help message to standard output and exit.
736 func_usage ()
737 {
738 $opt_debug
739
740 $SED -n '/^# Usage:/,/^# *.*--help/ {
741 s/^# //
742 s/^# *$//
743 s/\$progname/'$progname'/
744 p
745 }' < "$progpath"
746 echo
747 $ECHO "run \`$progname --help | more' for full usage"
748 exit $?
749 }
750
751 # func_help [NOEXIT]
752 # Echo long help message to standard output and exit,
753 # unless 'noexit' is passed as argument.
754 func_help ()
755 {
756 $opt_debug
757
758 $SED -n '/^# Usage:/,/# Report bugs to/ {
759 :print
760 s/^# //
761 s/^# *$//
762 s*\$progname*'$progname'*
763 s*\$host*'"$host"'*
764 s*\$SHELL*'"$SHELL"'*
765 s*\$LTCC*'"$LTCC"'*
766 s*\$LTCFLAGS*'"$LTCFLAGS"'*
767 s*\$LD*'"$LD"'*
768 s/\$with_gnu_ld/'"$with_gnu_ld"'/
769 s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/
770 s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/
771 p
772 d
773 }
774 /^# .* home page:/b print
775 /^# General help using/b print
776 ' < "$progpath"
777 ret=$?
778 if test -z "$1"; then
779 exit $ret
780 fi
781 }
782
783 # func_missing_arg argname
784 # Echo program name prefixed message to standard error and set global
785 # exit_cmd.
786 func_missing_arg ()
787 {
788 $opt_debug
789
790 func_error "missing argument for $1."
791 exit_cmd=exit
792 }
793
794
795 # func_split_short_opt shortopt
796 # Set func_split_short_opt_name and func_split_short_opt_arg shell
797 # variables after splitting SHORTOPT after the 2nd character.
798 func_split_short_opt ()
799 {
800 my_sed_short_opt='1s/^\(..\).*$/\1/;q'
801 my_sed_short_rest='1s/^..\(.*\)$/\1/;q'
802
803 func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"`
804 func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"`
805 } # func_split_short_opt may be replaced by extended shell implementation
806
807
808 # func_split_long_opt longopt
809 # Set func_split_long_opt_name and func_split_long_opt_arg shell
810 # variables after splitting LONGOPT at the `=' sign.
811 func_split_long_opt ()
812 {
813 my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q'
814 my_sed_long_arg='1s/^--[^=]*=//'
815
816 func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"`
817 func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"`
818 } # func_split_long_opt may be replaced by extended shell implementation
819
820 exit_cmd=:
821
822
823
824
825
826 magic="%%%MAGIC variable%%%"
827 magic_exe="%%%MAGIC EXE variable%%%"
828
829 # Global variables.
830 nonopt=
831 preserve_args=
832 lo2o="s/\\.lo\$/.${objext}/"
833 o2lo="s/\\.${objext}\$/.lo/"
834 extracted_archives=
835 extracted_serial=0
836
837 # If this variable is set in any of the actions, the command in it
838 # will be execed at the end. This prevents here-documents from being
839 # left over by shells.
840 exec_cmd=
841
842 # func_append var value
843 # Append VALUE to the end of shell variable VAR.
844 func_append ()
845 {
846 eval "${1}=\$${1}\${2}"
847 } # func_append may be replaced by extended shell implementation
848
849 # func_append_quoted var value
850 # Quote VALUE and append to the end of shell variable VAR, separated
851 # by a space.
852 func_append_quoted ()
853 {
854 func_quote_for_eval "${2}"
855 eval "${1}=\$${1}\\ \$func_quote_for_eval_result"
856 } # func_append_quoted may be replaced by extended shell implementation
857
858
859 # func_arith arithmetic-term...
860 func_arith ()
861 {
862 func_arith_result=`expr "${@}"`
863 } # func_arith may be replaced by extended shell implementation
864
865
866 # func_len string
867 # STRING may not start with a hyphen.
868 func_len ()
869 {
870 func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len`
871 } # func_len may be replaced by extended shell implementation
872
873
874 # func_lo2o object
875 func_lo2o ()
876 {
877 func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
878 } # func_lo2o may be replaced by extended shell implementation
879
880
881 # func_xform libobj-or-source
882 func_xform ()
883 {
884 func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
885 } # func_xform may be replaced by extended shell implementation
886
887
888 # func_fatal_configuration arg...
889 # Echo program name prefixed message to standard error, followed by
890 # a configuration failure hint, and exit.
891 func_fatal_configuration ()
892 {
893 func_error ${1+"$@"}
894 func_error "See the $PACKAGE documentation for more information."
895 func_fatal_error "Fatal configuration error."
896 }
897
898
899 # func_config
900 # Display the configuration for all the tags in this script.
901 func_config ()
902 {
903 re_begincf='^# ### BEGIN LIBTOOL'
904 re_endcf='^# ### END LIBTOOL'
905
906 # Default configuration.
907 $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
908
909 # Now print the configurations for the tags.
910 for tagname in $taglist; do
911 $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
912 done
913
914 exit $?
915 }
916
917 # func_features
918 # Display the features supported by this script.
919 func_features ()
920 {
921 echo "host: $host"
922 if test "$build_libtool_libs" = yes; then
923 echo "enable shared libraries"
924 else
925 echo "disable shared libraries"
926 fi
927 if test "$build_old_libs" = yes; then
928 echo "enable static libraries"
929 else
930 echo "disable static libraries"
931 fi
932
933 exit $?
934 }
935
936 # func_enable_tag tagname
937 # Verify that TAGNAME is valid, and either flag an error and exit, or
938 # enable the TAGNAME tag. We also add TAGNAME to the global $taglist
939 # variable here.
940 func_enable_tag ()
941 {
942 # Global variable:
943 tagname="$1"
944
945 re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
946 re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
947 sed_extractcf="/$re_begincf/,/$re_endcf/p"
948
949 # Validate tagname.
950 case $tagname in
951 *[!-_A-Za-z0-9,/]*)
952 func_fatal_error "invalid tag name: $tagname"
953 ;;
954 esac
955
956 # Don't test for the "default" C tag, as we know it's
957 # there but not specially marked.
958 case $tagname in
959 CC) ;;
960 *)
961 if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
962 taglist="$taglist $tagname"
963
964 # Evaluate the configuration. Be careful to quote the path
965 # and the sed script, to avoid splitting on whitespace, but
966 # also don't use non-portable quotes within backquotes within
967 # quotes we have to do it in 2 steps:
968 extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
969 eval "$extractedcf"
970 else
971 func_error "ignoring unknown tag $tagname"
972 fi
973 ;;
974 esac
975 }
976
977 # func_check_version_match
978 # Ensure that we are using m4 macros, and libtool script from the same
979 # release of libtool.
980 func_check_version_match ()
981 {
982 if test "$package_revision" != "$macro_revision"; then
983 if test "$VERSION" != "$macro_version"; then
984 if test -z "$macro_version"; then
985 cat >&2 <<_LT_EOF
986 $progname: Version mismatch error. This is $PACKAGE $VERSION, but the
987 $progname: definition of this LT_INIT comes from an older release.
988 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
989 $progname: and run autoconf again.
990 _LT_EOF
991 else
992 cat >&2 <<_LT_EOF
993 $progname: Version mismatch error. This is $PACKAGE $VERSION, but the
994 $progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
995 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
996 $progname: and run autoconf again.
997 _LT_EOF
998 fi
999 else
1000 cat >&2 <<_LT_EOF
1001 $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
1002 $progname: but the definition of this LT_INIT comes from revision $macro_revision.
1003 $progname: You should recreate aclocal.m4 with macros from revision $package_revision
1004 $progname: of $PACKAGE $VERSION and run autoconf again.
1005 _LT_EOF
1006 fi
1007
1008 exit $EXIT_MISMATCH
1009 fi
1010 }
1011
1012
1013 # Shorthand for --mode=foo, only valid as the first argument
1014 case $1 in
1015 clean|clea|cle|cl)
1016 shift; set dummy --mode clean ${1+"$@"}; shift
1017 ;;
1018 compile|compil|compi|comp|com|co|c)
1019 shift; set dummy --mode compile ${1+"$@"}; shift
1020 ;;
1021 execute|execut|execu|exec|exe|ex|e)
1022 shift; set dummy --mode execute ${1+"$@"}; shift
1023 ;;
1024 finish|finis|fini|fin|fi|f)
1025 shift; set dummy --mode finish ${1+"$@"}; shift
1026 ;;
1027 install|instal|insta|inst|ins|in|i)
1028 shift; set dummy --mode install ${1+"$@"}; shift
1029 ;;
1030 link|lin|li|l)
1031 shift; set dummy --mode link ${1+"$@"}; shift
1032 ;;
1033 uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
1034 shift; set dummy --mode uninstall ${1+"$@"}; shift
1035 ;;
1036 esac
1037
1038
1039
1040 # Option defaults:
1041 opt_debug=:
1042 opt_dry_run=false
1043 opt_config=false
1044 opt_preserve_dup_deps=false
1045 opt_features=false
1046 opt_finish=false
1047 opt_help=false
1048 opt_help_all=false
1049 opt_silent=:
1050 opt_warning=:
1051 opt_verbose=:
1052 opt_silent=false
1053 opt_verbose=false
1054
1055
1056 # Parse options once, thoroughly. This comes as soon as possible in the
1057 # script to make things like `--version' happen as quickly as we can.
1058 {
1059 # this just eases exit handling
1060 while test $# -gt 0; do
1061 opt="$1"
1062 shift
1063 case $opt in
1064 --debug|-x) opt_debug='set -x'
1065 func_echo "enabling shell trace mode"
1066 $opt_debug
1067 ;;
1068 --dry-run|--dryrun|-n)
1069 opt_dry_run=:
1070 ;;
1071 --config)
1072 opt_config=:
1073 func_config
1074 ;;
1075 --dlopen|-dlopen)
1076 optarg="$1"
1077 opt_dlopen="${opt_dlopen+$opt_dlopen
1078 }$optarg"
1079 shift
1080 ;;
1081 --preserve-dup-deps)
1082 opt_preserve_dup_deps=:
1083 ;;
1084 --features)
1085 opt_features=:
1086 func_features
1087 ;;
1088 --finish)
1089 opt_finish=:
1090 set dummy --mode finish ${1+"$@"}; shift
1091 ;;
1092 --help)
1093 opt_help=:
1094 ;;
1095 --help-all)
1096 opt_help_all=:
1097 opt_help=': help-all'
1098 ;;
1099 --mode)
1100 test $# = 0 && func_missing_arg $opt && break
1101 optarg="$1"
1102 opt_mode="$optarg"
1103 case $optarg in
1104 # Valid mode arguments:
1105 clean|compile|execute|finish|install|link|relink|uninstall) ;;
1106
1107 # Catch anything else as an error
1108 *) func_error "invalid argument for $opt"
1109 exit_cmd=exit
1110 break
1111 ;;
1112 esac
1113 shift
1114 ;;
1115 --no-silent|--no-quiet)
1116 opt_silent=false
1117 func_append preserve_args " $opt"
1118 ;;
1119 --no-warning|--no-warn)
1120 opt_warning=false
1121 func_append preserve_args " $opt"
1122 ;;
1123 --no-verbose)
1124 opt_verbose=false
1125 func_append preserve_args " $opt"
1126 ;;
1127 --silent|--quiet)
1128 opt_silent=:
1129 func_append preserve_args " $opt"
1130 opt_verbose=false
1131 ;;
1132 --verbose|-v)
1133 opt_verbose=:
1134 func_append preserve_args " $opt"
1135 opt_silent=false
1136 ;;
1137 --tag)
1138 test $# = 0 && func_missing_arg $opt && break
1139 optarg="$1"
1140 opt_tag="$optarg"
1141 func_append preserve_args " $opt $optarg"
1142 func_enable_tag "$optarg"
1143 shift
1144 ;;
1145
1146 -\?|-h) func_usage ;;
1147 --help) func_help ;;
1148 --version) func_version ;;
1149
1150 # Separate optargs to long options:
1151 --*=*)
1152 func_split_long_opt "$opt"
1153 set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"}
1154 shift
1155 ;;
1156
1157 # Separate non-argument short options:
1158 -\?*|-h*|-n*|-v*)
1159 func_split_short_opt "$opt"
1160 set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"}
1161 shift
1162 ;;
1163
1164 --) break ;;
1165 -*) func_fatal_help "unrecognized option \`$opt'" ;;
1166 *) set dummy "$opt" ${1+"$@"}; shift; break ;;
1167 esac
1168 done
1169
1170 # Validate options:
1171
1172 # save first non-option argument
1173 if test "$#" -gt 0; then
1174 nonopt="$opt"
1175 shift
1176 fi
1177
1178 # preserve --debug
1179 test "$opt_debug" = : || func_append preserve_args " --debug"
1180
1181 case $host in
1182 *cygwin* | *mingw* | *pw32* | *cegcc*)
1183 # don't eliminate duplications in $postdeps and $predeps
1184 opt_duplicate_compiler_generated_deps=:
1185 ;;
1186 *)
1187 opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
1188 ;;
1189 esac
1190
1191 $opt_help || {
1192 # Sanity checks first:
1193 func_check_version_match
1194
1195 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
1196 func_fatal_configuration "not configured to build any kind of library"
1197 fi
1198
1199 # Darwin sucks
1200 eval std_shrext=\"$shrext_cmds\"
1201
1202 # Only execute mode is allowed to have -dlopen flags.
1203 if test -n "$opt_dlopen" && test "$opt_mode" != execute; then
1204 func_error "unrecognized option \`-dlopen'"
1205 $ECHO "$help" 1>&2
1206 exit $EXIT_FAILURE
1207 fi
1208
1209 # Change the help message to a mode-specific one.
1210 generic_help="$help"
1211 help="Try \`$progname --help --mode=$opt_mode' for more information."
1212 }
1213
1214
1215 # Bail if the options were screwed
1216 $exit_cmd $EXIT_FAILURE
1217 }
1218
1219
1220
1221
1222 ## ----------- ##
1223 ## Main. ##
1224 ## ----------- ##
1225
1226 # func_lalib_p file
1227 # True iff FILE is a libtool `.la' library or `.lo' object file.
1228 # This function is only a basic sanity check; it will hardly flush out
1229 # determined imposters.
1230 func_lalib_p ()
1231 {
1232 test -f "$1" &&
1233 $SED -e 4q "$1" 2>/dev/null \
1234 | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
1235 }
1236
1237 # func_lalib_unsafe_p file
1238 # True iff FILE is a libtool `.la' library or `.lo' object file.
1239 # This function implements the same check as func_lalib_p without
1240 # resorting to external programs. To this end, it redirects stdin and
1241 # closes it afterwards, without saving the original file descriptor.
1242 # As a safety measure, use it only where a negative result would be
1243 # fatal anyway. Works if `file' does not exist.
1244 func_lalib_unsafe_p ()
1245 {
1246 lalib_p=no
1247 if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
1248 for lalib_p_l in 1 2 3 4
1249 do
1250 read lalib_p_line
1251 case "$lalib_p_line" in
1252 \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
1253 esac
1254 done
1255 exec 0<&5 5<&-
1256 fi
1257 test "$lalib_p" = yes
1258 }
1259
1260 # func_ltwrapper_script_p file
1261 # True iff FILE is a libtool wrapper script
1262 # This function is only a basic sanity check; it will hardly flush out
1263 # determined imposters.
1264 func_ltwrapper_script_p ()
1265 {
1266 func_lalib_p "$1"
1267 }
1268
1269 # func_ltwrapper_executable_p file
1270 # True iff FILE is a libtool wrapper executable
1271 # This function is only a basic sanity check; it will hardly flush out
1272 # determined imposters.
1273 func_ltwrapper_executable_p ()
1274 {
1275 func_ltwrapper_exec_suffix=
1276 case $1 in
1277 *.exe) ;;
1278 *) func_ltwrapper_exec_suffix=.exe ;;
1279 esac
1280 $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
1281 }
1282
1283 # func_ltwrapper_scriptname file
1284 # Assumes file is an ltwrapper_executable
1285 # uses $file to determine the appropriate filename for a
1286 # temporary ltwrapper_script.
1287 func_ltwrapper_scriptname ()
1288 {
1289 func_dirname_and_basename "$1" "" "."
1290 func_stripname '' '.exe' "$func_basename_result"
1291 func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
1292 }
1293
1294 # func_ltwrapper_p file
1295 # True iff FILE is a libtool wrapper script or wrapper executable
1296 # This function is only a basic sanity check; it will hardly flush out
1297 # determined imposters.
1298 func_ltwrapper_p ()
1299 {
1300 func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
1301 }
1302
1303
1304 # func_execute_cmds commands fail_cmd
1305 # Execute tilde-delimited COMMANDS.
1306 # If FAIL_CMD is given, eval that upon failure.
1307 # FAIL_CMD may read-access the current command in variable CMD!
1308 func_execute_cmds ()
1309 {
1310 $opt_debug
1311 save_ifs=$IFS; IFS='~'
1312 for cmd in $1; do
1313 IFS=$save_ifs
1314 eval cmd=\"$cmd\"
1315 func_show_eval "$cmd" "${2-:}"
1316 done
1317 IFS=$save_ifs
1318 }
1319
1320
1321 # func_source file
1322 # Source FILE, adding directory component if necessary.
1323 # Note that it is not necessary on cygwin/mingw to append a dot to
1324 # FILE even if both FILE and FILE.exe exist: automatic-append-.exe
1325 # behavior happens only for exec(3), not for open(2)! Also, sourcing
1326 # `FILE.' does not work on cygwin managed mounts.
1327 func_source ()
1328 {
1329 $opt_debug
1330 case $1 in
1331 */* | *\\*) . "$1" ;;
1332 *) . "./$1" ;;
1333 esac
1334 }
1335
1336
1337 # func_resolve_sysroot PATH
1338 # Replace a leading = in PATH with a sysroot. Store the result into
1339 # func_resolve_sysroot_result
1340 func_resolve_sysroot ()
1341 {
1342 func_resolve_sysroot_result=$1
1343 case $func_resolve_sysroot_result in
1344 =*)
1345 func_stripname '=' '' "$func_resolve_sysroot_result"
1346 func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
1347 ;;
1348 esac
1349 }
1350
1351 # func_replace_sysroot PATH
1352 # If PATH begins with the sysroot, replace it with = and
1353 # store the result into func_replace_sysroot_result.
1354 func_replace_sysroot ()
1355 {
1356 case "$lt_sysroot:$1" in
1357 ?*:"$lt_sysroot"*)
1358 func_stripname "$lt_sysroot" '' "$1"
1359 func_replace_sysroot_result="=$func_stripname_result"
1360 ;;
1361 *)
1362 # Including no sysroot.
1363 func_replace_sysroot_result=$1
1364 ;;
1365 esac
1366 }
1367
1368 # func_infer_tag arg
1369 # Infer tagged configuration to use if any are available and
1370 # if one wasn't chosen via the "--tag" command line option.
1371 # Only attempt this if the compiler in the base compile
1372 # command doesn't match the default compiler.
1373 # arg is usually of the form 'gcc ...'
1374 func_infer_tag ()
1375 {
1376 $opt_debug
1377 if test -n "$available_tags" && test -z "$tagname"; then
1378 CC_quoted=
1379 for arg in $CC; do
1380 func_append_quoted CC_quoted "$arg"
1381 done
1382 CC_expanded=`func_echo_all $CC`
1383 CC_quoted_expanded=`func_echo_all $CC_quoted`
1384 case $@ in
1385 # Blanks in the command may have been stripped by the calling shell,
1386 # but not from the CC environment variable when configure was run.
1387 " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
1388 " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;
1389 # Blanks at the start of $base_compile will cause this to fail
1390 # if we don't check for them as well.
1391 *)
1392 for z in $available_tags; do
1393 if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
1394 # Evaluate the configuration.
1395 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
1396 CC_quoted=
1397 for arg in $CC; do
1398 # Double-quote args containing other shell metacharacters.
1399 func_append_quoted CC_quoted "$arg"
1400 done
1401 CC_expanded=`func_echo_all $CC`
1402 CC_quoted_expanded=`func_echo_all $CC_quoted`
1403 case "$@ " in
1404 " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
1405 " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)
1406 # The compiler in the base compile command matches
1407 # the one in the tagged configuration.
1408 # Assume this is the tagged configuration we want.
1409 tagname=$z
1410 break
1411 ;;
1412 esac
1413 fi
1414 done
1415 # If $tagname still isn't set, then no tagged configuration
1416 # was found and let the user know that the "--tag" command
1417 # line option must be used.
1418 if test -z "$tagname"; then
1419 func_echo "unable to infer tagged configuration"
1420 func_fatal_error "specify a tag with \`--tag'"
1421 # else
1422 # func_verbose "using $tagname tagged configuration"
1423 fi
1424 ;;
1425 esac
1426 fi
1427 }
1428
1429
1430
1431 # func_write_libtool_object output_name pic_name nonpic_name
1432 # Create a libtool object file (analogous to a ".la" file),
1433 # but don't create it if we're doing a dry run.
1434 func_write_libtool_object ()
1435 {
1436 write_libobj=${1}
1437 if test "$build_libtool_libs" = yes; then
1438 write_lobj=\'${2}\'
1439 else
1440 write_lobj=none
1441 fi
1442
1443 if test "$build_old_libs" = yes; then
1444 write_oldobj=\'${3}\'
1445 else
1446 write_oldobj=none
1447 fi
1448
1449 $opt_dry_run || {
1450 cat >${write_libobj}T <<EOF
1451 # $write_libobj - a libtool object file
1452 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
1453 #
1454 # Please DO NOT delete this file!
1455 # It is necessary for linking the library.
1456
1457 # Name of the PIC object.
1458 pic_object=$write_lobj
1459
1460 # Name of the non-PIC object
1461 non_pic_object=$write_oldobj
1462
1463 EOF
1464 $MV "${write_libobj}T" "${write_libobj}"
1465 }
1466 }
1467
1468
1469 ##################################################
1470 # FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
1471 ##################################################
1472
1473 # func_convert_core_file_wine_to_w32 ARG
1474 # Helper function used by file name conversion functions when $build is *nix,
1475 # and $host is mingw, cygwin, or some other w32 environment. Relies on a
1476 # correctly configured wine environment available, with the winepath program
1477 # in $build's $PATH.
1478 #
1479 # ARG is the $build file name to be converted to w32 format.
1480 # Result is available in $func_convert_core_file_wine_to_w32_result, and will
1481 # be empty on error (or when ARG is empty)
1482 func_convert_core_file_wine_to_w32 ()
1483 {
1484 $opt_debug
1485 func_convert_core_file_wine_to_w32_result="$1"
1486 if test -n "$1"; then
1487 # Unfortunately, winepath does not exit with a non-zero error code, so we
1488 # are forced to check the contents of stdout. On the other hand, if the
1489 # command is not found, the shell will set an exit code of 127 and print
1490 # *an error message* to stdout. So we must check for both error code of
1491 # zero AND non-empty stdout, which explains the odd construction:
1492 func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
1493 if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then
1494 func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
1495 $SED -e "$lt_sed_naive_backslashify"`
1496 else
1497 func_convert_core_file_wine_to_w32_result=
1498 fi
1499 fi
1500 }
1501 # end: func_convert_core_file_wine_to_w32
1502
1503
1504 # func_convert_core_path_wine_to_w32 ARG
1505 # Helper function used by path conversion functions when $build is *nix, and
1506 # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
1507 # configured wine environment available, with the winepath program in $build's
1508 # $PATH. Assumes ARG has no leading or trailing path separator characters.
1509 #
1510 # ARG is path to be converted from $build format to win32.
1511 # Result is available in $func_convert_core_path_wine_to_w32_result.
1512 # Unconvertible file (directory) names in ARG are skipped; if no directory names
1513 # are convertible, then the result may be empty.
1514 func_convert_core_path_wine_to_w32 ()
1515 {
1516 $opt_debug
1517 # unfortunately, winepath doesn't convert paths, only file names
1518 func_convert_core_path_wine_to_w32_result=""
1519 if test -n "$1"; then
1520 oldIFS=$IFS
1521 IFS=:
1522 for func_convert_core_path_wine_to_w32_f in $1; do
1523 IFS=$oldIFS
1524 func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
1525 if test -n "$func_convert_core_file_wine_to_w32_result" ; then
1526 if test -z "$func_convert_core_path_wine_to_w32_result"; then
1527 func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result"
1528 else
1529 func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
1530 fi
1531 fi
1532 done
1533 IFS=$oldIFS
1534 fi
1535 }
1536 # end: func_convert_core_path_wine_to_w32
1537
1538
1539 # func_cygpath ARGS...
1540 # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
1541 # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
1542 # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
1543 # (2), returns the Cygwin file name or path in func_cygpath_result (input
1544 # file name or path is assumed to be in w32 format, as previously converted
1545 # from $build's *nix or MSYS format). In case (3), returns the w32 file name
1546 # or path in func_cygpath_result (input file name or path is assumed to be in
1547 # Cygwin format). Returns an empty string on error.
1548 #
1549 # ARGS are passed to cygpath, with the last one being the file name or path to
1550 # be converted.
1551 #
1552 # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
1553 # environment variable; do not put it in $PATH.
1554 func_cygpath ()
1555 {
1556 $opt_debug
1557 if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
1558 func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
1559 if test "$?" -ne 0; then
1560 # on failure, ensure result is empty
1561 func_cygpath_result=
1562 fi
1563 else
1564 func_cygpath_result=
1565 func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'"
1566 fi
1567 }
1568 #end: func_cygpath
1569
1570
1571 # func_convert_core_msys_to_w32 ARG
1572 # Convert file name or path ARG from MSYS format to w32 format. Return
1573 # result in func_convert_core_msys_to_w32_result.
1574 func_convert_core_msys_to_w32 ()
1575 {
1576 $opt_debug
1577 # awkward: cmd appends spaces to result
1578 func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
1579 $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
1580 }
1581 #end: func_convert_core_msys_to_w32
1582
1583
1584 # func_convert_file_check ARG1 ARG2
1585 # Verify that ARG1 (a file name in $build format) was converted to $host
1586 # format in ARG2. Otherwise, emit an error message, but continue (resetting
1587 # func_to_host_file_result to ARG1).
1588 func_convert_file_check ()
1589 {
1590 $opt_debug
1591 if test -z "$2" && test -n "$1" ; then
1592 func_error "Could not determine host file name corresponding to"
1593 func_error " \`$1'"
1594 func_error "Continuing, but uninstalled executables may not work."
1595 # Fallback:
1596 func_to_host_file_result="$1"
1597 fi
1598 }
1599 # end func_convert_file_check
1600
1601
1602 # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
1603 # Verify that FROM_PATH (a path in $build format) was converted to $host
1604 # format in TO_PATH. Otherwise, emit an error message, but continue, resetting
1605 # func_to_host_file_result to a simplistic fallback value (see below).
1606 func_convert_path_check ()
1607 {
1608 $opt_debug
1609 if test -z "$4" && test -n "$3"; then
1610 func_error "Could not determine the host path corresponding to"
1611 func_error " \`$3'"
1612 func_error "Continuing, but uninstalled executables may not work."
1613 # Fallback. This is a deliberately simplistic "conversion" and
1614 # should not be "improved". See libtool.info.
1615 if test "x$1" != "x$2"; then
1616 lt_replace_pathsep_chars="s|$1|$2|g"
1617 func_to_host_path_result=`echo "$3" |
1618 $SED -e "$lt_replace_pathsep_chars"`
1619 else
1620 func_to_host_path_result="$3"
1621 fi
1622 fi
1623 }
1624 # end func_convert_path_check
1625
1626
1627 # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
1628 # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
1629 # and appending REPL if ORIG matches BACKPAT.
1630 func_convert_path_front_back_pathsep ()
1631 {
1632 $opt_debug
1633 case $4 in
1634 $1 ) func_to_host_path_result="$3$func_to_host_path_result"
1635 ;;
1636 esac
1637 case $4 in
1638 $2 ) func_append func_to_host_path_result "$3"
1639 ;;
1640 esac
1641 }
1642 # end func_convert_path_front_back_pathsep
1643
1644
1645 ##################################################
1646 # $build to $host FILE NAME CONVERSION FUNCTIONS #
1647 ##################################################
1648 # invoked via `$to_host_file_cmd ARG'
1649 #
1650 # In each case, ARG is the path to be converted from $build to $host format.
1651 # Result will be available in $func_to_host_file_result.
1652
1653
1654 # func_to_host_file ARG
1655 # Converts the file name ARG from $build format to $host format. Return result
1656 # in func_to_host_file_result.
1657 func_to_host_file ()
1658 {
1659 $opt_debug
1660 $to_host_file_cmd "$1"
1661 }
1662 # end func_to_host_file
1663
1664
1665 # func_to_tool_file ARG LAZY
1666 # converts the file name ARG from $build format to toolchain format. Return
1667 # result in func_to_tool_file_result. If the conversion in use is listed
1668 # in (the comma separated) LAZY, no conversion takes place.
1669 func_to_tool_file ()
1670 {
1671 $opt_debug
1672 case ,$2, in
1673 *,"$to_tool_file_cmd",*)
1674 func_to_tool_file_result=$1
1675 ;;
1676 *)
1677 $to_tool_file_cmd "$1"
1678 func_to_tool_file_result=$func_to_host_file_result
1679 ;;
1680 esac
1681 }
1682 # end func_to_tool_file
1683
1684
1685 # func_convert_file_noop ARG
1686 # Copy ARG to func_to_host_file_result.
1687 func_convert_file_noop ()
1688 {
1689 func_to_host_file_result="$1"
1690 }
1691 # end func_convert_file_noop
1692
1693
1694 # func_convert_file_msys_to_w32 ARG
1695 # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
1696 # conversion to w32 is not available inside the cwrapper. Returns result in
1697 # func_to_host_file_result.
1698 func_convert_file_msys_to_w32 ()
1699 {
1700 $opt_debug
1701 func_to_host_file_result="$1"
1702 if test -n "$1"; then
1703 func_convert_core_msys_to_w32 "$1"
1704 func_to_host_file_result="$func_convert_core_msys_to_w32_result"
1705 fi
1706 func_convert_file_check "$1" "$func_to_host_file_result"
1707 }
1708 # end func_convert_file_msys_to_w32
1709
1710
1711 # func_convert_file_cygwin_to_w32 ARG
1712 # Convert file name ARG from Cygwin to w32 format. Returns result in
1713 # func_to_host_file_result.
1714 func_convert_file_cygwin_to_w32 ()
1715 {
1716 $opt_debug
1717 func_to_host_file_result="$1"
1718 if test -n "$1"; then
1719 # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
1720 # LT_CYGPATH in this case.
1721 func_to_host_file_result=`cygpath -m "$1"`
1722 fi
1723 func_convert_file_check "$1" "$func_to_host_file_result"
1724 }
1725 # end func_convert_file_cygwin_to_w32
1726
1727
1728 # func_convert_file_nix_to_w32 ARG
1729 # Convert file name ARG from *nix to w32 format. Requires a wine environment
1730 # and a working winepath. Returns result in func_to_host_file_result.
1731 func_convert_file_nix_to_w32 ()
1732 {
1733 $opt_debug
1734 func_to_host_file_result="$1"
1735 if test -n "$1"; then
1736 func_convert_core_file_wine_to_w32 "$1"
1737 func_to_host_file_result="$func_convert_core_file_wine_to_w32_result"
1738 fi
1739 func_convert_file_check "$1" "$func_to_host_file_result"
1740 }
1741 # end func_convert_file_nix_to_w32
1742
1743
1744 # func_convert_file_msys_to_cygwin ARG
1745 # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
1746 # Returns result in func_to_host_file_result.
1747 func_convert_file_msys_to_cygwin ()
1748 {
1749 $opt_debug
1750 func_to_host_file_result="$1"
1751 if test -n "$1"; then
1752 func_convert_core_msys_to_w32 "$1"
1753 func_cygpath -u "$func_convert_core_msys_to_w32_result"
1754 func_to_host_file_result="$func_cygpath_result"
1755 fi
1756 func_convert_file_check "$1" "$func_to_host_file_result"
1757 }
1758 # end func_convert_file_msys_to_cygwin
1759
1760
1761 # func_convert_file_nix_to_cygwin ARG
1762 # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed
1763 # in a wine environment, working winepath, and LT_CYGPATH set. Returns result
1764 # in func_to_host_file_result.
1765 func_convert_file_nix_to_cygwin ()
1766 {
1767 $opt_debug
1768 func_to_host_file_result="$1"
1769 if test -n "$1"; then
1770 # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
1771 func_convert_core_file_wine_to_w32 "$1"
1772 func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
1773 func_to_host_file_result="$func_cygpath_result"
1774 fi
1775 func_convert_file_check "$1" "$func_to_host_file_result"
1776 }
1777 # end func_convert_file_nix_to_cygwin
1778
1779
1780 #############################################
1781 # $build to $host PATH CONVERSION FUNCTIONS #
1782 #############################################
1783 # invoked via `$to_host_path_cmd ARG'
1784 #
1785 # In each case, ARG is the path to be converted from $build to $host format.
1786 # The result will be available in $func_to_host_path_result.
1787 #
1788 # Path separators are also converted from $build format to $host format. If
1789 # ARG begins or ends with a path separator character, it is preserved (but
1790 # converted to $host format) on output.
1791 #
1792 # All path conversion functions are named using the following convention:
1793 # file name conversion function : func_convert_file_X_to_Y ()
1794 # path conversion function : func_convert_path_X_to_Y ()
1795 # where, for any given $build/$host combination the 'X_to_Y' value is the
1796 # same. If conversion functions are added for new $build/$host combinations,
1797 # the two new functions must follow this pattern, or func_init_to_host_path_cmd
1798 # will break.
1799
1800
1801 # func_init_to_host_path_cmd
1802 # Ensures that function "pointer" variable $to_host_path_cmd is set to the
1803 # appropriate value, based on the value of $to_host_file_cmd.
1804 to_host_path_cmd=
1805 func_init_to_host_path_cmd ()
1806 {
1807 $opt_debug
1808 if test -z "$to_host_path_cmd"; then
1809 func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
1810 to_host_path_cmd="func_convert_path_${func_stripname_result}"
1811 fi
1812 }
1813
1814
1815 # func_to_host_path ARG
1816 # Converts the path ARG from $build format to $host format. Return result
1817 # in func_to_host_path_result.
1818 func_to_host_path ()
1819 {
1820 $opt_debug
1821 func_init_to_host_path_cmd
1822 $to_host_path_cmd "$1"
1823 }
1824 # end func_to_host_path
1825
1826
1827 # func_convert_path_noop ARG
1828 # Copy ARG to func_to_host_path_result.
1829 func_convert_path_noop ()
1830 {
1831 func_to_host_path_result="$1"
1832 }
1833 # end func_convert_path_noop
1834
1835
1836 # func_convert_path_msys_to_w32 ARG
1837 # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
1838 # conversion to w32 is not available inside the cwrapper. Returns result in
1839 # func_to_host_path_result.
1840 func_convert_path_msys_to_w32 ()
1841 {
1842 $opt_debug
1843 func_to_host_path_result="$1"
1844 if test -n "$1"; then
1845 # Remove leading and trailing path separator characters from ARG. MSYS
1846 # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
1847 # and winepath ignores them completely.
1848 func_stripname : : "$1"
1849 func_to_host_path_tmp1=$func_stripname_result
1850 func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
1851 func_to_host_path_result="$func_convert_core_msys_to_w32_result"
1852 func_convert_path_check : ";" \
1853 "$func_to_host_path_tmp1" "$func_to_host_path_result"
1854 func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
1855 fi
1856 }
1857 # end func_convert_path_msys_to_w32
1858
1859
1860 # func_convert_path_cygwin_to_w32 ARG
1861 # Convert path ARG from Cygwin to w32 format. Returns result in
1862 # func_to_host_file_result.
1863 func_convert_path_cygwin_to_w32 ()
1864 {
1865 $opt_debug
1866 func_to_host_path_result="$1"
1867 if test -n "$1"; then
1868 # See func_convert_path_msys_to_w32:
1869 func_stripname : : "$1"
1870 func_to_host_path_tmp1=$func_stripname_result
1871 func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
1872 func_convert_path_check : ";" \
1873 "$func_to_host_path_tmp1" "$func_to_host_path_result"
1874 func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
1875 fi
1876 }
1877 # end func_convert_path_cygwin_to_w32
1878
1879
1880 # func_convert_path_nix_to_w32 ARG
1881 # Convert path ARG from *nix to w32 format. Requires a wine environment and
1882 # a working winepath. Returns result in func_to_host_file_result.
1883 func_convert_path_nix_to_w32 ()
1884 {
1885 $opt_debug
1886 func_to_host_path_result="$1"
1887 if test -n "$1"; then
1888 # See func_convert_path_msys_to_w32:
1889 func_stripname : : "$1"
1890 func_to_host_path_tmp1=$func_stripname_result
1891 func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
1892 func_to_host_path_result="$func_convert_core_path_wine_to_w32_result"
1893 func_convert_path_check : ";" \
1894 "$func_to_host_path_tmp1" "$func_to_host_path_result"
1895 func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
1896 fi
1897 }
1898 # end func_convert_path_nix_to_w32
1899
1900
1901 # func_convert_path_msys_to_cygwin ARG
1902 # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
1903 # Returns result in func_to_host_file_result.
1904 func_convert_path_msys_to_cygwin ()
1905 {
1906 $opt_debug
1907 func_to_host_path_result="$1"
1908 if test -n "$1"; then
1909 # See func_convert_path_msys_to_w32:
1910 func_stripname : : "$1"
1911 func_to_host_path_tmp1=$func_stripname_result
1912 func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
1913 func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
1914 func_to_host_path_result="$func_cygpath_result"
1915 func_convert_path_check : : \
1916 "$func_to_host_path_tmp1" "$func_to_host_path_result"
1917 func_convert_path_front_back_pathsep ":*" "*:" : "$1"
1918 fi
1919 }
1920 # end func_convert_path_msys_to_cygwin
1921
1922
1923 # func_convert_path_nix_to_cygwin ARG
1924 # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a
1925 # a wine environment, working winepath, and LT_CYGPATH set. Returns result in
1926 # func_to_host_file_result.
1927 func_convert_path_nix_to_cygwin ()
1928 {
1929 $opt_debug
1930 func_to_host_path_result="$1"
1931 if test -n "$1"; then
1932 # Remove leading and trailing path separator characters from
1933 # ARG. msys behavior is inconsistent here, cygpath turns them
1934 # into '.;' and ';.', and winepath ignores them completely.
1935 func_stripname : : "$1"
1936 func_to_host_path_tmp1=$func_stripname_result
1937 func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
1938 func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
1939 func_to_host_path_result="$func_cygpath_result"
1940 func_convert_path_check : : \
1941 "$func_to_host_path_tmp1" "$func_to_host_path_result"
1942 func_convert_path_front_back_pathsep ":*" "*:" : "$1"
1943 fi
1944 }
1945 # end func_convert_path_nix_to_cygwin
1946
1947
1948 # func_mode_compile arg...
1949 func_mode_compile ()
1950 {
1951 $opt_debug
1952 # Get the compilation command and the source file.
1953 base_compile=
1954 srcfile="$nonopt" # always keep a non-empty value in "srcfile"
1955 suppress_opt=yes
1956 suppress_output=
1957 arg_mode=normal
1958 libobj=
1959 later=
1960 pie_flag=
1961
1962 for arg
1963 do
1964 case $arg_mode in
1965 arg )
1966 # do not "continue". Instead, add this to base_compile
1967 lastarg="$arg"
1968 arg_mode=normal
1969 ;;
1970
1971 target )
1972 libobj="$arg"
1973 arg_mode=normal
1974 continue
1975 ;;
1976
1977 normal )
1978 # Accept any command-line options.
1979 case $arg in
1980 -o)
1981 test -n "$libobj" && \
1982 func_fatal_error "you cannot specify \`-o' more than once"
1983 arg_mode=target
1984 continue
1985 ;;
1986
1987 -pie | -fpie | -fPIE)
1988 func_append pie_flag " $arg"
1989 continue
1990 ;;
1991
1992 -shared | -static | -prefer-pic | -prefer-non-pic)
1993 func_append later " $arg"
1994 continue
1995 ;;
1996
1997 -no-suppress)
1998 suppress_opt=no
1999 continue
2000 ;;
2001
2002 -Xcompiler)
2003 arg_mode=arg # the next one goes into the "base_compile" arg list
2004 continue # The current "srcfile" will either be retained or
2005 ;; # replaced later. I would guess that would be a bug.
2006
2007 -Wc,*)
2008 func_stripname '-Wc,' '' "$arg"
2009 args=$func_stripname_result
2010 lastarg=
2011 save_ifs="$IFS"; IFS=','
2012 for arg in $args; do
2013 IFS="$save_ifs"
2014 func_append_quoted lastarg "$arg"
2015 done
2016 IFS="$save_ifs"
2017 func_stripname ' ' '' "$lastarg"
2018 lastarg=$func_stripname_result
2019
2020 # Add the arguments to base_compile.
2021 func_append base_compile " $lastarg"
2022 continue
2023 ;;
2024
2025 *)
2026 # Accept the current argument as the source file.
2027 # The previous "srcfile" becomes the current argument.
2028 #
2029 lastarg="$srcfile"
2030 srcfile="$arg"
2031 ;;
2032 esac # case $arg
2033 ;;
2034 esac # case $arg_mode
2035
2036 # Aesthetically quote the previous argument.
2037 func_append_quoted base_compile "$lastarg"
2038 done # for arg
2039
2040 case $arg_mode in
2041 arg)
2042 func_fatal_error "you must specify an argument for -Xcompile"
2043 ;;
2044 target)
2045 func_fatal_error "you must specify a target with \`-o'"
2046 ;;
2047 *)
2048 # Get the name of the library object.
2049 test -z "$libobj" && {
2050 func_basename "$srcfile"
2051 libobj="$func_basename_result"
2052 }
2053 ;;
2054 esac
2055
2056 # Recognize several different file suffixes.
2057 # If the user specifies -o file.o, it is replaced with file.lo
2058 case $libobj in
2059 *.[cCFSifmso] | \
2060 *.ada | *.adb | *.ads | *.asm | \
2061 *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
2062 *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup)
2063 func_xform "$libobj"
2064 libobj=$func_xform_result
2065 ;;
2066 esac
2067
2068 case $libobj in
2069 *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
2070 *)
2071 func_fatal_error "cannot determine name of library object from \`$libobj'"
2072 ;;
2073 esac
2074
2075 func_infer_tag $base_compile
2076
2077 for arg in $later; do
2078 case $arg in
2079 -shared)
2080 test "$build_libtool_libs" != yes && \
2081 func_fatal_configuration "can not build a shared library"
2082 build_old_libs=no
2083 continue
2084 ;;
2085
2086 -static)
2087 build_libtool_libs=no
2088 build_old_libs=yes
2089 continue
2090 ;;
2091
2092 -prefer-pic)
2093 pic_mode=yes
2094 continue
2095 ;;
2096
2097 -prefer-non-pic)
2098 pic_mode=no
2099 continue
2100 ;;
2101 esac
2102 done
2103
2104 func_quote_for_eval "$libobj"
2105 test "X$libobj" != "X$func_quote_for_eval_result" \
2106 && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
2107 && func_warning "libobj name \`$libobj' may not contain shell special characters."
2108 func_dirname_and_basename "$obj" "/" ""
2109 objname="$func_basename_result"
2110 xdir="$func_dirname_result"
2111 lobj=${xdir}$objdir/$objname
2112
2113 test -z "$base_compile" && \
2114 func_fatal_help "you must specify a compilation command"
2115
2116 # Delete any leftover library objects.
2117 if test "$build_old_libs" = yes; then
2118 removelist="$obj $lobj $libobj ${libobj}T"
2119 else
2120 removelist="$lobj $libobj ${libobj}T"
2121 fi
2122
2123 # On Cygwin there's no "real" PIC flag so we must build both object types
2124 case $host_os in
2125 cygwin* | mingw* | pw32* | os2* | cegcc*)
2126 pic_mode=default
2127 ;;
2128 esac
2129 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
2130 # non-PIC code in shared libraries is not supported
2131 pic_mode=default
2132 fi
2133
2134 # Calculate the filename of the output object if compiler does
2135 # not support -o with -c
2136 if test "$compiler_c_o" = no; then
2137 output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext}
2138 lockfile="$output_obj.lock"
2139 else
2140 output_obj=
2141 need_locks=no
2142 lockfile=
2143 fi
2144
2145 # Lock this critical section if it is needed
2146 # We use this script file to make the link, it avoids creating a new file
2147 if test "$need_locks" = yes; then
2148 until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
2149 func_echo "Waiting for $lockfile to be removed"
2150 sleep 2
2151 done
2152 elif test "$need_locks" = warn; then
2153 if test -f "$lockfile"; then
2154 $ECHO "\
2155 *** ERROR, $lockfile exists and contains:
2156 `cat $lockfile 2>/dev/null`
2157
2158 This indicates that another process is trying to use the same
2159 temporary object file, and libtool could not work around it because
2160 your compiler does not support \`-c' and \`-o' together. If you
2161 repeat this compilation, it may succeed, by chance, but you had better
2162 avoid parallel builds (make -j) in this platform, or get a better
2163 compiler."
2164
2165 $opt_dry_run || $RM $removelist
2166 exit $EXIT_FAILURE
2167 fi
2168 func_append removelist " $output_obj"
2169 $ECHO "$srcfile" > "$lockfile"
2170 fi
2171
2172 $opt_dry_run || $RM $removelist
2173 func_append removelist " $lockfile"
2174 trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
2175
2176 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
2177 srcfile=$func_to_tool_file_result
2178 func_quote_for_eval "$srcfile"
2179 qsrcfile=$func_quote_for_eval_result
2180
2181 # Only build a PIC object if we are building libtool libraries.
2182 if test "$build_libtool_libs" = yes; then
2183 # Without this assignment, base_compile gets emptied.
2184 fbsd_hideous_sh_bug=$base_compile
2185
2186 if test "$pic_mode" != no; then
2187 command="$base_compile $qsrcfile $pic_flag"
2188 else
2189 # Don't build PIC code
2190 command="$base_compile $qsrcfile"
2191 fi
2192
2193 func_mkdir_p "$xdir$objdir"
2194
2195 if test -z "$output_obj"; then
2196 # Place PIC objects in $objdir
2197 func_append command " -o $lobj"
2198 fi
2199
2200 func_show_eval_locale "$command" \
2201 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
2202
2203 if test "$need_locks" = warn &&
2204 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
2205 $ECHO "\
2206 *** ERROR, $lockfile contains:
2207 `cat $lockfile 2>/dev/null`
2208
2209 but it should contain:
2210 $srcfile
2211
2212 This indicates that another process is trying to use the same
2213 temporary object file, and libtool could not work around it because
2214 your compiler does not support \`-c' and \`-o' together. If you
2215 repeat this compilation, it may succeed, by chance, but you had better
2216 avoid parallel builds (make -j) in this platform, or get a better
2217 compiler."
2218
2219 $opt_dry_run || $RM $removelist
2220 exit $EXIT_FAILURE
2221 fi
2222
2223 # Just move the object if needed, then go on to compile the next one
2224 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
2225 func_show_eval '$MV "$output_obj" "$lobj"' \
2226 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
2227 fi
2228
2229 # Allow error messages only from the first compilation.
2230 if test "$suppress_opt" = yes; then
2231 suppress_output=' >/dev/null 2>&1'
2232 fi
2233 fi
2234
2235 # Only build a position-dependent object if we build old libraries.
2236 if test "$build_old_libs" = yes; then
2237 if test "$pic_mode" != yes; then
2238 # Don't build PIC code
2239 command="$base_compile $qsrcfile$pie_flag"
2240 else
2241 command="$base_compile $qsrcfile $pic_flag"
2242 fi
2243 if test "$compiler_c_o" = yes; then
2244 func_append command " -o $obj"
2245 fi
2246
2247 # Suppress compiler output if we already did a PIC compilation.
2248 func_append command "$suppress_output"
2249 func_show_eval_locale "$command" \
2250 '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
2251
2252 if test "$need_locks" = warn &&
2253 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
2254 $ECHO "\
2255 *** ERROR, $lockfile contains:
2256 `cat $lockfile 2>/dev/null`
2257
2258 but it should contain:
2259 $srcfile
2260
2261 This indicates that another process is trying to use the same
2262 temporary object file, and libtool could not work around it because
2263 your compiler does not support \`-c' and \`-o' together. If you
2264 repeat this compilation, it may succeed, by chance, but you had better
2265 avoid parallel builds (make -j) in this platform, or get a better
2266 compiler."
2267
2268 $opt_dry_run || $RM $removelist
2269 exit $EXIT_FAILURE
2270 fi
2271
2272 # Just move the object if needed
2273 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
2274 func_show_eval '$MV "$output_obj" "$obj"' \
2275 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
2276 fi
2277 fi
2278
2279 $opt_dry_run || {
2280 func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
2281
2282 # Unlock the critical section if it was locked
2283 if test "$need_locks" != no; then
2284 removelist=$lockfile
2285 $RM "$lockfile"
2286 fi
2287 }
2288
2289 exit $EXIT_SUCCESS
2290 }
2291
2292 $opt_help || {
2293 test "$opt_mode" = compile && func_mode_compile ${1+"$@"}
2294 }
2295
2296 func_mode_help ()
2297 {
2298 # We need to display help for each of the modes.
2299 case $opt_mode in
2300 "")
2301 # Generic help is extracted from the usage comments
2302 # at the start of this file.
2303 func_help
2304 ;;
2305
2306 clean)
2307 $ECHO \
2308 "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
2309
2310 Remove files from the build directory.
2311
2312 RM is the name of the program to use to delete files associated with each FILE
2313 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
2314 to RM.
2315
2316 If FILE is a libtool library, object or program, all the files associated
2317 with it are deleted. Otherwise, only FILE itself is deleted using RM."
2318 ;;
2319
2320 compile)
2321 $ECHO \
2322 "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
2323
2324 Compile a source file into a libtool library object.
2325
2326 This mode accepts the following additional options:
2327
2328 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
2329 -no-suppress do not suppress compiler output for multiple passes
2330 -prefer-pic try to build PIC objects only
2331 -prefer-non-pic try to build non-PIC objects only
2332 -shared do not build a \`.o' file suitable for static linking
2333 -static only build a \`.o' file suitable for static linking
2334 -Wc,FLAG pass FLAG directly to the compiler
2335
2336 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
2337 from the given SOURCEFILE.
2338
2339 The output file name is determined by removing the directory component from
2340 SOURCEFILE, then substituting the C source code suffix \`.c' with the
2341 library object suffix, \`.lo'."
2342 ;;
2343
2344 execute)
2345 $ECHO \
2346 "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
2347
2348 Automatically set library path, then run a program.
2349
2350 This mode accepts the following additional options:
2351
2352 -dlopen FILE add the directory containing FILE to the library path
2353
2354 This mode sets the library path environment variable according to \`-dlopen'
2355 flags.
2356
2357 If any of the ARGS are libtool executable wrappers, then they are translated
2358 into their corresponding uninstalled binary, and any of their required library
2359 directories are added to the library path.
2360
2361 Then, COMMAND is executed, with ARGS as arguments."
2362 ;;
2363
2364 finish)
2365 $ECHO \
2366 "Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
2367
2368 Complete the installation of libtool libraries.
2369
2370 Each LIBDIR is a directory that contains libtool libraries.
2371
2372 The commands that this mode executes may require superuser privileges. Use
2373 the \`--dry-run' option if you just want to see what would be executed."
2374 ;;
2375
2376 install)
2377 $ECHO \
2378 "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
2379
2380 Install executables or libraries.
2381
2382 INSTALL-COMMAND is the installation command. The first component should be
2383 either the \`install' or \`cp' program.
2384
2385 The following components of INSTALL-COMMAND are treated specially:
2386
2387 -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation
2388
2389 The rest of the components are interpreted as arguments to that command (only
2390 BSD-compatible install options are recognized)."
2391 ;;
2392
2393 link)
2394 $ECHO \
2395 "Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
2396
2397 Link object files or libraries together to form another library, or to
2398 create an executable program.
2399
2400 LINK-COMMAND is a command using the C compiler that you would use to create
2401 a program from several object files.
2402
2403 The following components of LINK-COMMAND are treated specially:
2404
2405 -all-static do not do any dynamic linking at all
2406 -avoid-version do not add a version suffix if possible
2407 -bindir BINDIR specify path to binaries directory (for systems where
2408 libraries must be found in the PATH setting at runtime)
2409 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
2410 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
2411 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
2412 -export-symbols SYMFILE
2413 try to export only the symbols listed in SYMFILE
2414 -export-symbols-regex REGEX
2415 try to export only the symbols matching REGEX
2416 -LLIBDIR search LIBDIR for required installed libraries
2417 -lNAME OUTPUT-FILE requires the installed library libNAME
2418 -module build a library that can dlopened
2419 -no-fast-install disable the fast-install mode
2420 -no-install link a not-installable executable
2421 -no-undefined declare that a library does not refer to external symbols
2422 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
2423 -objectlist FILE Use a list of object files found in FILE to specify objects
2424 -precious-files-regex REGEX
2425 don't remove output files matching REGEX
2426 -release RELEASE specify package release information
2427 -rpath LIBDIR the created library will eventually be installed in LIBDIR
2428 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
2429 -shared only do dynamic linking of libtool libraries
2430 -shrext SUFFIX override the standard shared library file extension
2431 -static do not do any dynamic linking of uninstalled libtool libraries
2432 -static-libtool-libs
2433 do not do any dynamic linking of libtool libraries
2434 -version-info CURRENT[:REVISION[:AGE]]
2435 specify library version info [each variable defaults to 0]
2436 -weak LIBNAME declare that the target provides the LIBNAME interface
2437 -Wc,FLAG
2438 -Xcompiler FLAG pass linker-specific FLAG directly to the compiler
2439 -Wl,FLAG
2440 -Xlinker FLAG pass linker-specific FLAG directly to the linker
2441 -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC)
2442
2443 All other options (arguments beginning with \`-') are ignored.
2444
2445 Every other argument is treated as a filename. Files ending in \`.la' are
2446 treated as uninstalled libtool libraries, other files are standard or library
2447 object files.
2448
2449 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
2450 only library objects (\`.lo' files) may be specified, and \`-rpath' is
2451 required, except when creating a convenience library.
2452
2453 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
2454 using \`ar' and \`ranlib', or on Windows using \`lib'.
2455
2456 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
2457 is created, otherwise an executable program is created."
2458 ;;
2459
2460 uninstall)
2461 $ECHO \
2462 "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
2463
2464 Remove libraries from an installation directory.
2465
2466 RM is the name of the program to use to delete files associated with each FILE
2467 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
2468 to RM.
2469
2470 If FILE is a libtool library, all the files associated with it are deleted.
2471 Otherwise, only FILE itself is deleted using RM."
2472 ;;
2473
2474 *)
2475 func_fatal_help "invalid operation mode \`$opt_mode'"
2476 ;;
2477 esac
2478
2479 echo
2480 $ECHO "Try \`$progname --help' for more information about other modes."
2481 }
2482
2483 # Now that we've collected a possible --mode arg, show help if necessary
2484 if $opt_help; then
2485 if test "$opt_help" = :; then
2486 func_mode_help
2487 else
2488 {
2489 func_help noexit
2490 for opt_mode in compile link execute install finish uninstall clean; do
2491 func_mode_help
2492 done
2493 } | sed -n '1p; 2,$s/^Usage:/ or: /p'
2494 {
2495 func_help noexit
2496 for opt_mode in compile link execute install finish uninstall clean; do
2497 echo
2498 func_mode_help
2499 done
2500 } |
2501 sed '1d
2502 /^When reporting/,/^Report/{
2503 H
2504 d
2505 }
2506 $x
2507 /information about other modes/d
2508 /more detailed .*MODE/d
2509 s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
2510 fi
2511 exit $?
2512 fi
2513
2514
2515 # func_mode_execute arg...
2516 func_mode_execute ()
2517 {
2518 $opt_debug
2519 # The first argument is the command name.
2520 cmd="$nonopt"
2521 test -z "$cmd" && \
2522 func_fatal_help "you must specify a COMMAND"
2523
2524 # Handle -dlopen flags immediately.
2525 for file in $opt_dlopen; do
2526 test -f "$file" \
2527 || func_fatal_help "\`$file' is not a file"
2528
2529 dir=
2530 case $file in
2531 *.la)
2532 func_resolve_sysroot "$file"
2533 file=$func_resolve_sysroot_result
2534
2535 # Check to see that this really is a libtool archive.
2536 func_lalib_unsafe_p "$file" \
2537 || func_fatal_help "\`$lib' is not a valid libtool archive"
2538
2539 # Read the libtool library.
2540 dlname=
2541 library_names=
2542 func_source "$file"
2543
2544 # Skip this library if it cannot be dlopened.
2545 if test -z "$dlname"; then
2546 # Warn if it was a shared library.
2547 test -n "$library_names" && \
2548 func_warning "\`$file' was not linked with \`-export-dynamic'"
2549 continue
2550 fi
2551
2552 func_dirname "$file" "" "."
2553 dir="$func_dirname_result"
2554
2555 if test -f "$dir/$objdir/$dlname"; then
2556 func_append dir "/$objdir"
2557 else
2558 if test ! -f "$dir/$dlname"; then
2559 func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
2560 fi
2561 fi
2562 ;;
2563
2564 *.lo)
2565 # Just add the directory containing the .lo file.
2566 func_dirname "$file" "" "."
2567 dir="$func_dirname_result"
2568 ;;
2569
2570 *)
2571 func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
2572 continue
2573 ;;
2574 esac
2575
2576 # Get the absolute pathname.
2577 absdir=`cd "$dir" && pwd`
2578 test -n "$absdir" && dir="$absdir"
2579
2580 # Now add the directory to shlibpath_var.
2581 if eval "test -z \"\$$shlibpath_var\""; then
2582 eval "$shlibpath_var=\"\$dir\""
2583 else
2584 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
2585 fi
2586 done
2587
2588 # This variable tells wrapper scripts just to set shlibpath_var
2589 # rather than running their programs.
2590 libtool_execute_magic="$magic"
2591
2592 # Check if any of the arguments is a wrapper script.
2593 args=
2594 for file
2595 do
2596 case $file in
2597 -* | *.la | *.lo ) ;;
2598 *)
2599 # Do a test to see if this is really a libtool program.
2600 if func_ltwrapper_script_p "$file"; then
2601 func_source "$file"
2602 # Transform arg to wrapped name.
2603 file="$progdir/$program"
2604 elif func_ltwrapper_executable_p "$file"; then
2605 func_ltwrapper_scriptname "$file"
2606 func_source "$func_ltwrapper_scriptname_result"
2607 # Transform arg to wrapped name.
2608 file="$progdir/$program"
2609 fi
2610 ;;
2611 esac
2612 # Quote arguments (to preserve shell metacharacters).
2613 func_append_quoted args "$file"
2614 done
2615
2616 if test "X$opt_dry_run" = Xfalse; then
2617 if test -n "$shlibpath_var"; then
2618 # Export the shlibpath_var.
2619 eval "export $shlibpath_var"
2620 fi
2621
2622 # Restore saved environment variables
2623 for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
2624 do
2625 eval "if test \"\${save_$lt_var+set}\" = set; then
2626 $lt_var=\$save_$lt_var; export $lt_var
2627 else
2628 $lt_unset $lt_var
2629 fi"
2630 done
2631
2632 # Now prepare to actually exec the command.
2633 exec_cmd="\$cmd$args"
2634 else
2635 # Display what would be done.
2636 if test -n "$shlibpath_var"; then
2637 eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
2638 echo "export $shlibpath_var"
2639 fi
2640 $ECHO "$cmd$args"
2641 exit $EXIT_SUCCESS
2642 fi
2643 }
2644
2645 test "$opt_mode" = execute && func_mode_execute ${1+"$@"}
2646
2647
2648 # func_mode_finish arg...
2649 func_mode_finish ()
2650 {
2651 $opt_debug
2652 libs=
2653 libdirs=
2654 admincmds=
2655
2656 for opt in "$nonopt" ${1+"$@"}
2657 do
2658 if test -d "$opt"; then
2659 func_append libdirs " $opt"
2660
2661 elif test -f "$opt"; then
2662 if func_lalib_unsafe_p "$opt"; then
2663 func_append libs " $opt"
2664 else
2665 func_warning "\`$opt' is not a valid libtool archive"
2666 fi
2667
2668 else
2669 func_fatal_error "invalid argument \`$opt'"
2670 fi
2671 done
2672
2673 if test -n "$libs"; then
2674 if test -n "$lt_sysroot"; then
2675 sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`
2676 sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"
2677 else
2678 sysroot_cmd=
2679 fi
2680
2681 # Remove sysroot references
2682 if $opt_dry_run; then
2683 for lib in $libs; do
2684 echo "removing references to $lt_sysroot and \`=' prefixes from $lib"
2685 done
2686 else
2687 tmpdir=`func_mktempdir`
2688 for lib in $libs; do
2689 sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
2690 > $tmpdir/tmp-la
2691 mv -f $tmpdir/tmp-la $lib
2692 done
2693 ${RM}r "$tmpdir"
2694 fi
2695 fi
2696
2697 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
2698 for libdir in $libdirs; do
2699 if test -n "$finish_cmds"; then
2700 # Do each command in the finish commands.
2701 func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
2702 '"$cmd"'"'
2703 fi
2704 if test -n "$finish_eval"; then
2705 # Do the single finish_eval.
2706 eval cmds=\"$finish_eval\"
2707 $opt_dry_run || eval "$cmds" || func_append admincmds "
2708 $cmds"
2709 fi
2710 done
2711 fi
2712
2713 # Exit here if they wanted silent mode.
2714 $opt_silent && exit $EXIT_SUCCESS
2715
2716 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
2717 echo "----------------------------------------------------------------------"
2718 echo "Libraries have been installed in:"
2719 for libdir in $libdirs; do
2720 $ECHO " $libdir"
2721 done
2722 echo
2723 echo "If you ever happen to want to link against installed libraries"
2724 echo "in a given directory, LIBDIR, you must either use libtool, and"
2725 echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
2726 echo "flag during linking and do at least one of the following:"
2727 if test -n "$shlibpath_var"; then
2728 echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
2729 echo " during execution"
2730 fi
2731 if test -n "$runpath_var"; then
2732 echo " - add LIBDIR to the \`$runpath_var' environment variable"
2733 echo " during linking"
2734 fi
2735 if test -n "$hardcode_libdir_flag_spec"; then
2736 libdir=LIBDIR
2737 eval flag=\"$hardcode_libdir_flag_spec\"
2738
2739 $ECHO " - use the \`$flag' linker flag"
2740 fi
2741 if test -n "$admincmds"; then
2742 $ECHO " - have your system administrator run these commands:$admincmds"
2743 fi
2744 if test -f /etc/ld.so.conf; then
2745 echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
2746 fi
2747 echo
2748
2749 echo "See any operating system documentation about shared libraries for"
2750 case $host in
2751 solaris2.[6789]|solaris2.1[0-9])
2752 echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
2753 echo "pages."
2754 ;;
2755 *)
2756 echo "more information, such as the ld(1) and ld.so(8) manual pages."
2757 ;;
2758 esac
2759 echo "----------------------------------------------------------------------"
2760 fi
2761 exit $EXIT_SUCCESS
2762 }
2763
2764 test "$opt_mode" = finish && func_mode_finish ${1+"$@"}
2765
2766
2767 # func_mode_install arg...
2768 func_mode_install ()
2769 {
2770 $opt_debug
2771 # There may be an optional sh(1) argument at the beginning of
2772 # install_prog (especially on Windows NT).
2773 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
2774 # Allow the use of GNU shtool's install command.
2775 case $nonopt in *shtool*) :;; *) false;; esac; then
2776 # Aesthetically quote it.
2777 func_quote_for_eval "$nonopt"
2778 install_prog="$func_quote_for_eval_result "
2779 arg=$1
2780 shift
2781 else
2782 install_prog=
2783 arg=$nonopt
2784 fi
2785
2786 # The real first argument should be the name of the installation program.
2787 # Aesthetically quote it.
2788 func_quote_for_eval "$arg"
2789 func_append install_prog "$func_quote_for_eval_result"
2790 install_shared_prog=$install_prog
2791 case " $install_prog " in
2792 *[\\\ /]cp\ *) install_cp=: ;;
2793 *) install_cp=false ;;
2794 esac
2795
2796 # We need to accept at least all the BSD install flags.
2797 dest=
2798 files=
2799 opts=
2800 prev=
2801 install_type=
2802 isdir=no
2803 stripme=
2804 no_mode=:
2805 for arg
2806 do
2807 arg2=
2808 if test -n "$dest"; then
2809 func_append files " $dest"
2810 dest=$arg
2811 continue
2812 fi
2813
2814 case $arg in
2815 -d) isdir=yes ;;
2816 -f)
2817 if $install_cp; then :; else
2818 prev=$arg
2819 fi
2820 ;;
2821 -g | -m | -o)
2822 prev=$arg
2823 ;;
2824 -s)
2825 stripme=" -s"
2826 continue
2827 ;;
2828 -*)
2829 ;;
2830 *)
2831 # If the previous option needed an argument, then skip it.
2832 if test -n "$prev"; then
2833 if test "x$prev" = x-m && test -n "$install_override_mode"; then
2834 arg2=$install_override_mode
2835 no_mode=false
2836 fi
2837 prev=
2838 else
2839 dest=$arg
2840 continue
2841 fi
2842 ;;
2843 esac
2844
2845 # Aesthetically quote the argument.
2846 func_quote_for_eval "$arg"
2847 func_append install_prog " $func_quote_for_eval_result"
2848 if test -n "$arg2"; then
2849 func_quote_for_eval "$arg2"
2850 fi
2851 func_append install_shared_prog " $func_quote_for_eval_result"
2852 done
2853
2854 test -z "$install_prog" && \
2855 func_fatal_help "you must specify an install program"
2856
2857 test -n "$prev" && \
2858 func_fatal_help "the \`$prev' option requires an argument"
2859
2860 if test -n "$install_override_mode" && $no_mode; then
2861 if $install_cp; then :; else
2862 func_quote_for_eval "$install_override_mode"
2863 func_append install_shared_prog " -m $func_quote_for_eval_result"
2864 fi
2865 fi
2866
2867 if test -z "$files"; then
2868 if test -z "$dest"; then
2869 func_fatal_help "no file or destination specified"
2870 else
2871 func_fatal_help "you must specify a destination"
2872 fi
2873 fi
2874
2875 # Strip any trailing slash from the destination.
2876 func_stripname '' '/' "$dest"
2877 dest=$func_stripname_result
2878
2879 # Check to see that the destination is a directory.
2880 test -d "$dest" && isdir=yes
2881 if test "$isdir" = yes; then
2882 destdir="$dest"
2883 destname=
2884 else
2885 func_dirname_and_basename "$dest" "" "."
2886 destdir="$func_dirname_result"
2887 destname="$func_basename_result"
2888
2889 # Not a directory, so check to see that there is only one file specified.
2890 set dummy $files; shift
2891 test "$#" -gt 1 && \
2892 func_fatal_help "\`$dest' is not a directory"
2893 fi
2894 case $destdir in
2895 [\\/]* | [A-Za-z]:[\\/]*) ;;
2896 *)
2897 for file in $files; do
2898 case $file in
2899 *.lo) ;;
2900 *)
2901 func_fatal_help "\`$destdir' must be an absolute directory name"
2902 ;;
2903 esac
2904 done
2905 ;;
2906 esac
2907
2908 # This variable tells wrapper scripts just to set variables rather
2909 # than running their programs.
2910 libtool_install_magic="$magic"
2911
2912 staticlibs=
2913 future_libdirs=
2914 current_libdirs=
2915 for file in $files; do
2916
2917 # Do each installation.
2918 case $file in
2919 *.$libext)
2920 # Do the static libraries later.
2921 func_append staticlibs " $file"
2922 ;;
2923
2924 *.la)
2925 func_resolve_sysroot "$file"
2926 file=$func_resolve_sysroot_result
2927
2928 # Check to see that this really is a libtool archive.
2929 func_lalib_unsafe_p "$file" \
2930 || func_fatal_help "\`$file' is not a valid libtool archive"
2931
2932 library_names=
2933 old_library=
2934 relink_command=
2935 func_source "$file"
2936
2937 # Add the libdir to current_libdirs if it is the destination.
2938 if test "X$destdir" = "X$libdir"; then
2939 case "$current_libdirs " in
2940 *" $libdir "*) ;;
2941 *) func_append current_libdirs " $libdir" ;;
2942 esac
2943 else
2944 # Note the libdir as a future libdir.
2945 case "$future_libdirs " in
2946 *" $libdir "*) ;;
2947 *) func_append future_libdirs " $libdir" ;;
2948 esac
2949 fi
2950
2951 func_dirname "$file" "/" ""
2952 dir="$func_dirname_result"
2953 func_append dir "$objdir"
2954
2955 if test -n "$relink_command"; then
2956 # Determine the prefix the user has applied to our future dir.
2957 inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
2958
2959 # Don't allow the user to place us outside of our expected
2960 # location b/c this prevents finding dependent libraries that
2961 # are installed to the same prefix.
2962 # At present, this check doesn't affect windows .dll's that
2963 # are installed into $libdir/../bin (currently, that works fine)
2964 # but it's something to keep an eye on.
2965 test "$inst_prefix_dir" = "$destdir" && \
2966 func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
2967
2968 if test -n "$inst_prefix_dir"; then
2969 # Stick the inst_prefix_dir data into the link command.
2970 relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
2971 else
2972 relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
2973 fi
2974
2975 func_warning "relinking \`$file'"
2976 func_show_eval "$relink_command" \
2977 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
2978 fi
2979
2980 # See the names of the shared library.
2981 set dummy $library_names; shift
2982 if test -n "$1"; then
2983 realname="$1"
2984 shift
2985
2986 srcname="$realname"
2987 test -n "$relink_command" && srcname="$realname"T
2988
2989 # Install the shared library and build the symlinks.
2990 func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
2991 'exit $?'
2992 tstripme="$stripme"
2993 case $host_os in
2994 cygwin* | mingw* | pw32* | cegcc*)
2995 case $realname in
2996 *.dll.a)
2997 tstripme=""
2998 ;;
2999 esac
3000 ;;
3001 esac
3002 if test -n "$tstripme" && test -n "$striplib"; then
3003 func_show_eval "$striplib $destdir/$realname" 'exit $?'
3004 fi
3005
3006 if test "$#" -gt 0; then
3007 # Delete the old symlinks, and create new ones.
3008 # Try `ln -sf' first, because the `ln' binary might depend on
3009 # the symlink we replace! Solaris /bin/ln does not understand -f,
3010 # so we also need to try rm && ln -s.
3011 for linkname
3012 do
3013 test "$linkname" != "$realname" \
3014 && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
3015 done
3016 fi
3017
3018 # Do each command in the postinstall commands.
3019 lib="$destdir/$realname"
3020 func_execute_cmds "$postinstall_cmds" 'exit $?'
3021 fi
3022
3023 # Install the pseudo-library for information purposes.
3024 func_basename "$file"
3025 name="$func_basename_result"
3026 instname="$dir/$name"i
3027 func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
3028
3029 # Maybe install the static library, too.
3030 test -n "$old_library" && func_append staticlibs " $dir/$old_library"
3031 ;;
3032
3033 *.lo)
3034 # Install (i.e. copy) a libtool object.
3035
3036 # Figure out destination file name, if it wasn't already specified.
3037 if test -n "$destname"; then
3038 destfile="$destdir/$destname"
3039 else
3040 func_basename "$file"
3041 destfile="$func_basename_result"
3042 destfile="$destdir/$destfile"
3043 fi
3044
3045 # Deduce the name of the destination old-style object file.
3046 case $destfile in
3047 *.lo)
3048 func_lo2o "$destfile"
3049 staticdest=$func_lo2o_result
3050 ;;
3051 *.$objext)
3052 staticdest="$destfile"
3053 destfile=
3054 ;;
3055 *)
3056 func_fatal_help "cannot copy a libtool object to \`$destfile'"
3057 ;;
3058 esac
3059
3060 # Install the libtool object if requested.
3061 test -n "$destfile" && \
3062 func_show_eval "$install_prog $file $destfile" 'exit $?'
3063
3064 # Install the old object if enabled.
3065 if test "$build_old_libs" = yes; then
3066 # Deduce the name of the old-style object file.
3067 func_lo2o "$file"
3068 staticobj=$func_lo2o_result
3069 func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
3070 fi
3071 exit $EXIT_SUCCESS
3072 ;;
3073
3074 *)
3075 # Figure out destination file name, if it wasn't already specified.
3076 if test -n "$destname"; then
3077 destfile="$destdir/$destname"
3078 else
3079 func_basename "$file"
3080 destfile="$func_basename_result"
3081 destfile="$destdir/$destfile"
3082 fi
3083
3084 # If the file is missing, and there is a .exe on the end, strip it
3085 # because it is most likely a libtool script we actually want to
3086 # install
3087 stripped_ext=""
3088 case $file in
3089 *.exe)
3090 if test ! -f "$file"; then
3091 func_stripname '' '.exe' "$file"
3092 file=$func_stripname_result
3093 stripped_ext=".exe"
3094 fi
3095 ;;
3096 esac
3097
3098 # Do a test to see if this is really a libtool program.
3099 case $host in
3100 *cygwin* | *mingw*)
3101 if func_ltwrapper_executable_p "$file"; then
3102 func_ltwrapper_scriptname "$file"
3103 wrapper=$func_ltwrapper_scriptname_result
3104 else
3105 func_stripname '' '.exe' "$file"
3106 wrapper=$func_stripname_result
3107 fi
3108 ;;
3109 *)
3110 wrapper=$file
3111 ;;
3112 esac
3113 if func_ltwrapper_script_p "$wrapper"; then
3114 notinst_deplibs=
3115 relink_command=
3116
3117 func_source "$wrapper"
3118
3119 # Check the variables that should have been set.
3120 test -z "$generated_by_libtool_version" && \
3121 func_fatal_error "invalid libtool wrapper script \`$wrapper'"
3122
3123 finalize=yes
3124 for lib in $notinst_deplibs; do
3125 # Check to see that each library is installed.
3126 libdir=
3127 if test -f "$lib"; then
3128 func_source "$lib"
3129 fi
3130 libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test
3131 if test -n "$libdir" && test ! -f "$libfile"; then
3132 func_warning "\`$lib' has not been installed in \`$libdir'"
3133 finalize=no
3134 fi
3135 done
3136
3137 relink_command=
3138 func_source "$wrapper"
3139
3140 outputname=
3141 if test "$fast_install" = no && test -n "$relink_command"; then
3142 $opt_dry_run || {
3143 if test "$finalize" = yes; then
3144 tmpdir=`func_mktempdir`
3145 func_basename "$file$stripped_ext"
3146 file="$func_basename_result"
3147 outputname="$tmpdir/$file"
3148 # Replace the output file specification.
3149 relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
3150
3151 $opt_silent || {
3152 func_quote_for_expand "$relink_command"
3153 eval "func_echo $func_quote_for_expand_result"
3154 }
3155 if eval "$relink_command"; then :
3156 else
3157 func_error "error: relink \`$file' with the above command before installing it"
3158 $opt_dry_run || ${RM}r "$tmpdir"
3159 continue
3160 fi
3161 file="$outputname"
3162 else
3163 func_warning "cannot relink \`$file'"
3164 fi
3165 }
3166 else
3167 # Install the binary that we compiled earlier.
3168 file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`
3169 fi
3170 fi
3171
3172 # remove .exe since cygwin /usr/bin/install will append another
3173 # one anyway
3174 case $install_prog,$host in
3175 */usr/bin/install*,*cygwin*)
3176 case $file:$destfile in
3177 *.exe:*.exe)
3178 # this is ok
3179 ;;
3180 *.exe:*)
3181 destfile=$destfile.exe
3182 ;;
3183 *:*.exe)
3184 func_stripname '' '.exe' "$destfile"
3185 destfile=$func_stripname_result
3186 ;;
3187 esac
3188 ;;
3189 esac
3190 func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
3191 $opt_dry_run || if test -n "$outputname"; then
3192 ${RM}r "$tmpdir"
3193 fi
3194 ;;
3195 esac
3196 done
3197
3198 for file in $staticlibs; do
3199 func_basename "$file"
3200 name="$func_basename_result"
3201
3202 # Set up the ranlib parameters.
3203 oldlib="$destdir/$name"
3204 func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
3205 tool_oldlib=$func_to_tool_file_result
3206
3207 func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
3208
3209 if test -n "$stripme" && test -n "$old_striplib"; then
3210 func_show_eval "$old_striplib $tool_oldlib" 'exit $?'
3211 fi
3212
3213 # Do each command in the postinstall commands.
3214 func_execute_cmds "$old_postinstall_cmds" 'exit $?'
3215 done
3216
3217 test -n "$future_libdirs" && \
3218 func_warning "remember to run \`$progname --finish$future_libdirs'"
3219
3220 if test -n "$current_libdirs"; then
3221 # Maybe just do a dry run.
3222 $opt_dry_run && current_libdirs=" -n$current_libdirs"
3223 exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
3224 else
3225 exit $EXIT_SUCCESS
3226 fi
3227 }
3228
3229 test "$opt_mode" = install && func_mode_install ${1+"$@"}
3230
3231
3232 # func_generate_dlsyms outputname originator pic_p
3233 # Extract symbols from dlprefiles and create ${outputname}S.o with
3234 # a dlpreopen symbol table.
3235 func_generate_dlsyms ()
3236 {
3237 $opt_debug
3238 my_outputname="$1"
3239 my_originator="$2"
3240 my_pic_p="${3-no}"
3241 my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
3242 my_dlsyms=
3243
3244 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3245 if test -n "$NM" && test -n "$global_symbol_pipe"; then
3246 my_dlsyms="${my_outputname}S.c"
3247 else
3248 func_error "not configured to extract global symbols from dlpreopened files"
3249 fi
3250 fi
3251
3252 if test -n "$my_dlsyms"; then
3253 case $my_dlsyms in
3254 "") ;;
3255 *.c)
3256 # Discover the nlist of each of the dlfiles.
3257 nlist="$output_objdir/${my_outputname}.nm"
3258
3259 func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
3260
3261 # Parse the name list into a source file.
3262 func_verbose "creating $output_objdir/$my_dlsyms"
3263
3264 $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
3265 /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
3266 /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
3267
3268 #ifdef __cplusplus
3269 extern \"C\" {
3270 #endif
3271
3272 #if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
3273 #pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
3274 #endif
3275
3276 /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
3277 #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
3278 /* DATA imports from DLLs on WIN32 con't be const, because runtime
3279 relocations are performed -- see ld's documentation on pseudo-relocs. */
3280 # define LT_DLSYM_CONST
3281 #elif defined(__osf__)
3282 /* This system does not cope well with relocations in const data. */
3283 # define LT_DLSYM_CONST
3284 #else
3285 # define LT_DLSYM_CONST const
3286 #endif
3287
3288 /* External symbol declarations for the compiler. */\
3289 "
3290
3291 if test "$dlself" = yes; then
3292 func_verbose "generating symbol list for \`$output'"
3293
3294 $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
3295
3296 # Add our own program objects to the symbol list.
3297 progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
3298 for progfile in $progfiles; do
3299 func_to_tool_file "$progfile" func_convert_file_msys_to_w32
3300 func_verbose "extracting global C symbols from \`$func_to_tool_file_result'"
3301 $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
3302 done
3303
3304 if test -n "$exclude_expsyms"; then
3305 $opt_dry_run || {
3306 eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
3307 eval '$MV "$nlist"T "$nlist"'
3308 }
3309 fi
3310
3311 if test -n "$export_symbols_regex"; then
3312 $opt_dry_run || {
3313 eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
3314 eval '$MV "$nlist"T "$nlist"'
3315 }
3316 fi
3317
3318 # Prepare the list of exported symbols
3319 if test -z "$export_symbols"; then
3320 export_symbols="$output_objdir/$outputname.exp"
3321 $opt_dry_run || {
3322 $RM $export_symbols
3323 eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
3324 case $host in
3325 *cygwin* | *mingw* | *cegcc* )
3326 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
3327 eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
3328 ;;
3329 esac
3330 }
3331 else
3332 $opt_dry_run || {
3333 eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
3334 eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
3335 eval '$MV "$nlist"T "$nlist"'
3336 case $host in
3337 *cygwin* | *mingw* | *cegcc* )
3338 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
3339 eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
3340 ;;
3341 esac
3342 }
3343 fi
3344 fi
3345
3346 for dlprefile in $dlprefiles; do
3347 func_verbose "extracting global C symbols from \`$dlprefile'"
3348 func_basename "$dlprefile"
3349 name="$func_basename_result"
3350 case $host in
3351 *cygwin* | *mingw* | *cegcc* )
3352 # if an import library, we need to obtain dlname
3353 if func_win32_import_lib_p "$dlprefile"; then
3354 func_tr_sh "$dlprefile"
3355 eval "curr_lafile=\$libfile_$func_tr_sh_result"
3356 dlprefile_dlbasename=""
3357 if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
3358 # Use subshell, to avoid clobbering current variable values
3359 dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
3360 if test -n "$dlprefile_dlname" ; then
3361 func_basename "$dlprefile_dlname"
3362 dlprefile_dlbasename="$func_basename_result"
3363 else
3364 # no lafile. user explicitly requested -dlpreopen <import library>.
3365 $sharedlib_from_linklib_cmd "$dlprefile"
3366 dlprefile_dlbasename=$sharedlib_from_linklib_result
3367 fi
3368 fi
3369 $opt_dry_run || {
3370 if test -n "$dlprefile_dlbasename" ; then
3371 eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
3372 else
3373 func_warning "Could not compute DLL name from $name"
3374 eval '$ECHO ": $name " >> "$nlist"'
3375 fi
3376 func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
3377 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
3378 $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
3379 }
3380 else # not an import lib
3381 $opt_dry_run || {
3382 eval '$ECHO ": $name " >> "$nlist"'
3383 func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
3384 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
3385 }
3386 fi
3387 ;;
3388 *)
3389 $opt_dry_run || {
3390 eval '$ECHO ": $name " >> "$nlist"'
3391 func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
3392 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
3393 }
3394 ;;
3395 esac
3396 done
3397
3398 $opt_dry_run || {
3399 # Make sure we have at least an empty file.
3400 test -f "$nlist" || : > "$nlist"
3401
3402 if test -n "$exclude_expsyms"; then
3403 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
3404 $MV "$nlist"T "$nlist"
3405 fi
3406
3407 # Try sorting and uniquifying the output.
3408 if $GREP -v "^: " < "$nlist" |
3409 if sort -k 3 </dev/null >/dev/null 2>&1; then
3410 sort -k 3
3411 else
3412 sort +2
3413 fi |
3414 uniq > "$nlist"S; then
3415 :
3416 else
3417 $GREP -v "^: " < "$nlist" > "$nlist"S
3418 fi
3419
3420 if test -f "$nlist"S; then
3421 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
3422 else
3423 echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
3424 fi
3425
3426 echo >> "$output_objdir/$my_dlsyms" "\
3427
3428 /* The mapping between symbol names and symbols. */
3429 typedef struct {
3430 const char *name;
3431 void *address;
3432 } lt_dlsymlist;
3433 extern LT_DLSYM_CONST lt_dlsymlist
3434 lt_${my_prefix}_LTX_preloaded_symbols[];
3435 LT_DLSYM_CONST lt_dlsymlist
3436 lt_${my_prefix}_LTX_preloaded_symbols[] =
3437 {\
3438 { \"$my_originator\", (void *) 0 },"
3439
3440 case $need_lib_prefix in
3441 no)
3442 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
3443 ;;
3444 *)
3445 eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
3446 ;;
3447 esac
3448 echo >> "$output_objdir/$my_dlsyms" "\
3449 {0, (void *) 0}
3450 };
3451
3452 /* This works around a problem in FreeBSD linker */
3453 #ifdef FREEBSD_WORKAROUND
3454 static const void *lt_preloaded_setup() {
3455 return lt_${my_prefix}_LTX_preloaded_symbols;
3456 }
3457 #endif
3458
3459 #ifdef __cplusplus
3460 }
3461 #endif\
3462 "
3463 } # !$opt_dry_run
3464
3465 pic_flag_for_symtable=
3466 case "$compile_command " in
3467 *" -static "*) ;;
3468 *)
3469 case $host in
3470 # compiling the symbol table file with pic_flag works around
3471 # a FreeBSD bug that causes programs to crash when -lm is
3472 # linked before any other PIC object. But we must not use
3473 # pic_flag when linking with -static. The problem exists in
3474 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
3475 *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
3476 pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
3477 *-*-hpux*)
3478 pic_flag_for_symtable=" $pic_flag" ;;
3479 *)
3480 if test "X$my_pic_p" != Xno; then
3481 pic_flag_for_symtable=" $pic_flag"
3482 fi
3483 ;;
3484 esac
3485 ;;
3486 esac
3487 symtab_cflags=
3488 for arg in $LTCFLAGS; do
3489 case $arg in
3490 -pie | -fpie | -fPIE) ;;
3491 *) func_append symtab_cflags " $arg" ;;
3492 esac
3493 done
3494
3495 # Now compile the dynamic symbol file.
3496 func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
3497
3498 # Clean up the generated files.
3499 func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
3500
3501 # Transform the symbol file into the correct name.
3502 symfileobj="$output_objdir/${my_outputname}S.$objext"
3503 case $host in
3504 *cygwin* | *mingw* | *cegcc* )
3505 if test -f "$output_objdir/$my_outputname.def"; then
3506 compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
3507 finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
3508 else
3509 compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
3510 finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
3511 fi
3512 ;;
3513 *)
3514 compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
3515 finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
3516 ;;
3517 esac
3518 ;;
3519 *)
3520 func_fatal_error "unknown suffix for \`$my_dlsyms'"
3521 ;;
3522 esac
3523 else
3524 # We keep going just in case the user didn't refer to
3525 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
3526 # really was required.
3527
3528 # Nullify the symbol file.
3529 compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"`
3530 finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
3531 fi
3532 }
3533
3534 # func_win32_libid arg
3535 # return the library type of file 'arg'
3536 #
3537 # Need a lot of goo to handle *both* DLLs and import libs
3538 # Has to be a shell function in order to 'eat' the argument
3539 # that is supplied when $file_magic_command is called.
3540 # Despite the name, also deal with 64 bit binaries.
3541 func_win32_libid ()
3542 {
3543 $opt_debug
3544 win32_libid_type="unknown"
3545 win32_fileres=`file -L $1 2>/dev/null`
3546 case $win32_fileres in
3547 *ar\ archive\ import\ library*) # definitely import
3548 win32_libid_type="x86 archive import"
3549 ;;
3550 *ar\ archive*) # could be an import, or static
3551 # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
3552 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
3553 $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
3554 func_to_tool_file "$1" func_convert_file_msys_to_w32
3555 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
3556 $SED -n -e '
3557 1,100{
3558 / I /{
3559 s,.*,import,
3560 p
3561 q
3562 }
3563 }'`
3564 case $win32_nmres in
3565 import*) win32_libid_type="x86 archive import";;
3566 *) win32_libid_type="x86 archive static";;
3567 esac
3568 fi
3569 ;;
3570 *DLL*)
3571 win32_libid_type="x86 DLL"
3572 ;;
3573 *executable*) # but shell scripts are "executable" too...
3574 case $win32_fileres in
3575 *MS\ Windows\ PE\ Intel*)
3576 win32_libid_type="x86 DLL"
3577 ;;
3578 esac
3579 ;;
3580 esac
3581 $ECHO "$win32_libid_type"
3582 }
3583
3584 # func_cygming_dll_for_implib ARG
3585 #
3586 # Platform-specific function to extract the
3587 # name of the DLL associated with the specified
3588 # import library ARG.
3589 # Invoked by eval'ing the libtool variable
3590 # $sharedlib_from_linklib_cmd
3591 # Result is available in the variable
3592 # $sharedlib_from_linklib_result
3593 func_cygming_dll_for_implib ()
3594 {
3595 $opt_debug
3596 sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
3597 }
3598
3599 # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs
3600 #
3601 # The is the core of a fallback implementation of a
3602 # platform-specific function to extract the name of the
3603 # DLL associated with the specified import library LIBNAME.
3604 #
3605 # SECTION_NAME is either .idata$6 or .idata$7, depending
3606 # on the platform and compiler that created the implib.
3607 #
3608 # Echos the name of the DLL associated with the
3609 # specified import library.
3610 func_cygming_dll_for_implib_fallback_core ()
3611 {
3612 $opt_debug
3613 match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
3614 $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
3615 $SED '/^Contents of section '"$match_literal"':/{
3616 # Place marker at beginning of archive member dllname section
3617 s/.*/====MARK====/
3618 p
3619 d
3620 }
3621 # These lines can sometimes be longer than 43 characters, but
3622 # are always uninteresting
3623 /:[ ]*file format pe[i]\{,1\}-/d
3624 /^In archive [^:]*:/d
3625 # Ensure marker is printed
3626 /^====MARK====/p
3627 # Remove all lines with less than 43 characters
3628 /^.\{43\}/!d
3629 # From remaining lines, remove first 43 characters
3630 s/^.\{43\}//' |
3631 $SED -n '
3632 # Join marker and all lines until next marker into a single line
3633 /^====MARK====/ b para
3634 H
3635 $ b para
3636 b
3637 :para
3638 x
3639 s/\n//g
3640 # Remove the marker
3641 s/^====MARK====//
3642 # Remove trailing dots and whitespace
3643 s/[\. \t]*$//
3644 # Print
3645 /./p' |
3646 # we now have a list, one entry per line, of the stringified
3647 # contents of the appropriate section of all members of the
3648 # archive which possess that section. Heuristic: eliminate
3649 # all those which have a first or second character that is
3650 # a '.' (that is, objdump's representation of an unprintable
3651 # character.) This should work for all archives with less than
3652 # 0x302f exports -- but will fail for DLLs whose name actually
3653 # begins with a literal '.' or a single character followed by
3654 # a '.'.
3655 #
3656 # Of those that remain, print the first one.
3657 $SED -e '/^\./d;/^.\./d;q'
3658 }
3659
3660 # func_cygming_gnu_implib_p ARG
3661 # This predicate returns with zero status (TRUE) if
3662 # ARG is a GNU/binutils-style import library. Returns
3663 # with nonzero status (FALSE) otherwise.
3664 func_cygming_gnu_implib_p ()
3665 {
3666 $opt_debug
3667 func_to_tool_file "$1" func_convert_file_msys_to_w32
3668 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
3669 test -n "$func_cygming_gnu_implib_tmp"
3670 }
3671
3672 # func_cygming_ms_implib_p ARG
3673 # This predicate returns with zero status (TRUE) if
3674 # ARG is an MS-style import library. Returns
3675 # with nonzero status (FALSE) otherwise.
3676 func_cygming_ms_implib_p ()
3677 {
3678 $opt_debug
3679 func_to_tool_file "$1" func_convert_file_msys_to_w32
3680 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
3681 test -n "$func_cygming_ms_implib_tmp"
3682 }
3683
3684 # func_cygming_dll_for_implib_fallback ARG
3685 # Platform-specific function to extract the
3686 # name of the DLL associated with the specified
3687 # import library ARG.
3688 #
3689 # This fallback implementation is for use when $DLLTOOL
3690 # does not support the --identify-strict option.
3691 # Invoked by eval'ing the libtool variable
3692 # $sharedlib_from_linklib_cmd
3693 # Result is available in the variable
3694 # $sharedlib_from_linklib_result
3695 func_cygming_dll_for_implib_fallback ()
3696 {
3697 $opt_debug
3698 if func_cygming_gnu_implib_p "$1" ; then
3699 # binutils import library
3700 sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
3701 elif func_cygming_ms_implib_p "$1" ; then
3702 # ms-generated import library
3703 sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
3704 else
3705 # unknown
3706 sharedlib_from_linklib_result=""
3707 fi
3708 }
3709
3710
3711 # func_extract_an_archive dir oldlib
3712 func_extract_an_archive ()
3713 {
3714 $opt_debug
3715 f_ex_an_ar_dir="$1"; shift
3716 f_ex_an_ar_oldlib="$1"
3717 if test "$lock_old_archive_extraction" = yes; then
3718 lockfile=$f_ex_an_ar_oldlib.lock
3719 until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
3720 func_echo "Waiting for $lockfile to be removed"
3721 sleep 2
3722 done
3723 fi
3724 func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
3725 'stat=$?; rm -f "$lockfile"; exit $stat'
3726 if test "$lock_old_archive_extraction" = yes; then
3727 $opt_dry_run || rm -f "$lockfile"
3728 fi
3729 if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
3730 :
3731 else
3732 func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
3733 fi
3734 }
3735
3736
3737 # func_extract_archives gentop oldlib ...
3738 func_extract_archives ()
3739 {
3740 $opt_debug
3741 my_gentop="$1"; shift
3742 my_oldlibs=${1+"$@"}
3743 my_oldobjs=""
3744 my_xlib=""
3745 my_xabs=""
3746 my_xdir=""
3747
3748 for my_xlib in $my_oldlibs; do
3749 # Extract the objects.
3750 case $my_xlib in
3751 [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
3752 *) my_xabs=`pwd`"/$my_xlib" ;;
3753 esac
3754 func_basename "$my_xlib"
3755 my_xlib="$func_basename_result"
3756 my_xlib_u=$my_xlib
3757 while :; do
3758 case " $extracted_archives " in
3759 *" $my_xlib_u "*)
3760 func_arith $extracted_serial + 1
3761 extracted_serial=$func_arith_result
3762 my_xlib_u=lt$extracted_serial-$my_xlib ;;
3763 *) break ;;
3764 esac
3765 done
3766 extracted_archives="$extracted_archives $my_xlib_u"
3767 my_xdir="$my_gentop/$my_xlib_u"
3768
3769 func_mkdir_p "$my_xdir"
3770
3771 case $host in
3772 *-darwin*)
3773 func_verbose "Extracting $my_xabs"
3774 # Do not bother doing anything if just a dry run
3775 $opt_dry_run || {
3776 darwin_orig_dir=`pwd`
3777 cd $my_xdir || exit $?
3778 darwin_archive=$my_xabs
3779 darwin_curdir=`pwd`
3780 darwin_base_archive=`basename "$darwin_archive"`
3781 darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
3782 if test -n "$darwin_arches"; then
3783 darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
3784 darwin_arch=
3785 func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
3786 for darwin_arch in $darwin_arches ; do
3787 func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
3788 $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
3789 cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
3790 func_extract_an_archive "`pwd`" "${darwin_base_archive}"
3791 cd "$darwin_curdir"
3792 $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
3793 done # $darwin_arches
3794 ## Okay now we've a bunch of thin objects, gotta fatten them up :)
3795 darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
3796 darwin_file=
3797 darwin_files=
3798 for darwin_file in $darwin_filelist; do
3799 darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
3800 $LIPO -create -output "$darwin_file" $darwin_files
3801 done # $darwin_filelist
3802 $RM -rf unfat-$$
3803 cd "$darwin_orig_dir"
3804 else
3805 cd $darwin_orig_dir
3806 func_extract_an_archive "$my_xdir" "$my_xabs"
3807 fi # $darwin_arches
3808 } # !$opt_dry_run
3809 ;;
3810 *)
3811 func_extract_an_archive "$my_xdir" "$my_xabs"
3812 ;;
3813 esac
3814 my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
3815 done
3816
3817 func_extract_archives_result="$my_oldobjs"
3818 }
3819
3820
3821 # func_emit_wrapper [arg=no]
3822 #
3823 # Emit a libtool wrapper script on stdout.
3824 # Don't directly open a file because we may want to
3825 # incorporate the script contents within a cygwin/mingw
3826 # wrapper executable. Must ONLY be called from within
3827 # func_mode_link because it depends on a number of variables
3828 # set therein.
3829 #
3830 # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
3831 # variable will take. If 'yes', then the emitted script
3832 # will assume that the directory in which it is stored is
3833 # the $objdir directory. This is a cygwin/mingw-specific
3834 # behavior.
3835 func_emit_wrapper ()
3836 {
3837 func_emit_wrapper_arg1=${1-no}
3838
3839 $ECHO "\
3840 #! $SHELL
3841
3842 # $output - temporary wrapper script for $objdir/$outputname
3843 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
3844 #
3845 # The $output program cannot be directly executed until all the libtool
3846 # libraries that it depends on are installed.
3847 #
3848 # This wrapper script should never be moved out of the build directory.
3849 # If it is, it will not operate correctly.
3850
3851 # Sed substitution that helps us do robust quoting. It backslashifies
3852 # metacharacters that are still active within double-quoted strings.
3853 sed_quote_subst='$sed_quote_subst'
3854
3855 # Be Bourne compatible
3856 if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
3857 emulate sh
3858 NULLCMD=:
3859 # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
3860 # is contrary to our usage. Disable this feature.
3861 alias -g '\${1+\"\$@\"}'='\"\$@\"'
3862 setopt NO_GLOB_SUBST
3863 else
3864 case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
3865 fi
3866 BIN_SH=xpg4; export BIN_SH # for Tru64
3867 DUALCASE=1; export DUALCASE # for MKS sh
3868
3869 # The HP-UX ksh and POSIX shell print the target directory to stdout
3870 # if CDPATH is set.
3871 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
3872
3873 relink_command=\"$relink_command\"
3874
3875 # This environment variable determines our operation mode.
3876 if test \"\$libtool_install_magic\" = \"$magic\"; then
3877 # install mode needs the following variables:
3878 generated_by_libtool_version='$macro_version'
3879 notinst_deplibs='$notinst_deplibs'
3880 else
3881 # When we are sourced in execute mode, \$file and \$ECHO are already set.
3882 if test \"\$libtool_execute_magic\" != \"$magic\"; then
3883 file=\"\$0\""
3884
3885 qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
3886 $ECHO "\
3887
3888 # A function that is used when there is no print builtin or printf.
3889 func_fallback_echo ()
3890 {
3891 eval 'cat <<_LTECHO_EOF
3892 \$1
3893 _LTECHO_EOF'
3894 }
3895 ECHO=\"$qECHO\"
3896 fi
3897
3898 # Very basic option parsing. These options are (a) specific to
3899 # the libtool wrapper, (b) are identical between the wrapper
3900 # /script/ and the wrapper /executable/ which is used only on
3901 # windows platforms, and (c) all begin with the string "--lt-"
3902 # (application programs are unlikely to have options which match
3903 # this pattern).
3904 #
3905 # There are only two supported options: --lt-debug and
3906 # --lt-dump-script. There is, deliberately, no --lt-help.
3907 #
3908 # The first argument to this parsing function should be the
3909 # script's $0 value, followed by "$@".
3910 lt_option_debug=
3911 func_parse_lt_options ()
3912 {
3913 lt_script_arg0=\$0
3914 shift
3915 for lt_opt
3916 do
3917 case \"\$lt_opt\" in
3918 --lt-debug) lt_option_debug=1 ;;
3919 --lt-dump-script)
3920 lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
3921 test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
3922 lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
3923 cat \"\$lt_dump_D/\$lt_dump_F\"
3924 exit 0
3925 ;;
3926 --lt-*)
3927 \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
3928 exit 1
3929 ;;
3930 esac
3931 done
3932
3933 # Print the debug banner immediately:
3934 if test -n \"\$lt_option_debug\"; then
3935 echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2
3936 fi
3937 }
3938
3939 # Used when --lt-debug. Prints its arguments to stdout
3940 # (redirection is the responsibility of the caller)
3941 func_lt_dump_args ()
3942 {
3943 lt_dump_args_N=1;
3944 for lt_arg
3945 do
3946 \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\"
3947 lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
3948 done
3949 }
3950
3951 # Core function for launching the target application
3952 func_exec_program_core ()
3953 {
3954 "
3955 case $host in
3956 # Backslashes separate directories on plain windows
3957 *-*-mingw | *-*-os2* | *-cegcc*)
3958 $ECHO "\
3959 if test -n \"\$lt_option_debug\"; then
3960 \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2
3961 func_lt_dump_args \${1+\"\$@\"} 1>&2
3962 fi
3963 exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
3964 "
3965 ;;
3966
3967 *)
3968 $ECHO "\
3969 if test -n \"\$lt_option_debug\"; then
3970 \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2
3971 func_lt_dump_args \${1+\"\$@\"} 1>&2
3972 fi
3973 exec \"\$progdir/\$program\" \${1+\"\$@\"}
3974 "
3975 ;;
3976 esac
3977 $ECHO "\
3978 \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
3979 exit 1
3980 }
3981
3982 # A function to encapsulate launching the target application
3983 # Strips options in the --lt-* namespace from \$@ and
3984 # launches target application with the remaining arguments.
3985 func_exec_program ()
3986 {
3987 case \" \$* \" in
3988 *\\ --lt-*)
3989 for lt_wr_arg
3990 do
3991 case \$lt_wr_arg in
3992 --lt-*) ;;
3993 *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
3994 esac
3995 shift
3996 done ;;
3997 esac
3998 func_exec_program_core \${1+\"\$@\"}
3999 }
4000
4001 # Parse options
4002 func_parse_lt_options \"\$0\" \${1+\"\$@\"}
4003
4004 # Find the directory that this script lives in.
4005 thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
4006 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
4007
4008 # Follow symbolic links until we get to the real thisdir.
4009 file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`
4010 while test -n \"\$file\"; do
4011 destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`
4012
4013 # If there was a directory component, then change thisdir.
4014 if test \"x\$destdir\" != \"x\$file\"; then
4015 case \"\$destdir\" in
4016 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
4017 *) thisdir=\"\$thisdir/\$destdir\" ;;
4018 esac
4019 fi
4020
4021 file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\`
4022 file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
4023 done
4024
4025 # Usually 'no', except on cygwin/mingw when embedded into
4026 # the cwrapper.
4027 WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
4028 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
4029 # special case for '.'
4030 if test \"\$thisdir\" = \".\"; then
4031 thisdir=\`pwd\`
4032 fi
4033 # remove .libs from thisdir
4034 case \"\$thisdir\" in
4035 *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;;
4036 $objdir ) thisdir=. ;;
4037 esac
4038 fi
4039
4040 # Try to get the absolute directory name.
4041 absdir=\`cd \"\$thisdir\" && pwd\`
4042 test -n \"\$absdir\" && thisdir=\"\$absdir\"
4043 "
4044
4045 if test "$fast_install" = yes; then
4046 $ECHO "\
4047 program=lt-'$outputname'$exeext
4048 progdir=\"\$thisdir/$objdir\"
4049
4050 if test ! -f \"\$progdir/\$program\" ||
4051 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
4052 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
4053
4054 file=\"\$\$-\$program\"
4055
4056 if test ! -d \"\$progdir\"; then
4057 $MKDIR \"\$progdir\"
4058 else
4059 $RM \"\$progdir/\$file\"
4060 fi"
4061
4062 $ECHO "\
4063
4064 # relink executable if necessary
4065 if test -n \"\$relink_command\"; then
4066 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
4067 else
4068 $ECHO \"\$relink_command_output\" >&2
4069 $RM \"\$progdir/\$file\"
4070 exit 1
4071 fi
4072 fi
4073
4074 $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
4075 { $RM \"\$progdir/\$program\";
4076 $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
4077 $RM \"\$progdir/\$file\"
4078 fi"
4079 else
4080 $ECHO "\
4081 program='$outputname'
4082 progdir=\"\$thisdir/$objdir\"
4083 "
4084 fi
4085
4086 $ECHO "\
4087
4088 if test -f \"\$progdir/\$program\"; then"
4089
4090 # fixup the dll searchpath if we need to.
4091 #
4092 # Fix the DLL searchpath if we need to. Do this before prepending
4093 # to shlibpath, because on Windows, both are PATH and uninstalled
4094 # libraries must come first.
4095 if test -n "$dllsearchpath"; then
4096 $ECHO "\
4097 # Add the dll search path components to the executable PATH
4098 PATH=$dllsearchpath:\$PATH
4099 "
4100 fi
4101
4102 # Export our shlibpath_var if we have one.
4103 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4104 $ECHO "\
4105 # Add our own library path to $shlibpath_var
4106 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
4107
4108 # Some systems cannot cope with colon-terminated $shlibpath_var
4109 # The second colon is a workaround for a bug in BeOS R4 sed
4110 $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
4111
4112 export $shlibpath_var
4113 "
4114 fi
4115
4116 $ECHO "\
4117 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4118 # Run the actual program with our arguments.
4119 func_exec_program \${1+\"\$@\"}
4120 fi
4121 else
4122 # The program doesn't exist.
4123 \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
4124 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
4125 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
4126 exit 1
4127 fi
4128 fi\
4129 "
4130 }
4131
4132
4133 # func_emit_cwrapperexe_src
4134 # emit the source code for a wrapper executable on stdout
4135 # Must ONLY be called from within func_mode_link because
4136 # it depends on a number of variable set therein.
4137 func_emit_cwrapperexe_src ()
4138 {
4139 cat <<EOF
4140
4141 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4142 Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
4143
4144 The $output program cannot be directly executed until all the libtool
4145 libraries that it depends on are installed.
4146
4147 This wrapper executable should never be moved out of the build directory.
4148 If it is, it will not operate correctly.
4149 */
4150 EOF
4151 cat <<"EOF"
4152 #ifdef _MSC_VER
4153 # define _CRT_SECURE_NO_DEPRECATE 1
4154 #endif
4155 #include <stdio.h>
4156 #include <stdlib.h>
4157 #ifdef _MSC_VER
4158 # include <direct.h>
4159 # include <process.h>
4160 # include <io.h>
4161 #else
4162 # include <unistd.h>
4163 # include <stdint.h>
4164 # ifdef __CYGWIN__
4165 # include <io.h>
4166 # endif
4167 #endif
4168 #include <malloc.h>
4169 #include <stdarg.h>
4170 #include <assert.h>
4171 #include <string.h>
4172 #include <ctype.h>
4173 #include <errno.h>
4174 #include <fcntl.h>
4175 #include <sys/stat.h>
4176
4177 /* declarations of non-ANSI functions */
4178 #if defined(__MINGW32__)
4179 # ifdef __STRICT_ANSI__
4180 int _putenv (const char *);
4181 # endif
4182 #elif defined(__CYGWIN__)
4183 # ifdef __STRICT_ANSI__
4184 char *realpath (const char *, char *);
4185 int putenv (char *);
4186 int setenv (const char *, const char *, int);
4187 # endif
4188 /* #elif defined (other platforms) ... */
4189 #endif
4190
4191 /* portability defines, excluding path handling macros */
4192 #if defined(_MSC_VER)
4193 # define setmode _setmode
4194 # define stat _stat
4195 # define chmod _chmod
4196 # define getcwd _getcwd
4197 # define putenv _putenv
4198 # define S_IXUSR _S_IEXEC
4199 # ifndef _INTPTR_T_DEFINED
4200 # define _INTPTR_T_DEFINED
4201 # define intptr_t int
4202 # endif
4203 #elif defined(__MINGW32__)
4204 # define setmode _setmode
4205 # define stat _stat
4206 # define chmod _chmod
4207 # define getcwd _getcwd
4208 # define putenv _putenv
4209 #elif defined(__CYGWIN__)
4210 # define HAVE_SETENV
4211 # define FOPEN_WB "wb"
4212 /* #elif defined (other platforms) ... */
4213 #endif
4214
4215 #if defined(PATH_MAX)
4216 # define LT_PATHMAX PATH_MAX
4217 #elif defined(MAXPATHLEN)
4218 # define LT_PATHMAX MAXPATHLEN
4219 #else
4220 # define LT_PATHMAX 1024
4221 #endif
4222
4223 #ifndef S_IXOTH
4224 # define S_IXOTH 0
4225 #endif
4226 #ifndef S_IXGRP
4227 # define S_IXGRP 0
4228 #endif
4229
4230 /* path handling portability macros */
4231 #ifndef DIR_SEPARATOR
4232 # define DIR_SEPARATOR '/'
4233 # define PATH_SEPARATOR ':'
4234 #endif
4235
4236 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4237 defined (__OS2__)
4238 # define HAVE_DOS_BASED_FILE_SYSTEM
4239 # define FOPEN_WB "wb"
4240 # ifndef DIR_SEPARATOR_2
4241 # define DIR_SEPARATOR_2 '\\'
4242 # endif
4243 # ifndef PATH_SEPARATOR_2
4244 # define PATH_SEPARATOR_2 ';'
4245 # endif
4246 #endif
4247
4248 #ifndef DIR_SEPARATOR_2
4249 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
4250 #else /* DIR_SEPARATOR_2 */
4251 # define IS_DIR_SEPARATOR(ch) \
4252 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
4253 #endif /* DIR_SEPARATOR_2 */
4254
4255 #ifndef PATH_SEPARATOR_2
4256 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
4257 #else /* PATH_SEPARATOR_2 */
4258 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
4259 #endif /* PATH_SEPARATOR_2 */
4260
4261 #ifndef FOPEN_WB
4262 # define FOPEN_WB "w"
4263 #endif
4264 #ifndef _O_BINARY
4265 # define _O_BINARY 0
4266 #endif
4267
4268 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
4269 #define XFREE(stale) do { \
4270 if (stale) { free ((void *) stale); stale = 0; } \
4271 } while (0)
4272
4273 #if defined(LT_DEBUGWRAPPER)
4274 static int lt_debug = 1;
4275 #else
4276 static int lt_debug = 0;
4277 #endif
4278
4279 const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */
4280
4281 void *xmalloc (size_t num);
4282 char *xstrdup (const char *string);
4283 const char *base_name (const char *name);
4284 char *find_executable (const char *wrapper);
4285 char *chase_symlinks (const char *pathspec);
4286 int make_executable (const char *path);
4287 int check_executable (const char *path);
4288 char *strendzap (char *str, const char *pat);
4289 void lt_debugprintf (const char *file, int line, const char *fmt, ...);
4290 void lt_fatal (const char *file, int line, const char *message, ...);
4291 static const char *nonnull (const char *s);
4292 static const char *nonempty (const char *s);
4293 void lt_setenv (const char *name, const char *value);
4294 char *lt_extend_str (const char *orig_value, const char *add, int to_end);
4295 void lt_update_exe_path (const char *name, const char *value);
4296 void lt_update_lib_path (const char *name, const char *value);
4297 char **prepare_spawn (char **argv);
4298 void lt_dump_script (FILE *f);
4299 EOF
4300
4301 cat <<EOF
4302 volatile const char * MAGIC_EXE = "$magic_exe";
4303 const char * LIB_PATH_VARNAME = "$shlibpath_var";
4304 EOF
4305
4306 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4307 func_to_host_path "$temp_rpath"
4308 cat <<EOF
4309 const char * LIB_PATH_VALUE = "$func_to_host_path_result";
4310 EOF
4311 else
4312 cat <<"EOF"
4313 const char * LIB_PATH_VALUE = "";
4314 EOF
4315 fi
4316
4317 if test -n "$dllsearchpath"; then
4318 func_to_host_path "$dllsearchpath:"
4319 cat <<EOF
4320 const char * EXE_PATH_VARNAME = "PATH";
4321 const char * EXE_PATH_VALUE = "$func_to_host_path_result";
4322 EOF
4323 else
4324 cat <<"EOF"
4325 const char * EXE_PATH_VARNAME = "";
4326 const char * EXE_PATH_VALUE = "";
4327 EOF
4328 fi
4329
4330 if test "$fast_install" = yes; then
4331 cat <<EOF
4332 const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
4333 EOF
4334 else
4335 cat <<EOF
4336 const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
4337 EOF
4338 fi
4339
4340
4341 cat <<"EOF"
4342
4343 #define LTWRAPPER_OPTION_PREFIX "--lt-"
4344
4345 static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
4346 static const char *dumpscript_opt = LTWRAPPER_OPTION_PREFIX "dump-script";
4347 static const char *debug_opt = LTWRAPPER_OPTION_PREFIX "debug";
4348
4349 int
4350 main (int argc, char *argv[])
4351 {
4352 char **newargz;
4353 int newargc;
4354 char *tmp_pathspec;
4355 char *actual_cwrapper_path;
4356 char *actual_cwrapper_name;
4357 char *target_name;
4358 char *lt_argv_zero;
4359 intptr_t rval = 127;
4360
4361 int i;
4362
4363 program_name = (char *) xstrdup (base_name (argv[0]));
4364 newargz = XMALLOC (char *, argc + 1);
4365
4366 /* very simple arg parsing; don't want to rely on getopt
4367 * also, copy all non cwrapper options to newargz, except
4368 * argz[0], which is handled differently
4369 */
4370 newargc=0;
4371 for (i = 1; i < argc; i++)
4372 {
4373 if (strcmp (argv[i], dumpscript_opt) == 0)
4374 {
4375 EOF
4376 case "$host" in
4377 *mingw* | *cygwin* )
4378 # make stdout use "unix" line endings
4379 echo " setmode(1,_O_BINARY);"
4380 ;;
4381 esac
4382
4383 cat <<"EOF"
4384 lt_dump_script (stdout);
4385 return 0;
4386 }
4387 if (strcmp (argv[i], debug_opt) == 0)
4388 {
4389 lt_debug = 1;
4390 continue;
4391 }
4392 if (strcmp (argv[i], ltwrapper_option_prefix) == 0)
4393 {
4394 /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
4395 namespace, but it is not one of the ones we know about and
4396 have already dealt with, above (inluding dump-script), then
4397 report an error. Otherwise, targets might begin to believe
4398 they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
4399 namespace. The first time any user complains about this, we'll
4400 need to make LTWRAPPER_OPTION_PREFIX a configure-time option
4401 or a configure.ac-settable value.
4402 */
4403 lt_fatal (__FILE__, __LINE__,
4404 "unrecognized %s option: '%s'",
4405 ltwrapper_option_prefix, argv[i]);
4406 }
4407 /* otherwise ... */
4408 newargz[++newargc] = xstrdup (argv[i]);
4409 }
4410 newargz[++newargc] = NULL;
4411
4412 EOF
4413 cat <<EOF
4414 /* The GNU banner must be the first non-error debug message */
4415 lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\n");
4416 EOF
4417 cat <<"EOF"
4418 lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
4419 lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);
4420
4421 tmp_pathspec = find_executable (argv[0]);
4422 if (tmp_pathspec == NULL)
4423 lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
4424 lt_debugprintf (__FILE__, __LINE__,
4425 "(main) found exe (before symlink chase) at: %s\n",
4426 tmp_pathspec);
4427
4428 actual_cwrapper_path = chase_symlinks (tmp_pathspec);
4429 lt_debugprintf (__FILE__, __LINE__,
4430 "(main) found exe (after symlink chase) at: %s\n",
4431 actual_cwrapper_path);
4432 XFREE (tmp_pathspec);
4433
4434 actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
4435 strendzap (actual_cwrapper_path, actual_cwrapper_name);
4436
4437 /* wrapper name transforms */
4438 strendzap (actual_cwrapper_name, ".exe");
4439 tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
4440 XFREE (actual_cwrapper_name);
4441 actual_cwrapper_name = tmp_pathspec;
4442 tmp_pathspec = 0;
4443
4444 /* target_name transforms -- use actual target program name; might have lt- prefix */
4445 target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
4446 strendzap (target_name, ".exe");
4447 tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
4448 XFREE (target_name);
4449 target_name = tmp_pathspec;
4450 tmp_pathspec = 0;
4451
4452 lt_debugprintf (__FILE__, __LINE__,
4453 "(main) libtool target name: %s\n",
4454 target_name);
4455 EOF
4456
4457 cat <<EOF
4458 newargz[0] =
4459 XMALLOC (char, (strlen (actual_cwrapper_path) +
4460 strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
4461 strcpy (newargz[0], actual_cwrapper_path);
4462 strcat (newargz[0], "$objdir");
4463 strcat (newargz[0], "/");
4464 EOF
4465
4466 cat <<"EOF"
4467 /* stop here, and copy so we don't have to do this twice */
4468 tmp_pathspec = xstrdup (newargz[0]);
4469
4470 /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
4471 strcat (newargz[0], actual_cwrapper_name);
4472
4473 /* DO want the lt- prefix here if it exists, so use target_name */
4474 lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
4475 XFREE (tmp_pathspec);
4476 tmp_pathspec = NULL;
4477 EOF
4478
4479 case $host_os in
4480 mingw*)
4481 cat <<"EOF"
4482 {
4483 char* p;
4484 while ((p = strchr (newargz[0], '\\')) != NULL)
4485 {
4486 *p = '/';
4487 }
4488 while ((p = strchr (lt_argv_zero, '\\')) != NULL)
4489 {
4490 *p = '/';
4491 }
4492 }
4493 EOF
4494 ;;
4495 esac
4496
4497 cat <<"EOF"
4498 XFREE (target_name);
4499 XFREE (actual_cwrapper_path);
4500 XFREE (actual_cwrapper_name);
4501
4502 lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
4503 lt_setenv ("DUALCASE", "1"); /* for MSK sh */
4504 /* Update the DLL searchpath. EXE_PATH_VALUE ($dllsearchpath) must
4505 be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)
4506 because on Windows, both *_VARNAMEs are PATH but uninstalled
4507 libraries must come first. */
4508 lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
4509 lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
4510
4511 lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
4512 nonnull (lt_argv_zero));
4513 for (i = 0; i < newargc; i++)
4514 {
4515 lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
4516 i, nonnull (newargz[i]));
4517 }
4518
4519 EOF
4520
4521 case $host_os in
4522 mingw*)
4523 cat <<"EOF"
4524 /* execv doesn't actually work on mingw as expected on unix */
4525 newargz = prepare_spawn (newargz);
4526 rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
4527 if (rval == -1)
4528 {
4529 /* failed to start process */
4530 lt_debugprintf (__FILE__, __LINE__,
4531 "(main) failed to launch target \"%s\": %s\n",
4532 lt_argv_zero, nonnull (strerror (errno)));
4533 return 127;
4534 }
4535 return rval;
4536 EOF
4537 ;;
4538 *)
4539 cat <<"EOF"
4540 execv (lt_argv_zero, newargz);
4541 return rval; /* =127, but avoids unused variable warning */
4542 EOF
4543 ;;
4544 esac
4545
4546 cat <<"EOF"
4547 }
4548
4549 void *
4550 xmalloc (size_t num)
4551 {
4552 void *p = (void *) malloc (num);
4553 if (!p)
4554 lt_fatal (__FILE__, __LINE__, "memory exhausted");
4555
4556 return p;
4557 }
4558
4559 char *
4560 xstrdup (const char *string)
4561 {
4562 return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
4563 string) : NULL;
4564 }
4565
4566 const char *
4567 base_name (const char *name)
4568 {
4569 const char *base;
4570
4571 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4572 /* Skip over the disk name in MSDOS pathnames. */
4573 if (isalpha ((unsigned char) name[0]) && name[1] == ':')
4574 name += 2;
4575 #endif
4576
4577 for (base = name; *name; name++)
4578 if (IS_DIR_SEPARATOR (*name))
4579 base = name + 1;
4580 return base;
4581 }
4582
4583 int
4584 check_executable (const char *path)
4585 {
4586 struct stat st;
4587
4588 lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n",
4589 nonempty (path));
4590 if ((!path) || (!*path))
4591 return 0;
4592
4593 if ((stat (path, &st) >= 0)
4594 && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
4595 return 1;
4596 else
4597 return 0;
4598 }
4599
4600 int
4601 make_executable (const char *path)
4602 {
4603 int rval = 0;
4604 struct stat st;
4605
4606 lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n",
4607 nonempty (path));
4608 if ((!path) || (!*path))
4609 return 0;
4610
4611 if (stat (path, &st) >= 0)
4612 {
4613 rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
4614 }
4615 return rval;
4616 }
4617
4618 /* Searches for the full path of the wrapper. Returns
4619 newly allocated full path name if found, NULL otherwise
4620 Does not chase symlinks, even on platforms that support them.
4621 */
4622 char *
4623 find_executable (const char *wrapper)
4624 {
4625 int has_slash = 0;
4626 const char *p;
4627 const char *p_next;
4628 /* static buffer for getcwd */
4629 char tmp[LT_PATHMAX + 1];
4630 int tmp_len;
4631 char *concat_name;
4632
4633 lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
4634 nonempty (wrapper));
4635
4636 if ((wrapper == NULL) || (*wrapper == '\0'))
4637 return NULL;
4638
4639 /* Absolute path? */
4640 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4641 if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
4642 {
4643 concat_name = xstrdup (wrapper);
4644 if (check_executable (concat_name))
4645 return concat_name;
4646 XFREE (concat_name);
4647 }
4648 else
4649 {
4650 #endif
4651 if (IS_DIR_SEPARATOR (wrapper[0]))
4652 {
4653 concat_name = xstrdup (wrapper);
4654 if (check_executable (concat_name))
4655 return concat_name;
4656 XFREE (concat_name);
4657 }
4658 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4659 }
4660 #endif
4661
4662 for (p = wrapper; *p; p++)
4663 if (*p == '/')
4664 {
4665 has_slash = 1;
4666 break;
4667 }
4668 if (!has_slash)
4669 {
4670 /* no slashes; search PATH */
4671 const char *path = getenv ("PATH");
4672 if (path != NULL)
4673 {
4674 for (p = path; *p; p = p_next)
4675 {
4676 const char *q;
4677 size_t p_len;
4678 for (q = p; *q; q++)
4679 if (IS_PATH_SEPARATOR (*q))
4680 break;
4681 p_len = q - p;
4682 p_next = (*q == '\0' ? q : q + 1);
4683 if (p_len == 0)
4684 {
4685 /* empty path: current directory */
4686 if (getcwd (tmp, LT_PATHMAX) == NULL)
4687 lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
4688 nonnull (strerror (errno)));
4689 tmp_len = strlen (tmp);
4690 concat_name =
4691 XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
4692 memcpy (concat_name, tmp, tmp_len);
4693 concat_name[tmp_len] = '/';
4694 strcpy (concat_name + tmp_len + 1, wrapper);
4695 }
4696 else
4697 {
4698 concat_name =
4699 XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
4700 memcpy (concat_name, p, p_len);
4701 concat_name[p_len] = '/';
4702 strcpy (concat_name + p_len + 1, wrapper);
4703 }
4704 if (check_executable (concat_name))
4705 return concat_name;
4706 XFREE (concat_name);
4707 }
4708 }
4709 /* not found in PATH; assume curdir */
4710 }
4711 /* Relative path | not found in path: prepend cwd */
4712 if (getcwd (tmp, LT_PATHMAX) == NULL)
4713 lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
4714 nonnull (strerror (errno)));
4715 tmp_len = strlen (tmp);
4716 concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
4717 memcpy (concat_name, tmp, tmp_len);
4718 concat_name[tmp_len] = '/';
4719 strcpy (concat_name + tmp_len + 1, wrapper);
4720
4721 if (check_executable (concat_name))
4722 return concat_name;
4723 XFREE (concat_name);
4724 return NULL;
4725 }
4726
4727 char *
4728 chase_symlinks (const char *pathspec)
4729 {
4730 #ifndef S_ISLNK
4731 return xstrdup (pathspec);
4732 #else
4733 char buf[LT_PATHMAX];
4734 struct stat s;
4735 char *tmp_pathspec = xstrdup (pathspec);
4736 char *p;
4737 int has_symlinks = 0;
4738 while (strlen (tmp_pathspec) && !has_symlinks)
4739 {
4740 lt_debugprintf (__FILE__, __LINE__,
4741 "checking path component for symlinks: %s\n",
4742 tmp_pathspec);
4743 if (lstat (tmp_pathspec, &s) == 0)
4744 {
4745 if (S_ISLNK (s.st_mode) != 0)
4746 {
4747 has_symlinks = 1;
4748 break;
4749 }
4750
4751 /* search backwards for last DIR_SEPARATOR */
4752 p = tmp_pathspec + strlen (tmp_pathspec) - 1;
4753 while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
4754 p--;
4755 if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
4756 {
4757 /* no more DIR_SEPARATORS left */
4758 break;
4759 }
4760 *p = '\0';
4761 }
4762 else
4763 {
4764 lt_fatal (__FILE__, __LINE__,
4765 "error accessing file \"%s\": %s",
4766 tmp_pathspec, nonnull (strerror (errno)));
4767 }
4768 }
4769 XFREE (tmp_pathspec);
4770
4771 if (!has_symlinks)
4772 {
4773 return xstrdup (pathspec);
4774 }
4775
4776 tmp_pathspec = realpath (pathspec, buf);
4777 if (tmp_pathspec == 0)
4778 {
4779 lt_fatal (__FILE__, __LINE__,
4780 "could not follow symlinks for %s", pathspec);
4781 }
4782 return xstrdup (tmp_pathspec);
4783 #endif
4784 }
4785
4786 char *
4787 strendzap (char *str, const char *pat)
4788 {
4789 size_t len, patlen;
4790
4791 assert (str != NULL);
4792 assert (pat != NULL);
4793
4794 len = strlen (str);
4795 patlen = strlen (pat);
4796
4797 if (patlen <= len)
4798 {
4799 str += len - patlen;
4800 if (strcmp (str, pat) == 0)
4801 *str = '\0';
4802 }
4803 return str;
4804 }
4805
4806 void
4807 lt_debugprintf (const char *file, int line, const char *fmt, ...)
4808 {
4809 va_list args;
4810 if (lt_debug)
4811 {
4812 (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line);
4813 va_start (args, fmt);
4814 (void) vfprintf (stderr, fmt, args);
4815 va_end (args);
4816 }
4817 }
4818
4819 static void
4820 lt_error_core (int exit_status, const char *file,
4821 int line, const char *mode,
4822 const char *message, va_list ap)
4823 {
4824 fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode);
4825 vfprintf (stderr, message, ap);
4826 fprintf (stderr, ".\n");
4827
4828 if (exit_status >= 0)
4829 exit (exit_status);
4830 }
4831
4832 void
4833 lt_fatal (const char *file, int line, const char *message, ...)
4834 {
4835 va_list ap;
4836 va_start (ap, message);
4837 lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap);
4838 va_end (ap);
4839 }
4840
4841 static const char *
4842 nonnull (const char *s)
4843 {
4844 return s ? s : "(null)";
4845 }
4846
4847 static const char *
4848 nonempty (const char *s)
4849 {
4850 return (s && !*s) ? "(empty)" : nonnull (s);
4851 }
4852
4853 void
4854 lt_setenv (const char *name, const char *value)
4855 {
4856 lt_debugprintf (__FILE__, __LINE__,
4857 "(lt_setenv) setting '%s' to '%s'\n",
4858 nonnull (name), nonnull (value));
4859 {
4860 #ifdef HAVE_SETENV
4861 /* always make a copy, for consistency with !HAVE_SETENV */
4862 char *str = xstrdup (value);
4863 setenv (name, str, 1);
4864 #else
4865 int len = strlen (name) + 1 + strlen (value) + 1;
4866 char *str = XMALLOC (char, len);
4867 sprintf (str, "%s=%s", name, value);
4868 if (putenv (str) != EXIT_SUCCESS)
4869 {
4870 XFREE (str);
4871 }
4872 #endif
4873 }
4874 }
4875
4876 char *
4877 lt_extend_str (const char *orig_value, const char *add, int to_end)
4878 {
4879 char *new_value;
4880 if (orig_value && *orig_value)
4881 {
4882 int orig_value_len = strlen (orig_value);
4883 int add_len = strlen (add);
4884 new_value = XMALLOC (char, add_len + orig_value_len + 1);
4885 if (to_end)
4886 {
4887 strcpy (new_value, orig_value);
4888 strcpy (new_value + orig_value_len, add);
4889 }
4890 else
4891 {
4892 strcpy (new_value, add);
4893 strcpy (new_value + add_len, orig_value);
4894 }
4895 }
4896 else
4897 {
4898 new_value = xstrdup (add);
4899 }
4900 return new_value;
4901 }
4902
4903 void
4904 lt_update_exe_path (const char *name, const char *value)
4905 {
4906 lt_debugprintf (__FILE__, __LINE__,
4907 "(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
4908 nonnull (name), nonnull (value));
4909
4910 if (name && *name && value && *value)
4911 {
4912 char *new_value = lt_extend_str (getenv (name), value, 0);
4913 /* some systems can't cope with a ':'-terminated path #' */
4914 int len = strlen (new_value);
4915 while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
4916 {
4917 new_value[len-1] = '\0';
4918 }
4919 lt_setenv (name, new_value);
4920 XFREE (new_value);
4921 }
4922 }
4923
4924 void
4925 lt_update_lib_path (const char *name, const char *value)
4926 {
4927 lt_debugprintf (__FILE__, __LINE__,
4928 "(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
4929 nonnull (name), nonnull (value));
4930
4931 if (name && *name && value && *value)
4932 {
4933 char *new_value = lt_extend_str (getenv (name), value, 0);
4934 lt_setenv (name, new_value);
4935 XFREE (new_value);
4936 }
4937 }
4938
4939 EOF
4940 case $host_os in
4941 mingw*)
4942 cat <<"EOF"
4943
4944 /* Prepares an argument vector before calling spawn().
4945 Note that spawn() does not by itself call the command interpreter
4946 (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
4947 ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
4948 GetVersionEx(&v);
4949 v.dwPlatformId == VER_PLATFORM_WIN32_NT;
4950 }) ? "cmd.exe" : "command.com").
4951 Instead it simply concatenates the arguments, separated by ' ', and calls
4952 CreateProcess(). We must quote the arguments since Win32 CreateProcess()
4953 interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a
4954 special way:
4955 - Space and tab are interpreted as delimiters. They are not treated as
4956 delimiters if they are surrounded by double quotes: "...".
4957 - Unescaped double quotes are removed from the input. Their only effect is
4958 that within double quotes, space and tab are treated like normal
4959 characters.
4960 - Backslashes not followed by double quotes are not special.
4961 - But 2*n+1 backslashes followed by a double quote become
4962 n backslashes followed by a double quote (n >= 0):
4963 \" -> "
4964 \\\" -> \"
4965 \\\\\" -> \\"
4966 */
4967 #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
4968 #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
4969 char **
4970 prepare_spawn (char **argv)
4971 {
4972 size_t argc;
4973 char **new_argv;
4974 size_t i;
4975
4976 /* Count number of arguments. */
4977 for (argc = 0; argv[argc] != NULL; argc++)
4978 ;
4979
4980 /* Allocate new argument vector. */
4981 new_argv = XMALLOC (char *, argc + 1);
4982
4983 /* Put quoted arguments into the new argument vector. */
4984 for (i = 0; i < argc; i++)
4985 {
4986 const char *string = argv[i];
4987
4988 if (string[0] == '\0')
4989 new_argv[i] = xstrdup ("\"\"");
4990 else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
4991 {
4992 int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
4993 size_t length;
4994 unsigned int backslashes;
4995 const char *s;
4996 char *quoted_string;
4997 char *p;
4998
4999 length = 0;
5000 backslashes = 0;
5001 if (quote_around)
5002 length++;
5003 for (s = string; *s != '\0'; s++)
5004 {
5005 char c = *s;
5006 if (c == '"')
5007 length += backslashes + 1;
5008 length++;
5009 if (c == '\\')
5010 backslashes++;
5011 else
5012 backslashes = 0;
5013 }
5014 if (quote_around)
5015 length += backslashes + 1;
5016
5017 quoted_string = XMALLOC (char, length + 1);
5018
5019 p = quoted_string;
5020 backslashes = 0;
5021 if (quote_around)
5022 *p++ = '"';
5023 for (s = string; *s != '\0'; s++)
5024 {
5025 char c = *s;
5026 if (c == '"')
5027 {
5028 unsigned int j;
5029 for (j = backslashes + 1; j > 0; j--)
5030 *p++ = '\\';
5031 }
5032 *p++ = c;
5033 if (c == '\\')
5034 backslashes++;
5035 else
5036 backslashes = 0;
5037 }
5038 if (quote_around)
5039 {
5040 unsigned int j;
5041 for (j = backslashes; j > 0; j--)
5042 *p++ = '\\';
5043 *p++ = '"';
5044 }
5045 *p = '\0';
5046
5047 new_argv[i] = quoted_string;
5048 }
5049 else
5050 new_argv[i] = (char *) string;
5051 }
5052 new_argv[argc] = NULL;
5053
5054 return new_argv;
5055 }
5056 EOF
5057 ;;
5058 esac
5059
5060 cat <<"EOF"
5061 void lt_dump_script (FILE* f)
5062 {
5063 EOF
5064 func_emit_wrapper yes |
5065 $SED -n -e '
5066 s/^\(.\{79\}\)\(..*\)/\1\
5067 \2/
5068 h
5069 s/\([\\"]\)/\\\1/g
5070 s/$/\\n/
5071 s/\([^\n]*\).*/ fputs ("\1", f);/p
5072 g
5073 D'
5074 cat <<"EOF"
5075 }
5076 EOF
5077 }
5078 # end: func_emit_cwrapperexe_src
5079
5080 # func_win32_import_lib_p ARG
5081 # True if ARG is an import lib, as indicated by $file_magic_cmd
5082 func_win32_import_lib_p ()
5083 {
5084 $opt_debug
5085 case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
5086 *import*) : ;;
5087 *) false ;;
5088 esac
5089 }
5090
5091 # func_mode_link arg...
5092 func_mode_link ()
5093 {
5094 $opt_debug
5095 case $host in
5096 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
5097 # It is impossible to link a dll without this setting, and
5098 # we shouldn't force the makefile maintainer to figure out
5099 # which system we are compiling for in order to pass an extra
5100 # flag for every libtool invocation.
5101 # allow_undefined=no
5102
5103 # FIXME: Unfortunately, there are problems with the above when trying
5104 # to make a dll which has undefined symbols, in which case not
5105 # even a static library is built. For now, we need to specify
5106 # -no-undefined on the libtool link line when we can be certain
5107 # that all symbols are satisfied, otherwise we get a static library.
5108 allow_undefined=yes
5109 ;;
5110 *)
5111 allow_undefined=yes
5112 ;;
5113 esac
5114 libtool_args=$nonopt
5115 base_compile="$nonopt $@"
5116 compile_command=$nonopt
5117 finalize_command=$nonopt
5118
5119 compile_rpath=
5120 finalize_rpath=
5121 compile_shlibpath=
5122 finalize_shlibpath=
5123 convenience=
5124 old_convenience=
5125 deplibs=
5126 old_deplibs=
5127 compiler_flags=
5128 linker_flags=
5129 dllsearchpath=
5130 lib_search_path=`pwd`
5131 inst_prefix_dir=
5132 new_inherited_linker_flags=
5133
5134 avoid_version=no
5135 bindir=
5136 dlfiles=
5137 dlprefiles=
5138 dlself=no
5139 export_dynamic=no
5140 export_symbols=
5141 export_symbols_regex=
5142 generated=
5143 libobjs=
5144 ltlibs=
5145 module=no
5146 no_install=no
5147 objs=
5148 non_pic_objects=
5149 precious_files_regex=
5150 prefer_static_libs=no
5151 preload=no
5152 prev=
5153 prevarg=
5154 release=
5155 rpath=
5156 xrpath=
5157 perm_rpath=
5158 temp_rpath=
5159 thread_safe=no
5160 vinfo=
5161 vinfo_number=no
5162 weak_libs=
5163 single_module="${wl}-single_module"
5164 func_infer_tag $base_compile
5165
5166 # We need to know -static, to get the right output filenames.
5167 for arg
5168 do
5169 case $arg in
5170 -shared)
5171 test "$build_libtool_libs" != yes && \
5172 func_fatal_configuration "can not build a shared library"
5173 build_old_libs=no
5174 break
5175 ;;
5176 -all-static | -static | -static-libtool-libs)
5177 case $arg in
5178 -all-static)
5179 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
5180 func_warning "complete static linking is impossible in this configuration"
5181 fi
5182 if test -n "$link_static_flag"; then
5183 dlopen_self=$dlopen_self_static
5184 fi
5185 prefer_static_libs=yes
5186 ;;
5187 -static)
5188 if test -z "$pic_flag" && test -n "$link_static_flag"; then
5189 dlopen_self=$dlopen_self_static
5190 fi
5191 prefer_static_libs=built
5192 ;;
5193 -static-libtool-libs)
5194 if test -z "$pic_flag" && test -n "$link_static_flag"; then
5195 dlopen_self=$dlopen_self_static
5196 fi
5197 prefer_static_libs=yes
5198 ;;
5199 esac
5200 build_libtool_libs=no
5201 build_old_libs=yes
5202 break
5203 ;;
5204 esac
5205 done
5206
5207 # See if our shared archives depend on static archives.
5208 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
5209
5210 # Go through the arguments, transforming them on the way.
5211 while test "$#" -gt 0; do
5212 arg="$1"
5213 shift
5214 func_quote_for_eval "$arg"
5215 qarg=$func_quote_for_eval_unquoted_result
5216 func_append libtool_args " $func_quote_for_eval_result"
5217
5218 # If the previous option needs an argument, assign it.
5219 if test -n "$prev"; then
5220 case $prev in
5221 output)
5222 func_append compile_command " @OUTPUT@"
5223 func_append finalize_command " @OUTPUT@"
5224 ;;
5225 esac
5226
5227 case $prev in
5228 bindir)
5229 bindir="$arg"
5230 prev=
5231 continue
5232 ;;
5233 dlfiles|dlprefiles)
5234 if test "$preload" = no; then
5235 # Add the symbol object into the linking commands.
5236 func_append compile_command " @SYMFILE@"
5237 func_append finalize_command " @SYMFILE@"
5238 preload=yes
5239 fi
5240 case $arg in
5241 *.la | *.lo) ;; # We handle these cases below.
5242 force)
5243 if test "$dlself" = no; then
5244 dlself=needless
5245 export_dynamic=yes
5246 fi
5247 prev=
5248 continue
5249 ;;
5250 self)
5251 if test "$prev" = dlprefiles; then
5252 dlself=yes
5253 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
5254 dlself=yes
5255 else
5256 dlself=needless
5257 export_dynamic=yes
5258 fi
5259 prev=
5260 continue
5261 ;;
5262 *)
5263 if test "$prev" = dlfiles; then
5264 func_append dlfiles " $arg"
5265 else
5266 func_append dlprefiles " $arg"
5267 fi
5268 prev=
5269 continue
5270 ;;
5271 esac
5272 ;;
5273 expsyms)
5274 export_symbols="$arg"
5275 test -f "$arg" \
5276 || func_fatal_error "symbol file \`$arg' does not exist"
5277 prev=
5278 continue
5279 ;;
5280 expsyms_regex)
5281 export_symbols_regex="$arg"
5282 prev=
5283 continue
5284 ;;
5285 framework)
5286 case $host in
5287 *-*-darwin*)
5288 case "$deplibs " in
5289 *" $qarg.ltframework "*) ;;
5290 *) func_append deplibs " $qarg.ltframework" # this is fixed later
5291 ;;
5292 esac
5293 ;;
5294 esac
5295 prev=
5296 continue
5297 ;;
5298 inst_prefix)
5299 inst_prefix_dir="$arg"
5300 prev=
5301 continue
5302 ;;
5303 objectlist)
5304 if test -f "$arg"; then
5305 save_arg=$arg
5306 moreargs=
5307 for fil in `cat "$save_arg"`
5308 do
5309 # func_append moreargs " $fil"
5310 arg=$fil
5311 # A libtool-controlled object.
5312
5313 # Check to see that this really is a libtool object.
5314 if func_lalib_unsafe_p "$arg"; then
5315 pic_object=
5316 non_pic_object=
5317
5318 # Read the .lo file
5319 func_source "$arg"
5320
5321 if test -z "$pic_object" ||
5322 test -z "$non_pic_object" ||
5323 test "$pic_object" = none &&
5324 test "$non_pic_object" = none; then
5325 func_fatal_error "cannot find name of object for \`$arg'"
5326 fi
5327
5328 # Extract subdirectory from the argument.
5329 func_dirname "$arg" "/" ""
5330 xdir="$func_dirname_result"
5331
5332 if test "$pic_object" != none; then
5333 # Prepend the subdirectory the object is found in.
5334 pic_object="$xdir$pic_object"
5335
5336 if test "$prev" = dlfiles; then
5337 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
5338 func_append dlfiles " $pic_object"
5339 prev=
5340 continue
5341 else
5342 # If libtool objects are unsupported, then we need to preload.
5343 prev=dlprefiles
5344 fi
5345 fi
5346
5347 # CHECK ME: I think I busted this. -Ossama
5348 if test "$prev" = dlprefiles; then
5349 # Preload the old-style object.
5350 func_append dlprefiles " $pic_object"
5351 prev=
5352 fi
5353
5354 # A PIC object.
5355 func_append libobjs " $pic_object"
5356 arg="$pic_object"
5357 fi
5358
5359 # Non-PIC object.
5360 if test "$non_pic_object" != none; then
5361 # Prepend the subdirectory the object is found in.
5362 non_pic_object="$xdir$non_pic_object"
5363
5364 # A standard non-PIC object
5365 func_append non_pic_objects " $non_pic_object"
5366 if test -z "$pic_object" || test "$pic_object" = none ; then
5367 arg="$non_pic_object"
5368 fi
5369 else
5370 # If the PIC object exists, use it instead.
5371 # $xdir was prepended to $pic_object above.
5372 non_pic_object="$pic_object"
5373 func_append non_pic_objects " $non_pic_object"
5374 fi
5375 else
5376 # Only an error if not doing a dry-run.
5377 if $opt_dry_run; then
5378 # Extract subdirectory from the argument.
5379 func_dirname "$arg" "/" ""
5380 xdir="$func_dirname_result"
5381
5382 func_lo2o "$arg"
5383 pic_object=$xdir$objdir/$func_lo2o_result
5384 non_pic_object=$xdir$func_lo2o_result
5385 func_append libobjs " $pic_object"
5386 func_append non_pic_objects " $non_pic_object"
5387 else
5388 func_fatal_error "\`$arg' is not a valid libtool object"
5389 fi
5390 fi
5391 done
5392 else
5393 func_fatal_error "link input file \`$arg' does not exist"
5394 fi
5395 arg=$save_arg
5396 prev=
5397 continue
5398 ;;
5399 precious_regex)
5400 precious_files_regex="$arg"
5401 prev=
5402 continue
5403 ;;
5404 release)
5405 release="-$arg"
5406 prev=
5407 continue
5408 ;;
5409 rpath | xrpath)
5410 # We need an absolute path.
5411 case $arg in
5412 [\\/]* | [A-Za-z]:[\\/]*) ;;
5413 *)
5414 func_fatal_error "only absolute run-paths are allowed"
5415 ;;
5416 esac
5417 if test "$prev" = rpath; then
5418 case "$rpath " in
5419 *" $arg "*) ;;
5420 *) func_append rpath " $arg" ;;
5421 esac
5422 else
5423 case "$xrpath " in
5424 *" $arg "*) ;;
5425 *) func_append xrpath " $arg" ;;
5426 esac
5427 fi
5428 prev=
5429 continue
5430 ;;
5431 shrext)
5432 shrext_cmds="$arg"
5433 prev=
5434 continue
5435 ;;
5436 weak)
5437 func_append weak_libs " $arg"
5438 prev=
5439 continue
5440 ;;
5441 xcclinker)
5442 func_append linker_flags " $qarg"
5443 func_append compiler_flags " $qarg"
5444 prev=
5445 func_append compile_command " $qarg"
5446 func_append finalize_command " $qarg"
5447 continue
5448 ;;
5449 xcompiler)
5450 func_append compiler_flags " $qarg"
5451 prev=
5452 func_append compile_command " $qarg"
5453 func_append finalize_command " $qarg"
5454 continue
5455 ;;
5456 xlinker)
5457 func_append linker_flags " $qarg"
5458 func_append compiler_flags " $wl$qarg"
5459 prev=
5460 func_append compile_command " $wl$qarg"
5461 func_append finalize_command " $wl$qarg"
5462 continue
5463 ;;
5464 *)
5465 eval "$prev=\"\$arg\""
5466 prev=
5467 continue
5468 ;;
5469 esac
5470 fi # test -n "$prev"
5471
5472 prevarg="$arg"
5473
5474 case $arg in
5475 -all-static)
5476 if test -n "$link_static_flag"; then
5477 # See comment for -static flag below, for more details.
5478 func_append compile_command " $link_static_flag"
5479 func_append finalize_command " $link_static_flag"
5480 fi
5481 continue
5482 ;;
5483
5484 -allow-undefined)
5485 # FIXME: remove this flag sometime in the future.
5486 func_fatal_error "\`-allow-undefined' must not be used because it is the default"
5487 ;;
5488
5489 -avoid-version)
5490 avoid_version=yes
5491 continue
5492 ;;
5493
5494 -bindir)
5495 prev=bindir
5496 continue
5497 ;;
5498
5499 -dlopen)
5500 prev=dlfiles
5501 continue
5502 ;;
5503
5504 -dlpreopen)
5505 prev=dlprefiles
5506 continue
5507 ;;
5508
5509 -export-dynamic)
5510 export_dynamic=yes
5511 continue
5512 ;;
5513
5514 -export-symbols | -export-symbols-regex)
5515 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
5516 func_fatal_error "more than one -exported-symbols argument is not allowed"
5517 fi
5518 if test "X$arg" = "X-export-symbols"; then
5519 prev=expsyms
5520 else
5521 prev=expsyms_regex
5522 fi
5523 continue
5524 ;;
5525
5526 -framework)
5527 prev=framework
5528 continue
5529 ;;
5530
5531 -inst-prefix-dir)
5532 prev=inst_prefix
5533 continue
5534 ;;
5535
5536 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
5537 # so, if we see these flags be careful not to treat them like -L
5538 -L[A-Z][A-Z]*:*)
5539 case $with_gcc/$host in
5540 no/*-*-irix* | /*-*-irix*)
5541 func_append compile_command " $arg"
5542 func_append finalize_command " $arg"
5543 ;;
5544 esac
5545 continue
5546 ;;
5547
5548 -L*)
5549 func_stripname "-L" '' "$arg"
5550 if test -z "$func_stripname_result"; then
5551 if test "$#" -gt 0; then
5552 func_fatal_error "require no space between \`-L' and \`$1'"
5553 else
5554 func_fatal_error "need path for \`-L' option"
5555 fi
5556 fi
5557 func_resolve_sysroot "$func_stripname_result"
5558 dir=$func_resolve_sysroot_result
5559 # We need an absolute path.
5560 case $dir in
5561 [\\/]* | [A-Za-z]:[\\/]*) ;;
5562 *)
5563 absdir=`cd "$dir" && pwd`
5564 test -z "$absdir" && \
5565 func_fatal_error "cannot determine absolute directory name of \`$dir'"
5566 dir="$absdir"
5567 ;;
5568 esac
5569 case "$deplibs " in
5570 *" -L$dir "* | *" $arg "*)
5571 # Will only happen for absolute or sysroot arguments
5572 ;;
5573 *)
5574 # Preserve sysroot, but never include relative directories
5575 case $dir in
5576 [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;;
5577 *) func_append deplibs " -L$dir" ;;
5578 esac
5579 func_append lib_search_path " $dir"
5580 ;;
5581 esac
5582 case $host in
5583 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
5584 testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`
5585 case :$dllsearchpath: in
5586 *":$dir:"*) ;;
5587 ::) dllsearchpath=$dir;;
5588 *) func_append dllsearchpath ":$dir";;
5589 esac
5590 case :$dllsearchpath: in
5591 *":$testbindir:"*) ;;
5592 ::) dllsearchpath=$testbindir;;
5593 *) func_append dllsearchpath ":$testbindir";;
5594 esac
5595 ;;
5596 esac
5597 continue
5598 ;;
5599
5600 -l*)
5601 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
5602 case $host in
5603 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
5604 # These systems don't actually have a C or math library (as such)
5605 continue
5606 ;;
5607 *-*-os2*)
5608 # These systems don't actually have a C library (as such)
5609 test "X$arg" = "X-lc" && continue
5610 ;;
5611 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
5612 # Do not include libc due to us having libc/libc_r.
5613 test "X$arg" = "X-lc" && continue
5614 ;;
5615 *-*-rhapsody* | *-*-darwin1.[012])
5616 # Rhapsody C and math libraries are in the System framework
5617 func_append deplibs " System.ltframework"
5618 continue
5619 ;;
5620 *-*-sco3.2v5* | *-*-sco5v6*)
5621 # Causes problems with __ctype
5622 test "X$arg" = "X-lc" && continue
5623 ;;
5624 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
5625 # Compiler inserts libc in the correct place for threads to work
5626 test "X$arg" = "X-lc" && continue
5627 ;;
5628 esac
5629 elif test "X$arg" = "X-lc_r"; then
5630 case $host in
5631 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
5632 # Do not include libc_r directly, use -pthread flag.
5633 continue
5634 ;;
5635 esac
5636 fi
5637 func_append deplibs " $arg"
5638 continue
5639 ;;
5640
5641 -module)
5642 module=yes
5643 continue
5644 ;;
5645
5646 # Tru64 UNIX uses -model [arg] to determine the layout of C++
5647 # classes, name mangling, and exception handling.
5648 # Darwin uses the -arch flag to determine output architecture.
5649 -model|-arch|-isysroot|--sysroot)
5650 func_append compiler_flags " $arg"
5651 func_append compile_command " $arg"
5652 func_append finalize_command " $arg"
5653 prev=xcompiler
5654 continue
5655 ;;
5656
5657 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
5658 |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
5659 func_append compiler_flags " $arg"
5660 func_append compile_command " $arg"
5661 func_append finalize_command " $arg"
5662 case "$new_inherited_linker_flags " in
5663 *" $arg "*) ;;
5664 * ) func_append new_inherited_linker_flags " $arg" ;;
5665 esac
5666 continue
5667 ;;
5668
5669 -multi_module)
5670 single_module="${wl}-multi_module"
5671 continue
5672 ;;
5673
5674 -no-fast-install)
5675 fast_install=no
5676 continue
5677 ;;
5678
5679 -no-install)
5680 case $host in
5681 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
5682 # The PATH hackery in wrapper scripts is required on Windows
5683 # and Darwin in order for the loader to find any dlls it needs.
5684 func_warning "\`-no-install' is ignored for $host"
5685 func_warning "assuming \`-no-fast-install' instead"
5686 fast_install=no
5687 ;;
5688 *) no_install=yes ;;
5689 esac
5690 continue
5691 ;;
5692
5693 -no-undefined)
5694 allow_undefined=no
5695 continue
5696 ;;
5697
5698 -objectlist)
5699 prev=objectlist
5700 continue
5701 ;;
5702
5703 -o) prev=output ;;
5704
5705 -precious-files-regex)
5706 prev=precious_regex
5707 continue
5708 ;;
5709
5710 -release)
5711 prev=release
5712 continue
5713 ;;
5714
5715 -rpath)
5716 prev=rpath
5717 continue
5718 ;;
5719
5720 -R)
5721 prev=xrpath
5722 continue
5723 ;;
5724
5725 -R*)
5726 func_stripname '-R' '' "$arg"
5727 dir=$func_stripname_result
5728 # We need an absolute path.
5729 case $dir in
5730 [\\/]* | [A-Za-z]:[\\/]*) ;;
5731 =*)
5732 func_stripname '=' '' "$dir"
5733 dir=$lt_sysroot$func_stripname_result
5734 ;;
5735 *)
5736 func_fatal_error "only absolute run-paths are allowed"
5737 ;;
5738 esac
5739 case "$xrpath " in
5740 *" $dir "*) ;;
5741 *) func_append xrpath " $dir" ;;
5742 esac
5743 continue
5744 ;;
5745
5746 -shared)
5747 # The effects of -shared are defined in a previous loop.
5748 continue
5749 ;;
5750
5751 -shrext)
5752 prev=shrext
5753 continue
5754 ;;
5755
5756 -static | -static-libtool-libs)
5757 # The effects of -static are defined in a previous loop.
5758 # We used to do the same as -all-static on platforms that
5759 # didn't have a PIC flag, but the assumption that the effects
5760 # would be equivalent was wrong. It would break on at least
5761 # Digital Unix and AIX.
5762 continue
5763 ;;
5764
5765 -thread-safe)
5766 thread_safe=yes
5767 continue
5768 ;;
5769
5770 -version-info)
5771 prev=vinfo
5772 continue
5773 ;;
5774
5775 -version-number)
5776 prev=vinfo
5777 vinfo_number=yes
5778 continue
5779 ;;
5780
5781 -weak)
5782 prev=weak
5783 continue
5784 ;;
5785
5786 -Wc,*)
5787 func_stripname '-Wc,' '' "$arg"
5788 args=$func_stripname_result
5789 arg=
5790 save_ifs="$IFS"; IFS=','
5791 for flag in $args; do
5792 IFS="$save_ifs"
5793 func_quote_for_eval "$flag"
5794 func_append arg " $func_quote_for_eval_result"
5795 func_append compiler_flags " $func_quote_for_eval_result"
5796 done
5797 IFS="$save_ifs"
5798 func_stripname ' ' '' "$arg"
5799 arg=$func_stripname_result
5800 ;;
5801
5802 -Wl,*)
5803 func_stripname '-Wl,' '' "$arg"
5804 args=$func_stripname_result
5805 arg=
5806 save_ifs="$IFS"; IFS=','
5807 for flag in $args; do
5808 IFS="$save_ifs"
5809 func_quote_for_eval "$flag"
5810 func_append arg " $wl$func_quote_for_eval_result"
5811 func_append compiler_flags " $wl$func_quote_for_eval_result"
5812 func_append linker_flags " $func_quote_for_eval_result"
5813 done
5814 IFS="$save_ifs"
5815 func_stripname ' ' '' "$arg"
5816 arg=$func_stripname_result
5817 ;;
5818
5819 -Xcompiler)
5820 prev=xcompiler
5821 continue
5822 ;;
5823
5824 -Xlinker)
5825 prev=xlinker
5826 continue
5827 ;;
5828
5829 -XCClinker)
5830 prev=xcclinker
5831 continue
5832 ;;
5833
5834 # -msg_* for osf cc
5835 -msg_*)
5836 func_quote_for_eval "$arg"
5837 arg="$func_quote_for_eval_result"
5838 ;;
5839
5840 # Flags to be passed through unchanged, with rationale:
5841 # -64, -mips[0-9] enable 64-bit mode for the SGI compiler
5842 # -r[0-9][0-9]* specify processor for the SGI compiler
5843 # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
5844 # +DA*, +DD* enable 64-bit mode for the HP compiler
5845 # -q* compiler args for the IBM compiler
5846 # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
5847 # -F/path path to uninstalled frameworks, gcc on darwin
5848 # -p, -pg, --coverage, -fprofile-* profiling flags for GCC
5849 # @file GCC response files
5850 # -tp=* Portland pgcc target processor selection
5851 # --sysroot=* for sysroot support
5852 # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
5853 -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
5854 -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
5855 -O*|-flto*|-fwhopr*|-fuse-linker-plugin)
5856 func_quote_for_eval "$arg"
5857 arg="$func_quote_for_eval_result"
5858 func_append compile_command " $arg"
5859 func_append finalize_command " $arg"
5860 func_append compiler_flags " $arg"
5861 continue
5862 ;;
5863
5864 # Some other compiler flag.
5865 -* | +*)
5866 func_quote_for_eval "$arg"
5867 arg="$func_quote_for_eval_result"
5868 ;;
5869
5870 *.$objext)
5871 # A standard object.
5872 func_append objs " $arg"
5873 ;;
5874
5875 *.lo)
5876 # A libtool-controlled object.
5877
5878 # Check to see that this really is a libtool object.
5879 if func_lalib_unsafe_p "$arg"; then
5880 pic_object=
5881 non_pic_object=
5882
5883 # Read the .lo file
5884 func_source "$arg"
5885
5886 if test -z "$pic_object" ||
5887 test -z "$non_pic_object" ||
5888 test "$pic_object" = none &&
5889 test "$non_pic_object" = none; then
5890 func_fatal_error "cannot find name of object for \`$arg'"
5891 fi
5892
5893 # Extract subdirectory from the argument.
5894 func_dirname "$arg" "/" ""
5895 xdir="$func_dirname_result"
5896
5897 if test "$pic_object" != none; then
5898 # Prepend the subdirectory the object is found in.
5899 pic_object="$xdir$pic_object"
5900
5901 if test "$prev" = dlfiles; then
5902 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
5903 func_append dlfiles " $pic_object"
5904 prev=
5905 continue
5906 else
5907 # If libtool objects are unsupported, then we need to preload.
5908 prev=dlprefiles
5909 fi
5910 fi
5911
5912 # CHECK ME: I think I busted this. -Ossama
5913 if test "$prev" = dlprefiles; then
5914 # Preload the old-style object.
5915 func_append dlprefiles " $pic_object"
5916 prev=
5917 fi
5918
5919 # A PIC object.
5920 func_append libobjs " $pic_object"
5921 arg="$pic_object"
5922 fi
5923
5924 # Non-PIC object.
5925 if test "$non_pic_object" != none; then
5926 # Prepend the subdirectory the object is found in.
5927 non_pic_object="$xdir$non_pic_object"
5928
5929 # A standard non-PIC object
5930 func_append non_pic_objects " $non_pic_object"
5931 if test -z "$pic_object" || test "$pic_object" = none ; then
5932 arg="$non_pic_object"
5933 fi
5934 else
5935 # If the PIC object exists, use it instead.
5936 # $xdir was prepended to $pic_object above.
5937 non_pic_object="$pic_object"
5938 func_append non_pic_objects " $non_pic_object"
5939 fi
5940 else
5941 # Only an error if not doing a dry-run.
5942 if $opt_dry_run; then
5943 # Extract subdirectory from the argument.
5944 func_dirname "$arg" "/" ""
5945 xdir="$func_dirname_result"
5946
5947 func_lo2o "$arg"
5948 pic_object=$xdir$objdir/$func_lo2o_result
5949 non_pic_object=$xdir$func_lo2o_result
5950 func_append libobjs " $pic_object"
5951 func_append non_pic_objects " $non_pic_object"
5952 else
5953 func_fatal_error "\`$arg' is not a valid libtool object"
5954 fi
5955 fi
5956 ;;
5957
5958 *.$libext)
5959 # An archive.
5960 func_append deplibs " $arg"
5961 func_append old_deplibs " $arg"
5962 continue
5963 ;;
5964
5965 *.la)
5966 # A libtool-controlled library.
5967
5968 func_resolve_sysroot "$arg"
5969 if test "$prev" = dlfiles; then
5970 # This library was specified with -dlopen.
5971 func_append dlfiles " $func_resolve_sysroot_result"
5972 prev=
5973 elif test "$prev" = dlprefiles; then
5974 # The library was specified with -dlpreopen.
5975 func_append dlprefiles " $func_resolve_sysroot_result"
5976 prev=
5977 else
5978 func_append deplibs " $func_resolve_sysroot_result"
5979 fi
5980 continue
5981 ;;
5982
5983 # Some other compiler argument.
5984 *)
5985 # Unknown arguments in both finalize_command and compile_command need
5986 # to be aesthetically quoted because they are evaled later.
5987 func_quote_for_eval "$arg"
5988 arg="$func_quote_for_eval_result"
5989 ;;
5990 esac # arg
5991
5992 # Now actually substitute the argument into the commands.
5993 if test -n "$arg"; then
5994 func_append compile_command " $arg"
5995 func_append finalize_command " $arg"
5996 fi
5997 done # argument parsing loop
5998
5999 test -n "$prev" && \
6000 func_fatal_help "the \`$prevarg' option requires an argument"
6001
6002 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
6003 eval arg=\"$export_dynamic_flag_spec\"
6004 func_append compile_command " $arg"
6005 func_append finalize_command " $arg"
6006 fi
6007
6008 oldlibs=
6009 # calculate the name of the file, without its directory
6010 func_basename "$output"
6011 outputname="$func_basename_result"
6012 libobjs_save="$libobjs"
6013
6014 if test -n "$shlibpath_var"; then
6015 # get the directories listed in $shlibpath_var
6016 eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\`
6017 else
6018 shlib_search_path=
6019 fi
6020 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
6021 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
6022
6023 func_dirname "$output" "/" ""
6024 output_objdir="$func_dirname_result$objdir"
6025 func_to_tool_file "$output_objdir/"
6026 tool_output_objdir=$func_to_tool_file_result
6027 # Create the object directory.
6028 func_mkdir_p "$output_objdir"
6029
6030 # Determine the type of output
6031 case $output in
6032 "")
6033 func_fatal_help "you must specify an output file"
6034 ;;
6035 *.$libext) linkmode=oldlib ;;
6036 *.lo | *.$objext) linkmode=obj ;;
6037 *.la) linkmode=lib ;;
6038 *) linkmode=prog ;; # Anything else should be a program.
6039 esac
6040
6041 specialdeplibs=
6042
6043 libs=
6044 # Find all interdependent deplibs by searching for libraries
6045 # that are linked more than once (e.g. -la -lb -la)
6046 for deplib in $deplibs; do
6047 if $opt_preserve_dup_deps ; then
6048 case "$libs " in
6049 *" $deplib "*) func_append specialdeplibs " $deplib" ;;
6050 esac
6051 fi
6052 func_append libs " $deplib"
6053 done
6054
6055 if test "$linkmode" = lib; then
6056 libs="$predeps $libs $compiler_lib_search_path $postdeps"
6057
6058 # Compute libraries that are listed more than once in $predeps
6059 # $postdeps and mark them as special (i.e., whose duplicates are
6060 # not to be eliminated).
6061 pre_post_deps=
6062 if $opt_duplicate_compiler_generated_deps; then
6063 for pre_post_dep in $predeps $postdeps; do
6064 case "$pre_post_deps " in
6065 *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;;
6066 esac
6067 func_append pre_post_deps " $pre_post_dep"
6068 done
6069 fi
6070 pre_post_deps=
6071 fi
6072
6073 deplibs=
6074 newdependency_libs=
6075 newlib_search_path=
6076 need_relink=no # whether we're linking any uninstalled libtool libraries
6077 notinst_deplibs= # not-installed libtool libraries
6078 notinst_path= # paths that contain not-installed libtool libraries
6079
6080 case $linkmode in
6081 lib)
6082 passes="conv dlpreopen link"
6083 for file in $dlfiles $dlprefiles; do
6084 case $file in
6085 *.la) ;;
6086 *)
6087 func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
6088 ;;
6089 esac
6090 done
6091 ;;
6092 prog)
6093 compile_deplibs=
6094 finalize_deplibs=
6095 alldeplibs=no
6096 newdlfiles=
6097 newdlprefiles=
6098 passes="conv scan dlopen dlpreopen link"
6099 ;;
6100 *) passes="conv"
6101 ;;
6102 esac
6103
6104 for pass in $passes; do
6105 # The preopen pass in lib mode reverses $deplibs; put it back here
6106 # so that -L comes before libs that need it for instance...
6107 if test "$linkmode,$pass" = "lib,link"; then
6108 ## FIXME: Find the place where the list is rebuilt in the wrong
6109 ## order, and fix it there properly
6110 tmp_deplibs=
6111 for deplib in $deplibs; do
6112 tmp_deplibs="$deplib $tmp_deplibs"
6113 done
6114 deplibs="$tmp_deplibs"
6115 fi
6116
6117 if test "$linkmode,$pass" = "lib,link" ||
6118 test "$linkmode,$pass" = "prog,scan"; then
6119 libs="$deplibs"
6120 deplibs=
6121 fi
6122 if test "$linkmode" = prog; then
6123 case $pass in
6124 dlopen) libs="$dlfiles" ;;
6125 dlpreopen) libs="$dlprefiles" ;;
6126 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
6127 esac
6128 fi
6129 if test "$linkmode,$pass" = "lib,dlpreopen"; then
6130 # Collect and forward deplibs of preopened libtool libs
6131 for lib in $dlprefiles; do
6132 # Ignore non-libtool-libs
6133 dependency_libs=
6134 func_resolve_sysroot "$lib"
6135 case $lib in
6136 *.la) func_source "$func_resolve_sysroot_result" ;;
6137 esac
6138
6139 # Collect preopened libtool deplibs, except any this library
6140 # has declared as weak libs
6141 for deplib in $dependency_libs; do
6142 func_basename "$deplib"
6143 deplib_base=$func_basename_result
6144 case " $weak_libs " in
6145 *" $deplib_base "*) ;;
6146 *) func_append deplibs " $deplib" ;;
6147 esac
6148 done
6149 done
6150 libs="$dlprefiles"
6151 fi
6152 if test "$pass" = dlopen; then
6153 # Collect dlpreopened libraries
6154 save_deplibs="$deplibs"
6155 deplibs=
6156 fi
6157
6158 for deplib in $libs; do
6159 lib=
6160 found=no
6161 case $deplib in
6162 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
6163 |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
6164 if test "$linkmode,$pass" = "prog,link"; then
6165 compile_deplibs="$deplib $compile_deplibs"
6166 finalize_deplibs="$deplib $finalize_deplibs"
6167 else
6168 func_append compiler_flags " $deplib"
6169 if test "$linkmode" = lib ; then
6170 case "$new_inherited_linker_flags " in
6171 *" $deplib "*) ;;
6172 * ) func_append new_inherited_linker_flags " $deplib" ;;
6173 esac
6174 fi
6175 fi
6176 continue
6177 ;;
6178 -l*)
6179 if test "$linkmode" != lib && test "$linkmode" != prog; then
6180 func_warning "\`-l' is ignored for archives/objects"
6181 continue
6182 fi
6183 func_stripname '-l' '' "$deplib"
6184 name=$func_stripname_result
6185 if test "$linkmode" = lib; then
6186 searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
6187 else
6188 searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
6189 fi
6190 for searchdir in $searchdirs; do
6191 for search_ext in .la $std_shrext .so .a; do
6192 # Search the libtool library
6193 lib="$searchdir/lib${name}${search_ext}"
6194 if test -f "$lib"; then
6195 if test "$search_ext" = ".la"; then
6196 found=yes
6197 else
6198 found=no
6199 fi
6200 break 2
6201 fi
6202 done
6203 done
6204 if test "$found" != yes; then
6205 # deplib doesn't seem to be a libtool library
6206 if test "$linkmode,$pass" = "prog,link"; then
6207 compile_deplibs="$deplib $compile_deplibs"
6208 finalize_deplibs="$deplib $finalize_deplibs"
6209 else
6210 deplibs="$deplib $deplibs"
6211 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
6212 fi
6213 continue
6214 else # deplib is a libtool library
6215 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
6216 # We need to do some special things here, and not later.
6217 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
6218 case " $predeps $postdeps " in
6219 *" $deplib "*)
6220 if func_lalib_p "$lib"; then
6221 library_names=
6222 old_library=
6223 func_source "$lib"
6224 for l in $old_library $library_names; do
6225 ll="$l"
6226 done
6227 if test "X$ll" = "X$old_library" ; then # only static version available
6228 found=no
6229 func_dirname "$lib" "" "."
6230 ladir="$func_dirname_result"
6231 lib=$ladir/$old_library
6232 if test "$linkmode,$pass" = "prog,link"; then
6233 compile_deplibs="$deplib $compile_deplibs"
6234 finalize_deplibs="$deplib $finalize_deplibs"
6235 else
6236 deplibs="$deplib $deplibs"
6237 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
6238 fi
6239 continue
6240 fi
6241 fi
6242 ;;
6243 *) ;;
6244 esac
6245 fi
6246 fi
6247 ;; # -l
6248 *.ltframework)
6249 if test "$linkmode,$pass" = "prog,link"; then
6250 compile_deplibs="$deplib $compile_deplibs"
6251 finalize_deplibs="$deplib $finalize_deplibs"
6252 else
6253 deplibs="$deplib $deplibs"
6254 if test "$linkmode" = lib ; then
6255 case "$new_inherited_linker_flags " in
6256 *" $deplib "*) ;;
6257 * ) func_append new_inherited_linker_flags " $deplib" ;;
6258 esac
6259 fi
6260 fi
6261 continue
6262 ;;
6263 -L*)
6264 case $linkmode in
6265 lib)
6266 deplibs="$deplib $deplibs"
6267 test "$pass" = conv && continue
6268 newdependency_libs="$deplib $newdependency_libs"
6269 func_stripname '-L' '' "$deplib"
6270 func_resolve_sysroot "$func_stripname_result"
6271 func_append newlib_search_path " $func_resolve_sysroot_result"
6272 ;;
6273 prog)
6274 if test "$pass" = conv; then
6275 deplibs="$deplib $deplibs"
6276 continue
6277 fi
6278 if test "$pass" = scan; then
6279 deplibs="$deplib $deplibs"
6280 else
6281 compile_deplibs="$deplib $compile_deplibs"
6282 finalize_deplibs="$deplib $finalize_deplibs"
6283 fi
6284 func_stripname '-L' '' "$deplib"
6285 func_resolve_sysroot "$func_stripname_result"
6286 func_append newlib_search_path " $func_resolve_sysroot_result"
6287 ;;
6288 *)
6289 func_warning "\`-L' is ignored for archives/objects"
6290 ;;
6291 esac # linkmode
6292 continue
6293 ;; # -L
6294 -R*)
6295 if test "$pass" = link; then
6296 func_stripname '-R' '' "$deplib"
6297 func_resolve_sysroot "$func_stripname_result"
6298 dir=$func_resolve_sysroot_result
6299 # Make sure the xrpath contains only unique directories.
6300 case "$xrpath " in
6301 *" $dir "*) ;;
6302 *) func_append xrpath " $dir" ;;
6303 esac
6304 fi
6305 deplibs="$deplib $deplibs"
6306 continue
6307 ;;
6308 *.la)
6309 func_resolve_sysroot "$deplib"
6310 lib=$func_resolve_sysroot_result
6311 ;;
6312 *.$libext)
6313 if test "$pass" = conv; then
6314 deplibs="$deplib $deplibs"
6315 continue
6316 fi
6317 case $linkmode in
6318 lib)
6319 # Linking convenience modules into shared libraries is allowed,
6320 # but linking other static libraries is non-portable.
6321 case " $dlpreconveniencelibs " in
6322 *" $deplib "*) ;;
6323 *)
6324 valid_a_lib=no
6325 case $deplibs_check_method in
6326 match_pattern*)
6327 set dummy $deplibs_check_method; shift
6328 match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
6329 if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
6330 | $EGREP "$match_pattern_regex" > /dev/null; then
6331 valid_a_lib=yes
6332 fi
6333 ;;
6334 pass_all)
6335 valid_a_lib=yes
6336 ;;
6337 esac
6338 if test "$valid_a_lib" != yes; then
6339 echo
6340 $ECHO "*** Warning: Trying to link with static lib archive $deplib."
6341 echo "*** I have the capability to make that library automatically link in when"
6342 echo "*** you link to this library. But I can only do this if you have a"
6343 echo "*** shared version of the library, which you do not appear to have"
6344 echo "*** because the file extensions .$libext of this argument makes me believe"
6345 echo "*** that it is just a static archive that I should not use here."
6346 else
6347 echo
6348 $ECHO "*** Warning: Linking the shared library $output against the"
6349 $ECHO "*** static library $deplib is not portable!"
6350 deplibs="$deplib $deplibs"
6351 fi
6352 ;;
6353 esac
6354 continue
6355 ;;
6356 prog)
6357 if test "$pass" != link; then
6358 deplibs="$deplib $deplibs"
6359 else
6360 compile_deplibs="$deplib $compile_deplibs"
6361 finalize_deplibs="$deplib $finalize_deplibs"
6362 fi
6363 continue
6364 ;;
6365 esac # linkmode
6366 ;; # *.$libext
6367 *.lo | *.$objext)
6368 if test "$pass" = conv; then
6369 deplibs="$deplib $deplibs"
6370 elif test "$linkmode" = prog; then
6371 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
6372 # If there is no dlopen support or we're linking statically,
6373 # we need to preload.
6374 func_append newdlprefiles " $deplib"
6375 compile_deplibs="$deplib $compile_deplibs"
6376 finalize_deplibs="$deplib $finalize_deplibs"
6377 else
6378 func_append newdlfiles " $deplib"
6379 fi
6380 fi
6381 continue
6382 ;;
6383 %DEPLIBS%)
6384 alldeplibs=yes
6385 continue
6386 ;;
6387 esac # case $deplib
6388
6389 if test "$found" = yes || test -f "$lib"; then :
6390 else
6391 func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
6392 fi
6393
6394 # Check to see that this really is a libtool archive.
6395 func_lalib_unsafe_p "$lib" \
6396 || func_fatal_error "\`$lib' is not a valid libtool archive"
6397
6398 func_dirname "$lib" "" "."
6399 ladir="$func_dirname_result"
6400
6401 dlname=
6402 dlopen=
6403 dlpreopen=
6404 libdir=
6405 library_names=
6406 old_library=
6407 inherited_linker_flags=
6408 # If the library was installed with an old release of libtool,
6409 # it will not redefine variables installed, or shouldnotlink
6410 installed=yes
6411 shouldnotlink=no
6412 avoidtemprpath=
6413
6414
6415 # Read the .la file
6416 func_source "$lib"
6417
6418 # Convert "-framework foo" to "foo.ltframework"
6419 if test -n "$inherited_linker_flags"; then
6420 tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
6421 for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
6422 case " $new_inherited_linker_flags " in
6423 *" $tmp_inherited_linker_flag "*) ;;
6424 *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";;
6425 esac
6426 done
6427 fi
6428 dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
6429 if test "$linkmode,$pass" = "lib,link" ||
6430 test "$linkmode,$pass" = "prog,scan" ||
6431 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
6432 test -n "$dlopen" && func_append dlfiles " $dlopen"
6433 test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
6434 fi
6435
6436 if test "$pass" = conv; then
6437 # Only check for convenience libraries
6438 deplibs="$lib $deplibs"
6439 if test -z "$libdir"; then
6440 if test -z "$old_library"; then
6441 func_fatal_error "cannot find name of link library for \`$lib'"
6442 fi
6443 # It is a libtool convenience library, so add in its objects.
6444 func_append convenience " $ladir/$objdir/$old_library"
6445 func_append old_convenience " $ladir/$objdir/$old_library"
6446 elif test "$linkmode" != prog && test "$linkmode" != lib; then
6447 func_fatal_error "\`$lib' is not a convenience library"
6448 fi
6449 tmp_libs=
6450 for deplib in $dependency_libs; do
6451 deplibs="$deplib $deplibs"
6452 if $opt_preserve_dup_deps ; then
6453 case "$tmp_libs " in
6454 *" $deplib "*) func_append specialdeplibs " $deplib" ;;
6455 esac
6456 fi
6457 func_append tmp_libs " $deplib"
6458 done
6459 continue
6460 fi # $pass = conv
6461
6462
6463 # Get the name of the library we link against.
6464 linklib=
6465 if test -n "$old_library" &&
6466 { test "$prefer_static_libs" = yes ||
6467 test "$prefer_static_libs,$installed" = "built,no"; }; then
6468 linklib=$old_library
6469 else
6470 for l in $old_library $library_names; do
6471 linklib="$l"
6472 done
6473 fi
6474 if test -z "$linklib"; then
6475 func_fatal_error "cannot find name of link library for \`$lib'"
6476 fi
6477
6478 # This library was specified with -dlopen.
6479 if test "$pass" = dlopen; then
6480 if test -z "$libdir"; then
6481 func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
6482 fi
6483 if test -z "$dlname" ||
6484 test "$dlopen_support" != yes ||
6485 test "$build_libtool_libs" = no; then
6486 # If there is no dlname, no dlopen support or we're linking
6487 # statically, we need to preload. We also need to preload any
6488 # dependent libraries so libltdl's deplib preloader doesn't
6489 # bomb out in the load deplibs phase.
6490 func_append dlprefiles " $lib $dependency_libs"
6491 else
6492 func_append newdlfiles " $lib"
6493 fi
6494 continue
6495 fi # $pass = dlopen
6496
6497 # We need an absolute path.
6498 case $ladir in
6499 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
6500 *)
6501 abs_ladir=`cd "$ladir" && pwd`
6502 if test -z "$abs_ladir"; then
6503 func_warning "cannot determine absolute directory name of \`$ladir'"
6504 func_warning "passing it literally to the linker, although it might fail"
6505 abs_ladir="$ladir"
6506 fi
6507 ;;
6508 esac
6509 func_basename "$lib"
6510 laname="$func_basename_result"
6511
6512 # Find the relevant object directory and library name.
6513 if test "X$installed" = Xyes; then
6514 if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
6515 func_warning "library \`$lib' was moved."
6516 dir="$ladir"
6517 absdir="$abs_ladir"
6518 libdir="$abs_ladir"
6519 else
6520 dir="$lt_sysroot$libdir"
6521 absdir="$lt_sysroot$libdir"
6522 fi
6523 test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
6524 else
6525 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
6526 dir="$ladir"
6527 absdir="$abs_ladir"
6528 # Remove this search path later
6529 func_append notinst_path " $abs_ladir"
6530 else
6531 dir="$ladir/$objdir"
6532 absdir="$abs_ladir/$objdir"
6533 # Remove this search path later
6534 func_append notinst_path " $abs_ladir"
6535 fi
6536 fi # $installed = yes
6537 func_stripname 'lib' '.la' "$laname"
6538 name=$func_stripname_result
6539
6540 # This library was specified with -dlpreopen.
6541 if test "$pass" = dlpreopen; then
6542 if test -z "$libdir" && test "$linkmode" = prog; then
6543 func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
6544 fi
6545 case "$host" in
6546 # special handling for platforms with PE-DLLs.
6547 *cygwin* | *mingw* | *cegcc* )
6548 # Linker will automatically link against shared library if both
6549 # static and shared are present. Therefore, ensure we extract
6550 # symbols from the import library if a shared library is present
6551 # (otherwise, the dlopen module name will be incorrect). We do
6552 # this by putting the import library name into $newdlprefiles.
6553 # We recover the dlopen module name by 'saving' the la file
6554 # name in a special purpose variable, and (later) extracting the
6555 # dlname from the la file.
6556 if test -n "$dlname"; then
6557 func_tr_sh "$dir/$linklib"
6558 eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"
6559 func_append newdlprefiles " $dir/$linklib"
6560 else
6561 func_append newdlprefiles " $dir/$old_library"
6562 # Keep a list of preopened convenience libraries to check
6563 # that they are being used correctly in the link pass.
6564 test -z "$libdir" && \
6565 func_append dlpreconveniencelibs " $dir/$old_library"
6566 fi
6567 ;;
6568 * )
6569 # Prefer using a static library (so that no silly _DYNAMIC symbols
6570 # are required to link).
6571 if test -n "$old_library"; then
6572 func_append newdlprefiles " $dir/$old_library"
6573 # Keep a list of preopened convenience libraries to check
6574 # that they are being used correctly in the link pass.
6575 test -z "$libdir" && \
6576 func_append dlpreconveniencelibs " $dir/$old_library"
6577 # Otherwise, use the dlname, so that lt_dlopen finds it.
6578 elif test -n "$dlname"; then
6579 func_append newdlprefiles " $dir/$dlname"
6580 else
6581 func_append newdlprefiles " $dir/$linklib"
6582 fi
6583 ;;
6584 esac
6585 fi # $pass = dlpreopen
6586
6587 if test -z "$libdir"; then
6588 # Link the convenience library
6589 if test "$linkmode" = lib; then
6590 deplibs="$dir/$old_library $deplibs"
6591 elif test "$linkmode,$pass" = "prog,link"; then
6592 compile_deplibs="$dir/$old_library $compile_deplibs"
6593 finalize_deplibs="$dir/$old_library $finalize_deplibs"
6594 else
6595 deplibs="$lib $deplibs" # used for prog,scan pass
6596 fi
6597 continue
6598 fi
6599
6600
6601 if test "$linkmode" = prog && test "$pass" != link; then
6602 func_append newlib_search_path " $ladir"
6603 deplibs="$lib $deplibs"
6604
6605 linkalldeplibs=no
6606 if test "$link_all_deplibs" != no || test -z "$library_names" ||
6607 test "$build_libtool_libs" = no; then
6608 linkalldeplibs=yes
6609 fi
6610
6611 tmp_libs=
6612 for deplib in $dependency_libs; do
6613 case $deplib in
6614 -L*) func_stripname '-L' '' "$deplib"
6615 func_resolve_sysroot "$func_stripname_result"
6616 func_append newlib_search_path " $func_resolve_sysroot_result"
6617 ;;
6618 esac
6619 # Need to link against all dependency_libs?
6620 if test "$linkalldeplibs" = yes; then
6621 deplibs="$deplib $deplibs"
6622 else
6623 # Need to hardcode shared library paths
6624 # or/and link against static libraries
6625 newdependency_libs="$deplib $newdependency_libs"
6626 fi
6627 if $opt_preserve_dup_deps ; then
6628 case "$tmp_libs " in
6629 *" $deplib "*) func_append specialdeplibs " $deplib" ;;
6630 esac
6631 fi
6632 func_append tmp_libs " $deplib"
6633 done # for deplib
6634 continue
6635 fi # $linkmode = prog...
6636
6637 if test "$linkmode,$pass" = "prog,link"; then
6638 if test -n "$library_names" &&
6639 { { test "$prefer_static_libs" = no ||
6640 test "$prefer_static_libs,$installed" = "built,yes"; } ||
6641 test -z "$old_library"; }; then
6642 # We need to hardcode the library path
6643 if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
6644 # Make sure the rpath contains only unique directories.
6645 case "$temp_rpath:" in
6646 *"$absdir:"*) ;;
6647 *) func_append temp_rpath "$absdir:" ;;
6648 esac
6649 fi
6650
6651 # Hardcode the library path.
6652 # Skip directories that are in the system default run-time
6653 # search path.
6654 case " $sys_lib_dlsearch_path " in
6655 *" $absdir "*) ;;
6656 *)
6657 case "$compile_rpath " in
6658 *" $absdir "*) ;;
6659 *) func_append compile_rpath " $absdir" ;;
6660 esac
6661 ;;
6662 esac
6663 case " $sys_lib_dlsearch_path " in
6664 *" $libdir "*) ;;
6665 *)
6666 case "$finalize_rpath " in
6667 *" $libdir "*) ;;
6668 *) func_append finalize_rpath " $libdir" ;;
6669 esac
6670 ;;
6671 esac
6672 fi # $linkmode,$pass = prog,link...
6673
6674 if test "$alldeplibs" = yes &&
6675 { test "$deplibs_check_method" = pass_all ||
6676 { test "$build_libtool_libs" = yes &&
6677 test -n "$library_names"; }; }; then
6678 # We only need to search for static libraries
6679 continue
6680 fi
6681 fi
6682
6683 link_static=no # Whether the deplib will be linked statically
6684 use_static_libs=$prefer_static_libs
6685 if test "$use_static_libs" = built && test "$installed" = yes; then
6686 use_static_libs=no
6687 fi
6688 if test -n "$library_names" &&
6689 { test "$use_static_libs" = no || test -z "$old_library"; }; then
6690 case $host in
6691 *cygwin* | *mingw* | *cegcc*)
6692 # No point in relinking DLLs because paths are not encoded
6693 func_append notinst_deplibs " $lib"
6694 need_relink=no
6695 ;;
6696 *)
6697 if test "$installed" = no; then
6698 func_append notinst_deplibs " $lib"
6699 need_relink=yes
6700 fi
6701 ;;
6702 esac
6703 # This is a shared library
6704
6705 # Warn about portability, can't link against -module's on some
6706 # systems (darwin). Don't bleat about dlopened modules though!
6707 dlopenmodule=""
6708 for dlpremoduletest in $dlprefiles; do
6709 if test "X$dlpremoduletest" = "X$lib"; then
6710 dlopenmodule="$dlpremoduletest"
6711 break
6712 fi
6713 done
6714 if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
6715 echo
6716 if test "$linkmode" = prog; then
6717 $ECHO "*** Warning: Linking the executable $output against the loadable module"
6718 else
6719 $ECHO "*** Warning: Linking the shared library $output against the loadable module"
6720 fi
6721 $ECHO "*** $linklib is not portable!"
6722 fi
6723 if test "$linkmode" = lib &&
6724 test "$hardcode_into_libs" = yes; then
6725 # Hardcode the library path.
6726 # Skip directories that are in the system default run-time
6727 # search path.
6728 case " $sys_lib_dlsearch_path " in
6729 *" $absdir "*) ;;
6730 *)
6731 case "$compile_rpath " in
6732 *" $absdir "*) ;;
6733 *) func_append compile_rpath " $absdir" ;;
6734 esac
6735 ;;
6736 esac
6737 case " $sys_lib_dlsearch_path " in
6738 *" $libdir "*) ;;
6739 *)
6740 case "$finalize_rpath " in
6741 *" $libdir "*) ;;
6742 *) func_append finalize_rpath " $libdir" ;;
6743 esac
6744 ;;
6745 esac
6746 fi
6747
6748 if test -n "$old_archive_from_expsyms_cmds"; then
6749 # figure out the soname
6750 set dummy $library_names
6751 shift
6752 realname="$1"
6753 shift
6754 libname=`eval "\\$ECHO \"$libname_spec\""`
6755 # use dlname if we got it. it's perfectly good, no?
6756 if test -n "$dlname"; then
6757 soname="$dlname"
6758 elif test -n "$soname_spec"; then
6759 # bleh windows
6760 case $host in
6761 *cygwin* | mingw* | *cegcc*)
6762 func_arith $current - $age
6763 major=$func_arith_result
6764 versuffix="-$major"
6765 ;;
6766 esac
6767 eval soname=\"$soname_spec\"
6768 else
6769 soname="$realname"
6770 fi
6771
6772 # Make a new name for the extract_expsyms_cmds to use
6773 soroot="$soname"
6774 func_basename "$soroot"
6775 soname="$func_basename_result"
6776 func_stripname 'lib' '.dll' "$soname"
6777 newlib=libimp-$func_stripname_result.a
6778
6779 # If the library has no export list, then create one now
6780 if test -f "$output_objdir/$soname-def"; then :
6781 else
6782 func_verbose "extracting exported symbol list from \`$soname'"
6783 func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
6784 fi
6785
6786 # Create $newlib
6787 if test -f "$output_objdir/$newlib"; then :; else
6788 func_verbose "generating import library for \`$soname'"
6789 func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
6790 fi
6791 # make sure the library variables are pointing to the new library
6792 dir=$output_objdir
6793 linklib=$newlib
6794 fi # test -n "$old_archive_from_expsyms_cmds"
6795
6796 if test "$linkmode" = prog || test "$opt_mode" != relink; then
6797 add_shlibpath=
6798 add_dir=
6799 add=
6800 lib_linked=yes
6801 case $hardcode_action in
6802 immediate | unsupported)
6803 if test "$hardcode_direct" = no; then
6804 add="$dir/$linklib"
6805 case $host in
6806 *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
6807 *-*-sysv4*uw2*) add_dir="-L$dir" ;;
6808 *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
6809 *-*-unixware7*) add_dir="-L$dir" ;;
6810 *-*-darwin* )
6811 # if the lib is a (non-dlopened) module then we can not
6812 # link against it, someone is ignoring the earlier warnings
6813 if /usr/bin/file -L $add 2> /dev/null |
6814 $GREP ": [^:]* bundle" >/dev/null ; then
6815 if test "X$dlopenmodule" != "X$lib"; then
6816 $ECHO "*** Warning: lib $linklib is a module, not a shared library"
6817 if test -z "$old_library" ; then
6818 echo
6819 echo "*** And there doesn't seem to be a static archive available"
6820 echo "*** The link will probably fail, sorry"
6821 else
6822 add="$dir/$old_library"
6823 fi
6824 elif test -n "$old_library"; then
6825 add="$dir/$old_library"
6826 fi
6827 fi
6828 esac
6829 elif test "$hardcode_minus_L" = no; then
6830 case $host in
6831 *-*-sunos*) add_shlibpath="$dir" ;;
6832 esac
6833 add_dir="-L$dir"
6834 add="-l$name"
6835 elif test "$hardcode_shlibpath_var" = no; then
6836 add_shlibpath="$dir"
6837 add="-l$name"
6838 else
6839 lib_linked=no
6840 fi
6841 ;;
6842 relink)
6843 if test "$hardcode_direct" = yes &&
6844 test "$hardcode_direct_absolute" = no; then
6845 add="$dir/$linklib"
6846 elif test "$hardcode_minus_L" = yes; then
6847 add_dir="-L$absdir"
6848 # Try looking first in the location we're being installed to.
6849 if test -n "$inst_prefix_dir"; then
6850 case $libdir in
6851 [\\/]*)
6852 func_append add_dir " -L$inst_prefix_dir$libdir"
6853 ;;
6854 esac
6855 fi
6856 add="-l$name"
6857 elif test "$hardcode_shlibpath_var" = yes; then
6858 add_shlibpath="$dir"
6859 add="-l$name"
6860 else
6861 lib_linked=no
6862 fi
6863 ;;
6864 *) lib_linked=no ;;
6865 esac
6866
6867 if test "$lib_linked" != yes; then
6868 func_fatal_configuration "unsupported hardcode properties"
6869 fi
6870
6871 if test -n "$add_shlibpath"; then
6872 case :$compile_shlibpath: in
6873 *":$add_shlibpath:"*) ;;
6874 *) func_append compile_shlibpath "$add_shlibpath:" ;;
6875 esac
6876 fi
6877 if test "$linkmode" = prog; then
6878 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
6879 test -n "$add" && compile_deplibs="$add $compile_deplibs"
6880 else
6881 test -n "$add_dir" && deplibs="$add_dir $deplibs"
6882 test -n "$add" && deplibs="$add $deplibs"
6883 if test "$hardcode_direct" != yes &&
6884 test "$hardcode_minus_L" != yes &&
6885 test "$hardcode_shlibpath_var" = yes; then
6886 case :$finalize_shlibpath: in
6887 *":$libdir:"*) ;;
6888 *) func_append finalize_shlibpath "$libdir:" ;;
6889 esac
6890 fi
6891 fi
6892 fi
6893
6894 if test "$linkmode" = prog || test "$opt_mode" = relink; then
6895 add_shlibpath=
6896 add_dir=
6897 add=
6898 # Finalize command for both is simple: just hardcode it.
6899 if test "$hardcode_direct" = yes &&
6900 test "$hardcode_direct_absolute" = no; then
6901 add="$libdir/$linklib"
6902 elif test "$hardcode_minus_L" = yes; then
6903 add_dir="-L$libdir"
6904 add="-l$name"
6905 elif test "$hardcode_shlibpath_var" = yes; then
6906 case :$finalize_shlibpath: in
6907 *":$libdir:"*) ;;
6908 *) func_append finalize_shlibpath "$libdir:" ;;
6909 esac
6910 add="-l$name"
6911 elif test "$hardcode_automatic" = yes; then
6912 if test -n "$inst_prefix_dir" &&
6913 test -f "$inst_prefix_dir$libdir/$linklib" ; then
6914 add="$inst_prefix_dir$libdir/$linklib"
6915 else
6916 add="$libdir/$linklib"
6917 fi
6918 else
6919 # We cannot seem to hardcode it, guess we'll fake it.
6920 add_dir="-L$libdir"
6921 # Try looking first in the location we're being installed to.
6922 if test -n "$inst_prefix_dir"; then
6923 case $libdir in
6924 [\\/]*)
6925 func_append add_dir " -L$inst_prefix_dir$libdir"
6926 ;;
6927 esac
6928 fi
6929 add="-l$name"
6930 fi
6931
6932 if test "$linkmode" = prog; then
6933 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
6934 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
6935 else
6936 test -n "$add_dir" && deplibs="$add_dir $deplibs"
6937 test -n "$add" && deplibs="$add $deplibs"
6938 fi
6939 fi
6940 elif test "$linkmode" = prog; then
6941 # Here we assume that one of hardcode_direct or hardcode_minus_L
6942 # is not unsupported. This is valid on all known static and
6943 # shared platforms.
6944 if test "$hardcode_direct" != unsupported; then
6945 test -n "$old_library" && linklib="$old_library"
6946 compile_deplibs="$dir/$linklib $compile_deplibs"
6947 finalize_deplibs="$dir/$linklib $finalize_deplibs"
6948 else
6949 compile_deplibs="-l$name -L$dir $compile_deplibs"
6950 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
6951 fi
6952 elif test "$build_libtool_libs" = yes; then
6953 # Not a shared library
6954 if test "$deplibs_check_method" != pass_all; then
6955 # We're trying link a shared library against a static one
6956 # but the system doesn't support it.
6957
6958 # Just print a warning and add the library to dependency_libs so
6959 # that the program can be linked against the static library.
6960 echo
6961 $ECHO "*** Warning: This system can not link to static lib archive $lib."
6962 echo "*** I have the capability to make that library automatically link in when"
6963 echo "*** you link to this library. But I can only do this if you have a"
6964 echo "*** shared version of the library, which you do not appear to have."
6965 if test "$module" = yes; then
6966 echo "*** But as you try to build a module library, libtool will still create "
6967 echo "*** a static module, that should work as long as the dlopening application"
6968 echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
6969 if test -z "$global_symbol_pipe"; then
6970 echo
6971 echo "*** However, this would only work if libtool was able to extract symbol"
6972 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
6973 echo "*** not find such a program. So, this module is probably useless."
6974 echo "*** \`nm' from GNU binutils and a full rebuild may help."
6975 fi
6976 if test "$build_old_libs" = no; then
6977 build_libtool_libs=module
6978 build_old_libs=yes
6979 else
6980 build_libtool_libs=no
6981 fi
6982 fi
6983 else
6984 deplibs="$dir/$old_library $deplibs"
6985 link_static=yes
6986 fi
6987 fi # link shared/static library?
6988
6989 if test "$linkmode" = lib; then
6990 if test -n "$dependency_libs" &&
6991 { test "$hardcode_into_libs" != yes ||
6992 test "$build_old_libs" = yes ||
6993 test "$link_static" = yes; }; then
6994 # Extract -R from dependency_libs
6995 temp_deplibs=
6996 for libdir in $dependency_libs; do
6997 case $libdir in
6998 -R*) func_stripname '-R' '' "$libdir"
6999 temp_xrpath=$func_stripname_result
7000 case " $xrpath " in
7001 *" $temp_xrpath "*) ;;
7002 *) func_append xrpath " $temp_xrpath";;
7003 esac;;
7004 *) func_append temp_deplibs " $libdir";;
7005 esac
7006 done
7007 dependency_libs="$temp_deplibs"
7008 fi
7009
7010 func_append newlib_search_path " $absdir"
7011 # Link against this library
7012 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
7013 # ... and its dependency_libs
7014 tmp_libs=
7015 for deplib in $dependency_libs; do
7016 newdependency_libs="$deplib $newdependency_libs"
7017 case $deplib in
7018 -L*) func_stripname '-L' '' "$deplib"
7019 func_resolve_sysroot "$func_stripname_result";;
7020 *) func_resolve_sysroot "$deplib" ;;
7021 esac
7022 if $opt_preserve_dup_deps ; then
7023 case "$tmp_libs " in
7024 *" $func_resolve_sysroot_result "*)
7025 func_append specialdeplibs " $func_resolve_sysroot_result" ;;
7026 esac
7027 fi
7028 func_append tmp_libs " $func_resolve_sysroot_result"
7029 done
7030
7031 if test "$link_all_deplibs" != no; then
7032 # Add the search paths of all dependency libraries
7033 for deplib in $dependency_libs; do
7034 path=
7035 case $deplib in
7036 -L*) path="$deplib" ;;
7037 *.la)
7038 func_resolve_sysroot "$deplib"
7039 deplib=$func_resolve_sysroot_result
7040 func_dirname "$deplib" "" "."
7041 dir=$func_dirname_result
7042 # We need an absolute path.
7043 case $dir in
7044 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
7045 *)
7046 absdir=`cd "$dir" && pwd`
7047 if test -z "$absdir"; then
7048 func_warning "cannot determine absolute directory name of \`$dir'"
7049 absdir="$dir"
7050 fi
7051 ;;
7052 esac
7053 if $GREP "^installed=no" $deplib > /dev/null; then
7054 case $host in
7055 *-*-darwin*)
7056 depdepl=
7057 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
7058 if test -n "$deplibrary_names" ; then
7059 for tmp in $deplibrary_names ; do
7060 depdepl=$tmp
7061 done
7062 if test -f "$absdir/$objdir/$depdepl" ; then
7063 depdepl="$absdir/$objdir/$depdepl"
7064 darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
7065 if test -z "$darwin_install_name"; then
7066 darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
7067 fi
7068 func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
7069 func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}"
7070 path=
7071 fi
7072 fi
7073 ;;
7074 *)
7075 path="-L$absdir/$objdir"
7076 ;;
7077 esac
7078 else
7079 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
7080 test -z "$libdir" && \
7081 func_fatal_error "\`$deplib' is not a valid libtool archive"
7082 test "$absdir" != "$libdir" && \
7083 func_warning "\`$deplib' seems to be moved"
7084
7085 path="-L$absdir"
7086 fi
7087 ;;
7088 esac
7089 case " $deplibs " in
7090 *" $path "*) ;;
7091 *) deplibs="$path $deplibs" ;;
7092 esac
7093 done
7094 fi # link_all_deplibs != no
7095 fi # linkmode = lib
7096 done # for deplib in $libs
7097 if test "$pass" = link; then
7098 if test "$linkmode" = "prog"; then
7099 compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
7100 finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
7101 else
7102 compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
7103 fi
7104 fi
7105 dependency_libs="$newdependency_libs"
7106 if test "$pass" = dlpreopen; then
7107 # Link the dlpreopened libraries before other libraries
7108 for deplib in $save_deplibs; do
7109 deplibs="$deplib $deplibs"
7110 done
7111 fi
7112 if test "$pass" != dlopen; then
7113 if test "$pass" != conv; then
7114 # Make sure lib_search_path contains only unique directories.
7115 lib_search_path=
7116 for dir in $newlib_search_path; do
7117 case "$lib_search_path " in
7118 *" $dir "*) ;;
7119 *) func_append lib_search_path " $dir" ;;
7120 esac
7121 done
7122 newlib_search_path=
7123 fi
7124
7125 if test "$linkmode,$pass" != "prog,link"; then
7126 vars="deplibs"
7127 else
7128 vars="compile_deplibs finalize_deplibs"
7129 fi
7130 for var in $vars dependency_libs; do
7131 # Add libraries to $var in reverse order
7132 eval tmp_libs=\"\$$var\"
7133 new_libs=
7134 for deplib in $tmp_libs; do
7135 # FIXME: Pedantically, this is the right thing to do, so
7136 # that some nasty dependency loop isn't accidentally
7137 # broken:
7138 #new_libs="$deplib $new_libs"
7139 # Pragmatically, this seems to cause very few problems in
7140 # practice:
7141 case $deplib in
7142 -L*) new_libs="$deplib $new_libs" ;;
7143 -R*) ;;
7144 *)
7145 # And here is the reason: when a library appears more
7146 # than once as an explicit dependence of a library, or
7147 # is implicitly linked in more than once by the
7148 # compiler, it is considered special, and multiple
7149 # occurrences thereof are not removed. Compare this
7150 # with having the same library being listed as a
7151 # dependency of multiple other libraries: in this case,
7152 # we know (pedantically, we assume) the library does not
7153 # need to be listed more than once, so we keep only the
7154 # last copy. This is not always right, but it is rare
7155 # enough that we require users that really mean to play
7156 # such unportable linking tricks to link the library
7157 # using -Wl,-lname, so that libtool does not consider it
7158 # for duplicate removal.
7159 case " $specialdeplibs " in
7160 *" $deplib "*) new_libs="$deplib $new_libs" ;;
7161 *)
7162 case " $new_libs " in
7163 *" $deplib "*) ;;
7164 *) new_libs="$deplib $new_libs" ;;
7165 esac
7166 ;;
7167 esac
7168 ;;
7169 esac
7170 done
7171 tmp_libs=
7172 for deplib in $new_libs; do
7173 case $deplib in
7174 -L*)
7175 case " $tmp_libs " in
7176 *" $deplib "*) ;;
7177 *) func_append tmp_libs " $deplib" ;;
7178 esac
7179 ;;
7180 *) func_append tmp_libs " $deplib" ;;
7181 esac
7182 done
7183 eval $var=\"$tmp_libs\"
7184 done # for var
7185 fi
7186 # Last step: remove runtime libs from dependency_libs
7187 # (they stay in deplibs)
7188 tmp_libs=
7189 for i in $dependency_libs ; do
7190 case " $predeps $postdeps $compiler_lib_search_path " in
7191 *" $i "*)
7192 i=""
7193 ;;
7194 esac
7195 if test -n "$i" ; then
7196 func_append tmp_libs " $i"
7197 fi
7198 done
7199 dependency_libs=$tmp_libs
7200 done # for pass
7201 if test "$linkmode" = prog; then
7202 dlfiles="$newdlfiles"
7203 fi
7204 if test "$linkmode" = prog || test "$linkmode" = lib; then
7205 dlprefiles="$newdlprefiles"
7206 fi
7207
7208 case $linkmode in
7209 oldlib)
7210 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
7211 func_warning "\`-dlopen' is ignored for archives"
7212 fi
7213
7214 case " $deplibs" in
7215 *\ -l* | *\ -L*)
7216 func_warning "\`-l' and \`-L' are ignored for archives" ;;
7217 esac
7218
7219 test -n "$rpath" && \
7220 func_warning "\`-rpath' is ignored for archives"
7221
7222 test -n "$xrpath" && \
7223 func_warning "\`-R' is ignored for archives"
7224
7225 test -n "$vinfo" && \
7226 func_warning "\`-version-info/-version-number' is ignored for archives"
7227
7228 test -n "$release" && \
7229 func_warning "\`-release' is ignored for archives"
7230
7231 test -n "$export_symbols$export_symbols_regex" && \
7232 func_warning "\`-export-symbols' is ignored for archives"
7233
7234 # Now set the variables for building old libraries.
7235 build_libtool_libs=no
7236 oldlibs="$output"
7237 func_append objs "$old_deplibs"
7238 ;;
7239
7240 lib)
7241 # Make sure we only generate libraries of the form `libNAME.la'.
7242 case $outputname in
7243 lib*)
7244 func_stripname 'lib' '.la' "$outputname"
7245 name=$func_stripname_result
7246 eval shared_ext=\"$shrext_cmds\"
7247 eval libname=\"$libname_spec\"
7248 ;;
7249 *)
7250 test "$module" = no && \
7251 func_fatal_help "libtool library \`$output' must begin with \`lib'"
7252
7253 if test "$need_lib_prefix" != no; then
7254 # Add the "lib" prefix for modules if required
7255 func_stripname '' '.la' "$outputname"
7256 name=$func_stripname_result
7257 eval shared_ext=\"$shrext_cmds\"
7258 eval libname=\"$libname_spec\"
7259 else
7260 func_stripname '' '.la' "$outputname"
7261 libname=$func_stripname_result
7262 fi
7263 ;;
7264 esac
7265
7266 if test -n "$objs"; then
7267 if test "$deplibs_check_method" != pass_all; then
7268 func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
7269 else
7270 echo
7271 $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
7272 $ECHO "*** objects $objs is not portable!"
7273 func_append libobjs " $objs"
7274 fi
7275 fi
7276
7277 test "$dlself" != no && \
7278 func_warning "\`-dlopen self' is ignored for libtool libraries"
7279
7280 set dummy $rpath
7281 shift
7282 test "$#" -gt 1 && \
7283 func_warning "ignoring multiple \`-rpath's for a libtool library"
7284
7285 install_libdir="$1"
7286
7287 oldlibs=
7288 if test -z "$rpath"; then
7289 if test "$build_libtool_libs" = yes; then
7290 # Building a libtool convenience library.
7291 # Some compilers have problems with a `.al' extension so
7292 # convenience libraries should have the same extension an
7293 # archive normally would.
7294 oldlibs="$output_objdir/$libname.$libext $oldlibs"
7295 build_libtool_libs=convenience
7296 build_old_libs=yes
7297 fi
7298
7299 test -n "$vinfo" && \
7300 func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
7301
7302 test -n "$release" && \
7303 func_warning "\`-release' is ignored for convenience libraries"
7304 else
7305
7306 # Parse the version information argument.
7307 save_ifs="$IFS"; IFS=':'
7308 set dummy $vinfo 0 0 0
7309 shift
7310 IFS="$save_ifs"
7311
7312 test -n "$7" && \
7313 func_fatal_help "too many parameters to \`-version-info'"
7314
7315 # convert absolute version numbers to libtool ages
7316 # this retains compatibility with .la files and attempts
7317 # to make the code below a bit more comprehensible
7318
7319 case $vinfo_number in
7320 yes)
7321 number_major="$1"
7322 number_minor="$2"
7323 number_revision="$3"
7324 #
7325 # There are really only two kinds -- those that
7326 # use the current revision as the major version
7327 # and those that subtract age and use age as
7328 # a minor version. But, then there is irix
7329 # which has an extra 1 added just for fun
7330 #
7331 case $version_type in
7332 # correct linux to gnu/linux during the next big refactor
7333 darwin|linux|osf|windows|none)
7334 func_arith $number_major + $number_minor
7335 current=$func_arith_result
7336 age="$number_minor"
7337 revision="$number_revision"
7338 ;;
7339 freebsd-aout|freebsd-elf|qnx|sunos)
7340 current="$number_major"
7341 revision="$number_minor"
7342 age="0"
7343 ;;
7344 irix|nonstopux)
7345 func_arith $number_major + $number_minor
7346 current=$func_arith_result
7347 age="$number_minor"
7348 revision="$number_minor"
7349 lt_irix_increment=no
7350 ;;
7351 esac
7352 ;;
7353 no)
7354 current="$1"
7355 revision="$2"
7356 age="$3"
7357 ;;
7358 esac
7359
7360 # Check that each of the things are valid numbers.
7361 case $current in
7362 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
7363 *)
7364 func_error "CURRENT \`$current' must be a nonnegative integer"
7365 func_fatal_error "\`$vinfo' is not valid version information"
7366 ;;
7367 esac
7368
7369 case $revision in
7370 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
7371 *)
7372 func_error "REVISION \`$revision' must be a nonnegative integer"
7373 func_fatal_error "\`$vinfo' is not valid version information"
7374 ;;
7375 esac
7376
7377 case $age in
7378 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
7379 *)
7380 func_error "AGE \`$age' must be a nonnegative integer"
7381 func_fatal_error "\`$vinfo' is not valid version information"
7382 ;;
7383 esac
7384
7385 if test "$age" -gt "$current"; then
7386 func_error "AGE \`$age' is greater than the current interface number \`$current'"
7387 func_fatal_error "\`$vinfo' is not valid version information"
7388 fi
7389
7390 # Calculate the version variables.
7391 major=
7392 versuffix=
7393 verstring=
7394 case $version_type in
7395 none) ;;
7396
7397 darwin)
7398 # Like Linux, but with the current version available in
7399 # verstring for coding it into the library header
7400 func_arith $current - $age
7401 major=.$func_arith_result
7402 versuffix="$major.$age.$revision"
7403 # Darwin ld doesn't like 0 for these options...
7404 func_arith $current + 1
7405 minor_current=$func_arith_result
7406 xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
7407 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
7408 ;;
7409
7410 freebsd-aout)
7411 major=".$current"
7412 versuffix=".$current.$revision";
7413 ;;
7414
7415 freebsd-elf)
7416 major=".$current"
7417 versuffix=".$current"
7418 ;;
7419
7420 irix | nonstopux)
7421 if test "X$lt_irix_increment" = "Xno"; then
7422 func_arith $current - $age
7423 else
7424 func_arith $current - $age + 1
7425 fi
7426 major=$func_arith_result
7427
7428 case $version_type in
7429 nonstopux) verstring_prefix=nonstopux ;;
7430 *) verstring_prefix=sgi ;;
7431 esac
7432 verstring="$verstring_prefix$major.$revision"
7433
7434 # Add in all the interfaces that we are compatible with.
7435 loop=$revision
7436 while test "$loop" -ne 0; do
7437 func_arith $revision - $loop
7438 iface=$func_arith_result
7439 func_arith $loop - 1
7440 loop=$func_arith_result
7441 verstring="$verstring_prefix$major.$iface:$verstring"
7442 done
7443
7444 # Before this point, $major must not contain `.'.
7445 major=.$major
7446 versuffix="$major.$revision"
7447 ;;
7448
7449 linux) # correct to gnu/linux during the next big refactor
7450 func_arith $current - $age
7451 major=.$func_arith_result
7452 versuffix="$major.$age.$revision"
7453 ;;
7454
7455 osf)
7456 func_arith $current - $age
7457 major=.$func_arith_result
7458 versuffix=".$current.$age.$revision"
7459 verstring="$current.$age.$revision"
7460
7461 # Add in all the interfaces that we are compatible with.
7462 loop=$age
7463 while test "$loop" -ne 0; do
7464 func_arith $current - $loop
7465 iface=$func_arith_result
7466 func_arith $loop - 1
7467 loop=$func_arith_result
7468 verstring="$verstring:${iface}.0"
7469 done
7470
7471 # Make executables depend on our current version.
7472 func_append verstring ":${current}.0"
7473 ;;
7474
7475 qnx)
7476 major=".$current"
7477 versuffix=".$current"
7478 ;;
7479
7480 sunos)
7481 major=".$current"
7482 versuffix=".$current.$revision"
7483 ;;
7484
7485 windows)
7486 # Use '-' rather than '.', since we only want one
7487 # extension on DOS 8.3 filesystems.
7488 func_arith $current - $age
7489 major=$func_arith_result
7490 versuffix="-$major"
7491 ;;
7492
7493 *)
7494 func_fatal_configuration "unknown library version type \`$version_type'"
7495 ;;
7496 esac
7497
7498 # Clear the version info if we defaulted, and they specified a release.
7499 if test -z "$vinfo" && test -n "$release"; then
7500 major=
7501 case $version_type in
7502 darwin)
7503 # we can't check for "0.0" in archive_cmds due to quoting
7504 # problems, so we reset it completely
7505 verstring=
7506 ;;
7507 *)
7508 verstring="0.0"
7509 ;;
7510 esac
7511 if test "$need_version" = no; then
7512 versuffix=
7513 else
7514 versuffix=".0.0"
7515 fi
7516 fi
7517
7518 # Remove version info from name if versioning should be avoided
7519 if test "$avoid_version" = yes && test "$need_version" = no; then
7520 major=
7521 versuffix=
7522 verstring=""
7523 fi
7524
7525 # Check to see if the archive will have undefined symbols.
7526 if test "$allow_undefined" = yes; then
7527 if test "$allow_undefined_flag" = unsupported; then
7528 func_warning "undefined symbols not allowed in $host shared libraries"
7529 build_libtool_libs=no
7530 build_old_libs=yes
7531 fi
7532 else
7533 # Don't allow undefined symbols.
7534 allow_undefined_flag="$no_undefined_flag"
7535 fi
7536
7537 fi
7538
7539 func_generate_dlsyms "$libname" "$libname" "yes"
7540 func_append libobjs " $symfileobj"
7541 test "X$libobjs" = "X " && libobjs=
7542
7543 if test "$opt_mode" != relink; then
7544 # Remove our outputs, but don't remove object files since they
7545 # may have been created when compiling PIC objects.
7546 removelist=
7547 tempremovelist=`$ECHO "$output_objdir/*"`
7548 for p in $tempremovelist; do
7549 case $p in
7550 *.$objext | *.gcno)
7551 ;;
7552 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
7553 if test "X$precious_files_regex" != "X"; then
7554 if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
7555 then
7556 continue
7557 fi
7558 fi
7559 func_append removelist " $p"
7560 ;;
7561 *) ;;
7562 esac
7563 done
7564 test -n "$removelist" && \
7565 func_show_eval "${RM}r \$removelist"
7566 fi
7567
7568 # Now set the variables for building old libraries.
7569 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
7570 func_append oldlibs " $output_objdir/$libname.$libext"
7571
7572 # Transform .lo files to .o files.
7573 oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP`
7574 fi
7575
7576 # Eliminate all temporary directories.
7577 #for path in $notinst_path; do
7578 # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"`
7579 # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"`
7580 # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"`
7581 #done
7582
7583 if test -n "$xrpath"; then
7584 # If the user specified any rpath flags, then add them.
7585 temp_xrpath=
7586 for libdir in $xrpath; do
7587 func_replace_sysroot "$libdir"
7588 func_append temp_xrpath " -R$func_replace_sysroot_result"
7589 case "$finalize_rpath " in
7590 *" $libdir "*) ;;
7591 *) func_append finalize_rpath " $libdir" ;;
7592 esac
7593 done
7594 if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
7595 dependency_libs="$temp_xrpath $dependency_libs"
7596 fi
7597 fi
7598
7599 # Make sure dlfiles contains only unique files that won't be dlpreopened
7600 old_dlfiles="$dlfiles"
7601 dlfiles=
7602 for lib in $old_dlfiles; do
7603 case " $dlprefiles $dlfiles " in
7604 *" $lib "*) ;;
7605 *) func_append dlfiles " $lib" ;;
7606 esac
7607 done
7608
7609 # Make sure dlprefiles contains only unique files
7610 old_dlprefiles="$dlprefiles"
7611 dlprefiles=
7612 for lib in $old_dlprefiles; do
7613 case "$dlprefiles " in
7614 *" $lib "*) ;;
7615 *) func_append dlprefiles " $lib" ;;
7616 esac
7617 done
7618
7619 if test "$build_libtool_libs" = yes; then
7620 if test -n "$rpath"; then
7621 case $host in
7622 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
7623 # these systems don't actually have a c library (as such)!
7624 ;;
7625 *-*-rhapsody* | *-*-darwin1.[012])
7626 # Rhapsody C library is in the System framework
7627 func_append deplibs " System.ltframework"
7628 ;;
7629 *-*-netbsd*)
7630 # Don't link with libc until the a.out ld.so is fixed.
7631 ;;
7632 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
7633 # Do not include libc due to us having libc/libc_r.
7634 ;;
7635 *-*-sco3.2v5* | *-*-sco5v6*)
7636 # Causes problems with __ctype
7637 ;;
7638 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
7639 # Compiler inserts libc in the correct place for threads to work
7640 ;;
7641 *)
7642 # Add libc to deplibs on all other systems if necessary.
7643 if test "$build_libtool_need_lc" = "yes"; then
7644 func_append deplibs " -lc"
7645 fi
7646 ;;
7647 esac
7648 fi
7649
7650 # Transform deplibs into only deplibs that can be linked in shared.
7651 name_save=$name
7652 libname_save=$libname
7653 release_save=$release
7654 versuffix_save=$versuffix
7655 major_save=$major
7656 # I'm not sure if I'm treating the release correctly. I think
7657 # release should show up in the -l (ie -lgmp5) so we don't want to
7658 # add it in twice. Is that correct?
7659 release=""
7660 versuffix=""
7661 major=""
7662 newdeplibs=
7663 droppeddeps=no
7664 case $deplibs_check_method in
7665 pass_all)
7666 # Don't check for shared/static. Everything works.
7667 # This might be a little naive. We might want to check
7668 # whether the library exists or not. But this is on
7669 # osf3 & osf4 and I'm not really sure... Just
7670 # implementing what was already the behavior.
7671 newdeplibs=$deplibs
7672 ;;
7673 test_compile)
7674 # This code stresses the "libraries are programs" paradigm to its
7675 # limits. Maybe even breaks it. We compile a program, linking it
7676 # against the deplibs as a proxy for the library. Then we can check
7677 # whether they linked in statically or dynamically with ldd.
7678 $opt_dry_run || $RM conftest.c
7679 cat > conftest.c <<EOF
7680 int main() { return 0; }
7681 EOF
7682 $opt_dry_run || $RM conftest
7683 if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
7684 ldd_output=`ldd conftest`
7685 for i in $deplibs; do
7686 case $i in
7687 -l*)
7688 func_stripname -l '' "$i"
7689 name=$func_stripname_result
7690 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
7691 case " $predeps $postdeps " in
7692 *" $i "*)
7693 func_append newdeplibs " $i"
7694 i=""
7695 ;;
7696 esac
7697 fi
7698 if test -n "$i" ; then
7699 libname=`eval "\\$ECHO \"$libname_spec\""`
7700 deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
7701 set dummy $deplib_matches; shift
7702 deplib_match=$1
7703 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
7704 func_append newdeplibs " $i"
7705 else
7706 droppeddeps=yes
7707 echo
7708 $ECHO "*** Warning: dynamic linker does not accept needed library $i."
7709 echo "*** I have the capability to make that library automatically link in when"
7710 echo "*** you link to this library. But I can only do this if you have a"
7711 echo "*** shared version of the library, which I believe you do not have"
7712 echo "*** because a test_compile did reveal that the linker did not use it for"
7713 echo "*** its dynamic dependency list that programs get resolved with at runtime."
7714 fi
7715 fi
7716 ;;
7717 *)
7718 func_append newdeplibs " $i"
7719 ;;
7720 esac
7721 done
7722 else
7723 # Error occurred in the first compile. Let's try to salvage
7724 # the situation: Compile a separate program for each library.
7725 for i in $deplibs; do
7726 case $i in
7727 -l*)
7728 func_stripname -l '' "$i"
7729 name=$func_stripname_result
7730 $opt_dry_run || $RM conftest
7731 if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
7732 ldd_output=`ldd conftest`
7733 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
7734 case " $predeps $postdeps " in
7735 *" $i "*)
7736 func_append newdeplibs " $i"
7737 i=""
7738 ;;
7739 esac
7740 fi
7741 if test -n "$i" ; then
7742 libname=`eval "\\$ECHO \"$libname_spec\""`
7743 deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
7744 set dummy $deplib_matches; shift
7745 deplib_match=$1
7746 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
7747 func_append newdeplibs " $i"
7748 else
7749 droppeddeps=yes
7750 echo
7751 $ECHO "*** Warning: dynamic linker does not accept needed library $i."
7752 echo "*** I have the capability to make that library automatically link in when"
7753 echo "*** you link to this library. But I can only do this if you have a"
7754 echo "*** shared version of the library, which you do not appear to have"
7755 echo "*** because a test_compile did reveal that the linker did not use this one"
7756 echo "*** as a dynamic dependency that programs can get resolved with at runtime."
7757 fi
7758 fi
7759 else
7760 droppeddeps=yes
7761 echo
7762 $ECHO "*** Warning! Library $i is needed by this library but I was not able to"
7763 echo "*** make it link in! You will probably need to install it or some"
7764 echo "*** library that it depends on before this library will be fully"
7765 echo "*** functional. Installing it before continuing would be even better."
7766 fi
7767 ;;
7768 *)
7769 func_append newdeplibs " $i"
7770 ;;
7771 esac
7772 done
7773 fi
7774 ;;
7775 file_magic*)
7776 set dummy $deplibs_check_method; shift
7777 file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
7778 for a_deplib in $deplibs; do
7779 case $a_deplib in
7780 -l*)
7781 func_stripname -l '' "$a_deplib"
7782 name=$func_stripname_result
7783 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
7784 case " $predeps $postdeps " in
7785 *" $a_deplib "*)
7786 func_append newdeplibs " $a_deplib"
7787 a_deplib=""
7788 ;;
7789 esac
7790 fi
7791 if test -n "$a_deplib" ; then
7792 libname=`eval "\\$ECHO \"$libname_spec\""`
7793 if test -n "$file_magic_glob"; then
7794 libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
7795 else
7796 libnameglob=$libname
7797 fi
7798 test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob`
7799 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
7800 if test "$want_nocaseglob" = yes; then
7801 shopt -s nocaseglob
7802 potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
7803 $nocaseglob
7804 else
7805 potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
7806 fi
7807 for potent_lib in $potential_libs; do
7808 # Follow soft links.
7809 if ls -lLd "$potent_lib" 2>/dev/null |
7810 $GREP " -> " >/dev/null; then
7811 continue
7812 fi
7813 # The statement above tries to avoid entering an
7814 # endless loop below, in case of cyclic links.
7815 # We might still enter an endless loop, since a link
7816 # loop can be closed while we follow links,
7817 # but so what?
7818 potlib="$potent_lib"
7819 while test -h "$potlib" 2>/dev/null; do
7820 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
7821 case $potliblink in
7822 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
7823 *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";;
7824 esac
7825 done
7826 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
7827 $SED -e 10q |
7828 $EGREP "$file_magic_regex" > /dev/null; then
7829 func_append newdeplibs " $a_deplib"
7830 a_deplib=""
7831 break 2
7832 fi
7833 done
7834 done
7835 fi
7836 if test -n "$a_deplib" ; then
7837 droppeddeps=yes
7838 echo
7839 $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
7840 echo "*** I have the capability to make that library automatically link in when"
7841 echo "*** you link to this library. But I can only do this if you have a"
7842 echo "*** shared version of the library, which you do not appear to have"
7843 echo "*** because I did check the linker path looking for a file starting"
7844 if test -z "$potlib" ; then
7845 $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
7846 else
7847 $ECHO "*** with $libname and none of the candidates passed a file format test"
7848 $ECHO "*** using a file magic. Last file checked: $potlib"
7849 fi
7850 fi
7851 ;;
7852 *)
7853 # Add a -L argument.
7854 func_append newdeplibs " $a_deplib"
7855 ;;
7856 esac
7857 done # Gone through all deplibs.
7858 ;;
7859 match_pattern*)
7860 set dummy $deplibs_check_method; shift
7861 match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
7862 for a_deplib in $deplibs; do
7863 case $a_deplib in
7864 -l*)
7865 func_stripname -l '' "$a_deplib"
7866 name=$func_stripname_result
7867 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
7868 case " $predeps $postdeps " in
7869 *" $a_deplib "*)
7870 func_append newdeplibs " $a_deplib"
7871 a_deplib=""
7872 ;;
7873 esac
7874 fi
7875 if test -n "$a_deplib" ; then
7876 libname=`eval "\\$ECHO \"$libname_spec\""`
7877 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
7878 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
7879 for potent_lib in $potential_libs; do
7880 potlib="$potent_lib" # see symlink-check above in file_magic test
7881 if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
7882 $EGREP "$match_pattern_regex" > /dev/null; then
7883 func_append newdeplibs " $a_deplib"
7884 a_deplib=""
7885 break 2
7886 fi
7887 done
7888 done
7889 fi
7890 if test -n "$a_deplib" ; then
7891 droppeddeps=yes
7892 echo
7893 $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
7894 echo "*** I have the capability to make that library automatically link in when"
7895 echo "*** you link to this library. But I can only do this if you have a"
7896 echo "*** shared version of the library, which you do not appear to have"
7897 echo "*** because I did check the linker path looking for a file starting"
7898 if test -z "$potlib" ; then
7899 $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
7900 else
7901 $ECHO "*** with $libname and none of the candidates passed a file format test"
7902 $ECHO "*** using a regex pattern. Last file checked: $potlib"
7903 fi
7904 fi
7905 ;;
7906 *)
7907 # Add a -L argument.
7908 func_append newdeplibs " $a_deplib"
7909 ;;
7910 esac
7911 done # Gone through all deplibs.
7912 ;;
7913 none | unknown | *)
7914 newdeplibs=""
7915 tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
7916 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
7917 for i in $predeps $postdeps ; do
7918 # can't use Xsed below, because $i might contain '/'
7919 tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"`
7920 done
7921 fi
7922 case $tmp_deplibs in
7923 *[!\ \ ]*)
7924 echo
7925 if test "X$deplibs_check_method" = "Xnone"; then
7926 echo "*** Warning: inter-library dependencies are not supported in this platform."
7927 else
7928 echo "*** Warning: inter-library dependencies are not known to be supported."
7929 fi
7930 echo "*** All declared inter-library dependencies are being dropped."
7931 droppeddeps=yes
7932 ;;
7933 esac
7934 ;;
7935 esac
7936 versuffix=$versuffix_save
7937 major=$major_save
7938 release=$release_save
7939 libname=$libname_save
7940 name=$name_save
7941
7942 case $host in
7943 *-*-rhapsody* | *-*-darwin1.[012])
7944 # On Rhapsody replace the C library with the System framework
7945 newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'`
7946 ;;
7947 esac
7948
7949 if test "$droppeddeps" = yes; then
7950 if test "$module" = yes; then
7951 echo
7952 echo "*** Warning: libtool could not satisfy all declared inter-library"
7953 $ECHO "*** dependencies of module $libname. Therefore, libtool will create"
7954 echo "*** a static module, that should work as long as the dlopening"
7955 echo "*** application is linked with the -dlopen flag."
7956 if test -z "$global_symbol_pipe"; then
7957 echo
7958 echo "*** However, this would only work if libtool was able to extract symbol"
7959 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
7960 echo "*** not find such a program. So, this module is probably useless."
7961 echo "*** \`nm' from GNU binutils and a full rebuild may help."
7962 fi
7963 if test "$build_old_libs" = no; then
7964 oldlibs="$output_objdir/$libname.$libext"
7965 build_libtool_libs=module
7966 build_old_libs=yes
7967 else
7968 build_libtool_libs=no
7969 fi
7970 else
7971 echo "*** The inter-library dependencies that have been dropped here will be"
7972 echo "*** automatically added whenever a program is linked with this library"
7973 echo "*** or is declared to -dlopen it."
7974
7975 if test "$allow_undefined" = no; then
7976 echo
7977 echo "*** Since this library must not contain undefined symbols,"
7978 echo "*** because either the platform does not support them or"
7979 echo "*** it was explicitly requested with -no-undefined,"
7980 echo "*** libtool will only create a static version of it."
7981 if test "$build_old_libs" = no; then
7982 oldlibs="$output_objdir/$libname.$libext"
7983 build_libtool_libs=module
7984 build_old_libs=yes
7985 else
7986 build_libtool_libs=no
7987 fi
7988 fi
7989 fi
7990 fi
7991 # Done checking deplibs!
7992 deplibs=$newdeplibs
7993 fi
7994 # Time to change all our "foo.ltframework" stuff back to "-framework foo"
7995 case $host in
7996 *-*-darwin*)
7997 newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
7998 new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
7999 deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
8000 ;;
8001 esac
8002
8003 # move library search paths that coincide with paths to not yet
8004 # installed libraries to the beginning of the library search list
8005 new_libs=
8006 for path in $notinst_path; do
8007 case " $new_libs " in
8008 *" -L$path/$objdir "*) ;;
8009 *)
8010 case " $deplibs " in
8011 *" -L$path/$objdir "*)
8012 func_append new_libs " -L$path/$objdir" ;;
8013 esac
8014 ;;
8015 esac
8016 done
8017 for deplib in $deplibs; do
8018 case $deplib in
8019 -L*)
8020 case " $new_libs " in
8021 *" $deplib "*) ;;
8022 *) func_append new_libs " $deplib" ;;
8023 esac
8024 ;;
8025 *) func_append new_libs " $deplib" ;;
8026 esac
8027 done
8028 deplibs="$new_libs"
8029
8030 # All the library-specific variables (install_libdir is set above).
8031 library_names=
8032 old_library=
8033 dlname=
8034
8035 # Test again, we may have decided not to build it any more
8036 if test "$build_libtool_libs" = yes; then
8037 # Remove ${wl} instances when linking with ld.
8038 # FIXME: should test the right _cmds variable.
8039 case $archive_cmds in
8040 *\$LD\ *) wl= ;;
8041 esac
8042 if test "$hardcode_into_libs" = yes; then
8043 # Hardcode the library paths
8044 hardcode_libdirs=
8045 dep_rpath=
8046 rpath="$finalize_rpath"
8047 test "$opt_mode" != relink && rpath="$compile_rpath$rpath"
8048 for libdir in $rpath; do
8049 if test -n "$hardcode_libdir_flag_spec"; then
8050 if test -n "$hardcode_libdir_separator"; then
8051 func_replace_sysroot "$libdir"
8052 libdir=$func_replace_sysroot_result
8053 if test -z "$hardcode_libdirs"; then
8054 hardcode_libdirs="$libdir"
8055 else
8056 # Just accumulate the unique libdirs.
8057 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
8058 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
8059 ;;
8060 *)
8061 func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
8062 ;;
8063 esac
8064 fi
8065 else
8066 eval flag=\"$hardcode_libdir_flag_spec\"
8067 func_append dep_rpath " $flag"
8068 fi
8069 elif test -n "$runpath_var"; then
8070 case "$perm_rpath " in
8071 *" $libdir "*) ;;
8072 *) func_append perm_rpath " $libdir" ;;
8073 esac
8074 fi
8075 done
8076 # Substitute the hardcoded libdirs into the rpath.
8077 if test -n "$hardcode_libdir_separator" &&
8078 test -n "$hardcode_libdirs"; then
8079 libdir="$hardcode_libdirs"
8080 eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
8081 fi
8082 if test -n "$runpath_var" && test -n "$perm_rpath"; then
8083 # We should set the runpath_var.
8084 rpath=
8085 for dir in $perm_rpath; do
8086 func_append rpath "$dir:"
8087 done
8088 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
8089 fi
8090 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
8091 fi
8092
8093 shlibpath="$finalize_shlibpath"
8094 test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
8095 if test -n "$shlibpath"; then
8096 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
8097 fi
8098
8099 # Get the real and link names of the library.
8100 eval shared_ext=\"$shrext_cmds\"
8101 eval library_names=\"$library_names_spec\"
8102 set dummy $library_names
8103 shift
8104 realname="$1"
8105 shift
8106
8107 if test -n "$soname_spec"; then
8108 eval soname=\"$soname_spec\"
8109 else
8110 soname="$realname"
8111 fi
8112 if test -z "$dlname"; then
8113 dlname=$soname
8114 fi
8115
8116 lib="$output_objdir/$realname"
8117 linknames=
8118 for link
8119 do
8120 func_append linknames " $link"
8121 done
8122
8123 # Use standard objects if they are pic
8124 test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP`
8125 test "X$libobjs" = "X " && libobjs=
8126
8127 delfiles=
8128 if test -n "$export_symbols" && test -n "$include_expsyms"; then
8129 $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
8130 export_symbols="$output_objdir/$libname.uexp"
8131 func_append delfiles " $export_symbols"
8132 fi
8133
8134 orig_export_symbols=
8135 case $host_os in
8136 cygwin* | mingw* | cegcc*)
8137 if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
8138 # exporting using user supplied symfile
8139 if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
8140 # and it's NOT already a .def file. Must figure out
8141 # which of the given symbols are data symbols and tag
8142 # them as such. So, trigger use of export_symbols_cmds.
8143 # export_symbols gets reassigned inside the "prepare
8144 # the list of exported symbols" if statement, so the
8145 # include_expsyms logic still works.
8146 orig_export_symbols="$export_symbols"
8147 export_symbols=
8148 always_export_symbols=yes
8149 fi
8150 fi
8151 ;;
8152 esac
8153
8154 # Prepare the list of exported symbols
8155 if test -z "$export_symbols"; then
8156 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
8157 func_verbose "generating symbol list for \`$libname.la'"
8158 export_symbols="$output_objdir/$libname.exp"
8159 $opt_dry_run || $RM $export_symbols
8160 cmds=$export_symbols_cmds
8161 save_ifs="$IFS"; IFS='~'
8162 for cmd1 in $cmds; do
8163 IFS="$save_ifs"
8164 # Take the normal branch if the nm_file_list_spec branch
8165 # doesn't work or if tool conversion is not needed.
8166 case $nm_file_list_spec~$to_tool_file_cmd in
8167 *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)
8168 try_normal_branch=yes
8169 eval cmd=\"$cmd1\"
8170 func_len " $cmd"
8171 len=$func_len_result
8172 ;;
8173 *)
8174 try_normal_branch=no
8175 ;;
8176 esac
8177 if test "$try_normal_branch" = yes \
8178 && { test "$len" -lt "$max_cmd_len" \
8179 || test "$max_cmd_len" -le -1; }
8180 then
8181 func_show_eval "$cmd" 'exit $?'
8182 skipped_export=false
8183 elif test -n "$nm_file_list_spec"; then
8184 func_basename "$output"
8185 output_la=$func_basename_result
8186 save_libobjs=$libobjs
8187 save_output=$output
8188 output=${output_objdir}/${output_la}.nm
8189 func_to_tool_file "$output"
8190 libobjs=$nm_file_list_spec$func_to_tool_file_result
8191 func_append delfiles " $output"
8192 func_verbose "creating $NM input file list: $output"
8193 for obj in $save_libobjs; do
8194 func_to_tool_file "$obj"
8195 $ECHO "$func_to_tool_file_result"
8196 done > "$output"
8197 eval cmd=\"$cmd1\"
8198 func_show_eval "$cmd" 'exit $?'
8199 output=$save_output
8200 libobjs=$save_libobjs
8201 skipped_export=false
8202 else
8203 # The command line is too long to execute in one step.
8204 func_verbose "using reloadable object file for export list..."
8205 skipped_export=:
8206 # Break out early, otherwise skipped_export may be
8207 # set to false by a later but shorter cmd.
8208 break
8209 fi
8210 done
8211 IFS="$save_ifs"
8212 if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
8213 func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
8214 func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
8215 fi
8216 fi
8217 fi
8218
8219 if test -n "$export_symbols" && test -n "$include_expsyms"; then
8220 tmp_export_symbols="$export_symbols"
8221 test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
8222 $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
8223 fi
8224
8225 if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
8226 # The given exports_symbols file has to be filtered, so filter it.
8227 func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
8228 # FIXME: $output_objdir/$libname.filter potentially contains lots of
8229 # 's' commands which not all seds can handle. GNU sed should be fine
8230 # though. Also, the filter scales superlinearly with the number of
8231 # global variables. join(1) would be nice here, but unfortunately
8232 # isn't a blessed tool.
8233 $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
8234 func_append delfiles " $export_symbols $output_objdir/$libname.filter"
8235 export_symbols=$output_objdir/$libname.def
8236 $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
8237 fi
8238
8239 tmp_deplibs=
8240 for test_deplib in $deplibs; do
8241 case " $convenience " in
8242 *" $test_deplib "*) ;;
8243 *)
8244 func_append tmp_deplibs " $test_deplib"
8245 ;;
8246 esac
8247 done
8248 deplibs="$tmp_deplibs"
8249
8250 if test -n "$convenience"; then
8251 if test -n "$whole_archive_flag_spec" &&
8252 test "$compiler_needs_object" = yes &&
8253 test -z "$libobjs"; then
8254 # extract the archives, so we have objects to list.
8255 # TODO: could optimize this to just extract one archive.
8256 whole_archive_flag_spec=
8257 fi
8258 if test -n "$whole_archive_flag_spec"; then
8259 save_libobjs=$libobjs
8260 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
8261 test "X$libobjs" = "X " && libobjs=
8262 else
8263 gentop="$output_objdir/${outputname}x"
8264 func_append generated " $gentop"
8265
8266 func_extract_archives $gentop $convenience
8267 func_append libobjs " $func_extract_archives_result"
8268 test "X$libobjs" = "X " && libobjs=
8269 fi
8270 fi
8271
8272 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
8273 eval flag=\"$thread_safe_flag_spec\"
8274 func_append linker_flags " $flag"
8275 fi
8276
8277 # Make a backup of the uninstalled library when relinking
8278 if test "$opt_mode" = relink; then
8279 $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
8280 fi
8281
8282 # Do each of the archive commands.
8283 if test "$module" = yes && test -n "$module_cmds" ; then
8284 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
8285 eval test_cmds=\"$module_expsym_cmds\"
8286 cmds=$module_expsym_cmds
8287 else
8288 eval test_cmds=\"$module_cmds\"
8289 cmds=$module_cmds
8290 fi
8291 else
8292 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
8293 eval test_cmds=\"$archive_expsym_cmds\"
8294 cmds=$archive_expsym_cmds
8295 else
8296 eval test_cmds=\"$archive_cmds\"
8297 cmds=$archive_cmds
8298 fi
8299 fi
8300
8301 if test "X$skipped_export" != "X:" &&
8302 func_len " $test_cmds" &&
8303 len=$func_len_result &&
8304 test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
8305 :
8306 else
8307 # The command line is too long to link in one step, link piecewise
8308 # or, if using GNU ld and skipped_export is not :, use a linker
8309 # script.
8310
8311 # Save the value of $output and $libobjs because we want to
8312 # use them later. If we have whole_archive_flag_spec, we
8313 # want to use save_libobjs as it was before
8314 # whole_archive_flag_spec was expanded, because we can't
8315 # assume the linker understands whole_archive_flag_spec.
8316 # This may have to be revisited, in case too many
8317 # convenience libraries get linked in and end up exceeding
8318 # the spec.
8319 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
8320 save_libobjs=$libobjs
8321 fi
8322 save_output=$output
8323 func_basename "$output"
8324 output_la=$func_basename_result
8325
8326 # Clear the reloadable object creation command queue and
8327 # initialize k to one.
8328 test_cmds=
8329 concat_cmds=
8330 objlist=
8331 last_robj=
8332 k=1
8333
8334 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
8335 output=${output_objdir}/${output_la}.lnkscript
8336 func_verbose "creating GNU ld script: $output"
8337 echo 'INPUT (' > $output
8338 for obj in $save_libobjs
8339 do
8340 func_to_tool_file "$obj"
8341 $ECHO "$func_to_tool_file_result" >> $output
8342 done
8343 echo ')' >> $output
8344 func_append delfiles " $output"
8345 func_to_tool_file "$output"
8346 output=$func_to_tool_file_result
8347 elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
8348 output=${output_objdir}/${output_la}.lnk
8349 func_verbose "creating linker input file list: $output"
8350 : > $output
8351 set x $save_libobjs
8352 shift
8353 firstobj=
8354 if test "$compiler_needs_object" = yes; then
8355 firstobj="$1 "
8356 shift
8357 fi
8358 for obj
8359 do
8360 func_to_tool_file "$obj"
8361 $ECHO "$func_to_tool_file_result" >> $output
8362 done
8363 func_append delfiles " $output"
8364 func_to_tool_file "$output"
8365 output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
8366 else
8367 if test -n "$save_libobjs"; then
8368 func_verbose "creating reloadable object files..."
8369 output=$output_objdir/$output_la-${k}.$objext
8370 eval test_cmds=\"$reload_cmds\"
8371 func_len " $test_cmds"
8372 len0=$func_len_result
8373 len=$len0
8374
8375 # Loop over the list of objects to be linked.
8376 for obj in $save_libobjs
8377 do
8378 func_len " $obj"
8379 func_arith $len + $func_len_result
8380 len=$func_arith_result
8381 if test "X$objlist" = X ||
8382 test "$len" -lt "$max_cmd_len"; then
8383 func_append objlist " $obj"
8384 else
8385 # The command $test_cmds is almost too long, add a
8386 # command to the queue.
8387 if test "$k" -eq 1 ; then
8388 # The first file doesn't have a previous command to add.
8389 reload_objs=$objlist
8390 eval concat_cmds=\"$reload_cmds\"
8391 else
8392 # All subsequent reloadable object files will link in
8393 # the last one created.
8394 reload_objs="$objlist $last_robj"
8395 eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
8396 fi
8397 last_robj=$output_objdir/$output_la-${k}.$objext
8398 func_arith $k + 1
8399 k=$func_arith_result
8400 output=$output_objdir/$output_la-${k}.$objext
8401 objlist=" $obj"
8402 func_len " $last_robj"
8403 func_arith $len0 + $func_len_result
8404 len=$func_arith_result
8405 fi
8406 done
8407 # Handle the remaining objects by creating one last
8408 # reloadable object file. All subsequent reloadable object
8409 # files will link in the last one created.
8410 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
8411 reload_objs="$objlist $last_robj"
8412 eval concat_cmds=\"\${concat_cmds}$reload_cmds\"
8413 if test -n "$last_robj"; then
8414 eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
8415 fi
8416 func_append delfiles " $output"
8417
8418 else
8419 output=
8420 fi
8421
8422 if ${skipped_export-false}; then
8423 func_verbose "generating symbol list for \`$libname.la'"
8424 export_symbols="$output_objdir/$libname.exp"
8425 $opt_dry_run || $RM $export_symbols
8426 libobjs=$output
8427 # Append the command to create the export file.
8428 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
8429 eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
8430 if test -n "$last_robj"; then
8431 eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
8432 fi
8433 fi
8434
8435 test -n "$save_libobjs" &&
8436 func_verbose "creating a temporary reloadable object file: $output"
8437
8438 # Loop through the commands generated above and execute them.
8439 save_ifs="$IFS"; IFS='~'
8440 for cmd in $concat_cmds; do
8441 IFS="$save_ifs"
8442 $opt_silent || {
8443 func_quote_for_expand "$cmd"
8444 eval "func_echo $func_quote_for_expand_result"
8445 }
8446 $opt_dry_run || eval "$cmd" || {
8447 lt_exit=$?
8448
8449 # Restore the uninstalled library and exit
8450 if test "$opt_mode" = relink; then
8451 ( cd "$output_objdir" && \
8452 $RM "${realname}T" && \
8453 $MV "${realname}U" "$realname" )
8454 fi
8455
8456 exit $lt_exit
8457 }
8458 done
8459 IFS="$save_ifs"
8460
8461 if test -n "$export_symbols_regex" && ${skipped_export-false}; then
8462 func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
8463 func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
8464 fi
8465 fi
8466
8467 if ${skipped_export-false}; then
8468 if test -n "$export_symbols" && test -n "$include_expsyms"; then
8469 tmp_export_symbols="$export_symbols"
8470 test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
8471 $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
8472 fi
8473
8474 if test -n "$orig_export_symbols"; then
8475 # The given exports_symbols file has to be filtered, so filter it.
8476 func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
8477 # FIXME: $output_objdir/$libname.filter potentially contains lots of
8478 # 's' commands which not all seds can handle. GNU sed should be fine
8479 # though. Also, the filter scales superlinearly with the number of
8480 # global variables. join(1) would be nice here, but unfortunately
8481 # isn't a blessed tool.
8482 $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
8483 func_append delfiles " $export_symbols $output_objdir/$libname.filter"
8484 export_symbols=$output_objdir/$libname.def
8485 $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
8486 fi
8487 fi
8488
8489 libobjs=$output
8490 # Restore the value of output.
8491 output=$save_output
8492
8493 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
8494 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
8495 test "X$libobjs" = "X " && libobjs=
8496 fi
8497 # Expand the library linking commands again to reset the
8498 # value of $libobjs for piecewise linking.
8499
8500 # Do each of the archive commands.
8501 if test "$module" = yes && test -n "$module_cmds" ; then
8502 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
8503 cmds=$module_expsym_cmds
8504 else
8505 cmds=$module_cmds
8506 fi
8507 else
8508 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
8509 cmds=$archive_expsym_cmds
8510 else
8511 cmds=$archive_cmds
8512 fi
8513 fi
8514 fi
8515
8516 if test -n "$delfiles"; then
8517 # Append the command to remove temporary files to $cmds.
8518 eval cmds=\"\$cmds~\$RM $delfiles\"
8519 fi
8520
8521 # Add any objects from preloaded convenience libraries
8522 if test -n "$dlprefiles"; then
8523 gentop="$output_objdir/${outputname}x"
8524 func_append generated " $gentop"
8525
8526 func_extract_archives $gentop $dlprefiles
8527 func_append libobjs " $func_extract_archives_result"
8528 test "X$libobjs" = "X " && libobjs=
8529 fi
8530
8531 save_ifs="$IFS"; IFS='~'
8532 for cmd in $cmds; do
8533 IFS="$save_ifs"
8534 eval cmd=\"$cmd\"
8535 $opt_silent || {
8536 func_quote_for_expand "$cmd"
8537 eval "func_echo $func_quote_for_expand_result"
8538 }
8539 $opt_dry_run || eval "$cmd" || {
8540 lt_exit=$?
8541
8542 # Restore the uninstalled library and exit
8543 if test "$opt_mode" = relink; then
8544 ( cd "$output_objdir" && \
8545 $RM "${realname}T" && \
8546 $MV "${realname}U" "$realname" )
8547 fi
8548
8549 exit $lt_exit
8550 }
8551 done
8552 IFS="$save_ifs"
8553
8554 # Restore the uninstalled library and exit
8555 if test "$opt_mode" = relink; then
8556 $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
8557
8558 if test -n "$convenience"; then
8559 if test -z "$whole_archive_flag_spec"; then
8560 func_show_eval '${RM}r "$gentop"'
8561 fi
8562 fi
8563
8564 exit $EXIT_SUCCESS
8565 fi
8566
8567 # Create links to the real library.
8568 for linkname in $linknames; do
8569 if test "$realname" != "$linkname"; then
8570 func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
8571 fi
8572 done
8573
8574 # If -module or -export-dynamic was specified, set the dlname.
8575 if test "$module" = yes || test "$export_dynamic" = yes; then
8576 # On all known operating systems, these are identical.
8577 dlname="$soname"
8578 fi
8579 fi
8580 ;;
8581
8582 obj)
8583 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
8584 func_warning "\`-dlopen' is ignored for objects"
8585 fi
8586
8587 case " $deplibs" in
8588 *\ -l* | *\ -L*)
8589 func_warning "\`-l' and \`-L' are ignored for objects" ;;
8590 esac
8591
8592 test -n "$rpath" && \
8593 func_warning "\`-rpath' is ignored for objects"
8594
8595 test -n "$xrpath" && \
8596 func_warning "\`-R' is ignored for objects"
8597
8598 test -n "$vinfo" && \
8599 func_warning "\`-version-info' is ignored for objects"
8600
8601 test -n "$release" && \
8602 func_warning "\`-release' is ignored for objects"
8603
8604 case $output in
8605 *.lo)
8606 test -n "$objs$old_deplibs" && \
8607 func_fatal_error "cannot build library object \`$output' from non-libtool objects"
8608
8609 libobj=$output
8610 func_lo2o "$libobj"
8611 obj=$func_lo2o_result
8612 ;;
8613 *)
8614 libobj=
8615 obj="$output"
8616 ;;
8617 esac
8618
8619 # Delete the old objects.
8620 $opt_dry_run || $RM $obj $libobj
8621
8622 # Objects from convenience libraries. This assumes
8623 # single-version convenience libraries. Whenever we create
8624 # different ones for PIC/non-PIC, this we'll have to duplicate
8625 # the extraction.
8626 reload_conv_objs=
8627 gentop=
8628 # reload_cmds runs $LD directly, so let us get rid of
8629 # -Wl from whole_archive_flag_spec and hope we can get by with
8630 # turning comma into space..
8631 wl=
8632
8633 if test -n "$convenience"; then
8634 if test -n "$whole_archive_flag_spec"; then
8635 eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
8636 reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
8637 else
8638 gentop="$output_objdir/${obj}x"
8639 func_append generated " $gentop"
8640
8641 func_extract_archives $gentop $convenience
8642 reload_conv_objs="$reload_objs $func_extract_archives_result"
8643 fi
8644 fi
8645
8646 # If we're not building shared, we need to use non_pic_objs
8647 test "$build_libtool_libs" != yes && libobjs="$non_pic_objects"
8648
8649 # Create the old-style object.
8650 reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
8651
8652 output="$obj"
8653 func_execute_cmds "$reload_cmds" 'exit $?'
8654
8655 # Exit if we aren't doing a library object file.
8656 if test -z "$libobj"; then
8657 if test -n "$gentop"; then
8658 func_show_eval '${RM}r "$gentop"'
8659 fi
8660
8661 exit $EXIT_SUCCESS
8662 fi
8663
8664 if test "$build_libtool_libs" != yes; then
8665 if test -n "$gentop"; then
8666 func_show_eval '${RM}r "$gentop"'
8667 fi
8668
8669 # Create an invalid libtool object if no PIC, so that we don't
8670 # accidentally link it into a program.
8671 # $show "echo timestamp > $libobj"
8672 # $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
8673 exit $EXIT_SUCCESS
8674 fi
8675
8676 if test -n "$pic_flag" || test "$pic_mode" != default; then
8677 # Only do commands if we really have different PIC objects.
8678 reload_objs="$libobjs $reload_conv_objs"
8679 output="$libobj"
8680 func_execute_cmds "$reload_cmds" 'exit $?'
8681 fi
8682
8683 if test -n "$gentop"; then
8684 func_show_eval '${RM}r "$gentop"'
8685 fi
8686
8687 exit $EXIT_SUCCESS
8688 ;;
8689
8690 prog)
8691 case $host in
8692 *cygwin*) func_stripname '' '.exe' "$output"
8693 output=$func_stripname_result.exe;;
8694 esac
8695 test -n "$vinfo" && \
8696 func_warning "\`-version-info' is ignored for programs"
8697
8698 test -n "$release" && \
8699 func_warning "\`-release' is ignored for programs"
8700
8701 test "$preload" = yes \
8702 && test "$dlopen_support" = unknown \
8703 && test "$dlopen_self" = unknown \
8704 && test "$dlopen_self_static" = unknown && \
8705 func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
8706
8707 case $host in
8708 *-*-rhapsody* | *-*-darwin1.[012])
8709 # On Rhapsody replace the C library is the System framework
8710 compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'`
8711 finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'`
8712 ;;
8713 esac
8714
8715 case $host in
8716 *-*-darwin*)
8717 # Don't allow lazy linking, it breaks C++ global constructors
8718 # But is supposedly fixed on 10.4 or later (yay!).
8719 if test "$tagname" = CXX ; then
8720 case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
8721 10.[0123])
8722 func_append compile_command " ${wl}-bind_at_load"
8723 func_append finalize_command " ${wl}-bind_at_load"
8724 ;;
8725 esac
8726 fi
8727 # Time to change all our "foo.ltframework" stuff back to "-framework foo"
8728 compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
8729 finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
8730 ;;
8731 esac
8732
8733
8734 # move library search paths that coincide with paths to not yet
8735 # installed libraries to the beginning of the library search list
8736 new_libs=
8737 for path in $notinst_path; do
8738 case " $new_libs " in
8739 *" -L$path/$objdir "*) ;;
8740 *)
8741 case " $compile_deplibs " in
8742 *" -L$path/$objdir "*)
8743 func_append new_libs " -L$path/$objdir" ;;
8744 esac
8745 ;;
8746 esac
8747 done
8748 for deplib in $compile_deplibs; do
8749 case $deplib in
8750 -L*)
8751 case " $new_libs " in
8752 *" $deplib "*) ;;
8753 *) func_append new_libs " $deplib" ;;
8754 esac
8755 ;;
8756 *) func_append new_libs " $deplib" ;;
8757 esac
8758 done
8759 compile_deplibs="$new_libs"
8760
8761
8762 func_append compile_command " $compile_deplibs"
8763 func_append finalize_command " $finalize_deplibs"
8764
8765 if test -n "$rpath$xrpath"; then
8766 # If the user specified any rpath flags, then add them.
8767 for libdir in $rpath $xrpath; do
8768 # This is the magic to use -rpath.
8769 case "$finalize_rpath " in
8770 *" $libdir "*) ;;
8771 *) func_append finalize_rpath " $libdir" ;;
8772 esac
8773 done
8774 fi
8775
8776 # Now hardcode the library paths
8777 rpath=
8778 hardcode_libdirs=
8779 for libdir in $compile_rpath $finalize_rpath; do
8780 if test -n "$hardcode_libdir_flag_spec"; then
8781 if test -n "$hardcode_libdir_separator"; then
8782 if test -z "$hardcode_libdirs"; then
8783 hardcode_libdirs="$libdir"
8784 else
8785 # Just accumulate the unique libdirs.
8786 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
8787 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
8788 ;;
8789 *)
8790 func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
8791 ;;
8792 esac
8793 fi
8794 else
8795 eval flag=\"$hardcode_libdir_flag_spec\"
8796 func_append rpath " $flag"
8797 fi
8798 elif test -n "$runpath_var"; then
8799 case "$perm_rpath " in
8800 *" $libdir "*) ;;
8801 *) func_append perm_rpath " $libdir" ;;
8802 esac
8803 fi
8804 case $host in
8805 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
8806 testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
8807 case :$dllsearchpath: in
8808 *":$libdir:"*) ;;
8809 ::) dllsearchpath=$libdir;;
8810 *) func_append dllsearchpath ":$libdir";;
8811 esac
8812 case :$dllsearchpath: in
8813 *":$testbindir:"*) ;;
8814 ::) dllsearchpath=$testbindir;;
8815 *) func_append dllsearchpath ":$testbindir";;
8816 esac
8817 ;;
8818 esac
8819 done
8820 # Substitute the hardcoded libdirs into the rpath.
8821 if test -n "$hardcode_libdir_separator" &&
8822 test -n "$hardcode_libdirs"; then
8823 libdir="$hardcode_libdirs"
8824 eval rpath=\" $hardcode_libdir_flag_spec\"
8825 fi
8826 compile_rpath="$rpath"
8827
8828 rpath=
8829 hardcode_libdirs=
8830 for libdir in $finalize_rpath; do
8831 if test -n "$hardcode_libdir_flag_spec"; then
8832 if test -n "$hardcode_libdir_separator"; then
8833 if test -z "$hardcode_libdirs"; then
8834 hardcode_libdirs="$libdir"
8835 else
8836 # Just accumulate the unique libdirs.
8837 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
8838 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
8839 ;;
8840 *)
8841 func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
8842 ;;
8843 esac
8844 fi
8845 else
8846 eval flag=\"$hardcode_libdir_flag_spec\"
8847 func_append rpath " $flag"
8848 fi
8849 elif test -n "$runpath_var"; then
8850 case "$finalize_perm_rpath " in
8851 *" $libdir "*) ;;
8852 *) func_append finalize_perm_rpath " $libdir" ;;
8853 esac
8854 fi
8855 done
8856 # Substitute the hardcoded libdirs into the rpath.
8857 if test -n "$hardcode_libdir_separator" &&
8858 test -n "$hardcode_libdirs"; then
8859 libdir="$hardcode_libdirs"
8860 eval rpath=\" $hardcode_libdir_flag_spec\"
8861 fi
8862 finalize_rpath="$rpath"
8863
8864 if test -n "$libobjs" && test "$build_old_libs" = yes; then
8865 # Transform all the library objects into standard objects.
8866 compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
8867 finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
8868 fi
8869
8870 func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
8871
8872 # template prelinking step
8873 if test -n "$prelink_cmds"; then
8874 func_execute_cmds "$prelink_cmds" 'exit $?'
8875 fi
8876
8877 wrappers_required=yes
8878 case $host in
8879 *cegcc* | *mingw32ce*)
8880 # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
8881 wrappers_required=no
8882 ;;
8883 *cygwin* | *mingw* )
8884 if test "$build_libtool_libs" != yes; then
8885 wrappers_required=no
8886 fi
8887 ;;
8888 *)
8889 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
8890 wrappers_required=no
8891 fi
8892 ;;
8893 esac
8894 if test "$wrappers_required" = no; then
8895 # Replace the output file specification.
8896 compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
8897 link_command="$compile_command$compile_rpath"
8898
8899 # We have no uninstalled library dependencies, so finalize right now.
8900 exit_status=0
8901 func_show_eval "$link_command" 'exit_status=$?'
8902
8903 if test -n "$postlink_cmds"; then
8904 func_to_tool_file "$output"
8905 postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
8906 func_execute_cmds "$postlink_cmds" 'exit $?'
8907 fi
8908
8909 # Delete the generated files.
8910 if test -f "$output_objdir/${outputname}S.${objext}"; then
8911 func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
8912 fi
8913
8914 exit $exit_status
8915 fi
8916
8917 if test -n "$compile_shlibpath$finalize_shlibpath"; then
8918 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
8919 fi
8920 if test -n "$finalize_shlibpath"; then
8921 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
8922 fi
8923
8924 compile_var=
8925 finalize_var=
8926 if test -n "$runpath_var"; then
8927 if test -n "$perm_rpath"; then
8928 # We should set the runpath_var.
8929 rpath=
8930 for dir in $perm_rpath; do
8931 func_append rpath "$dir:"
8932 done
8933 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
8934 fi
8935 if test -n "$finalize_perm_rpath"; then
8936 # We should set the runpath_var.
8937 rpath=
8938 for dir in $finalize_perm_rpath; do
8939 func_append rpath "$dir:"
8940 done
8941 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
8942 fi
8943 fi
8944
8945 if test "$no_install" = yes; then
8946 # We don't need to create a wrapper script.
8947 link_command="$compile_var$compile_command$compile_rpath"
8948 # Replace the output file specification.
8949 link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
8950 # Delete the old output file.
8951 $opt_dry_run || $RM $output
8952 # Link the executable and exit
8953 func_show_eval "$link_command" 'exit $?'
8954
8955 if test -n "$postlink_cmds"; then
8956 func_to_tool_file "$output"
8957 postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
8958 func_execute_cmds "$postlink_cmds" 'exit $?'
8959 fi
8960
8961 exit $EXIT_SUCCESS
8962 fi
8963
8964 if test "$hardcode_action" = relink; then
8965 # Fast installation is not supported
8966 link_command="$compile_var$compile_command$compile_rpath"
8967 relink_command="$finalize_var$finalize_command$finalize_rpath"
8968
8969 func_warning "this platform does not like uninstalled shared libraries"
8970 func_warning "\`$output' will be relinked during installation"
8971 else
8972 if test "$fast_install" != no; then
8973 link_command="$finalize_var$compile_command$finalize_rpath"
8974 if test "$fast_install" = yes; then
8975 relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
8976 else
8977 # fast_install is set to needless
8978 relink_command=
8979 fi
8980 else
8981 link_command="$compile_var$compile_command$compile_rpath"
8982 relink_command="$finalize_var$finalize_command$finalize_rpath"
8983 fi
8984 fi
8985
8986 # Replace the output file specification.
8987 link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
8988
8989 # Delete the old output files.
8990 $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
8991
8992 func_show_eval "$link_command" 'exit $?'
8993
8994 if test -n "$postlink_cmds"; then
8995 func_to_tool_file "$output_objdir/$outputname"
8996 postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
8997 func_execute_cmds "$postlink_cmds" 'exit $?'
8998 fi
8999
9000 # Now create the wrapper script.
9001 func_verbose "creating $output"
9002
9003 # Quote the relink command for shipping.
9004 if test -n "$relink_command"; then
9005 # Preserve any variables that may affect compiler behavior
9006 for var in $variables_saved_for_relink; do
9007 if eval test -z \"\${$var+set}\"; then
9008 relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
9009 elif eval var_value=\$$var; test -z "$var_value"; then
9010 relink_command="$var=; export $var; $relink_command"
9011 else
9012 func_quote_for_eval "$var_value"
9013 relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
9014 fi
9015 done
9016 relink_command="(cd `pwd`; $relink_command)"
9017 relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
9018 fi
9019
9020 # Only actually do things if not in dry run mode.
9021 $opt_dry_run || {
9022 # win32 will think the script is a binary if it has
9023 # a .exe suffix, so we strip it off here.
9024 case $output in
9025 *.exe) func_stripname '' '.exe' "$output"
9026 output=$func_stripname_result ;;
9027 esac
9028 # test for cygwin because mv fails w/o .exe extensions
9029 case $host in
9030 *cygwin*)
9031 exeext=.exe
9032 func_stripname '' '.exe' "$outputname"
9033 outputname=$func_stripname_result ;;
9034 *) exeext= ;;
9035 esac
9036 case $host in
9037 *cygwin* | *mingw* )
9038 func_dirname_and_basename "$output" "" "."
9039 output_name=$func_basename_result
9040 output_path=$func_dirname_result
9041 cwrappersource="$output_path/$objdir/lt-$output_name.c"
9042 cwrapper="$output_path/$output_name.exe"
9043 $RM $cwrappersource $cwrapper
9044 trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
9045
9046 func_emit_cwrapperexe_src > $cwrappersource
9047
9048 # The wrapper executable is built using the $host compiler,
9049 # because it contains $host paths and files. If cross-
9050 # compiling, it, like the target executable, must be
9051 # executed on the $host or under an emulation environment.
9052 $opt_dry_run || {
9053 $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
9054 $STRIP $cwrapper
9055 }
9056
9057 # Now, create the wrapper script for func_source use:
9058 func_ltwrapper_scriptname $cwrapper
9059 $RM $func_ltwrapper_scriptname_result
9060 trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
9061 $opt_dry_run || {
9062 # note: this script will not be executed, so do not chmod.
9063 if test "x$build" = "x$host" ; then
9064 $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
9065 else
9066 func_emit_wrapper no > $func_ltwrapper_scriptname_result
9067 fi
9068 }
9069 ;;
9070 * )
9071 $RM $output
9072 trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
9073
9074 func_emit_wrapper no > $output
9075 chmod +x $output
9076 ;;
9077 esac
9078 }
9079 exit $EXIT_SUCCESS
9080 ;;
9081 esac
9082
9083 # See if we need to build an old-fashioned archive.
9084 for oldlib in $oldlibs; do
9085
9086 if test "$build_libtool_libs" = convenience; then
9087 oldobjs="$libobjs_save $symfileobj"
9088 addlibs="$convenience"
9089 build_libtool_libs=no
9090 else
9091 if test "$build_libtool_libs" = module; then
9092 oldobjs="$libobjs_save"
9093 build_libtool_libs=no
9094 else
9095 oldobjs="$old_deplibs $non_pic_objects"
9096 if test "$preload" = yes && test -f "$symfileobj"; then
9097 func_append oldobjs " $symfileobj"
9098 fi
9099 fi
9100 addlibs="$old_convenience"
9101 fi
9102
9103 if test -n "$addlibs"; then
9104 gentop="$output_objdir/${outputname}x"
9105 func_append generated " $gentop"
9106
9107 func_extract_archives $gentop $addlibs
9108 func_append oldobjs " $func_extract_archives_result"
9109 fi
9110
9111 # Do each command in the archive commands.
9112 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
9113 cmds=$old_archive_from_new_cmds
9114 else
9115
9116 # Add any objects from preloaded convenience libraries
9117 if test -n "$dlprefiles"; then
9118 gentop="$output_objdir/${outputname}x"
9119 func_append generated " $gentop"
9120
9121 func_extract_archives $gentop $dlprefiles
9122 func_append oldobjs " $func_extract_archives_result"
9123 fi
9124
9125 # POSIX demands no paths to be encoded in archives. We have
9126 # to avoid creating archives with duplicate basenames if we
9127 # might have to extract them afterwards, e.g., when creating a
9128 # static archive out of a convenience library, or when linking
9129 # the entirety of a libtool archive into another (currently
9130 # not supported by libtool).
9131 if (for obj in $oldobjs
9132 do
9133 func_basename "$obj"
9134 $ECHO "$func_basename_result"
9135 done | sort | sort -uc >/dev/null 2>&1); then
9136 :
9137 else
9138 echo "copying selected object files to avoid basename conflicts..."
9139 gentop="$output_objdir/${outputname}x"
9140 func_append generated " $gentop"
9141 func_mkdir_p "$gentop"
9142 save_oldobjs=$oldobjs
9143 oldobjs=
9144 counter=1
9145 for obj in $save_oldobjs
9146 do
9147 func_basename "$obj"
9148 objbase="$func_basename_result"
9149 case " $oldobjs " in
9150 " ") oldobjs=$obj ;;
9151 *[\ /]"$objbase "*)
9152 while :; do
9153 # Make sure we don't pick an alternate name that also
9154 # overlaps.
9155 newobj=lt$counter-$objbase
9156 func_arith $counter + 1
9157 counter=$func_arith_result
9158 case " $oldobjs " in
9159 *[\ /]"$newobj "*) ;;
9160 *) if test ! -f "$gentop/$newobj"; then break; fi ;;
9161 esac
9162 done
9163 func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
9164 func_append oldobjs " $gentop/$newobj"
9165 ;;
9166 *) func_append oldobjs " $obj" ;;
9167 esac
9168 done
9169 fi
9170 func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
9171 tool_oldlib=$func_to_tool_file_result
9172 eval cmds=\"$old_archive_cmds\"
9173
9174 func_len " $cmds"
9175 len=$func_len_result
9176 if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
9177 cmds=$old_archive_cmds
9178 elif test -n "$archiver_list_spec"; then
9179 func_verbose "using command file archive linking..."
9180 for obj in $oldobjs
9181 do
9182 func_to_tool_file "$obj"
9183 $ECHO "$func_to_tool_file_result"
9184 done > $output_objdir/$libname.libcmd
9185 func_to_tool_file "$output_objdir/$libname.libcmd"
9186 oldobjs=" $archiver_list_spec$func_to_tool_file_result"
9187 cmds=$old_archive_cmds
9188 else
9189 # the command line is too long to link in one step, link in parts
9190 func_verbose "using piecewise archive linking..."
9191 save_RANLIB=$RANLIB
9192 RANLIB=:
9193 objlist=
9194 concat_cmds=
9195 save_oldobjs=$oldobjs
9196 oldobjs=
9197 # Is there a better way of finding the last object in the list?
9198 for obj in $save_oldobjs
9199 do
9200 last_oldobj=$obj
9201 done
9202 eval test_cmds=\"$old_archive_cmds\"
9203 func_len " $test_cmds"
9204 len0=$func_len_result
9205 len=$len0
9206 for obj in $save_oldobjs
9207 do
9208 func_len " $obj"
9209 func_arith $len + $func_len_result
9210 len=$func_arith_result
9211 func_append objlist " $obj"
9212 if test "$len" -lt "$max_cmd_len"; then
9213 :
9214 else
9215 # the above command should be used before it gets too long
9216 oldobjs=$objlist
9217 if test "$obj" = "$last_oldobj" ; then
9218 RANLIB=$save_RANLIB
9219 fi
9220 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
9221 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
9222 objlist=
9223 len=$len0
9224 fi
9225 done
9226 RANLIB=$save_RANLIB
9227 oldobjs=$objlist
9228 if test "X$oldobjs" = "X" ; then
9229 eval cmds=\"\$concat_cmds\"
9230 else
9231 eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
9232 fi
9233 fi
9234 fi
9235 func_execute_cmds "$cmds" 'exit $?'
9236 done
9237
9238 test -n "$generated" && \
9239 func_show_eval "${RM}r$generated"
9240
9241 # Now create the libtool archive.
9242 case $output in
9243 *.la)
9244 old_library=
9245 test "$build_old_libs" = yes && old_library="$libname.$libext"
9246 func_verbose "creating $output"
9247
9248 # Preserve any variables that may affect compiler behavior
9249 for var in $variables_saved_for_relink; do
9250 if eval test -z \"\${$var+set}\"; then
9251 relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
9252 elif eval var_value=\$$var; test -z "$var_value"; then
9253 relink_command="$var=; export $var; $relink_command"
9254 else
9255 func_quote_for_eval "$var_value"
9256 relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
9257 fi
9258 done
9259 # Quote the link command for shipping.
9260 relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
9261 relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
9262 if test "$hardcode_automatic" = yes ; then
9263 relink_command=
9264 fi
9265
9266 # Only create the output if not a dry run.
9267 $opt_dry_run || {
9268 for installed in no yes; do
9269 if test "$installed" = yes; then
9270 if test -z "$install_libdir"; then
9271 break
9272 fi
9273 output="$output_objdir/$outputname"i
9274 # Replace all uninstalled libtool libraries with the installed ones
9275 newdependency_libs=
9276 for deplib in $dependency_libs; do
9277 case $deplib in
9278 *.la)
9279 func_basename "$deplib"
9280 name="$func_basename_result"
9281 func_resolve_sysroot "$deplib"
9282 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
9283 test -z "$libdir" && \
9284 func_fatal_error "\`$deplib' is not a valid libtool archive"
9285 func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
9286 ;;
9287 -L*)
9288 func_stripname -L '' "$deplib"
9289 func_replace_sysroot "$func_stripname_result"
9290 func_append newdependency_libs " -L$func_replace_sysroot_result"
9291 ;;
9292 -R*)
9293 func_stripname -R '' "$deplib"
9294 func_replace_sysroot "$func_stripname_result"
9295 func_append newdependency_libs " -R$func_replace_sysroot_result"
9296 ;;
9297 *) func_append newdependency_libs " $deplib" ;;
9298 esac
9299 done
9300 dependency_libs="$newdependency_libs"
9301 newdlfiles=
9302
9303 for lib in $dlfiles; do
9304 case $lib in
9305 *.la)
9306 func_basename "$lib"
9307 name="$func_basename_result"
9308 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
9309 test -z "$libdir" && \
9310 func_fatal_error "\`$lib' is not a valid libtool archive"
9311 func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
9312 ;;
9313 *) func_append newdlfiles " $lib" ;;
9314 esac
9315 done
9316 dlfiles="$newdlfiles"
9317 newdlprefiles=
9318 for lib in $dlprefiles; do
9319 case $lib in
9320 *.la)
9321 # Only pass preopened files to the pseudo-archive (for
9322 # eventual linking with the app. that links it) if we
9323 # didn't already link the preopened objects directly into
9324 # the library:
9325 func_basename "$lib"
9326 name="$func_basename_result"
9327 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
9328 test -z "$libdir" && \
9329 func_fatal_error "\`$lib' is not a valid libtool archive"
9330 func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
9331 ;;
9332 esac
9333 done
9334 dlprefiles="$newdlprefiles"
9335 else
9336 newdlfiles=
9337 for lib in $dlfiles; do
9338 case $lib in
9339 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
9340 *) abs=`pwd`"/$lib" ;;
9341 esac
9342 func_append newdlfiles " $abs"
9343 done
9344 dlfiles="$newdlfiles"
9345 newdlprefiles=
9346 for lib in $dlprefiles; do
9347 case $lib in
9348 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
9349 *) abs=`pwd`"/$lib" ;;
9350 esac
9351 func_append newdlprefiles " $abs"
9352 done
9353 dlprefiles="$newdlprefiles"
9354 fi
9355 $RM $output
9356 # place dlname in correct position for cygwin
9357 # In fact, it would be nice if we could use this code for all target
9358 # systems that can't hard-code library paths into their executables
9359 # and that have no shared library path variable independent of PATH,
9360 # but it turns out we can't easily determine that from inspecting
9361 # libtool variables, so we have to hard-code the OSs to which it
9362 # applies here; at the moment, that means platforms that use the PE
9363 # object format with DLL files. See the long comment at the top of
9364 # tests/bindir.at for full details.
9365 tdlname=$dlname
9366 case $host,$output,$installed,$module,$dlname in
9367 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
9368 # If a -bindir argument was supplied, place the dll there.
9369 if test "x$bindir" != x ;
9370 then
9371 func_relative_path "$install_libdir" "$bindir"
9372 tdlname=$func_relative_path_result$dlname
9373 else
9374 # Otherwise fall back on heuristic.
9375 tdlname=../bin/$dlname
9376 fi
9377 ;;
9378 esac
9379 $ECHO > $output "\
9380 # $outputname - a libtool library file
9381 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
9382 #
9383 # Please DO NOT delete this file!
9384 # It is necessary for linking the library.
9385
9386 # The name that we can dlopen(3).
9387 dlname='$tdlname'
9388
9389 # Names of this library.
9390 library_names='$library_names'
9391
9392 # The name of the static archive.
9393 old_library='$old_library'
9394
9395 # Linker flags that can not go in dependency_libs.
9396 inherited_linker_flags='$new_inherited_linker_flags'
9397
9398 # Libraries that this one depends upon.
9399 dependency_libs='$dependency_libs'
9400
9401 # Names of additional weak libraries provided by this library
9402 weak_library_names='$weak_libs'
9403
9404 # Version information for $libname.
9405 current=$current
9406 age=$age
9407 revision=$revision
9408
9409 # Is this an already installed library?
9410 installed=$installed
9411
9412 # Should we warn about portability when linking against -modules?
9413 shouldnotlink=$module
9414
9415 # Files to dlopen/dlpreopen
9416 dlopen='$dlfiles'
9417 dlpreopen='$dlprefiles'
9418
9419 # Directory that this library needs to be installed in:
9420 libdir='$install_libdir'"
9421 if test "$installed" = no && test "$need_relink" = yes; then
9422 $ECHO >> $output "\
9423 relink_command=\"$relink_command\""
9424 fi
9425 done
9426 }
9427
9428 # Do a symbolic link so that the libtool archive can be found in
9429 # LD_LIBRARY_PATH before the program is installed.
9430 func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
9431 ;;
9432 esac
9433 exit $EXIT_SUCCESS
9434 }
9435
9436 { test "$opt_mode" = link || test "$opt_mode" = relink; } &&
9437 func_mode_link ${1+"$@"}
9438
9439
9440 # func_mode_uninstall arg...
9441 func_mode_uninstall ()
9442 {
9443 $opt_debug
9444 RM="$nonopt"
9445 files=
9446 rmforce=
9447 exit_status=0
9448
9449 # This variable tells wrapper scripts just to set variables rather
9450 # than running their programs.
9451 libtool_install_magic="$magic"
9452
9453 for arg
9454 do
9455 case $arg in
9456 -f) func_append RM " $arg"; rmforce=yes ;;
9457 -*) func_append RM " $arg" ;;
9458 *) func_append files " $arg" ;;
9459 esac
9460 done
9461
9462 test -z "$RM" && \
9463 func_fatal_help "you must specify an RM program"
9464
9465 rmdirs=
9466
9467 for file in $files; do
9468 func_dirname "$file" "" "."
9469 dir="$func_dirname_result"
9470 if test "X$dir" = X.; then
9471 odir="$objdir"
9472 else
9473 odir="$dir/$objdir"
9474 fi
9475 func_basename "$file"
9476 name="$func_basename_result"
9477 test "$opt_mode" = uninstall && odir="$dir"
9478
9479 # Remember odir for removal later, being careful to avoid duplicates
9480 if test "$opt_mode" = clean; then
9481 case " $rmdirs " in
9482 *" $odir "*) ;;
9483 *) func_append rmdirs " $odir" ;;
9484 esac
9485 fi
9486
9487 # Don't error if the file doesn't exist and rm -f was used.
9488 if { test -L "$file"; } >/dev/null 2>&1 ||
9489 { test -h "$file"; } >/dev/null 2>&1 ||
9490 test -f "$file"; then
9491 :
9492 elif test -d "$file"; then
9493 exit_status=1
9494 continue
9495 elif test "$rmforce" = yes; then
9496 continue
9497 fi
9498
9499 rmfiles="$file"
9500
9501 case $name in
9502 *.la)
9503 # Possibly a libtool archive, so verify it.
9504 if func_lalib_p "$file"; then
9505 func_source $dir/$name
9506
9507 # Delete the libtool libraries and symlinks.
9508 for n in $library_names; do
9509 func_append rmfiles " $odir/$n"
9510 done
9511 test -n "$old_library" && func_append rmfiles " $odir/$old_library"
9512
9513 case "$opt_mode" in
9514 clean)
9515 case " $library_names " in
9516 *" $dlname "*) ;;
9517 *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;;
9518 esac
9519 test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i"
9520 ;;
9521 uninstall)
9522 if test -n "$library_names"; then
9523 # Do each command in the postuninstall commands.
9524 func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
9525 fi
9526
9527 if test -n "$old_library"; then
9528 # Do each command in the old_postuninstall commands.
9529 func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
9530 fi
9531 # FIXME: should reinstall the best remaining shared library.
9532 ;;
9533 esac
9534 fi
9535 ;;
9536
9537 *.lo)
9538 # Possibly a libtool object, so verify it.
9539 if func_lalib_p "$file"; then
9540
9541 # Read the .lo file
9542 func_source $dir/$name
9543
9544 # Add PIC object to the list of files to remove.
9545 if test -n "$pic_object" &&
9546 test "$pic_object" != none; then
9547 func_append rmfiles " $dir/$pic_object"
9548 fi
9549
9550 # Add non-PIC object to the list of files to remove.
9551 if test -n "$non_pic_object" &&
9552 test "$non_pic_object" != none; then
9553 func_append rmfiles " $dir/$non_pic_object"
9554 fi
9555 fi
9556 ;;
9557
9558 *)
9559 if test "$opt_mode" = clean ; then
9560 noexename=$name
9561 case $file in
9562 *.exe)
9563 func_stripname '' '.exe' "$file"
9564 file=$func_stripname_result
9565 func_stripname '' '.exe' "$name"
9566 noexename=$func_stripname_result
9567 # $file with .exe has already been added to rmfiles,
9568 # add $file without .exe
9569 func_append rmfiles " $file"
9570 ;;
9571 esac
9572 # Do a test to see if this is a libtool program.
9573 if func_ltwrapper_p "$file"; then
9574 if func_ltwrapper_executable_p "$file"; then
9575 func_ltwrapper_scriptname "$file"
9576 relink_command=
9577 func_source $func_ltwrapper_scriptname_result
9578 func_append rmfiles " $func_ltwrapper_scriptname_result"
9579 else
9580 relink_command=
9581 func_source $dir/$noexename
9582 fi
9583
9584 # note $name still contains .exe if it was in $file originally
9585 # as does the version of $file that was added into $rmfiles
9586 func_append rmfiles " $odir/$name $odir/${name}S.${objext}"
9587 if test "$fast_install" = yes && test -n "$relink_command"; then
9588 func_append rmfiles " $odir/lt-$name"
9589 fi
9590 if test "X$noexename" != "X$name" ; then
9591 func_append rmfiles " $odir/lt-${noexename}.c"
9592 fi
9593 fi
9594 fi
9595 ;;
9596 esac
9597 func_show_eval "$RM $rmfiles" 'exit_status=1'
9598 done
9599
9600 # Try to remove the ${objdir}s in the directories where we deleted files
9601 for dir in $rmdirs; do
9602 if test -d "$dir"; then
9603 func_show_eval "rmdir $dir >/dev/null 2>&1"
9604 fi
9605 done
9606
9607 exit $exit_status
9608 }
9609
9610 { test "$opt_mode" = uninstall || test "$opt_mode" = clean; } &&
9611 func_mode_uninstall ${1+"$@"}
9612
9613 test -z "$opt_mode" && {
9614 help="$generic_help"
9615 func_fatal_help "you must specify a MODE"
9616 }
9617
9618 test -z "$exec_cmd" && \
9619 func_fatal_help "invalid operation mode \`$opt_mode'"
9620
9621 if test -n "$exec_cmd"; then
9622 eval exec "$exec_cmd"
9623 exit $EXIT_FAILURE
9624 fi
9625
9626 exit $exit_status
9627
9628
9629 # The TAGs below are defined such that we never get into a situation
9630 # in which we disable both kinds of libraries. Given conflicting
9631 # choices, we go for a static library, that is the most portable,
9632 # since we can't tell whether shared libraries were disabled because
9633 # the user asked for that or because the platform doesn't support
9634 # them. This is particularly important on AIX, because we don't
9635 # support having both static and shared libraries enabled at the same
9636 # time on that platform, so we default to a shared-only configuration.
9637 # If a disable-shared tag is given, we'll fallback to a static-only
9638 # configuration. But we'll never go from static-only to shared-only.
9639
9640 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
9641 build_libtool_libs=no
9642 build_old_libs=yes
9643 # ### END LIBTOOL TAG CONFIG: disable-shared
9644
9645 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
9646 build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
9647 # ### END LIBTOOL TAG CONFIG: disable-static
9648
9649 # Local Variables:
9650 # mode:shell-script
9651 # sh-indentation:2
9652 # End:
9653 # vi:sw=2
9654
0 #! /bin/sh
1 # Common stub for a few missing GNU programs while installing.
2
3 scriptversion=2012-01-06.13; # UTC
4
5 # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
6 # 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
7 # Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
8
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 2, or (at your option)
12 # any later version.
13
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
18
19 # You should have received a copy of the GNU General Public License
20 # along with this program. If not, see <http://www.gnu.org/licenses/>.
21
22 # As a special exception to the GNU General Public License, if you
23 # distribute this file as part of a program that contains a
24 # configuration script generated by Autoconf, you may include it under
25 # the same distribution terms that you use for the rest of that program.
26
27 if test $# -eq 0; then
28 echo 1>&2 "Try \`$0 --help' for more information"
29 exit 1
30 fi
31
32 run=:
33 sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
34 sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
35
36 # In the cases where this matters, `missing' is being run in the
37 # srcdir already.
38 if test -f configure.ac; then
39 configure_ac=configure.ac
40 else
41 configure_ac=configure.in
42 fi
43
44 msg="missing on your system"
45
46 case $1 in
47 --run)
48 # Try to run requested program, and just exit if it succeeds.
49 run=
50 shift
51 "$@" && exit 0
52 # Exit code 63 means version mismatch. This often happens
53 # when the user try to use an ancient version of a tool on
54 # a file that requires a minimum version. In this case we
55 # we should proceed has if the program had been absent, or
56 # if --run hadn't been passed.
57 if test $? = 63; then
58 run=:
59 msg="probably too old"
60 fi
61 ;;
62
63 -h|--h|--he|--hel|--help)
64 echo "\
65 $0 [OPTION]... PROGRAM [ARGUMENT]...
66
67 Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
68 error status if there is no known handling for PROGRAM.
69
70 Options:
71 -h, --help display this help and exit
72 -v, --version output version information and exit
73 --run try to run the given command, and emulate it if it fails
74
75 Supported PROGRAM values:
76 aclocal touch file \`aclocal.m4'
77 autoconf touch file \`configure'
78 autoheader touch file \`config.h.in'
79 autom4te touch the output file, or create a stub one
80 automake touch all \`Makefile.in' files
81 bison create \`y.tab.[ch]', if possible, from existing .[ch]
82 flex create \`lex.yy.c', if possible, from existing .c
83 help2man touch the output file
84 lex create \`lex.yy.c', if possible, from existing .c
85 makeinfo touch the output file
86 yacc create \`y.tab.[ch]', if possible, from existing .[ch]
87
88 Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
89 \`g' are ignored when checking the name.
90
91 Send bug reports to <bug-automake@gnu.org>."
92 exit $?
93 ;;
94
95 -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
96 echo "missing $scriptversion (GNU Automake)"
97 exit $?
98 ;;
99
100 -*)
101 echo 1>&2 "$0: Unknown \`$1' option"
102 echo 1>&2 "Try \`$0 --help' for more information"
103 exit 1
104 ;;
105
106 esac
107
108 # normalize program name to check for.
109 program=`echo "$1" | sed '
110 s/^gnu-//; t
111 s/^gnu//; t
112 s/^g//; t'`
113
114 # Now exit if we have it, but it failed. Also exit now if we
115 # don't have it and --version was passed (most likely to detect
116 # the program). This is about non-GNU programs, so use $1 not
117 # $program.
118 case $1 in
119 lex*|yacc*)
120 # Not GNU programs, they don't have --version.
121 ;;
122
123 *)
124 if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
125 # We have it, but it failed.
126 exit 1
127 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
128 # Could not run --version or --help. This is probably someone
129 # running `$TOOL --version' or `$TOOL --help' to check whether
130 # $TOOL exists and not knowing $TOOL uses missing.
131 exit 1
132 fi
133 ;;
134 esac
135
136 # If it does not exist, or fails to run (possibly an outdated version),
137 # try to emulate it.
138 case $program in
139 aclocal*)
140 echo 1>&2 "\
141 WARNING: \`$1' is $msg. You should only need it if
142 you modified \`acinclude.m4' or \`${configure_ac}'. You might want
143 to install the \`Automake' and \`Perl' packages. Grab them from
144 any GNU archive site."
145 touch aclocal.m4
146 ;;
147
148 autoconf*)
149 echo 1>&2 "\
150 WARNING: \`$1' is $msg. You should only need it if
151 you modified \`${configure_ac}'. You might want to install the
152 \`Autoconf' and \`GNU m4' packages. Grab them from any GNU
153 archive site."
154 touch configure
155 ;;
156
157 autoheader*)
158 echo 1>&2 "\
159 WARNING: \`$1' is $msg. You should only need it if
160 you modified \`acconfig.h' or \`${configure_ac}'. You might want
161 to install the \`Autoconf' and \`GNU m4' packages. Grab them
162 from any GNU archive site."
163 files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
164 test -z "$files" && files="config.h"
165 touch_files=
166 for f in $files; do
167 case $f in
168 *:*) touch_files="$touch_files "`echo "$f" |
169 sed -e 's/^[^:]*://' -e 's/:.*//'`;;
170 *) touch_files="$touch_files $f.in";;
171 esac
172 done
173 touch $touch_files
174 ;;
175
176 automake*)
177 echo 1>&2 "\
178 WARNING: \`$1' is $msg. You should only need it if
179 you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
180 You might want to install the \`Automake' and \`Perl' packages.
181 Grab them from any GNU archive site."
182 find . -type f -name Makefile.am -print |
183 sed 's/\.am$/.in/' |
184 while read f; do touch "$f"; done
185 ;;
186
187 autom4te*)
188 echo 1>&2 "\
189 WARNING: \`$1' is needed, but is $msg.
190 You might have modified some files without having the
191 proper tools for further handling them.
192 You can get \`$1' as part of \`Autoconf' from any GNU
193 archive site."
194
195 file=`echo "$*" | sed -n "$sed_output"`
196 test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
197 if test -f "$file"; then
198 touch $file
199 else
200 test -z "$file" || exec >$file
201 echo "#! /bin/sh"
202 echo "# Created by GNU Automake missing as a replacement of"
203 echo "# $ $@"
204 echo "exit 0"
205 chmod +x $file
206 exit 1
207 fi
208 ;;
209
210 bison*|yacc*)
211 echo 1>&2 "\
212 WARNING: \`$1' $msg. You should only need it if
213 you modified a \`.y' file. You may need the \`Bison' package
214 in order for those modifications to take effect. You can get
215 \`Bison' from any GNU archive site."
216 rm -f y.tab.c y.tab.h
217 if test $# -ne 1; then
218 eval LASTARG=\${$#}
219 case $LASTARG in
220 *.y)
221 SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
222 if test -f "$SRCFILE"; then
223 cp "$SRCFILE" y.tab.c
224 fi
225 SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
226 if test -f "$SRCFILE"; then
227 cp "$SRCFILE" y.tab.h
228 fi
229 ;;
230 esac
231 fi
232 if test ! -f y.tab.h; then
233 echo >y.tab.h
234 fi
235 if test ! -f y.tab.c; then
236 echo 'main() { return 0; }' >y.tab.c
237 fi
238 ;;
239
240 lex*|flex*)
241 echo 1>&2 "\
242 WARNING: \`$1' is $msg. You should only need it if
243 you modified a \`.l' file. You may need the \`Flex' package
244 in order for those modifications to take effect. You can get
245 \`Flex' from any GNU archive site."
246 rm -f lex.yy.c
247 if test $# -ne 1; then
248 eval LASTARG=\${$#}
249 case $LASTARG in
250 *.l)
251 SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
252 if test -f "$SRCFILE"; then
253 cp "$SRCFILE" lex.yy.c
254 fi
255 ;;
256 esac
257 fi
258 if test ! -f lex.yy.c; then
259 echo 'main() { return 0; }' >lex.yy.c
260 fi
261 ;;
262
263 help2man*)
264 echo 1>&2 "\
265 WARNING: \`$1' is $msg. You should only need it if
266 you modified a dependency of a manual page. You may need the
267 \`Help2man' package in order for those modifications to take
268 effect. You can get \`Help2man' from any GNU archive site."
269
270 file=`echo "$*" | sed -n "$sed_output"`
271 test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
272 if test -f "$file"; then
273 touch $file
274 else
275 test -z "$file" || exec >$file
276 echo ".ab help2man is required to generate this page"
277 exit $?
278 fi
279 ;;
280
281 makeinfo*)
282 echo 1>&2 "\
283 WARNING: \`$1' is $msg. You should only need it if
284 you modified a \`.texi' or \`.texinfo' file, or any other file
285 indirectly affecting the aspect of the manual. The spurious
286 call might also be the consequence of using a buggy \`make' (AIX,
287 DU, IRIX). You might want to install the \`Texinfo' package or
288 the \`GNU make' package. Grab either from any GNU archive site."
289 # The file to touch is that specified with -o ...
290 file=`echo "$*" | sed -n "$sed_output"`
291 test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
292 if test -z "$file"; then
293 # ... or it is the one specified with @setfilename ...
294 infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
295 file=`sed -n '
296 /^@setfilename/{
297 s/.* \([^ ]*\) *$/\1/
298 p
299 q
300 }' $infile`
301 # ... or it is derived from the source name (dir/f.texi becomes f.info)
302 test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
303 fi
304 # If the file does not exist, the user really needs makeinfo;
305 # let's fail without touching anything.
306 test -f $file || exit 1
307 touch $file
308 ;;
309
310 *)
311 echo 1>&2 "\
312 WARNING: \`$1' is needed, and is $msg.
313 You might have modified some files without having the
314 proper tools for further handling them. Check the \`README' file,
315 it often tells you about the needed prerequisites for installing
316 this package. You may also peek at any GNU archive site, in case
317 some other package would contain this missing \`$1' program."
318 exit 1
319 ;;
320 esac
321
322 exit 0
323
324 # Local variables:
325 # eval: (add-hook 'write-file-hooks 'time-stamp)
326 # time-stamp-start: "scriptversion="
327 # time-stamp-format: "%:y-%02m-%02d.%02H"
328 # time-stamp-time-zone: "UTC"
329 # time-stamp-end: "; # UTC"
330 # End:
+0
-143
compile less more
0 #! /bin/sh
1 # Wrapper for compilers which do not understand `-c -o'.
2
3 scriptversion=2009-10-06.20; # UTC
4
5 # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009 Free Software
6 # Foundation, Inc.
7 # Written by Tom Tromey <tromey@cygnus.com>.
8 #
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 2, or (at your option)
12 # any later version.
13 #
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
18 #
19 # You should have received a copy of the GNU General Public License
20 # along with this program. If not, see <http://www.gnu.org/licenses/>.
21
22 # As a special exception to the GNU General Public License, if you
23 # distribute this file as part of a program that contains a
24 # configuration script generated by Autoconf, you may include it under
25 # the same distribution terms that you use for the rest of that program.
26
27 # This file is maintained in Automake, please report
28 # bugs to <bug-automake@gnu.org> or send patches to
29 # <automake-patches@gnu.org>.
30
31 case $1 in
32 '')
33 echo "$0: No command. Try \`$0 --help' for more information." 1>&2
34 exit 1;
35 ;;
36 -h | --h*)
37 cat <<\EOF
38 Usage: compile [--help] [--version] PROGRAM [ARGS]
39
40 Wrapper for compilers which do not understand `-c -o'.
41 Remove `-o dest.o' from ARGS, run PROGRAM with the remaining
42 arguments, and rename the output as expected.
43
44 If you are trying to build a whole package this is not the
45 right script to run: please start by reading the file `INSTALL'.
46
47 Report bugs to <bug-automake@gnu.org>.
48 EOF
49 exit $?
50 ;;
51 -v | --v*)
52 echo "compile $scriptversion"
53 exit $?
54 ;;
55 esac
56
57 ofile=
58 cfile=
59 eat=
60
61 for arg
62 do
63 if test -n "$eat"; then
64 eat=
65 else
66 case $1 in
67 -o)
68 # configure might choose to run compile as `compile cc -o foo foo.c'.
69 # So we strip `-o arg' only if arg is an object.
70 eat=1
71 case $2 in
72 *.o | *.obj)
73 ofile=$2
74 ;;
75 *)
76 set x "$@" -o "$2"
77 shift
78 ;;
79 esac
80 ;;
81 *.c)
82 cfile=$1
83 set x "$@" "$1"
84 shift
85 ;;
86 *)
87 set x "$@" "$1"
88 shift
89 ;;
90 esac
91 fi
92 shift
93 done
94
95 if test -z "$ofile" || test -z "$cfile"; then
96 # If no `-o' option was seen then we might have been invoked from a
97 # pattern rule where we don't need one. That is ok -- this is a
98 # normal compilation that the losing compiler can handle. If no
99 # `.c' file was seen then we are probably linking. That is also
100 # ok.
101 exec "$@"
102 fi
103
104 # Name of file we expect compiler to create.
105 cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
106
107 # Create the lock directory.
108 # Note: use `[/\\:.-]' here to ensure that we don't use the same name
109 # that we are using for the .o file. Also, base the name on the expected
110 # object file name, since that is what matters with a parallel build.
111 lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
112 while true; do
113 if mkdir "$lockdir" >/dev/null 2>&1; then
114 break
115 fi
116 sleep 1
117 done
118 # FIXME: race condition here if user kills between mkdir and trap.
119 trap "rmdir '$lockdir'; exit 1" 1 2 15
120
121 # Run the compile.
122 "$@"
123 ret=$?
124
125 if test -f "$cofile"; then
126 test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
127 elif test -f "${cofile}bj"; then
128 test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
129 fi
130
131 rmdir "$lockdir"
132 exit $ret
133
134 # Local Variables:
135 # mode: shell-script
136 # sh-indentation: 2
137 # eval: (add-hook 'write-file-hooks 'time-stamp)
138 # time-stamp-start: "scriptversion="
139 # time-stamp-format: "%:y-%02m-%02d.%02H"
140 # time-stamp-time-zone: "UTC"
141 # time-stamp-end: "; # UTC"
142 # End:
+0
-1501
config.guess less more
0 #! /bin/sh
1 # Attempt to guess a canonical system name.
2 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
3 # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
4 # Free Software Foundation, Inc.
5
6 timestamp='2009-11-20'
7
8 # This file is free software; you can redistribute it and/or modify it
9 # under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
12 #
13 # This program is distributed in the hope that it will be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 # General Public License for more details.
17 #
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
21 # 02110-1301, USA.
22 #
23 # As a special exception to the GNU General Public License, if you
24 # distribute this file as part of a program that contains a
25 # configuration script generated by Autoconf, you may include it under
26 # the same distribution terms that you use for the rest of that program.
27
28
29 # Originally written by Per Bothner. Please send patches (context
30 # diff format) to <config-patches@gnu.org> and include a ChangeLog
31 # entry.
32 #
33 # This script attempts to guess a canonical system name similar to
34 # config.sub. If it succeeds, it prints the system name on stdout, and
35 # exits with 0. Otherwise, it exits with 1.
36 #
37 # You can get the latest version of this script from:
38 # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
39
40 me=`echo "$0" | sed -e 's,.*/,,'`
41
42 usage="\
43 Usage: $0 [OPTION]
44
45 Output the configuration name of the system \`$me' is run on.
46
47 Operation modes:
48 -h, --help print this help, then exit
49 -t, --time-stamp print date of last modification, then exit
50 -v, --version print version number, then exit
51
52 Report bugs and patches to <config-patches@gnu.org>."
53
54 version="\
55 GNU config.guess ($timestamp)
56
57 Originally written by Per Bothner.
58 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
59 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
60
61 This is free software; see the source for copying conditions. There is NO
62 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
63
64 help="
65 Try \`$me --help' for more information."
66
67 # Parse command line
68 while test $# -gt 0 ; do
69 case $1 in
70 --time-stamp | --time* | -t )
71 echo "$timestamp" ; exit ;;
72 --version | -v )
73 echo "$version" ; exit ;;
74 --help | --h* | -h )
75 echo "$usage"; exit ;;
76 -- ) # Stop option processing
77 shift; break ;;
78 - ) # Use stdin as input.
79 break ;;
80 -* )
81 echo "$me: invalid option $1$help" >&2
82 exit 1 ;;
83 * )
84 break ;;
85 esac
86 done
87
88 if test $# != 0; then
89 echo "$me: too many arguments$help" >&2
90 exit 1
91 fi
92
93 trap 'exit 1' 1 2 15
94
95 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a
96 # compiler to aid in system detection is discouraged as it requires
97 # temporary files to be created and, as you can see below, it is a
98 # headache to deal with in a portable fashion.
99
100 # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
101 # use `HOST_CC' if defined, but it is deprecated.
102
103 # Portable tmp directory creation inspired by the Autoconf team.
104
105 set_cc_for_build='
106 trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
107 trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
108 : ${TMPDIR=/tmp} ;
109 { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
110 { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
111 { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
112 { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
113 dummy=$tmp/dummy ;
114 tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
115 case $CC_FOR_BUILD,$HOST_CC,$CC in
116 ,,) echo "int x;" > $dummy.c ;
117 for c in cc gcc c89 c99 ; do
118 if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
119 CC_FOR_BUILD="$c"; break ;
120 fi ;
121 done ;
122 if test x"$CC_FOR_BUILD" = x ; then
123 CC_FOR_BUILD=no_compiler_found ;
124 fi
125 ;;
126 ,,*) CC_FOR_BUILD=$CC ;;
127 ,*,*) CC_FOR_BUILD=$HOST_CC ;;
128 esac ; set_cc_for_build= ;'
129
130 # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
131 # (ghazi@noc.rutgers.edu 1994-08-24)
132 if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
133 PATH=$PATH:/.attbin ; export PATH
134 fi
135
136 UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
137 UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
138 UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
139 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
140
141 # Note: order is significant - the case branches are not exclusive.
142
143 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
144 *:NetBSD:*:*)
145 # NetBSD (nbsd) targets should (where applicable) match one or
146 # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
147 # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
148 # switched to ELF, *-*-netbsd* would select the old
149 # object file format. This provides both forward
150 # compatibility and a consistent mechanism for selecting the
151 # object file format.
152 #
153 # Note: NetBSD doesn't particularly care about the vendor
154 # portion of the name. We always set it to "unknown".
155 sysctl="sysctl -n hw.machine_arch"
156 UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
157 /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
158 case "${UNAME_MACHINE_ARCH}" in
159 armeb) machine=armeb-unknown ;;
160 arm*) machine=arm-unknown ;;
161 sh3el) machine=shl-unknown ;;
162 sh3eb) machine=sh-unknown ;;
163 sh5el) machine=sh5le-unknown ;;
164 *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
165 esac
166 # The Operating System including object format, if it has switched
167 # to ELF recently, or will in the future.
168 case "${UNAME_MACHINE_ARCH}" in
169 arm*|i386|m68k|ns32k|sh3*|sparc|vax)
170 eval $set_cc_for_build
171 if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
172 | grep -q __ELF__
173 then
174 # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
175 # Return netbsd for either. FIX?
176 os=netbsd
177 else
178 os=netbsdelf
179 fi
180 ;;
181 *)
182 os=netbsd
183 ;;
184 esac
185 # The OS release
186 # Debian GNU/NetBSD machines have a different userland, and
187 # thus, need a distinct triplet. However, they do not need
188 # kernel version information, so it can be replaced with a
189 # suitable tag, in the style of linux-gnu.
190 case "${UNAME_VERSION}" in
191 Debian*)
192 release='-gnu'
193 ;;
194 *)
195 release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
196 ;;
197 esac
198 # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
199 # contains redundant information, the shorter form:
200 # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
201 echo "${machine}-${os}${release}"
202 exit ;;
203 *:OpenBSD:*:*)
204 UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
205 echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
206 exit ;;
207 *:ekkoBSD:*:*)
208 echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
209 exit ;;
210 *:SolidBSD:*:*)
211 echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
212 exit ;;
213 macppc:MirBSD:*:*)
214 echo powerpc-unknown-mirbsd${UNAME_RELEASE}
215 exit ;;
216 *:MirBSD:*:*)
217 echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
218 exit ;;
219 alpha:OSF1:*:*)
220 case $UNAME_RELEASE in
221 *4.0)
222 UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
223 ;;
224 *5.*)
225 UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
226 ;;
227 esac
228 # According to Compaq, /usr/sbin/psrinfo has been available on
229 # OSF/1 and Tru64 systems produced since 1995. I hope that
230 # covers most systems running today. This code pipes the CPU
231 # types through head -n 1, so we only detect the type of CPU 0.
232 ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
233 case "$ALPHA_CPU_TYPE" in
234 "EV4 (21064)")
235 UNAME_MACHINE="alpha" ;;
236 "EV4.5 (21064)")
237 UNAME_MACHINE="alpha" ;;
238 "LCA4 (21066/21068)")
239 UNAME_MACHINE="alpha" ;;
240 "EV5 (21164)")
241 UNAME_MACHINE="alphaev5" ;;
242 "EV5.6 (21164A)")
243 UNAME_MACHINE="alphaev56" ;;
244 "EV5.6 (21164PC)")
245 UNAME_MACHINE="alphapca56" ;;
246 "EV5.7 (21164PC)")
247 UNAME_MACHINE="alphapca57" ;;
248 "EV6 (21264)")
249 UNAME_MACHINE="alphaev6" ;;
250 "EV6.7 (21264A)")
251 UNAME_MACHINE="alphaev67" ;;
252 "EV6.8CB (21264C)")
253 UNAME_MACHINE="alphaev68" ;;
254 "EV6.8AL (21264B)")
255 UNAME_MACHINE="alphaev68" ;;
256 "EV6.8CX (21264D)")
257 UNAME_MACHINE="alphaev68" ;;
258 "EV6.9A (21264/EV69A)")
259 UNAME_MACHINE="alphaev69" ;;
260 "EV7 (21364)")
261 UNAME_MACHINE="alphaev7" ;;
262 "EV7.9 (21364A)")
263 UNAME_MACHINE="alphaev79" ;;
264 esac
265 # A Pn.n version is a patched version.
266 # A Vn.n version is a released version.
267 # A Tn.n version is a released field test version.
268 # A Xn.n version is an unreleased experimental baselevel.
269 # 1.2 uses "1.2" for uname -r.
270 echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
271 exit ;;
272 Alpha\ *:Windows_NT*:*)
273 # How do we know it's Interix rather than the generic POSIX subsystem?
274 # Should we change UNAME_MACHINE based on the output of uname instead
275 # of the specific Alpha model?
276 echo alpha-pc-interix
277 exit ;;
278 21064:Windows_NT:50:3)
279 echo alpha-dec-winnt3.5
280 exit ;;
281 Amiga*:UNIX_System_V:4.0:*)
282 echo m68k-unknown-sysv4
283 exit ;;
284 *:[Aa]miga[Oo][Ss]:*:*)
285 echo ${UNAME_MACHINE}-unknown-amigaos
286 exit ;;
287 *:[Mm]orph[Oo][Ss]:*:*)
288 echo ${UNAME_MACHINE}-unknown-morphos
289 exit ;;
290 *:OS/390:*:*)
291 echo i370-ibm-openedition
292 exit ;;
293 *:z/VM:*:*)
294 echo s390-ibm-zvmoe
295 exit ;;
296 *:OS400:*:*)
297 echo powerpc-ibm-os400
298 exit ;;
299 arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
300 echo arm-acorn-riscix${UNAME_RELEASE}
301 exit ;;
302 arm:riscos:*:*|arm:RISCOS:*:*)
303 echo arm-unknown-riscos
304 exit ;;
305 SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
306 echo hppa1.1-hitachi-hiuxmpp
307 exit ;;
308 Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
309 # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
310 if test "`(/bin/universe) 2>/dev/null`" = att ; then
311 echo pyramid-pyramid-sysv3
312 else
313 echo pyramid-pyramid-bsd
314 fi
315 exit ;;
316 NILE*:*:*:dcosx)
317 echo pyramid-pyramid-svr4
318 exit ;;
319 DRS?6000:unix:4.0:6*)
320 echo sparc-icl-nx6
321 exit ;;
322 DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
323 case `/usr/bin/uname -p` in
324 sparc) echo sparc-icl-nx7; exit ;;
325 esac ;;
326 s390x:SunOS:*:*)
327 echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
328 exit ;;
329 sun4H:SunOS:5.*:*)
330 echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
331 exit ;;
332 sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
333 echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
334 exit ;;
335 i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
336 echo i386-pc-auroraux${UNAME_RELEASE}
337 exit ;;
338 i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
339 eval $set_cc_for_build
340 SUN_ARCH="i386"
341 # If there is a compiler, see if it is configured for 64-bit objects.
342 # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
343 # This test works for both compilers.
344 if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
345 if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
346 (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
347 grep IS_64BIT_ARCH >/dev/null
348 then
349 SUN_ARCH="x86_64"
350 fi
351 fi
352 echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
353 exit ;;
354 sun4*:SunOS:6*:*)
355 # According to config.sub, this is the proper way to canonicalize
356 # SunOS6. Hard to guess exactly what SunOS6 will be like, but
357 # it's likely to be more like Solaris than SunOS4.
358 echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
359 exit ;;
360 sun4*:SunOS:*:*)
361 case "`/usr/bin/arch -k`" in
362 Series*|S4*)
363 UNAME_RELEASE=`uname -v`
364 ;;
365 esac
366 # Japanese Language versions have a version number like `4.1.3-JL'.
367 echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
368 exit ;;
369 sun3*:SunOS:*:*)
370 echo m68k-sun-sunos${UNAME_RELEASE}
371 exit ;;
372 sun*:*:4.2BSD:*)
373 UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
374 test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
375 case "`/bin/arch`" in
376 sun3)
377 echo m68k-sun-sunos${UNAME_RELEASE}
378 ;;
379 sun4)
380 echo sparc-sun-sunos${UNAME_RELEASE}
381 ;;
382 esac
383 exit ;;
384 aushp:SunOS:*:*)
385 echo sparc-auspex-sunos${UNAME_RELEASE}
386 exit ;;
387 # The situation for MiNT is a little confusing. The machine name
388 # can be virtually everything (everything which is not
389 # "atarist" or "atariste" at least should have a processor
390 # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
391 # to the lowercase version "mint" (or "freemint"). Finally
392 # the system name "TOS" denotes a system which is actually not
393 # MiNT. But MiNT is downward compatible to TOS, so this should
394 # be no problem.
395 atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
396 echo m68k-atari-mint${UNAME_RELEASE}
397 exit ;;
398 atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
399 echo m68k-atari-mint${UNAME_RELEASE}
400 exit ;;
401 *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
402 echo m68k-atari-mint${UNAME_RELEASE}
403 exit ;;
404 milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
405 echo m68k-milan-mint${UNAME_RELEASE}
406 exit ;;
407 hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
408 echo m68k-hades-mint${UNAME_RELEASE}
409 exit ;;
410 *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
411 echo m68k-unknown-mint${UNAME_RELEASE}
412 exit ;;
413 m68k:machten:*:*)
414 echo m68k-apple-machten${UNAME_RELEASE}
415 exit ;;
416 powerpc:machten:*:*)
417 echo powerpc-apple-machten${UNAME_RELEASE}
418 exit ;;
419 RISC*:Mach:*:*)
420 echo mips-dec-mach_bsd4.3
421 exit ;;
422 RISC*:ULTRIX:*:*)
423 echo mips-dec-ultrix${UNAME_RELEASE}
424 exit ;;
425 VAX*:ULTRIX*:*:*)
426 echo vax-dec-ultrix${UNAME_RELEASE}
427 exit ;;
428 2020:CLIX:*:* | 2430:CLIX:*:*)
429 echo clipper-intergraph-clix${UNAME_RELEASE}
430 exit ;;
431 mips:*:*:UMIPS | mips:*:*:RISCos)
432 eval $set_cc_for_build
433 sed 's/^ //' << EOF >$dummy.c
434 #ifdef __cplusplus
435 #include <stdio.h> /* for printf() prototype */
436 int main (int argc, char *argv[]) {
437 #else
438 int main (argc, argv) int argc; char *argv[]; {
439 #endif
440 #if defined (host_mips) && defined (MIPSEB)
441 #if defined (SYSTYPE_SYSV)
442 printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
443 #endif
444 #if defined (SYSTYPE_SVR4)
445 printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
446 #endif
447 #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
448 printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
449 #endif
450 #endif
451 exit (-1);
452 }
453 EOF
454 $CC_FOR_BUILD -o $dummy $dummy.c &&
455 dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
456 SYSTEM_NAME=`$dummy $dummyarg` &&
457 { echo "$SYSTEM_NAME"; exit; }
458 echo mips-mips-riscos${UNAME_RELEASE}
459 exit ;;
460 Motorola:PowerMAX_OS:*:*)
461 echo powerpc-motorola-powermax
462 exit ;;
463 Motorola:*:4.3:PL8-*)
464 echo powerpc-harris-powermax
465 exit ;;
466 Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
467 echo powerpc-harris-powermax
468 exit ;;
469 Night_Hawk:Power_UNIX:*:*)
470 echo powerpc-harris-powerunix
471 exit ;;
472 m88k:CX/UX:7*:*)
473 echo m88k-harris-cxux7
474 exit ;;
475 m88k:*:4*:R4*)
476 echo m88k-motorola-sysv4
477 exit ;;
478 m88k:*:3*:R3*)
479 echo m88k-motorola-sysv3
480 exit ;;
481 AViiON:dgux:*:*)
482 # DG/UX returns AViiON for all architectures
483 UNAME_PROCESSOR=`/usr/bin/uname -p`
484 if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
485 then
486 if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
487 [ ${TARGET_BINARY_INTERFACE}x = x ]
488 then
489 echo m88k-dg-dgux${UNAME_RELEASE}
490 else
491 echo m88k-dg-dguxbcs${UNAME_RELEASE}
492 fi
493 else
494 echo i586-dg-dgux${UNAME_RELEASE}
495 fi
496 exit ;;
497 M88*:DolphinOS:*:*) # DolphinOS (SVR3)
498 echo m88k-dolphin-sysv3
499 exit ;;
500 M88*:*:R3*:*)
501 # Delta 88k system running SVR3
502 echo m88k-motorola-sysv3
503 exit ;;
504 XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
505 echo m88k-tektronix-sysv3
506 exit ;;
507 Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
508 echo m68k-tektronix-bsd
509 exit ;;
510 *:IRIX*:*:*)
511 echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
512 exit ;;
513 ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
514 echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
515 exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
516 i*86:AIX:*:*)
517 echo i386-ibm-aix
518 exit ;;
519 ia64:AIX:*:*)
520 if [ -x /usr/bin/oslevel ] ; then
521 IBM_REV=`/usr/bin/oslevel`
522 else
523 IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
524 fi
525 echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
526 exit ;;
527 *:AIX:2:3)
528 if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
529 eval $set_cc_for_build
530 sed 's/^ //' << EOF >$dummy.c
531 #include <sys/systemcfg.h>
532
533 main()
534 {
535 if (!__power_pc())
536 exit(1);
537 puts("powerpc-ibm-aix3.2.5");
538 exit(0);
539 }
540 EOF
541 if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
542 then
543 echo "$SYSTEM_NAME"
544 else
545 echo rs6000-ibm-aix3.2.5
546 fi
547 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
548 echo rs6000-ibm-aix3.2.4
549 else
550 echo rs6000-ibm-aix3.2
551 fi
552 exit ;;
553 *:AIX:*:[456])
554 IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
555 if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
556 IBM_ARCH=rs6000
557 else
558 IBM_ARCH=powerpc
559 fi
560 if [ -x /usr/bin/oslevel ] ; then
561 IBM_REV=`/usr/bin/oslevel`
562 else
563 IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
564 fi
565 echo ${IBM_ARCH}-ibm-aix${IBM_REV}
566 exit ;;
567 *:AIX:*:*)
568 echo rs6000-ibm-aix
569 exit ;;
570 ibmrt:4.4BSD:*|romp-ibm:BSD:*)
571 echo romp-ibm-bsd4.4
572 exit ;;
573 ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
574 echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
575 exit ;; # report: romp-ibm BSD 4.3
576 *:BOSX:*:*)
577 echo rs6000-bull-bosx
578 exit ;;
579 DPX/2?00:B.O.S.:*:*)
580 echo m68k-bull-sysv3
581 exit ;;
582 9000/[34]??:4.3bsd:1.*:*)
583 echo m68k-hp-bsd
584 exit ;;
585 hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
586 echo m68k-hp-bsd4.4
587 exit ;;
588 9000/[34678]??:HP-UX:*:*)
589 HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
590 case "${UNAME_MACHINE}" in
591 9000/31? ) HP_ARCH=m68000 ;;
592 9000/[34]?? ) HP_ARCH=m68k ;;
593 9000/[678][0-9][0-9])
594 if [ -x /usr/bin/getconf ]; then
595 sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
596 sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
597 case "${sc_cpu_version}" in
598 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
599 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
600 532) # CPU_PA_RISC2_0
601 case "${sc_kernel_bits}" in
602 32) HP_ARCH="hppa2.0n" ;;
603 64) HP_ARCH="hppa2.0w" ;;
604 '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
605 esac ;;
606 esac
607 fi
608 if [ "${HP_ARCH}" = "" ]; then
609 eval $set_cc_for_build
610 sed 's/^ //' << EOF >$dummy.c
611
612 #define _HPUX_SOURCE
613 #include <stdlib.h>
614 #include <unistd.h>
615
616 int main ()
617 {
618 #if defined(_SC_KERNEL_BITS)
619 long bits = sysconf(_SC_KERNEL_BITS);
620 #endif
621 long cpu = sysconf (_SC_CPU_VERSION);
622
623 switch (cpu)
624 {
625 case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
626 case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
627 case CPU_PA_RISC2_0:
628 #if defined(_SC_KERNEL_BITS)
629 switch (bits)
630 {
631 case 64: puts ("hppa2.0w"); break;
632 case 32: puts ("hppa2.0n"); break;
633 default: puts ("hppa2.0"); break;
634 } break;
635 #else /* !defined(_SC_KERNEL_BITS) */
636 puts ("hppa2.0"); break;
637 #endif
638 default: puts ("hppa1.0"); break;
639 }
640 exit (0);
641 }
642 EOF
643 (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
644 test -z "$HP_ARCH" && HP_ARCH=hppa
645 fi ;;
646 esac
647 if [ ${HP_ARCH} = "hppa2.0w" ]
648 then
649 eval $set_cc_for_build
650
651 # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
652 # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
653 # generating 64-bit code. GNU and HP use different nomenclature:
654 #
655 # $ CC_FOR_BUILD=cc ./config.guess
656 # => hppa2.0w-hp-hpux11.23
657 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
658 # => hppa64-hp-hpux11.23
659
660 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
661 grep -q __LP64__
662 then
663 HP_ARCH="hppa2.0w"
664 else
665 HP_ARCH="hppa64"
666 fi
667 fi
668 echo ${HP_ARCH}-hp-hpux${HPUX_REV}
669 exit ;;
670 ia64:HP-UX:*:*)
671 HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
672 echo ia64-hp-hpux${HPUX_REV}
673 exit ;;
674 3050*:HI-UX:*:*)
675 eval $set_cc_for_build
676 sed 's/^ //' << EOF >$dummy.c
677 #include <unistd.h>
678 int
679 main ()
680 {
681 long cpu = sysconf (_SC_CPU_VERSION);
682 /* The order matters, because CPU_IS_HP_MC68K erroneously returns
683 true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
684 results, however. */
685 if (CPU_IS_PA_RISC (cpu))
686 {
687 switch (cpu)
688 {
689 case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
690 case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
691 case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
692 default: puts ("hppa-hitachi-hiuxwe2"); break;
693 }
694 }
695 else if (CPU_IS_HP_MC68K (cpu))
696 puts ("m68k-hitachi-hiuxwe2");
697 else puts ("unknown-hitachi-hiuxwe2");
698 exit (0);
699 }
700 EOF
701 $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
702 { echo "$SYSTEM_NAME"; exit; }
703 echo unknown-hitachi-hiuxwe2
704 exit ;;
705 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
706 echo hppa1.1-hp-bsd
707 exit ;;
708 9000/8??:4.3bsd:*:*)
709 echo hppa1.0-hp-bsd
710 exit ;;
711 *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
712 echo hppa1.0-hp-mpeix
713 exit ;;
714 hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
715 echo hppa1.1-hp-osf
716 exit ;;
717 hp8??:OSF1:*:*)
718 echo hppa1.0-hp-osf
719 exit ;;
720 i*86:OSF1:*:*)
721 if [ -x /usr/sbin/sysversion ] ; then
722 echo ${UNAME_MACHINE}-unknown-osf1mk
723 else
724 echo ${UNAME_MACHINE}-unknown-osf1
725 fi
726 exit ;;
727 parisc*:Lites*:*:*)
728 echo hppa1.1-hp-lites
729 exit ;;
730 C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
731 echo c1-convex-bsd
732 exit ;;
733 C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
734 if getsysinfo -f scalar_acc
735 then echo c32-convex-bsd
736 else echo c2-convex-bsd
737 fi
738 exit ;;
739 C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
740 echo c34-convex-bsd
741 exit ;;
742 C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
743 echo c38-convex-bsd
744 exit ;;
745 C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
746 echo c4-convex-bsd
747 exit ;;
748 CRAY*Y-MP:*:*:*)
749 echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
750 exit ;;
751 CRAY*[A-Z]90:*:*:*)
752 echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
753 | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
754 -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
755 -e 's/\.[^.]*$/.X/'
756 exit ;;
757 CRAY*TS:*:*:*)
758 echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
759 exit ;;
760 CRAY*T3E:*:*:*)
761 echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
762 exit ;;
763 CRAY*SV1:*:*:*)
764 echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
765 exit ;;
766 *:UNICOS/mp:*:*)
767 echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
768 exit ;;
769 F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
770 FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
771 FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
772 FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
773 echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
774 exit ;;
775 5000:UNIX_System_V:4.*:*)
776 FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
777 FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
778 echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
779 exit ;;
780 i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
781 echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
782 exit ;;
783 sparc*:BSD/OS:*:*)
784 echo sparc-unknown-bsdi${UNAME_RELEASE}
785 exit ;;
786 *:BSD/OS:*:*)
787 echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
788 exit ;;
789 *:FreeBSD:*:*)
790 case ${UNAME_MACHINE} in
791 pc98)
792 echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
793 amd64)
794 echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
795 *)
796 echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
797 esac
798 exit ;;
799 i*:CYGWIN*:*)
800 echo ${UNAME_MACHINE}-pc-cygwin
801 exit ;;
802 *:MINGW*:*)
803 echo ${UNAME_MACHINE}-pc-mingw32
804 exit ;;
805 i*:windows32*:*)
806 # uname -m includes "-pc" on this system.
807 echo ${UNAME_MACHINE}-mingw32
808 exit ;;
809 i*:PW*:*)
810 echo ${UNAME_MACHINE}-pc-pw32
811 exit ;;
812 *:Interix*:*)
813 case ${UNAME_MACHINE} in
814 x86)
815 echo i586-pc-interix${UNAME_RELEASE}
816 exit ;;
817 authenticamd | genuineintel | EM64T)
818 echo x86_64-unknown-interix${UNAME_RELEASE}
819 exit ;;
820 IA64)
821 echo ia64-unknown-interix${UNAME_RELEASE}
822 exit ;;
823 esac ;;
824 [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
825 echo i${UNAME_MACHINE}-pc-mks
826 exit ;;
827 8664:Windows_NT:*)
828 echo x86_64-pc-mks
829 exit ;;
830 i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
831 # How do we know it's Interix rather than the generic POSIX subsystem?
832 # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
833 # UNAME_MACHINE based on the output of uname instead of i386?
834 echo i586-pc-interix
835 exit ;;
836 i*:UWIN*:*)
837 echo ${UNAME_MACHINE}-pc-uwin
838 exit ;;
839 amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
840 echo x86_64-unknown-cygwin
841 exit ;;
842 p*:CYGWIN*:*)
843 echo powerpcle-unknown-cygwin
844 exit ;;
845 prep*:SunOS:5.*:*)
846 echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
847 exit ;;
848 *:GNU:*:*)
849 # the GNU system
850 echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
851 exit ;;
852 *:GNU/*:*:*)
853 # other systems with GNU libc and userland
854 echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
855 exit ;;
856 i*86:Minix:*:*)
857 echo ${UNAME_MACHINE}-pc-minix
858 exit ;;
859 alpha:Linux:*:*)
860 case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
861 EV5) UNAME_MACHINE=alphaev5 ;;
862 EV56) UNAME_MACHINE=alphaev56 ;;
863 PCA56) UNAME_MACHINE=alphapca56 ;;
864 PCA57) UNAME_MACHINE=alphapca56 ;;
865 EV6) UNAME_MACHINE=alphaev6 ;;
866 EV67) UNAME_MACHINE=alphaev67 ;;
867 EV68*) UNAME_MACHINE=alphaev68 ;;
868 esac
869 objdump --private-headers /bin/sh | grep -q ld.so.1
870 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
871 echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
872 exit ;;
873 arm*:Linux:*:*)
874 eval $set_cc_for_build
875 if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
876 | grep -q __ARM_EABI__
877 then
878 echo ${UNAME_MACHINE}-unknown-linux-gnu
879 else
880 echo ${UNAME_MACHINE}-unknown-linux-gnueabi
881 fi
882 exit ;;
883 avr32*:Linux:*:*)
884 echo ${UNAME_MACHINE}-unknown-linux-gnu
885 exit ;;
886 cris:Linux:*:*)
887 echo cris-axis-linux-gnu
888 exit ;;
889 crisv32:Linux:*:*)
890 echo crisv32-axis-linux-gnu
891 exit ;;
892 frv:Linux:*:*)
893 echo frv-unknown-linux-gnu
894 exit ;;
895 i*86:Linux:*:*)
896 LIBC=gnu
897 eval $set_cc_for_build
898 sed 's/^ //' << EOF >$dummy.c
899 #ifdef __dietlibc__
900 LIBC=dietlibc
901 #endif
902 EOF
903 eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
904 echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
905 exit ;;
906 ia64:Linux:*:*)
907 echo ${UNAME_MACHINE}-unknown-linux-gnu
908 exit ;;
909 m32r*:Linux:*:*)
910 echo ${UNAME_MACHINE}-unknown-linux-gnu
911 exit ;;
912 m68*:Linux:*:*)
913 echo ${UNAME_MACHINE}-unknown-linux-gnu
914 exit ;;
915 mips:Linux:*:* | mips64:Linux:*:*)
916 eval $set_cc_for_build
917 sed 's/^ //' << EOF >$dummy.c
918 #undef CPU
919 #undef ${UNAME_MACHINE}
920 #undef ${UNAME_MACHINE}el
921 #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
922 CPU=${UNAME_MACHINE}el
923 #else
924 #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
925 CPU=${UNAME_MACHINE}
926 #else
927 CPU=
928 #endif
929 #endif
930 EOF
931 eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
932 test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
933 ;;
934 or32:Linux:*:*)
935 echo or32-unknown-linux-gnu
936 exit ;;
937 padre:Linux:*:*)
938 echo sparc-unknown-linux-gnu
939 exit ;;
940 parisc64:Linux:*:* | hppa64:Linux:*:*)
941 echo hppa64-unknown-linux-gnu
942 exit ;;
943 parisc:Linux:*:* | hppa:Linux:*:*)
944 # Look for CPU level
945 case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
946 PA7*) echo hppa1.1-unknown-linux-gnu ;;
947 PA8*) echo hppa2.0-unknown-linux-gnu ;;
948 *) echo hppa-unknown-linux-gnu ;;
949 esac
950 exit ;;
951 ppc64:Linux:*:*)
952 echo powerpc64-unknown-linux-gnu
953 exit ;;
954 ppc:Linux:*:*)
955 echo powerpc-unknown-linux-gnu
956 exit ;;
957 s390:Linux:*:* | s390x:Linux:*:*)
958 echo ${UNAME_MACHINE}-ibm-linux
959 exit ;;
960 sh64*:Linux:*:*)
961 echo ${UNAME_MACHINE}-unknown-linux-gnu
962 exit ;;
963 sh*:Linux:*:*)
964 echo ${UNAME_MACHINE}-unknown-linux-gnu
965 exit ;;
966 sparc:Linux:*:* | sparc64:Linux:*:*)
967 echo ${UNAME_MACHINE}-unknown-linux-gnu
968 exit ;;
969 vax:Linux:*:*)
970 echo ${UNAME_MACHINE}-dec-linux-gnu
971 exit ;;
972 x86_64:Linux:*:*)
973 echo x86_64-unknown-linux-gnu
974 exit ;;
975 xtensa*:Linux:*:*)
976 echo ${UNAME_MACHINE}-unknown-linux-gnu
977 exit ;;
978 i*86:DYNIX/ptx:4*:*)
979 # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
980 # earlier versions are messed up and put the nodename in both
981 # sysname and nodename.
982 echo i386-sequent-sysv4
983 exit ;;
984 i*86:UNIX_SV:4.2MP:2.*)
985 # Unixware is an offshoot of SVR4, but it has its own version
986 # number series starting with 2...
987 # I am not positive that other SVR4 systems won't match this,
988 # I just have to hope. -- rms.
989 # Use sysv4.2uw... so that sysv4* matches it.
990 echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
991 exit ;;
992 i*86:OS/2:*:*)
993 # If we were able to find `uname', then EMX Unix compatibility
994 # is probably installed.
995 echo ${UNAME_MACHINE}-pc-os2-emx
996 exit ;;
997 i*86:XTS-300:*:STOP)
998 echo ${UNAME_MACHINE}-unknown-stop
999 exit ;;
1000 i*86:atheos:*:*)
1001 echo ${UNAME_MACHINE}-unknown-atheos
1002 exit ;;
1003 i*86:syllable:*:*)
1004 echo ${UNAME_MACHINE}-pc-syllable
1005 exit ;;
1006 i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
1007 echo i386-unknown-lynxos${UNAME_RELEASE}
1008 exit ;;
1009 i*86:*DOS:*:*)
1010 echo ${UNAME_MACHINE}-pc-msdosdjgpp
1011 exit ;;
1012 i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
1013 UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
1014 if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
1015 echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
1016 else
1017 echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
1018 fi
1019 exit ;;
1020 i*86:*:5:[678]*)
1021 # UnixWare 7.x, OpenUNIX and OpenServer 6.
1022 case `/bin/uname -X | grep "^Machine"` in
1023 *486*) UNAME_MACHINE=i486 ;;
1024 *Pentium) UNAME_MACHINE=i586 ;;
1025 *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
1026 esac
1027 echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
1028 exit ;;
1029 i*86:*:3.2:*)
1030 if test -f /usr/options/cb.name; then
1031 UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
1032 echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
1033 elif /bin/uname -X 2>/dev/null >/dev/null ; then
1034 UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
1035 (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
1036 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
1037 && UNAME_MACHINE=i586
1038 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
1039 && UNAME_MACHINE=i686
1040 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
1041 && UNAME_MACHINE=i686
1042 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
1043 else
1044 echo ${UNAME_MACHINE}-pc-sysv32
1045 fi
1046 exit ;;
1047 pc:*:*:*)
1048 # Left here for compatibility:
1049 # uname -m prints for DJGPP always 'pc', but it prints nothing about
1050 # the processor, so we play safe by assuming i586.
1051 # Note: whatever this is, it MUST be the same as what config.sub
1052 # prints for the "djgpp" host, or else GDB configury will decide that
1053 # this is a cross-build.
1054 echo i586-pc-msdosdjgpp
1055 exit ;;
1056 Intel:Mach:3*:*)
1057 echo i386-pc-mach3
1058 exit ;;
1059 paragon:*:*:*)
1060 echo i860-intel-osf1
1061 exit ;;
1062 i860:*:4.*:*) # i860-SVR4
1063 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
1064 echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
1065 else # Add other i860-SVR4 vendors below as they are discovered.
1066 echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
1067 fi
1068 exit ;;
1069 mini*:CTIX:SYS*5:*)
1070 # "miniframe"
1071 echo m68010-convergent-sysv
1072 exit ;;
1073 mc68k:UNIX:SYSTEM5:3.51m)
1074 echo m68k-convergent-sysv
1075 exit ;;
1076 M680?0:D-NIX:5.3:*)
1077 echo m68k-diab-dnix
1078 exit ;;
1079 M68*:*:R3V[5678]*:*)
1080 test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
1081 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
1082 OS_REL=''
1083 test -r /etc/.relid \
1084 && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1085 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1086 && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1087 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1088 && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1089 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
1090 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1091 && { echo i486-ncr-sysv4; exit; } ;;
1092 NCR*:*:4.2:* | MPRAS*:*:4.2:*)
1093 OS_REL='.3'
1094 test -r /etc/.relid \
1095 && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1096 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1097 && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1098 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1099 && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
1100 /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
1101 && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1102 m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
1103 echo m68k-unknown-lynxos${UNAME_RELEASE}
1104 exit ;;
1105 mc68030:UNIX_System_V:4.*:*)
1106 echo m68k-atari-sysv4
1107 exit ;;
1108 TSUNAMI:LynxOS:2.*:*)
1109 echo sparc-unknown-lynxos${UNAME_RELEASE}
1110 exit ;;
1111 rs6000:LynxOS:2.*:*)
1112 echo rs6000-unknown-lynxos${UNAME_RELEASE}
1113 exit ;;
1114 PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
1115 echo powerpc-unknown-lynxos${UNAME_RELEASE}
1116 exit ;;
1117 SM[BE]S:UNIX_SV:*:*)
1118 echo mips-dde-sysv${UNAME_RELEASE}
1119 exit ;;
1120 RM*:ReliantUNIX-*:*:*)
1121 echo mips-sni-sysv4
1122 exit ;;
1123 RM*:SINIX-*:*:*)
1124 echo mips-sni-sysv4
1125 exit ;;
1126 *:SINIX-*:*:*)
1127 if uname -p 2>/dev/null >/dev/null ; then
1128 UNAME_MACHINE=`(uname -p) 2>/dev/null`
1129 echo ${UNAME_MACHINE}-sni-sysv4
1130 else
1131 echo ns32k-sni-sysv
1132 fi
1133 exit ;;
1134 PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
1135 # says <Richard.M.Bartel@ccMail.Census.GOV>
1136 echo i586-unisys-sysv4
1137 exit ;;
1138 *:UNIX_System_V:4*:FTX*)
1139 # From Gerald Hewes <hewes@openmarket.com>.
1140 # How about differentiating between stratus architectures? -djm
1141 echo hppa1.1-stratus-sysv4
1142 exit ;;
1143 *:*:*:FTX*)
1144 # From seanf@swdc.stratus.com.
1145 echo i860-stratus-sysv4
1146 exit ;;
1147 i*86:VOS:*:*)
1148 # From Paul.Green@stratus.com.
1149 echo ${UNAME_MACHINE}-stratus-vos
1150 exit ;;
1151 *:VOS:*:*)
1152 # From Paul.Green@stratus.com.
1153 echo hppa1.1-stratus-vos
1154 exit ;;
1155 mc68*:A/UX:*:*)
1156 echo m68k-apple-aux${UNAME_RELEASE}
1157 exit ;;
1158 news*:NEWS-OS:6*:*)
1159 echo mips-sony-newsos6
1160 exit ;;
1161 R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
1162 if [ -d /usr/nec ]; then
1163 echo mips-nec-sysv${UNAME_RELEASE}
1164 else
1165 echo mips-unknown-sysv${UNAME_RELEASE}
1166 fi
1167 exit ;;
1168 BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
1169 echo powerpc-be-beos
1170 exit ;;
1171 BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
1172 echo powerpc-apple-beos
1173 exit ;;
1174 BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
1175 echo i586-pc-beos
1176 exit ;;
1177 BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
1178 echo i586-pc-haiku
1179 exit ;;
1180 SX-4:SUPER-UX:*:*)
1181 echo sx4-nec-superux${UNAME_RELEASE}
1182 exit ;;
1183 SX-5:SUPER-UX:*:*)
1184 echo sx5-nec-superux${UNAME_RELEASE}
1185 exit ;;
1186 SX-6:SUPER-UX:*:*)
1187 echo sx6-nec-superux${UNAME_RELEASE}
1188 exit ;;
1189 SX-7:SUPER-UX:*:*)
1190 echo sx7-nec-superux${UNAME_RELEASE}
1191 exit ;;
1192 SX-8:SUPER-UX:*:*)
1193 echo sx8-nec-superux${UNAME_RELEASE}
1194 exit ;;
1195 SX-8R:SUPER-UX:*:*)
1196 echo sx8r-nec-superux${UNAME_RELEASE}
1197 exit ;;
1198 Power*:Rhapsody:*:*)
1199 echo powerpc-apple-rhapsody${UNAME_RELEASE}
1200 exit ;;
1201 *:Rhapsody:*:*)
1202 echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
1203 exit ;;
1204 *:Darwin:*:*)
1205 UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
1206 case $UNAME_PROCESSOR in
1207 i386)
1208 eval $set_cc_for_build
1209 if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
1210 if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
1211 (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
1212 grep IS_64BIT_ARCH >/dev/null
1213 then
1214 UNAME_PROCESSOR="x86_64"
1215 fi
1216 fi ;;
1217 unknown) UNAME_PROCESSOR=powerpc ;;
1218 esac
1219 echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
1220 exit ;;
1221 *:procnto*:*:* | *:QNX:[0123456789]*:*)
1222 UNAME_PROCESSOR=`uname -p`
1223 if test "$UNAME_PROCESSOR" = "x86"; then
1224 UNAME_PROCESSOR=i386
1225 UNAME_MACHINE=pc
1226 fi
1227 echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
1228 exit ;;
1229 *:QNX:*:4*)
1230 echo i386-pc-qnx
1231 exit ;;
1232 NSE-?:NONSTOP_KERNEL:*:*)
1233 echo nse-tandem-nsk${UNAME_RELEASE}
1234 exit ;;
1235 NSR-?:NONSTOP_KERNEL:*:*)
1236 echo nsr-tandem-nsk${UNAME_RELEASE}
1237 exit ;;
1238 *:NonStop-UX:*:*)
1239 echo mips-compaq-nonstopux
1240 exit ;;
1241 BS2000:POSIX*:*:*)
1242 echo bs2000-siemens-sysv
1243 exit ;;
1244 DS/*:UNIX_System_V:*:*)
1245 echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
1246 exit ;;
1247 *:Plan9:*:*)
1248 # "uname -m" is not consistent, so use $cputype instead. 386
1249 # is converted to i386 for consistency with other x86
1250 # operating systems.
1251 if test "$cputype" = "386"; then
1252 UNAME_MACHINE=i386
1253 else
1254 UNAME_MACHINE="$cputype"
1255 fi
1256 echo ${UNAME_MACHINE}-unknown-plan9
1257 exit ;;
1258 *:TOPS-10:*:*)
1259 echo pdp10-unknown-tops10
1260 exit ;;
1261 *:TENEX:*:*)
1262 echo pdp10-unknown-tenex
1263 exit ;;
1264 KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
1265 echo pdp10-dec-tops20
1266 exit ;;
1267 XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
1268 echo pdp10-xkl-tops20
1269 exit ;;
1270 *:TOPS-20:*:*)
1271 echo pdp10-unknown-tops20
1272 exit ;;
1273 *:ITS:*:*)
1274 echo pdp10-unknown-its
1275 exit ;;
1276 SEI:*:*:SEIUX)
1277 echo mips-sei-seiux${UNAME_RELEASE}
1278 exit ;;
1279 *:DragonFly:*:*)
1280 echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
1281 exit ;;
1282 *:*VMS:*:*)
1283 UNAME_MACHINE=`(uname -p) 2>/dev/null`
1284 case "${UNAME_MACHINE}" in
1285 A*) echo alpha-dec-vms ; exit ;;
1286 I*) echo ia64-dec-vms ; exit ;;
1287 V*) echo vax-dec-vms ; exit ;;
1288 esac ;;
1289 *:XENIX:*:SysV)
1290 echo i386-pc-xenix
1291 exit ;;
1292 i*86:skyos:*:*)
1293 echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
1294 exit ;;
1295 i*86:rdos:*:*)
1296 echo ${UNAME_MACHINE}-pc-rdos
1297 exit ;;
1298 i*86:AROS:*:*)
1299 echo ${UNAME_MACHINE}-pc-aros
1300 exit ;;
1301 esac
1302
1303 #echo '(No uname command or uname output not recognized.)' 1>&2
1304 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
1305
1306 eval $set_cc_for_build
1307 cat >$dummy.c <<EOF
1308 #ifdef _SEQUENT_
1309 # include <sys/types.h>
1310 # include <sys/utsname.h>
1311 #endif
1312 main ()
1313 {
1314 #if defined (sony)
1315 #if defined (MIPSEB)
1316 /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
1317 I don't know.... */
1318 printf ("mips-sony-bsd\n"); exit (0);
1319 #else
1320 #include <sys/param.h>
1321 printf ("m68k-sony-newsos%s\n",
1322 #ifdef NEWSOS4
1323 "4"
1324 #else
1325 ""
1326 #endif
1327 ); exit (0);
1328 #endif
1329 #endif
1330
1331 #if defined (__arm) && defined (__acorn) && defined (__unix)
1332 printf ("arm-acorn-riscix\n"); exit (0);
1333 #endif
1334
1335 #if defined (hp300) && !defined (hpux)
1336 printf ("m68k-hp-bsd\n"); exit (0);
1337 #endif
1338
1339 #if defined (NeXT)
1340 #if !defined (__ARCHITECTURE__)
1341 #define __ARCHITECTURE__ "m68k"
1342 #endif
1343 int version;
1344 version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
1345 if (version < 4)
1346 printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
1347 else
1348 printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
1349 exit (0);
1350 #endif
1351
1352 #if defined (MULTIMAX) || defined (n16)
1353 #if defined (UMAXV)
1354 printf ("ns32k-encore-sysv\n"); exit (0);
1355 #else
1356 #if defined (CMU)
1357 printf ("ns32k-encore-mach\n"); exit (0);
1358 #else
1359 printf ("ns32k-encore-bsd\n"); exit (0);
1360 #endif
1361 #endif
1362 #endif
1363
1364 #if defined (__386BSD__)
1365 printf ("i386-pc-bsd\n"); exit (0);
1366 #endif
1367
1368 #if defined (sequent)
1369 #if defined (i386)
1370 printf ("i386-sequent-dynix\n"); exit (0);
1371 #endif
1372 #if defined (ns32000)
1373 printf ("ns32k-sequent-dynix\n"); exit (0);
1374 #endif
1375 #endif
1376
1377 #if defined (_SEQUENT_)
1378 struct utsname un;
1379
1380 uname(&un);
1381
1382 if (strncmp(un.version, "V2", 2) == 0) {
1383 printf ("i386-sequent-ptx2\n"); exit (0);
1384 }
1385 if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
1386 printf ("i386-sequent-ptx1\n"); exit (0);
1387 }
1388 printf ("i386-sequent-ptx\n"); exit (0);
1389
1390 #endif
1391
1392 #if defined (vax)
1393 # if !defined (ultrix)
1394 # include <sys/param.h>
1395 # if defined (BSD)
1396 # if BSD == 43
1397 printf ("vax-dec-bsd4.3\n"); exit (0);
1398 # else
1399 # if BSD == 199006
1400 printf ("vax-dec-bsd4.3reno\n"); exit (0);
1401 # else
1402 printf ("vax-dec-bsd\n"); exit (0);
1403 # endif
1404 # endif
1405 # else
1406 printf ("vax-dec-bsd\n"); exit (0);
1407 # endif
1408 # else
1409 printf ("vax-dec-ultrix\n"); exit (0);
1410 # endif
1411 #endif
1412
1413 #if defined (alliant) && defined (i860)
1414 printf ("i860-alliant-bsd\n"); exit (0);
1415 #endif
1416
1417 exit (1);
1418 }
1419 EOF
1420
1421 $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
1422 { echo "$SYSTEM_NAME"; exit; }
1423
1424 # Apollos put the system type in the environment.
1425
1426 test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
1427
1428 # Convex versions that predate uname can use getsysinfo(1)
1429
1430 if [ -x /usr/convex/getsysinfo ]
1431 then
1432 case `getsysinfo -f cpu_type` in
1433 c1*)
1434 echo c1-convex-bsd
1435 exit ;;
1436 c2*)
1437 if getsysinfo -f scalar_acc
1438 then echo c32-convex-bsd
1439 else echo c2-convex-bsd
1440 fi
1441 exit ;;
1442 c34*)
1443 echo c34-convex-bsd
1444 exit ;;
1445 c38*)
1446 echo c38-convex-bsd
1447 exit ;;
1448 c4*)
1449 echo c4-convex-bsd
1450 exit ;;
1451 esac
1452 fi
1453
1454 cat >&2 <<EOF
1455 $0: unable to guess system type
1456
1457 This script, last modified $timestamp, has failed to recognize
1458 the operating system you are using. It is advised that you
1459 download the most up to date version of the config scripts from
1460
1461 http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
1462 and
1463 http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
1464
1465 If the version you run ($0) is already up to date, please
1466 send the following data and any information you think might be
1467 pertinent to <config-patches@gnu.org> in order to provide the needed
1468 information to handle your system.
1469
1470 config.guess timestamp = $timestamp
1471
1472 uname -m = `(uname -m) 2>/dev/null || echo unknown`
1473 uname -r = `(uname -r) 2>/dev/null || echo unknown`
1474 uname -s = `(uname -s) 2>/dev/null || echo unknown`
1475 uname -v = `(uname -v) 2>/dev/null || echo unknown`
1476
1477 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
1478 /bin/uname -X = `(/bin/uname -X) 2>/dev/null`
1479
1480 hostinfo = `(hostinfo) 2>/dev/null`
1481 /bin/universe = `(/bin/universe) 2>/dev/null`
1482 /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
1483 /bin/arch = `(/bin/arch) 2>/dev/null`
1484 /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
1485 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
1486
1487 UNAME_MACHINE = ${UNAME_MACHINE}
1488 UNAME_RELEASE = ${UNAME_RELEASE}
1489 UNAME_SYSTEM = ${UNAME_SYSTEM}
1490 UNAME_VERSION = ${UNAME_VERSION}
1491 EOF
1492
1493 exit 1
1494
1495 # Local variables:
1496 # eval: (add-hook 'write-file-hooks 'time-stamp)
1497 # time-stamp-start: "timestamp='"
1498 # time-stamp-format: "%:y-%02m-%02d"
1499 # time-stamp-end: "'"
1500 # End:
+0
-0
config.rpath less more
(Empty file)
+0
-1705
config.sub less more
0 #! /bin/sh
1 # Configuration validation subroutine script.
2 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
3 # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
4 # Free Software Foundation, Inc.
5
6 timestamp='2009-11-20'
7
8 # This file is (in principle) common to ALL GNU software.
9 # The presence of a machine in this file suggests that SOME GNU software
10 # can handle that machine. It does not imply ALL GNU software can.
11 #
12 # This file is free software; you can redistribute it and/or modify
13 # it under the terms of the GNU General Public License as published by
14 # the Free Software Foundation; either version 2 of the License, or
15 # (at your option) any later version.
16 #
17 # This program is distributed in the hope that it will be useful,
18 # but WITHOUT ANY WARRANTY; without even the implied warranty of
19 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 # GNU General Public License for more details.
21 #
22 # You should have received a copy of the GNU General Public License
23 # along with this program; if not, write to the Free Software
24 # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
25 # 02110-1301, USA.
26 #
27 # As a special exception to the GNU General Public License, if you
28 # distribute this file as part of a program that contains a
29 # configuration script generated by Autoconf, you may include it under
30 # the same distribution terms that you use for the rest of that program.
31
32
33 # Please send patches to <config-patches@gnu.org>. Submit a context
34 # diff and a properly formatted GNU ChangeLog entry.
35 #
36 # Configuration subroutine to validate and canonicalize a configuration type.
37 # Supply the specified configuration type as an argument.
38 # If it is invalid, we print an error message on stderr and exit with code 1.
39 # Otherwise, we print the canonical config type on stdout and succeed.
40
41 # You can get the latest version of this script from:
42 # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
43
44 # This file is supposed to be the same for all GNU packages
45 # and recognize all the CPU types, system types and aliases
46 # that are meaningful with *any* GNU software.
47 # Each package is responsible for reporting which valid configurations
48 # it does not support. The user should be able to distinguish
49 # a failure to support a valid configuration from a meaningless
50 # configuration.
51
52 # The goal of this file is to map all the various variations of a given
53 # machine specification into a single specification in the form:
54 # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
55 # or in some cases, the newer four-part form:
56 # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
57 # It is wrong to echo any other type of specification.
58
59 me=`echo "$0" | sed -e 's,.*/,,'`
60
61 usage="\
62 Usage: $0 [OPTION] CPU-MFR-OPSYS
63 $0 [OPTION] ALIAS
64
65 Canonicalize a configuration name.
66
67 Operation modes:
68 -h, --help print this help, then exit
69 -t, --time-stamp print date of last modification, then exit
70 -v, --version print version number, then exit
71
72 Report bugs and patches to <config-patches@gnu.org>."
73
74 version="\
75 GNU config.sub ($timestamp)
76
77 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
78 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
79
80 This is free software; see the source for copying conditions. There is NO
81 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
82
83 help="
84 Try \`$me --help' for more information."
85
86 # Parse command line
87 while test $# -gt 0 ; do
88 case $1 in
89 --time-stamp | --time* | -t )
90 echo "$timestamp" ; exit ;;
91 --version | -v )
92 echo "$version" ; exit ;;
93 --help | --h* | -h )
94 echo "$usage"; exit ;;
95 -- ) # Stop option processing
96 shift; break ;;
97 - ) # Use stdin as input.
98 break ;;
99 -* )
100 echo "$me: invalid option $1$help"
101 exit 1 ;;
102
103 *local*)
104 # First pass through any local machine types.
105 echo $1
106 exit ;;
107
108 * )
109 break ;;
110 esac
111 done
112
113 case $# in
114 0) echo "$me: missing argument$help" >&2
115 exit 1;;
116 1) ;;
117 *) echo "$me: too many arguments$help" >&2
118 exit 1;;
119 esac
120
121 # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
122 # Here we must recognize all the valid KERNEL-OS combinations.
123 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
124 case $maybe_os in
125 nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
126 uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
127 kopensolaris*-gnu* | \
128 storm-chaos* | os2-emx* | rtmk-nova*)
129 os=-$maybe_os
130 basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
131 ;;
132 *)
133 basic_machine=`echo $1 | sed 's/-[^-]*$//'`
134 if [ $basic_machine != $1 ]
135 then os=`echo $1 | sed 's/.*-/-/'`
136 else os=; fi
137 ;;
138 esac
139
140 ### Let's recognize common machines as not being operating systems so
141 ### that things like config.sub decstation-3100 work. We also
142 ### recognize some manufacturers as not being operating systems, so we
143 ### can provide default operating systems below.
144 case $os in
145 -sun*os*)
146 # Prevent following clause from handling this invalid input.
147 ;;
148 -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
149 -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
150 -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
151 -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
152 -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
153 -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
154 -apple | -axis | -knuth | -cray | -microblaze)
155 os=
156 basic_machine=$1
157 ;;
158 -bluegene*)
159 os=-cnk
160 ;;
161 -sim | -cisco | -oki | -wec | -winbond)
162 os=
163 basic_machine=$1
164 ;;
165 -scout)
166 ;;
167 -wrs)
168 os=-vxworks
169 basic_machine=$1
170 ;;
171 -chorusos*)
172 os=-chorusos
173 basic_machine=$1
174 ;;
175 -chorusrdb)
176 os=-chorusrdb
177 basic_machine=$1
178 ;;
179 -hiux*)
180 os=-hiuxwe2
181 ;;
182 -sco6)
183 os=-sco5v6
184 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
185 ;;
186 -sco5)
187 os=-sco3.2v5
188 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
189 ;;
190 -sco4)
191 os=-sco3.2v4
192 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
193 ;;
194 -sco3.2.[4-9]*)
195 os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
196 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
197 ;;
198 -sco3.2v[4-9]*)
199 # Don't forget version if it is 3.2v4 or newer.
200 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
201 ;;
202 -sco5v6*)
203 # Don't forget version if it is 3.2v4 or newer.
204 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
205 ;;
206 -sco*)
207 os=-sco3.2v2
208 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
209 ;;
210 -udk*)
211 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
212 ;;
213 -isc)
214 os=-isc2.2
215 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
216 ;;
217 -clix*)
218 basic_machine=clipper-intergraph
219 ;;
220 -isc*)
221 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
222 ;;
223 -lynx*)
224 os=-lynxos
225 ;;
226 -ptx*)
227 basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
228 ;;
229 -windowsnt*)
230 os=`echo $os | sed -e 's/windowsnt/winnt/'`
231 ;;
232 -psos*)
233 os=-psos
234 ;;
235 -mint | -mint[0-9]*)
236 basic_machine=m68k-atari
237 os=-mint
238 ;;
239 esac
240
241 # Decode aliases for certain CPU-COMPANY combinations.
242 case $basic_machine in
243 # Recognize the basic CPU types without company name.
244 # Some are omitted here because they have special meanings below.
245 1750a | 580 \
246 | a29k \
247 | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
248 | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
249 | am33_2.0 \
250 | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
251 | bfin \
252 | c4x | clipper \
253 | d10v | d30v | dlx | dsp16xx \
254 | fido | fr30 | frv \
255 | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
256 | i370 | i860 | i960 | ia64 \
257 | ip2k | iq2000 \
258 | lm32 \
259 | m32c | m32r | m32rle | m68000 | m68k | m88k \
260 | maxq | mb | microblaze | mcore | mep | metag \
261 | mips | mipsbe | mipseb | mipsel | mipsle \
262 | mips16 \
263 | mips64 | mips64el \
264 | mips64octeon | mips64octeonel \
265 | mips64orion | mips64orionel \
266 | mips64r5900 | mips64r5900el \
267 | mips64vr | mips64vrel \
268 | mips64vr4100 | mips64vr4100el \
269 | mips64vr4300 | mips64vr4300el \
270 | mips64vr5000 | mips64vr5000el \
271 | mips64vr5900 | mips64vr5900el \
272 | mipsisa32 | mipsisa32el \
273 | mipsisa32r2 | mipsisa32r2el \
274 | mipsisa64 | mipsisa64el \
275 | mipsisa64r2 | mipsisa64r2el \
276 | mipsisa64sb1 | mipsisa64sb1el \
277 | mipsisa64sr71k | mipsisa64sr71kel \
278 | mipstx39 | mipstx39el \
279 | mn10200 | mn10300 \
280 | moxie \
281 | mt \
282 | msp430 \
283 | nios | nios2 \
284 | ns16k | ns32k \
285 | or32 \
286 | pdp10 | pdp11 | pj | pjl \
287 | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
288 | pyramid \
289 | rx \
290 | score \
291 | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
292 | sh64 | sh64le \
293 | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
294 | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
295 | spu | strongarm \
296 | tahoe | thumb | tic4x | tic80 | tron \
297 | ubicom32 \
298 | v850 | v850e \
299 | we32k \
300 | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
301 | z8k | z80)
302 basic_machine=$basic_machine-unknown
303 ;;
304 m6811 | m68hc11 | m6812 | m68hc12 | picochip)
305 # Motorola 68HC11/12.
306 basic_machine=$basic_machine-unknown
307 os=-none
308 ;;
309 m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
310 ;;
311 ms1)
312 basic_machine=mt-unknown
313 ;;
314
315 # We use `pc' rather than `unknown'
316 # because (1) that's what they normally are, and
317 # (2) the word "unknown" tends to confuse beginning users.
318 i*86 | x86_64)
319 basic_machine=$basic_machine-pc
320 ;;
321 # Object if more than one company name word.
322 *-*-*)
323 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
324 exit 1
325 ;;
326 # Recognize the basic CPU types with company name.
327 580-* \
328 | a29k-* \
329 | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
330 | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
331 | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
332 | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
333 | avr-* | avr32-* \
334 | bfin-* | bs2000-* \
335 | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
336 | clipper-* | craynv-* | cydra-* \
337 | d10v-* | d30v-* | dlx-* \
338 | elxsi-* \
339 | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
340 | h8300-* | h8500-* \
341 | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
342 | i*86-* | i860-* | i960-* | ia64-* \
343 | ip2k-* | iq2000-* \
344 | lm32-* \
345 | m32c-* | m32r-* | m32rle-* \
346 | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
347 | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
348 | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
349 | mips16-* \
350 | mips64-* | mips64el-* \
351 | mips64octeon-* | mips64octeonel-* \
352 | mips64orion-* | mips64orionel-* \
353 | mips64r5900-* | mips64r5900el-* \
354 | mips64vr-* | mips64vrel-* \
355 | mips64vr4100-* | mips64vr4100el-* \
356 | mips64vr4300-* | mips64vr4300el-* \
357 | mips64vr5000-* | mips64vr5000el-* \
358 | mips64vr5900-* | mips64vr5900el-* \
359 | mipsisa32-* | mipsisa32el-* \
360 | mipsisa32r2-* | mipsisa32r2el-* \
361 | mipsisa64-* | mipsisa64el-* \
362 | mipsisa64r2-* | mipsisa64r2el-* \
363 | mipsisa64sb1-* | mipsisa64sb1el-* \
364 | mipsisa64sr71k-* | mipsisa64sr71kel-* \
365 | mipstx39-* | mipstx39el-* \
366 | mmix-* \
367 | mt-* \
368 | msp430-* \
369 | nios-* | nios2-* \
370 | none-* | np1-* | ns16k-* | ns32k-* \
371 | orion-* \
372 | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
373 | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
374 | pyramid-* \
375 | romp-* | rs6000-* | rx-* \
376 | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
377 | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
378 | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
379 | sparclite-* \
380 | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
381 | tahoe-* | thumb-* \
382 | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
383 | tron-* \
384 | ubicom32-* \
385 | v850-* | v850e-* | vax-* \
386 | we32k-* \
387 | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
388 | xstormy16-* | xtensa*-* \
389 | ymp-* \
390 | z8k-* | z80-*)
391 ;;
392 # Recognize the basic CPU types without company name, with glob match.
393 xtensa*)
394 basic_machine=$basic_machine-unknown
395 ;;
396 # Recognize the various machine names and aliases which stand
397 # for a CPU type and a company and sometimes even an OS.
398 386bsd)
399 basic_machine=i386-unknown
400 os=-bsd
401 ;;
402 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
403 basic_machine=m68000-att
404 ;;
405 3b*)
406 basic_machine=we32k-att
407 ;;
408 a29khif)
409 basic_machine=a29k-amd
410 os=-udi
411 ;;
412 abacus)
413 basic_machine=abacus-unknown
414 ;;
415 adobe68k)
416 basic_machine=m68010-adobe
417 os=-scout
418 ;;
419 alliant | fx80)
420 basic_machine=fx80-alliant
421 ;;
422 altos | altos3068)
423 basic_machine=m68k-altos
424 ;;
425 am29k)
426 basic_machine=a29k-none
427 os=-bsd
428 ;;
429 amd64)
430 basic_machine=x86_64-pc
431 ;;
432 amd64-*)
433 basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
434 ;;
435 amdahl)
436 basic_machine=580-amdahl
437 os=-sysv
438 ;;
439 amiga | amiga-*)
440 basic_machine=m68k-unknown
441 ;;
442 amigaos | amigados)
443 basic_machine=m68k-unknown
444 os=-amigaos
445 ;;
446 amigaunix | amix)
447 basic_machine=m68k-unknown
448 os=-sysv4
449 ;;
450 apollo68)
451 basic_machine=m68k-apollo
452 os=-sysv
453 ;;
454 apollo68bsd)
455 basic_machine=m68k-apollo
456 os=-bsd
457 ;;
458 aros)
459 basic_machine=i386-pc
460 os=-aros
461 ;;
462 aux)
463 basic_machine=m68k-apple
464 os=-aux
465 ;;
466 balance)
467 basic_machine=ns32k-sequent
468 os=-dynix
469 ;;
470 blackfin)
471 basic_machine=bfin-unknown
472 os=-linux
473 ;;
474 blackfin-*)
475 basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
476 os=-linux
477 ;;
478 bluegene*)
479 basic_machine=powerpc-ibm
480 os=-cnk
481 ;;
482 c90)
483 basic_machine=c90-cray
484 os=-unicos
485 ;;
486 cegcc)
487 basic_machine=arm-unknown
488 os=-cegcc
489 ;;
490 convex-c1)
491 basic_machine=c1-convex
492 os=-bsd
493 ;;
494 convex-c2)
495 basic_machine=c2-convex
496 os=-bsd
497 ;;
498 convex-c32)
499 basic_machine=c32-convex
500 os=-bsd
501 ;;
502 convex-c34)
503 basic_machine=c34-convex
504 os=-bsd
505 ;;
506 convex-c38)
507 basic_machine=c38-convex
508 os=-bsd
509 ;;
510 cray | j90)
511 basic_machine=j90-cray
512 os=-unicos
513 ;;
514 craynv)
515 basic_machine=craynv-cray
516 os=-unicosmp
517 ;;
518 cr16)
519 basic_machine=cr16-unknown
520 os=-elf
521 ;;
522 crds | unos)
523 basic_machine=m68k-crds
524 ;;
525 crisv32 | crisv32-* | etraxfs*)
526 basic_machine=crisv32-axis
527 ;;
528 cris | cris-* | etrax*)
529 basic_machine=cris-axis
530 ;;
531 crx)
532 basic_machine=crx-unknown
533 os=-elf
534 ;;
535 da30 | da30-*)
536 basic_machine=m68k-da30
537 ;;
538 decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
539 basic_machine=mips-dec
540 ;;
541 decsystem10* | dec10*)
542 basic_machine=pdp10-dec
543 os=-tops10
544 ;;
545 decsystem20* | dec20*)
546 basic_machine=pdp10-dec
547 os=-tops20
548 ;;
549 delta | 3300 | motorola-3300 | motorola-delta \
550 | 3300-motorola | delta-motorola)
551 basic_machine=m68k-motorola
552 ;;
553 delta88)
554 basic_machine=m88k-motorola
555 os=-sysv3
556 ;;
557 dicos)
558 basic_machine=i686-pc
559 os=-dicos
560 ;;
561 djgpp)
562 basic_machine=i586-pc
563 os=-msdosdjgpp
564 ;;
565 dpx20 | dpx20-*)
566 basic_machine=rs6000-bull
567 os=-bosx
568 ;;
569 dpx2* | dpx2*-bull)
570 basic_machine=m68k-bull
571 os=-sysv3
572 ;;
573 ebmon29k)
574 basic_machine=a29k-amd
575 os=-ebmon
576 ;;
577 elxsi)
578 basic_machine=elxsi-elxsi
579 os=-bsd
580 ;;
581 encore | umax | mmax)
582 basic_machine=ns32k-encore
583 ;;
584 es1800 | OSE68k | ose68k | ose | OSE)
585 basic_machine=m68k-ericsson
586 os=-ose
587 ;;
588 fx2800)
589 basic_machine=i860-alliant
590 ;;
591 genix)
592 basic_machine=ns32k-ns
593 ;;
594 gmicro)
595 basic_machine=tron-gmicro
596 os=-sysv
597 ;;
598 go32)
599 basic_machine=i386-pc
600 os=-go32
601 ;;
602 h3050r* | hiux*)
603 basic_machine=hppa1.1-hitachi
604 os=-hiuxwe2
605 ;;
606 h8300hms)
607 basic_machine=h8300-hitachi
608 os=-hms
609 ;;
610 h8300xray)
611 basic_machine=h8300-hitachi
612 os=-xray
613 ;;
614 h8500hms)
615 basic_machine=h8500-hitachi
616 os=-hms
617 ;;
618 harris)
619 basic_machine=m88k-harris
620 os=-sysv3
621 ;;
622 hp300-*)
623 basic_machine=m68k-hp
624 ;;
625 hp300bsd)
626 basic_machine=m68k-hp
627 os=-bsd
628 ;;
629 hp300hpux)
630 basic_machine=m68k-hp
631 os=-hpux
632 ;;
633 hp3k9[0-9][0-9] | hp9[0-9][0-9])
634 basic_machine=hppa1.0-hp
635 ;;
636 hp9k2[0-9][0-9] | hp9k31[0-9])
637 basic_machine=m68000-hp
638 ;;
639 hp9k3[2-9][0-9])
640 basic_machine=m68k-hp
641 ;;
642 hp9k6[0-9][0-9] | hp6[0-9][0-9])
643 basic_machine=hppa1.0-hp
644 ;;
645 hp9k7[0-79][0-9] | hp7[0-79][0-9])
646 basic_machine=hppa1.1-hp
647 ;;
648 hp9k78[0-9] | hp78[0-9])
649 # FIXME: really hppa2.0-hp
650 basic_machine=hppa1.1-hp
651 ;;
652 hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
653 # FIXME: really hppa2.0-hp
654 basic_machine=hppa1.1-hp
655 ;;
656 hp9k8[0-9][13679] | hp8[0-9][13679])
657 basic_machine=hppa1.1-hp
658 ;;
659 hp9k8[0-9][0-9] | hp8[0-9][0-9])
660 basic_machine=hppa1.0-hp
661 ;;
662 hppa-next)
663 os=-nextstep3
664 ;;
665 hppaosf)
666 basic_machine=hppa1.1-hp
667 os=-osf
668 ;;
669 hppro)
670 basic_machine=hppa1.1-hp
671 os=-proelf
672 ;;
673 i370-ibm* | ibm*)
674 basic_machine=i370-ibm
675 ;;
676 # I'm not sure what "Sysv32" means. Should this be sysv3.2?
677 i*86v32)
678 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
679 os=-sysv32
680 ;;
681 i*86v4*)
682 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
683 os=-sysv4
684 ;;
685 i*86v)
686 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
687 os=-sysv
688 ;;
689 i*86sol2)
690 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
691 os=-solaris2
692 ;;
693 i386mach)
694 basic_machine=i386-mach
695 os=-mach
696 ;;
697 i386-vsta | vsta)
698 basic_machine=i386-unknown
699 os=-vsta
700 ;;
701 iris | iris4d)
702 basic_machine=mips-sgi
703 case $os in
704 -irix*)
705 ;;
706 *)
707 os=-irix4
708 ;;
709 esac
710 ;;
711 isi68 | isi)
712 basic_machine=m68k-isi
713 os=-sysv
714 ;;
715 m68knommu)
716 basic_machine=m68k-unknown
717 os=-linux
718 ;;
719 m68knommu-*)
720 basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
721 os=-linux
722 ;;
723 m88k-omron*)
724 basic_machine=m88k-omron
725 ;;
726 magnum | m3230)
727 basic_machine=mips-mips
728 os=-sysv
729 ;;
730 merlin)
731 basic_machine=ns32k-utek
732 os=-sysv
733 ;;
734 microblaze)
735 basic_machine=microblaze-xilinx
736 ;;
737 mingw32)
738 basic_machine=i386-pc
739 os=-mingw32
740 ;;
741 mingw32ce)
742 basic_machine=arm-unknown
743 os=-mingw32ce
744 ;;
745 miniframe)
746 basic_machine=m68000-convergent
747 ;;
748 *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
749 basic_machine=m68k-atari
750 os=-mint
751 ;;
752 mips3*-*)
753 basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
754 ;;
755 mips3*)
756 basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
757 ;;
758 monitor)
759 basic_machine=m68k-rom68k
760 os=-coff
761 ;;
762 morphos)
763 basic_machine=powerpc-unknown
764 os=-morphos
765 ;;
766 msdos)
767 basic_machine=i386-pc
768 os=-msdos
769 ;;
770 ms1-*)
771 basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
772 ;;
773 mvs)
774 basic_machine=i370-ibm
775 os=-mvs
776 ;;
777 ncr3000)
778 basic_machine=i486-ncr
779 os=-sysv4
780 ;;
781 netbsd386)
782 basic_machine=i386-unknown
783 os=-netbsd
784 ;;
785 netwinder)
786 basic_machine=armv4l-rebel
787 os=-linux
788 ;;
789 news | news700 | news800 | news900)
790 basic_machine=m68k-sony
791 os=-newsos
792 ;;
793 news1000)
794 basic_machine=m68030-sony
795 os=-newsos
796 ;;
797 news-3600 | risc-news)
798 basic_machine=mips-sony
799 os=-newsos
800 ;;
801 necv70)
802 basic_machine=v70-nec
803 os=-sysv
804 ;;
805 next | m*-next )
806 basic_machine=m68k-next
807 case $os in
808 -nextstep* )
809 ;;
810 -ns2*)
811 os=-nextstep2
812 ;;
813 *)
814 os=-nextstep3
815 ;;
816 esac
817 ;;
818 nh3000)
819 basic_machine=m68k-harris
820 os=-cxux
821 ;;
822 nh[45]000)
823 basic_machine=m88k-harris
824 os=-cxux
825 ;;
826 nindy960)
827 basic_machine=i960-intel
828 os=-nindy
829 ;;
830 mon960)
831 basic_machine=i960-intel
832 os=-mon960
833 ;;
834 nonstopux)
835 basic_machine=mips-compaq
836 os=-nonstopux
837 ;;
838 np1)
839 basic_machine=np1-gould
840 ;;
841 nsr-tandem)
842 basic_machine=nsr-tandem
843 ;;
844 op50n-* | op60c-*)
845 basic_machine=hppa1.1-oki
846 os=-proelf
847 ;;
848 openrisc | openrisc-*)
849 basic_machine=or32-unknown
850 ;;
851 os400)
852 basic_machine=powerpc-ibm
853 os=-os400
854 ;;
855 OSE68000 | ose68000)
856 basic_machine=m68000-ericsson
857 os=-ose
858 ;;
859 os68k)
860 basic_machine=m68k-none
861 os=-os68k
862 ;;
863 pa-hitachi)
864 basic_machine=hppa1.1-hitachi
865 os=-hiuxwe2
866 ;;
867 paragon)
868 basic_machine=i860-intel
869 os=-osf
870 ;;
871 parisc)
872 basic_machine=hppa-unknown
873 os=-linux
874 ;;
875 parisc-*)
876 basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
877 os=-linux
878 ;;
879 pbd)
880 basic_machine=sparc-tti
881 ;;
882 pbb)
883 basic_machine=m68k-tti
884 ;;
885 pc532 | pc532-*)
886 basic_machine=ns32k-pc532
887 ;;
888 pc98)
889 basic_machine=i386-pc
890 ;;
891 pc98-*)
892 basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
893 ;;
894 pentium | p5 | k5 | k6 | nexgen | viac3)
895 basic_machine=i586-pc
896 ;;
897 pentiumpro | p6 | 6x86 | athlon | athlon_*)
898 basic_machine=i686-pc
899 ;;
900 pentiumii | pentium2 | pentiumiii | pentium3)
901 basic_machine=i686-pc
902 ;;
903 pentium4)
904 basic_machine=i786-pc
905 ;;
906 pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
907 basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
908 ;;
909 pentiumpro-* | p6-* | 6x86-* | athlon-*)
910 basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
911 ;;
912 pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
913 basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
914 ;;
915 pentium4-*)
916 basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
917 ;;
918 pn)
919 basic_machine=pn-gould
920 ;;
921 power) basic_machine=power-ibm
922 ;;
923 ppc) basic_machine=powerpc-unknown
924 ;;
925 ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
926 ;;
927 ppcle | powerpclittle | ppc-le | powerpc-little)
928 basic_machine=powerpcle-unknown
929 ;;
930 ppcle-* | powerpclittle-*)
931 basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
932 ;;
933 ppc64) basic_machine=powerpc64-unknown
934 ;;
935 ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
936 ;;
937 ppc64le | powerpc64little | ppc64-le | powerpc64-little)
938 basic_machine=powerpc64le-unknown
939 ;;
940 ppc64le-* | powerpc64little-*)
941 basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
942 ;;
943 ps2)
944 basic_machine=i386-ibm
945 ;;
946 pw32)
947 basic_machine=i586-unknown
948 os=-pw32
949 ;;
950 rdos)
951 basic_machine=i386-pc
952 os=-rdos
953 ;;
954 rom68k)
955 basic_machine=m68k-rom68k
956 os=-coff
957 ;;
958 rm[46]00)
959 basic_machine=mips-siemens
960 ;;
961 rtpc | rtpc-*)
962 basic_machine=romp-ibm
963 ;;
964 s390 | s390-*)
965 basic_machine=s390-ibm
966 ;;
967 s390x | s390x-*)
968 basic_machine=s390x-ibm
969 ;;
970 sa29200)
971 basic_machine=a29k-amd
972 os=-udi
973 ;;
974 sb1)
975 basic_machine=mipsisa64sb1-unknown
976 ;;
977 sb1el)
978 basic_machine=mipsisa64sb1el-unknown
979 ;;
980 sde)
981 basic_machine=mipsisa32-sde
982 os=-elf
983 ;;
984 sei)
985 basic_machine=mips-sei
986 os=-seiux
987 ;;
988 sequent)
989 basic_machine=i386-sequent
990 ;;
991 sh)
992 basic_machine=sh-hitachi
993 os=-hms
994 ;;
995 sh5el)
996 basic_machine=sh5le-unknown
997 ;;
998 sh64)
999 basic_machine=sh64-unknown
1000 ;;
1001 sparclite-wrs | simso-wrs)
1002 basic_machine=sparclite-wrs
1003 os=-vxworks
1004 ;;
1005 sps7)
1006 basic_machine=m68k-bull
1007 os=-sysv2
1008 ;;
1009 spur)
1010 basic_machine=spur-unknown
1011 ;;
1012 st2000)
1013 basic_machine=m68k-tandem
1014 ;;
1015 stratus)
1016 basic_machine=i860-stratus
1017 os=-sysv4
1018 ;;
1019 sun2)
1020 basic_machine=m68000-sun
1021 ;;
1022 sun2os3)
1023 basic_machine=m68000-sun
1024 os=-sunos3
1025 ;;
1026 sun2os4)
1027 basic_machine=m68000-sun
1028 os=-sunos4
1029 ;;
1030 sun3os3)
1031 basic_machine=m68k-sun
1032 os=-sunos3
1033 ;;
1034 sun3os4)
1035 basic_machine=m68k-sun
1036 os=-sunos4
1037 ;;
1038 sun4os3)
1039 basic_machine=sparc-sun
1040 os=-sunos3
1041 ;;
1042 sun4os4)
1043 basic_machine=sparc-sun
1044 os=-sunos4
1045 ;;
1046 sun4sol2)
1047 basic_machine=sparc-sun
1048 os=-solaris2
1049 ;;
1050 sun3 | sun3-*)
1051 basic_machine=m68k-sun
1052 ;;
1053 sun4)
1054 basic_machine=sparc-sun
1055 ;;
1056 sun386 | sun386i | roadrunner)
1057 basic_machine=i386-sun
1058 ;;
1059 sv1)
1060 basic_machine=sv1-cray
1061 os=-unicos
1062 ;;
1063 symmetry)
1064 basic_machine=i386-sequent
1065 os=-dynix
1066 ;;
1067 t3e)
1068 basic_machine=alphaev5-cray
1069 os=-unicos
1070 ;;
1071 t90)
1072 basic_machine=t90-cray
1073 os=-unicos
1074 ;;
1075 tic54x | c54x*)
1076 basic_machine=tic54x-unknown
1077 os=-coff
1078 ;;
1079 tic55x | c55x*)
1080 basic_machine=tic55x-unknown
1081 os=-coff
1082 ;;
1083 tic6x | c6x*)
1084 basic_machine=tic6x-unknown
1085 os=-coff
1086 ;;
1087 tile*)
1088 basic_machine=tile-unknown
1089 os=-linux-gnu
1090 ;;
1091 tx39)
1092 basic_machine=mipstx39-unknown
1093 ;;
1094 tx39el)
1095 basic_machine=mipstx39el-unknown
1096 ;;
1097 toad1)
1098 basic_machine=pdp10-xkl
1099 os=-tops20
1100 ;;
1101 tower | tower-32)
1102 basic_machine=m68k-ncr
1103 ;;
1104 tpf)
1105 basic_machine=s390x-ibm
1106 os=-tpf
1107 ;;
1108 udi29k)
1109 basic_machine=a29k-amd
1110 os=-udi
1111 ;;
1112 ultra3)
1113 basic_machine=a29k-nyu
1114 os=-sym1
1115 ;;
1116 v810 | necv810)
1117 basic_machine=v810-nec
1118 os=-none
1119 ;;
1120 vaxv)
1121 basic_machine=vax-dec
1122 os=-sysv
1123 ;;
1124 vms)
1125 basic_machine=vax-dec
1126 os=-vms
1127 ;;
1128 vpp*|vx|vx-*)
1129 basic_machine=f301-fujitsu
1130 ;;
1131 vxworks960)
1132 basic_machine=i960-wrs
1133 os=-vxworks
1134 ;;
1135 vxworks68)
1136 basic_machine=m68k-wrs
1137 os=-vxworks
1138 ;;
1139 vxworks29k)
1140 basic_machine=a29k-wrs
1141 os=-vxworks
1142 ;;
1143 w65*)
1144 basic_machine=w65-wdc
1145 os=-none
1146 ;;
1147 w89k-*)
1148 basic_machine=hppa1.1-winbond
1149 os=-proelf
1150 ;;
1151 xbox)
1152 basic_machine=i686-pc
1153 os=-mingw32
1154 ;;
1155 xps | xps100)
1156 basic_machine=xps100-honeywell
1157 ;;
1158 ymp)
1159 basic_machine=ymp-cray
1160 os=-unicos
1161 ;;
1162 z8k-*-coff)
1163 basic_machine=z8k-unknown
1164 os=-sim
1165 ;;
1166 z80-*-coff)
1167 basic_machine=z80-unknown
1168 os=-sim
1169 ;;
1170 none)
1171 basic_machine=none-none
1172 os=-none
1173 ;;
1174
1175 # Here we handle the default manufacturer of certain CPU types. It is in
1176 # some cases the only manufacturer, in others, it is the most popular.
1177 w89k)
1178 basic_machine=hppa1.1-winbond
1179 ;;
1180 op50n)
1181 basic_machine=hppa1.1-oki
1182 ;;
1183 op60c)
1184 basic_machine=hppa1.1-oki
1185 ;;
1186 romp)
1187 basic_machine=romp-ibm
1188 ;;
1189 mmix)
1190 basic_machine=mmix-knuth
1191 ;;
1192 rs6000)
1193 basic_machine=rs6000-ibm
1194 ;;
1195 vax)
1196 basic_machine=vax-dec
1197 ;;
1198 pdp10)
1199 # there are many clones, so DEC is not a safe bet
1200 basic_machine=pdp10-unknown
1201 ;;
1202 pdp11)
1203 basic_machine=pdp11-dec
1204 ;;
1205 we32k)
1206 basic_machine=we32k-att
1207 ;;
1208 sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
1209 basic_machine=sh-unknown
1210 ;;
1211 sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
1212 basic_machine=sparc-sun
1213 ;;
1214 cydra)
1215 basic_machine=cydra-cydrome
1216 ;;
1217 orion)
1218 basic_machine=orion-highlevel
1219 ;;
1220 orion105)
1221 basic_machine=clipper-highlevel
1222 ;;
1223 mac | mpw | mac-mpw)
1224 basic_machine=m68k-apple
1225 ;;
1226 pmac | pmac-mpw)
1227 basic_machine=powerpc-apple
1228 ;;
1229 *-unknown)
1230 # Make sure to match an already-canonicalized machine name.
1231 ;;
1232 *)
1233 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
1234 exit 1
1235 ;;
1236 esac
1237
1238 # Here we canonicalize certain aliases for manufacturers.
1239 case $basic_machine in
1240 *-digital*)
1241 basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
1242 ;;
1243 *-commodore*)
1244 basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
1245 ;;
1246 *)
1247 ;;
1248 esac
1249
1250 # Decode manufacturer-specific aliases for certain operating systems.
1251
1252 if [ x"$os" != x"" ]
1253 then
1254 case $os in
1255 # First match some system type aliases
1256 # that might get confused with valid system types.
1257 # -solaris* is a basic system type, with this one exception.
1258 -auroraux)
1259 os=-auroraux
1260 ;;
1261 -solaris1 | -solaris1.*)
1262 os=`echo $os | sed -e 's|solaris1|sunos4|'`
1263 ;;
1264 -solaris)
1265 os=-solaris2
1266 ;;
1267 -svr4*)
1268 os=-sysv4
1269 ;;
1270 -unixware*)
1271 os=-sysv4.2uw
1272 ;;
1273 -gnu/linux*)
1274 os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
1275 ;;
1276 # First accept the basic system types.
1277 # The portable systems comes first.
1278 # Each alternative MUST END IN A *, to match a version number.
1279 # -sysv* is not here because it comes later, after sysvr4.
1280 -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
1281 | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
1282 | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
1283 | -sym* | -kopensolaris* \
1284 | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
1285 | -aos* | -aros* \
1286 | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
1287 | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
1288 | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
1289 | -openbsd* | -solidbsd* \
1290 | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
1291 | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
1292 | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
1293 | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
1294 | -chorusos* | -chorusrdb* | -cegcc* \
1295 | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
1296 | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
1297 | -uxpv* | -beos* | -mpeix* | -udk* \
1298 | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
1299 | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
1300 | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
1301 | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
1302 | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
1303 | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
1304 | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
1305 # Remember, each alternative MUST END IN *, to match a version number.
1306 ;;
1307 -qnx*)
1308 case $basic_machine in
1309 x86-* | i*86-*)
1310 ;;
1311 *)
1312 os=-nto$os
1313 ;;
1314 esac
1315 ;;
1316 -nto-qnx*)
1317 ;;
1318 -nto*)
1319 os=`echo $os | sed -e 's|nto|nto-qnx|'`
1320 ;;
1321 -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
1322 | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
1323 | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
1324 ;;
1325 -mac*)
1326 os=`echo $os | sed -e 's|mac|macos|'`
1327 ;;
1328 -linux-dietlibc)
1329 os=-linux-dietlibc
1330 ;;
1331 -linux*)
1332 os=`echo $os | sed -e 's|linux|linux-gnu|'`
1333 ;;
1334 -sunos5*)
1335 os=`echo $os | sed -e 's|sunos5|solaris2|'`
1336 ;;
1337 -sunos6*)
1338 os=`echo $os | sed -e 's|sunos6|solaris3|'`
1339 ;;
1340 -opened*)
1341 os=-openedition
1342 ;;
1343 -os400*)
1344 os=-os400
1345 ;;
1346 -wince*)
1347 os=-wince
1348 ;;
1349 -osfrose*)
1350 os=-osfrose
1351 ;;
1352 -osf*)
1353 os=-osf
1354 ;;
1355 -utek*)
1356 os=-bsd
1357 ;;
1358 -dynix*)
1359 os=-bsd
1360 ;;
1361 -acis*)
1362 os=-aos
1363 ;;
1364 -atheos*)
1365 os=-atheos
1366 ;;
1367 -syllable*)
1368 os=-syllable
1369 ;;
1370 -386bsd)
1371 os=-bsd
1372 ;;
1373 -ctix* | -uts*)
1374 os=-sysv
1375 ;;
1376 -nova*)
1377 os=-rtmk-nova
1378 ;;
1379 -ns2 )
1380 os=-nextstep2
1381 ;;
1382 -nsk*)
1383 os=-nsk
1384 ;;
1385 # Preserve the version number of sinix5.
1386 -sinix5.*)
1387 os=`echo $os | sed -e 's|sinix|sysv|'`
1388 ;;
1389 -sinix*)
1390 os=-sysv4
1391 ;;
1392 -tpf*)
1393 os=-tpf
1394 ;;
1395 -triton*)
1396 os=-sysv3
1397 ;;
1398 -oss*)
1399 os=-sysv3
1400 ;;
1401 -svr4)
1402 os=-sysv4
1403 ;;
1404 -svr3)
1405 os=-sysv3
1406 ;;
1407 -sysvr4)
1408 os=-sysv4
1409 ;;
1410 # This must come after -sysvr4.
1411 -sysv*)
1412 ;;
1413 -ose*)
1414 os=-ose
1415 ;;
1416 -es1800*)
1417 os=-ose
1418 ;;
1419 -xenix)
1420 os=-xenix
1421 ;;
1422 -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
1423 os=-mint
1424 ;;
1425 -aros*)
1426 os=-aros
1427 ;;
1428 -kaos*)
1429 os=-kaos
1430 ;;
1431 -zvmoe)
1432 os=-zvmoe
1433 ;;
1434 -dicos*)
1435 os=-dicos
1436 ;;
1437 -none)
1438 ;;
1439 *)
1440 # Get rid of the `-' at the beginning of $os.
1441 os=`echo $os | sed 's/[^-]*-//'`
1442 echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
1443 exit 1
1444 ;;
1445 esac
1446 else
1447
1448 # Here we handle the default operating systems that come with various machines.
1449 # The value should be what the vendor currently ships out the door with their
1450 # machine or put another way, the most popular os provided with the machine.
1451
1452 # Note that if you're going to try to match "-MANUFACTURER" here (say,
1453 # "-sun"), then you have to tell the case statement up towards the top
1454 # that MANUFACTURER isn't an operating system. Otherwise, code above
1455 # will signal an error saying that MANUFACTURER isn't an operating
1456 # system, and we'll never get to this point.
1457
1458 case $basic_machine in
1459 score-*)
1460 os=-elf
1461 ;;
1462 spu-*)
1463 os=-elf
1464 ;;
1465 *-acorn)
1466 os=-riscix1.2
1467 ;;
1468 arm*-rebel)
1469 os=-linux
1470 ;;
1471 arm*-semi)
1472 os=-aout
1473 ;;
1474 c4x-* | tic4x-*)
1475 os=-coff
1476 ;;
1477 # This must come before the *-dec entry.
1478 pdp10-*)
1479 os=-tops20
1480 ;;
1481 pdp11-*)
1482 os=-none
1483 ;;
1484 *-dec | vax-*)
1485 os=-ultrix4.2
1486 ;;
1487 m68*-apollo)
1488 os=-domain
1489 ;;
1490 i386-sun)
1491 os=-sunos4.0.2
1492 ;;
1493 m68000-sun)
1494 os=-sunos3
1495 # This also exists in the configure program, but was not the
1496 # default.
1497 # os=-sunos4
1498 ;;
1499 m68*-cisco)
1500 os=-aout
1501 ;;
1502 mep-*)
1503 os=-elf
1504 ;;
1505 mips*-cisco)
1506 os=-elf
1507 ;;
1508 mips*-*)
1509 os=-elf
1510 ;;
1511 or32-*)
1512 os=-coff
1513 ;;
1514 *-tti) # must be before sparc entry or we get the wrong os.
1515 os=-sysv3
1516 ;;
1517 sparc-* | *-sun)
1518 os=-sunos4.1.1
1519 ;;
1520 *-be)
1521 os=-beos
1522 ;;
1523 *-haiku)
1524 os=-haiku
1525 ;;
1526 *-ibm)
1527 os=-aix
1528 ;;
1529 *-knuth)
1530 os=-mmixware
1531 ;;
1532 *-wec)
1533 os=-proelf
1534 ;;
1535 *-winbond)
1536 os=-proelf
1537 ;;
1538 *-oki)
1539 os=-proelf
1540 ;;
1541 *-hp)
1542 os=-hpux
1543 ;;
1544 *-hitachi)
1545 os=-hiux
1546 ;;
1547 i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
1548 os=-sysv
1549 ;;
1550 *-cbm)
1551 os=-amigaos
1552 ;;
1553 *-dg)
1554 os=-dgux
1555 ;;
1556 *-dolphin)
1557 os=-sysv3
1558 ;;
1559 m68k-ccur)
1560 os=-rtu
1561 ;;
1562 m88k-omron*)
1563 os=-luna
1564 ;;
1565 *-next )
1566 os=-nextstep
1567 ;;
1568 *-sequent)
1569 os=-ptx
1570 ;;
1571 *-crds)
1572 os=-unos
1573 ;;
1574 *-ns)
1575 os=-genix
1576 ;;
1577 i370-*)
1578 os=-mvs
1579 ;;
1580 *-next)
1581 os=-nextstep3
1582 ;;
1583 *-gould)
1584 os=-sysv
1585 ;;
1586 *-highlevel)
1587 os=-bsd
1588 ;;
1589 *-encore)
1590 os=-bsd
1591 ;;
1592 *-sgi)
1593 os=-irix
1594 ;;
1595 *-siemens)
1596 os=-sysv4
1597 ;;
1598 *-masscomp)
1599 os=-rtu
1600 ;;
1601 f30[01]-fujitsu | f700-fujitsu)
1602 os=-uxpv
1603 ;;
1604 *-rom68k)
1605 os=-coff
1606 ;;
1607 *-*bug)
1608 os=-coff
1609 ;;
1610 *-apple)
1611 os=-macos
1612 ;;
1613 *-atari*)
1614 os=-mint
1615 ;;
1616 *)
1617 os=-none
1618 ;;
1619 esac
1620 fi
1621
1622 # Here we handle the case where we know the os, and the CPU type, but not the
1623 # manufacturer. We pick the logical manufacturer.
1624 vendor=unknown
1625 case $basic_machine in
1626 *-unknown)
1627 case $os in
1628 -riscix*)
1629 vendor=acorn
1630 ;;
1631 -sunos*)
1632 vendor=sun
1633 ;;
1634 -cnk*|-aix*)
1635 vendor=ibm
1636 ;;
1637 -beos*)
1638 vendor=be
1639 ;;
1640 -hpux*)
1641 vendor=hp
1642 ;;
1643 -mpeix*)
1644 vendor=hp
1645 ;;
1646 -hiux*)
1647 vendor=hitachi
1648 ;;
1649 -unos*)
1650 vendor=crds
1651 ;;
1652 -dgux*)
1653 vendor=dg
1654 ;;
1655 -luna*)
1656 vendor=omron
1657 ;;
1658 -genix*)
1659 vendor=ns
1660 ;;
1661 -mvs* | -opened*)
1662 vendor=ibm
1663 ;;
1664 -os400*)
1665 vendor=ibm
1666 ;;
1667 -ptx*)
1668 vendor=sequent
1669 ;;
1670 -tpf*)
1671 vendor=ibm
1672 ;;
1673 -vxsim* | -vxworks* | -windiss*)
1674 vendor=wrs
1675 ;;
1676 -aux*)
1677 vendor=apple
1678 ;;
1679 -hms*)
1680 vendor=hitachi
1681 ;;
1682 -mpw* | -macos*)
1683 vendor=apple
1684 ;;
1685 -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
1686 vendor=atari
1687 ;;
1688 -vos*)
1689 vendor=stratus
1690 ;;
1691 esac
1692 basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
1693 ;;
1694 esac
1695
1696 echo $basic_machine$os
1697 exit
1698
1699 # Local variables:
1700 # eval: (add-hook 'write-file-hooks 'time-stamp)
1701 # time-stamp-start: "timestamp='"
1702 # time-stamp-format: "%:y-%02m-%02d"
1703 # time-stamp-end: "'"
1704 # End:
00 #! /bin/sh
11 # Guess values for system-dependent variables and create Makefiles.
2 # Generated by GNU Autoconf 2.68 for libatasmart 0.18.
2 # Generated by GNU Autoconf 2.68 for libatasmart 0.19.
33 #
44 # Report bugs to <mzyvongnfzneg (at) 0pointer (dot) net>.
55 #
569569 # Identity of this package.
570570 PACKAGE_NAME='libatasmart'
571571 PACKAGE_TARNAME='libatasmart'
572 PACKAGE_VERSION='0.18'
573 PACKAGE_STRING='libatasmart 0.18'
572 PACKAGE_VERSION='0.19'
573 PACKAGE_STRING='libatasmart 0.19'
574574 PACKAGE_BUGREPORT='mzyvongnfzneg (at) 0pointer (dot) net'
575 PACKAGE_URL=''
575 PACKAGE_URL='http://git.0pointer.de/?p=libatasmart.git'
576576
577577 ac_unique_file="atasmart.c"
578578 # Factoring default headers for most tests.
615615 am__EXEEXT_TRUE
616616 LTLIBOBJS
617617 LIBOBJS
618 LIBUDEV_LIBS
619 LIBUDEV_CFLAGS
620 PKG_CONFIG_LIBDIR
621 PKG_CONFIG_PATH
622 PKG_CONFIG
623618 OTOOL64
624619 OTOOL
625620 LIPO
647642 build_cpu
648643 build
649644 LIBTOOL
645 LIBUDEV_LIBS
646 LIBUDEV_CFLAGS
647 PKG_CONFIG_LIBDIR
648 PKG_CONFIG_PATH
649 PKG_CONFIG
650 GCLDFLAGS
651 WARNINGFLAGS
650652 EXEEXT_FOR_BUILD
651653 BUILD_LDFLAGS
652654 BUILD_CFLAGS
657659 am__fastdepCC_FALSE
658660 am__fastdepCC_TRUE
659661 CCDEPMODE
662 am__nodep
660663 AMDEPBACKSLASH
661664 AMDEP_FALSE
662665 AMDEP_TRUE
673676 LIBATASMART_VERSION_INFO
674677 AM_BACKSLASH
675678 AM_DEFAULT_VERBOSITY
679 AM_DEFAULT_V
680 AM_V
676681 am__untar
677682 am__tar
678683 AMTAR
740745 enable_silent_rules
741746 enable_dependency_tracking
742747 enable_largefile
748 enable_static
743749 enable_shared
744 enable_static
745750 with_pic
746751 enable_fast_install
747752 with_gnu_ld
13071312 # Omit some internal or obsolete options to make the list less imposing.
13081313 # This message is too long to be a string in the A/UX 3.1 sh.
13091314 cat <<_ACEOF
1310 \`configure' configures libatasmart 0.18 to adapt to many kinds of systems.
1315 \`configure' configures libatasmart 0.19 to adapt to many kinds of systems.
13111316
13121317 Usage: $0 [OPTION]... [VAR=VALUE]...
13131318
13771382
13781383 if test -n "$ac_init_help"; then
13791384 case $ac_init_help in
1380 short | recursive ) echo "Configuration of libatasmart 0.18:";;
1385 short | recursive ) echo "Configuration of libatasmart 0.19:";;
13811386 esac
13821387 cat <<\_ACEOF
13831388
13901395 --disable-dependency-tracking speeds up one-time build
13911396 --enable-dependency-tracking do not reject slow dependency extractors
13921397 --disable-largefile omit support for large files
1398 --enable-static[=PKGS] build static libraries [default=no]
13931399 --enable-shared[=PKGS] build shared libraries [default=yes]
1394 --enable-static[=PKGS] build static libraries [default=yes]
13951400 --enable-fast-install[=PKGS]
13961401 optimize for fast installation [default=yes]
13971402 --disable-libtool-lock avoid locking (might break parallel builds)
13991404 Optional Packages:
14001405 --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
14011406 --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
1402 --with-pic try to use only PIC/non-PIC objects [default=use
1407 --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use
14031408 both]
14041409 --with-gnu-ld assume the C compiler uses GNU ld [default=no]
14051410 --with-sysroot=DIR Search for dependent libraries within DIR
14341439 it to find libraries and programs with nonstandard names/locations.
14351440
14361441 Report bugs to <mzyvongnfzneg (at) 0pointer (dot) net>.
1442 libatasmart home page: <http://git.0pointer.de/?p=libatasmart.git>.
14371443 _ACEOF
14381444 ac_status=$?
14391445 fi
14961502 test -n "$ac_init_help" && exit $ac_status
14971503 if $ac_init_version; then
14981504 cat <<\_ACEOF
1499 libatasmart configure 0.18
1505 libatasmart configure 0.19
15001506 generated by GNU Autoconf 2.68
15011507
15021508 Copyright (C) 2010 Free Software Foundation, Inc.
18651871 This file contains any messages produced by compilers while
18661872 running configure, to aid debugging if configure makes a mistake.
18671873
1868 It was created by libatasmart $as_me 0.18, which was
1874 It was created by libatasmart $as_me 0.19, which was
18691875 generated by GNU Autoconf 2.68. Invocation command line was
18701876
18711877 $ $0 $@
22142220
22152221
22162222
2223
22172224 ac_config_headers="$ac_config_headers config.h"
22182225
22192226
2220
2221 am__api_version='1.11'
2222
22232227 ac_aux_dir=
2224 for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
2228 for ac_dir in build-aux "$srcdir"/build-aux; do
22252229 if test -f "$ac_dir/install-sh"; then
22262230 ac_aux_dir=$ac_dir
22272231 ac_install_sh="$ac_aux_dir/install-sh -c"
22372241 fi
22382242 done
22392243 if test -z "$ac_aux_dir"; then
2240 as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
2244 as_fn_error $? "cannot find install-sh, install.sh, or shtool in build-aux \"$srcdir\"/build-aux" "$LINENO" 5
22412245 fi
22422246
22432247 # These three variables are undocumented and unsupported,
22482252 ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
22492253 ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
22502254
2255
2256
2257 am__api_version='1.11'
22512258
22522259 # Find a good install program. We prefer a C program (faster),
22532260 # so one script is as good as another. But avoid the broken or
26732680 no) AM_DEFAULT_VERBOSITY=1;;
26742681 *) AM_DEFAULT_VERBOSITY=1;;
26752682 esac
2683 am_make=${MAKE-make}
2684 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
2685 $as_echo_n "checking whether $am_make supports nested variables... " >&6; }
2686 if ${am_cv_make_support_nested_variables+:} false; then :
2687 $as_echo_n "(cached) " >&6
2688 else
2689 if $as_echo 'TRUE=$(BAR$(V))
2690 BAR0=false
2691 BAR1=true
2692 V=1
2693 am__doit:
2694 @$(TRUE)
2695 .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
2696 am_cv_make_support_nested_variables=yes
2697 else
2698 am_cv_make_support_nested_variables=no
2699 fi
2700 fi
2701 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
2702 $as_echo "$am_cv_make_support_nested_variables" >&6; }
2703 if test $am_cv_make_support_nested_variables = yes; then
2704 AM_V='$(V)'
2705 AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
2706 else
2707 AM_V=$AM_DEFAULT_VERBOSITY
2708 AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
2709 fi
26762710 AM_BACKSLASH='\'
26772711
26782712 if test "`cd $srcdir && pwd`" != "`pwd`"; then
26972731
26982732 # Define the identity of the package.
26992733 PACKAGE='libatasmart'
2700 VERSION='0.18'
2734 VERSION='0.19'
27012735
27022736
27032737 cat >>confdefs.h <<_ACEOF
27272761
27282762 # We need awk for the "check" target. The system "awk" is bad on
27292763 # some platforms.
2730 # Always define AMTAR for backward compatibility.
2731
2732 AMTAR=${AMTAR-"${am_missing_run}tar"}
2764 # Always define AMTAR for backward compatibility. Yes, it's still used
2765 # in the wild :-( We should find a proper way to deprecate it ...
2766 AMTAR='$${TAR-tar}'
27332767
27342768
27352769 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to create a pax tar archive" >&5
28182852
28192853
28202854
2821
2822 PACKAGE_URL=http://git.0pointer.de/?p=libatasmart.git
2823
2824
2825 LIBATASMART_VERSION_INFO=4:4:0
2826
2827
28282855 # Check whether --enable-silent-rules was given.
28292856 if test "${enable_silent_rules+set}" = set; then :
28302857 enableval=$enable_silent_rules;
28352862 no) AM_DEFAULT_VERBOSITY=1;;
28362863 *) AM_DEFAULT_VERBOSITY=0;;
28372864 esac
2865 am_make=${MAKE-make}
2866 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
2867 $as_echo_n "checking whether $am_make supports nested variables... " >&6; }
2868 if ${am_cv_make_support_nested_variables+:} false; then :
2869 $as_echo_n "(cached) " >&6
2870 else
2871 if $as_echo 'TRUE=$(BAR$(V))
2872 BAR0=false
2873 BAR1=true
2874 V=1
2875 am__doit:
2876 @$(TRUE)
2877 .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
2878 am_cv_make_support_nested_variables=yes
2879 else
2880 am_cv_make_support_nested_variables=no
2881 fi
2882 fi
2883 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
2884 $as_echo "$am_cv_make_support_nested_variables" >&6; }
2885 if test $am_cv_make_support_nested_variables = yes; then
2886 AM_V='$(V)'
2887 AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
2888 else
2889 AM_V=$AM_DEFAULT_VERBOSITY
2890 AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
2891 fi
28382892 AM_BACKSLASH='\'
28392893
28402894
2895 LIBATASMART_VERSION_INFO=4:5:0
2896
2897
28412898 if type -p stow > /dev/null && test -d /usr/local/stow ; then
2842 { $as_echo "$as_me:${as_lineno-$LINENO}: *** Found /usr/local/stow: default install prefix set to /usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION} ***" >&5
2899 { $as_echo "$as_me:${as_lineno-$LINENO}: *** Found /usr/local/stow: default install prefix set to /usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION} ***" >&5
28432900 $as_echo "$as_me: *** Found /usr/local/stow: default install prefix set to /usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION} ***" >&6;}
2844 ac_default_prefix="/usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION}"
2901 ac_default_prefix="/usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION}"
28452902 fi
28462903
28472904 ac_ext=c
36853742 if test "x$enable_dependency_tracking" != xno; then
36863743 am_depcomp="$ac_aux_dir/depcomp"
36873744 AMDEPBACKSLASH='\'
3745 am__nodep='_no'
36883746 fi
36893747 if test "x$enable_dependency_tracking" != xno; then
36903748 AMDEP_TRUE=
37093767 # instance it was reported that on HP-UX the gcc test will end up
37103768 # making a dummy file named `D' -- because `-MD' means `put the output
37113769 # in D'.
3770 rm -rf conftest.dir
37123771 mkdir conftest.dir
37133772 # Copy depcomp to subdir because otherwise we won't find it if we're
37143773 # using a relative directory.
37683827 break
37693828 fi
37703829 ;;
3771 msvisualcpp | msvcmsys)
3830 msvc7 | msvc7msys | msvisualcpp | msvcmsys)
37723831 # This compiler won't grok `-c -o', but also, the minuso test has
37733832 # not run yet. These depmodes are late enough in the game, and
37743833 # so weak that their functioning should not be impacted.
49274986 fi
49284987
49294988
4989
4990 for flag in \
4991 -pipe \
4992 -Wall \
4993 -W \
4994 -Wextra \
4995 -Winline \
4996 -Wvla \
4997 -Wundef \
4998 -Wformat=2 \
4999 -Wlogical-op \
5000 -Wsign-compare \
5001 -Wformat-security \
5002 -Wmissing-include-dirs \
5003 -Wformat-nonliteral \
5004 -Wold-style-definition \
5005 -Wpointer-arith \
5006 -Winit-self \
5007 -Wdeclaration-after-statement \
5008 -Wfloat-equal \
5009 -Wmissing-prototypes \
5010 -Wstrict-prototypes \
5011 -Wredundant-decls \
5012 -Wmissing-declarations \
5013 -Wmissing-noreturn \
5014 -Wshadow \
5015 -Wendif-labels \
5016 -Wcast-align \
5017 -Wstrict-aliasing=2 \
5018 -Wwrite-strings \
5019 -Wno-long-long \
5020 -Wno-overlength-strings \
5021 -Wno-unused-parameter \
5022 -Wno-missing-field-initializers \
5023 -Wno-unused-result \
5024 -Wunsafe-loop-optimizations \
5025 -Wpacked \
5026 -Werror=overflow \
5027 -Wp,-D_FORTIFY_SOURCE=2 \
5028 -ffast-math \
5029 -fno-common \
5030 -fdiagnostics-show-option \
5031 -fno-strict-aliasing \
5032 -ffunction-sections \
5033 -fdata-sections; do
5034
5035 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports flag $flag in envvar CFLAGS" >&5
5036 $as_echo_n "checking if $CC supports flag $flag in envvar CFLAGS... " >&6; }
5037 if { as_var=`$as_echo "cc_cv_CFLAGS_$flag" | $as_tr_sh`; eval \${$as_var+:} false; }; then :
5038 $as_echo_n "(cached) " >&6
5039 else
5040 eval "cc_save_CFLAGS='${CFLAGS}'"
5041 eval "CFLAGS='$flag'"
5042 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5043 /* end confdefs.h. */
5044 int a = 0; int main(void) { return a; }
5045 _ACEOF
5046 if ac_fn_c_try_compile "$LINENO"; then :
5047 eval "`$as_echo "cc_cv_CFLAGS_$flag" | $as_tr_sh`='yes'"
5048 else
5049 eval "`$as_echo "cc_cv_CFLAGS_$flag" | $as_tr_sh`='no'"
5050 fi
5051 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5052 eval "CFLAGS='$cc_save_CFLAGS'"
5053 fi
5054 eval ac_res=\$`$as_echo "cc_cv_CFLAGS_$flag" | $as_tr_sh`
5055 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
5056 $as_echo "$ac_res" >&6; }
5057
5058 if eval test x$`$as_echo "cc_cv_CFLAGS_$flag" | $as_tr_sh` = xyes; then :
5059 eval "with_cflags='${with_cflags} $flag'"
5060 fi
5061
5062 done
5063
5064 WARNINGFLAGS=$with_cflags
5065
5066
5067
5068 for flag in \
5069 -Wl,--as-needed \
5070 -Wl,--gc-sections; do
5071
5072 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports flag $flag in envvar LDFLAGS" >&5
5073 $as_echo_n "checking if $CC supports flag $flag in envvar LDFLAGS... " >&6; }
5074 if { as_var=`$as_echo "cc_cv_LDFLAGS_$flag" | $as_tr_sh`; eval \${$as_var+:} false; }; then :
5075 $as_echo_n "(cached) " >&6
5076 else
5077 eval "cc_save_LDFLAGS='${LDFLAGS}'"
5078 eval "LDFLAGS='$flag'"
5079 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5080 /* end confdefs.h. */
5081 int a = 0; int main(void) { return a; }
5082 _ACEOF
5083 if ac_fn_c_try_compile "$LINENO"; then :
5084 eval "`$as_echo "cc_cv_LDFLAGS_$flag" | $as_tr_sh`='yes'"
5085 else
5086 eval "`$as_echo "cc_cv_LDFLAGS_$flag" | $as_tr_sh`='no'"
5087 fi
5088 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5089 eval "LDFLAGS='$cc_save_LDFLAGS'"
5090 fi
5091 eval ac_res=\$`$as_echo "cc_cv_LDFLAGS_$flag" | $as_tr_sh`
5092 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
5093 $as_echo "$ac_res" >&6; }
5094
5095 if eval test x$`$as_echo "cc_cv_LDFLAGS_$flag" | $as_tr_sh` = xyes; then :
5096 eval "with_ldflags='${with_ldflags} $flag'"
5097 fi
5098
5099 done
5100
5101 GCLDFLAGS=$with_ldflags
5102
5103
5104
5105
5106
5107
5108
5109
5110 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
5111 if test -n "$ac_tool_prefix"; then
5112 # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
5113 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
5114 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5115 $as_echo_n "checking for $ac_word... " >&6; }
5116 if ${ac_cv_path_PKG_CONFIG+:} false; then :
5117 $as_echo_n "(cached) " >&6
5118 else
5119 case $PKG_CONFIG in
5120 [\\/]* | ?:[\\/]*)
5121 ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
5122 ;;
5123 *)
5124 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5125 for as_dir in $PATH
5126 do
5127 IFS=$as_save_IFS
5128 test -z "$as_dir" && as_dir=.
5129 for ac_exec_ext in '' $ac_executable_extensions; do
5130 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
5131 ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
5132 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5133 break 2
5134 fi
5135 done
5136 done
5137 IFS=$as_save_IFS
5138
5139 ;;
5140 esac
5141 fi
5142 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
5143 if test -n "$PKG_CONFIG"; then
5144 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
5145 $as_echo "$PKG_CONFIG" >&6; }
5146 else
5147 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5148 $as_echo "no" >&6; }
5149 fi
5150
5151
5152 fi
5153 if test -z "$ac_cv_path_PKG_CONFIG"; then
5154 ac_pt_PKG_CONFIG=$PKG_CONFIG
5155 # Extract the first word of "pkg-config", so it can be a program name with args.
5156 set dummy pkg-config; ac_word=$2
5157 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5158 $as_echo_n "checking for $ac_word... " >&6; }
5159 if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
5160 $as_echo_n "(cached) " >&6
5161 else
5162 case $ac_pt_PKG_CONFIG in
5163 [\\/]* | ?:[\\/]*)
5164 ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
5165 ;;
5166 *)
5167 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5168 for as_dir in $PATH
5169 do
5170 IFS=$as_save_IFS
5171 test -z "$as_dir" && as_dir=.
5172 for ac_exec_ext in '' $ac_executable_extensions; do
5173 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
5174 ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
5175 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5176 break 2
5177 fi
5178 done
5179 done
5180 IFS=$as_save_IFS
5181
5182 ;;
5183 esac
5184 fi
5185 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
5186 if test -n "$ac_pt_PKG_CONFIG"; then
5187 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
5188 $as_echo "$ac_pt_PKG_CONFIG" >&6; }
5189 else
5190 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5191 $as_echo "no" >&6; }
5192 fi
5193
5194 if test "x$ac_pt_PKG_CONFIG" = x; then
5195 PKG_CONFIG=""
5196 else
5197 case $cross_compiling:$ac_tool_warned in
5198 yes:)
5199 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
5200 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
5201 ac_tool_warned=yes ;;
5202 esac
5203 PKG_CONFIG=$ac_pt_PKG_CONFIG
5204 fi
5205 else
5206 PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
5207 fi
5208
5209 fi
5210 if test -n "$PKG_CONFIG"; then
5211 _pkg_min_version=0.9.0
5212 { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
5213 $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
5214 if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
5215 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
5216 $as_echo "yes" >&6; }
5217 else
5218 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5219 $as_echo "no" >&6; }
5220 PKG_CONFIG=""
5221 fi
5222 fi
5223
5224 pkg_failed=no
5225 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBUDEV" >&5
5226 $as_echo_n "checking for LIBUDEV... " >&6; }
5227
5228 if test -n "$LIBUDEV_CFLAGS"; then
5229 pkg_cv_LIBUDEV_CFLAGS="$LIBUDEV_CFLAGS"
5230 elif test -n "$PKG_CONFIG"; then
5231 if test -n "$PKG_CONFIG" && \
5232 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libudev >= 143\""; } >&5
5233 ($PKG_CONFIG --exists --print-errors "libudev >= 143") 2>&5
5234 ac_status=$?
5235 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5236 test $ac_status = 0; }; then
5237 pkg_cv_LIBUDEV_CFLAGS=`$PKG_CONFIG --cflags "libudev >= 143" 2>/dev/null`
5238 else
5239 pkg_failed=yes
5240 fi
5241 else
5242 pkg_failed=untried
5243 fi
5244 if test -n "$LIBUDEV_LIBS"; then
5245 pkg_cv_LIBUDEV_LIBS="$LIBUDEV_LIBS"
5246 elif test -n "$PKG_CONFIG"; then
5247 if test -n "$PKG_CONFIG" && \
5248 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libudev >= 143\""; } >&5
5249 ($PKG_CONFIG --exists --print-errors "libudev >= 143") 2>&5
5250 ac_status=$?
5251 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5252 test $ac_status = 0; }; then
5253 pkg_cv_LIBUDEV_LIBS=`$PKG_CONFIG --libs "libudev >= 143" 2>/dev/null`
5254 else
5255 pkg_failed=yes
5256 fi
5257 else
5258 pkg_failed=untried
5259 fi
5260
5261
5262
5263 if test $pkg_failed = yes; then
5264 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5265 $as_echo "no" >&6; }
5266
5267 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
5268 _pkg_short_errors_supported=yes
5269 else
5270 _pkg_short_errors_supported=no
5271 fi
5272 if test $_pkg_short_errors_supported = yes; then
5273 LIBUDEV_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "libudev >= 143" 2>&1`
5274 else
5275 LIBUDEV_PKG_ERRORS=`$PKG_CONFIG --print-errors "libudev >= 143" 2>&1`
5276 fi
5277 # Put the nasty error message in config.log where it belongs
5278 echo "$LIBUDEV_PKG_ERRORS" >&5
5279
5280 as_fn_error $? "Package requirements (libudev >= 143) were not met:
5281
5282 $LIBUDEV_PKG_ERRORS
5283
5284 Consider adjusting the PKG_CONFIG_PATH environment variable if you
5285 installed software in a non-standard prefix.
5286
5287 Alternatively, you may set the environment variables LIBUDEV_CFLAGS
5288 and LIBUDEV_LIBS to avoid the need to call pkg-config.
5289 See the pkg-config man page for more details." "$LINENO" 5
5290
5291 elif test $pkg_failed = untried; then
5292 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5293 $as_echo "no" >&6; }
5294 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
5295 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
5296 as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it
5297 is in your PATH or set the PKG_CONFIG environment variable to the full
5298 path to pkg-config.
5299
5300 Alternatively, you may set the environment variables LIBUDEV_CFLAGS
5301 and LIBUDEV_LIBS to avoid the need to call pkg-config.
5302 See the pkg-config man page for more details.
5303
5304 To get pkg-config, see <http://pkg-config.freedesktop.org/>.
5305 See \`config.log' for more details" "$LINENO" 5; }
5306
5307 else
5308 LIBUDEV_CFLAGS=$pkg_cv_LIBUDEV_CFLAGS
5309 LIBUDEV_LIBS=$pkg_cv_LIBUDEV_LIBS
5310 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
5311 $as_echo "yes" >&6; }
5312
5313 fi
5314
5315
49305316 case `pwd` in
49315317 *\ * | *\ *)
49325318 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
49355321
49365322
49375323
4938 macro_version='2.4'
4939 macro_revision='1.3293'
5324 macro_version='2.4.2'
5325 macro_revision='1.3337'
49405326
49415327
49425328
56516037 lt_cv_sys_max_cmd_len=196608
56526038 ;;
56536039
6040 os2*)
6041 # The test takes a long time on OS/2.
6042 lt_cv_sys_max_cmd_len=8192
6043 ;;
6044
56546045 osf*)
56556046 # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
56566047 # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
56906081 # If test is not a shell built-in, we'll probably end up computing a
56916082 # maximum length that is only half of the actual maximum length, but
56926083 # we can't tell.
5693 while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \
6084 while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
56946085 = "X$teststring$teststring"; } >/dev/null 2>&1 &&
56956086 test $i != 17 # 1/2 MB should be enough
56966087 do
61196510 lt_cv_deplibs_check_method=pass_all
61206511 ;;
61216512
6122 # This must be Linux ELF.
6513 # This must be glibc/ELF.
61236514 linux* | k*bsd*-gnu | kopensolaris*-gnu)
61246515 lt_cv_deplibs_check_method=pass_all
61256516 ;;
67597150 if test -n "$RANLIB"; then
67607151 case $host_os in
67617152 openbsd*)
6762 old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
7153 old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
67637154 ;;
67647155 *)
6765 old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
7156 old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
67667157 ;;
67677158 esac
6768 old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
7159 old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
67697160 fi
67707161
67717162 case $host_os in
69127303 # which start with @ or ?.
69137304 lt_cv_sys_global_symbol_pipe="$AWK '"\
69147305 " {last_section=section; section=\$ 3};"\
7306 " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
69157307 " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
69167308 " \$ 0!~/External *\|/{next};"\
69177309 " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
73007692 CFLAGS="$SAVE_CFLAGS"
73017693 fi
73027694 ;;
7303 sparc*-*solaris*)
7695 *-*solaris*)
73047696 # Find out which ABI we are using.
73057697 echo 'int i;' > conftest.$ac_ext
73067698 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
73117703 case `/usr/bin/file conftest.o` in
73127704 *64-bit*)
73137705 case $lt_cv_prog_gnu_ld in
7314 yes*) LD="${LD-ld} -m elf64_sparc" ;;
7706 yes*)
7707 case $host in
7708 i?86-*-solaris*)
7709 LD="${LD-ld} -m elf_x86_64"
7710 ;;
7711 sparc*-*-solaris*)
7712 LD="${LD-ld} -m elf64_sparc"
7713 ;;
7714 esac
7715 # GNU ld 2.21 introduced _sol2 emulations. Use them if available.
7716 if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
7717 LD="${LD-ld}_sol2"
7718 fi
7719 ;;
73157720 *)
73167721 if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
73177722 LD="${LD-ld} -64"
79518356 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
79528357 -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
79538358 _lt_result=$?
7954 if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
8359 # If there is a non-empty error log, and "single_module"
8360 # appears in it, assume the flag caused a linker warning
8361 if test -s conftest.err && $GREP single_module conftest.err; then
8362 cat conftest.err >&5
8363 # Otherwise, if the output was created with a 0 exit code from
8364 # the compiler, it worked.
8365 elif test -f libconftest.dylib && test $_lt_result -eq 0; then
79558366 lt_cv_apple_cc_single_mod=yes
79568367 else
79578368 cat conftest.err >&5
79628373 fi
79638374 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5
79648375 $as_echo "$lt_cv_apple_cc_single_mod" >&6; }
8376
79658377 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5
79668378 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; }
79678379 if ${lt_cv_ld_exported_symbols_list+:} false; then :
79948406 fi
79958407 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
79968408 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
8409
79978410 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5
79988411 $as_echo_n "checking for -force_load linker flag... " >&6; }
79998412 if ${lt_cv_ld_force_load+:} false; then :
80158428 echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5
80168429 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
80178430 _lt_result=$?
8018 if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then
8431 if test -s conftest.err && $GREP force_load conftest.err; then
8432 cat conftest.err >&5
8433 elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
80198434 lt_cv_ld_force_load=yes
80208435 else
80218436 cat conftest.err >&5
80798494
80808495
80818496 # Set options
8497 # Check whether --enable-static was given.
8498 if test "${enable_static+set}" = set; then :
8499 enableval=$enable_static; p=${PACKAGE-default}
8500 case $enableval in
8501 yes) enable_static=yes ;;
8502 no) enable_static=no ;;
8503 *)
8504 enable_static=no
8505 # Look at the argument we got. We use all the common list separators.
8506 lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
8507 for pkg in $enableval; do
8508 IFS="$lt_save_ifs"
8509 if test "X$pkg" = "X$p"; then
8510 enable_static=yes
8511 fi
8512 done
8513 IFS="$lt_save_ifs"
8514 ;;
8515 esac
8516 else
8517 enable_static=no
8518 fi
8519
8520
8521
8522
8523
8524
8525
80828526
80838527
80848528
81198563
81208564
81218565
8122 # Check whether --enable-static was given.
8123 if test "${enable_static+set}" = set; then :
8124 enableval=$enable_static; p=${PACKAGE-default}
8125 case $enableval in
8126 yes) enable_static=yes ;;
8127 no) enable_static=no ;;
8566
8567
8568 # Check whether --with-pic was given.
8569 if test "${with_pic+set}" = set; then :
8570 withval=$with_pic; lt_p=${PACKAGE-default}
8571 case $withval in
8572 yes|no) pic_mode=$withval ;;
81288573 *)
8129 enable_static=no
8574 pic_mode=default
81308575 # Look at the argument we got. We use all the common list separators.
81318576 lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
8132 for pkg in $enableval; do
8577 for lt_pkg in $withval; do
81338578 IFS="$lt_save_ifs"
8134 if test "X$pkg" = "X$p"; then
8135 enable_static=yes
8579 if test "X$lt_pkg" = "X$lt_p"; then
8580 pic_mode=yes
81368581 fi
81378582 done
81388583 IFS="$lt_save_ifs"
81398584 ;;
81408585 esac
8141 else
8142 enable_static=yes
8143 fi
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154 # Check whether --with-pic was given.
8155 if test "${with_pic+set}" = set; then :
8156 withval=$with_pic; pic_mode="$withval"
81578586 else
81588587 pic_mode=default
81598588 fi
82058634
82068635 # Always use our own libtool.
82078636 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
8637
8638
8639
8640
82088641
82098642
82108643
86909123 case $cc_basename in
86919124 nvcc*) # Cuda Compiler Driver 2.2
86929125 lt_prog_compiler_wl='-Xlinker '
8693 lt_prog_compiler_pic='-Xcompiler -fPIC'
9126 if test -n "$lt_prog_compiler_pic"; then
9127 lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic"
9128 fi
86949129 ;;
86959130 esac
86969131 else
87819216 ;;
87829217 *)
87839218 case `$CC -V 2>&1 | sed 5q` in
8784 *Sun\ F* | *Sun*Fortran*)
9219 *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*)
87859220 # Sun Fortran 8.3 passes all unrecognized flags to the linker
87869221 lt_prog_compiler_pic='-KPIC'
87879222 lt_prog_compiler_static='-Bstatic'
87889223 lt_prog_compiler_wl=''
9224 ;;
9225 *Sun\ F* | *Sun*Fortran*)
9226 lt_prog_compiler_pic='-KPIC'
9227 lt_prog_compiler_static='-Bstatic'
9228 lt_prog_compiler_wl='-Qoption ld '
87899229 ;;
87909230 *Sun\ C*)
87919231 # Sun C 5.9
87929232 lt_prog_compiler_pic='-KPIC'
87939233 lt_prog_compiler_static='-Bstatic'
87949234 lt_prog_compiler_wl='-Wl,'
9235 ;;
9236 *Intel*\ [CF]*Compiler*)
9237 lt_prog_compiler_wl='-Wl,'
9238 lt_prog_compiler_pic='-fPIC'
9239 lt_prog_compiler_static='-static'
9240 ;;
9241 *Portland\ Group*)
9242 lt_prog_compiler_wl='-Wl,'
9243 lt_prog_compiler_pic='-fpic'
9244 lt_prog_compiler_static='-Bstatic'
87959245 ;;
87969246 esac
87979247 ;;
91549604 hardcode_direct=no
91559605 hardcode_direct_absolute=no
91569606 hardcode_libdir_flag_spec=
9157 hardcode_libdir_flag_spec_ld=
91589607 hardcode_libdir_separator=
91599608 hardcode_minus_L=no
91609609 hardcode_shlibpath_var=unsupported
94049853 xlf* | bgf* | bgxlf* | mpixlf*)
94059854 # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
94069855 whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
9407 hardcode_libdir_flag_spec=
9408 hardcode_libdir_flag_spec_ld='-rpath $libdir'
9856 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
94099857 archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
94109858 if test "x$supports_anon_versioning" = xyes; then
94119859 archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
978410232 # The linker will not automatically build a static lib if we build a DLL.
978510233 # _LT_TAGVAR(old_archive_from_new_cmds, )='true'
978610234 enable_shared_with_static_runtimes=yes
10235 exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
978710236 export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
978810237 # Don't use ranlib
978910238 old_postinstall_cmds='chmod 644 $oldlib'
982910278 hardcode_shlibpath_var=unsupported
983010279 if test "$lt_cv_ld_force_load" = "yes"; then
983110280 whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
10281
983210282 else
983310283 whole_archive_flag_spec=''
983410284 fi
985710307 hardcode_shlibpath_var=no
985810308 ;;
985910309
9860 freebsd1*)
9861 ld_shlibs=no
9862 ;;
9863
986410310 # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
986510311 # support. Future versions do this automatically, but an explicit c++rt0.o
986610312 # does not break anything, and helps significantly (at the cost of a little
987310319 ;;
987410320
987510321 # Unfortunately, older versions of FreeBSD 2 do not have this feature.
9876 freebsd2*)
10322 freebsd2.*)
987710323 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
987810324 hardcode_direct=yes
987910325 hardcode_minus_L=yes
991210358 fi
991310359 if test "$with_gnu_ld" = no; then
991410360 hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
9915 hardcode_libdir_flag_spec_ld='+b $libdir'
991610361 hardcode_libdir_separator=:
991710362 hardcode_direct=yes
991810363 hardcode_direct_absolute=yes
1038410829 fi
1038510830 ;;
1038610831 esac
10387
10388
10389
10390
10391
1039210832
1039310833
1039410834
1063011070
1063111071 case $host_os in
1063211072 aix3*)
10633 version_type=linux
11073 version_type=linux # correct to gnu/linux during the next big refactor
1063411074 library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
1063511075 shlibpath_var=LIBPATH
1063611076
1063911079 ;;
1064011080
1064111081 aix[4-9]*)
10642 version_type=linux
11082 version_type=linux # correct to gnu/linux during the next big refactor
1064311083 need_lib_prefix=no
1064411084 need_version=no
1064511085 hardcode_into_libs=yes
1070411144 ;;
1070511145
1070611146 bsdi[45]*)
10707 version_type=linux
11147 version_type=linux # correct to gnu/linux during the next big refactor
1070811148 need_version=no
1070911149 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
1071011150 soname_spec='${libname}${release}${shared_ext}$major'
1084311283 ;;
1084411284
1084511285 dgux*)
10846 version_type=linux
11286 version_type=linux # correct to gnu/linux during the next big refactor
1084711287 need_lib_prefix=no
1084811288 need_version=no
1084911289 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
1085011290 soname_spec='${libname}${release}${shared_ext}$major'
1085111291 shlibpath_var=LD_LIBRARY_PATH
10852 ;;
10853
10854 freebsd1*)
10855 dynamic_linker=no
1085611292 ;;
1085711293
1085811294 freebsd* | dragonfly*)
1086211298 objformat=`/usr/bin/objformat`
1086311299 else
1086411300 case $host_os in
10865 freebsd[123]*) objformat=aout ;;
11301 freebsd[23].*) objformat=aout ;;
1086611302 *) objformat=elf ;;
1086711303 esac
1086811304 fi
1088011316 esac
1088111317 shlibpath_var=LD_LIBRARY_PATH
1088211318 case $host_os in
10883 freebsd2*)
11319 freebsd2.*)
1088411320 shlibpath_overrides_runpath=yes
1088511321 ;;
1088611322 freebsd3.[01]* | freebsdelf3.[01]*)
1090011336 ;;
1090111337
1090211338 gnu*)
10903 version_type=linux
11339 version_type=linux # correct to gnu/linux during the next big refactor
1090411340 need_lib_prefix=no
1090511341 need_version=no
1090611342 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
1090711343 soname_spec='${libname}${release}${shared_ext}$major'
1090811344 shlibpath_var=LD_LIBRARY_PATH
11345 shlibpath_overrides_runpath=no
1090911346 hardcode_into_libs=yes
1091011347 ;;
1091111348
1091211349 haiku*)
10913 version_type=linux
11350 version_type=linux # correct to gnu/linux during the next big refactor
1091411351 need_lib_prefix=no
1091511352 need_version=no
1091611353 dynamic_linker="$host_os runtime_loader"
1097111408 ;;
1097211409
1097311410 interix[3-9]*)
10974 version_type=linux
11411 version_type=linux # correct to gnu/linux during the next big refactor
1097511412 need_lib_prefix=no
1097611413 need_version=no
1097711414 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
1098711424 nonstopux*) version_type=nonstopux ;;
1098811425 *)
1098911426 if test "$lt_cv_prog_gnu_ld" = yes; then
10990 version_type=linux
11427 version_type=linux # correct to gnu/linux during the next big refactor
1099111428 else
1099211429 version_type=irix
1099311430 fi ;;
1102411461 dynamic_linker=no
1102511462 ;;
1102611463
11027 # This must be Linux ELF.
11464 # This must be glibc/ELF.
1102811465 linux* | k*bsd*-gnu | kopensolaris*-gnu)
11029 version_type=linux
11466 version_type=linux # correct to gnu/linux during the next big refactor
1103011467 need_lib_prefix=no
1103111468 need_version=no
1103211469 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
1111211549 ;;
1111311550
1111411551 newsos6)
11115 version_type=linux
11552 version_type=linux # correct to gnu/linux during the next big refactor
1111611553 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
1111711554 shlibpath_var=LD_LIBRARY_PATH
1111811555 shlibpath_overrides_runpath=yes
1118111618 ;;
1118211619
1118311620 solaris*)
11184 version_type=linux
11621 version_type=linux # correct to gnu/linux during the next big refactor
1118511622 need_lib_prefix=no
1118611623 need_version=no
1118711624 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
1120611643 ;;
1120711644
1120811645 sysv4 | sysv4.3*)
11209 version_type=linux
11646 version_type=linux # correct to gnu/linux during the next big refactor
1121011647 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
1121111648 soname_spec='${libname}${release}${shared_ext}$major'
1121211649 shlibpath_var=LD_LIBRARY_PATH
1123011667
1123111668 sysv4*MP*)
1123211669 if test -d /usr/nec ;then
11233 version_type=linux
11670 version_type=linux # correct to gnu/linux during the next big refactor
1123411671 library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
1123511672 soname_spec='$libname${shared_ext}.$major'
1123611673 shlibpath_var=LD_LIBRARY_PATH
1126111698
1126211699 tpf*)
1126311700 # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
11264 version_type=linux
11701 version_type=linux # correct to gnu/linux during the next big refactor
1126511702 need_lib_prefix=no
1126611703 need_version=no
1126711704 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
1127111708 ;;
1127211709
1127311710 uts4*)
11274 version_type=linux
11711 version_type=linux # correct to gnu/linux during the next big refactor
1127511712 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
1127611713 soname_spec='${libname}${release}${shared_ext}$major'
1127711714 shlibpath_var=LD_LIBRARY_PATH
1205312490
1205412491
1205512492
12493
12494
1205612495 ac_config_commands="$ac_config_commands libtool"
1205712496
1205812497
1206112500 # Only expand once:
1206212501
1206312502
12064
12065
12066 for flag in -Wall -W -Wextra -pedantic -pipe -Wformat -Wold-style-definition -Wdeclaration-after-statement -Wfloat-equal -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wendif-labels -Wpointer-arith -Wcast-align -Wwrite-strings -Winline -Wno-unused-parameter -ffast-math; do
12067
12068 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports $flag flag" >&5
12069 $as_echo_n "checking if $CC supports $flag flag... " >&6; }
12070 if { as_var=`$as_echo "cc_cv_cflags_$flag" | $as_tr_sh`; eval \${$as_var+:} false; }; then :
12071 $as_echo_n "(cached) " >&6
12072 else
12073
12074 if { as_var=`$as_echo "cc_cv_cflags_$flag" | $as_tr_sh`; eval \${$as_var+:} false; }; then :
12075 $as_echo_n "(cached) " >&6
12076 else
12077 ac_save_CFLAGS="$CFLAGS"
12078 CFLAGS="$CFLAGS $flag"
12079 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12080 /* end confdefs.h. */
12081 int main() { return 0; }
12082 _ACEOF
12083 if ac_fn_c_try_link "$LINENO"; then :
12084 eval "`$as_echo "cc_cv_cflags_$flag" | $as_tr_sh`='yes'"
12085 else
12086 eval "`$as_echo "cc_cv_cflags_$flag" | $as_tr_sh`='no'"
12087 fi
12088 rm -f core conftest.err conftest.$ac_objext \
12089 conftest$ac_exeext conftest.$ac_ext
12090 CFLAGS="$ac_save_CFLAGS"
12091
12092 fi
12093
12094
12095 if eval test x$`$as_echo "cc_cv_cflags_$flag" | $as_tr_sh` = xyes; then :
12096
12097 fi
12098
12099 fi
12100 eval ac_res=\$`$as_echo "cc_cv_cflags_$flag" | $as_tr_sh`
12101 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
12102 $as_echo "$ac_res" >&6; }
12103
12104 if eval test x$`$as_echo "cc_cv_cflags_$flag" | $as_tr_sh` = xyes; then :
12105 CFLAGS="$CFLAGS $flag";
12106 fi
12107
12108 done
12109
12110
12111
12112
12113
12114
12115
12116
12117 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
12118 if test -n "$ac_tool_prefix"; then
12119 # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
12120 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
12121 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
12122 $as_echo_n "checking for $ac_word... " >&6; }
12123 if ${ac_cv_path_PKG_CONFIG+:} false; then :
12124 $as_echo_n "(cached) " >&6
12125 else
12126 case $PKG_CONFIG in
12127 [\\/]* | ?:[\\/]*)
12128 ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
12129 ;;
12130 *)
12131 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
12132 for as_dir in $PATH
12133 do
12134 IFS=$as_save_IFS
12135 test -z "$as_dir" && as_dir=.
12136 for ac_exec_ext in '' $ac_executable_extensions; do
12137 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
12138 ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
12139 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
12140 break 2
12141 fi
12142 done
12143 done
12144 IFS=$as_save_IFS
12145
12146 ;;
12147 esac
12148 fi
12149 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
12150 if test -n "$PKG_CONFIG"; then
12151 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
12152 $as_echo "$PKG_CONFIG" >&6; }
12153 else
12154 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
12155 $as_echo "no" >&6; }
12156 fi
12157
12158
12159 fi
12160 if test -z "$ac_cv_path_PKG_CONFIG"; then
12161 ac_pt_PKG_CONFIG=$PKG_CONFIG
12162 # Extract the first word of "pkg-config", so it can be a program name with args.
12163 set dummy pkg-config; ac_word=$2
12164 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
12165 $as_echo_n "checking for $ac_word... " >&6; }
12166 if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
12167 $as_echo_n "(cached) " >&6
12168 else
12169 case $ac_pt_PKG_CONFIG in
12170 [\\/]* | ?:[\\/]*)
12171 ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
12172 ;;
12173 *)
12174 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
12175 for as_dir in $PATH
12176 do
12177 IFS=$as_save_IFS
12178 test -z "$as_dir" && as_dir=.
12179 for ac_exec_ext in '' $ac_executable_extensions; do
12180 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
12181 ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
12182 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
12183 break 2
12184 fi
12185 done
12186 done
12187 IFS=$as_save_IFS
12188
12189 ;;
12190 esac
12191 fi
12192 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
12193 if test -n "$ac_pt_PKG_CONFIG"; then
12194 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
12195 $as_echo "$ac_pt_PKG_CONFIG" >&6; }
12196 else
12197 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
12198 $as_echo "no" >&6; }
12199 fi
12200
12201 if test "x$ac_pt_PKG_CONFIG" = x; then
12202 PKG_CONFIG=""
12203 else
12204 case $cross_compiling:$ac_tool_warned in
12205 yes:)
12206 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
12207 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
12208 ac_tool_warned=yes ;;
12209 esac
12210 PKG_CONFIG=$ac_pt_PKG_CONFIG
12211 fi
12212 else
12213 PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
12214 fi
12215
12216 fi
12217 if test -n "$PKG_CONFIG"; then
12218 _pkg_min_version=0.9.0
12219 { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
12220 $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
12221 if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
12222 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
12223 $as_echo "yes" >&6; }
12224 else
12225 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
12226 $as_echo "no" >&6; }
12227 PKG_CONFIG=""
12228 fi
12229 fi
12230
12231 pkg_failed=no
12232 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBUDEV" >&5
12233 $as_echo_n "checking for LIBUDEV... " >&6; }
12234
12235 if test -n "$LIBUDEV_CFLAGS"; then
12236 pkg_cv_LIBUDEV_CFLAGS="$LIBUDEV_CFLAGS"
12237 elif test -n "$PKG_CONFIG"; then
12238 if test -n "$PKG_CONFIG" && \
12239 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libudev >= 143\""; } >&5
12240 ($PKG_CONFIG --exists --print-errors "libudev >= 143") 2>&5
12241 ac_status=$?
12242 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
12243 test $ac_status = 0; }; then
12244 pkg_cv_LIBUDEV_CFLAGS=`$PKG_CONFIG --cflags "libudev >= 143" 2>/dev/null`
12245 else
12246 pkg_failed=yes
12247 fi
12248 else
12249 pkg_failed=untried
12250 fi
12251 if test -n "$LIBUDEV_LIBS"; then
12252 pkg_cv_LIBUDEV_LIBS="$LIBUDEV_LIBS"
12253 elif test -n "$PKG_CONFIG"; then
12254 if test -n "$PKG_CONFIG" && \
12255 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libudev >= 143\""; } >&5
12256 ($PKG_CONFIG --exists --print-errors "libudev >= 143") 2>&5
12257 ac_status=$?
12258 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
12259 test $ac_status = 0; }; then
12260 pkg_cv_LIBUDEV_LIBS=`$PKG_CONFIG --libs "libudev >= 143" 2>/dev/null`
12261 else
12262 pkg_failed=yes
12263 fi
12264 else
12265 pkg_failed=untried
12266 fi
12267
12268
12269
12270 if test $pkg_failed = yes; then
12271 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
12272 $as_echo "no" >&6; }
12273
12274 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
12275 _pkg_short_errors_supported=yes
12276 else
12277 _pkg_short_errors_supported=no
12278 fi
12279 if test $_pkg_short_errors_supported = yes; then
12280 LIBUDEV_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "libudev >= 143" 2>&1`
12281 else
12282 LIBUDEV_PKG_ERRORS=`$PKG_CONFIG --print-errors "libudev >= 143" 2>&1`
12283 fi
12284 # Put the nasty error message in config.log where it belongs
12285 echo "$LIBUDEV_PKG_ERRORS" >&5
12286
12287 as_fn_error $? "Package requirements (libudev >= 143) were not met:
12288
12289 $LIBUDEV_PKG_ERRORS
12290
12291 Consider adjusting the PKG_CONFIG_PATH environment variable if you
12292 installed software in a non-standard prefix.
12293
12294 Alternatively, you may set the environment variables LIBUDEV_CFLAGS
12295 and LIBUDEV_LIBS to avoid the need to call pkg-config.
12296 See the pkg-config man page for more details." "$LINENO" 5
12297
12298 elif test $pkg_failed = untried; then
12299 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
12300 $as_echo "no" >&6; }
12301 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
12302 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
12303 as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it
12304 is in your PATH or set the PKG_CONFIG environment variable to the full
12305 path to pkg-config.
12306
12307 Alternatively, you may set the environment variables LIBUDEV_CFLAGS
12308 and LIBUDEV_LIBS to avoid the need to call pkg-config.
12309 See the pkg-config man page for more details.
12310
12311 To get pkg-config, see <http://pkg-config.freedesktop.org/>.
12312 See \`config.log' for more details" "$LINENO" 5; }
12313
12314 else
12315 LIBUDEV_CFLAGS=$pkg_cv_LIBUDEV_CFLAGS
12316 LIBUDEV_LIBS=$pkg_cv_LIBUDEV_LIBS
12317 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
12318 $as_echo "yes" >&6; }
12319
12320 fi
1232112503
1232212504
1232312505 ac_config_files="$ac_config_files Makefile strpool/Makefile libatasmart.pc"
1285613038 # report actual input values of CONFIG_FILES etc. instead of their
1285713039 # values after options handling.
1285813040 ac_log="
12859 This file was extended by libatasmart $as_me 0.18, which was
13041 This file was extended by libatasmart $as_me 0.19, which was
1286013042 generated by GNU Autoconf 2.68. Invocation command line was
1286113043
1286213044 CONFIG_FILES = $CONFIG_FILES
1291613098 Configuration commands:
1291713099 $config_commands
1291813100
12919 Report bugs to <mzyvongnfzneg (at) 0pointer (dot) net>."
13101 Report bugs to <mzyvongnfzneg (at) 0pointer (dot) net>.
13102 libatasmart home page: <http://git.0pointer.de/?p=libatasmart.git>."
1292013103
1292113104 _ACEOF
1292213105 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
1292313106 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
1292413107 ac_cs_version="\\
12925 libatasmart config.status 0.18
13108 libatasmart config.status 0.19
1292613109 configured by $0, generated by GNU Autoconf 2.68,
1292713110 with options \\"\$ac_cs_config\\"
1292813111
1305313236 delay_variable_subst='$delay_variable_subst'
1305413237 macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`'
1305513238 macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`'
13239 enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`'
1305613240 enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`'
13057 enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`'
1305813241 pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`'
1305913242 enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`'
1306013243 SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`'
1306113244 ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`'
13245 PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`'
1306213246 host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`'
1306313247 host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`'
1306413248 host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`'
1314113325 allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`'
1314213326 no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`'
1314313327 hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`'
13144 hardcode_libdir_flag_spec_ld='`$ECHO "$hardcode_libdir_flag_spec_ld" | $SED "$delay_single_quote_subst"`'
1314513328 hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`'
1314613329 hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`'
1314713330 hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`'
1319713380 # Quote evaled strings.
1319813381 for var in SHELL \
1319913382 ECHO \
13383 PATH_SEPARATOR \
1320013384 SED \
1320113385 GREP \
1320213386 EGREP \
1324713431 allow_undefined_flag \
1324813432 no_undefined_flag \
1324913433 hardcode_libdir_flag_spec \
13250 hardcode_libdir_flag_spec_ld \
1325113434 hardcode_libdir_separator \
1325213435 exclude_expsyms \
1325313436 include_expsyms \
1404514228 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
1404614229 #
1404714230 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
14048 # 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
14049 # Inc.
14231 # 2006, 2007, 2008, 2009, 2010, 2011 Free Software
14232 # Foundation, Inc.
1405014233 # Written by Gordon Matzigkeit, 1996
1405114234 #
1405214235 # This file is part of GNU Libtool.
1408214265 macro_version=$macro_version
1408314266 macro_revision=$macro_revision
1408414267
14268 # Whether or not to build static libraries.
14269 build_old_libs=$enable_static
14270
1408514271 # Whether or not to build shared libraries.
1408614272 build_libtool_libs=$enable_shared
1408714273
14088 # Whether or not to build static libraries.
14089 build_old_libs=$enable_static
14090
1409114274 # What type of objects to build.
1409214275 pic_mode=$pic_mode
1409314276
1409914282
1410014283 # An echo program that protects backslashes.
1410114284 ECHO=$lt_ECHO
14285
14286 # The PATH separator for the build system.
14287 PATH_SEPARATOR=$lt_PATH_SEPARATOR
1410214288
1410314289 # The host system.
1410414290 host_alias=$host_alias
1440014586 # Flag to hardcode \$libdir into a binary during linking.
1440114587 # This must work even if \$libdir does not exist
1440214588 hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
14403
14404 # If ld is used when linking, flag to hardcode \$libdir into a binary
14405 # during linking. This must work even if \$libdir does not exist.
14406 hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld
1440714589
1440814590 # Whether we need a single "-rpath" flag with a separated argument.
1440914591 hardcode_libdir_separator=$lt_hardcode_libdir_separator
0 dnl -*- Autoconf -*-
1 dnl Process this file with autoconf to produce a configure script.
0 # -*- Autoconf -*-
1 # Process this file with autoconf to produce a configure script.
22
3 dnl This file is part of libatasmart.
4 dnl
5 dnl Copyright 2008 Lennart Poettering
6 dnl
7 dnl libatasmart is free software; you can redistribute it and/or modify
8 dnl it under the terms of the GNU Lesser General Public License as
9 dnl published by the Free Software Foundation, either version 2.1 of the
10 dnl License, or (at your option) any later version.
11 dnl
12 dnl libatasmart is distributed in the hope that it will be useful, but
13 dnl WITHOUT ANY WARRANTY; without even the implied warranty of
14 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 dnl Lesser General Public License for more details.
16 dnl
17 dnl You should have received a copy of the GNU Lesser General Public
18 dnl License along with libatasmart. If not, If not, see
19 dnl <http://www.gnu.org/licenses/>.
3 # This file is part of libatasmart.
4 #
5 # Copyright 2008 Lennart Poettering
6 #
7 # libatasmart is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU Lesser General Public License as
9 # published by the Free Software Foundation, either version 2.1 of the
10 # License, or (at your option) any later version.
11 #
12 # libatasmart is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # Lesser General Public License for more details.
16 #
17 # You should have received a copy of the GNU Lesser General Public
18 # License along with libatasmart. If not, If not, see
19 # <http://www.gnu.org/licenses/>.
2020
21 AC_PREREQ(2.63)
21 AC_PREREQ(2.68)
2222
23 AC_INIT([libatasmart], 0.18, [mzyvongnfzneg (at) 0pointer (dot) net])
23 AC_INIT([libatasmart],
24 [0.19],
25 [mzyvongnfzneg (at) 0pointer (dot) net],
26 [libatasmart],
27 [http://git.0pointer.de/?p=libatasmart.git])
28
2429 AC_CONFIG_SRCDIR([atasmart.c])
2530 AC_CONFIG_HEADERS([config.h])
2631 AC_CONFIG_MACRO_DIR(m4)
32 AC_CONFIG_AUX_DIR([build-aux])
2733
28 AM_INIT_AUTOMAKE([foreign 1.11 -Wall -Wno-portability silent-rules tar-pax])
29
30 AC_SUBST(PACKAGE_URL, [http://git.0pointer.de/?p=libatasmart.git])
31
32 AC_SUBST(LIBATASMART_VERSION_INFO, [4:4:0])
33
34 AM_INIT_AUTOMAKE([foreign 1.11 -Wall -Wno-portability silent-rules tar-pax no-dist-gzip dist-xz])
3435 AM_SILENT_RULES([yes])
3536
37 AC_SUBST(LIBATASMART_VERSION_INFO, [4:5:0])
38
3639 if type -p stow > /dev/null && test -d /usr/local/stow ; then
37 AC_MSG_NOTICE([*** Found /usr/local/stow: default install prefix set to /usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION} ***])
38 ac_default_prefix="/usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION}"
40 AC_MSG_NOTICE([*** Found /usr/local/stow: default install prefix set to /usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION} ***])
41 ac_default_prefix="/usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION}"
3942 fi
4043
4144 AC_PROG_CC
4750 AC_USE_SYSTEM_EXTENSIONS
4851 AC_SYS_LARGEFILE
4952
50 AC_PROG_LIBTOOL
53 CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
54 -pipe \
55 -Wall \
56 -W \
57 -Wextra \
58 -Winline \
59 -Wvla \
60 -Wundef \
61 -Wformat=2 \
62 -Wlogical-op \
63 -Wsign-compare \
64 -Wformat-security \
65 -Wmissing-include-dirs \
66 -Wformat-nonliteral \
67 -Wold-style-definition \
68 -Wpointer-arith \
69 -Winit-self \
70 -Wdeclaration-after-statement \
71 -Wfloat-equal \
72 -Wmissing-prototypes \
73 -Wstrict-prototypes \
74 -Wredundant-decls \
75 -Wmissing-declarations \
76 -Wmissing-noreturn \
77 -Wshadow \
78 -Wendif-labels \
79 -Wcast-align \
80 -Wstrict-aliasing=2 \
81 -Wwrite-strings \
82 -Wno-long-long \
83 -Wno-overlength-strings \
84 -Wno-unused-parameter \
85 -Wno-missing-field-initializers \
86 -Wno-unused-result \
87 -Wunsafe-loop-optimizations \
88 -Wpacked \
89 -Werror=overflow \
90 -Wp,-D_FORTIFY_SOURCE=2 \
91 -ffast-math \
92 -fno-common \
93 -fdiagnostics-show-option \
94 -fno-strict-aliasing \
95 -ffunction-sections \
96 -fdata-sections])
97 AC_SUBST([WARNINGFLAGS], $with_cflags)
5198
52 dnl Check compiler flags
53 CC_CHECK_CFLAGS_APPEND([-Wall -W -Wextra -pedantic -pipe -Wformat -Wold-style-definition -Wdeclaration-after-statement -Wfloat-equal -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wendif-labels -Wpointer-arith -Wcast-align -Wwrite-strings -Winline -Wno-unused-parameter -ffast-math])
99 CC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [\
100 -Wl,--as-needed \
101 -Wl,--gc-sections])
102 AC_SUBST([GCLDFLAGS], $with_ldflags)
54103
104 PKG_PROG_PKG_CONFIG
55105 PKG_CHECK_MODULES([LIBUDEV], [libudev >= 143])
106
107 LT_PREREQ(2.2)
108 LT_INIT([disable-static])
56109
57110 dnl###################################
58111 dnl# Output #
+0
-630
depcomp less more
0 #! /bin/sh
1 # depcomp - compile a program generating dependencies as side-effects
2
3 scriptversion=2009-04-28.21; # UTC
4
5 # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free
6 # Software Foundation, Inc.
7
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2, or (at your option)
11 # any later version.
12
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
17
18 # You should have received a copy of the GNU General Public License
19 # along with this program. If not, see <http://www.gnu.org/licenses/>.
20
21 # As a special exception to the GNU General Public License, if you
22 # distribute this file as part of a program that contains a
23 # configuration script generated by Autoconf, you may include it under
24 # the same distribution terms that you use for the rest of that program.
25
26 # Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
27
28 case $1 in
29 '')
30 echo "$0: No command. Try \`$0 --help' for more information." 1>&2
31 exit 1;
32 ;;
33 -h | --h*)
34 cat <<\EOF
35 Usage: depcomp [--help] [--version] PROGRAM [ARGS]
36
37 Run PROGRAMS ARGS to compile a file, generating dependencies
38 as side-effects.
39
40 Environment variables:
41 depmode Dependency tracking mode.
42 source Source file read by `PROGRAMS ARGS'.
43 object Object file output by `PROGRAMS ARGS'.
44 DEPDIR directory where to store dependencies.
45 depfile Dependency file to output.
46 tmpdepfile Temporary file to use when outputing dependencies.
47 libtool Whether libtool is used (yes/no).
48
49 Report bugs to <bug-automake@gnu.org>.
50 EOF
51 exit $?
52 ;;
53 -v | --v*)
54 echo "depcomp $scriptversion"
55 exit $?
56 ;;
57 esac
58
59 if test -z "$depmode" || test -z "$source" || test -z "$object"; then
60 echo "depcomp: Variables source, object and depmode must be set" 1>&2
61 exit 1
62 fi
63
64 # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
65 depfile=${depfile-`echo "$object" |
66 sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
67 tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
68
69 rm -f "$tmpdepfile"
70
71 # Some modes work just like other modes, but use different flags. We
72 # parameterize here, but still list the modes in the big case below,
73 # to make depend.m4 easier to write. Note that we *cannot* use a case
74 # here, because this file can only contain one case statement.
75 if test "$depmode" = hp; then
76 # HP compiler uses -M and no extra arg.
77 gccflag=-M
78 depmode=gcc
79 fi
80
81 if test "$depmode" = dashXmstdout; then
82 # This is just like dashmstdout with a different argument.
83 dashmflag=-xM
84 depmode=dashmstdout
85 fi
86
87 cygpath_u="cygpath -u -f -"
88 if test "$depmode" = msvcmsys; then
89 # This is just like msvisualcpp but w/o cygpath translation.
90 # Just convert the backslash-escaped backslashes to single forward
91 # slashes to satisfy depend.m4
92 cygpath_u="sed s,\\\\\\\\,/,g"
93 depmode=msvisualcpp
94 fi
95
96 case "$depmode" in
97 gcc3)
98 ## gcc 3 implements dependency tracking that does exactly what
99 ## we want. Yay! Note: for some reason libtool 1.4 doesn't like
100 ## it if -MD -MP comes after the -MF stuff. Hmm.
101 ## Unfortunately, FreeBSD c89 acceptance of flags depends upon
102 ## the command line argument order; so add the flags where they
103 ## appear in depend2.am. Note that the slowdown incurred here
104 ## affects only configure: in makefiles, %FASTDEP% shortcuts this.
105 for arg
106 do
107 case $arg in
108 -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
109 *) set fnord "$@" "$arg" ;;
110 esac
111 shift # fnord
112 shift # $arg
113 done
114 "$@"
115 stat=$?
116 if test $stat -eq 0; then :
117 else
118 rm -f "$tmpdepfile"
119 exit $stat
120 fi
121 mv "$tmpdepfile" "$depfile"
122 ;;
123
124 gcc)
125 ## There are various ways to get dependency output from gcc. Here's
126 ## why we pick this rather obscure method:
127 ## - Don't want to use -MD because we'd like the dependencies to end
128 ## up in a subdir. Having to rename by hand is ugly.
129 ## (We might end up doing this anyway to support other compilers.)
130 ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
131 ## -MM, not -M (despite what the docs say).
132 ## - Using -M directly means running the compiler twice (even worse
133 ## than renaming).
134 if test -z "$gccflag"; then
135 gccflag=-MD,
136 fi
137 "$@" -Wp,"$gccflag$tmpdepfile"
138 stat=$?
139 if test $stat -eq 0; then :
140 else
141 rm -f "$tmpdepfile"
142 exit $stat
143 fi
144 rm -f "$depfile"
145 echo "$object : \\" > "$depfile"
146 alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
147 ## The second -e expression handles DOS-style file names with drive letters.
148 sed -e 's/^[^:]*: / /' \
149 -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
150 ## This next piece of magic avoids the `deleted header file' problem.
151 ## The problem is that when a header file which appears in a .P file
152 ## is deleted, the dependency causes make to die (because there is
153 ## typically no way to rebuild the header). We avoid this by adding
154 ## dummy dependencies for each header file. Too bad gcc doesn't do
155 ## this for us directly.
156 tr ' ' '
157 ' < "$tmpdepfile" |
158 ## Some versions of gcc put a space before the `:'. On the theory
159 ## that the space means something, we add a space to the output as
160 ## well.
161 ## Some versions of the HPUX 10.20 sed can't process this invocation
162 ## correctly. Breaking it into two sed invocations is a workaround.
163 sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
164 rm -f "$tmpdepfile"
165 ;;
166
167 hp)
168 # This case exists only to let depend.m4 do its work. It works by
169 # looking at the text of this script. This case will never be run,
170 # since it is checked for above.
171 exit 1
172 ;;
173
174 sgi)
175 if test "$libtool" = yes; then
176 "$@" "-Wp,-MDupdate,$tmpdepfile"
177 else
178 "$@" -MDupdate "$tmpdepfile"
179 fi
180 stat=$?
181 if test $stat -eq 0; then :
182 else
183 rm -f "$tmpdepfile"
184 exit $stat
185 fi
186 rm -f "$depfile"
187
188 if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
189 echo "$object : \\" > "$depfile"
190
191 # Clip off the initial element (the dependent). Don't try to be
192 # clever and replace this with sed code, as IRIX sed won't handle
193 # lines with more than a fixed number of characters (4096 in
194 # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
195 # the IRIX cc adds comments like `#:fec' to the end of the
196 # dependency line.
197 tr ' ' '
198 ' < "$tmpdepfile" \
199 | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
200 tr '
201 ' ' ' >> "$depfile"
202 echo >> "$depfile"
203
204 # The second pass generates a dummy entry for each header file.
205 tr ' ' '
206 ' < "$tmpdepfile" \
207 | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
208 >> "$depfile"
209 else
210 # The sourcefile does not contain any dependencies, so just
211 # store a dummy comment line, to avoid errors with the Makefile
212 # "include basename.Plo" scheme.
213 echo "#dummy" > "$depfile"
214 fi
215 rm -f "$tmpdepfile"
216 ;;
217
218 aix)
219 # The C for AIX Compiler uses -M and outputs the dependencies
220 # in a .u file. In older versions, this file always lives in the
221 # current directory. Also, the AIX compiler puts `$object:' at the
222 # start of each line; $object doesn't have directory information.
223 # Version 6 uses the directory in both cases.
224 dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
225 test "x$dir" = "x$object" && dir=
226 base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
227 if test "$libtool" = yes; then
228 tmpdepfile1=$dir$base.u
229 tmpdepfile2=$base.u
230 tmpdepfile3=$dir.libs/$base.u
231 "$@" -Wc,-M
232 else
233 tmpdepfile1=$dir$base.u
234 tmpdepfile2=$dir$base.u
235 tmpdepfile3=$dir$base.u
236 "$@" -M
237 fi
238 stat=$?
239
240 if test $stat -eq 0; then :
241 else
242 rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
243 exit $stat
244 fi
245
246 for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
247 do
248 test -f "$tmpdepfile" && break
249 done
250 if test -f "$tmpdepfile"; then
251 # Each line is of the form `foo.o: dependent.h'.
252 # Do two passes, one to just change these to
253 # `$object: dependent.h' and one to simply `dependent.h:'.
254 sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
255 # That's a tab and a space in the [].
256 sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
257 else
258 # The sourcefile does not contain any dependencies, so just
259 # store a dummy comment line, to avoid errors with the Makefile
260 # "include basename.Plo" scheme.
261 echo "#dummy" > "$depfile"
262 fi
263 rm -f "$tmpdepfile"
264 ;;
265
266 icc)
267 # Intel's C compiler understands `-MD -MF file'. However on
268 # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
269 # ICC 7.0 will fill foo.d with something like
270 # foo.o: sub/foo.c
271 # foo.o: sub/foo.h
272 # which is wrong. We want:
273 # sub/foo.o: sub/foo.c
274 # sub/foo.o: sub/foo.h
275 # sub/foo.c:
276 # sub/foo.h:
277 # ICC 7.1 will output
278 # foo.o: sub/foo.c sub/foo.h
279 # and will wrap long lines using \ :
280 # foo.o: sub/foo.c ... \
281 # sub/foo.h ... \
282 # ...
283
284 "$@" -MD -MF "$tmpdepfile"
285 stat=$?
286 if test $stat -eq 0; then :
287 else
288 rm -f "$tmpdepfile"
289 exit $stat
290 fi
291 rm -f "$depfile"
292 # Each line is of the form `foo.o: dependent.h',
293 # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
294 # Do two passes, one to just change these to
295 # `$object: dependent.h' and one to simply `dependent.h:'.
296 sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
297 # Some versions of the HPUX 10.20 sed can't process this invocation
298 # correctly. Breaking it into two sed invocations is a workaround.
299 sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
300 sed -e 's/$/ :/' >> "$depfile"
301 rm -f "$tmpdepfile"
302 ;;
303
304 hp2)
305 # The "hp" stanza above does not work with aCC (C++) and HP's ia64
306 # compilers, which have integrated preprocessors. The correct option
307 # to use with these is +Maked; it writes dependencies to a file named
308 # 'foo.d', which lands next to the object file, wherever that
309 # happens to be.
310 # Much of this is similar to the tru64 case; see comments there.
311 dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
312 test "x$dir" = "x$object" && dir=
313 base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
314 if test "$libtool" = yes; then
315 tmpdepfile1=$dir$base.d
316 tmpdepfile2=$dir.libs/$base.d
317 "$@" -Wc,+Maked
318 else
319 tmpdepfile1=$dir$base.d
320 tmpdepfile2=$dir$base.d
321 "$@" +Maked
322 fi
323 stat=$?
324 if test $stat -eq 0; then :
325 else
326 rm -f "$tmpdepfile1" "$tmpdepfile2"
327 exit $stat
328 fi
329
330 for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
331 do
332 test -f "$tmpdepfile" && break
333 done
334 if test -f "$tmpdepfile"; then
335 sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
336 # Add `dependent.h:' lines.
337 sed -ne '2,${
338 s/^ *//
339 s/ \\*$//
340 s/$/:/
341 p
342 }' "$tmpdepfile" >> "$depfile"
343 else
344 echo "#dummy" > "$depfile"
345 fi
346 rm -f "$tmpdepfile" "$tmpdepfile2"
347 ;;
348
349 tru64)
350 # The Tru64 compiler uses -MD to generate dependencies as a side
351 # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
352 # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
353 # dependencies in `foo.d' instead, so we check for that too.
354 # Subdirectories are respected.
355 dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
356 test "x$dir" = "x$object" && dir=
357 base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
358
359 if test "$libtool" = yes; then
360 # With Tru64 cc, shared objects can also be used to make a
361 # static library. This mechanism is used in libtool 1.4 series to
362 # handle both shared and static libraries in a single compilation.
363 # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
364 #
365 # With libtool 1.5 this exception was removed, and libtool now
366 # generates 2 separate objects for the 2 libraries. These two
367 # compilations output dependencies in $dir.libs/$base.o.d and
368 # in $dir$base.o.d. We have to check for both files, because
369 # one of the two compilations can be disabled. We should prefer
370 # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
371 # automatically cleaned when .libs/ is deleted, while ignoring
372 # the former would cause a distcleancheck panic.
373 tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
374 tmpdepfile2=$dir$base.o.d # libtool 1.5
375 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
376 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
377 "$@" -Wc,-MD
378 else
379 tmpdepfile1=$dir$base.o.d
380 tmpdepfile2=$dir$base.d
381 tmpdepfile3=$dir$base.d
382 tmpdepfile4=$dir$base.d
383 "$@" -MD
384 fi
385
386 stat=$?
387 if test $stat -eq 0; then :
388 else
389 rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
390 exit $stat
391 fi
392
393 for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
394 do
395 test -f "$tmpdepfile" && break
396 done
397 if test -f "$tmpdepfile"; then
398 sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
399 # That's a tab and a space in the [].
400 sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
401 else
402 echo "#dummy" > "$depfile"
403 fi
404 rm -f "$tmpdepfile"
405 ;;
406
407 #nosideeffect)
408 # This comment above is used by automake to tell side-effect
409 # dependency tracking mechanisms from slower ones.
410
411 dashmstdout)
412 # Important note: in order to support this mode, a compiler *must*
413 # always write the preprocessed file to stdout, regardless of -o.
414 "$@" || exit $?
415
416 # Remove the call to Libtool.
417 if test "$libtool" = yes; then
418 while test "X$1" != 'X--mode=compile'; do
419 shift
420 done
421 shift
422 fi
423
424 # Remove `-o $object'.
425 IFS=" "
426 for arg
427 do
428 case $arg in
429 -o)
430 shift
431 ;;
432 $object)
433 shift
434 ;;
435 *)
436 set fnord "$@" "$arg"
437 shift # fnord
438 shift # $arg
439 ;;
440 esac
441 done
442
443 test -z "$dashmflag" && dashmflag=-M
444 # Require at least two characters before searching for `:'
445 # in the target name. This is to cope with DOS-style filenames:
446 # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
447 "$@" $dashmflag |
448 sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
449 rm -f "$depfile"
450 cat < "$tmpdepfile" > "$depfile"
451 tr ' ' '
452 ' < "$tmpdepfile" | \
453 ## Some versions of the HPUX 10.20 sed can't process this invocation
454 ## correctly. Breaking it into two sed invocations is a workaround.
455 sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
456 rm -f "$tmpdepfile"
457 ;;
458
459 dashXmstdout)
460 # This case only exists to satisfy depend.m4. It is never actually
461 # run, as this mode is specially recognized in the preamble.
462 exit 1
463 ;;
464
465 makedepend)
466 "$@" || exit $?
467 # Remove any Libtool call
468 if test "$libtool" = yes; then
469 while test "X$1" != 'X--mode=compile'; do
470 shift
471 done
472 shift
473 fi
474 # X makedepend
475 shift
476 cleared=no eat=no
477 for arg
478 do
479 case $cleared in
480 no)
481 set ""; shift
482 cleared=yes ;;
483 esac
484 if test $eat = yes; then
485 eat=no
486 continue
487 fi
488 case "$arg" in
489 -D*|-I*)
490 set fnord "$@" "$arg"; shift ;;
491 # Strip any option that makedepend may not understand. Remove
492 # the object too, otherwise makedepend will parse it as a source file.
493 -arch)
494 eat=yes ;;
495 -*|$object)
496 ;;
497 *)
498 set fnord "$@" "$arg"; shift ;;
499 esac
500 done
501 obj_suffix=`echo "$object" | sed 's/^.*\././'`
502 touch "$tmpdepfile"
503 ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
504 rm -f "$depfile"
505 cat < "$tmpdepfile" > "$depfile"
506 sed '1,2d' "$tmpdepfile" | tr ' ' '
507 ' | \
508 ## Some versions of the HPUX 10.20 sed can't process this invocation
509 ## correctly. Breaking it into two sed invocations is a workaround.
510 sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
511 rm -f "$tmpdepfile" "$tmpdepfile".bak
512 ;;
513
514 cpp)
515 # Important note: in order to support this mode, a compiler *must*
516 # always write the preprocessed file to stdout.
517 "$@" || exit $?
518
519 # Remove the call to Libtool.
520 if test "$libtool" = yes; then
521 while test "X$1" != 'X--mode=compile'; do
522 shift
523 done
524 shift
525 fi
526
527 # Remove `-o $object'.
528 IFS=" "
529 for arg
530 do
531 case $arg in
532 -o)
533 shift
534 ;;
535 $object)
536 shift
537 ;;
538 *)
539 set fnord "$@" "$arg"
540 shift # fnord
541 shift # $arg
542 ;;
543 esac
544 done
545
546 "$@" -E |
547 sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
548 -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
549 sed '$ s: \\$::' > "$tmpdepfile"
550 rm -f "$depfile"
551 echo "$object : \\" > "$depfile"
552 cat < "$tmpdepfile" >> "$depfile"
553 sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
554 rm -f "$tmpdepfile"
555 ;;
556
557 msvisualcpp)
558 # Important note: in order to support this mode, a compiler *must*
559 # always write the preprocessed file to stdout.
560 "$@" || exit $?
561
562 # Remove the call to Libtool.
563 if test "$libtool" = yes; then
564 while test "X$1" != 'X--mode=compile'; do
565 shift
566 done
567 shift
568 fi
569
570 IFS=" "
571 for arg
572 do
573 case "$arg" in
574 -o)
575 shift
576 ;;
577 $object)
578 shift
579 ;;
580 "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
581 set fnord "$@"
582 shift
583 shift
584 ;;
585 *)
586 set fnord "$@" "$arg"
587 shift
588 shift
589 ;;
590 esac
591 done
592 "$@" -E 2>/dev/null |
593 sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
594 rm -f "$depfile"
595 echo "$object : \\" > "$depfile"
596 sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
597 echo " " >> "$depfile"
598 sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
599 rm -f "$tmpdepfile"
600 ;;
601
602 msvcmsys)
603 # This case exists only to let depend.m4 do its work. It works by
604 # looking at the text of this script. This case will never be run,
605 # since it is checked for above.
606 exit 1
607 ;;
608
609 none)
610 exec "$@"
611 ;;
612
613 *)
614 echo "Unknown depmode $depmode" 1>&2
615 exit 1
616 ;;
617 esac
618
619 exit 0
620
621 # Local Variables:
622 # mode: shell-script
623 # sh-indentation: 2
624 # eval: (add-hook 'write-file-hooks 'time-stamp)
625 # time-stamp-start: "scriptversion="
626 # time-stamp-format: "%:y-%02m-%02d.%02H"
627 # time-stamp-time-zone: "UTC"
628 # time-stamp-end: "; # UTC"
629 # End:
+0
-520
install-sh less more
0 #!/bin/sh
1 # install - install a program, script, or datafile
2
3 scriptversion=2009-04-28.21; # UTC
4
5 # This originates from X11R5 (mit/util/scripts/install.sh), which was
6 # later released in X11R6 (xc/config/util/install.sh) with the
7 # following copyright and license.
8 #
9 # Copyright (C) 1994 X Consortium
10 #
11 # Permission is hereby granted, free of charge, to any person obtaining a copy
12 # of this software and associated documentation files (the "Software"), to
13 # deal in the Software without restriction, including without limitation the
14 # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
15 # sell copies of the Software, and to permit persons to whom the Software is
16 # furnished to do so, subject to the following conditions:
17 #
18 # The above copyright notice and this permission notice shall be included in
19 # all copies or substantial portions of the Software.
20 #
21 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24 # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
25 # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
26 # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27 #
28 # Except as contained in this notice, the name of the X Consortium shall not
29 # be used in advertising or otherwise to promote the sale, use or other deal-
30 # ings in this Software without prior written authorization from the X Consor-
31 # tium.
32 #
33 #
34 # FSF changes to this file are in the public domain.
35 #
36 # Calling this script install-sh is preferred over install.sh, to prevent
37 # `make' implicit rules from creating a file called install from it
38 # when there is no Makefile.
39 #
40 # This script is compatible with the BSD install script, but was written
41 # from scratch.
42
43 nl='
44 '
45 IFS=" "" $nl"
46
47 # set DOITPROG to echo to test this script
48
49 # Don't use :- since 4.3BSD and earlier shells don't like it.
50 doit=${DOITPROG-}
51 if test -z "$doit"; then
52 doit_exec=exec
53 else
54 doit_exec=$doit
55 fi
56
57 # Put in absolute file names if you don't have them in your path;
58 # or use environment vars.
59
60 chgrpprog=${CHGRPPROG-chgrp}
61 chmodprog=${CHMODPROG-chmod}
62 chownprog=${CHOWNPROG-chown}
63 cmpprog=${CMPPROG-cmp}
64 cpprog=${CPPROG-cp}
65 mkdirprog=${MKDIRPROG-mkdir}
66 mvprog=${MVPROG-mv}
67 rmprog=${RMPROG-rm}
68 stripprog=${STRIPPROG-strip}
69
70 posix_glob='?'
71 initialize_posix_glob='
72 test "$posix_glob" != "?" || {
73 if (set -f) 2>/dev/null; then
74 posix_glob=
75 else
76 posix_glob=:
77 fi
78 }
79 '
80
81 posix_mkdir=
82
83 # Desired mode of installed file.
84 mode=0755
85
86 chgrpcmd=
87 chmodcmd=$chmodprog
88 chowncmd=
89 mvcmd=$mvprog
90 rmcmd="$rmprog -f"
91 stripcmd=
92
93 src=
94 dst=
95 dir_arg=
96 dst_arg=
97
98 copy_on_change=false
99 no_target_directory=
100
101 usage="\
102 Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
103 or: $0 [OPTION]... SRCFILES... DIRECTORY
104 or: $0 [OPTION]... -t DIRECTORY SRCFILES...
105 or: $0 [OPTION]... -d DIRECTORIES...
106
107 In the 1st form, copy SRCFILE to DSTFILE.
108 In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
109 In the 4th, create DIRECTORIES.
110
111 Options:
112 --help display this help and exit.
113 --version display version info and exit.
114
115 -c (ignored)
116 -C install only if different (preserve the last data modification time)
117 -d create directories instead of installing files.
118 -g GROUP $chgrpprog installed files to GROUP.
119 -m MODE $chmodprog installed files to MODE.
120 -o USER $chownprog installed files to USER.
121 -s $stripprog installed files.
122 -t DIRECTORY install into DIRECTORY.
123 -T report an error if DSTFILE is a directory.
124
125 Environment variables override the default commands:
126 CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
127 RMPROG STRIPPROG
128 "
129
130 while test $# -ne 0; do
131 case $1 in
132 -c) ;;
133
134 -C) copy_on_change=true;;
135
136 -d) dir_arg=true;;
137
138 -g) chgrpcmd="$chgrpprog $2"
139 shift;;
140
141 --help) echo "$usage"; exit $?;;
142
143 -m) mode=$2
144 case $mode in
145 *' '* | *' '* | *'
146 '* | *'*'* | *'?'* | *'['*)
147 echo "$0: invalid mode: $mode" >&2
148 exit 1;;
149 esac
150 shift;;
151
152 -o) chowncmd="$chownprog $2"
153 shift;;
154
155 -s) stripcmd=$stripprog;;
156
157 -t) dst_arg=$2
158 shift;;
159
160 -T) no_target_directory=true;;
161
162 --version) echo "$0 $scriptversion"; exit $?;;
163
164 --) shift
165 break;;
166
167 -*) echo "$0: invalid option: $1" >&2
168 exit 1;;
169
170 *) break;;
171 esac
172 shift
173 done
174
175 if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
176 # When -d is used, all remaining arguments are directories to create.
177 # When -t is used, the destination is already specified.
178 # Otherwise, the last argument is the destination. Remove it from $@.
179 for arg
180 do
181 if test -n "$dst_arg"; then
182 # $@ is not empty: it contains at least $arg.
183 set fnord "$@" "$dst_arg"
184 shift # fnord
185 fi
186 shift # arg
187 dst_arg=$arg
188 done
189 fi
190
191 if test $# -eq 0; then
192 if test -z "$dir_arg"; then
193 echo "$0: no input file specified." >&2
194 exit 1
195 fi
196 # It's OK to call `install-sh -d' without argument.
197 # This can happen when creating conditional directories.
198 exit 0
199 fi
200
201 if test -z "$dir_arg"; then
202 trap '(exit $?); exit' 1 2 13 15
203
204 # Set umask so as not to create temps with too-generous modes.
205 # However, 'strip' requires both read and write access to temps.
206 case $mode in
207 # Optimize common cases.
208 *644) cp_umask=133;;
209 *755) cp_umask=22;;
210
211 *[0-7])
212 if test -z "$stripcmd"; then
213 u_plus_rw=
214 else
215 u_plus_rw='% 200'
216 fi
217 cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
218 *)
219 if test -z "$stripcmd"; then
220 u_plus_rw=
221 else
222 u_plus_rw=,u+rw
223 fi
224 cp_umask=$mode$u_plus_rw;;
225 esac
226 fi
227
228 for src
229 do
230 # Protect names starting with `-'.
231 case $src in
232 -*) src=./$src;;
233 esac
234
235 if test -n "$dir_arg"; then
236 dst=$src
237 dstdir=$dst
238 test -d "$dstdir"
239 dstdir_status=$?
240 else
241
242 # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
243 # might cause directories to be created, which would be especially bad
244 # if $src (and thus $dsttmp) contains '*'.
245 if test ! -f "$src" && test ! -d "$src"; then
246 echo "$0: $src does not exist." >&2
247 exit 1
248 fi
249
250 if test -z "$dst_arg"; then
251 echo "$0: no destination specified." >&2
252 exit 1
253 fi
254
255 dst=$dst_arg
256 # Protect names starting with `-'.
257 case $dst in
258 -*) dst=./$dst;;
259 esac
260
261 # If destination is a directory, append the input filename; won't work
262 # if double slashes aren't ignored.
263 if test -d "$dst"; then
264 if test -n "$no_target_directory"; then
265 echo "$0: $dst_arg: Is a directory" >&2
266 exit 1
267 fi
268 dstdir=$dst
269 dst=$dstdir/`basename "$src"`
270 dstdir_status=0
271 else
272 # Prefer dirname, but fall back on a substitute if dirname fails.
273 dstdir=`
274 (dirname "$dst") 2>/dev/null ||
275 expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
276 X"$dst" : 'X\(//\)[^/]' \| \
277 X"$dst" : 'X\(//\)$' \| \
278 X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
279 echo X"$dst" |
280 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
281 s//\1/
282 q
283 }
284 /^X\(\/\/\)[^/].*/{
285 s//\1/
286 q
287 }
288 /^X\(\/\/\)$/{
289 s//\1/
290 q
291 }
292 /^X\(\/\).*/{
293 s//\1/
294 q
295 }
296 s/.*/./; q'
297 `
298
299 test -d "$dstdir"
300 dstdir_status=$?
301 fi
302 fi
303
304 obsolete_mkdir_used=false
305
306 if test $dstdir_status != 0; then
307 case $posix_mkdir in
308 '')
309 # Create intermediate dirs using mode 755 as modified by the umask.
310 # This is like FreeBSD 'install' as of 1997-10-28.
311 umask=`umask`
312 case $stripcmd.$umask in
313 # Optimize common cases.
314 *[2367][2367]) mkdir_umask=$umask;;
315 .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
316
317 *[0-7])
318 mkdir_umask=`expr $umask + 22 \
319 - $umask % 100 % 40 + $umask % 20 \
320 - $umask % 10 % 4 + $umask % 2
321 `;;
322 *) mkdir_umask=$umask,go-w;;
323 esac
324
325 # With -d, create the new directory with the user-specified mode.
326 # Otherwise, rely on $mkdir_umask.
327 if test -n "$dir_arg"; then
328 mkdir_mode=-m$mode
329 else
330 mkdir_mode=
331 fi
332
333 posix_mkdir=false
334 case $umask in
335 *[123567][0-7][0-7])
336 # POSIX mkdir -p sets u+wx bits regardless of umask, which
337 # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
338 ;;
339 *)
340 tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
341 trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
342
343 if (umask $mkdir_umask &&
344 exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
345 then
346 if test -z "$dir_arg" || {
347 # Check for POSIX incompatibilities with -m.
348 # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
349 # other-writeable bit of parent directory when it shouldn't.
350 # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
351 ls_ld_tmpdir=`ls -ld "$tmpdir"`
352 case $ls_ld_tmpdir in
353 d????-?r-*) different_mode=700;;
354 d????-?--*) different_mode=755;;
355 *) false;;
356 esac &&
357 $mkdirprog -m$different_mode -p -- "$tmpdir" && {
358 ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
359 test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
360 }
361 }
362 then posix_mkdir=:
363 fi
364 rmdir "$tmpdir/d" "$tmpdir"
365 else
366 # Remove any dirs left behind by ancient mkdir implementations.
367 rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
368 fi
369 trap '' 0;;
370 esac;;
371 esac
372
373 if
374 $posix_mkdir && (
375 umask $mkdir_umask &&
376 $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
377 )
378 then :
379 else
380
381 # The umask is ridiculous, or mkdir does not conform to POSIX,
382 # or it failed possibly due to a race condition. Create the
383 # directory the slow way, step by step, checking for races as we go.
384
385 case $dstdir in
386 /*) prefix='/';;
387 -*) prefix='./';;
388 *) prefix='';;
389 esac
390
391 eval "$initialize_posix_glob"
392
393 oIFS=$IFS
394 IFS=/
395 $posix_glob set -f
396 set fnord $dstdir
397 shift
398 $posix_glob set +f
399 IFS=$oIFS
400
401 prefixes=
402
403 for d
404 do
405 test -z "$d" && continue
406
407 prefix=$prefix$d
408 if test -d "$prefix"; then
409 prefixes=
410 else
411 if $posix_mkdir; then
412 (umask=$mkdir_umask &&
413 $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
414 # Don't fail if two instances are running concurrently.
415 test -d "$prefix" || exit 1
416 else
417 case $prefix in
418 *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
419 *) qprefix=$prefix;;
420 esac
421 prefixes="$prefixes '$qprefix'"
422 fi
423 fi
424 prefix=$prefix/
425 done
426
427 if test -n "$prefixes"; then
428 # Don't fail if two instances are running concurrently.
429 (umask $mkdir_umask &&
430 eval "\$doit_exec \$mkdirprog $prefixes") ||
431 test -d "$dstdir" || exit 1
432 obsolete_mkdir_used=true
433 fi
434 fi
435 fi
436
437 if test -n "$dir_arg"; then
438 { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
439 { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
440 { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
441 test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
442 else
443
444 # Make a couple of temp file names in the proper directory.
445 dsttmp=$dstdir/_inst.$$_
446 rmtmp=$dstdir/_rm.$$_
447
448 # Trap to clean up those temp files at exit.
449 trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
450
451 # Copy the file name to the temp name.
452 (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
453
454 # and set any options; do chmod last to preserve setuid bits.
455 #
456 # If any of these fail, we abort the whole thing. If we want to
457 # ignore errors from any of these, just make sure not to ignore
458 # errors from the above "$doit $cpprog $src $dsttmp" command.
459 #
460 { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
461 { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
462 { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
463 { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
464
465 # If -C, don't bother to copy if it wouldn't change the file.
466 if $copy_on_change &&
467 old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
468 new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
469
470 eval "$initialize_posix_glob" &&
471 $posix_glob set -f &&
472 set X $old && old=:$2:$4:$5:$6 &&
473 set X $new && new=:$2:$4:$5:$6 &&
474 $posix_glob set +f &&
475
476 test "$old" = "$new" &&
477 $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
478 then
479 rm -f "$dsttmp"
480 else
481 # Rename the file to the real destination.
482 $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
483
484 # The rename failed, perhaps because mv can't rename something else
485 # to itself, or perhaps because mv is so ancient that it does not
486 # support -f.
487 {
488 # Now remove or move aside any old file at destination location.
489 # We try this two ways since rm can't unlink itself on some
490 # systems and the destination file might be busy for other
491 # reasons. In this case, the final cleanup might fail but the new
492 # file should still install successfully.
493 {
494 test ! -f "$dst" ||
495 $doit $rmcmd -f "$dst" 2>/dev/null ||
496 { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
497 { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
498 } ||
499 { echo "$0: cannot unlink or rename $dst" >&2
500 (exit 1); exit 1
501 }
502 } &&
503
504 # Now rename the file to the real destination.
505 $doit $mvcmd "$dsttmp" "$dst"
506 }
507 fi || exit 1
508
509 trap '' 0
510 fi
511 done
512
513 # Local variables:
514 # eval: (add-hook 'write-file-hooks 'time-stamp)
515 # time-stamp-start: "scriptversion="
516 # time-stamp-format: "%:y-%02m-%02d.%02H"
517 # time-stamp-time-zone: "UTC"
518 # time-stamp-end: "; # UTC"
519 # End:
+0
-9636
ltmain.sh less more
0
1 # libtool (GNU libtool) 2.4
2 # Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
3
4 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
5 # 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
6 # This is free software; see the source for copying conditions. There is NO
7 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
8
9 # GNU Libtool is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 2 of the License, or
12 # (at your option) any later version.
13 #
14 # As a special exception to the GNU General Public License,
15 # if you distribute this file as part of a program or library that
16 # is built using GNU Libtool, you may include this file under the
17 # same distribution terms that you use for the rest of that program.
18 #
19 # GNU Libtool is distributed in the hope that it will be useful, but
20 # WITHOUT ANY WARRANTY; without even the implied warranty of
21 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 # General Public License for more details.
23 #
24 # You should have received a copy of the GNU General Public License
25 # along with GNU Libtool; see the file COPYING. If not, a copy
26 # can be downloaded from http://www.gnu.org/licenses/gpl.html,
27 # or obtained by writing to the Free Software Foundation, Inc.,
28 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
29
30 # Usage: $progname [OPTION]... [MODE-ARG]...
31 #
32 # Provide generalized library-building support services.
33 #
34 # --config show all configuration variables
35 # --debug enable verbose shell tracing
36 # -n, --dry-run display commands without modifying any files
37 # --features display basic configuration information and exit
38 # --mode=MODE use operation mode MODE
39 # --preserve-dup-deps don't remove duplicate dependency libraries
40 # --quiet, --silent don't print informational messages
41 # --no-quiet, --no-silent
42 # print informational messages (default)
43 # --tag=TAG use configuration variables from tag TAG
44 # -v, --verbose print more informational messages than default
45 # --no-verbose don't print the extra informational messages
46 # --version print version information
47 # -h, --help, --help-all print short, long, or detailed help message
48 #
49 # MODE must be one of the following:
50 #
51 # clean remove files from the build directory
52 # compile compile a source file into a libtool object
53 # execute automatically set library path, then run a program
54 # finish complete the installation of libtool libraries
55 # install install libraries or executables
56 # link create a library or an executable
57 # uninstall remove libraries from an installed directory
58 #
59 # MODE-ARGS vary depending on the MODE. When passed as first option,
60 # `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that.
61 # Try `$progname --help --mode=MODE' for a more detailed description of MODE.
62 #
63 # When reporting a bug, please describe a test case to reproduce it and
64 # include the following information:
65 #
66 # host-triplet: $host
67 # shell: $SHELL
68 # compiler: $LTCC
69 # compiler flags: $LTCFLAGS
70 # linker: $LD (gnu? $with_gnu_ld)
71 # $progname: (GNU libtool) 2.4
72 # automake: $automake_version
73 # autoconf: $autoconf_version
74 #
75 # Report bugs to <bug-libtool@gnu.org>.
76 # GNU libtool home page: <http://www.gnu.org/software/libtool/>.
77 # General help using GNU software: <http://www.gnu.org/gethelp/>.
78
79 PROGRAM=libtool
80 PACKAGE=libtool
81 VERSION=2.4
82 TIMESTAMP=""
83 package_revision=1.3293
84
85 # Be Bourne compatible
86 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
87 emulate sh
88 NULLCMD=:
89 # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
90 # is contrary to our usage. Disable this feature.
91 alias -g '${1+"$@"}'='"$@"'
92 setopt NO_GLOB_SUBST
93 else
94 case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
95 fi
96 BIN_SH=xpg4; export BIN_SH # for Tru64
97 DUALCASE=1; export DUALCASE # for MKS sh
98
99 # A function that is used when there is no print builtin or printf.
100 func_fallback_echo ()
101 {
102 eval 'cat <<_LTECHO_EOF
103 $1
104 _LTECHO_EOF'
105 }
106
107 # NLS nuisances: We save the old values to restore during execute mode.
108 lt_user_locale=
109 lt_safe_locale=
110 for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
111 do
112 eval "if test \"\${$lt_var+set}\" = set; then
113 save_$lt_var=\$$lt_var
114 $lt_var=C
115 export $lt_var
116 lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
117 lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
118 fi"
119 done
120 LC_ALL=C
121 LANGUAGE=C
122 export LANGUAGE LC_ALL
123
124 $lt_unset CDPATH
125
126
127 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
128 # is ksh but when the shell is invoked as "sh" and the current value of
129 # the _XPG environment variable is not equal to 1 (one), the special
130 # positional parameter $0, within a function call, is the name of the
131 # function.
132 progpath="$0"
133
134
135
136 : ${CP="cp -f"}
137 test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
138 : ${EGREP="/bin/grep -E"}
139 : ${FGREP="/bin/grep -F"}
140 : ${GREP="/bin/grep"}
141 : ${LN_S="ln -s"}
142 : ${MAKE="make"}
143 : ${MKDIR="mkdir"}
144 : ${MV="mv -f"}
145 : ${RM="rm -f"}
146 : ${SED="/bin/sed"}
147 : ${SHELL="${CONFIG_SHELL-/bin/sh}"}
148 : ${Xsed="$SED -e 1s/^X//"}
149
150 # Global variables:
151 EXIT_SUCCESS=0
152 EXIT_FAILURE=1
153 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing.
154 EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake.
155
156 exit_status=$EXIT_SUCCESS
157
158 # Make sure IFS has a sensible default
159 lt_nl='
160 '
161 IFS=" $lt_nl"
162
163 dirname="s,/[^/]*$,,"
164 basename="s,^.*/,,"
165
166 # func_dirname file append nondir_replacement
167 # Compute the dirname of FILE. If nonempty, add APPEND to the result,
168 # otherwise set result to NONDIR_REPLACEMENT.
169 func_dirname ()
170 {
171 func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
172 if test "X$func_dirname_result" = "X${1}"; then
173 func_dirname_result="${3}"
174 else
175 func_dirname_result="$func_dirname_result${2}"
176 fi
177 } # func_dirname may be replaced by extended shell implementation
178
179
180 # func_basename file
181 func_basename ()
182 {
183 func_basename_result=`$ECHO "${1}" | $SED "$basename"`
184 } # func_basename may be replaced by extended shell implementation
185
186
187 # func_dirname_and_basename file append nondir_replacement
188 # perform func_basename and func_dirname in a single function
189 # call:
190 # dirname: Compute the dirname of FILE. If nonempty,
191 # add APPEND to the result, otherwise set result
192 # to NONDIR_REPLACEMENT.
193 # value returned in "$func_dirname_result"
194 # basename: Compute filename of FILE.
195 # value retuned in "$func_basename_result"
196 # Implementation must be kept synchronized with func_dirname
197 # and func_basename. For efficiency, we do not delegate to
198 # those functions but instead duplicate the functionality here.
199 func_dirname_and_basename ()
200 {
201 # Extract subdirectory from the argument.
202 func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
203 if test "X$func_dirname_result" = "X${1}"; then
204 func_dirname_result="${3}"
205 else
206 func_dirname_result="$func_dirname_result${2}"
207 fi
208 func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
209 } # func_dirname_and_basename may be replaced by extended shell implementation
210
211
212 # func_stripname prefix suffix name
213 # strip PREFIX and SUFFIX off of NAME.
214 # PREFIX and SUFFIX must not contain globbing or regex special
215 # characters, hashes, percent signs, but SUFFIX may contain a leading
216 # dot (in which case that matches only a dot).
217 # func_strip_suffix prefix name
218 func_stripname ()
219 {
220 case ${2} in
221 .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
222 *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
223 esac
224 } # func_stripname may be replaced by extended shell implementation
225
226
227 # These SED scripts presuppose an absolute path with a trailing slash.
228 pathcar='s,^/\([^/]*\).*$,\1,'
229 pathcdr='s,^/[^/]*,,'
230 removedotparts=':dotsl
231 s@/\./@/@g
232 t dotsl
233 s,/\.$,/,'
234 collapseslashes='s@/\{1,\}@/@g'
235 finalslash='s,/*$,/,'
236
237 # func_normal_abspath PATH
238 # Remove doubled-up and trailing slashes, "." path components,
239 # and cancel out any ".." path components in PATH after making
240 # it an absolute path.
241 # value returned in "$func_normal_abspath_result"
242 func_normal_abspath ()
243 {
244 # Start from root dir and reassemble the path.
245 func_normal_abspath_result=
246 func_normal_abspath_tpath=$1
247 func_normal_abspath_altnamespace=
248 case $func_normal_abspath_tpath in
249 "")
250 # Empty path, that just means $cwd.
251 func_stripname '' '/' "`pwd`"
252 func_normal_abspath_result=$func_stripname_result
253 return
254 ;;
255 # The next three entries are used to spot a run of precisely
256 # two leading slashes without using negated character classes;
257 # we take advantage of case's first-match behaviour.
258 ///*)
259 # Unusual form of absolute path, do nothing.
260 ;;
261 //*)
262 # Not necessarily an ordinary path; POSIX reserves leading '//'
263 # and for example Cygwin uses it to access remote file shares
264 # over CIFS/SMB, so we conserve a leading double slash if found.
265 func_normal_abspath_altnamespace=/
266 ;;
267 /*)
268 # Absolute path, do nothing.
269 ;;
270 *)
271 # Relative path, prepend $cwd.
272 func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
273 ;;
274 esac
275 # Cancel out all the simple stuff to save iterations. We also want
276 # the path to end with a slash for ease of parsing, so make sure
277 # there is one (and only one) here.
278 func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
279 -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
280 while :; do
281 # Processed it all yet?
282 if test "$func_normal_abspath_tpath" = / ; then
283 # If we ascended to the root using ".." the result may be empty now.
284 if test -z "$func_normal_abspath_result" ; then
285 func_normal_abspath_result=/
286 fi
287 break
288 fi
289 func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
290 -e "$pathcar"`
291 func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
292 -e "$pathcdr"`
293 # Figure out what to do with it
294 case $func_normal_abspath_tcomponent in
295 "")
296 # Trailing empty path component, ignore it.
297 ;;
298 ..)
299 # Parent dir; strip last assembled component from result.
300 func_dirname "$func_normal_abspath_result"
301 func_normal_abspath_result=$func_dirname_result
302 ;;
303 *)
304 # Actual path component, append it.
305 func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent
306 ;;
307 esac
308 done
309 # Restore leading double-slash if one was found on entry.
310 func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
311 }
312
313 # func_relative_path SRCDIR DSTDIR
314 # generates a relative path from SRCDIR to DSTDIR, with a trailing
315 # slash if non-empty, suitable for immediately appending a filename
316 # without needing to append a separator.
317 # value returned in "$func_relative_path_result"
318 func_relative_path ()
319 {
320 func_relative_path_result=
321 func_normal_abspath "$1"
322 func_relative_path_tlibdir=$func_normal_abspath_result
323 func_normal_abspath "$2"
324 func_relative_path_tbindir=$func_normal_abspath_result
325
326 # Ascend the tree starting from libdir
327 while :; do
328 # check if we have found a prefix of bindir
329 case $func_relative_path_tbindir in
330 $func_relative_path_tlibdir)
331 # found an exact match
332 func_relative_path_tcancelled=
333 break
334 ;;
335 $func_relative_path_tlibdir*)
336 # found a matching prefix
337 func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
338 func_relative_path_tcancelled=$func_stripname_result
339 if test -z "$func_relative_path_result"; then
340 func_relative_path_result=.
341 fi
342 break
343 ;;
344 *)
345 func_dirname $func_relative_path_tlibdir
346 func_relative_path_tlibdir=${func_dirname_result}
347 if test "x$func_relative_path_tlibdir" = x ; then
348 # Have to descend all the way to the root!
349 func_relative_path_result=../$func_relative_path_result
350 func_relative_path_tcancelled=$func_relative_path_tbindir
351 break
352 fi
353 func_relative_path_result=../$func_relative_path_result
354 ;;
355 esac
356 done
357
358 # Now calculate path; take care to avoid doubling-up slashes.
359 func_stripname '' '/' "$func_relative_path_result"
360 func_relative_path_result=$func_stripname_result
361 func_stripname '/' '/' "$func_relative_path_tcancelled"
362 if test "x$func_stripname_result" != x ; then
363 func_relative_path_result=${func_relative_path_result}/${func_stripname_result}
364 fi
365
366 # Normalisation. If bindir is libdir, return empty string,
367 # else relative path ending with a slash; either way, target
368 # file name can be directly appended.
369 if test ! -z "$func_relative_path_result"; then
370 func_stripname './' '' "$func_relative_path_result/"
371 func_relative_path_result=$func_stripname_result
372 fi
373 }
374
375 # The name of this program:
376 func_dirname_and_basename "$progpath"
377 progname=$func_basename_result
378
379 # Make sure we have an absolute path for reexecution:
380 case $progpath in
381 [\\/]*|[A-Za-z]:\\*) ;;
382 *[\\/]*)
383 progdir=$func_dirname_result
384 progdir=`cd "$progdir" && pwd`
385 progpath="$progdir/$progname"
386 ;;
387 *)
388 save_IFS="$IFS"
389 IFS=:
390 for progdir in $PATH; do
391 IFS="$save_IFS"
392 test -x "$progdir/$progname" && break
393 done
394 IFS="$save_IFS"
395 test -n "$progdir" || progdir=`pwd`
396 progpath="$progdir/$progname"
397 ;;
398 esac
399
400 # Sed substitution that helps us do robust quoting. It backslashifies
401 # metacharacters that are still active within double-quoted strings.
402 Xsed="${SED}"' -e 1s/^X//'
403 sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
404
405 # Same as above, but do not quote variable references.
406 double_quote_subst='s/\(["`\\]\)/\\\1/g'
407
408 # Sed substitution that turns a string into a regex matching for the
409 # string literally.
410 sed_make_literal_regex='s,[].[^$\\*\/],\\&,g'
411
412 # Sed substitution that converts a w32 file name or path
413 # which contains forward slashes, into one that contains
414 # (escaped) backslashes. A very naive implementation.
415 lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
416
417 # Re-`\' parameter expansions in output of double_quote_subst that were
418 # `\'-ed in input to the same. If an odd number of `\' preceded a '$'
419 # in input to double_quote_subst, that '$' was protected from expansion.
420 # Since each input `\' is now two `\'s, look for any number of runs of
421 # four `\'s followed by two `\'s and then a '$'. `\' that '$'.
422 bs='\\'
423 bs2='\\\\'
424 bs4='\\\\\\\\'
425 dollar='\$'
426 sed_double_backslash="\
427 s/$bs4/&\\
428 /g
429 s/^$bs2$dollar/$bs&/
430 s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
431 s/\n//g"
432
433 # Standard options:
434 opt_dry_run=false
435 opt_help=false
436 opt_quiet=false
437 opt_verbose=false
438 opt_warning=:
439
440 # func_echo arg...
441 # Echo program name prefixed message, along with the current mode
442 # name if it has been set yet.
443 func_echo ()
444 {
445 $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
446 }
447
448 # func_verbose arg...
449 # Echo program name prefixed message in verbose mode only.
450 func_verbose ()
451 {
452 $opt_verbose && func_echo ${1+"$@"}
453
454 # A bug in bash halts the script if the last line of a function
455 # fails when set -e is in force, so we need another command to
456 # work around that:
457 :
458 }
459
460 # func_echo_all arg...
461 # Invoke $ECHO with all args, space-separated.
462 func_echo_all ()
463 {
464 $ECHO "$*"
465 }
466
467 # func_error arg...
468 # Echo program name prefixed message to standard error.
469 func_error ()
470 {
471 $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2
472 }
473
474 # func_warning arg...
475 # Echo program name prefixed warning message to standard error.
476 func_warning ()
477 {
478 $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
479
480 # bash bug again:
481 :
482 }
483
484 # func_fatal_error arg...
485 # Echo program name prefixed message to standard error, and exit.
486 func_fatal_error ()
487 {
488 func_error ${1+"$@"}
489 exit $EXIT_FAILURE
490 }
491
492 # func_fatal_help arg...
493 # Echo program name prefixed message to standard error, followed by
494 # a help hint, and exit.
495 func_fatal_help ()
496 {
497 func_error ${1+"$@"}
498 func_fatal_error "$help"
499 }
500 help="Try \`$progname --help' for more information." ## default
501
502
503 # func_grep expression filename
504 # Check whether EXPRESSION matches any line of FILENAME, without output.
505 func_grep ()
506 {
507 $GREP "$1" "$2" >/dev/null 2>&1
508 }
509
510
511 # func_mkdir_p directory-path
512 # Make sure the entire path to DIRECTORY-PATH is available.
513 func_mkdir_p ()
514 {
515 my_directory_path="$1"
516 my_dir_list=
517
518 if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
519
520 # Protect directory names starting with `-'
521 case $my_directory_path in
522 -*) my_directory_path="./$my_directory_path" ;;
523 esac
524
525 # While some portion of DIR does not yet exist...
526 while test ! -d "$my_directory_path"; do
527 # ...make a list in topmost first order. Use a colon delimited
528 # list incase some portion of path contains whitespace.
529 my_dir_list="$my_directory_path:$my_dir_list"
530
531 # If the last portion added has no slash in it, the list is done
532 case $my_directory_path in */*) ;; *) break ;; esac
533
534 # ...otherwise throw away the child directory and loop
535 my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"`
536 done
537 my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'`
538
539 save_mkdir_p_IFS="$IFS"; IFS=':'
540 for my_dir in $my_dir_list; do
541 IFS="$save_mkdir_p_IFS"
542 # mkdir can fail with a `File exist' error if two processes
543 # try to create one of the directories concurrently. Don't
544 # stop in that case!
545 $MKDIR "$my_dir" 2>/dev/null || :
546 done
547 IFS="$save_mkdir_p_IFS"
548
549 # Bail out if we (or some other process) failed to create a directory.
550 test -d "$my_directory_path" || \
551 func_fatal_error "Failed to create \`$1'"
552 fi
553 }
554
555
556 # func_mktempdir [string]
557 # Make a temporary directory that won't clash with other running
558 # libtool processes, and avoids race conditions if possible. If
559 # given, STRING is the basename for that directory.
560 func_mktempdir ()
561 {
562 my_template="${TMPDIR-/tmp}/${1-$progname}"
563
564 if test "$opt_dry_run" = ":"; then
565 # Return a directory name, but don't create it in dry-run mode
566 my_tmpdir="${my_template}-$$"
567 else
568
569 # If mktemp works, use that first and foremost
570 my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
571
572 if test ! -d "$my_tmpdir"; then
573 # Failing that, at least try and use $RANDOM to avoid a race
574 my_tmpdir="${my_template}-${RANDOM-0}$$"
575
576 save_mktempdir_umask=`umask`
577 umask 0077
578 $MKDIR "$my_tmpdir"
579 umask $save_mktempdir_umask
580 fi
581
582 # If we're not in dry-run mode, bomb out on failure
583 test -d "$my_tmpdir" || \
584 func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
585 fi
586
587 $ECHO "$my_tmpdir"
588 }
589
590
591 # func_quote_for_eval arg
592 # Aesthetically quote ARG to be evaled later.
593 # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
594 # is double-quoted, suitable for a subsequent eval, whereas
595 # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
596 # which are still active within double quotes backslashified.
597 func_quote_for_eval ()
598 {
599 case $1 in
600 *[\\\`\"\$]*)
601 func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;;
602 *)
603 func_quote_for_eval_unquoted_result="$1" ;;
604 esac
605
606 case $func_quote_for_eval_unquoted_result in
607 # Double-quote args containing shell metacharacters to delay
608 # word splitting, command substitution and and variable
609 # expansion for a subsequent eval.
610 # Many Bourne shells cannot handle close brackets correctly
611 # in scan sets, so we specify it separately.
612 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
613 func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
614 ;;
615 *)
616 func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
617 esac
618 }
619
620
621 # func_quote_for_expand arg
622 # Aesthetically quote ARG to be evaled later; same as above,
623 # but do not quote variable references.
624 func_quote_for_expand ()
625 {
626 case $1 in
627 *[\\\`\"]*)
628 my_arg=`$ECHO "$1" | $SED \
629 -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
630 *)
631 my_arg="$1" ;;
632 esac
633
634 case $my_arg in
635 # Double-quote args containing shell metacharacters to delay
636 # word splitting and command substitution for a subsequent eval.
637 # Many Bourne shells cannot handle close brackets correctly
638 # in scan sets, so we specify it separately.
639 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
640 my_arg="\"$my_arg\""
641 ;;
642 esac
643
644 func_quote_for_expand_result="$my_arg"
645 }
646
647
648 # func_show_eval cmd [fail_exp]
649 # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
650 # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
651 # is given, then evaluate it.
652 func_show_eval ()
653 {
654 my_cmd="$1"
655 my_fail_exp="${2-:}"
656
657 ${opt_silent-false} || {
658 func_quote_for_expand "$my_cmd"
659 eval "func_echo $func_quote_for_expand_result"
660 }
661
662 if ${opt_dry_run-false}; then :; else
663 eval "$my_cmd"
664 my_status=$?
665 if test "$my_status" -eq 0; then :; else
666 eval "(exit $my_status); $my_fail_exp"
667 fi
668 fi
669 }
670
671
672 # func_show_eval_locale cmd [fail_exp]
673 # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
674 # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
675 # is given, then evaluate it. Use the saved locale for evaluation.
676 func_show_eval_locale ()
677 {
678 my_cmd="$1"
679 my_fail_exp="${2-:}"
680
681 ${opt_silent-false} || {
682 func_quote_for_expand "$my_cmd"
683 eval "func_echo $func_quote_for_expand_result"
684 }
685
686 if ${opt_dry_run-false}; then :; else
687 eval "$lt_user_locale
688 $my_cmd"
689 my_status=$?
690 eval "$lt_safe_locale"
691 if test "$my_status" -eq 0; then :; else
692 eval "(exit $my_status); $my_fail_exp"
693 fi
694 fi
695 }
696
697 # func_tr_sh
698 # Turn $1 into a string suitable for a shell variable name.
699 # Result is stored in $func_tr_sh_result. All characters
700 # not in the set a-zA-Z0-9_ are replaced with '_'. Further,
701 # if $1 begins with a digit, a '_' is prepended as well.
702 func_tr_sh ()
703 {
704 case $1 in
705 [0-9]* | *[!a-zA-Z0-9_]*)
706 func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'`
707 ;;
708 * )
709 func_tr_sh_result=$1
710 ;;
711 esac
712 }
713
714
715 # func_version
716 # Echo version message to standard output and exit.
717 func_version ()
718 {
719 $opt_debug
720
721 $SED -n '/(C)/!b go
722 :more
723 /\./!{
724 N
725 s/\n# / /
726 b more
727 }
728 :go
729 /^# '$PROGRAM' (GNU /,/# warranty; / {
730 s/^# //
731 s/^# *$//
732 s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
733 p
734 }' < "$progpath"
735 exit $?
736 }
737
738 # func_usage
739 # Echo short help message to standard output and exit.
740 func_usage ()
741 {
742 $opt_debug
743
744 $SED -n '/^# Usage:/,/^# *.*--help/ {
745 s/^# //
746 s/^# *$//
747 s/\$progname/'$progname'/
748 p
749 }' < "$progpath"
750 echo
751 $ECHO "run \`$progname --help | more' for full usage"
752 exit $?
753 }
754
755 # func_help [NOEXIT]
756 # Echo long help message to standard output and exit,
757 # unless 'noexit' is passed as argument.
758 func_help ()
759 {
760 $opt_debug
761
762 $SED -n '/^# Usage:/,/# Report bugs to/ {
763 :print
764 s/^# //
765 s/^# *$//
766 s*\$progname*'$progname'*
767 s*\$host*'"$host"'*
768 s*\$SHELL*'"$SHELL"'*
769 s*\$LTCC*'"$LTCC"'*
770 s*\$LTCFLAGS*'"$LTCFLAGS"'*
771 s*\$LD*'"$LD"'*
772 s/\$with_gnu_ld/'"$with_gnu_ld"'/
773 s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
774 s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
775 p
776 d
777 }
778 /^# .* home page:/b print
779 /^# General help using/b print
780 ' < "$progpath"
781 ret=$?
782 if test -z "$1"; then
783 exit $ret
784 fi
785 }
786
787 # func_missing_arg argname
788 # Echo program name prefixed message to standard error and set global
789 # exit_cmd.
790 func_missing_arg ()
791 {
792 $opt_debug
793
794 func_error "missing argument for $1."
795 exit_cmd=exit
796 }
797
798
799 # func_split_short_opt shortopt
800 # Set func_split_short_opt_name and func_split_short_opt_arg shell
801 # variables after splitting SHORTOPT after the 2nd character.
802 func_split_short_opt ()
803 {
804 my_sed_short_opt='1s/^\(..\).*$/\1/;q'
805 my_sed_short_rest='1s/^..\(.*\)$/\1/;q'
806
807 func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"`
808 func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"`
809 } # func_split_short_opt may be replaced by extended shell implementation
810
811
812 # func_split_long_opt longopt
813 # Set func_split_long_opt_name and func_split_long_opt_arg shell
814 # variables after splitting LONGOPT at the `=' sign.
815 func_split_long_opt ()
816 {
817 my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q'
818 my_sed_long_arg='1s/^--[^=]*=//'
819
820 func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"`
821 func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"`
822 } # func_split_long_opt may be replaced by extended shell implementation
823
824 exit_cmd=:
825
826
827
828
829
830 magic="%%%MAGIC variable%%%"
831 magic_exe="%%%MAGIC EXE variable%%%"
832
833 # Global variables.
834 nonopt=
835 preserve_args=
836 lo2o="s/\\.lo\$/.${objext}/"
837 o2lo="s/\\.${objext}\$/.lo/"
838 extracted_archives=
839 extracted_serial=0
840
841 # If this variable is set in any of the actions, the command in it
842 # will be execed at the end. This prevents here-documents from being
843 # left over by shells.
844 exec_cmd=
845
846 # func_append var value
847 # Append VALUE to the end of shell variable VAR.
848 func_append ()
849 {
850 eval "${1}=\$${1}\${2}"
851 } # func_append may be replaced by extended shell implementation
852
853 # func_append_quoted var value
854 # Quote VALUE and append to the end of shell variable VAR, separated
855 # by a space.
856 func_append_quoted ()
857 {
858 func_quote_for_eval "${2}"
859 eval "${1}=\$${1}\\ \$func_quote_for_eval_result"
860 } # func_append_quoted may be replaced by extended shell implementation
861
862
863 # func_arith arithmetic-term...
864 func_arith ()
865 {
866 func_arith_result=`expr "${@}"`
867 } # func_arith may be replaced by extended shell implementation
868
869
870 # func_len string
871 # STRING may not start with a hyphen.
872 func_len ()
873 {
874 func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len`
875 } # func_len may be replaced by extended shell implementation
876
877
878 # func_lo2o object
879 func_lo2o ()
880 {
881 func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
882 } # func_lo2o may be replaced by extended shell implementation
883
884
885 # func_xform libobj-or-source
886 func_xform ()
887 {
888 func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
889 } # func_xform may be replaced by extended shell implementation
890
891
892 # func_fatal_configuration arg...
893 # Echo program name prefixed message to standard error, followed by
894 # a configuration failure hint, and exit.
895 func_fatal_configuration ()
896 {
897 func_error ${1+"$@"}
898 func_error "See the $PACKAGE documentation for more information."
899 func_fatal_error "Fatal configuration error."
900 }
901
902
903 # func_config
904 # Display the configuration for all the tags in this script.
905 func_config ()
906 {
907 re_begincf='^# ### BEGIN LIBTOOL'
908 re_endcf='^# ### END LIBTOOL'
909
910 # Default configuration.
911 $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
912
913 # Now print the configurations for the tags.
914 for tagname in $taglist; do
915 $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
916 done
917
918 exit $?
919 }
920
921 # func_features
922 # Display the features supported by this script.
923 func_features ()
924 {
925 echo "host: $host"
926 if test "$build_libtool_libs" = yes; then
927 echo "enable shared libraries"
928 else
929 echo "disable shared libraries"
930 fi
931 if test "$build_old_libs" = yes; then
932 echo "enable static libraries"
933 else
934 echo "disable static libraries"
935 fi
936
937 exit $?
938 }
939
940 # func_enable_tag tagname
941 # Verify that TAGNAME is valid, and either flag an error and exit, or
942 # enable the TAGNAME tag. We also add TAGNAME to the global $taglist
943 # variable here.
944 func_enable_tag ()
945 {
946 # Global variable:
947 tagname="$1"
948
949 re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
950 re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
951 sed_extractcf="/$re_begincf/,/$re_endcf/p"
952
953 # Validate tagname.
954 case $tagname in
955 *[!-_A-Za-z0-9,/]*)
956 func_fatal_error "invalid tag name: $tagname"
957 ;;
958 esac
959
960 # Don't test for the "default" C tag, as we know it's
961 # there but not specially marked.
962 case $tagname in
963 CC) ;;
964 *)
965 if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
966 taglist="$taglist $tagname"
967
968 # Evaluate the configuration. Be careful to quote the path
969 # and the sed script, to avoid splitting on whitespace, but
970 # also don't use non-portable quotes within backquotes within
971 # quotes we have to do it in 2 steps:
972 extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
973 eval "$extractedcf"
974 else
975 func_error "ignoring unknown tag $tagname"
976 fi
977 ;;
978 esac
979 }
980
981 # func_check_version_match
982 # Ensure that we are using m4 macros, and libtool script from the same
983 # release of libtool.
984 func_check_version_match ()
985 {
986 if test "$package_revision" != "$macro_revision"; then
987 if test "$VERSION" != "$macro_version"; then
988 if test -z "$macro_version"; then
989 cat >&2 <<_LT_EOF
990 $progname: Version mismatch error. This is $PACKAGE $VERSION, but the
991 $progname: definition of this LT_INIT comes from an older release.
992 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
993 $progname: and run autoconf again.
994 _LT_EOF
995 else
996 cat >&2 <<_LT_EOF
997 $progname: Version mismatch error. This is $PACKAGE $VERSION, but the
998 $progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
999 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
1000 $progname: and run autoconf again.
1001 _LT_EOF
1002 fi
1003 else
1004 cat >&2 <<_LT_EOF
1005 $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
1006 $progname: but the definition of this LT_INIT comes from revision $macro_revision.
1007 $progname: You should recreate aclocal.m4 with macros from revision $package_revision
1008 $progname: of $PACKAGE $VERSION and run autoconf again.
1009 _LT_EOF
1010 fi
1011
1012 exit $EXIT_MISMATCH
1013 fi
1014 }
1015
1016
1017 # Shorthand for --mode=foo, only valid as the first argument
1018 case $1 in
1019 clean|clea|cle|cl)
1020 shift; set dummy --mode clean ${1+"$@"}; shift
1021 ;;
1022 compile|compil|compi|comp|com|co|c)
1023 shift; set dummy --mode compile ${1+"$@"}; shift
1024 ;;
1025 execute|execut|execu|exec|exe|ex|e)
1026 shift; set dummy --mode execute ${1+"$@"}; shift
1027 ;;
1028 finish|finis|fini|fin|fi|f)
1029 shift; set dummy --mode finish ${1+"$@"}; shift
1030 ;;
1031 install|instal|insta|inst|ins|in|i)
1032 shift; set dummy --mode install ${1+"$@"}; shift
1033 ;;
1034 link|lin|li|l)
1035 shift; set dummy --mode link ${1+"$@"}; shift
1036 ;;
1037 uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
1038 shift; set dummy --mode uninstall ${1+"$@"}; shift
1039 ;;
1040 esac
1041
1042
1043
1044 # Option defaults:
1045 opt_debug=:
1046 opt_dry_run=false
1047 opt_config=false
1048 opt_preserve_dup_deps=false
1049 opt_features=false
1050 opt_finish=false
1051 opt_help=false
1052 opt_help_all=false
1053 opt_silent=:
1054 opt_verbose=:
1055 opt_silent=false
1056 opt_verbose=false
1057
1058
1059 # Parse options once, thoroughly. This comes as soon as possible in the
1060 # script to make things like `--version' happen as quickly as we can.
1061 {
1062 # this just eases exit handling
1063 while test $# -gt 0; do
1064 opt="$1"
1065 shift
1066 case $opt in
1067 --debug|-x) opt_debug='set -x'
1068 func_echo "enabling shell trace mode"
1069 $opt_debug
1070 ;;
1071 --dry-run|--dryrun|-n)
1072 opt_dry_run=:
1073 ;;
1074 --config)
1075 opt_config=:
1076 func_config
1077 ;;
1078 --dlopen|-dlopen)
1079 optarg="$1"
1080 opt_dlopen="${opt_dlopen+$opt_dlopen
1081 }$optarg"
1082 shift
1083 ;;
1084 --preserve-dup-deps)
1085 opt_preserve_dup_deps=:
1086 ;;
1087 --features)
1088 opt_features=:
1089 func_features
1090 ;;
1091 --finish)
1092 opt_finish=:
1093 set dummy --mode finish ${1+"$@"}; shift
1094 ;;
1095 --help)
1096 opt_help=:
1097 ;;
1098 --help-all)
1099 opt_help_all=:
1100 opt_help=': help-all'
1101 ;;
1102 --mode)
1103 test $# = 0 && func_missing_arg $opt && break
1104 optarg="$1"
1105 opt_mode="$optarg"
1106 case $optarg in
1107 # Valid mode arguments:
1108 clean|compile|execute|finish|install|link|relink|uninstall) ;;
1109
1110 # Catch anything else as an error
1111 *) func_error "invalid argument for $opt"
1112 exit_cmd=exit
1113 break
1114 ;;
1115 esac
1116 shift
1117 ;;
1118 --no-silent|--no-quiet)
1119 opt_silent=false
1120 func_append preserve_args " $opt"
1121 ;;
1122 --no-verbose)
1123 opt_verbose=false
1124 func_append preserve_args " $opt"
1125 ;;
1126 --silent|--quiet)
1127 opt_silent=:
1128 func_append preserve_args " $opt"
1129 opt_verbose=false
1130 ;;
1131 --verbose|-v)
1132 opt_verbose=:
1133 func_append preserve_args " $opt"
1134 opt_silent=false
1135 ;;
1136 --tag)
1137 test $# = 0 && func_missing_arg $opt && break
1138 optarg="$1"
1139 opt_tag="$optarg"
1140 func_append preserve_args " $opt $optarg"
1141 func_enable_tag "$optarg"
1142 shift
1143 ;;
1144
1145 -\?|-h) func_usage ;;
1146 --help) func_help ;;
1147 --version) func_version ;;
1148
1149 # Separate optargs to long options:
1150 --*=*)
1151 func_split_long_opt "$opt"
1152 set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"}
1153 shift
1154 ;;
1155
1156 # Separate non-argument short options:
1157 -\?*|-h*|-n*|-v*)
1158 func_split_short_opt "$opt"
1159 set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"}
1160 shift
1161 ;;
1162
1163 --) break ;;
1164 -*) func_fatal_help "unrecognized option \`$opt'" ;;
1165 *) set dummy "$opt" ${1+"$@"}; shift; break ;;
1166 esac
1167 done
1168
1169 # Validate options:
1170
1171 # save first non-option argument
1172 if test "$#" -gt 0; then
1173 nonopt="$opt"
1174 shift
1175 fi
1176
1177 # preserve --debug
1178 test "$opt_debug" = : || func_append preserve_args " --debug"
1179
1180 case $host in
1181 *cygwin* | *mingw* | *pw32* | *cegcc*)
1182 # don't eliminate duplications in $postdeps and $predeps
1183 opt_duplicate_compiler_generated_deps=:
1184 ;;
1185 *)
1186 opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
1187 ;;
1188 esac
1189
1190 $opt_help || {
1191 # Sanity checks first:
1192 func_check_version_match
1193
1194 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
1195 func_fatal_configuration "not configured to build any kind of library"
1196 fi
1197
1198 # Darwin sucks
1199 eval std_shrext=\"$shrext_cmds\"
1200
1201 # Only execute mode is allowed to have -dlopen flags.
1202 if test -n "$opt_dlopen" && test "$opt_mode" != execute; then
1203 func_error "unrecognized option \`-dlopen'"
1204 $ECHO "$help" 1>&2
1205 exit $EXIT_FAILURE
1206 fi
1207
1208 # Change the help message to a mode-specific one.
1209 generic_help="$help"
1210 help="Try \`$progname --help --mode=$opt_mode' for more information."
1211 }
1212
1213
1214 # Bail if the options were screwed
1215 $exit_cmd $EXIT_FAILURE
1216 }
1217
1218
1219
1220
1221 ## ----------- ##
1222 ## Main. ##
1223 ## ----------- ##
1224
1225 # func_lalib_p file
1226 # True iff FILE is a libtool `.la' library or `.lo' object file.
1227 # This function is only a basic sanity check; it will hardly flush out
1228 # determined imposters.
1229 func_lalib_p ()
1230 {
1231 test -f "$1" &&
1232 $SED -e 4q "$1" 2>/dev/null \
1233 | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
1234 }
1235
1236 # func_lalib_unsafe_p file
1237 # True iff FILE is a libtool `.la' library or `.lo' object file.
1238 # This function implements the same check as func_lalib_p without
1239 # resorting to external programs. To this end, it redirects stdin and
1240 # closes it afterwards, without saving the original file descriptor.
1241 # As a safety measure, use it only where a negative result would be
1242 # fatal anyway. Works if `file' does not exist.
1243 func_lalib_unsafe_p ()
1244 {
1245 lalib_p=no
1246 if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
1247 for lalib_p_l in 1 2 3 4
1248 do
1249 read lalib_p_line
1250 case "$lalib_p_line" in
1251 \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
1252 esac
1253 done
1254 exec 0<&5 5<&-
1255 fi
1256 test "$lalib_p" = yes
1257 }
1258
1259 # func_ltwrapper_script_p file
1260 # True iff FILE is a libtool wrapper script
1261 # This function is only a basic sanity check; it will hardly flush out
1262 # determined imposters.
1263 func_ltwrapper_script_p ()
1264 {
1265 func_lalib_p "$1"
1266 }
1267
1268 # func_ltwrapper_executable_p file
1269 # True iff FILE is a libtool wrapper executable
1270 # This function is only a basic sanity check; it will hardly flush out
1271 # determined imposters.
1272 func_ltwrapper_executable_p ()
1273 {
1274 func_ltwrapper_exec_suffix=
1275 case $1 in
1276 *.exe) ;;
1277 *) func_ltwrapper_exec_suffix=.exe ;;
1278 esac
1279 $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
1280 }
1281
1282 # func_ltwrapper_scriptname file
1283 # Assumes file is an ltwrapper_executable
1284 # uses $file to determine the appropriate filename for a
1285 # temporary ltwrapper_script.
1286 func_ltwrapper_scriptname ()
1287 {
1288 func_dirname_and_basename "$1" "" "."
1289 func_stripname '' '.exe' "$func_basename_result"
1290 func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
1291 }
1292
1293 # func_ltwrapper_p file
1294 # True iff FILE is a libtool wrapper script or wrapper executable
1295 # This function is only a basic sanity check; it will hardly flush out
1296 # determined imposters.
1297 func_ltwrapper_p ()
1298 {
1299 func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
1300 }
1301
1302
1303 # func_execute_cmds commands fail_cmd
1304 # Execute tilde-delimited COMMANDS.
1305 # If FAIL_CMD is given, eval that upon failure.
1306 # FAIL_CMD may read-access the current command in variable CMD!
1307 func_execute_cmds ()
1308 {
1309 $opt_debug
1310 save_ifs=$IFS; IFS='~'
1311 for cmd in $1; do
1312 IFS=$save_ifs
1313 eval cmd=\"$cmd\"
1314 func_show_eval "$cmd" "${2-:}"
1315 done
1316 IFS=$save_ifs
1317 }
1318
1319
1320 # func_source file
1321 # Source FILE, adding directory component if necessary.
1322 # Note that it is not necessary on cygwin/mingw to append a dot to
1323 # FILE even if both FILE and FILE.exe exist: automatic-append-.exe
1324 # behavior happens only for exec(3), not for open(2)! Also, sourcing
1325 # `FILE.' does not work on cygwin managed mounts.
1326 func_source ()
1327 {
1328 $opt_debug
1329 case $1 in
1330 */* | *\\*) . "$1" ;;
1331 *) . "./$1" ;;
1332 esac
1333 }
1334
1335
1336 # func_resolve_sysroot PATH
1337 # Replace a leading = in PATH with a sysroot. Store the result into
1338 # func_resolve_sysroot_result
1339 func_resolve_sysroot ()
1340 {
1341 func_resolve_sysroot_result=$1
1342 case $func_resolve_sysroot_result in
1343 =*)
1344 func_stripname '=' '' "$func_resolve_sysroot_result"
1345 func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
1346 ;;
1347 esac
1348 }
1349
1350 # func_replace_sysroot PATH
1351 # If PATH begins with the sysroot, replace it with = and
1352 # store the result into func_replace_sysroot_result.
1353 func_replace_sysroot ()
1354 {
1355 case "$lt_sysroot:$1" in
1356 ?*:"$lt_sysroot"*)
1357 func_stripname "$lt_sysroot" '' "$1"
1358 func_replace_sysroot_result="=$func_stripname_result"
1359 ;;
1360 *)
1361 # Including no sysroot.
1362 func_replace_sysroot_result=$1
1363 ;;
1364 esac
1365 }
1366
1367 # func_infer_tag arg
1368 # Infer tagged configuration to use if any are available and
1369 # if one wasn't chosen via the "--tag" command line option.
1370 # Only attempt this if the compiler in the base compile
1371 # command doesn't match the default compiler.
1372 # arg is usually of the form 'gcc ...'
1373 func_infer_tag ()
1374 {
1375 $opt_debug
1376 if test -n "$available_tags" && test -z "$tagname"; then
1377 CC_quoted=
1378 for arg in $CC; do
1379 func_append_quoted CC_quoted "$arg"
1380 done
1381 CC_expanded=`func_echo_all $CC`
1382 CC_quoted_expanded=`func_echo_all $CC_quoted`
1383 case $@ in
1384 # Blanks in the command may have been stripped by the calling shell,
1385 # but not from the CC environment variable when configure was run.
1386 " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
1387 " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;
1388 # Blanks at the start of $base_compile will cause this to fail
1389 # if we don't check for them as well.
1390 *)
1391 for z in $available_tags; do
1392 if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
1393 # Evaluate the configuration.
1394 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
1395 CC_quoted=
1396 for arg in $CC; do
1397 # Double-quote args containing other shell metacharacters.
1398 func_append_quoted CC_quoted "$arg"
1399 done
1400 CC_expanded=`func_echo_all $CC`
1401 CC_quoted_expanded=`func_echo_all $CC_quoted`
1402 case "$@ " in
1403 " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
1404 " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)
1405 # The compiler in the base compile command matches
1406 # the one in the tagged configuration.
1407 # Assume this is the tagged configuration we want.
1408 tagname=$z
1409 break
1410 ;;
1411 esac
1412 fi
1413 done
1414 # If $tagname still isn't set, then no tagged configuration
1415 # was found and let the user know that the "--tag" command
1416 # line option must be used.
1417 if test -z "$tagname"; then
1418 func_echo "unable to infer tagged configuration"
1419 func_fatal_error "specify a tag with \`--tag'"
1420 # else
1421 # func_verbose "using $tagname tagged configuration"
1422 fi
1423 ;;
1424 esac
1425 fi
1426 }
1427
1428
1429
1430 # func_write_libtool_object output_name pic_name nonpic_name
1431 # Create a libtool object file (analogous to a ".la" file),
1432 # but don't create it if we're doing a dry run.
1433 func_write_libtool_object ()
1434 {
1435 write_libobj=${1}
1436 if test "$build_libtool_libs" = yes; then
1437 write_lobj=\'${2}\'
1438 else
1439 write_lobj=none
1440 fi
1441
1442 if test "$build_old_libs" = yes; then
1443 write_oldobj=\'${3}\'
1444 else
1445 write_oldobj=none
1446 fi
1447
1448 $opt_dry_run || {
1449 cat >${write_libobj}T <<EOF
1450 # $write_libobj - a libtool object file
1451 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
1452 #
1453 # Please DO NOT delete this file!
1454 # It is necessary for linking the library.
1455
1456 # Name of the PIC object.
1457 pic_object=$write_lobj
1458
1459 # Name of the non-PIC object
1460 non_pic_object=$write_oldobj
1461
1462 EOF
1463 $MV "${write_libobj}T" "${write_libobj}"
1464 }
1465 }
1466
1467
1468 ##################################################
1469 # FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
1470 ##################################################
1471
1472 # func_convert_core_file_wine_to_w32 ARG
1473 # Helper function used by file name conversion functions when $build is *nix,
1474 # and $host is mingw, cygwin, or some other w32 environment. Relies on a
1475 # correctly configured wine environment available, with the winepath program
1476 # in $build's $PATH.
1477 #
1478 # ARG is the $build file name to be converted to w32 format.
1479 # Result is available in $func_convert_core_file_wine_to_w32_result, and will
1480 # be empty on error (or when ARG is empty)
1481 func_convert_core_file_wine_to_w32 ()
1482 {
1483 $opt_debug
1484 func_convert_core_file_wine_to_w32_result="$1"
1485 if test -n "$1"; then
1486 # Unfortunately, winepath does not exit with a non-zero error code, so we
1487 # are forced to check the contents of stdout. On the other hand, if the
1488 # command is not found, the shell will set an exit code of 127 and print
1489 # *an error message* to stdout. So we must check for both error code of
1490 # zero AND non-empty stdout, which explains the odd construction:
1491 func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
1492 if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then
1493 func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
1494 $SED -e "$lt_sed_naive_backslashify"`
1495 else
1496 func_convert_core_file_wine_to_w32_result=
1497 fi
1498 fi
1499 }
1500 # end: func_convert_core_file_wine_to_w32
1501
1502
1503 # func_convert_core_path_wine_to_w32 ARG
1504 # Helper function used by path conversion functions when $build is *nix, and
1505 # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
1506 # configured wine environment available, with the winepath program in $build's
1507 # $PATH. Assumes ARG has no leading or trailing path separator characters.
1508 #
1509 # ARG is path to be converted from $build format to win32.
1510 # Result is available in $func_convert_core_path_wine_to_w32_result.
1511 # Unconvertible file (directory) names in ARG are skipped; if no directory names
1512 # are convertible, then the result may be empty.
1513 func_convert_core_path_wine_to_w32 ()
1514 {
1515 $opt_debug
1516 # unfortunately, winepath doesn't convert paths, only file names
1517 func_convert_core_path_wine_to_w32_result=""
1518 if test -n "$1"; then
1519 oldIFS=$IFS
1520 IFS=:
1521 for func_convert_core_path_wine_to_w32_f in $1; do
1522 IFS=$oldIFS
1523 func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
1524 if test -n "$func_convert_core_file_wine_to_w32_result" ; then
1525 if test -z "$func_convert_core_path_wine_to_w32_result"; then
1526 func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result"
1527 else
1528 func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
1529 fi
1530 fi
1531 done
1532 IFS=$oldIFS
1533 fi
1534 }
1535 # end: func_convert_core_path_wine_to_w32
1536
1537
1538 # func_cygpath ARGS...
1539 # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
1540 # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
1541 # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
1542 # (2), returns the Cygwin file name or path in func_cygpath_result (input
1543 # file name or path is assumed to be in w32 format, as previously converted
1544 # from $build's *nix or MSYS format). In case (3), returns the w32 file name
1545 # or path in func_cygpath_result (input file name or path is assumed to be in
1546 # Cygwin format). Returns an empty string on error.
1547 #
1548 # ARGS are passed to cygpath, with the last one being the file name or path to
1549 # be converted.
1550 #
1551 # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
1552 # environment variable; do not put it in $PATH.
1553 func_cygpath ()
1554 {
1555 $opt_debug
1556 if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
1557 func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
1558 if test "$?" -ne 0; then
1559 # on failure, ensure result is empty
1560 func_cygpath_result=
1561 fi
1562 else
1563 func_cygpath_result=
1564 func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'"
1565 fi
1566 }
1567 #end: func_cygpath
1568
1569
1570 # func_convert_core_msys_to_w32 ARG
1571 # Convert file name or path ARG from MSYS format to w32 format. Return
1572 # result in func_convert_core_msys_to_w32_result.
1573 func_convert_core_msys_to_w32 ()
1574 {
1575 $opt_debug
1576 # awkward: cmd appends spaces to result
1577 func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
1578 $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
1579 }
1580 #end: func_convert_core_msys_to_w32
1581
1582
1583 # func_convert_file_check ARG1 ARG2
1584 # Verify that ARG1 (a file name in $build format) was converted to $host
1585 # format in ARG2. Otherwise, emit an error message, but continue (resetting
1586 # func_to_host_file_result to ARG1).
1587 func_convert_file_check ()
1588 {
1589 $opt_debug
1590 if test -z "$2" && test -n "$1" ; then
1591 func_error "Could not determine host file name corresponding to"
1592 func_error " \`$1'"
1593 func_error "Continuing, but uninstalled executables may not work."
1594 # Fallback:
1595 func_to_host_file_result="$1"
1596 fi
1597 }
1598 # end func_convert_file_check
1599
1600
1601 # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
1602 # Verify that FROM_PATH (a path in $build format) was converted to $host
1603 # format in TO_PATH. Otherwise, emit an error message, but continue, resetting
1604 # func_to_host_file_result to a simplistic fallback value (see below).
1605 func_convert_path_check ()
1606 {
1607 $opt_debug
1608 if test -z "$4" && test -n "$3"; then
1609 func_error "Could not determine the host path corresponding to"
1610 func_error " \`$3'"
1611 func_error "Continuing, but uninstalled executables may not work."
1612 # Fallback. This is a deliberately simplistic "conversion" and
1613 # should not be "improved". See libtool.info.
1614 if test "x$1" != "x$2"; then
1615 lt_replace_pathsep_chars="s|$1|$2|g"
1616 func_to_host_path_result=`echo "$3" |
1617 $SED -e "$lt_replace_pathsep_chars"`
1618 else
1619 func_to_host_path_result="$3"
1620 fi
1621 fi
1622 }
1623 # end func_convert_path_check
1624
1625
1626 # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
1627 # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
1628 # and appending REPL if ORIG matches BACKPAT.
1629 func_convert_path_front_back_pathsep ()
1630 {
1631 $opt_debug
1632 case $4 in
1633 $1 ) func_to_host_path_result="$3$func_to_host_path_result"
1634 ;;
1635 esac
1636 case $4 in
1637 $2 ) func_append func_to_host_path_result "$3"
1638 ;;
1639 esac
1640 }
1641 # end func_convert_path_front_back_pathsep
1642
1643
1644 ##################################################
1645 # $build to $host FILE NAME CONVERSION FUNCTIONS #
1646 ##################################################
1647 # invoked via `$to_host_file_cmd ARG'
1648 #
1649 # In each case, ARG is the path to be converted from $build to $host format.
1650 # Result will be available in $func_to_host_file_result.
1651
1652
1653 # func_to_host_file ARG
1654 # Converts the file name ARG from $build format to $host format. Return result
1655 # in func_to_host_file_result.
1656 func_to_host_file ()
1657 {
1658 $opt_debug
1659 $to_host_file_cmd "$1"
1660 }
1661 # end func_to_host_file
1662
1663
1664 # func_to_tool_file ARG LAZY
1665 # converts the file name ARG from $build format to toolchain format. Return
1666 # result in func_to_tool_file_result. If the conversion in use is listed
1667 # in (the comma separated) LAZY, no conversion takes place.
1668 func_to_tool_file ()
1669 {
1670 $opt_debug
1671 case ,$2, in
1672 *,"$to_tool_file_cmd",*)
1673 func_to_tool_file_result=$1
1674 ;;
1675 *)
1676 $to_tool_file_cmd "$1"
1677 func_to_tool_file_result=$func_to_host_file_result
1678 ;;
1679 esac
1680 }
1681 # end func_to_tool_file
1682
1683
1684 # func_convert_file_noop ARG
1685 # Copy ARG to func_to_host_file_result.
1686 func_convert_file_noop ()
1687 {
1688 func_to_host_file_result="$1"
1689 }
1690 # end func_convert_file_noop
1691
1692
1693 # func_convert_file_msys_to_w32 ARG
1694 # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
1695 # conversion to w32 is not available inside the cwrapper. Returns result in
1696 # func_to_host_file_result.
1697 func_convert_file_msys_to_w32 ()
1698 {
1699 $opt_debug
1700 func_to_host_file_result="$1"
1701 if test -n "$1"; then
1702 func_convert_core_msys_to_w32 "$1"
1703 func_to_host_file_result="$func_convert_core_msys_to_w32_result"
1704 fi
1705 func_convert_file_check "$1" "$func_to_host_file_result"
1706 }
1707 # end func_convert_file_msys_to_w32
1708
1709
1710 # func_convert_file_cygwin_to_w32 ARG
1711 # Convert file name ARG from Cygwin to w32 format. Returns result in
1712 # func_to_host_file_result.
1713 func_convert_file_cygwin_to_w32 ()
1714 {
1715 $opt_debug
1716 func_to_host_file_result="$1"
1717 if test -n "$1"; then
1718 # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
1719 # LT_CYGPATH in this case.
1720 func_to_host_file_result=`cygpath -m "$1"`
1721 fi
1722 func_convert_file_check "$1" "$func_to_host_file_result"
1723 }
1724 # end func_convert_file_cygwin_to_w32
1725
1726
1727 # func_convert_file_nix_to_w32 ARG
1728 # Convert file name ARG from *nix to w32 format. Requires a wine environment
1729 # and a working winepath. Returns result in func_to_host_file_result.
1730 func_convert_file_nix_to_w32 ()
1731 {
1732 $opt_debug
1733 func_to_host_file_result="$1"
1734 if test -n "$1"; then
1735 func_convert_core_file_wine_to_w32 "$1"
1736 func_to_host_file_result="$func_convert_core_file_wine_to_w32_result"
1737 fi
1738 func_convert_file_check "$1" "$func_to_host_file_result"
1739 }
1740 # end func_convert_file_nix_to_w32
1741
1742
1743 # func_convert_file_msys_to_cygwin ARG
1744 # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
1745 # Returns result in func_to_host_file_result.
1746 func_convert_file_msys_to_cygwin ()
1747 {
1748 $opt_debug
1749 func_to_host_file_result="$1"
1750 if test -n "$1"; then
1751 func_convert_core_msys_to_w32 "$1"
1752 func_cygpath -u "$func_convert_core_msys_to_w32_result"
1753 func_to_host_file_result="$func_cygpath_result"
1754 fi
1755 func_convert_file_check "$1" "$func_to_host_file_result"
1756 }
1757 # end func_convert_file_msys_to_cygwin
1758
1759
1760 # func_convert_file_nix_to_cygwin ARG
1761 # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed
1762 # in a wine environment, working winepath, and LT_CYGPATH set. Returns result
1763 # in func_to_host_file_result.
1764 func_convert_file_nix_to_cygwin ()
1765 {
1766 $opt_debug
1767 func_to_host_file_result="$1"
1768 if test -n "$1"; then
1769 # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
1770 func_convert_core_file_wine_to_w32 "$1"
1771 func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
1772 func_to_host_file_result="$func_cygpath_result"
1773 fi
1774 func_convert_file_check "$1" "$func_to_host_file_result"
1775 }
1776 # end func_convert_file_nix_to_cygwin
1777
1778
1779 #############################################
1780 # $build to $host PATH CONVERSION FUNCTIONS #
1781 #############################################
1782 # invoked via `$to_host_path_cmd ARG'
1783 #
1784 # In each case, ARG is the path to be converted from $build to $host format.
1785 # The result will be available in $func_to_host_path_result.
1786 #
1787 # Path separators are also converted from $build format to $host format. If
1788 # ARG begins or ends with a path separator character, it is preserved (but
1789 # converted to $host format) on output.
1790 #
1791 # All path conversion functions are named using the following convention:
1792 # file name conversion function : func_convert_file_X_to_Y ()
1793 # path conversion function : func_convert_path_X_to_Y ()
1794 # where, for any given $build/$host combination the 'X_to_Y' value is the
1795 # same. If conversion functions are added for new $build/$host combinations,
1796 # the two new functions must follow this pattern, or func_init_to_host_path_cmd
1797 # will break.
1798
1799
1800 # func_init_to_host_path_cmd
1801 # Ensures that function "pointer" variable $to_host_path_cmd is set to the
1802 # appropriate value, based on the value of $to_host_file_cmd.
1803 to_host_path_cmd=
1804 func_init_to_host_path_cmd ()
1805 {
1806 $opt_debug
1807 if test -z "$to_host_path_cmd"; then
1808 func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
1809 to_host_path_cmd="func_convert_path_${func_stripname_result}"
1810 fi
1811 }
1812
1813
1814 # func_to_host_path ARG
1815 # Converts the path ARG from $build format to $host format. Return result
1816 # in func_to_host_path_result.
1817 func_to_host_path ()
1818 {
1819 $opt_debug
1820 func_init_to_host_path_cmd
1821 $to_host_path_cmd "$1"
1822 }
1823 # end func_to_host_path
1824
1825
1826 # func_convert_path_noop ARG
1827 # Copy ARG to func_to_host_path_result.
1828 func_convert_path_noop ()
1829 {
1830 func_to_host_path_result="$1"
1831 }
1832 # end func_convert_path_noop
1833
1834
1835 # func_convert_path_msys_to_w32 ARG
1836 # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
1837 # conversion to w32 is not available inside the cwrapper. Returns result in
1838 # func_to_host_path_result.
1839 func_convert_path_msys_to_w32 ()
1840 {
1841 $opt_debug
1842 func_to_host_path_result="$1"
1843 if test -n "$1"; then
1844 # Remove leading and trailing path separator characters from ARG. MSYS
1845 # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
1846 # and winepath ignores them completely.
1847 func_stripname : : "$1"
1848 func_to_host_path_tmp1=$func_stripname_result
1849 func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
1850 func_to_host_path_result="$func_convert_core_msys_to_w32_result"
1851 func_convert_path_check : ";" \
1852 "$func_to_host_path_tmp1" "$func_to_host_path_result"
1853 func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
1854 fi
1855 }
1856 # end func_convert_path_msys_to_w32
1857
1858
1859 # func_convert_path_cygwin_to_w32 ARG
1860 # Convert path ARG from Cygwin to w32 format. Returns result in
1861 # func_to_host_file_result.
1862 func_convert_path_cygwin_to_w32 ()
1863 {
1864 $opt_debug
1865 func_to_host_path_result="$1"
1866 if test -n "$1"; then
1867 # See func_convert_path_msys_to_w32:
1868 func_stripname : : "$1"
1869 func_to_host_path_tmp1=$func_stripname_result
1870 func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
1871 func_convert_path_check : ";" \
1872 "$func_to_host_path_tmp1" "$func_to_host_path_result"
1873 func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
1874 fi
1875 }
1876 # end func_convert_path_cygwin_to_w32
1877
1878
1879 # func_convert_path_nix_to_w32 ARG
1880 # Convert path ARG from *nix to w32 format. Requires a wine environment and
1881 # a working winepath. Returns result in func_to_host_file_result.
1882 func_convert_path_nix_to_w32 ()
1883 {
1884 $opt_debug
1885 func_to_host_path_result="$1"
1886 if test -n "$1"; then
1887 # See func_convert_path_msys_to_w32:
1888 func_stripname : : "$1"
1889 func_to_host_path_tmp1=$func_stripname_result
1890 func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
1891 func_to_host_path_result="$func_convert_core_path_wine_to_w32_result"
1892 func_convert_path_check : ";" \
1893 "$func_to_host_path_tmp1" "$func_to_host_path_result"
1894 func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
1895 fi
1896 }
1897 # end func_convert_path_nix_to_w32
1898
1899
1900 # func_convert_path_msys_to_cygwin ARG
1901 # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
1902 # Returns result in func_to_host_file_result.
1903 func_convert_path_msys_to_cygwin ()
1904 {
1905 $opt_debug
1906 func_to_host_path_result="$1"
1907 if test -n "$1"; then
1908 # See func_convert_path_msys_to_w32:
1909 func_stripname : : "$1"
1910 func_to_host_path_tmp1=$func_stripname_result
1911 func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
1912 func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
1913 func_to_host_path_result="$func_cygpath_result"
1914 func_convert_path_check : : \
1915 "$func_to_host_path_tmp1" "$func_to_host_path_result"
1916 func_convert_path_front_back_pathsep ":*" "*:" : "$1"
1917 fi
1918 }
1919 # end func_convert_path_msys_to_cygwin
1920
1921
1922 # func_convert_path_nix_to_cygwin ARG
1923 # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a
1924 # a wine environment, working winepath, and LT_CYGPATH set. Returns result in
1925 # func_to_host_file_result.
1926 func_convert_path_nix_to_cygwin ()
1927 {
1928 $opt_debug
1929 func_to_host_path_result="$1"
1930 if test -n "$1"; then
1931 # Remove leading and trailing path separator characters from
1932 # ARG. msys behavior is inconsistent here, cygpath turns them
1933 # into '.;' and ';.', and winepath ignores them completely.
1934 func_stripname : : "$1"
1935 func_to_host_path_tmp1=$func_stripname_result
1936 func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
1937 func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
1938 func_to_host_path_result="$func_cygpath_result"
1939 func_convert_path_check : : \
1940 "$func_to_host_path_tmp1" "$func_to_host_path_result"
1941 func_convert_path_front_back_pathsep ":*" "*:" : "$1"
1942 fi
1943 }
1944 # end func_convert_path_nix_to_cygwin
1945
1946
1947 # func_mode_compile arg...
1948 func_mode_compile ()
1949 {
1950 $opt_debug
1951 # Get the compilation command and the source file.
1952 base_compile=
1953 srcfile="$nonopt" # always keep a non-empty value in "srcfile"
1954 suppress_opt=yes
1955 suppress_output=
1956 arg_mode=normal
1957 libobj=
1958 later=
1959 pie_flag=
1960
1961 for arg
1962 do
1963 case $arg_mode in
1964 arg )
1965 # do not "continue". Instead, add this to base_compile
1966 lastarg="$arg"
1967 arg_mode=normal
1968 ;;
1969
1970 target )
1971 libobj="$arg"
1972 arg_mode=normal
1973 continue
1974 ;;
1975
1976 normal )
1977 # Accept any command-line options.
1978 case $arg in
1979 -o)
1980 test -n "$libobj" && \
1981 func_fatal_error "you cannot specify \`-o' more than once"
1982 arg_mode=target
1983 continue
1984 ;;
1985
1986 -pie | -fpie | -fPIE)
1987 func_append pie_flag " $arg"
1988 continue
1989 ;;
1990
1991 -shared | -static | -prefer-pic | -prefer-non-pic)
1992 func_append later " $arg"
1993 continue
1994 ;;
1995
1996 -no-suppress)
1997 suppress_opt=no
1998 continue
1999 ;;
2000
2001 -Xcompiler)
2002 arg_mode=arg # the next one goes into the "base_compile" arg list
2003 continue # The current "srcfile" will either be retained or
2004 ;; # replaced later. I would guess that would be a bug.
2005
2006 -Wc,*)
2007 func_stripname '-Wc,' '' "$arg"
2008 args=$func_stripname_result
2009 lastarg=
2010 save_ifs="$IFS"; IFS=','
2011 for arg in $args; do
2012 IFS="$save_ifs"
2013 func_append_quoted lastarg "$arg"
2014 done
2015 IFS="$save_ifs"
2016 func_stripname ' ' '' "$lastarg"
2017 lastarg=$func_stripname_result
2018
2019 # Add the arguments to base_compile.
2020 func_append base_compile " $lastarg"
2021 continue
2022 ;;
2023
2024 *)
2025 # Accept the current argument as the source file.
2026 # The previous "srcfile" becomes the current argument.
2027 #
2028 lastarg="$srcfile"
2029 srcfile="$arg"
2030 ;;
2031 esac # case $arg
2032 ;;
2033 esac # case $arg_mode
2034
2035 # Aesthetically quote the previous argument.
2036 func_append_quoted base_compile "$lastarg"
2037 done # for arg
2038
2039 case $arg_mode in
2040 arg)
2041 func_fatal_error "you must specify an argument for -Xcompile"
2042 ;;
2043 target)
2044 func_fatal_error "you must specify a target with \`-o'"
2045 ;;
2046 *)
2047 # Get the name of the library object.
2048 test -z "$libobj" && {
2049 func_basename "$srcfile"
2050 libobj="$func_basename_result"
2051 }
2052 ;;
2053 esac
2054
2055 # Recognize several different file suffixes.
2056 # If the user specifies -o file.o, it is replaced with file.lo
2057 case $libobj in
2058 *.[cCFSifmso] | \
2059 *.ada | *.adb | *.ads | *.asm | \
2060 *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
2061 *.[fF][09]? | *.for | *.java | *.obj | *.sx | *.cu | *.cup)
2062 func_xform "$libobj"
2063 libobj=$func_xform_result
2064 ;;
2065 esac
2066
2067 case $libobj in
2068 *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
2069 *)
2070 func_fatal_error "cannot determine name of library object from \`$libobj'"
2071 ;;
2072 esac
2073
2074 func_infer_tag $base_compile
2075
2076 for arg in $later; do
2077 case $arg in
2078 -shared)
2079 test "$build_libtool_libs" != yes && \
2080 func_fatal_configuration "can not build a shared library"
2081 build_old_libs=no
2082 continue
2083 ;;
2084
2085 -static)
2086 build_libtool_libs=no
2087 build_old_libs=yes
2088 continue
2089 ;;
2090
2091 -prefer-pic)
2092 pic_mode=yes
2093 continue
2094 ;;
2095
2096 -prefer-non-pic)
2097 pic_mode=no
2098 continue
2099 ;;
2100 esac
2101 done
2102
2103 func_quote_for_eval "$libobj"
2104 test "X$libobj" != "X$func_quote_for_eval_result" \
2105 && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
2106 && func_warning "libobj name \`$libobj' may not contain shell special characters."
2107 func_dirname_and_basename "$obj" "/" ""
2108 objname="$func_basename_result"
2109 xdir="$func_dirname_result"
2110 lobj=${xdir}$objdir/$objname
2111
2112 test -z "$base_compile" && \
2113 func_fatal_help "you must specify a compilation command"
2114
2115 # Delete any leftover library objects.
2116 if test "$build_old_libs" = yes; then
2117 removelist="$obj $lobj $libobj ${libobj}T"
2118 else
2119 removelist="$lobj $libobj ${libobj}T"
2120 fi
2121
2122 # On Cygwin there's no "real" PIC flag so we must build both object types
2123 case $host_os in
2124 cygwin* | mingw* | pw32* | os2* | cegcc*)
2125 pic_mode=default
2126 ;;
2127 esac
2128 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
2129 # non-PIC code in shared libraries is not supported
2130 pic_mode=default
2131 fi
2132
2133 # Calculate the filename of the output object if compiler does
2134 # not support -o with -c
2135 if test "$compiler_c_o" = no; then
2136 output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext}
2137 lockfile="$output_obj.lock"
2138 else
2139 output_obj=
2140 need_locks=no
2141 lockfile=
2142 fi
2143
2144 # Lock this critical section if it is needed
2145 # We use this script file to make the link, it avoids creating a new file
2146 if test "$need_locks" = yes; then
2147 until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
2148 func_echo "Waiting for $lockfile to be removed"
2149 sleep 2
2150 done
2151 elif test "$need_locks" = warn; then
2152 if test -f "$lockfile"; then
2153 $ECHO "\
2154 *** ERROR, $lockfile exists and contains:
2155 `cat $lockfile 2>/dev/null`
2156
2157 This indicates that another process is trying to use the same
2158 temporary object file, and libtool could not work around it because
2159 your compiler does not support \`-c' and \`-o' together. If you
2160 repeat this compilation, it may succeed, by chance, but you had better
2161 avoid parallel builds (make -j) in this platform, or get a better
2162 compiler."
2163
2164 $opt_dry_run || $RM $removelist
2165 exit $EXIT_FAILURE
2166 fi
2167 func_append removelist " $output_obj"
2168 $ECHO "$srcfile" > "$lockfile"
2169 fi
2170
2171 $opt_dry_run || $RM $removelist
2172 func_append removelist " $lockfile"
2173 trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
2174
2175 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
2176 srcfile=$func_to_tool_file_result
2177 func_quote_for_eval "$srcfile"
2178 qsrcfile=$func_quote_for_eval_result
2179
2180 # Only build a PIC object if we are building libtool libraries.
2181 if test "$build_libtool_libs" = yes; then
2182 # Without this assignment, base_compile gets emptied.
2183 fbsd_hideous_sh_bug=$base_compile
2184
2185 if test "$pic_mode" != no; then
2186 command="$base_compile $qsrcfile $pic_flag"
2187 else
2188 # Don't build PIC code
2189 command="$base_compile $qsrcfile"
2190 fi
2191
2192 func_mkdir_p "$xdir$objdir"
2193
2194 if test -z "$output_obj"; then
2195 # Place PIC objects in $objdir
2196 func_append command " -o $lobj"
2197 fi
2198
2199 func_show_eval_locale "$command" \
2200 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
2201
2202 if test "$need_locks" = warn &&
2203 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
2204 $ECHO "\
2205 *** ERROR, $lockfile contains:
2206 `cat $lockfile 2>/dev/null`
2207
2208 but it should contain:
2209 $srcfile
2210
2211 This indicates that another process is trying to use the same
2212 temporary object file, and libtool could not work around it because
2213 your compiler does not support \`-c' and \`-o' together. If you
2214 repeat this compilation, it may succeed, by chance, but you had better
2215 avoid parallel builds (make -j) in this platform, or get a better
2216 compiler."
2217
2218 $opt_dry_run || $RM $removelist
2219 exit $EXIT_FAILURE
2220 fi
2221
2222 # Just move the object if needed, then go on to compile the next one
2223 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
2224 func_show_eval '$MV "$output_obj" "$lobj"' \
2225 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
2226 fi
2227
2228 # Allow error messages only from the first compilation.
2229 if test "$suppress_opt" = yes; then
2230 suppress_output=' >/dev/null 2>&1'
2231 fi
2232 fi
2233
2234 # Only build a position-dependent object if we build old libraries.
2235 if test "$build_old_libs" = yes; then
2236 if test "$pic_mode" != yes; then
2237 # Don't build PIC code
2238 command="$base_compile $qsrcfile$pie_flag"
2239 else
2240 command="$base_compile $qsrcfile $pic_flag"
2241 fi
2242 if test "$compiler_c_o" = yes; then
2243 func_append command " -o $obj"
2244 fi
2245
2246 # Suppress compiler output if we already did a PIC compilation.
2247 func_append command "$suppress_output"
2248 func_show_eval_locale "$command" \
2249 '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
2250
2251 if test "$need_locks" = warn &&
2252 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
2253 $ECHO "\
2254 *** ERROR, $lockfile contains:
2255 `cat $lockfile 2>/dev/null`
2256
2257 but it should contain:
2258 $srcfile
2259
2260 This indicates that another process is trying to use the same
2261 temporary object file, and libtool could not work around it because
2262 your compiler does not support \`-c' and \`-o' together. If you
2263 repeat this compilation, it may succeed, by chance, but you had better
2264 avoid parallel builds (make -j) in this platform, or get a better
2265 compiler."
2266
2267 $opt_dry_run || $RM $removelist
2268 exit $EXIT_FAILURE
2269 fi
2270
2271 # Just move the object if needed
2272 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
2273 func_show_eval '$MV "$output_obj" "$obj"' \
2274 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
2275 fi
2276 fi
2277
2278 $opt_dry_run || {
2279 func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
2280
2281 # Unlock the critical section if it was locked
2282 if test "$need_locks" != no; then
2283 removelist=$lockfile
2284 $RM "$lockfile"
2285 fi
2286 }
2287
2288 exit $EXIT_SUCCESS
2289 }
2290
2291 $opt_help || {
2292 test "$opt_mode" = compile && func_mode_compile ${1+"$@"}
2293 }
2294
2295 func_mode_help ()
2296 {
2297 # We need to display help for each of the modes.
2298 case $opt_mode in
2299 "")
2300 # Generic help is extracted from the usage comments
2301 # at the start of this file.
2302 func_help
2303 ;;
2304
2305 clean)
2306 $ECHO \
2307 "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
2308
2309 Remove files from the build directory.
2310
2311 RM is the name of the program to use to delete files associated with each FILE
2312 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
2313 to RM.
2314
2315 If FILE is a libtool library, object or program, all the files associated
2316 with it are deleted. Otherwise, only FILE itself is deleted using RM."
2317 ;;
2318
2319 compile)
2320 $ECHO \
2321 "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
2322
2323 Compile a source file into a libtool library object.
2324
2325 This mode accepts the following additional options:
2326
2327 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
2328 -no-suppress do not suppress compiler output for multiple passes
2329 -prefer-pic try to build PIC objects only
2330 -prefer-non-pic try to build non-PIC objects only
2331 -shared do not build a \`.o' file suitable for static linking
2332 -static only build a \`.o' file suitable for static linking
2333 -Wc,FLAG pass FLAG directly to the compiler
2334
2335 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
2336 from the given SOURCEFILE.
2337
2338 The output file name is determined by removing the directory component from
2339 SOURCEFILE, then substituting the C source code suffix \`.c' with the
2340 library object suffix, \`.lo'."
2341 ;;
2342
2343 execute)
2344 $ECHO \
2345 "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
2346
2347 Automatically set library path, then run a program.
2348
2349 This mode accepts the following additional options:
2350
2351 -dlopen FILE add the directory containing FILE to the library path
2352
2353 This mode sets the library path environment variable according to \`-dlopen'
2354 flags.
2355
2356 If any of the ARGS are libtool executable wrappers, then they are translated
2357 into their corresponding uninstalled binary, and any of their required library
2358 directories are added to the library path.
2359
2360 Then, COMMAND is executed, with ARGS as arguments."
2361 ;;
2362
2363 finish)
2364 $ECHO \
2365 "Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
2366
2367 Complete the installation of libtool libraries.
2368
2369 Each LIBDIR is a directory that contains libtool libraries.
2370
2371 The commands that this mode executes may require superuser privileges. Use
2372 the \`--dry-run' option if you just want to see what would be executed."
2373 ;;
2374
2375 install)
2376 $ECHO \
2377 "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
2378
2379 Install executables or libraries.
2380
2381 INSTALL-COMMAND is the installation command. The first component should be
2382 either the \`install' or \`cp' program.
2383
2384 The following components of INSTALL-COMMAND are treated specially:
2385
2386 -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation
2387
2388 The rest of the components are interpreted as arguments to that command (only
2389 BSD-compatible install options are recognized)."
2390 ;;
2391
2392 link)
2393 $ECHO \
2394 "Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
2395
2396 Link object files or libraries together to form another library, or to
2397 create an executable program.
2398
2399 LINK-COMMAND is a command using the C compiler that you would use to create
2400 a program from several object files.
2401
2402 The following components of LINK-COMMAND are treated specially:
2403
2404 -all-static do not do any dynamic linking at all
2405 -avoid-version do not add a version suffix if possible
2406 -bindir BINDIR specify path to binaries directory (for systems where
2407 libraries must be found in the PATH setting at runtime)
2408 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
2409 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
2410 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
2411 -export-symbols SYMFILE
2412 try to export only the symbols listed in SYMFILE
2413 -export-symbols-regex REGEX
2414 try to export only the symbols matching REGEX
2415 -LLIBDIR search LIBDIR for required installed libraries
2416 -lNAME OUTPUT-FILE requires the installed library libNAME
2417 -module build a library that can dlopened
2418 -no-fast-install disable the fast-install mode
2419 -no-install link a not-installable executable
2420 -no-undefined declare that a library does not refer to external symbols
2421 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
2422 -objectlist FILE Use a list of object files found in FILE to specify objects
2423 -precious-files-regex REGEX
2424 don't remove output files matching REGEX
2425 -release RELEASE specify package release information
2426 -rpath LIBDIR the created library will eventually be installed in LIBDIR
2427 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
2428 -shared only do dynamic linking of libtool libraries
2429 -shrext SUFFIX override the standard shared library file extension
2430 -static do not do any dynamic linking of uninstalled libtool libraries
2431 -static-libtool-libs
2432 do not do any dynamic linking of libtool libraries
2433 -version-info CURRENT[:REVISION[:AGE]]
2434 specify library version info [each variable defaults to 0]
2435 -weak LIBNAME declare that the target provides the LIBNAME interface
2436 -Wc,FLAG
2437 -Xcompiler FLAG pass linker-specific FLAG directly to the compiler
2438 -Wl,FLAG
2439 -Xlinker FLAG pass linker-specific FLAG directly to the linker
2440 -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC)
2441
2442 All other options (arguments beginning with \`-') are ignored.
2443
2444 Every other argument is treated as a filename. Files ending in \`.la' are
2445 treated as uninstalled libtool libraries, other files are standard or library
2446 object files.
2447
2448 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
2449 only library objects (\`.lo' files) may be specified, and \`-rpath' is
2450 required, except when creating a convenience library.
2451
2452 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
2453 using \`ar' and \`ranlib', or on Windows using \`lib'.
2454
2455 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
2456 is created, otherwise an executable program is created."
2457 ;;
2458
2459 uninstall)
2460 $ECHO \
2461 "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
2462
2463 Remove libraries from an installation directory.
2464
2465 RM is the name of the program to use to delete files associated with each FILE
2466 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
2467 to RM.
2468
2469 If FILE is a libtool library, all the files associated with it are deleted.
2470 Otherwise, only FILE itself is deleted using RM."
2471 ;;
2472
2473 *)
2474 func_fatal_help "invalid operation mode \`$opt_mode'"
2475 ;;
2476 esac
2477
2478 echo
2479 $ECHO "Try \`$progname --help' for more information about other modes."
2480 }
2481
2482 # Now that we've collected a possible --mode arg, show help if necessary
2483 if $opt_help; then
2484 if test "$opt_help" = :; then
2485 func_mode_help
2486 else
2487 {
2488 func_help noexit
2489 for opt_mode in compile link execute install finish uninstall clean; do
2490 func_mode_help
2491 done
2492 } | sed -n '1p; 2,$s/^Usage:/ or: /p'
2493 {
2494 func_help noexit
2495 for opt_mode in compile link execute install finish uninstall clean; do
2496 echo
2497 func_mode_help
2498 done
2499 } |
2500 sed '1d
2501 /^When reporting/,/^Report/{
2502 H
2503 d
2504 }
2505 $x
2506 /information about other modes/d
2507 /more detailed .*MODE/d
2508 s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
2509 fi
2510 exit $?
2511 fi
2512
2513
2514 # func_mode_execute arg...
2515 func_mode_execute ()
2516 {
2517 $opt_debug
2518 # The first argument is the command name.
2519 cmd="$nonopt"
2520 test -z "$cmd" && \
2521 func_fatal_help "you must specify a COMMAND"
2522
2523 # Handle -dlopen flags immediately.
2524 for file in $opt_dlopen; do
2525 test -f "$file" \
2526 || func_fatal_help "\`$file' is not a file"
2527
2528 dir=
2529 case $file in
2530 *.la)
2531 func_resolve_sysroot "$file"
2532 file=$func_resolve_sysroot_result
2533
2534 # Check to see that this really is a libtool archive.
2535 func_lalib_unsafe_p "$file" \
2536 || func_fatal_help "\`$lib' is not a valid libtool archive"
2537
2538 # Read the libtool library.
2539 dlname=
2540 library_names=
2541 func_source "$file"
2542
2543 # Skip this library if it cannot be dlopened.
2544 if test -z "$dlname"; then
2545 # Warn if it was a shared library.
2546 test -n "$library_names" && \
2547 func_warning "\`$file' was not linked with \`-export-dynamic'"
2548 continue
2549 fi
2550
2551 func_dirname "$file" "" "."
2552 dir="$func_dirname_result"
2553
2554 if test -f "$dir/$objdir/$dlname"; then
2555 func_append dir "/$objdir"
2556 else
2557 if test ! -f "$dir/$dlname"; then
2558 func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
2559 fi
2560 fi
2561 ;;
2562
2563 *.lo)
2564 # Just add the directory containing the .lo file.
2565 func_dirname "$file" "" "."
2566 dir="$func_dirname_result"
2567 ;;
2568
2569 *)
2570 func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
2571 continue
2572 ;;
2573 esac
2574
2575 # Get the absolute pathname.
2576 absdir=`cd "$dir" && pwd`
2577 test -n "$absdir" && dir="$absdir"
2578
2579 # Now add the directory to shlibpath_var.
2580 if eval "test -z \"\$$shlibpath_var\""; then
2581 eval "$shlibpath_var=\"\$dir\""
2582 else
2583 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
2584 fi
2585 done
2586
2587 # This variable tells wrapper scripts just to set shlibpath_var
2588 # rather than running their programs.
2589 libtool_execute_magic="$magic"
2590
2591 # Check if any of the arguments is a wrapper script.
2592 args=
2593 for file
2594 do
2595 case $file in
2596 -* | *.la | *.lo ) ;;
2597 *)
2598 # Do a test to see if this is really a libtool program.
2599 if func_ltwrapper_script_p "$file"; then
2600 func_source "$file"
2601 # Transform arg to wrapped name.
2602 file="$progdir/$program"
2603 elif func_ltwrapper_executable_p "$file"; then
2604 func_ltwrapper_scriptname "$file"
2605 func_source "$func_ltwrapper_scriptname_result"
2606 # Transform arg to wrapped name.
2607 file="$progdir/$program"
2608 fi
2609 ;;
2610 esac
2611 # Quote arguments (to preserve shell metacharacters).
2612 func_append_quoted args "$file"
2613 done
2614
2615 if test "X$opt_dry_run" = Xfalse; then
2616 if test -n "$shlibpath_var"; then
2617 # Export the shlibpath_var.
2618 eval "export $shlibpath_var"
2619 fi
2620
2621 # Restore saved environment variables
2622 for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
2623 do
2624 eval "if test \"\${save_$lt_var+set}\" = set; then
2625 $lt_var=\$save_$lt_var; export $lt_var
2626 else
2627 $lt_unset $lt_var
2628 fi"
2629 done
2630
2631 # Now prepare to actually exec the command.
2632 exec_cmd="\$cmd$args"
2633 else
2634 # Display what would be done.
2635 if test -n "$shlibpath_var"; then
2636 eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
2637 echo "export $shlibpath_var"
2638 fi
2639 $ECHO "$cmd$args"
2640 exit $EXIT_SUCCESS
2641 fi
2642 }
2643
2644 test "$opt_mode" = execute && func_mode_execute ${1+"$@"}
2645
2646
2647 # func_mode_finish arg...
2648 func_mode_finish ()
2649 {
2650 $opt_debug
2651 libs=
2652 libdirs=
2653 admincmds=
2654
2655 for opt in "$nonopt" ${1+"$@"}
2656 do
2657 if test -d "$opt"; then
2658 func_append libdirs " $opt"
2659
2660 elif test -f "$opt"; then
2661 if func_lalib_unsafe_p "$opt"; then
2662 func_append libs " $opt"
2663 else
2664 func_warning "\`$opt' is not a valid libtool archive"
2665 fi
2666
2667 else
2668 func_fatal_error "invalid argument \`$opt'"
2669 fi
2670 done
2671
2672 if test -n "$libs"; then
2673 if test -n "$lt_sysroot"; then
2674 sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`
2675 sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"
2676 else
2677 sysroot_cmd=
2678 fi
2679
2680 # Remove sysroot references
2681 if $opt_dry_run; then
2682 for lib in $libs; do
2683 echo "removing references to $lt_sysroot and \`=' prefixes from $lib"
2684 done
2685 else
2686 tmpdir=`func_mktempdir`
2687 for lib in $libs; do
2688 sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
2689 > $tmpdir/tmp-la
2690 mv -f $tmpdir/tmp-la $lib
2691 done
2692 ${RM}r "$tmpdir"
2693 fi
2694 fi
2695
2696 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
2697 for libdir in $libdirs; do
2698 if test -n "$finish_cmds"; then
2699 # Do each command in the finish commands.
2700 func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
2701 '"$cmd"'"'
2702 fi
2703 if test -n "$finish_eval"; then
2704 # Do the single finish_eval.
2705 eval cmds=\"$finish_eval\"
2706 $opt_dry_run || eval "$cmds" || func_append admincmds "
2707 $cmds"
2708 fi
2709 done
2710 fi
2711
2712 # Exit here if they wanted silent mode.
2713 $opt_silent && exit $EXIT_SUCCESS
2714
2715 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
2716 echo "----------------------------------------------------------------------"
2717 echo "Libraries have been installed in:"
2718 for libdir in $libdirs; do
2719 $ECHO " $libdir"
2720 done
2721 echo
2722 echo "If you ever happen to want to link against installed libraries"
2723 echo "in a given directory, LIBDIR, you must either use libtool, and"
2724 echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
2725 echo "flag during linking and do at least one of the following:"
2726 if test -n "$shlibpath_var"; then
2727 echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
2728 echo " during execution"
2729 fi
2730 if test -n "$runpath_var"; then
2731 echo " - add LIBDIR to the \`$runpath_var' environment variable"
2732 echo " during linking"
2733 fi
2734 if test -n "$hardcode_libdir_flag_spec"; then
2735 libdir=LIBDIR
2736 eval flag=\"$hardcode_libdir_flag_spec\"
2737
2738 $ECHO " - use the \`$flag' linker flag"
2739 fi
2740 if test -n "$admincmds"; then
2741 $ECHO " - have your system administrator run these commands:$admincmds"
2742 fi
2743 if test -f /etc/ld.so.conf; then
2744 echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
2745 fi
2746 echo
2747
2748 echo "See any operating system documentation about shared libraries for"
2749 case $host in
2750 solaris2.[6789]|solaris2.1[0-9])
2751 echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
2752 echo "pages."
2753 ;;
2754 *)
2755 echo "more information, such as the ld(1) and ld.so(8) manual pages."
2756 ;;
2757 esac
2758 echo "----------------------------------------------------------------------"
2759 fi
2760 exit $EXIT_SUCCESS
2761 }
2762
2763 test "$opt_mode" = finish && func_mode_finish ${1+"$@"}
2764
2765
2766 # func_mode_install arg...
2767 func_mode_install ()
2768 {
2769 $opt_debug
2770 # There may be an optional sh(1) argument at the beginning of
2771 # install_prog (especially on Windows NT).
2772 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
2773 # Allow the use of GNU shtool's install command.
2774 case $nonopt in *shtool*) :;; *) false;; esac; then
2775 # Aesthetically quote it.
2776 func_quote_for_eval "$nonopt"
2777 install_prog="$func_quote_for_eval_result "
2778 arg=$1
2779 shift
2780 else
2781 install_prog=
2782 arg=$nonopt
2783 fi
2784
2785 # The real first argument should be the name of the installation program.
2786 # Aesthetically quote it.
2787 func_quote_for_eval "$arg"
2788 func_append install_prog "$func_quote_for_eval_result"
2789 install_shared_prog=$install_prog
2790 case " $install_prog " in
2791 *[\\\ /]cp\ *) install_cp=: ;;
2792 *) install_cp=false ;;
2793 esac
2794
2795 # We need to accept at least all the BSD install flags.
2796 dest=
2797 files=
2798 opts=
2799 prev=
2800 install_type=
2801 isdir=no
2802 stripme=
2803 no_mode=:
2804 for arg
2805 do
2806 arg2=
2807 if test -n "$dest"; then
2808 func_append files " $dest"
2809 dest=$arg
2810 continue
2811 fi
2812
2813 case $arg in
2814 -d) isdir=yes ;;
2815 -f)
2816 if $install_cp; then :; else
2817 prev=$arg
2818 fi
2819 ;;
2820 -g | -m | -o)
2821 prev=$arg
2822 ;;
2823 -s)
2824 stripme=" -s"
2825 continue
2826 ;;
2827 -*)
2828 ;;
2829 *)
2830 # If the previous option needed an argument, then skip it.
2831 if test -n "$prev"; then
2832 if test "x$prev" = x-m && test -n "$install_override_mode"; then
2833 arg2=$install_override_mode
2834 no_mode=false
2835 fi
2836 prev=
2837 else
2838 dest=$arg
2839 continue
2840 fi
2841 ;;
2842 esac
2843
2844 # Aesthetically quote the argument.
2845 func_quote_for_eval "$arg"
2846 func_append install_prog " $func_quote_for_eval_result"
2847 if test -n "$arg2"; then
2848 func_quote_for_eval "$arg2"
2849 fi
2850 func_append install_shared_prog " $func_quote_for_eval_result"
2851 done
2852
2853 test -z "$install_prog" && \
2854 func_fatal_help "you must specify an install program"
2855
2856 test -n "$prev" && \
2857 func_fatal_help "the \`$prev' option requires an argument"
2858
2859 if test -n "$install_override_mode" && $no_mode; then
2860 if $install_cp; then :; else
2861 func_quote_for_eval "$install_override_mode"
2862 func_append install_shared_prog " -m $func_quote_for_eval_result"
2863 fi
2864 fi
2865
2866 if test -z "$files"; then
2867 if test -z "$dest"; then
2868 func_fatal_help "no file or destination specified"
2869 else
2870 func_fatal_help "you must specify a destination"
2871 fi
2872 fi
2873
2874 # Strip any trailing slash from the destination.
2875 func_stripname '' '/' "$dest"
2876 dest=$func_stripname_result
2877
2878 # Check to see that the destination is a directory.
2879 test -d "$dest" && isdir=yes
2880 if test "$isdir" = yes; then
2881 destdir="$dest"
2882 destname=
2883 else
2884 func_dirname_and_basename "$dest" "" "."
2885 destdir="$func_dirname_result"
2886 destname="$func_basename_result"
2887
2888 # Not a directory, so check to see that there is only one file specified.
2889 set dummy $files; shift
2890 test "$#" -gt 1 && \
2891 func_fatal_help "\`$dest' is not a directory"
2892 fi
2893 case $destdir in
2894 [\\/]* | [A-Za-z]:[\\/]*) ;;
2895 *)
2896 for file in $files; do
2897 case $file in
2898 *.lo) ;;
2899 *)
2900 func_fatal_help "\`$destdir' must be an absolute directory name"
2901 ;;
2902 esac
2903 done
2904 ;;
2905 esac
2906
2907 # This variable tells wrapper scripts just to set variables rather
2908 # than running their programs.
2909 libtool_install_magic="$magic"
2910
2911 staticlibs=
2912 future_libdirs=
2913 current_libdirs=
2914 for file in $files; do
2915
2916 # Do each installation.
2917 case $file in
2918 *.$libext)
2919 # Do the static libraries later.
2920 func_append staticlibs " $file"
2921 ;;
2922
2923 *.la)
2924 func_resolve_sysroot "$file"
2925 file=$func_resolve_sysroot_result
2926
2927 # Check to see that this really is a libtool archive.
2928 func_lalib_unsafe_p "$file" \
2929 || func_fatal_help "\`$file' is not a valid libtool archive"
2930
2931 library_names=
2932 old_library=
2933 relink_command=
2934 func_source "$file"
2935
2936 # Add the libdir to current_libdirs if it is the destination.
2937 if test "X$destdir" = "X$libdir"; then
2938 case "$current_libdirs " in
2939 *" $libdir "*) ;;
2940 *) func_append current_libdirs " $libdir" ;;
2941 esac
2942 else
2943 # Note the libdir as a future libdir.
2944 case "$future_libdirs " in
2945 *" $libdir "*) ;;
2946 *) func_append future_libdirs " $libdir" ;;
2947 esac
2948 fi
2949
2950 func_dirname "$file" "/" ""
2951 dir="$func_dirname_result"
2952 func_append dir "$objdir"
2953
2954 if test -n "$relink_command"; then
2955 # Determine the prefix the user has applied to our future dir.
2956 inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
2957
2958 # Don't allow the user to place us outside of our expected
2959 # location b/c this prevents finding dependent libraries that
2960 # are installed to the same prefix.
2961 # At present, this check doesn't affect windows .dll's that
2962 # are installed into $libdir/../bin (currently, that works fine)
2963 # but it's something to keep an eye on.
2964 test "$inst_prefix_dir" = "$destdir" && \
2965 func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
2966
2967 if test -n "$inst_prefix_dir"; then
2968 # Stick the inst_prefix_dir data into the link command.
2969 relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
2970 else
2971 relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
2972 fi
2973
2974 func_warning "relinking \`$file'"
2975 func_show_eval "$relink_command" \
2976 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
2977 fi
2978
2979 # See the names of the shared library.
2980 set dummy $library_names; shift
2981 if test -n "$1"; then
2982 realname="$1"
2983 shift
2984
2985 srcname="$realname"
2986 test -n "$relink_command" && srcname="$realname"T
2987
2988 # Install the shared library and build the symlinks.
2989 func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
2990 'exit $?'
2991 tstripme="$stripme"
2992 case $host_os in
2993 cygwin* | mingw* | pw32* | cegcc*)
2994 case $realname in
2995 *.dll.a)
2996 tstripme=""
2997 ;;
2998 esac
2999 ;;
3000 esac
3001 if test -n "$tstripme" && test -n "$striplib"; then
3002 func_show_eval "$striplib $destdir/$realname" 'exit $?'
3003 fi
3004
3005 if test "$#" -gt 0; then
3006 # Delete the old symlinks, and create new ones.
3007 # Try `ln -sf' first, because the `ln' binary might depend on
3008 # the symlink we replace! Solaris /bin/ln does not understand -f,
3009 # so we also need to try rm && ln -s.
3010 for linkname
3011 do
3012 test "$linkname" != "$realname" \
3013 && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
3014 done
3015 fi
3016
3017 # Do each command in the postinstall commands.
3018 lib="$destdir/$realname"
3019 func_execute_cmds "$postinstall_cmds" 'exit $?'
3020 fi
3021
3022 # Install the pseudo-library for information purposes.
3023 func_basename "$file"
3024 name="$func_basename_result"
3025 instname="$dir/$name"i
3026 func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
3027
3028 # Maybe install the static library, too.
3029 test -n "$old_library" && func_append staticlibs " $dir/$old_library"
3030 ;;
3031
3032 *.lo)
3033 # Install (i.e. copy) a libtool object.
3034
3035 # Figure out destination file name, if it wasn't already specified.
3036 if test -n "$destname"; then
3037 destfile="$destdir/$destname"
3038 else
3039 func_basename "$file"
3040 destfile="$func_basename_result"
3041 destfile="$destdir/$destfile"
3042 fi
3043
3044 # Deduce the name of the destination old-style object file.
3045 case $destfile in
3046 *.lo)
3047 func_lo2o "$destfile"
3048 staticdest=$func_lo2o_result
3049 ;;
3050 *.$objext)
3051 staticdest="$destfile"
3052 destfile=
3053 ;;
3054 *)
3055 func_fatal_help "cannot copy a libtool object to \`$destfile'"
3056 ;;
3057 esac
3058
3059 # Install the libtool object if requested.
3060 test -n "$destfile" && \
3061 func_show_eval "$install_prog $file $destfile" 'exit $?'
3062
3063 # Install the old object if enabled.
3064 if test "$build_old_libs" = yes; then
3065 # Deduce the name of the old-style object file.
3066 func_lo2o "$file"
3067 staticobj=$func_lo2o_result
3068 func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
3069 fi
3070 exit $EXIT_SUCCESS
3071 ;;
3072
3073 *)
3074 # Figure out destination file name, if it wasn't already specified.
3075 if test -n "$destname"; then
3076 destfile="$destdir/$destname"
3077 else
3078 func_basename "$file"
3079 destfile="$func_basename_result"
3080 destfile="$destdir/$destfile"
3081 fi
3082
3083 # If the file is missing, and there is a .exe on the end, strip it
3084 # because it is most likely a libtool script we actually want to
3085 # install
3086 stripped_ext=""
3087 case $file in
3088 *.exe)
3089 if test ! -f "$file"; then
3090 func_stripname '' '.exe' "$file"
3091 file=$func_stripname_result
3092 stripped_ext=".exe"
3093 fi
3094 ;;
3095 esac
3096
3097 # Do a test to see if this is really a libtool program.
3098 case $host in
3099 *cygwin* | *mingw*)
3100 if func_ltwrapper_executable_p "$file"; then
3101 func_ltwrapper_scriptname "$file"
3102 wrapper=$func_ltwrapper_scriptname_result
3103 else
3104 func_stripname '' '.exe' "$file"
3105 wrapper=$func_stripname_result
3106 fi
3107 ;;
3108 *)
3109 wrapper=$file
3110 ;;
3111 esac
3112 if func_ltwrapper_script_p "$wrapper"; then
3113 notinst_deplibs=
3114 relink_command=
3115
3116 func_source "$wrapper"
3117
3118 # Check the variables that should have been set.
3119 test -z "$generated_by_libtool_version" && \
3120 func_fatal_error "invalid libtool wrapper script \`$wrapper'"
3121
3122 finalize=yes
3123 for lib in $notinst_deplibs; do
3124 # Check to see that each library is installed.
3125 libdir=
3126 if test -f "$lib"; then
3127 func_source "$lib"
3128 fi
3129 libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test
3130 if test -n "$libdir" && test ! -f "$libfile"; then
3131 func_warning "\`$lib' has not been installed in \`$libdir'"
3132 finalize=no
3133 fi
3134 done
3135
3136 relink_command=
3137 func_source "$wrapper"
3138
3139 outputname=
3140 if test "$fast_install" = no && test -n "$relink_command"; then
3141 $opt_dry_run || {
3142 if test "$finalize" = yes; then
3143 tmpdir=`func_mktempdir`
3144 func_basename "$file$stripped_ext"
3145 file="$func_basename_result"
3146 outputname="$tmpdir/$file"
3147 # Replace the output file specification.
3148 relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
3149
3150 $opt_silent || {
3151 func_quote_for_expand "$relink_command"
3152 eval "func_echo $func_quote_for_expand_result"
3153 }
3154 if eval "$relink_command"; then :
3155 else
3156 func_error "error: relink \`$file' with the above command before installing it"
3157 $opt_dry_run || ${RM}r "$tmpdir"
3158 continue
3159 fi
3160 file="$outputname"
3161 else
3162 func_warning "cannot relink \`$file'"
3163 fi
3164 }
3165 else
3166 # Install the binary that we compiled earlier.
3167 file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`
3168 fi
3169 fi
3170
3171 # remove .exe since cygwin /usr/bin/install will append another
3172 # one anyway
3173 case $install_prog,$host in
3174 */usr/bin/install*,*cygwin*)
3175 case $file:$destfile in
3176 *.exe:*.exe)
3177 # this is ok
3178 ;;
3179 *.exe:*)
3180 destfile=$destfile.exe
3181 ;;
3182 *:*.exe)
3183 func_stripname '' '.exe' "$destfile"
3184 destfile=$func_stripname_result
3185 ;;
3186 esac
3187 ;;
3188 esac
3189 func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
3190 $opt_dry_run || if test -n "$outputname"; then
3191 ${RM}r "$tmpdir"
3192 fi
3193 ;;
3194 esac
3195 done
3196
3197 for file in $staticlibs; do
3198 func_basename "$file"
3199 name="$func_basename_result"
3200
3201 # Set up the ranlib parameters.
3202 oldlib="$destdir/$name"
3203
3204 func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
3205
3206 if test -n "$stripme" && test -n "$old_striplib"; then
3207 func_show_eval "$old_striplib $oldlib" 'exit $?'
3208 fi
3209
3210 # Do each command in the postinstall commands.
3211 func_execute_cmds "$old_postinstall_cmds" 'exit $?'
3212 done
3213
3214 test -n "$future_libdirs" && \
3215 func_warning "remember to run \`$progname --finish$future_libdirs'"
3216
3217 if test -n "$current_libdirs"; then
3218 # Maybe just do a dry run.
3219 $opt_dry_run && current_libdirs=" -n$current_libdirs"
3220 exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
3221 else
3222 exit $EXIT_SUCCESS
3223 fi
3224 }
3225
3226 test "$opt_mode" = install && func_mode_install ${1+"$@"}
3227
3228
3229 # func_generate_dlsyms outputname originator pic_p
3230 # Extract symbols from dlprefiles and create ${outputname}S.o with
3231 # a dlpreopen symbol table.
3232 func_generate_dlsyms ()
3233 {
3234 $opt_debug
3235 my_outputname="$1"
3236 my_originator="$2"
3237 my_pic_p="${3-no}"
3238 my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
3239 my_dlsyms=
3240
3241 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3242 if test -n "$NM" && test -n "$global_symbol_pipe"; then
3243 my_dlsyms="${my_outputname}S.c"
3244 else
3245 func_error "not configured to extract global symbols from dlpreopened files"
3246 fi
3247 fi
3248
3249 if test -n "$my_dlsyms"; then
3250 case $my_dlsyms in
3251 "") ;;
3252 *.c)
3253 # Discover the nlist of each of the dlfiles.
3254 nlist="$output_objdir/${my_outputname}.nm"
3255
3256 func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
3257
3258 # Parse the name list into a source file.
3259 func_verbose "creating $output_objdir/$my_dlsyms"
3260
3261 $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
3262 /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
3263 /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
3264
3265 #ifdef __cplusplus
3266 extern \"C\" {
3267 #endif
3268
3269 #if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
3270 #pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
3271 #endif
3272
3273 /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
3274 #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
3275 /* DATA imports from DLLs on WIN32 con't be const, because runtime
3276 relocations are performed -- see ld's documentation on pseudo-relocs. */
3277 # define LT_DLSYM_CONST
3278 #elif defined(__osf__)
3279 /* This system does not cope well with relocations in const data. */
3280 # define LT_DLSYM_CONST
3281 #else
3282 # define LT_DLSYM_CONST const
3283 #endif
3284
3285 /* External symbol declarations for the compiler. */\
3286 "
3287
3288 if test "$dlself" = yes; then
3289 func_verbose "generating symbol list for \`$output'"
3290
3291 $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
3292
3293 # Add our own program objects to the symbol list.
3294 progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
3295 for progfile in $progfiles; do
3296 func_to_tool_file "$progfile" func_convert_file_msys_to_w32
3297 func_verbose "extracting global C symbols from \`$func_to_tool_file_result'"
3298 $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
3299 done
3300
3301 if test -n "$exclude_expsyms"; then
3302 $opt_dry_run || {
3303 eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
3304 eval '$MV "$nlist"T "$nlist"'
3305 }
3306 fi
3307
3308 if test -n "$export_symbols_regex"; then
3309 $opt_dry_run || {
3310 eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
3311 eval '$MV "$nlist"T "$nlist"'
3312 }
3313 fi
3314
3315 # Prepare the list of exported symbols
3316 if test -z "$export_symbols"; then
3317 export_symbols="$output_objdir/$outputname.exp"
3318 $opt_dry_run || {
3319 $RM $export_symbols
3320 eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
3321 case $host in
3322 *cygwin* | *mingw* | *cegcc* )
3323 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
3324 eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
3325 ;;
3326 esac
3327 }
3328 else
3329 $opt_dry_run || {
3330 eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
3331 eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
3332 eval '$MV "$nlist"T "$nlist"'
3333 case $host in
3334 *cygwin* | *mingw* | *cegcc* )
3335 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
3336 eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
3337 ;;
3338 esac
3339 }
3340 fi
3341 fi
3342
3343 for dlprefile in $dlprefiles; do
3344 func_verbose "extracting global C symbols from \`$dlprefile'"
3345 func_basename "$dlprefile"
3346 name="$func_basename_result"
3347 case $host in
3348 *cygwin* | *mingw* | *cegcc* )
3349 # if an import library, we need to obtain dlname
3350 if func_win32_import_lib_p "$dlprefile"; then
3351 func_tr_sh "$dlprefile"
3352 eval "curr_lafile=\$libfile_$func_tr_sh_result"
3353 dlprefile_dlbasename=""
3354 if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
3355 # Use subshell, to avoid clobbering current variable values
3356 dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
3357 if test -n "$dlprefile_dlname" ; then
3358 func_basename "$dlprefile_dlname"
3359 dlprefile_dlbasename="$func_basename_result"
3360 else
3361 # no lafile. user explicitly requested -dlpreopen <import library>.
3362 $sharedlib_from_linklib_cmd "$dlprefile"
3363 dlprefile_dlbasename=$sharedlib_from_linklib_result
3364 fi
3365 fi
3366 $opt_dry_run || {
3367 if test -n "$dlprefile_dlbasename" ; then
3368 eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
3369 else
3370 func_warning "Could not compute DLL name from $name"
3371 eval '$ECHO ": $name " >> "$nlist"'
3372 fi
3373 func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
3374 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
3375 $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
3376 }
3377 else # not an import lib
3378 $opt_dry_run || {
3379 eval '$ECHO ": $name " >> "$nlist"'
3380 func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
3381 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
3382 }
3383 fi
3384 ;;
3385 *)
3386 $opt_dry_run || {
3387 eval '$ECHO ": $name " >> "$nlist"'
3388 func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
3389 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
3390 }
3391 ;;
3392 esac
3393 done
3394
3395 $opt_dry_run || {
3396 # Make sure we have at least an empty file.
3397 test -f "$nlist" || : > "$nlist"
3398
3399 if test -n "$exclude_expsyms"; then
3400 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
3401 $MV "$nlist"T "$nlist"
3402 fi
3403
3404 # Try sorting and uniquifying the output.
3405 if $GREP -v "^: " < "$nlist" |
3406 if sort -k 3 </dev/null >/dev/null 2>&1; then
3407 sort -k 3
3408 else
3409 sort +2
3410 fi |
3411 uniq > "$nlist"S; then
3412 :
3413 else
3414 $GREP -v "^: " < "$nlist" > "$nlist"S
3415 fi
3416
3417 if test -f "$nlist"S; then
3418 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
3419 else
3420 echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
3421 fi
3422
3423 echo >> "$output_objdir/$my_dlsyms" "\
3424
3425 /* The mapping between symbol names and symbols. */
3426 typedef struct {
3427 const char *name;
3428 void *address;
3429 } lt_dlsymlist;
3430 extern LT_DLSYM_CONST lt_dlsymlist
3431 lt_${my_prefix}_LTX_preloaded_symbols[];
3432 LT_DLSYM_CONST lt_dlsymlist
3433 lt_${my_prefix}_LTX_preloaded_symbols[] =
3434 {\
3435 { \"$my_originator\", (void *) 0 },"
3436
3437 case $need_lib_prefix in
3438 no)
3439 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
3440 ;;
3441 *)
3442 eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
3443 ;;
3444 esac
3445 echo >> "$output_objdir/$my_dlsyms" "\
3446 {0, (void *) 0}
3447 };
3448
3449 /* This works around a problem in FreeBSD linker */
3450 #ifdef FREEBSD_WORKAROUND
3451 static const void *lt_preloaded_setup() {
3452 return lt_${my_prefix}_LTX_preloaded_symbols;
3453 }
3454 #endif
3455
3456 #ifdef __cplusplus
3457 }
3458 #endif\
3459 "
3460 } # !$opt_dry_run
3461
3462 pic_flag_for_symtable=
3463 case "$compile_command " in
3464 *" -static "*) ;;
3465 *)
3466 case $host in
3467 # compiling the symbol table file with pic_flag works around
3468 # a FreeBSD bug that causes programs to crash when -lm is
3469 # linked before any other PIC object. But we must not use
3470 # pic_flag when linking with -static. The problem exists in
3471 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
3472 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
3473 pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
3474 *-*-hpux*)
3475 pic_flag_for_symtable=" $pic_flag" ;;
3476 *)
3477 if test "X$my_pic_p" != Xno; then
3478 pic_flag_for_symtable=" $pic_flag"
3479 fi
3480 ;;
3481 esac
3482 ;;
3483 esac
3484 symtab_cflags=
3485 for arg in $LTCFLAGS; do
3486 case $arg in
3487 -pie | -fpie | -fPIE) ;;
3488 *) func_append symtab_cflags " $arg" ;;
3489 esac
3490 done
3491
3492 # Now compile the dynamic symbol file.
3493 func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
3494
3495 # Clean up the generated files.
3496 func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
3497
3498 # Transform the symbol file into the correct name.
3499 symfileobj="$output_objdir/${my_outputname}S.$objext"
3500 case $host in
3501 *cygwin* | *mingw* | *cegcc* )
3502 if test -f "$output_objdir/$my_outputname.def"; then
3503 compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
3504 finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
3505 else
3506 compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
3507 finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
3508 fi
3509 ;;
3510 *)
3511 compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
3512 finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
3513 ;;
3514 esac
3515 ;;
3516 *)
3517 func_fatal_error "unknown suffix for \`$my_dlsyms'"
3518 ;;
3519 esac
3520 else
3521 # We keep going just in case the user didn't refer to
3522 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
3523 # really was required.
3524
3525 # Nullify the symbol file.
3526 compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"`
3527 finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
3528 fi
3529 }
3530
3531 # func_win32_libid arg
3532 # return the library type of file 'arg'
3533 #
3534 # Need a lot of goo to handle *both* DLLs and import libs
3535 # Has to be a shell function in order to 'eat' the argument
3536 # that is supplied when $file_magic_command is called.
3537 # Despite the name, also deal with 64 bit binaries.
3538 func_win32_libid ()
3539 {
3540 $opt_debug
3541 win32_libid_type="unknown"
3542 win32_fileres=`file -L $1 2>/dev/null`
3543 case $win32_fileres in
3544 *ar\ archive\ import\ library*) # definitely import
3545 win32_libid_type="x86 archive import"
3546 ;;
3547 *ar\ archive*) # could be an import, or static
3548 # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
3549 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
3550 $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
3551 func_to_tool_file "$1" func_convert_file_msys_to_w32
3552 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
3553 $SED -n -e '
3554 1,100{
3555 / I /{
3556 s,.*,import,
3557 p
3558 q
3559 }
3560 }'`
3561 case $win32_nmres in
3562 import*) win32_libid_type="x86 archive import";;
3563 *) win32_libid_type="x86 archive static";;
3564 esac
3565 fi
3566 ;;
3567 *DLL*)
3568 win32_libid_type="x86 DLL"
3569 ;;
3570 *executable*) # but shell scripts are "executable" too...
3571 case $win32_fileres in
3572 *MS\ Windows\ PE\ Intel*)
3573 win32_libid_type="x86 DLL"
3574 ;;
3575 esac
3576 ;;
3577 esac
3578 $ECHO "$win32_libid_type"
3579 }
3580
3581 # func_cygming_dll_for_implib ARG
3582 #
3583 # Platform-specific function to extract the
3584 # name of the DLL associated with the specified
3585 # import library ARG.
3586 # Invoked by eval'ing the libtool variable
3587 # $sharedlib_from_linklib_cmd
3588 # Result is available in the variable
3589 # $sharedlib_from_linklib_result
3590 func_cygming_dll_for_implib ()
3591 {
3592 $opt_debug
3593 sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
3594 }
3595
3596 # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs
3597 #
3598 # The is the core of a fallback implementation of a
3599 # platform-specific function to extract the name of the
3600 # DLL associated with the specified import library LIBNAME.
3601 #
3602 # SECTION_NAME is either .idata$6 or .idata$7, depending
3603 # on the platform and compiler that created the implib.
3604 #
3605 # Echos the name of the DLL associated with the
3606 # specified import library.
3607 func_cygming_dll_for_implib_fallback_core ()
3608 {
3609 $opt_debug
3610 match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
3611 $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
3612 $SED '/^Contents of section '"$match_literal"':/{
3613 # Place marker at beginning of archive member dllname section
3614 s/.*/====MARK====/
3615 p
3616 d
3617 }
3618 # These lines can sometimes be longer than 43 characters, but
3619 # are always uninteresting
3620 /:[ ]*file format pe[i]\{,1\}-/d
3621 /^In archive [^:]*:/d
3622 # Ensure marker is printed
3623 /^====MARK====/p
3624 # Remove all lines with less than 43 characters
3625 /^.\{43\}/!d
3626 # From remaining lines, remove first 43 characters
3627 s/^.\{43\}//' |
3628 $SED -n '
3629 # Join marker and all lines until next marker into a single line
3630 /^====MARK====/ b para
3631 H
3632 $ b para
3633 b
3634 :para
3635 x
3636 s/\n//g
3637 # Remove the marker
3638 s/^====MARK====//
3639 # Remove trailing dots and whitespace
3640 s/[\. \t]*$//
3641 # Print
3642 /./p' |
3643 # we now have a list, one entry per line, of the stringified
3644 # contents of the appropriate section of all members of the
3645 # archive which possess that section. Heuristic: eliminate
3646 # all those which have a first or second character that is
3647 # a '.' (that is, objdump's representation of an unprintable
3648 # character.) This should work for all archives with less than
3649 # 0x302f exports -- but will fail for DLLs whose name actually
3650 # begins with a literal '.' or a single character followed by
3651 # a '.'.
3652 #
3653 # Of those that remain, print the first one.
3654 $SED -e '/^\./d;/^.\./d;q'
3655 }
3656
3657 # func_cygming_gnu_implib_p ARG
3658 # This predicate returns with zero status (TRUE) if
3659 # ARG is a GNU/binutils-style import library. Returns
3660 # with nonzero status (FALSE) otherwise.
3661 func_cygming_gnu_implib_p ()
3662 {
3663 $opt_debug
3664 func_to_tool_file "$1" func_convert_file_msys_to_w32
3665 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
3666 test -n "$func_cygming_gnu_implib_tmp"
3667 }
3668
3669 # func_cygming_ms_implib_p ARG
3670 # This predicate returns with zero status (TRUE) if
3671 # ARG is an MS-style import library. Returns
3672 # with nonzero status (FALSE) otherwise.
3673 func_cygming_ms_implib_p ()
3674 {
3675 $opt_debug
3676 func_to_tool_file "$1" func_convert_file_msys_to_w32
3677 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
3678 test -n "$func_cygming_ms_implib_tmp"
3679 }
3680
3681 # func_cygming_dll_for_implib_fallback ARG
3682 # Platform-specific function to extract the
3683 # name of the DLL associated with the specified
3684 # import library ARG.
3685 #
3686 # This fallback implementation is for use when $DLLTOOL
3687 # does not support the --identify-strict option.
3688 # Invoked by eval'ing the libtool variable
3689 # $sharedlib_from_linklib_cmd
3690 # Result is available in the variable
3691 # $sharedlib_from_linklib_result
3692 func_cygming_dll_for_implib_fallback ()
3693 {
3694 $opt_debug
3695 if func_cygming_gnu_implib_p "$1" ; then
3696 # binutils import library
3697 sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
3698 elif func_cygming_ms_implib_p "$1" ; then
3699 # ms-generated import library
3700 sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
3701 else
3702 # unknown
3703 sharedlib_from_linklib_result=""
3704 fi
3705 }
3706
3707
3708 # func_extract_an_archive dir oldlib
3709 func_extract_an_archive ()
3710 {
3711 $opt_debug
3712 f_ex_an_ar_dir="$1"; shift
3713 f_ex_an_ar_oldlib="$1"
3714 if test "$lock_old_archive_extraction" = yes; then
3715 lockfile=$f_ex_an_ar_oldlib.lock
3716 until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
3717 func_echo "Waiting for $lockfile to be removed"
3718 sleep 2
3719 done
3720 fi
3721 func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
3722 'stat=$?; rm -f "$lockfile"; exit $stat'
3723 if test "$lock_old_archive_extraction" = yes; then
3724 $opt_dry_run || rm -f "$lockfile"
3725 fi
3726 if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
3727 :
3728 else
3729 func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
3730 fi
3731 }
3732
3733
3734 # func_extract_archives gentop oldlib ...
3735 func_extract_archives ()
3736 {
3737 $opt_debug
3738 my_gentop="$1"; shift
3739 my_oldlibs=${1+"$@"}
3740 my_oldobjs=""
3741 my_xlib=""
3742 my_xabs=""
3743 my_xdir=""
3744
3745 for my_xlib in $my_oldlibs; do
3746 # Extract the objects.
3747 case $my_xlib in
3748 [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
3749 *) my_xabs=`pwd`"/$my_xlib" ;;
3750 esac
3751 func_basename "$my_xlib"
3752 my_xlib="$func_basename_result"
3753 my_xlib_u=$my_xlib
3754 while :; do
3755 case " $extracted_archives " in
3756 *" $my_xlib_u "*)
3757 func_arith $extracted_serial + 1
3758 extracted_serial=$func_arith_result
3759 my_xlib_u=lt$extracted_serial-$my_xlib ;;
3760 *) break ;;
3761 esac
3762 done
3763 extracted_archives="$extracted_archives $my_xlib_u"
3764 my_xdir="$my_gentop/$my_xlib_u"
3765
3766 func_mkdir_p "$my_xdir"
3767
3768 case $host in
3769 *-darwin*)
3770 func_verbose "Extracting $my_xabs"
3771 # Do not bother doing anything if just a dry run
3772 $opt_dry_run || {
3773 darwin_orig_dir=`pwd`
3774 cd $my_xdir || exit $?
3775 darwin_archive=$my_xabs
3776 darwin_curdir=`pwd`
3777 darwin_base_archive=`basename "$darwin_archive"`
3778 darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
3779 if test -n "$darwin_arches"; then
3780 darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
3781 darwin_arch=
3782 func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
3783 for darwin_arch in $darwin_arches ; do
3784 func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
3785 $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
3786 cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
3787 func_extract_an_archive "`pwd`" "${darwin_base_archive}"
3788 cd "$darwin_curdir"
3789 $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
3790 done # $darwin_arches
3791 ## Okay now we've a bunch of thin objects, gotta fatten them up :)
3792 darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
3793 darwin_file=
3794 darwin_files=
3795 for darwin_file in $darwin_filelist; do
3796 darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
3797 $LIPO -create -output "$darwin_file" $darwin_files
3798 done # $darwin_filelist
3799 $RM -rf unfat-$$
3800 cd "$darwin_orig_dir"
3801 else
3802 cd $darwin_orig_dir
3803 func_extract_an_archive "$my_xdir" "$my_xabs"
3804 fi # $darwin_arches
3805 } # !$opt_dry_run
3806 ;;
3807 *)
3808 func_extract_an_archive "$my_xdir" "$my_xabs"
3809 ;;
3810 esac
3811 my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
3812 done
3813
3814 func_extract_archives_result="$my_oldobjs"
3815 }
3816
3817
3818 # func_emit_wrapper [arg=no]
3819 #
3820 # Emit a libtool wrapper script on stdout.
3821 # Don't directly open a file because we may want to
3822 # incorporate the script contents within a cygwin/mingw
3823 # wrapper executable. Must ONLY be called from within
3824 # func_mode_link because it depends on a number of variables
3825 # set therein.
3826 #
3827 # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
3828 # variable will take. If 'yes', then the emitted script
3829 # will assume that the directory in which it is stored is
3830 # the $objdir directory. This is a cygwin/mingw-specific
3831 # behavior.
3832 func_emit_wrapper ()
3833 {
3834 func_emit_wrapper_arg1=${1-no}
3835
3836 $ECHO "\
3837 #! $SHELL
3838
3839 # $output - temporary wrapper script for $objdir/$outputname
3840 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
3841 #
3842 # The $output program cannot be directly executed until all the libtool
3843 # libraries that it depends on are installed.
3844 #
3845 # This wrapper script should never be moved out of the build directory.
3846 # If it is, it will not operate correctly.
3847
3848 # Sed substitution that helps us do robust quoting. It backslashifies
3849 # metacharacters that are still active within double-quoted strings.
3850 sed_quote_subst='$sed_quote_subst'
3851
3852 # Be Bourne compatible
3853 if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
3854 emulate sh
3855 NULLCMD=:
3856 # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
3857 # is contrary to our usage. Disable this feature.
3858 alias -g '\${1+\"\$@\"}'='\"\$@\"'
3859 setopt NO_GLOB_SUBST
3860 else
3861 case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
3862 fi
3863 BIN_SH=xpg4; export BIN_SH # for Tru64
3864 DUALCASE=1; export DUALCASE # for MKS sh
3865
3866 # The HP-UX ksh and POSIX shell print the target directory to stdout
3867 # if CDPATH is set.
3868 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
3869
3870 relink_command=\"$relink_command\"
3871
3872 # This environment variable determines our operation mode.
3873 if test \"\$libtool_install_magic\" = \"$magic\"; then
3874 # install mode needs the following variables:
3875 generated_by_libtool_version='$macro_version'
3876 notinst_deplibs='$notinst_deplibs'
3877 else
3878 # When we are sourced in execute mode, \$file and \$ECHO are already set.
3879 if test \"\$libtool_execute_magic\" != \"$magic\"; then
3880 file=\"\$0\""
3881
3882 qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
3883 $ECHO "\
3884
3885 # A function that is used when there is no print builtin or printf.
3886 func_fallback_echo ()
3887 {
3888 eval 'cat <<_LTECHO_EOF
3889 \$1
3890 _LTECHO_EOF'
3891 }
3892 ECHO=\"$qECHO\"
3893 fi
3894
3895 # Very basic option parsing. These options are (a) specific to
3896 # the libtool wrapper, (b) are identical between the wrapper
3897 # /script/ and the wrapper /executable/ which is used only on
3898 # windows platforms, and (c) all begin with the string "--lt-"
3899 # (application programs are unlikely to have options which match
3900 # this pattern).
3901 #
3902 # There are only two supported options: --lt-debug and
3903 # --lt-dump-script. There is, deliberately, no --lt-help.
3904 #
3905 # The first argument to this parsing function should be the
3906 # script's $0 value, followed by "$@".
3907 lt_option_debug=
3908 func_parse_lt_options ()
3909 {
3910 lt_script_arg0=\$0
3911 shift
3912 for lt_opt
3913 do
3914 case \"\$lt_opt\" in
3915 --lt-debug) lt_option_debug=1 ;;
3916 --lt-dump-script)
3917 lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
3918 test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
3919 lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
3920 cat \"\$lt_dump_D/\$lt_dump_F\"
3921 exit 0
3922 ;;
3923 --lt-*)
3924 \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
3925 exit 1
3926 ;;
3927 esac
3928 done
3929
3930 # Print the debug banner immediately:
3931 if test -n \"\$lt_option_debug\"; then
3932 echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2
3933 fi
3934 }
3935
3936 # Used when --lt-debug. Prints its arguments to stdout
3937 # (redirection is the responsibility of the caller)
3938 func_lt_dump_args ()
3939 {
3940 lt_dump_args_N=1;
3941 for lt_arg
3942 do
3943 \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\"
3944 lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
3945 done
3946 }
3947
3948 # Core function for launching the target application
3949 func_exec_program_core ()
3950 {
3951 "
3952 case $host in
3953 # Backslashes separate directories on plain windows
3954 *-*-mingw | *-*-os2* | *-cegcc*)
3955 $ECHO "\
3956 if test -n \"\$lt_option_debug\"; then
3957 \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2
3958 func_lt_dump_args \${1+\"\$@\"} 1>&2
3959 fi
3960 exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
3961 "
3962 ;;
3963
3964 *)
3965 $ECHO "\
3966 if test -n \"\$lt_option_debug\"; then
3967 \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2
3968 func_lt_dump_args \${1+\"\$@\"} 1>&2
3969 fi
3970 exec \"\$progdir/\$program\" \${1+\"\$@\"}
3971 "
3972 ;;
3973 esac
3974 $ECHO "\
3975 \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
3976 exit 1
3977 }
3978
3979 # A function to encapsulate launching the target application
3980 # Strips options in the --lt-* namespace from \$@ and
3981 # launches target application with the remaining arguments.
3982 func_exec_program ()
3983 {
3984 for lt_wr_arg
3985 do
3986 case \$lt_wr_arg in
3987 --lt-*) ;;
3988 *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
3989 esac
3990 shift
3991 done
3992 func_exec_program_core \${1+\"\$@\"}
3993 }
3994
3995 # Parse options
3996 func_parse_lt_options \"\$0\" \${1+\"\$@\"}
3997
3998 # Find the directory that this script lives in.
3999 thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
4000 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
4001
4002 # Follow symbolic links until we get to the real thisdir.
4003 file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`
4004 while test -n \"\$file\"; do
4005 destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`
4006
4007 # If there was a directory component, then change thisdir.
4008 if test \"x\$destdir\" != \"x\$file\"; then
4009 case \"\$destdir\" in
4010 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
4011 *) thisdir=\"\$thisdir/\$destdir\" ;;
4012 esac
4013 fi
4014
4015 file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\`
4016 file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
4017 done
4018
4019 # Usually 'no', except on cygwin/mingw when embedded into
4020 # the cwrapper.
4021 WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
4022 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
4023 # special case for '.'
4024 if test \"\$thisdir\" = \".\"; then
4025 thisdir=\`pwd\`
4026 fi
4027 # remove .libs from thisdir
4028 case \"\$thisdir\" in
4029 *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;;
4030 $objdir ) thisdir=. ;;
4031 esac
4032 fi
4033
4034 # Try to get the absolute directory name.
4035 absdir=\`cd \"\$thisdir\" && pwd\`
4036 test -n \"\$absdir\" && thisdir=\"\$absdir\"
4037 "
4038
4039 if test "$fast_install" = yes; then
4040 $ECHO "\
4041 program=lt-'$outputname'$exeext
4042 progdir=\"\$thisdir/$objdir\"
4043
4044 if test ! -f \"\$progdir/\$program\" ||
4045 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
4046 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
4047
4048 file=\"\$\$-\$program\"
4049
4050 if test ! -d \"\$progdir\"; then
4051 $MKDIR \"\$progdir\"
4052 else
4053 $RM \"\$progdir/\$file\"
4054 fi"
4055
4056 $ECHO "\
4057
4058 # relink executable if necessary
4059 if test -n \"\$relink_command\"; then
4060 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
4061 else
4062 $ECHO \"\$relink_command_output\" >&2
4063 $RM \"\$progdir/\$file\"
4064 exit 1
4065 fi
4066 fi
4067
4068 $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
4069 { $RM \"\$progdir/\$program\";
4070 $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
4071 $RM \"\$progdir/\$file\"
4072 fi"
4073 else
4074 $ECHO "\
4075 program='$outputname'
4076 progdir=\"\$thisdir/$objdir\"
4077 "
4078 fi
4079
4080 $ECHO "\
4081
4082 if test -f \"\$progdir/\$program\"; then"
4083
4084 # fixup the dll searchpath if we need to.
4085 #
4086 # Fix the DLL searchpath if we need to. Do this before prepending
4087 # to shlibpath, because on Windows, both are PATH and uninstalled
4088 # libraries must come first.
4089 if test -n "$dllsearchpath"; then
4090 $ECHO "\
4091 # Add the dll search path components to the executable PATH
4092 PATH=$dllsearchpath:\$PATH
4093 "
4094 fi
4095
4096 # Export our shlibpath_var if we have one.
4097 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4098 $ECHO "\
4099 # Add our own library path to $shlibpath_var
4100 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
4101
4102 # Some systems cannot cope with colon-terminated $shlibpath_var
4103 # The second colon is a workaround for a bug in BeOS R4 sed
4104 $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
4105
4106 export $shlibpath_var
4107 "
4108 fi
4109
4110 $ECHO "\
4111 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4112 # Run the actual program with our arguments.
4113 func_exec_program \${1+\"\$@\"}
4114 fi
4115 else
4116 # The program doesn't exist.
4117 \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
4118 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
4119 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
4120 exit 1
4121 fi
4122 fi\
4123 "
4124 }
4125
4126
4127 # func_emit_cwrapperexe_src
4128 # emit the source code for a wrapper executable on stdout
4129 # Must ONLY be called from within func_mode_link because
4130 # it depends on a number of variable set therein.
4131 func_emit_cwrapperexe_src ()
4132 {
4133 cat <<EOF
4134
4135 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4136 Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
4137
4138 The $output program cannot be directly executed until all the libtool
4139 libraries that it depends on are installed.
4140
4141 This wrapper executable should never be moved out of the build directory.
4142 If it is, it will not operate correctly.
4143 */
4144 EOF
4145 cat <<"EOF"
4146 #ifdef _MSC_VER
4147 # define _CRT_SECURE_NO_DEPRECATE 1
4148 #endif
4149 #include <stdio.h>
4150 #include <stdlib.h>
4151 #ifdef _MSC_VER
4152 # include <direct.h>
4153 # include <process.h>
4154 # include <io.h>
4155 #else
4156 # include <unistd.h>
4157 # include <stdint.h>
4158 # ifdef __CYGWIN__
4159 # include <io.h>
4160 # endif
4161 #endif
4162 #include <malloc.h>
4163 #include <stdarg.h>
4164 #include <assert.h>
4165 #include <string.h>
4166 #include <ctype.h>
4167 #include <errno.h>
4168 #include <fcntl.h>
4169 #include <sys/stat.h>
4170
4171 /* declarations of non-ANSI functions */
4172 #if defined(__MINGW32__)
4173 # ifdef __STRICT_ANSI__
4174 int _putenv (const char *);
4175 # endif
4176 #elif defined(__CYGWIN__)
4177 # ifdef __STRICT_ANSI__
4178 char *realpath (const char *, char *);
4179 int putenv (char *);
4180 int setenv (const char *, const char *, int);
4181 # endif
4182 /* #elif defined (other platforms) ... */
4183 #endif
4184
4185 /* portability defines, excluding path handling macros */
4186 #if defined(_MSC_VER)
4187 # define setmode _setmode
4188 # define stat _stat
4189 # define chmod _chmod
4190 # define getcwd _getcwd
4191 # define putenv _putenv
4192 # define S_IXUSR _S_IEXEC
4193 # ifndef _INTPTR_T_DEFINED
4194 # define _INTPTR_T_DEFINED
4195 # define intptr_t int
4196 # endif
4197 #elif defined(__MINGW32__)
4198 # define setmode _setmode
4199 # define stat _stat
4200 # define chmod _chmod
4201 # define getcwd _getcwd
4202 # define putenv _putenv
4203 #elif defined(__CYGWIN__)
4204 # define HAVE_SETENV
4205 # define FOPEN_WB "wb"
4206 /* #elif defined (other platforms) ... */
4207 #endif
4208
4209 #if defined(PATH_MAX)
4210 # define LT_PATHMAX PATH_MAX
4211 #elif defined(MAXPATHLEN)
4212 # define LT_PATHMAX MAXPATHLEN
4213 #else
4214 # define LT_PATHMAX 1024
4215 #endif
4216
4217 #ifndef S_IXOTH
4218 # define S_IXOTH 0
4219 #endif
4220 #ifndef S_IXGRP
4221 # define S_IXGRP 0
4222 #endif
4223
4224 /* path handling portability macros */
4225 #ifndef DIR_SEPARATOR
4226 # define DIR_SEPARATOR '/'
4227 # define PATH_SEPARATOR ':'
4228 #endif
4229
4230 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4231 defined (__OS2__)
4232 # define HAVE_DOS_BASED_FILE_SYSTEM
4233 # define FOPEN_WB "wb"
4234 # ifndef DIR_SEPARATOR_2
4235 # define DIR_SEPARATOR_2 '\\'
4236 # endif
4237 # ifndef PATH_SEPARATOR_2
4238 # define PATH_SEPARATOR_2 ';'
4239 # endif
4240 #endif
4241
4242 #ifndef DIR_SEPARATOR_2
4243 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
4244 #else /* DIR_SEPARATOR_2 */
4245 # define IS_DIR_SEPARATOR(ch) \
4246 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
4247 #endif /* DIR_SEPARATOR_2 */
4248
4249 #ifndef PATH_SEPARATOR_2
4250 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
4251 #else /* PATH_SEPARATOR_2 */
4252 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
4253 #endif /* PATH_SEPARATOR_2 */
4254
4255 #ifndef FOPEN_WB
4256 # define FOPEN_WB "w"
4257 #endif
4258 #ifndef _O_BINARY
4259 # define _O_BINARY 0
4260 #endif
4261
4262 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
4263 #define XFREE(stale) do { \
4264 if (stale) { free ((void *) stale); stale = 0; } \
4265 } while (0)
4266
4267 #if defined(LT_DEBUGWRAPPER)
4268 static int lt_debug = 1;
4269 #else
4270 static int lt_debug = 0;
4271 #endif
4272
4273 const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */
4274
4275 void *xmalloc (size_t num);
4276 char *xstrdup (const char *string);
4277 const char *base_name (const char *name);
4278 char *find_executable (const char *wrapper);
4279 char *chase_symlinks (const char *pathspec);
4280 int make_executable (const char *path);
4281 int check_executable (const char *path);
4282 char *strendzap (char *str, const char *pat);
4283 void lt_debugprintf (const char *file, int line, const char *fmt, ...);
4284 void lt_fatal (const char *file, int line, const char *message, ...);
4285 static const char *nonnull (const char *s);
4286 static const char *nonempty (const char *s);
4287 void lt_setenv (const char *name, const char *value);
4288 char *lt_extend_str (const char *orig_value, const char *add, int to_end);
4289 void lt_update_exe_path (const char *name, const char *value);
4290 void lt_update_lib_path (const char *name, const char *value);
4291 char **prepare_spawn (char **argv);
4292 void lt_dump_script (FILE *f);
4293 EOF
4294
4295 cat <<EOF
4296 volatile const char * MAGIC_EXE = "$magic_exe";
4297 const char * LIB_PATH_VARNAME = "$shlibpath_var";
4298 EOF
4299
4300 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4301 func_to_host_path "$temp_rpath"
4302 cat <<EOF
4303 const char * LIB_PATH_VALUE = "$func_to_host_path_result";
4304 EOF
4305 else
4306 cat <<"EOF"
4307 const char * LIB_PATH_VALUE = "";
4308 EOF
4309 fi
4310
4311 if test -n "$dllsearchpath"; then
4312 func_to_host_path "$dllsearchpath:"
4313 cat <<EOF
4314 const char * EXE_PATH_VARNAME = "PATH";
4315 const char * EXE_PATH_VALUE = "$func_to_host_path_result";
4316 EOF
4317 else
4318 cat <<"EOF"
4319 const char * EXE_PATH_VARNAME = "";
4320 const char * EXE_PATH_VALUE = "";
4321 EOF
4322 fi
4323
4324 if test "$fast_install" = yes; then
4325 cat <<EOF
4326 const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
4327 EOF
4328 else
4329 cat <<EOF
4330 const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
4331 EOF
4332 fi
4333
4334
4335 cat <<"EOF"
4336
4337 #define LTWRAPPER_OPTION_PREFIX "--lt-"
4338
4339 static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
4340 static const char *dumpscript_opt = LTWRAPPER_OPTION_PREFIX "dump-script";
4341 static const char *debug_opt = LTWRAPPER_OPTION_PREFIX "debug";
4342
4343 int
4344 main (int argc, char *argv[])
4345 {
4346 char **newargz;
4347 int newargc;
4348 char *tmp_pathspec;
4349 char *actual_cwrapper_path;
4350 char *actual_cwrapper_name;
4351 char *target_name;
4352 char *lt_argv_zero;
4353 intptr_t rval = 127;
4354
4355 int i;
4356
4357 program_name = (char *) xstrdup (base_name (argv[0]));
4358 newargz = XMALLOC (char *, argc + 1);
4359
4360 /* very simple arg parsing; don't want to rely on getopt
4361 * also, copy all non cwrapper options to newargz, except
4362 * argz[0], which is handled differently
4363 */
4364 newargc=0;
4365 for (i = 1; i < argc; i++)
4366 {
4367 if (strcmp (argv[i], dumpscript_opt) == 0)
4368 {
4369 EOF
4370 case "$host" in
4371 *mingw* | *cygwin* )
4372 # make stdout use "unix" line endings
4373 echo " setmode(1,_O_BINARY);"
4374 ;;
4375 esac
4376
4377 cat <<"EOF"
4378 lt_dump_script (stdout);
4379 return 0;
4380 }
4381 if (strcmp (argv[i], debug_opt) == 0)
4382 {
4383 lt_debug = 1;
4384 continue;
4385 }
4386 if (strcmp (argv[i], ltwrapper_option_prefix) == 0)
4387 {
4388 /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
4389 namespace, but it is not one of the ones we know about and
4390 have already dealt with, above (inluding dump-script), then
4391 report an error. Otherwise, targets might begin to believe
4392 they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
4393 namespace. The first time any user complains about this, we'll
4394 need to make LTWRAPPER_OPTION_PREFIX a configure-time option
4395 or a configure.ac-settable value.
4396 */
4397 lt_fatal (__FILE__, __LINE__,
4398 "unrecognized %s option: '%s'",
4399 ltwrapper_option_prefix, argv[i]);
4400 }
4401 /* otherwise ... */
4402 newargz[++newargc] = xstrdup (argv[i]);
4403 }
4404 newargz[++newargc] = NULL;
4405
4406 EOF
4407 cat <<EOF
4408 /* The GNU banner must be the first non-error debug message */
4409 lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\n");
4410 EOF
4411 cat <<"EOF"
4412 lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
4413 lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);
4414
4415 tmp_pathspec = find_executable (argv[0]);
4416 if (tmp_pathspec == NULL)
4417 lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
4418 lt_debugprintf (__FILE__, __LINE__,
4419 "(main) found exe (before symlink chase) at: %s\n",
4420 tmp_pathspec);
4421
4422 actual_cwrapper_path = chase_symlinks (tmp_pathspec);
4423 lt_debugprintf (__FILE__, __LINE__,
4424 "(main) found exe (after symlink chase) at: %s\n",
4425 actual_cwrapper_path);
4426 XFREE (tmp_pathspec);
4427
4428 actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
4429 strendzap (actual_cwrapper_path, actual_cwrapper_name);
4430
4431 /* wrapper name transforms */
4432 strendzap (actual_cwrapper_name, ".exe");
4433 tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
4434 XFREE (actual_cwrapper_name);
4435 actual_cwrapper_name = tmp_pathspec;
4436 tmp_pathspec = 0;
4437
4438 /* target_name transforms -- use actual target program name; might have lt- prefix */
4439 target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
4440 strendzap (target_name, ".exe");
4441 tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
4442 XFREE (target_name);
4443 target_name = tmp_pathspec;
4444 tmp_pathspec = 0;
4445
4446 lt_debugprintf (__FILE__, __LINE__,
4447 "(main) libtool target name: %s\n",
4448 target_name);
4449 EOF
4450
4451 cat <<EOF
4452 newargz[0] =
4453 XMALLOC (char, (strlen (actual_cwrapper_path) +
4454 strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
4455 strcpy (newargz[0], actual_cwrapper_path);
4456 strcat (newargz[0], "$objdir");
4457 strcat (newargz[0], "/");
4458 EOF
4459
4460 cat <<"EOF"
4461 /* stop here, and copy so we don't have to do this twice */
4462 tmp_pathspec = xstrdup (newargz[0]);
4463
4464 /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
4465 strcat (newargz[0], actual_cwrapper_name);
4466
4467 /* DO want the lt- prefix here if it exists, so use target_name */
4468 lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
4469 XFREE (tmp_pathspec);
4470 tmp_pathspec = NULL;
4471 EOF
4472
4473 case $host_os in
4474 mingw*)
4475 cat <<"EOF"
4476 {
4477 char* p;
4478 while ((p = strchr (newargz[0], '\\')) != NULL)
4479 {
4480 *p = '/';
4481 }
4482 while ((p = strchr (lt_argv_zero, '\\')) != NULL)
4483 {
4484 *p = '/';
4485 }
4486 }
4487 EOF
4488 ;;
4489 esac
4490
4491 cat <<"EOF"
4492 XFREE (target_name);
4493 XFREE (actual_cwrapper_path);
4494 XFREE (actual_cwrapper_name);
4495
4496 lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
4497 lt_setenv ("DUALCASE", "1"); /* for MSK sh */
4498 /* Update the DLL searchpath. EXE_PATH_VALUE ($dllsearchpath) must
4499 be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)
4500 because on Windows, both *_VARNAMEs are PATH but uninstalled
4501 libraries must come first. */
4502 lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
4503 lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
4504
4505 lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
4506 nonnull (lt_argv_zero));
4507 for (i = 0; i < newargc; i++)
4508 {
4509 lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
4510 i, nonnull (newargz[i]));
4511 }
4512
4513 EOF
4514
4515 case $host_os in
4516 mingw*)
4517 cat <<"EOF"
4518 /* execv doesn't actually work on mingw as expected on unix */
4519 newargz = prepare_spawn (newargz);
4520 rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
4521 if (rval == -1)
4522 {
4523 /* failed to start process */
4524 lt_debugprintf (__FILE__, __LINE__,
4525 "(main) failed to launch target \"%s\": %s\n",
4526 lt_argv_zero, nonnull (strerror (errno)));
4527 return 127;
4528 }
4529 return rval;
4530 EOF
4531 ;;
4532 *)
4533 cat <<"EOF"
4534 execv (lt_argv_zero, newargz);
4535 return rval; /* =127, but avoids unused variable warning */
4536 EOF
4537 ;;
4538 esac
4539
4540 cat <<"EOF"
4541 }
4542
4543 void *
4544 xmalloc (size_t num)
4545 {
4546 void *p = (void *) malloc (num);
4547 if (!p)
4548 lt_fatal (__FILE__, __LINE__, "memory exhausted");
4549
4550 return p;
4551 }
4552
4553 char *
4554 xstrdup (const char *string)
4555 {
4556 return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
4557 string) : NULL;
4558 }
4559
4560 const char *
4561 base_name (const char *name)
4562 {
4563 const char *base;
4564
4565 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4566 /* Skip over the disk name in MSDOS pathnames. */
4567 if (isalpha ((unsigned char) name[0]) && name[1] == ':')
4568 name += 2;
4569 #endif
4570
4571 for (base = name; *name; name++)
4572 if (IS_DIR_SEPARATOR (*name))
4573 base = name + 1;
4574 return base;
4575 }
4576
4577 int
4578 check_executable (const char *path)
4579 {
4580 struct stat st;
4581
4582 lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n",
4583 nonempty (path));
4584 if ((!path) || (!*path))
4585 return 0;
4586
4587 if ((stat (path, &st) >= 0)
4588 && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
4589 return 1;
4590 else
4591 return 0;
4592 }
4593
4594 int
4595 make_executable (const char *path)
4596 {
4597 int rval = 0;
4598 struct stat st;
4599
4600 lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n",
4601 nonempty (path));
4602 if ((!path) || (!*path))
4603 return 0;
4604
4605 if (stat (path, &st) >= 0)
4606 {
4607 rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
4608 }
4609 return rval;
4610 }
4611
4612 /* Searches for the full path of the wrapper. Returns
4613 newly allocated full path name if found, NULL otherwise
4614 Does not chase symlinks, even on platforms that support them.
4615 */
4616 char *
4617 find_executable (const char *wrapper)
4618 {
4619 int has_slash = 0;
4620 const char *p;
4621 const char *p_next;
4622 /* static buffer for getcwd */
4623 char tmp[LT_PATHMAX + 1];
4624 int tmp_len;
4625 char *concat_name;
4626
4627 lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
4628 nonempty (wrapper));
4629
4630 if ((wrapper == NULL) || (*wrapper == '\0'))
4631 return NULL;
4632
4633 /* Absolute path? */
4634 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4635 if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
4636 {
4637 concat_name = xstrdup (wrapper);
4638 if (check_executable (concat_name))
4639 return concat_name;
4640 XFREE (concat_name);
4641 }
4642 else
4643 {
4644 #endif
4645 if (IS_DIR_SEPARATOR (wrapper[0]))
4646 {
4647 concat_name = xstrdup (wrapper);
4648 if (check_executable (concat_name))
4649 return concat_name;
4650 XFREE (concat_name);
4651 }
4652 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4653 }
4654 #endif
4655
4656 for (p = wrapper; *p; p++)
4657 if (*p == '/')
4658 {
4659 has_slash = 1;
4660 break;
4661 }
4662 if (!has_slash)
4663 {
4664 /* no slashes; search PATH */
4665 const char *path = getenv ("PATH");
4666 if (path != NULL)
4667 {
4668 for (p = path; *p; p = p_next)
4669 {
4670 const char *q;
4671 size_t p_len;
4672 for (q = p; *q; q++)
4673 if (IS_PATH_SEPARATOR (*q))
4674 break;
4675 p_len = q - p;
4676 p_next = (*q == '\0' ? q : q + 1);
4677 if (p_len == 0)
4678 {
4679 /* empty path: current directory */
4680 if (getcwd (tmp, LT_PATHMAX) == NULL)
4681 lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
4682 nonnull (strerror (errno)));
4683 tmp_len = strlen (tmp);
4684 concat_name =
4685 XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
4686 memcpy (concat_name, tmp, tmp_len);
4687 concat_name[tmp_len] = '/';
4688 strcpy (concat_name + tmp_len + 1, wrapper);
4689 }
4690 else
4691 {
4692 concat_name =
4693 XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
4694 memcpy (concat_name, p, p_len);
4695 concat_name[p_len] = '/';
4696 strcpy (concat_name + p_len + 1, wrapper);
4697 }
4698 if (check_executable (concat_name))
4699 return concat_name;
4700 XFREE (concat_name);
4701 }
4702 }
4703 /* not found in PATH; assume curdir */
4704 }
4705 /* Relative path | not found in path: prepend cwd */
4706 if (getcwd (tmp, LT_PATHMAX) == NULL)
4707 lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
4708 nonnull (strerror (errno)));
4709 tmp_len = strlen (tmp);
4710 concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
4711 memcpy (concat_name, tmp, tmp_len);
4712 concat_name[tmp_len] = '/';
4713 strcpy (concat_name + tmp_len + 1, wrapper);
4714
4715 if (check_executable (concat_name))
4716 return concat_name;
4717 XFREE (concat_name);
4718 return NULL;
4719 }
4720
4721 char *
4722 chase_symlinks (const char *pathspec)
4723 {
4724 #ifndef S_ISLNK
4725 return xstrdup (pathspec);
4726 #else
4727 char buf[LT_PATHMAX];
4728 struct stat s;
4729 char *tmp_pathspec = xstrdup (pathspec);
4730 char *p;
4731 int has_symlinks = 0;
4732 while (strlen (tmp_pathspec) && !has_symlinks)
4733 {
4734 lt_debugprintf (__FILE__, __LINE__,
4735 "checking path component for symlinks: %s\n",
4736 tmp_pathspec);
4737 if (lstat (tmp_pathspec, &s) == 0)
4738 {
4739 if (S_ISLNK (s.st_mode) != 0)
4740 {
4741 has_symlinks = 1;
4742 break;
4743 }
4744
4745 /* search backwards for last DIR_SEPARATOR */
4746 p = tmp_pathspec + strlen (tmp_pathspec) - 1;
4747 while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
4748 p--;
4749 if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
4750 {
4751 /* no more DIR_SEPARATORS left */
4752 break;
4753 }
4754 *p = '\0';
4755 }
4756 else
4757 {
4758 lt_fatal (__FILE__, __LINE__,
4759 "error accessing file \"%s\": %s",
4760 tmp_pathspec, nonnull (strerror (errno)));
4761 }
4762 }
4763 XFREE (tmp_pathspec);
4764
4765 if (!has_symlinks)
4766 {
4767 return xstrdup (pathspec);
4768 }
4769
4770 tmp_pathspec = realpath (pathspec, buf);
4771 if (tmp_pathspec == 0)
4772 {
4773 lt_fatal (__FILE__, __LINE__,
4774 "could not follow symlinks for %s", pathspec);
4775 }
4776 return xstrdup (tmp_pathspec);
4777 #endif
4778 }
4779
4780 char *
4781 strendzap (char *str, const char *pat)
4782 {
4783 size_t len, patlen;
4784
4785 assert (str != NULL);
4786 assert (pat != NULL);
4787
4788 len = strlen (str);
4789 patlen = strlen (pat);
4790
4791 if (patlen <= len)
4792 {
4793 str += len - patlen;
4794 if (strcmp (str, pat) == 0)
4795 *str = '\0';
4796 }
4797 return str;
4798 }
4799
4800 void
4801 lt_debugprintf (const char *file, int line, const char *fmt, ...)
4802 {
4803 va_list args;
4804 if (lt_debug)
4805 {
4806 (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line);
4807 va_start (args, fmt);
4808 (void) vfprintf (stderr, fmt, args);
4809 va_end (args);
4810 }
4811 }
4812
4813 static void
4814 lt_error_core (int exit_status, const char *file,
4815 int line, const char *mode,
4816 const char *message, va_list ap)
4817 {
4818 fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode);
4819 vfprintf (stderr, message, ap);
4820 fprintf (stderr, ".\n");
4821
4822 if (exit_status >= 0)
4823 exit (exit_status);
4824 }
4825
4826 void
4827 lt_fatal (const char *file, int line, const char *message, ...)
4828 {
4829 va_list ap;
4830 va_start (ap, message);
4831 lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap);
4832 va_end (ap);
4833 }
4834
4835 static const char *
4836 nonnull (const char *s)
4837 {
4838 return s ? s : "(null)";
4839 }
4840
4841 static const char *
4842 nonempty (const char *s)
4843 {
4844 return (s && !*s) ? "(empty)" : nonnull (s);
4845 }
4846
4847 void
4848 lt_setenv (const char *name, const char *value)
4849 {
4850 lt_debugprintf (__FILE__, __LINE__,
4851 "(lt_setenv) setting '%s' to '%s'\n",
4852 nonnull (name), nonnull (value));
4853 {
4854 #ifdef HAVE_SETENV
4855 /* always make a copy, for consistency with !HAVE_SETENV */
4856 char *str = xstrdup (value);
4857 setenv (name, str, 1);
4858 #else
4859 int len = strlen (name) + 1 + strlen (value) + 1;
4860 char *str = XMALLOC (char, len);
4861 sprintf (str, "%s=%s", name, value);
4862 if (putenv (str) != EXIT_SUCCESS)
4863 {
4864 XFREE (str);
4865 }
4866 #endif
4867 }
4868 }
4869
4870 char *
4871 lt_extend_str (const char *orig_value, const char *add, int to_end)
4872 {
4873 char *new_value;
4874 if (orig_value && *orig_value)
4875 {
4876 int orig_value_len = strlen (orig_value);
4877 int add_len = strlen (add);
4878 new_value = XMALLOC (char, add_len + orig_value_len + 1);
4879 if (to_end)
4880 {
4881 strcpy (new_value, orig_value);
4882 strcpy (new_value + orig_value_len, add);
4883 }
4884 else
4885 {
4886 strcpy (new_value, add);
4887 strcpy (new_value + add_len, orig_value);
4888 }
4889 }
4890 else
4891 {
4892 new_value = xstrdup (add);
4893 }
4894 return new_value;
4895 }
4896
4897 void
4898 lt_update_exe_path (const char *name, const char *value)
4899 {
4900 lt_debugprintf (__FILE__, __LINE__,
4901 "(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
4902 nonnull (name), nonnull (value));
4903
4904 if (name && *name && value && *value)
4905 {
4906 char *new_value = lt_extend_str (getenv (name), value, 0);
4907 /* some systems can't cope with a ':'-terminated path #' */
4908 int len = strlen (new_value);
4909 while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
4910 {
4911 new_value[len-1] = '\0';
4912 }
4913 lt_setenv (name, new_value);
4914 XFREE (new_value);
4915 }
4916 }
4917
4918 void
4919 lt_update_lib_path (const char *name, const char *value)
4920 {
4921 lt_debugprintf (__FILE__, __LINE__,
4922 "(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
4923 nonnull (name), nonnull (value));
4924
4925 if (name && *name && value && *value)
4926 {
4927 char *new_value = lt_extend_str (getenv (name), value, 0);
4928 lt_setenv (name, new_value);
4929 XFREE (new_value);
4930 }
4931 }
4932
4933 EOF
4934 case $host_os in
4935 mingw*)
4936 cat <<"EOF"
4937
4938 /* Prepares an argument vector before calling spawn().
4939 Note that spawn() does not by itself call the command interpreter
4940 (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
4941 ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
4942 GetVersionEx(&v);
4943 v.dwPlatformId == VER_PLATFORM_WIN32_NT;
4944 }) ? "cmd.exe" : "command.com").
4945 Instead it simply concatenates the arguments, separated by ' ', and calls
4946 CreateProcess(). We must quote the arguments since Win32 CreateProcess()
4947 interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a
4948 special way:
4949 - Space and tab are interpreted as delimiters. They are not treated as
4950 delimiters if they are surrounded by double quotes: "...".
4951 - Unescaped double quotes are removed from the input. Their only effect is
4952 that within double quotes, space and tab are treated like normal
4953 characters.
4954 - Backslashes not followed by double quotes are not special.
4955 - But 2*n+1 backslashes followed by a double quote become
4956 n backslashes followed by a double quote (n >= 0):
4957 \" -> "
4958 \\\" -> \"
4959 \\\\\" -> \\"
4960 */
4961 #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
4962 #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
4963 char **
4964 prepare_spawn (char **argv)
4965 {
4966 size_t argc;
4967 char **new_argv;
4968 size_t i;
4969
4970 /* Count number of arguments. */
4971 for (argc = 0; argv[argc] != NULL; argc++)
4972 ;
4973
4974 /* Allocate new argument vector. */
4975 new_argv = XMALLOC (char *, argc + 1);
4976
4977 /* Put quoted arguments into the new argument vector. */
4978 for (i = 0; i < argc; i++)
4979 {
4980 const char *string = argv[i];
4981
4982 if (string[0] == '\0')
4983 new_argv[i] = xstrdup ("\"\"");
4984 else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
4985 {
4986 int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
4987 size_t length;
4988 unsigned int backslashes;
4989 const char *s;
4990 char *quoted_string;
4991 char *p;
4992
4993 length = 0;
4994 backslashes = 0;
4995 if (quote_around)
4996 length++;
4997 for (s = string; *s != '\0'; s++)
4998 {
4999 char c = *s;
5000 if (c == '"')
5001 length += backslashes + 1;
5002 length++;
5003 if (c == '\\')
5004 backslashes++;
5005 else
5006 backslashes = 0;
5007 }
5008 if (quote_around)
5009 length += backslashes + 1;
5010
5011 quoted_string = XMALLOC (char, length + 1);
5012
5013 p = quoted_string;
5014 backslashes = 0;
5015 if (quote_around)
5016 *p++ = '"';
5017 for (s = string; *s != '\0'; s++)
5018 {
5019 char c = *s;
5020 if (c == '"')
5021 {
5022 unsigned int j;
5023 for (j = backslashes + 1; j > 0; j--)
5024 *p++ = '\\';
5025 }
5026 *p++ = c;
5027 if (c == '\\')
5028 backslashes++;
5029 else
5030 backslashes = 0;
5031 }
5032 if (quote_around)
5033 {
5034 unsigned int j;
5035 for (j = backslashes; j > 0; j--)
5036 *p++ = '\\';
5037 *p++ = '"';
5038 }
5039 *p = '\0';
5040
5041 new_argv[i] = quoted_string;
5042 }
5043 else
5044 new_argv[i] = (char *) string;
5045 }
5046 new_argv[argc] = NULL;
5047
5048 return new_argv;
5049 }
5050 EOF
5051 ;;
5052 esac
5053
5054 cat <<"EOF"
5055 void lt_dump_script (FILE* f)
5056 {
5057 EOF
5058 func_emit_wrapper yes |
5059 $SED -e 's/\([\\"]\)/\\\1/g' \
5060 -e 's/^/ fputs ("/' -e 's/$/\\n", f);/'
5061
5062 cat <<"EOF"
5063 }
5064 EOF
5065 }
5066 # end: func_emit_cwrapperexe_src
5067
5068 # func_win32_import_lib_p ARG
5069 # True if ARG is an import lib, as indicated by $file_magic_cmd
5070 func_win32_import_lib_p ()
5071 {
5072 $opt_debug
5073 case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
5074 *import*) : ;;
5075 *) false ;;
5076 esac
5077 }
5078
5079 # func_mode_link arg...
5080 func_mode_link ()
5081 {
5082 $opt_debug
5083 case $host in
5084 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
5085 # It is impossible to link a dll without this setting, and
5086 # we shouldn't force the makefile maintainer to figure out
5087 # which system we are compiling for in order to pass an extra
5088 # flag for every libtool invocation.
5089 # allow_undefined=no
5090
5091 # FIXME: Unfortunately, there are problems with the above when trying
5092 # to make a dll which has undefined symbols, in which case not
5093 # even a static library is built. For now, we need to specify
5094 # -no-undefined on the libtool link line when we can be certain
5095 # that all symbols are satisfied, otherwise we get a static library.
5096 allow_undefined=yes
5097 ;;
5098 *)
5099 allow_undefined=yes
5100 ;;
5101 esac
5102 libtool_args=$nonopt
5103 base_compile="$nonopt $@"
5104 compile_command=$nonopt
5105 finalize_command=$nonopt
5106
5107 compile_rpath=
5108 finalize_rpath=
5109 compile_shlibpath=
5110 finalize_shlibpath=
5111 convenience=
5112 old_convenience=
5113 deplibs=
5114 old_deplibs=
5115 compiler_flags=
5116 linker_flags=
5117 dllsearchpath=
5118 lib_search_path=`pwd`
5119 inst_prefix_dir=
5120 new_inherited_linker_flags=
5121
5122 avoid_version=no
5123 bindir=
5124 dlfiles=
5125 dlprefiles=
5126 dlself=no
5127 export_dynamic=no
5128 export_symbols=
5129 export_symbols_regex=
5130 generated=
5131 libobjs=
5132 ltlibs=
5133 module=no
5134 no_install=no
5135 objs=
5136 non_pic_objects=
5137 precious_files_regex=
5138 prefer_static_libs=no
5139 preload=no
5140 prev=
5141 prevarg=
5142 release=
5143 rpath=
5144 xrpath=
5145 perm_rpath=
5146 temp_rpath=
5147 thread_safe=no
5148 vinfo=
5149 vinfo_number=no
5150 weak_libs=
5151 single_module="${wl}-single_module"
5152 func_infer_tag $base_compile
5153
5154 # We need to know -static, to get the right output filenames.
5155 for arg
5156 do
5157 case $arg in
5158 -shared)
5159 test "$build_libtool_libs" != yes && \
5160 func_fatal_configuration "can not build a shared library"
5161 build_old_libs=no
5162 break
5163 ;;
5164 -all-static | -static | -static-libtool-libs)
5165 case $arg in
5166 -all-static)
5167 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
5168 func_warning "complete static linking is impossible in this configuration"
5169 fi
5170 if test -n "$link_static_flag"; then
5171 dlopen_self=$dlopen_self_static
5172 fi
5173 prefer_static_libs=yes
5174 ;;
5175 -static)
5176 if test -z "$pic_flag" && test -n "$link_static_flag"; then
5177 dlopen_self=$dlopen_self_static
5178 fi
5179 prefer_static_libs=built
5180 ;;
5181 -static-libtool-libs)
5182 if test -z "$pic_flag" && test -n "$link_static_flag"; then
5183 dlopen_self=$dlopen_self_static
5184 fi
5185 prefer_static_libs=yes
5186 ;;
5187 esac
5188 build_libtool_libs=no
5189 build_old_libs=yes
5190 break
5191 ;;
5192 esac
5193 done
5194
5195 # See if our shared archives depend on static archives.
5196 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
5197
5198 # Go through the arguments, transforming them on the way.
5199 while test "$#" -gt 0; do
5200 arg="$1"
5201 shift
5202 func_quote_for_eval "$arg"
5203 qarg=$func_quote_for_eval_unquoted_result
5204 func_append libtool_args " $func_quote_for_eval_result"
5205
5206 # If the previous option needs an argument, assign it.
5207 if test -n "$prev"; then
5208 case $prev in
5209 output)
5210 func_append compile_command " @OUTPUT@"
5211 func_append finalize_command " @OUTPUT@"
5212 ;;
5213 esac
5214
5215 case $prev in
5216 bindir)
5217 bindir="$arg"
5218 prev=
5219 continue
5220 ;;
5221 dlfiles|dlprefiles)
5222 if test "$preload" = no; then
5223 # Add the symbol object into the linking commands.
5224 func_append compile_command " @SYMFILE@"
5225 func_append finalize_command " @SYMFILE@"
5226 preload=yes
5227 fi
5228 case $arg in
5229 *.la | *.lo) ;; # We handle these cases below.
5230 force)
5231 if test "$dlself" = no; then
5232 dlself=needless
5233 export_dynamic=yes
5234 fi
5235 prev=
5236 continue
5237 ;;
5238 self)
5239 if test "$prev" = dlprefiles; then
5240 dlself=yes
5241 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
5242 dlself=yes
5243 else
5244 dlself=needless
5245 export_dynamic=yes
5246 fi
5247 prev=
5248 continue
5249 ;;
5250 *)
5251 if test "$prev" = dlfiles; then
5252 func_append dlfiles " $arg"
5253 else
5254 func_append dlprefiles " $arg"
5255 fi
5256 prev=
5257 continue
5258 ;;
5259 esac
5260 ;;
5261 expsyms)
5262 export_symbols="$arg"
5263 test -f "$arg" \
5264 || func_fatal_error "symbol file \`$arg' does not exist"
5265 prev=
5266 continue
5267 ;;
5268 expsyms_regex)
5269 export_symbols_regex="$arg"
5270 prev=
5271 continue
5272 ;;
5273 framework)
5274 case $host in
5275 *-*-darwin*)
5276 case "$deplibs " in
5277 *" $qarg.ltframework "*) ;;
5278 *) func_append deplibs " $qarg.ltframework" # this is fixed later
5279 ;;
5280 esac
5281 ;;
5282 esac
5283 prev=
5284 continue
5285 ;;
5286 inst_prefix)
5287 inst_prefix_dir="$arg"
5288 prev=
5289 continue
5290 ;;
5291 objectlist)
5292 if test -f "$arg"; then
5293 save_arg=$arg
5294 moreargs=
5295 for fil in `cat "$save_arg"`
5296 do
5297 # func_append moreargs " $fil"
5298 arg=$fil
5299 # A libtool-controlled object.
5300
5301 # Check to see that this really is a libtool object.
5302 if func_lalib_unsafe_p "$arg"; then
5303 pic_object=
5304 non_pic_object=
5305
5306 # Read the .lo file
5307 func_source "$arg"
5308
5309 if test -z "$pic_object" ||
5310 test -z "$non_pic_object" ||
5311 test "$pic_object" = none &&
5312 test "$non_pic_object" = none; then
5313 func_fatal_error "cannot find name of object for \`$arg'"
5314 fi
5315
5316 # Extract subdirectory from the argument.
5317 func_dirname "$arg" "/" ""
5318 xdir="$func_dirname_result"
5319
5320 if test "$pic_object" != none; then
5321 # Prepend the subdirectory the object is found in.
5322 pic_object="$xdir$pic_object"
5323
5324 if test "$prev" = dlfiles; then
5325 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
5326 func_append dlfiles " $pic_object"
5327 prev=
5328 continue
5329 else
5330 # If libtool objects are unsupported, then we need to preload.
5331 prev=dlprefiles
5332 fi
5333 fi
5334
5335 # CHECK ME: I think I busted this. -Ossama
5336 if test "$prev" = dlprefiles; then
5337 # Preload the old-style object.
5338 func_append dlprefiles " $pic_object"
5339 prev=
5340 fi
5341
5342 # A PIC object.
5343 func_append libobjs " $pic_object"
5344 arg="$pic_object"
5345 fi
5346
5347 # Non-PIC object.
5348 if test "$non_pic_object" != none; then
5349 # Prepend the subdirectory the object is found in.
5350 non_pic_object="$xdir$non_pic_object"
5351
5352 # A standard non-PIC object
5353 func_append non_pic_objects " $non_pic_object"
5354 if test -z "$pic_object" || test "$pic_object" = none ; then
5355 arg="$non_pic_object"
5356 fi
5357 else
5358 # If the PIC object exists, use it instead.
5359 # $xdir was prepended to $pic_object above.
5360 non_pic_object="$pic_object"
5361 func_append non_pic_objects " $non_pic_object"
5362 fi
5363 else
5364 # Only an error if not doing a dry-run.
5365 if $opt_dry_run; then
5366 # Extract subdirectory from the argument.
5367 func_dirname "$arg" "/" ""
5368 xdir="$func_dirname_result"
5369
5370 func_lo2o "$arg"
5371 pic_object=$xdir$objdir/$func_lo2o_result
5372 non_pic_object=$xdir$func_lo2o_result
5373 func_append libobjs " $pic_object"
5374 func_append non_pic_objects " $non_pic_object"
5375 else
5376 func_fatal_error "\`$arg' is not a valid libtool object"
5377 fi
5378 fi
5379 done
5380 else
5381 func_fatal_error "link input file \`$arg' does not exist"
5382 fi
5383 arg=$save_arg
5384 prev=
5385 continue
5386 ;;
5387 precious_regex)
5388 precious_files_regex="$arg"
5389 prev=
5390 continue
5391 ;;
5392 release)
5393 release="-$arg"
5394 prev=
5395 continue
5396 ;;
5397 rpath | xrpath)
5398 # We need an absolute path.
5399 case $arg in
5400 [\\/]* | [A-Za-z]:[\\/]*) ;;
5401 *)
5402 func_fatal_error "only absolute run-paths are allowed"
5403 ;;
5404 esac
5405 if test "$prev" = rpath; then
5406 case "$rpath " in
5407 *" $arg "*) ;;
5408 *) func_append rpath " $arg" ;;
5409 esac
5410 else
5411 case "$xrpath " in
5412 *" $arg "*) ;;
5413 *) func_append xrpath " $arg" ;;
5414 esac
5415 fi
5416 prev=
5417 continue
5418 ;;
5419 shrext)
5420 shrext_cmds="$arg"
5421 prev=
5422 continue
5423 ;;
5424 weak)
5425 func_append weak_libs " $arg"
5426 prev=
5427 continue
5428 ;;
5429 xcclinker)
5430 func_append linker_flags " $qarg"
5431 func_append compiler_flags " $qarg"
5432 prev=
5433 func_append compile_command " $qarg"
5434 func_append finalize_command " $qarg"
5435 continue
5436 ;;
5437 xcompiler)
5438 func_append compiler_flags " $qarg"
5439 prev=
5440 func_append compile_command " $qarg"
5441 func_append finalize_command " $qarg"
5442 continue
5443 ;;
5444 xlinker)
5445 func_append linker_flags " $qarg"
5446 func_append compiler_flags " $wl$qarg"
5447 prev=
5448 func_append compile_command " $wl$qarg"
5449 func_append finalize_command " $wl$qarg"
5450 continue
5451 ;;
5452 *)
5453 eval "$prev=\"\$arg\""
5454 prev=
5455 continue
5456 ;;
5457 esac
5458 fi # test -n "$prev"
5459
5460 prevarg="$arg"
5461
5462 case $arg in
5463 -all-static)
5464 if test -n "$link_static_flag"; then
5465 # See comment for -static flag below, for more details.
5466 func_append compile_command " $link_static_flag"
5467 func_append finalize_command " $link_static_flag"
5468 fi
5469 continue
5470 ;;
5471
5472 -allow-undefined)
5473 # FIXME: remove this flag sometime in the future.
5474 func_fatal_error "\`-allow-undefined' must not be used because it is the default"
5475 ;;
5476
5477 -avoid-version)
5478 avoid_version=yes
5479 continue
5480 ;;
5481
5482 -bindir)
5483 prev=bindir
5484 continue
5485 ;;
5486
5487 -dlopen)
5488 prev=dlfiles
5489 continue
5490 ;;
5491
5492 -dlpreopen)
5493 prev=dlprefiles
5494 continue
5495 ;;
5496
5497 -export-dynamic)
5498 export_dynamic=yes
5499 continue
5500 ;;
5501
5502 -export-symbols | -export-symbols-regex)
5503 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
5504 func_fatal_error "more than one -exported-symbols argument is not allowed"
5505 fi
5506 if test "X$arg" = "X-export-symbols"; then
5507 prev=expsyms
5508 else
5509 prev=expsyms_regex
5510 fi
5511 continue
5512 ;;
5513
5514 -framework)
5515 prev=framework
5516 continue
5517 ;;
5518
5519 -inst-prefix-dir)
5520 prev=inst_prefix
5521 continue
5522 ;;
5523
5524 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
5525 # so, if we see these flags be careful not to treat them like -L
5526 -L[A-Z][A-Z]*:*)
5527 case $with_gcc/$host in
5528 no/*-*-irix* | /*-*-irix*)
5529 func_append compile_command " $arg"
5530 func_append finalize_command " $arg"
5531 ;;
5532 esac
5533 continue
5534 ;;
5535
5536 -L*)
5537 func_stripname "-L" '' "$arg"
5538 if test -z "$func_stripname_result"; then
5539 if test "$#" -gt 0; then
5540 func_fatal_error "require no space between \`-L' and \`$1'"
5541 else
5542 func_fatal_error "need path for \`-L' option"
5543 fi
5544 fi
5545 func_resolve_sysroot "$func_stripname_result"
5546 dir=$func_resolve_sysroot_result
5547 # We need an absolute path.
5548 case $dir in
5549 [\\/]* | [A-Za-z]:[\\/]*) ;;
5550 *)
5551 absdir=`cd "$dir" && pwd`
5552 test -z "$absdir" && \
5553 func_fatal_error "cannot determine absolute directory name of \`$dir'"
5554 dir="$absdir"
5555 ;;
5556 esac
5557 case "$deplibs " in
5558 *" -L$dir "* | *" $arg "*)
5559 # Will only happen for absolute or sysroot arguments
5560 ;;
5561 *)
5562 # Preserve sysroot, but never include relative directories
5563 case $dir in
5564 [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;;
5565 *) func_append deplibs " -L$dir" ;;
5566 esac
5567 func_append lib_search_path " $dir"
5568 ;;
5569 esac
5570 case $host in
5571 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
5572 testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`
5573 case :$dllsearchpath: in
5574 *":$dir:"*) ;;
5575 ::) dllsearchpath=$dir;;
5576 *) func_append dllsearchpath ":$dir";;
5577 esac
5578 case :$dllsearchpath: in
5579 *":$testbindir:"*) ;;
5580 ::) dllsearchpath=$testbindir;;
5581 *) func_append dllsearchpath ":$testbindir";;
5582 esac
5583 ;;
5584 esac
5585 continue
5586 ;;
5587
5588 -l*)
5589 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
5590 case $host in
5591 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
5592 # These systems don't actually have a C or math library (as such)
5593 continue
5594 ;;
5595 *-*-os2*)
5596 # These systems don't actually have a C library (as such)
5597 test "X$arg" = "X-lc" && continue
5598 ;;
5599 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
5600 # Do not include libc due to us having libc/libc_r.
5601 test "X$arg" = "X-lc" && continue
5602 ;;
5603 *-*-rhapsody* | *-*-darwin1.[012])
5604 # Rhapsody C and math libraries are in the System framework
5605 func_append deplibs " System.ltframework"
5606 continue
5607 ;;
5608 *-*-sco3.2v5* | *-*-sco5v6*)
5609 # Causes problems with __ctype
5610 test "X$arg" = "X-lc" && continue
5611 ;;
5612 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
5613 # Compiler inserts libc in the correct place for threads to work
5614 test "X$arg" = "X-lc" && continue
5615 ;;
5616 esac
5617 elif test "X$arg" = "X-lc_r"; then
5618 case $host in
5619 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
5620 # Do not include libc_r directly, use -pthread flag.
5621 continue
5622 ;;
5623 esac
5624 fi
5625 func_append deplibs " $arg"
5626 continue
5627 ;;
5628
5629 -module)
5630 module=yes
5631 continue
5632 ;;
5633
5634 # Tru64 UNIX uses -model [arg] to determine the layout of C++
5635 # classes, name mangling, and exception handling.
5636 # Darwin uses the -arch flag to determine output architecture.
5637 -model|-arch|-isysroot|--sysroot)
5638 func_append compiler_flags " $arg"
5639 func_append compile_command " $arg"
5640 func_append finalize_command " $arg"
5641 prev=xcompiler
5642 continue
5643 ;;
5644
5645 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
5646 func_append compiler_flags " $arg"
5647 func_append compile_command " $arg"
5648 func_append finalize_command " $arg"
5649 case "$new_inherited_linker_flags " in
5650 *" $arg "*) ;;
5651 * ) func_append new_inherited_linker_flags " $arg" ;;
5652 esac
5653 continue
5654 ;;
5655
5656 -multi_module)
5657 single_module="${wl}-multi_module"
5658 continue
5659 ;;
5660
5661 -no-fast-install)
5662 fast_install=no
5663 continue
5664 ;;
5665
5666 -no-install)
5667 case $host in
5668 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
5669 # The PATH hackery in wrapper scripts is required on Windows
5670 # and Darwin in order for the loader to find any dlls it needs.
5671 func_warning "\`-no-install' is ignored for $host"
5672 func_warning "assuming \`-no-fast-install' instead"
5673 fast_install=no
5674 ;;
5675 *) no_install=yes ;;
5676 esac
5677 continue
5678 ;;
5679
5680 -no-undefined)
5681 allow_undefined=no
5682 continue
5683 ;;
5684
5685 -objectlist)
5686 prev=objectlist
5687 continue
5688 ;;
5689
5690 -o) prev=output ;;
5691
5692 -precious-files-regex)
5693 prev=precious_regex
5694 continue
5695 ;;
5696
5697 -release)
5698 prev=release
5699 continue
5700 ;;
5701
5702 -rpath)
5703 prev=rpath
5704 continue
5705 ;;
5706
5707 -R)
5708 prev=xrpath
5709 continue
5710 ;;
5711
5712 -R*)
5713 func_stripname '-R' '' "$arg"
5714 dir=$func_stripname_result
5715 # We need an absolute path.
5716 case $dir in
5717 [\\/]* | [A-Za-z]:[\\/]*) ;;
5718 =*)
5719 func_stripname '=' '' "$dir"
5720 dir=$lt_sysroot$func_stripname_result
5721 ;;
5722 *)
5723 func_fatal_error "only absolute run-paths are allowed"
5724 ;;
5725 esac
5726 case "$xrpath " in
5727 *" $dir "*) ;;
5728 *) func_append xrpath " $dir" ;;
5729 esac
5730 continue
5731 ;;
5732
5733 -shared)
5734 # The effects of -shared are defined in a previous loop.
5735 continue
5736 ;;
5737
5738 -shrext)
5739 prev=shrext
5740 continue
5741 ;;
5742
5743 -static | -static-libtool-libs)
5744 # The effects of -static are defined in a previous loop.
5745 # We used to do the same as -all-static on platforms that
5746 # didn't have a PIC flag, but the assumption that the effects
5747 # would be equivalent was wrong. It would break on at least
5748 # Digital Unix and AIX.
5749 continue
5750 ;;
5751
5752 -thread-safe)
5753 thread_safe=yes
5754 continue
5755 ;;
5756
5757 -version-info)
5758 prev=vinfo
5759 continue
5760 ;;
5761
5762 -version-number)
5763 prev=vinfo
5764 vinfo_number=yes
5765 continue
5766 ;;
5767
5768 -weak)
5769 prev=weak
5770 continue
5771 ;;
5772
5773 -Wc,*)
5774 func_stripname '-Wc,' '' "$arg"
5775 args=$func_stripname_result
5776 arg=
5777 save_ifs="$IFS"; IFS=','
5778 for flag in $args; do
5779 IFS="$save_ifs"
5780 func_quote_for_eval "$flag"
5781 func_append arg " $func_quote_for_eval_result"
5782 func_append compiler_flags " $func_quote_for_eval_result"
5783 done
5784 IFS="$save_ifs"
5785 func_stripname ' ' '' "$arg"
5786 arg=$func_stripname_result
5787 ;;
5788
5789 -Wl,*)
5790 func_stripname '-Wl,' '' "$arg"
5791 args=$func_stripname_result
5792 arg=
5793 save_ifs="$IFS"; IFS=','
5794 for flag in $args; do
5795 IFS="$save_ifs"
5796 func_quote_for_eval "$flag"
5797 func_append arg " $wl$func_quote_for_eval_result"
5798 func_append compiler_flags " $wl$func_quote_for_eval_result"
5799 func_append linker_flags " $func_quote_for_eval_result"
5800 done
5801 IFS="$save_ifs"
5802 func_stripname ' ' '' "$arg"
5803 arg=$func_stripname_result
5804 ;;
5805
5806 -Xcompiler)
5807 prev=xcompiler
5808 continue
5809 ;;
5810
5811 -Xlinker)
5812 prev=xlinker
5813 continue
5814 ;;
5815
5816 -XCClinker)
5817 prev=xcclinker
5818 continue
5819 ;;
5820
5821 # -msg_* for osf cc
5822 -msg_*)
5823 func_quote_for_eval "$arg"
5824 arg="$func_quote_for_eval_result"
5825 ;;
5826
5827 # Flags to be passed through unchanged, with rationale:
5828 # -64, -mips[0-9] enable 64-bit mode for the SGI compiler
5829 # -r[0-9][0-9]* specify processor for the SGI compiler
5830 # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
5831 # +DA*, +DD* enable 64-bit mode for the HP compiler
5832 # -q* compiler args for the IBM compiler
5833 # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
5834 # -F/path path to uninstalled frameworks, gcc on darwin
5835 # -p, -pg, --coverage, -fprofile-* profiling flags for GCC
5836 # @file GCC response files
5837 # -tp=* Portland pgcc target processor selection
5838 # --sysroot=* for sysroot support
5839 # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
5840 -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
5841 -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
5842 -O*|-flto*|-fwhopr*|-fuse-linker-plugin)
5843 func_quote_for_eval "$arg"
5844 arg="$func_quote_for_eval_result"
5845 func_append compile_command " $arg"
5846 func_append finalize_command " $arg"
5847 func_append compiler_flags " $arg"
5848 continue
5849 ;;
5850
5851 # Some other compiler flag.
5852 -* | +*)
5853 func_quote_for_eval "$arg"
5854 arg="$func_quote_for_eval_result"
5855 ;;
5856
5857 *.$objext)
5858 # A standard object.
5859 func_append objs " $arg"
5860 ;;
5861
5862 *.lo)
5863 # A libtool-controlled object.
5864
5865 # Check to see that this really is a libtool object.
5866 if func_lalib_unsafe_p "$arg"; then
5867 pic_object=
5868 non_pic_object=
5869
5870 # Read the .lo file
5871 func_source "$arg"
5872
5873 if test -z "$pic_object" ||
5874 test -z "$non_pic_object" ||
5875 test "$pic_object" = none &&
5876 test "$non_pic_object" = none; then
5877 func_fatal_error "cannot find name of object for \`$arg'"
5878 fi
5879
5880 # Extract subdirectory from the argument.
5881 func_dirname "$arg" "/" ""
5882 xdir="$func_dirname_result"
5883
5884 if test "$pic_object" != none; then
5885 # Prepend the subdirectory the object is found in.
5886 pic_object="$xdir$pic_object"
5887
5888 if test "$prev" = dlfiles; then
5889 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
5890 func_append dlfiles " $pic_object"
5891 prev=
5892 continue
5893 else
5894 # If libtool objects are unsupported, then we need to preload.
5895 prev=dlprefiles
5896 fi
5897 fi
5898
5899 # CHECK ME: I think I busted this. -Ossama
5900 if test "$prev" = dlprefiles; then
5901 # Preload the old-style object.
5902 func_append dlprefiles " $pic_object"
5903 prev=
5904 fi
5905
5906 # A PIC object.
5907 func_append libobjs " $pic_object"
5908 arg="$pic_object"
5909 fi
5910
5911 # Non-PIC object.
5912 if test "$non_pic_object" != none; then
5913 # Prepend the subdirectory the object is found in.
5914 non_pic_object="$xdir$non_pic_object"
5915
5916 # A standard non-PIC object
5917 func_append non_pic_objects " $non_pic_object"
5918 if test -z "$pic_object" || test "$pic_object" = none ; then
5919 arg="$non_pic_object"
5920 fi
5921 else
5922 # If the PIC object exists, use it instead.
5923 # $xdir was prepended to $pic_object above.
5924 non_pic_object="$pic_object"
5925 func_append non_pic_objects " $non_pic_object"
5926 fi
5927 else
5928 # Only an error if not doing a dry-run.
5929 if $opt_dry_run; then
5930 # Extract subdirectory from the argument.
5931 func_dirname "$arg" "/" ""
5932 xdir="$func_dirname_result"
5933
5934 func_lo2o "$arg"
5935 pic_object=$xdir$objdir/$func_lo2o_result
5936 non_pic_object=$xdir$func_lo2o_result
5937 func_append libobjs " $pic_object"
5938 func_append non_pic_objects " $non_pic_object"
5939 else
5940 func_fatal_error "\`$arg' is not a valid libtool object"
5941 fi
5942 fi
5943 ;;
5944
5945 *.$libext)
5946 # An archive.
5947 func_append deplibs " $arg"
5948 func_append old_deplibs " $arg"
5949 continue
5950 ;;
5951
5952 *.la)
5953 # A libtool-controlled library.
5954
5955 func_resolve_sysroot "$arg"
5956 if test "$prev" = dlfiles; then
5957 # This library was specified with -dlopen.
5958 func_append dlfiles " $func_resolve_sysroot_result"
5959 prev=
5960 elif test "$prev" = dlprefiles; then
5961 # The library was specified with -dlpreopen.
5962 func_append dlprefiles " $func_resolve_sysroot_result"
5963 prev=
5964 else
5965 func_append deplibs " $func_resolve_sysroot_result"
5966 fi
5967 continue
5968 ;;
5969
5970 # Some other compiler argument.
5971 *)
5972 # Unknown arguments in both finalize_command and compile_command need
5973 # to be aesthetically quoted because they are evaled later.
5974 func_quote_for_eval "$arg"
5975 arg="$func_quote_for_eval_result"
5976 ;;
5977 esac # arg
5978
5979 # Now actually substitute the argument into the commands.
5980 if test -n "$arg"; then
5981 func_append compile_command " $arg"
5982 func_append finalize_command " $arg"
5983 fi
5984 done # argument parsing loop
5985
5986 test -n "$prev" && \
5987 func_fatal_help "the \`$prevarg' option requires an argument"
5988
5989 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
5990 eval arg=\"$export_dynamic_flag_spec\"
5991 func_append compile_command " $arg"
5992 func_append finalize_command " $arg"
5993 fi
5994
5995 oldlibs=
5996 # calculate the name of the file, without its directory
5997 func_basename "$output"
5998 outputname="$func_basename_result"
5999 libobjs_save="$libobjs"
6000
6001 if test -n "$shlibpath_var"; then
6002 # get the directories listed in $shlibpath_var
6003 eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\`
6004 else
6005 shlib_search_path=
6006 fi
6007 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
6008 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
6009
6010 func_dirname "$output" "/" ""
6011 output_objdir="$func_dirname_result$objdir"
6012 func_to_tool_file "$output_objdir/"
6013 tool_output_objdir=$func_to_tool_file_result
6014 # Create the object directory.
6015 func_mkdir_p "$output_objdir"
6016
6017 # Determine the type of output
6018 case $output in
6019 "")
6020 func_fatal_help "you must specify an output file"
6021 ;;
6022 *.$libext) linkmode=oldlib ;;
6023 *.lo | *.$objext) linkmode=obj ;;
6024 *.la) linkmode=lib ;;
6025 *) linkmode=prog ;; # Anything else should be a program.
6026 esac
6027
6028 specialdeplibs=
6029
6030 libs=
6031 # Find all interdependent deplibs by searching for libraries
6032 # that are linked more than once (e.g. -la -lb -la)
6033 for deplib in $deplibs; do
6034 if $opt_preserve_dup_deps ; then
6035 case "$libs " in
6036 *" $deplib "*) func_append specialdeplibs " $deplib" ;;
6037 esac
6038 fi
6039 func_append libs " $deplib"
6040 done
6041
6042 if test "$linkmode" = lib; then
6043 libs="$predeps $libs $compiler_lib_search_path $postdeps"
6044
6045 # Compute libraries that are listed more than once in $predeps
6046 # $postdeps and mark them as special (i.e., whose duplicates are
6047 # not to be eliminated).
6048 pre_post_deps=
6049 if $opt_duplicate_compiler_generated_deps; then
6050 for pre_post_dep in $predeps $postdeps; do
6051 case "$pre_post_deps " in
6052 *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;;
6053 esac
6054 func_append pre_post_deps " $pre_post_dep"
6055 done
6056 fi
6057 pre_post_deps=
6058 fi
6059
6060 deplibs=
6061 newdependency_libs=
6062 newlib_search_path=
6063 need_relink=no # whether we're linking any uninstalled libtool libraries
6064 notinst_deplibs= # not-installed libtool libraries
6065 notinst_path= # paths that contain not-installed libtool libraries
6066
6067 case $linkmode in
6068 lib)
6069 passes="conv dlpreopen link"
6070 for file in $dlfiles $dlprefiles; do
6071 case $file in
6072 *.la) ;;
6073 *)
6074 func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
6075 ;;
6076 esac
6077 done
6078 ;;
6079 prog)
6080 compile_deplibs=
6081 finalize_deplibs=
6082 alldeplibs=no
6083 newdlfiles=
6084 newdlprefiles=
6085 passes="conv scan dlopen dlpreopen link"
6086 ;;
6087 *) passes="conv"
6088 ;;
6089 esac
6090
6091 for pass in $passes; do
6092 # The preopen pass in lib mode reverses $deplibs; put it back here
6093 # so that -L comes before libs that need it for instance...
6094 if test "$linkmode,$pass" = "lib,link"; then
6095 ## FIXME: Find the place where the list is rebuilt in the wrong
6096 ## order, and fix it there properly
6097 tmp_deplibs=
6098 for deplib in $deplibs; do
6099 tmp_deplibs="$deplib $tmp_deplibs"
6100 done
6101 deplibs="$tmp_deplibs"
6102 fi
6103
6104 if test "$linkmode,$pass" = "lib,link" ||
6105 test "$linkmode,$pass" = "prog,scan"; then
6106 libs="$deplibs"
6107 deplibs=
6108 fi
6109 if test "$linkmode" = prog; then
6110 case $pass in
6111 dlopen) libs="$dlfiles" ;;
6112 dlpreopen) libs="$dlprefiles" ;;
6113 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
6114 esac
6115 fi
6116 if test "$linkmode,$pass" = "lib,dlpreopen"; then
6117 # Collect and forward deplibs of preopened libtool libs
6118 for lib in $dlprefiles; do
6119 # Ignore non-libtool-libs
6120 dependency_libs=
6121 func_resolve_sysroot "$lib"
6122 case $lib in
6123 *.la) func_source "$func_resolve_sysroot_result" ;;
6124 esac
6125
6126 # Collect preopened libtool deplibs, except any this library
6127 # has declared as weak libs
6128 for deplib in $dependency_libs; do
6129 func_basename "$deplib"
6130 deplib_base=$func_basename_result
6131 case " $weak_libs " in
6132 *" $deplib_base "*) ;;
6133 *) func_append deplibs " $deplib" ;;
6134 esac
6135 done
6136 done
6137 libs="$dlprefiles"
6138 fi
6139 if test "$pass" = dlopen; then
6140 # Collect dlpreopened libraries
6141 save_deplibs="$deplibs"
6142 deplibs=
6143 fi
6144
6145 for deplib in $libs; do
6146 lib=
6147 found=no
6148 case $deplib in
6149 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
6150 if test "$linkmode,$pass" = "prog,link"; then
6151 compile_deplibs="$deplib $compile_deplibs"
6152 finalize_deplibs="$deplib $finalize_deplibs"
6153 else
6154 func_append compiler_flags " $deplib"
6155 if test "$linkmode" = lib ; then
6156 case "$new_inherited_linker_flags " in
6157 *" $deplib "*) ;;
6158 * ) func_append new_inherited_linker_flags " $deplib" ;;
6159 esac
6160 fi
6161 fi
6162 continue
6163 ;;
6164 -l*)
6165 if test "$linkmode" != lib && test "$linkmode" != prog; then
6166 func_warning "\`-l' is ignored for archives/objects"
6167 continue
6168 fi
6169 func_stripname '-l' '' "$deplib"
6170 name=$func_stripname_result
6171 if test "$linkmode" = lib; then
6172 searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
6173 else
6174 searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
6175 fi
6176 for searchdir in $searchdirs; do
6177 for search_ext in .la $std_shrext .so .a; do
6178 # Search the libtool library
6179 lib="$searchdir/lib${name}${search_ext}"
6180 if test -f "$lib"; then
6181 if test "$search_ext" = ".la"; then
6182 found=yes
6183 else
6184 found=no
6185 fi
6186 break 2
6187 fi
6188 done
6189 done
6190 if test "$found" != yes; then
6191 # deplib doesn't seem to be a libtool library
6192 if test "$linkmode,$pass" = "prog,link"; then
6193 compile_deplibs="$deplib $compile_deplibs"
6194 finalize_deplibs="$deplib $finalize_deplibs"
6195 else
6196 deplibs="$deplib $deplibs"
6197 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
6198 fi
6199 continue
6200 else # deplib is a libtool library
6201 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
6202 # We need to do some special things here, and not later.
6203 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
6204 case " $predeps $postdeps " in
6205 *" $deplib "*)
6206 if func_lalib_p "$lib"; then
6207 library_names=
6208 old_library=
6209 func_source "$lib"
6210 for l in $old_library $library_names; do
6211 ll="$l"
6212 done
6213 if test "X$ll" = "X$old_library" ; then # only static version available
6214 found=no
6215 func_dirname "$lib" "" "."
6216 ladir="$func_dirname_result"
6217 lib=$ladir/$old_library
6218 if test "$linkmode,$pass" = "prog,link"; then
6219 compile_deplibs="$deplib $compile_deplibs"
6220 finalize_deplibs="$deplib $finalize_deplibs"
6221 else
6222 deplibs="$deplib $deplibs"
6223 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
6224 fi
6225 continue
6226 fi
6227 fi
6228 ;;
6229 *) ;;
6230 esac
6231 fi
6232 fi
6233 ;; # -l
6234 *.ltframework)
6235 if test "$linkmode,$pass" = "prog,link"; then
6236 compile_deplibs="$deplib $compile_deplibs"
6237 finalize_deplibs="$deplib $finalize_deplibs"
6238 else
6239 deplibs="$deplib $deplibs"
6240 if test "$linkmode" = lib ; then
6241 case "$new_inherited_linker_flags " in
6242 *" $deplib "*) ;;
6243 * ) func_append new_inherited_linker_flags " $deplib" ;;
6244 esac
6245 fi
6246 fi
6247 continue
6248 ;;
6249 -L*)
6250 case $linkmode in
6251 lib)
6252 deplibs="$deplib $deplibs"
6253 test "$pass" = conv && continue
6254 newdependency_libs="$deplib $newdependency_libs"
6255 func_stripname '-L' '' "$deplib"
6256 func_resolve_sysroot "$func_stripname_result"
6257 func_append newlib_search_path " $func_resolve_sysroot_result"
6258 ;;
6259 prog)
6260 if test "$pass" = conv; then
6261 deplibs="$deplib $deplibs"
6262 continue
6263 fi
6264 if test "$pass" = scan; then
6265 deplibs="$deplib $deplibs"
6266 else
6267 compile_deplibs="$deplib $compile_deplibs"
6268 finalize_deplibs="$deplib $finalize_deplibs"
6269 fi
6270 func_stripname '-L' '' "$deplib"
6271 func_resolve_sysroot "$func_stripname_result"
6272 func_append newlib_search_path " $func_resolve_sysroot_result"
6273 ;;
6274 *)
6275 func_warning "\`-L' is ignored for archives/objects"
6276 ;;
6277 esac # linkmode
6278 continue
6279 ;; # -L
6280 -R*)
6281 if test "$pass" = link; then
6282 func_stripname '-R' '' "$deplib"
6283 func_resolve_sysroot "$func_stripname_result"
6284 dir=$func_resolve_sysroot_result
6285 # Make sure the xrpath contains only unique directories.
6286 case "$xrpath " in
6287 *" $dir "*) ;;
6288 *) func_append xrpath " $dir" ;;
6289 esac
6290 fi
6291 deplibs="$deplib $deplibs"
6292 continue
6293 ;;
6294 *.la)
6295 func_resolve_sysroot "$deplib"
6296 lib=$func_resolve_sysroot_result
6297 ;;
6298 *.$libext)
6299 if test "$pass" = conv; then
6300 deplibs="$deplib $deplibs"
6301 continue
6302 fi
6303 case $linkmode in
6304 lib)
6305 # Linking convenience modules into shared libraries is allowed,
6306 # but linking other static libraries is non-portable.
6307 case " $dlpreconveniencelibs " in
6308 *" $deplib "*) ;;
6309 *)
6310 valid_a_lib=no
6311 case $deplibs_check_method in
6312 match_pattern*)
6313 set dummy $deplibs_check_method; shift
6314 match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
6315 if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
6316 | $EGREP "$match_pattern_regex" > /dev/null; then
6317 valid_a_lib=yes
6318 fi
6319 ;;
6320 pass_all)
6321 valid_a_lib=yes
6322 ;;
6323 esac
6324 if test "$valid_a_lib" != yes; then
6325 echo
6326 $ECHO "*** Warning: Trying to link with static lib archive $deplib."
6327 echo "*** I have the capability to make that library automatically link in when"
6328 echo "*** you link to this library. But I can only do this if you have a"
6329 echo "*** shared version of the library, which you do not appear to have"
6330 echo "*** because the file extensions .$libext of this argument makes me believe"
6331 echo "*** that it is just a static archive that I should not use here."
6332 else
6333 echo
6334 $ECHO "*** Warning: Linking the shared library $output against the"
6335 $ECHO "*** static library $deplib is not portable!"
6336 deplibs="$deplib $deplibs"
6337 fi
6338 ;;
6339 esac
6340 continue
6341 ;;
6342 prog)
6343 if test "$pass" != link; then
6344 deplibs="$deplib $deplibs"
6345 else
6346 compile_deplibs="$deplib $compile_deplibs"
6347 finalize_deplibs="$deplib $finalize_deplibs"
6348 fi
6349 continue
6350 ;;
6351 esac # linkmode
6352 ;; # *.$libext
6353 *.lo | *.$objext)
6354 if test "$pass" = conv; then
6355 deplibs="$deplib $deplibs"
6356 elif test "$linkmode" = prog; then
6357 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
6358 # If there is no dlopen support or we're linking statically,
6359 # we need to preload.
6360 func_append newdlprefiles " $deplib"
6361 compile_deplibs="$deplib $compile_deplibs"
6362 finalize_deplibs="$deplib $finalize_deplibs"
6363 else
6364 func_append newdlfiles " $deplib"
6365 fi
6366 fi
6367 continue
6368 ;;
6369 %DEPLIBS%)
6370 alldeplibs=yes
6371 continue
6372 ;;
6373 esac # case $deplib
6374
6375 if test "$found" = yes || test -f "$lib"; then :
6376 else
6377 func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
6378 fi
6379
6380 # Check to see that this really is a libtool archive.
6381 func_lalib_unsafe_p "$lib" \
6382 || func_fatal_error "\`$lib' is not a valid libtool archive"
6383
6384 func_dirname "$lib" "" "."
6385 ladir="$func_dirname_result"
6386
6387 dlname=
6388 dlopen=
6389 dlpreopen=
6390 libdir=
6391 library_names=
6392 old_library=
6393 inherited_linker_flags=
6394 # If the library was installed with an old release of libtool,
6395 # it will not redefine variables installed, or shouldnotlink
6396 installed=yes
6397 shouldnotlink=no
6398 avoidtemprpath=
6399
6400
6401 # Read the .la file
6402 func_source "$lib"
6403
6404 # Convert "-framework foo" to "foo.ltframework"
6405 if test -n "$inherited_linker_flags"; then
6406 tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
6407 for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
6408 case " $new_inherited_linker_flags " in
6409 *" $tmp_inherited_linker_flag "*) ;;
6410 *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";;
6411 esac
6412 done
6413 fi
6414 dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
6415 if test "$linkmode,$pass" = "lib,link" ||
6416 test "$linkmode,$pass" = "prog,scan" ||
6417 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
6418 test -n "$dlopen" && func_append dlfiles " $dlopen"
6419 test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
6420 fi
6421
6422 if test "$pass" = conv; then
6423 # Only check for convenience libraries
6424 deplibs="$lib $deplibs"
6425 if test -z "$libdir"; then
6426 if test -z "$old_library"; then
6427 func_fatal_error "cannot find name of link library for \`$lib'"
6428 fi
6429 # It is a libtool convenience library, so add in its objects.
6430 func_append convenience " $ladir/$objdir/$old_library"
6431 func_append old_convenience " $ladir/$objdir/$old_library"
6432 elif test "$linkmode" != prog && test "$linkmode" != lib; then
6433 func_fatal_error "\`$lib' is not a convenience library"
6434 fi
6435 tmp_libs=
6436 for deplib in $dependency_libs; do
6437 deplibs="$deplib $deplibs"
6438 if $opt_preserve_dup_deps ; then
6439 case "$tmp_libs " in
6440 *" $deplib "*) func_append specialdeplibs " $deplib" ;;
6441 esac
6442 fi
6443 func_append tmp_libs " $deplib"
6444 done
6445 continue
6446 fi # $pass = conv
6447
6448
6449 # Get the name of the library we link against.
6450 linklib=
6451 if test -n "$old_library" &&
6452 { test "$prefer_static_libs" = yes ||
6453 test "$prefer_static_libs,$installed" = "built,no"; }; then
6454 linklib=$old_library
6455 else
6456 for l in $old_library $library_names; do
6457 linklib="$l"
6458 done
6459 fi
6460 if test -z "$linklib"; then
6461 func_fatal_error "cannot find name of link library for \`$lib'"
6462 fi
6463
6464 # This library was specified with -dlopen.
6465 if test "$pass" = dlopen; then
6466 if test -z "$libdir"; then
6467 func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
6468 fi
6469 if test -z "$dlname" ||
6470 test "$dlopen_support" != yes ||
6471 test "$build_libtool_libs" = no; then
6472 # If there is no dlname, no dlopen support or we're linking
6473 # statically, we need to preload. We also need to preload any
6474 # dependent libraries so libltdl's deplib preloader doesn't
6475 # bomb out in the load deplibs phase.
6476 func_append dlprefiles " $lib $dependency_libs"
6477 else
6478 func_append newdlfiles " $lib"
6479 fi
6480 continue
6481 fi # $pass = dlopen
6482
6483 # We need an absolute path.
6484 case $ladir in
6485 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
6486 *)
6487 abs_ladir=`cd "$ladir" && pwd`
6488 if test -z "$abs_ladir"; then
6489 func_warning "cannot determine absolute directory name of \`$ladir'"
6490 func_warning "passing it literally to the linker, although it might fail"
6491 abs_ladir="$ladir"
6492 fi
6493 ;;
6494 esac
6495 func_basename "$lib"
6496 laname="$func_basename_result"
6497
6498 # Find the relevant object directory and library name.
6499 if test "X$installed" = Xyes; then
6500 if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
6501 func_warning "library \`$lib' was moved."
6502 dir="$ladir"
6503 absdir="$abs_ladir"
6504 libdir="$abs_ladir"
6505 else
6506 dir="$lt_sysroot$libdir"
6507 absdir="$lt_sysroot$libdir"
6508 fi
6509 test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
6510 else
6511 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
6512 dir="$ladir"
6513 absdir="$abs_ladir"
6514 # Remove this search path later
6515 func_append notinst_path " $abs_ladir"
6516 else
6517 dir="$ladir/$objdir"
6518 absdir="$abs_ladir/$objdir"
6519 # Remove this search path later
6520 func_append notinst_path " $abs_ladir"
6521 fi
6522 fi # $installed = yes
6523 func_stripname 'lib' '.la' "$laname"
6524 name=$func_stripname_result
6525
6526 # This library was specified with -dlpreopen.
6527 if test "$pass" = dlpreopen; then
6528 if test -z "$libdir" && test "$linkmode" = prog; then
6529 func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
6530 fi
6531 case "$host" in
6532 # special handling for platforms with PE-DLLs.
6533 *cygwin* | *mingw* | *cegcc* )
6534 # Linker will automatically link against shared library if both
6535 # static and shared are present. Therefore, ensure we extract
6536 # symbols from the import library if a shared library is present
6537 # (otherwise, the dlopen module name will be incorrect). We do
6538 # this by putting the import library name into $newdlprefiles.
6539 # We recover the dlopen module name by 'saving' the la file
6540 # name in a special purpose variable, and (later) extracting the
6541 # dlname from the la file.
6542 if test -n "$dlname"; then
6543 func_tr_sh "$dir/$linklib"
6544 eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"
6545 func_append newdlprefiles " $dir/$linklib"
6546 else
6547 func_append newdlprefiles " $dir/$old_library"
6548 # Keep a list of preopened convenience libraries to check
6549 # that they are being used correctly in the link pass.
6550 test -z "$libdir" && \
6551 func_append dlpreconveniencelibs " $dir/$old_library"
6552 fi
6553 ;;
6554 * )
6555 # Prefer using a static library (so that no silly _DYNAMIC symbols
6556 # are required to link).
6557 if test -n "$old_library"; then
6558 func_append newdlprefiles " $dir/$old_library"
6559 # Keep a list of preopened convenience libraries to check
6560 # that they are being used correctly in the link pass.
6561 test -z "$libdir" && \
6562 func_append dlpreconveniencelibs " $dir/$old_library"
6563 # Otherwise, use the dlname, so that lt_dlopen finds it.
6564 elif test -n "$dlname"; then
6565 func_append newdlprefiles " $dir/$dlname"
6566 else
6567 func_append newdlprefiles " $dir/$linklib"
6568 fi
6569 ;;
6570 esac
6571 fi # $pass = dlpreopen
6572
6573 if test -z "$libdir"; then
6574 # Link the convenience library
6575 if test "$linkmode" = lib; then
6576 deplibs="$dir/$old_library $deplibs"
6577 elif test "$linkmode,$pass" = "prog,link"; then
6578 compile_deplibs="$dir/$old_library $compile_deplibs"
6579 finalize_deplibs="$dir/$old_library $finalize_deplibs"
6580 else
6581 deplibs="$lib $deplibs" # used for prog,scan pass
6582 fi
6583 continue
6584 fi
6585
6586
6587 if test "$linkmode" = prog && test "$pass" != link; then
6588 func_append newlib_search_path " $ladir"
6589 deplibs="$lib $deplibs"
6590
6591 linkalldeplibs=no
6592 if test "$link_all_deplibs" != no || test -z "$library_names" ||
6593 test "$build_libtool_libs" = no; then
6594 linkalldeplibs=yes
6595 fi
6596
6597 tmp_libs=
6598 for deplib in $dependency_libs; do
6599 case $deplib in
6600 -L*) func_stripname '-L' '' "$deplib"
6601 func_resolve_sysroot "$func_stripname_result"
6602 func_append newlib_search_path " $func_resolve_sysroot_result"
6603 ;;
6604 esac
6605 # Need to link against all dependency_libs?
6606 if test "$linkalldeplibs" = yes; then
6607 deplibs="$deplib $deplibs"
6608 else
6609 # Need to hardcode shared library paths
6610 # or/and link against static libraries
6611 newdependency_libs="$deplib $newdependency_libs"
6612 fi
6613 if $opt_preserve_dup_deps ; then
6614 case "$tmp_libs " in
6615 *" $deplib "*) func_append specialdeplibs " $deplib" ;;
6616 esac
6617 fi
6618 func_append tmp_libs " $deplib"
6619 done # for deplib
6620 continue
6621 fi # $linkmode = prog...
6622
6623 if test "$linkmode,$pass" = "prog,link"; then
6624 if test -n "$library_names" &&
6625 { { test "$prefer_static_libs" = no ||
6626 test "$prefer_static_libs,$installed" = "built,yes"; } ||
6627 test -z "$old_library"; }; then
6628 # We need to hardcode the library path
6629 if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
6630 # Make sure the rpath contains only unique directories.
6631 case "$temp_rpath:" in
6632 *"$absdir:"*) ;;
6633 *) func_append temp_rpath "$absdir:" ;;
6634 esac
6635 fi
6636
6637 # Hardcode the library path.
6638 # Skip directories that are in the system default run-time
6639 # search path.
6640 case " $sys_lib_dlsearch_path " in
6641 *" $absdir "*) ;;
6642 *)
6643 case "$compile_rpath " in
6644 *" $absdir "*) ;;
6645 *) func_append compile_rpath " $absdir" ;;
6646 esac
6647 ;;
6648 esac
6649 case " $sys_lib_dlsearch_path " in
6650 *" $libdir "*) ;;
6651 *)
6652 case "$finalize_rpath " in
6653 *" $libdir "*) ;;
6654 *) func_append finalize_rpath " $libdir" ;;
6655 esac
6656 ;;
6657 esac
6658 fi # $linkmode,$pass = prog,link...
6659
6660 if test "$alldeplibs" = yes &&
6661 { test "$deplibs_check_method" = pass_all ||
6662 { test "$build_libtool_libs" = yes &&
6663 test -n "$library_names"; }; }; then
6664 # We only need to search for static libraries
6665 continue
6666 fi
6667 fi
6668
6669 link_static=no # Whether the deplib will be linked statically
6670 use_static_libs=$prefer_static_libs
6671 if test "$use_static_libs" = built && test "$installed" = yes; then
6672 use_static_libs=no
6673 fi
6674 if test -n "$library_names" &&
6675 { test "$use_static_libs" = no || test -z "$old_library"; }; then
6676 case $host in
6677 *cygwin* | *mingw* | *cegcc*)
6678 # No point in relinking DLLs because paths are not encoded
6679 func_append notinst_deplibs " $lib"
6680 need_relink=no
6681 ;;
6682 *)
6683 if test "$installed" = no; then
6684 func_append notinst_deplibs " $lib"
6685 need_relink=yes
6686 fi
6687 ;;
6688 esac
6689 # This is a shared library
6690
6691 # Warn about portability, can't link against -module's on some
6692 # systems (darwin). Don't bleat about dlopened modules though!
6693 dlopenmodule=""
6694 for dlpremoduletest in $dlprefiles; do
6695 if test "X$dlpremoduletest" = "X$lib"; then
6696 dlopenmodule="$dlpremoduletest"
6697 break
6698 fi
6699 done
6700 if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
6701 echo
6702 if test "$linkmode" = prog; then
6703 $ECHO "*** Warning: Linking the executable $output against the loadable module"
6704 else
6705 $ECHO "*** Warning: Linking the shared library $output against the loadable module"
6706 fi
6707 $ECHO "*** $linklib is not portable!"
6708 fi
6709 if test "$linkmode" = lib &&
6710 test "$hardcode_into_libs" = yes; then
6711 # Hardcode the library path.
6712 # Skip directories that are in the system default run-time
6713 # search path.
6714 case " $sys_lib_dlsearch_path " in
6715 *" $absdir "*) ;;
6716 *)
6717 case "$compile_rpath " in
6718 *" $absdir "*) ;;
6719 *) func_append compile_rpath " $absdir" ;;
6720 esac
6721 ;;
6722 esac
6723 case " $sys_lib_dlsearch_path " in
6724 *" $libdir "*) ;;
6725 *)
6726 case "$finalize_rpath " in
6727 *" $libdir "*) ;;
6728 *) func_append finalize_rpath " $libdir" ;;
6729 esac
6730 ;;
6731 esac
6732 fi
6733
6734 if test -n "$old_archive_from_expsyms_cmds"; then
6735 # figure out the soname
6736 set dummy $library_names
6737 shift
6738 realname="$1"
6739 shift
6740 libname=`eval "\\$ECHO \"$libname_spec\""`
6741 # use dlname if we got it. it's perfectly good, no?
6742 if test -n "$dlname"; then
6743 soname="$dlname"
6744 elif test -n "$soname_spec"; then
6745 # bleh windows
6746 case $host in
6747 *cygwin* | mingw* | *cegcc*)
6748 func_arith $current - $age
6749 major=$func_arith_result
6750 versuffix="-$major"
6751 ;;
6752 esac
6753 eval soname=\"$soname_spec\"
6754 else
6755 soname="$realname"
6756 fi
6757
6758 # Make a new name for the extract_expsyms_cmds to use
6759 soroot="$soname"
6760 func_basename "$soroot"
6761 soname="$func_basename_result"
6762 func_stripname 'lib' '.dll' "$soname"
6763 newlib=libimp-$func_stripname_result.a
6764
6765 # If the library has no export list, then create one now
6766 if test -f "$output_objdir/$soname-def"; then :
6767 else
6768 func_verbose "extracting exported symbol list from \`$soname'"
6769 func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
6770 fi
6771
6772 # Create $newlib
6773 if test -f "$output_objdir/$newlib"; then :; else
6774 func_verbose "generating import library for \`$soname'"
6775 func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
6776 fi
6777 # make sure the library variables are pointing to the new library
6778 dir=$output_objdir
6779 linklib=$newlib
6780 fi # test -n "$old_archive_from_expsyms_cmds"
6781
6782 if test "$linkmode" = prog || test "$opt_mode" != relink; then
6783 add_shlibpath=
6784 add_dir=
6785 add=
6786 lib_linked=yes
6787 case $hardcode_action in
6788 immediate | unsupported)
6789 if test "$hardcode_direct" = no; then
6790 add="$dir/$linklib"
6791 case $host in
6792 *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
6793 *-*-sysv4*uw2*) add_dir="-L$dir" ;;
6794 *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
6795 *-*-unixware7*) add_dir="-L$dir" ;;
6796 *-*-darwin* )
6797 # if the lib is a (non-dlopened) module then we can not
6798 # link against it, someone is ignoring the earlier warnings
6799 if /usr/bin/file -L $add 2> /dev/null |
6800 $GREP ": [^:]* bundle" >/dev/null ; then
6801 if test "X$dlopenmodule" != "X$lib"; then
6802 $ECHO "*** Warning: lib $linklib is a module, not a shared library"
6803 if test -z "$old_library" ; then
6804 echo
6805 echo "*** And there doesn't seem to be a static archive available"
6806 echo "*** The link will probably fail, sorry"
6807 else
6808 add="$dir/$old_library"
6809 fi
6810 elif test -n "$old_library"; then
6811 add="$dir/$old_library"
6812 fi
6813 fi
6814 esac
6815 elif test "$hardcode_minus_L" = no; then
6816 case $host in
6817 *-*-sunos*) add_shlibpath="$dir" ;;
6818 esac
6819 add_dir="-L$dir"
6820 add="-l$name"
6821 elif test "$hardcode_shlibpath_var" = no; then
6822 add_shlibpath="$dir"
6823 add="-l$name"
6824 else
6825 lib_linked=no
6826 fi
6827 ;;
6828 relink)
6829 if test "$hardcode_direct" = yes &&
6830 test "$hardcode_direct_absolute" = no; then
6831 add="$dir/$linklib"
6832 elif test "$hardcode_minus_L" = yes; then
6833 add_dir="-L$dir"
6834 # Try looking first in the location we're being installed to.
6835 if test -n "$inst_prefix_dir"; then
6836 case $libdir in
6837 [\\/]*)
6838 func_append add_dir " -L$inst_prefix_dir$libdir"
6839 ;;
6840 esac
6841 fi
6842 add="-l$name"
6843 elif test "$hardcode_shlibpath_var" = yes; then
6844 add_shlibpath="$dir"
6845 add="-l$name"
6846 else
6847 lib_linked=no
6848 fi
6849 ;;
6850 *) lib_linked=no ;;
6851 esac
6852
6853 if test "$lib_linked" != yes; then
6854 func_fatal_configuration "unsupported hardcode properties"
6855 fi
6856
6857 if test -n "$add_shlibpath"; then
6858 case :$compile_shlibpath: in
6859 *":$add_shlibpath:"*) ;;
6860 *) func_append compile_shlibpath "$add_shlibpath:" ;;
6861 esac
6862 fi
6863 if test "$linkmode" = prog; then
6864 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
6865 test -n "$add" && compile_deplibs="$add $compile_deplibs"
6866 else
6867 test -n "$add_dir" && deplibs="$add_dir $deplibs"
6868 test -n "$add" && deplibs="$add $deplibs"
6869 if test "$hardcode_direct" != yes &&
6870 test "$hardcode_minus_L" != yes &&
6871 test "$hardcode_shlibpath_var" = yes; then
6872 case :$finalize_shlibpath: in
6873 *":$libdir:"*) ;;
6874 *) func_append finalize_shlibpath "$libdir:" ;;
6875 esac
6876 fi
6877 fi
6878 fi
6879
6880 if test "$linkmode" = prog || test "$opt_mode" = relink; then
6881 add_shlibpath=
6882 add_dir=
6883 add=
6884 # Finalize command for both is simple: just hardcode it.
6885 if test "$hardcode_direct" = yes &&
6886 test "$hardcode_direct_absolute" = no; then
6887 add="$libdir/$linklib"
6888 elif test "$hardcode_minus_L" = yes; then
6889 add_dir="-L$libdir"
6890 add="-l$name"
6891 elif test "$hardcode_shlibpath_var" = yes; then
6892 case :$finalize_shlibpath: in
6893 *":$libdir:"*) ;;
6894 *) func_append finalize_shlibpath "$libdir:" ;;
6895 esac
6896 add="-l$name"
6897 elif test "$hardcode_automatic" = yes; then
6898 if test -n "$inst_prefix_dir" &&
6899 test -f "$inst_prefix_dir$libdir/$linklib" ; then
6900 add="$inst_prefix_dir$libdir/$linklib"
6901 else
6902 add="$libdir/$linklib"
6903 fi
6904 else
6905 # We cannot seem to hardcode it, guess we'll fake it.
6906 add_dir="-L$libdir"
6907 # Try looking first in the location we're being installed to.
6908 if test -n "$inst_prefix_dir"; then
6909 case $libdir in
6910 [\\/]*)
6911 func_append add_dir " -L$inst_prefix_dir$libdir"
6912 ;;
6913 esac
6914 fi
6915 add="-l$name"
6916 fi
6917
6918 if test "$linkmode" = prog; then
6919 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
6920 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
6921 else
6922 test -n "$add_dir" && deplibs="$add_dir $deplibs"
6923 test -n "$add" && deplibs="$add $deplibs"
6924 fi
6925 fi
6926 elif test "$linkmode" = prog; then
6927 # Here we assume that one of hardcode_direct or hardcode_minus_L
6928 # is not unsupported. This is valid on all known static and
6929 # shared platforms.
6930 if test "$hardcode_direct" != unsupported; then
6931 test -n "$old_library" && linklib="$old_library"
6932 compile_deplibs="$dir/$linklib $compile_deplibs"
6933 finalize_deplibs="$dir/$linklib $finalize_deplibs"
6934 else
6935 compile_deplibs="-l$name -L$dir $compile_deplibs"
6936 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
6937 fi
6938 elif test "$build_libtool_libs" = yes; then
6939 # Not a shared library
6940 if test "$deplibs_check_method" != pass_all; then
6941 # We're trying link a shared library against a static one
6942 # but the system doesn't support it.
6943
6944 # Just print a warning and add the library to dependency_libs so
6945 # that the program can be linked against the static library.
6946 echo
6947 $ECHO "*** Warning: This system can not link to static lib archive $lib."
6948 echo "*** I have the capability to make that library automatically link in when"
6949 echo "*** you link to this library. But I can only do this if you have a"
6950 echo "*** shared version of the library, which you do not appear to have."
6951 if test "$module" = yes; then
6952 echo "*** But as you try to build a module library, libtool will still create "
6953 echo "*** a static module, that should work as long as the dlopening application"
6954 echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
6955 if test -z "$global_symbol_pipe"; then
6956 echo
6957 echo "*** However, this would only work if libtool was able to extract symbol"
6958 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
6959 echo "*** not find such a program. So, this module is probably useless."
6960 echo "*** \`nm' from GNU binutils and a full rebuild may help."
6961 fi
6962 if test "$build_old_libs" = no; then
6963 build_libtool_libs=module
6964 build_old_libs=yes
6965 else
6966 build_libtool_libs=no
6967 fi
6968 fi
6969 else
6970 deplibs="$dir/$old_library $deplibs"
6971 link_static=yes
6972 fi
6973 fi # link shared/static library?
6974
6975 if test "$linkmode" = lib; then
6976 if test -n "$dependency_libs" &&
6977 { test "$hardcode_into_libs" != yes ||
6978 test "$build_old_libs" = yes ||
6979 test "$link_static" = yes; }; then
6980 # Extract -R from dependency_libs
6981 temp_deplibs=
6982 for libdir in $dependency_libs; do
6983 case $libdir in
6984 -R*) func_stripname '-R' '' "$libdir"
6985 temp_xrpath=$func_stripname_result
6986 case " $xrpath " in
6987 *" $temp_xrpath "*) ;;
6988 *) func_append xrpath " $temp_xrpath";;
6989 esac;;
6990 *) func_append temp_deplibs " $libdir";;
6991 esac
6992 done
6993 dependency_libs="$temp_deplibs"
6994 fi
6995
6996 func_append newlib_search_path " $absdir"
6997 # Link against this library
6998 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
6999 # ... and its dependency_libs
7000 tmp_libs=
7001 for deplib in $dependency_libs; do
7002 newdependency_libs="$deplib $newdependency_libs"
7003 case $deplib in
7004 -L*) func_stripname '-L' '' "$deplib"
7005 func_resolve_sysroot "$func_stripname_result";;
7006 *) func_resolve_sysroot "$deplib" ;;
7007 esac
7008 if $opt_preserve_dup_deps ; then
7009 case "$tmp_libs " in
7010 *" $func_resolve_sysroot_result "*)
7011 func_append specialdeplibs " $func_resolve_sysroot_result" ;;
7012 esac
7013 fi
7014 func_append tmp_libs " $func_resolve_sysroot_result"
7015 done
7016
7017 if test "$link_all_deplibs" != no; then
7018 # Add the search paths of all dependency libraries
7019 for deplib in $dependency_libs; do
7020 path=
7021 case $deplib in
7022 -L*) path="$deplib" ;;
7023 *.la)
7024 func_resolve_sysroot "$deplib"
7025 deplib=$func_resolve_sysroot_result
7026 func_dirname "$deplib" "" "."
7027 dir=$func_dirname_result
7028 # We need an absolute path.
7029 case $dir in
7030 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
7031 *)
7032 absdir=`cd "$dir" && pwd`
7033 if test -z "$absdir"; then
7034 func_warning "cannot determine absolute directory name of \`$dir'"
7035 absdir="$dir"
7036 fi
7037 ;;
7038 esac
7039 if $GREP "^installed=no" $deplib > /dev/null; then
7040 case $host in
7041 *-*-darwin*)
7042 depdepl=
7043 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
7044 if test -n "$deplibrary_names" ; then
7045 for tmp in $deplibrary_names ; do
7046 depdepl=$tmp
7047 done
7048 if test -f "$absdir/$objdir/$depdepl" ; then
7049 depdepl="$absdir/$objdir/$depdepl"
7050 darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
7051 if test -z "$darwin_install_name"; then
7052 darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
7053 fi
7054 func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
7055 func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}"
7056 path=
7057 fi
7058 fi
7059 ;;
7060 *)
7061 path="-L$absdir/$objdir"
7062 ;;
7063 esac
7064 else
7065 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
7066 test -z "$libdir" && \
7067 func_fatal_error "\`$deplib' is not a valid libtool archive"
7068 test "$absdir" != "$libdir" && \
7069 func_warning "\`$deplib' seems to be moved"
7070
7071 path="-L$absdir"
7072 fi
7073 ;;
7074 esac
7075 case " $deplibs " in
7076 *" $path "*) ;;
7077 *) deplibs="$path $deplibs" ;;
7078 esac
7079 done
7080 fi # link_all_deplibs != no
7081 fi # linkmode = lib
7082 done # for deplib in $libs
7083 if test "$pass" = link; then
7084 if test "$linkmode" = "prog"; then
7085 compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
7086 finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
7087 else
7088 compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
7089 fi
7090 fi
7091 dependency_libs="$newdependency_libs"
7092 if test "$pass" = dlpreopen; then
7093 # Link the dlpreopened libraries before other libraries
7094 for deplib in $save_deplibs; do
7095 deplibs="$deplib $deplibs"
7096 done
7097 fi
7098 if test "$pass" != dlopen; then
7099 if test "$pass" != conv; then
7100 # Make sure lib_search_path contains only unique directories.
7101 lib_search_path=
7102 for dir in $newlib_search_path; do
7103 case "$lib_search_path " in
7104 *" $dir "*) ;;
7105 *) func_append lib_search_path " $dir" ;;
7106 esac
7107 done
7108 newlib_search_path=
7109 fi
7110
7111 if test "$linkmode,$pass" != "prog,link"; then
7112 vars="deplibs"
7113 else
7114 vars="compile_deplibs finalize_deplibs"
7115 fi
7116 for var in $vars dependency_libs; do
7117 # Add libraries to $var in reverse order
7118 eval tmp_libs=\"\$$var\"
7119 new_libs=
7120 for deplib in $tmp_libs; do
7121 # FIXME: Pedantically, this is the right thing to do, so
7122 # that some nasty dependency loop isn't accidentally
7123 # broken:
7124 #new_libs="$deplib $new_libs"
7125 # Pragmatically, this seems to cause very few problems in
7126 # practice:
7127 case $deplib in
7128 -L*) new_libs="$deplib $new_libs" ;;
7129 -R*) ;;
7130 *)
7131 # And here is the reason: when a library appears more
7132 # than once as an explicit dependence of a library, or
7133 # is implicitly linked in more than once by the
7134 # compiler, it is considered special, and multiple
7135 # occurrences thereof are not removed. Compare this
7136 # with having the same library being listed as a
7137 # dependency of multiple other libraries: in this case,
7138 # we know (pedantically, we assume) the library does not
7139 # need to be listed more than once, so we keep only the
7140 # last copy. This is not always right, but it is rare
7141 # enough that we require users that really mean to play
7142 # such unportable linking tricks to link the library
7143 # using -Wl,-lname, so that libtool does not consider it
7144 # for duplicate removal.
7145 case " $specialdeplibs " in
7146 *" $deplib "*) new_libs="$deplib $new_libs" ;;
7147 *)
7148 case " $new_libs " in
7149 *" $deplib "*) ;;
7150 *) new_libs="$deplib $new_libs" ;;
7151 esac
7152 ;;
7153 esac
7154 ;;
7155 esac
7156 done
7157 tmp_libs=
7158 for deplib in $new_libs; do
7159 case $deplib in
7160 -L*)
7161 case " $tmp_libs " in
7162 *" $deplib "*) ;;
7163 *) func_append tmp_libs " $deplib" ;;
7164 esac
7165 ;;
7166 *) func_append tmp_libs " $deplib" ;;
7167 esac
7168 done
7169 eval $var=\"$tmp_libs\"
7170 done # for var
7171 fi
7172 # Last step: remove runtime libs from dependency_libs
7173 # (they stay in deplibs)
7174 tmp_libs=
7175 for i in $dependency_libs ; do
7176 case " $predeps $postdeps $compiler_lib_search_path " in
7177 *" $i "*)
7178 i=""
7179 ;;
7180 esac
7181 if test -n "$i" ; then
7182 func_append tmp_libs " $i"
7183 fi
7184 done
7185 dependency_libs=$tmp_libs
7186 done # for pass
7187 if test "$linkmode" = prog; then
7188 dlfiles="$newdlfiles"
7189 fi
7190 if test "$linkmode" = prog || test "$linkmode" = lib; then
7191 dlprefiles="$newdlprefiles"
7192 fi
7193
7194 case $linkmode in
7195 oldlib)
7196 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
7197 func_warning "\`-dlopen' is ignored for archives"
7198 fi
7199
7200 case " $deplibs" in
7201 *\ -l* | *\ -L*)
7202 func_warning "\`-l' and \`-L' are ignored for archives" ;;
7203 esac
7204
7205 test -n "$rpath" && \
7206 func_warning "\`-rpath' is ignored for archives"
7207
7208 test -n "$xrpath" && \
7209 func_warning "\`-R' is ignored for archives"
7210
7211 test -n "$vinfo" && \
7212 func_warning "\`-version-info/-version-number' is ignored for archives"
7213
7214 test -n "$release" && \
7215 func_warning "\`-release' is ignored for archives"
7216
7217 test -n "$export_symbols$export_symbols_regex" && \
7218 func_warning "\`-export-symbols' is ignored for archives"
7219
7220 # Now set the variables for building old libraries.
7221 build_libtool_libs=no
7222 oldlibs="$output"
7223 func_append objs "$old_deplibs"
7224 ;;
7225
7226 lib)
7227 # Make sure we only generate libraries of the form `libNAME.la'.
7228 case $outputname in
7229 lib*)
7230 func_stripname 'lib' '.la' "$outputname"
7231 name=$func_stripname_result
7232 eval shared_ext=\"$shrext_cmds\"
7233 eval libname=\"$libname_spec\"
7234 ;;
7235 *)
7236 test "$module" = no && \
7237 func_fatal_help "libtool library \`$output' must begin with \`lib'"
7238
7239 if test "$need_lib_prefix" != no; then
7240 # Add the "lib" prefix for modules if required
7241 func_stripname '' '.la' "$outputname"
7242 name=$func_stripname_result
7243 eval shared_ext=\"$shrext_cmds\"
7244 eval libname=\"$libname_spec\"
7245 else
7246 func_stripname '' '.la' "$outputname"
7247 libname=$func_stripname_result
7248 fi
7249 ;;
7250 esac
7251
7252 if test -n "$objs"; then
7253 if test "$deplibs_check_method" != pass_all; then
7254 func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
7255 else
7256 echo
7257 $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
7258 $ECHO "*** objects $objs is not portable!"
7259 func_append libobjs " $objs"
7260 fi
7261 fi
7262
7263 test "$dlself" != no && \
7264 func_warning "\`-dlopen self' is ignored for libtool libraries"
7265
7266 set dummy $rpath
7267 shift
7268 test "$#" -gt 1 && \
7269 func_warning "ignoring multiple \`-rpath's for a libtool library"
7270
7271 install_libdir="$1"
7272
7273 oldlibs=
7274 if test -z "$rpath"; then
7275 if test "$build_libtool_libs" = yes; then
7276 # Building a libtool convenience library.
7277 # Some compilers have problems with a `.al' extension so
7278 # convenience libraries should have the same extension an
7279 # archive normally would.
7280 oldlibs="$output_objdir/$libname.$libext $oldlibs"
7281 build_libtool_libs=convenience
7282 build_old_libs=yes
7283 fi
7284
7285 test -n "$vinfo" && \
7286 func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
7287
7288 test -n "$release" && \
7289 func_warning "\`-release' is ignored for convenience libraries"
7290 else
7291
7292 # Parse the version information argument.
7293 save_ifs="$IFS"; IFS=':'
7294 set dummy $vinfo 0 0 0
7295 shift
7296 IFS="$save_ifs"
7297
7298 test -n "$7" && \
7299 func_fatal_help "too many parameters to \`-version-info'"
7300
7301 # convert absolute version numbers to libtool ages
7302 # this retains compatibility with .la files and attempts
7303 # to make the code below a bit more comprehensible
7304
7305 case $vinfo_number in
7306 yes)
7307 number_major="$1"
7308 number_minor="$2"
7309 number_revision="$3"
7310 #
7311 # There are really only two kinds -- those that
7312 # use the current revision as the major version
7313 # and those that subtract age and use age as
7314 # a minor version. But, then there is irix
7315 # which has an extra 1 added just for fun
7316 #
7317 case $version_type in
7318 darwin|linux|osf|windows|none)
7319 func_arith $number_major + $number_minor
7320 current=$func_arith_result
7321 age="$number_minor"
7322 revision="$number_revision"
7323 ;;
7324 freebsd-aout|freebsd-elf|qnx|sunos)
7325 current="$number_major"
7326 revision="$number_minor"
7327 age="0"
7328 ;;
7329 irix|nonstopux)
7330 func_arith $number_major + $number_minor
7331 current=$func_arith_result
7332 age="$number_minor"
7333 revision="$number_minor"
7334 lt_irix_increment=no
7335 ;;
7336 esac
7337 ;;
7338 no)
7339 current="$1"
7340 revision="$2"
7341 age="$3"
7342 ;;
7343 esac
7344
7345 # Check that each of the things are valid numbers.
7346 case $current in
7347 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
7348 *)
7349 func_error "CURRENT \`$current' must be a nonnegative integer"
7350 func_fatal_error "\`$vinfo' is not valid version information"
7351 ;;
7352 esac
7353
7354 case $revision in
7355 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
7356 *)
7357 func_error "REVISION \`$revision' must be a nonnegative integer"
7358 func_fatal_error "\`$vinfo' is not valid version information"
7359 ;;
7360 esac
7361
7362 case $age in
7363 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
7364 *)
7365 func_error "AGE \`$age' must be a nonnegative integer"
7366 func_fatal_error "\`$vinfo' is not valid version information"
7367 ;;
7368 esac
7369
7370 if test "$age" -gt "$current"; then
7371 func_error "AGE \`$age' is greater than the current interface number \`$current'"
7372 func_fatal_error "\`$vinfo' is not valid version information"
7373 fi
7374
7375 # Calculate the version variables.
7376 major=
7377 versuffix=
7378 verstring=
7379 case $version_type in
7380 none) ;;
7381
7382 darwin)
7383 # Like Linux, but with the current version available in
7384 # verstring for coding it into the library header
7385 func_arith $current - $age
7386 major=.$func_arith_result
7387 versuffix="$major.$age.$revision"
7388 # Darwin ld doesn't like 0 for these options...
7389 func_arith $current + 1
7390 minor_current=$func_arith_result
7391 xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
7392 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
7393 ;;
7394
7395 freebsd-aout)
7396 major=".$current"
7397 versuffix=".$current.$revision";
7398 ;;
7399
7400 freebsd-elf)
7401 major=".$current"
7402 versuffix=".$current"
7403 ;;
7404
7405 irix | nonstopux)
7406 if test "X$lt_irix_increment" = "Xno"; then
7407 func_arith $current - $age
7408 else
7409 func_arith $current - $age + 1
7410 fi
7411 major=$func_arith_result
7412
7413 case $version_type in
7414 nonstopux) verstring_prefix=nonstopux ;;
7415 *) verstring_prefix=sgi ;;
7416 esac
7417 verstring="$verstring_prefix$major.$revision"
7418
7419 # Add in all the interfaces that we are compatible with.
7420 loop=$revision
7421 while test "$loop" -ne 0; do
7422 func_arith $revision - $loop
7423 iface=$func_arith_result
7424 func_arith $loop - 1
7425 loop=$func_arith_result
7426 verstring="$verstring_prefix$major.$iface:$verstring"
7427 done
7428
7429 # Before this point, $major must not contain `.'.
7430 major=.$major
7431 versuffix="$major.$revision"
7432 ;;
7433
7434 linux)
7435 func_arith $current - $age
7436 major=.$func_arith_result
7437 versuffix="$major.$age.$revision"
7438 ;;
7439
7440 osf)
7441 func_arith $current - $age
7442 major=.$func_arith_result
7443 versuffix=".$current.$age.$revision"
7444 verstring="$current.$age.$revision"
7445
7446 # Add in all the interfaces that we are compatible with.
7447 loop=$age
7448 while test "$loop" -ne 0; do
7449 func_arith $current - $loop
7450 iface=$func_arith_result
7451 func_arith $loop - 1
7452 loop=$func_arith_result
7453 verstring="$verstring:${iface}.0"
7454 done
7455
7456 # Make executables depend on our current version.
7457 func_append verstring ":${current}.0"
7458 ;;
7459
7460 qnx)
7461 major=".$current"
7462 versuffix=".$current"
7463 ;;
7464
7465 sunos)
7466 major=".$current"
7467 versuffix=".$current.$revision"
7468 ;;
7469
7470 windows)
7471 # Use '-' rather than '.', since we only want one
7472 # extension on DOS 8.3 filesystems.
7473 func_arith $current - $age
7474 major=$func_arith_result
7475 versuffix="-$major"
7476 ;;
7477
7478 *)
7479 func_fatal_configuration "unknown library version type \`$version_type'"
7480 ;;
7481 esac
7482
7483 # Clear the version info if we defaulted, and they specified a release.
7484 if test -z "$vinfo" && test -n "$release"; then
7485 major=
7486 case $version_type in
7487 darwin)
7488 # we can't check for "0.0" in archive_cmds due to quoting
7489 # problems, so we reset it completely
7490 verstring=
7491 ;;
7492 *)
7493 verstring="0.0"
7494 ;;
7495 esac
7496 if test "$need_version" = no; then
7497 versuffix=
7498 else
7499 versuffix=".0.0"
7500 fi
7501 fi
7502
7503 # Remove version info from name if versioning should be avoided
7504 if test "$avoid_version" = yes && test "$need_version" = no; then
7505 major=
7506 versuffix=
7507 verstring=""
7508 fi
7509
7510 # Check to see if the archive will have undefined symbols.
7511 if test "$allow_undefined" = yes; then
7512 if test "$allow_undefined_flag" = unsupported; then
7513 func_warning "undefined symbols not allowed in $host shared libraries"
7514 build_libtool_libs=no
7515 build_old_libs=yes
7516 fi
7517 else
7518 # Don't allow undefined symbols.
7519 allow_undefined_flag="$no_undefined_flag"
7520 fi
7521
7522 fi
7523
7524 func_generate_dlsyms "$libname" "$libname" "yes"
7525 func_append libobjs " $symfileobj"
7526 test "X$libobjs" = "X " && libobjs=
7527
7528 if test "$opt_mode" != relink; then
7529 # Remove our outputs, but don't remove object files since they
7530 # may have been created when compiling PIC objects.
7531 removelist=
7532 tempremovelist=`$ECHO "$output_objdir/*"`
7533 for p in $tempremovelist; do
7534 case $p in
7535 *.$objext | *.gcno)
7536 ;;
7537 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
7538 if test "X$precious_files_regex" != "X"; then
7539 if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
7540 then
7541 continue
7542 fi
7543 fi
7544 func_append removelist " $p"
7545 ;;
7546 *) ;;
7547 esac
7548 done
7549 test -n "$removelist" && \
7550 func_show_eval "${RM}r \$removelist"
7551 fi
7552
7553 # Now set the variables for building old libraries.
7554 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
7555 func_append oldlibs " $output_objdir/$libname.$libext"
7556
7557 # Transform .lo files to .o files.
7558 oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP`
7559 fi
7560
7561 # Eliminate all temporary directories.
7562 #for path in $notinst_path; do
7563 # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"`
7564 # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"`
7565 # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"`
7566 #done
7567
7568 if test -n "$xrpath"; then
7569 # If the user specified any rpath flags, then add them.
7570 temp_xrpath=
7571 for libdir in $xrpath; do
7572 func_replace_sysroot "$libdir"
7573 func_append temp_xrpath " -R$func_replace_sysroot_result"
7574 case "$finalize_rpath " in
7575 *" $libdir "*) ;;
7576 *) func_append finalize_rpath " $libdir" ;;
7577 esac
7578 done
7579 if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
7580 dependency_libs="$temp_xrpath $dependency_libs"
7581 fi
7582 fi
7583
7584 # Make sure dlfiles contains only unique files that won't be dlpreopened
7585 old_dlfiles="$dlfiles"
7586 dlfiles=
7587 for lib in $old_dlfiles; do
7588 case " $dlprefiles $dlfiles " in
7589 *" $lib "*) ;;
7590 *) func_append dlfiles " $lib" ;;
7591 esac
7592 done
7593
7594 # Make sure dlprefiles contains only unique files
7595 old_dlprefiles="$dlprefiles"
7596 dlprefiles=
7597 for lib in $old_dlprefiles; do
7598 case "$dlprefiles " in
7599 *" $lib "*) ;;
7600 *) func_append dlprefiles " $lib" ;;
7601 esac
7602 done
7603
7604 if test "$build_libtool_libs" = yes; then
7605 if test -n "$rpath"; then
7606 case $host in
7607 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
7608 # these systems don't actually have a c library (as such)!
7609 ;;
7610 *-*-rhapsody* | *-*-darwin1.[012])
7611 # Rhapsody C library is in the System framework
7612 func_append deplibs " System.ltframework"
7613 ;;
7614 *-*-netbsd*)
7615 # Don't link with libc until the a.out ld.so is fixed.
7616 ;;
7617 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
7618 # Do not include libc due to us having libc/libc_r.
7619 ;;
7620 *-*-sco3.2v5* | *-*-sco5v6*)
7621 # Causes problems with __ctype
7622 ;;
7623 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
7624 # Compiler inserts libc in the correct place for threads to work
7625 ;;
7626 *)
7627 # Add libc to deplibs on all other systems if necessary.
7628 if test "$build_libtool_need_lc" = "yes"; then
7629 func_append deplibs " -lc"
7630 fi
7631 ;;
7632 esac
7633 fi
7634
7635 # Transform deplibs into only deplibs that can be linked in shared.
7636 name_save=$name
7637 libname_save=$libname
7638 release_save=$release
7639 versuffix_save=$versuffix
7640 major_save=$major
7641 # I'm not sure if I'm treating the release correctly. I think
7642 # release should show up in the -l (ie -lgmp5) so we don't want to
7643 # add it in twice. Is that correct?
7644 release=""
7645 versuffix=""
7646 major=""
7647 newdeplibs=
7648 droppeddeps=no
7649 case $deplibs_check_method in
7650 pass_all)
7651 # Don't check for shared/static. Everything works.
7652 # This might be a little naive. We might want to check
7653 # whether the library exists or not. But this is on
7654 # osf3 & osf4 and I'm not really sure... Just
7655 # implementing what was already the behavior.
7656 newdeplibs=$deplibs
7657 ;;
7658 test_compile)
7659 # This code stresses the "libraries are programs" paradigm to its
7660 # limits. Maybe even breaks it. We compile a program, linking it
7661 # against the deplibs as a proxy for the library. Then we can check
7662 # whether they linked in statically or dynamically with ldd.
7663 $opt_dry_run || $RM conftest.c
7664 cat > conftest.c <<EOF
7665 int main() { return 0; }
7666 EOF
7667 $opt_dry_run || $RM conftest
7668 if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
7669 ldd_output=`ldd conftest`
7670 for i in $deplibs; do
7671 case $i in
7672 -l*)
7673 func_stripname -l '' "$i"
7674 name=$func_stripname_result
7675 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
7676 case " $predeps $postdeps " in
7677 *" $i "*)
7678 func_append newdeplibs " $i"
7679 i=""
7680 ;;
7681 esac
7682 fi
7683 if test -n "$i" ; then
7684 libname=`eval "\\$ECHO \"$libname_spec\""`
7685 deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
7686 set dummy $deplib_matches; shift
7687 deplib_match=$1
7688 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
7689 func_append newdeplibs " $i"
7690 else
7691 droppeddeps=yes
7692 echo
7693 $ECHO "*** Warning: dynamic linker does not accept needed library $i."
7694 echo "*** I have the capability to make that library automatically link in when"
7695 echo "*** you link to this library. But I can only do this if you have a"
7696 echo "*** shared version of the library, which I believe you do not have"
7697 echo "*** because a test_compile did reveal that the linker did not use it for"
7698 echo "*** its dynamic dependency list that programs get resolved with at runtime."
7699 fi
7700 fi
7701 ;;
7702 *)
7703 func_append newdeplibs " $i"
7704 ;;
7705 esac
7706 done
7707 else
7708 # Error occurred in the first compile. Let's try to salvage
7709 # the situation: Compile a separate program for each library.
7710 for i in $deplibs; do
7711 case $i in
7712 -l*)
7713 func_stripname -l '' "$i"
7714 name=$func_stripname_result
7715 $opt_dry_run || $RM conftest
7716 if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
7717 ldd_output=`ldd conftest`
7718 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
7719 case " $predeps $postdeps " in
7720 *" $i "*)
7721 func_append newdeplibs " $i"
7722 i=""
7723 ;;
7724 esac
7725 fi
7726 if test -n "$i" ; then
7727 libname=`eval "\\$ECHO \"$libname_spec\""`
7728 deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
7729 set dummy $deplib_matches; shift
7730 deplib_match=$1
7731 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
7732 func_append newdeplibs " $i"
7733 else
7734 droppeddeps=yes
7735 echo
7736 $ECHO "*** Warning: dynamic linker does not accept needed library $i."
7737 echo "*** I have the capability to make that library automatically link in when"
7738 echo "*** you link to this library. But I can only do this if you have a"
7739 echo "*** shared version of the library, which you do not appear to have"
7740 echo "*** because a test_compile did reveal that the linker did not use this one"
7741 echo "*** as a dynamic dependency that programs can get resolved with at runtime."
7742 fi
7743 fi
7744 else
7745 droppeddeps=yes
7746 echo
7747 $ECHO "*** Warning! Library $i is needed by this library but I was not able to"
7748 echo "*** make it link in! You will probably need to install it or some"
7749 echo "*** library that it depends on before this library will be fully"
7750 echo "*** functional. Installing it before continuing would be even better."
7751 fi
7752 ;;
7753 *)
7754 func_append newdeplibs " $i"
7755 ;;
7756 esac
7757 done
7758 fi
7759 ;;
7760 file_magic*)
7761 set dummy $deplibs_check_method; shift
7762 file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
7763 for a_deplib in $deplibs; do
7764 case $a_deplib in
7765 -l*)
7766 func_stripname -l '' "$a_deplib"
7767 name=$func_stripname_result
7768 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
7769 case " $predeps $postdeps " in
7770 *" $a_deplib "*)
7771 func_append newdeplibs " $a_deplib"
7772 a_deplib=""
7773 ;;
7774 esac
7775 fi
7776 if test -n "$a_deplib" ; then
7777 libname=`eval "\\$ECHO \"$libname_spec\""`
7778 if test -n "$file_magic_glob"; then
7779 libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
7780 else
7781 libnameglob=$libname
7782 fi
7783 test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob`
7784 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
7785 if test "$want_nocaseglob" = yes; then
7786 shopt -s nocaseglob
7787 potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
7788 $nocaseglob
7789 else
7790 potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
7791 fi
7792 for potent_lib in $potential_libs; do
7793 # Follow soft links.
7794 if ls -lLd "$potent_lib" 2>/dev/null |
7795 $GREP " -> " >/dev/null; then
7796 continue
7797 fi
7798 # The statement above tries to avoid entering an
7799 # endless loop below, in case of cyclic links.
7800 # We might still enter an endless loop, since a link
7801 # loop can be closed while we follow links,
7802 # but so what?
7803 potlib="$potent_lib"
7804 while test -h "$potlib" 2>/dev/null; do
7805 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
7806 case $potliblink in
7807 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
7808 *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";;
7809 esac
7810 done
7811 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
7812 $SED -e 10q |
7813 $EGREP "$file_magic_regex" > /dev/null; then
7814 func_append newdeplibs " $a_deplib"
7815 a_deplib=""
7816 break 2
7817 fi
7818 done
7819 done
7820 fi
7821 if test -n "$a_deplib" ; then
7822 droppeddeps=yes
7823 echo
7824 $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
7825 echo "*** I have the capability to make that library automatically link in when"
7826 echo "*** you link to this library. But I can only do this if you have a"
7827 echo "*** shared version of the library, which you do not appear to have"
7828 echo "*** because I did check the linker path looking for a file starting"
7829 if test -z "$potlib" ; then
7830 $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
7831 else
7832 $ECHO "*** with $libname and none of the candidates passed a file format test"
7833 $ECHO "*** using a file magic. Last file checked: $potlib"
7834 fi
7835 fi
7836 ;;
7837 *)
7838 # Add a -L argument.
7839 func_append newdeplibs " $a_deplib"
7840 ;;
7841 esac
7842 done # Gone through all deplibs.
7843 ;;
7844 match_pattern*)
7845 set dummy $deplibs_check_method; shift
7846 match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
7847 for a_deplib in $deplibs; do
7848 case $a_deplib in
7849 -l*)
7850 func_stripname -l '' "$a_deplib"
7851 name=$func_stripname_result
7852 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
7853 case " $predeps $postdeps " in
7854 *" $a_deplib "*)
7855 func_append newdeplibs " $a_deplib"
7856 a_deplib=""
7857 ;;
7858 esac
7859 fi
7860 if test -n "$a_deplib" ; then
7861 libname=`eval "\\$ECHO \"$libname_spec\""`
7862 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
7863 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
7864 for potent_lib in $potential_libs; do
7865 potlib="$potent_lib" # see symlink-check above in file_magic test
7866 if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
7867 $EGREP "$match_pattern_regex" > /dev/null; then
7868 func_append newdeplibs " $a_deplib"
7869 a_deplib=""
7870 break 2
7871 fi
7872 done
7873 done
7874 fi
7875 if test -n "$a_deplib" ; then
7876 droppeddeps=yes
7877 echo
7878 $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
7879 echo "*** I have the capability to make that library automatically link in when"
7880 echo "*** you link to this library. But I can only do this if you have a"
7881 echo "*** shared version of the library, which you do not appear to have"
7882 echo "*** because I did check the linker path looking for a file starting"
7883 if test -z "$potlib" ; then
7884 $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
7885 else
7886 $ECHO "*** with $libname and none of the candidates passed a file format test"
7887 $ECHO "*** using a regex pattern. Last file checked: $potlib"
7888 fi
7889 fi
7890 ;;
7891 *)
7892 # Add a -L argument.
7893 func_append newdeplibs " $a_deplib"
7894 ;;
7895 esac
7896 done # Gone through all deplibs.
7897 ;;
7898 none | unknown | *)
7899 newdeplibs=""
7900 tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
7901 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
7902 for i in $predeps $postdeps ; do
7903 # can't use Xsed below, because $i might contain '/'
7904 tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"`
7905 done
7906 fi
7907 case $tmp_deplibs in
7908 *[!\ \ ]*)
7909 echo
7910 if test "X$deplibs_check_method" = "Xnone"; then
7911 echo "*** Warning: inter-library dependencies are not supported in this platform."
7912 else
7913 echo "*** Warning: inter-library dependencies are not known to be supported."
7914 fi
7915 echo "*** All declared inter-library dependencies are being dropped."
7916 droppeddeps=yes
7917 ;;
7918 esac
7919 ;;
7920 esac
7921 versuffix=$versuffix_save
7922 major=$major_save
7923 release=$release_save
7924 libname=$libname_save
7925 name=$name_save
7926
7927 case $host in
7928 *-*-rhapsody* | *-*-darwin1.[012])
7929 # On Rhapsody replace the C library with the System framework
7930 newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'`
7931 ;;
7932 esac
7933
7934 if test "$droppeddeps" = yes; then
7935 if test "$module" = yes; then
7936 echo
7937 echo "*** Warning: libtool could not satisfy all declared inter-library"
7938 $ECHO "*** dependencies of module $libname. Therefore, libtool will create"
7939 echo "*** a static module, that should work as long as the dlopening"
7940 echo "*** application is linked with the -dlopen flag."
7941 if test -z "$global_symbol_pipe"; then
7942 echo
7943 echo "*** However, this would only work if libtool was able to extract symbol"
7944 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
7945 echo "*** not find such a program. So, this module is probably useless."
7946 echo "*** \`nm' from GNU binutils and a full rebuild may help."
7947 fi
7948 if test "$build_old_libs" = no; then
7949 oldlibs="$output_objdir/$libname.$libext"
7950 build_libtool_libs=module
7951 build_old_libs=yes
7952 else
7953 build_libtool_libs=no
7954 fi
7955 else
7956 echo "*** The inter-library dependencies that have been dropped here will be"
7957 echo "*** automatically added whenever a program is linked with this library"
7958 echo "*** or is declared to -dlopen it."
7959
7960 if test "$allow_undefined" = no; then
7961 echo
7962 echo "*** Since this library must not contain undefined symbols,"
7963 echo "*** because either the platform does not support them or"
7964 echo "*** it was explicitly requested with -no-undefined,"
7965 echo "*** libtool will only create a static version of it."
7966 if test "$build_old_libs" = no; then
7967 oldlibs="$output_objdir/$libname.$libext"
7968 build_libtool_libs=module
7969 build_old_libs=yes
7970 else
7971 build_libtool_libs=no
7972 fi
7973 fi
7974 fi
7975 fi
7976 # Done checking deplibs!
7977 deplibs=$newdeplibs
7978 fi
7979 # Time to change all our "foo.ltframework" stuff back to "-framework foo"
7980 case $host in
7981 *-*-darwin*)
7982 newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
7983 new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
7984 deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
7985 ;;
7986 esac
7987
7988 # move library search paths that coincide with paths to not yet
7989 # installed libraries to the beginning of the library search list
7990 new_libs=
7991 for path in $notinst_path; do
7992 case " $new_libs " in
7993 *" -L$path/$objdir "*) ;;
7994 *)
7995 case " $deplibs " in
7996 *" -L$path/$objdir "*)
7997 func_append new_libs " -L$path/$objdir" ;;
7998 esac
7999 ;;
8000 esac
8001 done
8002 for deplib in $deplibs; do
8003 case $deplib in
8004 -L*)
8005 case " $new_libs " in
8006 *" $deplib "*) ;;
8007 *) func_append new_libs " $deplib" ;;
8008 esac
8009 ;;
8010 *) func_append new_libs " $deplib" ;;
8011 esac
8012 done
8013 deplibs="$new_libs"
8014
8015 # All the library-specific variables (install_libdir is set above).
8016 library_names=
8017 old_library=
8018 dlname=
8019
8020 # Test again, we may have decided not to build it any more
8021 if test "$build_libtool_libs" = yes; then
8022 if test "$hardcode_into_libs" = yes; then
8023 # Hardcode the library paths
8024 hardcode_libdirs=
8025 dep_rpath=
8026 rpath="$finalize_rpath"
8027 test "$opt_mode" != relink && rpath="$compile_rpath$rpath"
8028 for libdir in $rpath; do
8029 if test -n "$hardcode_libdir_flag_spec"; then
8030 if test -n "$hardcode_libdir_separator"; then
8031 func_replace_sysroot "$libdir"
8032 libdir=$func_replace_sysroot_result
8033 if test -z "$hardcode_libdirs"; then
8034 hardcode_libdirs="$libdir"
8035 else
8036 # Just accumulate the unique libdirs.
8037 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
8038 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
8039 ;;
8040 *)
8041 func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
8042 ;;
8043 esac
8044 fi
8045 else
8046 eval flag=\"$hardcode_libdir_flag_spec\"
8047 func_append dep_rpath " $flag"
8048 fi
8049 elif test -n "$runpath_var"; then
8050 case "$perm_rpath " in
8051 *" $libdir "*) ;;
8052 *) func_apped perm_rpath " $libdir" ;;
8053 esac
8054 fi
8055 done
8056 # Substitute the hardcoded libdirs into the rpath.
8057 if test -n "$hardcode_libdir_separator" &&
8058 test -n "$hardcode_libdirs"; then
8059 libdir="$hardcode_libdirs"
8060 if test -n "$hardcode_libdir_flag_spec_ld"; then
8061 eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
8062 else
8063 eval dep_rpath=\"$hardcode_libdir_flag_spec\"
8064 fi
8065 fi
8066 if test -n "$runpath_var" && test -n "$perm_rpath"; then
8067 # We should set the runpath_var.
8068 rpath=
8069 for dir in $perm_rpath; do
8070 func_append rpath "$dir:"
8071 done
8072 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
8073 fi
8074 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
8075 fi
8076
8077 shlibpath="$finalize_shlibpath"
8078 test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
8079 if test -n "$shlibpath"; then
8080 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
8081 fi
8082
8083 # Get the real and link names of the library.
8084 eval shared_ext=\"$shrext_cmds\"
8085 eval library_names=\"$library_names_spec\"
8086 set dummy $library_names
8087 shift
8088 realname="$1"
8089 shift
8090
8091 if test -n "$soname_spec"; then
8092 eval soname=\"$soname_spec\"
8093 else
8094 soname="$realname"
8095 fi
8096 if test -z "$dlname"; then
8097 dlname=$soname
8098 fi
8099
8100 lib="$output_objdir/$realname"
8101 linknames=
8102 for link
8103 do
8104 func_append linknames " $link"
8105 done
8106
8107 # Use standard objects if they are pic
8108 test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP`
8109 test "X$libobjs" = "X " && libobjs=
8110
8111 delfiles=
8112 if test -n "$export_symbols" && test -n "$include_expsyms"; then
8113 $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
8114 export_symbols="$output_objdir/$libname.uexp"
8115 func_append delfiles " $export_symbols"
8116 fi
8117
8118 orig_export_symbols=
8119 case $host_os in
8120 cygwin* | mingw* | cegcc*)
8121 if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
8122 # exporting using user supplied symfile
8123 if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
8124 # and it's NOT already a .def file. Must figure out
8125 # which of the given symbols are data symbols and tag
8126 # them as such. So, trigger use of export_symbols_cmds.
8127 # export_symbols gets reassigned inside the "prepare
8128 # the list of exported symbols" if statement, so the
8129 # include_expsyms logic still works.
8130 orig_export_symbols="$export_symbols"
8131 export_symbols=
8132 always_export_symbols=yes
8133 fi
8134 fi
8135 ;;
8136 esac
8137
8138 # Prepare the list of exported symbols
8139 if test -z "$export_symbols"; then
8140 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
8141 func_verbose "generating symbol list for \`$libname.la'"
8142 export_symbols="$output_objdir/$libname.exp"
8143 $opt_dry_run || $RM $export_symbols
8144 cmds=$export_symbols_cmds
8145 save_ifs="$IFS"; IFS='~'
8146 for cmd1 in $cmds; do
8147 IFS="$save_ifs"
8148 # Take the normal branch if the nm_file_list_spec branch
8149 # doesn't work or if tool conversion is not needed.
8150 case $nm_file_list_spec~$to_tool_file_cmd in
8151 *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)
8152 try_normal_branch=yes
8153 eval cmd=\"$cmd1\"
8154 func_len " $cmd"
8155 len=$func_len_result
8156 ;;
8157 *)
8158 try_normal_branch=no
8159 ;;
8160 esac
8161 if test "$try_normal_branch" = yes \
8162 && { test "$len" -lt "$max_cmd_len" \
8163 || test "$max_cmd_len" -le -1; }
8164 then
8165 func_show_eval "$cmd" 'exit $?'
8166 skipped_export=false
8167 elif test -n "$nm_file_list_spec"; then
8168 func_basename "$output"
8169 output_la=$func_basename_result
8170 save_libobjs=$libobjs
8171 save_output=$output
8172 output=${output_objdir}/${output_la}.nm
8173 func_to_tool_file "$output"
8174 libobjs=$nm_file_list_spec$func_to_tool_file_result
8175 func_append delfiles " $output"
8176 func_verbose "creating $NM input file list: $output"
8177 for obj in $save_libobjs; do
8178 func_to_tool_file "$obj"
8179 $ECHO "$func_to_tool_file_result"
8180 done > "$output"
8181 eval cmd=\"$cmd1\"
8182 func_show_eval "$cmd" 'exit $?'
8183 output=$save_output
8184 libobjs=$save_libobjs
8185 skipped_export=false
8186 else
8187 # The command line is too long to execute in one step.
8188 func_verbose "using reloadable object file for export list..."
8189 skipped_export=:
8190 # Break out early, otherwise skipped_export may be
8191 # set to false by a later but shorter cmd.
8192 break
8193 fi
8194 done
8195 IFS="$save_ifs"
8196 if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
8197 func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
8198 func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
8199 fi
8200 fi
8201 fi
8202
8203 if test -n "$export_symbols" && test -n "$include_expsyms"; then
8204 tmp_export_symbols="$export_symbols"
8205 test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
8206 $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
8207 fi
8208
8209 if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
8210 # The given exports_symbols file has to be filtered, so filter it.
8211 func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
8212 # FIXME: $output_objdir/$libname.filter potentially contains lots of
8213 # 's' commands which not all seds can handle. GNU sed should be fine
8214 # though. Also, the filter scales superlinearly with the number of
8215 # global variables. join(1) would be nice here, but unfortunately
8216 # isn't a blessed tool.
8217 $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
8218 func_append delfiles " $export_symbols $output_objdir/$libname.filter"
8219 export_symbols=$output_objdir/$libname.def
8220 $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
8221 fi
8222
8223 tmp_deplibs=
8224 for test_deplib in $deplibs; do
8225 case " $convenience " in
8226 *" $test_deplib "*) ;;
8227 *)
8228 func_append tmp_deplibs " $test_deplib"
8229 ;;
8230 esac
8231 done
8232 deplibs="$tmp_deplibs"
8233
8234 if test -n "$convenience"; then
8235 if test -n "$whole_archive_flag_spec" &&
8236 test "$compiler_needs_object" = yes &&
8237 test -z "$libobjs"; then
8238 # extract the archives, so we have objects to list.
8239 # TODO: could optimize this to just extract one archive.
8240 whole_archive_flag_spec=
8241 fi
8242 if test -n "$whole_archive_flag_spec"; then
8243 save_libobjs=$libobjs
8244 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
8245 test "X$libobjs" = "X " && libobjs=
8246 else
8247 gentop="$output_objdir/${outputname}x"
8248 func_append generated " $gentop"
8249
8250 func_extract_archives $gentop $convenience
8251 func_append libobjs " $func_extract_archives_result"
8252 test "X$libobjs" = "X " && libobjs=
8253 fi
8254 fi
8255
8256 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
8257 eval flag=\"$thread_safe_flag_spec\"
8258 func_append linker_flags " $flag"
8259 fi
8260
8261 # Make a backup of the uninstalled library when relinking
8262 if test "$opt_mode" = relink; then
8263 $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
8264 fi
8265
8266 # Do each of the archive commands.
8267 if test "$module" = yes && test -n "$module_cmds" ; then
8268 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
8269 eval test_cmds=\"$module_expsym_cmds\"
8270 cmds=$module_expsym_cmds
8271 else
8272 eval test_cmds=\"$module_cmds\"
8273 cmds=$module_cmds
8274 fi
8275 else
8276 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
8277 eval test_cmds=\"$archive_expsym_cmds\"
8278 cmds=$archive_expsym_cmds
8279 else
8280 eval test_cmds=\"$archive_cmds\"
8281 cmds=$archive_cmds
8282 fi
8283 fi
8284
8285 if test "X$skipped_export" != "X:" &&
8286 func_len " $test_cmds" &&
8287 len=$func_len_result &&
8288 test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
8289 :
8290 else
8291 # The command line is too long to link in one step, link piecewise
8292 # or, if using GNU ld and skipped_export is not :, use a linker
8293 # script.
8294
8295 # Save the value of $output and $libobjs because we want to
8296 # use them later. If we have whole_archive_flag_spec, we
8297 # want to use save_libobjs as it was before
8298 # whole_archive_flag_spec was expanded, because we can't
8299 # assume the linker understands whole_archive_flag_spec.
8300 # This may have to be revisited, in case too many
8301 # convenience libraries get linked in and end up exceeding
8302 # the spec.
8303 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
8304 save_libobjs=$libobjs
8305 fi
8306 save_output=$output
8307 func_basename "$output"
8308 output_la=$func_basename_result
8309
8310 # Clear the reloadable object creation command queue and
8311 # initialize k to one.
8312 test_cmds=
8313 concat_cmds=
8314 objlist=
8315 last_robj=
8316 k=1
8317
8318 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
8319 output=${output_objdir}/${output_la}.lnkscript
8320 func_verbose "creating GNU ld script: $output"
8321 echo 'INPUT (' > $output
8322 for obj in $save_libobjs
8323 do
8324 func_to_tool_file "$obj"
8325 $ECHO "$func_to_tool_file_result" >> $output
8326 done
8327 echo ')' >> $output
8328 func_append delfiles " $output"
8329 func_to_tool_file "$output"
8330 output=$func_to_tool_file_result
8331 elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
8332 output=${output_objdir}/${output_la}.lnk
8333 func_verbose "creating linker input file list: $output"
8334 : > $output
8335 set x $save_libobjs
8336 shift
8337 firstobj=
8338 if test "$compiler_needs_object" = yes; then
8339 firstobj="$1 "
8340 shift
8341 fi
8342 for obj
8343 do
8344 func_to_tool_file "$obj"
8345 $ECHO "$func_to_tool_file_result" >> $output
8346 done
8347 func_append delfiles " $output"
8348 func_to_tool_file "$output"
8349 output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
8350 else
8351 if test -n "$save_libobjs"; then
8352 func_verbose "creating reloadable object files..."
8353 output=$output_objdir/$output_la-${k}.$objext
8354 eval test_cmds=\"$reload_cmds\"
8355 func_len " $test_cmds"
8356 len0=$func_len_result
8357 len=$len0
8358
8359 # Loop over the list of objects to be linked.
8360 for obj in $save_libobjs
8361 do
8362 func_len " $obj"
8363 func_arith $len + $func_len_result
8364 len=$func_arith_result
8365 if test "X$objlist" = X ||
8366 test "$len" -lt "$max_cmd_len"; then
8367 func_append objlist " $obj"
8368 else
8369 # The command $test_cmds is almost too long, add a
8370 # command to the queue.
8371 if test "$k" -eq 1 ; then
8372 # The first file doesn't have a previous command to add.
8373 reload_objs=$objlist
8374 eval concat_cmds=\"$reload_cmds\"
8375 else
8376 # All subsequent reloadable object files will link in
8377 # the last one created.
8378 reload_objs="$objlist $last_robj"
8379 eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
8380 fi
8381 last_robj=$output_objdir/$output_la-${k}.$objext
8382 func_arith $k + 1
8383 k=$func_arith_result
8384 output=$output_objdir/$output_la-${k}.$objext
8385 objlist=" $obj"
8386 func_len " $last_robj"
8387 func_arith $len0 + $func_len_result
8388 len=$func_arith_result
8389 fi
8390 done
8391 # Handle the remaining objects by creating one last
8392 # reloadable object file. All subsequent reloadable object
8393 # files will link in the last one created.
8394 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
8395 reload_objs="$objlist $last_robj"
8396 eval concat_cmds=\"\${concat_cmds}$reload_cmds\"
8397 if test -n "$last_robj"; then
8398 eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
8399 fi
8400 func_append delfiles " $output"
8401
8402 else
8403 output=
8404 fi
8405
8406 if ${skipped_export-false}; then
8407 func_verbose "generating symbol list for \`$libname.la'"
8408 export_symbols="$output_objdir/$libname.exp"
8409 $opt_dry_run || $RM $export_symbols
8410 libobjs=$output
8411 # Append the command to create the export file.
8412 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
8413 eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
8414 if test -n "$last_robj"; then
8415 eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
8416 fi
8417 fi
8418
8419 test -n "$save_libobjs" &&
8420 func_verbose "creating a temporary reloadable object file: $output"
8421
8422 # Loop through the commands generated above and execute them.
8423 save_ifs="$IFS"; IFS='~'
8424 for cmd in $concat_cmds; do
8425 IFS="$save_ifs"
8426 $opt_silent || {
8427 func_quote_for_expand "$cmd"
8428 eval "func_echo $func_quote_for_expand_result"
8429 }
8430 $opt_dry_run || eval "$cmd" || {
8431 lt_exit=$?
8432
8433 # Restore the uninstalled library and exit
8434 if test "$opt_mode" = relink; then
8435 ( cd "$output_objdir" && \
8436 $RM "${realname}T" && \
8437 $MV "${realname}U" "$realname" )
8438 fi
8439
8440 exit $lt_exit
8441 }
8442 done
8443 IFS="$save_ifs"
8444
8445 if test -n "$export_symbols_regex" && ${skipped_export-false}; then
8446 func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
8447 func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
8448 fi
8449 fi
8450
8451 if ${skipped_export-false}; then
8452 if test -n "$export_symbols" && test -n "$include_expsyms"; then
8453 tmp_export_symbols="$export_symbols"
8454 test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
8455 $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
8456 fi
8457
8458 if test -n "$orig_export_symbols"; then
8459 # The given exports_symbols file has to be filtered, so filter it.
8460 func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
8461 # FIXME: $output_objdir/$libname.filter potentially contains lots of
8462 # 's' commands which not all seds can handle. GNU sed should be fine
8463 # though. Also, the filter scales superlinearly with the number of
8464 # global variables. join(1) would be nice here, but unfortunately
8465 # isn't a blessed tool.
8466 $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
8467 func_append delfiles " $export_symbols $output_objdir/$libname.filter"
8468 export_symbols=$output_objdir/$libname.def
8469 $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
8470 fi
8471 fi
8472
8473 libobjs=$output
8474 # Restore the value of output.
8475 output=$save_output
8476
8477 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
8478 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
8479 test "X$libobjs" = "X " && libobjs=
8480 fi
8481 # Expand the library linking commands again to reset the
8482 # value of $libobjs for piecewise linking.
8483
8484 # Do each of the archive commands.
8485 if test "$module" = yes && test -n "$module_cmds" ; then
8486 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
8487 cmds=$module_expsym_cmds
8488 else
8489 cmds=$module_cmds
8490 fi
8491 else
8492 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
8493 cmds=$archive_expsym_cmds
8494 else
8495 cmds=$archive_cmds
8496 fi
8497 fi
8498 fi
8499
8500 if test -n "$delfiles"; then
8501 # Append the command to remove temporary files to $cmds.
8502 eval cmds=\"\$cmds~\$RM $delfiles\"
8503 fi
8504
8505 # Add any objects from preloaded convenience libraries
8506 if test -n "$dlprefiles"; then
8507 gentop="$output_objdir/${outputname}x"
8508 func_append generated " $gentop"
8509
8510 func_extract_archives $gentop $dlprefiles
8511 func_append libobjs " $func_extract_archives_result"
8512 test "X$libobjs" = "X " && libobjs=
8513 fi
8514
8515 save_ifs="$IFS"; IFS='~'
8516 for cmd in $cmds; do
8517 IFS="$save_ifs"
8518 eval cmd=\"$cmd\"
8519 $opt_silent || {
8520 func_quote_for_expand "$cmd"
8521 eval "func_echo $func_quote_for_expand_result"
8522 }
8523 $opt_dry_run || eval "$cmd" || {
8524 lt_exit=$?
8525
8526 # Restore the uninstalled library and exit
8527 if test "$opt_mode" = relink; then
8528 ( cd "$output_objdir" && \
8529 $RM "${realname}T" && \
8530 $MV "${realname}U" "$realname" )
8531 fi
8532
8533 exit $lt_exit
8534 }
8535 done
8536 IFS="$save_ifs"
8537
8538 # Restore the uninstalled library and exit
8539 if test "$opt_mode" = relink; then
8540 $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
8541
8542 if test -n "$convenience"; then
8543 if test -z "$whole_archive_flag_spec"; then
8544 func_show_eval '${RM}r "$gentop"'
8545 fi
8546 fi
8547
8548 exit $EXIT_SUCCESS
8549 fi
8550
8551 # Create links to the real library.
8552 for linkname in $linknames; do
8553 if test "$realname" != "$linkname"; then
8554 func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
8555 fi
8556 done
8557
8558 # If -module or -export-dynamic was specified, set the dlname.
8559 if test "$module" = yes || test "$export_dynamic" = yes; then
8560 # On all known operating systems, these are identical.
8561 dlname="$soname"
8562 fi
8563 fi
8564 ;;
8565
8566 obj)
8567 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
8568 func_warning "\`-dlopen' is ignored for objects"
8569 fi
8570
8571 case " $deplibs" in
8572 *\ -l* | *\ -L*)
8573 func_warning "\`-l' and \`-L' are ignored for objects" ;;
8574 esac
8575
8576 test -n "$rpath" && \
8577 func_warning "\`-rpath' is ignored for objects"
8578
8579 test -n "$xrpath" && \
8580 func_warning "\`-R' is ignored for objects"
8581
8582 test -n "$vinfo" && \
8583 func_warning "\`-version-info' is ignored for objects"
8584
8585 test -n "$release" && \
8586 func_warning "\`-release' is ignored for objects"
8587
8588 case $output in
8589 *.lo)
8590 test -n "$objs$old_deplibs" && \
8591 func_fatal_error "cannot build library object \`$output' from non-libtool objects"
8592
8593 libobj=$output
8594 func_lo2o "$libobj"
8595 obj=$func_lo2o_result
8596 ;;
8597 *)
8598 libobj=
8599 obj="$output"
8600 ;;
8601 esac
8602
8603 # Delete the old objects.
8604 $opt_dry_run || $RM $obj $libobj
8605
8606 # Objects from convenience libraries. This assumes
8607 # single-version convenience libraries. Whenever we create
8608 # different ones for PIC/non-PIC, this we'll have to duplicate
8609 # the extraction.
8610 reload_conv_objs=
8611 gentop=
8612 # reload_cmds runs $LD directly, so let us get rid of
8613 # -Wl from whole_archive_flag_spec and hope we can get by with
8614 # turning comma into space..
8615 wl=
8616
8617 if test -n "$convenience"; then
8618 if test -n "$whole_archive_flag_spec"; then
8619 eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
8620 reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
8621 else
8622 gentop="$output_objdir/${obj}x"
8623 func_append generated " $gentop"
8624
8625 func_extract_archives $gentop $convenience
8626 reload_conv_objs="$reload_objs $func_extract_archives_result"
8627 fi
8628 fi
8629
8630 # If we're not building shared, we need to use non_pic_objs
8631 test "$build_libtool_libs" != yes && libobjs="$non_pic_objects"
8632
8633 # Create the old-style object.
8634 reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
8635
8636 output="$obj"
8637 func_execute_cmds "$reload_cmds" 'exit $?'
8638
8639 # Exit if we aren't doing a library object file.
8640 if test -z "$libobj"; then
8641 if test -n "$gentop"; then
8642 func_show_eval '${RM}r "$gentop"'
8643 fi
8644
8645 exit $EXIT_SUCCESS
8646 fi
8647
8648 if test "$build_libtool_libs" != yes; then
8649 if test -n "$gentop"; then
8650 func_show_eval '${RM}r "$gentop"'
8651 fi
8652
8653 # Create an invalid libtool object if no PIC, so that we don't
8654 # accidentally link it into a program.
8655 # $show "echo timestamp > $libobj"
8656 # $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
8657 exit $EXIT_SUCCESS
8658 fi
8659
8660 if test -n "$pic_flag" || test "$pic_mode" != default; then
8661 # Only do commands if we really have different PIC objects.
8662 reload_objs="$libobjs $reload_conv_objs"
8663 output="$libobj"
8664 func_execute_cmds "$reload_cmds" 'exit $?'
8665 fi
8666
8667 if test -n "$gentop"; then
8668 func_show_eval '${RM}r "$gentop"'
8669 fi
8670
8671 exit $EXIT_SUCCESS
8672 ;;
8673
8674 prog)
8675 case $host in
8676 *cygwin*) func_stripname '' '.exe' "$output"
8677 output=$func_stripname_result.exe;;
8678 esac
8679 test -n "$vinfo" && \
8680 func_warning "\`-version-info' is ignored for programs"
8681
8682 test -n "$release" && \
8683 func_warning "\`-release' is ignored for programs"
8684
8685 test "$preload" = yes \
8686 && test "$dlopen_support" = unknown \
8687 && test "$dlopen_self" = unknown \
8688 && test "$dlopen_self_static" = unknown && \
8689 func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
8690
8691 case $host in
8692 *-*-rhapsody* | *-*-darwin1.[012])
8693 # On Rhapsody replace the C library is the System framework
8694 compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'`
8695 finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'`
8696 ;;
8697 esac
8698
8699 case $host in
8700 *-*-darwin*)
8701 # Don't allow lazy linking, it breaks C++ global constructors
8702 # But is supposedly fixed on 10.4 or later (yay!).
8703 if test "$tagname" = CXX ; then
8704 case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
8705 10.[0123])
8706 func_append compile_command " ${wl}-bind_at_load"
8707 func_append finalize_command " ${wl}-bind_at_load"
8708 ;;
8709 esac
8710 fi
8711 # Time to change all our "foo.ltframework" stuff back to "-framework foo"
8712 compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
8713 finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
8714 ;;
8715 esac
8716
8717
8718 # move library search paths that coincide with paths to not yet
8719 # installed libraries to the beginning of the library search list
8720 new_libs=
8721 for path in $notinst_path; do
8722 case " $new_libs " in
8723 *" -L$path/$objdir "*) ;;
8724 *)
8725 case " $compile_deplibs " in
8726 *" -L$path/$objdir "*)
8727 func_append new_libs " -L$path/$objdir" ;;
8728 esac
8729 ;;
8730 esac
8731 done
8732 for deplib in $compile_deplibs; do
8733 case $deplib in
8734 -L*)
8735 case " $new_libs " in
8736 *" $deplib "*) ;;
8737 *) func_append new_libs " $deplib" ;;
8738 esac
8739 ;;
8740 *) func_append new_libs " $deplib" ;;
8741 esac
8742 done
8743 compile_deplibs="$new_libs"
8744
8745
8746 func_append compile_command " $compile_deplibs"
8747 func_append finalize_command " $finalize_deplibs"
8748
8749 if test -n "$rpath$xrpath"; then
8750 # If the user specified any rpath flags, then add them.
8751 for libdir in $rpath $xrpath; do
8752 # This is the magic to use -rpath.
8753 case "$finalize_rpath " in
8754 *" $libdir "*) ;;
8755 *) func_append finalize_rpath " $libdir" ;;
8756 esac
8757 done
8758 fi
8759
8760 # Now hardcode the library paths
8761 rpath=
8762 hardcode_libdirs=
8763 for libdir in $compile_rpath $finalize_rpath; do
8764 if test -n "$hardcode_libdir_flag_spec"; then
8765 if test -n "$hardcode_libdir_separator"; then
8766 if test -z "$hardcode_libdirs"; then
8767 hardcode_libdirs="$libdir"
8768 else
8769 # Just accumulate the unique libdirs.
8770 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
8771 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
8772 ;;
8773 *)
8774 func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
8775 ;;
8776 esac
8777 fi
8778 else
8779 eval flag=\"$hardcode_libdir_flag_spec\"
8780 func_append rpath " $flag"
8781 fi
8782 elif test -n "$runpath_var"; then
8783 case "$perm_rpath " in
8784 *" $libdir "*) ;;
8785 *) func_append perm_rpath " $libdir" ;;
8786 esac
8787 fi
8788 case $host in
8789 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
8790 testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
8791 case :$dllsearchpath: in
8792 *":$libdir:"*) ;;
8793 ::) dllsearchpath=$libdir;;
8794 *) func_append dllsearchpath ":$libdir";;
8795 esac
8796 case :$dllsearchpath: in
8797 *":$testbindir:"*) ;;
8798 ::) dllsearchpath=$testbindir;;
8799 *) func_append dllsearchpath ":$testbindir";;
8800 esac
8801 ;;
8802 esac
8803 done
8804 # Substitute the hardcoded libdirs into the rpath.
8805 if test -n "$hardcode_libdir_separator" &&
8806 test -n "$hardcode_libdirs"; then
8807 libdir="$hardcode_libdirs"
8808 eval rpath=\" $hardcode_libdir_flag_spec\"
8809 fi
8810 compile_rpath="$rpath"
8811
8812 rpath=
8813 hardcode_libdirs=
8814 for libdir in $finalize_rpath; do
8815 if test -n "$hardcode_libdir_flag_spec"; then
8816 if test -n "$hardcode_libdir_separator"; then
8817 if test -z "$hardcode_libdirs"; then
8818 hardcode_libdirs="$libdir"
8819 else
8820 # Just accumulate the unique libdirs.
8821 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
8822 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
8823 ;;
8824 *)
8825 func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
8826 ;;
8827 esac
8828 fi
8829 else
8830 eval flag=\"$hardcode_libdir_flag_spec\"
8831 func_append rpath " $flag"
8832 fi
8833 elif test -n "$runpath_var"; then
8834 case "$finalize_perm_rpath " in
8835 *" $libdir "*) ;;
8836 *) func_append finalize_perm_rpath " $libdir" ;;
8837 esac
8838 fi
8839 done
8840 # Substitute the hardcoded libdirs into the rpath.
8841 if test -n "$hardcode_libdir_separator" &&
8842 test -n "$hardcode_libdirs"; then
8843 libdir="$hardcode_libdirs"
8844 eval rpath=\" $hardcode_libdir_flag_spec\"
8845 fi
8846 finalize_rpath="$rpath"
8847
8848 if test -n "$libobjs" && test "$build_old_libs" = yes; then
8849 # Transform all the library objects into standard objects.
8850 compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
8851 finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
8852 fi
8853
8854 func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
8855
8856 # template prelinking step
8857 if test -n "$prelink_cmds"; then
8858 func_execute_cmds "$prelink_cmds" 'exit $?'
8859 fi
8860
8861 wrappers_required=yes
8862 case $host in
8863 *cegcc* | *mingw32ce*)
8864 # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
8865 wrappers_required=no
8866 ;;
8867 *cygwin* | *mingw* )
8868 if test "$build_libtool_libs" != yes; then
8869 wrappers_required=no
8870 fi
8871 ;;
8872 *)
8873 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
8874 wrappers_required=no
8875 fi
8876 ;;
8877 esac
8878 if test "$wrappers_required" = no; then
8879 # Replace the output file specification.
8880 compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
8881 link_command="$compile_command$compile_rpath"
8882
8883 # We have no uninstalled library dependencies, so finalize right now.
8884 exit_status=0
8885 func_show_eval "$link_command" 'exit_status=$?'
8886
8887 if test -n "$postlink_cmds"; then
8888 func_to_tool_file "$output"
8889 postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
8890 func_execute_cmds "$postlink_cmds" 'exit $?'
8891 fi
8892
8893 # Delete the generated files.
8894 if test -f "$output_objdir/${outputname}S.${objext}"; then
8895 func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
8896 fi
8897
8898 exit $exit_status
8899 fi
8900
8901 if test -n "$compile_shlibpath$finalize_shlibpath"; then
8902 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
8903 fi
8904 if test -n "$finalize_shlibpath"; then
8905 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
8906 fi
8907
8908 compile_var=
8909 finalize_var=
8910 if test -n "$runpath_var"; then
8911 if test -n "$perm_rpath"; then
8912 # We should set the runpath_var.
8913 rpath=
8914 for dir in $perm_rpath; do
8915 func_append rpath "$dir:"
8916 done
8917 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
8918 fi
8919 if test -n "$finalize_perm_rpath"; then
8920 # We should set the runpath_var.
8921 rpath=
8922 for dir in $finalize_perm_rpath; do
8923 func_append rpath "$dir:"
8924 done
8925 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
8926 fi
8927 fi
8928
8929 if test "$no_install" = yes; then
8930 # We don't need to create a wrapper script.
8931 link_command="$compile_var$compile_command$compile_rpath"
8932 # Replace the output file specification.
8933 link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
8934 # Delete the old output file.
8935 $opt_dry_run || $RM $output
8936 # Link the executable and exit
8937 func_show_eval "$link_command" 'exit $?'
8938
8939 if test -n "$postlink_cmds"; then
8940 func_to_tool_file "$output"
8941 postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
8942 func_execute_cmds "$postlink_cmds" 'exit $?'
8943 fi
8944
8945 exit $EXIT_SUCCESS
8946 fi
8947
8948 if test "$hardcode_action" = relink; then
8949 # Fast installation is not supported
8950 link_command="$compile_var$compile_command$compile_rpath"
8951 relink_command="$finalize_var$finalize_command$finalize_rpath"
8952
8953 func_warning "this platform does not like uninstalled shared libraries"
8954 func_warning "\`$output' will be relinked during installation"
8955 else
8956 if test "$fast_install" != no; then
8957 link_command="$finalize_var$compile_command$finalize_rpath"
8958 if test "$fast_install" = yes; then
8959 relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
8960 else
8961 # fast_install is set to needless
8962 relink_command=
8963 fi
8964 else
8965 link_command="$compile_var$compile_command$compile_rpath"
8966 relink_command="$finalize_var$finalize_command$finalize_rpath"
8967 fi
8968 fi
8969
8970 # Replace the output file specification.
8971 link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
8972
8973 # Delete the old output files.
8974 $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
8975
8976 func_show_eval "$link_command" 'exit $?'
8977
8978 if test -n "$postlink_cmds"; then
8979 func_to_tool_file "$output_objdir/$outputname"
8980 postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
8981 func_execute_cmds "$postlink_cmds" 'exit $?'
8982 fi
8983
8984 # Now create the wrapper script.
8985 func_verbose "creating $output"
8986
8987 # Quote the relink command for shipping.
8988 if test -n "$relink_command"; then
8989 # Preserve any variables that may affect compiler behavior
8990 for var in $variables_saved_for_relink; do
8991 if eval test -z \"\${$var+set}\"; then
8992 relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
8993 elif eval var_value=\$$var; test -z "$var_value"; then
8994 relink_command="$var=; export $var; $relink_command"
8995 else
8996 func_quote_for_eval "$var_value"
8997 relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
8998 fi
8999 done
9000 relink_command="(cd `pwd`; $relink_command)"
9001 relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
9002 fi
9003
9004 # Only actually do things if not in dry run mode.
9005 $opt_dry_run || {
9006 # win32 will think the script is a binary if it has
9007 # a .exe suffix, so we strip it off here.
9008 case $output in
9009 *.exe) func_stripname '' '.exe' "$output"
9010 output=$func_stripname_result ;;
9011 esac
9012 # test for cygwin because mv fails w/o .exe extensions
9013 case $host in
9014 *cygwin*)
9015 exeext=.exe
9016 func_stripname '' '.exe' "$outputname"
9017 outputname=$func_stripname_result ;;
9018 *) exeext= ;;
9019 esac
9020 case $host in
9021 *cygwin* | *mingw* )
9022 func_dirname_and_basename "$output" "" "."
9023 output_name=$func_basename_result
9024 output_path=$func_dirname_result
9025 cwrappersource="$output_path/$objdir/lt-$output_name.c"
9026 cwrapper="$output_path/$output_name.exe"
9027 $RM $cwrappersource $cwrapper
9028 trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
9029
9030 func_emit_cwrapperexe_src > $cwrappersource
9031
9032 # The wrapper executable is built using the $host compiler,
9033 # because it contains $host paths and files. If cross-
9034 # compiling, it, like the target executable, must be
9035 # executed on the $host or under an emulation environment.
9036 $opt_dry_run || {
9037 $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
9038 $STRIP $cwrapper
9039 }
9040
9041 # Now, create the wrapper script for func_source use:
9042 func_ltwrapper_scriptname $cwrapper
9043 $RM $func_ltwrapper_scriptname_result
9044 trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
9045 $opt_dry_run || {
9046 # note: this script will not be executed, so do not chmod.
9047 if test "x$build" = "x$host" ; then
9048 $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
9049 else
9050 func_emit_wrapper no > $func_ltwrapper_scriptname_result
9051 fi
9052 }
9053 ;;
9054 * )
9055 $RM $output
9056 trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
9057
9058 func_emit_wrapper no > $output
9059 chmod +x $output
9060 ;;
9061 esac
9062 }
9063 exit $EXIT_SUCCESS
9064 ;;
9065 esac
9066
9067 # See if we need to build an old-fashioned archive.
9068 for oldlib in $oldlibs; do
9069
9070 if test "$build_libtool_libs" = convenience; then
9071 oldobjs="$libobjs_save $symfileobj"
9072 addlibs="$convenience"
9073 build_libtool_libs=no
9074 else
9075 if test "$build_libtool_libs" = module; then
9076 oldobjs="$libobjs_save"
9077 build_libtool_libs=no
9078 else
9079 oldobjs="$old_deplibs $non_pic_objects"
9080 if test "$preload" = yes && test -f "$symfileobj"; then
9081 func_append oldobjs " $symfileobj"
9082 fi
9083 fi
9084 addlibs="$old_convenience"
9085 fi
9086
9087 if test -n "$addlibs"; then
9088 gentop="$output_objdir/${outputname}x"
9089 func_append generated " $gentop"
9090
9091 func_extract_archives $gentop $addlibs
9092 func_append oldobjs " $func_extract_archives_result"
9093 fi
9094
9095 # Do each command in the archive commands.
9096 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
9097 cmds=$old_archive_from_new_cmds
9098 else
9099
9100 # Add any objects from preloaded convenience libraries
9101 if test -n "$dlprefiles"; then
9102 gentop="$output_objdir/${outputname}x"
9103 func_append generated " $gentop"
9104
9105 func_extract_archives $gentop $dlprefiles
9106 func_append oldobjs " $func_extract_archives_result"
9107 fi
9108
9109 # POSIX demands no paths to be encoded in archives. We have
9110 # to avoid creating archives with duplicate basenames if we
9111 # might have to extract them afterwards, e.g., when creating a
9112 # static archive out of a convenience library, or when linking
9113 # the entirety of a libtool archive into another (currently
9114 # not supported by libtool).
9115 if (for obj in $oldobjs
9116 do
9117 func_basename "$obj"
9118 $ECHO "$func_basename_result"
9119 done | sort | sort -uc >/dev/null 2>&1); then
9120 :
9121 else
9122 echo "copying selected object files to avoid basename conflicts..."
9123 gentop="$output_objdir/${outputname}x"
9124 func_append generated " $gentop"
9125 func_mkdir_p "$gentop"
9126 save_oldobjs=$oldobjs
9127 oldobjs=
9128 counter=1
9129 for obj in $save_oldobjs
9130 do
9131 func_basename "$obj"
9132 objbase="$func_basename_result"
9133 case " $oldobjs " in
9134 " ") oldobjs=$obj ;;
9135 *[\ /]"$objbase "*)
9136 while :; do
9137 # Make sure we don't pick an alternate name that also
9138 # overlaps.
9139 newobj=lt$counter-$objbase
9140 func_arith $counter + 1
9141 counter=$func_arith_result
9142 case " $oldobjs " in
9143 *[\ /]"$newobj "*) ;;
9144 *) if test ! -f "$gentop/$newobj"; then break; fi ;;
9145 esac
9146 done
9147 func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
9148 func_append oldobjs " $gentop/$newobj"
9149 ;;
9150 *) func_append oldobjs " $obj" ;;
9151 esac
9152 done
9153 fi
9154 eval cmds=\"$old_archive_cmds\"
9155
9156 func_len " $cmds"
9157 len=$func_len_result
9158 if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
9159 cmds=$old_archive_cmds
9160 elif test -n "$archiver_list_spec"; then
9161 func_verbose "using command file archive linking..."
9162 for obj in $oldobjs
9163 do
9164 func_to_tool_file "$obj"
9165 $ECHO "$func_to_tool_file_result"
9166 done > $output_objdir/$libname.libcmd
9167 func_to_tool_file "$output_objdir/$libname.libcmd"
9168 oldobjs=" $archiver_list_spec$func_to_tool_file_result"
9169 cmds=$old_archive_cmds
9170 else
9171 # the command line is too long to link in one step, link in parts
9172 func_verbose "using piecewise archive linking..."
9173 save_RANLIB=$RANLIB
9174 RANLIB=:
9175 objlist=
9176 concat_cmds=
9177 save_oldobjs=$oldobjs
9178 oldobjs=
9179 # Is there a better way of finding the last object in the list?
9180 for obj in $save_oldobjs
9181 do
9182 last_oldobj=$obj
9183 done
9184 eval test_cmds=\"$old_archive_cmds\"
9185 func_len " $test_cmds"
9186 len0=$func_len_result
9187 len=$len0
9188 for obj in $save_oldobjs
9189 do
9190 func_len " $obj"
9191 func_arith $len + $func_len_result
9192 len=$func_arith_result
9193 func_append objlist " $obj"
9194 if test "$len" -lt "$max_cmd_len"; then
9195 :
9196 else
9197 # the above command should be used before it gets too long
9198 oldobjs=$objlist
9199 if test "$obj" = "$last_oldobj" ; then
9200 RANLIB=$save_RANLIB
9201 fi
9202 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
9203 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
9204 objlist=
9205 len=$len0
9206 fi
9207 done
9208 RANLIB=$save_RANLIB
9209 oldobjs=$objlist
9210 if test "X$oldobjs" = "X" ; then
9211 eval cmds=\"\$concat_cmds\"
9212 else
9213 eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
9214 fi
9215 fi
9216 fi
9217 func_execute_cmds "$cmds" 'exit $?'
9218 done
9219
9220 test -n "$generated" && \
9221 func_show_eval "${RM}r$generated"
9222
9223 # Now create the libtool archive.
9224 case $output in
9225 *.la)
9226 old_library=
9227 test "$build_old_libs" = yes && old_library="$libname.$libext"
9228 func_verbose "creating $output"
9229
9230 # Preserve any variables that may affect compiler behavior
9231 for var in $variables_saved_for_relink; do
9232 if eval test -z \"\${$var+set}\"; then
9233 relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
9234 elif eval var_value=\$$var; test -z "$var_value"; then
9235 relink_command="$var=; export $var; $relink_command"
9236 else
9237 func_quote_for_eval "$var_value"
9238 relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
9239 fi
9240 done
9241 # Quote the link command for shipping.
9242 relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
9243 relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
9244 if test "$hardcode_automatic" = yes ; then
9245 relink_command=
9246 fi
9247
9248 # Only create the output if not a dry run.
9249 $opt_dry_run || {
9250 for installed in no yes; do
9251 if test "$installed" = yes; then
9252 if test -z "$install_libdir"; then
9253 break
9254 fi
9255 output="$output_objdir/$outputname"i
9256 # Replace all uninstalled libtool libraries with the installed ones
9257 newdependency_libs=
9258 for deplib in $dependency_libs; do
9259 case $deplib in
9260 *.la)
9261 func_basename "$deplib"
9262 name="$func_basename_result"
9263 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
9264 test -z "$libdir" && \
9265 func_fatal_error "\`$deplib' is not a valid libtool archive"
9266 func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
9267 ;;
9268 -L*)
9269 func_stripname -L '' "$deplib"
9270 func_replace_sysroot "$func_stripname_result"
9271 func_append newdependency_libs " -L$func_replace_sysroot_result"
9272 ;;
9273 -R*)
9274 func_stripname -R '' "$deplib"
9275 func_replace_sysroot "$func_stripname_result"
9276 func_append newdependency_libs " -R$func_replace_sysroot_result"
9277 ;;
9278 *) func_append newdependency_libs " $deplib" ;;
9279 esac
9280 done
9281 dependency_libs="$newdependency_libs"
9282 newdlfiles=
9283
9284 for lib in $dlfiles; do
9285 case $lib in
9286 *.la)
9287 func_basename "$lib"
9288 name="$func_basename_result"
9289 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
9290 test -z "$libdir" && \
9291 func_fatal_error "\`$lib' is not a valid libtool archive"
9292 func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
9293 ;;
9294 *) func_append newdlfiles " $lib" ;;
9295 esac
9296 done
9297 dlfiles="$newdlfiles"
9298 newdlprefiles=
9299 for lib in $dlprefiles; do
9300 case $lib in
9301 *.la)
9302 # Only pass preopened files to the pseudo-archive (for
9303 # eventual linking with the app. that links it) if we
9304 # didn't already link the preopened objects directly into
9305 # the library:
9306 func_basename "$lib"
9307 name="$func_basename_result"
9308 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
9309 test -z "$libdir" && \
9310 func_fatal_error "\`$lib' is not a valid libtool archive"
9311 func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
9312 ;;
9313 esac
9314 done
9315 dlprefiles="$newdlprefiles"
9316 else
9317 newdlfiles=
9318 for lib in $dlfiles; do
9319 case $lib in
9320 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
9321 *) abs=`pwd`"/$lib" ;;
9322 esac
9323 func_append newdlfiles " $abs"
9324 done
9325 dlfiles="$newdlfiles"
9326 newdlprefiles=
9327 for lib in $dlprefiles; do
9328 case $lib in
9329 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
9330 *) abs=`pwd`"/$lib" ;;
9331 esac
9332 func_append newdlprefiles " $abs"
9333 done
9334 dlprefiles="$newdlprefiles"
9335 fi
9336 $RM $output
9337 # place dlname in correct position for cygwin
9338 # In fact, it would be nice if we could use this code for all target
9339 # systems that can't hard-code library paths into their executables
9340 # and that have no shared library path variable independent of PATH,
9341 # but it turns out we can't easily determine that from inspecting
9342 # libtool variables, so we have to hard-code the OSs to which it
9343 # applies here; at the moment, that means platforms that use the PE
9344 # object format with DLL files. See the long comment at the top of
9345 # tests/bindir.at for full details.
9346 tdlname=$dlname
9347 case $host,$output,$installed,$module,$dlname in
9348 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
9349 # If a -bindir argument was supplied, place the dll there.
9350 if test "x$bindir" != x ;
9351 then
9352 func_relative_path "$install_libdir" "$bindir"
9353 tdlname=$func_relative_path_result$dlname
9354 else
9355 # Otherwise fall back on heuristic.
9356 tdlname=../bin/$dlname
9357 fi
9358 ;;
9359 esac
9360 $ECHO > $output "\
9361 # $outputname - a libtool library file
9362 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
9363 #
9364 # Please DO NOT delete this file!
9365 # It is necessary for linking the library.
9366
9367 # The name that we can dlopen(3).
9368 dlname='$tdlname'
9369
9370 # Names of this library.
9371 library_names='$library_names'
9372
9373 # The name of the static archive.
9374 old_library='$old_library'
9375
9376 # Linker flags that can not go in dependency_libs.
9377 inherited_linker_flags='$new_inherited_linker_flags'
9378
9379 # Libraries that this one depends upon.
9380 dependency_libs='$dependency_libs'
9381
9382 # Names of additional weak libraries provided by this library
9383 weak_library_names='$weak_libs'
9384
9385 # Version information for $libname.
9386 current=$current
9387 age=$age
9388 revision=$revision
9389
9390 # Is this an already installed library?
9391 installed=$installed
9392
9393 # Should we warn about portability when linking against -modules?
9394 shouldnotlink=$module
9395
9396 # Files to dlopen/dlpreopen
9397 dlopen='$dlfiles'
9398 dlpreopen='$dlprefiles'
9399
9400 # Directory that this library needs to be installed in:
9401 libdir='$install_libdir'"
9402 if test "$installed" = no && test "$need_relink" = yes; then
9403 $ECHO >> $output "\
9404 relink_command=\"$relink_command\""
9405 fi
9406 done
9407 }
9408
9409 # Do a symbolic link so that the libtool archive can be found in
9410 # LD_LIBRARY_PATH before the program is installed.
9411 func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
9412 ;;
9413 esac
9414 exit $EXIT_SUCCESS
9415 }
9416
9417 { test "$opt_mode" = link || test "$opt_mode" = relink; } &&
9418 func_mode_link ${1+"$@"}
9419
9420
9421 # func_mode_uninstall arg...
9422 func_mode_uninstall ()
9423 {
9424 $opt_debug
9425 RM="$nonopt"
9426 files=
9427 rmforce=
9428 exit_status=0
9429
9430 # This variable tells wrapper scripts just to set variables rather
9431 # than running their programs.
9432 libtool_install_magic="$magic"
9433
9434 for arg
9435 do
9436 case $arg in
9437 -f) func_append RM " $arg"; rmforce=yes ;;
9438 -*) func_append RM " $arg" ;;
9439 *) func_append files " $arg" ;;
9440 esac
9441 done
9442
9443 test -z "$RM" && \
9444 func_fatal_help "you must specify an RM program"
9445
9446 rmdirs=
9447
9448 for file in $files; do
9449 func_dirname "$file" "" "."
9450 dir="$func_dirname_result"
9451 if test "X$dir" = X.; then
9452 odir="$objdir"
9453 else
9454 odir="$dir/$objdir"
9455 fi
9456 func_basename "$file"
9457 name="$func_basename_result"
9458 test "$opt_mode" = uninstall && odir="$dir"
9459
9460 # Remember odir for removal later, being careful to avoid duplicates
9461 if test "$opt_mode" = clean; then
9462 case " $rmdirs " in
9463 *" $odir "*) ;;
9464 *) func_append rmdirs " $odir" ;;
9465 esac
9466 fi
9467
9468 # Don't error if the file doesn't exist and rm -f was used.
9469 if { test -L "$file"; } >/dev/null 2>&1 ||
9470 { test -h "$file"; } >/dev/null 2>&1 ||
9471 test -f "$file"; then
9472 :
9473 elif test -d "$file"; then
9474 exit_status=1
9475 continue
9476 elif test "$rmforce" = yes; then
9477 continue
9478 fi
9479
9480 rmfiles="$file"
9481
9482 case $name in
9483 *.la)
9484 # Possibly a libtool archive, so verify it.
9485 if func_lalib_p "$file"; then
9486 func_source $dir/$name
9487
9488 # Delete the libtool libraries and symlinks.
9489 for n in $library_names; do
9490 func_append rmfiles " $odir/$n"
9491 done
9492 test -n "$old_library" && func_append rmfiles " $odir/$old_library"
9493
9494 case "$opt_mode" in
9495 clean)
9496 case " $library_names " in
9497 *" $dlname "*) ;;
9498 *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;;
9499 esac
9500 test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i"
9501 ;;
9502 uninstall)
9503 if test -n "$library_names"; then
9504 # Do each command in the postuninstall commands.
9505 func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
9506 fi
9507
9508 if test -n "$old_library"; then
9509 # Do each command in the old_postuninstall commands.
9510 func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
9511 fi
9512 # FIXME: should reinstall the best remaining shared library.
9513 ;;
9514 esac
9515 fi
9516 ;;
9517
9518 *.lo)
9519 # Possibly a libtool object, so verify it.
9520 if func_lalib_p "$file"; then
9521
9522 # Read the .lo file
9523 func_source $dir/$name
9524
9525 # Add PIC object to the list of files to remove.
9526 if test -n "$pic_object" &&
9527 test "$pic_object" != none; then
9528 func_append rmfiles " $dir/$pic_object"
9529 fi
9530
9531 # Add non-PIC object to the list of files to remove.
9532 if test -n "$non_pic_object" &&
9533 test "$non_pic_object" != none; then
9534 func_append rmfiles " $dir/$non_pic_object"
9535 fi
9536 fi
9537 ;;
9538
9539 *)
9540 if test "$opt_mode" = clean ; then
9541 noexename=$name
9542 case $file in
9543 *.exe)
9544 func_stripname '' '.exe' "$file"
9545 file=$func_stripname_result
9546 func_stripname '' '.exe' "$name"
9547 noexename=$func_stripname_result
9548 # $file with .exe has already been added to rmfiles,
9549 # add $file without .exe
9550 func_append rmfiles " $file"
9551 ;;
9552 esac
9553 # Do a test to see if this is a libtool program.
9554 if func_ltwrapper_p "$file"; then
9555 if func_ltwrapper_executable_p "$file"; then
9556 func_ltwrapper_scriptname "$file"
9557 relink_command=
9558 func_source $func_ltwrapper_scriptname_result
9559 func_append rmfiles " $func_ltwrapper_scriptname_result"
9560 else
9561 relink_command=
9562 func_source $dir/$noexename
9563 fi
9564
9565 # note $name still contains .exe if it was in $file originally
9566 # as does the version of $file that was added into $rmfiles
9567 func_append rmfiles " $odir/$name $odir/${name}S.${objext}"
9568 if test "$fast_install" = yes && test -n "$relink_command"; then
9569 func_append rmfiles " $odir/lt-$name"
9570 fi
9571 if test "X$noexename" != "X$name" ; then
9572 func_append rmfiles " $odir/lt-${noexename}.c"
9573 fi
9574 fi
9575 fi
9576 ;;
9577 esac
9578 func_show_eval "$RM $rmfiles" 'exit_status=1'
9579 done
9580
9581 # Try to remove the ${objdir}s in the directories where we deleted files
9582 for dir in $rmdirs; do
9583 if test -d "$dir"; then
9584 func_show_eval "rmdir $dir >/dev/null 2>&1"
9585 fi
9586 done
9587
9588 exit $exit_status
9589 }
9590
9591 { test "$opt_mode" = uninstall || test "$opt_mode" = clean; } &&
9592 func_mode_uninstall ${1+"$@"}
9593
9594 test -z "$opt_mode" && {
9595 help="$generic_help"
9596 func_fatal_help "you must specify a MODE"
9597 }
9598
9599 test -z "$exec_cmd" && \
9600 func_fatal_help "invalid operation mode \`$opt_mode'"
9601
9602 if test -n "$exec_cmd"; then
9603 eval exec "$exec_cmd"
9604 exit $EXIT_FAILURE
9605 fi
9606
9607 exit $exit_status
9608
9609
9610 # The TAGs below are defined such that we never get into a situation
9611 # in which we disable both kinds of libraries. Given conflicting
9612 # choices, we go for a static library, that is the most portable,
9613 # since we can't tell whether shared libraries were disabled because
9614 # the user asked for that or because the platform doesn't support
9615 # them. This is particularly important on AIX, because we don't
9616 # support having both static and shared libraries enabled at the same
9617 # time on that platform, so we default to a shared-only configuration.
9618 # If a disable-shared tag is given, we'll fallback to a static-only
9619 # configuration. But we'll never go from static-only to shared-only.
9620
9621 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
9622 build_libtool_libs=no
9623 build_old_libs=yes
9624 # ### END LIBTOOL TAG CONFIG: disable-shared
9625
9626 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
9627 build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
9628 # ### END LIBTOOL TAG CONFIG: disable-static
9629
9630 # Local Variables:
9631 # mode:shell-script
9632 # sh-indentation:2
9633 # End:
9634 # vi:sw=2
9635
00 dnl Macros to check the presence of generic (non-typed) symbols.
1 dnl Copyright (c) 2006-2007 Diego Pettenò <flameeyes@gmail.com>
2 dnl Copyright (c) 2006-2007 xine project
1 dnl Copyright (c) 2006-2008 Diego Pettenò <flameeyes@gmail.com>
2 dnl Copyright (c) 2006-2008 xine project
3 dnl Copyright (c) 2012 Lucas De Marchi <lucas.de.marchi@gmail.com>
34 dnl
45 dnl This program is free software; you can redistribute it and/or modify
56 dnl it under the terms of the GNU General Public License as published by
3132 dnl this special exception to the GPL to apply to your modified version as
3233 dnl well.
3334
34 dnl Check if the flag is supported by compiler
35 dnl CC_CHECK_CFLAGS_SILENT([FLAG], [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND])
36
37 AC_DEFUN([CC_CHECK_CFLAGS_SILENT], [
38 AC_CACHE_VAL(AS_TR_SH([cc_cv_cflags_$1]),
39 [ac_save_CFLAGS="$CFLAGS"
40 CFLAGS="$CFLAGS $1"
41 AC_LINK_IFELSE([AC_LANG_SOURCE([int main() { return 0; }])],
42 [eval "AS_TR_SH([cc_cv_cflags_$1])='yes'"],
43 [eval "AS_TR_SH([cc_cv_cflags_$1])='no'"])
44 CFLAGS="$ac_save_CFLAGS"
45 ])
46
47 AS_IF([eval test x$]AS_TR_SH([cc_cv_cflags_$1])[ = xyes],
48 [$2], [$3])
49 ])
50
51 dnl Check if the flag is supported by compiler (cacheable)
52 dnl CC_CHECK_CFLAGS([FLAG], [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND])
53
54 AC_DEFUN([CC_CHECK_CFLAGS], [
55 AC_CACHE_CHECK([if $CC supports $1 flag],
56 AS_TR_SH([cc_cv_cflags_$1]),
57 CC_CHECK_CFLAGS_SILENT([$1]) dnl Don't execute actions here!
58 )
59
60 AS_IF([eval test x$]AS_TR_SH([cc_cv_cflags_$1])[ = xyes],
61 [$2], [$3])
62 ])
63
64 dnl CC_CHECK_CFLAG_APPEND(FLAG, [action-if-found], [action-if-not-found])
65 dnl Check for CFLAG and appends them to CFLAGS if supported
66 AC_DEFUN([CC_CHECK_CFLAG_APPEND], [
67 AC_CACHE_CHECK([if $CC supports $1 flag],
68 AS_TR_SH([cc_cv_cflags_$1]),
69 CC_CHECK_CFLAGS_SILENT([$1]) dnl Don't execute actions here!
70 )
71
72 AS_IF([eval test x$]AS_TR_SH([cc_cv_cflags_$1])[ = xyes],
73 [CFLAGS="$CFLAGS $1"; $2], [$3])
74 ])
75
76 dnl CC_CHECK_CFLAGS_APPEND([FLAG1 FLAG2], [action-if-found], [action-if-not])
77 AC_DEFUN([CC_CHECK_CFLAGS_APPEND], [
78 for flag in $1; do
79 CC_CHECK_CFLAG_APPEND($flag, [$2], [$3])
35 dnl Check if FLAG in ENV-VAR is supported by compiler and append it
36 dnl to WHERE-TO-APPEND variable
37 dnl CC_CHECK_FLAG_APPEND([WHERE-TO-APPEND], [ENV-VAR], [FLAG])
38
39 AC_DEFUN([CC_CHECK_FLAG_APPEND], [
40 AC_CACHE_CHECK([if $CC supports flag $3 in envvar $2],
41 AS_TR_SH([cc_cv_$2_$3]),
42 [eval "AS_TR_SH([cc_save_$2])='${$2}'"
43 eval "AS_TR_SH([$2])='$3'"
44 AC_COMPILE_IFELSE([AC_LANG_SOURCE([int a = 0; int main(void) { return a; } ])],
45 [eval "AS_TR_SH([cc_cv_$2_$3])='yes'"],
46 [eval "AS_TR_SH([cc_cv_$2_$3])='no'"])
47 eval "AS_TR_SH([$2])='$cc_save_$2'"])
48
49 AS_IF([eval test x$]AS_TR_SH([cc_cv_$2_$3])[ = xyes],
50 [eval "$1='${$1} $3'"])
51 ])
52
53 dnl CC_CHECK_FLAGS_APPEND([WHERE-TO-APPEND], [ENV-VAR], [FLAG1 FLAG2])
54 AC_DEFUN([CC_CHECK_FLAGS_APPEND], [
55 for flag in $3; do
56 CC_CHECK_FLAG_APPEND($1, $2, $flag)
8057 done
8158 ])
8259
8865 AS_TR_SH([cc_cv_ldflags_$1]),
8966 [ac_save_LDFLAGS="$LDFLAGS"
9067 LDFLAGS="$LDFLAGS $1"
91 AC_LINK_IFELSE([AC_LANG_SOURCE([int main() { return 1; }])],
68 AC_LINK_IFELSE([int main() { return 1; }],
9269 [eval "AS_TR_SH([cc_cv_ldflags_$1])='yes'"],
9370 [eval "AS_TR_SH([cc_cv_ldflags_$1])="])
9471 LDFLAGS="$ac_save_LDFLAGS"
9673
9774 AS_IF([eval test x$]AS_TR_SH([cc_cv_ldflags_$1])[ = xyes],
9875 [$2], [$3])
76 ])
77
78 dnl define the LDFLAGS_NOUNDEFINED variable with the correct value for
79 dnl the current linker to avoid undefined references in a shared object.
80 AC_DEFUN([CC_NOUNDEFINED], [
81 dnl We check $host for which systems to enable this for.
82 AC_REQUIRE([AC_CANONICAL_HOST])
83
84 case $host in
85 dnl FreeBSD (et al.) does not complete linking for shared objects when pthreads
86 dnl are requested, as different implementations are present; to avoid problems
87 dnl use -Wl,-z,defs only for those platform not behaving this way.
88 *-freebsd* | *-openbsd*) ;;
89 *)
90 dnl First of all check for the --no-undefined variant of GNU ld. This allows
91 dnl for a much more readable commandline, so that people can understand what
92 dnl it does without going to look for what the heck -z defs does.
93 for possible_flags in "-Wl,--no-undefined" "-Wl,-z,defs"; do
94 CC_CHECK_LDFLAGS([$possible_flags], [LDFLAGS_NOUNDEFINED="$possible_flags"])
95 break
96 done
97 ;;
98 esac
99
100 AC_SUBST([LDFLAGS_NOUNDEFINED])
99101 ])
100102
101103 dnl Check for a -Werror flag or equivalent. -Werror is the GCC
139141 AC_DEFUN([CC_ATTRIBUTE_CONSTRUCTOR], [
140142 CC_CHECK_ATTRIBUTE(
141143 [constructor],,
142 [extern void foo();
143 void __attribute__((constructor)) ctor() { foo(); }],
144 [$1], [$2])
145 ])
146
147 AC_DEFUN([CC_ATTRIBUTE_DESTRUCTOR], [
148 CC_CHECK_ATTRIBUTE(
149 [destructor],,
150 [extern void foo();
151 void __attribute__((destructor)) dtor() { foo(); }],
144 [void __attribute__((constructor)) ctor() { int a; }],
152145 [$1], [$2])
153146 ])
154147
254247 [cc_cv_func_expect],
255248 [ac_save_CFLAGS="$CFLAGS"
256249 CFLAGS="$CFLAGS $cc_cv_werror"
257 AC_COMPILE_IFELSE(
250 AC_COMPILE_IFELSE([AC_LANG_SOURCE(
258251 [int some_function() {
259252 int a = 3;
260253 return (int)__builtin_expect(a, 3);
261 }],
254 }])],
262255 [cc_cv_func_expect=yes],
263256 [cc_cv_func_expect=no])
264257 CFLAGS="$ac_save_CFLAGS"
278271 [ac_save_CFLAGS="$CFLAGS"
279272 CFLAGS="$CFLAGS $cc_cv_werror"
280273 for cc_attribute_align_try in 64 32 16 8 4 2; do
281 AC_COMPILE_IFELSE([
274 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
282275 int main() {
283276 static char c __attribute__ ((aligned($cc_attribute_align_try))) = 0;
284277 return c;
285 }], [cc_cv_attribute_aligned=$cc_attribute_align_try; break])
278 }])], [cc_cv_attribute_aligned=$cc_attribute_align_try; break])
286279 done
287280 CFLAGS="$ac_save_CFLAGS"
288281 ])
00 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
11 #
22 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
3 # 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
4 # Inc.
3 # 2006, 2007, 2008, 2009, 2010, 2011 Free Software
4 # Foundation, Inc.
55 # Written by Gordon Matzigkeit, 1996
66 #
77 # This file is free software; the Free Software Foundation gives
1010
1111 m4_define([_LT_COPYING], [dnl
1212 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
13 # 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
14 # Inc.
13 # 2006, 2007, 2008, 2009, 2010, 2011 Free Software
14 # Foundation, Inc.
1515 # Written by Gordon Matzigkeit, 1996
1616 #
1717 # This file is part of GNU Libtool.
145145 AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
146146 AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
147147
148 _LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
149 dnl
148150 _LT_DECL([], [host_alias], [0], [The host system])dnl
149151 _LT_DECL([], [host], [0])dnl
150152 _LT_DECL([], [host_os], [0])dnl
636638 m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
637639 configured by $[0], generated by m4_PACKAGE_STRING.
638640
639 Copyright (C) 2010 Free Software Foundation, Inc.
641 Copyright (C) 2011 Free Software Foundation, Inc.
640642 This config.lt script is free software; the Free Software Foundation
641643 gives unlimited permision to copy, distribute and modify it."
642644
800802 m4_case([$1],
801803 [C], [_LT_LANG(C)],
802804 [C++], [_LT_LANG(CXX)],
805 [Go], [_LT_LANG(GO)],
803806 [Java], [_LT_LANG(GCJ)],
804807 [Fortran 77], [_LT_LANG(F77)],
805808 [Fortran], [_LT_LANG(FC)],
819822 m4_define([_LT_LANG_]$1[_enabled], [])dnl
820823 _LT_LANG_$1_CONFIG($1)])dnl
821824 ])# _LT_LANG
825
826
827 m4_ifndef([AC_PROG_GO], [
828 ############################################################
829 # NOTE: This macro has been submitted for inclusion into #
830 # GNU Autoconf as AC_PROG_GO. When it is available in #
831 # a released version of Autoconf we should remove this #
832 # macro and use it instead. #
833 ############################################################
834 m4_defun([AC_PROG_GO],
835 [AC_LANG_PUSH(Go)dnl
836 AC_ARG_VAR([GOC], [Go compiler command])dnl
837 AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
838 _AC_ARG_VAR_LDFLAGS()dnl
839 AC_CHECK_TOOL(GOC, gccgo)
840 if test -z "$GOC"; then
841 if test -n "$ac_tool_prefix"; then
842 AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
843 fi
844 fi
845 if test -z "$GOC"; then
846 AC_CHECK_PROG(GOC, gccgo, gccgo, false)
847 fi
848 ])#m4_defun
849 ])#m4_ifndef
822850
823851
824852 # _LT_LANG_DEFAULT_CONFIG
850878 [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
851879 m4_ifdef([LT_PROG_GCJ],
852880 [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
881
882 AC_PROVIDE_IFELSE([AC_PROG_GO],
883 [LT_LANG(GO)],
884 [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
853885
854886 AC_PROVIDE_IFELSE([LT_PROG_RC],
855887 [LT_LANG(RC)],
953985 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
954986 -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
955987 _lt_result=$?
956 if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
988 # If there is a non-empty error log, and "single_module"
989 # appears in it, assume the flag caused a linker warning
990 if test -s conftest.err && $GREP single_module conftest.err; then
991 cat conftest.err >&AS_MESSAGE_LOG_FD
992 # Otherwise, if the output was created with a 0 exit code from
993 # the compiler, it worked.
994 elif test -f libconftest.dylib && test $_lt_result -eq 0; then
957995 lt_cv_apple_cc_single_mod=yes
958996 else
959997 cat conftest.err >&AS_MESSAGE_LOG_FD
961999 rm -rf libconftest.dylib*
9621000 rm -f conftest.*
9631001 fi])
1002
9641003 AC_CACHE_CHECK([for -exported_symbols_list linker flag],
9651004 [lt_cv_ld_exported_symbols_list],
9661005 [lt_cv_ld_exported_symbols_list=no
9721011 [lt_cv_ld_exported_symbols_list=no])
9731012 LDFLAGS="$save_LDFLAGS"
9741013 ])
1014
9751015 AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
9761016 [lt_cv_ld_force_load=no
9771017 cat > conftest.c << _LT_EOF
9891029 echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
9901030 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
9911031 _lt_result=$?
992 if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then
1032 if test -s conftest.err && $GREP force_load conftest.err; then
1033 cat conftest.err >&AS_MESSAGE_LOG_FD
1034 elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
9931035 lt_cv_ld_force_load=yes
9941036 else
9951037 cat conftest.err >&AS_MESSAGE_LOG_FD
10341076 ])
10351077
10361078
1037 # _LT_DARWIN_LINKER_FEATURES
1038 # --------------------------
1079 # _LT_DARWIN_LINKER_FEATURES([TAG])
1080 # ---------------------------------
10391081 # Checks for linker and compiler features on darwin
10401082 m4_defun([_LT_DARWIN_LINKER_FEATURES],
10411083 [
10461088 _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
10471089 if test "$lt_cv_ld_force_load" = "yes"; then
10481090 _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
1091 m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
1092 [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes])
10491093 else
10501094 _LT_TAGVAR(whole_archive_flag_spec, $1)=''
10511095 fi
13291373 CFLAGS="$SAVE_CFLAGS"
13301374 fi
13311375 ;;
1332 sparc*-*solaris*)
1376 *-*solaris*)
13331377 # Find out which ABI we are using.
13341378 echo 'int i;' > conftest.$ac_ext
13351379 if AC_TRY_EVAL(ac_compile); then
13361380 case `/usr/bin/file conftest.o` in
13371381 *64-bit*)
13381382 case $lt_cv_prog_gnu_ld in
1339 yes*) LD="${LD-ld} -m elf64_sparc" ;;
1383 yes*)
1384 case $host in
1385 i?86-*-solaris*)
1386 LD="${LD-ld} -m elf_x86_64"
1387 ;;
1388 sparc*-*-solaris*)
1389 LD="${LD-ld} -m elf64_sparc"
1390 ;;
1391 esac
1392 # GNU ld 2.21 introduced _sol2 emulations. Use them if available.
1393 if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
1394 LD="${LD-ld}_sol2"
1395 fi
1396 ;;
13401397 *)
13411398 if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
13421399 LD="${LD-ld} -64"
14131470 if test -n "$RANLIB"; then
14141471 case $host_os in
14151472 openbsd*)
1416 old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
1473 old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
14171474 ;;
14181475 *)
1419 old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
1476 old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
14201477 ;;
14211478 esac
1422 old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
1479 old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
14231480 fi
14241481
14251482 case $host_os in
15971654 interix*)
15981655 # We know the value 262144 and hardcode it with a safety zone (like BSD)
15991656 lt_cv_sys_max_cmd_len=196608
1657 ;;
1658
1659 os2*)
1660 # The test takes a long time on OS/2.
1661 lt_cv_sys_max_cmd_len=8192
16001662 ;;
16011663
16021664 osf*)
16381700 # If test is not a shell built-in, we'll probably end up computing a
16391701 # maximum length that is only half of the actual maximum length, but
16401702 # we can't tell.
1641 while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \
1703 while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
16421704 = "X$teststring$teststring"; } >/dev/null 2>&1 &&
16431705 test $i != 17 # 1/2 MB should be enough
16441706 do
21842246
21852247 case $host_os in
21862248 aix3*)
2187 version_type=linux
2249 version_type=linux # correct to gnu/linux during the next big refactor
21882250 library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
21892251 shlibpath_var=LIBPATH
21902252
21932255 ;;
21942256
21952257 aix[[4-9]]*)
2196 version_type=linux
2258 version_type=linux # correct to gnu/linux during the next big refactor
21972259 need_lib_prefix=no
21982260 need_version=no
21992261 hardcode_into_libs=yes
22582320 ;;
22592321
22602322 bsdi[[45]]*)
2261 version_type=linux
2323 version_type=linux # correct to gnu/linux during the next big refactor
22622324 need_version=no
22632325 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
22642326 soname_spec='${libname}${release}${shared_ext}$major'
23972459 ;;
23982460
23992461 dgux*)
2400 version_type=linux
2462 version_type=linux # correct to gnu/linux during the next big refactor
24012463 need_lib_prefix=no
24022464 need_version=no
24032465 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
24042466 soname_spec='${libname}${release}${shared_ext}$major'
24052467 shlibpath_var=LD_LIBRARY_PATH
2406 ;;
2407
2408 freebsd1*)
2409 dynamic_linker=no
24102468 ;;
24112469
24122470 freebsd* | dragonfly*)
24162474 objformat=`/usr/bin/objformat`
24172475 else
24182476 case $host_os in
2419 freebsd[[123]]*) objformat=aout ;;
2477 freebsd[[23]].*) objformat=aout ;;
24202478 *) objformat=elf ;;
24212479 esac
24222480 fi
24342492 esac
24352493 shlibpath_var=LD_LIBRARY_PATH
24362494 case $host_os in
2437 freebsd2*)
2495 freebsd2.*)
24382496 shlibpath_overrides_runpath=yes
24392497 ;;
24402498 freebsd3.[[01]]* | freebsdelf3.[[01]]*)
24542512 ;;
24552513
24562514 gnu*)
2457 version_type=linux
2515 version_type=linux # correct to gnu/linux during the next big refactor
24582516 need_lib_prefix=no
24592517 need_version=no
24602518 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
24612519 soname_spec='${libname}${release}${shared_ext}$major'
24622520 shlibpath_var=LD_LIBRARY_PATH
2521 shlibpath_overrides_runpath=no
24632522 hardcode_into_libs=yes
24642523 ;;
24652524
24662525 haiku*)
2467 version_type=linux
2526 version_type=linux # correct to gnu/linux during the next big refactor
24682527 need_lib_prefix=no
24692528 need_version=no
24702529 dynamic_linker="$host_os runtime_loader"
25252584 ;;
25262585
25272586 interix[[3-9]]*)
2528 version_type=linux
2587 version_type=linux # correct to gnu/linux during the next big refactor
25292588 need_lib_prefix=no
25302589 need_version=no
25312590 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
25412600 nonstopux*) version_type=nonstopux ;;
25422601 *)
25432602 if test "$lt_cv_prog_gnu_ld" = yes; then
2544 version_type=linux
2603 version_type=linux # correct to gnu/linux during the next big refactor
25452604 else
25462605 version_type=irix
25472606 fi ;;
25782637 dynamic_linker=no
25792638 ;;
25802639
2581 # This must be Linux ELF.
2640 # This must be glibc/ELF.
25822641 linux* | k*bsd*-gnu | kopensolaris*-gnu)
2583 version_type=linux
2642 version_type=linux # correct to gnu/linux during the next big refactor
25842643 need_lib_prefix=no
25852644 need_version=no
25862645 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
26472706 ;;
26482707
26492708 newsos6)
2650 version_type=linux
2709 version_type=linux # correct to gnu/linux during the next big refactor
26512710 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
26522711 shlibpath_var=LD_LIBRARY_PATH
26532712 shlibpath_overrides_runpath=yes
27162775 ;;
27172776
27182777 solaris*)
2719 version_type=linux
2778 version_type=linux # correct to gnu/linux during the next big refactor
27202779 need_lib_prefix=no
27212780 need_version=no
27222781 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
27412800 ;;
27422801
27432802 sysv4 | sysv4.3*)
2744 version_type=linux
2803 version_type=linux # correct to gnu/linux during the next big refactor
27452804 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
27462805 soname_spec='${libname}${release}${shared_ext}$major'
27472806 shlibpath_var=LD_LIBRARY_PATH
27652824
27662825 sysv4*MP*)
27672826 if test -d /usr/nec ;then
2768 version_type=linux
2827 version_type=linux # correct to gnu/linux during the next big refactor
27692828 library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
27702829 soname_spec='$libname${shared_ext}.$major'
27712830 shlibpath_var=LD_LIBRARY_PATH
27962855
27972856 tpf*)
27982857 # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
2799 version_type=linux
2858 version_type=linux # correct to gnu/linux during the next big refactor
28002859 need_lib_prefix=no
28012860 need_version=no
28022861 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
28062865 ;;
28072866
28082867 uts4*)
2809 version_type=linux
2868 version_type=linux # correct to gnu/linux during the next big refactor
28102869 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
28112870 soname_spec='${libname}${release}${shared_ext}$major'
28122871 shlibpath_var=LD_LIBRARY_PATH
32283287 lt_cv_deplibs_check_method=pass_all
32293288 ;;
32303289
3231 # This must be Linux ELF.
3290 # This must be glibc/ELF.
32323291 linux* | k*bsd*-gnu | kopensolaris*-gnu)
32333292 lt_cv_deplibs_check_method=pass_all
32343293 ;;
36483707 # which start with @ or ?.
36493708 lt_cv_sys_global_symbol_pipe="$AWK ['"\
36503709 " {last_section=section; section=\$ 3};"\
3710 " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
36513711 " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
36523712 " \$ 0!~/External *\|/{next};"\
36533713 " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
42324292 case $cc_basename in
42334293 nvcc*) # Cuda Compiler Driver 2.2
42344294 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
4235 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Xcompiler -fPIC'
4295 if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
4296 _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
4297 fi
42364298 ;;
42374299 esac
42384300 else
43244386 ;;
43254387 *)
43264388 case `$CC -V 2>&1 | sed 5q` in
4327 *Sun\ F* | *Sun*Fortran*)
4389 *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
43284390 # Sun Fortran 8.3 passes all unrecognized flags to the linker
43294391 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
43304392 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
43314393 _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
4394 ;;
4395 *Sun\ F* | *Sun*Fortran*)
4396 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4397 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4398 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
43324399 ;;
43334400 *Sun\ C*)
43344401 # Sun C 5.9
43354402 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
43364403 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
43374404 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4405 ;;
4406 *Intel*\ [[CF]]*Compiler*)
4407 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4408 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4409 _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4410 ;;
4411 *Portland\ Group*)
4412 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4413 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4414 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
43384415 ;;
43394416 esac
43404417 ;;
44954572 ;;
44964573 cygwin* | mingw* | cegcc*)
44974574 case $cc_basename in
4498 cl*) ;;
4575 cl*)
4576 _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
4577 ;;
44994578 *)
45004579 _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
45014580 _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
45204599 _LT_TAGVAR(hardcode_direct, $1)=no
45214600 _LT_TAGVAR(hardcode_direct_absolute, $1)=no
45224601 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
4523 _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
45244602 _LT_TAGVAR(hardcode_libdir_separator, $1)=
45254603 _LT_TAGVAR(hardcode_minus_L, $1)=no
45264604 _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
47714849 xlf* | bgf* | bgxlf* | mpixlf*)
47724850 # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
47734851 _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
4774 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
4775 _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
4852 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
47764853 _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
47774854 if test "x$supports_anon_versioning" = xyes; then
47784855 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
50675144 # The linker will not automatically build a static lib if we build a DLL.
50685145 # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
50695146 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5147 _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
50705148 _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
50715149 # Don't use ranlib
50725150 _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
51135191 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
51145192 ;;
51155193
5116 freebsd1*)
5117 _LT_TAGVAR(ld_shlibs, $1)=no
5118 ;;
5119
51205194 # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
51215195 # support. Future versions do this automatically, but an explicit c++rt0.o
51225196 # does not break anything, and helps significantly (at the cost of a little
51295203 ;;
51305204
51315205 # Unfortunately, older versions of FreeBSD 2 do not have this feature.
5132 freebsd2*)
5206 freebsd2.*)
51335207 _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
51345208 _LT_TAGVAR(hardcode_direct, $1)=yes
51355209 _LT_TAGVAR(hardcode_minus_L, $1)=yes
51685242 fi
51695243 if test "$with_gnu_ld" = no; then
51705244 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
5171 _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
51725245 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
51735246 _LT_TAGVAR(hardcode_direct, $1)=yes
51745247 _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
56105683 _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
56115684 [Flag to hardcode $libdir into a binary during linking.
56125685 This must work even if $libdir does not exist])
5613 _LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1],
5614 [[If ld is used when linking, flag to hardcode $libdir into a binary
5615 during linking. This must work even if $libdir does not exist]])
56165686 _LT_TAGDECL([], [hardcode_libdir_separator], [1],
56175687 [Whether we need a single "-rpath" flag with a separated argument])
56185688 _LT_TAGDECL([], [hardcode_direct], [0],
57705840 _LT_TAGVAR(hardcode_direct, $1)=no
57715841 _LT_TAGVAR(hardcode_direct_absolute, $1)=no
57725842 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
5773 _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
57745843 _LT_TAGVAR(hardcode_libdir_separator, $1)=
57755844 _LT_TAGVAR(hardcode_minus_L, $1)=no
57765845 _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
61406209 esac
61416210 ;;
61426211
6143 freebsd[[12]]*)
6212 freebsd2.*)
61446213 # C++ shared libraries reported to be fairly broken before
61456214 # switch to ELF
61466215 _LT_TAGVAR(ld_shlibs, $1)=no
69016970 }
69026971 };
69036972 _LT_EOF
6973 ], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
6974 package foo
6975 func foo() {
6976 }
6977 _LT_EOF
69046978 ])
69056979
69066980 _lt_libdeps_save_CFLAGS=$CFLAGS
69076981 case "$CC $CFLAGS " in #(
69086982 *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
69096983 *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
6984 *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
69106985 esac
69116986
69126987 dnl Parse the compiler output and extract the necessary
71037178 _LT_TAGVAR(hardcode_direct, $1)=no
71047179 _LT_TAGVAR(hardcode_direct_absolute, $1)=no
71057180 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
7106 _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
71077181 _LT_TAGVAR(hardcode_libdir_separator, $1)=
71087182 _LT_TAGVAR(hardcode_minus_L, $1)=no
71097183 _LT_TAGVAR(hardcode_automatic, $1)=no
72367310 _LT_TAGVAR(hardcode_direct, $1)=no
72377311 _LT_TAGVAR(hardcode_direct_absolute, $1)=no
72387312 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
7239 _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
72407313 _LT_TAGVAR(hardcode_libdir_separator, $1)=
72417314 _LT_TAGVAR(hardcode_minus_L, $1)=no
72427315 _LT_TAGVAR(hardcode_automatic, $1)=no
74237496 ])# _LT_LANG_GCJ_CONFIG
74247497
74257498
7499 # _LT_LANG_GO_CONFIG([TAG])
7500 # --------------------------
7501 # Ensure that the configuration variables for the GNU Go compiler
7502 # are suitably defined. These variables are subsequently used by _LT_CONFIG
7503 # to write the compiler configuration to `libtool'.
7504 m4_defun([_LT_LANG_GO_CONFIG],
7505 [AC_REQUIRE([LT_PROG_GO])dnl
7506 AC_LANG_SAVE
7507
7508 # Source file extension for Go test sources.
7509 ac_ext=go
7510
7511 # Object file extension for compiled Go test sources.
7512 objext=o
7513 _LT_TAGVAR(objext, $1)=$objext
7514
7515 # Code to be used in simple compile tests
7516 lt_simple_compile_test_code="package main; func main() { }"
7517
7518 # Code to be used in simple link tests
7519 lt_simple_link_test_code='package main; func main() { }'
7520
7521 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
7522 _LT_TAG_COMPILER
7523
7524 # save warnings/boilerplate of simple test code
7525 _LT_COMPILER_BOILERPLATE
7526 _LT_LINKER_BOILERPLATE
7527
7528 # Allow CC to be a program name with arguments.
7529 lt_save_CC=$CC
7530 lt_save_CFLAGS=$CFLAGS
7531 lt_save_GCC=$GCC
7532 GCC=yes
7533 CC=${GOC-"gccgo"}
7534 CFLAGS=$GOFLAGS
7535 compiler=$CC
7536 _LT_TAGVAR(compiler, $1)=$CC
7537 _LT_TAGVAR(LD, $1)="$LD"
7538 _LT_CC_BASENAME([$compiler])
7539
7540 # Go did not exist at the time GCC didn't implicitly link libc in.
7541 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7542
7543 _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
7544 _LT_TAGVAR(reload_flag, $1)=$reload_flag
7545 _LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7546
7547 ## CAVEAT EMPTOR:
7548 ## There is no encapsulation within the following macros, do not change
7549 ## the running order or otherwise move them around unless you know exactly
7550 ## what you are doing...
7551 if test -n "$compiler"; then
7552 _LT_COMPILER_NO_RTTI($1)
7553 _LT_COMPILER_PIC($1)
7554 _LT_COMPILER_C_O($1)
7555 _LT_COMPILER_FILE_LOCKS($1)
7556 _LT_LINKER_SHLIBS($1)
7557 _LT_LINKER_HARDCODE_LIBPATH($1)
7558
7559 _LT_CONFIG($1)
7560 fi
7561
7562 AC_LANG_RESTORE
7563
7564 GCC=$lt_save_GCC
7565 CC=$lt_save_CC
7566 CFLAGS=$lt_save_CFLAGS
7567 ])# _LT_LANG_GO_CONFIG
7568
7569
74267570 # _LT_LANG_RC_CONFIG([TAG])
74277571 # -------------------------
74287572 # Ensure that the configuration variables for the Windows resource compiler
74907634 AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
74917635 dnl aclocal-1.4 backwards compatibility:
74927636 dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
7637
7638
7639 # LT_PROG_GO
7640 # ----------
7641 AC_DEFUN([LT_PROG_GO],
7642 [AC_CHECK_TOOL(GOC, gccgo,)
7643 ])
74937644
74947645
74957646 # LT_PROG_RC
325325 # MODE is either `yes' or `no'. If omitted, it defaults to `both'.
326326 m4_define([_LT_WITH_PIC],
327327 [AC_ARG_WITH([pic],
328 [AS_HELP_STRING([--with-pic],
328 [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
329329 [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
330 [pic_mode="$withval"],
330 [lt_p=${PACKAGE-default}
331 case $withval in
332 yes|no) pic_mode=$withval ;;
333 *)
334 pic_mode=default
335 # Look at the argument we got. We use all the common list separators.
336 lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
337 for lt_pkg in $withval; do
338 IFS="$lt_save_ifs"
339 if test "X$lt_pkg" = "X$lt_p"; then
340 pic_mode=yes
341 fi
342 done
343 IFS="$lt_save_ifs"
344 ;;
345 esac],
331346 [pic_mode=default])
332347
333348 test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
88
99 # @configure_input@
1010
11 # serial 3293 ltversion.m4
11 # serial 3337 ltversion.m4
1212 # This file is part of GNU Libtool
1313
14 m4_define([LT_PACKAGE_VERSION], [2.4])
15 m4_define([LT_PACKAGE_REVISION], [1.3293])
14 m4_define([LT_PACKAGE_VERSION], [2.4.2])
15 m4_define([LT_PACKAGE_REVISION], [1.3337])
1616
1717 AC_DEFUN([LTVERSION_VERSION],
18 [macro_version='2.4'
19 macro_revision='1.3293'
18 [macro_version='2.4.2'
19 macro_revision='1.3337'
2020 _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
2121 _LT_DECL(, macro_revision, 0)
2222 ])
+0
-376
missing less more
0 #! /bin/sh
1 # Common stub for a few missing GNU programs while installing.
2
3 scriptversion=2009-04-28.21; # UTC
4
5 # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
6 # 2008, 2009 Free Software Foundation, Inc.
7 # Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
8
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 2, or (at your option)
12 # any later version.
13
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
18
19 # You should have received a copy of the GNU General Public License
20 # along with this program. If not, see <http://www.gnu.org/licenses/>.
21
22 # As a special exception to the GNU General Public License, if you
23 # distribute this file as part of a program that contains a
24 # configuration script generated by Autoconf, you may include it under
25 # the same distribution terms that you use for the rest of that program.
26
27 if test $# -eq 0; then
28 echo 1>&2 "Try \`$0 --help' for more information"
29 exit 1
30 fi
31
32 run=:
33 sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
34 sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
35
36 # In the cases where this matters, `missing' is being run in the
37 # srcdir already.
38 if test -f configure.ac; then
39 configure_ac=configure.ac
40 else
41 configure_ac=configure.in
42 fi
43
44 msg="missing on your system"
45
46 case $1 in
47 --run)
48 # Try to run requested program, and just exit if it succeeds.
49 run=
50 shift
51 "$@" && exit 0
52 # Exit code 63 means version mismatch. This often happens
53 # when the user try to use an ancient version of a tool on
54 # a file that requires a minimum version. In this case we
55 # we should proceed has if the program had been absent, or
56 # if --run hadn't been passed.
57 if test $? = 63; then
58 run=:
59 msg="probably too old"
60 fi
61 ;;
62
63 -h|--h|--he|--hel|--help)
64 echo "\
65 $0 [OPTION]... PROGRAM [ARGUMENT]...
66
67 Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
68 error status if there is no known handling for PROGRAM.
69
70 Options:
71 -h, --help display this help and exit
72 -v, --version output version information and exit
73 --run try to run the given command, and emulate it if it fails
74
75 Supported PROGRAM values:
76 aclocal touch file \`aclocal.m4'
77 autoconf touch file \`configure'
78 autoheader touch file \`config.h.in'
79 autom4te touch the output file, or create a stub one
80 automake touch all \`Makefile.in' files
81 bison create \`y.tab.[ch]', if possible, from existing .[ch]
82 flex create \`lex.yy.c', if possible, from existing .c
83 help2man touch the output file
84 lex create \`lex.yy.c', if possible, from existing .c
85 makeinfo touch the output file
86 tar try tar, gnutar, gtar, then tar without non-portable flags
87 yacc create \`y.tab.[ch]', if possible, from existing .[ch]
88
89 Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
90 \`g' are ignored when checking the name.
91
92 Send bug reports to <bug-automake@gnu.org>."
93 exit $?
94 ;;
95
96 -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
97 echo "missing $scriptversion (GNU Automake)"
98 exit $?
99 ;;
100
101 -*)
102 echo 1>&2 "$0: Unknown \`$1' option"
103 echo 1>&2 "Try \`$0 --help' for more information"
104 exit 1
105 ;;
106
107 esac
108
109 # normalize program name to check for.
110 program=`echo "$1" | sed '
111 s/^gnu-//; t
112 s/^gnu//; t
113 s/^g//; t'`
114
115 # Now exit if we have it, but it failed. Also exit now if we
116 # don't have it and --version was passed (most likely to detect
117 # the program). This is about non-GNU programs, so use $1 not
118 # $program.
119 case $1 in
120 lex*|yacc*)
121 # Not GNU programs, they don't have --version.
122 ;;
123
124 tar*)
125 if test -n "$run"; then
126 echo 1>&2 "ERROR: \`tar' requires --run"
127 exit 1
128 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
129 exit 1
130 fi
131 ;;
132
133 *)
134 if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
135 # We have it, but it failed.
136 exit 1
137 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
138 # Could not run --version or --help. This is probably someone
139 # running `$TOOL --version' or `$TOOL --help' to check whether
140 # $TOOL exists and not knowing $TOOL uses missing.
141 exit 1
142 fi
143 ;;
144 esac
145
146 # If it does not exist, or fails to run (possibly an outdated version),
147 # try to emulate it.
148 case $program in
149 aclocal*)
150 echo 1>&2 "\
151 WARNING: \`$1' is $msg. You should only need it if
152 you modified \`acinclude.m4' or \`${configure_ac}'. You might want
153 to install the \`Automake' and \`Perl' packages. Grab them from
154 any GNU archive site."
155 touch aclocal.m4
156 ;;
157
158 autoconf*)
159 echo 1>&2 "\
160 WARNING: \`$1' is $msg. You should only need it if
161 you modified \`${configure_ac}'. You might want to install the
162 \`Autoconf' and \`GNU m4' packages. Grab them from any GNU
163 archive site."
164 touch configure
165 ;;
166
167 autoheader*)
168 echo 1>&2 "\
169 WARNING: \`$1' is $msg. You should only need it if
170 you modified \`acconfig.h' or \`${configure_ac}'. You might want
171 to install the \`Autoconf' and \`GNU m4' packages. Grab them
172 from any GNU archive site."
173 files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
174 test -z "$files" && files="config.h"
175 touch_files=
176 for f in $files; do
177 case $f in
178 *:*) touch_files="$touch_files "`echo "$f" |
179 sed -e 's/^[^:]*://' -e 's/:.*//'`;;
180 *) touch_files="$touch_files $f.in";;
181 esac
182 done
183 touch $touch_files
184 ;;
185
186 automake*)
187 echo 1>&2 "\
188 WARNING: \`$1' is $msg. You should only need it if
189 you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
190 You might want to install the \`Automake' and \`Perl' packages.
191 Grab them from any GNU archive site."
192 find . -type f -name Makefile.am -print |
193 sed 's/\.am$/.in/' |
194 while read f; do touch "$f"; done
195 ;;
196
197 autom4te*)
198 echo 1>&2 "\
199 WARNING: \`$1' is needed, but is $msg.
200 You might have modified some files without having the
201 proper tools for further handling them.
202 You can get \`$1' as part of \`Autoconf' from any GNU
203 archive site."
204
205 file=`echo "$*" | sed -n "$sed_output"`
206 test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
207 if test -f "$file"; then
208 touch $file
209 else
210 test -z "$file" || exec >$file
211 echo "#! /bin/sh"
212 echo "# Created by GNU Automake missing as a replacement of"
213 echo "# $ $@"
214 echo "exit 0"
215 chmod +x $file
216 exit 1
217 fi
218 ;;
219
220 bison*|yacc*)
221 echo 1>&2 "\
222 WARNING: \`$1' $msg. You should only need it if
223 you modified a \`.y' file. You may need the \`Bison' package
224 in order for those modifications to take effect. You can get
225 \`Bison' from any GNU archive site."
226 rm -f y.tab.c y.tab.h
227 if test $# -ne 1; then
228 eval LASTARG="\${$#}"
229 case $LASTARG in
230 *.y)
231 SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
232 if test -f "$SRCFILE"; then
233 cp "$SRCFILE" y.tab.c
234 fi
235 SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
236 if test -f "$SRCFILE"; then
237 cp "$SRCFILE" y.tab.h
238 fi
239 ;;
240 esac
241 fi
242 if test ! -f y.tab.h; then
243 echo >y.tab.h
244 fi
245 if test ! -f y.tab.c; then
246 echo 'main() { return 0; }' >y.tab.c
247 fi
248 ;;
249
250 lex*|flex*)
251 echo 1>&2 "\
252 WARNING: \`$1' is $msg. You should only need it if
253 you modified a \`.l' file. You may need the \`Flex' package
254 in order for those modifications to take effect. You can get
255 \`Flex' from any GNU archive site."
256 rm -f lex.yy.c
257 if test $# -ne 1; then
258 eval LASTARG="\${$#}"
259 case $LASTARG in
260 *.l)
261 SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
262 if test -f "$SRCFILE"; then
263 cp "$SRCFILE" lex.yy.c
264 fi
265 ;;
266 esac
267 fi
268 if test ! -f lex.yy.c; then
269 echo 'main() { return 0; }' >lex.yy.c
270 fi
271 ;;
272
273 help2man*)
274 echo 1>&2 "\
275 WARNING: \`$1' is $msg. You should only need it if
276 you modified a dependency of a manual page. You may need the
277 \`Help2man' package in order for those modifications to take
278 effect. You can get \`Help2man' from any GNU archive site."
279
280 file=`echo "$*" | sed -n "$sed_output"`
281 test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
282 if test -f "$file"; then
283 touch $file
284 else
285 test -z "$file" || exec >$file
286 echo ".ab help2man is required to generate this page"
287 exit $?
288 fi
289 ;;
290
291 makeinfo*)
292 echo 1>&2 "\
293 WARNING: \`$1' is $msg. You should only need it if
294 you modified a \`.texi' or \`.texinfo' file, or any other file
295 indirectly affecting the aspect of the manual. The spurious
296 call might also be the consequence of using a buggy \`make' (AIX,
297 DU, IRIX). You might want to install the \`Texinfo' package or
298 the \`GNU make' package. Grab either from any GNU archive site."
299 # The file to touch is that specified with -o ...
300 file=`echo "$*" | sed -n "$sed_output"`
301 test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
302 if test -z "$file"; then
303 # ... or it is the one specified with @setfilename ...
304 infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
305 file=`sed -n '
306 /^@setfilename/{
307 s/.* \([^ ]*\) *$/\1/
308 p
309 q
310 }' $infile`
311 # ... or it is derived from the source name (dir/f.texi becomes f.info)
312 test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
313 fi
314 # If the file does not exist, the user really needs makeinfo;
315 # let's fail without touching anything.
316 test -f $file || exit 1
317 touch $file
318 ;;
319
320 tar*)
321 shift
322
323 # We have already tried tar in the generic part.
324 # Look for gnutar/gtar before invocation to avoid ugly error
325 # messages.
326 if (gnutar --version > /dev/null 2>&1); then
327 gnutar "$@" && exit 0
328 fi
329 if (gtar --version > /dev/null 2>&1); then
330 gtar "$@" && exit 0
331 fi
332 firstarg="$1"
333 if shift; then
334 case $firstarg in
335 *o*)
336 firstarg=`echo "$firstarg" | sed s/o//`
337 tar "$firstarg" "$@" && exit 0
338 ;;
339 esac
340 case $firstarg in
341 *h*)
342 firstarg=`echo "$firstarg" | sed s/h//`
343 tar "$firstarg" "$@" && exit 0
344 ;;
345 esac
346 fi
347
348 echo 1>&2 "\
349 WARNING: I can't seem to be able to run \`tar' with the given arguments.
350 You may want to install GNU tar or Free paxutils, or check the
351 command line arguments."
352 exit 1
353 ;;
354
355 *)
356 echo 1>&2 "\
357 WARNING: \`$1' is needed, and is $msg.
358 You might have modified some files without having the
359 proper tools for further handling them. Check the \`README' file,
360 it often tells you about the needed prerequisites for installing
361 this package. You may also peek at any GNU archive site, in case
362 some other package would contain this missing \`$1' program."
363 exit 1
364 ;;
365 esac
366
367 exit 0
368
369 # Local variables:
370 # eval: (add-hook 'write-file-hooks 'time-stamp)
371 # time-stamp-start: "scriptversion="
372 # time-stamp-format: "%:y-%02m-%02d.%02H"
373 # time-stamp-time-zone: "UTC"
374 # time-stamp-end: "; # UTC"
375 # End:
1616 # <http://www.gnu.org/licenses/>.
1717
1818 CC = @CC_FOR_BUILD@
19 CFLAGS = @BUILD_CFLAGS@
20 LDFLAGS = @BUILD_LDFLAGS@
19 AM_CFLAGS = @BUILD_CFLAGS@
20 AM_LDFLAGS = @BUILD_LDFLAGS@
2121
2222 noinst_PROGRAMS = \
2323 strpool
2424
2525 strpool_SOURCES = \
2626 ../strpool.c
27
0 # Makefile.in generated by automake 1.11.1 from Makefile.am.
0 # Makefile.in generated by automake 1.11.3 from Makefile.am.
11 # @configure_input@
22
33 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
4 # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
5 # Inc.
4 # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
5 # Foundation, Inc.
66 # This Makefile.in is free software; the Free Software Foundation
77 # gives unlimited permission to copy and/or distribute it,
88 # with or without modifications, as long as this notice is preserved.
7070 am_strpool_OBJECTS = strpool.$(OBJEXT)
7171 strpool_OBJECTS = $(am_strpool_OBJECTS)
7272 strpool_LDADD = $(LDADD)
73 AM_V_lt = $(am__v_lt_$(V))
74 am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
73 AM_V_lt = $(am__v_lt_@AM_V@)
74 am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
7575 am__v_lt_0 = --silent
7676 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
77 depcomp = $(SHELL) $(top_srcdir)/depcomp
77 depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
7878 am__depfiles_maybe = depfiles
7979 am__mv = mv -f
8080 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
8383 $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
8484 $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
8585 $(AM_CFLAGS) $(CFLAGS)
86 AM_V_CC = $(am__v_CC_$(V))
87 am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
86 AM_V_CC = $(am__v_CC_@AM_V@)
87 am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
8888 am__v_CC_0 = @echo " CC " $@;
89 AM_V_at = $(am__v_at_$(V))
90 am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
89 AM_V_at = $(am__v_at_@AM_V@)
90 am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
9191 am__v_at_0 = @
9292 CCLD = $(CC)
9393 LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
9494 $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
9595 $(AM_LDFLAGS) $(LDFLAGS) -o $@
96 AM_V_CCLD = $(am__v_CCLD_$(V))
97 am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
96 AM_V_CCLD = $(am__v_CCLD_@AM_V@)
97 am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
9898 am__v_CCLD_0 = @echo " CCLD " $@;
99 AM_V_GEN = $(am__v_GEN_$(V))
100 am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
99 AM_V_GEN = $(am__v_GEN_@AM_V@)
100 am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
101101 am__v_GEN_0 = @echo " GEN " $@;
102102 SOURCES = $(strpool_SOURCES)
103103 DIST_SOURCES = $(strpool_SOURCES)
117117 CC = @CC_FOR_BUILD@
118118 CCDEPMODE = @CCDEPMODE@
119119 CC_FOR_BUILD = @CC_FOR_BUILD@
120 CFLAGS = @BUILD_CFLAGS@
120 CFLAGS = @CFLAGS@
121121 CPP = @CPP@
122122 CPPFLAGS = @CPPFLAGS@
123123 CYGPATH_W = @CYGPATH_W@
133133 EXEEXT = @EXEEXT@
134134 EXEEXT_FOR_BUILD = @EXEEXT_FOR_BUILD@
135135 FGREP = @FGREP@
136 GCLDFLAGS = @GCLDFLAGS@
136137 GREP = @GREP@
137138 INSTALL = @INSTALL@
138139 INSTALL_DATA = @INSTALL_DATA@
140141 INSTALL_SCRIPT = @INSTALL_SCRIPT@
141142 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
142143 LD = @LD@
143 LDFLAGS = @BUILD_LDFLAGS@
144 LDFLAGS = @LDFLAGS@
144145 LIBATASMART_VERSION_INFO = @LIBATASMART_VERSION_INFO@
145146 LIBOBJS = @LIBOBJS@
146147 LIBS = @LIBS@
176177 SHELL = @SHELL@
177178 STRIP = @STRIP@
178179 VERSION = @VERSION@
180 WARNINGFLAGS = @WARNINGFLAGS@
179181 abs_builddir = @abs_builddir@
180182 abs_srcdir = @abs_srcdir@
181183 abs_top_builddir = @abs_top_builddir@
228230 top_build_prefix = @top_build_prefix@
229231 top_builddir = @top_builddir@
230232 top_srcdir = @top_srcdir@
233 AM_CFLAGS = @BUILD_CFLAGS@
234 AM_LDFLAGS = @BUILD_LDFLAGS@
231235 strpool_SOURCES = \
232236 ../strpool.c
233237
274278 list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
275279 echo " rm -f" $$list; \
276280 rm -f $$list
277 strpool$(EXEEXT): $(strpool_OBJECTS) $(strpool_DEPENDENCIES)
281 strpool$(EXEEXT): $(strpool_OBJECTS) $(strpool_DEPENDENCIES) $(EXTRA_strpool_DEPENDENCIES)
278282 @rm -f strpool$(EXEEXT)
279283 $(AM_V_CCLD)$(LINK) $(strpool_OBJECTS) $(strpool_LDADD) $(LIBS)
280284
289293 .c.o:
290294 @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
291295 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
292 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
293 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
296 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
294297 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
295 @am__fastdepCC_FALSE@ $(COMPILE) -c $<
298 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $<
296299
297300 .c.obj:
298301 @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
299302 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
300 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
301 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
303 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
302304 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
303 @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
305 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
304306
305307 .c.lo:
306308 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
307309 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
308 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
309 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
310 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
310311 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
311 @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
312 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
312313
313314 strpool.o: ../strpool.c
314315 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strpool.o -MD -MP -MF $(DEPDIR)/strpool.Tpo -c -o strpool.o `test -f '../strpool.c' || echo '$(srcdir)/'`../strpool.c
315316 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strpool.Tpo $(DEPDIR)/strpool.Po
316 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
317 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../strpool.c' object='strpool.o' libtool=no @AMDEPBACKSLASH@
317 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../strpool.c' object='strpool.o' libtool=no @AMDEPBACKSLASH@
318318 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
319 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strpool.o `test -f '../strpool.c' || echo '$(srcdir)/'`../strpool.c
319 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strpool.o `test -f '../strpool.c' || echo '$(srcdir)/'`../strpool.c
320320
321321 strpool.obj: ../strpool.c
322322 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strpool.obj -MD -MP -MF $(DEPDIR)/strpool.Tpo -c -o strpool.obj `if test -f '../strpool.c'; then $(CYGPATH_W) '../strpool.c'; else $(CYGPATH_W) '$(srcdir)/../strpool.c'; fi`
323323 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strpool.Tpo $(DEPDIR)/strpool.Po
324 @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
325 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../strpool.c' object='strpool.obj' libtool=no @AMDEPBACKSLASH@
324 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../strpool.c' object='strpool.obj' libtool=no @AMDEPBACKSLASH@
326325 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
327 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strpool.obj `if test -f '../strpool.c'; then $(CYGPATH_W) '../strpool.c'; else $(CYGPATH_W) '$(srcdir)/../strpool.c'; fi`
326 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strpool.obj `if test -f '../strpool.c'; then $(CYGPATH_W) '../strpool.c'; else $(CYGPATH_W) '$(srcdir)/../strpool.c'; fi`
328327
329328 mostlyclean-libtool:
330329 -rm -f *.lo
428427
429428 installcheck: installcheck-am
430429 install-strip:
431 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
432 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
433 `test -z '$(STRIP)' || \
434 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
430 if test -z '$(STRIP)'; then \
431 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
432 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
433 install; \
434 else \
435 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
436 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
437 "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
438 fi
435439 mostlyclean-generic:
436440
437441 clean-generic: