install-data-local: gdb.py
@$(mkdir_p) $(DESTDIR)$(toolexeclibdir)
## We want to install gdb.py as SOMETHING-gdb.py. SOMETHING is the
-## full name of the final library. We want to ignore symlinks, the
-## .la file, and any previous -gdb.py file. This is inherently
-## fragile, but there does not seem to be a better option, because
-## libtool hides the real names from us.
- @here=`pwd`; cd $(DESTDIR)$(toolexeclibdir); \
- for file in libstdc++.*; do \
- case $$file in \
- *-gdb.py) ;; \
- *.la) ;; \
- *) if test -h $$file; then \
- continue; \
- fi; \
- libname=$$file;; \
- esac; \
- done; \
- cd $$here; \
+## full name of the final library. We use the libtool .la file to get
+## the correct name.
+ @libname=`sed -ne "/^library_names=/{s/.*='//;s/'$$//;s/ .*//;p;}" \
+ $(DESTDIR)$(toolexeclibdir)/libstdc++.la`; \
echo " $(INSTALL_DATA) gdb.py $(DESTDIR)$(toolexeclibdir)/$$libname-gdb.py"; \
$(INSTALL_DATA) gdb.py $(DESTDIR)$(toolexeclibdir)/$$libname-gdb.py
install-data-local: gdb.py
@$(mkdir_p) $(DESTDIR)$(toolexeclibdir)
- @here=`pwd`; cd $(DESTDIR)$(toolexeclibdir); \
- for file in libstdc++.*; do \
- case $$file in \
- *-gdb.py) ;; \
- *.la) ;; \
- *) if test -h $$file; then \
- continue; \
- fi; \
- libname=$$file;; \
- esac; \
- done; \
- cd $$here; \
+ @libname=`sed -ne "/^library_names=/{s/.*='//;s/'$$//;s/ .*//;p;}" \
+ $(DESTDIR)$(toolexeclibdir)/libstdc++.la`; \
echo " $(INSTALL_DATA) gdb.py $(DESTDIR)$(toolexeclibdir)/$$libname-gdb.py"; \
$(INSTALL_DATA) gdb.py $(DESTDIR)$(toolexeclibdir)/$$libname-gdb.py