[csw-devel] SF.net SVN: gar:[17876] csw/mgar/pkg/libtool/trunk/Makefile

dmichelsen at users.sourceforge.net dmichelsen at users.sourceforge.net
Thu Apr 26 13:31:48 CEST 2012


Revision: 17876
          http://gar.svn.sourceforge.net/gar/?rev=17876&view=rev
Author:   dmichelsen
Date:     2012-04-26 11:31:48 +0000 (Thu, 26 Apr 2012)
Log Message:
-----------
libtool/trunk: Allow overriding of LTCFLAGS, inherit from CFLAGS otherwise

Modified Paths:
--------------
    csw/mgar/pkg/libtool/trunk/Makefile

Modified: csw/mgar/pkg/libtool/trunk/Makefile
===================================================================
--- csw/mgar/pkg/libtool/trunk/Makefile	2012-04-26 09:25:32 UTC (rev 17875)
+++ csw/mgar/pkg/libtool/trunk/Makefile	2012-04-26 11:31:48 UTC (rev 17876)
@@ -86,19 +86,27 @@
 post-install-modulated: $(if $(COMPILER_TAGNAME_$(GARCOMPILER)),install-libtool-$(COMPILER_TAGNAME_$(GARCOMPILER)))
 	ginstall -d $(DESTDIR)$(docdir)/libtool
 	ginstall $(WORKDIR)/README.CSW $(DESTDIR)$(docdir)/libtool/README.CSW
+	@$(MAKECOOKIE)
 
 patch-libtool:
-	cat $(WORKDIR)/$(PATCHFILES_POSTINSTALL_$(MODULATION)) | (cd $(DESTDIR)$(bindir) && gpatch -p1)
+	-cat $(WORKDIR)/$(PATCHFILES_POSTINSTALL_$(MODULATION)) | (cd $(DESTDIR)$(bindir) && gpatch --forward -p1)
 	# Remove arch-specific flags from the libtool-compilation so they don't spoil the target build
-	perl -pi -e 's/^LTCFLAGS=.*/LTCFLAGS="-O"/' $(DESTDIR)$(bindir)/libtool
-	@$(MAKECOOKIE)
+	# Instead we inherit from CFLAGS as removing the arch specified leads to the default arch which
+	# may very well be wrong (especially on sparc default is v8+ instead of the requested default v8
+	# thus resulting in a different binary being generated).
+	perl -pi -e 's/^LTCFLAGS=.*/if [ -z "\$$LTCFLAGS" ]; then \
+  if [ -z "\$$CFLAGS" ]; then \
+    LTCFLAGS="-O" \
+  else \
+    LTCFLAGS="\$$CFLAGS" \
+  fi \
+fi/' $(DESTDIR)$(bindir)/libtool
 
 install-libtool-%:
 	perl -ane 'print if( /^available_tags/ ); $$p = 1 if( /^# ### BEGIN LIBTOOL CONFIG/ ); print if( $$p ); $$p = 0 if( /^# ### END LIBTOOL CONFIG/ )' \
 		<$(DESTDIR)$(bindir)/libtool >$(DESTDIR)$(datadir)/libtool/$*.conf
 	perl -ane '$$p = 1 if( /^# ### BEGIN LIBTOOL TAG CONFIG/ ); print if( $$p ); if( /^# ### END LIBTOOL TAG CONFIG/ ) { $$p = 0; print "\n"; }' \
 		<$(DESTDIR)$(bindir)/libtool >$(DESTDIR)$(datadir)/libtool/$*.tags
-	@$(MAKECOOKIE)
 
 merge-copy-tags: $(PKGROOT)
 	$(_DBG_MERGE)(cd $(INSTALLISADIR); pax -r -w -v $(_PAX_ARGS) \

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the devel mailing list