diff --git a/accessible/public/nsIAccessibleEvent.idl b/accessible/public/nsIAccessibleEvent.idl index 853e659057e..41019646c73 100644 --- a/accessible/public/nsIAccessibleEvent.idl +++ b/accessible/public/nsIAccessibleEvent.idl @@ -571,3 +571,26 @@ interface nsIAccessibleTableChangeEvent: nsISupports readonly attribute long numRowsOrCols; }; + +/* + * An interface for virtual cursor changed events. + * Passes previous cursor position and text offsets. + */ +[scriptable, uuid(370e8b9b-2bbc-4bff-a9c7-16ddc54aea21)] +interface nsIAccessibleVirtualCursorChangeEvent : nsISupports +{ + /** + * Previous object pointed at by virtual cursor. null if none. + */ + readonly attribute nsIAccessible oldAccessible; + + /** + * Previous start offset of pivot. -1 if none. + */ + readonly attribute long oldStartOffset; + + /** + * Previous end offset of pivot. -1 if none. + */ + readonly attribute long oldEndOffset; +}; diff --git a/accessible/src/base/AccEvent.cpp b/accessible/src/base/AccEvent.cpp index bf2e812ebd5..942c5f1cebe 100644 --- a/accessible/src/base/AccEvent.cpp +++ b/accessible/src/base/AccEvent.cpp @@ -380,3 +380,24 @@ AccTableChangeEvent::CreateXPCOMObject() return event; } + +//////////////////////////////////////////////////////////////////////////////// +// AccVCChangeEvent +//////////////////////////////////////////////////////////////////////////////// + +AccVCChangeEvent:: + AccVCChangeEvent(nsAccessible* aAccessible, + nsIAccessible* aOldAccessible, + PRInt32 aOldStart, PRInt32 aOldEnd) : + AccEvent(::nsIAccessibleEvent::EVENT_VIRTUALCURSOR_CHANGED, aAccessible), + mOldAccessible(aOldAccessible), mOldStart(aOldStart), mOldEnd(aOldEnd) +{ +} + +already_AddRefed +AccVCChangeEvent::CreateXPCOMObject() +{ + nsAccEvent* event = new nsAccVirtualCursorChangeEvent(this); + NS_ADDREF(event); + return event; +} diff --git a/accessible/src/base/AccEvent.h b/accessible/src/base/AccEvent.h index 3dc39ee1d75..19cc2ed59be 100644 --- a/accessible/src/base/AccEvent.h +++ b/accessible/src/base/AccEvent.h @@ -129,7 +129,8 @@ public: eShowEvent, eCaretMoveEvent, eSelectionChangeEvent, - eTableChangeEvent + eTableChangeEvent, + eVirtualCursorChangeEvent }; static const EventGroup kEventGroup = eGenericEvent; @@ -399,6 +400,37 @@ private: PRUint32 mNumRowsOrCols; // the number of inserted/deleted rows/columns }; +/** + * Accessible virtual cursor change event. + */ +class AccVCChangeEvent : public AccEvent +{ +public: + AccVCChangeEvent(nsAccessible* aAccessible, + nsIAccessible* aOldAccessible, + PRInt32 aOldStart, PRInt32 aOldEnd); + + virtual ~AccVCChangeEvent() { } + + // AccEvent + virtual already_AddRefed CreateXPCOMObject(); + + static const EventGroup kEventGroup = eVirtualCursorChangeEvent; + virtual unsigned int GetEventGroups() const + { + return AccEvent::GetEventGroups() | (1U << eVirtualCursorChangeEvent); + } + + // AccTableChangeEvent + nsIAccessible* OldAccessible() const { return mOldAccessible; } + PRInt32 OldStartOffset() const { return mOldStart; } + PRInt32 OldEndOffset() const { return mOldEnd; } + +private: + nsRefPtr mOldAccessible; + PRInt32 mOldStart; + PRInt32 mOldEnd; +}; /** * Downcast the generic accessible event object to derived type. diff --git a/accessible/src/base/Makefile.in b/accessible/src/base/Makefile.in index 9dc49eb3091..7fd861756c4 100644 --- a/accessible/src/base/Makefile.in +++ b/accessible/src/base/Makefile.in @@ -75,8 +75,8 @@ CPPSRCS = \ nsCaretAccessible.cpp \ nsTextAccessible.cpp \ nsTextEquivUtils.cpp \ - nsTextAttrs.cpp \ StyleInfo.cpp \ + TextAttrs.cpp \ TextUpdater.cpp \ $(NULL) diff --git a/accessible/src/base/StyleInfo.cpp b/accessible/src/base/StyleInfo.cpp index 4bd503ddcfe..c3f4c1cf8d4 100644 --- a/accessible/src/base/StyleInfo.cpp +++ b/accessible/src/base/StyleInfo.cpp @@ -131,3 +131,12 @@ StyleInfo::FormatFontStyle(const nscoord& aValue, nsAString& aFormattedValue) nsCSSProps::ValueToKeywordEnum(aValue, nsCSSProps::kFontStyleKTable); AppendUTF8toUTF16(nsCSSKeywords::GetStringValue(keyword), aFormattedValue); } + +void +StyleInfo::FormatTextDecorationStyle(PRUint8 aValue, nsAString& aFormattedValue) +{ + nsCSSKeyword keyword = + nsCSSProps::ValueToKeywordEnum(aValue, + nsCSSProps::kTextDecorationStyleKTable); + AppendUTF8toUTF16(nsCSSKeywords::GetStringValue(keyword), aFormattedValue); +} diff --git a/accessible/src/base/StyleInfo.h b/accessible/src/base/StyleInfo.h index b77cd048557..3e44d5754d4 100644 --- a/accessible/src/base/StyleInfo.h +++ b/accessible/src/base/StyleInfo.h @@ -62,6 +62,7 @@ public: static void FormatColor(const nscolor& aValue, nsString& aFormattedValue); static void FormatFontStyle(const nscoord& aValue, nsAString& aFormattedValue); + static void FormatTextDecorationStyle(PRUint8 aValue, nsAString& aFormattedValue); private: StyleInfo() MOZ_DELETE; diff --git a/accessible/src/base/nsTextAttrs.cpp b/accessible/src/base/TextAttrs.cpp similarity index 59% rename from accessible/src/base/nsTextAttrs.cpp rename to accessible/src/base/TextAttrs.cpp index 9dd2085791c..bf22eca74a7 100644 --- a/accessible/src/base/nsTextAttrs.cpp +++ b/accessible/src/base/TextAttrs.cpp @@ -36,7 +36,7 @@ * * ***** END LICENSE BLOCK ***** */ -#include "nsTextAttrs.h" +#include "TextAttrs.h" #include "nsAccUtils.h" #include "nsCoreUtils.h" @@ -73,28 +73,18 @@ const char* const kCopyValue = nsnull; static nsCSSTextAttrMapItem gCSSTextAttrsMap[] = { - // CSS name CSS value Attribute name Attribute value - { "text-decoration", "line-through", &nsGkAtoms::textLineThroughStyle, "solid" }, - { "text-decoration", "underline", &nsGkAtoms::textUnderlineStyle, "solid" }, + // CSS name CSS value Attribute name Attribute value { "vertical-align", kAnyValue, &nsGkAtoms::textPosition, kCopyValue } }; //////////////////////////////////////////////////////////////////////////////// -// nsTextAttrs +// TextAttrsMgr +//////////////////////////////////////////////////////////////////////////////// -nsTextAttrsMgr::nsTextAttrsMgr(nsHyperTextAccessible *aHyperTextAcc, - bool aIncludeDefAttrs, - nsAccessible *aOffsetAcc, - PRInt32 aOffsetAccIdx) : - mHyperTextAcc(aHyperTextAcc), mIncludeDefAttrs(aIncludeDefAttrs), - mOffsetAcc(aOffsetAcc), mOffsetAccIdx(aOffsetAccIdx) -{ -} - -nsresult -nsTextAttrsMgr::GetAttributes(nsIPersistentProperties *aAttributes, - PRInt32 *aStartHTOffset, - PRInt32 *aEndHTOffset) +void +TextAttrsMgr::GetAttributes(nsIPersistentProperties* aAttributes, + PRInt32* aStartHTOffset, + PRInt32* aEndHTOffset) { // 1. Hyper text accessible must be specified always. // 2. Offset accessible and result hyper text offsets must be specified in @@ -108,7 +98,7 @@ nsTextAttrsMgr::GetAttributes(nsIPersistentProperties *aAttributes, (!mOffsetAcc && mOffsetAccIdx == -1 && !aStartHTOffset && !aEndHTOffset && mIncludeDefAttrs && aAttributes)), - "Wrong usage of nsTextAttrsMgr!"); + "Wrong usage of TextAttrsMgr!"); // Embedded objects are combined into own range with empty attributes set. if (mOffsetAcc && nsAccUtils::IsEmbeddedObject(mOffsetAcc)) { @@ -130,7 +120,7 @@ nsTextAttrsMgr::GetAttributes(nsIPersistentProperties *aAttributes, (*aEndHTOffset)++; } - return NS_OK; + return; } // Get the content and frame of the accessible. In the case of document @@ -139,7 +129,7 @@ nsTextAttrsMgr::GetAttributes(nsIPersistentProperties *aAttributes, nsIFrame *rootFrame = mHyperTextAcc->GetFrame(); NS_ASSERTION(rootFrame, "No frame for accessible!"); if (!rootFrame) - return NS_OK; + return; nsIContent *offsetNode = nsnull, *offsetElm = nsnull; nsIFrame *frame = nsnull; @@ -149,26 +139,18 @@ nsTextAttrsMgr::GetAttributes(nsIPersistentProperties *aAttributes, frame = offsetElm->GetPrimaryFrame(); } - nsTArray textAttrArray(10); + nsTArray textAttrArray(9); // "language" text attribute - nsLangTextAttr langTextAttr(mHyperTextAcc, hyperTextElm, offsetNode); + LangTextAttr langTextAttr(mHyperTextAcc, hyperTextElm, offsetNode); textAttrArray.AppendElement(&langTextAttr); - // "text-line-through-style" text attribute - nsCSSTextAttr lineThroughTextAttr(0, hyperTextElm, offsetElm); - textAttrArray.AppendElement(&lineThroughTextAttr); - - // "text-underline-style" text attribute - nsCSSTextAttr underlineTextAttr(1, hyperTextElm, offsetElm); - textAttrArray.AppendElement(&underlineTextAttr); - // "text-position" text attribute - nsCSSTextAttr posTextAttr(2, hyperTextElm, offsetElm); + CSSTextAttr posTextAttr(0, hyperTextElm, offsetElm); textAttrArray.AppendElement(&posTextAttr); // "background-color" text attribute - nsBGColorTextAttr bgColorTextAttr(rootFrame, frame); + BGColorTextAttr bgColorTextAttr(rootFrame, frame); textAttrArray.AppendElement(&bgColorTextAttr); // "color" text attribute @@ -180,7 +162,7 @@ nsTextAttrsMgr::GetAttributes(nsIPersistentProperties *aAttributes, textAttrArray.AppendElement(&fontFamilyTextAttr); // "font-size" text attribute - nsFontSizeTextAttr fontSizeTextAttr(rootFrame, frame); + FontSizeTextAttr fontSizeTextAttr(rootFrame, frame); textAttrArray.AppendElement(&fontSizeTextAttr); // "font-style" text attribute @@ -188,34 +170,28 @@ nsTextAttrsMgr::GetAttributes(nsIPersistentProperties *aAttributes, textAttrArray.AppendElement(&fontStyleTextAttr); // "font-weight" text attribute - nsFontWeightTextAttr fontWeightTextAttr(rootFrame, frame); + FontWeightTextAttr fontWeightTextAttr(rootFrame, frame); textAttrArray.AppendElement(&fontWeightTextAttr); + // "text-underline(line-through)-style(color)" text attributes + TextDecorTextAttr textDecorTextAttr(rootFrame, frame); + textAttrArray.AppendElement(&textDecorTextAttr); + // Expose text attributes if applicable. if (aAttributes) { PRUint32 len = textAttrArray.Length(); - for (PRUint32 idx = 0; idx < len; idx++) { - nsITextAttr *textAttr = textAttrArray[idx]; - - nsAutoString value; - if (textAttr->GetValue(value, mIncludeDefAttrs)) - nsAccUtils::SetAccAttr(aAttributes, textAttr->GetName(), value); - } + for (PRUint32 idx = 0; idx < len; idx++) + textAttrArray[idx]->Expose(aAttributes, mIncludeDefAttrs); } - nsresult rv = NS_OK; - // Expose text attributes range where they are applied if applicable. if (mOffsetAcc) - rv = GetRange(textAttrArray, aStartHTOffset, aEndHTOffset); - - textAttrArray.Clear(); - return rv; + GetRange(textAttrArray, aStartHTOffset, aEndHTOffset); } -nsresult -nsTextAttrsMgr::GetRange(const nsTArray& aTextAttrArray, - PRInt32 *aStartHTOffset, PRInt32 *aEndHTOffset) +void +TextAttrsMgr::GetRange(const nsTArray& aTextAttrArray, + PRInt32* aStartHTOffset, PRInt32* aEndHTOffset) { PRUint32 attrLen = aTextAttrArray.Length(); @@ -228,12 +204,13 @@ nsTextAttrsMgr::GetRange(const nsTArray& aTextAttrArray, if (nsAccUtils::IsEmbeddedObject(currAcc)) break; - nsIContent *currElm = nsCoreUtils::GetDOMElementFor(currAcc->GetContent()); - NS_ENSURE_STATE(currElm); + nsIContent* currElm = nsCoreUtils::GetDOMElementFor(currAcc->GetContent()); + if (!currElm) + return; bool offsetFound = false; for (PRUint32 attrIdx = 0; attrIdx < attrLen; attrIdx++) { - nsITextAttr *textAttr = aTextAttrArray[attrIdx]; + TextAttr* textAttr = aTextAttrArray[attrIdx]; if (!textAttr->Equal(currElm)) { offsetFound = true; break; @@ -253,12 +230,13 @@ nsTextAttrsMgr::GetRange(const nsTArray& aTextAttrArray, if (nsAccUtils::IsEmbeddedObject(currAcc)) break; - nsIContent *currElm = nsCoreUtils::GetDOMElementFor(currAcc->GetContent()); - NS_ENSURE_STATE(currElm); + nsIContent* currElm = nsCoreUtils::GetDOMElementFor(currAcc->GetContent()); + if (!currElm) + return; bool offsetFound = false; for (PRUint32 attrIdx = 0; attrIdx < attrLen; attrIdx++) { - nsITextAttr *textAttr = aTextAttrArray[attrIdx]; + TextAttr* textAttr = aTextAttrArray[attrIdx]; // Alter the end offset when text attribute changes its value and stop // the search. @@ -273,69 +251,68 @@ nsTextAttrsMgr::GetRange(const nsTArray& aTextAttrArray, (*aEndHTOffset) += nsAccUtils::TextLength(currAcc); } - - return NS_OK; } -//////////////////////////////////////////////////////////////////////////////// -// nsLangTextAttr -nsLangTextAttr::nsLangTextAttr(nsHyperTextAccessible *aRootAcc, - nsIContent *aRootContent, nsIContent *aContent) : - nsTextAttr(aContent == nsnull), mRootContent(aRootContent) +//////////////////////////////////////////////////////////////////////////////// +// LangTextAttr +//////////////////////////////////////////////////////////////////////////////// + +TextAttrsMgr::LangTextAttr:: + LangTextAttr(nsHyperTextAccessible* aRoot, + nsIContent* aRootElm, nsIContent* aElm) : + TTextAttr(!aElm), mRootContent(aRootElm) { - aRootAcc->Language(mRootNativeValue); + aRoot->Language(mRootNativeValue); mIsRootDefined = !mRootNativeValue.IsEmpty(); - if (aContent) - mIsDefined = GetLang(aContent, mNativeValue); + if (aElm) + mIsDefined = GetLang(aElm, mNativeValue); } bool -nsLangTextAttr::GetValueFor(nsIContent *aElm, nsAutoString *aValue) +TextAttrsMgr::LangTextAttr:: + GetValueFor(nsIContent* aElm, nsString* aValue) { return GetLang(aElm, *aValue); } void -nsLangTextAttr::Format(const nsAutoString& aValue, nsAString& aFormattedValue) +TextAttrsMgr::LangTextAttr:: + ExposeValue(nsIPersistentProperties* aAttributes, const nsString& aValue) { - aFormattedValue = aValue; + nsAccUtils::SetAccAttr(aAttributes, nsGkAtoms::language, aValue); } bool -nsLangTextAttr::GetLang(nsIContent *aContent, nsAString& aLang) +TextAttrsMgr::LangTextAttr:: + GetLang(nsIContent* aElm, nsAString& aLang) { - nsCoreUtils::GetLanguageFor(aContent, mRootContent, aLang); + nsCoreUtils::GetLanguageFor(aElm, mRootContent, aLang); return !aLang.IsEmpty(); } //////////////////////////////////////////////////////////////////////////////// -// nsCSSTextAttr +// CSSTextAttr //////////////////////////////////////////////////////////////////////////////// -nsCSSTextAttr::nsCSSTextAttr(PRUint32 aIndex, nsIContent *aRootContent, - nsIContent *aContent) : - nsTextAttr(aContent == nsnull), mIndex(aIndex) +TextAttrsMgr::CSSTextAttr:: + CSSTextAttr(PRUint32 aIndex, nsIContent* aRootElm, nsIContent* aElm) : + TTextAttr(!aElm), mIndex(aIndex) { - mIsRootDefined = GetValueFor(aRootContent, &mRootNativeValue); + mIsRootDefined = GetValueFor(aRootElm, &mRootNativeValue); - if (aContent) - mIsDefined = GetValueFor(aContent, &mNativeValue); -} - -nsIAtom* -nsCSSTextAttr::GetName() const -{ - return *gCSSTextAttrsMap[mIndex].mAttrName; + if (aElm) + mIsDefined = GetValueFor(aElm, &mNativeValue); } bool -nsCSSTextAttr::GetValueFor(nsIContent *aContent, nsAutoString *aValue) +TextAttrsMgr::CSSTextAttr:: + GetValueFor(nsIContent* aElm, nsString* aValue) { nsCOMPtr currStyleDecl = - nsCoreUtils::GetComputedStyleDeclaration(EmptyString(), aContent); + nsCoreUtils::GetComputedStyleDeclaration(EmptyString(), aElm); if (!currStyleDecl) return false; @@ -353,22 +330,30 @@ nsCSSTextAttr::GetValueFor(nsIContent *aContent, nsAutoString *aValue) } void -nsCSSTextAttr::Format(const nsAutoString& aValue, nsAString& aFormattedValue) +TextAttrsMgr::CSSTextAttr:: + ExposeValue(nsIPersistentProperties* aAttributes, const nsString& aValue) { - const char *attrValue = gCSSTextAttrsMap[mIndex].mAttrValue; - if (attrValue != kCopyValue) - AppendASCIItoUTF16(attrValue, aFormattedValue); - else - aFormattedValue = aValue; + const char* attrValue = gCSSTextAttrsMap[mIndex].mAttrValue; + if (attrValue != kCopyValue) { + nsAutoString formattedValue; + AppendASCIItoUTF16(attrValue, formattedValue); + nsAccUtils::SetAccAttr(aAttributes, *gCSSTextAttrsMap[mIndex].mAttrName, + formattedValue); + return; + } + + nsAccUtils::SetAccAttr(aAttributes, *gCSSTextAttrsMap[mIndex].mAttrName, + aValue); } //////////////////////////////////////////////////////////////////////////////// -// nsBGColorTextAttr +// BGColorTextAttr //////////////////////////////////////////////////////////////////////////////// -nsBGColorTextAttr::nsBGColorTextAttr(nsIFrame *aRootFrame, nsIFrame *aFrame) : - nsTextAttr(aFrame == nsnull), mRootFrame(aRootFrame) +TextAttrsMgr::BGColorTextAttr:: + BGColorTextAttr(nsIFrame* aRootFrame, nsIFrame* aFrame) : + TTextAttr(!aFrame), mRootFrame(aRootFrame) { mIsRootDefined = GetColor(mRootFrame, &mRootNativeValue); if (aFrame) @@ -376,27 +361,28 @@ nsBGColorTextAttr::nsBGColorTextAttr(nsIFrame *aRootFrame, nsIFrame *aFrame) : } bool -nsBGColorTextAttr::GetValueFor(nsIContent *aContent, nscolor *aValue) +TextAttrsMgr::BGColorTextAttr:: + GetValueFor(nsIContent* aElm, nscolor* aValue) { - nsIFrame *frame = aContent->GetPrimaryFrame(); - if (!frame) - return false; - - return GetColor(frame, aValue); + nsIFrame* frame = aElm->GetPrimaryFrame(); + return frame ? GetColor(frame, aValue) : false; } void -nsBGColorTextAttr::Format(const nscolor& aValue, nsAString& aFormattedValue) +TextAttrsMgr::BGColorTextAttr:: + ExposeValue(nsIPersistentProperties* aAttributes, const nscolor& aValue) { - nsAutoString value; - StyleInfo::FormatColor(aValue, value); - aFormattedValue = value; + nsAutoString formattedValue; + StyleInfo::FormatColor(aValue, formattedValue); + nsAccUtils::SetAccAttr(aAttributes, nsGkAtoms::backgroundColor, + formattedValue); } bool -nsBGColorTextAttr::GetColor(nsIFrame *aFrame, nscolor *aColor) +TextAttrsMgr::BGColorTextAttr:: + GetColor(nsIFrame* aFrame, nscolor* aColor) { - const nsStyleBackground *styleBackground = aFrame->GetStyleBackground(); + const nsStyleBackground* styleBackground = aFrame->GetStyleBackground(); if (NS_GET_A(styleBackground->mBackgroundColor) > 0) { *aColor = styleBackground->mBackgroundColor; @@ -423,8 +409,9 @@ nsBGColorTextAttr::GetColor(nsIFrame *aFrame, nscolor *aColor) // ColorTextAttr //////////////////////////////////////////////////////////////////////////////// -ColorTextAttr::ColorTextAttr(nsIFrame* aRootFrame, nsIFrame* aFrame) : - nsTextAttr(!aFrame) +TextAttrsMgr::ColorTextAttr:: + ColorTextAttr(nsIFrame* aRootFrame, nsIFrame* aFrame) : + TTextAttr(!aFrame) { mRootNativeValue = aRootFrame->GetStyleColor()->mColor; mIsRootDefined = true; @@ -436,9 +423,10 @@ ColorTextAttr::ColorTextAttr(nsIFrame* aRootFrame, nsIFrame* aFrame) : } bool -ColorTextAttr::GetValueFor(nsIContent* aContent, nscolor* aValue) +TextAttrsMgr::ColorTextAttr:: + GetValueFor(nsIContent* aElm, nscolor* aValue) { - nsIFrame* frame = aContent->GetPrimaryFrame(); + nsIFrame* frame = aElm->GetPrimaryFrame(); if (frame) { *aValue = frame->GetStyleColor()->mColor; return true; @@ -448,11 +436,12 @@ ColorTextAttr::GetValueFor(nsIContent* aContent, nscolor* aValue) } void -ColorTextAttr::Format(const nscolor& aValue, nsAString& aFormattedValue) +TextAttrsMgr::ColorTextAttr:: + ExposeValue(nsIPersistentProperties* aAttributes, const nscolor& aValue) { - nsAutoString value; - StyleInfo::FormatColor(aValue, value); - aFormattedValue = value; + nsAutoString formattedValue; + StyleInfo::FormatColor(aValue, formattedValue); + nsAccUtils::SetAccAttr(aAttributes, nsGkAtoms::color, formattedValue); } @@ -460,8 +449,9 @@ ColorTextAttr::Format(const nscolor& aValue, nsAString& aFormattedValue) // FontFamilyTextAttr //////////////////////////////////////////////////////////////////////////////// -FontFamilyTextAttr::FontFamilyTextAttr(nsIFrame* aRootFrame, nsIFrame* aFrame) : - nsTextAttr(aFrame == nsnull) +TextAttrsMgr::FontFamilyTextAttr:: + FontFamilyTextAttr(nsIFrame* aRootFrame, nsIFrame* aFrame) : + TTextAttr(!aFrame) { mIsRootDefined = GetFontFamily(aRootFrame, mRootNativeValue); @@ -470,24 +460,23 @@ FontFamilyTextAttr::FontFamilyTextAttr(nsIFrame* aRootFrame, nsIFrame* aFrame) : } bool -FontFamilyTextAttr::GetValueFor(nsIContent* aElm, nsAutoString* aValue) +TextAttrsMgr::FontFamilyTextAttr:: + GetValueFor(nsIContent* aElm, nsString* aValue) { nsIFrame* frame = aElm->GetPrimaryFrame(); - if (!frame) - return false; - - return GetFontFamily(frame, *aValue); + return frame ? GetFontFamily(frame, *aValue) : false; } void -FontFamilyTextAttr::Format(const nsAutoString& aValue, - nsAString& aFormattedValue) +TextAttrsMgr::FontFamilyTextAttr:: + ExposeValue(nsIPersistentProperties* aAttributes, const nsString& aValue) { - aFormattedValue = aValue; + nsAccUtils::SetAccAttr(aAttributes, nsGkAtoms::font_family, aValue); } bool -FontFamilyTextAttr::GetFontFamily(nsIFrame* aFrame, nsAutoString& aFamily) +TextAttrsMgr::FontFamilyTextAttr:: + GetFontFamily(nsIFrame* aFrame, nsString& aFamily) { nsRefPtr fm; nsLayoutUtils::GetFontMetricsForFrame(aFrame, getter_AddRefs(fm)); @@ -501,36 +490,40 @@ FontFamilyTextAttr::GetFontFamily(nsIFrame* aFrame, nsAutoString& aFamily) //////////////////////////////////////////////////////////////////////////////// -// nsFontSizeTextAttr +// FontSizeTextAttr //////////////////////////////////////////////////////////////////////////////// -nsFontSizeTextAttr::nsFontSizeTextAttr(nsIFrame *aRootFrame, nsIFrame *aFrame) : - nsTextAttr(aFrame == nsnull) +TextAttrsMgr::FontSizeTextAttr:: + FontSizeTextAttr(nsIFrame* aRootFrame, nsIFrame* aFrame) : + TTextAttr(!aFrame) { mDC = aRootFrame->PresContext()->DeviceContext(); - mRootNativeValue = GetFontSize(aRootFrame); + mRootNativeValue = aRootFrame->GetStyleFont()->mSize; mIsRootDefined = true; if (aFrame) { - mNativeValue = GetFontSize(aFrame); + mNativeValue = aFrame->GetStyleFont()->mSize; mIsDefined = true; } } bool -nsFontSizeTextAttr::GetValueFor(nsIContent *aContent, nscoord *aValue) +TextAttrsMgr::FontSizeTextAttr:: + GetValueFor(nsIContent* aElm, nscoord* aValue) { - nsIFrame *frame = aContent->GetPrimaryFrame(); - if (!frame) - return false; + nsIFrame* frame = aElm->GetPrimaryFrame(); + if (frame) { + *aValue = frame->GetStyleFont()->mSize; + return true; + } - *aValue = GetFontSize(frame); - return true; + return false; } void -nsFontSizeTextAttr::Format(const nscoord& aValue, nsAString& aFormattedValue) +TextAttrsMgr::FontSizeTextAttr:: + ExposeValue(nsIPersistentProperties* aAttributes, const nscoord& aValue) { // Convert from nscoord to pt. // @@ -548,13 +541,8 @@ nsFontSizeTextAttr::Format(const nscoord& aValue, nsAString& aFormattedValue) nsAutoString value; value.AppendInt(pts); value.Append(NS_LITERAL_STRING("pt")); - aFormattedValue = value; -} -nscoord -nsFontSizeTextAttr::GetFontSize(nsIFrame *aFrame) -{ - return aFrame->GetStyleFont()->mSize; + nsAccUtils::SetAccAttr(aAttributes, nsGkAtoms::font_size, value); } @@ -562,8 +550,9 @@ nsFontSizeTextAttr::GetFontSize(nsIFrame *aFrame) // FontStyleTextAttr //////////////////////////////////////////////////////////////////////////////// -FontStyleTextAttr::FontStyleTextAttr(nsIFrame* aRootFrame, nsIFrame* aFrame) : - nsTextAttr(!aFrame) +TextAttrsMgr::FontStyleTextAttr:: + FontStyleTextAttr(nsIFrame* aRootFrame, nsIFrame* aFrame) : + TTextAttr(!aFrame) { mRootNativeValue = aRootFrame->GetStyleFont()->mFont.style; mIsRootDefined = true; @@ -575,7 +564,8 @@ FontStyleTextAttr::FontStyleTextAttr(nsIFrame* aRootFrame, nsIFrame* aFrame) : } bool -FontStyleTextAttr::GetValueFor(nsIContent* aContent, nscoord* aValue) +TextAttrsMgr::FontStyleTextAttr:: + GetValueFor(nsIContent* aContent, nscoord* aValue) { nsIFrame* frame = aContent->GetPrimaryFrame(); if (frame) { @@ -587,19 +577,23 @@ FontStyleTextAttr::GetValueFor(nsIContent* aContent, nscoord* aValue) } void -FontStyleTextAttr::Format(const nscoord& aValue, nsAString& aFormattedValue) +TextAttrsMgr::FontStyleTextAttr:: + ExposeValue(nsIPersistentProperties* aAttributes, const nscoord& aValue) { - StyleInfo::FormatFontStyle(aValue, aFormattedValue); + nsAutoString formattedValue; + StyleInfo::FormatFontStyle(aValue, formattedValue); + + nsAccUtils::SetAccAttr(aAttributes, nsGkAtoms::font_style, formattedValue); } //////////////////////////////////////////////////////////////////////////////// -// nsFontWeightTextAttr +// FontWeightTextAttr //////////////////////////////////////////////////////////////////////////////// -nsFontWeightTextAttr::nsFontWeightTextAttr(nsIFrame *aRootFrame, - nsIFrame *aFrame) : - nsTextAttr(aFrame == nsnull) +TextAttrsMgr::FontWeightTextAttr:: + FontWeightTextAttr(nsIFrame* aRootFrame, nsIFrame* aFrame) : + TTextAttr(!aFrame) { mRootNativeValue = GetFontWeight(aRootFrame); mIsRootDefined = true; @@ -611,26 +605,31 @@ nsFontWeightTextAttr::nsFontWeightTextAttr(nsIFrame *aRootFrame, } bool -nsFontWeightTextAttr::GetValueFor(nsIContent *aContent, PRInt32 *aValue) +TextAttrsMgr::FontWeightTextAttr:: + GetValueFor(nsIContent* aElm, PRInt32* aValue) { - nsIFrame *frame = aContent->GetPrimaryFrame(); - if (!frame) - return false; + nsIFrame* frame = aElm->GetPrimaryFrame(); + if (frame) { + *aValue = GetFontWeight(frame); + return true; + } - *aValue = GetFontWeight(frame); - return true; + return false; } void -nsFontWeightTextAttr::Format(const PRInt32& aValue, nsAString& aFormattedValue) +TextAttrsMgr::FontWeightTextAttr:: + ExposeValue(nsIPersistentProperties* aAttributes, const PRInt32& aValue) { - nsAutoString value; - value.AppendInt(aValue); - aFormattedValue = value; + nsAutoString formattedValue; + formattedValue.AppendInt(aValue); + + nsAccUtils::SetAccAttr(aAttributes, nsGkAtoms::fontWeight, formattedValue); } PRInt32 -nsFontWeightTextAttr::GetFontWeight(nsIFrame *aFrame) +TextAttrsMgr::FontWeightTextAttr:: + GetFontWeight(nsIFrame* aFrame) { // nsFont::width isn't suitable here because it's necessary to expose real // value of font weight (used font might not have some font weight values). @@ -664,3 +663,82 @@ nsFontWeightTextAttr::GetFontWeight(nsIFrame *aFrame) return fontEntry->Weight(); #endif } + + +//////////////////////////////////////////////////////////////////////////////// +// TextDecorTextAttr +//////////////////////////////////////////////////////////////////////////////// + +TextAttrsMgr::TextDecorValue:: + TextDecorValue(nsIFrame* aFrame) +{ + const nsStyleTextReset* textReset = aFrame->GetStyleTextReset(); + mStyle = textReset->GetDecorationStyle(); + + bool isForegroundColor = false; + textReset->GetDecorationColor(mColor, isForegroundColor); + if (isForegroundColor) + mColor = aFrame->GetStyleColor()->mColor; + + mLine = textReset->mTextDecorationLine & + (NS_STYLE_TEXT_DECORATION_LINE_UNDERLINE | + NS_STYLE_TEXT_DECORATION_LINE_LINE_THROUGH); +} + +TextAttrsMgr::TextDecorTextAttr:: + TextDecorTextAttr(nsIFrame* aRootFrame, nsIFrame* aFrame) : + TTextAttr(!aFrame) +{ + mRootNativeValue = TextDecorValue(aRootFrame); + mIsRootDefined = mRootNativeValue.IsDefined(); + + if (aFrame) { + mNativeValue = TextDecorValue(aFrame); + mIsDefined = mNativeValue.IsDefined(); + } +} + +bool +TextAttrsMgr::TextDecorTextAttr:: + GetValueFor(nsIContent* aContent, TextDecorValue* aValue) +{ + nsIFrame* frame = aContent->GetPrimaryFrame(); + if (frame) { + *aValue = TextDecorValue(frame); + return aValue->IsDefined(); + } + + return false; +} + +void +TextAttrsMgr::TextDecorTextAttr:: + ExposeValue(nsIPersistentProperties* aAttributes, const TextDecorValue& aValue) +{ + if (aValue.IsUnderline()) { + nsAutoString formattedStyle; + StyleInfo::FormatTextDecorationStyle(aValue.Style(), formattedStyle); + nsAccUtils::SetAccAttr(aAttributes, + nsGkAtoms::textUnderlineStyle, + formattedStyle); + + nsAutoString formattedColor; + StyleInfo::FormatColor(aValue.Color(), formattedColor); + nsAccUtils::SetAccAttr(aAttributes, nsGkAtoms::textUnderlineColor, + formattedColor); + return; + } + + if (aValue.IsLineThrough()) { + nsAutoString formattedStyle; + StyleInfo::FormatTextDecorationStyle(aValue.Style(), formattedStyle); + nsAccUtils::SetAccAttr(aAttributes, + nsGkAtoms::textLineThroughStyle, + formattedStyle); + + nsAutoString formattedColor; + StyleInfo::FormatColor(aValue.Color(), formattedColor); + nsAccUtils::SetAccAttr(aAttributes, nsGkAtoms::textLineThroughColor, + formattedColor); + } +} diff --git a/accessible/src/base/TextAttrs.h b/accessible/src/base/TextAttrs.h new file mode 100644 index 00000000000..2374b8dc7ae --- /dev/null +++ b/accessible/src/base/TextAttrs.h @@ -0,0 +1,443 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is + * Mozilla Foundation. + * Portions created by the Initial Developer are Copyright (C) 2007 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Alexander Surkov (original author) + * + * Alternatively, the contents of this file may be used under the terms of + * either of the GNU General Public License Version 2 or later (the "GPL"), + * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +#ifndef nsTextAttrs_h_ +#define nsTextAttrs_h_ + +#include "nsIContent.h" +#include "nsIFrame.h" +#include "nsIPersistentProperties2.h" +#include "nsStyleConsts.h" + +class nsHyperTextAccessible; + +namespace mozilla { +namespace a11y { + +/** + * Used to expose text attributes for the hyper text accessible (see + * nsHyperTextAccessible class). + * + * @note "invalid: spelling" text attribute is implemented entirely in + * nsHyperTextAccessible class. + */ +class TextAttrsMgr +{ +public: + /** + * Constructor. Used to expose default text attributes. + */ + TextAttrsMgr(nsHyperTextAccessible* aHyperTextAcc) : + mHyperTextAcc(aHyperTextAcc), mIncludeDefAttrs(true), + mOffsetAcc(nsnull), mOffsetAccIdx(-1) { } + + /** + * Constructor. Used to expose text attributes at the given offset. + * + * @param aHyperTextAcc [in] hyper text accessible text attributes are + * calculated for + * @param aIncludeDefAttrs [optional] indicates whether default text + * attributes should be included into list of exposed + * text attributes + * @param oOffsetAcc [optional] offset an accessible the text attributes + * should be calculated for + * @param oOffsetAccIdx [optional] index in parent of offset accessible + */ + TextAttrsMgr(nsHyperTextAccessible* aHyperTextAcc, + bool aIncludeDefAttrs, + nsAccessible* aOffsetAcc, + PRInt32 aOffsetAccIdx) : + mHyperTextAcc(aHyperTextAcc), mIncludeDefAttrs(aIncludeDefAttrs), + mOffsetAcc(aOffsetAcc), mOffsetAccIdx(aOffsetAccIdx) { } + + /* + * Return text attributes and hyper text offsets where these attributes are + * applied. Offsets are calculated in the case of non default attributes. + * + * @note In the case of default attributes pointers on hyper text offsets + * must be skipped. + * + * @param aAttributes [in, out] text attributes list + * @param aStartHTOffset [out, optional] start hyper text offset + * @param aEndHTOffset [out, optional] end hyper text offset + */ + void GetAttributes(nsIPersistentProperties* aAttributes, + PRInt32* aStartHTOffset = nsnull, + PRInt32* aEndHTOffset = nsnull); + +protected: + /** + * Calculates range (start and end offsets) of text where the text attributes + * are stretched. New offsets may be smaller if one of text attributes changes + * its value before or after the given offsets. + * + * @param aTextAttrArray [in] text attributes array + * @param aStartHTOffset [in, out] the start offset + * @param aEndHTOffset [in, out] the end offset + */ + class TextAttr; + void GetRange(const nsTArray& aTextAttrArray, + PRInt32* aStartHTOffset, PRInt32* aEndHTOffset); + +private: + nsHyperTextAccessible* mHyperTextAcc; + + bool mIncludeDefAttrs; + + nsAccessible* mOffsetAcc; + PRInt32 mOffsetAccIdx; + +protected: + + /** + * Interface class of text attribute class implementations. + */ + class TextAttr + { + public: + /** + * Expose the text attribute to the given attribute set. + * + * @param aAttributes [in] the given attribute set + * @param aIncludeDefAttrValue [in] if true then attribute is exposed even + * if its value is the same as default one + */ + virtual void Expose(nsIPersistentProperties* aAttributes, + bool aIncludeDefAttrValue) = 0; + + /** + * Return true if the text attribute value on the given element equals with + * predefined attribute value. + */ + virtual bool Equal(nsIContent* aElm) = 0; + }; + + + /** + * Base class to work with text attributes. See derived classes below. + */ + template + class TTextAttr : public TextAttr + { + public: + TTextAttr(bool aGetRootValue) : mGetRootValue(aGetRootValue) {} + + // ITextAttr + virtual void Expose(nsIPersistentProperties* aAttributes, + bool aIncludeDefAttrValue) + { + if (mGetRootValue) { + if (mIsRootDefined) + ExposeValue(aAttributes, mRootNativeValue); + return; + } + + if (mIsDefined) { + if (aIncludeDefAttrValue || mRootNativeValue != mNativeValue) + ExposeValue(aAttributes, mNativeValue); + return; + } + + if (aIncludeDefAttrValue && mIsRootDefined) + ExposeValue(aAttributes, mRootNativeValue); + } + + virtual bool Equal(nsIContent* aElm) + { + T nativeValue; + bool isDefined = GetValueFor(aElm, &nativeValue); + + if (!mIsDefined && !isDefined) + return true; + + if (mIsDefined && isDefined) + return nativeValue == mNativeValue; + + if (mIsDefined) + return mNativeValue == mRootNativeValue; + + return nativeValue == mRootNativeValue; + } + + protected: + + // Expose the text attribute with the given value to attribute set. + virtual void ExposeValue(nsIPersistentProperties* aAttributes, + const T& aValue) = 0; + + // Return native value for the given DOM element. + virtual bool GetValueFor(nsIContent* aElm, T* aValue) = 0; + + // Indicates if root value should be exposed. + bool mGetRootValue; + + // Native value and flag indicating if the value is defined (initialized in + // derived classes). Note, undefined native value means it is inherited + // from root. + T mNativeValue; + bool mIsDefined; + + // Native root value and flag indicating if the value is defined (initialized + // in derived classes). + T mRootNativeValue; + bool mIsRootDefined; + }; + + + /** + * Class is used for the work with 'language' text attribute. + */ + class LangTextAttr : public TTextAttr + { + public: + LangTextAttr(nsHyperTextAccessible* aRoot, nsIContent* aRootElm, + nsIContent* aElm); + virtual ~LangTextAttr() { } + + protected: + + // TextAttr + virtual bool GetValueFor(nsIContent* aElm, nsString* aValue); + virtual void ExposeValue(nsIPersistentProperties* aAttributes, + const nsString& aValue); + + private: + bool GetLang(nsIContent* aElm, nsAString& aLang); + nsCOMPtr mRootContent; + }; + + + /** + * Class is used for the work with CSS based text attributes. + */ + class CSSTextAttr : public TTextAttr + { + public: + CSSTextAttr(PRUint32 aIndex, nsIContent* aRootElm, nsIContent* aElm); + virtual ~CSSTextAttr() { } + + protected: + + // TextAttr + virtual bool GetValueFor(nsIContent* aElm, nsString* aValue); + virtual void ExposeValue(nsIPersistentProperties* aAttributes, + const nsString& aValue); + + private: + PRInt32 mIndex; + }; + + + /** + * Class is used for the work with 'background-color' text attribute. + */ + class BGColorTextAttr : public TTextAttr + { + public: + BGColorTextAttr(nsIFrame* aRootFrame, nsIFrame* aFrame); + virtual ~BGColorTextAttr() { } + + protected: + + // TextAttr + virtual bool GetValueFor(nsIContent* aElm, nscolor* aValue); + virtual void ExposeValue(nsIPersistentProperties* aAttributes, + const nscolor& aValue); + + private: + bool GetColor(nsIFrame* aFrame, nscolor* aColor); + nsIFrame* mRootFrame; + }; + + + /** + * Class is used for the work with 'color' text attribute. + */ + class ColorTextAttr : public TTextAttr + { + public: + ColorTextAttr(nsIFrame* aRootFrame, nsIFrame* aFrame); + virtual ~ColorTextAttr() { } + + protected: + + // TTextAttr + virtual bool GetValueFor(nsIContent* aElm, nscolor* aValue); + virtual void ExposeValue(nsIPersistentProperties* aAttributes, + const nscolor& aValue); + }; + + + /** + * Class is used for the work with "font-family" text attribute. + */ + class FontFamilyTextAttr : public TTextAttr + { + public: + FontFamilyTextAttr(nsIFrame* aRootFrame, nsIFrame* aFrame); + virtual ~FontFamilyTextAttr() { } + + protected: + + // TTextAttr + virtual bool GetValueFor(nsIContent* aElm, nsString* aValue); + virtual void ExposeValue(nsIPersistentProperties* aAttributes, + const nsString& aValue); + + private: + + bool GetFontFamily(nsIFrame* aFrame, nsString& aFamily); + }; + + + /** + * Class is used for the work with "font-size" text attribute. + */ + class FontSizeTextAttr : public TTextAttr + { + public: + FontSizeTextAttr(nsIFrame* aRootFrame, nsIFrame* aFrame); + virtual ~FontSizeTextAttr() { } + + protected: + + // TTextAttr + virtual bool GetValueFor(nsIContent* aElm, nscoord* aValue); + virtual void ExposeValue(nsIPersistentProperties* aAttributes, + const nscoord& aValue); + + private: + nsDeviceContext* mDC; + }; + + + /** + * Class is used for the work with "font-style" text attribute. + */ + class FontStyleTextAttr : public TTextAttr + { + public: + FontStyleTextAttr(nsIFrame* aRootFrame, nsIFrame* aFrame); + virtual ~FontStyleTextAttr() { } + + protected: + + // TTextAttr + virtual bool GetValueFor(nsIContent* aContent, nscoord* aValue); + virtual void ExposeValue(nsIPersistentProperties* aAttributes, + const nscoord& aValue); + }; + + + /** + * Class is used for the work with "font-weight" text attribute. + */ + class FontWeightTextAttr : public TTextAttr + { + public: + FontWeightTextAttr(nsIFrame* aRootFrame, nsIFrame* aFrame); + virtual ~FontWeightTextAttr() { } + + protected: + + // TTextAttr + virtual bool GetValueFor(nsIContent* aElm, PRInt32* aValue); + virtual void ExposeValue(nsIPersistentProperties* aAttributes, + const PRInt32& aValue); + + private: + PRInt32 GetFontWeight(nsIFrame* aFrame); + }; + + + /** + * TextDecorTextAttr class is used for the work with + * "text-line-through-style", "text-line-through-color", + * "text-underline-style" and "text-underline-color" text attributes. + */ + + class TextDecorValue + { + public: + TextDecorValue() { } + TextDecorValue(nsIFrame* aFrame); + + nscolor Color() const { return mColor; } + PRUint8 Style() const { return mStyle; } + + bool IsDefined() const + { return IsUnderline() || IsLineThrough(); } + bool IsUnderline() const + { return mLine & NS_STYLE_TEXT_DECORATION_LINE_UNDERLINE; } + bool IsLineThrough() const + { return mLine & NS_STYLE_TEXT_DECORATION_LINE_LINE_THROUGH; } + + bool operator ==(const TextDecorValue& aValue) + { + return mColor == aValue.mColor && mLine == aValue.mLine && + mStyle == aValue.mStyle; + } + bool operator !=(const TextDecorValue& aValue) + { return !(*this == aValue); } + + private: + nscolor mColor; + PRUint8 mLine; + PRUint8 mStyle; + }; + + class TextDecorTextAttr : public TTextAttr + { + public: + TextDecorTextAttr(nsIFrame* aRootFrame, nsIFrame* aFrame); + virtual ~TextDecorTextAttr() { } + + protected: + + // TextAttr + virtual bool GetValueFor(nsIContent* aElm, TextDecorValue* aValue); + virtual void ExposeValue(nsIPersistentProperties* aAttributes, + const TextDecorValue& aValue); + }; + +}; // TextAttrMgr + +} // namespace a11y +} // namespace mozilla + +#endif diff --git a/accessible/src/base/nsAccessible.cpp b/accessible/src/base/nsAccessible.cpp index 022f2ce957c..95b53c3da3d 100644 --- a/accessible/src/base/nsAccessible.cpp +++ b/accessible/src/base/nsAccessible.cpp @@ -1450,6 +1450,23 @@ nsAccessible::GetAttributesInternal(nsIPersistentProperties *aAttributes) if (!mContent->IsElement()) return NS_OK; + // Expose draggable object attribute? + nsCOMPtr htmlElement = do_QueryInterface(mContent); + if (htmlElement) { + bool draggable = false; + htmlElement->GetDraggable(&draggable); + if (draggable) { + nsAccUtils::SetAccAttr(aAttributes, nsGkAtoms::draggable, + NS_LITERAL_STRING("true")); + } + } + + // Don't calculate CSS-based object attributes when no frame (i.e. + // the accessible is not unattached form three) or when the accessible is not + // primary for node (like list bullet or XUL tree items). + if (!mContent->GetPrimaryFrame() || !IsPrimaryForNode()) + return NS_OK; + // CSS style based object attributes. nsAutoString value; StyleInfo styleInfo(mContent->AsElement(), mDoc->PresShell()); @@ -1482,17 +1499,6 @@ nsAccessible::GetAttributesInternal(nsIPersistentProperties *aAttributes) styleInfo.MarginBottom(value); nsAccUtils::SetAccAttr(aAttributes, nsGkAtoms::marginBottom, value); - // Expose draggable object attribute? - nsCOMPtr htmlElement = do_QueryInterface(mContent); - if (htmlElement) { - bool draggable = false; - htmlElement->GetDraggable(&draggable); - if (draggable) { - nsAccUtils::SetAccAttr(aAttributes, nsGkAtoms::draggable, - NS_LITERAL_STRING("true")); - } - } - return NS_OK; } diff --git a/accessible/src/base/nsDocAccessible.cpp b/accessible/src/base/nsDocAccessible.cpp index 8eeb28aa06c..a958cd290bd 100644 --- a/accessible/src/base/nsDocAccessible.cpp +++ b/accessible/src/base/nsDocAccessible.cpp @@ -923,7 +923,8 @@ nsDocAccessible::OnPivotChanged(nsIAccessiblePivot* aPivot, nsIAccessible* aOldAccessible, PRInt32 aOldStart, PRInt32 aOldEnd) { - nsRefPtr event = new AccEvent(nsIAccessibleEvent::EVENT_VIRTUALCURSOR_CHANGED, this); + nsRefPtr event = new AccVCChangeEvent(this, aOldAccessible, + aOldStart, aOldEnd); nsEventShell::FireEvent(event); return NS_OK; diff --git a/accessible/src/base/nsTextAttrs.h b/accessible/src/base/nsTextAttrs.h deleted file mode 100644 index aadcde7a8e6..00000000000 --- a/accessible/src/base/nsTextAttrs.h +++ /dev/null @@ -1,426 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Mozilla Foundation. - * Portions created by the Initial Developer are Copyright (C) 2007 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Alexander Surkov (original author) - * - * Alternatively, the contents of this file may be used under the terms of - * either of the GNU General Public License Version 2 or later (the "GPL"), - * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#ifndef nsTextAttrs_h_ -#define nsTextAttrs_h_ - -class nsHyperTextAccessible; - -#include "nsIContent.h" -#include "nsIFrame.h" -#include "nsIPersistentProperties2.h" - -class nsITextAttr; - -/** - * Used to expose text attributes for the hyper text accessible (see - * nsHyperTextAccessible class). It is indended for the work with 'language' and - * CSS based text attributes. - * - * @note "invalid: spelling" text attrbiute is implemented entirerly in - * nsHyperTextAccessible class. - */ -class nsTextAttrsMgr -{ -public: - /** - * Constructor. If instance of the class is intended to expose default text - * attributes then 'aIncludeDefAttrs' and 'aOffsetNode' argument must be - * skiped. - * - * @param aHyperTextAcc hyper text accessible text attributes are - * calculated for - * @param aHyperTextNode DOM node of the given hyper text accessbile - * @param aIncludeDefAttrs [optional] indicates whether default text - * attributes should be included into list of exposed - * text attributes. - * @param oOffsetNode [optional] DOM node represents hyper text offset - * inside hyper text accessible - */ - nsTextAttrsMgr(nsHyperTextAccessible *aHyperTextAcc, - bool aIncludeDefAttrs = true, - nsAccessible *aOffsetAcc = nsnull, - PRInt32 aOffsetAccIdx = -1); - - /* - * Return text attributes and hyper text offsets where these attributes are - * applied. Offsets are calculated in the case of non default attributes. - * - * @note In the case of default attributes pointers on hyper text offsets - * must be skiped. - * - * @param aAttributes [in, out] text attributes list - * @param aStartHTOffset [out, optional] start hyper text offset - * @param aEndHTOffset [out, optional] end hyper text offset - */ - nsresult GetAttributes(nsIPersistentProperties *aAttributes, - PRInt32 *aStartHTOffset = nsnull, - PRInt32 *aEndHTOffset = nsnull); - -protected: - /** - * Calculates range (start and end offsets) of text where the text attributes - * are stretched. New offsets may be smaller if one of text attributes changes - * its value before or after the given offsets. - * - * @param aTextAttrArray [in] text attributes array - * @param aStartHTOffset [in, out] the start offset - * @param aEndHTOffset [in, out] the end offset - */ - nsresult GetRange(const nsTArray& aTextAttrArray, - PRInt32 *aStartHTOffset, PRInt32 *aEndHTOffset); - -private: - nsRefPtr mHyperTextAcc; - - bool mIncludeDefAttrs; - - nsRefPtr mOffsetAcc; - PRInt32 mOffsetAccIdx; -}; - - -//////////////////////////////////////////////////////////////////////////////// -// Private implementation details - -/** - * Interface class of text attribute class implementations. - */ -class nsITextAttr -{ -public: - /** - * Return the name of text attribute. - */ - virtual nsIAtom* GetName() const = 0; - - /** - * Retrieve the value of text attribute in out param, return true if differs - * from the default value of text attribute or if include default attribute - * value flag is setted. - * - * @param aValue [in, out] the value of text attribute - * @param aIncludeDefAttrValue [in] include default attribute value flag - * @return true if text attribute value differs from - * default or include default attribute value - * flag is applied - */ - virtual bool GetValue(nsAString& aValue, bool aIncludeDefAttrValue) = 0; - - /** - * Return true if the text attribute value on the given element equals with - * predefined attribute value. - */ - virtual bool Equal(nsIContent *aContent) = 0; -}; - - -/** - * Base class to work with text attributes. See derived classes below. - */ -template -class nsTextAttr : public nsITextAttr -{ -public: - nsTextAttr(bool aGetRootValue) : mGetRootValue(aGetRootValue) {} - - // nsITextAttr - virtual bool GetValue(nsAString& aValue, bool aIncludeDefAttrValue) - { - if (mGetRootValue) { - Format(mRootNativeValue, aValue); - return mIsRootDefined; - } - - bool isDefined = mIsDefined; - T* nativeValue = &mNativeValue; - - if (!isDefined) { - if (aIncludeDefAttrValue) { - isDefined = mIsRootDefined; - nativeValue = &mRootNativeValue; - } - } else if (!aIncludeDefAttrValue) { - isDefined = mRootNativeValue != mNativeValue; - } - - if (!isDefined) - return false; - - Format(*nativeValue, aValue); - return true; - } - - virtual bool Equal(nsIContent *aContent) - { - T nativeValue; - bool isDefined = GetValueFor(aContent, &nativeValue); - - if (!mIsDefined && !isDefined) - return true; - - if (mIsDefined && isDefined) - return nativeValue == mNativeValue; - - if (mIsDefined) - return mNativeValue == mRootNativeValue; - - return nativeValue == mRootNativeValue; - } - -protected: - - // Return native value for the given DOM element. - virtual bool GetValueFor(nsIContent *aContent, T *aValue) = 0; - - // Format native value to text attribute value. - virtual void Format(const T& aValue, nsAString& aFormattedValue) = 0; - - // Indicates if root value should be exposed. - bool mGetRootValue; - - // Native value and flag indicating if the value is defined (initialized in - // derived classes). Note, undefined native value means it is inherited - // from root. - T mNativeValue; - bool mIsDefined; - - // Native root value and flag indicating if the value is defined (initialized - // in derived classes). - T mRootNativeValue; - bool mIsRootDefined; -}; - - -/** - * Class is used for the work with 'language' text attribute in nsTextAttrsMgr - * class. - */ -class nsLangTextAttr : public nsTextAttr -{ -public: - nsLangTextAttr(nsHyperTextAccessible *aRootAcc, nsIContent *aRootContent, - nsIContent *aContent); - - // nsITextAttr - virtual nsIAtom *GetName() const { return nsGkAtoms::language; } - -protected: - - // nsTextAttr - virtual bool GetValueFor(nsIContent *aElm, nsAutoString *aValue); - virtual void Format(const nsAutoString& aValue, nsAString& aFormattedValue); - -private: - bool GetLang(nsIContent *aContent, nsAString& aLang); - nsCOMPtr mRootContent; -}; - - -/** - * Class is used for the work with CSS based text attributes in nsTextAttrsMgr - * class. - */ -class nsCSSTextAttr : public nsTextAttr -{ -public: - nsCSSTextAttr(PRUint32 aIndex, nsIContent *aRootContent, - nsIContent *aContent); - - // nsITextAttr - virtual nsIAtom *GetName() const; - -protected: - - // nsTextAttr - virtual bool GetValueFor(nsIContent *aContent, nsAutoString *aValue); - virtual void Format(const nsAutoString& aValue, nsAString& aFormattedValue); - -private: - PRInt32 mIndex; -}; - - -/** - * Class is used for the work with 'background-color' text attribute in - * nsTextAttrsMgr class. - */ -class nsBGColorTextAttr : public nsTextAttr -{ -public: - nsBGColorTextAttr(nsIFrame *aRootFrame, nsIFrame *aFrame); - - // nsITextAttr - virtual nsIAtom *GetName() const { return nsGkAtoms::backgroundColor; } - -protected: - // nsTextAttr - virtual bool GetValueFor(nsIContent *aContent, nscolor *aValue); - virtual void Format(const nscolor& aValue, nsAString& aFormattedValue); - -private: - bool GetColor(nsIFrame *aFrame, nscolor *aColor); - nsIFrame *mRootFrame; -}; - - -/** - * Class is used for the work with 'color' text attribute in nsTextAttrsMgr - * class. - */ -class ColorTextAttr : public nsTextAttr -{ -public: - ColorTextAttr(nsIFrame* aRootFrame, nsIFrame* aFrame); - - // nsITextAttr - virtual nsIAtom* GetName() const { return nsGkAtoms::color; } - -protected: - // nsTextAttr - virtual bool GetValueFor(nsIContent* aContent, nscolor* aValue); - virtual void Format(const nscolor& aValue, nsAString& aFormattedValue); -}; - - -/** - * Class is used for the work with "font-family" text attribute in - * nsTextAttrsMgr class. - */ -class FontFamilyTextAttr : public nsTextAttr -{ -public: - FontFamilyTextAttr(nsIFrame* aRootFrame, nsIFrame* aFrame); - - // nsITextAttr - virtual nsIAtom* GetName() const { return nsGkAtoms::font_family; } - -protected: - - // nsTextAttr - virtual bool GetValueFor(nsIContent* aContent, nsAutoString* aValue); - virtual void Format(const nsAutoString& aValue, nsAString& aFormattedValue); - -private: - - bool GetFontFamily(nsIFrame* aFrame, nsAutoString& aFamily); -}; - - -/** - * Class is used for the work with "font-size" text attribute in nsTextAttrsMgr - * class. - */ -class nsFontSizeTextAttr : public nsTextAttr -{ -public: - nsFontSizeTextAttr(nsIFrame *aRootFrame, nsIFrame *aFrame); - - // nsITextAttr - virtual nsIAtom *GetName() const { return nsGkAtoms::font_size; } - -protected: - - // nsTextAttr - virtual bool GetValueFor(nsIContent *aContent, nscoord *aValue); - virtual void Format(const nscoord& aValue, nsAString& aFormattedValue); - -private: - - /** - * Return font size for the given frame. - * - * @param aFrame [in] the given frame to query font-size - * @return font size - */ - nscoord GetFontSize(nsIFrame *aFrame); - - nsDeviceContext *mDC; -}; - - -/** - * Class is used for the work with "font-style" text attribute in nsTextAttrsMgr - * class. - */ -class FontStyleTextAttr : public nsTextAttr -{ -public: - FontStyleTextAttr(nsIFrame* aRootFrame, nsIFrame* aFrame); - - // nsITextAttr - virtual nsIAtom* GetName() const { return nsGkAtoms::font_style; } - -protected: - - // nsTextAttr - virtual bool GetValueFor(nsIContent* aContent, nscoord* aValue); - virtual void Format(const nscoord &aValue, nsAString &aFormattedValue); -}; - - -/** - * Class is used for the work with "font-weight" text attribute in - * nsTextAttrsMgr class. - */ -class nsFontWeightTextAttr : public nsTextAttr -{ -public: - nsFontWeightTextAttr(nsIFrame *aRootFrame, nsIFrame *aFrame); - - // nsITextAttr - virtual nsIAtom *GetName() const { return nsGkAtoms::fontWeight; } - -protected: - - // nsTextAttr - virtual bool GetValueFor(nsIContent *aElm, PRInt32 *aValue); - virtual void Format(const PRInt32& aValue, nsAString& aFormattedValue); - -private: - - /** - * Return font weight for the given frame. - * - * @param aFrame [in] the given frame to query font weight - * @return font weight - */ - PRInt32 GetFontWeight(nsIFrame *aFrame); -}; - -#endif diff --git a/accessible/src/html/nsHyperTextAccessible.cpp b/accessible/src/html/nsHyperTextAccessible.cpp index b51741676ba..77903b195af 100644 --- a/accessible/src/html/nsHyperTextAccessible.cpp +++ b/accessible/src/html/nsHyperTextAccessible.cpp @@ -42,9 +42,9 @@ #include "nsAccessibilityService.h" #include "nsAccUtils.h" #include "nsDocAccessible.h" -#include "nsTextAttrs.h" #include "Role.h" #include "States.h" +#include "TextAttrs.h" #include "nsIClipboard.h" #include "nsContentUtils.h" @@ -1130,8 +1130,8 @@ nsHyperTextAccessible::GetTextAttributes(bool aIncludeDefAttrs, // default attributes if they were requested, otherwise return empty set. if (aOffset == 0) { if (aIncludeDefAttrs) { - nsTextAttrsMgr textAttrsMgr(this, true, nsnull, -1); - return textAttrsMgr.GetAttributes(*aAttributes); + TextAttrsMgr textAttrsMgr(this); + textAttrsMgr.GetAttributes(*aAttributes); } return NS_OK; } @@ -1143,11 +1143,9 @@ nsHyperTextAccessible::GetTextAttributes(bool aIncludeDefAttrs, PRInt32 endOffset = GetChildOffset(accAtOffsetIdx + 1); PRInt32 offsetInAcc = aOffset - startOffset; - nsTextAttrsMgr textAttrsMgr(this, aIncludeDefAttrs, accAtOffset, - accAtOffsetIdx); - nsresult rv = textAttrsMgr.GetAttributes(*aAttributes, &startOffset, - &endOffset); - NS_ENSURE_SUCCESS(rv, rv); + TextAttrsMgr textAttrsMgr(this, aIncludeDefAttrs, accAtOffset, + accAtOffsetIdx); + textAttrsMgr.GetAttributes(*aAttributes, &startOffset, &endOffset); // Compute spelling attributes on text accessible only. nsIFrame *offsetFrame = accAtOffset->GetFrame(); @@ -1186,8 +1184,9 @@ nsHyperTextAccessible::GetDefaultTextAttributes(nsIPersistentProperties **aAttri NS_ADDREF(*aAttributes = attributes); - nsTextAttrsMgr textAttrsMgr(this, true); - return textAttrsMgr.GetAttributes(*aAttributes); + TextAttrsMgr textAttrsMgr(this); + textAttrsMgr.GetAttributes(*aAttributes); + return NS_OK; } PRInt32 diff --git a/accessible/src/xpcom/nsAccEvent.cpp b/accessible/src/xpcom/nsAccEvent.cpp index 8904cfe1075..8e5d69b15e2 100644 --- a/accessible/src/xpcom/nsAccEvent.cpp +++ b/accessible/src/xpcom/nsAccEvent.cpp @@ -253,3 +253,40 @@ nsAccTableChangeEvent::GetNumRowsOrCols(PRInt32* aNumRowsOrCols) return NS_OK; } +//////////////////////////////////////////////////////////////////////////////// +// nsAccVirtualCursorChangeEvent +//////////////////////////////////////////////////////////////////////////////// + +NS_IMPL_ISUPPORTS_INHERITED1(nsAccVirtualCursorChangeEvent, nsAccEvent, + nsIAccessibleVirtualCursorChangeEvent) + +NS_IMETHODIMP +nsAccVirtualCursorChangeEvent::GetOldAccessible(nsIAccessible** aOldAccessible) +{ + NS_ENSURE_ARG_POINTER(aOldAccessible); + + *aOldAccessible = + static_cast(mEvent.get())->OldAccessible(); + NS_IF_ADDREF(*aOldAccessible); + return NS_OK; +} + +NS_IMETHODIMP +nsAccVirtualCursorChangeEvent::GetOldStartOffset(PRInt32* aOldStartOffset) +{ + NS_ENSURE_ARG_POINTER(aOldStartOffset); + + *aOldStartOffset = + static_cast(mEvent.get())->OldStartOffset(); + return NS_OK; +} + +NS_IMETHODIMP +nsAccVirtualCursorChangeEvent::GetOldEndOffset(PRInt32* aOldEndOffset) +{ + NS_ENSURE_ARG_POINTER(aOldEndOffset); + + *aOldEndOffset = + static_cast(mEvent.get())->OldEndOffset(); + return NS_OK; +} diff --git a/accessible/src/xpcom/nsAccEvent.h b/accessible/src/xpcom/nsAccEvent.h index c014d87bf8d..5209c1e39c7 100644 --- a/accessible/src/xpcom/nsAccEvent.h +++ b/accessible/src/xpcom/nsAccEvent.h @@ -164,5 +164,25 @@ private: nsAccTableChangeEvent& operator =(const nsAccTableChangeEvent&); }; +/** + * Accessible virtual cursor change event. + */ +class nsAccVirtualCursorChangeEvent : public nsAccEvent, + public nsIAccessibleVirtualCursorChangeEvent +{ +public: + nsAccVirtualCursorChangeEvent(AccVCChangeEvent* aEvent) : + nsAccEvent(aEvent) { } + virtual ~nsAccVirtualCursorChangeEvent() { } + + NS_DECL_ISUPPORTS_INHERITED + NS_DECL_NSIACCESSIBLEVIRTUALCURSORCHANGEEVENT + +private: + nsAccVirtualCursorChangeEvent() MOZ_DELETE; + nsAccVirtualCursorChangeEvent(const nsAccVirtualCursorChangeEvent&) MOZ_DELETE; + nsAccVirtualCursorChangeEvent& operator =(const nsAccVirtualCursorChangeEvent&) MOZ_DELETE; +}; + #endif diff --git a/accessible/tests/mochitest/attributes.js b/accessible/tests/mochitest/attributes.js index 45a7ac1f8b4..89936b509a8 100644 --- a/accessible/tests/mochitest/attributes.js +++ b/accessible/tests/mochitest/attributes.js @@ -47,6 +47,23 @@ function testCSSAttrs(aID) testAttrs(aID, attrs, true); } +/** + * Test the accessible that it doesn't have CSS-based object attributes. + */ +function testAbsentCSSAttrs(aID) +{ + var attrs = { + "display": "", + "text-align": "", + "text-indent": "", + "margin-left": "", + "margin-right": "", + "margin-top": "", + "margin-bottom": "" + }; + testAbsentAttrs(aID, attrs); +} + /** * Test group object attributes (posinset, setsize and level) and * nsIAccessible::groupPosition() method. diff --git a/accessible/tests/mochitest/attributes/test_obj_css.html b/accessible/tests/mochitest/attributes/test_obj_css.html index d66a2389d52..2de13c71d14 100644 --- a/accessible/tests/mochitest/attributes/test_obj_css.html +++ b/accessible/tests/mochitest/attributes/test_obj_css.html @@ -82,6 +82,9 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=689540 testCSSAttrs("tr"); testCSSAttrs("td"); + // no CSS-based object attributes + testAbsentCSSAttrs(getAccessible("listitem").firstChild); + SimpleTest.finish(); } @@ -111,6 +114,11 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=689540 title="Don't use GetComputedStyle for object attribute calculation"> Mozilla Bug 714579 + + Mozilla Bug 729831 +

@@ -189,5 +197,9 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=689540 td + +
    +
  • item +
diff --git a/accessible/tests/mochitest/attributes/test_text.html b/accessible/tests/mochitest/attributes/test_text.html index fc4c92f7a59..f695301696d 100644 --- a/accessible/tests/mochitest/attributes/test_text.html +++ b/accessible/tests/mochitest/attributes/test_text.html @@ -269,13 +269,19 @@ attrs = {}; testTextAttrs(ID, 84, attrs, defAttrs, 83, 91); - attrs = { "text-underline-style": "solid" }; + attrs = { + "text-underline-style": "solid", + "text-underline-color": gComputedStyle.color + }; testTextAttrs(ID, 92, attrs, defAttrs, 91, 101); attrs = {}; testTextAttrs(ID, 102, attrs, defAttrs, 101, 109); - attrs = { "text-line-through-style": "solid" }; + attrs = { + "text-line-through-style": "solid", + "text-line-through-color": gComputedStyle.color + }; testTextAttrs(ID, 110, attrs, defAttrs, 109, 122); attrs = {}; @@ -323,13 +329,19 @@ attrs = {}; testTextAttrs(ID, 85, attrs, defAttrs, 84, 92); - attrs = { "text-underline-style": "solid" }; + attrs = { + "text-underline-style": "solid", + "text-underline-color": gComputedStyle.color + }; testTextAttrs(ID, 93, attrs, defAttrs, 92, 102); attrs = {}; testTextAttrs(ID, 103, attrs, defAttrs, 102, 110); - attrs = { "text-line-through-style": "solid" }; + attrs = { + "text-line-through-style": "solid", + "text-line-through-color": gComputedStyle.color + }; testTextAttrs(ID, 111, attrs, defAttrs, 110, 123); attrs = {}; @@ -437,6 +449,48 @@ attrs = { }; testTextAttrs(ID, 31, attrs, defAttrs, 31, 45); + ////////////////////////////////////////////////////////////////////////// + // area17, "text-decoration" tests + ID = "area17"; + defAttrs = buildDefaultTextAttrs(ID, "12pt"); + testDefaultTextAttrs(ID, defAttrs); + + attrs = { + "text-underline-style": "solid", + "text-underline-color": "rgb(0, 0, 0)", + }; + testTextAttrs(ID, 0, attrs, defAttrs, 0, 10); + + attrs = { + "text-underline-style": "solid", + "text-underline-color": "rgb(0, 0, 255)", + }; + testTextAttrs(ID, 10, attrs, defAttrs, 10, 15); + + attrs = { + "text-underline-style": "dotted", + "text-underline-color": "rgb(0, 0, 0)", + }; + testTextAttrs(ID, 15, attrs, defAttrs, 15, 22); + + attrs = { + "text-line-through-style": "solid", + "text-line-through-color": "rgb(0, 0, 0)", + }; + testTextAttrs(ID, 22, attrs, defAttrs, 22, 34); + + attrs = { + "text-line-through-style": "solid", + "text-line-through-color": "rgb(0, 0, 255)", + }; + testTextAttrs(ID, 34, attrs, defAttrs, 34, 39); + + attrs = { + "text-line-through-style": "wavy", + "text-line-through-color": "rgb(0, 0, 0)", + }; + testTextAttrs(ID, 39, attrs, defAttrs, 39, 44); + SimpleTest.finish(); } @@ -450,12 +504,17 @@ href="https://bugzilla.mozilla.org/show_bug.cgi?id=345759" title="Implement text attributes"> Mozilla Bug 345759 -
+ Mozilla Bug 473576 + + Mozilla Bug 523304 +

@@ -546,5 +605,15 @@
     texttext
     texttext
   

+ +

+ underline + blue + dotted + linethrough + blue + wavy + +

diff --git a/accessible/tests/mochitest/common.js b/accessible/tests/mochitest/common.js index a80193e6fad..0cc663d9ccc 100644 --- a/accessible/tests/mochitest/common.js +++ b/accessible/tests/mochitest/common.js @@ -10,6 +10,8 @@ const nsIAccessibleCaretMoveEvent = Components.interfaces.nsIAccessibleCaretMoveEvent; const nsIAccessibleTextChangeEvent = Components.interfaces.nsIAccessibleTextChangeEvent; +const nsIAccessibleVirtualCursorChangeEvent = + Components.interfaces.nsIAccessibleVirtualCursorChangeEvent; const nsIAccessibleStates = Components.interfaces.nsIAccessibleStates; const nsIAccessibleRole = Components.interfaces.nsIAccessibleRole; diff --git a/accessible/tests/mochitest/pivot.js b/accessible/tests/mochitest/pivot.js index 6449c48f379..86802373908 100644 --- a/accessible/tests/mochitest/pivot.js +++ b/accessible/tests/mochitest/pivot.js @@ -74,6 +74,15 @@ function virtualCursorChangedChecker(aDocAcc, aIdOrNameOrAcc, aTextOffsets) this.check = function virtualCursorChangedChecker_check(aEvent) { + SimpleTest.info("virtualCursorChangedChecker_check"); + + var event = null; + try { + event = aEvent.QueryInterface(nsIAccessibleVirtualCursorChangeEvent); + } catch (e) { + SimpleTest.ok(false, "Does not support correct interface: " + e); + } + var position = aDocAcc.virtualCursor.position; var idMatches = position.DOMNode.id == aIdOrNameOrAcc; @@ -90,9 +99,38 @@ function virtualCursorChangedChecker(aDocAcc, aIdOrNameOrAcc, aTextOffsets) SimpleTest.is(aDocAcc.virtualCursor.endOffset, aTextOffsets[1], "wrong end offset"); } + + var prevPosAndOffset = virtualCursorChangedChecker. + getPreviousPosAndOffset(aDocAcc.virtualCursor); + + if (prevPosAndOffset) { + SimpleTest.is(event.oldAccessible, prevPosAndOffset.position, + "previous position does not match"); + SimpleTest.is(event.oldStartOffset, prevPosAndOffset.startOffset, + "previous start offset does not match"); + SimpleTest.is(event.oldEndOffset, prevPosAndOffset.endOffset, + "previous end offset does not match"); + } }; } +virtualCursorChangedChecker.prevPosAndOffset = {}; + +virtualCursorChangedChecker.storePreviousPosAndOffset = + function storePreviousPosAndOffset(aPivot) +{ + virtualCursorChangedChecker.prevPosAndOffset[aPivot] = + {position: aPivot.position, + startOffset: aPivot.startOffset, + endOffset: aPivot.endOffset}; +}; + +virtualCursorChangedChecker.getPreviousPosAndOffset = + function getPreviousPosAndOffset(aPivot) +{ + return virtualCursorChangedChecker.prevPosAndOffset[aPivot]; +}; + /** * Set a text range in the pivot and wait for virtual cursor change event. * @@ -105,6 +143,8 @@ function setVirtualCursorRangeInvoker(aDocAcc, aTextAccessible, aTextOffsets) { this.invoke = function virtualCursorChangedInvoker_invoke() { + virtualCursorChangedChecker. + storePreviousPosAndOffset(aDocAcc.virtualCursor); SimpleTest.info(prettyName(aTextAccessible) + " " + aTextOffsets); aDocAcc.virtualCursor.setTextRange(aTextAccessible, aTextOffsets[0], @@ -136,6 +176,8 @@ function setVirtualCursorPosInvoker(aDocAcc, aPivotMoveMethod, aRule, { this.invoke = function virtualCursorChangedInvoker_invoke() { + virtualCursorChangedChecker. + storePreviousPosAndOffset(aDocAcc.virtualCursor); var moved = aDocAcc.virtualCursor[aPivotMoveMethod](aRule); SimpleTest.ok((aIdOrNameOrAcc && moved) || (!aIdOrNameOrAcc && !moved), "moved pivot"); diff --git a/browser/app/blocklist.xml b/browser/app/blocklist.xml index d7ba29e6461..27adc22e659 100644 --- a/browser/app/blocklist.xml +++ b/browser/app/blocklist.xml @@ -1,5 +1,5 @@ - + @@ -19,18 +19,6 @@ - - - - - - - - - - - - @@ -63,18 +51,6 @@ - - - - - - - - - - - - @@ -89,18 +65,8 @@ - - - - - - - - - - - - + + @@ -121,13 +87,6 @@ - - - - - - - @@ -136,35 +95,18 @@ - - - - - + + - - - - - - - - - - - - - - @@ -203,17 +145,6 @@ - - - - - - - - - - - @@ -230,39 +161,11 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -271,24 +174,10 @@ - - - - - - - - - - - - - - diff --git a/browser/base/content/browser-menubar.inc b/browser/base/content/browser-menubar.inc index c9b5ce07e1e..a6adbdb85d7 100644 --- a/browser/base/content/browser-menubar.inc +++ b/browser/base/content/browser-menubar.inc @@ -291,12 +291,12 @@ - + @@ -2841,15 +2839,19 @@ this.parentNode && this.parentNode.localName == "toolbar" ? this.parentNode : this; ]]> + false + @@ -3080,6 +3082,9 @@ %debuggerDTD; ]> + + + + + + + + + + + + + + + + + +
diff --git a/browser/devtools/debugger/test/Makefile.in b/browser/devtools/debugger/test/Makefile.in index bb3e29eb67b..0a96d99a763 100644 --- a/browser/devtools/debugger/test/Makefile.in +++ b/browser/devtools/debugger/test/Makefile.in @@ -74,6 +74,7 @@ _BROWSER_TEST_FILES = \ browser_dbg_select-line.js \ browser_dbg_clean-exit.js \ browser_dbg_bug723069_editor-breakpoints.js \ + browser_dbg_bug731394_editor-contextmenu.js \ head.js \ $(NULL) diff --git a/browser/devtools/debugger/test/browser_dbg_bug731394_editor-contextmenu.js b/browser/devtools/debugger/test/browser_dbg_bug731394_editor-contextmenu.js new file mode 100644 index 00000000000..e4be65aac2c --- /dev/null +++ b/browser/devtools/debugger/test/browser_dbg_bug731394_editor-contextmenu.js @@ -0,0 +1,102 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +/** + * Bug 731394: test the debugger source editor default context menu. + */ + +const TAB_URL = EXAMPLE_URL + "browser_dbg_script-switching.html"; + +let gPane = null; +let gTab = null; +let gDebuggee = null; +let gDebugger = null; + +function test() +{ + let tempScope = {}; + Cu.import("resource:///modules/source-editor.jsm", tempScope); + let SourceEditor = tempScope.SourceEditor; + + let contextMenu = null; + + debug_tab_pane(TAB_URL, function(aTab, aDebuggee, aPane) { + gTab = aTab; + gDebuggee = aDebuggee; + gPane = aPane; + gDebugger = gPane.debuggerWindow; + + gPane.activeThread.addOneTimeListener("scriptsadded", function() { + Services.tm.currentThread.dispatch({ run: onScriptsAdded }, 0); + }); + gDebuggee.firstCall(); + }); + + function onScriptsAdded() + { + let scripts = gDebugger.DebuggerView.Scripts._scripts; + + is(gDebugger.StackFrames.activeThread.state, "paused", + "Should only be getting stack frames while paused."); + + is(scripts.itemCount, 2, "Found the expected number of scripts."); + + let editor = gDebugger.editor; + + isnot(editor.getText().indexOf("debugger"), -1, + "The correct script was loaded initially."); + + contextMenu = gDebugger.document.getElementById("sourceEditorContextMenu"); + ok(contextMenu, "source editor context menupopup"); + ok(editor.readOnly, "editor is read only"); + + editor.focus(); + editor.setSelection(0, 10); + + contextMenu.addEventListener("popupshown", function onPopupShown() { + contextMenu.removeEventListener("popupshown", onPopupShown, false); + executeSoon(testContextMenu); + }, false); + contextMenu.openPopup(editor.editorElement, "overlap", 0, 0, true, false); + } + + function testContextMenu() + { + let document = gDebugger.document; + + ok(document.getElementById("editMenuCommands"), + "#editMenuCommands found"); + ok(!document.getElementById("editMenuKeys"), + "#editMenuKeys not found"); + ok(document.getElementById("sourceEditorCommands"), + "#sourceEditorCommands found"); + ok(document.getElementById("sourceEditorKeys"), + "#sourceEditorKeys found"); + + // Map command ids to their expected disabled state. + let commands = {"se-cmd-undo": true, "se-cmd-redo": true, + "se-cmd-cut": true, "se-cmd-paste": true, + "se-cmd-delete": true, "cmd_findAgain": true, + "cmd_findPrevious": true, "cmd_find": false, + "cmd_gotoLine": false, "cmd_copy": false, + "se-cmd-selectAll": false}; + for (let id in commands) { + let element = document.getElementById(id); + is(element.hasAttribute("disabled"), commands[id], + id + " hasAttribute('disabled') check"); + } + + executeSoon(function() { + contextMenu.hidePopup(); + gDebugger.StackFrames.activeThread.resume(finish); + }); + } + + registerCleanupFunction(function() { + removeTab(gTab); + gPane = null; + gTab = null; + gDebuggee = null; + gDebugger = null; + }); +} diff --git a/browser/devtools/jar.mn b/browser/devtools/jar.mn index 396a1b302e0..8c918130825 100644 --- a/browser/devtools/jar.mn +++ b/browser/devtools/jar.mn @@ -10,7 +10,7 @@ browser.jar: content/browser/devtools/cssruleview.xul (styleinspector/cssruleview.xul) content/browser/devtools/styleinspector.css (styleinspector/styleinspector.css) content/browser/orion.js (sourceeditor/orion/orion.js) - content/browser/source-editor-overlay.xul (sourceeditor/source-editor-overlay.xul) +* content/browser/source-editor-overlay.xul (sourceeditor/source-editor-overlay.xul) * content/browser/debugger.xul (debugger/debugger.xul) content/browser/debugger.css (debugger/debugger.css) content/browser/debugger.js (debugger/debugger.js) diff --git a/browser/devtools/scratchpad/scratchpad.xul b/browser/devtools/scratchpad/scratchpad.xul index 7efe53bed14..d57cdf95c62 100644 --- a/browser/devtools/scratchpad/scratchpad.xul +++ b/browser/devtools/scratchpad/scratchpad.xul @@ -111,21 +111,6 @@ modifiers="accel"/> --> - - - - - - - - -#ifdef XP_MACOSX - - -#else - - -#endif @@ -219,56 +182,20 @@ - - + onpopupshowing="goUpdateSourceEditorMenuItems()"> + + - - - + + + - + - - + + - + @@ -338,13 +265,13 @@ - - - - + onpopupshowing="goUpdateSourceEditorMenuItems()"> + + + + - + - + diff --git a/browser/devtools/scratchpad/test/browser_scratchpad_bug_699130_edit_ui_updates.js b/browser/devtools/scratchpad/test/browser_scratchpad_bug_699130_edit_ui_updates.js index 72e58eb8b15..4befa8d690f 100644 --- a/browser/devtools/scratchpad/test/browser_scratchpad_bug_699130_edit_ui_updates.js +++ b/browser/devtools/scratchpad/test/browser_scratchpad_bug_699130_edit_ui_updates.js @@ -27,7 +27,7 @@ function runTests() let doc = gScratchpadWindow.document; let winUtils = gScratchpadWindow.QueryInterface(Ci.nsIInterfaceRequestor). getInterface(Ci.nsIDOMWindowUtils); - let OS = Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULRuntime).OS; + let OS = Services.appinfo.OS; info("will test the Edit menu"); @@ -51,9 +51,9 @@ function runTests() let menuPopup = editMenu.menupopup; ok(menuPopup, "the Edit menupopup"); - let cutItem = doc.getElementById("sp-menu-cut"); + let cutItem = doc.getElementById("se-menu-cut"); ok(cutItem, "the Cut menuitem"); - let pasteItem = doc.getElementById("sp-menu-paste"); + let pasteItem = doc.getElementById("se-menu-paste"); ok(pasteItem, "the Paste menuitem"); let anchor = doc.documentElement; @@ -174,9 +174,9 @@ function runTests() menuPopup = doc.getElementById("scratchpad-text-popup"); ok(menuPopup, "the context menupopup"); - cutItem = doc.getElementById("menu_cut"); + cutItem = doc.getElementById("se-cMenu-cut"); ok(cutItem, "the Cut menuitem"); - pasteItem = doc.getElementById("menu_paste"); + pasteItem = doc.getElementById("se-cMenu-paste"); ok(pasteItem, "the Paste menuitem"); sp.setText("bug 699130: hello world! (context menu)"); diff --git a/browser/devtools/sourceeditor/source-editor-orion.jsm b/browser/devtools/sourceeditor/source-editor-orion.jsm index e7dc16e24e1..fa0408c7c3c 100644 --- a/browser/devtools/sourceeditor/source-editor-orion.jsm +++ b/browser/devtools/sourceeditor/source-editor-orion.jsm @@ -24,6 +24,7 @@ * Kenny Heaton * Spyros Livathinos * Allen Eubank + * Girish Sharma * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or @@ -63,6 +64,14 @@ const ORION_IFRAME = "data:text/html;charset=utf8," + const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; +/** + * Maximum allowed vertical offset for the line index when you call + * SourceEditor.setCaretPosition(). + * + * @type number + */ +const VERTICAL_OFFSET = 3; + /** * The primary selection update delay. On Linux, the X11 primary selection is * updated to hold the currently selected text. @@ -109,6 +118,10 @@ const ORION_ANNOTATION_TYPES = { * Default key bindings in the Orion editor. */ const DEFAULT_KEYBINDINGS = [ + { + action: "enter", + code: Ci.nsIDOMKeyEvent.DOM_VK_ENTER, + }, { action: "undo", code: Ci.nsIDOMKeyEvent.DOM_VK_Z, @@ -465,6 +478,10 @@ SourceEditor.prototype = { */ _doTab: function SE__doTab() { + if (this.readOnly) { + return false; + } + let indent = "\t"; let selection = this.getSelection(); let model = this._model; @@ -515,6 +532,10 @@ SourceEditor.prototype = { */ _doUnindentLines: function SE__doUnindentLines() { + if (this.readOnly) { + return true; + } + let indent = "\t"; let selection = this.getSelection(); @@ -569,6 +590,10 @@ SourceEditor.prototype = { */ _doEnter: function SE__doEnter() { + if (this.readOnly) { + return false; + } + let selection = this.getSelection(); if (selection.start != selection.end) { return false; @@ -1309,10 +1334,56 @@ SourceEditor.prototype = { * The new caret line location. Line numbers start from 0. * @param number [aColumn=0] * Optional. The new caret column location. Columns start from 0. + * @param number [aAlign=0] + * Optional. Position of the line with respect to viewport. + * Allowed values are: + * SourceEditor.VERTICAL_ALIGN.TOP target line at top of view. + * SourceEditor.VERTICAL_ALIGN.CENTER target line at center of view. + * SourceEditor.VERTICAL_ALIGN.BOTTOM target line at bottom of view. */ - setCaretPosition: function SE_setCaretPosition(aLine, aColumn) + setCaretPosition: function SE_setCaretPosition(aLine, aColumn, aAlign) { - this.setCaretOffset(this._model.getLineStart(aLine) + (aColumn || 0)); + let editorHeight = this._view.getClientArea().height; + let lineHeight = this._view.getLineHeight(); + let linesVisible = Math.floor(editorHeight/lineHeight); + let halfVisible = Math.round(linesVisible/2); + let firstVisible = this.getTopIndex(); + let lastVisible = this._view.getBottomIndex(); + let caretOffset = this._model.getLineStart(aLine) + (aColumn || 0); + + this._view.setSelection(caretOffset, caretOffset, false); + + // If the target line is in view, skip the vertical alignment part. + if (aLine <= lastVisible && aLine >= firstVisible) { + this._view.showSelection(); + return; + } + + // Setting the offset so that the line always falls in the upper half + // of visible lines (lower half for BOTTOM aligned). + // VERTICAL_OFFSET is the maximum allowed value. + let offset = Math.min(halfVisible, VERTICAL_OFFSET); + + let topIndex; + switch (aAlign) { + case this.VERTICAL_ALIGN.CENTER: + topIndex = Math.max(aLine - halfVisible, 0); + break; + + case this.VERTICAL_ALIGN.BOTTOM: + topIndex = Math.max(aLine - linesVisible + offset, 0); + break; + + default: // this.VERTICAL_ALIGN.TOP. + topIndex = Math.max(aLine - offset, 0); + break; + } + // Bringing down the topIndex to total lines in the editor if exceeding. + topIndex = Math.min(topIndex, this.getLineCount()); + this.setTopIndex(topIndex); + + let location = this._view.getLocationAtOffset(caretOffset); + this._view.setHorizontalPixel(location.x); }, /** diff --git a/browser/devtools/sourceeditor/source-editor-overlay.xul b/browser/devtools/sourceeditor/source-editor-overlay.xul index 52d2d0684a1..4533e82092b 100644 --- a/browser/devtools/sourceeditor/source-editor-overlay.xul +++ b/browser/devtools/sourceeditor/source-editor-overlay.xul @@ -35,80 +35,203 @@ - the terms of any one of the MPL, the GPL or the LGPL. - - ***** END LICENSE BLOCK ***** --> - + + %editMenuStrings; + + %sourceEditorStrings; +]> + the source-editor-overlay.xul is loaded. Do not use #editMenuKeys to + avoid conflicts! --> + + + + + + + + +#ifdef XP_UNIX + +#else + +#endif + + + + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/browser/devtools/sourceeditor/source-editor-ui.jsm b/browser/devtools/sourceeditor/source-editor-ui.jsm index c28c590685d..82fce6a8800 100644 --- a/browser/devtools/sourceeditor/source-editor-ui.jsm +++ b/browser/devtools/sourceeditor/source-editor-ui.jsm @@ -253,6 +253,10 @@ SourceEditorController.prototype = { case "cmd_gotoLine": case "se-cmd-undo": case "se-cmd-redo": + case "se-cmd-cut": + case "se-cmd-paste": + case "se-cmd-delete": + case "se-cmd-selectAll": result = true; break; default: @@ -278,6 +282,7 @@ SourceEditorController.prototype = { switch (aCommand) { case "cmd_find": case "cmd_gotoLine": + case "se-cmd-selectAll": result = true; break; case "cmd_findAgain": @@ -290,6 +295,19 @@ SourceEditorController.prototype = { case "se-cmd-redo": result = this._editor.canRedo(); break; + case "se-cmd-cut": + case "se-cmd-delete": { + let selection = this._editor.getSelection(); + result = selection.start != selection.end && !this._editor.readOnly; + break; + } + case "se-cmd-paste": { + let window = this._editor._view._frameWindow; + let controller = window.controllers.getControllerForCommand("cmd_paste"); + result = !this._editor.readOnly && + controller.isCommandEnabled("cmd_paste"); + break; + } default: result = false; break; @@ -320,12 +338,26 @@ SourceEditorController.prototype = { case "cmd_gotoLine": this._editor.ui.gotoLine(); break; + case "se-cmd-selectAll": + this._editor._view.invokeAction("selectAll"); + break; case "se-cmd-undo": this._editor.undo(); break; case "se-cmd-redo": this._editor.redo(); break; + case "se-cmd-cut": + this._editor.ui._ownerWindow.goDoCommand("cmd_cut"); + break; + case "se-cmd-paste": + this._editor.ui._ownerWindow.goDoCommand("cmd_paste"); + break; + case "se-cmd-delete": { + let selection = this._editor.getSelection(); + this._editor.setText("", selection.start, selection.end); + break; + } } }, diff --git a/browser/devtools/sourceeditor/source-editor.jsm b/browser/devtools/sourceeditor/source-editor.jsm index 7eb31982c65..3f159801256 100644 --- a/browser/devtools/sourceeditor/source-editor.jsm +++ b/browser/devtools/sourceeditor/source-editor.jsm @@ -312,6 +312,16 @@ SourceEditor.EVENTS = { DIRTY_CHANGED: "DirtyChanged", }; +/** + * Allowed vertical alignment options for the line index + * when you call SourceEditor.setCaretPosition(). + */ +SourceEditor.VERTICAL_ALIGN = { + TOP: 0, + CENTER: 1, + BOTTOM: 2, +}; + /** * Extend a destination object with properties from a source object. * @@ -336,6 +346,7 @@ extend(SourceEditor.prototype, { MODES: SourceEditor.MODES, THEMES: SourceEditor.THEMES, DEFAULTS: SourceEditor.DEFAULTS, + VERTICAL_ALIGN: SourceEditor.VERTICAL_ALIGN, _lastFind: null, diff --git a/browser/devtools/sourceeditor/test/Makefile.in b/browser/devtools/sourceeditor/test/Makefile.in index 94aaf9beea0..b7c1c5d2309 100644 --- a/browser/devtools/sourceeditor/test/Makefile.in +++ b/browser/devtools/sourceeditor/test/Makefile.in @@ -60,6 +60,7 @@ _BROWSER_TEST_FILES = \ browser_bug712982_line_ruler_click.js \ browser_bug725618_moveLines_shortcut.js \ browser_bug700893_dirty_state.js \ + browser_bug729480_line_vertical_align.js \ head.js \ libs:: $(_BROWSER_TEST_FILES) diff --git a/browser/devtools/sourceeditor/test/browser_bug729480_line_vertical_align.js b/browser/devtools/sourceeditor/test/browser_bug729480_line_vertical_align.js new file mode 100644 index 00000000000..171141ba521 --- /dev/null +++ b/browser/devtools/sourceeditor/test/browser_bug729480_line_vertical_align.js @@ -0,0 +1,99 @@ +/* vim: set ts=2 et sw=2 tw=80: */ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +let tempScope = {}; +Cu.import("resource:///modules/source-editor.jsm", tempScope); +let SourceEditor = tempScope.SourceEditor; + +let testWin; +let editor; +const VERTICAL_OFFSET = 3; + +function test() +{ + waitForExplicitFinish(); + + const windowUrl = "data:application/vnd.mozilla.xul+xml," + + ""; + const windowFeatures = "chrome,titlebar,toolbar,centerscreen,dialog=no"; + + testWin = Services.ww.openWindow(null, windowUrl, "_blank", windowFeatures, null); + testWin.addEventListener("load", function onWindowLoad() { + testWin.removeEventListener("load", onWindowLoad, false); + waitForFocus(initEditor, testWin); + }, false); +} + +function initEditor() +{ + let box = testWin.document.querySelector("box"); + + editor = new SourceEditor(); + editor.init(box, {showLineNumbers: true}, editorLoaded); +} + +function editorLoaded() +{ + editor.focus(); + + // setting 3 pages of lines containing the line number. + let view = editor._view; + + let lineHeight = view.getLineHeight(); + let editorHeight = view.getClientArea().height; + let linesPerPage = Math.floor(editorHeight / lineHeight); + let totalLines = 3 * linesPerPage; + + let text = ""; + for (let i = 0; i < totalLines; i++) { + text += "Line " + i + "\n"; + } + + editor.setText(text); + editor.setCaretOffset(0); + + let offset = Math.min(Math.round(linesPerPage/2), VERTICAL_OFFSET); + // Building the iterator array. + // [line, alignment, topIndex_check] + let iterateOn = [ + [0, "TOP", 0], + [25, "TOP", 25 - offset], + // Case when the target line is already in view. + [27, "TOP", 25 - offset], + [0, "BOTTOM", 0], + [5, "BOTTOM", 0], + [38, "BOTTOM", 38 - linesPerPage + offset], + [0, "CENTER", 0], + [4, "CENTER", 0], + [34, "CENTER", 34 - Math.round(linesPerPage/2)] + ]; + + function testEnd() { + editor.destroy(); + testWin.close(); + testWin = editor = null; + waitForFocus(finish, window); + } + + function testPosition(pos) { + is(editor.getTopIndex(), iterateOn[pos][2], "scroll is correct for test #" + pos); + iterator(++pos); + } + + function iterator(i) { + if (i == iterateOn.length) { + testEnd(); + } else { + editor.setCaretPosition(iterateOn[i][0], 0, + editor.VERTICAL_ALIGN[iterateOn[i][1]]); + executeSoon(testPosition.bind(this, i)); + } + } + iterator(0); +} diff --git a/browser/devtools/sourceeditor/test/browser_sourceeditor_initialization.js b/browser/devtools/sourceeditor/test/browser_sourceeditor_initialization.js index f2431f0e956..92ec1fbce57 100644 --- a/browser/devtools/sourceeditor/test/browser_sourceeditor_initialization.js +++ b/browser/devtools/sourceeditor/test/browser_sourceeditor_initialization.js @@ -201,11 +201,21 @@ function editorLoaded() editor.setText("foobar"); is(editor.getText(), "foobar", "editor allows programmatic changes (setText)"); + EventUtils.synthesizeKey("VK_RETURN", {}, testWin); + is(editor.getText(), "foobar", "Enter key does nothing"); + + EventUtils.synthesizeKey("VK_TAB", {}, testWin); + is(editor.getText(), "foobar", "Tab does nothing"); + + editor.setText(" foobar"); + EventUtils.synthesizeKey("VK_TAB", {shiftKey: true}, testWin); + is(editor.getText(), " foobar", "Shift+Tab does nothing"); + editor.readOnly = false; editor.setCaretOffset(editor.getCharCount()); EventUtils.synthesizeKey("-", {}, testWin); - is(editor.getText(), "foobar-", "editor is now editable again"); + is(editor.getText(), " foobar-", "editor is now editable again"); // Test the Selection event. diff --git a/browser/devtools/styleeditor/styleeditor.xul b/browser/devtools/styleeditor/styleeditor.xul index d27b9db46e1..57c49cbc38f 100644 --- a/browser/devtools/styleeditor/styleeditor.xul +++ b/browser/devtools/styleeditor/styleeditor.xul @@ -57,7 +57,22 @@ - + + + + + + + + + + + + + + + @@ -66,7 +81,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/browser/locales/en-US/chrome/browser/devtools/sourceeditor.dtd b/browser/locales/en-US/chrome/browser/devtools/sourceeditor.dtd index e26a92d2d5f..e512028baa2 100644 --- a/browser/locales/en-US/chrome/browser/devtools/sourceeditor.dtd +++ b/browser/locales/en-US/chrome/browser/devtools/sourceeditor.dtd @@ -10,23 +10,6 @@ - A good criteria is the language in which you'd find the best - documentation on web development on the web. --> - - - - - - - - - - - - - - - - - diff --git a/browser/modules/KeywordURLResetPrompter.jsm b/browser/modules/KeywordURLResetPrompter.jsm new file mode 100644 index 00000000000..4991b55475e --- /dev/null +++ b/browser/modules/KeywordURLResetPrompter.jsm @@ -0,0 +1,105 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +let EXPORTED_SYMBOLS = [ "KeywordURLResetPrompter" ]; + +const Ci = Components.interfaces; +const Cc = Components.classes; +const Cu = Components.utils; + +Cu.import("resource://gre/modules/Services.jsm"); + +const KEYWORD_PROMPT_REV = 1; + +let KeywordURLResetPrompter = { + get shouldPrompt() { + let keywordURLUserSet = Services.prefs.prefHasUserValue("keyword.URL"); + let declinedRev; + try { + declinedRev = Services.prefs.getIntPref("browser.keywordURLPromptDeclined"); + } catch (ex) {} + + return keywordURLUserSet && declinedRev != KEYWORD_PROMPT_REV; + }, + + prompt: function KeywordURLResetPrompter_prompt(win, keywordURI) { + let tabbrowser = win.gBrowser; + let notifyBox = tabbrowser.getNotificationBox(); + + let existingNotification = notifyBox.getNotificationWithValue("keywordURL-reset"); + if (existingNotification) + return; + + // Find the name/URI of this build's original default engine. + // XXX: Can't use originalDefaultEngine getter here, because that doesn't + // use the default pref branch. + let defaultURI; + let defaultEngine; + try { + let defaultPB = Services.prefs.getDefaultBranch(null); + let defaultName = defaultPB.getComplexValue("browser.search.defaultenginename", + Ci.nsIPrefLocalizedString).data; + defaultEngine = Services.search.getEngineByName(defaultName); + defaultURI = defaultEngine.getSubmission("foo").uri; + } catch (ex) { + // Something went horribly wrong! bail out + return; + } + + // If the user-set value has the same base domain as the default, don't + // prompt. + let keywordBaseDomain; + try { + keywordBaseDomain = Services.eTLD.getBaseDomain(keywordURI); + if (keywordBaseDomain == Services.eTLD.getBaseDomain(defaultURI)) + return; + } catch (ex) {} + + if (!keywordBaseDomain) + return; + + let brandBundle = Services.strings.createBundle("chrome://branding/locale/brand.properties"); + let brandShortName = brandBundle.GetStringFromName("brandShortName"); + + let browserBundle = win.gNavigatorBundle; + let msg = browserBundle.getFormattedString("keywordPrompt.message", + [brandShortName, keywordBaseDomain, + defaultEngine.name]); + let buttons = [ + { + label: browserBundle.getFormattedString("keywordPrompt.yesButton", + [defaultEngine.name]), + accessKey: browserBundle.getString("keywordPrompt.yesButton.accessKey"), + popup: null, + callback: function(aNotificationBar, aButton) { + Services.prefs.clearUserPref("keyword.URL"); + try { + // If the currently loaded URI still has the same base domain as the + // keyword URI (this is used as a rough approximation of whether the + // user is still seeing search results as opposed to having clicked + // on a result link), load the default engine's searchForm URL so + // that they can re-do their search. + let currentBaseDomain = Services.eTLD.getBaseDomain(tabbrowser.currentURI); + if (currentBaseDomain == keywordBaseDomain) + tabbrowser.loadURI(defaultEngine.searchForm); + } catch (ex) {} + } + }, + { + label: browserBundle.getFormattedString("keywordPrompt.noButton", + [keywordBaseDomain]), + accessKey: browserBundle.getString("keywordPrompt.noButton.accessKey"), + popup: null, + callback: function(aNotificationBar, aButton) { + Services.prefs.setIntPref("browser.keywordURLPromptDeclined", KEYWORD_PROMPT_REV); + } + } + ]; + + let notification = notifyBox.appendNotification(msg, "keywordURL-reset", null, notifyBox.PRIORITY_WARNING_HIGH, buttons); + notification.setAttribute("hideclose", true); + // stick around for a few page loads in case there are redirects involved + notification.persistence = 3; + } +} diff --git a/browser/modules/Makefile.in b/browser/modules/Makefile.in index ba2063663ab..7357fa997e7 100644 --- a/browser/modules/Makefile.in +++ b/browser/modules/Makefile.in @@ -52,6 +52,7 @@ EXTRA_JS_MODULES = \ NewTabUtils.jsm \ offlineAppCache.jsm \ TelemetryTimestamps.jsm \ + KeywordURLResetPrompter.jsm \ $(NULL) ifeq ($(MOZ_WIDGET_TOOLKIT),windows) diff --git a/browser/themes/gnomestripe/devtools/csshtmltree.css b/browser/themes/gnomestripe/devtools/csshtmltree.css index 0ee9c461260..1cb385a2adf 100644 --- a/browser/themes/gnomestripe/devtools/csshtmltree.css +++ b/browser/themes/gnomestripe/devtools/csshtmltree.css @@ -205,7 +205,7 @@ .ruleview-rule-source { background-color: -moz-dialog; - color: #0091ff; + color: -moz-dialogText; padding: 2px 5px; cursor: pointer; } diff --git a/browser/themes/gnomestripe/places/livemark-item.png b/browser/themes/gnomestripe/places/livemark-item.png index 8ef1ba4a5cd..9184b95187e 100644 Binary files a/browser/themes/gnomestripe/places/livemark-item.png and b/browser/themes/gnomestripe/places/livemark-item.png differ diff --git a/browser/themes/pinstripe/devtools/csshtmltree.css b/browser/themes/pinstripe/devtools/csshtmltree.css index e40f46af724..314c47b1fe4 100644 --- a/browser/themes/pinstripe/devtools/csshtmltree.css +++ b/browser/themes/pinstripe/devtools/csshtmltree.css @@ -207,7 +207,7 @@ .ruleview-rule-source { background-color: -moz-dialog; - color: #0091ff; + color: -moz-dialogText; padding: 2px 5px; cursor: pointer; } diff --git a/browser/themes/pinstripe/places/livemark-item.png b/browser/themes/pinstripe/places/livemark-item.png index 8ef1ba4a5cd..9184b95187e 100644 Binary files a/browser/themes/pinstripe/places/livemark-item.png and b/browser/themes/pinstripe/places/livemark-item.png differ diff --git a/browser/themes/winstripe/devtools/csshtmltree.css b/browser/themes/winstripe/devtools/csshtmltree.css index 42dce67568c..a88a00803a2 100644 --- a/browser/themes/winstripe/devtools/csshtmltree.css +++ b/browser/themes/winstripe/devtools/csshtmltree.css @@ -205,7 +205,7 @@ .ruleview-rule-source { background-color: -moz-dialog; - color: #0091ff; + color: -moz-dialogText; padding: 2px 5px; cursor: pointer; } diff --git a/browser/themes/winstripe/places/livemark-item.png b/browser/themes/winstripe/places/livemark-item.png index 8ef1ba4a5cd..9184b95187e 100644 Binary files a/browser/themes/winstripe/places/livemark-item.png and b/browser/themes/winstripe/places/livemark-item.png differ diff --git a/config/rules.mk b/config/rules.mk index 5e299925f5d..a9d51e5503d 100644 --- a/config/rules.mk +++ b/config/rules.mk @@ -960,10 +960,10 @@ ifdef MSMANIFEST_TOOL endif # MSVC with manifest tool else ifeq ($(CPP_PROG_LINK),1) - $(EXPAND_CCC) $(CXXFLAGS) -o $@ $< $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(MOZ_GLUE_PROGRAM_LDFLAGS) $(WRAP_LDFLAGS) $(LIBS_DIR) $(LIBS) $(OS_LIBS) $(EXTRA_LIBS) $(BIN_FLAGS) + $(EXPAND_CCC) $(CXXFLAGS) -o $@ $< $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(WRAP_LDFLAGS) $(LIBS_DIR) $(LIBS) $(MOZ_GLUE_PROGRAM_LDFLAGS) $(OS_LIBS) $(EXTRA_LIBS) $(BIN_FLAGS) @$(call CHECK_STDCXX,$@) else - $(EXPAND_CC) $(CFLAGS) $(OUTOPTION)$@ $< $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(MOZ_GLUE_PROGRAM_LDFLAGS) $(WRAP_LDFLAGS) $(LIBS_DIR) $(LIBS) $(OS_LIBS) $(EXTRA_LIBS) $(BIN_FLAGS) + $(EXPAND_CC) $(CFLAGS) $(OUTOPTION)$@ $< $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(WRAP_LDFLAGS) $(LIBS_DIR) $(LIBS) $(MOZ_GLUE_PROGRAM_LDFLAGS) $(OS_LIBS) $(EXTRA_LIBS) $(BIN_FLAGS) endif # CPP_PROG_LINK endif # WINNT && !GNU_CC diff --git a/configure.in b/configure.in index d1c61263d28..0a5dd86e59e 100644 --- a/configure.in +++ b/configure.in @@ -4931,6 +4931,10 @@ MOZ_ARG_HEADER(Toolkit Options) AC_MSG_ERROR([You must specify a default toolkit (perhaps $_PLATFORM_DEFAULT_TOOLKIT).]) fi +MOZ_ARG_WITHOUT_BOOL(x, +[ --without-x Build without X11], + WITHOUT_X11=1) + dnl ======================================================== dnl = Enable the toolkit as needed = dnl ======================================================== @@ -4965,16 +4969,17 @@ cairo-gtk2|cairo-gtk2-x11) cairo-qt) MOZ_WIDGET_TOOLKIT=qt MOZ_ENABLE_QT=1 - MOZ_ENABLE_XREMOTE=1 + if test -z "$WITHOUT_X11"; then + MOZ_ENABLE_XREMOTE=1 + MOZ_WEBGL_GLX=1 + MOZ_X11=1 + AC_DEFINE(MOZ_X11) + XT_LIBS= + fi + MOZ_WEBGL=1 - MOZ_WEBGL_GLX=1 USE_ELF_DYNSTR_GC= - - AC_DEFINE(MOZ_X11) - MOZ_X11=1 USE_FC_FREETYPE=1 - XT_LIBS= - TK_CFLAGS='$(MOZ_QT_CFLAGS)' TK_LIBS='$(MOZ_QT_LIBS)' AC_DEFINE(MOZ_WIDGET_QT) @@ -8843,6 +8848,9 @@ fi dnl Check for missing components if test "$COMPILE_ENVIRONMENT"; then if test "$MOZ_X11"; then + if test "$WITHOUT_X11"; then + AC_MSG_ERROR([--without-x specified and MOZ_X11 still defined]) + fi dnl ==================================================== dnl = Check if X headers exist dnl ==================================================== diff --git a/content/base/public/CORSMode.h b/content/base/public/CORSMode.h new file mode 100644 index 00000000000..0bed540d90d --- /dev/null +++ b/content/base/public/CORSMode.h @@ -0,0 +1,32 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef CORSMode_h_ +#define CORSMode_h_ + +namespace mozilla { + +enum CORSMode { + /** + * The default of not using CORS to validate cross-origin loads. + */ + CORS_NONE, + + /** + * Validate cross-site loads using CORS, but do not send any credentials + * (cookies, HTTP auth logins, etc) along with the request. + */ + CORS_ANONYMOUS, + + /** + * Validate cross-site loads using CORS, and send credentials such as cookies + * and HTTP auth logins along with the request. + */ + CORS_USE_CREDENTIALS +}; + +} // namespace mozilla + +#endif /* CORSMode_h_ */ diff --git a/content/base/public/Makefile.in b/content/base/public/Makefile.in index 3a9f08e5275..9d002e3cf6d 100644 --- a/content/base/public/Makefile.in +++ b/content/base/public/Makefile.in @@ -79,13 +79,17 @@ nsXMLNameSpaceMap.h \ nsIXFormsUtilityService.h \ $(NULL) -EXPORTS_NAMESPACES = mozilla/dom +EXPORTS_NAMESPACES = mozilla/dom mozilla EXPORTS_mozilla/dom = \ Element.h \ FromParser.h \ $(NULL) +EXPORTS_mozilla = \ + CORSMode.h \ + $(NULL) + SDK_XPIDLSRCS = \ nsISelection.idl \ $(NULL) @@ -97,7 +101,6 @@ XPIDLSRCS = \ nsIDOMFileReader.idl \ nsIDOMFileList.idl \ nsIDOMFileException.idl \ - nsIDOMFileError.idl \ nsIDOMFormData.idl \ nsIDOMParser.idl \ nsIDOMSerializer.idl \ diff --git a/content/base/public/nsContentUtils.h b/content/base/public/nsContentUtils.h index 4fdfaad807a..ebad2696580 100644 --- a/content/base/public/nsContentUtils.h +++ b/content/base/public/nsContentUtils.h @@ -1619,7 +1619,43 @@ public: * case for ASCII characters a-z. */ static bool EqualsIgnoreASCIICase(const nsAString& aStr1, - const nsAString& aStr2); + const nsAString& aStr2); + + /** + * Case insensitive comparison between a string and an ASCII literal. + * This must ONLY be applied to an actual literal string. Do not attempt + * to use it with a regular char* pointer, or with a char array variable. + * The template trick to acquire the array length at compile time without + * using a macro is due to Corey Kosak, which much thanks. + */ + static bool EqualsLiteralIgnoreASCIICase(const nsAString& aStr1, + const char* aStr2, + const PRUint32 len); +#ifdef NS_DISABLE_LITERAL_TEMPLATE + static inline bool + EqualsLiteralIgnoreASCIICase(const nsAString& aStr1, + const char* aStr2) + { + PRUint32 len = strlen(aStr2); + return EqualsLiteralIgnoreASCIICase(aStr1, aStr2, len); + } +#else + template + static inline bool + EqualsLiteralIgnoreASCIICase(const nsAString& aStr1, + const char (&aStr2)[N]) + { + return EqualsLiteralIgnoreASCIICase(aStr1, aStr2, N-1); + } + template + static inline bool + EqualsLiteralIgnoreASCIICase(const nsAString& aStr1, + char (&aStr2)[N]) + { + const char* s = aStr2; + return EqualsLiteralIgnoreASCIICase(aStr1, s, N-1); + } +#endif /** * Convert ASCII A-Z to a-z. diff --git a/content/base/public/nsDOMFile.h b/content/base/public/nsDOMFile.h index d188d4b2e51..5614b8219d8 100644 --- a/content/base/public/nsDOMFile.h +++ b/content/base/public/nsDOMFile.h @@ -43,7 +43,6 @@ #include "nsIFile.h" #include "nsIDOMFile.h" #include "nsIDOMFileList.h" -#include "nsIDOMFileError.h" #include "nsIInputStream.h" #include "nsIJSNativeInitializer.h" #include "nsIMutable.h" @@ -53,12 +52,13 @@ #include "nsIXMLHttpRequest.h" #include "prmem.h" #include "nsAutoPtr.h" -#include "mozilla/dom/indexedDB/FileInfo.h" -#include "mozilla/dom/indexedDB/FileManager.h" -#include "mozilla/dom/indexedDB/IndexedDatabaseManager.h" #include "mozilla/GuardObjects.h" #include "mozilla/StandardInteger.h" +#include "mozilla/dom/DOMError.h" +#include "mozilla/dom/indexedDB/FileInfo.h" +#include "mozilla/dom/indexedDB/FileManager.h" +#include "mozilla/dom/indexedDB/IndexedDatabaseManager.h" class nsIFile; class nsIInputStream; @@ -363,18 +363,6 @@ private: nsCOMArray mFiles; }; -class nsDOMFileError : public nsIDOMFileError -{ -public: - NS_DECL_ISUPPORTS - NS_DECL_NSIDOMFILEERROR - - nsDOMFileError(PRUint16 aErrorCode) : mCode(aErrorCode) {} - -private: - PRUint16 mCode; -}; - class NS_STACK_CLASS nsDOMFileInternalUrlHolder { public: nsDOMFileInternalUrlHolder(nsIDOMBlob* aFile, nsIPrincipal* aPrincipal diff --git a/content/base/public/nsIDOMFileError.idl b/content/base/public/nsIDOMFileError.idl deleted file mode 100644 index 2bdd2fe21b4..00000000000 --- a/content/base/public/nsIDOMFileError.idl +++ /dev/null @@ -1,50 +0,0 @@ -/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Mozilla Corporation - * Portions created by the Initial Developer are Copyright (C) 2007 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include "domstubs.idl" - -[scriptable, uuid(4BDAFB64-15E2-49C1-A090-4315A7884A56)] -interface nsIDOMFileError : nsISupports -{ - const unsigned short NOT_FOUND_ERR = 1; - const unsigned short SECURITY_ERR = 2; - const unsigned short ABORT_ERR = 3; - const unsigned short NOT_READABLE_ERR = 4; - const unsigned short ENCODING_ERR = 5; - - readonly attribute unsigned short code; -}; diff --git a/content/base/public/nsIDOMFileReader.idl b/content/base/public/nsIDOMFileReader.idl index 56306a585ee..1b62c648f51 100644 --- a/content/base/public/nsIDOMFileReader.idl +++ b/content/base/public/nsIDOMFileReader.idl @@ -39,9 +39,9 @@ interface nsIDOMEventListener; interface nsIDOMBlob; -interface nsIDOMFileError; +interface nsIDOMDOMError; -[scriptable, builtinclass, uuid(d158de26-904e-4731-b42c-8b3a4d172703)] +[scriptable, builtinclass, uuid(faed1779-b523-4060-8c3b-7199f347b273)] interface nsIDOMFileReader : nsIDOMEventTarget { [implicit_jscontext] @@ -59,7 +59,7 @@ interface nsIDOMFileReader : nsIDOMEventTarget [implicit_jscontext] readonly attribute jsval result; - readonly attribute nsIDOMFileError error; + readonly attribute nsIDOMDOMError error; attribute nsIDOMEventListener onloadstart; attribute nsIDOMEventListener onprogress; diff --git a/content/base/public/nsIDocument.h b/content/base/public/nsIDocument.h index 802210dd8fb..a12264842e3 100644 --- a/content/base/public/nsIDocument.h +++ b/content/base/public/nsIDocument.h @@ -1424,7 +1424,8 @@ public: /** * Called by nsParser to preload images. Can be removed and code moved * to nsPreloadURIs::PreloadURIs() in file nsParser.cpp whenever the - * parser-module is linked with gklayout-module. + * parser-module is linked with gklayout-module. aCrossOriginAttr should + * be a void string if the attr is not present. */ virtual void MaybePreLoadImage(nsIURI* uri, const nsAString& aCrossOriginAttr) = 0; diff --git a/content/base/public/nsIScriptElement.h b/content/base/public/nsIScriptElement.h index d15f0d2a50e..e6c04b72846 100644 --- a/content/base/public/nsIScriptElement.h +++ b/content/base/public/nsIScriptElement.h @@ -47,6 +47,7 @@ #include "nsIParser.h" #include "nsContentCreatorFunctions.h" #include "nsIDOMHTMLScriptElement.h" +#include "mozilla/CORSMode.h" #define NS_ISCRIPTELEMENT_IID \ { 0x24ab3ff2, 0xd75e, 0x4be4, \ @@ -258,6 +259,15 @@ public: return block; } + /** + * Get the CORS mode of the script element + */ + virtual mozilla::CORSMode GetCORSMode() const + { + /* Default to no CORS */ + return mozilla::CORS_NONE; + } + protected: /** * Processes the script if it's in the document-tree and links to or diff --git a/content/base/src/FileIOObject.cpp b/content/base/src/FileIOObject.cpp index d1f5312db60..813507beadd 100644 --- a/content/base/src/FileIOObject.cpp +++ b/content/base/src/FileIOObject.cpp @@ -119,13 +119,13 @@ FileIOObject::DispatchError(nsresult rv, nsAString& finalEvent) // Set the status attribute, and dispatch the error event switch (rv) { case NS_ERROR_FILE_NOT_FOUND: - mError = new nsDOMFileError(nsIDOMFileError::NOT_FOUND_ERR); + mError = DOMError::CreateWithName(NS_LITERAL_STRING("NotFoundError")); break; case NS_ERROR_FILE_ACCESS_DENIED: - mError = new nsDOMFileError(nsIDOMFileError::SECURITY_ERR); + mError = DOMError::CreateWithName(NS_LITERAL_STRING("SecurityError")); break; default: - mError = new nsDOMFileError(nsIDOMFileError::NOT_READABLE_ERR); + mError = DOMError::CreateWithName(NS_LITERAL_STRING("NotReadableError")); break; } @@ -258,14 +258,17 @@ FileIOObject::OnStopRequest(nsIRequest* aRequest, nsISupports* aContext, NS_IMETHODIMP FileIOObject::Abort() { - if (mReadyState != 1) + if (mReadyState != 1) { + // XXX The spec doesn't say this return NS_ERROR_DOM_FILE_ABORT_ERR; + } ClearProgressEventTimer(); mReadyState = 2; // There are DONE constants on multiple interfaces, // but they all have value 2. - mError = new nsDOMFileError(nsIDOMFileError::ABORT_ERR); + // XXX The spec doesn't say this + mError = DOMError::CreateWithName(NS_LITERAL_STRING("AbortError")); nsString finalEvent; nsresult rv = DoAbort(finalEvent); @@ -285,7 +288,7 @@ FileIOObject::GetReadyState(PRUint16 *aReadyState) } NS_IMETHODIMP -FileIOObject::GetError(nsIDOMFileError** aError) +FileIOObject::GetError(nsIDOMDOMError** aError) { NS_IF_ADDREF(*aError = mError); return NS_OK; diff --git a/content/base/src/FileIOObject.h b/content/base/src/FileIOObject.h index f5df017d479..3e05dcbaed3 100644 --- a/content/base/src/FileIOObject.h +++ b/content/base/src/FileIOObject.h @@ -45,9 +45,10 @@ #include "nsIDOMFile.h" #include "nsIStreamListener.h" #include "nsITimer.h" - #include "nsCOMPtr.h" +#include "mozilla/dom/DOMError.h" + #define NS_PROGRESS_EVENT_INTERVAL 50 namespace mozilla { @@ -69,7 +70,7 @@ public: // Common methods NS_METHOD Abort(); NS_METHOD GetReadyState(PRUint16* aReadyState); - NS_METHOD GetError(nsIDOMFileError** aError); + NS_METHOD GetError(nsIDOMDOMError** aError); NS_DECL_AND_IMPL_EVENT_HANDLER(abort); NS_DECL_AND_IMPL_EVENT_HANDLER(error); @@ -108,7 +109,7 @@ protected: bool mProgressEventWasDelayed; bool mTimerIsActive; - nsCOMPtr mError; + nsCOMPtr mError; nsCOMPtr mChannel; PRUint16 mReadyState; diff --git a/content/base/src/nsAttrValue.cpp b/content/base/src/nsAttrValue.cpp index 53dffd927e4..4b80af50f59 100644 --- a/content/base/src/nsAttrValue.cpp +++ b/content/base/src/nsAttrValue.cpp @@ -714,7 +714,7 @@ nsAttrValue::GetEnumString(nsAString& aResult, bool aRealTag) const if (table->value == val) { aResult.AssignASCII(table->tag); if (!aRealTag && allEnumBits & NS_ATTRVALUE_ENUMTABLE_VALUE_NEEDS_TO_UPPER) { - ToUpperCase(aResult); + nsContentUtils::ASCIIToUpper(aResult); } return; } @@ -1316,7 +1316,7 @@ nsAttrValue::ParseEnumValue(const nsAString& aValue, if (!equals) { nsAutoString tag; tag.AssignASCII(tableEntry->tag); - ToUpperCase(tag); + nsContentUtils::ASCIIToUpper(tag); if ((equals = tag.Equals(aValue))) { value |= NS_ATTRVALUE_ENUMTABLE_VALUE_NEEDS_TO_UPPER; } diff --git a/content/base/src/nsContentSink.cpp b/content/base/src/nsContentSink.cpp index 601e7829c0c..768acbce10f 100644 --- a/content/base/src/nsContentSink.cpp +++ b/content/base/src/nsContentSink.cpp @@ -617,8 +617,9 @@ nsContentSink::ProcessLinkHeader(nsIContent* aElement, if (media.IsEmpty()) { media = value; - // HTML4.0 spec is inconsistent, make it case INSENSITIVE - ToLowerCase(media); + // The HTML5 spec is formulated in terms of the CSS3 spec, + // which specifies that media queries are case insensitive. + nsContentUtils::ASCIIToLower(media); } } else if (attr.LowerCaseEqualsLiteral("anchor")) { if (anchor.IsEmpty()) { @@ -757,7 +758,7 @@ nsContentSink::ProcessMETATag(nsIContent* aContent) nsAutoString result; aContent->GetAttr(kNameSpaceID_None, nsGkAtoms::content, result); if (!result.IsEmpty()) { - ToLowerCase(header); + nsContentUtils::ASCIIToLower(header); nsCOMPtr fieldAtom(do_GetAtom(header)); rv = ProcessHeaderData(fieldAtom, result, aContent); } @@ -769,7 +770,7 @@ nsContentSink::ProcessMETATag(nsIContent* aContent) nsAutoString result; aContent->GetAttr(kNameSpaceID_None, nsGkAtoms::content, result); if (!result.IsEmpty()) { - ToLowerCase(result); + nsContentUtils::ASCIIToLower(result); mDocument->SetHeaderData(nsGkAtoms::handheldFriendly, result); } } diff --git a/content/base/src/nsContentUtils.cpp b/content/base/src/nsContentUtils.cpp index 3c764c9c32f..673b1488e41 100644 --- a/content/base/src/nsContentUtils.cpp +++ b/content/base/src/nsContentUtils.cpp @@ -5393,6 +5393,7 @@ nsContentUtils::ASCIIToUpper(const nsAString& aSource, nsAString& aDest) } } +/* static */ bool nsContentUtils::EqualsIgnoreASCIICase(const nsAString& aStr1, const nsAString& aStr2) @@ -5415,7 +5416,7 @@ nsContentUtils::EqualsIgnoreASCIICase(const nsAString& aStr1, return false; } - // We know they only differ in the 0x0020 bit. + // We know they can only differ in the 0x0020 bit. // Likely the two chars are the same, so check that first if (c1 != c2) { // They do differ, but since it's only in the 0x0020 bit, check if it's @@ -5430,6 +5431,44 @@ nsContentUtils::EqualsIgnoreASCIICase(const nsAString& aStr1, return true; } +/* static */ +bool +nsContentUtils::EqualsLiteralIgnoreASCIICase(const nsAString& aStr1, + const char* aStr2, + const PRUint32 len) +{ + if (aStr1.Length() != len) { + return false; + } + + const PRUnichar* str1 = aStr1.BeginReading(); + const char* str2 = aStr2; + const PRUnichar* end = str1 + len; + + while (str1 < end) { + PRUnichar c1 = *str1++; + PRUnichar c2 = *str2++; + + // First check if any bits other than the 0x0020 differs + if ((c1 ^ c2) & 0xffdf) { + return false; + } + + // We know they can only differ in the 0x0020 bit. + // Likely the two chars are the same, so check that first + if (c1 != c2) { + // They do differ, but since it's only in the 0x0020 bit, check if it's + // the same ascii char, but just differing in case + PRUnichar c1Upper = c1 & 0xffdf; + if (!('A' <= c1Upper && c1Upper <= 'Z')) { + return false; + } + } + } + + return true; +} + /* static */ nsIInterfaceRequestor* nsContentUtils::GetSameOriginChecker() diff --git a/content/base/src/nsDOMAttribute.cpp b/content/base/src/nsDOMAttribute.cpp index 77795865214..77d13ae228b 100644 --- a/content/base/src/nsDOMAttribute.cpp +++ b/content/base/src/nsDOMAttribute.cpp @@ -210,11 +210,11 @@ nsDOMAttribute::GetNameAtom(nsIContent* aContent) mNodeInfo->NamespaceID() == kNameSpaceID_None && aContent->IsInHTMLDocument() && aContent->IsHTML()) { - nsAutoString name; - mNodeInfo->NameAtom()->ToString(name); - nsAutoString lower; - ToLowerCase(name, lower); - nsCOMPtr nameAtom = do_GetAtom(lower); + nsString name; + mNodeInfo->GetName(name); + nsAutoString lowercaseName; + nsContentUtils::ASCIIToLower(name, lowercaseName); + nsCOMPtr nameAtom = do_GetAtom(lowercaseName); nameAtom.swap(result); } else { nsCOMPtr nameAtom = mNodeInfo->NameAtom(); diff --git a/content/base/src/nsDOMAttributeMap.cpp b/content/base/src/nsDOMAttributeMap.cpp index 6a6d442d643..f0617a0e5fa 100644 --- a/content/base/src/nsDOMAttributeMap.cpp +++ b/content/base/src/nsDOMAttributeMap.cpp @@ -335,9 +335,7 @@ nsDOMAttributeMap::SetNamedItemInternal(nsIDOMNode *aNode, else { if (mContent->IsInHTMLDocument() && mContent->IsHTML()) { - nsAutoString lower; - ToLowerCase(name, lower); - name = lower; + nsContentUtils::ASCIIToLower(name); } rv = mContent->NodeInfo()->NodeInfoManager()-> diff --git a/content/base/src/nsDOMFile.cpp b/content/base/src/nsDOMFile.cpp index a5a8786d9c9..0919c88cd8e 100644 --- a/content/base/src/nsDOMFile.cpp +++ b/content/base/src/nsDOMFile.cpp @@ -632,27 +632,6 @@ nsDOMFileList::Item(PRUint32 aIndex, nsIDOMFile **aFile) return NS_OK; } -//////////////////////////////////////////////////////////////////////////// -// nsDOMFileError implementation - -DOMCI_DATA(FileError, nsDOMFileError) - -NS_INTERFACE_MAP_BEGIN(nsDOMFileError) - NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMFileError) - NS_INTERFACE_MAP_ENTRY(nsIDOMFileError) - NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(FileError) -NS_INTERFACE_MAP_END - -NS_IMPL_ADDREF(nsDOMFileError) -NS_IMPL_RELEASE(nsDOMFileError) - -NS_IMETHODIMP -nsDOMFileError::GetCode(PRUint16* aCode) -{ - *aCode = mCode; - return NS_OK; -} - //////////////////////////////////////////////////////////////////////////// // nsDOMFileInternalUrlHolder implementation diff --git a/content/base/src/nsDOMFileReader.cpp b/content/base/src/nsDOMFileReader.cpp index 48f42da41bd..6324b968eb0 100644 --- a/content/base/src/nsDOMFileReader.cpp +++ b/content/base/src/nsDOMFileReader.cpp @@ -255,7 +255,7 @@ nsDOMFileReader::GetResult(JSContext* aCx, jsval* aResult) } NS_IMETHODIMP -nsDOMFileReader::GetError(nsIDOMFileError** aError) +nsDOMFileReader::GetError(nsIDOMDOMError** aError) { return FileIOObject::GetError(aError); } diff --git a/content/base/src/nsDOMFileReader.h b/content/base/src/nsDOMFileReader.h index 38dbe5bfd47..78e29813e51 100644 --- a/content/base/src/nsDOMFileReader.h +++ b/content/base/src/nsDOMFileReader.h @@ -54,7 +54,6 @@ #include "nsIDOMFile.h" #include "nsIDOMFileReader.h" #include "nsIDOMFileList.h" -#include "nsIDOMFileError.h" #include "nsIInputStream.h" #include "nsCOMPtr.h" #include "nsIStreamLoader.h" diff --git a/content/base/src/nsDocument.cpp b/content/base/src/nsDocument.cpp index 9cbbd96a346..7b0f63a0a6c 100644 --- a/content/base/src/nsDocument.cpp +++ b/content/base/src/nsDocument.cpp @@ -3247,6 +3247,14 @@ nsIDocument::TakeFrameRequestCallbacks(FrameRequestCallbackList& aCallbacks) mFrameRequestCallbacks.Clear(); } +PLDHashOperator RequestDiscardEnumerator(imgIRequest* aKey, + PRUint32 aData, + void* userArg) +{ + aKey->RequestDiscard(); + return PL_DHASH_NEXT; +} + void nsDocument::DeleteShell() { @@ -3255,6 +3263,11 @@ nsDocument::DeleteShell() RevokeAnimationFrameNotifications(); } + // When our shell goes away, request that all our images be immediately + // discarded, so we don't carry around decoded image data for a document we + // no longer intend to paint. + mImageTracker.EnumerateRead(RequestDiscardEnumerator, nsnull); + mPresShell = nsnull; } @@ -4414,7 +4427,7 @@ nsDocument::CreateElement(const nsAString& aTagName, bool needsLowercase = IsHTML() && !IsLowercaseASCII(aTagName); nsAutoString lcTagName; if (needsLowercase) { - ToLowerCase(aTagName, lcTagName); + nsContentUtils::ASCIIToLower(aTagName, lcTagName); } rv = CreateElem(needsLowercase ? lcTagName : aTagName, @@ -7724,14 +7737,20 @@ nsDocument::MaybePreLoadImage(nsIURI* uri, const nsAString &aCrossOriginAttr) } nsLoadFlags loadFlags = nsIRequest::LOAD_NORMAL; - if (aCrossOriginAttr.LowerCaseEqualsLiteral("anonymous")) { + switch (nsGenericElement::StringToCORSMode(aCrossOriginAttr)) { + case CORS_NONE: + // Nothing to do + break; + case CORS_ANONYMOUS: loadFlags |= imgILoader::LOAD_CORS_ANONYMOUS; - } else if (aCrossOriginAttr.LowerCaseEqualsLiteral("use-credentials")) { + break; + case CORS_USE_CREDENTIALS: loadFlags |= imgILoader::LOAD_CORS_USE_CREDENTIALS; + break; + default: + /* should never happen */ + MOZ_NOT_REACHED("Unknown CORS mode!"); } - // else should we err on the side of not doing the preload if - // aCrossOriginAttr is nonempty? Let's err on the side of doing the - // preload as CORS_NONE. // Image not in cache - trigger preload nsCOMPtr request; @@ -8309,26 +8328,32 @@ nsDocument::RemoveImage(imgIRequest* aImage) // If the count is now zero, remove from the tracker. // Otherwise, set the new value. - if (count == 0) { - mImageTracker.Remove(aImage); - } else { + if (count != 0) { mImageTracker.Put(aImage, count); + return NS_OK; } + mImageTracker.Remove(aImage); + nsresult rv = NS_OK; - // If we removed the image from the tracker and we're locking images, unlock - // this image. - if (count == 0 && mLockingImages) + // Now that we're no longer tracking this image, unlock it if we'd + // previously locked it. + if (mLockingImages) { rv = aImage->UnlockImage(); + } - // If we removed the image from the tracker and we're animating images, - // remove our request to animate this image. - if (count == 0 && mAnimatingImages) { + // If we're animating images, remove our request to animate this one. + if (mAnimatingImages) { nsresult rv2 = aImage->DecrementAnimationConsumers(); rv = NS_SUCCEEDED(rv) ? rv2 : rv; } + // Request that the image be discarded if nobody else holds a lock on it. + // Do this even if !mLockingImages, because even if we didn't just unlock + // this image, it might still be a candidate for discarding. + aImage->RequestDiscard(); + return rv; } diff --git a/content/base/src/nsGenericElement.cpp b/content/base/src/nsGenericElement.cpp index 88f1167a93d..0badc1cd79f 100644 --- a/content/base/src/nsGenericElement.cpp +++ b/content/base/src/nsGenericElement.cpp @@ -159,6 +159,8 @@ #include "nsLayoutStatics.h" #include "mozilla/Telemetry.h" +#include "mozilla/CORSMode.h" + using namespace mozilla; using namespace mozilla::dom; @@ -2853,15 +2855,16 @@ nsGenericElement::GetAttributeNS(const nsAString& aNamespaceURI, nsContentUtils::NameSpaceManager()->GetNameSpaceID(aNamespaceURI); if (nsid == kNameSpaceID_Unknown) { - // Unknown namespace means no attr... - - aReturn.Truncate(); - + // Unknown namespace means no attribute. + SetDOMStringToNull(aReturn); return NS_OK; } nsCOMPtr name = do_GetAtom(aLocalName); - GetAttr(nsid, name, aReturn); + bool hasAttr = GetAttr(nsid, name, aReturn); + if (!hasAttr) { + SetDOMStringToNull(aReturn); + } return NS_OK; } @@ -6235,6 +6238,48 @@ nsGenericElement::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const mAttrsAndChildren.SizeOfExcludingThis(aMallocSizeOf); } +static const nsAttrValue::EnumTable kCORSAttributeTable[] = { + // Order matters here + // See ParseCORSValue + { "anonymous", CORS_ANONYMOUS }, + { "use-credentials", CORS_USE_CREDENTIALS }, + { 0 } +}; + +/* static */ void +nsGenericElement::ParseCORSValue(const nsAString& aValue, + nsAttrValue& aResult) +{ + DebugOnly success = + aResult.ParseEnumValue(aValue, kCORSAttributeTable, false, + // default value is anonymous if aValue is + // not a value we understand + &kCORSAttributeTable[0]); + MOZ_ASSERT(success); +} + +/* static */ CORSMode +nsGenericElement::StringToCORSMode(const nsAString& aValue) +{ + if (aValue.IsVoid()) { + return CORS_NONE; + } + + nsAttrValue val; + nsGenericElement::ParseCORSValue(aValue, val); + return CORSMode(val.GetEnumValue()); +} + +/* static */ CORSMode +nsGenericElement::AttrValueToCORSMode(const nsAttrValue* aValue) +{ + if (!aValue) { + return CORS_NONE; + } + + return CORSMode(aValue->GetEnumValue()); +} + #define EVENT(name_, id_, type_, struct_) \ NS_IMETHODIMP nsINode::GetOn##name_(JSContext *cx, jsval *vp) { \ nsEventListenerManager *elm = GetListenerManager(false); \ diff --git a/content/base/src/nsGenericElement.h b/content/base/src/nsGenericElement.h index 9553c667bbc..0f6edf69254 100644 --- a/content/base/src/nsGenericElement.h +++ b/content/base/src/nsGenericElement.h @@ -65,6 +65,7 @@ #include "nsDOMClassInfoID.h" // DOMCI_DATA #include "nsIDOMTouchEvent.h" #include "nsIInlineEventHandlers.h" +#include "mozilla/CORSMode.h" #include "nsISMILAttr.h" @@ -640,6 +641,25 @@ public: void *aData); static void MarkUserDataHandler(void* aObject, nsIAtom* aKey, void* aChild, void* aData); + + /** + * Parse a string into an nsAttrValue for a CORS attribute. This + * never fails. The resulting value is an enumerated value whose + * GetEnumValue() returns one of the above constants. + */ + static void ParseCORSValue(const nsAString& aValue, nsAttrValue& aResult); + + /** + * Return the CORS mode for a given string + */ + static mozilla::CORSMode StringToCORSMode(const nsAString& aValue); + + /** + * Return the CORS mode for a given nsAttrValue (which may be null, + * but if not should have been parsed via ParseCORSValue). + */ + static mozilla::CORSMode AttrValueToCORSMode(const nsAttrValue* aValue); + protected: /* * Named-bools for use with SetAttrAndNotify to make call sites easier to diff --git a/content/base/src/nsGkAtomList.h b/content/base/src/nsGkAtomList.h index 18578f3a162..dd3c5afac42 100644 --- a/content/base/src/nsGkAtomList.h +++ b/content/base/src/nsGkAtomList.h @@ -2004,8 +2004,10 @@ GK_ATOM(setsize, "setsize") GK_ATOM(tableCellIndex, "table-cell-index") GK_ATOM(textAlign, "text-align") GK_ATOM(textIndent, "text-indent") +GK_ATOM(textLineThroughColor, "text-line-through-color") GK_ATOM(textLineThroughStyle, "text-line-through-style") GK_ATOM(textPosition, "text-position") +GK_ATOM(textUnderlineColor, "text-underline-color") GK_ATOM(textUnderlineStyle, "text-underline-style") GK_ATOM(toolbarname, "toolbarname") GK_ATOM(toolbarseparator, "toolbarseparator") diff --git a/content/base/src/nsImageLoadingContent.cpp b/content/base/src/nsImageLoadingContent.cpp index c7acfb4a11f..b41e2581239 100644 --- a/content/base/src/nsImageLoadingContent.cpp +++ b/content/base/src/nsImageLoadingContent.cpp @@ -60,7 +60,7 @@ #include "nsThreadUtils.h" #include "nsNetUtil.h" #include "nsAsyncDOMEvent.h" -#include "nsGenericHTMLElement.h" +#include "nsGenericElement.h" #include "nsIPresShell.h" #include "nsEventStates.h" @@ -82,6 +82,8 @@ #include "mozAutoDocUpdate.h" #include "mozilla/dom/Element.h" +using namespace mozilla; + #ifdef DEBUG_chb static void PrintReqURL(imgIRequest* req) { if (!req) { @@ -775,9 +777,9 @@ nsImageLoadingContent::LoadImage(nsIURI* aNewURI, nsLoadFlags loadFlags = aLoadFlags; PRInt32 corsmode = GetCORSMode(); - if (corsmode == nsGenericHTMLElement::CORS_ANONYMOUS) { + if (corsmode == CORS_ANONYMOUS) { loadFlags |= imgILoader::LOAD_CORS_ANONYMOUS; - } else if (corsmode == nsGenericHTMLElement::CORS_USE_CREDENTIALS) { + } else if (corsmode == CORS_USE_CREDENTIALS) { loadFlags |= imgILoader::LOAD_CORS_USE_CREDENTIALS; } @@ -1187,8 +1189,8 @@ nsImageLoadingContent::CreateStaticImageClone(nsImageLoadingContent* aDest) cons aDest->mSuppressed = mSuppressed; } -nsGenericHTMLElement::CORSMode +CORSMode nsImageLoadingContent::GetCORSMode() { - return nsGenericHTMLElement::CORS_NONE; + return CORS_NONE; } diff --git a/content/base/src/nsImageLoadingContent.h b/content/base/src/nsImageLoadingContent.h index 415afe9b7a3..cc788a759f3 100644 --- a/content/base/src/nsImageLoadingContent.h +++ b/content/base/src/nsImageLoadingContent.h @@ -54,6 +54,7 @@ #include "nsString.h" #include "nsEventStates.h" #include "nsGenericHTMLElement.h" +#include "mozilla/CORSMode.h" class nsIURI; class nsIDocument; @@ -183,7 +184,7 @@ protected: * Returns the CORS mode that will be used for all future image loads. The * default implementation returns CORS_NONE unconditionally. */ - virtual nsGenericHTMLElement::CORSMode GetCORSMode(); + virtual mozilla::CORSMode GetCORSMode(); private: /** diff --git a/content/base/src/nsScriptLoader.cpp b/content/base/src/nsScriptLoader.cpp index 34b1fce8cc0..b7559322cb2 100644 --- a/content/base/src/nsScriptLoader.cpp +++ b/content/base/src/nsScriptLoader.cpp @@ -74,13 +74,17 @@ #include "nsChannelPolicy.h" #include "nsCRT.h" #include "nsContentCreatorFunctions.h" +#include "nsGenericElement.h" +#include "nsCrossSiteListenerProxy.h" #include "mozilla/FunctionTimer.h" +#include "mozilla/CORSMode.h" #ifdef PR_LOGGING static PRLogModuleInfo* gCspPRLog; #endif +using namespace mozilla; using namespace mozilla::dom; ////////////////////////////////////////////////////////////// @@ -90,11 +94,14 @@ using namespace mozilla::dom; class nsScriptLoadRequest : public nsISupports { public: nsScriptLoadRequest(nsIScriptElement* aElement, - PRUint32 aVersion) + PRUint32 aVersion, + CORSMode aCORSMode) : mElement(aElement), mLoading(true), mIsInline(true), - mJSVersion(aVersion), mLineNo(1) + mJSVersion(aVersion), + mLineNo(1), + mCORSMode(aCORSMode) { } @@ -122,6 +129,7 @@ public: nsCOMPtr mURI; nsCOMPtr mOriginPrincipal; PRInt32 mLineNo; + const CORSMode mCORSMode; }; // The nsScriptLoadRequest is passed as the context to necko, and thus @@ -293,7 +301,6 @@ nsScriptLoader::StartLoad(nsScriptLoadRequest *aRequest, const nsAString &aType) } nsCOMPtr loadGroup = mDocument->GetDocumentLoadGroup(); - nsCOMPtr loader; nsCOMPtr window(do_QueryInterface(mDocument->GetScriptGlobalObject())); if (!window) { @@ -332,10 +339,21 @@ nsScriptLoader::StartLoad(nsScriptLoadRequest *aRequest, const nsAString &aType) httpChannel->SetReferrer(mDocument->GetDocumentURI()); } + nsCOMPtr loader; rv = NS_NewStreamLoader(getter_AddRefs(loader), this); NS_ENSURE_SUCCESS(rv, rv); - rv = channel->AsyncOpen(loader, aRequest); + nsCOMPtr listener = loader.get(); + + if (aRequest->mCORSMode != CORS_NONE) { + bool withCredentials = (aRequest->mCORSMode == CORS_USE_CREDENTIALS); + listener = + new nsCORSListenerProxy(listener, mDocument->NodePrincipal(), channel, + withCredentials, &rv); + NS_ENSURE_SUCCESS(rv, rv); + } + + rv = channel->AsyncOpen(listener, aRequest); NS_ENSURE_SUCCESS(rv, rv); return NS_OK; @@ -551,6 +569,7 @@ nsScriptLoader::ProcessScriptElement(nsIScriptElement *aElement) if (!scriptURI) { return false; } + CORSMode ourCORSMode = aElement->GetCORSMode(); nsTArray::index_type i = mPreloads.IndexOf(scriptURI.get(), 0, PreloadURIComparator()); if (i != nsTArray::NoIndex) { @@ -565,7 +584,8 @@ nsScriptLoader::ProcessScriptElement(nsIScriptElement *aElement) // the charset we have now. nsAutoString elementCharset; aElement->GetScriptCharset(elementCharset); - if (elementCharset.Equals(preloadCharset)) { + if (elementCharset.Equals(preloadCharset) && + ourCORSMode == request->mCORSMode) { rv = CheckContentPolicy(mDocument, aElement, request->mURI, type); NS_ENSURE_SUCCESS(rv, false); } else { @@ -576,7 +596,7 @@ nsScriptLoader::ProcessScriptElement(nsIScriptElement *aElement) if (!request) { // no usable preload - request = new nsScriptLoadRequest(aElement, version); + request = new nsScriptLoadRequest(aElement, version, ourCORSMode); request->mURI = scriptURI; request->mIsInline = false; request->mLoading = true; @@ -697,7 +717,8 @@ nsScriptLoader::ProcessScriptElement(nsIScriptElement *aElement) } } - request = new nsScriptLoadRequest(aElement, version); + // Inline scripts ignore ther CORS mode and are always CORS_NONE + request = new nsScriptLoadRequest(aElement, version, CORS_NONE); request->mJSVersion = version; request->mLoading = false; request->mIsInline = true; @@ -1228,9 +1249,14 @@ nsScriptLoader::PrepareLoadedRequest(nsScriptLoadRequest* aRequest, } nsCOMPtr channel = do_QueryInterface(req); - rv = nsContentUtils::GetSecurityManager()-> - GetChannelPrincipal(channel, getter_AddRefs(aRequest->mOriginPrincipal)); - NS_ENSURE_SUCCESS(rv, rv); + // If this load was subject to a CORS check; don't flag it with a + // separate origin principal, so that it will treat our document's + // principal as the origin principal + if (aRequest->mCORSMode == CORS_NONE) { + rv = nsContentUtils::GetSecurityManager()-> + GetChannelPrincipal(channel, getter_AddRefs(aRequest->mOriginPrincipal)); + NS_ENSURE_SUCCESS(rv, rv); + } if (aStringLen) { // Check the charset attribute to determine script charset. @@ -1325,14 +1351,17 @@ nsScriptLoader::ParsingComplete(bool aTerminated) void nsScriptLoader::PreloadURI(nsIURI *aURI, const nsAString &aCharset, - const nsAString &aType) + const nsAString &aType, + const nsAString &aCrossOrigin) { // Check to see if scripts has been turned off. if (!mEnabled || !mDocument->IsScriptEnabled()) { return; } - nsRefPtr request = new nsScriptLoadRequest(nsnull, 0); + nsRefPtr request = + new nsScriptLoadRequest(nsnull, 0, + nsGenericElement::StringToCORSMode(aCrossOrigin)); request->mURI = aURI; request->mIsInline = false; request->mLoading = true; diff --git a/content/base/src/nsScriptLoader.h b/content/base/src/nsScriptLoader.h index d8963249a04..3d882b944d0 100644 --- a/content/base/src/nsScriptLoader.h +++ b/content/base/src/nsScriptLoader.h @@ -238,9 +238,12 @@ public: * @param aURI The URI of the external script. * @param aCharset The charset parameter for the script. * @param aType The type parameter for the script. + * @param aCrossOrigin The crossorigin attribute for the script. + * Void if not present. */ virtual void PreloadURI(nsIURI *aURI, const nsAString &aCharset, - const nsAString &aType); + const nsAString &aType, + const nsAString &aCrossOrigin); private: /** diff --git a/content/base/src/nsStyleLinkElement.cpp b/content/base/src/nsStyleLinkElement.cpp index 9cb62d9cfd4..36e923811ba 100644 --- a/content/base/src/nsStyleLinkElement.cpp +++ b/content/base/src/nsStyleLinkElement.cpp @@ -185,7 +185,7 @@ PRUint32 nsStyleLinkElement::ParseLinkTypes(const nsAString& aTypes) while (current != done) { if (nsContentUtils::IsHTMLWhitespace(*current)) { if (inString) { - ToLowerCase(Substring(start, current), subString); + nsContentUtils::ASCIIToLower(Substring(start, current), subString); linkMask |= ToLinkMask(subString); inString = false; } @@ -199,8 +199,8 @@ PRUint32 nsStyleLinkElement::ParseLinkTypes(const nsAString& aTypes) ++current; } if (inString) { - ToLowerCase(Substring(start, current), subString); - linkMask |= ToLinkMask(subString); + nsContentUtils::ASCIIToLower(Substring(start, current), subString); + linkMask |= ToLinkMask(subString); } return linkMask; } diff --git a/content/base/test/Makefile.in b/content/base/test/Makefile.in index a97f7a6e49d..cf348b28ef4 100644 --- a/content/base/test/Makefile.in +++ b/content/base/test/Makefile.in @@ -562,6 +562,11 @@ _TEST_FILES2 = \ test_bug726364.html \ test_bug698381.html \ test_bug711047.html \ + test_bug696301-1.html \ + test_bug696301-2.html \ + bug696301-script-1.js \ + bug696301-script-1.js^headers^ \ + bug696301-script-2.js \ $(NULL) _CHROME_FILES = \ diff --git a/content/base/test/bug696301-script-1.js b/content/base/test/bug696301-script-1.js new file mode 100644 index 00000000000..b139b2fdfd3 --- /dev/null +++ b/content/base/test/bug696301-script-1.js @@ -0,0 +1,3 @@ +var a = 0; +var global = "ran"; +c(); \ No newline at end of file diff --git a/content/base/test/bug696301-script-1.js^headers^ b/content/base/test/bug696301-script-1.js^headers^ new file mode 100644 index 00000000000..cb762eff806 --- /dev/null +++ b/content/base/test/bug696301-script-1.js^headers^ @@ -0,0 +1 @@ +Access-Control-Allow-Origin: * diff --git a/content/base/test/bug696301-script-2.js b/content/base/test/bug696301-script-2.js new file mode 100644 index 00000000000..b139b2fdfd3 --- /dev/null +++ b/content/base/test/bug696301-script-2.js @@ -0,0 +1,3 @@ +var a = 0; +var global = "ran"; +c(); \ No newline at end of file diff --git a/content/base/test/test_bug696301-1.html b/content/base/test/test_bug696301-1.html new file mode 100644 index 00000000000..01b6c584d1a --- /dev/null +++ b/content/base/test/test_bug696301-1.html @@ -0,0 +1,78 @@ + + + + + + Test for Bug 696301 + + + + +Mozilla Bug 696301 +

+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/content/base/test/test_bug696301-2.html b/content/base/test/test_bug696301-2.html new file mode 100644 index 00000000000..c03e7d6e506 --- /dev/null +++ b/content/base/test/test_bug696301-2.html @@ -0,0 +1,80 @@ + + + + + + Test for Bug 696301 + + + + +Mozilla Bug 696301 +

+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/content/canvas/crashtests/crashtests.list b/content/canvas/crashtests/crashtests.list index feb59687d5c..00749276dcb 100644 --- a/content/canvas/crashtests/crashtests.list +++ b/content/canvas/crashtests/crashtests.list @@ -3,4 +3,5 @@ load 421715-1.html load 553938-1.html load 647480.html load 0px-size-font-667225.html +load texImage2D.html load 729116.html diff --git a/content/canvas/crashtests/texImage2D.html b/content/canvas/crashtests/texImage2D.html new file mode 100644 index 00000000000..370b0085720 --- /dev/null +++ b/content/canvas/crashtests/texImage2D.html @@ -0,0 +1,8 @@ + + + diff --git a/content/canvas/src/CustomQS_WebGL.h b/content/canvas/src/CustomQS_WebGL.h index 507dc957db5..6d21d6e08a4 100644 --- a/content/canvas/src/CustomQS_WebGL.h +++ b/content/canvas/src/CustomQS_WebGL.h @@ -382,6 +382,133 @@ nsIDOMWebGLRenderingContext_ReadPixels(JSContext *cx, unsigned argc, jsval *vp) } +class CallTexImage2D +{ +private: + nsIDOMWebGLRenderingContext* self; + WebGLenum target; + WebGLint level; + WebGLenum internalformat; + WebGLenum format; + WebGLenum type; + +public: + explicit CallTexImage2D(nsIDOMWebGLRenderingContext* aSelf, + WebGLenum aTarget, + WebGLint aLevel, + WebGLenum aInternalformat, + WebGLenum aFormat, + WebGLenum aType) + : self(aSelf) + , target(aTarget) + , level(aLevel) + , internalformat(aInternalformat) + , format(aFormat) + , type(aType) + {} + + nsresult DoCallForImageData(WebGLsizei width, WebGLsizei height, + JSObject* pixels) + { + return self->TexImage2D_imageData(target, level, internalformat, width, + height, 0, format, type, pixels); + } + nsresult DoCallForElement(mozilla::dom::Element* elt) + { + return self->TexImage2D_dom(target, level, internalformat, format, type, + elt); + } +}; + +class CallTexSubImage2D +{ +private: + nsIDOMWebGLRenderingContext* self; + WebGLenum target; + WebGLint level; + WebGLint xoffset; + WebGLint yoffset; + WebGLenum format; + WebGLenum type; + +public: + explicit CallTexSubImage2D(nsIDOMWebGLRenderingContext* aSelf, + WebGLenum aTarget, + WebGLint aLevel, + WebGLint aXoffset, + WebGLint aYoffset, + WebGLenum aFormat, + WebGLenum aType) + + : self(aSelf) + , target(aTarget) + , level(aLevel) + , xoffset(aXoffset) + , yoffset(aYoffset) + , format(aFormat) + , type(aType) + {} + + nsresult DoCallForImageData(WebGLsizei width, WebGLsizei height, + JSObject* pixels) + { + return self->TexSubImage2D_imageData(target, level, xoffset, yoffset, + width, height, format, type, + pixels); + } + nsresult DoCallForElement(mozilla::dom::Element* elt) + { + return self->TexSubImage2D_dom(target, level, xoffset, yoffset, format, + type, elt); + } +}; + +template +static bool +TexImage2DImageDataOrElement(JSContext* cx, T& self, JS::Value* object) +{ + MOZ_ASSERT(object && object->isObject()); + + nsGenericElement* elt; + xpc_qsSelfRef eltRef; + if (NS_SUCCEEDED(xpc_qsUnwrapArg( + cx, *object, &elt, &eltRef.ptr, object))) { + nsresult rv = self.DoCallForElement(elt); + return NS_SUCCEEDED(rv) || xpc_qsThrow(cx, rv); + } + + // Failed to interpret object as an Element, now try to interpret it as + // ImageData. + JSObject* imageData = &object->toObject(); + + jsval js_width, js_height, js_data; + if (!JS_GetProperty(cx, imageData, "width", &js_width) || + !JS_GetProperty(cx, imageData, "height", &js_height) || + !JS_GetProperty(cx, imageData, "data", &js_data)) { + return false; + } + if (js_width == JSVAL_VOID || + js_height == JSVAL_VOID || + !js_data.isObject()) + { + return xpc_qsThrow(cx, NS_ERROR_FAILURE); + } + int32_t int_width, int_height; + JSObject *obj_data = JSVAL_TO_OBJECT(js_data); + if (!JS_ValueToECMAInt32(cx, js_width, &int_width) || + !JS_ValueToECMAInt32(cx, js_height, &int_height)) + { + return false; + } + if (!js_IsTypedArray(obj_data)) + { + return xpc_qsThrow(cx, NS_ERROR_FAILURE); + } + + nsresult rv = self.DoCallForImageData(int_width, int_height, obj_data); + return NS_SUCCEEDED(rv) || xpc_qsThrow(cx, rv); +} + /* * TexImage2D takes: * TexImage2D(uint, int, uint, int, int, int, uint, uint, ArrayBufferView) @@ -412,65 +539,21 @@ nsIDOMWebGLRenderingContext_TexImage2D(JSContext *cx, unsigned argc, jsval *vp) // arguments common to all cases GET_UINT32_ARG(argv0, 0); GET_INT32_ARG(argv1, 1); + GET_UINT32_ARG(argv2, 2); - if (argc > 5 && - !JSVAL_IS_PRIMITIVE(argv[5])) - { + if (argc > 5 && !JSVAL_IS_PRIMITIVE(argv[5])) { // implement the variants taking a DOMElement as argv[5] - GET_UINT32_ARG(argv2, 2); GET_UINT32_ARG(argv3, 3); GET_UINT32_ARG(argv4, 4); - nsIDOMElement *elt; - xpc_qsSelfRef eltRef; - rv = xpc_qsUnwrapArg(cx, argv[5], &elt, &eltRef.ptr, &argv[5]); - if (NS_FAILED(rv)) return JS_FALSE; - - rv = self->TexImage2D_dom(argv0, argv1, argv2, argv3, argv4, elt); - - // NS_ERROR_DOM_SECURITY_ERR indicates we tried to load a cross-domain element, so - // bail out immediately, don't try to interprete as ImageData - if (rv == NS_ERROR_DOM_SECURITY_ERR) { - xpc_qsThrowBadArg(cx, rv, vp, 5); - return JS_FALSE; + CallTexImage2D selfCaller(self, argv0, argv1, argv2, argv3, argv4); + if (!TexImage2DImageDataOrElement(cx, selfCaller, argv + 5)) { + return false; } - - if (NS_FAILED(rv)) { - // failed to interprete argv[5] as a DOMElement, now try to interprete it as ImageData - JSObject *argv5 = JSVAL_TO_OBJECT(argv[5]); - - jsval js_width, js_height, js_data; - JS_GetProperty(cx, argv5, "width", &js_width); - JS_GetProperty(cx, argv5, "height", &js_height); - JS_GetProperty(cx, argv5, "data", &js_data); - if (js_width == JSVAL_VOID || - js_height == JSVAL_VOID || - !js_data.isObject()) - { - xpc_qsThrowBadArg(cx, NS_ERROR_FAILURE, vp, 5); - return JS_FALSE; - } - int32_t int_width, int_height; - JSObject *obj_data = JSVAL_TO_OBJECT(js_data); - if (!JS_ValueToECMAInt32(cx, js_width, &int_width) || - !JS_ValueToECMAInt32(cx, js_height, &int_height)) - { - return JS_FALSE; - } - if (!js_IsTypedArray(obj_data)) - { - xpc_qsThrowBadArg(cx, NS_ERROR_FAILURE, vp, 5); - return JS_FALSE; - } - rv = self->TexImage2D_imageData(argv0, argv1, argv2, - int_width, int_height, 0, - argv3, argv4, js::TypedArray::getTypedArray(obj_data)); - } - } else if (argc > 8 && - JSVAL_IS_OBJECT(argv[8])) // here, we allow null ! - { + rv = NS_OK; + } else if (argc > 8 && JSVAL_IS_OBJECT(argv[8])) { + // here, we allow null ! // implement the variants taking a buffer/array as argv[8] - GET_UINT32_ARG(argv2, 2); GET_INT32_ARG(argv3, 3); GET_INT32_ARG(argv4, 4); GET_INT32_ARG(argv5, 5); @@ -536,61 +619,17 @@ nsIDOMWebGLRenderingContext_TexSubImage2D(JSContext *cx, unsigned argc, jsval *v GET_INT32_ARG(argv2, 2); GET_INT32_ARG(argv3, 3); - if (argc > 6 && - !JSVAL_IS_PRIMITIVE(argv[6])) - { - // implement the variants taking a DOMElement as argv[6] + if (argc > 6 && !JSVAL_IS_PRIMITIVE(argv[6])) { + // implement the variants taking a DOMElement or an ImageData as argv[6] GET_UINT32_ARG(argv4, 4); GET_UINT32_ARG(argv5, 5); - nsIDOMElement *elt; - xpc_qsSelfRef eltRef; - rv = xpc_qsUnwrapArg(cx, argv[6], &elt, &eltRef.ptr, &argv[6]); - if (NS_FAILED(rv)) return JS_FALSE; - - rv = self->TexSubImage2D_dom(argv0, argv1, argv2, argv3, argv4, argv5, elt); - - // NS_ERROR_DOM_SECURITY_ERR indicates we tried to load a cross-domain element, so - // bail out immediately, don't try to interprete as ImageData - if (rv == NS_ERROR_DOM_SECURITY_ERR) { - xpc_qsThrowBadArg(cx, rv, vp, 6); - return JS_FALSE; + CallTexSubImage2D selfCaller(self, argv0, argv1, argv2, argv3, argv4, argv5); + if (!TexImage2DImageDataOrElement(cx, selfCaller, argv + 6)) { + return false; } - - if (NS_FAILED(rv)) { - // failed to interprete argv[6] as a DOMElement, now try to interprete it as ImageData - JSObject *argv6 = JSVAL_TO_OBJECT(argv[6]); - jsval js_width, js_height, js_data; - JS_GetProperty(cx, argv6, "width", &js_width); - JS_GetProperty(cx, argv6, "height", &js_height); - JS_GetProperty(cx, argv6, "data", &js_data); - if (js_width == JSVAL_VOID || - js_height == JSVAL_VOID || - !js_data.isObject()) - { - xpc_qsThrowBadArg(cx, NS_ERROR_FAILURE, vp, 6); - return JS_FALSE; - } - int32_t int_width, int_height; - JSObject *obj_data = JSVAL_TO_OBJECT(js_data); - if (!JS_ValueToECMAInt32(cx, js_width, &int_width) || - !JS_ValueToECMAInt32(cx, js_height, &int_height)) - { - return JS_FALSE; - } - if (!js_IsTypedArray(obj_data)) - { - xpc_qsThrowBadArg(cx, NS_ERROR_FAILURE, vp, 6); - return JS_FALSE; - } - rv = self->TexSubImage2D_imageData(argv0, argv1, argv2, argv3, - int_width, int_height, - argv4, argv5, - js::TypedArray::getTypedArray(obj_data)); - } - } else if (argc > 8 && - !JSVAL_IS_PRIMITIVE(argv[8])) - { + rv = NS_OK; + } else if (argc > 8 && !JSVAL_IS_PRIMITIVE(argv[8])) { // implement the variants taking a buffer/array as argv[8] GET_INT32_ARG(argv4, 4); GET_INT32_ARG(argv5, 5); diff --git a/content/canvas/src/WebGLContext.h b/content/canvas/src/WebGLContext.h index ffc1154f159..208a634711e 100644 --- a/content/canvas/src/WebGLContext.h +++ b/content/canvas/src/WebGLContext.h @@ -815,7 +815,7 @@ protected: int dstFormat, bool dstPremultiplied, size_t dstTexelSize); - nsresult DOMElementToImageSurface(nsIDOMElement *imageOrCanvas, + nsresult DOMElementToImageSurface(dom::Element* imageOrCanvas, gfxImageSurface **imageOut, int *format); diff --git a/content/canvas/src/WebGLContextGL.cpp b/content/canvas/src/WebGLContextGL.cpp index d76744a99d6..d446ef5ba1e 100644 --- a/content/canvas/src/WebGLContextGL.cpp +++ b/content/canvas/src/WebGLContextGL.cpp @@ -70,6 +70,7 @@ #endif using namespace mozilla; +using namespace mozilla::dom; static bool BaseTypeAndSizeFromUniformType(WebGLenum uType, WebGLenum *baseType, WebGLint *unitSize); static WebGLenum InternalFormatForFormatAndType(WebGLenum format, WebGLenum type, bool isGLES2); @@ -3966,11 +3967,10 @@ WebGLContext::ConvertImage(size_t width, size_t height, size_t srcStride, size_t } nsresult -WebGLContext::DOMElementToImageSurface(nsIDOMElement *imageOrCanvas, +WebGLContext::DOMElementToImageSurface(Element* imageOrCanvas, gfxImageSurface **imageOut, int *format) { - nsCOMPtr content = do_QueryInterface(imageOrCanvas); - if (!content) { + if (!imageOrCanvas) { return NS_ERROR_FAILURE; } @@ -3984,7 +3984,7 @@ WebGLContext::DOMElementToImageSurface(nsIDOMElement *imageOrCanvas, flags |= nsLayoutUtils::SFE_NO_PREMULTIPLY_ALPHA; nsLayoutUtils::SurfaceFromElementResult res = - nsLayoutUtils::SurfaceFromElement(content->AsElement(), flags); + nsLayoutUtils::SurfaceFromElement(imageOrCanvas, flags); if (!res.mSurface) return NS_ERROR_FAILURE; if (res.mSurface->GetType() != gfxASurface::SurfaceTypeImage) { @@ -4016,7 +4016,7 @@ WebGLContext::DOMElementToImageSurface(nsIDOMElement *imageOrCanvas, // part 2: if the DOM element is a canvas, check that it's not write-only. // That would indicate a tainted canvas, i.e. a canvas that could contain // cross-domain image data. - if (nsHTMLCanvasElement* canvas = nsHTMLCanvasElement::FromContent(content)) { + if (nsHTMLCanvasElement* canvas = nsHTMLCanvasElement::FromContent(imageOrCanvas)) { if (canvas->IsWriteOnly()) { LogMessageIfVerbose("The canvas used as source for texImage2D here is tainted (write-only). It is forbidden " "to load a WebGL texture from a tainted canvas. A Canvas becomes tainted for example " @@ -5082,7 +5082,7 @@ WebGLContext::TexImage2D_imageData(WebGLenum target, WebGLint level, WebGLenum i NS_IMETHODIMP WebGLContext::TexImage2D_dom(WebGLenum target, WebGLint level, WebGLenum internalformat, - WebGLenum format, GLenum type, nsIDOMElement *elt) + WebGLenum format, GLenum type, Element* elt) { if (!IsContextStable()) return NS_OK; @@ -5272,7 +5272,7 @@ NS_IMETHODIMP WebGLContext::TexSubImage2D_dom(WebGLenum target, WebGLint level, WebGLint xoffset, WebGLint yoffset, WebGLenum format, WebGLenum type, - nsIDOMElement *elt) + Element *elt) { if (!IsContextStable()) return NS_OK; diff --git a/content/canvas/test/test_canvas.html b/content/canvas/test/test_canvas.html index e0c78ee4698..6df50da8110 100644 --- a/content/canvas/test/test_canvas.html +++ b/content/canvas/test/test_canvas.html @@ -7591,7 +7591,7 @@ ok(!_thrown_outer, ctx.canvas.id + ' should not throw exception');

Canvas test: 2d.imageData.create.type - bug 433004

- +

FAIL (fallback content)

diff --git a/content/html/content/public/nsHTMLMediaElement.h b/content/html/content/public/nsHTMLMediaElement.h index eb38af5b744..c8a050f5187 100644 --- a/content/html/content/public/nsHTMLMediaElement.h +++ b/content/html/content/public/nsHTMLMediaElement.h @@ -50,6 +50,7 @@ #include "nsIObserver.h" #include "nsAudioStream.h" #include "VideoFrameContainer.h" +#include "mozilla/CORSMode.h" // Define to output information on decoding and painting framerate /* #define DEBUG_FRAME_RATE 1 */ @@ -71,7 +72,7 @@ public: CANPLAY_YES }; - CORSMode GetCORSMode() { + mozilla::CORSMode GetCORSMode() { return mCORSMode; } @@ -781,7 +782,7 @@ protected: bool mMediaSecurityVerified; // The CORS mode when loading the media element - CORSMode mCORSMode; + mozilla::CORSMode mCORSMode; }; #endif diff --git a/content/html/content/src/nsGenericHTMLElement.cpp b/content/html/content/src/nsGenericHTMLElement.cpp index 6fc86ebd7b7..842b1788db6 100644 --- a/content/html/content/src/nsGenericHTMLElement.cpp +++ b/content/html/content/src/nsGenericHTMLElement.cpp @@ -2488,24 +2488,25 @@ nsGenericHTMLElement::GetContentEditable(nsAString& aContentEditable) nsresult nsGenericHTMLElement::SetContentEditable(const nsAString& aContentEditable) { - nsString contentEditable; - ToLowerCase(aContentEditable, contentEditable); - - if (contentEditable.EqualsLiteral("inherit")) { + if (nsContentUtils::EqualsLiteralIgnoreASCIICase(aContentEditable, "inherit")) { UnsetAttr(kNameSpaceID_None, nsGkAtoms::contenteditable, true); return NS_OK; } - if (!contentEditable.EqualsLiteral("true") && - !contentEditable.EqualsLiteral("false")) { - return NS_ERROR_DOM_SYNTAX_ERR; + if (nsContentUtils::EqualsLiteralIgnoreASCIICase(aContentEditable, "true")) { + SetAttr(kNameSpaceID_None, nsGkAtoms::contenteditable, NS_LITERAL_STRING("true"), true); + + return NS_OK; + } + + if (nsContentUtils::EqualsLiteralIgnoreASCIICase(aContentEditable, "false")) { + SetAttr(kNameSpaceID_None, nsGkAtoms::contenteditable, NS_LITERAL_STRING("false"), true); + + return NS_OK; } - SetAttr(kNameSpaceID_None, nsGkAtoms::contenteditable, contentEditable, - true); - - return NS_OK; + return NS_ERROR_DOM_SYNTAX_ERR; } nsresult @@ -2886,14 +2887,6 @@ nsGenericHTMLFormElement::PreHandleEvent(nsEventChainPreVisitor& aVisitor) return nsGenericHTMLElement::PreHandleEvent(aVisitor); } -const nsAttrValue::EnumTable nsGenericHTMLElement::kCORSAttributeTable[] = { - // Order matters here - // See ParseAttribute in nsHTMLImageElement or nsHTMLMediaElement - { "anonymous", nsGenericHTMLElement::CORS_ANONYMOUS }, - { "use-credentials", nsGenericHTMLElement::CORS_USE_CREDENTIALS }, - { 0 } -}; - /* virtual */ bool nsGenericHTMLFormElement::IsDisabled() const diff --git a/content/html/content/src/nsGenericHTMLElement.h b/content/html/content/src/nsGenericHTMLElement.h index 6c7bb6d26b1..3dedd8c2165 100644 --- a/content/html/content/src/nsGenericHTMLElement.h +++ b/content/html/content/src/nsGenericHTMLElement.h @@ -530,7 +530,7 @@ public: * Returns the current disabled state of the element. */ virtual bool IsDisabled() const { - return HasAttr(kNameSpaceID_None, nsGkAtoms::disabled); + return false; } bool IsHidden() const @@ -538,32 +538,6 @@ public: return HasAttr(kNameSpaceID_None, nsGkAtoms::hidden); } - /** - * Shared cross-origin resource sharing attributes so they don't get - * duplicated on every CORS-enabled element - */ - - enum CORSMode { - /** - * The default of not using CORS to validate cross-origin loads. - */ - CORS_NONE, - - /** - * Validate cross-site loads using CORS, but do not send any credentials - * (cookies, HTTP auth logins, etc) along with the request. - */ - CORS_ANONYMOUS, - - /** - * Validate cross-site loads using CORS, and send credentials such as cookies - * and HTTP auth logins along with the request. - */ - CORS_USE_CREDENTIALS - }; - - const static nsAttrValue::EnumTable kCORSAttributeTable[]; - protected: /** * Add/remove this element to the documents name cache diff --git a/content/html/content/src/nsHTMLImageElement.cpp b/content/html/content/src/nsHTMLImageElement.cpp index 521c613b837..50c7edca890 100644 --- a/content/html/content/src/nsHTMLImageElement.cpp +++ b/content/html/content/src/nsHTMLImageElement.cpp @@ -363,10 +363,8 @@ nsHTMLImageElement::ParseAttribute(PRInt32 aNamespaceID, return ParseAlignValue(aValue, aResult); } if (aAttribute == nsGkAtoms::crossorigin) { - return aResult.ParseEnumValue(aValue, nsGenericHTMLElement::kCORSAttributeTable, false, - // default value is anonymous if aValue is - // not a value we understand - &nsGenericHTMLElement::kCORSAttributeTable[0]); + ParseCORSValue(aValue, aResult); + return true; } if (ParseImageAttribute(aAttribute, aValue, aResult)) { return true; @@ -662,17 +660,8 @@ nsHTMLImageElement::CopyInnerTo(nsGenericElement* aDest) const return nsGenericHTMLElement::CopyInnerTo(aDest); } -nsGenericHTMLElement::CORSMode +CORSMode nsHTMLImageElement::GetCORSMode() { - nsGenericHTMLElement::CORSMode ret = nsGenericHTMLElement::CORS_NONE; - - const nsAttrValue* value = GetParsedAttr(nsGkAtoms::crossorigin); - if (value) { - NS_ASSERTION(value->Type() == nsAttrValue::eEnum, - "Why is this not an enum value?"); - ret = nsGenericHTMLElement::CORSMode(value->GetEnumValue()); - } - - return ret; + return AttrValueToCORSMode(GetParsedAttr(nsGkAtoms::crossorigin)); } diff --git a/content/html/content/src/nsHTMLLinkElement.cpp b/content/html/content/src/nsHTMLLinkElement.cpp index 693b47a879e..099c78212ca 100644 --- a/content/html/content/src/nsHTMLLinkElement.cpp +++ b/content/html/content/src/nsHTMLLinkElement.cpp @@ -436,7 +436,9 @@ nsHTMLLinkElement::GetStyleSheetInfo(nsAString& aTitle, } GetAttr(kNameSpaceID_None, nsGkAtoms::media, aMedia); - ToLowerCase(aMedia); // HTML4.0 spec is inconsistent, make it case INSENSITIVE + // The HTML5 spec is formulated in terms of the CSSOM spec, which specifies + // that media queries should be ASCII lowercased during serialization. + nsContentUtils::ASCIIToLower(aMedia); nsAutoString mimeType; nsAutoString notUsed; diff --git a/content/html/content/src/nsHTMLMediaElement.cpp b/content/html/content/src/nsHTMLMediaElement.cpp index 87ad45b768b..ad8978c9923 100644 --- a/content/html/content/src/nsHTMLMediaElement.cpp +++ b/content/html/content/src/nsHTMLMediaElement.cpp @@ -951,14 +951,7 @@ nsresult nsHTMLMediaElement::LoadResource() } // Set the media element's CORS mode only when loading a resource - // By default, it's CORS_NONE - mCORSMode = CORS_NONE; - const nsAttrValue* value = GetParsedAttr(nsGkAtoms::crossorigin); - if (value) { - NS_ASSERTION(value->Type() == nsAttrValue::eEnum, - "Why is this not an enum value?"); - mCORSMode = CORSMode(value->GetEnumValue()); - } + mCORSMode = AttrValueToCORSMode(GetParsedAttr(nsGkAtoms::crossorigin)); nsHTMLMediaElement* other = LookupMediaElementURITable(mLoadingSrc); if (other) { @@ -1604,10 +1597,8 @@ bool nsHTMLMediaElement::ParseAttribute(PRInt32 aNamespaceID, return true; } if (aAttribute == nsGkAtoms::crossorigin) { - return aResult.ParseEnumValue(aValue, kCORSAttributeTable, false, - // default value is anonymous if aValue is - // not a value we understand - &kCORSAttributeTable[0]); + ParseCORSValue(aValue, aResult); + return true; } if (aAttribute == nsGkAtoms::preload) { return aResult.ParseEnumValue(aValue, kPreloadTable, false); diff --git a/content/html/content/src/nsHTMLOptGroupElement.cpp b/content/html/content/src/nsHTMLOptGroupElement.cpp index 49507f47380..a97680dec5b 100644 --- a/content/html/content/src/nsHTMLOptGroupElement.cpp +++ b/content/html/content/src/nsHTMLOptGroupElement.cpp @@ -85,6 +85,10 @@ public: virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const; virtual nsXPCClassInfo* GetClassInfo(); + + virtual bool IsDisabled() const { + return HasAttr(kNameSpaceID_None, nsGkAtoms::disabled); + } protected: /** diff --git a/content/html/content/src/nsHTMLOptionElement.h b/content/html/content/src/nsHTMLOptionElement.h index 67856a5a3a4..49021e08d9d 100644 --- a/content/html/content/src/nsHTMLOptionElement.h +++ b/content/html/content/src/nsHTMLOptionElement.h @@ -104,6 +104,10 @@ public: nsresult CopyInnerTo(nsGenericElement* aDest) const; virtual nsXPCClassInfo* GetClassInfo(); + + virtual bool IsDisabled() const { + return HasAttr(kNameSpaceID_None, nsGkAtoms::disabled); + } protected: /** * Get the select content element that contains this option, this diff --git a/content/html/content/src/nsHTMLScriptElement.cpp b/content/html/content/src/nsHTMLScriptElement.cpp index ec626bee430..88a25dffaf5 100644 --- a/content/html/content/src/nsHTMLScriptElement.cpp +++ b/content/html/content/src/nsHTMLScriptElement.cpp @@ -57,6 +57,7 @@ #include "nsTArray.h" #include "nsDOMJSUtils.h" +using namespace mozilla; using namespace mozilla::dom; class nsHTMLScriptElement : public nsGenericHTMLElement, @@ -108,11 +109,16 @@ public: virtual void GetScriptText(nsAString& text); virtual void GetScriptCharset(nsAString& charset); virtual void FreezeUriAsyncDefer(); + virtual CORSMode GetCORSMode() const; // nsIContent virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent, nsIContent* aBindingParent, bool aCompileEventHandlers); + virtual bool ParseAttribute(PRInt32 aNamespaceID, + nsIAtom* aAttribute, + const nsAString& aValue, + nsAttrValue& aResult); virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const; @@ -178,6 +184,22 @@ nsHTMLScriptElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent, return NS_OK; } +bool +nsHTMLScriptElement::ParseAttribute(PRInt32 aNamespaceID, + nsIAtom* aAttribute, + const nsAString& aValue, + nsAttrValue& aResult) +{ + if (aNamespaceID == kNameSpaceID_None && + aAttribute == nsGkAtoms::crossorigin) { + ParseCORSValue(aValue, aResult); + return true; + } + + return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue, + aResult); +} + nsresult nsHTMLScriptElement::Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const { @@ -311,6 +333,12 @@ nsHTMLScriptElement::FreezeUriAsyncDefer() mFrozen = true; } +CORSMode +nsHTMLScriptElement::GetCORSMode() const +{ + return AttrValueToCORSMode(GetParsedAttr(nsGkAtoms::crossorigin)); +} + bool nsHTMLScriptElement::HasScriptContent() { diff --git a/content/html/content/src/nsHTMLStyleElement.cpp b/content/html/content/src/nsHTMLStyleElement.cpp index 935af2a8e60..8d87a269e56 100644 --- a/content/html/content/src/nsHTMLStyleElement.cpp +++ b/content/html/content/src/nsHTMLStyleElement.cpp @@ -340,7 +340,9 @@ nsHTMLStyleElement::GetStyleSheetInfo(nsAString& aTitle, aTitle.Assign(title); GetAttr(kNameSpaceID_None, nsGkAtoms::media, aMedia); - ToLowerCase(aMedia); // HTML4.0 spec is inconsistent, make it case INSENSITIVE + // The HTML5 spec is formulated in terms of the CSSOM spec, which specifies + // that media queries should be ASCII lowercased during serialization. + nsContentUtils::ASCIIToLower(aMedia); GetAttr(kNameSpaceID_None, nsGkAtoms::type, aType); diff --git a/content/html/content/test/test_bug353415-1.html b/content/html/content/test/test_bug353415-1.html index c7bcdebdc23..1f528ae6f79 100644 --- a/content/html/content/test/test_bug353415-1.html +++ b/content/html/content/test/test_bug353415-1.html @@ -5,7 +5,7 @@ - +

0 @@ -27,13 +27,16 @@
diff --git a/content/html/content/test/test_bug353415-2.html b/content/html/content/test/test_bug353415-2.html index e2d9ac60882..9e82e9df896 100644 --- a/content/html/content/test/test_bug353415-2.html +++ b/content/html/content/test/test_bug353415-2.html @@ -54,12 +54,14 @@ diff --git a/content/html/content/test/test_bug430351.html b/content/html/content/test/test_bug430351.html index d1e7caff673..04587c9710c 100644 --- a/content/html/content/test/test_bug430351.html +++ b/content/html/content/test/test_bug430351.html @@ -61,6 +61,7 @@ var focusableElements = [ "
", "
", "
", + "
", "", "", @@ -165,7 +166,17 @@ var focusableElements = [ "", "", "", - "" + "", + + "", + "", + "", + "", + + "", + "", + "", + "" ]; var nonFocusableElements = [ @@ -182,7 +193,6 @@ var nonFocusableElements = [ "", "
", - "
", "
", "", @@ -243,7 +253,13 @@ var nonFocusableElements = [ "", "", - "" + "", + + "", + "", + + "", + "" ]; var focusableInContentEditable = [ @@ -268,6 +284,7 @@ var focusableInContentEditable = [ "
", "
", "
", + "
", "", "", @@ -365,7 +382,15 @@ var focusableInContentEditable = [ "", "", "", - "" + "", + + "", + "", + "", + + "", + "", + "" ]; var focusableInDesignMode = [ diff --git a/content/html/document/src/nsHTMLDocument.cpp b/content/html/document/src/nsHTMLDocument.cpp index 3f94697e487..bcf83fca84c 100644 --- a/content/html/document/src/nsHTMLDocument.cpp +++ b/content/html/document/src/nsHTMLDocument.cpp @@ -1358,7 +1358,7 @@ nsHTMLDocument::Open(const nsAString& aContentTypeOrUrl, contentType.AssignLiteral("text/html"); if (aOptionalArgCount > 0) { nsAutoString type; - ToLowerCase(aContentTypeOrUrl, type); + nsContentUtils::ASCIIToLower(aContentTypeOrUrl, type); nsCAutoString actualType, dummy; NS_ParseContentType(NS_ConvertUTF16toUTF8(type), actualType, dummy); if (!actualType.EqualsLiteral("text/html") && diff --git a/content/svg/content/src/nsSVGFilters.cpp b/content/svg/content/src/nsSVGFilters.cpp index 624be8b8da7..f97e8e4035c 100644 --- a/content/svg/content/src/nsSVGFilters.cpp +++ b/content/svg/content/src/nsSVGFilters.cpp @@ -144,12 +144,12 @@ nsSVGFE::SetupScalingFilter(nsSVGFilterInstance *aInstance, return result; } - float kernelX = aInstance->GetPrimitiveNumber(nsSVGUtils::X, - aKernelUnitLength, - nsSVGNumberPair::eFirst); - float kernelY = aInstance->GetPrimitiveNumber(nsSVGUtils::Y, - aKernelUnitLength, - nsSVGNumberPair::eSecond); + gfxFloat kernelX = aInstance->GetPrimitiveNumber(nsSVGUtils::X, + aKernelUnitLength, + nsSVGNumberPair::eFirst); + gfxFloat kernelY = aInstance->GetPrimitiveNumber(nsSVGUtils::Y, + aKernelUnitLength, + nsSVGNumberPair::eSecond); if (kernelX <= 0 || kernelY <= 0) return result; diff --git a/content/svg/content/src/nsSVGScriptElement.cpp b/content/svg/content/src/nsSVGScriptElement.cpp index 932de276483..1ec93291294 100644 --- a/content/svg/content/src/nsSVGScriptElement.cpp +++ b/content/svg/content/src/nsSVGScriptElement.cpp @@ -86,6 +86,7 @@ public: virtual void GetScriptText(nsAString& text); virtual void GetScriptCharset(nsAString& charset); virtual void FreezeUriAsyncDefer(); + virtual CORSMode GetCORSMode() const; // nsScriptElement virtual bool HasScriptContent(); @@ -96,6 +97,10 @@ public: bool aCompileEventHandlers); virtual nsresult AfterSetAttr(PRInt32 aNamespaceID, nsIAtom* aName, const nsAttrValue* aValue, bool aNotify); + virtual bool ParseAttribute(PRInt32 aNamespaceID, + nsIAtom* aAttribute, + const nsAString& aValue, + nsAttrValue& aResult); virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const; @@ -288,3 +293,26 @@ nsSVGScriptElement::AfterSetAttr(PRInt32 aNamespaceID, nsIAtom* aName, return nsSVGScriptElementBase::AfterSetAttr(aNamespaceID, aName, aValue, aNotify); } + +bool +nsSVGScriptElement::ParseAttribute(PRInt32 aNamespaceID, + nsIAtom* aAttribute, + const nsAString& aValue, + nsAttrValue& aResult) +{ + if (aNamespaceID == kNameSpaceID_None && + aAttribute == nsGkAtoms::crossorigin) { + ParseCORSValue(aValue, aResult); + return true; + } + + return nsSVGScriptElementBase::ParseAttribute(aNamespaceID, aAttribute, + aValue, aResult); +} + +CORSMode +nsSVGScriptElement::GetCORSMode() const +{ + return AttrValueToCORSMode(GetParsedAttr(nsGkAtoms::crossorigin)); +} + diff --git a/content/svg/content/src/nsSVGStyleElement.cpp b/content/svg/content/src/nsSVGStyleElement.cpp index 181ef23b450..14204e643cc 100644 --- a/content/svg/content/src/nsSVGStyleElement.cpp +++ b/content/svg/content/src/nsSVGStyleElement.cpp @@ -337,9 +337,9 @@ nsSVGStyleElement::GetStyleSheetInfo(nsAString& aTitle, aTitle.Assign(title); GetAttr(kNameSpaceID_None, nsGkAtoms::media, aMedia); - // SVG spec refers to the HTML4.0 spec which is inconsistent, make it - // case INSENSITIVE - ToLowerCase(aMedia); + // The SVG spec is formulated in terms of the CSS2 spec, + // which specifies that media queries are case insensitive. + nsContentUtils::ASCIIToLower(aMedia); GetAttr(kNameSpaceID_None, nsGkAtoms::type, aType); if (aType.IsEmpty()) { diff --git a/content/xbl/src/nsXBLPrototypeHandler.cpp b/content/xbl/src/nsXBLPrototypeHandler.cpp index 017e762d020..0b2a36ad9f2 100644 --- a/content/xbl/src/nsXBLPrototypeHandler.cpp +++ b/content/xbl/src/nsXBLPrototypeHandler.cpp @@ -932,21 +932,18 @@ nsXBLPrototypeHandler::ConstructPrototype(nsIContent* aKeyElement, if (!key.IsEmpty()) { if (mKeyMask == 0) mKeyMask = cAllModifiers; - ToLowerCase(key); + nsContentUtils::ASCIIToLower(key); // We have a charcode. mMisc = 1; mDetail = key[0]; const PRUint8 GTK2Modifiers = cShift | cControl | cShiftMask | cControlMask; if ((mKeyMask & GTK2Modifiers) == GTK2Modifiers && - modifiers.First() != PRUnichar(',') && - (mDetail == 'u' || mDetail == 'U')) + modifiers.First() != PRUnichar(',') && mDetail == 'u') ReportKeyConflict(key.get(), modifiers.get(), aKeyElement, "GTK2Conflict"); const PRUint8 WinModifiers = cControl | cAlt | cControlMask | cAltMask; if ((mKeyMask & WinModifiers) == WinModifiers && - modifiers.First() != PRUnichar(',') && - (('A' <= mDetail && mDetail <= 'Z') || - ('a' <= mDetail && mDetail <= 'z'))) + modifiers.First() != PRUnichar(',') && ('a' <= mDetail && mDetail <= 'z')) ReportKeyConflict(key.get(), modifiers.get(), aKeyElement, "WinConflict"); } else { diff --git a/content/xslt/src/base/txStringUtils.h b/content/xslt/src/base/txStringUtils.h index fe0b0e9c5c9..262396d9172 100644 --- a/content/xslt/src/base/txStringUtils.h +++ b/content/xslt/src/base/txStringUtils.h @@ -44,8 +44,6 @@ #include "nsIAtom.h" #include "nsUnicharUtils.h" -#define TX_ToLowerCase ToLowerCase - typedef nsCaseInsensitiveStringComparator txCaseInsensitiveStringComparator; /** @@ -62,7 +60,7 @@ TX_ToLowerCaseAtom(nsIAtom* aAtom) { nsAutoString str; aAtom->ToString(str); - TX_ToLowerCase(str); + nsContentUtils::ASCIIToLower(str); return do_GetAtom(str); } diff --git a/content/xslt/src/xpath/txExprParser.cpp b/content/xslt/src/xpath/txExprParser.cpp index d9c970b6db4..7f901b1869e 100644 --- a/content/xslt/src/xpath/txExprParser.cpp +++ b/content/xslt/src/xpath/txExprParser.cpp @@ -938,7 +938,7 @@ txExprParser::resolveQName(const nsAString& aQName, *aPrefix = 0; if (aIsNameTest && aContext->caseInsensitiveNameTests()) { nsAutoString lcname; - TX_ToLowerCase(aQName, lcname); + nsContentUtils::ASCIIToLower(aQName, lcname); *aLocalName = NS_NewAtom(lcname); } else { diff --git a/content/xslt/src/xpath/txMozillaXPathTreeWalker.cpp b/content/xslt/src/xpath/txMozillaXPathTreeWalker.cpp index 91331748bca..14353352335 100644 --- a/content/xslt/src/xpath/txMozillaXPathTreeWalker.cpp +++ b/content/xslt/src/xpath/txMozillaXPathTreeWalker.cpp @@ -453,7 +453,7 @@ txXPathNodeUtils::getLocalName(const txXPathNode& aNode, nsAString& aLocalName) // Check for html if (aNode.Content()->NodeInfo()->NamespaceEquals(kNameSpaceID_None) && aNode.Content()->IsHTML()) { - ToUpperCase(aLocalName); + nsContentUtils::ASCIIToUpper(aLocalName); } } diff --git a/content/xslt/src/xpath/txResultRecycler.cpp b/content/xslt/src/xpath/txResultRecycler.cpp index 611f7a0162c..2bd3e6b1d4c 100644 --- a/content/xslt/src/xpath/txResultRecycler.cpp +++ b/content/xslt/src/xpath/txResultRecycler.cpp @@ -228,23 +228,6 @@ txResultRecycler::getNodeSet(const txXPathNode& aNode, txAExprResult** aResult) return NS_OK; } -nsresult -txResultRecycler::getNodeSet(const txXPathNode& aNode, txNodeSet** aResult) -{ - if (mNodeSetResults.isEmpty()) { - *aResult = new txNodeSet(aNode, this); - NS_ENSURE_TRUE(*aResult, NS_ERROR_OUT_OF_MEMORY); - } - else { - *aResult = static_cast(mNodeSetResults.pop()); - (*aResult)->append(aNode); - (*aResult)->mRecycler = this; - } - NS_ADDREF(*aResult); - - return NS_OK; -} - nsresult txResultRecycler::getNumberResult(double aValue, txAExprResult** aResult) { diff --git a/content/xslt/src/xpath/txResultRecycler.h b/content/xslt/src/xpath/txResultRecycler.h index b087abff425..93da7a29c6f 100644 --- a/content/xslt/src/xpath/txResultRecycler.h +++ b/content/xslt/src/xpath/txResultRecycler.h @@ -86,7 +86,6 @@ public: nsresult getNodeSet(txNodeSet** aResult); nsresult getNodeSet(txNodeSet* aNodeSet, txNodeSet** aResult); nsresult getNodeSet(const txXPathNode& aNode, txAExprResult** aResult); - nsresult getNodeSet(const txXPathNode& aNode, txNodeSet** aResult); nsresult getNumberResult(double aValue, txAExprResult** aResult); /** diff --git a/content/xslt/src/xslt/txMozillaXMLOutput.cpp b/content/xslt/src/xslt/txMozillaXMLOutput.cpp index 3af32c19f39..51fd9b26b0b 100644 --- a/content/xslt/src/xslt/txMozillaXMLOutput.cpp +++ b/content/xslt/src/xslt/txMozillaXMLOutput.cpp @@ -160,7 +160,7 @@ txMozillaXMLOutput::attribute(nsIAtom* aPrefix, if (mOpenedElementIsHTML && aNsID == kNameSpaceID_None) { nsAutoString lnameStr; - ToLowerCase(aLocalName, lnameStr); + nsContentUtils::ASCIIToLower(aLocalName, lnameStr); lname = do_GetAtom(lnameStr); } else { @@ -499,7 +499,7 @@ txMozillaXMLOutput::startElement(nsIAtom* aPrefix, nsId = kNameSpaceID_XHTML; nsAutoString lnameStr; - ToLowerCase(aLocalName, lnameStr); + nsContentUtils::ASCIIToLower(aLocalName, lnameStr); lname = do_GetAtom(lnameStr); } else { @@ -802,7 +802,7 @@ txMozillaXMLOutput::endHTMLElement(nsIContent* aElement) nsAutoString value; aElement->GetAttr(kNameSpaceID_None, nsGkAtoms::content, value); if (!value.IsEmpty()) { - ToLowerCase(httpEquiv); + nsContentUtils::ASCIIToLower(httpEquiv); nsCOMPtr header = do_GetAtom(httpEquiv); processHTTPEquiv(header, value); } diff --git a/content/xul/document/src/nsXULPrototypeDocument.cpp b/content/xul/document/src/nsXULPrototypeDocument.cpp index a2e221c60d0..040491b9ed7 100644 --- a/content/xul/document/src/nsXULPrototypeDocument.cpp +++ b/content/xul/document/src/nsXULPrototypeDocument.cpp @@ -788,11 +788,7 @@ nsXULPDGlobalObject::ClearGlobalObjectOwner() if (this != nsXULPrototypeDocument::gSystemGlobal) mCachedPrincipal = mGlobalObjectOwner->DocumentPrincipal(); - if (mContext) { - mContext->FinalizeContext(); - mContext = NULL; - } - + mContext = NULL; mGlobalObjectOwner = NULL; } diff --git a/docshell/base/nsDefaultURIFixup.cpp b/docshell/base/nsDefaultURIFixup.cpp index 80475f9f5da..4b23445eb76 100644 --- a/docshell/base/nsDefaultURIFixup.cpp +++ b/docshell/base/nsDefaultURIFixup.cpp @@ -54,6 +54,7 @@ #include "nsIURIFixup.h" #include "nsDefaultURIFixup.h" #include "mozilla/Preferences.h" +#include "nsIObserverService.h" using namespace mozilla; @@ -378,7 +379,17 @@ NS_IMETHODIMP nsDefaultURIFixup::KeywordToURI(const nsACString& aKeyword, spec.Insert(url, 0); - return NS_NewURI(aURI, spec); + nsresult rv = NS_NewURI(aURI, spec); + if (NS_FAILED(rv)) + return rv; + + nsCOMPtr obsSvc = mozilla::services::GetObserverService(); + if (obsSvc) { + obsSvc->NotifyObservers(*aURI, + "defaultURIFixup-using-keyword-pref", + nsnull); + } + return NS_OK; } #ifdef MOZ_TOOLKIT_SEARCH diff --git a/dom/base/nsDOMClassInfo.cpp b/dom/base/nsDOMClassInfo.cpp index 115d59ab4bd..a490bcc61fa 100644 --- a/dom/base/nsDOMClassInfo.cpp +++ b/dom/base/nsDOMClassInfo.cpp @@ -452,7 +452,6 @@ #include "nsDOMFile.h" #include "nsDOMFileReader.h" #include "nsIDOMFileException.h" -#include "nsIDOMFileError.h" #include "nsIDOMFormData.h" #include "nsIDOMDOMStringMap.h" @@ -1394,8 +1393,6 @@ static nsDOMClassInfoData sClassInfoData[] = { DOM_DEFAULT_SCRIPTABLE_FLAGS) NS_DEFINE_CLASSINFO_DATA(FileException, nsDOMGenericSH, DOM_DEFAULT_SCRIPTABLE_FLAGS) - NS_DEFINE_CLASSINFO_DATA(FileError, nsDOMGenericSH, - DOM_DEFAULT_SCRIPTABLE_FLAGS) NS_DEFINE_CLASSINFO_DATA(FileReader, nsEventTargetSH, EVENTTARGET_SCRIPTABLE_FLAGS) NS_DEFINE_CLASSINFO_DATA(MozURLProperty, nsDOMGenericSH, @@ -3964,10 +3961,6 @@ nsDOMClassInfo::Init() DOM_CLASSINFO_MAP_ENTRY(nsIDOMFileList) DOM_CLASSINFO_MAP_END - DOM_CLASSINFO_MAP_BEGIN(FileError, nsIDOMFileError) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMFileError) - DOM_CLASSINFO_MAP_END - DOM_CLASSINFO_MAP_BEGIN(Blob, nsIDOMBlob) DOM_CLASSINFO_MAP_ENTRY(nsIDOMBlob) DOM_CLASSINFO_MAP_END diff --git a/dom/base/nsDOMClassInfoClasses.h b/dom/base/nsDOMClassInfoClasses.h index 14c7e78114a..5885454b460 100644 --- a/dom/base/nsDOMClassInfoClasses.h +++ b/dom/base/nsDOMClassInfoClasses.h @@ -402,7 +402,6 @@ DOMCI_CLASS(FileList) DOMCI_CLASS(Blob) DOMCI_CLASS(File) DOMCI_CLASS(FileException) -DOMCI_CLASS(FileError) DOMCI_CLASS(FileReader) DOMCI_CLASS(MozURLProperty) DOMCI_CLASS(MozBlobBuilder) diff --git a/dom/base/nsDOMJSUtils.h b/dom/base/nsDOMJSUtils.h index 9fb31cc2a9d..ec0defc48fc 100644 --- a/dom/base/nsDOMJSUtils.h +++ b/dom/base/nsDOMJSUtils.h @@ -5,6 +5,8 @@ #include "jsapi.h" #include "nsIScriptContext.h" +class nsIJSArgArray; + // seems like overkill for just this 1 function - but let's see what else // falls out first. inline nsIScriptContext * @@ -50,6 +52,6 @@ GetScriptContextPrincipalFromJSContext(JSContext *cx) // rooted, but all items remain NULL. This presumably means the caller will // then QI us for nsIJSArgArray, and set our array elements. nsresult NS_CreateJSArgv(JSContext *aContext, PRUint32 aArgc, void *aArgv, - nsIArray **aArray); + nsIJSArgArray **aArray); #endif // nsDOMJSUtils_h__ diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp index 5a6c2c24db3..6ccba831e0f 100644 --- a/dom/base/nsGlobalWindow.cpp +++ b/dom/base/nsGlobalWindow.cpp @@ -2402,7 +2402,6 @@ nsGlobalWindow::SetDocShell(nsIDocShell* aDocShell) if (mContext) { mContext->GC(js::gcreason::SET_DOC_SHELL); - mContext->FinalizeContext(); mContext = nsnull; } @@ -5932,7 +5931,7 @@ nsGlobalWindow::OpenDialog(const nsAString& aUrl, const nsAString& aName, // Strip the url, name and options from the args seen by scripts. PRUint32 argOffset = argc < 3 ? argc : 3; - nsCOMPtr argvArray; + nsCOMPtr argvArray; rv = NS_CreateJSArgv(cx, argc - argOffset, argv + argOffset, getter_AddRefs(argvArray)); NS_ENSURE_SUCCESS(rv, rv); @@ -6532,7 +6531,6 @@ nsGlobalWindow::ForceClose() nsresult nsGlobalWindow::FinalClose() { - nsresult rv; // Flag that we were closed. mIsClosed = true; @@ -6549,38 +6547,24 @@ nsGlobalWindow::FinalClose() nsIScriptContext *currentCX = nsJSUtils::GetDynamicScriptContext(cx); if (currentCX && currentCX == GetContextInternal()) { - // We ignore the return value here. If setting the termination function - // fails, it's better to fail to close the window than it is to crash - // (which is what would tend to happen if we did this synchronously - // here). - rv = currentCX->SetTerminationFunction(CloseWindow, - static_cast - (this)); - if (NS_SUCCEEDED(rv)) { - mHavePendingClose = true; - } + currentCX->SetTerminationFunction(CloseWindow, this); + mHavePendingClose = true; return NS_OK; } } - // We may have plugins on the page that have issued this close from their // event loop and because we currently destroy the plugin window with // frames, we crash. So, if we are called from Javascript, post an event // to really close the window. - rv = NS_ERROR_FAILURE; - if (!nsContentUtils::IsCallerChrome()) { - rv = nsCloseEvent::PostCloseEvent(this); - } - - if (NS_FAILED(rv)) { + if (nsContentUtils::IsCallerChrome() || + NS_FAILED(nsCloseEvent::PostCloseEvent(this))) { ReallyCloseWindow(); - rv = NS_OK; } else { mHavePendingClose = true; } - - return rv; + + return NS_OK; } @@ -8867,8 +8851,7 @@ nsGlobalWindow::OpenInternal(const nsAString& aUrl, const nsAString& aName, if (mContext == GetScriptContextFromJSContext(aJSCallerContext)) { mBlockScriptedClosingFlag = true; mContext->SetTerminationFunction(CloseBlockScriptTerminationFunc, - static_cast - (this)); + this); } } diff --git a/dom/base/nsIScriptContext.h b/dom/base/nsIScriptContext.h index 6be0faf4198..ac8683b02ab 100644 --- a/dom/base/nsIScriptContext.h +++ b/dom/base/nsIScriptContext.h @@ -56,6 +56,7 @@ class nsIObjectInputStream; class nsIObjectOutputStream; template class nsScriptObjectHolder; class nsIScriptObjectPrincipal; +class nsIDOMWindow; typedef void (*nsScriptTerminationFunc)(nsISupports* aRef); @@ -75,8 +76,8 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsIScriptContextPrincipal, NS_ISCRIPTCONTEXTPRINCIPAL_IID) #define NS_ISCRIPTCONTEXT_IID \ -{ 0x6d69fbee, 0x0723, 0x48f5, \ - { 0x82, 0x48, 0xcd, 0xcf, 0x88, 0xac, 0x25, 0x74 } } +{ 0xdfaea249, 0xaaad, 0x48bd, \ + { 0xb8, 0x04, 0x92, 0xad, 0x30, 0x88, 0xd0, 0xc6 } } /* This MUST match JSVERSION_DEFAULT. This version stuff if we don't know what language we have is a little silly... */ @@ -344,11 +345,6 @@ public: */ virtual bool IsContextInitialized() = 0; - /** - * Called as the global object discards its reference to the context. - */ - virtual void FinalizeContext() = 0; - /** * For garbage collected systems, do a synchronous collection pass. * May be a no-op on other systems @@ -389,8 +385,8 @@ public: * * @throws NS_ERROR_OUT_OF_MEMORY if that happens */ - virtual nsresult SetTerminationFunction(nsScriptTerminationFunc aFunc, - nsISupports* aRef) = 0; + virtual void SetTerminationFunction(nsScriptTerminationFunc aFunc, + nsIDOMWindow* aRef) = 0; /** * Called to disable/enable script execution in this context. @@ -400,7 +396,7 @@ public: // SetProperty is suspect and jst believes should not be needed. Currenly // used only for "arguments". - virtual nsresult SetProperty(void *aTarget, const char *aPropName, nsISupports *aVal) = 0; + virtual nsresult SetProperty(JSObject* aTarget, const char* aPropName, nsISupports* aVal) = 0; /** * Called to set/get information if the script context is * currently processing a script tag diff --git a/dom/base/nsJSEnvironment.cpp b/dom/base/nsJSEnvironment.cpp index 94b8f64bf73..71768d0de64 100644 --- a/dom/base/nsJSEnvironment.cpp +++ b/dom/base/nsJSEnvironment.cpp @@ -2293,7 +2293,7 @@ nsJSContext::InitializeExternalClasses() } nsresult -nsJSContext::SetProperty(void *aTarget, const char *aPropName, nsISupports *aArgs) +nsJSContext::SetProperty(JSObject* aTarget, const char* aPropName, nsISupports* aArgs) { PRUint32 argc; jsval *argv = nsnull; @@ -2302,8 +2302,8 @@ nsJSContext::SetProperty(void *aTarget, const char *aPropName, nsISupports *aArg Maybe tempStorage; - nsresult rv; - rv = ConvertSupportsTojsvals(aArgs, GetNativeGlobal(), &argc, &argv, tempStorage); + nsresult rv = + ConvertSupportsTojsvals(aArgs, GetNativeGlobal(), &argc, &argv, tempStorage); NS_ENSURE_SUCCESS(rv, rv); jsval vargs; @@ -2327,11 +2327,9 @@ nsJSContext::SetProperty(void *aTarget, const char *aPropName, nsISupports *aArg // Make sure to use JS_DefineProperty here so that we can override // readonly XPConnect properties here as well (read dialogArguments). - rv = ::JS_DefineProperty(mContext, reinterpret_cast(aTarget), - aPropName, vargs, nsnull, nsnull, 0) ? - NS_OK : NS_ERROR_FAILURE; - - return rv; + return JS_DefineProperty(mContext, aTarget, aPropName, vargs, NULL, NULL, 0) + ? NS_OK + : NS_ERROR_FAILURE; } nsresult @@ -2360,7 +2358,7 @@ nsJSContext::ConvertSupportsTojsvals(nsISupports *aArgs, if (!aArgs) return NS_OK; - PRUint32 argCtr, argCount; + PRUint32 argCount; // This general purpose function may need to convert an arg array // (window.arguments, event-handler args) and a generic property. nsCOMPtr argsArray(do_QueryInterface(aArgs)); @@ -2381,7 +2379,7 @@ nsJSContext::ConvertSupportsTojsvals(nsISupports *aArgs, jsval *argv = aTempStorage.ref().Elements(); if (argsArray) { - for (argCtr = 0; argCtr < argCount && NS_SUCCEEDED(rv); argCtr++) { + for (PRUint32 argCtr = 0; argCtr < argCount && NS_SUCCEEDED(rv); argCtr++) { nsCOMPtr arg; jsval *thisval = argv + argCtr; argsArray->QueryElementAt(argCtr, NS_GET_IID(nsISupports), @@ -2975,12 +2973,6 @@ nsJSContext::IsContextInitialized() return mIsInitialized; } -void -nsJSContext::FinalizeContext() -{ - ; -} - void nsJSContext::ScriptEvaluated(bool aTerminated) { @@ -3006,20 +2998,15 @@ nsJSContext::ScriptEvaluated(bool aTerminated) } } -nsresult +void nsJSContext::SetTerminationFunction(nsScriptTerminationFunc aFunc, - nsISupports* aRef) + nsIDOMWindow* aRef) { NS_PRECONDITION(GetExecutingScript(), "should be executing script"); nsJSContext::TerminationFuncClosure* newClosure = new nsJSContext::TerminationFuncClosure(aFunc, aRef, mTerminations); - if (!newClosure) { - return NS_ERROR_OUT_OF_MEMORY; - } - mTerminations = newClosure; - return NS_OK; } bool @@ -3922,7 +3909,7 @@ nsresult NS_CreateJSRuntime(nsIScriptRuntime **aRuntime) // to/from nsISupports. // When consumed by non-JS (eg, another script language), conversion is done // on-the-fly. -class nsJSArgArray : public nsIJSArgArray, public nsIArray { +class nsJSArgArray : public nsIJSArgArray { public: nsJSArgArray(JSContext *aContext, PRUint32 argc, jsval *argv, nsresult *prv); ~nsJSArgArray(); @@ -4062,7 +4049,7 @@ NS_IMETHODIMP nsJSArgArray::Enumerate(nsISimpleEnumerator **_retval) // The factory function nsresult NS_CreateJSArgv(JSContext *aContext, PRUint32 argc, void *argv, - nsIArray **aArray) + nsIJSArgArray **aArray) { nsresult rv; nsJSArgArray *ret = new nsJSArgArray(aContext, argc, diff --git a/dom/base/nsJSEnvironment.h b/dom/base/nsJSEnvironment.h index 1ff03dab63b..22d202a4878 100644 --- a/dom/base/nsJSEnvironment.h +++ b/dom/base/nsJSEnvironment.h @@ -47,6 +47,7 @@ #include "prtime.h" #include "nsCycleCollectionParticipant.h" #include "nsIXPConnect.h" +#include "nsIArray.h" class nsIXPConnectJSObjectHolder; class nsRootedJSValueArray; @@ -143,15 +144,14 @@ public: virtual nsresult SetOuterObject(JSObject* aOuterObject); virtual nsresult InitOuterWindow(); virtual bool IsContextInitialized(); - virtual void FinalizeContext(); virtual void ScriptEvaluated(bool aTerminated); - virtual nsresult SetTerminationFunction(nsScriptTerminationFunc aFunc, - nsISupports* aRef); + virtual void SetTerminationFunction(nsScriptTerminationFunc aFunc, + nsIDOMWindow* aRef); virtual bool GetScriptsEnabled(); virtual void SetScriptsEnabled(bool aEnabled, bool aFireTimeouts); - virtual nsresult SetProperty(void *aTarget, const char *aPropName, nsISupports *aVal); + virtual nsresult SetProperty(JSObject* aTarget, const char* aPropName, nsISupports* aVal); virtual bool GetProcessingScriptTag(); virtual void SetProcessingScriptTag(bool aResult); @@ -348,11 +348,10 @@ public: // nsISupports conversion. If this interface is not supported, the object will // be queried for nsIArray, and everything converted via xpcom objects. #define NS_IJSARGARRAY_IID \ - { /*{E96FB2AE-CB4F-44a0-81F8-D91C80AFE9A3} */ \ - 0xe96fb2ae, 0xcb4f, 0x44a0, \ - { 0x81, 0xf8, 0xd9, 0x1c, 0x80, 0xaf, 0xe9, 0xa3 } } +{ 0xb6acdac8, 0xf5c6, 0x432c, \ + { 0xa8, 0x6e, 0x33, 0xee, 0xb1, 0xb0, 0xcd, 0xdc } } -class nsIJSArgArray: public nsISupports +class nsIJSArgArray : public nsIArray { public: NS_DECLARE_STATIC_IID_ACCESSOR(NS_IJSARGARRAY_IID) diff --git a/dom/base/nsJSTimeoutHandler.cpp b/dom/base/nsJSTimeoutHandler.cpp index 97e4e32f3b3..f4fe1f283f8 100644 --- a/dom/base/nsJSTimeoutHandler.cpp +++ b/dom/base/nsJSTimeoutHandler.cpp @@ -101,7 +101,7 @@ private: nsCString mFileName; PRUint32 mLineNo; PRUint32 mVersion; - nsCOMPtr mArgv; + nsCOMPtr mArgv; // The JS expression to evaluate or function to call, if !mExpr JSFlatString *mExpr; @@ -326,7 +326,7 @@ nsJSScriptTimeoutHandler::Init(nsGlobalWindow *aWindow, bool *aIsInterval, // to setTimeout or setInterval; the first two are our callback // and the delay, so only arguments after that need to go in our // array. - nsCOMPtr array; + nsCOMPtr array; // NS_MAX(argc - 2, 0) wouldn't work right because argc is unsigned. rv = NS_CreateJSArgv(cx, NS_MAX(argc, 2u) - 2, nsnull, getter_AddRefs(array)); @@ -336,8 +336,7 @@ nsJSScriptTimeoutHandler::Init(nsGlobalWindow *aWindow, bool *aIsInterval, PRUint32 dummy; jsval *jsargv = nsnull; - nsCOMPtr jsarray(do_QueryInterface(array)); - jsarray->GetArgs(&dummy, reinterpret_cast(&jsargv)); + array->GetArgs(&dummy, reinterpret_cast(&jsargv)); // jsargv might be null if we have argc <= 2 if (jsargv) { diff --git a/dom/interfaces/canvas/nsIDOMWebGLRenderingContext.idl b/dom/interfaces/canvas/nsIDOMWebGLRenderingContext.idl index 81ecd91d011..735f2afbd8e 100644 --- a/dom/interfaces/canvas/nsIDOMWebGLRenderingContext.idl +++ b/dom/interfaces/canvas/nsIDOMWebGLRenderingContext.idl @@ -59,16 +59,18 @@ typedef float WebGLclampf; // for jsval #include "jsapi.h" -namespace js { -struct ArrayBuffer; -struct TypedArray; -} +namespace mozilla { +namespace dom { +class Element; +} // namespace dom +} // namespace mozilla /* Avoid conflict with WinAPI */ #undef NO_ERROR %} [ptr] native WebGLJSObjectPtr (JSObject); +[ptr] native Element (mozilla::dom::Element); // // OpenGL object wrappers @@ -175,7 +177,7 @@ interface nsIWebGLExtensionTextureFilterAnisotropic : nsIWebGLExtension const WebGLenum MAX_TEXTURE_MAX_ANISOTROPY_EXT = 0x84FF; }; -[scriptable, builtinclass, uuid(f000afac-11b3-4c06-a35f-8db411f1cf54)] +[scriptable, builtinclass, uuid(020474b1-2d3f-403b-b85d-11d9082ccd92)] interface nsIDOMWebGLRenderingContext : nsISupports { // @@ -786,7 +788,7 @@ interface nsIDOMWebGLRenderingContext : nsISupports // HTMLImageElement, HTMLCanvasElement, HTMLVideoElement [noscript] void texImage2D_dom(in WebGLenum target, in WebGLint level, in WebGLenum internalformat, - in WebGLenum format, in WebGLenum type, in nsIDOMElement element); + in WebGLenum format, in WebGLenum type, in Element element); void texSubImage2D([optional] in long dummy); [noscript] void texSubImage2D_array(in WebGLenum target, in WebGLint level, @@ -798,7 +800,7 @@ interface nsIDOMWebGLRenderingContext : nsISupports // HTMLImageElement, HTMLCanvasElement, HTMLVideoElement [noscript] void texSubImage2D_dom(in WebGLenum target, in WebGLint level, in WebGLint xoffset, in WebGLint yoffset, in WebGLenum format, in WebGLenum type, - in nsIDOMElement element); + in Element element); // Modified: This replaces glTexParameterf, glTexParameterfv, glTexParameteri and glTexParameteriv void texParameterf(in WebGLenum target, in WebGLenum pname, in WebGLfloat param); diff --git a/dom/src/storage/nsDOMStorage.cpp b/dom/src/storage/nsDOMStorage.cpp index fdff85f66bb..7610a0e1cc0 100644 --- a/dom/src/storage/nsDOMStorage.cpp +++ b/dom/src/storage/nsDOMStorage.cpp @@ -2363,7 +2363,7 @@ NS_IMETHODIMP nsDOMStorageEvent::GetStorageArea(nsIDOMStorage * *aStorageArea) { NS_ENSURE_ARG_POINTER(aStorageArea); - NS_ADDREF(*aStorageArea = mStorageArea); + NS_IF_ADDREF(*aStorageArea = mStorageArea); return NS_OK; } diff --git a/dom/system/nsDeviceMotion.cpp b/dom/system/nsDeviceMotion.cpp index 639a588d0b7..9c2230c6389 100644 --- a/dom/system/nsDeviceMotion.cpp +++ b/dom/system/nsDeviceMotion.cpp @@ -199,12 +199,15 @@ NS_IMETHODIMP nsDeviceMotion::RemoveListener(nsIDeviceMotionListener *aListener) NS_IMETHODIMP nsDeviceMotion::AddWindowListener(nsIDOMWindow *aWindow) { + if (mWindowListeners.IndexOf(aWindow) != NoIndex) + return NS_OK; + if (mStarted == false) { mStarted = true; Startup(); } - if (mWindowListeners.IndexOf(aWindow) == NoIndex) - mWindowListeners.AppendElement(aWindow); + + mWindowListeners.AppendElement(aWindow); return NS_OK; } @@ -224,28 +227,34 @@ nsDeviceMotion::DeviceMotionChanged(PRUint32 type, double x, double y, double z) if (!mEnabled) return NS_ERROR_NOT_INITIALIZED; - for (PRUint32 i = mListeners.Count(); i > 0 ; ) { + nsCOMArray listeners = mListeners; + for (PRUint32 i = listeners.Count(); i > 0 ; ) { --i; nsRefPtr a = new nsDeviceMotionData(type, x, y, z); - mListeners[i]->OnMotionChange(a); + listeners[i]->OnMotionChange(a); } - for (PRUint32 i = mWindowListeners.Length(); i > 0 ; ) { + nsCOMArray windowListeners; + for (PRUint32 i = 0; i < mWindowListeners.Length(); i++) { + windowListeners.AppendObject(mWindowListeners[i]); + } + + for (PRUint32 i = windowListeners.Count(); i > 0 ; ) { --i; // check to see if this window is in the background. if // it is, don't send any device motion to it. - nsCOMPtr pwindow = do_QueryInterface(mWindowListeners[i]); + nsCOMPtr pwindow = do_QueryInterface(windowListeners[i]); if (!pwindow || !pwindow->GetOuterWindow() || pwindow->GetOuterWindow()->IsBackground()) continue; nsCOMPtr domdoc; - mWindowListeners[i]->GetDocument(getter_AddRefs(domdoc)); + windowListeners[i]->GetDocument(getter_AddRefs(domdoc)); if (domdoc) { - nsCOMPtr target = do_QueryInterface(mWindowListeners[i]); + nsCOMPtr target = do_QueryInterface(windowListeners[i]); if (type == nsIDeviceMotionData::TYPE_ACCELERATION) FireDOMMotionEvent(domdoc, target, x, y, z); else if (type == nsIDeviceMotionData::TYPE_ORIENTATION) diff --git a/dom/tests/mochitest/dom-level2-core/test_getAttributeNS03.html b/dom/tests/mochitest/dom-level2-core/test_getAttributeNS03.html index e9dfcb64e68..5a5a3359464 100644 --- a/dom/tests/mochitest/dom-level2-core/test_getAttributeNS03.html +++ b/dom/tests/mochitest/dom-level2-core/test_getAttributeNS03.html @@ -105,7 +105,7 @@ function getAttributeNS03() { assertNotNull("empAddrNotNull",testAddr); testAddr.removeAttributeNS(namespaceURI,localName); attrValue = testAddr.getAttributeNS(namespaceURI,localName); - assertEquals("throw_Equals","",attrValue); + assertEquals("throw_Equals",null,attrValue); } diff --git a/gfx/cairo/README b/gfx/cairo/README index 09d6a30821d..eb8428ea127 100644 --- a/gfx/cairo/README +++ b/gfx/cairo/README @@ -10,10 +10,6 @@ VERSIONS: cairo (12d521df8acc483b2daa844d4f05dc2fe2765ba6) pixman (2f4f2fb4859931bf6dc5632d8c919e7296736427) -***** NOTE FOR VISUAL C++ 6.0 ***** - -VC6 is not supported. Please upgrade to VC8. - ==== Patches ==== Some specific things: diff --git a/gfx/gl/GLContextProviderEGL.cpp b/gfx/gl/GLContextProviderEGL.cpp index c269923ea9e..f12d53299d2 100644 --- a/gfx/gl/GLContextProviderEGL.cpp +++ b/gfx/gl/GLContextProviderEGL.cpp @@ -2087,7 +2087,7 @@ GLContextEGL::CreateTextureImage(const nsIntSize& aSize, { nsRefPtr t = new gl::TiledTextureImage(this, aSize, aContentType, aUseNearestFilter); return t.forget(); -}; +} already_AddRefed GLContextEGL::TileGenFunc(const nsIntSize& aSize, diff --git a/gfx/skia/SkPostConfig.patch b/gfx/skia/SkPostConfig.patch new file mode 100644 index 00000000000..d32341f4ea2 --- /dev/null +++ b/gfx/skia/SkPostConfig.patch @@ -0,0 +1,32 @@ +diff --git a/gfx/skia/include/core/SkPostConfig.h b/gfx/skia/include/core/SkPostConfig.h +--- a/gfx/skia/include/core/SkPostConfig.h ++++ b/gfx/skia/include/core/SkPostConfig.h +@@ -277,19 +277,28 @@ + #endif + + ////////////////////////////////////////////////////////////////////// + + #ifndef SK_OVERRIDE + #if defined(_MSC_VER) + #define SK_OVERRIDE override + #elif defined(__clang__) ++#if __has_feature(cxx_override_control) + // Some documentation suggests we should be using __attribute__((override)), + // but it doesn't work. + #define SK_OVERRIDE override ++#elif defined(__has_extension) ++#if __has_extension(cxx_override_control) ++#define SK_OVERRIDE override ++#endif ++#endif ++#ifndef SK_OVERRIDE ++#define SK_OVERRIDE ++#endif + #else + // Linux GCC ignores "__attribute__((override))" and rejects "override". + #define SK_OVERRIDE + #endif + #endif + + ////////////////////////////////////////////////////////////////////// + diff --git a/gfx/skia/include/core/SkPostConfig.h b/gfx/skia/include/core/SkPostConfig.h index edce3342599..0880c1ea8e5 100644 --- a/gfx/skia/include/core/SkPostConfig.h +++ b/gfx/skia/include/core/SkPostConfig.h @@ -282,9 +282,18 @@ #if defined(_MSC_VER) #define SK_OVERRIDE override #elif defined(__clang__) +#if __has_feature(cxx_override_control) // Some documentation suggests we should be using __attribute__((override)), // but it doesn't work. #define SK_OVERRIDE override +#elif defined(__has_extension) +#if __has_extension(cxx_override_control) +#define SK_OVERRIDE override +#endif +#endif +#ifndef SK_OVERRIDE +#define SK_OVERRIDE +#endif #else // Linux GCC ignores "__attribute__((override))" and rejects "override". #define SK_OVERRIDE diff --git a/gfx/skia/update.sh b/gfx/skia/update.sh index 75e4c1f1bca..cb4844c40bf 100755 --- a/gfx/skia/update.sh +++ b/gfx/skia/update.sh @@ -112,3 +112,5 @@ patch -p3 < uninitialized-margin.patch patch -p3 < fix-comma-end-enum-list.patch # Bug 719872 - Fix crash on Android by reverting to older FontHost impl patch -p3 < old-android-fonthost.patch +# Bug 731384 - Fix compile errors on older versions of clang +patch -p3 < SkPostConfig.patch diff --git a/gfx/thebes/gfxWindowsPlatform.cpp b/gfx/thebes/gfxWindowsPlatform.cpp index e8b04770d37..a7cca0aa019 100644 --- a/gfx/thebes/gfxWindowsPlatform.cpp +++ b/gfx/thebes/gfxWindowsPlatform.cpp @@ -419,12 +419,7 @@ gfxWindowsPlatform::UpdateRenderMode() PRInt32 status; if (NS_SUCCEEDED(gfxInfo->GetFeatureStatus(nsIGfxInfo::FEATURE_DIRECT2D, &status))) { if (status != nsIGfxInfo::FEATURE_NO_INFO) { - d2dDisabled = true; - if (status == nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION || - status == nsIGfxInfo::FEATURE_BLOCKED_DEVICE) - { - d2dBlocked = true; - } + d2dBlocked = true; } } } @@ -526,7 +521,6 @@ gfxWindowsPlatform::VerifyD2DDevice(bool aAttemptForce) return; } - nsRefPtr adapter1; hr = factory1->EnumAdapters1(0, getter_AddRefs(adapter1)); if (SUCCEEDED(hr) && adapter1) { diff --git a/image/public/imgIContainer.idl b/image/public/imgIContainer.idl index 5a632215103..14d22f2c554 100644 --- a/image/public/imgIContainer.idl +++ b/image/public/imgIContainer.idl @@ -93,7 +93,7 @@ native gfxGraphicsFilter(gfxPattern::GraphicsFilter); * * Internally, imgIContainer also manages animation of images. */ -[scriptable, uuid(2506249c-e0a1-4d8f-846c-2d478247f8d8)] +[scriptable, uuid(8bf87433-be67-413b-9497-00071c5002bd)] interface imgIContainer : nsISupports { /** @@ -283,6 +283,12 @@ interface imgIContainer : nsISupports */ void unlockImage(); + /** + * If this image is unlocked, discard its decoded data. If the image is + * locked or has already been discarded, do nothing. + */ + void requestDiscard(); + /** * Indicates that this imgIContainer has been triggered to update * its internal animation state. Likely this should only be called diff --git a/image/public/imgIRequest.idl b/image/public/imgIRequest.idl index 9d3cfb75b92..080e2f9661b 100644 --- a/image/public/imgIRequest.idl +++ b/image/public/imgIRequest.idl @@ -52,7 +52,7 @@ interface nsIPrincipal; * @version 0.1 * @see imagelib2 */ -[scriptable, uuid(c3bf4e2a-f64b-4ac1-a84e-18631b1802ab)] +[scriptable, uuid(d35a9adb-8328-4b64-b06f-72a165acd080)] interface imgIRequest : nsIRequest { /** @@ -194,6 +194,12 @@ interface imgIRequest : nsIRequest */ void unlockImage(); + /** + * If this image is unlocked, discard the image's decoded data. If the image + * is locked or is already discarded, do nothing. + */ + void requestDiscard(); + /** * If this request is for an animated image, the method creates a new * request which contains the current frame of the image. diff --git a/image/src/RasterImage.cpp b/image/src/RasterImage.cpp index 6f778745580..e3669f72333 100644 --- a/image/src/RasterImage.cpp +++ b/image/src/RasterImage.cpp @@ -2696,6 +2696,18 @@ RasterImage::UnlockImage() return NS_OK; } +//****************************************************************************** +/* void requestDiscard() */ +NS_IMETHODIMP +RasterImage::RequestDiscard() +{ + if (CanDiscard()) { + ForceDiscard(); + } + + return NS_OK; +} + // Flushes up to aMaxBytes to the decoder. nsresult RasterImage::DecodeSomeData(PRUint32 aMaxBytes) diff --git a/image/src/RasterImage.h b/image/src/RasterImage.h index 16d86344a0e..8b61f170628 100644 --- a/image/src/RasterImage.h +++ b/image/src/RasterImage.h @@ -198,6 +198,7 @@ public: NS_SCRIPTABLE NS_IMETHOD RequestDecode(void); NS_SCRIPTABLE NS_IMETHOD LockImage(void); NS_SCRIPTABLE NS_IMETHOD UnlockImage(void); + NS_SCRIPTABLE NS_IMETHOD RequestDiscard(void); NS_SCRIPTABLE NS_IMETHOD ResetAnimation(void); NS_IMETHOD_(void) RequestRefresh(const mozilla::TimeStamp& aTime); // END NS_DECL_IMGICONTAINER diff --git a/image/src/VectorImage.cpp b/image/src/VectorImage.cpp index f263f29d503..530602d1b08 100644 --- a/image/src/VectorImage.cpp +++ b/image/src/VectorImage.cpp @@ -626,6 +626,15 @@ VectorImage::UnlockImage() return NS_OK; } +//****************************************************************************** +/* void requestDiscard() */ +NS_IMETHODIMP +VectorImage::RequestDiscard() +{ + // This method is for image-discarding, which only applies to RasterImages. + return NS_OK; +} + //****************************************************************************** /* void resetAnimation (); */ NS_IMETHODIMP diff --git a/image/src/VectorImage.h b/image/src/VectorImage.h index bd1e9b4ad49..a10a347eacc 100644 --- a/image/src/VectorImage.h +++ b/image/src/VectorImage.h @@ -81,6 +81,7 @@ public: NS_SCRIPTABLE NS_IMETHOD RequestDecode(void); NS_SCRIPTABLE NS_IMETHOD LockImage(void); NS_SCRIPTABLE NS_IMETHOD UnlockImage(void); + NS_SCRIPTABLE NS_IMETHOD RequestDiscard(void); NS_SCRIPTABLE NS_IMETHOD ResetAnimation(void); NS_IMETHOD_(void) RequestRefresh(const mozilla::TimeStamp& aTime); // END NS_DECL_IMGICONTAINER diff --git a/image/src/imgRequestProxy.cpp b/image/src/imgRequestProxy.cpp index 477ee29343a..32edcc9360a 100644 --- a/image/src/imgRequestProxy.cpp +++ b/image/src/imgRequestProxy.cpp @@ -370,6 +370,16 @@ imgRequestProxy::UnlockImage() return NS_OK; } +/* void requestDiscard (); */ +NS_IMETHODIMP +imgRequestProxy::RequestDiscard() +{ + if (mImage) { + return mImage->RequestDiscard(); + } + return NS_OK; +} + NS_IMETHODIMP imgRequestProxy::IncrementAnimationConsumers() { diff --git a/image/test/mochitest/Makefile.in b/image/test/mochitest/Makefile.in index e673798cdff..39548c1d5a6 100644 --- a/image/test/mochitest/Makefile.in +++ b/image/test/mochitest/Makefile.in @@ -88,6 +88,7 @@ _TEST_FILES = imgutils.js \ test_bug671906.html \ test_error_events.html \ error-early.png \ + test_drawDiscardedImage.html \ $(NULL) # Tests disabled due to intermittent orange diff --git a/image/test/mochitest/test_drawDiscardedImage.html b/image/test/mochitest/test_drawDiscardedImage.html new file mode 100644 index 00000000000..7c99ba50461 --- /dev/null +++ b/image/test/mochitest/test_drawDiscardedImage.html @@ -0,0 +1,85 @@ + + + + + Test for Bug 731419 - Draw an ostensibly discarded image to a canvas + + + + + + + + + + + + + + + + + diff --git a/intl/uconv/tests/unit/test_decode_gb18030.js b/intl/uconv/tests/unit/test_decode_gb18030.js new file mode 100644 index 00000000000..dab20049514 --- /dev/null +++ b/intl/uconv/tests/unit/test_decode_gb18030.js @@ -0,0 +1,16 @@ +// Tests conversion from gb18030 to Unicode +// This is a sniff test which doesn't cover the full gb18030 range: the test string +// includes only the ASCII range and the first 63 double byte characters +// and border values of 4 byte characters + +load('CharsetConversionTests.js'); + +const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x81@\x81A\x81B\x81C\x81D\x81E\x81F\x81G\x81H\x81I\x81J\x81K\x81L\x81M\x81N\x81O\x81P\x81Q\x81R\x81S\x81T\x81U\x81V\x81W\x81X\x81Y\x81Z\x81[\x81\\\x81]\x81^\x81_\x81`\x81a\x81b\x81c\x81d\x81e\x81f\x81g\x81h\x81i\x81j\x81k\x81l\x81m\x81n\x81o\x81p\x81q\x81r\x81s\x81t\x81u\x81v\x81w\x81x\x81y\x81z\x81{\x81|\x81}\x81~\x810\x810\x841\xa46\x841\xa47\x849\xfe9\x850\x810\x859\xfe9\x860\x810\x8f9\xfe9\x900\x810\xe32\x9a5\xe32\x9a6\xe39\xfe9\xe40\x810\xfc9\xfe9\xfd0\x810\xfe9\xfe9"; + +const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u4E02\u4E04\u4E05\u4E06\u4E0F\u4E12\u4E17\u4E1F\u4E20\u4E21\u4E23\u4E26\u4E29\u4E2E\u4E2F\u4E31\u4E33\u4E35\u4E37\u4E3C\u4E40\u4E41\u4E42\u4E44\u4E46\u4E4A\u4E51\u4E55\u4E57\u4E5A\u4E5B\u4E62\u4E63\u4E64\u4E65\u4E67\u4E68\u4E6A\u4E6B\u4E6C\u4E6D\u4E6E\u4E6F\u4E72\u4E74\u4E75\u4E76\u4E77\u4E78\u4E79\u4E7A\u4E7B\u4E7C\u4E7D\u4E7F\u4E80\u4E81\u4E82\u4E83\u4E84\u4E85\u4E87\u4E8A\x80\uFFFC\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uD800\uDC00\uDBFF\uDFFF\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"; + +const aliases = [ "gb18030" ]; + +function run_test() { + testDecodeAliases(); +} diff --git a/intl/uconv/tests/unit/xpcshell.ini b/intl/uconv/tests/unit/xpcshell.ini index 05f236fec79..9178482e689 100644 --- a/intl/uconv/tests/unit/xpcshell.ini +++ b/intl/uconv/tests/unit/xpcshell.ini @@ -63,6 +63,7 @@ tail = [test_decode_CP874.js] [test_decode_EUCKR_Hangul.js] [test_decode_armscii.js] +[test_decode_gb18030.js] [test_decode_gbk.js] [test_decode_tcvn5712.js] [test_decode_utf-7_internal.js] diff --git a/intl/uconv/ucvcn/nsGBKToUnicode.cpp b/intl/uconv/ucvcn/nsGBKToUnicode.cpp index 1aa81e126e9..3034a650666 100644 --- a/intl/uconv/ucvcn/nsGBKToUnicode.cpp +++ b/intl/uconv/ucvcn/nsGBKToUnicode.cpp @@ -298,8 +298,11 @@ bool nsGB18030ToUnicode::DecodeToSurrogate(const char* aSrc, PRUnichar* aOut) a3 -= (PRUint8)0x81; a4 -= (PRUint8)0x30; PRUint32 idx = (((a1 * 10 + a2 ) * 126 + a3) * 10) + a4; + // idx == ucs4Codepoint - 0x10000 + if (idx > 0x000FFFFF) + return false; - *aOut++ = 0xD800 | (0x000003FF & (idx >> 10)); + *aOut++ = 0xD800 | (idx >> 10); *aOut = 0xDC00 | (0x000003FF & idx); return true; diff --git a/js/public/Utility.h b/js/public/Utility.h index c3027269b71..f5294e36907 100644 --- a/js/public/Utility.h +++ b/js/public/Utility.h @@ -45,6 +45,11 @@ #include #include +#ifdef JS_OOM_DO_BACKTRACES +#include +#include +#endif + #include "jstypes.h" #ifdef __cplusplus @@ -112,10 +117,43 @@ extern JS_PUBLIC_API(void) JS_Abort(void); */ extern JS_PUBLIC_DATA(uint32_t) OOM_maxAllocations; /* set from shell/js.cpp */ extern JS_PUBLIC_DATA(uint32_t) OOM_counter; /* data race, who cares. */ + +#ifdef JS_OOM_DO_BACKTRACES +#define JS_OOM_BACKTRACE_SIZE 32 +static JS_ALWAYS_INLINE void +PrintBacktrace() +{ + void* OOM_trace[JS_OOM_BACKTRACE_SIZE]; + char** OOM_traceSymbols = NULL; + int32_t OOM_traceSize = 0; + int32_t OOM_traceIdx = 0; + OOM_traceSize = backtrace(OOM_trace, JS_OOM_BACKTRACE_SIZE); + OOM_traceSymbols = backtrace_symbols(OOM_trace, OOM_traceSize); + + if (!OOM_traceSymbols) + return; + + for (OOM_traceIdx = 0; OOM_traceIdx < OOM_traceSize; ++OOM_traceIdx) { + fprintf(stderr, "#%d %s\n", OOM_traceIdx, OOM_traceSymbols[OOM_traceIdx]); + } + + free(OOM_traceSymbols); +} + +#define JS_OOM_EMIT_BACKTRACE() \ + do {\ + fprintf(stderr, "Forcing artificial memory allocation function failure:\n");\ + PrintBacktrace();\ + } while (0) +# else +# define JS_OOM_EMIT_BACKTRACE() do {} while(0) +#endif /* JS_OOM_DO_BACKTRACES */ + # define JS_OOM_POSSIBLY_FAIL() \ do \ { \ if (++OOM_counter > OOM_maxAllocations) { \ + JS_OOM_EMIT_BACKTRACE();\ return NULL; \ } \ } while (0) diff --git a/js/src/config/rules.mk b/js/src/config/rules.mk index 5e299925f5d..a9d51e5503d 100644 --- a/js/src/config/rules.mk +++ b/js/src/config/rules.mk @@ -960,10 +960,10 @@ ifdef MSMANIFEST_TOOL endif # MSVC with manifest tool else ifeq ($(CPP_PROG_LINK),1) - $(EXPAND_CCC) $(CXXFLAGS) -o $@ $< $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(MOZ_GLUE_PROGRAM_LDFLAGS) $(WRAP_LDFLAGS) $(LIBS_DIR) $(LIBS) $(OS_LIBS) $(EXTRA_LIBS) $(BIN_FLAGS) + $(EXPAND_CCC) $(CXXFLAGS) -o $@ $< $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(WRAP_LDFLAGS) $(LIBS_DIR) $(LIBS) $(MOZ_GLUE_PROGRAM_LDFLAGS) $(OS_LIBS) $(EXTRA_LIBS) $(BIN_FLAGS) @$(call CHECK_STDCXX,$@) else - $(EXPAND_CC) $(CFLAGS) $(OUTOPTION)$@ $< $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(MOZ_GLUE_PROGRAM_LDFLAGS) $(WRAP_LDFLAGS) $(LIBS_DIR) $(LIBS) $(OS_LIBS) $(EXTRA_LIBS) $(BIN_FLAGS) + $(EXPAND_CC) $(CFLAGS) $(OUTOPTION)$@ $< $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(WRAP_LDFLAGS) $(LIBS_DIR) $(LIBS) $(MOZ_GLUE_PROGRAM_LDFLAGS) $(OS_LIBS) $(EXTRA_LIBS) $(BIN_FLAGS) endif # CPP_PROG_LINK endif # WINNT && !GNU_CC diff --git a/js/src/configure.in b/js/src/configure.in index 40a6ce5fa68..e255210cb5d 100644 --- a/js/src/configure.in +++ b/js/src/configure.in @@ -4549,6 +4549,18 @@ if test -n "$JS_MORE_DETERMINISTIC"; then AC_DEFINE(JS_MORE_DETERMINISTIC) fi +dnl ======================================================== +dnl Enable output of backtraces on artificial OOMs +dnl ======================================================== +MOZ_ARG_ENABLE_BOOL(oom-backtrace, +[ --enable-oom-backtrace + Enable output of backtraces on artificial OOMs (-A)], + JS_OOM_DO_BACKTRACES=1, + JS_OOM_DO_BACKTRACES= ) +if test -n "$JS_OOM_DO_BACKTRACES"; then + AC_DEFINE(JS_OOM_DO_BACKTRACES) +fi + dnl ====================================================== dnl = Enable compiling with ccache dnl ====================================================== diff --git a/js/src/ds/LifoAlloc.h b/js/src/ds/LifoAlloc.h index 4d269fba483..715d241bafb 100644 --- a/js/src/ds/LifoAlloc.h +++ b/js/src/ds/LifoAlloc.h @@ -221,6 +221,8 @@ class LifoAlloc JS_ALWAYS_INLINE void *alloc(size_t n) { + JS_OOM_POSSIBLY_FAIL(); + void *result; if (latest && (result = latest->tryAlloc(n))) return result; diff --git a/js/src/jit-test/tests/debug/Debugger-findScripts-01.js b/js/src/jit-test/tests/debug/Debugger-findScripts-01.js new file mode 100644 index 00000000000..e39691605b2 --- /dev/null +++ b/js/src/jit-test/tests/debug/Debugger-findScripts-01.js @@ -0,0 +1,4 @@ +// In a debugger with no debuggees, findScripts should return no scripts. + +var dbg = new Debugger; +assertEq(dbg.findScripts().length, 0); diff --git a/js/src/jit-test/tests/debug/Debugger-findScripts-02.js b/js/src/jit-test/tests/debug/Debugger-findScripts-02.js new file mode 100644 index 00000000000..f9162d786a0 --- /dev/null +++ b/js/src/jit-test/tests/debug/Debugger-findScripts-02.js @@ -0,0 +1,15 @@ +// In a debuggee with functions, findScripts finds those functions' scripts. + +var g = newGlobal('new-compartment'); +g.eval('function f(){}'); +g.eval('function g(){}'); +g.eval('function h(){}'); + +var dbg = new Debugger(g); +var fw = dbg.addDebuggee(g.f); +var gw = dbg.addDebuggee(g.g); +var hw = dbg.addDebuggee(g.h); + +assertEq(dbg.findScripts().indexOf(fw.script) != -1, true); +assertEq(dbg.findScripts().indexOf(gw.script) != -1, true); +assertEq(dbg.findScripts().indexOf(hw.script) != -1, true); diff --git a/js/src/jit-test/tests/debug/Debugger-findScripts-03.js b/js/src/jit-test/tests/debug/Debugger-findScripts-03.js new file mode 100644 index 00000000000..e234748eafa --- /dev/null +++ b/js/src/jit-test/tests/debug/Debugger-findScripts-03.js @@ -0,0 +1,16 @@ +// While eval code is running, findScripts returns its script. + +var g = newGlobal('new-compartment'); +var dbg = new Debugger(g); +var log; + +g.check = function () { + log += 'c'; + var frame = dbg.getNewestFrame(); + assertEq(frame.type, "eval"); + assertEq(dbg.findScripts().indexOf(frame.script) != -1, true); +}; + +log = ''; +g.eval('check()'); +assertEq(log, 'c'); diff --git a/js/src/jit-test/tests/debug/Debugger-findScripts-04.js b/js/src/jit-test/tests/debug/Debugger-findScripts-04.js new file mode 100644 index 00000000000..3fba42fecb9 --- /dev/null +++ b/js/src/jit-test/tests/debug/Debugger-findScripts-04.js @@ -0,0 +1,27 @@ +// Within a series of evals and calls, all their frames' scripts appear in findScripts' result. +var g = newGlobal('new-compartment'); +var dbg = new Debugger(g); +var log; + +g.check = function () { + log += 'c'; + var scripts = dbg.findScripts(); + + var innerEvalFrame = dbg.getNewestFrame(); + assertEq(innerEvalFrame.type, "eval"); + assertEq(scripts.indexOf(innerEvalFrame.script) != -1, true); + + var callFrame = innerEvalFrame.older; + assertEq(callFrame.type, "call"); + assertEq(scripts.indexOf(callFrame.script) != -1, true); + + var outerEvalFrame = callFrame.older; + assertEq(outerEvalFrame.type, "eval"); + assertEq(scripts.indexOf(outerEvalFrame.script) != -1, true); + assertEq(innerEvalFrame != outerEvalFrame, true); +}; + +g.eval('function f() { eval("check();") }'); +log = ''; +g.eval('f();'); +assertEq(log, 'c'); diff --git a/js/src/jit-test/tests/debug/Debugger-findScripts-05.js b/js/src/jit-test/tests/debug/Debugger-findScripts-05.js new file mode 100644 index 00000000000..bcc023331ad --- /dev/null +++ b/js/src/jit-test/tests/debug/Debugger-findScripts-05.js @@ -0,0 +1,17 @@ +// findScripts' result includes scripts for nested functions. +var g = newGlobal('new-compartment'); +var dbg = new Debugger(g); +var log; + +g.eval('function f() { return function g() { return function h() { return "Squee!"; } } }'); +var fw = dbg.addDebuggee(g.f); +var gw = dbg.addDebuggee(g.f()); +var hw = dbg.addDebuggee(g.f()()); + +assertEq(fw.script != gw.script, true); +assertEq(fw.script != hw.script, true); + +var scripts = dbg.findScripts(); +assertEq(scripts.indexOf(fw.script) != -1, true); +assertEq(scripts.indexOf(gw.script) != -1, true); +assertEq(scripts.indexOf(hw.script) != -1, true); diff --git a/js/src/jit-test/tests/debug/Debugger-findScripts-06.js b/js/src/jit-test/tests/debug/Debugger-findScripts-06.js new file mode 100644 index 00000000000..c0944030900 --- /dev/null +++ b/js/src/jit-test/tests/debug/Debugger-findScripts-06.js @@ -0,0 +1,11 @@ +// In a debugger with multiple debuggees, findScripts finds scripts across all debuggees. +var g1 = newGlobal('new-compartment'); +var g2 = newGlobal('new-compartment'); +var dbg = new Debugger(g1, g2); + +g1.eval('function f() {}'); +g2.eval('function g() {}'); + +var scripts = dbg.findScripts(); +assertEq(scripts.indexOf(dbg.addDebuggee(g1.f).script) != -1, true); +assertEq(scripts.indexOf(dbg.addDebuggee(g2.g).script) != -1, true); diff --git a/js/src/jsapi-tests/testSlowScript.cpp b/js/src/jsapi-tests/testSlowScript.cpp new file mode 100644 index 00000000000..1613a79a971 --- /dev/null +++ b/js/src/jsapi-tests/testSlowScript.cpp @@ -0,0 +1,81 @@ +#include "tests.h" + +JSBool +OperationCallback(JSContext *cx) +{ + return false; +} + +static unsigned sRemain; + +JSBool +TriggerOperationCallback(JSContext *cx, unsigned argc, jsval *vp) +{ + if (!sRemain--) + JS_TriggerOperationCallback(JS_GetRuntime(cx)); + *vp = JSVAL_VOID; + return true; +} + +BEGIN_TEST(testSlowScript) +{ + JS_SetOperationCallback(cx, OperationCallback); + JS_DefineFunction(cx, global, "triggerOperationCallback", TriggerOperationCallback, 0, 0); + + test("while (true)" + " for (i in [0,0,0,0])" + " triggerOperationCallback();"); + + test("while (true)" + " for (i in [0,0,0,0])" + " for (j in [0,0,0,0])" + " triggerOperationCallback();"); + + test("while (true)" + " for (i in [0,0,0,0])" + " for (j in [0,0,0,0])" + " for (k in [0,0,0,0])" + " triggerOperationCallback();"); + + test("function f() { while (true) yield triggerOperationCallback() }" + "for (i in f()) ;"); + + test("function f() { while (true) yield 1 }" + "for (i in f())" + " triggerOperationCallback();"); + + test("(function() {" + " while (true)" + " let (x = 1) { eval('triggerOperationCallback()'); }" + "})()"); + + return true; +} + +bool +test(const char *bytes) +{ + jsval v; + + JS_SetOptions(cx, JS_GetOptions(cx) & ~(JSOPTION_METHODJIT | JSOPTION_METHODJIT_ALWAYS)); + sRemain = 0; + CHECK(!evaluate(bytes, __FILE__, __LINE__, &v)); + CHECK(!JS_IsExceptionPending(cx)); + + sRemain = 1000; + CHECK(!evaluate(bytes, __FILE__, __LINE__, &v)); + CHECK(!JS_IsExceptionPending(cx)); + + JS_SetOptions(cx, JS_GetOptions(cx) | JSOPTION_METHODJIT | JSOPTION_METHODJIT_ALWAYS); + + sRemain = 0; + CHECK(!evaluate(bytes, __FILE__, __LINE__, &v)); + CHECK(!JS_IsExceptionPending(cx)); + + sRemain = 1000; + CHECK(!evaluate(bytes, __FILE__, __LINE__, &v)); + CHECK(!JS_IsExceptionPending(cx)); + + return true; +} +END_TEST(testSlowScript) diff --git a/js/src/jsapi.h b/js/src/jsapi.h index e6ea47fc71b..b7bef71cb65 100644 --- a/js/src/jsapi.h +++ b/js/src/jsapi.h @@ -862,7 +862,8 @@ class JS_PUBLIC_API(AutoGCRooter) { STRING = -14, /* js::AutoStringRooter */ IDVECTOR = -15, /* js::AutoIdVector */ OBJVECTOR = -16, /* js::AutoObjectVector */ - IONMASM = -17 /* ion::MacroAssembler */ + SCRIPTVECTOR =-17, /* js::AutoScriptVector */ + IONMASM = -18 /* js::ion::MacroAssembler */ }; private: @@ -1140,6 +1141,19 @@ class AutoIdVector : public AutoVectorRooter JS_DECL_USE_GUARD_OBJECT_NOTIFIER }; +class AutoScriptVector : public AutoVectorRooter +{ + public: + explicit AutoScriptVector(JSContext *cx + JS_GUARD_OBJECT_NOTIFIER_PARAM) + : AutoVectorRooter(cx, SCRIPTVECTOR) + { + JS_GUARD_OBJECT_NOTIFIER_INIT; + } + + JS_DECL_USE_GUARD_OBJECT_NOTIFIER +}; + } /* namespace JS */ /************************************************************************/ diff --git a/js/src/jsarray.cpp b/js/src/jsarray.cpp index 823f6a28993..c1cd20e4fc2 100644 --- a/js/src/jsarray.cpp +++ b/js/src/jsarray.cpp @@ -3846,10 +3846,9 @@ mjit::stubs::NewDenseUnallocatedArray(VMFrame &f, uint32_t length) { JSObject *proto = (JSObject *) f.scratch; JSObject *obj = NewArray(f.cx, length, proto); - if (!obj) { - js_ReportOutOfMemory(f.cx); + if (!obj) THROWV(NULL); - } + return obj; } #endif diff --git a/js/src/jsgc.cpp b/js/src/jsgc.cpp index 1c1816b57f4..b794f53e5d9 100644 --- a/js/src/jsgc.cpp +++ b/js/src/jsgc.cpp @@ -2338,6 +2338,13 @@ AutoGCRooter::trace(JSTracer *trc) return; } + case SCRIPTVECTOR: { + AutoScriptVector::VectorImpl &vector = static_cast(this)->vector; + for (size_t i = 0; i < vector.length(); i++) + MarkScriptRoot(trc, &vector[i], "AutoScriptVector element"); + return; + } + case IONMASM: { #ifdef JS_ION static_cast(this)->masm()->trace(trc); diff --git a/js/src/jsgcinlines.h b/js/src/jsgcinlines.h index 5fcd1515c0e..feb489a0d8a 100644 --- a/js/src/jsgcinlines.h +++ b/js/src/jsgcinlines.h @@ -118,8 +118,8 @@ GetGCObjectFixedSlotsKind(size_t numFixedSlots) static inline bool IsBackgroundAllocKind(AllocKind kind) { - JS_ASSERT(kind <= FINALIZE_OBJECT_LAST); - return kind % 2 == 1; + JS_ASSERT(kind <= FINALIZE_LAST); + return kind <= FINALIZE_OBJECT_LAST && kind % 2 == 1; } static inline AllocKind @@ -353,9 +353,13 @@ class CellIter : public CellIterImpl : lists(&comp->arenas), kind(kind) { -#ifdef JS_THREADSAFE - JS_ASSERT(comp->arenas.doneBackgroundFinalize(kind)); -#endif + /* + * We have a single-threaded runtime, so there's no need to protect + * against other threads iterating or allocating. However, we do have + * background finalization; make sure people aren't using CellIter to + * walk such allocation kinds. + */ + JS_ASSERT(!IsBackgroundAllocKind(kind)); if (lists->isSynchronizedFreeList(kind)) { lists = NULL; } else { @@ -403,6 +407,9 @@ NewGCThing(JSContext *cx, js::gc::AllocKind kind, size_t thingSize) JS_ASSERT(!cx->runtime->gcRunning); JS_ASSERT(!cx->runtime->noGCOrAllocationCheck); + /* For testing out of memory conditions */ + JS_OOM_POSSIBLY_FAIL(); + #ifdef JS_GC_ZEAL if (cx->runtime->needZealousGC()) js::gc::RunDebugGC(cx); diff --git a/js/src/jsinterp.cpp b/js/src/jsinterp.cpp index 51f3ac6b800..48d60997469 100644 --- a/js/src/jsinterp.cpp +++ b/js/src/jsinterp.cpp @@ -1020,6 +1020,79 @@ js::UnwindScope(JSContext *cx, uint32_t stackDepth) } } +void +js::UnwindForUncatchableException(JSContext *cx, const FrameRegs ®s) +{ + + /* c.f. the regular (catchable) TryNoteIter loop in Interpret. */ + for (TryNoteIter tni(regs); !tni.done(); ++tni) { + JSTryNote *tn = *tni; + if (tn->kind == JSTRY_ITER) { + Value *sp = regs.fp()->base() + tn->stackDepth; + UnwindIteratorForUncatchableException(cx, &sp[-1].toObject()); + } + } +} + +TryNoteIter::TryNoteIter(const FrameRegs ®s) + : regs(regs), + script(regs.fp()->script()), + pcOffset(regs.pc - script->main()) +{ + if (JSScript::isValidOffset(script->trynotesOffset)) { + tn = script->trynotes()->vector; + tnEnd = tn + script->trynotes()->length; + } else { + tn = tnEnd = NULL; + } + settle(); +} + +void +TryNoteIter::operator++() +{ + ++tn; + settle(); +} + +bool +TryNoteIter::done() const +{ + return tn == tnEnd; +} + +void +TryNoteIter::settle() +{ + for (; tn != tnEnd; ++tn) { + /* If pc is out of range, try the next one. */ + if (pcOffset - tn->start >= tn->length) + continue; + + /* + * We have a note that covers the exception pc but we must check + * whether the interpreter has already executed the corresponding + * handler. This is possible when the executed bytecode implements + * break or return from inside a for-in loop. + * + * In this case the emitter generates additional [enditer] and [gosub] + * opcodes to close all outstanding iterators and execute the finally + * blocks. If such an [enditer] throws an exception, its pc can still + * be inside several nested for-in loops and try-finally statements + * even if we have already closed the corresponding iterators and + * invoked the finally blocks. + * + * To address this, we make [enditer] always decrease the stack even + * when its implementation throws an exception. Thus already executed + * [enditer] and [gosub] opcodes will have try notes with the stack + * depth exceeding the current one and this condition is what we use to + * filter them out. + */ + if (tn->stackDepth <= regs.sp - regs.fp()->base()) + break; + } +} + /* * Increment/decrement the value 'v'. The resulting value is stored in *slot. * The result of the expression (taking into account prefix/postfix) is stored @@ -4211,14 +4284,7 @@ END_CASE(JSOP_ARRAYPUSH) JS_ASSERT(&cx->regs() == ®s); JS_ASSERT(uint32_t(regs.pc - script->code) < script->length); - if (!cx->isExceptionPending()) { - /* This is an error, not a catchable exception, quit the frame ASAP. */ - interpReturnOK = false; - } else { - JSThrowHook handler; - JSTryNote *tn, *tnlimit; - uint32_t offset; - + if (cx->isExceptionPending()) { /* Restore atoms local in case we will resume. */ atoms = script->atoms; @@ -4227,8 +4293,7 @@ END_CASE(JSOP_ARRAYPUSH) Value rval; JSTrapStatus st = Debugger::onExceptionUnwind(cx, &rval); if (st == JSTRAP_CONTINUE) { - handler = cx->runtime->debugHooks.throwHook; - if (handler) + if (JSThrowHook handler = cx->runtime->debugHooks.throwHook) st = handler(cx, script, regs.pc, &rval, cx->runtime->debugHooks.throwHookData); } @@ -4249,40 +4314,10 @@ END_CASE(JSOP_ARRAYPUSH) CHECK_INTERRUPT_HANDLER(); } - /* - * Look for a try block in script that can catch this exception. - */ - if (!JSScript::isValidOffset(script->trynotesOffset)) - goto no_catch; + for (TryNoteIter tni(regs); !tni.done(); ++tni) { + JSTryNote *tn = *tni; - offset = (uint32_t)(regs.pc - script->main()); - tn = script->trynotes()->vector; - tnlimit = tn + script->trynotes()->length; - do { - if (offset - tn->start >= tn->length) - continue; - - /* - * We have a note that covers the exception pc but we must check - * whether the interpreter has already executed the corresponding - * handler. This is possible when the executed bytecode - * implements break or return from inside a for-in loop. - * - * In this case the emitter generates additional [enditer] and - * [gosub] opcodes to close all outstanding iterators and execute - * the finally blocks. If such an [enditer] throws an exception, - * its pc can still be inside several nested for-in loops and - * try-finally statements even if we have already closed the - * corresponding iterators and invoked the finally blocks. - * - * To address this, we make [enditer] always decrease the stack - * even when its implementation throws an exception. Thus already - * executed [enditer] and [gosub] opcodes will have try notes - * with the stack depth exceeding the current one and this - * condition is what we use to filter them out. - */ - if (tn->stackDepth > regs.sp - regs.fp()->base()) - continue; + UnwindScope(cx, tn->stackDepth); /* * Set pc to the first bytecode after the the try note to point @@ -4290,8 +4325,6 @@ END_CASE(JSOP_ARRAYPUSH) * the for-in loop. */ regs.pc = (script)->main() + tn->start + tn->length; - - UnwindScope(cx, tn->stackDepth); regs.sp = regs.fp()->base() + tn->stackDepth; switch (tn->kind) { @@ -4332,9 +4365,8 @@ END_CASE(JSOP_ARRAYPUSH) goto error; } } - } while (++tn != tnlimit); + } - no_catch: /* * Propagate the exception or error to the caller unless the exception * is an asynchronous return from a generator. @@ -4348,6 +4380,9 @@ END_CASE(JSOP_ARRAYPUSH) regs.fp()->clearReturnValue(); } #endif + } else { + UnwindForUncatchableException(cx, regs); + interpReturnOK = false; } forced_return: diff --git a/js/src/jsinterp.h b/js/src/jsinterp.h index 69007267273..4229747a976 100644 --- a/js/src/jsinterp.h +++ b/js/src/jsinterp.h @@ -329,12 +329,33 @@ class InterpreterFrames { extern void UnwindScope(JSContext *cx, uint32_t stackDepth); +/* + * Unwind for an uncatchable exception. This means not running finalizers, etc; + * just preserving the basic engine stack invariants. + */ +extern void +UnwindForUncatchableException(JSContext *cx, const FrameRegs ®s); + extern bool OnUnknownMethod(JSContext *cx, JSObject *obj, Value idval, Value *vp); extern bool IsActiveWithOrBlock(JSContext *cx, JSObject &obj, uint32_t stackDepth); +class TryNoteIter +{ + const FrameRegs ®s; + JSScript *script; + uint32_t pcOffset; + JSTryNote *tn, *tnEnd; + void settle(); + public: + TryNoteIter(const FrameRegs ®s); + bool done() const; + void operator++(); + JSTryNote *operator*() const { return tn; } +}; + /************************************************************************/ /* diff --git a/js/src/jsiter.cpp b/js/src/jsiter.cpp index 58cc71b740a..ac6318991f3 100644 --- a/js/src/jsiter.cpp +++ b/js/src/jsiter.cpp @@ -885,14 +885,12 @@ static JSBool CloseGenerator(JSContext *cx, JSObject *genobj); #endif -namespace js { - /* * Call ToObject(v).__iterator__(keyonly) if ToObject(v).__iterator__ exists. * Otherwise construct the default iterator. */ JSBool -ValueToIterator(JSContext *cx, unsigned flags, Value *vp) +js::ValueToIterator(JSContext *cx, unsigned flags, Value *vp) { /* JSITER_KEYVALUE must always come with JSITER_FOREACH */ JS_ASSERT_IF(flags & JSITER_KEYVALUE, flags & JSITER_FOREACH); @@ -931,7 +929,7 @@ ValueToIterator(JSContext *cx, unsigned flags, Value *vp) } bool -CloseIterator(JSContext *cx, JSObject *obj) +js::CloseIterator(JSContext *cx, JSObject *obj) { cx->iterValue.setMagic(JS_NO_ITER_VALUE); @@ -962,7 +960,7 @@ CloseIterator(JSContext *cx, JSObject *obj) } bool -UnwindIteratorForException(JSContext *cx, JSObject *obj) +js::UnwindIteratorForException(JSContext *cx, JSObject *obj) { Value v = cx->getPendingException(); cx->clearPendingException(); @@ -972,7 +970,17 @@ UnwindIteratorForException(JSContext *cx, JSObject *obj) return true; } -} // namespace js +void +js::UnwindIteratorForUncatchableException(JSContext *cx, JSObject *obj) +{ + if (obj->isIterator()) { + NativeIterator *ni = obj->getNativeIterator(); + if (ni->flags & JSITER_ENUMERATE) { + JS_ASSERT(cx->enumerators == obj); + cx->enumerators = ni->next; + } + } +} /* * Suppress enumeration of deleted properties. This function must be called diff --git a/js/src/jsiter.h b/js/src/jsiter.h index 63987a8e069..c0883c6c71e 100644 --- a/js/src/jsiter.h +++ b/js/src/jsiter.h @@ -199,6 +199,9 @@ CloseIterator(JSContext *cx, JSObject *iterObj); extern bool UnwindIteratorForException(JSContext *cx, JSObject *obj); +extern void +UnwindIteratorForUncatchableException(JSContext *cx, JSObject *obj); + } extern bool diff --git a/js/src/jsobjinlines.h b/js/src/jsobjinlines.h index 4f62733e014..8d93467a097 100644 --- a/js/src/jsobjinlines.h +++ b/js/src/jsobjinlines.h @@ -1076,8 +1076,10 @@ JSObject::createDenseArray(JSContext *cx, js::gc::AllocKind kind, uint32_t capacity = js::gc::GetGCKindSlots(kind) - js::ObjectElements::VALUES_PER_HEADER; JSObject *obj = js_NewGCObject(cx, kind); - if (!obj) + if (!obj) { + js_ReportOutOfMemory(cx); return NULL; + } obj->shape_.init(shape); obj->type_.init(type); diff --git a/js/src/jsscope.cpp b/js/src/jsscope.cpp index 53f381a56ed..c79011f433a 100644 --- a/js/src/jsscope.cpp +++ b/js/src/jsscope.cpp @@ -451,8 +451,10 @@ JSObject::toDictionaryMode(JSContext *cx) JS_ASSERT(!shape->inDictionary()); Shape *dprop = js_NewGCShape(cx); - if (!dprop) + if (!dprop) { + js_ReportOutOfMemory(cx); return false; + } HeapPtrShape *listp = dictionaryShape ? &dictionaryShape->parent @@ -466,8 +468,10 @@ JSObject::toDictionaryMode(JSContext *cx) shape = shape->previous(); } - if (!root->hashify(cx)) + if (!root->hashify(cx)) { + js_ReportOutOfMemory(cx); return false; + } JS_ASSERT((Shape **) root->listp == root.address()); root->listp = &self->shape_; diff --git a/js/src/methodjit/Compiler.cpp b/js/src/methodjit/Compiler.cpp index bbac5948e40..f0e91b2d7a9 100644 --- a/js/src/methodjit/Compiler.cpp +++ b/js/src/methodjit/Compiler.cpp @@ -408,8 +408,10 @@ mjit::Compiler::pushActiveFrame(JSScript *script, uint32_t argc) script->initCounts(cx); ActiveFrame *newa = OffTheBooks::new_(cx); - if (!newa) + if (!newa) { + js_ReportOutOfMemory(cx); return Compile_Error; + } newa->parent = a; if (a) @@ -624,8 +626,10 @@ mjit::Compiler::prepareInferenceTypes(JSScript *script, ActiveFrame *a) a->varTypes = (VarType *) OffTheBooks::calloc_(TotalSlots(script) * sizeof(VarType)); - if (!a->varTypes) + if (!a->varTypes) { + js_ReportOutOfMemory(cx); return Compile_Error; + } for (uint32_t slot = ArgSlot(0); slot < TotalSlots(script); slot++) { VarType &vt = a->varTypes[slot]; @@ -7001,8 +7005,10 @@ mjit::Compiler::startLoop(jsbytecode *head, Jump entry, jsbytecode *entryTarget) } LoopState *nloop = OffTheBooks::new_(cx, &ssa, this, &frame); - if (!nloop || !nloop->init(head, entry, entryTarget)) + if (!nloop || !nloop->init(head, entry, entryTarget)) { + js_ReportOutOfMemory(cx); return false; + } nloop->outer = loop; loop = nloop; @@ -7178,8 +7184,10 @@ mjit::Compiler::jumpAndRun(Jump j, jsbytecode *target, Jump *slow, bool *trampol RegisterAllocation *&alloc = analysis->getAllocation(target); if (!alloc) { alloc = cx->typeLifoAlloc().new_(false); - if (!alloc) + if (!alloc) { + js_ReportOutOfMemory(cx); return false; + } } lvtarget = alloc; consistent = frame.consistentRegisters(target); diff --git a/js/src/methodjit/FrameState.cpp b/js/src/methodjit/FrameState.cpp index a9b24b677d4..28f91d39950 100644 --- a/js/src/methodjit/FrameState.cpp +++ b/js/src/methodjit/FrameState.cpp @@ -575,8 +575,10 @@ FrameState::computeAllocation(jsbytecode *target) { JS_ASSERT(cx->typeInferenceEnabled()); RegisterAllocation *alloc = cx->typeLifoAlloc().new_(false); - if (!alloc) + if (!alloc) { + js_ReportOutOfMemory(cx); return NULL; + } /* * State must be synced at exception and switch targets, at traps and when @@ -856,8 +858,10 @@ FrameState::discardForJoin(RegisterAllocation *&alloc, uint32_t stackDepth) * loop head, and for exception, switch target and trap safe points. */ alloc = cx->typeLifoAlloc().new_(false); - if (!alloc) + if (!alloc) { + js_ReportOutOfMemory(cx); return false; + } } resetInternalState(); diff --git a/js/src/methodjit/InvokeHelpers.cpp b/js/src/methodjit/InvokeHelpers.cpp index a66c8eb8b8c..9cbe40f220c 100644 --- a/js/src/methodjit/InvokeHelpers.cpp +++ b/js/src/methodjit/InvokeHelpers.cpp @@ -78,37 +78,21 @@ FindExceptionHandler(JSContext *cx) StackFrame *fp = cx->fp(); JSScript *script = fp->script(); -top: - if (cx->isExceptionPending() && JSScript::isValidOffset(script->trynotesOffset)) { - // The PC is updated before every stub call, so we can use it here. - unsigned offset = cx->regs().pc - script->main(); + if (!JSScript::isValidOffset(script->trynotesOffset)) + return NULL; - JSTryNoteArray *tnarray = script->trynotes(); - for (unsigned i = 0; i < tnarray->length; ++i) { - JSTryNote *tn = &tnarray->vector[i]; - - // The following if condition actually tests two separate conditions: - // (1) offset - tn->start >= tn->length - // means the PC is not in the range of this try note, so we - // should continue searching, after considering: - // (2) offset - tn->start == tn->length - // means the PC is at the first op of the exception handler - // for this try note. This happens when an exception is thrown - // during recording: the interpreter sets the PC to the handler - // and then exits. In this case, we are in fact at the right - // exception handler. - // - // Hypothetically, the op we are at might have thrown an - // exception, in which case this would not be the right handler. - // But the first ops of exception handlers generated by our - // bytecode compiler cannot throw, so this is not possible. - if (offset - tn->start > tn->length) - continue; - if (tn->stackDepth > cx->regs().sp - fp->base()) - continue; + error: + if (cx->isExceptionPending()) { + for (TryNoteIter tni(cx->regs()); !tni.done(); ++tni) { + JSTryNote *tn = *tni; UnwindScope(cx, tn->stackDepth); + /* + * Set pc to the first bytecode after the the try note to point + * to the beginning of catch or finally or to [enditer] closing + * the for-in loop. + */ jsbytecode *pc = script->main() + tn->start + tn->length; cx->regs().pc = pc; cx->regs().sp = fp->base() + tn->stackDepth; @@ -154,10 +138,12 @@ top: bool ok = UnwindIteratorForException(cx, &cx->regs().sp[-1].toObject()); cx->regs().sp -= 1; if (!ok) - goto top; + goto error; } } } + } else { + UnwindForUncatchableException(cx, cx->regs()); } return NULL; diff --git a/js/src/methodjit/LoopState.cpp b/js/src/methodjit/LoopState.cpp index c7afaa45975..73423e193b4 100644 --- a/js/src/methodjit/LoopState.cpp +++ b/js/src/methodjit/LoopState.cpp @@ -125,8 +125,10 @@ LoopState::init(jsbytecode *head, Jump entry, jsbytecode *entryTarget) JS_ASSERT(!alloc); alloc = cx->typeLifoAlloc().new_(true); - if (!alloc) + if (!alloc) { + js_ReportOutOfMemory(cx); return false; + } this->alloc = alloc; this->loopRegs = Registers::AvailAnyRegs; diff --git a/js/src/vm/Debugger.cpp b/js/src/vm/Debugger.cpp index 808a5c1b469..a3adef84625 100644 --- a/js/src/vm/Debugger.cpp +++ b/js/src/vm/Debugger.cpp @@ -47,6 +47,7 @@ #include "jsobj.h" #include "jswrapper.h" #include "jsarrayinlines.h" +#include "jsgcinlines.h" #include "jsinterpinlines.h" #include "jsobjinlines.h" #include "jsopcodeinlines.h" @@ -54,6 +55,7 @@ #include "frontend/BytecodeCompiler.h" #include "frontend/BytecodeEmitter.h" #include "methodjit/Retcon.h" +#include "js/Vector.h" #include "vm/Stack-inl.h" @@ -2032,6 +2034,87 @@ Debugger::removeDebuggeeGlobal(JSContext *cx, GlobalObject *global, debuggees.remove(global); } +/* A set of JSCompartment pointers. */ +typedef HashSet, RuntimeAllocPolicy> CompartmentSet; + +JSBool +Debugger::findScripts(JSContext *cx, unsigned argc, Value *vp) +{ + THIS_DEBUGGER(cx, argc, vp, "findScripts", args, dbg); + + CompartmentSet compartments(cx); + if (!compartments.init()) { + js_ReportOutOfMemory(cx); + return false; + } + + /* Assemble the set of debuggee compartments. */ + for (GlobalObjectSet::Range r = dbg->debuggees.all(); !r.empty(); r.popFront()) { + if (!compartments.put(r.front()->compartment())) { + js_ReportOutOfMemory(cx); + return false; + } + } + + /* + * Accumulate the scripts in an AutoScriptVector, instead of creating + * the JS array as we go, because we mustn't allocate JS objects or GC + * while we use the CellIter. + */ + AutoScriptVector scripts(cx); + + /* Search each compartment for debuggee scripts. */ + for (CompartmentSet::Range r = compartments.all(); !r.empty(); r.popFront()) { + for (gc::CellIter i(r.front(), gc::FINALIZE_SCRIPT); !i.done(); i.next()) { + JSScript *script = i.get(); + GlobalObject *global = script->getGlobalObjectOrNull(); + if (global && dbg->debuggees.has(global)) { + if (!scripts.append(script)) { + js_ReportOutOfMemory(cx); + return false; + } + } + } + } + + /* + * Since eval scripts have no global, we need to find them via the call + * stack, where frame's scope tells us the global in use. + */ + for (FrameRegsIter fri(cx); !fri.done(); ++fri) { + if (fri.fp()->isEvalFrame() && dbg->debuggees.has(&fri.fp()->scopeChain().global())) { + JSScript *script = fri.fp()->script(); + + /* + * If eval scripts never have global objects set, then we don't need + * to check the existing script vector for duplicates, since we only + * include scripts with globals above. + */ + JS_ASSERT(!script->getGlobalObjectOrNull()); + if (!scripts.append(script)) { + js_ReportOutOfMemory(cx); + return false; + } + } + } + + JSObject *result = NewDenseAllocatedArray(cx, scripts.length(), NULL); + if (!result) + return false; + + result->ensureDenseArrayInitializedLength(cx, 0, scripts.length()); + + for (size_t i = 0; i < scripts.length(); i++) { + JSObject *scriptObject = dbg->wrapScript(cx, scripts[i]); + if (!scriptObject) + return false; + result->setDenseArrayElement(i, ObjectValue(*scriptObject)); + } + + args.rval().setObject(*result); + return true; +} + JSPropertySpec Debugger::properties[] = { JS_PSGS("enabled", Debugger::getEnabled, Debugger::setEnabled, 0), JS_PSGS("onDebuggerStatement", Debugger::getOnDebuggerStatement, @@ -2052,6 +2135,7 @@ JSFunctionSpec Debugger::methods[] = { JS_FN("getDebuggees", Debugger::getDebuggees, 0, 0), JS_FN("getNewestFrame", Debugger::getNewestFrame, 0, 0), JS_FN("clearAllBreakpoints", Debugger::clearAllBreakpoints, 1, 0), + JS_FN("findScripts", Debugger::findScripts, 1, 0), JS_FS_END }; diff --git a/js/src/vm/Debugger.h b/js/src/vm/Debugger.h index e130da46b56..07df2a67026 100644 --- a/js/src/vm/Debugger.h +++ b/js/src/vm/Debugger.h @@ -200,6 +200,7 @@ class Debugger { static JSBool getDebuggees(JSContext *cx, unsigned argc, Value *vp); static JSBool getNewestFrame(JSContext *cx, unsigned argc, Value *vp); static JSBool clearAllBreakpoints(JSContext *cx, unsigned argc, Value *vp); + static JSBool findScripts(JSContext *cx, unsigned argc, Value *vp); static JSBool construct(JSContext *cx, unsigned argc, Value *vp); static JSPropertySpec properties[]; static JSFunctionSpec methods[]; diff --git a/js/xpconnect/src/XPCWrappedNativeScope.cpp b/js/xpconnect/src/XPCWrappedNativeScope.cpp index e5a27d0681f..ae32270c8d7 100644 --- a/js/xpconnect/src/XPCWrappedNativeScope.cpp +++ b/js/xpconnect/src/XPCWrappedNativeScope.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * ***** BEGIN LICENSE BLOCK ***** +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -255,30 +254,12 @@ XPCWrappedNativeScope::SetGlobal(XPCCallContext& ccx, JSObject* aGlobal, mScriptObjectPrincipal = sop; // Lookup 'globalObject.Object.prototype' for our wrapper's proto - { - AutoJSErrorAndExceptionEater eater(ccx); // scoped error eater - - jsval val; - jsid idObj = mRuntime->GetStringID(XPCJSRuntime::IDX_OBJECT); - jsid idProto = mRuntime->GetStringID(XPCJSRuntime::IDX_PROTOTYPE); - - // When creating a new scope to boostrap a new global, we don't yet have - // an XPCWrappedNative associated with the global object. However, the - // resolve hook on the JSClass assumes there is one. So we need to avoid - // resolving anything on the global object until things get a bit further - // along. As such, we manually resolve |Object| before accessing it below. - JSBool didResolve; - - if (JS_ResolveStandardClass(ccx, aGlobal, idObj, &didResolve) && - JS_GetPropertyById(ccx, aGlobal, idObj, &val) && - !JSVAL_IS_PRIMITIVE(val) && - JS_GetPropertyById(ccx, JSVAL_TO_OBJECT(val), idProto, &val) && - !JSVAL_IS_PRIMITIVE(val)) { - mPrototypeJSObject = JSVAL_TO_OBJECT(val); - } else { - NS_ERROR("Can't get globalObject.Object.prototype"); - } - } + JSObject *objectPrototype = + JS_GetObjectPrototype(ccx.GetJSContext(), aGlobal); + if (objectPrototype) + mPrototypeJSObject = objectPrototype; + else + NS_ERROR("Can't get globalObject.Object.prototype"); // Clear the no helper wrapper prototype object so that a new one // gets created if needed. diff --git a/js/xpconnect/src/xpcprivate.h b/js/xpconnect/src/xpcprivate.h index 222f8677e32..737ba901656 100644 --- a/js/xpconnect/src/xpcprivate.h +++ b/js/xpconnect/src/xpcprivate.h @@ -3954,30 +3954,6 @@ private: PRInt64 mTimeStamp; }; -/***************************************************************************/ - -class NS_STACK_CLASS AutoJSErrorAndExceptionEater -{ -public: - AutoJSErrorAndExceptionEater(JSContext* aCX - MOZ_GUARD_OBJECT_NOTIFIER_PARAM) - : mCX(aCX), - mOldErrorReporter(JS_SetErrorReporter(mCX, nsnull)), - mOldExceptionState(JS_SaveExceptionState(mCX)) { - MOZ_GUARD_OBJECT_NOTIFIER_INIT; - } - ~AutoJSErrorAndExceptionEater() - { - JS_SetErrorReporter(mCX, mOldErrorReporter); - JS_RestoreExceptionState(mCX, mOldExceptionState); - } -private: - JSContext* mCX; - JSErrorReporter mOldErrorReporter; - JSExceptionState* mOldExceptionState; - MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER -}; - /****************************************************************************** * Handles pre/post script processing and the setting/resetting the error * reporter diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index e1f55b2f739..6eedc39707e 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -3534,7 +3534,15 @@ const nsCSSFrameConstructor::FrameConstructionData* nsCSSFrameConstructor::FindCanvasData(Element* aElement, nsStyleContext* aStyleContext) { - if (!aElement->OwnerDoc()->IsScriptEnabled()) { + // We want to check whether script is enabled on the document that + // could be painting to the canvas. That's the owner document of + // the canvas, except when the owner document is a static document, + // in which case it's the original document it was cloned from. + nsIDocument* doc = aElement->OwnerDoc(); + if (doc->IsStaticDocument()) { + doc = doc->GetOriginalDocument(); + } + if (!doc->IsScriptEnabled()) { return nsnull; } @@ -3906,6 +3914,12 @@ bool IsXULDisplayType(const nsStyleDisplay* aDisplay) #define SCROLLABLE_XUL_FCDATA(_func) \ FCDATA_DECL(FCDATA_DISALLOW_OUT_OF_FLOW | FCDATA_SKIP_ABSPOS_PUSH | \ FCDATA_MAY_NEED_SCROLLFRAME, _func) +// .. but we allow some XUL frames to be _containers_ for out-of-flow content +// (This is the same as SCROLLABLE_XUL_FCDATA, but w/o FCDATA_SKIP_ABSPOS_PUSH) +#define SCROLLABLE_ABSPOS_CONTAINER_XUL_FCDATA(_func) \ + FCDATA_DECL(FCDATA_DISALLOW_OUT_OF_FLOW | \ + FCDATA_MAY_NEED_SCROLLFRAME, _func) + #define SIMPLE_XUL_CREATE(_tag, _func) \ { &nsGkAtoms::_tag, SIMPLE_XUL_FCDATA(_func) } #define SCROLLABLE_XUL_CREATE(_tag, _func) \ @@ -3914,6 +3928,8 @@ bool IsXULDisplayType(const nsStyleDisplay* aDisplay) { _int, SIMPLE_XUL_FCDATA(_func) } #define SCROLLABLE_XUL_INT_CREATE(_int, _func) \ { _int, SCROLLABLE_XUL_FCDATA(_func) } +#define SCROLLABLE_ABSPOS_CONTAINER_XUL_INT_CREATE(_int, _func) \ + { _int, SCROLLABLE_ABSPOS_CONTAINER_XUL_FCDATA(_func) } static nsIFrame* NS_NewGridBoxFrame(nsIPresShell* aPresShell, @@ -4109,8 +4125,10 @@ nsCSSFrameConstructor::FindXULDisplayData(const nsStyleDisplay* aDisplay, nsStyleContext* aStyleContext) { static const FrameConstructionDataByInt sXULDisplayData[] = { - SCROLLABLE_XUL_INT_CREATE(NS_STYLE_DISPLAY_INLINE_BOX, NS_NewBoxFrame), - SCROLLABLE_XUL_INT_CREATE(NS_STYLE_DISPLAY_BOX, NS_NewBoxFrame), + SCROLLABLE_ABSPOS_CONTAINER_XUL_INT_CREATE(NS_STYLE_DISPLAY_INLINE_BOX, + NS_NewBoxFrame), + SCROLLABLE_ABSPOS_CONTAINER_XUL_INT_CREATE(NS_STYLE_DISPLAY_BOX, + NS_NewBoxFrame), #ifdef MOZ_XUL SCROLLABLE_XUL_INT_CREATE(NS_STYLE_DISPLAY_INLINE_GRID, NS_NewGridBoxFrame), SCROLLABLE_XUL_INT_CREATE(NS_STYLE_DISPLAY_GRID, NS_NewGridBoxFrame), diff --git a/layout/base/nsLayoutUtils.cpp b/layout/base/nsLayoutUtils.cpp index 1a46283afac..50276c4f1e7 100644 --- a/layout/base/nsLayoutUtils.cpp +++ b/layout/base/nsLayoutUtils.cpp @@ -90,7 +90,6 @@ #ifdef MOZ_MEDIA #include "nsHTMLVideoElement.h" #endif -#include "nsGenericHTMLElement.h" #include "imgIRequest.h" #include "nsIImageLoadingContent.h" #include "nsCOMPtr.h" @@ -4202,7 +4201,7 @@ nsLayoutUtils::SurfaceFromElement(dom::Element* aElement, surf = imgSurf; } - result.mCORSUsed = video->GetCORSMode() != nsGenericHTMLElement::CORS_NONE; + result.mCORSUsed = video->GetCORSMode() != CORS_NONE; result.mSurface = surf; result.mSize = size; result.mPrincipal = principal.forget(); diff --git a/layout/generic/nsBlockFrame.cpp b/layout/generic/nsBlockFrame.cpp index 6b0f5812a1e..3af97127663 100644 --- a/layout/generic/nsBlockFrame.cpp +++ b/layout/generic/nsBlockFrame.cpp @@ -2269,7 +2269,7 @@ nsBlockFrame::ReflowDirtyLines(nsBlockReflowState& aState) // The line is empty. Try the next one. NS_ASSERTION(pulledLine->GetChildCount() == 0 && !pulledLine->mFirstChild, "bad empty line"); - aState.FreeLineBox(pulledLine); + FreeLineBox(pulledLine); continue; } @@ -2464,7 +2464,7 @@ nsBlockFrame::DeleteLine(nsBlockReflowState& aState, "but perhaps OK now"); nsLineBox *line = aLine; aLine = mLines.erase(aLine); - aState.FreeLineBox(line); + FreeLineBox(line); // Mark the previous margin of the next line dirty since we need to // recompute its top position. if (aLine != aLineEnd) @@ -2671,16 +2671,14 @@ nsBlockFrame::PullFrameFrom(nsBlockReflowState& aState, } // when aFromContainer is 'this', then aLine->LastChild()'s next sibling // is already set correctly. - aLine->SetChildCount(aLine->GetChildCount() + 1); - - PRInt32 fromLineChildCount = fromLine->GetChildCount(); - if (0 != --fromLineChildCount) { + aLine->NoteFrameAdded(frame); + + if (fromLine->GetChildCount() > 1) { // Mark line dirty now that we pulled a child - fromLine->SetChildCount(fromLineChildCount); + fromLine->NoteFrameRemoved(frame); fromLine->MarkDirty(); fromLine->mFirstChild = newFirstChild; - } - else { + } else { // Free up the fromLine now that it's empty // Its bounds might need to be redrawn, though. // XXX WHY do we invalidate the bounds AND the combined area? doesn't @@ -2696,7 +2694,7 @@ nsBlockFrame::PullFrameFrom(nsBlockReflowState& aState, Invalidate(fromLine->GetVisualOverflowArea()); fromLineList->erase(aFromLine); // aFromLine is now invalid - aState.FreeLineBox(fromLine); + FreeLineBox(fromLine); // Put any remaining overflow lines back. if (aFromOverflowLine) { @@ -3305,7 +3303,7 @@ nsBlockFrame::ReflowBlockFrame(nsBlockReflowState& aState, // Push continuation to a new line, but only if we actually made one. if (madeContinuation) { - nsLineBox* line = aState.NewLineBox(nextFrame, 1, true); + nsLineBox* line = NewLineBox(nextFrame, true); NS_ENSURE_TRUE(line, NS_ERROR_OUT_OF_MEMORY); mLines.after_insert(aLine, line); } @@ -3639,7 +3637,7 @@ nsBlockFrame::DoReflowInlineFrames(nsBlockReflowState& aState, nsLineBox *toremove = aLine; aLine = mLines.erase(aLine); NS_ASSERTION(nsnull == toremove->mFirstChild, "bad empty line"); - aState.FreeLineBox(toremove); + FreeLineBox(toremove); } --aLine; @@ -3976,7 +3974,7 @@ nsBlockFrame::CreateContinuationFor(nsBlockReflowState& aState, mFrames.InsertFrame(nsnull, aFrame, newFrame); if (aLine) { - aLine->SetChildCount(aLine->GetChildCount() + 1); + aLine->NoteFrameAdded(newFrame); } aMadeNewFrame = true; @@ -4099,12 +4097,11 @@ nsBlockFrame::SplitLine(nsBlockReflowState& aState, #endif // Put frames being split out into their own line - nsLineBox* newLine = aState.NewLineBox(aFrame, pushCount, false); + nsLineBox* newLine = NewLineBox(aLine, aFrame, pushCount); if (!newLine) { return NS_ERROR_OUT_OF_MEMORY; } mLines.after_insert(aLine, newLine); - aLine->SetChildCount(aLine->GetChildCount() - pushCount); #ifdef DEBUG if (gReallyNoisyReflow) { newLine->List(stdout, gNoiseIndent+1); @@ -4874,8 +4871,6 @@ nsBlockFrame::AddFrames(nsFrameList& aFrameList, nsIFrame* aPrevSibling) aPrevSibling = GetInsideBullet(); } - nsIPresShell *presShell = PresContext()->PresShell(); - // Attempt to find the line that contains the previous sibling FrameLines* overflowLines; nsLineList* lineList = &mLines; @@ -4922,12 +4917,11 @@ nsBlockFrame::AddFrames(nsFrameList& aFrameList, nsIFrame* aPrevSibling) PRInt32 rem = prevSibLine->GetChildCount() - prevSiblingIndex - 1; if (rem) { // Split the line in two where the frame(s) are being inserted. - nsLineBox* line = NS_NewLineBox(presShell, aPrevSibling->GetNextSibling(), rem, false); + nsLineBox* line = NewLineBox(prevSibLine, aPrevSibling->GetNextSibling(), rem); if (!line) { return NS_ERROR_OUT_OF_MEMORY; } lineList->after_insert(prevSibLine, line); - prevSibLine->SetChildCount(prevSibLine->GetChildCount() - rem); // Mark prevSibLine dirty and as needing textrun invalidation, since // we may be breaking up text in the line. Its previous line may also // need to be invalidated because it may be able to pull some text up. @@ -4968,7 +4962,7 @@ nsBlockFrame::AddFrames(nsFrameList& aFrameList, nsIFrame* aPrevSibling) (aPrevSibling && ShouldPutNextSiblingOnNewLine(aPrevSibling))) { // Create a new line for the frame and add its line to the line // list. - nsLineBox* line = NS_NewLineBox(presShell, newFrame, 1, isBlock); + nsLineBox* line = NewLineBox(newFrame, isBlock); if (!line) { return NS_ERROR_OUT_OF_MEMORY; } @@ -4984,7 +4978,7 @@ nsBlockFrame::AddFrames(nsFrameList& aFrameList, nsIFrame* aPrevSibling) } } else { - prevSibLine->SetChildCount(prevSibLine->GetChildCount() + 1); + prevSibLine->NoteFrameAdded(newFrame); // We're adding inline content to prevSibLine, so we need to mark it // dirty, ensure its textruns are recomputed, and possibly do the same // to its previous line since that line may be able to pull content up. @@ -5506,9 +5500,7 @@ nsBlockFrame::DoRemoveFrame(nsIFrame* aDeletedFrame, PRUint32 aFlags) } // Update the child count of the line to be accurate - PRInt32 lineChildCount = line->GetChildCount(); - lineChildCount--; - line->SetChildCount(lineChildCount); + line->NoteFrameRemoved(aDeletedFrame); // Destroy frame; capture its next continuation first in case we need // to destroy that too. @@ -5535,7 +5527,7 @@ nsBlockFrame::DoRemoveFrame(nsIFrame* aDeletedFrame, PRUint32 aFlags) bool haveAdvancedToNextLine = false; // If line is empty, remove it now. - if (0 == lineChildCount) { + if (0 == line->GetChildCount()) { #ifdef NOISY_REMOVE_FRAME printf("DoRemoveFrame: %s line=%p became empty so it will be removed\n", searchingOverflowList?"overflow":"normal", line.get()); @@ -5688,12 +5680,10 @@ nsBlockFrame::StealFrame(nsPresContext* aPresContext, } // Register removal with the line boxes - PRInt32 count = line->GetChildCount(); - line->SetChildCount(--count); - if (count > 0) { + line->NoteFrameRemoved(frame); + if (line->GetChildCount() > 0) { line->MarkDirty(); - } - else { + } else { // Remove the line box nsLineBox* lineBox = line; if (searchingOverflowList) { @@ -5712,8 +5702,7 @@ nsBlockFrame::StealFrame(nsPresContext* aPresContext, line_end = mLines.end(); line = line_end; } - } - else { + } else { line = mLines.erase(line); } lineBox->Destroy(aPresContext->PresShell()); diff --git a/layout/generic/nsBlockFrame.h b/layout/generic/nsBlockFrame.h index b61207fdc3b..dfbb1ec6207 100644 --- a/layout/generic/nsBlockFrame.h +++ b/layout/generic/nsBlockFrame.h @@ -354,6 +354,16 @@ protected: #endif #endif + nsLineBox* NewLineBox(nsIFrame* aFrame, bool aIsBlock) { + return NS_NewLineBox(PresContext()->PresShell(), aFrame, aIsBlock); + } + nsLineBox* NewLineBox(nsLineBox* aFromLine, nsIFrame* aFrame, PRInt32 aCount) { + return NS_NewLineBox(PresContext()->PresShell(), aFromLine, aFrame, aCount); + } + void FreeLineBox(nsLineBox* aLine) { + aLine->Destroy(PresContext()->PresShell()); + } + void TryAllLines(nsLineList::iterator* aIterator, nsLineList::iterator* aStartIterator, nsLineList::iterator* aEndIterator, diff --git a/layout/generic/nsBlockReflowState.cpp b/layout/generic/nsBlockReflowState.cpp index 144606a5e88..b62d989a4c5 100644 --- a/layout/generic/nsBlockReflowState.cpp +++ b/layout/generic/nsBlockReflowState.cpp @@ -149,22 +149,6 @@ nsBlockReflowState::nsBlockReflowState(const nsHTMLReflowState& aReflowState, mMinLineHeight = aReflowState.CalcLineHeight(); } -nsLineBox* -nsBlockReflowState::NewLineBox(nsIFrame* aFrame, - PRInt32 aCount, - bool aIsBlock) -{ - return NS_NewLineBox(mPresContext->PresShell(), aFrame, aCount, aIsBlock); -} - -void -nsBlockReflowState::FreeLineBox(nsLineBox* aLine) -{ - if (aLine) { - aLine->Destroy(mPresContext->PresShell()); - } -} - void nsBlockReflowState::ComputeReplacedBlockOffsetsForFloats(nsIFrame* aFrame, const nsRect& aFloatAvailableSpace, diff --git a/layout/generic/nsBlockReflowState.h b/layout/generic/nsBlockReflowState.h index f8a022ea2e2..a27925b686a 100644 --- a/layout/generic/nsBlockReflowState.h +++ b/layout/generic/nsBlockReflowState.h @@ -179,10 +179,6 @@ public: } } - nsLineBox* NewLineBox(nsIFrame* aFrame, PRInt32 aCount, bool aIsBlock); - - void FreeLineBox(nsLineBox* aLine); - //---------------------------------------- // This state is the "global" state computed once for the reflow of diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp index a82bc6afde0..2fddfaddd87 100644 --- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -7560,6 +7560,20 @@ nsFrame::DoLayout(nsBoxLayoutState& aState) desiredSize.width = size.width; desiredSize.height = size.height; desiredSize.UnionOverflowAreasWithDesiredBounds(); + + if (HasAbsolutelyPositionedChildren()) { + // Set up a |reflowState| to pass into ReflowAbsoluteFrames + nsHTMLReflowState reflowState(aState.PresContext(), this, + aState.GetRenderingContext(), + nsSize(size.width, NS_UNCONSTRAINEDSIZE)); + + // Set up a |reflowStatus| to pass into ReflowAbsoluteFrames + // (just a dummy value; hopefully that's OK) + nsReflowStatus reflowStatus = NS_FRAME_COMPLETE; + ReflowAbsoluteFrames(aState.PresContext(), desiredSize, + reflowState, reflowStatus); + } + FinishAndStoreOverflow(desiredSize.mOverflowAreas, size); SyncLayout(aState); diff --git a/layout/generic/nsLineBox.cpp b/layout/generic/nsLineBox.cpp index 6ef3a1fc40b..728b2d6eac1 100644 --- a/layout/generic/nsLineBox.cpp +++ b/layout/generic/nsLineBox.cpp @@ -55,6 +55,11 @@ static PRInt32 ctorCount; PRInt32 nsLineBox::GetCtorCount() { return ctorCount; } #endif +#ifndef _MSC_VER +// static nsLineBox constant; initialized in the header file. +const PRUint32 nsLineBox::kMinChildCountForHashtable; +#endif + nsLineBox::nsLineBox(nsIFrame* aFrame, PRInt32 aCount, bool aIsBlock) : mFirstChild(aFrame), mBounds(0, 0, 0, 0), @@ -76,7 +81,7 @@ nsLineBox::nsLineBox(nsIFrame* aFrame, PRInt32 aCount, bool aIsBlock) #if NS_STYLE_CLEAR_NONE > 0 mFlags.mBreakType = NS_STYLE_CLEAR_NONE; #endif - SetChildCount(aCount); + mChildCount = aCount; MarkDirty(); mFlags.mBlock = aIsBlock; } @@ -84,14 +89,88 @@ nsLineBox::nsLineBox(nsIFrame* aFrame, PRInt32 aCount, bool aIsBlock) nsLineBox::~nsLineBox() { MOZ_COUNT_DTOR(nsLineBox); + if (NS_UNLIKELY(mFlags.mHasHashedFrames)) { + delete mFrames; + } Cleanup(); } nsLineBox* -NS_NewLineBox(nsIPresShell* aPresShell, nsIFrame* aFrame, - PRInt32 aCount, bool aIsBlock) +NS_NewLineBox(nsIPresShell* aPresShell, nsIFrame* aFrame, bool aIsBlock) { - return new (aPresShell)nsLineBox(aFrame, aCount, aIsBlock); + return new (aPresShell) nsLineBox(aFrame, 1, aIsBlock); +} + +nsLineBox* +NS_NewLineBox(nsIPresShell* aPresShell, nsLineBox* aFromLine, + nsIFrame* aFrame, PRInt32 aCount) +{ + nsLineBox* newLine = new (aPresShell) nsLineBox(aFrame, aCount, false); + if (newLine) { + newLine->NoteFramesMovedFrom(aFromLine); + } + return newLine; +} + +void +nsLineBox::StealHashTableFrom(nsLineBox* aFromLine, PRUint32 aFromLineNewCount) +{ + MOZ_ASSERT(!mFlags.mHasHashedFrames); + MOZ_ASSERT(GetChildCount() >= PRInt32(aFromLineNewCount)); + mFrames = aFromLine->mFrames; + mFlags.mHasHashedFrames = 1; + aFromLine->mFlags.mHasHashedFrames = 0; + aFromLine->mChildCount = aFromLineNewCount; + // remove aFromLine's frames that aren't on this line + nsIFrame* f = aFromLine->mFirstChild; + for (PRUint32 i = 0; i < aFromLineNewCount; f = f->GetNextSibling(), ++i) { + mFrames->RemoveEntry(f); + } +} + +void +nsLineBox::NoteFramesMovedFrom(nsLineBox* aFromLine) +{ + PRUint32 fromCount = aFromLine->GetChildCount(); + PRUint32 toCount = GetChildCount(); + MOZ_ASSERT(toCount <= fromCount, "moved more frames than aFromLine has"); + PRUint32 fromNewCount = fromCount - toCount; + if (NS_LIKELY(!aFromLine->mFlags.mHasHashedFrames)) { + aFromLine->mChildCount = fromNewCount; + MOZ_ASSERT(toCount < kMinChildCountForHashtable); + } else if (fromNewCount < kMinChildCountForHashtable) { + // aFromLine has a hash table but will not have it after moving the frames + // so this line can steal the hash table if it needs it. + if (toCount >= kMinChildCountForHashtable) { + StealHashTableFrom(aFromLine, fromNewCount); + } else { + delete aFromLine->mFrames; + aFromLine->mFlags.mHasHashedFrames = 0; + aFromLine->mChildCount = fromNewCount; + } + } else { + // aFromLine still needs a hash table. + if (toCount < kMinChildCountForHashtable) { + // remove the moved frames from it + nsIFrame* f = mFirstChild; + for (PRUint32 i = 0; i < toCount; f = f->GetNextSibling(), ++i) { + aFromLine->mFrames->RemoveEntry(f); + } + } else if (toCount <= fromNewCount) { + // This line needs a hash table, allocate a hash table for it since that + // means fewer hash ops. + nsIFrame* f = mFirstChild; + for (PRUint32 i = 0; i < toCount; f = f->GetNextSibling(), ++i) { + aFromLine->mFrames->RemoveEntry(f); // toCount RemoveEntry + } + SwitchToHashtable(); // toCount PutEntry + } else { + // This line needs a hash table, but it's fewer hash ops to steal + // aFromLine's hash table and allocate a new hash table for that line. + StealHashTableFrom(aFromLine, fromNewCount); // fromNewCount RemoveEntry + aFromLine->SwitchToHashtable(); // fromNewCount PutEntry + } + } } // Overloaded new operator. Uses an arena (which comes from the presShell) @@ -102,21 +181,11 @@ nsLineBox::operator new(size_t sz, nsIPresShell* aPresShell) CPP_THROW_NEW return aPresShell->AllocateMisc(sz); } -// Overloaded delete operator. Doesn't actually free the memory, because we -// use an arena -void -nsLineBox::operator delete(void* aPtr, size_t sz) -{ -} - void nsLineBox::Destroy(nsIPresShell* aPresShell) { - // Destroy the object. This won't actually free the memory, though - delete this; - - // Have the pres shell recycle the memory - aPresShell->FreeMisc(sizeof(*this), (void*)this); + this->nsLineBox::~nsLineBox(); + aPresShell->FreeMisc(sizeof(*this), this); } void @@ -365,10 +434,18 @@ nsLineBox::RFindLineContaining(nsIFrame* aFrame, PRInt32* aFrameIndexInLine) { NS_PRECONDITION(aFrame, "null ptr"); + nsIFrame* curFrame = aLastFrameBeforeEnd; while (aBegin != aEnd) { --aEnd; NS_ASSERTION(aEnd->LastChild() == curFrame, "Unexpected curFrame"); + if (NS_UNLIKELY(aEnd->mFlags.mHasHashedFrames) && + !aEnd->Contains(aFrame)) { + if (aEnd->mFirstChild) { + curFrame = aEnd->mFirstChild->GetPrevSibling(); + } + continue; + } // i is the index of curFrame in aEnd PRInt32 i = aEnd->GetChildCount() - 1; while (i >= 0) { @@ -379,6 +456,7 @@ nsLineBox::RFindLineContaining(nsIFrame* aFrame, --i; curFrame = curFrame->GetPrevSibling(); } + MOZ_ASSERT(!aEnd->mFlags.mHasHashedFrames, "Contains lied to us!"); } *aFrameIndexInLine = -1; return false; diff --git a/layout/generic/nsLineBox.h b/layout/generic/nsLineBox.h index f20023e3087..a024ed48be2 100644 --- a/layout/generic/nsLineBox.h +++ b/layout/generic/nsLineBox.h @@ -182,9 +182,21 @@ protected: need to rearrange the mBits bitfield; #endif -// Funtion to create a line box +/** + * Function to create a line box and initialize it with a single frame. + * If the frame was moved from another line then you're responsible + * for notifying that line using NoteFrameRemoved(). Alternatively, + * it's better to use the next function that does that for you in an + * optimal way. + */ nsLineBox* NS_NewLineBox(nsIPresShell* aPresShell, nsIFrame* aFrame, - PRInt32 aCount, bool aIsBlock); + bool aIsBlock); +/** + * Function to create a line box and initialize it with aCount frames + * that are currently on aFromLine. + */ +nsLineBox* NS_NewLineBox(nsIPresShell* aPresShell, nsLineBox* aFromLine, + nsIFrame* aFrame, PRInt32 aCount); class nsLineList; @@ -232,13 +244,14 @@ private: // Overloaded new operator. Uses an arena (which comes from the presShell) // to perform the allocation. void* operator new(size_t sz, nsIPresShell* aPresShell) CPP_THROW_NEW; - void operator delete(void* aPtr, size_t sz); + void operator delete(void* aPtr, size_t sz) MOZ_DELETE; public: - // Use these two functions to allocate and destroy line boxes + // Use these functions to allocate and destroy line boxes friend nsLineBox* NS_NewLineBox(nsIPresShell* aPresShell, nsIFrame* aFrame, - PRInt32 aCount, bool aIsBlock); - + bool aIsBlock); + friend nsLineBox* NS_NewLineBox(nsIPresShell* aPresShell, nsLineBox* aFromLine, + nsIFrame* aFrame, PRInt32 aCount); void Destroy(nsIPresShell* aPresShell); // mBlock bit @@ -284,7 +297,6 @@ public: // mImpactedByFloat bit void SetLineIsImpactedByFloat(bool aValue) { - NS_ASSERTION((false==aValue || true==aValue), "somebody is playing fast and loose with bools and bits!"); mFlags.mImpactedByFloat = aValue; } bool IsImpactedByFloat() const { @@ -293,7 +305,6 @@ public: // mLineWrapped bit void SetLineWrapped(bool aOn) { - NS_ASSERTION((false==aOn || true==aOn), "somebody is playing fast and loose with bools and bits!"); mFlags.mLineWrapped = aOn; } bool IsLineWrapped() const { @@ -302,7 +313,6 @@ public: // mInvalidateTextRuns bit void SetInvalidateTextRuns(bool aOn) { - NS_ASSERTION((false==aOn || true==aOn), "somebody is playing fast and loose with bools and bits!"); mFlags.mInvalidateTextRuns = aOn; } bool GetInvalidateTextRuns() const { @@ -344,20 +354,76 @@ public: return mFlags.mHadFloatPushed; } +private: + // Add a hash table for fast lookup when the line has more frames than this. + static const PRUint32 kMinChildCountForHashtable = 200; - // mChildCount value - PRInt32 GetChildCount() const { - return (PRInt32) mFlags.mChildCount; + /** + * Take ownership of aFromLine's hash table and remove the frames that + * stay on aFromLine from it, i.e. aFromLineNewCount frames starting with + * mFirstChild. This method is used to optimize moving a large number + * of frames from one line to the next. + */ + void StealHashTableFrom(nsLineBox* aFromLine, PRUint32 aFromLineNewCount); + + /** + * Does the equivalent of this->NoteFrameAdded and aFromLine->NoteFrameRemoved + * for each frame on this line, but in a optimized way. + */ + void NoteFramesMovedFrom(nsLineBox* aFromLine); + + void SwitchToHashtable() + { + MOZ_ASSERT(!mFlags.mHasHashedFrames); + PRUint32 count = GetChildCount(); + mFrames = new nsTHashtable< nsPtrHashKey >(); + mFlags.mHasHashedFrames = 1; + PRUint32 minSize = + NS_MAX(kMinChildCountForHashtable, PRUint32(PL_DHASH_MIN_SIZE)); + mFrames->Init(NS_MAX(count, minSize)); + for (nsIFrame* f = mFirstChild; count-- > 0; f = f->GetNextSibling()) { + mFrames->PutEntry(f); + } } - void SetChildCount(PRInt32 aNewCount) { - if (aNewCount < 0) { - NS_WARNING("negative child count"); - aNewCount = 0; + void SwitchToCounter() { + MOZ_ASSERT(mFlags.mHasHashedFrames); + PRUint32 count = GetChildCount(); + delete mFrames; + mFlags.mHasHashedFrames = 0; + mChildCount = count; + } + +public: + PRInt32 GetChildCount() const { + return NS_UNLIKELY(mFlags.mHasHashedFrames) ? mFrames->Count() : mChildCount; + } + + /** + * Register that aFrame is now on this line. + */ + void NoteFrameAdded(nsIFrame* aFrame) { + if (NS_UNLIKELY(mFlags.mHasHashedFrames)) { + mFrames->PutEntry(aFrame); + } else { + if (++mChildCount >= kMinChildCountForHashtable) { + SwitchToHashtable(); + } } - if (aNewCount > LINE_MAX_CHILD_COUNT) { - aNewCount = LINE_MAX_CHILD_COUNT; + } + + /** + * Register that aFrame is not on this line anymore. + */ + void NoteFrameRemoved(nsIFrame* aFrame) { + MOZ_ASSERT(GetChildCount() > 0); + if (NS_UNLIKELY(mFlags.mHasHashedFrames)) { + mFrames->RemoveEntry(aFrame); + if (mFrames->Count() < kMinChildCountForHashtable) { + SwitchToCounter(); + } + } else { + --mChildCount; } - mFlags.mChildCount = aNewCount; } // mBreakType value @@ -473,10 +539,13 @@ public: nsIFrame* LastChild() const; #endif +private: PRInt32 IndexOf(nsIFrame* aFrame) const; +public: bool Contains(nsIFrame* aFrame) const { - return IndexOf(aFrame) >= 0; + return NS_UNLIKELY(mFlags.mHasHashedFrames) ? mFrames->Contains(aFrame) + : IndexOf(aFrame) >= 0; } // whether the line box is "logically" empty (just like nsIFrame::IsEmpty) @@ -504,6 +573,12 @@ public: nsRect mBounds; + // mFlags.mHasHashedFrames says which one to use + union { + nsTHashtable< nsPtrHashKey >* mFrames; + PRUint32 mChildCount; + }; + struct FlagBits { PRUint32 mDirty : 1; PRUint32 mPreviousMarginDirty : 1; @@ -521,10 +596,8 @@ public: // Indicates that this line *may* have a placeholder for a float // that was pushed to a later column or page. PRUint32 mHadFloatPushed : 1; + PRUint32 mHasHashedFrames: 1; PRUint32 mBreakType : 4; - - // FIXME: Move this out of FlagBits - PRUint32 mChildCount; }; struct ExtraData { diff --git a/layout/generic/nsSelection.cpp b/layout/generic/nsSelection.cpp index 2d26bde5a3a..45364479f1b 100644 --- a/layout/generic/nsSelection.cpp +++ b/layout/generic/nsSelection.cpp @@ -5692,24 +5692,23 @@ nsTypedSelection::NotifySelectionListeners() if (!mFrameSelection) return NS_OK;//nothing to do - if (mFrameSelection->GetBatching()){ + if (mFrameSelection->GetBatching()) { mFrameSelection->SetDirty(); return NS_OK; } - PRInt32 cnt = mSelectionListeners.Count(); nsCOMArray selectionListeners(mSelectionListeners); - + PRInt32 cnt = selectionListeners.Count(); + if (cnt != mSelectionListeners.Count()) { + return NS_ERROR_OUT_OF_MEMORY; // nsCOMArray is fallible + } nsCOMPtr domdoc; nsCOMPtr shell; nsresult rv = GetPresShell(getter_AddRefs(shell)); if (NS_SUCCEEDED(rv) && shell) domdoc = do_QueryInterface(shell->GetDocument()); short reason = mFrameSelection->PopReason(); - for (PRInt32 i = 0; i < cnt; i++) - { - nsISelectionListener* thisListener = selectionListeners[i]; - if (thisListener) - thisListener->NotifySelectionChanged(domdoc, this, reason); + for (PRInt32 i = 0; i < cnt; i++) { + selectionListeners[i]->NotifySelectionChanged(domdoc, this, reason); } return NS_OK; } diff --git a/layout/mathml/mathfont.properties b/layout/mathml/mathfont.properties index 69f7ead3216..cebb9fd4a29 100644 --- a/layout/mathml/mathfont.properties +++ b/layout/mathml/mathfont.properties @@ -46,9 +46,9 @@ # each font. Do not include the Unicode table in this list. %ifdef XP_WIN -font.mathfont-glyph-tables = STIXNonUnicode, STIXSizeOneSym, STIXSize1, MathJax_Main, Asana Math, Standard Symbols L, Symbol +font.mathfont-glyph-tables = MathJax_Main, STIXNonUnicode, STIXSizeOneSym, STIXSize1, Asana Math, Standard Symbols L, Symbol %else -font.mathfont-glyph-tables = STIXNonUnicode, STIXSizeOneSym, STIXSize1, MathJax_Main, Asana Math, Standard Symbols L +font.mathfont-glyph-tables = MathJax_Main, STIXNonUnicode, STIXSizeOneSym, STIXSize1, Asana Math, Standard Symbols L %endif # The ordered list of fonts with which to attempt to stretch MathML diff --git a/layout/mathml/mathml.css b/layout/mathml/mathml.css index d3cfa5e408c..8ebd0e4f228 100644 --- a/layout/mathml/mathml.css +++ b/layout/mathml/mathml.css @@ -54,7 +54,7 @@ math { display: inline; font-size: inherit; font-style: normal; - font-family: STIXGeneral, DejaVu Serif, DejaVu Sans, Cambria, Cambria Math, Times, Lucida Sans Unicode, OpenSymbol, Standard Symbols L, serif; + font-family: MathJax_Main, STIXGeneral, DejaVu Serif, DejaVu Sans, Cambria, Cambria Math, Times, Lucida Sans Unicode, OpenSymbol, Standard Symbols L, serif; text-rendering: optimizeLegibility; -moz-float-edge: margin-box; } @@ -156,13 +156,18 @@ math[display="inline"] { */ [mathvariant] { /* shared and same as [mathvariant="normal"] */ /* reset all font properties except those that affect the size */ + font-family: MathJax_Main, STIXGeneral, DejaVu Serif, DejaVu Sans, Cambria, Cambria Math, Times, Lucida Sans Unicode, OpenSymbol, Standard Symbols L, serif; font-style: normal; font-variant: normal; font-weight: normal; } -[mathvariant="bold-fraktur"], +[mathvariant="bold-fraktur"] { + font-weight: bold; + font-family: MathJax_Fraktur, STIXGeneral, DejaVu Serif, DejaVu Sans, Cambria, Cambria Math, Times, Lucida Sans Unicode, OpenSymbol, Standard Symbols L, serif; +} [mathvariant="bold-script"] { font-weight: bold; + font-family: MathJax_Script, STIXGeneral, DejaVu Serif, DejaVu Sans, Cambria, Cambria Math, Times, Lucida Sans Unicode, OpenSymbol, Standard Symbols L, serif; } [mathvariant="bold"] { font-weight: bold; @@ -175,23 +180,32 @@ math[display="inline"] { font-style: italic; } [mathvariant="sans-serif"] { - font-family: sans-serif; + font-family: MathJax_SansSerif, sans-serif; } [mathvariant="bold-sans-serif"] { font-weight: bold; - font-family: sans-serif; + font-family: MathJax_SansSerif, sans-serif; } [mathvariant="sans-serif-italic"] { - font-family: sans-serif; + font-family: MathJax_SansSerif, sans-serif; font-style: italic; } [mathvariant="sans-serif-bold-italic"] { - font-family: sans-serif; + font-family: MathJax_SansSerif, sans-serif; font-weight: bold; font-style: italic; } [mathvariant="monospace"] { - font-family: monospace; + font-family: MathJax_Typewriter, monospace; +} +[mathvariant="double-struck"] { + font-family: MathJax_AMS, STIXGeneral, DejaVu Serif, DejaVu Sans, Cambria, Cambria Math, Times, Lucida Sans Unicode, OpenSymbol, Standard Symbols L, serif; +} +[mathvariant="script"] { + font-family: MathJax_Script, STIXGeneral, DejaVu Serif, DejaVu Sans, Cambria, Cambria Math, Times, Lucida Sans Unicode, OpenSymbol, Standard Symbols L, serif; +} +[mathvariant="fraktur"] { + font-style: MathJax_Fraktur, STIXGeneral, DejaVu Serif, DejaVu Sans, Cambria, Cambria Math, Times, Lucida Sans Unicode, OpenSymbol, Standard Symbols L, serif; } /**************************************************************************/ diff --git a/layout/reftests/box/flexbox-abspos-container-1-ref.html b/layout/reftests/box/flexbox-abspos-container-1-ref.html new file mode 100644 index 00000000000..fbeaabf32aa --- /dev/null +++ b/layout/reftests/box/flexbox-abspos-container-1-ref.html @@ -0,0 +1,27 @@ + + + + + + +
+
+
+ + diff --git a/layout/reftests/box/flexbox-abspos-container-1a.html b/layout/reftests/box/flexbox-abspos-container-1a.html new file mode 100644 index 00000000000..1f6ee21a70d --- /dev/null +++ b/layout/reftests/box/flexbox-abspos-container-1a.html @@ -0,0 +1,30 @@ + + + + + + + +
+
+
+ + diff --git a/layout/reftests/box/flexbox-abspos-container-1b.html b/layout/reftests/box/flexbox-abspos-container-1b.html new file mode 100644 index 00000000000..b19072382ad --- /dev/null +++ b/layout/reftests/box/flexbox-abspos-container-1b.html @@ -0,0 +1,29 @@ + + + + + + + +
+
+
+ + diff --git a/layout/reftests/box/flexbox-abspos-container-1c.html b/layout/reftests/box/flexbox-abspos-container-1c.html new file mode 100644 index 00000000000..553c9fc1b78 --- /dev/null +++ b/layout/reftests/box/flexbox-abspos-container-1c.html @@ -0,0 +1,33 @@ + + + + + + + +
+
+
+
+
+ + diff --git a/layout/reftests/box/flexbox-abspos-container-1d.html b/layout/reftests/box/flexbox-abspos-container-1d.html new file mode 100644 index 00000000000..78bb84fa75d --- /dev/null +++ b/layout/reftests/box/flexbox-abspos-container-1d.html @@ -0,0 +1,31 @@ + + + + + + + +
+
+
+
+
+ + diff --git a/layout/reftests/box/flexbox-abspos-container-2-ref.html b/layout/reftests/box/flexbox-abspos-container-2-ref.html new file mode 100644 index 00000000000..d3ef6118876 --- /dev/null +++ b/layout/reftests/box/flexbox-abspos-container-2-ref.html @@ -0,0 +1,27 @@ + + + + + + +
+
+
+ + diff --git a/layout/reftests/box/flexbox-abspos-container-2.html b/layout/reftests/box/flexbox-abspos-container-2.html new file mode 100644 index 00000000000..aa3013f534e --- /dev/null +++ b/layout/reftests/box/flexbox-abspos-container-2.html @@ -0,0 +1,31 @@ + + + + + + + +
+
+
+ + diff --git a/layout/reftests/box/flexbox-child-is-abspos-container-1-ref.html b/layout/reftests/box/flexbox-child-is-abspos-container-1-ref.html new file mode 100644 index 00000000000..8e62ec1815a --- /dev/null +++ b/layout/reftests/box/flexbox-child-is-abspos-container-1-ref.html @@ -0,0 +1,29 @@ + + + + + + +
+
+
+
+
+ + diff --git a/layout/reftests/box/flexbox-child-is-abspos-container-1.html b/layout/reftests/box/flexbox-child-is-abspos-container-1.html new file mode 100644 index 00000000000..c5892758dc4 --- /dev/null +++ b/layout/reftests/box/flexbox-child-is-abspos-container-1.html @@ -0,0 +1,32 @@ + + + + + + + +
+
+
+
+
+ + diff --git a/layout/reftests/box/flexbox-child-is-abspos-container-2-ref.html b/layout/reftests/box/flexbox-child-is-abspos-container-2-ref.html new file mode 100644 index 00000000000..de5abf137d6 --- /dev/null +++ b/layout/reftests/box/flexbox-child-is-abspos-container-2-ref.html @@ -0,0 +1,30 @@ + + + + + + +
+
+
+
+
+ + diff --git a/layout/reftests/box/flexbox-child-is-abspos-container-2.html b/layout/reftests/box/flexbox-child-is-abspos-container-2.html new file mode 100644 index 00000000000..dad64a15794 --- /dev/null +++ b/layout/reftests/box/flexbox-child-is-abspos-container-2.html @@ -0,0 +1,34 @@ + + + + + + + +
+
+
+
+
+ + diff --git a/layout/reftests/box/reftest.list b/layout/reftests/box/reftest.list index 7acadb49d0e..c1056b78e15 100644 --- a/layout/reftests/box/reftest.list +++ b/layout/reftests/box/reftest.list @@ -1,4 +1,11 @@ +== flexbox-abspos-container-1a.html flexbox-abspos-container-1-ref.html +== flexbox-abspos-container-1b.html flexbox-abspos-container-1-ref.html +== flexbox-abspos-container-1c.html flexbox-abspos-container-1-ref.html +== flexbox-abspos-container-1d.html flexbox-abspos-container-1-ref.html +== flexbox-abspos-container-2.html flexbox-abspos-container-2-ref.html == flexbox-attributes-no-box-horizontal.xhtml flexbox-attributes-no-box-horizontal-ref.xhtml == flexbox-attributes-no-box-vertical.xhtml flexbox-attributes-no-box-vertical-ref.xhtml == flexbox-attributes-no-input-horizontal.xhtml flexbox-attributes-no-input-horizontal-ref.xhtml == flexbox-attributes-no-input-vertical.xhtml flexbox-attributes-no-input-vertical-ref.xhtml +== flexbox-child-is-abspos-container-1.html flexbox-child-is-abspos-container-1-ref.html +== flexbox-child-is-abspos-container-2.html flexbox-child-is-abspos-container-2-ref.html diff --git a/layout/svg/base/src/nsISVGChildFrame.h b/layout/svg/base/src/nsISVGChildFrame.h index 38c73eec57e..faa457ece7d 100644 --- a/layout/svg/base/src/nsISVGChildFrame.h +++ b/layout/svg/base/src/nsISVGChildFrame.h @@ -57,6 +57,13 @@ class SVGLengthList; class SVGUserUnitList; } +/** + * This class is not particularly well named. It is inherited by some, but + * not all SVG frame classes that can be descendants of an + * nsSVGOuterSVGFrame in the frame tree. Note specifically that SVG container + * frames that do not inherit nsSVGDisplayContainerFrame do not inherit this + * class (so that's classes that only inherit nsSVGContainerFrame). + */ class nsISVGChildFrame : public nsQueryFrame { public: @@ -91,13 +98,16 @@ public: // Flags to pass to NotifySVGChange: // - // SUPPRESS_INVALIDATION - do not invalidate rendered areas (only to be - // used in conjunction with TRANSFORM_CHANGED) + // DO_NOT_NOTIFY_RENDERING_OBSERVERS - this should only be used when + // updating the descendant frames of a clipPath, + // mask, pattern or marker frame (or other similar + // NS_STATE_SVG_NONDISPLAY_CHILD frame) immediately + // prior to painting that frame's descendants. // TRANSFORM_CHANGED - the current transform matrix for this frame has changed // COORD_CONTEXT_CHANGED - the dimensions of this frame's coordinate context has // changed (percentage lengths must be reevaluated) enum SVGChangedFlags { - SUPPRESS_INVALIDATION = 0x01, + DO_NOT_NOTIFY_RENDERING_OBSERVERS = 0x01, TRANSFORM_CHANGED = 0x02, COORD_CONTEXT_CHANGED = 0x04 }; diff --git a/layout/svg/base/src/nsSVGAFrame.cpp b/layout/svg/base/src/nsSVGAFrame.cpp index a0eb9a48034..56fa7fc6d4c 100644 --- a/layout/svg/base/src/nsSVGAFrame.cpp +++ b/layout/svg/base/src/nsSVGAFrame.cpp @@ -159,6 +159,13 @@ nsSVGAFrame::GetType() const void nsSVGAFrame::NotifySVGChanged(PRUint32 aFlags) { + NS_ABORT_IF_FALSE(!(aFlags & DO_NOT_NOTIFY_RENDERING_OBSERVERS) || + (GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD), + "Must be NS_STATE_SVG_NONDISPLAY_CHILD!"); + + NS_ABORT_IF_FALSE(aFlags & (TRANSFORM_CHANGED | COORD_CONTEXT_CHANGED), + "Invalidation logic may need adjusting"); + if (aFlags & TRANSFORM_CHANGED) { // make sure our cached transform matrix gets (lazily) updated mCanvasTM = nsnull; diff --git a/layout/svg/base/src/nsSVGClipPathFrame.cpp b/layout/svg/base/src/nsSVGClipPathFrame.cpp index 881878e4a53..a375f1e1f73 100644 --- a/layout/svg/base/src/nsSVGClipPathFrame.cpp +++ b/layout/svg/base/src/nsSVGClipPathFrame.cpp @@ -102,8 +102,9 @@ nsSVGClipPathFrame::ClipPaint(nsRenderingContext* aContext, nsISVGChildFrame* SVGFrame = do_QueryFrame(kid); if (SVGFrame) { // The CTM of each frame referencing us can be different. - SVGFrame->NotifySVGChanged(nsISVGChildFrame::SUPPRESS_INVALIDATION | - nsISVGChildFrame::TRANSFORM_CHANGED); + SVGFrame->NotifySVGChanged( + nsISVGChildFrame::DO_NOT_NOTIFY_RENDERING_OBSERVERS | + nsISVGChildFrame::TRANSFORM_CHANGED); bool isOK = true; nsSVGClipPathFrame *clipPathFrame = diff --git a/layout/svg/base/src/nsSVGClipPathFrame.h b/layout/svg/base/src/nsSVGClipPathFrame.h index a569ad60835..8c1d8a9d571 100644 --- a/layout/svg/base/src/nsSVGClipPathFrame.h +++ b/layout/svg/base/src/nsSVGClipPathFrame.h @@ -49,9 +49,12 @@ class nsSVGClipPathFrame : public nsSVGClipPathFrameBase friend nsIFrame* NS_NewSVGClipPathFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); protected: - nsSVGClipPathFrame(nsStyleContext* aContext) : - nsSVGClipPathFrameBase(aContext), - mInUse(false) {} + nsSVGClipPathFrame(nsStyleContext* aContext) + : nsSVGClipPathFrameBase(aContext) + , mInUse(false) + { + AddStateBits(NS_STATE_SVG_NONDISPLAY_CHILD); + } public: NS_DECL_FRAMEARENA_HELPERS diff --git a/layout/svg/base/src/nsSVGContainerFrame.cpp b/layout/svg/base/src/nsSVGContainerFrame.cpp index fafc65e62f0..42ab5e45289 100644 --- a/layout/svg/base/src/nsSVGContainerFrame.cpp +++ b/layout/svg/base/src/nsSVGContainerFrame.cpp @@ -51,7 +51,12 @@ nsIFrame* NS_NewSVGContainerFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) { - return new (aPresShell) nsSVGContainerFrame(aContext); + nsIFrame *frame = new (aPresShell) nsSVGContainerFrame(aContext); + // If we were called directly, then the frame is for a or + // an unknown element type. In both cases we prevent the content + // from displaying directly. + frame->AddStateBits(NS_STATE_SVG_NONDISPLAY_CHILD); + return frame; } NS_IMPL_FRAMEARENA_HELPERS(nsSVGContainerFrame) @@ -88,16 +93,6 @@ nsSVGContainerFrame::RemoveFrame(ChildListID aListID, return NS_OK; } -NS_IMETHODIMP -nsSVGContainerFrame::Init(nsIContent* aContent, - nsIFrame* aParent, - nsIFrame* aPrevInFlow) -{ - AddStateBits(NS_STATE_SVG_NONDISPLAY_CHILD); - nsresult rv = nsSVGContainerFrameBase::Init(aContent, aParent, aPrevInFlow); - return rv; -} - NS_IMETHODIMP nsSVGDisplayContainerFrame::Init(nsIContent* aContent, nsIFrame* aParent, @@ -108,7 +103,7 @@ nsSVGDisplayContainerFrame::Init(nsIContent* aContent, (NS_STATE_SVG_NONDISPLAY_CHILD | NS_STATE_SVG_CLIPPATH_CHILD | NS_STATE_SVG_REDRAW_SUSPENDED)); } - nsresult rv = nsSVGContainerFrameBase::Init(aContent, aParent, aPrevInFlow); + nsresult rv = nsSVGContainerFrame::Init(aContent, aParent, aPrevInFlow); return rv; } @@ -232,8 +227,12 @@ nsSVGDisplayContainerFrame::InitialUpdate() void nsSVGDisplayContainerFrame::NotifySVGChanged(PRUint32 aFlags) { - NS_ASSERTION(aFlags & (TRANSFORM_CHANGED | COORD_CONTEXT_CHANGED), - "Invalidation logic may need adjusting"); + NS_ABORT_IF_FALSE(!(aFlags & DO_NOT_NOTIFY_RENDERING_OBSERVERS) || + (GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD), + "Must be NS_STATE_SVG_NONDISPLAY_CHILD!"); + + NS_ABORT_IF_FALSE(aFlags & (TRANSFORM_CHANGED | COORD_CONTEXT_CHANGED), + "Invalidation logic may need adjusting"); nsSVGUtils::NotifyChildrenOfSVGChange(this, aFlags); } diff --git a/layout/svg/base/src/nsSVGContainerFrame.h b/layout/svg/base/src/nsSVGContainerFrame.h index 60ac96faf52..7ebdb740626 100644 --- a/layout/svg/base/src/nsSVGContainerFrame.h +++ b/layout/svg/base/src/nsSVGContainerFrame.h @@ -47,6 +47,13 @@ class nsRenderingContext; typedef nsContainerFrame nsSVGContainerFrameBase; +/** + * Base class for SVG container frames. Frame sub-classes that do not + * display their contents directly (such as the frames for or + * ) just inherit this class. Frame sub-classes that do or can + * display their contents directly (such as the frames for inner- or + * ) inherit our nsDisplayContainerFrame sub-class. + */ class nsSVGContainerFrame : public nsSVGContainerFrameBase { friend nsIFrame* NS_NewSVGContainerFrame(nsIPresShell* aPresShell, @@ -71,9 +78,6 @@ public: nsFrameList& aFrameList); NS_IMETHOD RemoveFrame(ChildListID aListID, nsIFrame* aOldFrame); - NS_IMETHOD Init(nsIContent* aContent, - nsIFrame* aParent, - nsIFrame* aPrevInFlow); virtual bool IsFrameOfType(PRUint32 aFlags) const { @@ -82,6 +86,10 @@ public: } }; +/** + * Frame class or base-class for SVG containers that can or do display their + * contents directly. + */ class nsSVGDisplayContainerFrame : public nsSVGContainerFrame, public nsISVGChildFrame { diff --git a/layout/svg/base/src/nsSVGFilterFrame.h b/layout/svg/base/src/nsSVGFilterFrame.h index 7f2659639b0..001e3e17be7 100644 --- a/layout/svg/base/src/nsSVGFilterFrame.h +++ b/layout/svg/base/src/nsSVGFilterFrame.h @@ -49,7 +49,11 @@ class nsSVGFilterFrame : public nsSVGFilterFrameBase friend nsIFrame* NS_NewSVGFilterFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); protected: - nsSVGFilterFrame(nsStyleContext* aContext) : nsSVGFilterFrameBase(aContext) {} + nsSVGFilterFrame(nsStyleContext* aContext) + : nsSVGFilterFrameBase(aContext) + { + AddStateBits(NS_STATE_SVG_NONDISPLAY_CHILD); + } public: NS_DECL_FRAMEARENA_HELPERS diff --git a/layout/svg/base/src/nsSVGForeignObjectFrame.cpp b/layout/svg/base/src/nsSVGForeignObjectFrame.cpp index 73474c6f03d..0d9a7b642c9 100644 --- a/layout/svg/base/src/nsSVGForeignObjectFrame.cpp +++ b/layout/svg/base/src/nsSVGForeignObjectFrame.cpp @@ -394,6 +394,13 @@ nsSVGForeignObjectFrame::InitialUpdate() void nsSVGForeignObjectFrame::NotifySVGChanged(PRUint32 aFlags) { + NS_ABORT_IF_FALSE(!(aFlags & DO_NOT_NOTIFY_RENDERING_OBSERVERS) || + (GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD), + "Must be NS_STATE_SVG_NONDISPLAY_CHILD!"); + + NS_ABORT_IF_FALSE(aFlags & (TRANSFORM_CHANGED | COORD_CONTEXT_CHANGED), + "Invalidation logic may need adjusting"); + bool reflow = false; if (aFlags & TRANSFORM_CHANGED) { @@ -405,7 +412,7 @@ nsSVGForeignObjectFrame::NotifySVGChanged(PRUint32 aFlags) // We also seem to get some sort of infinite loop post bug 421584 if we // reflow. mCanvasTM = nsnull; - if (!(aFlags & SUPPRESS_INVALIDATION)) { + if (!(aFlags & DO_NOT_NOTIFY_RENDERING_OBSERVERS)) { UpdateGraphic(); } diff --git a/layout/svg/base/src/nsSVGGFrame.cpp b/layout/svg/base/src/nsSVGGFrame.cpp index 3f518cc3a2a..1217d5dd6e5 100644 --- a/layout/svg/base/src/nsSVGGFrame.cpp +++ b/layout/svg/base/src/nsSVGGFrame.cpp @@ -80,6 +80,13 @@ nsSVGGFrame::GetType() const void nsSVGGFrame::NotifySVGChanged(PRUint32 aFlags) { + NS_ABORT_IF_FALSE(!(aFlags & DO_NOT_NOTIFY_RENDERING_OBSERVERS) || + (GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD), + "Must be NS_STATE_SVG_NONDISPLAY_CHILD!"); + + NS_ABORT_IF_FALSE(aFlags & (TRANSFORM_CHANGED | COORD_CONTEXT_CHANGED), + "Invalidation logic may need adjusting"); + if (aFlags & TRANSFORM_CHANGED) { // make sure our cached transform matrix gets (lazily) updated mCanvasTM = nsnull; diff --git a/layout/svg/base/src/nsSVGGlyphFrame.cpp b/layout/svg/base/src/nsSVGGlyphFrame.cpp index d5c639ba2c4..8b5cef7b616 100644 --- a/layout/svg/base/src/nsSVGGlyphFrame.cpp +++ b/layout/svg/base/src/nsSVGGlyphFrame.cpp @@ -521,10 +521,17 @@ nsSVGGlyphFrame::InitialUpdate() void nsSVGGlyphFrame::NotifySVGChanged(PRUint32 aFlags) { + NS_ABORT_IF_FALSE(!(aFlags & DO_NOT_NOTIFY_RENDERING_OBSERVERS) || + (GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD), + "Must be NS_STATE_SVG_NONDISPLAY_CHILD!"); + + NS_ABORT_IF_FALSE(aFlags & (TRANSFORM_CHANGED | COORD_CONTEXT_CHANGED), + "Invalidation logic may need adjusting"); + if (aFlags & TRANSFORM_CHANGED) { ClearTextRun(); } - if (!(aFlags & SUPPRESS_INVALIDATION)) { + if (!(aFlags & DO_NOT_NOTIFY_RENDERING_OBSERVERS)) { nsSVGUtils::UpdateGraphic(this); } } diff --git a/layout/svg/base/src/nsSVGInnerSVGFrame.cpp b/layout/svg/base/src/nsSVGInnerSVGFrame.cpp index 1bc90d1104d..5d3b8db4a26 100644 --- a/layout/svg/base/src/nsSVGInnerSVGFrame.cpp +++ b/layout/svg/base/src/nsSVGInnerSVGFrame.cpp @@ -113,6 +113,13 @@ nsSVGInnerSVGFrame::PaintSVG(nsRenderingContext *aContext, void nsSVGInnerSVGFrame::NotifySVGChanged(PRUint32 aFlags) { + NS_ABORT_IF_FALSE(!(aFlags & DO_NOT_NOTIFY_RENDERING_OBSERVERS) || + (GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD), + "Must be NS_STATE_SVG_NONDISPLAY_CHILD!"); + + NS_ABORT_IF_FALSE(aFlags & (TRANSFORM_CHANGED | COORD_CONTEXT_CHANGED), + "Invalidation logic may need adjusting"); + if (aFlags & COORD_CONTEXT_CHANGED) { nsSVGSVGElement *svg = static_cast(mContent); diff --git a/layout/svg/base/src/nsSVGMarkerFrame.cpp b/layout/svg/base/src/nsSVGMarkerFrame.cpp index b45d9422997..faf6ee95e5a 100644 --- a/layout/svg/base/src/nsSVGMarkerFrame.cpp +++ b/layout/svg/base/src/nsSVGMarkerFrame.cpp @@ -163,8 +163,9 @@ nsSVGMarkerFrame::PaintMark(nsRenderingContext *aContext, nsISVGChildFrame* SVGFrame = do_QueryFrame(kid); if (SVGFrame) { // The CTM of each frame referencing us may be different. - SVGFrame->NotifySVGChanged(nsISVGChildFrame::SUPPRESS_INVALIDATION | - nsISVGChildFrame::TRANSFORM_CHANGED); + SVGFrame->NotifySVGChanged( + nsISVGChildFrame::DO_NOT_NOTIFY_RENDERING_OBSERVERS | + nsISVGChildFrame::TRANSFORM_CHANGED); nsSVGUtils::PaintFrameWithEffects(aContext, nsnull, kid); } } diff --git a/layout/svg/base/src/nsSVGMarkerFrame.h b/layout/svg/base/src/nsSVGMarkerFrame.h index d7204ebe565..80ad9323570 100644 --- a/layout/svg/base/src/nsSVGMarkerFrame.h +++ b/layout/svg/base/src/nsSVGMarkerFrame.h @@ -54,11 +54,14 @@ class nsSVGMarkerFrame : public nsSVGMarkerFrameBase friend nsIFrame* NS_NewSVGMarkerFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); protected: - nsSVGMarkerFrame(nsStyleContext* aContext) : - nsSVGMarkerFrameBase(aContext), - mMarkedFrame(nsnull), - mInUse(false), - mInUse2(false) {} + nsSVGMarkerFrame(nsStyleContext* aContext) + : nsSVGMarkerFrameBase(aContext) + , mMarkedFrame(nsnull) + , mInUse(false) + , mInUse2(false) + { + AddStateBits(NS_STATE_SVG_NONDISPLAY_CHILD); + } public: NS_DECL_FRAMEARENA_HELPERS diff --git a/layout/svg/base/src/nsSVGMaskFrame.cpp b/layout/svg/base/src/nsSVGMaskFrame.cpp index 896086d87ab..ba92b9f7eec 100644 --- a/layout/svg/base/src/nsSVGMaskFrame.cpp +++ b/layout/svg/base/src/nsSVGMaskFrame.cpp @@ -128,8 +128,9 @@ nsSVGMaskFrame::ComputeMaskAlpha(nsRenderingContext *aContext, // The CTM of each frame referencing us can be different nsISVGChildFrame* SVGFrame = do_QueryFrame(kid); if (SVGFrame) { - SVGFrame->NotifySVGChanged(nsISVGChildFrame::SUPPRESS_INVALIDATION | - nsISVGChildFrame::TRANSFORM_CHANGED); + SVGFrame->NotifySVGChanged( + nsISVGChildFrame::DO_NOT_NOTIFY_RENDERING_OBSERVERS | + nsISVGChildFrame::TRANSFORM_CHANGED); } nsSVGUtils::PaintFrameWithEffects(&tmpCtx, nsnull, kid); } diff --git a/layout/svg/base/src/nsSVGMaskFrame.h b/layout/svg/base/src/nsSVGMaskFrame.h index d524bc102d1..0eb040c2e33 100644 --- a/layout/svg/base/src/nsSVGMaskFrame.h +++ b/layout/svg/base/src/nsSVGMaskFrame.h @@ -51,9 +51,12 @@ class nsSVGMaskFrame : public nsSVGMaskFrameBase friend nsIFrame* NS_NewSVGMaskFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); protected: - nsSVGMaskFrame(nsStyleContext* aContext) : - nsSVGMaskFrameBase(aContext), - mInUse(false) {} + nsSVGMaskFrame(nsStyleContext* aContext) + : nsSVGMaskFrameBase(aContext) + , mInUse(false) + { + AddStateBits(NS_STATE_SVG_NONDISPLAY_CHILD); + } public: NS_DECL_FRAMEARENA_HELPERS diff --git a/layout/svg/base/src/nsSVGPaintServerFrame.h b/layout/svg/base/src/nsSVGPaintServerFrame.h index 6a107061924..20cf76bb5c0 100644 --- a/layout/svg/base/src/nsSVGPaintServerFrame.h +++ b/layout/svg/base/src/nsSVGPaintServerFrame.h @@ -47,8 +47,11 @@ typedef nsSVGContainerFrame nsSVGPaintServerFrameBase; class nsSVGPaintServerFrame : public nsSVGPaintServerFrameBase { protected: - nsSVGPaintServerFrame(nsStyleContext* aContext) : - nsSVGPaintServerFrameBase(aContext) {} + nsSVGPaintServerFrame(nsStyleContext* aContext) + : nsSVGPaintServerFrameBase(aContext) + { + AddStateBits(NS_STATE_SVG_NONDISPLAY_CHILD); + } public: NS_DECL_FRAMEARENA_HELPERS diff --git a/layout/svg/base/src/nsSVGPathGeometryFrame.cpp b/layout/svg/base/src/nsSVGPathGeometryFrame.cpp index 110cba877db..c389a985364 100644 --- a/layout/svg/base/src/nsSVGPathGeometryFrame.cpp +++ b/layout/svg/base/src/nsSVGPathGeometryFrame.cpp @@ -247,7 +247,14 @@ nsSVGPathGeometryFrame::InitialUpdate() void nsSVGPathGeometryFrame::NotifySVGChanged(PRUint32 aFlags) { - if (!(aFlags & SUPPRESS_INVALIDATION)) { + NS_ABORT_IF_FALSE(!(aFlags & DO_NOT_NOTIFY_RENDERING_OBSERVERS) || + (GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD), + "Must be NS_STATE_SVG_NONDISPLAY_CHILD!"); + + NS_ABORT_IF_FALSE(aFlags & (TRANSFORM_CHANGED | COORD_CONTEXT_CHANGED), + "Invalidation logic may need adjusting"); + + if (!(aFlags & DO_NOT_NOTIFY_RENDERING_OBSERVERS)) { nsSVGUtils::UpdateGraphic(this); } } diff --git a/layout/svg/base/src/nsSVGPatternFrame.cpp b/layout/svg/base/src/nsSVGPatternFrame.cpp index 02028fd4eb7..b822451dccf 100644 --- a/layout/svg/base/src/nsSVGPatternFrame.cpp +++ b/layout/svg/base/src/nsSVGPatternFrame.cpp @@ -327,8 +327,9 @@ nsSVGPatternFrame::PaintPattern(gfxASurface** surface, // The CTM of each frame referencing us can be different nsISVGChildFrame* SVGFrame = do_QueryFrame(kid); if (SVGFrame) { - SVGFrame->NotifySVGChanged(nsISVGChildFrame::SUPPRESS_INVALIDATION | - nsISVGChildFrame::TRANSFORM_CHANGED); + SVGFrame->NotifySVGChanged( + nsISVGChildFrame::DO_NOT_NOTIFY_RENDERING_OBSERVERS | + nsISVGChildFrame::TRANSFORM_CHANGED); } nsSVGUtils::PaintFrameWithEffects(&context, nsnull, kid); } diff --git a/layout/svg/base/src/nsSVGTextFrame.cpp b/layout/svg/base/src/nsSVGTextFrame.cpp index cbdae2d8d3c..1c3e3c2dfca 100644 --- a/layout/svg/base/src/nsSVGTextFrame.cpp +++ b/layout/svg/base/src/nsSVGTextFrame.cpp @@ -181,6 +181,13 @@ nsSVGTextFrame::GetRotationOfChar(PRUint32 charnum, float *_retval) void nsSVGTextFrame::NotifySVGChanged(PRUint32 aFlags) { + NS_ABORT_IF_FALSE(!(aFlags & DO_NOT_NOTIFY_RENDERING_OBSERVERS) || + (GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD), + "Must be NS_STATE_SVG_NONDISPLAY_CHILD!"); + + NS_ABORT_IF_FALSE(aFlags & (TRANSFORM_CHANGED | COORD_CONTEXT_CHANGED), + "Invalidation logic may need adjusting"); + bool updateGlyphMetrics = false; if (aFlags & COORD_CONTEXT_CHANGED) { diff --git a/layout/tools/reftest/reftest.js b/layout/tools/reftest/reftest.js index daa73ccc147..20fb074a1d2 100644 --- a/layout/tools/reftest/reftest.js +++ b/layout/tools/reftest/reftest.js @@ -397,6 +397,7 @@ function StartHTTPServer() function StartTests() { + var uri; #if BOOTSTRAP /* These prefs are optional, so we don't need to spit an error to the log */ try { diff --git a/layout/xul/base/src/nsBoxFrame.cpp b/layout/xul/base/src/nsBoxFrame.cpp index 476a9cd0877..38db8793c26 100644 --- a/layout/xul/base/src/nsBoxFrame.cpp +++ b/layout/xul/base/src/nsBoxFrame.cpp @@ -758,6 +758,8 @@ nsBoxFrame::Reflow(nsPresContext* aPresContext, } #endif + ReflowAbsoluteFrames(aPresContext, aDesiredSize, aReflowState, aStatus); + NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize); return NS_OK; } @@ -934,6 +936,35 @@ nsBoxFrame::DoLayout(nsBoxLayoutState& aState) aState.SetLayoutFlags(oldFlags); + if (HasAbsolutelyPositionedChildren()) { + // Set up a |reflowState| to pass into ReflowAbsoluteFrames + nsHTMLReflowState reflowState(aState.PresContext(), this, + aState.GetRenderingContext(), + nsSize(mRect.width, NS_UNCONSTRAINEDSIZE)); + + // Set up a |desiredSize| to pass into ReflowAbsoluteFrames + nsHTMLReflowMetrics desiredSize; + desiredSize.width = mRect.width; + desiredSize.height = mRect.height; + + // get the ascent (cribbed from ::Reflow) + nscoord ascent = mRect.height; + + // getting the ascent could be a lot of work. Don't get it if + // we are the root. The viewport doesn't care about it. + if (!(mState & NS_STATE_IS_ROOT)) { + ascent = GetBoxAscent(aState); + } + desiredSize.ascent = ascent; + desiredSize.mOverflowAreas = GetOverflowAreas(); + + // Set up a |reflowStatus| to pass into ReflowAbsoluteFrames + // (just a dummy value; hopefully that's OK) + nsReflowStatus reflowStatus = NS_FRAME_COMPLETE; + ReflowAbsoluteFrames(aState.PresContext(), desiredSize, + reflowState, reflowStatus); + } + return rv; } @@ -946,6 +977,8 @@ nsBoxFrame::DestroyFrom(nsIFrame* aDestructRoot) // clean up the container box's layout manager and child boxes SetLayoutManager(nsnull); + DestroyAbsoluteFrames(aDestructRoot); + nsContainerFrame::DestroyFrom(aDestructRoot); } diff --git a/mfbt/STYLE b/mfbt/STYLE index 31b3ceec138..36acf9f8d20 100644 --- a/mfbt/STYLE +++ b/mfbt/STYLE @@ -2,11 +2,16 @@ == Line length == -The line limit is 80 characters, except that excessively long blocks of preprocessor directives may exceed this if it makes the code more readable (e.g. MOZ_STATIC_ASSERT in Assertions.h.), and unbreakable text in comments (e.g. URLs) may exceed this as well. Wrap expressions after binary operators. +The line limit is 80 characters, except that excessively long blocks of +preprocessor directives may exceed this if it makes the code more readable (e.g. +MOZ_STATIC_ASSERT in Assertions.h.), and unbreakable text in comments (e.g. +URLs) may exceed this as well. Wrap expressions after binary operators. == Capitalization == -Standalone functions, classes, structs, and template parameters are named InterCaps-style. Member functions and fields in classes and structs are named camelCaps-style. +Standalone functions, classes, structs, and template parameters are named +InterCaps-style. Member functions and fields in classes and structs are named +camelCaps-style. == Indentation == @@ -22,7 +27,8 @@ Surround binary operators with a single space on either side. if (x == 2) return 17; -When describing pointer types, the * shall be adjacent to the type name. (Same goes for references -- & goes by the type name.) +When describing pointer types, the * shall be adjacent to the type name. (Same +goes for references -- & goes by the type name.) int Foo(int* p) @@ -31,7 +37,8 @@ When describing pointer types, the * shall be adjacent to the type name. (Same int& i = *p; } -A corollary: don't mix declaration types by declaring a T and a T* (or a T**, &c.) in the same declaration. +A corollary: don't mix declaration types by declaring a T and a T* (or a T**, +&c.) in the same declaration. T* foo, bar; // BAD @@ -44,7 +51,9 @@ Don't brace single statements. for (size_t i = 0; i < 5; i++) frob(i); -But do brace them if the statement (or condition(s) or any additional consequents, if the braces would be associated with an if statement) occupies multiple lines. +But do brace them if the statement (or condition(s) or any additional +consequents, if the braces would be associated with an if statement) occupies +multiple lines. if (cond1 || cond2) @@ -68,11 +77,13 @@ But do brace them if the statement (or condition(s) or any additional consequent action(); } -Braces in control flow go at the end of the line except when associated with an |if| or loop-head where the condition covers multiple lines +Braces in control flow go at the end of the line except when associated with an +|if| or loop-head where the condition covers multiple lines == Classes and structs == -Inside class and structure definitions, public/private consume one level of indentation. +Inside class and structure definitions, public/private consume one level of +indentation. class Baz { @@ -80,7 +91,8 @@ Inside class and structure definitions, public/private consume one level of inde Baz() { } }; -The absence of public/private in structs in which all members are public still consumes a level. +The absence of public/private in structs in which all members are public still +consumes a level. struct Foo { @@ -108,11 +120,16 @@ Member initialization in constructors should be formatted as follows: } }; -Fields should go first in the class so that the basic structure is all in one place, consistently. +Fields should go first in the class so that the basic structure is all in one +place, consistently. -Use the inline keyword to annotate functions defined inline in a header. (If the function is defined inline in the class, don't bother adding it redundantly.) +Use the inline keyword to annotate functions defined inline in a header. (If +the function is defined inline in the class, don't bother adding it +redundantly.) -Explicitly delete (using Attributes.h's MOZ_DELETE) the copy constructor and assignment operator from classes not intended to be copied or assigned to avoid mistakes. +Explicitly delete (using Attributes.h's MOZ_DELETE) the copy constructor and +assignment operator from classes not intended to be copied or assigned to avoid +mistakes. class Funky { @@ -124,9 +141,11 @@ Explicitly delete (using Attributes.h's MOZ_DELETE) the copy constructor and ass void operator=(const Funky& other) MOZ_DELETE; }; -Include a blank line between sections of structs and classes with different access control. +Include a blank line between sections of structs and classes with different +access control. -The "get" prefix is used when a method is fallible. If it's infallible, don't use it. +The "get" prefix is used when a method is fallible. If it's infallible, don't +use it. class String { @@ -143,9 +162,12 @@ Capitalize template parameter names to distinguish them from fields. { }; -Use single-letter names if it makes sense (T for an arbitrary type, K for key type, V for value type, &c.). Otherwise use InterCaps-style names. +Use single-letter names if it makes sense (T for an arbitrary type, K for key +type, V for value type, &c.). Otherwise use InterCaps-style names. -When declaring or defining a function, template<...> goes on one line, the return type and other specifiers go on another line, and the function name and argument list go on a third line. +When declaring or defining a function, template<...> goes on one line, the +return type and other specifiers go on another line, and the function name and +argument list go on a third line. template inline bool @@ -155,30 +177,38 @@ When declaring or defining a function, template<...> goes on one line, the retur == Namespaces == -All C++ code shall be in the mozilla namespace, except that functionality only used to implement external-facing API should be in the mozilla::detail namespace, indicating that it should not be directly used. +All C++ code shall be in the mozilla namespace, except that functionality only +used to implement external-facing API should be in the mozilla::detail +namespace, indicating that it should not be directly used. -Namespace opening braces go on the same line as the namespace declaration. Namespace closing braces shall be commented. Namespace contents are not indented. +Namespace opening braces go on the same line as the namespace declaration. +Namespace closing braces shall be commented. Namespace contents are not +indented. namespace mozilla { ... } // namespace mozilla -Don't use |using| in a header unless it's confined to a class or method. Implementation files for out-of-line functionality may use |using|. +Don't use |using| in a header unless it's confined to a class or method. +Implementation files for out-of-line functionality may use |using|. == #includes == -Headers that include mfbt headers use a fully-qualified include path, even if full qualification is not strictly necessary. +Headers that include mfbt headers use a fully-qualified include path, even if +full qualification is not strictly necessary. #include "mozilla/Assertions.h" -mfbt headers should be included first, alphabetically. Standard includes should follow, separated from mfbt includes by a blank line. +mfbt headers should be included first, alphabetically. Standard includes should +follow, separated from mfbt includes by a blank line. #include "mozilla/Assertions.h" #include "mozilla/Attributes.h" #include -If a header dependency is limited simply to the existence of a class, forward-declare it rather than #include that header. +If a header dependency is limited simply to the existence of a class, +forward-declare it rather than #include that header. namespace mozilla { @@ -190,9 +220,12 @@ If a header dependency is limited simply to the existence of a class, forward-de == Preprocessor == -Include guards should be named by determining the fully-qualified include path, then substituting _ for / and . in it, and finally appending a trailing _. For example, "mozilla/Assertions.h" becomes mozilla_Assertions_h_. +Include guards should be named by determining the fully-qualified include path, +then substituting _ for / and . in it, and finally appending a trailing _. For +example, "mozilla/Assertions.h" becomes mozilla_Assertions_h_. -Nested preprocessor directives indent the directive name (but not the #) by two spaces. +Nested preprocessor directives indent the directive name (but not the #) by two +spaces. #ifdef __clang__ # define FOO ... @@ -200,7 +233,8 @@ Nested preprocessor directives indent the directive name (but not the #) by two # define FOO ... #endif -Comments within nested preprocessor directives align with directive names at that nesting depth. +Comments within nested preprocessor directives align with directive names at +that nesting depth. #if defined(__GNUC__) /* gcc supports C++11 override syntax. */ @@ -209,11 +243,17 @@ Comments within nested preprocessor directives align with directive names at tha # define MOZ_OVERRIDE /* unsupported */ #endif -Feature-testing macros may be defined to nothing. Macros intended to be textually expanded should be defined to a comment indicating non-support, as above or as appropriate to the situation. +Feature-testing macros may be defined to nothing. Macros intended to be +textually expanded should be defined to a comment indicating non-support, as +above or as appropriate to the situation. -No particular preference is expressed between testing for a macro being defined using defined(...) and using #ifdef. +No particular preference is expressed between testing for a macro being defined +using defined(...) and using #ifdef. -When defining a macro with different expansions for different compilers, the top level of distinction should be the compiler, and the next nested level should be the compiler version. Clang seems likely to be around for awhile, so to reduce confusion test for it separately from gcc even when it's not strictly necessary. +When defining a macro with different expansions for different compilers, the top +level of distinction should be the compiler, and the next nested level should be +the compiler version. Clang seems likely to be around for awhile, so to reduce +confusion test for it separately from gcc even when it's not strictly necessary. #if defined(__clang__) #elif defined(__GNUC__) @@ -223,20 +263,28 @@ When defining a macro with different expansions for different compilers, the top #elif defined(_MSC_VER) #endif -But don't distinguish clang's feature support using version checks: use the __has_feature() and __has_extension() macros instead, because vendors may customize clang's version numbers. +But don't distinguish clang's feature support using version checks: use the +__has_feature() and __has_extension() macros instead, because vendors may +customize clang's version numbers. Prefer inline functions to macros whenever possible. == Comments == -Header files shall have a short descriptive comment underneath license boilerplate indicating what functionality the file implements, to be picked up by MXR and displayed in directory listings. (But see bug 717196, which currently prevents MXR from doing this if the MPL2 boilerplate is used.) +Header files shall have a short descriptive comment underneath license +boilerplate indicating what functionality the file implements, to be picked up +by MXR and displayed in directory listings. (But see bug 717196, which +currently prevents MXR from doing this if the MPL2 boilerplate is used.) Assertions.h: ...license boilerplate... /* Implementations of runtime and static assertion macros for C and C++. */ -Classes intended for public use shall have interface comments explaining their functionality from the user's perspective. These comments shall include examples of how the relevant functionality might be used. These interface comments use /** */ doxygen/Javadoc-style comments. +Classes intended for public use shall have interface comments explaining their +functionality from the user's perspective. These comments shall include +examples of how the relevant functionality might be used. These interface +comments use /** */ doxygen/Javadoc-style comments. /** * The Frobber class simplifies the process of frobbing. @@ -245,21 +293,38 @@ Classes intended for public use shall have interface comments explaining their f { }; -Comments describing implementation details (tradeoffs considered, assumptions made, mathematical background, &c.) occur separately from interface comments so that users need not consider them. They should go inside the class definition or inside the appropriate method, depending on the specificity of the comment. +Comments describing implementation details (tradeoffs considered, assumptions +made, mathematical background, &c.) occur separately from interface comments so +that users need not consider them. They should go inside the class definition +or inside the appropriate method, depending on the specificity of the comment. -Headers which are intended to be C-compatible shall use only /**/-style comments. (Code examples nested inside documentation comments may use //-style comments.) Headers which are C++-compatible may also use //-style comments. +Headers which are intended to be C-compatible shall use only /**/-style +comments. (Code examples nested inside documentation comments may use //-style +comments.) Headers which are C++-compatible may also use //-style comments. Non-interface comments that are /**/-style shall not also be doxygen-style. -Use Python-style ** to denote exponentiation inside comments, not ^ (which can be confused with C-style bitwise xor). If you're writing sufficiently complex math, feel free to descend into LaTeX math mode ;-) inside implementation comments if you need to. (But keep it out of interface comments, because most people probably haven't seen LaTeX.) +Use Python-style ** to denote exponentiation inside comments, not ^ (which can +be confused with C-style bitwise xor). If you're writing sufficiently complex +math, feel free to descend into LaTeX math mode ;-) inside implementation +comments if you need to. (But keep it out of interface comments, because most +people probably haven't seen LaTeX.) == Miscellaneous == -Enclose C-compatible code in |extern "C"| blocks, and #ifdef __cplusplus the block start/end as needed. The contents of these blocks should not be indented. +Enclose C-compatible code in |extern "C"| blocks, and #ifdef __cplusplus the +block start/end as needed. The contents of these blocks should not be indented. -Add new functionality to new headers unless an existing header makes sense. Err on the side of more headers rather than fewer, as this helps to minimize dependencies. Don't add anything to Util.h, which will be split into multiple headers at some point (bug 713082). +Add new functionality to new headers unless an existing header makes sense. +Err on the side of more headers rather than fewer, as this helps to minimize +dependencies. Don't add anything to Util.h, which will be split into multiple +headers at some point (bug 713082). -Don't use bool for argument types unless the method is a "set" or "enable"-style method where the method name and bool value together indicate the sense of its effect. Use well-named enums in all other places, so that the semantics of the argument are clear at a glance and do not require knowing how the method interprets that argument. +Don't use bool for argument types unless the method is a "set" or "enable"-style +method where the method name and bool value together indicate the sense of its +effect. Use well-named enums in all other places, so that the semantics of the +argument are clear at a glance and do not require knowing how the method +interprets that argument. void setVisible(bool visible); // true clearly means visible, false clearly not diff --git a/mobile/android/base/AboutHomeContent.java b/mobile/android/base/AboutHomeContent.java index e1075fd57fe..aac47e135a2 100644 --- a/mobile/android/base/AboutHomeContent.java +++ b/mobile/android/base/AboutHomeContent.java @@ -717,18 +717,4 @@ public class AboutHomeContent extends ScrollView { return false; } } - - public static class LinkTextView extends TextView { - public LinkTextView(Context context, AttributeSet attrs) { - super(context, attrs); - } - - @Override - public void setText(CharSequence text, BufferType type) { - SpannableString content = new SpannableString(text + " \u00BB"); - content.setSpan(new UnderlineSpan(), 0, text.length(), 0); - - super.setText(content, BufferType.SPANNABLE); - } - } } diff --git a/mobile/android/base/AndroidManifest.xml.in b/mobile/android/base/AndroidManifest.xml.in index 401117e480c..33a9e5730ad 100644 --- a/mobile/android/base/AndroidManifest.xml.in +++ b/mobile/android/base/AndroidManifest.xml.in @@ -160,6 +160,10 @@ android:theme="@style/Gecko.Translucent.TabsTray" android:launchMode="singleTask"/> + + b) { - int tmp = a; - a = b; - b = tmp; - } switch (id) { case R.id.selectAll: @@ -239,17 +233,9 @@ public class GeckoInputConnection extract.partialStartOffset = -1; extract.partialEndOffset = -1; - int a = Selection.getSelectionStart(content); - int b = Selection.getSelectionEnd(content); - if (a > b) { - int tmp = a; - a = b; - b = tmp; - } - - extract.selectionStart = a; - extract.selectionEnd = b; - + clampSelection(); + extract.selectionStart = Selection.getSelectionStart(content); + extract.selectionEnd = Selection.getSelectionEnd(content); extract.startOffset = 0; try { @@ -272,10 +258,80 @@ public class GeckoInputConnection return super.setSelection(start, end); } + @Override + public boolean deleteSurroundingText(int leftLength, int rightLength) { + clampSelection(); + return super.deleteSurroundingText(leftLength, rightLength); + } + + @Override + public int getCursorCapsMode(int reqModes) { + clampSelection(); + return super.getCursorCapsMode(reqModes); + } + + @Override + public CharSequence getTextBeforeCursor(int length, int flags) { + clampSelection(); + return super.getTextBeforeCursor(length, flags); + } + + @Override + public CharSequence getSelectedText(int flags) { + clampSelection(); + return super.getSelectedText(flags); + } + + @Override + public CharSequence getTextAfterCursor(int length, int flags) { + clampSelection(); + return super.getTextAfterCursor(length, flags); + } + @Override public boolean setComposingText(CharSequence text, int newCursorPosition) { - replaceText(text, newCursorPosition, true); - return true; + clampSelection(); + return super.setComposingText(text, newCursorPosition); + } + + // Android's BaseInputConnection.java is vulnerable to IndexOutOfBoundsExceptions because it + // does not adequately protect against stale indexes for selections exceeding the content length + // when the Editable content changes. We must clamp the indexes to be safe. + private void clampSelection() { + Editable content = getEditable(); + if (content == null) { + return; + } + + final int selectionStart = Selection.getSelectionStart(content); + final int selectionEnd = Selection.getSelectionEnd(content); + + int a = clampContentIndex(content, selectionStart); + int b = clampContentIndex(content, selectionEnd); + + if (a > b) { + int tmp = a; + a = b; + b = tmp; + } + + if (a != selectionStart || b != selectionEnd) { + Log.e(LOGTAG, "CLAMPING BOGUS SELECTION (" + selectionStart + ", " + selectionEnd + + "] -> (" + a + ", " + b + "]", new AssertionError()); + setSelection(a, b); + } + } + + private static int clampContentIndex(Editable content, int index) { + if (index < 0) { + index = 0; + } else { + final int contentLength = content.length(); + if (index > contentLength) { + index = contentLength; + } + } + return index; } private void replaceText(CharSequence text, int newCursorPosition, boolean composing) { @@ -309,15 +365,9 @@ public class GeckoInputConnection if (a != -1 && b != -1) { removeComposingSpans(content); } else { + clampSelection(); a = Selection.getSelectionStart(content); b = Selection.getSelectionEnd(content); - if (a < 0) a = 0; - if (b < 0) b = 0; - if (b < a) { - int tmp = a; - a = b; - b = tmp; - } } if (composing) { @@ -468,8 +518,14 @@ public class GeckoInputConnection int start, int end) { if (!mBatchMode) { final Editable content = getEditable(); + + start = clampContentIndex(content, start); + end = clampContentIndex(content, end); + + clampSelection(); int a = Selection.getSelectionStart(content); int b = Selection.getSelectionEnd(content); + if (start != a || end != b) { if (DEBUG) { Log.d(LOGTAG, String.format( @@ -761,6 +817,7 @@ public class GeckoInputConnection !mKeyListener.onKeyDown(v, mEditable, keyCode, event)) { // Make sure selection in Gecko is up-to-date final Editable content = getEditable(); + clampSelection(); int a = Selection.getSelectionStart(content); int b = Selection.getSelectionEnd(content); GeckoAppShell.sendEventToGecko( @@ -969,18 +1026,6 @@ public class GeckoInputConnection mEditable.setSpan(this, 0, contents.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE); Selection.setSelection(mEditable, contents.length()); } - - public void resetSelection() { - // An Android framework bug can cause a SpannableStringBuilder crash when focus changes - // invalidate text selection offsets. A workaround is to reset selection when the activity - // resumes. More info: https://code.google.com/p/android/issues/detail?id=5164 - Editable content = getEditable(); - if (content != null) { - Log.d(LOGTAG, "IME: resetSelection"); - int length = content.length(); - setSelection(length, length); - } - } } class DebugGeckoInputConnection extends GeckoInputConnection { diff --git a/mobile/android/base/LinkTextView.java b/mobile/android/base/LinkTextView.java new file mode 100644 index 00000000000..a710fc161f1 --- /dev/null +++ b/mobile/android/base/LinkTextView.java @@ -0,0 +1,25 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +package org.mozilla.gecko; + +import android.content.Context; +import android.util.AttributeSet; +import android.text.SpannableString; +import android.text.style.UnderlineSpan; +import android.widget.TextView; + +public class LinkTextView extends TextView { + public LinkTextView(Context context, AttributeSet attrs) { + super(context, attrs); + } + + @Override + public void setText(CharSequence text, BufferType type) { + SpannableString content = new SpannableString(text + " \u00BB"); + content.setSpan(new UnderlineSpan(), 0, text.length(), 0); + + super.setText(content, BufferType.SPANNABLE); + } +} diff --git a/mobile/android/base/Makefile.in b/mobile/android/base/Makefile.in index a7c9f102770..08b23bc7089 100644 --- a/mobile/android/base/Makefile.in +++ b/mobile/android/base/Makefile.in @@ -94,12 +94,14 @@ FENNEC_JAVA_FILES = \ GeckoThread.java \ GlobalHistory.java \ LinkPreference.java \ + LinkTextView.java \ ProfileMigrator.java \ PromptService.java \ sqlite/ByteBufferInputStream.java \ sqlite/MatrixBlobCursor.java \ sqlite/SQLiteBridge.java \ sqlite/SQLiteBridgeException.java \ + RemoteTabs.java \ SetupScreen.java \ SurfaceLockInfo.java \ Tab.java \ @@ -245,6 +247,9 @@ RES_LAYOUT = \ res/layout/notification_progress_text.xml \ res/layout/site_setting_title.xml \ res/layout/setup_screen.xml \ + res/layout/remote_tabs.xml \ + res/layout/remote_tabs_child.xml \ + res/layout/remote_tabs_group.xml \ res/layout/tabs_row.xml \ res/layout/tabs_tray.xml \ res/layout/list_item_header.xml \ @@ -290,6 +295,7 @@ RES_ANIM = \ RES_DRAWABLE_NODPI = \ res/drawable-nodpi/abouthome_bg.png \ res/drawable-nodpi/abouthome_topsites_bg.png \ + res/drawable-nodpi/background.png \ res/drawable-nodpi/tabs_tray_bg.png \ res/drawable-nodpi/tabs_tray_pressed_bg.png \ $(NULL) @@ -525,7 +531,6 @@ MOZ_ANDROID_DRAWABLES += \ mobile/android/base/resources/drawable/awesomebar_tab_press_selected.xml \ mobile/android/base/resources/drawable/awesomebar_tab_selected.xml \ mobile/android/base/resources/drawable/awesomebar_tab_unselected.xml \ - mobile/android/base/resources/drawable/background.png \ mobile/android/base/resources/drawable/desktop_notification.png \ mobile/android/base/resources/drawable/gecko_actionbar_bg.xml \ mobile/android/base/resources/drawable/progress_spinner.xml \ @@ -547,6 +552,7 @@ MOZ_ANDROID_DRAWABLES += \ mobile/android/base/resources/drawable/progress_spinner_16.png \ mobile/android/base/resources/drawable/progress_spinner_17.png \ mobile/android/base/resources/drawable/progress_spinner_18.png \ + mobile/android/base/resources/drawable/remote_tabs_group_bg_repeat.xml \ mobile/android/base/resources/drawable/start.png \ mobile/android/base/resources/drawable/site_security_level.xml \ mobile/android/base/resources/drawable/tabs_button.xml \ diff --git a/mobile/android/base/RemoteTabs.java b/mobile/android/base/RemoteTabs.java new file mode 100644 index 00000000000..10fb918c4ee --- /dev/null +++ b/mobile/android/base/RemoteTabs.java @@ -0,0 +1,230 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +package org.mozilla.gecko; + +import java.util.ArrayList; +import java.util.HashMap; + +import org.mozilla.gecko.db.BrowserContract.Clients; +import org.mozilla.gecko.db.BrowserContract.Tabs; +import org.mozilla.gecko.db.BrowserContract; + +import org.json.JSONObject; + +import android.app.Activity; +import android.content.Intent; +import android.content.Context; +import android.database.Cursor; +import android.graphics.drawable.Drawable; +import android.os.Bundle; +import android.os.SystemClock; +import android.util.AttributeSet; +import android.util.DisplayMetrics; +import android.view.View; +import android.widget.Button; +import android.widget.LinearLayout; +import android.widget.ExpandableListView; +import android.widget.SimpleExpandableListAdapter; +import android.text.TextUtils; +import android.util.Log; + +public class RemoteTabs extends Activity + implements ExpandableListView.OnGroupClickListener, ExpandableListView.OnChildClickListener { + private static final String LOGTAG = "GeckoRemoteTabs"; + + private static int sPreferredHeight; + private static int sChildItemHeight; + private static int sGroupItemHeight; + private static ExpandableListView mList; + + private static ArrayList > mClientsList; + private static ArrayList >> mTabsList; + + // 50 for child + 2 for divider + private static final int CHILD_ITEM_HEIGHT = 52; + + // 30 for group + 2 for divider + private static final int GROUP_ITEM_HEIGHT = 32; + + private static final String[] PROJECTION_COLUMNS = new String[] { + BrowserContract.Tabs.TITLE, // 0 + BrowserContract.Tabs.URL, // 1 + BrowserContract.Clients.GUID, // 2 + BrowserContract.Clients.NAME // 3 + }; + + private static final String[] CLIENT_KEY = new String[] { "name" }; + private static final String[] TAB_KEY = new String[] { "title" }; + private static final int[] CLIENT_RESOURCE = new int[] { R.id.client }; + private static final int[] TAB_RESOURCE = new int[] { R.id.tab }; + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + setContentView(R.layout.remote_tabs); + + mList = (ExpandableListView) findViewById(R.id.list); + mList.setOnGroupClickListener(this); + mList.setOnChildClickListener(this); + + LinearLayout container = (LinearLayout) findViewById(R.id.container); + container.setOnClickListener(new Button.OnClickListener() { + public void onClick(View v) { + finishActivity(); + } + }); + + DisplayMetrics metrics = new DisplayMetrics(); + getWindowManager().getDefaultDisplay().getMetrics(metrics); + + sChildItemHeight = (int) (CHILD_ITEM_HEIGHT * metrics.density); + sGroupItemHeight = (int) (GROUP_ITEM_HEIGHT * metrics.density); + sPreferredHeight = (int) (0.67 * metrics.heightPixels); + + // Query the database for remote tabs in AsyncTask + (new QueryRemoteTabsTask()).execute(); + } + + @Override + public void onBackPressed() { + startActivity(new Intent(this, TabsTray.class)); + overridePendingTransition(R.anim.grow_fade_in, 0); + finishActivity(); + } + + void finishActivity() { + finish(); + overridePendingTransition(0, R.anim.shrink_fade_out); + } + + @Override + public boolean onGroupClick(ExpandableListView parent, View view, int position, long id) { + // By default, the group collapses/expands. Consume the event. + return true; + } + + @Override + public boolean onChildClick(ExpandableListView parent, View view, int groupPosition, int childPosition, long id) { + HashMap tab = mTabsList.get(groupPosition).get(childPosition); + if (tab == null) { + finishActivity(); + return true; + } + + String url = tab.get("url"); + JSONObject args = new JSONObject(); + try { + args.put("url", url); + args.put("engine", null); + args.put("userEntered", false); + } catch (Exception e) { + Log.e(LOGTAG, "error building JSON arguments"); + } + + Log.i(LOGTAG, "Sending message to Gecko: " + SystemClock.uptimeMillis() + " - Tab:Add"); + GeckoAppShell.sendEventToGecko(GeckoEvent.createBroadcastEvent("Tab:Add", args.toString())); + finishActivity(); + return true; + } + + // Tabs List Container holds the ExpandableListView + public static class TabsListContainer extends LinearLayout { + public TabsListContainer(Context context, AttributeSet attrs) { + super(context, attrs); + } + + @Override + protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { + SimpleExpandableListAdapter adapter = (SimpleExpandableListAdapter) mList.getExpandableListAdapter(); + if (adapter == null) { + super.onMeasure(widthMeasureSpec, heightMeasureSpec); + return; + } + + int groupCount = adapter.getGroupCount(); + int childrenHeight = groupCount * sGroupItemHeight; + for (int i = 0; i < groupCount; i++) + childrenHeight += adapter.getChildrenCount(i) * sChildItemHeight; + + int restrictedHeightSpec = MeasureSpec.makeMeasureSpec(Math.min(childrenHeight, sPreferredHeight), MeasureSpec.EXACTLY); + super.onMeasure(widthMeasureSpec, restrictedHeightSpec); + } + } + + // AsyncTask to query the database + private class QueryRemoteTabsTask extends GeckoAsyncTask { + @Override + protected Void doInBackground(Void... unused) { + mClientsList = new ArrayList >(); + mTabsList = new ArrayList >>(); + + Cursor tabs = getContentResolver().query(BrowserContract.Tabs.CONTENT_URI, + PROJECTION_COLUMNS, + BrowserContract.Tabs.CLIENT_GUID + " IS NOT NULL", + null, + null); + + if (tabs == null) + return null; + + String oldGuid = null; + ArrayList > tabsForClient = null; + HashMap client; + HashMap tab; + + try { + while (tabs.moveToNext()) { + String title = tabs.getString(0); + String url = tabs.getString(1); + String guid = tabs.getString(2); + String name = tabs.getString(3); + + if (oldGuid == null || !TextUtils.equals(oldGuid, guid)) { + client = new HashMap (); + client.put("name", name); + mClientsList.add(client); + + tabsForClient = new ArrayList >(); + mTabsList.add(tabsForClient); + + oldGuid = new String(guid); + } + + tab = new HashMap(); + tab.put("title", TextUtils.isEmpty(title) ? url : title); + tab.put("url", url); + tabsForClient.add(tab); + } + } finally { + tabs.close(); + } + + return null; + } + + @Override + protected void onPostExecute(Void unused) { + if (mClientsList.size() == 0) { + finishActivity(); + return; + } + + mList.setAdapter(new SimpleExpandableListAdapter(getApplicationContext(), + mClientsList, + R.layout.remote_tabs_group, + CLIENT_KEY, + CLIENT_RESOURCE, + mTabsList, + R.layout.remote_tabs_child, + TAB_KEY, + TAB_RESOURCE)); + + for (int i = 0; i < mClientsList.size(); i++) { + mList.expandGroup(i); + } + } + } +} diff --git a/mobile/android/base/TabsTray.java b/mobile/android/base/TabsTray.java index ae39a5ca65b..4461d17fae4 100644 --- a/mobile/android/base/TabsTray.java +++ b/mobile/android/base/TabsTray.java @@ -39,8 +39,14 @@ package org.mozilla.gecko; import java.util.ArrayList; +import org.mozilla.gecko.db.BrowserContract.Clients; +import org.mozilla.gecko.db.BrowserContract; + +import android.accounts.AccountManager; import android.app.Activity; import android.content.Context; +import android.database.Cursor; +import android.content.Intent; import android.graphics.drawable.Drawable; import android.os.Bundle; import android.os.Build; @@ -66,6 +72,7 @@ public class TabsTray extends Activity implements Tabs.OnTabsChangedListener { private static int sAddTabHeight; private static ListView mList; private static TabsListContainer mListContainer; + private static LinkTextView mRemoteTabs; private TabsAdapter mTabsAdapter; private boolean mWaitingForClose; @@ -84,14 +91,21 @@ public class TabsTray extends Activity implements Tabs.OnTabsChangedListener { mList = (ListView) findViewById(R.id.list); mListContainer = (TabsListContainer) findViewById(R.id.list_container); - LinearLayout addTab = (LinearLayout) findViewById(R.id.add_tab); + ImageButton addTab = (ImageButton) findViewById(R.id.add_tab); addTab.setOnClickListener(new Button.OnClickListener() { public void onClick(View v) { GeckoApp.mAppContext.addTab(); finishActivity(); } }); - + + mRemoteTabs = (LinkTextView) findViewById(R.id.remote_tabs); + mRemoteTabs.setOnClickListener(new Button.OnClickListener() { + public void onClick(View v) { + showRemoteTabs(); + } + }); + LinearLayout container = (LinearLayout) findViewById(R.id.container); container.setOnClickListener(new Button.OnClickListener() { public void onClick(View v) { @@ -103,7 +117,7 @@ public class TabsTray extends Activity implements Tabs.OnTabsChangedListener { getWindowManager().getDefaultDisplay().getMetrics(metrics); sListItemHeight = (int) (TABS_LIST_ITEM_HEIGHT * metrics.density); - sAddTabHeight = (int) (TABS_ADD_TAB_HEIGHT * metrics.density); + sAddTabHeight = (int) (TABS_ADD_TAB_HEIGHT * metrics.density); sPreferredHeight = (int) (0.67 * metrics.heightPixels); sMaxHeight = (int) (sPreferredHeight + (0.33 * sListItemHeight)); @@ -111,6 +125,11 @@ public class TabsTray extends Activity implements Tabs.OnTabsChangedListener { tabs.registerOnTabsChangedListener(this); tabs.refreshThumbnails(); onTabChanged(null, null); + + // If sync is set up, query the database for remote clients + // Cleanup after Bug: 734211 is fixed + if (AccountManager.get(getApplicationContext()).getAccountsByType("org.mozilla.firefox_sync").length > 0) + (new QueryForRemoteClientsTask()).execute(); } @Override @@ -118,7 +137,7 @@ public class TabsTray extends Activity implements Tabs.OnTabsChangedListener { super.onDestroy(); Tabs.getInstance().unregisterOnTabsChangedListener(this); } - + public void onTabChanged(Tab tab, Tabs.TabEvents msg) { if (Tabs.getInstance().getCount() == 1) finishActivity(); @@ -135,7 +154,7 @@ public class TabsTray extends Activity implements Tabs.OnTabsChangedListener { mList.setSelection(selected); return; } - + int position = mTabsAdapter.getPositionForTab(tab); if (position == -1) return; @@ -157,6 +176,12 @@ public class TabsTray extends Activity implements Tabs.OnTabsChangedListener { GeckoAppShell.sendEventToGecko(GeckoEvent.createBroadcastEvent("Tab:Screenshot:Cancel","")); } + void showRemoteTabs() { + startActivity(new Intent(this, RemoteTabs.class)); + overridePendingTransition(R.anim.grow_fade_in, 0); + finishActivity(); + } + // Tabs List Container holds the ListView and the New Tab button public static class TabsListContainer extends LinearLayout { public TabsListContainer(Context context, AttributeSet attrs) { @@ -186,7 +211,36 @@ public class TabsTray extends Activity implements Tabs.OnTabsChangedListener { } } - // Adapter to bind tabs into a list + // AsyncTask to see if there is any remote tabs in the database + private class QueryForRemoteClientsTask extends GeckoAsyncTask { + @Override + protected Boolean doInBackground(Void... unused) { + Cursor clients = getContentResolver().query(BrowserContract.Clients.CONTENT_URI, + null, + null, + null, + null); + + if (clients == null) + return false; + + try { + return clients.moveToNext(); + } finally { + clients.close(); + } + } + + @Override + protected void onPostExecute(Boolean clientsExist) { + if (clientsExist.booleanValue()) + mRemoteTabs.setVisibility(View.VISIBLE); + else + mRemoteTabs.setVisibility(View.GONE); + } + } + + // Adapter to bind tabs into a list private class TabsAdapter extends BaseAdapter { public TabsAdapter(Context context, ArrayList tabs) { mContext = context; @@ -199,7 +253,7 @@ public class TabsTray extends Activity implements Tabs.OnTabsChangedListener { for (int i = 0; i < tabs.size(); i++) { mTabs.add(tabs.get(i)); } - + mOnInfoClickListener = new View.OnClickListener() { public void onClick(View v) { Tabs.getInstance().selectTab(Integer.parseInt((String) v.getTag())); @@ -225,7 +279,7 @@ public class TabsTray extends Activity implements Tabs.OnTabsChangedListener { public int getCount() { return mTabs.size(); } - + public Tab getItem(int position) { return mTabs.get(position); } @@ -274,7 +328,7 @@ public class TabsTray extends Activity implements Tabs.OnTabsChangedListener { info.setOnClickListener(mOnInfoClickListener); assignValues(convertView, tab); - + ImageButton close = (ImageButton) convertView.findViewById(R.id.close); if (mTabs.size() > 1) { close.setTag(String.valueOf(tab.getId())); @@ -293,7 +347,7 @@ public class TabsTray extends Activity implements Tabs.OnTabsChangedListener { @Override public void notifyDataSetInvalidated() { } - + private Context mContext; private ArrayList mTabs; private LayoutInflater mInflater; diff --git a/mobile/android/base/db/TabsProvider.java.in b/mobile/android/base/db/TabsProvider.java.in index 2f298d06baa..80787afe29c 100644 --- a/mobile/android/base/db/TabsProvider.java.in +++ b/mobile/android/base/db/TabsProvider.java.in @@ -51,7 +51,7 @@ public class TabsProvider extends ContentProvider { static final int CLIENTS = 602; static final int CLIENTS_ID = 603; - static final String DEFAULT_TABS_SORT_ORDER = Tabs.POSITION + " ASC"; + static final String DEFAULT_TABS_SORT_ORDER = Clients.LAST_MODIFIED + " DESC, " + Tabs.LAST_USED + " DESC"; static final String DEFAULT_CLIENTS_SORT_ORDER = Clients.LAST_MODIFIED + " DESC"; static final String INDEX_TABS_GUID = "tabs_guid_index"; @@ -73,13 +73,15 @@ public class TabsProvider extends ContentProvider { map = new HashMap(); map.put(Tabs._ID, Tabs._ID); - map.put(Tabs.CLIENT_GUID, Tabs.CLIENT_GUID); map.put(Tabs.TITLE, Tabs.TITLE); map.put(Tabs.URL, Tabs.URL); map.put(Tabs.HISTORY, Tabs.HISTORY); map.put(Tabs.FAVICON, Tabs.FAVICON); map.put(Tabs.LAST_USED, Tabs.LAST_USED); map.put(Tabs.POSITION, Tabs.POSITION); + map.put(Clients.GUID, Clients.GUID); + map.put(Clients.NAME, Clients.NAME); + map.put(Clients.LAST_MODIFIED, Clients.LAST_MODIFIED); TABS_PROJECTION_MAP = Collections.unmodifiableMap(map); map = new HashMap(); @@ -526,7 +528,7 @@ public class TabsProvider extends ContentProvider { } qb.setProjectionMap(TABS_PROJECTION_MAP); - qb.setTables(TABLE_TABS); + qb.setTables(TABLE_TABS + " LEFT OUTER JOIN " + TABLE_CLIENTS + " ON (" + TABLE_TABS + "." + Tabs.CLIENT_GUID + " = " + TABLE_CLIENTS + "." + Clients.GUID + ")"); break; case CLIENTS_ID: diff --git a/mobile/android/base/locales/en-US/android_strings.dtd b/mobile/android/base/locales/en-US/android_strings.dtd index 953d9b20c54..2389cff071f 100644 --- a/mobile/android/base/locales/en-US/android_strings.dtd +++ b/mobile/android/base/locales/en-US/android_strings.dtd @@ -27,6 +27,8 @@ + + diff --git a/mobile/android/base/resources/drawable/background.png b/mobile/android/base/resources/drawable-nodpi/background.png similarity index 100% rename from mobile/android/base/resources/drawable/background.png rename to mobile/android/base/resources/drawable-nodpi/background.png diff --git a/mobile/android/base/resources/drawable/remote_tabs_group_bg_repeat.xml b/mobile/android/base/resources/drawable/remote_tabs_group_bg_repeat.xml new file mode 100644 index 00000000000..8c19eac320d --- /dev/null +++ b/mobile/android/base/resources/drawable/remote_tabs_group_bg_repeat.xml @@ -0,0 +1,4 @@ + + diff --git a/mobile/android/base/resources/layout/abouthome_content.xml b/mobile/android/base/resources/layout/abouthome_content.xml index b9be61f7477..cb3cdd59aa9 100644 --- a/mobile/android/base/resources/layout/abouthome_content.xml +++ b/mobile/android/base/resources/layout/abouthome_content.xml @@ -60,16 +60,15 @@ android:isScrollContainer="false" android:gravity="center"/> - + - + - + diff --git a/mobile/android/base/resources/layout/remote_tabs.xml b/mobile/android/base/resources/layout/remote_tabs.xml new file mode 100644 index 00000000000..10a0a0b3a67 --- /dev/null +++ b/mobile/android/base/resources/layout/remote_tabs.xml @@ -0,0 +1,23 @@ + + + + + + + + + + diff --git a/mobile/android/base/resources/layout/remote_tabs_child.xml b/mobile/android/base/resources/layout/remote_tabs_child.xml new file mode 100644 index 00000000000..ec073bf60d8 --- /dev/null +++ b/mobile/android/base/resources/layout/remote_tabs_child.xml @@ -0,0 +1,17 @@ + + diff --git a/mobile/android/base/resources/layout/remote_tabs_group.xml b/mobile/android/base/resources/layout/remote_tabs_group.xml new file mode 100644 index 00000000000..b4c106a28fd --- /dev/null +++ b/mobile/android/base/resources/layout/remote_tabs_group.xml @@ -0,0 +1,17 @@ + + diff --git a/mobile/android/base/resources/layout/tabs_tray.xml b/mobile/android/base/resources/layout/tabs_tray.xml index f29dfb4d74c..00e7df1165e 100644 --- a/mobile/android/base/resources/layout/tabs_tray.xml +++ b/mobile/android/base/resources/layout/tabs_tray.xml @@ -20,19 +20,39 @@ android:layout_height="2dp" android:background="@drawable/tabs_tray_list_divider"/> - + - + - + + + diff --git a/mobile/android/base/strings.xml.in b/mobile/android/base/strings.xml.in index 0947fb388af..9babfa95d69 100644 --- a/mobile/android/base/strings.xml.in +++ b/mobile/android/base/strings.xml.in @@ -33,6 +33,8 @@ &choose_file; &awesomebar_default_text; + + &remote_tabs; &quit; &bookmark; diff --git a/mobile/android/base/sync/GlobalSession.java b/mobile/android/base/sync/GlobalSession.java index 82d700a1dee..a22a6695a5f 100644 --- a/mobile/android/base/sync/GlobalSession.java +++ b/mobile/android/base/sync/GlobalSession.java @@ -65,6 +65,7 @@ import org.mozilla.gecko.sync.stage.CheckPreconditionsStage; import org.mozilla.gecko.sync.stage.CompletedStage; import org.mozilla.gecko.sync.stage.EnsureClusterURLStage; import org.mozilla.gecko.sync.stage.EnsureKeysStage; +import org.mozilla.gecko.sync.stage.FennecTabsServerSyncStage; import org.mozilla.gecko.sync.stage.FetchInfoCollectionsStage; import org.mozilla.gecko.sync.stage.FetchMetaGlobalStage; import org.mozilla.gecko.sync.stage.GlobalSyncStage; @@ -200,6 +201,7 @@ public class GlobalSession implements CredentialsSource, PrefsSource { stages.put(Stage.syncClientsEngine, new SyncClientsEngineStage()); // TODO: more stages. + stages.put(Stage.syncTabs, new FennecTabsServerSyncStage()); stages.put(Stage.syncBookmarks, new AndroidBrowserBookmarksServerSyncStage()); stages.put(Stage.syncHistory, new AndroidBrowserHistoryServerSyncStage()); stages.put(Stage.completed, new CompletedStage()); diff --git a/mobile/android/base/sync/net/BaseResource.java b/mobile/android/base/sync/net/BaseResource.java index 53884ec4aa0..2f733b13848 100644 --- a/mobile/android/base/sync/net/BaseResource.java +++ b/mobile/android/base/sync/net/BaseResource.java @@ -1,39 +1,6 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Android Sync Client. - * - * The Initial Developer of the Original Code is - * the Mozilla Foundation. - * Portions created by the Initial Developer are Copyright (C) 2011 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Richard Newman - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ package org.mozilla.gecko.sync.net; @@ -46,7 +13,6 @@ import java.security.SecureRandom; import javax.net.ssl.SSLContext; -import android.util.Log; import ch.boye.httpclientandroidlib.Header; import ch.boye.httpclientandroidlib.HttpEntity; import ch.boye.httpclientandroidlib.HttpResponse; @@ -75,6 +41,8 @@ import ch.boye.httpclientandroidlib.params.HttpProtocolParams; import ch.boye.httpclientandroidlib.protocol.BasicHttpContext; import ch.boye.httpclientandroidlib.protocol.HttpContext; +import org.mozilla.gecko.sync.Logger; + /** * Provide simple HTTP access to a Sync server or similar. * Implements Basic Auth by asking its delegate for credentials. @@ -109,11 +77,11 @@ public class BaseResource implements Resource { public BaseResource(URI uri, boolean rewrite) { if (rewrite && uri.getHost().equals("localhost")) { // Rewrite localhost URIs to refer to the special Android emulator loopback passthrough interface. - Log.d(LOG_TAG, "Rewriting " + uri + " to point to " + ANDROID_LOOPBACK_IP + "."); + Logger.debug(LOG_TAG, "Rewriting " + uri + " to point to " + ANDROID_LOOPBACK_IP + "."); try { this.uri = new URI(uri.getScheme(), uri.getUserInfo(), ANDROID_LOOPBACK_IP, uri.getPort(), uri.getPath(), uri.getQuery(), uri.getFragment()); } catch (URISyntaxException e) { - Log.e(LOG_TAG, "Got error rewriting URI for Android emulator.", e); + Logger.error(LOG_TAG, "Got error rewriting URI for Android emulator.", e); } } else { this.uri = uri; @@ -136,7 +104,7 @@ public class BaseResource implements Resource { Credentials creds = new UsernamePasswordCredentials(credentials); Header header = BasicScheme.authenticate(creds, "US-ASCII", false); request.addHeader(header); - Log.d(LOG_TAG, "Adding auth header " + header); + Logger.trace(LOG_TAG, "Adding Basic Auth header."); } /** @@ -204,7 +172,7 @@ public class BaseResource implements Resource { private void execute() { try { HttpResponse response = client.execute(request, context); - Log.i(LOG_TAG, "Response: " + response.getStatusLine().toString()); + Logger.debug(LOG_TAG, "Response: " + response.getStatusLine().toString()); delegate.handleHttpResponse(response); } catch (ClientProtocolException e) { delegate.handleHttpProtocolException(e); @@ -221,10 +189,10 @@ public class BaseResource implements Resource { try { this.prepareClient(); } catch (KeyManagementException e) { - Log.e(LOG_TAG, "Couldn't prepare client.", e); + Logger.error(LOG_TAG, "Couldn't prepare client.", e); delegate.handleTransportException(e); } catch (NoSuchAlgorithmException e) { - Log.e(LOG_TAG, "Couldn't prepare client.", e); + Logger.error(LOG_TAG, "Couldn't prepare client.", e); delegate.handleTransportException(e); } this.execute(); @@ -232,19 +200,19 @@ public class BaseResource implements Resource { @Override public void get() { - Log.i(LOG_TAG, "HTTP GET " + this.uri.toASCIIString()); + Logger.debug(LOG_TAG, "HTTP GET " + this.uri.toASCIIString()); this.go(new HttpGet(this.uri)); } @Override public void delete() { - Log.i(LOG_TAG, "HTTP DELETE " + this.uri.toASCIIString()); + Logger.debug(LOG_TAG, "HTTP DELETE " + this.uri.toASCIIString()); this.go(new HttpDelete(this.uri)); } @Override public void post(HttpEntity body) { - Log.i(LOG_TAG, "HTTP POST " + this.uri.toASCIIString()); + Logger.debug(LOG_TAG, "HTTP POST " + this.uri.toASCIIString()); HttpPost request = new HttpPost(this.uri); request.setEntity(body); this.go(request); @@ -252,7 +220,7 @@ public class BaseResource implements Resource { @Override public void put(HttpEntity body) { - Log.i(LOG_TAG, "HTTP PUT " + this.uri.toASCIIString()); + Logger.debug(LOG_TAG, "HTTP PUT " + this.uri.toASCIIString()); HttpPut request = new HttpPut(this.uri); request.setEntity(body); this.go(request); diff --git a/mobile/android/base/sync/repositories/NoContentProviderException.java b/mobile/android/base/sync/repositories/NoContentProviderException.java new file mode 100644 index 00000000000..7f2ffc3c692 --- /dev/null +++ b/mobile/android/base/sync/repositories/NoContentProviderException.java @@ -0,0 +1,25 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +package org.mozilla.gecko.sync.repositories; + +import org.mozilla.gecko.sync.SyncException; + +import android.net.Uri; + +/** + * Raised when a Content Provider cannot be retrieved. + * + * @author rnewman + * + */ +public class NoContentProviderException extends SyncException { + private static final long serialVersionUID = 1L; + + public final Uri requestedProvider; + public NoContentProviderException(Uri requested) { + super(); + this.requestedProvider = requested; + } +} diff --git a/mobile/android/base/sync/repositories/android/FennecTabsRepository.java b/mobile/android/base/sync/repositories/android/FennecTabsRepository.java new file mode 100644 index 00000000000..446221ad4f0 --- /dev/null +++ b/mobile/android/base/sync/repositories/android/FennecTabsRepository.java @@ -0,0 +1,222 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +package org.mozilla.gecko.sync.repositories.android; + +import org.mozilla.gecko.db.BrowserContract; +import org.mozilla.gecko.sync.Logger; +import org.mozilla.gecko.sync.repositories.InactiveSessionException; +import org.mozilla.gecko.sync.repositories.NoContentProviderException; +import org.mozilla.gecko.sync.repositories.NoStoreDelegateException; +import org.mozilla.gecko.sync.repositories.Repository; +import org.mozilla.gecko.sync.repositories.RepositorySession; +import org.mozilla.gecko.sync.repositories.delegates.RepositorySessionCreationDelegate; +import org.mozilla.gecko.sync.repositories.delegates.RepositorySessionFetchRecordsDelegate; +import org.mozilla.gecko.sync.repositories.delegates.RepositorySessionFinishDelegate; +import org.mozilla.gecko.sync.repositories.delegates.RepositorySessionGuidsSinceDelegate; +import org.mozilla.gecko.sync.repositories.delegates.RepositorySessionWipeDelegate; +import org.mozilla.gecko.sync.repositories.domain.Record; +import org.mozilla.gecko.sync.repositories.domain.TabsRecord; + +import android.content.ContentProviderClient; +import android.content.ContentValues; +import android.content.Context; +import android.net.Uri; +import android.os.RemoteException; + +public class FennecTabsRepository extends Repository { + + /** + * Note that — unlike most repositories — this will only fetch Fennec's tabs, + * and only store tabs from other clients. + * + * It will never retrieve tabs from other clients, or store tabs for Fennec, + * unless you use {@link fetch(String[], RepositorySessionFetchRecordsDelegate)} + * and specify an explicit GUID. + */ + public static class FennecTabsRepositorySession extends RepositorySession { + + private static final String LOG_TAG = "FennecTabsSession"; + + private final ContentProviderClient tabsProvider; + private final ContentProviderClient clientsProvider; + + protected ContentProviderClient getContentProvider(final Context context, final Uri uri) throws NoContentProviderException { + + ContentProviderClient client = context.getContentResolver().acquireContentProviderClient(uri); + if (client == null) { + throw new NoContentProviderException(uri); + } + return client; + } + + protected void releaseProviders() { + try { + clientsProvider.release(); + } catch (Exception e) {} + try { + tabsProvider.release(); + } catch (Exception e) {} + } + + + public FennecTabsRepositorySession(Repository repository, Context context) throws NoContentProviderException { + super(repository); + clientsProvider = getContentProvider(context, BrowserContract.Clients.CONTENT_URI); + try { + tabsProvider = getContentProvider(context, BrowserContract.Tabs.CONTENT_URI); + } catch (NoContentProviderException e) { + clientsProvider.release(); + throw e; + } catch (Exception e) { + clientsProvider.release(); + // Oh, Java. + throw new RuntimeException(e); + } + } + + @Override + public void abort() { + releaseProviders(); + super.abort(); + } + + @Override + public void finish(final RepositorySessionFinishDelegate delegate) throws InactiveSessionException { + releaseProviders(); + super.finish(delegate); + } + + @Override + public void guidsSince(long timestamp, + RepositorySessionGuidsSinceDelegate delegate) { + // Empty until Bug 730039 lands. + delegate.onGuidsSinceSucceeded(new String[] {}); + } + + @Override + public void fetchSince(long timestamp, + RepositorySessionFetchRecordsDelegate delegate) { + // Empty until Bug 730039 lands. + delegate.onFetchCompleted(now()); + } + + @Override + public void fetch(String[] guids, + RepositorySessionFetchRecordsDelegate delegate) { + // Incomplete until Bug 730039 lands. + // TODO + delegate.onFetchCompleted(now()); + } + + @Override + public void fetchAll(RepositorySessionFetchRecordsDelegate delegate) { + // Incomplete until Bug 730039 lands. + // TODO + delegate.onFetchCompleted(now()); + } + + private static final String TABS_CLIENT_GUID_IS = BrowserContract.Tabs.CLIENT_GUID + " = ?"; + private static final String CLIENT_GUID_IS = BrowserContract.Clients.GUID + " = ?"; + @Override + public void store(final Record record) throws NoStoreDelegateException { + if (delegate == null) { + Logger.warn(LOG_TAG, "No store delegate."); + throw new NoStoreDelegateException(); + } + if (record == null) { + Logger.error(LOG_TAG, "Record sent to store was null"); + throw new IllegalArgumentException("Null record passed to FennecTabsRepositorySession.store()."); + } + if (!(record instanceof TabsRecord)) { + Logger.error(LOG_TAG, "Can't store anything but a TabsRecord"); + throw new IllegalArgumentException("Non-TabsRecord passed to FennecTabsRepositorySession.store()."); + } + final TabsRecord tabsRecord = (TabsRecord) record; + + Runnable command = new Runnable() { + @Override + public void run() { + Logger.debug(LOG_TAG, "Storing tabs for client " + tabsRecord.guid); + if (!isActive()) { + delegate.onRecordStoreFailed(new InactiveSessionException(null)); + return; + } + if (tabsRecord.guid == null) { + delegate.onRecordStoreFailed(new RuntimeException("Can't store record with null GUID.")); + return; + } + + try { + // This is nice and easy: we *always* store. + final String[] selectionArgs = new String[] { tabsRecord.guid }; + if (tabsRecord.deleted) { + try { + Logger.debug(LOG_TAG, "Clearing entry for client " + tabsRecord.guid); + clientsProvider.delete(BrowserContract.Clients.CONTENT_URI, + CLIENT_GUID_IS, + selectionArgs); + delegate.onRecordStoreSucceeded(record); + } catch (Exception e) { + delegate.onRecordStoreFailed(e); + } + return; + } + + // If it exists, update the client record; otherwise insert. + final ContentValues clientsCV = tabsRecord.getClientsContentValues(); + + Logger.debug(LOG_TAG, "Updating clients provider."); + final int updated = clientsProvider.update(BrowserContract.Clients.CONTENT_URI, + clientsCV, + CLIENT_GUID_IS, + selectionArgs); + if (0 == updated) { + clientsProvider.insert(BrowserContract.Clients.CONTENT_URI, clientsCV); + } + + // Now insert tabs. + final ContentValues[] tabsArray = tabsRecord.getTabsContentValues(); + Logger.debug(LOG_TAG, "Inserting " + tabsArray.length + " tabs for client " + tabsRecord.guid); + + tabsProvider.delete(BrowserContract.Tabs.CONTENT_URI, TABS_CLIENT_GUID_IS, selectionArgs); + final int inserted = tabsProvider.bulkInsert(BrowserContract.Tabs.CONTENT_URI, tabsArray); + Logger.trace(LOG_TAG, "Inserted: " + inserted); + + delegate.onRecordStoreSucceeded(tabsRecord); + } catch (Exception e) { + Logger.warn(LOG_TAG, "Error storing tabs.", e); + delegate.onRecordStoreFailed(e); + } + } + }; + + storeWorkQueue.execute(command); + } + + @Override + public void wipe(RepositorySessionWipeDelegate delegate) { + try { + tabsProvider.delete(BrowserContract.Tabs.CONTENT_URI, null, null); + clientsProvider.delete(BrowserContract.Clients.CONTENT_URI, null, null); + } catch (RemoteException e) { + Logger.warn(LOG_TAG, "Got RemoteException in wipe.", e); + delegate.onWipeFailed(e); + return; + } + delegate.onWipeSucceeded(); + } + } + + @Override + public void createSession(RepositorySessionCreationDelegate delegate, + Context context) { + try { + final FennecTabsRepositorySession session = new FennecTabsRepositorySession(this, context); + delegate.onSessionCreated(session); + } catch (Exception e) { + delegate.onSessionCreateFailed(e); + } + } +} diff --git a/mobile/android/base/sync/repositories/domain/TabsRecord.java b/mobile/android/base/sync/repositories/domain/TabsRecord.java index e2726da1958..49358c41c57 100644 --- a/mobile/android/base/sync/repositories/domain/TabsRecord.java +++ b/mobile/android/base/sync/repositories/domain/TabsRecord.java @@ -8,11 +8,14 @@ import java.util.ArrayList; import org.json.simple.JSONObject; import org.json.simple.JSONArray; +import org.mozilla.gecko.db.BrowserContract; import org.mozilla.gecko.sync.ExtendedJSONObject; import org.mozilla.gecko.sync.Logger; import org.mozilla.gecko.sync.NonArrayJSONException; import org.mozilla.gecko.sync.Utils; +import android.content.ContentValues; + /** * Represents a client's collection of tabs. * @@ -40,7 +43,19 @@ public class TabsRecord extends Record { String title = obj.getString("title"); String icon = obj.getString("icon"); JSONArray history = obj.getArray("urlHistory"); - long lastUsed = obj.getLong("lastUsed"); + + // Last used is inexplicably a string in seconds. Most of the time. + long lastUsed = 0; + Object lU = obj.get("lastUsed"); + if (lU instanceof Number) { + lastUsed = ((Long) lU) * 1000L; + } else if (lU instanceof String) { + try { + lastUsed = Long.parseLong((String) lU, 10) * 1000L; + } catch (NumberFormatException e) { + Logger.debug(LOG_TAG, "Invalid number format in lastUsed: " + lU); + } + } return new Tab(title, icon, history, lastUsed); } @@ -50,9 +65,23 @@ public class TabsRecord extends Record { o.put("title", title); o.put("icon", icon); o.put("urlHistory", history); - o.put("lastUsed", lastUsed); + o.put("lastUsed", this.lastUsed / 1000); return o; } + + public ContentValues toContentValues(String clientGUID, int position) { + ContentValues out = new ContentValues(); + out.put(BrowserContract.Tabs.POSITION, position); + out.put(BrowserContract.Tabs.CLIENT_GUID, clientGUID); + + out.put(BrowserContract.Tabs.FAVICON, this.icon); + out.put(BrowserContract.Tabs.LAST_USED, this.lastUsed); + out.put(BrowserContract.Tabs.TITLE, this.title); + out.put(BrowserContract.Tabs.URL, (String) this.history.get(0)); + out.put(BrowserContract.Tabs.HISTORY, this.history.toJSONString()); + return out; + + } } private static final String LOG_TAG = "TabsRecord"; @@ -130,4 +159,21 @@ public class TabsRecord extends Record { return out; } + + public ContentValues getClientsContentValues() { + ContentValues cv = new ContentValues(); + cv.put(BrowserContract.Clients.GUID, this.guid); + cv.put(BrowserContract.Clients.NAME, this.clientName); + cv.put(BrowserContract.Clients.LAST_MODIFIED, this.lastModified); + return cv; + } + + public ContentValues[] getTabsContentValues() { + int c = tabs.size(); + ContentValues[] out = new ContentValues[c]; + for (int i = 0; i < c; i++) { + out[i] = tabs.get(i).toContentValues(this.guid, i); + } + return out; + } } diff --git a/mobile/android/base/sync/stage/FennecTabsServerSyncStage.java b/mobile/android/base/sync/stage/FennecTabsServerSyncStage.java new file mode 100644 index 00000000000..60d731cf499 --- /dev/null +++ b/mobile/android/base/sync/stage/FennecTabsServerSyncStage.java @@ -0,0 +1,45 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +package org.mozilla.gecko.sync.stage; + +import org.mozilla.gecko.sync.repositories.domain.TabsRecord; +import org.mozilla.gecko.sync.CryptoRecord; +import org.mozilla.gecko.sync.repositories.RecordFactory; +import org.mozilla.gecko.sync.repositories.Repository; +import org.mozilla.gecko.sync.repositories.android.FennecTabsRepository; +import org.mozilla.gecko.sync.repositories.domain.Record; + +public class FennecTabsServerSyncStage extends ServerSyncStage { + private static final String COLLECTION = "tabs"; + + public class FennecTabsRecordFactory extends RecordFactory { + @Override + public Record createRecord(Record record) { + TabsRecord r = new TabsRecord(); + r.initFromEnvelope((CryptoRecord) record); + return r; + } + } + + @Override + protected String getCollection() { + return COLLECTION; + } + + @Override + protected String getEngineName() { + return COLLECTION; + } + + @Override + protected Repository getLocalRepository() { + return new FennecTabsRepository(); + } + + @Override + protected RecordFactory getRecordFactory() { + return new FennecTabsRecordFactory(); + } +} diff --git a/mobile/android/base/sync/stage/GlobalSyncStage.java b/mobile/android/base/sync/stage/GlobalSyncStage.java index babecd4119b..d12ffd08b18 100644 --- a/mobile/android/base/sync/stage/GlobalSyncStage.java +++ b/mobile/android/base/sync/stage/GlobalSyncStage.java @@ -57,6 +57,7 @@ public interface GlobalSyncStage { processClientCommands, updateEnabledEngines, */ + syncTabs, syncBookmarks, syncHistory, completed, diff --git a/mobile/android/base/sync/stage/ServerSyncStage.java b/mobile/android/base/sync/stage/ServerSyncStage.java index 1f04c35f359..894d5cf57f4 100644 --- a/mobile/android/base/sync/stage/ServerSyncStage.java +++ b/mobile/android/base/sync/stage/ServerSyncStage.java @@ -42,6 +42,7 @@ import java.net.URISyntaxException; import org.json.simple.parser.ParseException; import org.mozilla.gecko.sync.GlobalSession; +import org.mozilla.gecko.sync.Logger; import org.mozilla.gecko.sync.MetaGlobalException; import org.mozilla.gecko.sync.NoCollectionKeysSetException; import org.mozilla.gecko.sync.NonObjectJSONException; @@ -127,17 +128,18 @@ public abstract class ServerSyncStage implements @Override public void execute(GlobalSession session) throws NoSuchStageException { - Log.d(LOG_TAG, "Starting execute."); + final String name = getEngineName(); + Logger.debug(LOG_TAG, "Starting execute for " + name); this.session = session; try { if (!this.isEnabled()) { - Log.i(LOG_TAG, "Stage disabled; skipping."); + Logger.info(LOG_TAG, "Stage " + name + " disabled; skipping."); session.advance(); return; } } catch (MetaGlobalException e) { - session.abort(e, "Inappropriate meta/global; refusing to execute " + this.getEngineName() + " stage."); + session.abort(e, "Inappropriate meta/global; refusing to execute " + name + " stage."); return; } @@ -161,9 +163,9 @@ public abstract class ServerSyncStage implements session.abort(e, "Invalid persisted JSON for config."); return; } - Log.d(LOG_TAG, "Invoking synchronizer."); + Logger.debug(LOG_TAG, "Invoking synchronizer."); synchronizer.synchronize(session.getContext(), this); - Log.d(LOG_TAG, "Reached end of execute."); + Logger.debug(LOG_TAG, "Reached end of execute."); } @Override diff --git a/mobile/android/sync/java-sources.mn b/mobile/android/sync/java-sources.mn index c89902fc47e..37b5ed1e133 100644 --- a/mobile/android/sync/java-sources.mn +++ b/mobile/android/sync/java-sources.mn @@ -1 +1 @@ -sync/AlreadySyncingException.java sync/CollectionKeys.java sync/CredentialsSource.java sync/crypto/CryptoException.java sync/crypto/CryptoInfo.java sync/crypto/HKDF.java sync/crypto/HMACVerificationException.java sync/crypto/KeyBundle.java sync/crypto/MissingCryptoInputException.java sync/crypto/NoKeyBundleException.java sync/CryptoRecord.java sync/DelayedWorkTracker.java sync/delegates/ClientsDataDelegate.java sync/delegates/FreshStartDelegate.java sync/delegates/GlobalSessionCallback.java sync/delegates/InfoCollectionsDelegate.java sync/delegates/KeyUploadDelegate.java sync/delegates/MetaGlobalDelegate.java sync/delegates/WipeServerDelegate.java sync/ExtendedJSONObject.java sync/GlobalSession.java sync/HTTPFailureException.java sync/InfoCollections.java sync/jpake/BigIntegerHelper.java sync/jpake/Gx3OrGx4IsZeroOrOneException.java sync/jpake/IncorrectZkpException.java sync/jpake/JPakeClient.java sync/jpake/JPakeCrypto.java sync/jpake/JPakeJson.java sync/jpake/JPakeNoActivePairingException.java sync/jpake/JPakeNumGenerator.java sync/jpake/JPakeNumGeneratorRandom.java sync/jpake/JPakeParty.java sync/jpake/JPakeRequest.java sync/jpake/JPakeRequestDelegate.java sync/jpake/JPakeResponse.java sync/jpake/stage/CompleteStage.java sync/jpake/stage/ComputeFinalStage.java sync/jpake/stage/ComputeKeyVerificationStage.java sync/jpake/stage/ComputeStepOneStage.java sync/jpake/stage/ComputeStepTwoStage.java sync/jpake/stage/DecryptDataStage.java sync/jpake/stage/GetChannelStage.java sync/jpake/stage/GetRequestStage.java sync/jpake/stage/JPakeStage.java sync/jpake/stage/PutRequestStage.java sync/jpake/stage/VerifyPairingStage.java sync/jpake/Zkp.java sync/KeyBundleProvider.java sync/Logger.java sync/MetaGlobal.java sync/MetaGlobalException.java sync/MetaGlobalMissingEnginesException.java sync/MetaGlobalNotSetException.java sync/middleware/Crypto5MiddlewareRepository.java sync/middleware/Crypto5MiddlewareRepositorySession.java sync/middleware/MiddlewareRepository.java sync/middleware/MiddlewareRepositorySession.java sync/net/BaseResource.java sync/net/CompletedEntity.java sync/net/HandleProgressException.java sync/net/Resource.java sync/net/ResourceDelegate.java sync/net/SyncResourceDelegate.java sync/net/SyncResponse.java sync/net/SyncStorageCollectionRequest.java sync/net/SyncStorageCollectionRequestDelegate.java sync/net/SyncStorageRecordRequest.java sync/net/SyncStorageRequest.java sync/net/SyncStorageRequestDelegate.java sync/net/SyncStorageRequestIncrementalDelegate.java sync/net/SyncStorageResponse.java sync/net/TLSSocketFactory.java sync/net/WBOCollectionRequestDelegate.java sync/net/WBORequestDelegate.java sync/NoCollectionKeysSetException.java sync/NonArrayJSONException.java sync/NonObjectJSONException.java sync/PrefsSource.java sync/repositories/android/AndroidBrowserBookmarksDataAccessor.java sync/repositories/android/AndroidBrowserBookmarksRepository.java sync/repositories/android/AndroidBrowserBookmarksRepositorySession.java sync/repositories/android/AndroidBrowserHistoryDataAccessor.java sync/repositories/android/AndroidBrowserHistoryDataExtender.java sync/repositories/android/AndroidBrowserHistoryRepository.java sync/repositories/android/AndroidBrowserHistoryRepositorySession.java sync/repositories/android/AndroidBrowserPasswordsDataAccessor.java sync/repositories/android/AndroidBrowserPasswordsRepository.java sync/repositories/android/AndroidBrowserPasswordsRepositorySession.java sync/repositories/android/AndroidBrowserRepository.java sync/repositories/android/AndroidBrowserRepositoryDataAccessor.java sync/repositories/android/AndroidBrowserRepositorySession.java sync/repositories/android/BrowserContractHelpers.java sync/repositories/android/CachedSQLiteOpenHelper.java sync/repositories/android/ClientsDatabase.java sync/repositories/android/ClientsDatabaseAccessor.java sync/repositories/android/PasswordColumns.java sync/repositories/android/RepoUtils.java sync/repositories/BookmarkNeedsReparentingException.java sync/repositories/BookmarksRepository.java sync/repositories/ConstrainedServer11Repository.java sync/repositories/delegates/DeferrableRepositorySessionCreationDelegate.java sync/repositories/delegates/DeferredRepositorySessionBeginDelegate.java sync/repositories/delegates/DeferredRepositorySessionFetchRecordsDelegate.java sync/repositories/delegates/DeferredRepositorySessionFinishDelegate.java sync/repositories/delegates/DeferredRepositorySessionStoreDelegate.java sync/repositories/delegates/RepositorySessionBeginDelegate.java sync/repositories/delegates/RepositorySessionCleanDelegate.java sync/repositories/delegates/RepositorySessionCreationDelegate.java sync/repositories/delegates/RepositorySessionFetchRecordsDelegate.java sync/repositories/delegates/RepositorySessionFinishDelegate.java sync/repositories/delegates/RepositorySessionGuidsSinceDelegate.java sync/repositories/delegates/RepositorySessionStoreDelegate.java sync/repositories/delegates/RepositorySessionWipeDelegate.java sync/repositories/domain/BookmarkRecord.java sync/repositories/domain/BookmarkRecordFactory.java sync/repositories/domain/ClientRecord.java sync/repositories/domain/ClientRecordFactory.java sync/repositories/domain/HistoryRecord.java sync/repositories/domain/HistoryRecordFactory.java sync/repositories/domain/PasswordRecord.java sync/repositories/domain/Record.java sync/repositories/domain/TabsRecord.java sync/repositories/HashSetStoreTracker.java sync/repositories/HistoryRepository.java sync/repositories/IdentityRecordFactory.java sync/repositories/InactiveSessionException.java sync/repositories/InvalidBookmarkTypeException.java sync/repositories/InvalidRequestException.java sync/repositories/InvalidSessionTransitionException.java sync/repositories/MultipleRecordsForGuidException.java sync/repositories/NoGuidForIdException.java sync/repositories/NoStoreDelegateException.java sync/repositories/NullCursorException.java sync/repositories/ParentNotFoundException.java sync/repositories/ProfileDatabaseException.java sync/repositories/RecordFactory.java sync/repositories/RecordFilter.java sync/repositories/Repository.java sync/repositories/RepositorySession.java sync/repositories/RepositorySessionBundle.java sync/repositories/Server11Repository.java sync/repositories/Server11RepositorySession.java sync/repositories/StoreTracker.java sync/repositories/StoreTrackingRepositorySession.java sync/setup/activities/AccountActivity.java sync/setup/activities/SetupFailureActivity.java sync/setup/activities/SetupSuccessActivity.java sync/setup/activities/SetupSyncActivity.java sync/setup/Constants.java sync/setup/SyncAuthenticatorService.java sync/stage/AndroidBrowserBookmarksServerSyncStage.java sync/stage/AndroidBrowserHistoryServerSyncStage.java sync/stage/CheckPreconditionsStage.java sync/stage/CompletedStage.java sync/stage/EnsureClusterURLStage.java sync/stage/EnsureKeysStage.java sync/stage/FetchInfoCollectionsStage.java sync/stage/FetchMetaGlobalStage.java sync/stage/GlobalSyncStage.java sync/stage/NoSuchStageException.java sync/stage/NoSyncIDException.java sync/stage/ServerSyncStage.java sync/stage/SyncClientsEngineStage.java sync/StubActivity.java sync/syncadapter/SyncAdapter.java sync/syncadapter/SyncService.java sync/SyncConfiguration.java sync/SyncConfigurationException.java sync/SyncException.java sync/synchronizer/ConcurrentRecordConsumer.java sync/synchronizer/RecordConsumer.java sync/synchronizer/RecordsChannel.java sync/synchronizer/RecordsChannelDelegate.java sync/synchronizer/RecordsConsumerDelegate.java sync/synchronizer/SerialRecordConsumer.java sync/synchronizer/SessionNotBegunException.java sync/synchronizer/Synchronizer.java sync/synchronizer/SynchronizerDelegate.java sync/synchronizer/SynchronizerSession.java sync/synchronizer/SynchronizerSessionDelegate.java sync/synchronizer/UnbundleError.java sync/synchronizer/UnexpectedSessionException.java sync/SynchronizerConfiguration.java sync/SynchronizerConfigurations.java sync/ThreadPool.java sync/UnexpectedJSONException.java sync/UnknownSynchronizerConfigurationVersionException.java sync/Utils.java +sync/AlreadySyncingException.java sync/CollectionKeys.java sync/CredentialsSource.java sync/crypto/CryptoException.java sync/crypto/CryptoInfo.java sync/crypto/HKDF.java sync/crypto/HMACVerificationException.java sync/crypto/KeyBundle.java sync/crypto/MissingCryptoInputException.java sync/crypto/NoKeyBundleException.java sync/CryptoRecord.java sync/DelayedWorkTracker.java sync/delegates/ClientsDataDelegate.java sync/delegates/FreshStartDelegate.java sync/delegates/GlobalSessionCallback.java sync/delegates/InfoCollectionsDelegate.java sync/delegates/KeyUploadDelegate.java sync/delegates/MetaGlobalDelegate.java sync/delegates/WipeServerDelegate.java sync/ExtendedJSONObject.java sync/GlobalSession.java sync/HTTPFailureException.java sync/InfoCollections.java sync/jpake/BigIntegerHelper.java sync/jpake/Gx3OrGx4IsZeroOrOneException.java sync/jpake/IncorrectZkpException.java sync/jpake/JPakeClient.java sync/jpake/JPakeCrypto.java sync/jpake/JPakeJson.java sync/jpake/JPakeNoActivePairingException.java sync/jpake/JPakeNumGenerator.java sync/jpake/JPakeNumGeneratorRandom.java sync/jpake/JPakeParty.java sync/jpake/JPakeRequest.java sync/jpake/JPakeRequestDelegate.java sync/jpake/JPakeResponse.java sync/jpake/stage/CompleteStage.java sync/jpake/stage/ComputeFinalStage.java sync/jpake/stage/ComputeKeyVerificationStage.java sync/jpake/stage/ComputeStepOneStage.java sync/jpake/stage/ComputeStepTwoStage.java sync/jpake/stage/DecryptDataStage.java sync/jpake/stage/GetChannelStage.java sync/jpake/stage/GetRequestStage.java sync/jpake/stage/JPakeStage.java sync/jpake/stage/PutRequestStage.java sync/jpake/stage/VerifyPairingStage.java sync/jpake/Zkp.java sync/KeyBundleProvider.java sync/Logger.java sync/MetaGlobal.java sync/MetaGlobalException.java sync/MetaGlobalMissingEnginesException.java sync/MetaGlobalNotSetException.java sync/middleware/Crypto5MiddlewareRepository.java sync/middleware/Crypto5MiddlewareRepositorySession.java sync/middleware/MiddlewareRepository.java sync/middleware/MiddlewareRepositorySession.java sync/net/BaseResource.java sync/net/CompletedEntity.java sync/net/HandleProgressException.java sync/net/Resource.java sync/net/ResourceDelegate.java sync/net/SyncResourceDelegate.java sync/net/SyncResponse.java sync/net/SyncStorageCollectionRequest.java sync/net/SyncStorageCollectionRequestDelegate.java sync/net/SyncStorageRecordRequest.java sync/net/SyncStorageRequest.java sync/net/SyncStorageRequestDelegate.java sync/net/SyncStorageRequestIncrementalDelegate.java sync/net/SyncStorageResponse.java sync/net/TLSSocketFactory.java sync/net/WBOCollectionRequestDelegate.java sync/net/WBORequestDelegate.java sync/NoCollectionKeysSetException.java sync/NonArrayJSONException.java sync/NonObjectJSONException.java sync/PrefsSource.java sync/repositories/android/AndroidBrowserBookmarksDataAccessor.java sync/repositories/android/AndroidBrowserBookmarksRepository.java sync/repositories/android/AndroidBrowserBookmarksRepositorySession.java sync/repositories/android/AndroidBrowserHistoryDataAccessor.java sync/repositories/android/AndroidBrowserHistoryDataExtender.java sync/repositories/android/AndroidBrowserHistoryRepository.java sync/repositories/android/AndroidBrowserHistoryRepositorySession.java sync/repositories/android/AndroidBrowserPasswordsDataAccessor.java sync/repositories/android/AndroidBrowserPasswordsRepository.java sync/repositories/android/AndroidBrowserPasswordsRepositorySession.java sync/repositories/android/AndroidBrowserRepository.java sync/repositories/android/AndroidBrowserRepositoryDataAccessor.java sync/repositories/android/AndroidBrowserRepositorySession.java sync/repositories/android/BrowserContractHelpers.java sync/repositories/android/CachedSQLiteOpenHelper.java sync/repositories/android/ClientsDatabase.java sync/repositories/android/ClientsDatabaseAccessor.java sync/repositories/android/FennecTabsRepository.java sync/repositories/android/PasswordColumns.java sync/repositories/android/RepoUtils.java sync/repositories/BookmarkNeedsReparentingException.java sync/repositories/BookmarksRepository.java sync/repositories/ConstrainedServer11Repository.java sync/repositories/delegates/DeferrableRepositorySessionCreationDelegate.java sync/repositories/delegates/DeferredRepositorySessionBeginDelegate.java sync/repositories/delegates/DeferredRepositorySessionFetchRecordsDelegate.java sync/repositories/delegates/DeferredRepositorySessionFinishDelegate.java sync/repositories/delegates/DeferredRepositorySessionStoreDelegate.java sync/repositories/delegates/RepositorySessionBeginDelegate.java sync/repositories/delegates/RepositorySessionCleanDelegate.java sync/repositories/delegates/RepositorySessionCreationDelegate.java sync/repositories/delegates/RepositorySessionFetchRecordsDelegate.java sync/repositories/delegates/RepositorySessionFinishDelegate.java sync/repositories/delegates/RepositorySessionGuidsSinceDelegate.java sync/repositories/delegates/RepositorySessionStoreDelegate.java sync/repositories/delegates/RepositorySessionWipeDelegate.java sync/repositories/domain/BookmarkRecord.java sync/repositories/domain/BookmarkRecordFactory.java sync/repositories/domain/ClientRecord.java sync/repositories/domain/ClientRecordFactory.java sync/repositories/domain/HistoryRecord.java sync/repositories/domain/HistoryRecordFactory.java sync/repositories/domain/PasswordRecord.java sync/repositories/domain/Record.java sync/repositories/domain/TabsRecord.java sync/repositories/HashSetStoreTracker.java sync/repositories/HistoryRepository.java sync/repositories/IdentityRecordFactory.java sync/repositories/InactiveSessionException.java sync/repositories/InvalidBookmarkTypeException.java sync/repositories/InvalidRequestException.java sync/repositories/InvalidSessionTransitionException.java sync/repositories/MultipleRecordsForGuidException.java sync/repositories/NoContentProviderException.java sync/repositories/NoGuidForIdException.java sync/repositories/NoStoreDelegateException.java sync/repositories/NullCursorException.java sync/repositories/ParentNotFoundException.java sync/repositories/ProfileDatabaseException.java sync/repositories/RecordFactory.java sync/repositories/RecordFilter.java sync/repositories/Repository.java sync/repositories/RepositorySession.java sync/repositories/RepositorySessionBundle.java sync/repositories/Server11Repository.java sync/repositories/Server11RepositorySession.java sync/repositories/StoreTracker.java sync/repositories/StoreTrackingRepositorySession.java sync/setup/activities/AccountActivity.java sync/setup/activities/SetupFailureActivity.java sync/setup/activities/SetupSuccessActivity.java sync/setup/activities/SetupSyncActivity.java sync/setup/Constants.java sync/setup/SyncAuthenticatorService.java sync/stage/AndroidBrowserBookmarksServerSyncStage.java sync/stage/AndroidBrowserHistoryServerSyncStage.java sync/stage/CheckPreconditionsStage.java sync/stage/CompletedStage.java sync/stage/EnsureClusterURLStage.java sync/stage/EnsureKeysStage.java sync/stage/FennecTabsServerSyncStage.java sync/stage/FetchInfoCollectionsStage.java sync/stage/FetchMetaGlobalStage.java sync/stage/GlobalSyncStage.java sync/stage/NoSuchStageException.java sync/stage/NoSyncIDException.java sync/stage/ServerSyncStage.java sync/stage/SyncClientsEngineStage.java sync/StubActivity.java sync/syncadapter/SyncAdapter.java sync/syncadapter/SyncService.java sync/SyncConfiguration.java sync/SyncConfigurationException.java sync/SyncException.java sync/synchronizer/ConcurrentRecordConsumer.java sync/synchronizer/RecordConsumer.java sync/synchronizer/RecordsChannel.java sync/synchronizer/RecordsChannelDelegate.java sync/synchronizer/RecordsConsumerDelegate.java sync/synchronizer/SerialRecordConsumer.java sync/synchronizer/SessionNotBegunException.java sync/synchronizer/Synchronizer.java sync/synchronizer/SynchronizerDelegate.java sync/synchronizer/SynchronizerSession.java sync/synchronizer/SynchronizerSessionDelegate.java sync/synchronizer/UnbundleError.java sync/synchronizer/UnexpectedSessionException.java sync/SynchronizerConfiguration.java sync/SynchronizerConfigurations.java sync/ThreadPool.java sync/UnexpectedJSONException.java sync/UnknownSynchronizerConfigurationVersionException.java sync/Utils.java diff --git a/modules/freetype2/ChangeLog b/modules/freetype2/ChangeLog index 7a32679871c..9afc1aa12bd 100644 --- a/modules/freetype2/ChangeLog +++ b/modules/freetype2/ChangeLog @@ -1,3 +1,2825 @@ +2012-03-08 Werner Lemberg + + * Version 2.4.9 released. + ========================= + + + Tag sources with `VER-2-4-9'. + + * docs/CHANGES: Updated. + + * docs/VERSION.DLL: Update documentation and bump version number to + 2.4.9. + + * README, Jamfile (RefDoc), + builds/win32/vc2005/freetype.vcproj, builds/win32/vc2005/index.html, + builds/win32/vc2008/freetype.vcproj, builds/win32/vc2008/index.html, + builds/win32/vc2010/freetype.vcxproj, builds/win32/vc2010/index.html, + builds/win32/visualc/freetype.dsp, + builds/win32/visualc/freetype.vcproj, + builds/win32/visualc/index.html, builds/win32/visualce/freetype.dsp, + builds/win32/visualce/freetype.vcproj, + builds/win32/visualce/index.html, + builds/wince/vc2005-ce/freetype.vcproj, + builds/wince/vc2005-ce/index.html, + builds/wince/vc2008-ce/freetype.vcproj, + builds/wince/vc2008-ce/index.html: s/2.4.8/2.4.9/, s/248/249/. + + * include/freetype/freetype.h (FREETYPE_PATCH): Set to 9. + + * builds/unix/configure.raw (version_info): Set to 14:1:8. + +2012-03-08 Werner Lemberg + + [bdf] Add missing overflow check. + + * src/bdf/bdflib.c (_bdf_parse_glyphs) : Add threshold for + `glyph->bpr'. + +2012-03-07 Vinnie Falco + + Prepare source code for amalgamation. + + * src\autofit\aferrors.h, src\bdf\bdferror.h, src\bzip2\ftbzip2.c, + src\cache\ftcerror.h, src\cff\cfferrs.h, src\cid\ciderrs.h, + src\gxvalid\gxverror.h, src\gzip\ftgzip.c, src\lzw\ftlzw.c, + src\otvalid\otverror.h, src\pcf\pcferror.h, src\pfr\pfrerror.h, + src\psaux\psauxerr.h, src\pshinter\pshnterr.h, + src\psnames\psnamerr.h, src\raster\rasterrs.h, src\sfnt\sferrors.h, + src\smooth\ftsmerrs.h, src\truetype\tterrors.h, + src\type1\t1errors.h, src\type42\t42error.h, src\winfonts\fnterrs.h: + Add #undef FT_ERR_PREFIX before #define FT_ERR_PREFIX. + +2012-03-03 Werner Lemberg + + Fix Savannah bug #35660. + + For some divisions, we use casts to 32bit entities. Always guard + against division by zero with these casts also. + + * src/base/ftcalc.c (ft_div64by32): Remove redundant cast. + (FT_MulDiv, FT_MulDiv_No_Round): Add 32bit cast. + (FT_DivFix): Add 32bit cast (this omission triggered the bug). + +2012-03-03 Werner Lemberg + + [psaux] Fix handling of track kerning. + + * src/psaux/afmparse.c (afm_parse_track_kern): Don't inverse sign + for `min_kern'. It is indeed quite common that track kerning + *increases* spacing for very small sizes. + +2012-03-02 Werner Lemberg + + [truetype] Fix Savannah bug #35689. + + * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Check first outline + point. + +2012-03-01 Werner Lemberg + + [bdf] Fix Savannah bug #35656. + + * src/bdf/bdflib.c (_bdf_parse_glyphs) <_BDF_BITMAP>: Check validity + of nibble characters instead of accessing `a2i' array. + +2012-03-01 Werner Lemberg + + [winfonts] Fix Savannah bug #35659. + + * src/winfonts/winfnt.c (FNT_Face_Init): Check number of glyphs. + +2012-03-01 Werner Lemberg + + [bdf] Fix Savannah bug #35658. + + * src/bdf/bdflib.c (_bdf_list_split): Initialize `field' elements + properly. + +2012-03-01 Werner Lemberg + + [psaux] Fix Savannah bug #35657. + + If in function `skip_spaces' the routine `skip_comment' comes to the + end of buffer, `cur' is still increased by one, so we need to check + for `p >= limit' and not `p == limit'. + + * src/psaux/psconv.c (PS_Conv_Strtol, PS_Conv_ToFixed, + PS_Conv_ASCIIHexDecode, PS_Conv_EexecDecode): Fix boundary checking. + +2012-03-01 Werner Lemberg + + [truetype] Fix Savannah bug #35646. + + * src/truetype/ttinterp.c (Ins_MIRP): Typo, present since ages. The + code is now in sync with the other operators (e.g. MSIRP) which + modify twilight points. + +2012-03-01 Werner Lemberg + + [bdf] Fix Savannah bug #35643. + + * src/bdf/bdflib.c (_bdf_list_ensure): Bring code in sync with + comment before `_bdf_list_split', this is, really allocate at least + five `field' elements. + +2012-03-01 Werner Lemberg + + [bdf] Fix Savannah bug #35641. + + * src/bdf/bdflib.c (_bdf_parse_glyphs) : Abort if + _BDF_ENCODING isn't set. We need this because access to the `glyph' + variable might be undefined otherwise. + +2012-03-01 Werner Lemberg + + [truetype] Fix Savannah bug #35640. + + * src/truetype/ttinterp.c (SkipCode, TT_RunIns): Fix boundary check + for NPUSHB and NPUSHW instructions. + +2012-02-29 Werner Lemberg + + [truetype] Fix Savannah bug #35601. + + * src/truetype/ttinterp.c (Ins_SHZ): Use number of points instead of + last point for loop. + Also remove redundant boundary check. + +2012-02-29 Werner Lemberg + + [truetype] Remove redundant check. + + * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Remove redundant + second check for ordered contour start points. + +2012-02-29 Werner Lemberg + + [truetype] Make SHC instruction behave similar to MS rasterizer. + + * src/truetype/ttinterp.c (Ins_SHC): Handle virtual contour in + twilight zone. + +2012-02-29 Alexei Podtelezhnikov + + Avoid modulo operators against a power-of-two denominator. + + * src/afcjk.c (af_hint_normal_stem), src/base/ftoutln.c + (ft_contour_has), src/cff/cffgload.c (cff_decoder_parse_charstrings) + , + src/gxvalid/gxvcommn.c (GXV_32BIT_ALIGNMENT_VALIDATE), + src/gxvalid/gxvfeat.c (gxv_feat_setting_validate): Replace `%' with + `&' operator. + +2012-02-29 Werner Lemberg + + [autofit] Don't synchronize digit widths for light rendering mode. + + We don't hint horizontally in this mode. + + * src/autofit/afloader.c (af_loader_load_g) : + Implement it. + +2012-02-26 Alexei Podtelezhnikov + + [type42] Minor code optimization (again). + + * src/type42/t42parse.c (t42_parse_sfnts): Simplify previous change. + +2012-02-26 Mateusz Jurczyk + Werner Lemberg + + [smooth] Fix Savannah bug #35604. + + * src/smooth/ftsmooth.c (ft_smooth_render_generic): Use `FT_Pos' + instead of `FT_UInt' for some variables and update comparisons + accordingly. A detailed analysis can be found in the bug report. + +2012-02-26 Alexei Podtelezhnikov + + [type42] Minor code optimization. + + * src/type42/t42parse.c (t42_parse_sfnts): Use bitmask instead of + modulo operator. + +2012-02-26 Werner Lemberg + + * docs/CHANGES: Updated. + +2012-02-26 Werner Lemberg + + [type1] Fix Savannah bug #35608. + + * src/type1/t1parse.c (T1_Get_Private_Dict): Reject too short + dictionaries. + +2012-02-26 Werner Lemberg + + [bdf] Support `ENCODING -1 ' format. + + * src/bdf/bdflib.c (_bdf_parse_glyphs) : Implement it. + +2012-02-26 Werner Lemberg + + [bdf] Fix Savannah bug #35607. + + * src/bdf/bdflib.c (_bdf_parse_glyphs) : Normalize + negative encoding values. + +2012-02-26 Werner Lemberg + + [type1] Fix Savannah bug #35606. + + * src/type1/t1load.c (parse_subrs): Add proper guards for `strncmp'. + + * src/psaux/psobjs.c (ps_parser_skip_PS_token): Emit error message + only if cur < limit. + +2012-02-25 Werner Lemberg + + [pcf] Fix Savannah bug #35603. + + * src/pcf/pcfread.c (pcf_get_properties): Assure final zero byte in + `strings' array. + +2012-02-25 Werner Lemberg + + [type42] Fix Savannah bug #35602. + + * src/type42/t42parse.c (t42_parse_sfnts): Check `string_size' more + thoroughly. + +2012-02-25 Werner Lemberg + + [bdf] Fix Savannah bugs #35599 and #35600. + + * src/bdf/bdflib.c (ACMSG16): New warning message. + (_bdf_parse_glyphs) <_BDF_BITMAP>: Check line length. + +2012-02-24 Werner Lemberg + + [bdf] Fix Savannah bugs #35597 and #35598. + + * src/bdf/bdflib.c (_bdf_is_atom): Fix handling of property value. + +2012-02-24  Vinnie Falco + + Prepare source code for amalgamation (6/6). + + * src/cff/cffdrivr.c: s/Load_Glyph/cff_glyph_load/. + + * src/cid/cidload.c: s/parse_font_matrix/cid_parse_font_matrix/. + s/t1_init_loader/cid_init_loader/. + s/t1_done_loader/cid_done_loader/. + + * src/pxaux/t1cmap.c: s/t1_get_glyph_name/psaux_get_glyph_name/. + + * src/truetype/ttdriver.c: s/Load_Glyph/tt_glyph_load/. + + * src/type1/t1load.c: s/parse_font_matrix/t1_parse_font_matrix/. + +2012-02-24  Vinnie Falco + + Prepare source code for amalgamation (5/6). + + * include/freetype/fterrors.h: Undefine FT_KEEP_ERR_PREFIX after + using it. + +2012-02-22  Vinnie Falco + + Prepare source code for amalgamation (4/6). + + * src/smooth/ftgrays.c, src/raster/ftraster.c: Undefine RAS_ARG, + RAS_ARGS, RAS_VAR, and RAS_VARS before defining it. + + * src/smooth/ftgrays.c: s/TRaster/black_TRaster/, + s/PRaster/black_PRaster/. + * src/raster/ftraster.c: s/TRaster/gray_TRaster/, + s/PRaster/gray_PRaster/. + +2012-02-20  Vinnie Falco + + Prepare source code for amalgamation (3/6). + + * src/smooth/ftgrays.c: s/TWorker/black_TWorker/, + s/PWorker/black_PWorker/. + * src/raster/ftraster.c: s/TWorker/gray_TWorker/, + s/PWorker/gray_PWorker/. + +2012-02-20  Vinnie Falco + + Prepare source code for amalgamation (2/6). + + * src/smooth/ftgrays.c, src/raster/ftraster.c: Undefine FLOOR, + CEILING, TRUNC, and SCALED before defining it. + +2012-02-20  Vinnie Falco + + Prepare source code for amalgamation (1/6). + + See discussion starting at + + http://lists.gnu.org/archive/html/freetype-devel/2012-01/msg00037.html + + * src/smooth/ftgrays.c: s/TBand/gray_TBand/. + * src/raster/ftraster.c: s/TBand/black_TBand/. + +2012-02-17 Alexei Podtelezhnikov + + [autofit] Fix outline flags. + + * src/autofit/afloader.c (af_loader_load_g): Don't reassign + `outline.flags' so that this information is preserved. See + discussion starting at + + http://lists.gnu.org/archive/html/freetype-devel/2012-02/msg00046.html + +2012-02-11 Werner Lemberg + + [truetype] Fix Savannah bug #35466. + + Jump instructions are now bound to the current function. The MS + Windows rasterizer behaves the same, as confirmed by Greg Hitchcock. + + * src/truetype/ttinterp.h (TT_CallRec): Add `Cur_End' element. + * src/truetype/ttobjs.h (TT_DefRecord): Add `end' element. + + * src/truetype/ttinterp.c (DO_JROT, DO_JMPR, DO_JROF): Check upper + bound of jump address. + (Ins_FDEF, Ins_CALL, Ins_LOOPCALL, Ins_UNKNOWN, TT_RunIns): Updated. + +2012-02-11 Werner Lemberg + + We don't use `extensions'. + + * include/freetype/internal/ftobjs.h (FT_DriverRec): Remove + `extensions' field. + +2012-02-11 Werner Lemberg + + Clean up `generic' fields. + + * include/freetype/internal/ftobjs.h (FT_ModuleRec, FT_LibraryRec): + Remove `generic' field since users can't access it. + + * src/base/ftobjs.c (FT_Done_GlyphSlot): Call `generic.finalizer' as + advertised in the documentation of FT_Generic. + (Destroy_Module, FT_Done_Library): Updated to changes in `ftobjs.h'. + +2012-02-07 Werner Lemberg + + [autofit] Harmonize function arguments. + + * src/autofit/afloader.c, src/autofit/afloader.h: Use `FT_Int32' for + `load_flags'. + +2012-02-07 Werner Lemberg + + * src/cff/cffobjs.c (cff_face_init): Remove unnecessary casts. + +2012-01-17 suzuki toshiya + + [gxvalid] Fix Savannah bug #35286. + + Patch submitted by anonymous reporter. + + * src/gxvalid/gxvcommn.c (gxv_XStateTable_subtable_setup): + gxv_set_length_by_ulong_offset() must be called with 3, not 4, + the number of the subtables in the state tables; classTable, + stateArray, entryTable. + +2012-01-17 suzuki toshiya + + [raccess] Modify for PIC build. + + Based on the patch provided by Erik Dahlstrom , + http://lists.gnu.org/archive/html/freetype-devel/2012-01/msg00010.html + + Also `raccess_guess_table[]' and `raccess_rule_by_darwin_vfs()' + are renamed with `ft_' suffixes. + + * src/base/ftbase.h: `raccess_rule_by_darwin_vfs()' is renamed + to `ft_raccess_rule_by_darwin_vfs()'. + * src/base/ftobjs.c: Ditto. + + * src/base/ftrfork.c: Declarations of FT_RFork_Rule, + raccess_guess_rec, are moved to... + * include/freetype/internal/ftrfork.h: Here. + + * include/freetype/internal/ftrfork.h: + FT_RFORK_RULE_ARRAY_{BEGIN,ENTRY,END} macros are defined + to replace raccess_guess_table[] in both of PIC and non-PIC + modes. + * src/base/ftrfork.c: raccess_guess_table[] array is rewritten + by FT_RFORK_RULE_ARRAY_{BEGIN,ENTRY,END}. + + * src/base/basepic.h (BasePIC): Add `ft_raccess_guess_table' + storage. (FT_RACCESS_GUESS_TABLE_GET): New macro to retrieve + the function pointer from `ft_raccess_guess_table' storage in + `BasePIC' structure. + * src/base/ftrfork.c (FT_Raccess_Guess): Rewritten with + FT_RACCESS_GUESS_TABLE_GET. + (raccess_get_rule_type_from_rule_index): Add `library' as the + first argument to the function, to retrieve the storage of + `ft_raccess_guess_table' from it. Also `raccess_guess_table' + is replaced by FT_RACCESS_GUESS_TABLE_GET. + (ft_raccess_rule_by_darwin_vfs): Ditto. + +2012-01-16 suzuki toshiya + + Remove trailing spaces. + +2012-01-16 suzuki toshiya + + Formatting PIC related sources. + + * src/autofit/afpic.c: Harmonize to FT2 coding conventions. + * src/base/basepic.c: Ditto. + * src/base/ftpic.c: Ditto. + * src/cff/cffpic.c: Ditto. + * src/pshinter/pshpic.c: Ditto. + * src/psnames/pspic.c: Ditto. + * src/raster/rastpic.c: Ditto. + * src/sfnt/sfntpic.c: Ditto. + * src/smooth/ftspic.c: Ditto. + * src/truetype/ttpic.c: Ditto. + +2012-01-16 suzuki toshiya + + [autofit] Fix the inclusion of `aflatin2.h' in PIC file. + + * src/autofit/afpic.c: Include `aflatin2.h' when + FT_OPTION_AUTOFIT2 is defined, as afglobal.c does so. + Unconditionally inclusion causes declared but unimplemented + warning by GCC 4.6. + +2012-01-16 suzuki toshiya + + [cff] Remove redundant declarations of cff_cmap_XXX_class_rec. + + * src/cff/cffpic.c: The declarations of + FT_Init_Class_cff_cmap_encoding_class_rec() and + FT_Init_Class_cff_cmap_unicode_class_rec() are removed. + They can be obtained by the inclusion of cffcmap.h. + cffcmap.h invokes FT_DECLARE_CMAP_CLASS() and it declares + FT_Init_Class_cff_cmap_encoding_class_rec() etc in PIC mode. + +2012-01-15 suzuki toshiya + + Fix redundant declaration warning in PIC mode. + + Originally FT_DEFINE_{DRIVER,MODULE,RENDERER}() macros were + designed to declare xxx_pic_{free,init} by themselves. + Because these macros are used at the end of the module + interface (e.g. ttdriver.c) and the wrapper source to build + a module as a single object (e.g. truetype.c) includes + the PIC file (e.g. ttpic.c) before the module interface, + these macros are expanded AFTER xxx_pic_{free,init} body + when the modules are built as single object. + The declaration after the implementation causes the redundant + declaration warnings, so the declarations are moved to module + PIC headers (e.g. ttpic.h). Separating to other header files + are needed for multi build. + + * include/freetype/internal/ftdriver.h (FT_DEFINE_DRIVER): + Remove class_##_pic_free and class_##_pic_init declarations. + * include/freetype/internal/ftobjs.h (FT_DEFINE_RENDERER, + FT_DEFINE_MODULE): Ditto. + + * src/base/basepic.h: Insert a comment and fix coding style. + * src/autofit/afpic.h: Declare autofit_module_class_pic_{free, + init}. + * src/cff/cffpic.h: Declare cff_driver_class_pic_{free,init}. + * src/pshinter/pshpic.h: Declare pshinter_module_class_pic_{free, + init}. + * src/psnames/pspic.h: Declare psnames_module_class_pic_{free, + init}. + * src/raster/rastpic.h: Declare + ft_raster{1,5}_renderer_class_pic_{free,init} + * src/sfnt/sfntpic.h: Declare sfnt_module_class_pic_{free,init}. + * src/smooth/ftspic.h: Declare + ft_smooth_{,lcd_,lcdv_}renderer_class_pic_{free,init}. + * src/truetype/ttpic.h: Declare tt_driver_class_pic_{free,init}. + +2012-01-15 suzuki toshiya + + Make pspic.c to include module error header to fix multi build. + + * src/psnames/pspic.c: Include `psnamerr.h'. + +2012-01-14 suzuki toshiya + + [base] Fix a dereference of uninitialized variable in PIC mode. + + * src/base/ftglyph.c (FT_Glyph_To_Bitmap): `glyph' must be + set before derefering to obtain `library'. The initialization + of `clazz', `glyph', `library' and NULL pointer check are + reordered to minimize PIC conditonals. + +2012-01-14 suzuki toshiya + + [base] Insert explicit cast for GCC 4.6 in PIC mode. + + * src/base/ftinit.c (FT_Add_Default_Modules): Under PIC + configuration, FT_DEFAULT_MODULES_GET returns + FT_Module_Class** pointer, GCC 4.6 warns that + const FT_Module_Class* const* variable is warned as + inappropriate to store it. To calm it, explicit cast is + inserted. Also `library' is checked to prevent the NULL + pointer dereference in FT_DEFAULT_MODULES_GET. + +2012-01-13 suzuki toshiya + + Fix PIC build broken by d9145241fe378104ba4c12a42534549faacc92e6. + + Under PIC configuration, FT_{CFF,PSCMAPS,SFNT,TT}_SERVICES_GET + take no arguments but derefer the variable named `library' + internally. + + * src/cff/cffdrivr.c (cff_get_interface): Declare `library' and + set it if non-NULL driver is passed. + * src/truetype/ttdriver.c (tt_get_interface): Ditto. + + * src/sfnt/sfdriver.c (sfnt_get_interface): Declare `library' + under PIC configuration, and set it if non-NULL module is given. + * src/psnames/psmodule.c (psnames_get_interface): Ditto. + +2012-01-13 suzuki toshiya + + Make PIC files include module error headers, to use the error codes + with per-module prefix. + + * src/autofit/afpic.c: Include `aferrors.h'. + * src/cff/cffpic.c: Include `cfferrs.h'. + * src/pshinter/pshpic.c: Include `pshnterr.h'. + * src/raster/rastpic.c: Include `rasterrs.h'. + * src/sfnt/sfntpic.c: Include `sferrors.h'. + * src/smooth/ftspic.c: Include `ftsmerrs.h'. + * src/truetype/ttpic.c: Include `tterrors.h'. + +2012-01-04 Tobias Ringström + + [truetype] Fix IP instruction if x_ppem != y_ppem. + + * src/truetype/ttinterp.c (Ins_IP): Scale `orus' coordinates + properly. + +2012-01-02 Werner Lemberg + + Fix tracing message for `loca' table. + + * src/truetype/ttpload.c (tt_face_get_location): Don't emit a + warning message if the last `loca' entry references an empty glyph. + +2011-12-10 Werner Lemberg + + Add some variable initializations. + Reported by Richard COOK . + + * src/type1/t1driver.c (t1_ps_get_font_value): Initialize `val'. + * src/smooth/ftgrays.c (gray_render_conic): Initialize `levels' + earlier. + +2011-12-08 Werner Lemberg + + Fix serious scaling bug in `FT_Get_Advances'. + + * src/base/ftadvanc.c (FT_Get_Advances): Advance values returned by + `FT_Load_Glyph' must be simply multiplied by 1024. + +2011-12-08 Werner Lemberg + + * src/bdf/bdflib.c (_bdf_parse_start): Drop redundant error tracing. + +2011-12-02 suzuki toshiya + + [mac] Unify DARWIN_NO_CARBON with FT_MACINTOSH. + + Originally FT_MACINTOSH was a pure auto macro and DARWIN_NO_CARBON + was a configurable macro to disable Carbon-dependent code. Because + now configure script sets DARWIN_NO_CARBON by default and disables + Darwin & Carbon-dependent codes, these macros can be unified. + FT_MACINTOSH (undefined by default) is kept and DARWIN_NO_CARBON + (defined by default) is removed, because DARWIN_NO_CARBON violates + FT_XXX naming convention of public macros, and a macro configured by + default is not portable for the building without configure (e.g. + make devel). + + * builds/unix/configure.raw: Define FT_MACINTOSH if Carbon-based + old Mac font support is requested and Carbon is available. + * builds/unix/ftconfig.in: Undefine FT_MACINTOSH when the support + for Mac OS X without Carbon (e.g. Mac OS X 10.4 for ppc64) is + requested. + * include/freetype/config/ftconfig.in: Ditto. + * builds/vms/ftconfig.h: Ditto. + + * src/base/ftbase.h: Remove DARWIN_NO_CARBON. + * src/base/ftbase.c: Ditto. + * src/base/ftobjs.c: Ditto. + * src/base/ftrfork.c: Ditto. + + * src/base/ftmac.c: Compile the body if FT_MACINTOSH is defined + (same with TT_USE_BYTECODE_INTERPRETER in ttinterp.c). + * builds/mac/ftmac.c: Ditto. + + * builds/mac/FreeType.m68k_cfm.make.txt: Define FT_MACINTOSH. + * builds/mac/FreeType.m68k_far.make.txt: Ditto. + * builds/mac/FreeType.ppc_classic.make.txt: Ditto. + * builds/mac/FreeType.ppc_carbon.make.txt: Ditto. + +2011-11-30 suzuki toshiya + + Fix Savannah bug #34728 (`make devel' on Mac OS X). + + * builds/toplevel.mk: Check `/dev/null' to identify the Unix- + like systems without `init' nor `hurd' (e.g. Mac OS X >= 10.4). + * builds/unix/detect.mk: Ditto. + +2011-11-30 suzuki toshiya + + [apinames] Fix the overflow of signed integer hash. + + * src/tools/apinames.c (names_add): Change the type of `h' from + int to unsigned int, to prevent undefined behaviour in the + overflow of signed integers (overflow of unsigned int is defined + to be wrap around). Found by clang test suggested by Sean + McBride. + +2011-11-30 Werner Lemberg + + [winfonts] Remove casts. + + * src/winfonts/winfnt.c (winfnt_driver_class): Remove all casts and + update affected functions. + (FNT_Size_Select): Fix number of arguments. + +2011-11-30 Werner Lemberg + + [type42] Remove casts. + + * src/type42/t42driver.c (t42_driver_class): Remove all casts and + update affected functions. + + * src/type42/t42objs.c, src/type42/t42objs.h: Updated for t42driver + changes. + +2011-11-30 Werner Lemberg + + [type1] Remove casts. + + * src/type1/t1driver.c (t1_driver_class): Remove all casts and + update affected functions. + + * src/type1/t1gload.c, src/type1/t1gload.h, src/type1/t1objs.c: + Updated for t1driver changes. + src/type1/t1objs.h (T1_Driver): Remove unused typedef. + Updated for t1driver changes. + +2011-11-27 Werner Lemberg + + [bdf] Fix Savannah bug #34896. + + ENCODING now covers the whole Unicode range. + + Note, however, that this change is quite expensive since it + increases the size of three arrays by almost 400kByte in total. The + right fix is to replace the logic with something smarter. + Additionally, there exist very old BDFs for three-byte CCCII + encoding which exceeds the range of Unicode (another reason to have + a smarter logic). + + * src/bdf/bdf.h (bdf_font_t): Increase size of `nmod' and `umod' + arrays. + * src/bdf/bdflib.c (bdf_parse_t): Increase size of `have' array. + +2011-11-27 Werner Lemberg + + [bdf] Improve tracing. + + * src/bdf/bdflib.c (DBGMSG1, DBGMSG2): New macros. + (_bdf_parse_glyphs): Use them. + +2011-11-26 Werner Lemberg + + Improve tracing. + + * src/bdf/bdfdrivr.c (BDF_Face_Done), src/pcf/pcfdrivr.c + (PCF_Face_Done): Remove tracing message. + + * src/bdf/bdfdrivr.c (BDF_Face_Init), src/cff/cffobjs.c + (cff_face_init), src/cid/cidobjs.c (cid_face_init), + src/pfr/pfrobjs.c (pfr_face_init), src/sfnt/sfobjs.c + (sfnt_init_face), src/truetype/ttobjs.c (tt_face_init), + src/type1/t1objs.c (T1_Face_Init), src/type42/t42objs.c + (T42_Face_Init), src/winfonts/winfnt.c (FNT_Face_Init): Add + `greeting' message. + + * src/sfnt/sfobjs.c (sfnt_open_font), src/type42/t42objs.c + (T42_Open_Face): Improve tracing. + +2011-11-26 Werner Lemberg + + [cid] Fix error code. + + * src/cid/cidparse.c (cid_parser_new): Do it. + +2011-11-26 Werner Lemberg + + [cff] Fix error code. + + * src/cff/cffload.c (cff_font_load): Do it. + +2011-11-26 Werner Lemberg + + Add new error code FT_Err_Missing_Module. + + Previously, FreeType misleadingly returned + FT_Err_Unknown_File_Format if a module was missing (or a test was + missing completely). + + * include/freetype/fterrdef.h (FT_Err_Missing_Module): Define. + + * src/cff/cffobjs.c (cff_face_init), src/cff/cffdrivr.c + (cff_get_glyph_name), src/cid/cidobjs.c (cid_face_init), + src/sfnt/sfobjs.c (sfnt_init_face), src/truetype/ttobjs.c + (tt_face_init), src/type1/t1objs.c (T1_Face_Init), + src/type42/t42objs.c (T42_Face_Init, T42_Driver_Init): Updated. + + * src/type1/t1afm.c (T1_Read_Metrics), src/type/t1objs.c + (T1_Face_Init), src/type42/t42objs.c (T42_Face_Init): Remove now + redundant test for `psaux'. + +2011-11-25 Werner Lemberg + + [bdf] Add more error messages. + + * src/bdf/bdflib.c (_bdf_set_default_spacing, _bdf_add_property): + Add line number argument. + Update all callers. + (ERRMSG5, ERRMSG6, ERRMSG7, ERRMSG8, ERRMSG9): New macros. + (_bdf_readstream, _bdf_set_default_spacing, _bdf_add_property, + _bdf_parse_glyphs, _bdf_parse_start): Add error messages. + +2011-11-24 Werner Lemberg + + * include/freetype/fterrors.h: Remove dead code. + +2011-11-15 Werner Lemberg + + * docs/releases: Updated. + +2011-11-15 Werner Lemberg + + * Version 2.4.8 released. + ========================= + + + Tag sources with `VER-2-4-8'. + + * docs/CHANGES: Updated. + + * docs/VERSION.DLL: Update documentation and bump version number to + 2.4.8. + + * README, Jamfile (RefDoc), + builds/win32/vc2005/freetype.vcproj, builds/win32/vc2005/index.html, + builds/win32/vc2008/freetype.vcproj, builds/win32/vc2008/index.html, + builds/win32/vc2010/freetype.vcxproj, builds/win32/vc2010/index.html, + builds/win32/visualc/freetype.dsp, + builds/win32/visualc/freetype.vcproj, + builds/win32/visualc/index.html, builds/win32/visualce/freetype.dsp, + builds/win32/visualce/freetype.vcproj, + builds/win32/visualce/index.html, + builds/wince/vc2005-ce/freetype.vcproj, + builds/wince/vc2005-ce/index.html, + builds/wince/vc2008-ce/freetype.vcproj, + builds/wince/vc2008-ce/index.html: s/2.4.7/2.4.8/, s/247/248/. + + * include/freetype/freetype.h (FREETYPE_PATCH): Set to 8. + + * builds/unix/configure.raw (version_info): Set to 14:0:8. + +2011-11-13 Chris Liddell + + Add FT_Get_PS_Font_Value() API. + + This allows a Type 1 font face to be interrogated to retrieve most + of the dictionary keys (keys not relevant to FreeType's Type 1 + interpreter are not available). + + * include/freetype/internal/services/svpsinfo.h + (PS_GetFontValueFunc): New typedef. + (PSInfo): Add `ps_get_font_value'. + (FT_DEFINE_SERVICE_PSINFOREC): Updated. + + * include/freetype/internal/t1types.h (T1_EncodingType): Moved to... + * include/freetype/t1tables.h: Here. + (PS_Dict_Keys): New enumeration. + (FT_Get_PS_Font_Value): New declaration. + + * src/base/fttype1.c (FT_Get_PS_Font_Value): New function. + + * src/type1/t1driver.c (t1_ps_get_font_value): This new function + does the real job. + (t1_service_ps_info): Add it. + + * src/cff/cffdrivr.c (cff_service_ps_info), src/cid/cidriver.c + (cid_service_ps_info), src/type42/t42drivr.c (t42_service_ps_info): + Updated. + +2011-11-08 Braden Thomas + + [cid] Various loading fixes. + + * src/cid/cidload.c (cid_load_keyword) , + (parse_font_matrix, parse_expansion_factor): Correctly check number + of dictionaries. + (cid_read_subrs): Protect against invalid values of `num_subrs'. + Assure that the elements of the `offsets' array are ascending. + +2011-11-05 Werner Lemberg + + * README: We use copyright ranges also. + + According to + + http://www.gnu.org/prep/maintain/html_node/Copyright-Notices.html + + this should be mentioned explicitly. + +2011-10-30 suzuki toshiya + + [raccess] Supplement for previous fix. + + * src/base/ftbase.h (raccess_rule_by_darwin_vfs): Do not declare + it on native Mac OS X. + * src/base/ftrfork.c (raccess_get_rule_type_from_rule_index): + Hide raccess_get_rule_type_from_rule_index() on native Mac OS X + too. + +2011-10-30 suzuki toshiya + + [raccess] Hide raccess_rule_by_darwin_vfs() on native Mac OS X. + + * src/base/ftrfork.c (raccess_rule_by_darwin_vfs): Do not + compile on native Mac OS X because it is not used. + +2011-10-25 Werner Lemberg + + [truetype] Fix MD instruction for twilight zone. + + * src/truetype/ttinterp.c (Ins_MD): Without this fix, the MD + instruction applied to original coordinates of twilight points + always returns zero. + +2011-10-18 Werner Lemberg + + * Version 2.4.7 released. + ========================= + + + Tag sources with `VER-2-4-7'. + + * docs/CHANGES: Updated. + + * docs/VERSION.DLL: Update documentation and bump version number to + 2.4.7. + + * README, Jamfile (RefDoc), + builds/win32/vc2005/freetype.vcproj, builds/win32/vc2005/index.html, + builds/win32/vc2008/freetype.vcproj, builds/win32/vc2008/index.html, + builds/win32/vc2010/freetype.vcxproj, builds/win32/vc2010/index.html, + builds/win32/visualc/freetype.dsp, + builds/win32/visualc/freetype.vcproj, + builds/win32/visualc/index.html, builds/win32/visualce/freetype.dsp, + builds/win32/visualce/freetype.vcproj, + builds/win32/visualce/index.html, + builds/wince/vc2005-ce/freetype.vcproj, + builds/wince/vc2005-ce/index.html, + builds/wince/vc2008-ce/freetype.vcproj, + builds/wince/vc2008-ce/index.html: s/2.4.6/2.4.7/, s/246/247/. + + * include/freetype/freetype.h (FREETYPE_PATCH): Set to 7. + + * builds/unix/configure.raw (version_info): Set to 13:2:7. + +2011-10-15 Kal Conley + + Fix handling of transformations if no renderer is present. + + * src/base/ftobjs.c (FT_Load_Glyph): Thinko. + +2011-10-15 Kal Conley + + Fix conditions for autohinting. + + * src/base/ftobjs.c (FT_Load_Glyph): Handle + FT_LOAD_IGNORE_TRANSFORM. + +2011-10-07 suzuki toshiya + + [gxvalid] Fix a bug to detect too large offset in morx table. + + * src/gxvalid/gxvmorx2.c + (gxv_morx_subtable_type2_ligActionIndex_validate): Fix a bug + that too large positive offset cannot be detected. + +2011-10-01 Braden Thomas + + Handle some border cases. + + * include/freetype/config/ftstdlib.h (FT_USHORT_MAX): New macro. + + * src/base/ftbitmap.c (FT_Bitmap_Convert): Protect against invalid + value of `target->rows'. + + * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Add check for + flex start. + + * src/raster/ftrend1.c (ft_raster1_render): Check `width' and + `height'. + + * src/truetype/ttgxvar.c (TT_Vary_Get_Glyph_Deltas): Protect against + invalid values in `localpoints' array. + +2011-10-01 Werner Lemberg + + [psnames] Handle zapfdingbats. + Problem reported by Nicolas Rougier . + + * src/tools/glnames.py (adobe_glyph_list): Add data from AGL's + `zapfdingbats.txt' file. + + * src/psnames/pstables.h: Regenerated. + +2011-09-27 Simon Bünzli + + Fix Savannah bug #34189. + + * src/type1/t1load.c (T1_Open_Face): Initialize + `face->len_buildchar'. + +2011-09-26 Werner Lemberg + + [cff] Dump SIDs while tracing. + + * src/cff/cffobjs.c (cff_face_init): Do it. + + * src/cff/cffparse.c (cff_parser_run) [FT_DEBUG_LEVEL_TRACE] + : Identify as SID. + +2011-09-17 Werner Lemberg + + Remove unused FT_ALIGNMENT macro. + + * builds/unix/ftconfig.in, builds/vms/ftconfig.h, + include/freetype/config/ftconfig.h: Do it. + +2011-09-17 Alexei Podtelezhnikov + + [smooth] Slightly optimize conic and cubic flatterners. + + * src/smooth/ftgrays.c (gray_render_conic, gray_render_cubic): Move + out some code from the main loop to speed it up. + +2011-09-11 Tomas Hoger + + Slightly improve LZW_CLEAR handling. + + * src/lzw/ftzopen.c (ft_lzwstate_io) : + Ensure that subsequent (modulo garbage byte(s)) LZW_CLEAR codes are + handled as clear codes. This also re-sets old_code and old_char to + predictable values, which is a little better than using `random' + ones if the code following LZW_CLEAR is invalid. + +2011-09-11 Tomas Hoger + + Add explicit LZW decompression stack size limit. + + Stack larger than 1<prefix[code - 256] + when traversing prefix table. Such check is less efficient and + should not be required if prefix table is constructed correctly in + the first place. + + * src/lzw/ftzopen.c (ft_lzwstate_stack_grow): Implement it. + +2011-09-11 Tomas Hoger + + Protect against loops in the prefix table. + + LZW decompressor did not sufficiently check codes read from the + input LZW stream. A specially-crafted or corrupted input could + create a loop in the prefix table, which leads to memory usage + spikes, as there's no decompression stack size limit. + + * src/lzw/ftzopen.c (ft_lzwstate_io) : First + code in valid LZW stream must be 0..255. + : In the special KwKwK case, code == free_ent, + code > free_ent is invalid. + +2011-09-09 Werner Lemberg + + Better tracing of metrics. + + * src/base/ftobjs.c (FT_Request_Size, FT_Select_Size): Decorate with + FT_TRACE. + +2011-09-07 Werner Lemberg + + Fix Savannah bug #33816. + + * src/cff/cfftypes.h (CFF_FontRecDictRec): New member + `has_font_matrix'. + * src/cff/cffparse.c (cff_parse_font_matrix): Set it. + Update tracing output. + * src/cff/cffobjs.c (cff_face_init): Use it so that the heuristics + can be removed. + +2011-08-30 Werner Lemberg + + Better tracing of metrics. + + * src/base/ftobjs.c (FT_Select_Metrics, FT_Request_Metrics): + Decorate with FT_TRACE. + +2011-08-25 Werner Lemberg + + [cff] Better tracing of the parsing process. + + * src/cff/cffload.c (cff_subfont_load, cff_font_load): Decorate with + FT_TRACE. + + * src/cff/cffparse.c (cff_parse_font_matrix, cff_parse_font_bbox, + cff_parse_private_dict, cff_parse_cid_ros): Updated. + (CFF_FIELD_NUM, CFF_FIELD_FIXED, CFF_FIELD_FIXED_1000, + CFF_FIELD_STRING, CFF_FIELD_BOOL, CFF_FIELD_CALLBACK, CFF_FIELD, + CFF_FIELD_DELTA): Add argument for ID. + (cff_parser_run): Decorate with FT_TRACE. + + * src/cff/cffparse.h (CFF_Field_Handler) [FT_DEBUG_LEVEL_TRACE]: Add + `id' member. + + * src/cff/cfftoken.h: Add IDs to all fields. + +2011-08-16 Werner Lemberg + + Fix Savannah bug #34022. + + * README, docs/INSTALL: Remove references to UPGRADE.UNIX. + +2011-08-15 Werner Lemberg + + Fix Savannah bug #34018. + + * docs/UPGRADE.UNIX: Removed. Obsolete. + +2011-08-15 David Bevan + + Fix Savannah bug #33992. + + * src/base/ftstroke.c (FT_Stroker_ParseOutline): Fix border case. + +2011-08-12 Werner Lemberg + + Fix Savannah bug #33975. + + * src/cff/cffparse.c (cff_parse_font_matrix): Fix typo. + +2011-07-29 Werner Lemberg + + * Version 2.4.6 released. + ========================= + + + Tag sources with `VER-2-4-6'. + + * docs/CHANGES: Updated. + + * docs/VERSION.DLL: Update documentation and bump version number to + 2.4.6. + + * README, Jamfile (RefDoc), + builds/win32/vc2005/freetype.vcproj, builds/win32/vc2005/index.html, + builds/win32/vc2008/freetype.vcproj, builds/win32/vc2008/index.html, + builds/win32/vc2010/freetype.vcxproj, builds/win32/vc2010/index.html, + builds/win32/visualc/freetype.dsp, + builds/win32/visualc/freetype.vcproj, + builds/win32/visualc/index.html, builds/win32/visualce/freetype.dsp, + builds/win32/visualce/freetype.vcproj, + builds/win32/visualce/index.html, + builds/wince/vc2005-ce/freetype.vcproj, + builds/wince/vc2005-ce/index.html, + builds/wince/vc2008-ce/freetype.vcproj, + builds/wince/vc2008-ce/index.html: s/2.4.5/2.4.6/, s/245/246/. + + * include/freetype/freetype.h (FREETYPE_PATCH): Set to 6. + + * builds/unix/configure.raw (version_info): Set to 13:1:7. + +2011-07-29 Werner Lemberg + + [cff] Add some more tracing infos. + + * src/cff/cffparse.c (cff_parse_font_matrix, cff_parse_font_bbox, + cff_parse_cid_ros): Add tracing. + +2011-07-22 Dirk Müller + + [psaux, type1] Fix null pointer dereferences. + + Found with font fuzzying. + + * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Check + `decoder->buildchar'. + + * src/type1/t1load.c (t1_load_keyword): Check `blend->num_designs'. + +2011-07-20 Chris Morgan + + Add FT_CONFIG_OPTION_DISABLE_STREAM_SUPPORT. + + Useful for embedded systems which don't need file stream support. + + * src/base/ftsystem.c, src/base/ftobjs.c (FT_Stream_New): Implement + it. + +2011-07-20 Elton Chung + + * src/base/ftpatent.c (FT_Face_SetUnpatentedHinting): Fix typo. + +2011-07-16 Steven Chu + + [truetype] Fix metrics on size request for scalable fonts. + + * src/truetype/ttdriver.c (tt_size_request): Fix copying metrics + from TT_Size to FT_Size if scalable font. + + See + + http://lists.gnu.org/archive/html/freetype-devel/2011-07/msg00049.html + + for some comparison images. + +2011-07-14 Matthias Drochner . + + [psaux] Fix potential sign extension problems. + + When shifting right a signed value, it is not defined by the + C standard whether one gets a sign extension or not. Use a macro to + do an explicit cast from a signed short (assuming that this is + 16bit) to an int. + + * src/psaux/t1decode.c (Fix2Int): New macro. + Use it where appropriate. + +2011-07-14 Werner Lemberg + + * src/psaux/t1decode.c (t1_decoder_parse_charstrings) + : Better handling of subroutine index 0. + From Matthias Drochner . + +2011-07-10 ÐлекÑей Подтележников + + [psaux] Optimize previous commit. + + * src/psaux/t1decode.c (t1_decoder_parse_charstrings) + : Move error check down to avoid testing twice for + good cases. + +2011-07-08 Werner Lemberg + + [psaux] Add better argument check for `callothersubr'. + + * src/psaux/t1decode.c (t1_decoder_parse_charstrings) + : Reject negative arguments. + +2011-07-07 Werner Lemberg + + [sfnt] Try harder to find non-zero values for ascender and descender. + + * src/sfnt/sfobjs.c (sfnt_load_face): Consult `OS/2' table in case + the `hhea' table's values are zero. + +2011-07-03 Werner Lemberg + + Fix previous commit. + + We want to unset FT_FACE_FLAG_SCALABLE only if there are bitmap + strikes in the font. + + * src/truetype/ttobjs.c (tt_face_init): Implement it. + + * docs/CHANGES: Updated. + +2011-07-02 Just Fill Bugs + + Fix Savannah bug #33246. + + * src/truetype/ttobjs.c (tt_check_single_notdef): New function. + (tt_face_init): Use it to test FT_FACE_FLAG_SCALABLE. + +2011-07-02 Werner Lemberg + + * docs/CHANGES: Updated. + +2011-07-02 David Bevan + + [ftstroke] Major revision. + + The main problems + ----------------- + + o If FT_STROKER_LINEJOIN_BEVEL was specified, unlimited miter + joins (not bevel joins) were generated. Indeed, the meanings of + `miter' and `bevel' were incorrectly reversed (consistently) in + both the code and comments. + + o The way bevel joins were constructed (whether specified + explicitly, or created as a result of exceeding the miter limit) + did not match what is required for stroked text in PostScript or + PDF. + + The main fixes + -------------- + + o The behaviour of FT_STROKER_LINEJOIN_BEVEL has been corrected. + + o A new line join style, FT_STROKER_LINEJOIN_MITER_FIXED, has been + introduced to support PostScript and PDF miter joins. + + o FT_STROKER_LINEJOIN_MITER_VARIABLE has been introduced as an + alias for FT_STROKER_LINEJOIN_MITER. + + Additionally, a variety of stroking errors have been fixed. These + would cause various artifacts (including points `at infinity'), + especially when stroking poor quality fonts. + + See + + http://lists.gnu.org/archive/html/freetype-devel/2011-07/msg00001.html + + for example documents. The FreeType stroker now produces results + very similar to that produced by GhostScript and Distiller for these + fonts. + + Other problems + -------------- + + The following problems have been resolved: + + o Inside corners could be generated incorrectly. Intersecting the + inside corner could cause a missing triangular area and other + effects. + + The intersection point can only be used if the join is between + two lines and both lines are long enough. The `optimization' + condition in `ft_stroker_inside' has been corrected; this + requires the line length to be passed into various functions and + stored in `FT_StrokerRec'. + + o Incorrect cubic curves could be generated. The angle + calculations in `FT_Stroker_CubicTo' have been corrected to + handle the case of the curve crossing the +/-PI direction. + + o If the border radius was greater than the radius of curvature of + a curve, then the negative sector would end up outside (not + inside) the border. This situation is now recognized and the + negative sector is circumnavigated in the opposite direction. + (If round line joins are being used, this code is disabled + because the line join will always cover the negative sector.) + + o When a curve is split, the arcs may not join smoothly (especially + if the curve turns sharply back on itself). Changes in + direction between adjacent arcs were not handled. A round + corner is now added if the deviation from one arc to the next is + greater than a suitable threshold. + + o The current direction wasn't retained if a the outline contained + a zero length lineto or a curve that was determined to be + `basically a point'. This could cause a spurious join to be + added. + + o Cubics with close control points could be mishandled. All eight + cases are now distinguished correctly. + + Other improvements + ------------------ + + o Borders for cubic curves could be too `flat'. + FT_SMALL_CUBIC_THRESHOLD has been reduced a little to prevent + this. + + o The handling and use of movable points has been simplified a + little. + + o Various values are now computed only if the results are actually + needed. + + o The directions of the outer and inner borders have been swapped, + as recommended by Graham Asher. + + * src/base/ftstroke.c: Revised. + * include/freetype/ftstroke.h: Updated. + +2011-06-30 Ä°smail Dönmez + + * builds/toplevel.mk: We use git, not CVS, thus skip `.gitignore'. + +2011-06-29 Werner Lemberg + + Fix Savannah bug #33663. + + * src/bdf/bdflib.c (_bdf_parse_glyphs): Handle negative values for + ENCODING correctly. + + * docs/CHANGES: Document it. + +2011-06-24 Werner Lemberg + + * Version 2.4.5 released. + ========================= + + + Tag sources with `VER-2-4-5'. + + * docs/CHANGES: Updated. + + * docs/VERSION.DLL: Update documentation and bump version number to + 2.4.5 + + * README, Jamfile (RefDoc), + builds/win32/vc2005/freetype.vcproj, builds/win32/vc2005/index.html, + builds/win32/vc2008/freetype.vcproj, builds/win32/vc2008/index.html, + builds/win32/vc2010/freetype.vcxproj, builds/win32/vc2010/index.html, + builds/win32/visualc/freetype.dsp, + builds/win32/visualc/freetype.vcproj, + builds/win32/visualc/index.html, builds/win32/visualce/freetype.dsp, + builds/win32/visualce/freetype.vcproj, + builds/win32/visualce/index.html, + builds/wince/vc2005-ce/freetype.vcproj, + builds/wince/vc2005-ce/index.html, + builds/wince/vc2008-ce/freetype.vcproj, + builds/wince/vc2008-ce/index.html: s/2.4.4/2.4.5/, s/244/245/. + + * include/freetype/freetype.h (FREETYPE_PATCH): Set to 5. + + * builds/unix/configure.raw (version_info): Set to 13:0:7. + +2011-06-20 Werner Lemberg + + * src/autofit/aflatin.c (af_latin_metrics_scale_dim): Fix change + from 2011-05-04. + +2011-06-19 suzuki toshiya + + [gxvalid] make the `prop' validation tracing verbose. + + * src/gxvalid/gxvprop.c: Add tracing messages for errors. + +2011-06-19 suzuki toshiya + + [autogen.sh] Reflect environment variable LIBTOOLIZE. + +2011-06-18 Werner Lemberg + + Update license documentation. + + * docs/GPL.TXT: Renamed to... + * docs/GPLv2.TXT: This. + + * docs/LICENSE.TXT: Updated. + +2011-06-14 suzuki toshiya + + Fix g++4.6 compiler warnings in module drivers. + + The background is same with previous commit. + + * src/truetype/ttgxvar.c (ft_var_readpackedpoints): + Init `points'. (TT_Vary_Get_Glyph_Deltas): Init + `delta_xy'. (TT_Get_MM_Var): Init `mmvar'. + * src/type1/t1load.c (T1_Get_MM_Var): Ditto. + * src/cff/cffdrivr.c (cff_ps_get_font_info): Init + `font_info'. + * src/cff/cffload.c (cff_index_get_pointers): Init `t'. + (cff_font_load): Init `sub'. + * src/cff/cffobjs.c (cff_size_init): Init `internal'. + (cff_face_init): Init `cff'. + * src/pfr/pfrload.c (pfr_extra_item_load_stem_snaps): + Init `snaps'. + * src/pcf/pcfread.c (pcf_get_properties): Init `properties'. + (pcf_get_bitmaps): Init `offsets'. (pcf_get_encodings): + Init `tmpEncoding'. + * src/sfnt/ttload.c (tt_face_load_gasp): Init `gaspranges'. + * src/sfnt/ttsbit.c (Load_SBit_Image): Init `components'. + * src/cache/ftcmru.c (FTC_MruList_New): Init `node'. + * src/gzip/ftgzip.c (FT_Stream_OpenGzip): Init `zip' and + `zip_buff'. + * src/lzw/ftlzw.c (FT_Stream_OpenLZW): Init `zip'. + * src/bzip2/ftbzip2.c (FT_Stream_OpenBzip2): Init `zip'. + +2011-06-14 suzuki toshiya + + [base] Fix g++4.6 compiler warnings in src/base/*.c. + + Passing uninitialized pointer to FT_NEW() families is + not problematic theoretically (as far as the returned + pointer is checked before writing), but g++4.6 dislikes + it and warns by -Wuninitialized. Initialize them by NULL. + + * src/base/ftobjs.c (FT_Stream_New): Init `stream'. + (new_memory_stream): Ditto. + (FT_New_GlyphSlot): Init `slot'. + (FT_CMap_New): Init `cmap'. + (open_face_PS_from_sfnt_stream): Init `sfnt_ps'. + (Mac_Read_POST_Resource): Init `pfb_data'. + (Mac_Read_sfnt_Resource): Init `sfnt_data'. + * src/base/ftrfork.c (FT_Raccess_Get_DataOffsets): + Init `offsets_internal' and `ref'. + (raccess_guess_darwin_hfsplus): Init `newpath'. + (raccess_guess_darwin_newvfs): Ditto. + * src/base/ftbitmap.c (ft_bitmap_assure_buffer): + Init `buffer'. + * src/base/ftstroke.c (FT_Stroker_New): Init `stroker'. + +2011-06-14 suzuki toshiya + + [gxvalid] Cleanup. + + Some invalid, overrunning, unrecommended non-zero values + are cared in paranoid validation mode only. There are + many lines looking like: + + if ( valid->root->level >= FT_VALIDATE_PARANOID ) + FT_INVALID_xxx; + + To simplify them, GXV_SET_ERR_IF_PARANOID( err ) is + introduced for more paranoid validation in future. + + * src/gxvalid/gxvcommn.h (IS_PARANOID_VALIDATION): + New macro to assure valid->root->level is more or + equal to FT_VALIDATE_PARANOID. (GXV_SET_ERR_IF_PARANOID): + New macro to raise an error if in paranoid validation. + * src/gxvalid/gxvcommn.c: Use GXV_SET_ERR_IF_PARANOID(). + * src/gxvalid/gxvfeat.c: Ditto. + * src/gxvalid/gxvjust.c: Ditto. + * src/gxvalid/gxvkern.c: Ditto. + * src/gxvalid/gxvmort.c: Ditto. + * src/gxvalid/gxvmort0.c: Ditto. + * src/gxvalid/gxvmort1.c: Ditto. + * src/gxvalid/gxvmort2.c: Ditto. + * src/gxvalid/gxvmorx1.c: Ditto. + * src/gxvalid/gxvmorx2.c: Ditto. + +2011-06-14 suzuki toshiya + + [gxvalid] Fix gcc4.6 compiler warnings in gxvtrak.c. + + * src/gxvalid/gxvtrak.c (gxv_trak_trackTable_validate): + Check different entries pointing same traking value. + (gxv_trak_validate): Remove unused variable `table_size'. + +2011-06-14 suzuki toshiya + + [gxvalid] Fix gcc4.6 compiler warnings in gxvmorx*.c. + + * src/gxvalid/gxvmorx.c (gxv_morx_subtables_validate): + Conditionalize unvalidated variable `subFeatureFlags'. + (gxv_morx_chain_validate): Conditionalize unvalidated + variable `defaultFlags'. + + * src/gxvalid/gxmorx0.c + (gxv_morx_subtable_type0_entry_validate): + Conditionalize unvalidated variables; `markFirst', + `dontAdvance', `markLast', `verb'. + + * src/gxvalid/gxmorx1.c + (gxv_morx_subtable_type1_entry_validate): Conditionalize + unvalidated variables; `setMark', `dontAdvance'. + + * src/gxvalid/gxvmorx2.c + (gxv_morx_subtable_type2_ligActionOffset_validate): + Conditionalize unvalidated variables; `last', `store'. + Checking for overrunning offset is added. + (gxv_morx_subtable_type2_entry_validate): + Conditionalize unvalidated variables; `setComponent', + `dontAdvance', `performAction'. + (gxv_morx_subtable_type2_ligatureTable_validate): + Check if the GID for ligature does not exceed the + max GID in `maxp' table. + + * src/gxvalid/gxvmort5.c + (gxv_morx_subtable_type5_InsertList_validate): + Conditionalize unvalidated loading of `insert_glyphID' + array. (gxv_morx_subtable_type5_entry_validate): + Conditionalize unvalidated variables; `setMark', + `dontAdvance', `currentIsKashidaLike', + `markedIsKashidaLike', `currentInsertBefore', + `markedInsertBefore'. + +2011-06-14 suzuki toshiya + + [gxvalid] Fix gcc4.6 compiler warnings in gxvmort*.c. + + * src/gxvalid/gxvmort.c (gxv_mort_subtables_validate): + Conditionalize unvalidated variable `subFeatureFlags'. + (gxv_mort_chain_validate): Conditionalize unvalidated + variable `defaultFlags'. + + * src/gxvalid/gxmort0.c + (gxv_mort_subtable_type0_entry_validate): Check the + conflict of the marks for the glyphs. + + * src/gxvalid/gxmort1.c + (gxv_mort_subtable_type1_offset_to_subst_validate): + Local variables `min_gid', `max_gid' are replaced by + variables in the validator. + (gxv_mort_subtable_type1_entry_validate): Conditionalize + unvalidated variables; `setMark', `dontAdvance'. + (gxv_mort_subtable_type1_substTable_validate): + Validate the GID by the min/max GIDs in the validator. + + * src/gxvalid/gxvmort2.c + (gxv_mort_subtable_type2_ligActionOffset_validate): + Conditionalize unvalidated variables; `last', `store'. + Checking for overrunning offset is added. + (gxv_mort_subtable_type2_entry_validate): + Conditionalize unvalidated variables; `setComponent', + `dontAdvance'. + (gxv_mort_subtable_type2_ligatureTable_validate): + Check if the GID for ligature does not exceed the + max GID in `maxp' table. + + * src/gxvalid/gxvmort5.c + (gxv_mort_subtable_type5_InsertList_validate): + Conditionalize unvalidated loading of `insert_glyphID' + array. (gxv_mort_subtable_type5_entry_validate): + Conditionalize unvalidated variables; `setMark', + `dontAdvance', `currentIsKashidaLike', + `markedIsKashidaLike', `currentInsertBefore', + `markedInsertBefore'. + +2011-06-14 suzuki toshiya + + [gxvalid] Fix gcc4.6 compiler warnings in gxvkern.c. + + * src/gxvalid/gxvkern.c + (gxv_kern_subtable_fmt0_pairs_validate): Conditionalize + unvalidated variable `kernValue'. + (gxv_kern_subtable_fmt1_entry_validate): Conditionalize + unvalidated variables; `push', `dontAdvance', `kernAction', + `kernValue'. + (gxv_kern_coverage_new_apple_validate): Conditionalize + trace-only variables; `kernVertical', `kernCrossStream', + `kernVariation'. + (gxv_kern_coverage_classic_apple_validate): Conditionalize + trace-only variables; `horizontal', `cross_stream'. + (gxv_kern_coverage_classic_microsoft_validate): + Conditionalize trace-only variables; `horizontal', + `minimum', `cross_stream', `override'. + (gxv_kern_subtable_validate): Conditionalize trace-only + variables; `version', `tupleIndex'. + +2011-06-14 suzuki toshiya + + [gxvalid] Fix gcc4.6 compiler warnings in gxvjust.c. + + * src/gxvalid/gxvjust.c (gxv_just_check_max_gid): + New function to unify the checks of too large GID. + (gxv_just_wdp_entry_validate): Conditionalize unvalidated + variables; `beforeGrowLimit', `beforeShrinkGrowLimit', + `afterGrowLimit', `afterShrinkGrowLimit', `growFlags', + `shrinkFlags'. Additional check for non-zero values in + unused storage `justClass' is added. + (gxv_just_actSubrecord_type0_validate): Conditionalize + unvalidated variable `order'. GID is checked by + gxv_just_check_max_gid(). Additional check for upside-down + relationship between `lowerLimit' and `upperLimit' is added. + (gxv_just_actSubrecord_type1_validate): GID is checked by + gxv_just_check_max_gid(). + (gxv_just_actSubrecord_type2_validate): Conditionalize + unvalidated variable `substThreshhold'. GID is checked by + gxv_just_check_max_gid(). + (gxv_just_actSubrecord_type5_validate): GID is checked by + gxv_just_check_max_gid(). + (gxv_just_classTable_entry_validate): Conditionalize + unvalidated variables; `setMark', `dontAdvance', + `markClass', `currentClass'. + +2011-06-14 suzuki toshiya + + [gxvalid] Preparation to fix gcc4.6 compiler warnings. + + * src/gxvalid/gxvcommn.h (GXV_LOAD_TRACE_VARS): New macro to + conditionalize the variable which is only used for trace messages. + Automatically set by FT_DEBUG_LEVEL_TRACE. + (GXV_LOAD_UNUSED_VARS): New macro to conditionalize the loading of + unvalidated variables. Undefined by default to calm gcc4.6 warning. + (GXV_ValidatorRec.{min_gid,max_gid}): New variables to hold defined + GID ranges, for the comparison of GID ranges in different subtables. + +2011-06-08 Werner Lemberg + + [autofit] Remove unused structure member. + + * src/autofit/afhints.h (AF_SegmentRec): Remove `contour'. + * src/autofit/aflatin.c (af_latin_hints_compute_segments), + src/autofit/aflatin2.c (af_latin2_hints_compute_segments): Updated. + +2011-05-30 Werner Lemberg + + Fix g++ 4.6 compilation. + + * src/autofit/afhints.c (af_glyph_hints_dump_segments, + af_glyph_hints_dump_edges): Use cast. + +2011-05-30 Werner Lemberg + + Fix gcc 4.6 compiler warnings. + + * src/autofit/afcjk.c (af_cjk_metrics_init_blues): Use casts and + remove unused variables. + * src/autofit/aflatin.c (af_latin_hints_compute_edges): Comment out + `up_dir'. + * src/smooth/ftsmooth.c (ft_smooth_render_generic): Use `height_org' + and `width_org' conditionalized. + +2011-05-28 suzuki toshiya + + [mac] Conditionalize the inclusion of `AvailabilityMacros.h'. + + The native SDK on earliest Mac OS X (10.0-10.1) did not have + `AvailabilityMacros.h'. To prevent the inclusion of missing + header file, ECANCELED (introduced in 10.2) in POSIX header + file is checked to detect the system version. + + * include/freetype/config/ftconfig.h: Conditionalize the + inclusion of `AvailabilityMacros.h'. + * builds/unix/ftconfig.in: Ditto. + * builds/vms/ftconfig.h: Ditto. + +2011-05-27 Werner Lemberg + + [autofit] Improve tracing of hinting process. + + * src/autofit/aflatin.c (af_latin_hint_edges): Add tracing message + `ADJUST'. + +2011-05-26 Werner Lemberg + + [autofit] Fix trace message. + + * src/autofit/aflatin.c (af_latin_hint_edges): Show correct value in + tracing message. + +2011-05-24 Daniel Zimmermann + + Reduce warnings for MS Visual Studio 2010. + + * src/autofit/afhints.c (af_glyph_hints_get_num_segments, + af_glyph_hints_get_segment_offset) [!FT_DEBUG_AUTOFIT]: Provide + return value. + * src/cff/cffgload.c (cff_slot_load): Add cast. + * src/truetype/ttobjs.c (tt_check_trickyness_sfnt_ids): Use proper + loop variable type. + +2011-05-16 suzuki toshiya + + Automake component `builds/unix/install-sh' is removed. + + * builds/unix/install-sh: Removed. It is not needed to + include repository, because autogen.sh installs it. + * builds/unix/.gitignore: Register install-sh. + +2011-05-12 suzuki toshiya + + [autofit] Make trace message for CJK bluezone more verbose. + +2011-05-08 Just Fill Bugs + suzuki toshiya + + [autofit] Add bluezones for CJK Ideographs. + + To remove extremas of vertical strokes of CJK Ideographs at + low resolution and make the top and bottom horizontal stems + aligned, bluezones for CJK Ideographs are calculated from + sample glyphs. At present, vertical bluezones (bluezones + to align vertical stems) are disabled by default. For detail, see + http://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00070.html + http://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00092.html + http://lists.gnu.org/archive/html/freetype-devel/2011-05/msg00001.html + + * include/freetype/internal/fttrace.h: New trace component `afcjk'. + * src/autofit/afcjk.h (AF_CJK{Blue,Axis,Metric}Rec): Add CJK version + for AF_Latin{Blue,Axis,Metric}Rec. + (af_cjk_metrics_check_digits): Ditto, shared with Indic module. + (af_cjk_metrics_init_widths): Ditto. + (af_cjk_metrics_init): Take AF_CJKMetric instead of AF_LatinMetric. + (af_cjk_metrics_scale): Ditto (declaration). + (af_cjk_hints_init): Ditto (declaration). + (af_cjk_hints_apply): Ditto (declaration). + * src/autofit/afcjk.c (af_cjk_metrics_scale): Ditto (body). + (af_cjk_hints_init): Ditto (body). + (af_cjk_hints_apply): Ditto (body). + (af_cjk_metrics_init_widths): Duplicate af_latin_metrics_init_widths. + (af_cjk_metrics_check_digits): Duplicate af_latin_metrics_check_digits. + (af_cjk_metrics_init): Call CJK bluezone initializer. + (af_cjk_metrics_scale_dim): Add code to scale bluezones. + (af_cjk_hints_compute_blue_edges): New function, CJK version of + af_latin_hints_compute_blue_edges. + (af_cjk_metrics_init_blues): New function, CJK version of + af_latin_metrics_init_blues. + (af_cjk_hints_edges): Add code to align the edge stems to blue zones. + + * src/autofit/afindic.c (af_indic_metrics_init): Take AF_CJKMetric + instead of AF_LatinMetric, and initialize as af_cjk_metrics_init. + However bluezones are not initialized. + (af_indic_metrics_scale): Take AF_CJKMetric instead of AF_LatinMetric. + (af_indic_hints_init): Ditto. + (af_indic_hints_apply): Ditto. + + * docs/CHANGES: Note about CJK bluezone support. + +2011-05-06 Werner Lemberg + + [autofit] Remove unused struct member. + + * src/autofit/aflatin.h (AF_LatinAxis): Remove `control_overshoot'. + +2011-05-04 Werner Lemberg + + * src/autofit/aflatin.c (af_latin_metrics_scale_dim): Simplify. + +2011-05-01 Just Fill Bugs + Werner Lemberg + + [autofit] Add more debugging functions. + + * src/autofit/afhints.c (af_glyph_hints_get_num_segments, + af_glyph_hints_get_segment_offset): New functions. + +2011-05-01 suzuki toshiya + + Add new option `--disable-mmap' to configure script. + + * builds/unix/configure.raw: New option `--disable-mmap' + is added. It is for the developers to simulate the systems + without mmap() (like 4.3BSD, minix etc) on POSIX systems. + +2011-04-30 suzuki toshiya + + [truetype] Always recalculate the sfnt table checksum. + + * src/truetype/ttobjs.c (tt_get_sfnt_checksum): Recalculate + the sfnt table checksum even if non-zero value is written in + the TrueType font header. Some bad PDF generators write + wrong values. For details see examples and benchmark tests + of the latency by recalculation: + http://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00091.html + http://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00096.html + +2011-04-30 suzuki toshiya + + [truetype] Register a set of tricky fonts, NEC FA family. + + * src/truetype/ttobjs.c (tt_check_trickyness_sfnt_ids): + Add 8 checksum sets for NEC FA family. For the tricky fonts + without some tables (e.g. NEC FA fonts lack cvt table), + extra check is added to assure that a zero-length table in the + registry is not included in the font. + +2011-04-29 suzuki toshiya + + [truetype] Fix a bug in the sfnt table checksum getter. + + * src/truetype/ttobjs.c (tt_get_sfnt_checksum): Check the + return value of face->goto_table() correctly. + +2011-04-28 Werner Lemberg + + [autofit] Improve tracing messages. + + * src/autofit/aflatin.c (af_latin_metrics_init_blues, + af_latin_align_linked_edge, af_latin_hint_edges): Do it. + +2011-04-25 Kan-Ru Chen + + [truetype] Always check the checksum to identify tricky fonts. + + Because some PDF generators mangle the family name badly, + the trickyness check by the checksum should be invoked always. + For sample PDF, see + http://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00073.html + + * src/truetype/ttobjs.c (tt_check_trickyness): Even when + tt_check_trickyness_family() finds no trickyness, + tt_check_trickyness_sfnt_ids() is invoked. + +2011-04-22 suzuki toshiya + + [autofit] Add more Indic scripts with hanging baseline. + + * src/autofit/afindic.c (af_indic_uniranges): Tibetan, Limbu, + Sundanese, Meetei Mayak, Syloti Nagri and Sharada scripts are + added. + +2011-04-21 Behdad Esfahbod + + Always ignore global advance. + + This makes FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH redundant, + deprecated, and ignored. The new behavior is what every major user + of FreeType has been requesting. Global advance is broken in many + CJK fonts. Just ignoring it by default makes most sense. + + * src/truetype/ttdriver.c (tt_get_advances), + src/truetype/ttgload.c (TT_Get_HMetrics, TT_Get_VMetrics, + tt_get_metrics, compute_glyph_metrics, TT_Load_Glyph), + src/truetype/ttgload.h: Implement it. + + * docs/CHANGES: Updated. + +2011-04-21 rainy6144 + + [autofit] Blur CJK stems if too many to preserve their gaps. + + When there are too many stems to preserve their gaps in the + rasterization of CJK Ideographs at a low resolution, blur the + stems instead of showing clumped stems. See + http://lists.gnu.org/archive/html/freetype-devel/2011-02/msg00011.html + http://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00046.html + for details. + + * src/autofit/afcjk.c (af_cjk_hint_edges): Store the position of + the previous stem by `has_last_stem' and `last_stem_pos', and skip + a stem if the current and previous stem are too near to preserve + the gap. + +2011-04-18 Werner Lemberg + + Integrate autofitter debugging stuff. + + * devel/ftoption.h, include/freetype/config/ftoption.h + (FT_DEBUG_AUTOFIT): New macro. + + * include/freetype/internal/fttrace.h: Add trace components for + autofitter. + + * src/autofit/aftypes.h (AF_LOG): Removed. + (_af_debug): Removed. + + * src/autofit/*: s/AF_DEBUG/FT_DEBUG_AUTOFIT/. + s/AF_LOG/FT_TRACE5/. + Define FT_COMPONENT where necessary. + +2011-04-18 Werner Lemberg + + Synchronize config files. + + * builds/unix/ftconfig.in: Copy missing assembler routines from + include/freetype/config/ftconfig.h. + +2011-04-13 Werner Lemberg + + Fix Savannah bug #33047. + + Patch submitted by anonymous reporter. + + * src/psaux/psobjs.c (ps_table_add): Use FT_PtrDist for pointer + difference. + +2011-04-11 Kan-Ru Chen + + Fix reading of signed integers from files on 64bit platforms. + + Previously, signed integers were converted to unsigned integers, but + this can fail because of sign extension. For example, 0xa344a1eb + becomes 0xffffffffa344a1eb. + + We now do the reverse which is always correct because the integer + size is the same during the cast from unsigned to signed. + + * include/freetype/internal/ftstream.h, src/base/ftstream.c + (FT_Stream_Get*): Replace with... + (FT_Stream_GetU*): Functions which read unsigned integers. + Update all macros accordingly. + + * src/gzip/ftgzip.c (ft_gzip_get_uncompressed_size): Updated. + +2011-04-07 Werner Lemberg + + Update Unicode ranges for CJK autofitter; in particular, add Hangul. + + * src/autofit/afcjk.c (af_cjk_uniranges): Update to Unicode 6.0. + +2011-04-04 Werner Lemberg + + Fix formatting of autofit debug dumps. + + * src/autofit/afhints.c (af_glyph_hints_dump_points, + af_glyph_hints_dump_segments, af_glyph_hints_dump_edges): Adjust + column widths. + +2011-03-30 Werner Lemberg + + * src/autofit/aftypes.h (AF_OutlineRec): Removed, unused. + +2011-03-24 Werner Lemberg + + * src/cff/cfftypes.h (CFF_MAX_CID_FONTS): Increase to 256. + This limit is given on p. 37 of Adobe Technical Note #5014. + +2011-03-23 Werner Lemberg + + * src/truetype/ttpload.c (tt_face_load_loca): Fix mismatch warning. + +2011-03-20 Werner Lemberg + + * src/sfnt/sfobjs.c (sfnt_open_font): Check number of TTC subfonts. + +2011-03-19 Werner Lemberg + + More C++ compilation fixes. + + * src/autofit/afhints.c (af_glyph_hints_dump_points, + af_glyph_hints_dump_segments, af_glyph_hints_dump_edges) + [__cplusplus]: Protect with `extern "C"'. + +2011-03-18 Werner Lemberg + + C++ compilation fixes. + + * src/autofit/aflatin.c (af_latin_hints_apply), src/autofit/afcjk.c + (af_cjk_hints_apply): Use cast for `dim'. + +2011-03-17 Alexei Podtelezhnikov + + A better fix for Savannah bug #32671. + + * src/smooth/ftgrays.c (gray_render_conic): Clean up code and + replace WHILE loop with a more natural DO-WHILE construct. + +2011-03-16 Werner Lemberg . + + * src/base/ftstroke.c (FT_StrokerRec): Remove unused `valid' field. + Suggested by Graham Asher. + +2011-03-09 Werner Lemberg + + Make FT_Sfnt_Table_Info return the number of SFNT tables. + + * src/sfnt/sfdriver.c (sfnt_table_info): Implement it. + * include/freetype/tttables.h: Update documentation. + * docs/CHANGES: Updated. + +2011-03-07 Bram Tassyns + + Fix Savannah bug #27988. + + * src/cff/cffobjs.c (remove_style): New function. + (cff_face_init): Use it to strip off the style part of the family + name. + +2011-03-07 Werner Lemberg + + * docs/CHANGES: Updated. + +2011-03-07 Alexei Podtelezhnikov + + Quick fix for Savannah bug #32671. + + This isn't the optimal solution yet, but it restores the previous + rendering quality (more or less). + + * src/smooth/ftgrays.c (gray_render_conic): Do more splitting. + +2011-03-06 Werner Lemberg + + Fix autohinting fallback. + + * src/base/ftobjs.c (FT_Load_Glyph): Assure that we only check TTFs, + ignoring CFF-based OTFs. + +2011-02-27 Werner Lemberg + + Add AF_CONFIG_OPTION_USE_WARPER to control the autofit warper. + + * devel/ftoption.h, include/freetype/config/ftoption.h + (AF_CONFIG_OPTION_USE_WARPER): New macro. + * src/autofit/aftypes.h (AF_USE_WARPER): Remove. + + * src/autofit/*: s/AF_USE_WARPER/AF_CONFIG_OPTION_USE_WARPER/. + + * src/autofit/afwarp.c [!AF_CONFIG_OPTION_USE_WARPER]: Replace dummy + variable assignment with a typedef. + +2011-02-26 Werner Lemberg + + [autofit] Slight simplifications. + + * src/autofit/aflatin.c (af_latin_hints_link_segments): Remove + test which always returns false. + (af_latin_hints_compute_blue_edges): Remove redundant assignment. + +2011-02-24 Werner Lemberg + + * docs/PROBLEMS: Mention rendering differences on different + platforms. + Suggested and worded by Jason Owen . + +2011-02-24 Werner Lemberg + + [autofit] Comment out unused code. + + * src/autofit/aflatin.c, src/autofit/aflatin2.c + (af_latin_hints_compute_edges): Do it. + +2011-02-24 Werner Lemberg + + * src/autofit/afhints.h (AF_GlyphHints): Remove unused field. + +2011-02-20 suzuki toshiya + + [cache] Fix an off-by-one bug in `FTC_Manager_RemoveFaceID'. + Found by , see detail in + + http://lists.gnu.org/archive/html/freetype/2011-01/msg00023.html + + * src/cache/ftccache.c (FTC_Cache_RemoveFaceID): Check the node + buckets[cache->p + cache->mask] too. + +2011-02-19 Kevin Kofler + + Fall back to autohinting if a TTF/OTF doesn't contain any bytecode. + This is Savannah patch #7471. + + * src/base/ftobjs.c (FT_Load_Glyph): Implement it. + +2011-02-19 John Tytgat + + [cff] Fix subset prefix removal. + This is Savannah patch #7465. + + * src/cff/cffobjs.c (remove_subset_prefix): Update length after + subset prefix removal. + +2011-02-13 Bradley Grainger + + Add inline assembly version of FT_MulFix for MSVC. + + * include/freetype/config/ftconfig.h: Ported the FT_MulFix_i386 + function from GNU inline assembly syntax (see #ifdef __GNUC__ block + above) to MASM syntax for Microsoft Visual C++. + +2011-02-13 Bradley Grainger + + Add project and solution files in Visual Studio 2010 format. + + * builds/win32/.gitignore: Ignore user-specific cache files. + * builds/win32/vc2010/: Add VS2010 project & solution files, created + by upgrading builds/win32/vc2008/freetype.vcproj. + * objs/.gitignore: Ignore Visual Studio output files. + +2011-02-01 Werner Lemberg + + * src/autofit/afdummy.c: Include `aferrors.h'. + Problem reported by Chris Liddell . + +2011-02-01 Werner Lemberg + + [cff] Ignore unknown operators in charstrings. + Patch suggested by Miles.Lau . + + * src/cff/cffgload.c (cff_decoder_parse_charstrings): Emit tracing + message for unknown operators and continue instead of exiting with a + syntax error. + +2011-02-01 Werner Lemberg + + [truetype] FT_LOAD_PEDANTIC now affects `prep' and `fpgm' also. + + * src/truetype/ttgload.c (tt_loader_init): Handle + `FT_LOAD_PEDANTIC'. + * src/truetype/ttobjs.c (tt_size_run_fpgm, tt_size_run_prep, + tt_size_init_bytecode, tt_size_ready_bytecode): New argument to + handle pedantic mode. + * src/truetype/ttobjs.h: Updated. + +2011-01-31 Werner Lemberg + + [truetype] Protect jump instructions against endless loops. + + * src/truetype/interp.c (DO_JROT, DO_JMPR, DO_JROF): Exit with error + if offset is zero. + +2011-01-31 Werner Lemberg + + [truetype] Improve handling of invalid references. + + * src/truetype/interp.c: Set even more TT_Err_Invalid_Reference + error codes only if pedantic hinting is active. At the same time, + try to provide sane values which hopefully allow useful + continuation. Exception to this is CALL and LOOPCALL – due to + possible stack corruption it is necessary to bail out. + +2011-01-31 Werner Lemberg + + [truetype] Improve handling of stack underflow. + + * src/truetype/ttinterp.c (TT_RunIns, Ins_FLIPPT, Ins_DELTAP, + Ins_DELTAC): Exit with error only if `pedantic_hinting' is set. + Otherwise, try to do something sane. + +2011-01-30 Werner Lemberg + + * src/sfnt/ttmtx.c (tt_face_load_hmtx): Fix tracing message. + +2011-01-30 LIU Sun-Liang + + [truetype]: Fix behaviour of MIAP for invalid arguments. + + * src/truetype/ttinterp.c (Ins_MIAP): Set reference points even in + case of error. + +2011-01-18 Werner Lemberg + + [truetype] Fix handling of MIRP instruction. + + Thanks to Greg Hitchcock who explained the issue. + + * src/truetype/ttinterp.c (Ins_MIRP): Replace a `>=' operator with + `>' since the description in the specification is incorrect. + This fixes, for example, glyph `two' in font `Helvetica Neue LT Com + 65 medium' at 15ppem. + +2011-01-15 suzuki toshiya + + Fix ARM assembly code in include/freetype/config/ftconfig.h. + + * include/freetype/config/ftconfig.h (FT_MulFix_arm): + Copy the maintained code from builds/unix/ftconfig.in. + Old GNU binutils could not accept the reduced syntax + `orr %0, %2, lsl #16'. Un-omitted syntax like RVCT, + `orr %0, %0, %2, lsl #16' is better. Reported by + Johnson Y. Yan. The bug report by Qt developers is + considered too. + + http://bugreports.qt.nokia.com/browse/QTBUG-6521 + +2011-01-15 Werner Lemberg + + [raster] Make bbox handling the same as with Microsoft's rasterizer. + + Right before B/W rasterizing, the bbox gets simply rounded to + integers. This fixes, for example, glyph `three' in font `Helvetica + Neue LT Com 65 Medium' at 11ppem. + + Thanks to Greg Hitchcock who explained this behaviour. + + * src/raster/ftrend1.c (ft_raster1_render): Implement it. + +2011-01-15 suzuki toshiya + + Copy -mcpu=* & -march=* options from CFLAGS to LDFLAGS. + + * builds/unix/configure.raw: Consider recent gcc-standard + flags to specify architecture in CFLAGS & LDFLAGS + harmonization. Requested by Savannah bug #32114, to + support multilib feature of BuildRoot SDK correctly. + +2011-01-15 suzuki toshiya + + Fix off-by-one bug in CFLAGS & LDFLAGS harmonizer. + + * builds/unix/configure.raw: Some important options that + included in CFLAGS but not in LDFLAGS are copied to + LDFLAGS, but the last option in CFLAGS was not checked. + +2011-01-13 Werner Lemberg + + [raster] Add undocumented drop-out rule to the other bbox side also. + + * src/raster/ftraster.c (Vertical_Sweep_Drop, + Horizontal_Sweep_Drop): Implement it. + +2011-01-13 Werner Lemberg + + [raster] Reduce jitter value. + + This catches a rendering problem with glyph `x' from Tahoma at + 10ppem. It seems that the increase of the precision in the change + from 2009-06-11 makes a larger jitter value unnecessary. + + * src/raster/ftraster.c (Set_High_Precision): Implement it. + +2011-01-13 Werner Lemberg + + [raster] Handle drop-outs at glyph borders according to Microsoft. + + If a drop-out rule would switch on a pixel outside of the glyph's + bounding box, use the right (or top) pixel instead. This is an + undocumented feature, but some fonts like `Helvetica Neue LT Com 65 + Medium' heavily rely on it. + + Thanks to Greg Hitchcock who explained this behaviour. + + * src/raster/ftraster.c (Vertical_Sweep_Drop, + Horizontal_Sweep_Drop): Implement it. + +2011-01-09 suzuki toshiya + + [cache] Fix Savannah bug #31923, patch drafted by Harsha. + + When a node comparator changes the cached nodes during the + search of a node matching with queried properties, the + pointers obtained before the function should be updated to + prevent the dereference to freed or reallocated nodes. + To minimize the rescan of the linked list, the update is + executed when the comparator notifies the change of cached + nodes. This change depends previous change: + 38b272ffbbdaae276d636aec4ef84af407d16181 + + * src/cache/ftccache.h (FTC_CACHE_LOOKUP_CMP): Rescan the + top node if the cached nodes are changed. + * src/cache/ftccache.c (FTC_Cache_Lookup): Ditto. + +2011-01-09 suzuki toshiya + + [cache] Notice if a cache query induced the node list change. + + Some node comparators (comparing the cache node contents and the + properties specified by the query) can flush the cache node to + prevent the cache inflation. The change may invalidate the pointers + to the node obtained before the node comparison, so it should be + noticed to the caller. The problem caused by the cache node + changing is reported by Harsha, see Savannah bug #31923. + + * src/cache/ftccache.h (FTC_Node_CompareFunc): Add new argument + `FT_Bool* list_changed' to indicate the change of the cached nodes + to the caller. + (FTC_CACHE_LOOKUP_CMP): Watch the change of the cached nodes by + `_list_changed'. + (FTC_CACHE_TRYLOOP_END): Take new macro argument `_list_changed' + and update it when `FTC_Manager_FlushN' flushes any nodes. + + * src/cache/ftccback.h (ftc_snode_compare): Updated to fit with new + FTC_Node_CompareFunc type. + (ftc_gnode_compare): Ditto. + + * src/cache/ftcbasic.c: Include FT_INTERNAL_OBJECTS_H to use + TRUE/FALSE macros. + (ftc_basic_gnode_compare_faceid): New argument `FT_Bool* + list_changed' to indicate the change of the cache nodes (anyway, it + is always FALSE). + + * src/cache/ftccmap.c: Include FT_INTERNAL_OBJECTS_H to use + TRUE/FALSE macros. + (ftc_cmap_node_compare): New argument `FT_Bool* list_changed' to + indicate the change of the cache nodes (anyway, it is always FALSE). + (ftc_cmap_node_remove_faceid): Ditto. + + * src/cache/ftccache.c (FTC_Cache_NewNode): Pass a NULL pointer to + `FTC_CACHE_TRYLOOP_END', because the result is not needed. + (FTC_Cache_Lookup): Watch the change of the cache nodes by + `list_changed'. + (FTC_Cache_RemoveFaceID): Ditto. + + * src/cache/ftcglyph.c: Include FT_INTERNAL_OBJECTS_H to use + TRUE/FALSE macros. + (ftc_gnode_compare): New argument `FT_Bool* list_changed' to + indicate the change of the cache nodes (anyway, it is always FALSE). + (FTC_GNode_Compare): New argument `FT_Bool* list_changed' to be + passed to `ftc_gnode_compare'. + * src/cache/ftcglyph.h (FTC_GNode_Compare): Ditto. + + * src/cache/ftcsbits.c (ftc_snode_compare): New argument `FT_Bool* + list_changed' to indicate the change of the cache nodes, anyway. It + is updated by `FTC_CACHE_TRYLOOP'. + (FTC_SNode_Compare): New argument `FT_Bool* list_changed' to be + passed to `ftc_snode_compare'. + * src/cache/ftcsbits.h (FTC_SNode_Compare): Ditto. + +2011-01-09 suzuki toshiya + + [cache] Fit `FTC_GNode_Compare' to `FTC_Node_CompareFunc'. + + * src/cache/ftcglyph.h (FTC_GNode_Compare): Add the 3rd + argument `FTC_Cache cache' to fit FTC_Node_CompareFunc + prototype. + * src/cache/ftcglyph.c (FTC_GNode_Compare): Ditto. Anyway, + `cache' is not used by its child `ftc_gnode_compare'. + +2011-01-09 suzuki toshiya + + [cache] Deduplicate the code to get the top node by a hash. + + There are several duplicated code fragments getting the top node + from a cache by a given hash, like: + + idx = hash & cache->mask; + if ( idx < cache->p ) + idx = hash & ( cache->mask * 2 + 1 ); + pnode = cache->buckets + idx; + + To remove duplication, a cpp-macro to do same work + `FTC_NODE__TOP_FOR_HASH' is introduced. For non-inlined + configuration, non-`ftc_get_top_node_for_hash' is also introduced. + + * src/cache/ftccache.h (FTC_NODE__TOP_FOR_HASH): Declare + and implement inlined version. + (FTC_CACHE_LOOKUP_CMP): Use `FTC_NODE__TOP_FOR_HASH'. + * src/cache/ftccache.c (ftc_get_top_node_for_hash): Non-inlined + version. + (ftc_node_hash_unlink): Use `FTC_NODE__TOP_FOR_HASH'. + (ftc_node_hash_link): Ditto. + (FTC_Cache_Lookup): Ditto. + +2011-01-09 suzuki toshiya + + [cache] inline-specific functions are conditionalized. + + * src/cache/ftcglyph.c (FTC_GNode_Compare): Conditionalized for + inlined configuration. This function is a thin wrapper of + `ftc_gnode_compare' for inlined `FTC_CACHE_LOOKUP_CMP' (see + `nodecmp' argument). Under non-inlined configuration, + `ftc_gnode_compare' is invoked by `FTC_Cache_Lookup', via + `FTC_Cache->clazz.node_compare'. + + * src/cache/ftcglyph.h (FTC_GNode_Compare): Ditto. + * src/cache/ftcsbits.c (FTC_SNode_Compare): Ditto, for + `ftc_snode_compare'. + * src/cache/ftcsbits.h (FTC_SNode_Compare): Ditto. + +2011-01-09 suzuki toshiya + + [cache] Correct a type mismatch under non-inlined config. + + * src/cache/ftcglyph.h (FTC_GCACHE_LOOKUP_CMP): `FTC_GCache_Lookup' + takes the node via a pointer `FTC_Node*', differently from cpp-macro + `FTC_CACHE_LOOKUP_CMP'. + +2011-01-06 suzuki toshiya + + Update Jamfile to include Bzip2 support. + + * Jamfile: Include src/bzip2 to project. + Comments for lzw, gzip, bzip2 are changed to clarify that + they are for compressed PCF fonts, not others. + (e.g. compressed BDF fonts are not supported yet) + +2011-01-05 suzuki toshiya + + Update Symbian project files to include Bzip2 support. + + Currently, it provides `FT_Stream_OpenBzip2' that returns + unimplemented error always, to prevent unresolved symbol + error for the applications designed for Unix systems. + + * builds/symbian/bld.inf: Include ftbzip2.h. + * builds/symbian/freetype.mmp: Include ftbzip2.c. + +2011-01-05 suzuki toshiya + + Update classic MacOS makefiles to include Bzip2 support. + + Currently, it provides `FT_Stream_OpenBzip2' that returns + unimplemented error always, to prevent unresolved symbol + error for the applications designed for Unix systems. + + * builds/mac/FreeType.m68k_cfm.make.txt: Include ftbzip2.c.o. + * builds/mac/FreeType.m68k_far.make.txt: Ditto. + * builds/mac/FreeType.ppc_carbon.make.txt: Include ftbzip2.c.x. + * builds/mac/FreeType.ppc_classic.make.txt: Ditto. + +2011-01-05 suzuki toshiya + + Update Amiga makefiles to include Bzip2 support. + + Currently, it provides `FT_Stream_OpenBzip2' that returns + unimplemented error always, to prevent unresolved symbol + error for the applications designed for Unix systems. + + * builds/amiga/makefile: Include bzip2.ppc.o built from ftbzip2.c. + * builds/amiga/makefile.os4: Include bzip2.o built from ftbzip2.c. + * builds/amiga/smakefile: Ditto. + +2011-01-05 suzuki toshiya + + Update pkg-config tools to reflect Bzip2 support. + + * builds/unix/freetype-config.in: Include `-lbz2' to + --libs output, if built with Bzip2 support. + * builds/unix/freetype2.in: Ditto. + +2011-01-05 suzuki toshiya + + * builds/unix/configure.raw: Remove `SYSTEM_BZ2LIB' macro. + + SYSTEM_ZLIB is used to switch the builtin zlib source + or system zlib source out of FreeType2. But ftbzip2 + module has no builtin bzip2 library and always requires + system bzip2 library. Thus SYSTEM_BZ2LIB is always yes, + it is not used. + +2011-01-03 Werner Lemberg + + */rules.mk: Handle `*pic.c' files. + +2010-12-31 Werner Lemberg + + * src/cff/cfftypes.h (CFF_MAX_CID_FONTS): Increase to 64. + Problem reported by Tom Bishop . + +2010-12-31 Werner Lemberg + + Improve bzip2 support. + + * include/freetype/ftmoderr.h: Add bzip2. + + * docs/INSTALL.ANY, docs/CHANGES: Updated. + + * src/pcf/README: Updated. + * include/freetype/internal/pcftypes.h: Obsolete, removed. + +2010-12-31 Joel Klinghed + + Add bzip2 compression support to handle *.pcf.bz2 files. + + * builds/unix/configure.raw: Test for libbz2 library. + + * devel/ftoption.h, include/freetype/config/ftoption.h + (FT_CONFIG_OPTION_USE_BZIP2): Define. + * include/freetype/config/ftheader.h (FT_BZIP2_H): Define. + + * include/freetype/ftbzip2.h: New file. + + * src/bzip2/*: New files. + + * src/pcf/pcf.h: s/gzip_/comp_/. + * src/pcf/pcfdrvr.c: Include FT_BZIP2_H. + s/gzip_/comp_/. + (PCF_Face_Init): Handle bzip2 compressed files. + + * docs/formats.txt, modules.cfg: Updated. + +2010-12-25 Harsha + + Apply Savannah patch #7422. + + If we encounter a space in a string then the sbit buffer is NULL, + height and width are 0s. So the check in ftc_snode_compare will + always pass for spaces (comparision with 255). Here the comments + above the condition are proper but the implementation is not. When + we create an snode I think it is the proper way to initialize the + width to 255 and then put a check for being equal to 255 in snode + compare function. + + * src/cache/ftcsbits.c (FTC_SNode_New): Initialize sbit widths with + value 255. + (ftc_snode_compare): Fix condition. + +2010-12-13 Werner Lemberg + + Fix parameter handling of `FT_Set_Renderer'. + Reported by Kirill Tishin . + + * src/base/ftobjs.c (FT_Set_Renderer): Increment `parameters'. + +2010-12-09 Werner Lemberg + + [cff] Allow `hlineto' and `vlineto' without arguments. + + We simply ignore such instructions. This is invalid, but it doesn't + harm; and indeed, there exist such subsetted fonts in PDFs. + + Reported by Albert Astals Cid . + + * src/cff/cffgload.c (cff_decoder_parse_charstrings) + [cff_op_hlineto]: Ignore instruction if there aren't any arguments + on the stack. + +2010-11-28 Werner Lemberg + + * Version 2.4.4 released. + ========================= + + + Tag sources with `VER-2-4-4'. + + * docs/CHANGES: Updated. + + * docs/VERSION.DLL: Update documentation and bump version number to + 2.4.4 + + * README, Jamfile (RefDoc), + builds/win32/vc2005/freetype.vcproj, builds/win32/vc2005/index.html, + builds/win32/vc2008/freetype.vcproj, builds/win32/vc2008/index.html, + builds/win32/visualc/freetype.dsp, + builds/win32/visualc/freetype.vcproj, + builds/win32/visualc/index.html, builds/win32/visualce/freetype.dsp, + builds/win32/visualce/freetype.vcproj, + builds/win32/visualce/index.html, + builds/wince/vc2005-ce/freetype.vcproj, + builds/wince/vc2005-ce/index.html, + builds/wince/vc2008-ce/freetype.vcproj, + builds/wince/vc2008-ce/index.html: s/2.4.3/2.4.4/, s/243/244/. + + * include/freetype/freetype.h (FREETYPE_PATCH): Set to 4. + + * builds/unix/configure.raw (version_info): Set to 12:2:6. + +2010-11-28 Alexei Podtelezhnikov + + [ftsmooth]: Minor code simplification. + + * src/smooth/ftgrays (gray_render_cubic): Do only one comparison + instead of two. + +2010-11-26 Johnson Y. Yan + + [truetype] Better multi-threading support. + + * src/truetype/ttinterp.c (TT_Load_Context): Reset glyph zone + references. + +2010-11-23 John Tytgat + + * src/psaux/t1decode.c (t1_decoder_parse_charstring): Expand + start_point, check_points, add_point, add_point1, close_contour + macros. + Remove add_contour macro. + Return error code from t1_builder_start_point and + t1_builder_check_points when there was one (instead of returning 0). + +2010-11-22 suzuki toshiya + + [truetype] Identify the tricky fonts by cvt/fpgm/prep checksums. + Some Latin TrueType fonts are still expected to be unhinted. + Fix Savannah bug #31645. + + * src/truetype/ttobjs.c (tt_check_trickyness): Divided to... + (tt_check_trickyness_family): this checking family name, and + (tt_check_trickyness_sfnt_ids): this checking cvt/fpgm/prep. + (tt_get_sfnt_checksum): Function to retrieve the sfnt checksum + for specified subtable even if cleared by lazy PDF generators. + (tt_synth_sfnt_checksum): Function to calculate the checksum. + +2010-11-18 Werner Lemberg + + [truetype] Fix `loca' handling for inconsistent number of glyphs. + Reported by Johnson Y. Yan . + + * src/truetype/ttpload.c (tt_face_load_loca): While sanitizing, + handle case where `loca' is the last table in the font. + +2010-11-18 Werner Lemberg + + [sfnt] Ignore all errors while loading `OS/2' table. + Suggested by Johnson Y. Yan . + + * src/sfnt/sfobjs.c (sfnt_load_face): Do it. + +2010-11-18 Johnson Y. Yan + + [type1] Fix matrix normalization. + + * src/type1/t1load.c (parse_font_matrix): Handle sign of scaling + factor. + +2010-11-18 Werner Lemberg + + [type1] Improve guard against malformed data. + Based on a patch submitted by Johnson Y. Yan + + + * src/type1/t1load.c (read_binary_data): Check `size'. + +2010-11-17 Werner Lemberg + + [sfnt] While tracing, output table checksums also. + + * src/sfnt/ttload.c (tt_face_load_font_dir): Do it. + +2010-11-04 suzuki toshiya + + [UVS] Fix `find_variant_selector_charmap', Savannah bug #31545. + + Since 2010-07-04, `find_variant_selector_charmap' returns + the first cmap subtable always under rogue-compatible + configuration, it causes NULL pointer dereference and + make UVS-related functions crashed. + + * src/base/ftobjs.c (Fix find_variant_selector_charmap): + Returns UVS cmap correctly. + +2010-11-01 Alexei Podtelezhnikov + + [ftsmooth] Improve rendering. + + * src/smooth/ftsmooth.c (gray_render_conic): Since version 2.4.3, + cubic deviations have been estimated _after_ UPSCALE, whereas + conic ones have been evaluated _before_ UPSCALE, which produces + inferior rendering results. Fix this. + Partially undo change from 2010-10-15 by using ONE_PIXEL/4; this has + been tested with demo images sent to the mailing list. See + + http://lists.gnu.org/archive/html/freetype-devel/2010-10/msg00055.html + + and later mails in this thread. + +2010-10-28 Werner Lemberg + + [ftraster] Minor fixes. + + Reported by Tom Bishop . + + * src/raster/ftraster.c (ULong): Remove unused typedef. + (TWorker): Remove unused variable `precision_mask'. + +2010-10-28 Werner Lemberg + + [ftraster] Fix rendering. + + Problem reported by Tom Bishop ; see + thread starting with + + http://lists.gnu.org/archive/html/freetype/2010-10/msg00049.html + + * src/raster/ftraster.c (Line_Up): Replace FMulDiv with SMulDiv + since the involved multiplication exceeds 32 bits. + +2010-10-25 suzuki toshiya + + Revert a change of `_idx' type in `FTC_CACHE_LOOKUP_CMP'. + + * src/cache/ftccache.h (FTC_CACHE_LOOKUP_CMP): Revert + the type of `_idx' from FT_PtrDist (by previous change) + to original FT_UFast, to match with FT_CacheRec. + +2010-10-24 suzuki toshiya + + [cache] Change the hash types to FT_PtrDist. + + On LLP64 platforms (e.g. Win64), FT_ULong (32-bit) + variables are inappropriate to calculate hash values + from the memory address (64-bit). The hash variables + are extended from FT_ULong to FT_PtrDist and new + hashing macro functions are introduced. The hash + values on 16-bit memory platforms are changed, but + ILP32 and LP64 are not changed. The hash value in + the cache subsystem is not reverted to the memory + address, so using signed type FT_PtrDist is safe. + + * src/cache/ftccache.h (_FTC_FACE_ID_HASH): New hash + function to replace `FTC_FACE_ID_HASH' for portability. + * src/cache/ftcmanag.h (FTC_SCALER_HASH): Replace + `FTC_FACE_ID_HASH' by `_FTC_FACE_ID_HASH'. + * src/cache/ftccmap.c (FTC_CMAP_HASH): Ditto. + + * src/cache/ftccache.h (FTC_NodeRec): The type of the + member `hash' is changed from FT_UInt32 to FT_PtrDist. + + * src/cache/ftccache.h (FTC_Cache_Lookup): The type of the + argument `hash' is changed from FT_UInt32 to FT_PtrDist. + (FTC_Cache_NewNode): Ditto. + * src/cache/ftccache.c (ftc_cache_add): Ditto. + (FTC_Cache_Lookup): Ditto. (FTC_Cache_NewNode): Ditto. + * src/cache/ftcglyph.h (FTC_GCache_Lookup): Ditto. + * src/cache/ftcglyph.c (FTC_GCache_Lookup): Ditto. + + * src/cache/ftcbasic.c (FTC_ImageCache_Lookup): The type + of the internal variable `hash' is changed to FT_PtrDist + from FT_UInt32. (FTC_ImageCache_LookupScaler): Ditto. + (FTC_SBitCache_Lookup): Ditto. + (FTC_SBitCache_LookupScaler): Ditto. + * src/cache/ftccmap.c (FTC_CMapCache_Lookup): Ditto. + * src/cache/ftccache.h (FTC_CACHE_LOOKUP_CMP): Ditto. + Also the type of the internal variable `_idx' is changed to + FT_PtrDist from FT_UFast for better pointer calculation. + +2010-10-24 suzuki toshiya + + [cache] Hide internal macros incompatible with LLP64. + + `FT_POINTER_TO_ULONG', `FTC_FACE_ID_HASH', and + `FTC_IMAGE_TYPE_HASH' are enclosed by + FT_CONFIG_OPTION_OLD_INTERNALS and hidden from + normal clients. + + For the history of these macros, see the investigation: + http://lists.gnu.org/archive/html/freetype/2010-10/msg00022.html + +2010-10-24 suzuki toshiya + + Change the type of `FT_MEM_VAL' from FT_ULong to FT_PtrDist. + + On LLP64 platforms (e.g. Win64), unsigned long (32-bit) + cannot cover the memory address (64-bit). `FT_MEM_VAL' is + used for hashing only and not dereferred, so using signed + type FT_PtrDist is safe. + + * src/base/ftdbgmem.c (FT_MEM_VAL): Change the type of the + return value from FT_ULong to FT_PtrDist. + (ft_mem_table_resize): The type of hash is changed to + FT_PtrDist. (ft_mem_table_get_nodep): Ditto. + +2010-10-24 suzuki toshiya + + Replace "%lx" for memory address by "%p", LLP64 platforms. + + On LLP64 platforms (e.g. Win64), long (32-bit) cannot cover + the memory address (64-bit). Also the casts from the pointer + type to long int should be removed to preserve the address + correctly. + + * src/raster/ftraster.c (New_Profile): Replace "%lx" by "%p". + (End_Profile) Ditto. + * src/truetype/ttinterp.c (Init_Context): Ditto. + +2010-10-15 Alexei Podtelezhnikov + + Fix thinko in spline flattening. + + FT_MAX_CURVE_DEVIATION is dependent on the value of ONE_PIXEL. + + * src/smooth/ftgrays.c (FT_MAX_CURVE_DEVIATION): Remove it and + replace it everywhere with ONE_PIXEL/8. + +2010-10-13 suzuki toshiya + + [raccess] Skip unrequired resource access rules by Darwin VFS. + + When a resource fork access rule by Darwin VFS could open the + resource fork but no font is found in it, the rest of rules + by Darwin VFS are skipped. It reduces the warnings of the + deprecated resource fork access method by recent Darwin kernel. + Fix MacPorts ticket #18859: + http://trac.macports.org/ticket/18859 + + * src/base/ftobjs.c (load_face_in_embedded_rfork): + When `FT_Stream_New' returns FT_Err_Cannot_Open_Stream, it + means that the file is possible to be `fopen'-ed but zero-sized. + Also there is a case that the resource fork is not zero-sized, + but no supported font exists in it. If a rule by Darwin VFS + falls into such cases, there is no need to try other Darwin VFS + rules anymore. Such cases are marked by vfs_rfork_has_no_font. + If it is TRUE, the Darwin VFS rules are skipped. + +2010-10-13 suzuki toshiya + + [raccess] Grouping resource access rules based on Darwin VFS. + + MacOS X/Darwin kernel supports a few tricky methods to access + a resource fork via ANSI C or POSIX interface. Current resource + fork accessor tries all possible methods to support all kernels. + But if a method could open a resource fork but no font is found, + there is no need to try other methods older than tested method. + To determine whether the rule index is for Darwin VFS, a local + function `ftrfork.c::raccess_rule_by_darwin_vfs' is introduced. + To use this function in ftobjs.c etc but it should be inlined, + it is exposed by ftbase.h. + + * src/base/ftrfork.c (FT_RFork_Rule): New enum type to identify + the rules to access the resource fork. + (raccess_guess_rec): New structure to bind the rule function and + rule enum type. + (FT_Raccess_Guess): The list of the rule functions is replaced by + (raccess_guess_table): This. This is exposed to be used by other + intra module functions. + (raccess_rule_by_darwin_vfs): A function to return a boolean + if the rule specified by the rule index is based on Darwin VFS. + +2010-10-13 suzuki toshiya + + Prevent to open a FT_Stream for zero-sized file on non-Unix. + + builds/unix/ftsystem.c prevents to open an useless stream from + zero-sized file and returns FT_Err_Cannot_Open_Stream, but the + stream drivers for ANSI C, Amiga and VMS return useless streams. + For cross-platform consistency, all stream drivers should act + same. + + * src/base/ftsystem.c (FT_Stream_Open): If the size of the opened + file is zero, FT_Err_Cannot_Open_Stream is returned. + * builds/amiga/src/base/ftsystem.c (FT_Stream_Open): Ditto. + * src/vms/ftsystem.c (FT_Stream_Open): Ditto. + 2010-10-12 Werner Lemberg Fix Savannah bug #31310. @@ -5,6 +2827,12 @@ * src/truetype/ttgxvar.c (ft_var_readpackedpoints): Protect against invalid `runcnt' values. +2010-10-08 Chris Liddell + + Fix Savannah bug #31275. + + * src/sfnt/ttpost.c: Include FT_INTERNAL_DEBUG_H. + 2010-10-06 Werner Lemberg [truetype] Improve error handling of `SHZ' bytecode instruction. @@ -12,6 +2840,14 @@ * src/truetype/ttinterp.c (Ins_SHZ): Check `last_point'. +2010-10-05 Werner Lemberg + + Fix Savannah bug #31253. + Patch submitted by an anonymous reporter. + + * configure: Use `awk' instead of `sed' to manipulate output of `ls + -id'. + 2010-10-03 Werner Lemberg * Version 2.4.3 released. @@ -120,7 +2956,7 @@ * src/cff/cffload.c (cff_index_access_element): `off2', the offset to the next element is truncated at the end of the stream to prevent invalid I/O. As `off1', the offset to the requested element has - been checked by FT_STREAM_SEEK(), `off2' should be checked + been checked by `FT_STREAM_SEEK', `off2' should be checked similarly. 2010-09-19 suzuki toshiya @@ -135,7 +2971,7 @@ 2010-09-19 suzuki toshiya - [cff] Make trace message in cff_charset_load() verbose. + [cff] Make trace message in` cff_charset_load' verbose. See Savannah bug #30975. * src/cff/cffload.c (cff_charset_load): Report the original `nleft' @@ -171,8 +3007,8 @@ See Savannah bug #31040. * src/sfnt/ttpost.c (load_post_names): Get the length of `post' - table and pass the limit of `post' table to load_format_20() and - load_format_25(). + table and pass the limit of `post' table to `load_format_20' and + `load_format_25'. (load_format_20): Stop the parsing when we reached at the limit of `post' table. If more glyph names are required, they are filled by NULL names. @@ -184,9 +3020,9 @@ * src/truetype/ttinterp.c (free_buffer_in_size): Don't duplicate FT_GlyphZoneRec size->twilight to be freed. If duplicated, - FT_FREE() erases the duplicated pointers only and leave original + `FT_FREE' erases the duplicated pointers only and leave original pointers. They can cause the double-free crash when the burst - errors occur in TrueType interpreter and free_buffer_in_size() is + errors occur in TrueType interpreter and `free_buffer_in_size' is invoked repeatedly. 2010-09-15 Werner Lemberg @@ -243,7 +3079,7 @@ * src/truetype/ttinterp.c (TT_RunIns): Decrease the trace level showing the error when the interpreter returns with an error, - from FT_TRACE7() to FT_TRACE1(). + from` FT_TRACE7' to `FT_TRACE1'. 2010-08-30 suzuki toshiya @@ -400,7 +3236,7 @@ [cff] Don't use any values in decoder after parsing error. * src/cff/cffgload.c (cff_slot_load): Skip the evaluations - of the values in decoder, if cff_decoder_parse_charstrings() + of the values in decoder, if `cff_decoder_parse_charstrings' returns any error. 2010-08-04 Werner Lemberg @@ -1224,7 +4060,7 @@ ---------------------------------------------------------------------------- -Copyright 2010 by +Copyright 2010-2012 by David Turner, Robert Wilhelm, and Werner Lemberg. This file is part of the FreeType project, and may only be used, modified, diff --git a/modules/freetype2/Jamfile b/modules/freetype2/Jamfile index bea731f8c5f..313bda65e6c 100644 --- a/modules/freetype2/Jamfile +++ b/modules/freetype2/Jamfile @@ -1,6 +1,6 @@ # FreeType 2 top Jamfile. # -# Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by +# Copyright 2001-2011 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, @@ -76,9 +76,10 @@ FT2_COMPONENTS ?= autofit # auto-fitter cache # cache sub-system cff # CFF/CEF font driver cid # PostScript CID-keyed font driver - gzip # support for gzip-compressed files - lzw # support for LZW-compressed files pcf # PCF font driver + bzip2 # support for bzip2-compressed PCF font + gzip # support for gzip-compressed PCF font + lzw # support for LZW-compressed PCF font pfr # PFR/TrueDoc font driver psaux # common PostScript routines module pshinter # PostScript hinter module @@ -194,7 +195,7 @@ rule RefDoc actions RefDoc { - python $(FT2_SRC)/tools/docmaker/docmaker.py --prefix=ft2 --title=FreeType-2.4.3 --output=$(DOC_DIR) $(FT2_INCLUDE)/freetype/*.h $(FT2_INCLUDE)/freetype/config/*.h + python $(FT2_SRC)/tools/docmaker/docmaker.py --prefix=ft2 --title=FreeType-2.4.9 --output=$(DOC_DIR) $(FT2_INCLUDE)/freetype/*.h $(FT2_INCLUDE)/freetype/config/*.h } RefDoc refdoc ; diff --git a/modules/freetype2/README b/modules/freetype2/README index ffd9dc04ade..84b1c44cc1e 100644 --- a/modules/freetype2/README +++ b/modules/freetype2/README @@ -1,15 +1,4 @@ - Special notes to Unix users - =========================== - - Please read the file `docs/UPGRADE.UNIX'. It contains important - information regarding the installation of FreeType on Unix systems, - especially GNU based operating systems like GNU/Linux. - - FreeType 2's library is called `libfreetype', FreeType 1's library - is called `libttf'. They are *not* compatible! - - - FreeType 2.4.3 + FreeType 2.4.9 ============== Please read the docs/CHANGES file, it contains IMPORTANT @@ -17,6 +6,10 @@ Read the files `docs/INSTALL' for installation instructions. + See the file `docs/LICENSE.TXT' for the available licenses. Note + that we use ranges (`2008-2010') for copyright years also instead of + listing individual years (`2008, 2009, 2010'). + The FreeType 2 API reference is located in `docs/reference'; use the file `ft2-doc.html' as the top entry point. Additional documentation is available as a separate package from our sites. Go @@ -26,9 +19,9 @@ and download one of the following files. - freetype-doc-2.4.3.tar.bz2 - freetype-doc-2.4.3.tar.gz - ftdoc243.zip + freetype-doc-2.4.9.tar.bz2 + freetype-doc-2.4.9.tar.gz + ftdoc249.zip Bugs @@ -51,7 +44,7 @@ ---------------------------------------------------------------------- -Copyright 2006, 2007, 2008, 2009, 2010 by +Copyright 2006-2011 by David Turner, Robert Wilhelm, and Werner Lemberg. This file is part of the FreeType project, and may only be used, diff --git a/modules/freetype2/README.moz-patches b/modules/freetype2/README.moz-patches index 3a819666d96..be737ac44c9 100644 --- a/modules/freetype2/README.moz-patches +++ b/modules/freetype2/README.moz-patches @@ -1,6 +1,4 @@ -This directory contains freetype2 v2.4.3 downloaded from +This directory contains freetype2 v2.4.9 downloaded from http://savannah.nongnu.org/download/freetype/ -Makefile.in is added for the mozilla build. - -Additional patch applied locally: +There are currently no local changes applied the freetype tree. diff --git a/modules/freetype2/autogen.sh b/modules/freetype2/autogen.sh old mode 100644 new mode 100755 index c28a51c1323..9f2fb6a3e81 --- a/modules/freetype2/autogen.sh +++ b/modules/freetype2/autogen.sh @@ -118,9 +118,12 @@ fi # On MacOS X, the GNU libtool is named `glibtool'. HOSTOS=`uname` -LIBTOOLIZE=libtoolize -if test "$HOSTOS"x = Darwinx; then +if test "$LIBTOOLIZE"x != x; then + : +elif test "$HOSTOS"x = Darwinx; then LIBTOOLIZE=glibtoolize +else + LIBTOOLIZE=libtoolize fi if test "$ACLOCAL"x = x; then diff --git a/modules/freetype2/builds/amiga/makefile b/modules/freetype2/builds/amiga/makefile index e874a1f292b..379883deec0 100644 --- a/modules/freetype2/builds/amiga/makefile +++ b/modules/freetype2/builds/amiga/makefile @@ -234,6 +234,11 @@ pcf.ppc.o: $(FTSRC)/pcf/pcf.c gzip.ppc.o: $(FTSRC)/gzip/ftgzip.c $(CC) -c $(CFLAGS) -o $@ $< +# FreeType2 library bzip2 support for compressed PCF bitmap fonts +# +bzip2.ppc.o: $(FTSRC)/bzip2/ftbzip2.c + $(CC) -c $(CFLAGS) -o $@ $< + # # FreeType2 library compress support for compressed PCF bitmap fonts # @@ -285,8 +290,8 @@ RASTERPPC = raster.ppc.o smooth.ppc.o FONTDPPC = cff.ppc.o type1.ppc.o type42.ppc.o type1cid.ppc.o truetype.ppc.o\ bdf.ppc.o pcf.ppc.o pfr.ppc.o winfnt.ppc.o -libft2_ppc.a: $(BASEPPC) $(AFITPPC) $(GXVPPC) $(OTVPPC) $(PSPPC) $(RASTERPPC) sfnt.ppc.o ftcache.ppc.o $(FONTDPPC) gzip.ppc.o lzw.ppc.o - $(AR) $@ $(BASEPPC) $(AFITPPC) $(GXVPPC) $(OTVPPC) $(PSPPC) $(RASTERPPC) sfnt.ppc.o ftcache.ppc.o $(FONTDPPC) gzip.ppc.o lzw.ppc.o +libft2_ppc.a: $(BASEPPC) $(AFITPPC) $(GXVPPC) $(OTVPPC) $(PSPPC) $(RASTERPPC) sfnt.ppc.o ftcache.ppc.o $(FONTDPPC) gzip.ppc.o bzip2.ppc.o lzw.ppc.o + $(AR) $@ $(BASEPPC) $(AFITPPC) $(GXVPPC) $(OTVPPC) $(PSPPC) $(RASTERPPC) sfnt.ppc.o ftcache.ppc.o $(FONTDPPC) gzip.ppc.o bzip2.ppc.o lzw.ppc.o -@ ($(RANLIB) $@ || true) >/dev/null 2>&1 #Local Variables: diff --git a/modules/freetype2/builds/amiga/makefile.os4 b/modules/freetype2/builds/amiga/makefile.os4 index edd88eba947..13758bcebf1 100644 --- a/modules/freetype2/builds/amiga/makefile.os4 +++ b/modules/freetype2/builds/amiga/makefile.os4 @@ -237,6 +237,12 @@ pcf.ppc.o: FT:src/pcf/pcf.c gzip.ppc.o: FT:src/gzip/ftgzip.c $(CC) -c $(CFLAGS) -o $@ /FT/src/gzip/ftgzip.c +# +# FreeType2 library bzip2 support for compressed PCF bitmap fonts +# +bzip2.ppc.o: FT:src/bzip2/ftbzip2.c + $(CC) -c $(CFLAGS) -o $@ /FT/src/bzip2/ftbzip2.c + # # FreeType2 library compress support for compressed PCF bitmap fonts # diff --git a/modules/freetype2/builds/amiga/smakefile b/modules/freetype2/builds/amiga/smakefile index 2a561a8828d..097aec9b064 100644 --- a/modules/freetype2/builds/amiga/smakefile +++ b/modules/freetype2/builds/amiga/smakefile @@ -98,8 +98,8 @@ assign: # uses separate object modules in lib to make for easier debugging # also, can make smaller programs if entire engine is not used -ft2_$(CPU).lib: $(OBJBASE) $(OBJAFIT) $(OBJOTV) $(OBJPS) $(OBJRASTER) $(OBJSFNT) $(OBJCACHE) $(OBJFONTD) lzw.o gzip.o - oml $@ r $(OBJBASE) $(OBJAFIT) $(OBJOTV) $(OBJPS) $(OBJRASTER) $(OBJSFNT) $(OBJCACHE) $(OBJFONTD) lzw.o gzip.o +ft2_$(CPU).lib: $(OBJBASE) $(OBJAFIT) $(OBJOTV) $(OBJPS) $(OBJRASTER) $(OBJSFNT) $(OBJCACHE) $(OBJFONTD) lzw.o gzip.o bzip2.o + oml $@ r $(OBJBASE) $(OBJAFIT) $(OBJOTV) $(OBJPS) $(OBJRASTER) $(OBJSFNT) $(OBJCACHE) $(OBJFONTD) lzw.o gzip.o bzip2.o clean: -delete \#?.o @@ -262,6 +262,12 @@ pcf.o: $(CORE)pcf/pcf.c gzip.o: $(CORE)gzip/ftgzip.c sc $(SCFLAGS) define FAR objname=$@ $< +# +# freetype library bzip2 support for compressed PCF bitmap fonts +# +bzip2.o: $(CORE)bzip2/ftbzip2.c + sc $(SCFLAGS) define FAR objname=$@ $< + # # freetype library compress support for compressed PCF bitmap fonts # diff --git a/modules/freetype2/builds/amiga/src/base/ftsystem.c b/modules/freetype2/builds/amiga/src/base/ftsystem.c index 016f1e29e73..6f9eac17fc8 100644 --- a/modules/freetype2/builds/amiga/src/base/ftsystem.c +++ b/modules/freetype2/builds/amiga/src/base/ftsystem.c @@ -4,7 +4,7 @@ /* */ /* Amiga-specific FreeType low-level system interface (body). */ /* */ -/* Copyright 1996-2001, 2002, 2005, 2006, 2007 by */ +/* Copyright 1996-2001, 2002, 2005, 2006, 2007, 2010 by */ /* David Turner, Robert Wilhelm, Werner Lemberg and Detlef Würkner. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -442,6 +442,14 @@ Free_VecPooled( APTR poolHeader, stream->read = ft_amiga_stream_io; stream->close = ft_amiga_stream_close; + if ( !stream->size ) + { + ft_amiga_stream_close( stream ); + FT_ERROR(( "FT_Stream_Open:" )); + FT_ERROR(( " opened `%s' but zero-sized\n", filepathname )); + return FT_Err_Cannot_Open_Stream;; + } + FT_TRACE1(( "FT_Stream_Open:" )); FT_TRACE1(( " opened `%s' (%ld bytes) successfully\n", filepathname, stream->size )); diff --git a/modules/freetype2/builds/atari/gen-purec-patch.sh b/modules/freetype2/builds/atari/gen-purec-patch.sh old mode 100644 new mode 100755 diff --git a/modules/freetype2/builds/mac/FreeType.m68k_cfm.make.txt b/modules/freetype2/builds/mac/FreeType.m68k_cfm.make.txt index 3360d917677..425f9f9ce28 100644 --- a/modules/freetype2/builds/mac/FreeType.m68k_cfm.make.txt +++ b/modules/freetype2/builds/mac/FreeType.m68k_cfm.make.txt @@ -17,6 +17,7 @@ Includes = \xB6 Sym-68K = -sym off COptions = \xB6 + -d FT_MACINTOSH=1 \xB6 -d HAVE_FSSPEC=1 \xB6 -d HAVE_FSREF=0 \xB6 -d HAVE_QUICKDRAW_TOOLBOX=1 \xB6 @@ -56,6 +57,7 @@ SrcFiles = \xB6 :src:cid:type1cid.c \xB6 # :src:gxvalid:gxvalid.c \xB6 :src:gzip:ftgzip.c \xB6 + :src:bzip2:ftbzip2.c \xB6 :src:lzw:ftlzw.c \xB6 :src:otvalid:otvalid.c \xB6 :src:pcf:pcf.c \xB6 @@ -100,6 +102,7 @@ ObjFiles-68K = \xB6 "{ObjDir}type1cid.c.o" \xB6 # "{ObjDir}gxvalid.c.o" \xB6 "{ObjDir}ftgzip.c.o" \xB6 + "{ObjDir}ftbzip2.c.o" \xB6 "{ObjDir}ftlzw.c.o" \xB6 "{ObjDir}otvalid.c.o" \xB6 "{ObjDir}pcf.c.o" \xB6 @@ -177,6 +180,7 @@ FreeType.m68k_cfm.o \xC4\xC4 {ObjFiles-68K} {LibFiles-68K} {\xA5MondoBuild\xA5 "{ObjDir}type1cid.c.o" \xC4 :src:cid:type1cid.c # "{ObjDir}gxvalid.c.o" \xC4 :src:gxvalid:gxvalid.c "{ObjDir}ftgzip.c.o" \xC4 :src:gzip:ftgzip.c +"{ObjDir}ftbzip2.c.o" \xC4 :src:bzip2:ftbzip2.c "{ObjDir}ftlzw.c.o" \xC4 :src:lzw:ftlzw.c "{ObjDir}otvalid.c.o" \xC4 :src:otvalid:otvalid.c "{ObjDir}pcf.c.o" \xC4 :src:pcf:pcf.c diff --git a/modules/freetype2/builds/mac/FreeType.m68k_far.make.txt b/modules/freetype2/builds/mac/FreeType.m68k_far.make.txt index 224f8e180bc..ebf5a1b56ab 100644 --- a/modules/freetype2/builds/mac/FreeType.m68k_far.make.txt +++ b/modules/freetype2/builds/mac/FreeType.m68k_far.make.txt @@ -16,6 +16,7 @@ Includes = \xB6 Sym-68K = -sym off COptions = \xB6 + -d FT_MACINTOSH=1 \xB6 -d HAVE_FSSPEC=1 \xB6 -d HAVE_FSREF=0 \xB6 -d HAVE_QUICKDRAW_TOOLBOX=1 \xB6 @@ -55,6 +56,7 @@ SrcFiles = \xB6 :src:cid:type1cid.c \xB6 :src:gxvalid:gxvalid.c \xB6 :src:gzip:ftgzip.c \xB6 + :src:bzip2:ftbzip2.c \xB6 :src:lzw:ftlzw.c \xB6 :src:otvalid:otvalid.c \xB6 :src:pcf:pcf.c \xB6 @@ -99,6 +101,7 @@ ObjFiles-68K = \xB6 "{ObjDir}type1cid.c.o" \xB6 "{ObjDir}gxvalid.c.o" \xB6 "{ObjDir}ftgzip.c.o" \xB6 + "{ObjDir}ftbzip2.c.o" \xB6 "{ObjDir}ftlzw.c.o" \xB6 "{ObjDir}otvalid.c.o" \xB6 "{ObjDir}pcf.c.o" \xB6 @@ -176,6 +179,7 @@ FreeType.m68k_far.o \xC4\xC4 {ObjFiles-68K} {LibFiles-68K} {\xA5MondoBuild\xA5 "{ObjDir}type1cid.c.o" \xC4 :src:cid:type1cid.c "{ObjDir}gxvalid.c.o" \xC4 :src:gxvalid:gxvalid.c "{ObjDir}ftgzip.c.o" \xC4 :src:gzip:ftgzip.c +"{ObjDir}ftbzip2.c.o" \xC4 :src:bzip2:ftbzip2.c "{ObjDir}ftlzw.c.o" \xC4 :src:lzw:ftlzw.c "{ObjDir}otvalid.c.o" \xC4 :src:otvalid:otvalid.c "{ObjDir}pcf.c.o" \xC4 :src:pcf:pcf.c diff --git a/modules/freetype2/builds/mac/FreeType.ppc_carbon.make.txt b/modules/freetype2/builds/mac/FreeType.ppc_carbon.make.txt index 0b80deb4e91..2926413f395 100644 --- a/modules/freetype2/builds/mac/FreeType.ppc_carbon.make.txt +++ b/modules/freetype2/builds/mac/FreeType.ppc_carbon.make.txt @@ -17,6 +17,7 @@ Includes = \xB6 Sym-PPC = -sym off PPCCOptions = \xB6 + -d FT_MACINTOSH=1 \xB6 -d HAVE_FSSPEC=1 \xB6 -d HAVE_FSREF=1 \xB6 -d HAVE_QUICKDRAW_TOOLBOX=1 \xB6 @@ -56,6 +57,7 @@ SrcFiles = \xB6 :src:cid:type1cid.c \xB6 :src:gxvalid:gxvalid.c \xB6 :src:gzip:ftgzip.c \xB6 + :src:bzip2:ftbzip2.c \xB6 :src:lzw:ftlzw.c \xB6 :src:otvalid:otvalid.c \xB6 :src:pcf:pcf.c \xB6 @@ -100,6 +102,7 @@ ObjFiles-PPC = \xB6 "{ObjDir}type1cid.c.x" \xB6 "{ObjDir}gxvalid.c.x" \xB6 "{ObjDir}ftgzip.c.x" \xB6 + "{ObjDir}ftbzip2.c.x" \xB6 "{ObjDir}ftlzw.c.x" \xB6 "{ObjDir}otvalid.c.x" \xB6 "{ObjDir}pcf.c.x" \xB6 @@ -180,6 +183,7 @@ FreeType.ppc_carbon.o \xC4\xC4 {ObjFiles-PPC} {LibFiles-PPC} {\xA5MondoBuild\x "{ObjDir}type1cid.c.x" \xC4 :src:cid:type1cid.c "{ObjDir}gxvalid.c.x" \xC4 :src:gxvalid:gxvalid.c "{ObjDir}ftgzip.c.x" \xC4 :src:gzip:ftgzip.c +"{ObjDir}ftbzip2.c.x" \xC4 :src:bzip2:ftbzip2.c "{ObjDir}ftlzw.c.x" \xC4 :src:lzw:ftlzw.c "{ObjDir}otvalid.c.x" \xC4 :src:otvalid:otvalid.c "{ObjDir}pcf.c.x" \xC4 :src:pcf:pcf.c diff --git a/modules/freetype2/builds/mac/FreeType.ppc_classic.make.txt b/modules/freetype2/builds/mac/FreeType.ppc_classic.make.txt index ffa23b26406..377de9ab98f 100644 --- a/modules/freetype2/builds/mac/FreeType.ppc_classic.make.txt +++ b/modules/freetype2/builds/mac/FreeType.ppc_classic.make.txt @@ -17,6 +17,7 @@ Includes = \xB6 Sym-PPC = -sym off PPCCOptions = \xB6 + -d FT_MACINTOSH=1 \xB6 -d HAVE_FSSPEC=1 \xB6 -d HAVE_FSREF=0 \xB6 -d HAVE_QUICKDRAW_TOOLBOX=1 \xB6 @@ -56,6 +57,7 @@ SrcFiles = \xB6 :src:cid:type1cid.c \xB6 :src:gxvalid:gxvalid.c \xB6 :src:gzip:ftgzip.c \xB6 + :src:bzip2:ftbzip2.c \xB6 :src:lzw:ftlzw.c \xB6 :src:otvalid:otvalid.c \xB6 :src:pcf:pcf.c \xB6 @@ -100,6 +102,7 @@ ObjFiles-PPC = \xB6 "{ObjDir}type1cid.c.x" \xB6 "{ObjDir}gxvalid.c.x" \xB6 "{ObjDir}ftgzip.c.x" \xB6 + "{ObjDir}ftbzip2.c.x" \xB6 "{ObjDir}ftlzw.c.x" \xB6 "{ObjDir}otvalid.c.x" \xB6 "{ObjDir}pcf.c.x" \xB6 @@ -180,6 +183,7 @@ FreeType.ppc_classic.o \xC4\xC4 {ObjFiles-PPC} {LibFiles-PPC} {\xA5MondoBuild\ "{ObjDir}type1cid.c.x" \xC4 :src:cid:type1cid.c "{ObjDir}gxvalid.c.x" \xC4 :src:gxvalid:gxvalid.c "{ObjDir}ftgzip.c.x" \xC4 :src:gzip:ftgzip.c +"{ObjDir}ftbzip2.c.x" \xC4 :src:bzip2:ftbzip2.c "{ObjDir}ftlzw.c.x" \xC4 :src:lzw:ftlzw.c "{ObjDir}otvalid.c.x" \xC4 :src:otvalid:otvalid.c "{ObjDir}pcf.c.x" \xC4 :src:pcf:pcf.c diff --git a/modules/freetype2/builds/mac/ascii2mpw.py b/modules/freetype2/builds/mac/ascii2mpw.py old mode 100644 new mode 100755 diff --git a/modules/freetype2/builds/mac/ftmac.c b/modules/freetype2/builds/mac/ftmac.c index c974f670f2d..719dd0ce976 100644 --- a/modules/freetype2/builds/mac/ftmac.c +++ b/modules/freetype2/builds/mac/ftmac.c @@ -171,6 +171,7 @@ typedef short ResourceIndex; #define PREFER_LWFN 1 #endif +#ifdef FT_MACINTOSH #if !HAVE_QUICKDRAW_CARBON /* QuickDraw is deprecated since Mac OS X 10.4 */ @@ -1527,5 +1528,7 @@ typedef short ResourceIndex; } +#endif /* FT_MACINTOSH */ + /* END */ diff --git a/modules/freetype2/builds/symbian/bld.inf b/modules/freetype2/builds/symbian/bld.inf index 7932dcbf2b1..dd5f559d4b1 100644 --- a/modules/freetype2/builds/symbian/bld.inf +++ b/modules/freetype2/builds/symbian/bld.inf @@ -36,6 +36,7 @@ PRJ_EXPORTS ../../include/freetype/ftglyph.h freetype/ftglyph.h ../../include/freetype/ftgxval.h freetype/ftgxval.h ../../include/freetype/ftgzip.h freetype/ftgzip.h +../../include/freetype/ftbzip2.h freetype/ftbzip2.h ../../include/freetype/ftimage.h freetype/ftimage.h ../../include/freetype/ftincrem.h freetype/ftincrem.h ../../include/freetype/ftlcdfil.h freetype/ftlcdfil.h diff --git a/modules/freetype2/builds/symbian/freetype.mmp b/modules/freetype2/builds/symbian/freetype.mmp index c10f3574811..cb0008c4463 100644 --- a/modules/freetype2/builds/symbian/freetype.mmp +++ b/modules/freetype2/builds/symbian/freetype.mmp @@ -64,6 +64,10 @@ sourcepath ..\..\src\gzip source ftgzip.c +sourcepath ..\..\src\bzip2 + +source ftbzip2.c + sourcepath ..\..\src\lzw source ftlzw.c @@ -126,6 +130,7 @@ userinclude ..\..\src\cff userinclude ..\..\src\cid userinclude ..\..\src\gxvalid userinclude ..\..\src\gzip +userinclude ..\..\src\bzip2 userinclude ..\..\src\lzw userinclude ..\..\src\otvalid userinclude ..\..\src\pcf diff --git a/modules/freetype2/builds/toplevel.mk b/modules/freetype2/builds/toplevel.mk index d9fbee0b38a..18bcef2c484 100644 --- a/modules/freetype2/builds/toplevel.mk +++ b/modules/freetype2/builds/toplevel.mk @@ -122,6 +122,7 @@ ifdef check_platform # is_unix := $(strip $(wildcard /sbin/init) \ $(wildcard /usr/sbin/init) \ + $(wildcard /dev/null) \ $(wildcard /hurd/auth)) ifneq ($(is_unix),) @@ -199,7 +200,7 @@ dist: currdir=`pwd` ; \ for f in `find . -wholename '*/.git' -prune \ - -o -name .cvsignore \ + -o -name .gitignore \ -o -type d \ -o -print` ; do \ ln -s $$currdir/$$f tmp/$$f ; \ diff --git a/modules/freetype2/builds/unix/aclocal.m4 b/modules/freetype2/builds/unix/aclocal.m4 index 492a669ecc9..f90ad9fe324 100644 --- a/modules/freetype2/builds/unix/aclocal.m4 +++ b/modules/freetype2/builds/unix/aclocal.m4 @@ -14,7 +14,8 @@ # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008 Free Software Foundation, Inc. +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives @@ -23,7 +24,8 @@ m4_define([_LT_COPYING], [dnl # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008 Free Software Foundation, Inc. +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. @@ -50,7 +52,7 @@ m4_define([_LT_COPYING], [dnl # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ]) -# serial 56 LT_INIT +# serial 57 LT_INIT # LT_PREREQ(VERSION) @@ -79,6 +81,7 @@ esac # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT +AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl @@ -95,6 +98,8 @@ AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl +_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) + dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) @@ -131,7 +136,7 @@ m4_defun([_LT_CC_BASENAME], *) break;; esac done -cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` ]) @@ -151,6 +156,11 @@ m4_defun([_LT_FILEUTILS_DEFAULTS], m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl + +_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl +dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl @@ -173,10 +183,13 @@ _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl +m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl +m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl +m4_require([_LT_WITH_SYSROOT])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options which allow our @@ -192,7 +205,6 @@ fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl -_LT_PROG_ECHO_BACKSLASH case $host_os in aix3*) @@ -206,23 +218,6 @@ aix3*) ;; esac -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\([["`\\]]\)/\\\1/g' - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to delay expansion of an escaped single quote. -delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' - # Global variables: ofile=libtool can_build_shared=yes @@ -263,6 +258,28 @@ _LT_CONFIG_COMMANDS ])# _LT_SETUP +# _LT_PREPARE_SED_QUOTE_VARS +# -------------------------- +# Define a few sed substitution that help us do robust quoting. +m4_defun([_LT_PREPARE_SED_QUOTE_VARS], +[# Backslashify metacharacters that are still active within +# double-quoted strings. +sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\([["`\\]]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' +]) + # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from `configure', and `config.status' @@ -415,7 +432,7 @@ m4_define([_lt_decl_all_varnames], # declaration there will have the same value as in `configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], -[$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`']) +[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS @@ -425,7 +442,7 @@ m4_define([_LT_CONFIG_STATUS_DECLARE], # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # -# ='`$ECHO "X$" | $Xsed -e "$delay_single_quote_subst"`' +# ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) @@ -524,12 +541,20 @@ LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$[]1 +_LTECHO_EOF' +} + # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do - case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -540,9 +565,9 @@ done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do - case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -550,16 +575,38 @@ for var in lt_decl_all_varnames([[ \ esac done -# Fix-up fallback echo if it was mangled by the above quoting rules. -case \$lt_ECHO in -*'\\\[$]0 --fallback-echo"')dnl " - lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\` - ;; -esac - _LT_OUTPUT_LIBTOOL_INIT ]) +# _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) +# ------------------------------------ +# Generate a child script FILE with all initialization necessary to +# reuse the environment learned by the parent script, and make the +# file executable. If COMMENT is supplied, it is inserted after the +# `#!' sequence but before initialization text begins. After this +# macro, additional text can be appended to FILE to form the body of +# the child script. The macro ends with non-zero status if the +# file could not be fully written (such as if the disk is full). +m4_ifdef([AS_INIT_GENERATED], +[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], +[m4_defun([_LT_GENERATED_FILE_INIT], +[m4_require([AS_PREPARE])]dnl +[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl +[lt_write_fail=0 +cat >$1 <<_ASEOF || lt_write_fail=1 +#! $SHELL +# Generated by $as_me. +$2 +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$1 <<\_ASEOF || lt_write_fail=1 +AS_SHELL_SANITIZE +_AS_PREPARE +exec AS_MESSAGE_FD>&1 +_ASEOF +test $lt_write_fail = 0 && chmod +x $1[]dnl +m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- @@ -569,20 +616,11 @@ _LT_OUTPUT_LIBTOOL_INIT AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) -cat >"$CONFIG_LT" <<_LTEOF -#! $SHELL -# Generated by $as_me. -# Run this file to recreate a libtool stub with the current configuration. - -lt_cl_silent=false -SHELL=\${CONFIG_SHELL-$SHELL} -_LTEOF +_LT_GENERATED_FILE_INIT(["$CONFIG_LT"], +[# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF -AS_SHELL_SANITIZE -_AS_PREPARE - -exec AS_MESSAGE_FD>&1 +lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo @@ -608,7 +646,7 @@ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. -Copyright (C) 2008 Free Software Foundation, Inc. +Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." @@ -653,15 +691,13 @@ chmod +x "$CONFIG_LT" # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. -if test "$no_create" != yes; then - lt_cl_success=: - test "$silent" = yes && - lt_config_lt_args="$lt_config_lt_args --quiet" - exec AS_MESSAGE_LOG_FD>/dev/null - $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false - exec AS_MESSAGE_LOG_FD>>config.log - $lt_cl_success || AS_EXIT(1) -fi +lt_cl_success=: +test "$silent" = yes && + lt_config_lt_args="$lt_config_lt_args --quiet" +exec AS_MESSAGE_LOG_FD>/dev/null +$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false +exec AS_MESSAGE_LOG_FD>>config.log +$lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT @@ -691,6 +727,7 @@ _LT_CONFIG_SAVE_COMMANDS([ # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # _LT_COPYING @@ -723,15 +760,12 @@ _LT_EOF # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? - sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ - || (rm -f "$cfgfile"; exit 1) + sed '$q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) - _LT_PROG_XSI_SHELLFNS + _LT_PROG_REPLACE_SHELLFNS - sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ - || (rm -f "$cfgfile"; exit 1) - - mv -f "$cfgfile" "$ofile" || + mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], @@ -776,6 +810,7 @@ AC_DEFUN([LT_LANG], m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], + [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], @@ -797,6 +832,29 @@ m4_defun([_LT_LANG], ])# _LT_LANG +m4_ifndef([AC_PROG_GO], [ +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_GO. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # +m4_defun([AC_PROG_GO], +[AC_LANG_PUSH(Go)dnl +AC_ARG_VAR([GOC], [Go compiler command])dnl +AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl +_AC_ARG_VAR_LDFLAGS()dnl +AC_CHECK_TOOL(GOC, gccgo) +if test -z "$GOC"; then + if test -n "$ac_tool_prefix"; then + AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) + fi +fi +if test -z "$GOC"; then + AC_CHECK_PROG(GOC, gccgo, gccgo, false) +fi +])#m4_defun +])#m4_ifndef + + # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], @@ -827,6 +885,10 @@ AC_PROVIDE_IFELSE([AC_PROG_GCJ], m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) +AC_PROVIDE_IFELSE([AC_PROG_GO], + [LT_LANG(GO)], + [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) + AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) @@ -837,11 +899,13 @@ AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) +AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) +dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER @@ -927,7 +991,13 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? - if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then + # If there is a non-empty error log, and "single_module" + # appears in it, assume the flag caused a linker warning + if test -s conftest.err && $GREP single_module conftest.err; then + cat conftest.err >&AS_MESSAGE_LOG_FD + # Otherwise, if the output was created with a 0 exit code from + # the compiler, it worked. + elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD @@ -935,6 +1005,7 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ rm -rf libconftest.dylib* rm -f conftest.* fi]) + AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no @@ -946,6 +1017,34 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) + + AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], + [lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD + echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD + $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD + echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD + $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -s conftest.err && $GREP force_load conftest.err; then + cat conftest.err >&AS_MESSAGE_LOG_FD + elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&AS_MESSAGE_LOG_FD + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; @@ -973,7 +1072,7 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi - if test "$DSYMUTIL" != ":"; then + if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= @@ -983,8 +1082,8 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ ]) -# _LT_DARWIN_LINKER_FEATURES -# -------------------------- +# _LT_DARWIN_LINKER_FEATURES([TAG]) +# --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ @@ -993,7 +1092,13 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES], _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_TAGVAR(whole_archive_flag_spec, $1)='' + if test "$lt_cv_ld_force_load" = "yes"; then + _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\"`' + m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], + [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) + else + _LT_TAGVAR(whole_archive_flag_spec, $1)='' + fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" case $cc_basename in @@ -1001,7 +1106,7 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES], *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then - output_verbose_link_cmd=echo + output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" @@ -1017,203 +1122,142 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES], fi ]) -# _LT_SYS_MODULE_PATH_AIX -# ----------------------- +# _LT_SYS_MODULE_PATH_AIX([TAGNAME]) +# ---------------------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. +# Store the results from the different compilers for each TAGNAME. +# Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl -AC_LINK_IFELSE(AC_LANG_PROGRAM,[ -lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\(.*\)$/\1/ - p - } - }' -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then - aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -fi],[]) -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi +if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], + [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ + lt_aix_libpath_sed='[ + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }]' + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi],[]) + if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" + fi + ]) + aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) +fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], -[ifdef([AC_DIVERSION_NOTICE], - [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], - [AC_DIVERT_PUSH(NOTICE)]) -$1 -AC_DIVERT_POP -])# _LT_SHELL_INIT +[m4_divert_text([M4SH-INIT], [$1 +])])# _LT_SHELL_INIT + # _LT_PROG_ECHO_BACKSLASH # ----------------------- -# Add some code to the start of the generated configure script which -# will find an echo command which doesn't interpret backslashes. +# Find how we can fake an echo command that does not interpret backslash. +# In particular, with Autoconf 2.60 or later we add some code to the start +# of the generated configure script which will find a shell with a builtin +# printf (which we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], -[_LT_SHELL_INIT([ -# Check that we are running under the correct shell. -SHELL=${CONFIG_SHELL-/bin/sh} +[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO -case X$lt_ECHO in -X*--fallback-echo) - # Remove one level of quotation (which was required for Make). - ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` - ;; +AC_MSG_CHECKING([how to print strings]) +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' +else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$[]1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} + +case "$ECHO" in + printf*) AC_MSG_RESULT([printf]) ;; + print*) AC_MSG_RESULT([print -r]) ;; + *) AC_MSG_RESULT([cat]) ;; esac -ECHO=${lt_ECHO-echo} -if test "X[$]1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X[$]1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then - # Yippee, $ECHO works! - : -else - # Restart under the correct shell. - exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} -fi +m4_ifdef([_AS_DETECT_SUGGESTED], +[_AS_DETECT_SUGGESTED([ + test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test "X`printf %s $ECHO`" = "X$ECHO" \ + || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) -if test "X[$]1" = X--fallback-echo; then - # used as fallback echo - shift - cat <<_LT_EOF -[$]* -_LT_EOF - exit 0 -fi - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -if test -z "$lt_ECHO"; then - if test "X${echo_test_string+set}" != Xset; then - # find a string as large as possible, as long as the shell can cope with it - for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do - # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... - if { echo_test_string=`eval $cmd`; } 2>/dev/null && - { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null - then - break - fi - done - fi - - if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && - echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - : - else - # The Solaris, AIX, and Digital Unix default echo programs unquote - # backslashes. This makes it impossible to quote backslashes using - # echo "$something" | sed 's/\\/\\\\/g' - # - # So, first we look for a working echo in the user's PATH. - - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for dir in $PATH /usr/ucb; do - IFS="$lt_save_ifs" - if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && - test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - ECHO="$dir/echo" - break - fi - done - IFS="$lt_save_ifs" - - if test "X$ECHO" = Xecho; then - # We didn't find a better echo, so look for alternatives. - if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && - echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # This shell has a builtin print -r that does the trick. - ECHO='print -r' - elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && - test "X$CONFIG_SHELL" != X/bin/ksh; then - # If we have ksh, try running configure again with it. - ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} - export ORIGINAL_CONFIG_SHELL - CONFIG_SHELL=/bin/ksh - export CONFIG_SHELL - exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} - else - # Try using printf. - ECHO='printf %s\n' - if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && - echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # Cool, printf works - : - elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL - export CONFIG_SHELL - SHELL="$CONFIG_SHELL" - export SHELL - ECHO="$CONFIG_SHELL [$]0 --fallback-echo" - elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - ECHO="$CONFIG_SHELL [$]0 --fallback-echo" - else - # maybe with a smaller string... - prev=: - - for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do - if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null - then - break - fi - prev="$cmd" - done - - if test "$prev" != 'sed 50q "[$]0"'; then - echo_test_string=`eval $prev` - export echo_test_string - exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} - else - # Oops. We lost completely, so just stick with echo. - ECHO=echo - fi - fi - fi - fi - fi -fi - -# Copy echo and quote the copy suitably for passing to libtool from -# the Makefile, instead of quoting the original, which is used later. -lt_ECHO=$ECHO -if test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then - lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" -fi - -AC_SUBST(lt_ECHO) -]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) -_LT_DECL([], [ECHO], [1], - [An echo program that does not interpret backslashes]) +_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH +# _LT_WITH_SYSROOT +# ---------------- +AC_DEFUN([_LT_WITH_SYSROOT], +[AC_MSG_CHECKING([for sysroot]) +AC_ARG_WITH([sysroot], +[ --with-sysroot[=DIR] Search for dependent libraries within DIR + (or the compiler's sysroot if not specified).], +[], [with_sysroot=no]) + +dnl lt_sysroot will always be passed unquoted. We quote it here +dnl in case the user passed a directory name. +lt_sysroot= +case ${with_sysroot} in #( + yes) + if test "$GCC" = yes; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( + /*) + lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) + AC_MSG_RESULT([${with_sysroot}]) + AC_MSG_ERROR([The sysroot must be an absolute path.]) + ;; +esac + + AC_MSG_RESULT([${lt_sysroot:-no}]) +_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl +[dependent libraries, and in which our libraries should be installed.])]) + # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], @@ -1242,7 +1286,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '[#]line __oline__ "configure"' > conftest.$ac_ext + echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in @@ -1335,14 +1379,27 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) CFLAGS="$SAVE_CFLAGS" fi ;; -sparc*-*solaris*) +*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in - yes*) LD="${LD-ld} -m elf64_sparc" ;; + yes*) + case $host in + i?86-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + # GNU ld 2.21 introduced _sol2 emulations. Use them if available. + if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then + LD="${LD-ld}_sol2" + fi + ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" @@ -1360,14 +1417,47 @@ need_locks="$enable_libtool_lock" ])# _LT_ENABLE_LOCK +# _LT_PROG_AR +# ----------- +m4_defun([_LT_PROG_AR], +[AC_CHECK_TOOLS(AR, [ar], false) +: ${AR=ar} +: ${AR_FLAGS=cru} +_LT_DECL([], [AR], [1], [The archiver]) +_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) + +AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], + [lt_cv_ar_at_file=no + AC_COMPILE_IFELSE([AC_LANG_PROGRAM], + [echo conftest.$ac_objext > conftest.lst + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' + AC_TRY_EVAL([lt_ar_try]) + if test "$ac_status" -eq 0; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + AC_TRY_EVAL([lt_ar_try]) + if test "$ac_status" -ne 0; then + lt_cv_ar_at_file=@ + fi + fi + rm -f conftest.* libconftest.a + ]) + ]) + +if test "x$lt_cv_ar_at_file" = xno; then + archiver_list_spec= +else + archiver_list_spec=$lt_cv_ar_at_file +fi +_LT_DECL([], [archiver_list_spec], [1], + [How to feed a file listing to the archiver]) +])# _LT_PROG_AR + + # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], -[AC_CHECK_TOOL(AR, ar, false) -test -z "$AR" && AR=ar -test -z "$AR_FLAGS" && AR_FLAGS=cru -_LT_DECL([], [AR], [1], [The archiver]) -_LT_DECL([], [AR_FLAGS], [1]) +[_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: @@ -1386,18 +1476,27 @@ old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" + old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi + +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) +_LT_DECL([], [lock_old_archive_extraction], [0], + [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE @@ -1422,15 +1521,15 @@ AC_CACHE_CHECK([$1], [$2], -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. - $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes @@ -1470,7 +1569,7 @@ AC_CACHE_CHECK([$1], [$2], if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD - $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes @@ -1533,6 +1632,11 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl lt_cv_sys_max_cmd_len=8192; ;; + mint*) + # On MiNT this can take a long time and run out of memory. + lt_cv_sys_max_cmd_len=8192; + ;; + amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. @@ -1558,6 +1662,11 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl lt_cv_sys_max_cmd_len=196608 ;; + os2*) + # The test takes a long time on OS/2. + lt_cv_sys_max_cmd_len=8192 + ;; + osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not @@ -1597,8 +1706,8 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. - while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ - = "XX$teststring$teststring"; } >/dev/null 2>&1 && + while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` @@ -1649,7 +1758,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -[#line __oline__ "configure" +[#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -1690,7 +1799,13 @@ else # endif #endif -void fnord() { int i=42;} +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); @@ -1699,7 +1814,11 @@ int main () if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } /* dlclose (self); */ } else @@ -1875,16 +1994,16 @@ AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings - $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes @@ -2043,6 +2162,7 @@ m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl +m4_require([_LT_CHECK_SHELL_FEATURES])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ @@ -2051,16 +2171,23 @@ if test "$GCC" = yes; then darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac - lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; + *) lt_sed_strip_eq="s,=/,/,g" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'` - else - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= @@ -2073,7 +2200,7 @@ if test "$GCC" = yes; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done - lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk ' + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; @@ -2093,7 +2220,13 @@ BEGIN {RS=" "; FS="/|\n";} { if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` - sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) @@ -2119,7 +2252,7 @@ need_version=unknown case $host_os in aix3*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH @@ -2128,7 +2261,7 @@ aix3*) ;; aix[[4-9]]*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes @@ -2181,7 +2314,7 @@ amigaos*) m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; @@ -2193,7 +2326,7 @@ beos*) ;; bsdi[[45]]*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' @@ -2212,8 +2345,9 @@ cygwin* | mingw* | pw32* | cegcc*) need_version=no need_lib_prefix=no - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) + case $GCC,$cc_basename in + yes,*) + # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ @@ -2234,36 +2368,83 @@ cygwin* | mingw* | pw32* | cegcc*) cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" +m4_if([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + library_names_spec='${libname}.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec="$LIB" + if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' ;; *) + # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' + dynamic_linker='Win32 ld.exe' ;; esac - dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; @@ -2284,7 +2465,7 @@ m4_if([$1], [],[ ;; dgux*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' @@ -2292,10 +2473,6 @@ dgux*) shlibpath_var=LD_LIBRARY_PATH ;; -freebsd1*) - dynamic_linker=no - ;; - freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. @@ -2303,7 +2480,7 @@ freebsd* | dragonfly*) objformat=`/usr/bin/objformat` else case $host_os in - freebsd[[123]]*) objformat=aout ;; + freebsd[[23]].*) objformat=aout ;; *) objformat=elf ;; esac fi @@ -2321,7 +2498,7 @@ freebsd* | dragonfly*) esac shlibpath_var=LD_LIBRARY_PATH case $host_os in - freebsd2*) + freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) @@ -2341,12 +2518,26 @@ freebsd* | dragonfly*) ;; gnu*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=yes + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; @@ -2392,12 +2583,14 @@ hpux9* | hpux10* | hpux11*) soname_spec='${libname}${release}${shared_ext}$major' ;; esac - # HP-UX runs *really* slowly unless shared libraries are mode 555. + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 ;; interix[[3-9]]*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' @@ -2413,7 +2606,7 @@ irix5* | irix6* | nonstopux*) nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; @@ -2450,9 +2643,9 @@ linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; -# This must be Linux ELF. -linux* | k*bsd*-gnu) - version_type=linux +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -2460,16 +2653,21 @@ linux* | k*bsd*-gnu) finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no + # Some binutils ld are patched to set DT_RUNPATH - save_LDFLAGS=$LDFLAGS - save_libdir=$libdir - eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ - LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" - AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], - [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], - [shlibpath_overrides_runpath=yes])]) - LDFLAGS=$save_LDFLAGS - libdir=$save_libdir + AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], + [lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ + LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], + [lt_cv_shlibpath_overrides_runpath=yes])]) + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + ]) + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install @@ -2478,7 +2676,7 @@ linux* | k*bsd*-gnu) # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi @@ -2510,7 +2708,7 @@ netbsd*) ;; newsos6) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes @@ -2579,7 +2777,7 @@ rdos*) ;; solaris*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -2604,7 +2802,7 @@ sunos4*) ;; sysv4 | sysv4.3*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH @@ -2628,7 +2826,7 @@ sysv4 | sysv4.3*) sysv4*MP*) if test -d /usr/nec ;then - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH @@ -2659,7 +2857,7 @@ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -2669,7 +2867,7 @@ tpf*) ;; uts4*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH @@ -2711,6 +2909,8 @@ _LT_DECL([], [library_names_spec], [1], The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) +_LT_DECL([], [install_override_mode], [1], + [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], @@ -2823,6 +3023,7 @@ AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], @@ -2944,6 +3145,11 @@ case $reload_flag in esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + if test "$GCC" != yes; then + reload_cmds=false + fi + ;; darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' @@ -2952,8 +3158,8 @@ case $host_os in fi ;; esac -_LT_DECL([], [reload_flag], [1], [How to create reloadable object files])dnl -_LT_DECL([], [reload_cmds], [2])dnl +_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl +_LT_TAGDECL([], [reload_cmds], [2])dnl ])# _LT_CMD_RELOAD @@ -3005,16 +3211,18 @@ mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. - if ( file / ) >/dev/null 2>&1; then + # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. + if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else - lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; -cegcc) +cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' @@ -3044,6 +3252,10 @@ gnu*) lt_cv_deplibs_check_method=pass_all ;; +haiku*) + lt_cv_deplibs_check_method=pass_all + ;; + hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in @@ -3052,11 +3264,11 @@ hpux10.20* | hpux11*) lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) - [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] + [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) - lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac @@ -3077,8 +3289,8 @@ irix5* | irix6* | nonstopux*) lt_cv_deplibs_check_method=pass_all ;; -# This must be Linux ELF. -linux* | k*bsd*-gnu) +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; @@ -3156,6 +3368,21 @@ tpf*) ;; esac ]) + +file_magic_glob= +want_nocaseglob=no +if test "$build" = "$host"; then + case $host_os in + mingw* | pw32*) + if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then + want_nocaseglob=yes + else + file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` + fi + ;; + esac +fi + file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown @@ -3163,7 +3390,11 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], - [Command to use when deplibs_check_method == "file_magic"]) + [Command to use when deplibs_check_method = "file_magic"]) +_LT_DECL([], [file_magic_glob], [1], + [How to find potential files when deplibs_check_method = "file_magic"]) +_LT_DECL([], [want_nocaseglob], [1], + [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD @@ -3220,7 +3451,19 @@ if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. - AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :) + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) + case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols" + ;; + *) + DUMPBIN=: + ;; + esac + fi AC_SUBST([DUMPBIN]) if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" @@ -3233,13 +3476,13 @@ _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD) + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD - (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD - (eval echo "\"\$as_me:__oline__: output\"" >&AS_MESSAGE_LOG_FD) + (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" @@ -3254,6 +3497,67 @@ dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) +# _LT_CHECK_SHAREDLIB_FROM_LINKLIB +# -------------------------------- +# how to determine the name of the shared library +# associated with a specific link library. +# -- PORTME fill in with the dynamic library characteristics +m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], +[m4_require([_LT_DECL_EGREP]) +m4_require([_LT_DECL_OBJDUMP]) +m4_require([_LT_DECL_DLLTOOL]) +AC_CACHE_CHECK([how to associate runtime and link libraries], +lt_cv_sharedlib_from_linklib_cmd, +[lt_cv_sharedlib_from_linklib_cmd='unknown' + +case $host_os in +cygwin* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh + # decide which to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback + ;; + esac + ;; +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd="$ECHO" + ;; +esac +]) +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO + +_LT_DECL([], [sharedlib_from_linklib_cmd], [1], + [Command to associate shared and link libraries]) +])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB + + +# _LT_PATH_MANIFEST_TOOL +# ---------------------- +# locate the manifest tool +m4_defun([_LT_PATH_MANIFEST_TOOL], +[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) +test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt +AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], + [lt_cv_path_mainfest_tool=no + echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD + $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out + cat conftest.err >&AS_MESSAGE_LOG_FD + if $GREP 'Manifest Tool' conftest.out > /dev/null; then + lt_cv_path_mainfest_tool=yes + fi + rm -f conftest*]) +if test "x$lt_cv_path_mainfest_tool" != xyes; then + MANIFEST_TOOL=: +fi +_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl +])# _LT_PATH_MANIFEST_TOOL + # LT_LIB_M # -------- @@ -3262,7 +3566,7 @@ AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in -*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) +*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) @@ -3290,7 +3594,12 @@ m4_defun([_LT_COMPILER_NO_RTTI], _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then - _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + case $cc_basename in + nvcc*) + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; + *) + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; + esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, @@ -3307,6 +3616,7 @@ _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl @@ -3374,8 +3684,8 @@ esac lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= @@ -3399,6 +3709,7 @@ for ac_symprfx in "" "_"; do # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ +" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ @@ -3411,6 +3722,7 @@ for ac_symprfx in "" "_"; do else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no @@ -3432,7 +3744,7 @@ _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm - if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then + if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" @@ -3444,6 +3756,18 @@ _LT_EOF if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT@&t@_DLSYM_CONST +#elif defined(__osf__) +/* This system does not cope well with relocations in const data. */ +# define LT@&t@_DLSYM_CONST +#else +# define LT@&t@_DLSYM_CONST const +#endif + #ifdef __cplusplus extern "C" { #endif @@ -3455,7 +3779,7 @@ _LT_EOF cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ -const struct { +LT@&t@_DLSYM_CONST struct { const char *name; void *address; } @@ -3481,15 +3805,15 @@ static const void *lt_preloaded_setup() { _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext - lt_save_LIBS="$LIBS" - lt_save_CFLAGS="$CFLAGS" + lt_globsym_save_LIBS=$LIBS + lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi - LIBS="$lt_save_LIBS" - CFLAGS="$lt_save_CFLAGS" + LIBS=$lt_globsym_save_LIBS + CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi @@ -3522,6 +3846,13 @@ else AC_MSG_RESULT(ok) fi +# Response file support. +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + nm_file_list_spec='@' +elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then + nm_file_list_spec='@' +fi + _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], @@ -3532,6 +3863,8 @@ _LT_DECL([global_symbol_to_c_name_address], _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) +_LT_DECL([], [nm_file_list_spec], [1], + [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS @@ -3543,7 +3876,6 @@ _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= -AC_MSG_CHECKING([for $compiler option to produce PIC]) m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then @@ -3594,6 +3926,11 @@ m4_if([$1], [CXX], [ # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + _LT_TAGVAR(lt_prog_compiler_static, $1)= + ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. @@ -3643,6 +3980,12 @@ m4_if([$1], [CXX], [ ;; esac ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; dgux*) case $cc_basename in ec++*) @@ -3699,7 +4042,7 @@ m4_if([$1], [CXX], [ ;; esac ;; - linux* | k*bsd*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler @@ -3732,8 +4075,8 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; - xlc* | xlC*) - # IBM XL 8.0 on PPC + xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) + # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' @@ -3795,7 +4138,7 @@ m4_if([$1], [CXX], [ ;; solaris*) case $cc_basename in - CC*) + CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' @@ -3899,6 +4242,12 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + _LT_TAGVAR(lt_prog_compiler_static, $1)= + ;; + hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag @@ -3941,6 +4290,15 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' + if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" + fi + ;; + esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in @@ -3983,7 +4341,7 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; - linux* | k*bsd*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) @@ -4004,7 +4362,13 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; - pgcc* | pgf77* | pgf90* | pgf95*) + nagfor*) + # NAG Fortran compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' @@ -4016,25 +4380,40 @@ m4_if([$1], [CXX], [ # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; - xl*) - # IBM XL C 8.0/Fortran 10.1 on PPC + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in + *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='' + ;; + *Sun\ F* | *Sun*Fortran*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; - *Sun\ F*) - # Sun Fortran 8.3 passes all unrecognized flags to the linker - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + *Intel*\ [[CF]]*Compiler*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + *Portland\ Group*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; esac ;; @@ -4066,7 +4445,7 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in - f77* | f90* | f95*) + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; @@ -4123,9 +4502,11 @@ case $host_os in _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac -AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) -_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], - [How to pass a linker flag through the compiler]) + +AC_CACHE_CHECK([for $compiler option to produce PIC], + [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], + [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) +_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. @@ -4144,6 +4525,8 @@ fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) +_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], + [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # @@ -4164,6 +4547,7 @@ _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl +m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl @@ -4172,27 +4556,37 @@ m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global defined + # symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" - ;; + ;; cygwin* | mingw* | cegcc*) - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' - ;; + case $cc_basename in + cl*) + _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + ;; + *) + _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' + _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] + ;; + esac + ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - ;; + ;; esac - _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= @@ -4207,7 +4601,6 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported @@ -4255,7 +4648,33 @@ dnl Note also adjust exclude_expsyms for C++ above. esac _LT_TAGVAR(ld_shlibs, $1)=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; + *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' @@ -4273,6 +4692,7 @@ dnl Note also adjust exclude_expsyms for C++ above. fi supports_anon_versioning=no case `$LD -v 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... @@ -4288,11 +4708,12 @@ dnl Note also adjust exclude_expsyms for C++ above. _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 -*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to modify your PATH -*** so that a non-GNU linker is found, and then restart. +*** really care for shared libraries, you may want to install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. _LT_EOF fi @@ -4328,10 +4749,12 @@ _LT_EOF # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - _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' + _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' + _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' @@ -4349,6 +4772,11 @@ _LT_EOF fi ;; + haiku*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no @@ -4364,7 +4792,7 @@ _LT_EOF _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; - gnu* | linux* | tpf* | k*bsd*-gnu) + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in @@ -4374,15 +4802,16 @@ _LT_EOF if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then - tmp_addflag= + tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; - pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group f77 and f90 compilers + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; @@ -4393,13 +4822,17 @@ _LT_EOF lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; - xl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) + xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 @@ -4415,17 +4848,16 @@ _LT_EOF fi case $cc_basename in - xlf*) + xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' - _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ - $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac @@ -4439,8 +4871,8 @@ _LT_EOF _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; @@ -4458,8 +4890,8 @@ _LT_EOF _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi @@ -4505,8 +4937,8 @@ _LT_EOF *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi @@ -4546,8 +4978,10 @@ _LT_EOF else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global + # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi @@ -4634,9 +5068,9 @@ _LT_EOF _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. - _LT_SYS_MODULE_PATH_AIX + _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' @@ -4645,14 +5079,19 @@ _LT_EOF else # Determine the default libpath from the value encoded in an # empty executable. - _LT_SYS_MODULE_PATH_AIX + _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' @@ -4684,20 +5123,64 @@ _LT_EOF # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' - # FIXME: Should let the user specify the lib program. - _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' - _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + case $cc_basename in + cl*) + # Native MSVC + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + _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' + # Don't use ranlib + _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' + _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # Assume MSVC wrapper + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + # FIXME: Should let the user specify the lib program. + _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + esac ;; darwin* | rhapsody*) @@ -4710,10 +5193,6 @@ _LT_EOF _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; - freebsd1*) - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little @@ -4726,7 +5205,7 @@ _LT_EOF ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) + freebsd2.*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes @@ -4735,7 +5214,7 @@ _LT_EOF # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no @@ -4743,7 +5222,7 @@ _LT_EOF hpux9*) if test "$GCC" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi @@ -4758,14 +5237,13 @@ _LT_EOF ;; hpux10*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes @@ -4777,16 +5255,16 @@ _LT_EOF ;; hpux11*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then + if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else @@ -4798,7 +5276,14 @@ _LT_EOF _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + m4_if($1, [], [ + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + _LT_LINKER_OPTION([if $CC understands -b], + _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], + [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], + [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], + [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi @@ -4826,19 +5311,34 @@ _LT_EOF irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" - AC_LINK_IFELSE(int foo(void) {}, - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' - ) - LDFLAGS="$save_LDFLAGS" + # This should be the same for all languages, so no per-tag cache variable. + AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], + [lt_cv_irix_exported_symbol], + [save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + AC_LINK_IFELSE( + [AC_LANG_SOURCE( + [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], + [C++], [[int foo (void) { return 0; }]], + [Fortran 77], [[ + subroutine foo + end]], + [Fortran], [[ + subroutine foo + end]])])], + [lt_cv_irix_exported_symbol=yes], + [lt_cv_irix_exported_symbol=no]) + LDFLAGS="$save_LDFLAGS"]) + if test "$lt_cv_irix_exported_symbol" = yes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + fi else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' @@ -4900,17 +5400,17 @@ _LT_EOF _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' @@ -4920,13 +5420,13 @@ _LT_EOF osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ - $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' @@ -4939,9 +5439,9 @@ _LT_EOF _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) @@ -5117,36 +5617,38 @@ x|xyes) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. - AC_MSG_CHECKING([whether -lc should be explicitly linked in]) - $RM conftest* - echo "$lt_simple_compile_test_code" > conftest.$ac_ext + AC_CACHE_CHECK([whether -lc should be explicitly linked in], + [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), + [$RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile) 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) - pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) - _LT_TAGVAR(allow_undefined_flag, $1)= - if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) - then - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - else - _LT_TAGVAR(archive_cmds_need_lc, $1)=yes - fi - _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $RM conftest* - AC_MSG_RESULT([$_LT_TAGVAR(archive_cmds_need_lc, $1)]) + if AC_TRY_EVAL(ac_compile) 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) + pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) + _LT_TAGVAR(allow_undefined_flag, $1)= + if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) + then + lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no + else + lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes + fi + _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + ]) + _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi @@ -5183,9 +5685,6 @@ _LT_TAGDECL([], [no_undefined_flag], [1], _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) -_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1], - [[If ld is used when linking, flag to hardcode $libdir into a binary - during linking. This must work even if $libdir does not exist]]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], @@ -5211,8 +5710,6 @@ _LT_TAGDECL([], [inherit_rpath], [0], to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) -_LT_TAGDECL([], [fix_srcfile_path], [1], - [Fix the shell variable $srcfile for the compiler]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], @@ -5223,6 +5720,8 @@ _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) +_LT_TAGDECL([], [postlink_cmds], [2], + [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented @@ -5312,14 +5811,15 @@ CC="$lt_save_CC" ])# _LT_LANG_C_CONFIG -# _LT_PROG_CXX -# ------------ -# Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++ -# compiler, we have our own version here. -m4_defun([_LT_PROG_CXX], -[ -pushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes]) -AC_PROG_CXX +# _LT_LANG_CXX_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for a C++ compiler are suitably +# defined. These variables are subsequently used by _LT_CONFIG to write +# the compiler configuration to `libtool'. +m4_defun([_LT_LANG_CXX_CONFIG], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_PATH_MANIFEST_TOOL])dnl if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then @@ -5327,22 +5827,6 @@ if test -n "$CXX" && ( test "X$CXX" != "Xno" && else _lt_caught_CXX_error=yes fi -popdef([AC_MSG_ERROR]) -])# _LT_PROG_CXX - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([_LT_PROG_CXX], []) - - -# _LT_LANG_CXX_CONFIG([TAG]) -# -------------------------- -# Ensure that the configuration variables for a C++ compiler are suitably -# defined. These variables are subsequently used by _LT_CONFIG to write -# the compiler configuration to `libtool'. -m4_defun([_LT_LANG_CXX_CONFIG], -[AC_REQUIRE([_LT_PROG_CXX])dnl -m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_DECL_EGREP])dnl AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no @@ -5354,7 +5838,6 @@ _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported @@ -5364,6 +5847,8 @@ _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no @@ -5395,6 +5880,7 @@ if test "$_lt_caught_CXX_error" != yes; then # Allow CC to be a program name with arguments. lt_save_CC=$CC + lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX @@ -5412,6 +5898,7 @@ if test "$_lt_caught_CXX_error" != yes; then fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} + CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) @@ -5433,8 +5920,8 @@ if test "$_lt_caught_CXX_error" != yes; then # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' @@ -5466,7 +5953,7 @@ if test "$_lt_caught_CXX_error" != yes; then # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no @@ -5575,10 +6062,10 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty # executable. - _LT_SYS_MODULE_PATH_AIX + _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' @@ -5587,14 +6074,19 @@ if test "$_lt_caught_CXX_error" != yes; then else # Determine the default libpath from the value encoded in an # empty executable. - _LT_SYS_MODULE_PATH_AIX + _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared # libraries. @@ -5624,28 +6116,75 @@ if test "$_lt_caught_CXX_error" != yes; then ;; cygwin* | mingw* | pw32* | cegcc*) - # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, - # as there is no search path for DLLs. - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(always_export_symbols, $1)=no - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + case $GXX,$cc_basename in + ,cl* | no,cl*) + # Native MSVC + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + # Don't use ranlib + _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' + _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + func_to_tool_file "$lt_outputfile"~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # g++ + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; @@ -5668,7 +6207,7 @@ if test "$_lt_caught_CXX_error" != yes; then esac ;; - freebsd[[12]]*) + freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no @@ -5687,6 +6226,11 @@ if test "$_lt_caught_CXX_error" != yes; then gnu*) ;; + haiku*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: @@ -5711,11 +6255,11 @@ if test "$_lt_caught_CXX_error" != yes; then # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no @@ -5776,7 +6320,7 @@ if test "$_lt_caught_CXX_error" != yes; then # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then @@ -5786,10 +6330,10 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi @@ -5819,7 +6363,7 @@ if test "$_lt_caught_CXX_error" != yes; then case $cc_basename in CC*) # SGI C++ - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is @@ -5830,9 +6374,9 @@ if test "$_lt_caught_CXX_error" != yes; then *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes @@ -5843,7 +6387,7 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(inherit_rpath, $1)=yes ;; - linux* | k*bsd*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler @@ -5861,7 +6405,7 @@ if test "$_lt_caught_CXX_error" != yes; then # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' @@ -5898,26 +6442,26 @@ if test "$_lt_caught_CXX_error" != yes; then pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in - *pgCC\ [[1-5]]* | *pgcpp\ [[1-5]]*) + *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ - compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"' + compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ - $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; - *) # Version 6 will use weak symbols + *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; @@ -5925,7 +6469,7 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ @@ -5944,9 +6488,9 @@ if test "$_lt_caught_CXX_error" != yes; then # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; - xl*) + xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' @@ -5966,13 +6510,13 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. - output_verbose_link_cmd='echo' + output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is @@ -6041,7 +6585,7 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi - output_verbose_link_cmd=echo + output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi @@ -6076,15 +6620,15 @@ if test "$_lt_caught_CXX_error" != yes; then case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; @@ -6100,17 +6644,17 @@ if test "$_lt_caught_CXX_error" != yes; then # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac @@ -6120,7 +6664,7 @@ if test "$_lt_caught_CXX_error" != yes; then # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support @@ -6156,7 +6700,7 @@ if test "$_lt_caught_CXX_error" != yes; then solaris*) case $cc_basename in - CC*) + CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' @@ -6177,7 +6721,7 @@ if test "$_lt_caught_CXX_error" != yes; then esac _LT_TAGVAR(link_all_deplibs, $1)=yes - output_verbose_link_cmd='echo' + output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is @@ -6197,14 +6741,14 @@ if test "$_lt_caught_CXX_error" != yes; then if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. @@ -6215,7 +6759,7 @@ if test "$_lt_caught_CXX_error" != yes; then # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' @@ -6269,6 +6813,10 @@ if test "$_lt_caught_CXX_error" != yes; then CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ + '"$_LT_TAGVAR(old_archive_cmds, $1)" + _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ + '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' @@ -6324,6 +6872,7 @@ if test "$_lt_caught_CXX_error" != yes; then fi # test -n "$compiler" CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC @@ -6338,6 +6887,29 @@ AC_LANG_POP ])# _LT_LANG_CXX_CONFIG +# _LT_FUNC_STRIPNAME_CNF +# ---------------------- +# func_stripname_cnf prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# +# This function is identical to the (non-XSI) version of func_stripname, +# except this one can be used by m4 code that may be executed by configure, +# rather than the libtool script. +m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl +AC_REQUIRE([_LT_DECL_SED]) +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) +func_stripname_cnf () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; + esac +} # func_stripname_cnf +])# _LT_FUNC_STRIPNAME_CNF + # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose @@ -6346,6 +6918,7 @@ AC_LANG_POP # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl +AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= @@ -6395,7 +6968,20 @@ public class foo { } }; _LT_EOF +], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF +package foo +func foo() { +} +_LT_EOF ]) + +_lt_libdeps_save_CFLAGS=$CFLAGS +case "$CC $CFLAGS " in #( +*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; +*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; +*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; +esac + dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then @@ -6407,7 +6993,7 @@ if AC_TRY_EVAL(ac_compile); then pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do - case $p in + case ${prev}${p} in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. @@ -6416,13 +7002,22 @@ if AC_TRY_EVAL(ac_compile); then test $p = "-R"; then prev=$p continue - else - prev= fi + # Expand the sysroot to ease extracting the directories later. + if test -z "$prev"; then + case $p in + -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; + -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; + -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; + esac + fi + case $p in + =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; + esac if test "$pre_test_object_deps_done" = no; then - case $p in - -L* | -R*) + case ${prev} in + -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. @@ -6442,8 +7037,10 @@ if AC_TRY_EVAL(ac_compile); then _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" fi fi + prev= ;; + *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. @@ -6479,6 +7076,7 @@ else fi $RM -f confest.$objext +CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], @@ -6515,7 +7113,7 @@ linux*) solaris*) case $cc_basename in - CC*) + CC* | sunCC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as @@ -6559,32 +7157,16 @@ _LT_TAGDECL([], [compiler_lib_search_path], [1], ])# _LT_SYS_HIDDEN_LIBDEPS -# _LT_PROG_F77 -# ------------ -# Since AC_PROG_F77 is broken, in that it returns the empty string -# if there is no fortran compiler, we have our own version here. -m4_defun([_LT_PROG_F77], -[ -pushdef([AC_MSG_ERROR], [_lt_disable_F77=yes]) -AC_PROG_F77 -if test -z "$F77" || test "X$F77" = "Xno"; then - _lt_disable_F77=yes -fi -popdef([AC_MSG_ERROR]) -])# _LT_PROG_F77 - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([_LT_PROG_F77], []) - - # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_F77_CONFIG], -[AC_REQUIRE([_LT_PROG_F77])dnl -AC_LANG_PUSH(Fortran 77) +[AC_LANG_PUSH(Fortran 77) +if test -z "$F77" || test "X$F77" = "Xno"; then + _lt_disable_F77=yes +fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= @@ -6594,7 +7176,6 @@ _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no @@ -6603,6 +7184,8 @@ _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no @@ -6642,7 +7225,9 @@ if test "$_lt_disable_F77" != yes; then # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC + lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} + CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) @@ -6696,38 +7281,24 @@ if test "$_lt_disable_F77" != yes; then GCC=$lt_save_GCC CC="$lt_save_CC" + CFLAGS="$lt_save_CFLAGS" fi # test "$_lt_disable_F77" != yes AC_LANG_POP ])# _LT_LANG_F77_CONFIG -# _LT_PROG_FC -# ----------- -# Since AC_PROG_FC is broken, in that it returns the empty string -# if there is no fortran compiler, we have our own version here. -m4_defun([_LT_PROG_FC], -[ -pushdef([AC_MSG_ERROR], [_lt_disable_FC=yes]) -AC_PROG_FC -if test -z "$FC" || test "X$FC" = "Xno"; then - _lt_disable_FC=yes -fi -popdef([AC_MSG_ERROR]) -])# _LT_PROG_FC - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([_LT_PROG_FC], []) - - # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_FC_CONFIG], -[AC_REQUIRE([_LT_PROG_FC])dnl -AC_LANG_PUSH(Fortran) +[AC_LANG_PUSH(Fortran) + +if test -z "$FC" || test "X$FC" = "Xno"; then + _lt_disable_FC=yes +fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= @@ -6737,7 +7308,6 @@ _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no @@ -6746,6 +7316,8 @@ _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no @@ -6785,7 +7357,9 @@ if test "$_lt_disable_FC" != yes; then # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC + lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} + CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu @@ -6841,7 +7415,8 @@ if test "$_lt_disable_FC" != yes; then fi # test -n "$compiler" GCC=$lt_save_GCC - CC="$lt_save_CC" + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS fi # test "$_lt_disable_FC" != yes AC_LANG_POP @@ -6878,10 +7453,12 @@ _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. -lt_save_CC="$CC" +lt_save_CC=$CC +lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} +CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" @@ -6891,6 +7468,8 @@ _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) @@ -6906,10 +7485,78 @@ fi AC_LANG_RESTORE GCC=$lt_save_GCC -CC="$lt_save_CC" +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG +# _LT_LANG_GO_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for the GNU Go compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_GO_CONFIG], +[AC_REQUIRE([LT_PROG_GO])dnl +AC_LANG_SAVE + +# Source file extension for Go test sources. +ac_ext=go + +# Object file extension for compiled Go test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="package main; func main() { }" + +# Code to be used in simple link tests +lt_simple_link_test_code='package main; func main() { }' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC=yes +CC=${GOC-"gccgo"} +CFLAGS=$GOFLAGS +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_TAGVAR(LD, $1)="$LD" +_LT_CC_BASENAME([$compiler]) + +# Go did not exist at the time GCC didn't implicitly link libc in. +_LT_TAGVAR(archive_cmds_need_lc, $1)=no + +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds + +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) +fi + +AC_LANG_RESTORE + +GCC=$lt_save_GCC +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS +])# _LT_LANG_GO_CONFIG + + # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler @@ -6941,9 +7588,11 @@ _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" +lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} +CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) @@ -6956,7 +7605,8 @@ fi GCC=$lt_save_GCC AC_LANG_RESTORE -CC="$lt_save_CC" +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG @@ -6976,6 +7626,13 @@ dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) +# LT_PROG_GO +# ---------- +AC_DEFUN([LT_PROG_GO], +[AC_CHECK_TOOL(GOC, gccgo,) +]) + + # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], @@ -7015,6 +7672,15 @@ _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) +# _LT_DECL_DLLTOOL +# ---------------- +# Ensure DLLTOOL variable is set. +m4_defun([_LT_DECL_DLLTOOL], +[AC_CHECK_TOOL(DLLTOOL, dlltool, false) +test -z "$DLLTOOL" && DLLTOOL=dlltool +_LT_DECL([], [DLLTOOL], [1], [DLL creation program]) +AC_SUBST([DLLTOOL]) +]) # _LT_DECL_SED # ------------ @@ -7106,8 +7772,8 @@ m4_defun([_LT_CHECK_SHELL_FEATURES], # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" - test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ - = c,a/b,, \ + test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes @@ -7146,222 +7812,177 @@ _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES -# _LT_PROG_XSI_SHELLFNS -# --------------------- -# Bourne and XSI compatible variants of some useful shell functions. -m4_defun([_LT_PROG_XSI_SHELLFNS], -[case $xsi_shell in - yes) - cat << \_LT_EOF >> "$cfgfile" - -# func_dirname file append nondir_replacement -# Compute the dirname of FILE. If nonempty, add APPEND to the result, -# otherwise set result to NONDIR_REPLACEMENT. -func_dirname () -{ - case ${1} in - */*) func_dirname_result="${1%/*}${2}" ;; - * ) func_dirname_result="${3}" ;; - esac -} - -# func_basename file -func_basename () -{ - func_basename_result="${1##*/}" -} - -# func_dirname_and_basename file append nondir_replacement -# perform func_basename and func_dirname in a single function -# call: -# dirname: Compute the dirname of FILE. If nonempty, -# add APPEND to the result, otherwise set result -# to NONDIR_REPLACEMENT. -# value returned in "$func_dirname_result" -# basename: Compute filename of FILE. -# value retuned in "$func_basename_result" -# Implementation must be kept synchronized with func_dirname -# and func_basename. For efficiency, we do not delegate to -# those functions but instead duplicate the functionality here. -func_dirname_and_basename () -{ - case ${1} in - */*) func_dirname_result="${1%/*}${2}" ;; - * ) func_dirname_result="${3}" ;; - esac - func_basename_result="${1##*/}" -} - -# func_stripname prefix suffix name -# strip PREFIX and SUFFIX off of NAME. -# PREFIX and SUFFIX must not contain globbing or regex special -# characters, hashes, percent signs, but SUFFIX may contain a leading -# dot (in which case that matches only a dot). -func_stripname () -{ - # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are - # positional parameters, so assign one to ordinary parameter first. - func_stripname_result=${3} - func_stripname_result=${func_stripname_result#"${1}"} - func_stripname_result=${func_stripname_result%"${2}"} -} - -# func_opt_split -func_opt_split () -{ - func_opt_split_opt=${1%%=*} - func_opt_split_arg=${1#*=} -} - -# func_lo2o object -func_lo2o () -{ - case ${1} in - *.lo) func_lo2o_result=${1%.lo}.${objext} ;; - *) func_lo2o_result=${1} ;; - esac -} - -# func_xform libobj-or-source -func_xform () -{ - func_xform_result=${1%.*}.lo -} - -# func_arith arithmetic-term... -func_arith () -{ - func_arith_result=$(( $[*] )) -} - -# func_len string -# STRING may not start with a hyphen. -func_len () -{ - func_len_result=${#1} -} - -_LT_EOF - ;; - *) # Bourne compatible functions. - cat << \_LT_EOF >> "$cfgfile" - -# func_dirname file append nondir_replacement -# Compute the dirname of FILE. If nonempty, add APPEND to the result, -# otherwise set result to NONDIR_REPLACEMENT. -func_dirname () -{ - # Extract subdirectory from the argument. - func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` - if test "X$func_dirname_result" = "X${1}"; then - func_dirname_result="${3}" - else - func_dirname_result="$func_dirname_result${2}" - fi -} - -# func_basename file -func_basename () -{ - func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` -} - -dnl func_dirname_and_basename -dnl A portable version of this function is already defined in general.m4sh -dnl so there is no need for it here. - -# func_stripname prefix suffix name -# strip PREFIX and SUFFIX off of NAME. -# PREFIX and SUFFIX must not contain globbing or regex special -# characters, hashes, percent signs, but SUFFIX may contain a leading -# dot (in which case that matches only a dot). -# func_strip_suffix prefix name -func_stripname () -{ - case ${2} in - .*) func_stripname_result=`$ECHO "X${3}" \ - | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; - *) func_stripname_result=`$ECHO "X${3}" \ - | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; - esac -} - -# sed scripts: -my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q' -my_sed_long_arg='1s/^-[[^=]]*=//' - -# func_opt_split -func_opt_split () -{ - func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` - func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` -} - -# func_lo2o object -func_lo2o () -{ - func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` -} - -# func_xform libobj-or-source -func_xform () -{ - func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[[^.]]*$/.lo/'` -} - -# func_arith arithmetic-term... -func_arith () -{ - func_arith_result=`expr "$[@]"` -} - -# func_len string -# STRING may not start with a hyphen. -func_len () -{ - func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len` -} - -_LT_EOF -esac - -case $lt_shell_append in - yes) - cat << \_LT_EOF >> "$cfgfile" - -# func_append var value -# Append VALUE to the end of shell variable VAR. -func_append () -{ - eval "$[1]+=\$[2]" -} -_LT_EOF - ;; - *) - cat << \_LT_EOF >> "$cfgfile" - -# func_append var value -# Append VALUE to the end of shell variable VAR. -func_append () -{ - eval "$[1]=\$$[1]\$[2]" -} - -_LT_EOF - ;; - esac +# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) +# ------------------------------------------------------ +# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and +# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. +m4_defun([_LT_PROG_FUNCTION_REPLACE], +[dnl { +sed -e '/^$1 ()$/,/^} # $1 /c\ +$1 ()\ +{\ +m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) +} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: ]) + +# _LT_PROG_REPLACE_SHELLFNS +# ------------------------- +# Replace existing portable implementations of several shell functions with +# equivalent extended shell implementations where those features are available.. +m4_defun([_LT_PROG_REPLACE_SHELLFNS], +[if test x"$xsi_shell" = xyes; then + _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac]) + + _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl + func_basename_result="${1##*/}"]) + + _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac + func_basename_result="${1##*/}"]) + + _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl + # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are + # positional parameters, so assign one to ordinary parameter first. + func_stripname_result=${3} + func_stripname_result=${func_stripname_result#"${1}"} + func_stripname_result=${func_stripname_result%"${2}"}]) + + _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl + func_split_long_opt_name=${1%%=*} + func_split_long_opt_arg=${1#*=}]) + + _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl + func_split_short_opt_arg=${1#??} + func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) + + _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl + case ${1} in + *.lo) func_lo2o_result=${1%.lo}.${objext} ;; + *) func_lo2o_result=${1} ;; + esac]) + + _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) + + _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) + + _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) +fi + +if test x"$lt_shell_append" = xyes; then + _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) + + _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl + func_quote_for_eval "${2}" +dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ + eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) + + # Save a `func_append' function call where possible by direct use of '+=' + sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +else + # Save a `func_append' function call even when '+=' is not available + sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +fi + +if test x"$_lt_function_replace_fail" = x":"; then + AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) +fi +]) + +# _LT_PATH_CONVERSION_FUNCTIONS +# ----------------------------- +# Determine which file name conversion functions should be used by +# func_to_host_file (and, implicitly, by func_to_host_path). These are needed +# for certain cross-compile configurations and native mingw. +m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_MSG_CHECKING([how to convert $build file names to $host format]) +AC_CACHE_VAL(lt_cv_to_host_file_cmd, +[case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 + ;; + esac + ;; + *-*-cygwin* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin + ;; + esac + ;; + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; +esac +]) +to_host_file_cmd=$lt_cv_to_host_file_cmd +AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) +_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], + [0], [convert $build file names to $host format])dnl + +AC_MSG_CHECKING([how to convert $build file names to toolchain format]) +AC_CACHE_VAL(lt_cv_to_tool_file_cmd, +[#assume ordinary cross tools, or native build. +lt_cv_to_tool_file_cmd=func_convert_file_noop +case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 + ;; + esac + ;; +esac +]) +to_tool_file_cmd=$lt_cv_to_tool_file_cmd +AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) +_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], + [0], [convert $build files to toolchain format])dnl +])# _LT_PATH_CONVERSION_FUNCTIONS + # Helper functions for option handling. -*- Autoconf -*- # -# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. +# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, +# Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. -# serial 6 ltoptions.m4 +# serial 7 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) @@ -7476,7 +8097,7 @@ LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in -*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*) +*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) @@ -7484,13 +8105,13 @@ case $host in esac test -z "$AS" && AS=as -_LT_DECL([], [AS], [0], [Assembler program])dnl +_LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool -_LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl +_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump -_LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl +_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], @@ -7676,9 +8297,24 @@ dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # MODE is either `yes' or `no'. If omitted, it defaults to `both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], - [AS_HELP_STRING([--with-pic], + [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], - [pic_mode="$withval"], + [lt_p=${PACKAGE-default} + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for lt_pkg in $withval; do + IFS="$lt_save_ifs" + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], [pic_mode=default]) test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) @@ -7848,31 +8484,31 @@ m4_define([lt_dict_filter], # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. -# Generated from ltversion.in. +# @configure_input@ -# serial 3017 ltversion.m4 +# serial 3337 ltversion.m4 # This file is part of GNU Libtool -m4_define([LT_PACKAGE_VERSION], [2.2.6b]) -m4_define([LT_PACKAGE_REVISION], [1.3017]) +m4_define([LT_PACKAGE_VERSION], [2.4.2]) +m4_define([LT_PACKAGE_REVISION], [1.3337]) AC_DEFUN([LTVERSION_VERSION], -[macro_version='2.2.6b' -macro_revision='1.3017' +[macro_version='2.4.2' +macro_revision='1.3337' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # -# Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. +# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. -# serial 4 lt~obsolete.m4 +# serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # @@ -7942,7 +8578,6 @@ m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) -m4_ifndef([AC_LIBTOOL_RC], [AC_DEFUN([AC_LIBTOOL_RC])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) @@ -7955,5 +8590,12 @@ m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) +m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) +m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) +m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) +m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) +m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) +m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) +m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) m4_include([ft-munmap.m4]) diff --git a/modules/freetype2/builds/unix/config.guess b/modules/freetype2/builds/unix/config.guess old mode 100644 new mode 100755 index 4c8f032e786..d622a44e551 --- a/modules/freetype2/builds/unix/config.guess +++ b/modules/freetype2/builds/unix/config.guess @@ -1,10 +1,10 @@ #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 -# Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +# 2011, 2012 Free Software Foundation, Inc. -timestamp='2010-09-24' +timestamp='2012-02-10' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -17,9 +17,7 @@ timestamp='2010-09-24' # General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA -# 02110-1301, USA. +# along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -57,8 +55,8 @@ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free -Software Foundation, Inc. +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 +Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -92,7 +90,7 @@ if test $# != 0; then exit 1 fi -trap 'exit 1' HUP INT TERM +trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires @@ -106,7 +104,7 @@ trap 'exit 1' HUP INT TERM set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; -trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" HUP INT PIPE TERM ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || @@ -145,7 +143,7 @@ UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or - # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward @@ -181,7 +179,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in fi ;; *) - os=netbsd + os=netbsd ;; esac # The OS release @@ -224,7 +222,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on @@ -270,7 +268,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - exit ;; + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. + exitcode=$? + trap '' 0 + exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead @@ -296,7 +297,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in echo s390-ibm-zvmoe exit ;; *:OS400:*:*) - echo powerpc-ibm-os400 + echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} @@ -395,23 +396,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} - exit ;; + exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} - exit ;; + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} - exit ;; + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} - exit ;; + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; @@ -481,8 +482,8 @@ EOF echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) - # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ @@ -495,7 +496,7 @@ EOF else echo i586-dg-dgux${UNAME_RELEASE} fi - exit ;; + exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; @@ -595,52 +596,52 @@ EOF 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` - sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 - 532) # CPU_PA_RISC2_0 - case "${sc_kernel_bits}" in - 32) HP_ARCH="hppa2.0n" ;; - 64) HP_ARCH="hppa2.0w" ;; + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 - esac ;; - esac + esac ;; + esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + sed 's/^ //' << EOF >$dummy.c - #define _HPUX_SOURCE - #include - #include + #define _HPUX_SOURCE + #include + #include - int main () - { - #if defined(_SC_KERNEL_BITS) - long bits = sysconf(_SC_KERNEL_BITS); - #endif - long cpu = sysconf (_SC_CPU_VERSION); + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1"); break; - case CPU_PA_RISC2_0: - #if defined(_SC_KERNEL_BITS) - switch (bits) - { - case 64: puts ("hppa2.0w"); break; - case 32: puts ("hppa2.0n"); break; - default: puts ("hppa2.0"); break; - } break; - #else /* !defined(_SC_KERNEL_BITS) */ - puts ("hppa2.0"); break; - #endif - default: puts ("hppa1.0"); break; - } - exit (0); - } + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa @@ -731,22 +732,22 @@ EOF exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd - exit ;; + exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi - exit ;; + exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd - exit ;; + exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd - exit ;; + exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd - exit ;; + exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; @@ -770,14 +771,14 @@ EOF exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` - echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} @@ -789,13 +790,12 @@ EOF echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) - case ${UNAME_MACHINE} in - pc98) - echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + UNAME_PROCESSOR=`/usr/bin/uname -p` + case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) - echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) @@ -804,15 +804,18 @@ EOF *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; + i*:MSYS*:*) + echo ${UNAME_MACHINE}-pc-msys + exit ;; i*:windows32*:*) - # uname -m includes "-pc" on this system. - echo ${UNAME_MACHINE}-mingw32 + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) - case ${UNAME_MACHINE} in + case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; @@ -858,6 +861,13 @@ EOF i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; + aarch64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + aarch64_be:Linux:*:*) + UNAME_MACHINE=aarch64_be + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; @@ -867,7 +877,7 @@ EOF EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; - esac + esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} @@ -879,20 +889,29 @@ EOF then echo ${UNAME_MACHINE}-unknown-linux-gnu else - echo ${UNAME_MACHINE}-unknown-linux-gnueabi + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + echo ${UNAME_MACHINE}-unknown-linux-gnueabi + else + echo ${UNAME_MACHINE}-unknown-linux-gnueabihf + fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) - echo cris-axis-linux-gnu + echo ${UNAME_MACHINE}-axis-linux-gnu exit ;; crisv32:Linux:*:*) - echo crisv32-axis-linux-gnu + echo ${UNAME_MACHINE}-axis-linux-gnu exit ;; frv:Linux:*:*) - echo frv-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + hexagon:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:Linux:*:*) LIBC=gnu @@ -934,7 +953,7 @@ EOF test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) - echo or32-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; padre:Linux:*:*) echo sparc-unknown-linux-gnu @@ -960,7 +979,7 @@ EOF echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu @@ -969,16 +988,16 @@ EOF echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; tile*:Linux:*:*) - echo ${UNAME_MACHINE}-tilera-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) - echo x86_64-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. @@ -987,11 +1006,11 @@ EOF echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) - # Unixware is an offshoot of SVR4, but it has its own version - # number series starting with 2... - # I am not positive that other SVR4 systems won't match this, + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. - # Use sysv4.2uw... so that sysv4* matches it. + # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) @@ -1023,7 +1042,7 @@ EOF fi exit ;; i*86:*:5:[678]*) - # UnixWare 7.x, OpenUNIX and OpenServer 6. + # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; @@ -1051,13 +1070,13 @@ EOF exit ;; pc:*:*:*) # Left here for compatibility: - # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i586. + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp - exit ;; + exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; @@ -1092,8 +1111,8 @@ EOF /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4; exit; } ;; + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ @@ -1136,10 +1155,10 @@ EOF echo ns32k-sni-sysv fi exit ;; - PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says - echo i586-unisys-sysv4 - exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm @@ -1165,11 +1184,11 @@ EOF exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} + echo mips-nec-sysv${UNAME_RELEASE} else - echo mips-unknown-sysv${UNAME_RELEASE} + echo mips-unknown-sysv${UNAME_RELEASE} fi - exit ;; + exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; @@ -1282,13 +1301,13 @@ EOF echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} + echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) - UNAME_MACHINE=`(uname -p) 2>/dev/null` + UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; @@ -1306,6 +1325,9 @@ EOF i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; + x86_64:VMkernel:*:*) + echo ${UNAME_MACHINE}-unknown-esx + exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 @@ -1328,11 +1350,11 @@ main () #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 - "4" + "4" #else - "" + "" #endif - ); exit (0); + ); exit (0); #endif #endif diff --git a/modules/freetype2/builds/unix/config.sub b/modules/freetype2/builds/unix/config.sub old mode 100644 new mode 100755 index 320e3038811..c894da45500 --- a/modules/freetype2/builds/unix/config.sub +++ b/modules/freetype2/builds/unix/config.sub @@ -1,10 +1,10 @@ #! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 -# Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +# 2011, 2012 Free Software Foundation, Inc. -timestamp='2010-09-11' +timestamp='2012-02-10' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -21,9 +21,7 @@ timestamp='2010-09-11' # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA -# 02110-1301, USA. +# along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -76,8 +74,8 @@ version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free -Software Foundation, Inc. +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 +Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -132,6 +130,10 @@ case $maybe_os in os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; + android-linux) + os=-linux-android + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown + ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] @@ -158,8 +160,8 @@ case $os in os= basic_machine=$1 ;; - -bluegene*) - os=-cnk + -bluegene*) + os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= @@ -175,10 +177,10 @@ case $os in os=-chorusos basic_machine=$1 ;; - -chorusrdb) - os=-chorusrdb + -chorusrdb) + os=-chorusrdb basic_machine=$1 - ;; + ;; -hiux*) os=-hiuxwe2 ;; @@ -247,17 +249,22 @@ case $basic_machine in # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ + | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ + | be32 | be64 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ + | epiphany \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ + | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep | metag \ @@ -286,22 +293,23 @@ case $basic_machine in | nds32 | nds32le | nds32be \ | nios | nios2 \ | ns16k | ns32k \ + | open8 \ | or32 \ | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ - | rx \ + | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ - | spu | strongarm \ - | tahoe | thumb | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ + | spu \ + | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ - | v850 | v850e \ + | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | we32k \ - | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ + | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; @@ -314,8 +322,7 @@ case $basic_machine in c6x) basic_machine=tic6x-unknown ;; - m6811 | m68hc11 | m6812 | m68hc12 | picochip) - # Motorola 68HC11/12. + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) basic_machine=$basic_machine-unknown os=-none ;; @@ -325,6 +332,21 @@ case $basic_machine in basic_machine=mt-unknown ;; + strongarm | thumb | xscale) + basic_machine=arm-unknown + ;; + xgate) + basic_machine=$basic_machine-unknown + os=-none + ;; + xscaleeb) + basic_machine=armeb-unknown + ;; + + xscaleel) + basic_machine=armel-unknown + ;; + # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. @@ -339,11 +361,13 @@ case $basic_machine in # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ + | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ + | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | clipper-* | craynv-* | cydra-* \ @@ -352,8 +376,10 @@ case $basic_machine in | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ + | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ @@ -382,24 +408,26 @@ case $basic_machine in | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ + | open8-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ - | romp-* | rs6000-* | rx-* \ + | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ - | tahoe-* | thumb-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ + | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ - | tile-* | tilegx-* \ + | tile*-* \ | tron-* \ | ubicom32-* \ - | v850-* | v850e-* | vax-* \ + | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ + | vax-* \ | we32k-* \ - | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) @@ -424,7 +452,7 @@ case $basic_machine in basic_machine=a29k-amd os=-udi ;; - abacus) + abacus) basic_machine=abacus-unknown ;; adobe68k) @@ -507,7 +535,7 @@ case $basic_machine in basic_machine=c90-cray os=-unicos ;; - cegcc) + cegcc) basic_machine=arm-unknown os=-cegcc ;; @@ -539,7 +567,7 @@ case $basic_machine in basic_machine=craynv-cray os=-unicosmp ;; - cr16) + cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; @@ -697,7 +725,6 @@ case $basic_machine in i370-ibm* | ibm*) basic_machine=i370-ibm ;; -# I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 @@ -755,7 +782,7 @@ case $basic_machine in basic_machine=ns32k-utek os=-sysv ;; - microblaze) + microblaze) basic_machine=microblaze-xilinx ;; mingw32) @@ -794,10 +821,18 @@ case $basic_machine in ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; + msys) + basic_machine=i386-pc + os=-msys + ;; mvs) basic_machine=i370-ibm os=-mvs ;; + nacl) + basic_machine=le32-unknown + os=-nacl + ;; ncr3000) basic_machine=i486-ncr os=-sysv4 @@ -862,10 +897,10 @@ case $basic_machine in np1) basic_machine=np1-gould ;; - neo-tandem) + neo-tandem) basic_machine=neo-tandem ;; - nse-tandem) + nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) @@ -950,9 +985,10 @@ case $basic_machine in ;; power) basic_machine=power-ibm ;; - ppc) basic_machine=powerpc-unknown + ppc | ppcbe) basic_machine=powerpc-unknown ;; - ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ppc-* | ppcbe-*) + basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown @@ -1046,6 +1082,9 @@ case $basic_machine in basic_machine=i860-stratus os=-sysv4 ;; + strongarm-* | thumb-*) + basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; sun2) basic_machine=m68000-sun ;; @@ -1102,13 +1141,8 @@ case $basic_machine in basic_machine=t90-cray os=-unicos ;; - # This must be matched before tile*. - tilegx*) - basic_machine=tilegx-unknown - os=-linux-gnu - ;; tile*) - basic_machine=tile-unknown + basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) @@ -1178,6 +1212,9 @@ case $basic_machine in xps | xps100) basic_machine=xps100-honeywell ;; + xscale-* | xscalee[bl]-*) + basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` + ;; ymp) basic_machine=ymp-cray os=-unicos @@ -1275,11 +1312,11 @@ esac if [ x"$os" != x"" ] then case $os in - # First match some system type aliases - # that might get confused with valid system types. + # First match some system type aliases + # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. - -auroraux) - os=-auroraux + -auroraux) + os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` @@ -1315,7 +1352,7 @@ case $os in | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ - | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ @@ -1364,7 +1401,7 @@ case $os in -opened*) os=-openedition ;; - -os400*) + -os400*) os=-os400 ;; -wince*) @@ -1413,7 +1450,7 @@ case $os in -sinix*) os=-sysv4 ;; - -tpf*) + -tpf*) os=-tpf ;; -triton*) @@ -1458,8 +1495,8 @@ case $os in -dicos*) os=-dicos ;; - -nacl*) - ;; + -nacl*) + ;; -none) ;; *) @@ -1482,10 +1519,10 @@ else # system, and we'll never get to this point. case $basic_machine in - score-*) + score-*) os=-elf ;; - spu-*) + spu-*) os=-elf ;; *-acorn) @@ -1497,8 +1534,8 @@ case $basic_machine in arm*-semi) os=-aout ;; - c4x-* | tic4x-*) - os=-coff + c4x-* | tic4x-*) + os=-coff ;; tic54x-*) os=-coff @@ -1527,14 +1564,11 @@ case $basic_machine in ;; m68000-sun) os=-sunos3 - # This also exists in the configure program, but was not the - # default. - # os=-sunos4 ;; m68*-cisco) os=-aout ;; - mep-*) + mep-*) os=-elf ;; mips*-cisco) @@ -1561,7 +1595,7 @@ case $basic_machine in *-ibm) os=-aix ;; - *-knuth) + *-knuth) os=-mmixware ;; *-wec) diff --git a/modules/freetype2/builds/unix/configure b/modules/freetype2/builds/unix/configure index dccd6062132..7d2eb89ded4 100755 --- a/modules/freetype2/builds/unix/configure +++ b/modules/freetype2/builds/unix/configure @@ -1,13 +1,13 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.65 for FreeType 2.4.3. +# Generated by GNU Autoconf 2.68 for FreeType 2.4.9. # # Report bugs to . # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software +# Foundation, Inc. # # # This configure script is free software; the Free Software Foundation @@ -91,6 +91,7 @@ fi IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. +as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -173,7 +174,15 @@ test x\$exitcode = x0 || exit 1" as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 -test \$(( 1 + 1 )) = 2 || exit 1" +test \$(( 1 + 1 )) = 2 || exit 1 + + test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ + || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else @@ -216,11 +225,18 @@ IFS=$as_save_IFS # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. + # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} + case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; + esac + exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} fi if test x$as_have_required = xno; then : @@ -319,7 +335,7 @@ $as_echo X"$as_dir" | test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p @@ -359,19 +375,19 @@ else fi # as_fn_arith -# as_fn_error ERROR [LINENO LOG_FD] -# --------------------------------- +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with status $?, using 1 if that was 0. +# script with STATUS, using 1 if that was 0. as_fn_error () { - as_status=$?; test $as_status -eq 0 && as_status=1 - if test "$3"; then - as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $1" >&2 + $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error @@ -528,161 +544,14 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -# Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} -case X$lt_ECHO in -X*--fallback-echo) - # Remove one level of quotation (which was required for Make). - ECHO=`echo "$lt_ECHO" | sed 's,\\\\\$\\$0,'$0','` - ;; -esac - -ECHO=${lt_ECHO-echo} -if test "X$1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X$1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then - # Yippee, $ECHO works! - : -else - # Restart under the correct shell. - exec $SHELL "$0" --no-reexec ${1+"$@"} -fi - -if test "X$1" = X--fallback-echo; then - # used as fallback echo - shift - cat <<_LT_EOF -$* -_LT_EOF - exit 0 -fi - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -if test -z "$lt_ECHO"; then - if test "X${echo_test_string+set}" != Xset; then - # find a string as large as possible, as long as the shell can cope with it - for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do - # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... - if { echo_test_string=`eval $cmd`; } 2>/dev/null && - { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null - then - break - fi - done - fi - - if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && - echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - : - else - # The Solaris, AIX, and Digital Unix default echo programs unquote - # backslashes. This makes it impossible to quote backslashes using - # echo "$something" | sed 's/\\/\\\\/g' - # - # So, first we look for a working echo in the user's PATH. - - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for dir in $PATH /usr/ucb; do - IFS="$lt_save_ifs" - if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && - test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - ECHO="$dir/echo" - break - fi - done - IFS="$lt_save_ifs" - - if test "X$ECHO" = Xecho; then - # We didn't find a better echo, so look for alternatives. - if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && - echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # This shell has a builtin print -r that does the trick. - ECHO='print -r' - elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && - test "X$CONFIG_SHELL" != X/bin/ksh; then - # If we have ksh, try running configure again with it. - ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} - export ORIGINAL_CONFIG_SHELL - CONFIG_SHELL=/bin/ksh - export CONFIG_SHELL - exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} - else - # Try using printf. - ECHO='printf %s\n' - if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && - echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # Cool, printf works - : - elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL - export CONFIG_SHELL - SHELL="$CONFIG_SHELL" - export SHELL - ECHO="$CONFIG_SHELL $0 --fallback-echo" - elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - ECHO="$CONFIG_SHELL $0 --fallback-echo" - else - # maybe with a smaller string... - prev=: - - for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do - if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null - then - break - fi - prev="$cmd" - done - - if test "$prev" != 'sed 50q "$0"'; then - echo_test_string=`eval $prev` - export echo_test_string - exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} - else - # Oops. We lost completely, so just stick with echo. - ECHO=echo - fi - fi - fi - fi - fi -fi - -# Copy echo and quote the copy suitably for passing to libtool from -# the Makefile, instead of quoting the original, which is used later. -lt_ECHO=$ECHO -if test "X$lt_ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then - lt_ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" -fi - - - test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. -# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` @@ -701,8 +570,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='FreeType' PACKAGE_TARNAME='freetype' -PACKAGE_VERSION='2.4.3' -PACKAGE_STRING='FreeType 2.4.3' +PACKAGE_VERSION='2.4.9' +PACKAGE_STRING='FreeType 2.4.9' PACKAGE_BUGREPORT='freetype@nongnu.org' PACKAGE_URL='' @@ -754,9 +623,11 @@ OTOOL LIPO NMEDIT DSYMUTIL -lt_ECHO +MANIFEST_TOOL +AWK RANLIB STRIP +ac_ct_AR AR LN_S NM @@ -771,6 +642,7 @@ DLLTOOL AS SYSTEM_ZLIB FT2_EXTRA_LIBS +LIBBZ2 LIBZ ftmac_c FTSYS_SRC @@ -845,7 +717,9 @@ ac_subst_files='' ac_user_opts=' enable_option_checking enable_biarch_config +enable_mmap with_zlib +with_bzip2 with_old_mac_fonts with_fsspec with_fsref @@ -857,6 +731,7 @@ enable_static with_pic enable_fast_install with_gnu_ld +with_sysroot enable_libtool_lock ' ac_precious_vars='build_alias @@ -930,8 +805,9 @@ do fi case $ac_option in - *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *) ac_optarg=yes ;; + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. @@ -976,7 +852,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error "invalid feature name: $ac_useropt" + as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1002,7 +878,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error "invalid feature name: $ac_useropt" + as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1206,7 +1082,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error "invalid package name: $ac_useropt" + as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1222,7 +1098,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error "invalid package name: $ac_useropt" + as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1252,8 +1128,8 @@ do | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; - -*) as_fn_error "unrecognized option: \`$ac_option' -Try \`$0 --help' for more information." + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" ;; *=*) @@ -1261,7 +1137,7 @@ Try \`$0 --help' for more information." # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) - as_fn_error "invalid variable name: \`$ac_envvar'" ;; + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; @@ -1271,7 +1147,7 @@ Try \`$0 --help' for more information." $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac @@ -1279,13 +1155,13 @@ done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` - as_fn_error "missing argument to $ac_option" + as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; - fatal) as_fn_error "unrecognized options: $ac_unrecognized_opts" ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi @@ -1308,7 +1184,7 @@ do [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac - as_fn_error "expected an absolute directory name for --$ac_var: $ac_val" + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' @@ -1322,8 +1198,8 @@ target=$target_alias if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe - $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used." >&2 + $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used" >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi @@ -1338,9 +1214,9 @@ test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - as_fn_error "working directory cannot be determined" + as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - as_fn_error "pwd does not report name of working directory" + as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. @@ -1379,11 +1255,11 @@ else fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - as_fn_error "cannot find sources ($ac_unique_file) in $srcdir" + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error "$ac_msg" + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then @@ -1409,7 +1285,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures FreeType 2.4.3 to adapt to many kinds of systems. +\`configure' configures FreeType 2.4.9 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1423,7 +1299,7 @@ Configuration: --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking...' messages + -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files @@ -1474,7 +1350,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of FreeType 2.4.3:";; + short | recursive ) echo "Configuration of FreeType 2.4.9:";; esac cat <<\_ACEOF @@ -1484,6 +1360,7 @@ Optional Features: --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-biarch-config install biarch ftconfig.h to support multiple architectures by single file + --disable-mmap do not check mmap() and do not use --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] @@ -1494,6 +1371,7 @@ Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --without-zlib use internal zlib instead of system-wide + --without-bzip2 do not support bzip2 compressed fonts --with-old-mac-fonts allow Mac resource-based fonts to be used --with-fsspec use obsolete FSSpec API of MacOS, if available (default=yes) @@ -1505,9 +1383,11 @@ Optional Packages: --with-quickdraw-carbon use MacOS QuickDraw in Carbon, if available (default=yes) --with-ats use AppleTypeService, if available (default=yes) - --with-pic try to use only PIC/non-PIC objects [default=use + --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] + --with-sysroot=DIR Search for dependent libraries within DIR + (or the compiler's sysroot if not specified). Some influential environment variables: CC C compiler command @@ -1585,10 +1465,10 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -FreeType configure 2.4.3 -generated by GNU Autoconf 2.65 +FreeType configure 2.4.9 +generated by GNU Autoconf 2.68 -Copyright (C) 2009 Free Software Foundation, Inc. +Copyright (C) 2010 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1632,7 +1512,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile @@ -1658,7 +1538,7 @@ $as_echo "$ac_try_echo"; } >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } >/dev/null && { + test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : @@ -1669,7 +1549,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp @@ -1711,7 +1591,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run @@ -1724,10 +1604,10 @@ fi ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 @@ -1763,7 +1643,7 @@ if ac_fn_c_try_cpp "$LINENO"; then : else ac_header_preproc=no fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } @@ -1786,17 +1666,15 @@ $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} -( cat <<\_ASBOX -## ---------------------------------- ## +( $as_echo "## ---------------------------------- ## ## Report this to freetype@nongnu.org ## -## ---------------------------------- ## -_ASBOX +## ---------------------------------- ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" @@ -1805,7 +1683,7 @@ eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel @@ -1818,7 +1696,7 @@ ac_fn_c_check_header_compile () as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -1836,7 +1714,7 @@ fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile @@ -2013,7 +1891,7 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ rm -f conftest.val fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_compute_int @@ -2059,7 +1937,7 @@ fi # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link @@ -2072,7 +1950,7 @@ ac_fn_c_check_func () as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -2127,19 +2005,22 @@ fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func -# ac_fn_c_check_decl LINENO SYMBOL VAR -# ------------------------------------ -# Tests whether SYMBOL is declared, setting cache variable VAR accordingly. +# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES +# --------------------------------------------- +# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR +# accordingly. ac_fn_c_check_decl () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $2 is declared" >&5 -$as_echo_n "checking whether $2 is declared... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + as_decl_name=`echo $2|sed 's/ *(.*//'` + as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 +$as_echo_n "checking whether $as_decl_name is declared... " >&6; } +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -2148,8 +2029,12 @@ $4 int main () { -#ifndef $2 - (void) $2; +#ifndef $as_decl_name +#ifdef __cplusplus + (void) $as_decl_use; +#else + (void) $as_decl_name; +#endif #endif ; @@ -2166,15 +2051,15 @@ fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_decl cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by FreeType $as_me 2.4.3, which was -generated by GNU Autoconf 2.65. Invocation command line was +It was created by FreeType $as_me 2.4.9, which was +generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2284,11 +2169,9 @@ trap 'exit_status=$? { echo - cat <<\_ASBOX -## ---------------- ## + $as_echo "## ---------------- ## ## Cache variables. ## -## ---------------- ## -_ASBOX +## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( @@ -2322,11 +2205,9 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; ) echo - cat <<\_ASBOX -## ----------------- ## + $as_echo "## ----------------- ## ## Output variables. ## -## ----------------- ## -_ASBOX +## ----------------- ##" echo for ac_var in $ac_subst_vars do @@ -2339,11 +2220,9 @@ _ASBOX echo if test -n "$ac_subst_files"; then - cat <<\_ASBOX -## ------------------- ## + $as_echo "## ------------------- ## ## File substitutions. ## -## ------------------- ## -_ASBOX +## ------------------- ##" echo for ac_var in $ac_subst_files do @@ -2357,11 +2236,9 @@ _ASBOX fi if test -s confdefs.h; then - cat <<\_ASBOX -## ----------- ## + $as_echo "## ----------- ## ## confdefs.h. ## -## ----------- ## -_ASBOX +## ----------- ##" echo cat confdefs.h echo @@ -2416,7 +2293,12 @@ _ACEOF ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then - ac_site_file1=$CONFIG_SITE + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site @@ -2431,7 +2313,11 @@ do { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } fi done @@ -2510,7 +2396,7 @@ if $ac_cache_corrupted; then $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## @@ -2528,7 +2414,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu # Don't forget to update docs/VERSION.DLL! -version_info='12:1:6' +version_info='14:1:8' ft_version=`echo $version_info | tr : .` @@ -2538,16 +2424,22 @@ ft_version=`echo $version_info | tr : .` ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do - for ac_t in install-sh install.sh shtool; do - if test -f "$ac_dir/$ac_t"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/$ac_t -c" - break 2 - fi - done + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi done if test -z "$ac_aux_dir"; then - as_fn_error "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 + as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, @@ -2561,27 +2453,27 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - as_fn_error "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } -if test "${ac_cv_build+set}" = set; then : +if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && - as_fn_error "cannot guess build type; you must specify one" "$LINENO" 5 + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - as_fn_error "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; -*) as_fn_error "invalid value of canonical build" "$LINENO" 5;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' @@ -2599,14 +2491,14 @@ case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } -if test "${ac_cv_host+set}" = set; then : +if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - as_fn_error "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi @@ -2614,7 +2506,7 @@ fi $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; -*) as_fn_error "invalid value of canonical host" "$LINENO" 5;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' @@ -2644,7 +2536,7 @@ if test -n "$ac_tool_prefix"; then set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -2684,7 +2576,7 @@ if test -z "$ac_cv_prog_CC"; then set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : +if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -2737,7 +2629,7 @@ if test -z "$CC"; then set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -2777,7 +2669,7 @@ if test -z "$CC"; then set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -2836,7 +2728,7 @@ if test -z "$CC"; then set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -2880,7 +2772,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : +if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -2934,8 +2826,8 @@ fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "no acceptable C compiler found in \$PATH -See \`config.log' for more details." "$LINENO" 5; } +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 @@ -3049,9 +2941,8 @@ sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ as_fn_set_status 77 -as_fn_error "C compiler cannot create executables -See \`config.log' for more details." "$LINENO" 5; }; } +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } @@ -3093,8 +2984,8 @@ done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." "$LINENO" 5; } +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 @@ -3151,9 +3042,9 @@ $as_echo "$ac_try_echo"; } >&5 else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "cannot run C compiled programs. +as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. -See \`config.log' for more details." "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5; } fi fi fi @@ -3164,7 +3055,7 @@ rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } -if test "${ac_cv_objext+set}" = set; then : +if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -3204,8 +3095,8 @@ sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "cannot compute suffix of object files: cannot compile -See \`config.log' for more details." "$LINENO" 5; } +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi @@ -3215,7 +3106,7 @@ OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if test "${ac_cv_c_compiler_gnu+set}" = set; then : +if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -3252,7 +3143,7 @@ ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } -if test "${ac_cv_prog_cc_g+set}" = set; then : +if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag @@ -3330,7 +3221,7 @@ else fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if test "${ac_cv_prog_cc_c89+set}" = set; then : +if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no @@ -3437,7 +3328,7 @@ if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then : + if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded @@ -3467,7 +3358,7 @@ else # Broken: fails on valid input. continue fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. @@ -3483,11 +3374,11 @@ else ac_preproc_ok=: break fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext +rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi @@ -3526,7 +3417,7 @@ else # Broken: fails on valid input. continue fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. @@ -3542,18 +3433,18 @@ else ac_preproc_ok=: break fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext +rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." "$LINENO" 5; } +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c @@ -3572,7 +3463,7 @@ if test ${cross_compiling} = yes; then set dummy ${build}-gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC_BUILD+set}" = set; then : +if ${ac_cv_prog_CC_BUILD+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC_BUILD"; then @@ -3609,7 +3500,7 @@ fi set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC_BUILD+set}" = set; then : +if ${ac_cv_prog_CC_BUILD+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC_BUILD"; then @@ -3646,7 +3537,7 @@ fi set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC_BUILD+set}" = set; then : +if ${ac_cv_prog_CC_BUILD+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC_BUILD"; then @@ -3696,19 +3587,19 @@ $as_echo "no" >&6; } fi - test -z "${CC_BUILD}" && as_fn_error "cannot find native C compiler" "$LINENO" 5 + test -z "${CC_BUILD}" && as_fn_error $? "cannot find native C compiler" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of native executables" >&5 $as_echo_n "checking for suffix of native executables... " >&6; } rm -f a.* b.* a_out.exe conftest.* echo > conftest.c "int main() { return 0;}" - ${CC_BUILD} conftest.c || as_fn_error "native C compiler is not working" "$LINENO" 5 + ${CC_BUILD} conftest.c || as_fn_error $? "native C compiler is not working" "$LINENO" 5 rm -f conftest.c if test -x a.out -o -x b.out -o -x conftest; then EXEEXT_BUILD="" elif test -x a_out.exe -o -x conftest.exe; then EXEEXT_BUILD=".exe" - elif test -x conftest.* ; then + elif test -x conftest.*; then EXEEXT_BUILD=`echo conftest.* | sed -n '1s/^.*\././'` fi rm -f a.* b.* a_out.exe conftest.* @@ -3752,7 +3643,7 @@ fi set dummy rm; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_RMF+set}" = set; then : +if ${ac_cv_prog_RMF+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RMF"; then @@ -3789,7 +3680,7 @@ fi set dummy rmdir; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_RMDIR+set}" = set; then : +if ${ac_cv_prog_RMDIR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RMDIR"; then @@ -3845,7 +3736,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then -if test "${ac_cv_path_install+set}" = set; then : +if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3925,7 +3816,8 @@ case "$INSTALL" in /*) ;; */*) - INSTALL="`pwd`/$INSTALL" ;; + INSTALL="`pwd`/$INSTALL" + ;; esac @@ -3935,7 +3827,7 @@ esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if test "${ac_cv_path_GREP+set}" = set; then : +if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then @@ -3984,7 +3876,7 @@ esac done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then - as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP @@ -3998,7 +3890,7 @@ $as_echo "$ac_cv_path_GREP" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } -if test "${ac_cv_path_EGREP+set}" = set; then : +if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 @@ -4050,7 +3942,7 @@ esac done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then - as_fn_error "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP @@ -4065,7 +3957,7 @@ $as_echo "$ac_cv_path_EGREP" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } -if test "${ac_cv_header_stdc+set}" = set; then : +if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4182,8 +4074,7 @@ do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -4197,8 +4088,7 @@ for ac_header in fcntl.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -4213,7 +4103,7 @@ done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } -if test "${ac_cv_c_const+set}" = set; then : +if ${ac_cv_c_const+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4297,7 +4187,7 @@ fi # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 $as_echo_n "checking size of int... " >&6; } -if test "${ac_cv_sizeof_int+set}" = set; then : +if ${ac_cv_sizeof_int+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default"; then : @@ -4306,9 +4196,8 @@ else if test "$ac_cv_type_int" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ as_fn_set_status 77 -as_fn_error "cannot compute sizeof (int) -See \`config.log' for more details." "$LINENO" 5; }; } +as_fn_error 77 "cannot compute sizeof (int) +See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_int=0 fi @@ -4331,7 +4220,7 @@ _ACEOF # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 $as_echo_n "checking size of long... " >&6; } -if test "${ac_cv_sizeof_long+set}" = set; then : +if ${ac_cv_sizeof_long+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then : @@ -4340,9 +4229,8 @@ else if test "$ac_cv_type_long" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ as_fn_set_status 77 -as_fn_error "cannot compute sizeof (long) -See \`config.log' for more details." "$LINENO" 5; }; } +as_fn_error 77 "cannot compute sizeof (long) +See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_long=0 fi @@ -4363,8 +4251,8 @@ _ACEOF # check whether cpp computation of size of int and long in ftconfig.in works -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking cpp computation of bit length in ftconfig.in works" >&5 -$as_echo_n "checking cpp computation of bit length in ftconfig.in works... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cpp computation of bit length in ftconfig.in works" >&5 +$as_echo_n "checking whether cpp computation of bit length in ftconfig.in works... " >&6; } orig_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="-I${srcdir} -I. ${CPPFLAGS}" ac_clean_files="ft2build.h ftoption.h ftstdlib.h" @@ -4437,6 +4325,14 @@ CPPFLAGS="${orig_CPPFLAGS}" # Here we check whether we can use our mmap file component. +# Check whether --enable-mmap was given. +if test "${enable_mmap+set}" = set; then : + enableval=$enable_mmap; enable_mmap="no" +else + enable_mmap="yes" +fi + +if test "x${enable_mmap}" != "xno"; then @@ -4445,8 +4341,7 @@ do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -4465,7 +4360,7 @@ done for ac_func in getpagesize do : ac_fn_c_check_func "$LINENO" "getpagesize" "ac_cv_func_getpagesize" -if test "x$ac_cv_func_getpagesize" = x""yes; then : +if test "x$ac_cv_func_getpagesize" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_GETPAGESIZE 1 _ACEOF @@ -4475,7 +4370,7 @@ done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mmap" >&5 $as_echo_n "checking for working mmap... " >&6; } -if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then : +if ${ac_cv_func_mmap_fixed_mapped+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : @@ -4552,6 +4447,7 @@ int main () { char *data, *data2, *data3; + const char *cdata2; int i, pagesize; int fd, fd2; @@ -4576,10 +4472,10 @@ main () fd2 = open ("conftest.txt", O_RDWR | O_CREAT | O_TRUNC, 0600); if (fd2 < 0) return 4; - data2 = ""; - if (write (fd2, data2, 1) != 1) + cdata2 = ""; + if (write (fd2, cdata2, 1) != 1) return 5; - data2 = mmap (0, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd2, 0L); + data2 = (char *) mmap (0, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd2, 0L); if (data2 == MAP_FAILED) return 6; for (i = 0; i < pagesize; ++i) @@ -4638,7 +4534,9 @@ $as_echo "#define HAVE_MMAP 1" >>confdefs.h fi rm -f conftest.mmap conftest.txt -if test "$ac_cv_func_mmap_fixed_mapped" != yes; then +fi +if test "x${enable_mmap}" = "xno" \ + -o "$ac_cv_func_mmap_fixed_mapped" != "yes"; then FTSYS_SRC='$(BASE_DIR)/ftsystem.c' else FTSYS_SRC='$(BUILD_DIR)/ftsystem.c' @@ -4652,7 +4550,7 @@ else " -if test "x$ac_cv_have_decl_munmap" = x""yes; then : +if test "x$ac_cv_have_decl_munmap" = xyes; then : ac_have_decl=1 else ac_have_decl=0 @@ -4696,8 +4594,7 @@ for ac_func in memcpy memmove do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -eval as_val=\$$as_ac_var - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -4719,7 +4616,7 @@ fi if test x$with_zlib != xno && test -z "$LIBZ"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gzsetparams in -lz" >&5 $as_echo_n "checking for gzsetparams in -lz... " >&6; } -if test "${ac_cv_lib_z_gzsetparams+set}" = set; then : +if ${ac_cv_lib_z_gzsetparams+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -4753,9 +4650,9 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_gzsetparams" >&5 $as_echo "$ac_cv_lib_z_gzsetparams" >&6; } -if test "x$ac_cv_lib_z_gzsetparams" = x""yes; then : +if test "x$ac_cv_lib_z_gzsetparams" = xyes; then : ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" -if test "x$ac_cv_header_zlib_h" = x""yes; then : +if test "x$ac_cv_header_zlib_h" = xyes; then : LIBZ='-lz' fi @@ -4769,6 +4666,66 @@ if test x$with_zlib != xno && test -n "$LIBZ"; then SYSTEM_ZLIB=yes fi +# check for system libbz2 + +# don't quote AS_HELP_STRING! + +# Check whether --with-bzip2 was given. +if test "${with_bzip2+set}" = set; then : + withval=$with_bzip2; +fi + +if test x$with_bzip2 != xno && test -z "$LIBBZ2"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BZ2_bzDecompress in -lbz2" >&5 +$as_echo_n "checking for BZ2_bzDecompress in -lbz2... " >&6; } +if ${ac_cv_lib_bz2_BZ2_bzDecompress+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lbz2 $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char BZ2_bzDecompress (); +int +main () +{ +return BZ2_bzDecompress (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_bz2_BZ2_bzDecompress=yes +else + ac_cv_lib_bz2_BZ2_bzDecompress=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bz2_BZ2_bzDecompress" >&5 +$as_echo "$ac_cv_lib_bz2_BZ2_bzDecompress" >&6; } +if test "x$ac_cv_lib_bz2_BZ2_bzDecompress" = xyes; then : + ac_fn_c_check_header_mongrel "$LINENO" "bzlib.h" "ac_cv_header_bzlib_h" "$ac_includes_default" +if test "x$ac_cv_header_bzlib_h" = xyes; then : + LIBBZ2='-lbz2' +fi + + +fi + +fi +if test x$with_bzip2 != xno && test -n "$LIBBZ2"; then + CFLAGS="$CFLAGS -DFT_CONFIG_OPTION_USE_BZIP2" + LDFLAGS="$LDFLAGS $LIBBZ2" +fi # Some options handling SDKs/archs in CFLAGS should be copied # to LDFLAGS. Apple TechNote 2137 recommends to include these @@ -4777,7 +4734,7 @@ fi save_config_args=$* set dummy ${CFLAGS} i=1 -while test $i -lt $# +while test $i -le $# do c=$1 @@ -4797,7 +4754,7 @@ $as_echo "no, copy to LDFLAGS" >&6; } fi shift 1 ;; - -m32|-m64) # options taking no argument + -m32|-m64|-march=*|-mcpu=*) # options taking no argument { $as_echo "$as_me:${as_lineno-$LINENO}: result: whether CFLAGS and LDFLAGS share ${c}" >&5 $as_echo "whether CFLAGS and LDFLAGS share ${c}" >&6; } if expr " ${LDFLAGS} " : ".* ${c} *${a}.*" > /dev/null @@ -4870,9 +4827,9 @@ if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } ftmac_c='ftmac.c' - { $as_echo "$as_me:${as_lineno-$LINENO}: checking OS_INLINE macro is ANSI compatible" >&5 -$as_echo_n "checking OS_INLINE macro is ANSI compatible... " >&6; } - orig_CFLAGS="$CFLAGS" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether OS_INLINE macro is ANSI compatible" >&5 +$as_echo_n "checking whether OS_INLINE macro is ANSI compatible... " >&6; } + orig_CFLAGS="$CFLAGS -DFT_MACINTOSH" CFLAGS="$CFLAGS $XX_CFLAGS $XX_ANSIFLAGS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -4978,7 +4935,8 @@ else xdarwin*) CFLAGS="$CFLAGS -DDARWIN_NO_CARBON" ;; - *) ;; + *) + ;; esac fi @@ -5282,7 +5240,7 @@ fi if test x$with_ats = xno; then CFLAGS="$CFLAGS -DHAVE_ATS=0" -elif test x$with_old_mac_fonts = xyes -a x$with_ats != x ; then +elif test x$with_old_mac_fonts = xyes -a x$with_ats != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking AppleTypeService functions" >&5 $as_echo_n "checking AppleTypeService functions... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -5357,6 +5315,7 @@ esac + case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 @@ -5365,8 +5324,8 @@ esac -macro_version='2.2.6b' -macro_revision='1.3017' +macro_version='2.4.2' +macro_revision='1.3337' @@ -5382,9 +5341,78 @@ macro_revision='1.3017' ltmain="$ac_aux_dir/ltmain.sh" +# Backslashify metacharacters that are still active within +# double-quoted strings. +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 +$as_echo_n "checking how to print strings... " >&6; } +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' +else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "" +} + +case "$ECHO" in + printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 +$as_echo "printf" >&6; } ;; + print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 +$as_echo "print -r" >&6; } ;; + *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 +$as_echo "cat" >&6; } ;; +esac + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } -if test "${ac_cv_path_SED+set}" = set; then : +if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ @@ -5439,7 +5467,7 @@ esac done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then - as_fn_error "no acceptable sed could be found in \$PATH" "$LINENO" 5 + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED @@ -5466,7 +5494,7 @@ Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } -if test "${ac_cv_path_FGREP+set}" = set; then : +if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 @@ -5518,7 +5546,7 @@ esac done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then - as_fn_error "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP @@ -5597,7 +5625,7 @@ else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi -if test "${lt_cv_path_LD+set}" = set; then : +if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then @@ -5634,10 +5662,10 @@ else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi -test -z "$LD" && as_fn_error "no acceptable ld found in \$PATH" "$LINENO" 5 +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } -if test "${lt_cv_prog_gnu_ld+set}" = set; then : +if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. @@ -5664,7 +5692,7 @@ with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } -if test "${lt_cv_path_NM+set}" = set; then : +if ${lt_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then @@ -5717,14 +5745,17 @@ if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. - if test -n "$ac_tool_prefix"; then - for ac_prog in "dumpbin -symbols" "link -dump -symbols" + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + if test -n "$ac_tool_prefix"; then + for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_DUMPBIN+set}" = set; then : +if ${ac_cv_prog_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then @@ -5762,13 +5793,13 @@ fi fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN - for ac_prog in "dumpbin -symbols" "link -dump -symbols" + for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then : +if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then @@ -5817,6 +5848,15 @@ esac fi fi + case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols" + ;; + *) + DUMPBIN=: + ;; + esac + fi if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" @@ -5831,18 +5871,18 @@ test -z "$NM" && NM=nm { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } -if test "${lt_cv_nm_interface+set}" = set; then : +if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:5839: $ac_compile\"" >&5) + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 - (eval echo "\"\$as_me:5842: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 - (eval echo "\"\$as_me:5845: output\"" >&5) + (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" @@ -5866,7 +5906,7 @@ fi # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } -if test "${lt_cv_sys_max_cmd_len+set}" = set; then : +if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&6 else i=0 @@ -5899,6 +5939,11 @@ else lt_cv_sys_max_cmd_len=8192; ;; + mint*) + # On MiNT this can take a long time and run out of memory. + lt_cv_sys_max_cmd_len=8192; + ;; + amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. @@ -5924,6 +5969,11 @@ else lt_cv_sys_max_cmd_len=196608 ;; + os2*) + # The test takes a long time on OS/2. + lt_cv_sys_max_cmd_len=8192 + ;; + osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not @@ -5963,8 +6013,8 @@ else # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. - while { test "X"`$SHELL $0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ - = "XX$teststring$teststring"; } >/dev/null 2>&1 && + while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` @@ -6006,8 +6056,8 @@ $as_echo_n "checking whether the shell understands some XSI constructs... " >&6; # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" - test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ - = c,a/b,, \ + test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes @@ -6056,9 +6106,83 @@ esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 +$as_echo_n "checking how to convert $build file names to $host format... " >&6; } +if ${lt_cv_to_host_file_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 + ;; + esac + ;; + *-*-cygwin* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin + ;; + esac + ;; + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; +esac + +fi + +to_host_file_cmd=$lt_cv_to_host_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 +$as_echo "$lt_cv_to_host_file_cmd" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 +$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } +if ${lt_cv_to_tool_file_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + #assume ordinary cross tools, or native build. +lt_cv_to_tool_file_cmd=func_convert_file_noop +case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 + ;; + esac + ;; +esac + +fi + +to_tool_file_cmd=$lt_cv_to_tool_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 +$as_echo "$lt_cv_to_tool_file_cmd" >&6; } + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } -if test "${lt_cv_ld_reload_flag+set}" = set; then : +if ${lt_cv_ld_reload_flag+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' @@ -6072,6 +6196,11 @@ case $reload_flag in esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + if test "$GCC" != yes; then + reload_cmds=false + fi + ;; darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' @@ -6094,7 +6223,7 @@ if test -n "$ac_tool_prefix"; then set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_OBJDUMP+set}" = set; then : +if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then @@ -6134,7 +6263,7 @@ if test -z "$ac_cv_prog_OBJDUMP"; then set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then : +if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then @@ -6190,7 +6319,7 @@ test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } -if test "${lt_cv_deplibs_check_method+set}" = set; then : +if ${lt_cv_deplibs_check_method+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' @@ -6232,16 +6361,18 @@ mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. - if ( file / ) >/dev/null 2>&1; then + # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. + if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else - lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; -cegcc) +cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' @@ -6271,6 +6402,10 @@ gnu*) lt_cv_deplibs_check_method=pass_all ;; +haiku*) + lt_cv_deplibs_check_method=pass_all + ;; + hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in @@ -6279,11 +6414,11 @@ hpux10.20* | hpux11*) lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac @@ -6304,8 +6439,8 @@ irix5* | irix6* | nonstopux*) lt_cv_deplibs_check_method=pass_all ;; -# This must be Linux ELF. -linux* | k*bsd*-gnu) +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; @@ -6386,6 +6521,21 @@ esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } + +file_magic_glob= +want_nocaseglob=no +if test "$build" = "$host"; then + case $host_os in + mingw* | pw32*) + if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then + want_nocaseglob=yes + else + file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` + fi + ;; + esac +fi + file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown @@ -6399,14 +6549,164 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown + + + + + + + + + + if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. -set dummy ${ac_tool_prefix}ar; ac_word=$2 + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_AR+set}" = set; then : +if ${ac_cv_prog_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +$as_echo "$DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +$as_echo "$ac_ct_DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DLLTOOL=$ac_ct_DLLTOOL + fi +else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi + +test -z "$DLLTOOL" && DLLTOOL=dlltool + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 +$as_echo_n "checking how to associate runtime and link libraries... " >&6; } +if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_sharedlib_from_linklib_cmd='unknown' + +case $host_os in +cygwin* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh + # decide which to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback + ;; + esac + ;; +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd="$ECHO" + ;; +esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 +$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO + + + + + + + +if test -n "$ac_tool_prefix"; then + for ac_prog in ar + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then @@ -6419,7 +6719,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_AR="${ac_tool_prefix}ar" + ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -6439,14 +6739,18 @@ $as_echo "no" >&6; } fi + test -n "$AR" && break + done fi -if test -z "$ac_cv_prog_AR"; then +if test -z "$AR"; then ac_ct_AR=$AR - # Extract the first word of "ar", so it can be a program name with args. -set dummy ar; ac_word=$2 + for ac_prog in ar +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_AR+set}" = set; then : +if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then @@ -6459,7 +6763,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_AR="ar" + ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -6478,6 +6782,10 @@ else $as_echo "no" >&6; } fi + + test -n "$ac_ct_AR" && break +done + if test "x$ac_ct_AR" = x; then AR="false" else @@ -6489,12 +6797,10 @@ ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi -else - AR="$ac_cv_prog_AR" fi -test -z "$AR" && AR=ar -test -z "$AR_FLAGS" && AR_FLAGS=cru +: ${AR=ar} +: ${AR_FLAGS=cru} @@ -6506,12 +6812,70 @@ test -z "$AR_FLAGS" && AR_FLAGS=cru +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 +$as_echo_n "checking for archiver @FILE support... " >&6; } +if ${lt_cv_ar_at_file+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ar_at_file=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + echo conftest.$ac_objext > conftest.lst + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -eq 0; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -ne 0; then + lt_cv_ar_at_file=@ + fi + fi + rm -f conftest.* libconftest.a + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 +$as_echo "$lt_cv_ar_at_file" >&6; } + +if test "x$lt_cv_ar_at_file" = xno; then + archiver_list_spec= +else + archiver_list_spec=$lt_cv_ar_at_file +fi + + + + + + + if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_STRIP+set}" = set; then : +if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then @@ -6551,7 +6915,7 @@ if test -z "$ac_cv_prog_STRIP"; then set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then @@ -6610,7 +6974,7 @@ if test -n "$ac_tool_prefix"; then set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_RANLIB+set}" = set; then : +if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then @@ -6650,7 +7014,7 @@ if test -z "$ac_cv_prog_RANLIB"; then set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then : +if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then @@ -6712,29 +7076,83 @@ old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" + old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" +fi + +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac + + + + + + + + + + + + + + + + + + + + + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AWK+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi - - - - - - - - - - - - - + test -n "$AWK" && break +done @@ -6767,7 +7185,7 @@ compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } -if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then : +if ${lt_cv_sys_global_symbol_pipe+:} false; then : $as_echo_n "(cached) " >&6 else @@ -6828,8 +7246,8 @@ esac lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= @@ -6853,6 +7271,7 @@ for ac_symprfx in "" "_"; do # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ +" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ @@ -6865,6 +7284,7 @@ for ac_symprfx in "" "_"; do else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no @@ -6890,8 +7310,8 @@ _LT_EOF test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\""; } >&5 - (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 + (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then @@ -6906,6 +7326,18 @@ _LT_EOF if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT_DLSYM_CONST +#elif defined(__osf__) +/* This system does not cope well with relocations in const data. */ +# define LT_DLSYM_CONST +#else +# define LT_DLSYM_CONST const +#endif + #ifdef __cplusplus extern "C" { #endif @@ -6917,7 +7349,7 @@ _LT_EOF cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ -const struct { +LT_DLSYM_CONST struct { const char *name; void *address; } @@ -6943,8 +7375,8 @@ static const void *lt_preloaded_setup() { _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext - lt_save_LIBS="$LIBS" - lt_save_CFLAGS="$CFLAGS" + lt_globsym_save_LIBS=$LIBS + lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 @@ -6954,8 +7386,8 @@ _LT_EOF test $ac_status = 0; } && test -s conftest${ac_exeext}; then pipe_works=yes fi - LIBS="$lt_save_LIBS" - CFLAGS="$lt_save_CFLAGS" + LIBS=$lt_globsym_save_LIBS + CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi @@ -6992,6 +7424,12 @@ else $as_echo "ok" >&6; } fi +# Response file support. +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + nm_file_list_spec='@' +elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then + nm_file_list_spec='@' +fi @@ -7012,6 +7450,49 @@ fi + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 +$as_echo_n "checking for sysroot... " >&6; } + +# Check whether --with-sysroot was given. +if test "${with_sysroot+set}" = set; then : + withval=$with_sysroot; +else + with_sysroot=no +fi + + +lt_sysroot= +case ${with_sysroot} in #( + yes) + if test "$GCC" = yes; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( + /*) + lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 +$as_echo "${with_sysroot}" >&6; } + as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 + ;; +esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 +$as_echo "${lt_sysroot:-no}" >&6; } + + + + # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : @@ -7044,7 +7525,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 7047 "configure"' > conftest.$ac_ext + echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -7138,7 +7619,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } -if test "${lt_cv_cc_needs_belf+set}" = set; then : +if ${lt_cv_cc_needs_belf+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=c @@ -7179,7 +7660,7 @@ $as_echo "$lt_cv_cc_needs_belf" >&6; } CFLAGS="$SAVE_CFLAGS" fi ;; -sparc*-*solaris*) +*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 @@ -7190,7 +7671,20 @@ sparc*-*solaris*) case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in - yes*) LD="${LD-ld} -m elf64_sparc" ;; + yes*) + case $host in + i?86-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + # GNU ld 2.21 introduced _sol2 emulations. Use them if available. + if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then + LD="${LD-ld}_sol2" + fi + ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" @@ -7206,6 +7700,123 @@ esac need_locks="$enable_libtool_lock" +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. +set dummy ${ac_tool_prefix}mt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$MANIFEST_TOOL"; then + ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL +if test -n "$MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 +$as_echo "$MANIFEST_TOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_MANIFEST_TOOL"; then + ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL + # Extract the first word of "mt", so it can be a program name with args. +set dummy mt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_MANIFEST_TOOL"; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL +if test -n "$ac_ct_MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 +$as_echo "$ac_ct_MANIFEST_TOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_MANIFEST_TOOL" = x; then + MANIFEST_TOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL + fi +else + MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" +fi + +test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 +$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } +if ${lt_cv_path_mainfest_tool+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_path_mainfest_tool=no + echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 + $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out + cat conftest.err >&5 + if $GREP 'Manifest Tool' conftest.out > /dev/null; then + lt_cv_path_mainfest_tool=yes + fi + rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 +$as_echo "$lt_cv_path_mainfest_tool" >&6; } +if test "x$lt_cv_path_mainfest_tool" != xyes; then + MANIFEST_TOOL=: +fi + + + + + case $host_os in rhapsody* | darwin*) @@ -7214,7 +7825,7 @@ need_locks="$enable_libtool_lock" set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_DSYMUTIL+set}" = set; then : +if ${ac_cv_prog_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then @@ -7254,7 +7865,7 @@ if test -z "$ac_cv_prog_DSYMUTIL"; then set dummy dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then : +if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then @@ -7306,7 +7917,7 @@ fi set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_NMEDIT+set}" = set; then : +if ${ac_cv_prog_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then @@ -7346,7 +7957,7 @@ if test -z "$ac_cv_prog_NMEDIT"; then set dummy nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then : +if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then @@ -7398,7 +8009,7 @@ fi set dummy ${ac_tool_prefix}lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_LIPO+set}" = set; then : +if ${ac_cv_prog_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then @@ -7438,7 +8049,7 @@ if test -z "$ac_cv_prog_LIPO"; then set dummy lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_LIPO+set}" = set; then : +if ${ac_cv_prog_ac_ct_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then @@ -7490,7 +8101,7 @@ fi set dummy ${ac_tool_prefix}otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_OTOOL+set}" = set; then : +if ${ac_cv_prog_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then @@ -7530,7 +8141,7 @@ if test -z "$ac_cv_prog_OTOOL"; then set dummy otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; then : +if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then @@ -7582,7 +8193,7 @@ fi set dummy ${ac_tool_prefix}otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_OTOOL64+set}" = set; then : +if ${ac_cv_prog_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then @@ -7622,7 +8233,7 @@ if test -z "$ac_cv_prog_OTOOL64"; then set dummy otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; then : +if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then @@ -7697,7 +8308,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } -if test "${lt_cv_apple_cc_single_mod+set}" = set; then : +if ${lt_cv_apple_cc_single_mod+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no @@ -7713,7 +8324,13 @@ else $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? - if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then + # If there is a non-empty error log, and "single_module" + # appears in it, assume the flag caused a linker warning + if test -s conftest.err && $GREP single_module conftest.err; then + cat conftest.err >&5 + # Otherwise, if the output was created with a 0 exit code from + # the compiler, it worked. + elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 @@ -7724,9 +8341,10 @@ else fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } -if test "${lt_cv_ld_exported_symbols_list+set}" = set; then : +if ${lt_cv_ld_exported_symbols_list+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no @@ -7756,6 +8374,41 @@ rm -f core conftest.err conftest.$ac_objext \ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 +$as_echo_n "checking for -force_load linker flag... " >&6; } +if ${lt_cv_ld_force_load+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 + echo "$AR cru libconftest.a conftest.o" >&5 + $AR cru libconftest.a conftest.o 2>&5 + echo "$RANLIB libconftest.a" >&5 + $RANLIB libconftest.a 2>&5 + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -s conftest.err && $GREP force_load conftest.err; then + cat conftest.err >&5 + elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&5 + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 +$as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; @@ -7783,7 +8436,7 @@ $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi - if test "$DSYMUTIL" != ":"; then + if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= @@ -7795,7 +8448,7 @@ for ac_header in dlfcn.h do : ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " -if test "x$ac_cv_header_dlfcn_h" = x""yes; then : +if test "x$ac_cv_header_dlfcn_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF @@ -7806,17 +8459,19 @@ done + + # Set options enable_win32_dll=yes case $host in -*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*) +*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. set dummy ${ac_tool_prefix}as; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_AS+set}" = set; then : +if ${ac_cv_prog_AS+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AS"; then @@ -7856,7 +8511,7 @@ if test -z "$ac_cv_prog_AS"; then set dummy as; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_AS+set}" = set; then : +if ${ac_cv_prog_ac_ct_AS+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AS"; then @@ -7908,7 +8563,7 @@ fi set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_DLLTOOL+set}" = set; then : +if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then @@ -7948,7 +8603,7 @@ if test -z "$ac_cv_prog_DLLTOOL"; then set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then : +if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then @@ -8000,7 +8655,7 @@ fi set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_OBJDUMP+set}" = set; then : +if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then @@ -8040,7 +8695,7 @@ if test -z "$ac_cv_prog_OBJDUMP"; then set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then : +if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then @@ -8179,7 +8834,22 @@ fi # Check whether --with-pic was given. if test "${with_pic+set}" = set; then : - withval=$with_pic; pic_mode="$withval" + withval=$with_pic; lt_p=${PACKAGE-default} + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for lt_pkg in $withval; do + IFS="$lt_save_ifs" + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac else pic_mode=default fi @@ -8250,6 +8920,11 @@ LIBTOOL='$(SHELL) $(top_builddir)/libtool' + + + + + @@ -8277,7 +8952,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } -if test "${lt_cv_objdir+set}" = set; then : +if ${lt_cv_objdir+:} false; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null @@ -8305,19 +8980,6 @@ _ACEOF - - - - - - - - - - - - - case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some @@ -8330,23 +8992,6 @@ aix3*) ;; esac -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -sed_quote_subst='s/\(["`$\\]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\(["`\\]\)/\\\1/g' - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to delay expansion of an escaped single quote. -delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' - # Global variables: ofile=libtool can_build_shared=yes @@ -8375,7 +9020,7 @@ for cc_temp in $compiler""; do *) break;; esac done -cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it @@ -8385,7 +9030,7 @@ file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } -if test "${lt_cv_path_MAGIC_CMD+set}" = set; then : +if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in @@ -8451,7 +9096,7 @@ if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } -if test "${lt_cv_path_MAGIC_CMD+set}" = set; then : +if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in @@ -8580,11 +9225,16 @@ if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then - lt_prog_compiler_no_builtin_flag=' -fno-builtin' + case $cc_basename in + nvcc*) + lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; + *) + lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; + esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } -if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then : +if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no @@ -8600,15 +9250,15 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:8603: $lt_compile\"" >&5) + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:8607: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. - $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes @@ -8637,8 +9287,6 @@ fi lt_prog_compiler_pic= lt_prog_compiler_static= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 -$as_echo_n "checking for $compiler option to produce PIC... " >&6; } if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' @@ -8686,6 +9334,12 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } lt_prog_compiler_pic='-fno-common' ;; + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + lt_prog_compiler_static= + ;; + hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag @@ -8728,6 +9382,15 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } lt_prog_compiler_pic='-fPIC' ;; esac + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + lt_prog_compiler_wl='-Xlinker ' + if test -n "$lt_prog_compiler_pic"; then + lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" + fi + ;; + esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in @@ -8769,7 +9432,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } lt_prog_compiler_static='-non_shared' ;; - linux* | k*bsd*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) @@ -8790,7 +9453,13 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; - pgcc* | pgf77* | pgf90* | pgf95*) + nagfor*) + # NAG Fortran compiler + lt_prog_compiler_wl='-Wl,-Wl,,' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' @@ -8802,25 +9471,40 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; - xl*) - # IBM XL C 8.0/Fortran 10.1 on PPC + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in + *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='' + ;; + *Sun\ F* | *Sun*Fortran*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Qoption ld ' + ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; - *Sun\ F*) - # Sun Fortran 8.3 passes all unrecognized flags to the linker - lt_prog_compiler_pic='-KPIC' + *Intel*\ [CF]*Compiler*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + *Portland\ Group*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' - lt_prog_compiler_wl='' ;; esac ;; @@ -8852,7 +9536,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in - f77* | f90* | f95*) + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; @@ -8909,13 +9593,17 @@ case $host_os in lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5 -$as_echo "$lt_prog_compiler_pic" >&6; } - - - - +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } +if ${lt_cv_prog_compiler_pic+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic=$lt_prog_compiler_pic +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 +$as_echo "$lt_cv_prog_compiler_pic" >&6; } +lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. @@ -8923,7 +9611,7 @@ $as_echo "$lt_prog_compiler_pic" >&6; } if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } -if test "${lt_cv_prog_compiler_pic_works+set}" = set; then : +if ${lt_cv_prog_compiler_pic_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no @@ -8939,15 +9627,15 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:8942: $lt_compile\"" >&5) + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:8946: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. - $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes @@ -8976,13 +9664,18 @@ fi + + + + + # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } -if test "${lt_cv_prog_compiler_static_works+set}" = set; then : +if ${lt_cv_prog_compiler_static_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no @@ -8995,7 +9688,7 @@ else if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 - $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes @@ -9025,7 +9718,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if test "${lt_cv_prog_compiler_c_o+set}" = set; then : +if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no @@ -9044,16 +9737,16 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:9047: $lt_compile\"" >&5) + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:9051: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings - $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes @@ -9080,7 +9773,7 @@ $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if test "${lt_cv_prog_compiler_c_o+set}" = set; then : +if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no @@ -9099,16 +9792,16 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:9102: $lt_compile\"" >&5) + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:9106: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings - $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes @@ -9174,7 +9867,6 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= - hardcode_libdir_flag_spec_ld= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported @@ -9221,7 +9913,33 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie esac ld_shlibs=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; + *\ \(GNU\ Binutils\)\ [3-9]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' @@ -9239,6 +9957,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie fi supports_anon_versioning=no case `$LD -v 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... @@ -9254,11 +9973,12 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie ld_shlibs=no cat <<_LT_EOF 1>&2 -*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to modify your PATH -*** so that a non-GNU linker is found, and then restart. +*** really care for shared libraries, you may want to install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. _LT_EOF fi @@ -9294,10 +10014,12 @@ _LT_EOF # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' + export_dynamic_flag_spec='${wl}--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' @@ -9315,6 +10037,11 @@ _LT_EOF fi ;; + haiku*) + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + link_all_deplibs=yes + ;; + interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no @@ -9330,7 +10057,7 @@ _LT_EOF archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; - gnu* | linux* | tpf* | k*bsd*-gnu) + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in @@ -9340,15 +10067,16 @@ _LT_EOF if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then - tmp_addflag= + tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; - pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group f77 and f90 compilers + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; @@ -9359,13 +10087,17 @@ _LT_EOF lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; - xl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) + xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object=yes + ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 - whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 @@ -9381,17 +10113,16 @@ _LT_EOF fi case $cc_basename in - xlf*) + xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' - hardcode_libdir_flag_spec= - hardcode_libdir_flag_spec_ld='-rpath $libdir' - archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ - $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac @@ -9405,8 +10136,8 @@ _LT_EOF archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; @@ -9424,8 +10155,8 @@ _LT_EOF _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi @@ -9471,8 +10202,8 @@ _LT_EOF *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi @@ -9512,8 +10243,10 @@ _LT_EOF else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global + # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi @@ -9600,7 +10333,13 @@ _LT_EOF allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath_+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -9613,25 +10352,32 @@ main () _ACEOF if ac_fn_c_try_link "$LINENO"; then : -lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\(.*\)$/\1/ - p - } - }' -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then - aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -fi + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_="/usr/lib:/lib" + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' @@ -9640,7 +10386,13 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi else # Determine the default libpath from the value encoded in an # empty executable. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath_+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -9653,30 +10405,42 @@ main () _ACEOF if ac_fn_c_try_link "$LINENO"; then : -lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\(.*\)$/\1/ - p - } - }' -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then - aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -fi + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_="/usr/lib:/lib" + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec='$convenience' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + fi archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' @@ -9708,20 +10472,64 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. - hardcode_libdir_flag_spec=' ' - allow_undefined_flag=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - old_archive_from_new_cmds='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' - fix_srcfile_path='`cygpath -w "$srcfile"`' - enable_shared_with_static_runtimes=yes + case $cc_basename in + cl*) + # Native MSVC + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + always_export_symbols=yes + file_list_spec='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, )='true' + enable_shared_with_static_runtimes=yes + exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' + # Don't use ranlib + old_postinstall_cmds='chmod 644 $oldlib' + postlink_cmds='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # Assume MSVC wrapper + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_from_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' + enable_shared_with_static_runtimes=yes + ;; + esac ;; darwin* | rhapsody*) @@ -9731,7 +10539,12 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported - whole_archive_flag_spec='' + if test "$lt_cv_ld_force_load" = "yes"; then + 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\"`' + + else + whole_archive_flag_spec='' + fi link_all_deplibs=yes allow_undefined_flag="$_lt_dar_allow_undefined" case $cc_basename in @@ -9739,7 +10552,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then - output_verbose_link_cmd=echo + output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" @@ -9757,10 +10570,6 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_shlibpath_var=no ;; - freebsd1*) - ld_shlibs=no - ;; - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little @@ -9773,7 +10582,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) + freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes @@ -9782,7 +10591,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) - archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no @@ -9790,7 +10599,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hpux9*) if test "$GCC" = yes; then - archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi @@ -9805,14 +10614,13 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ;; hpux10*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_flag_spec_ld='+b $libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes @@ -9824,16 +10632,16 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ;; hpux11*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then + if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) - archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) - archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else @@ -9845,7 +10653,46 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) - archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 +$as_echo_n "checking if $CC understands -b... " >&6; } +if ${lt_cv_prog_compiler__b+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler__b=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -b" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler__b=yes + fi + else + lt_cv_prog_compiler__b=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 +$as_echo "$lt_cv_prog_compiler__b" >&6; } + +if test x"$lt_cv_prog_compiler__b" = xyes; then + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' +else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' +fi + ;; esac fi @@ -9873,26 +10720,39 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + # This should be the same for all languages, so no per-tag cache variable. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 +$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } +if ${lt_cv_irix_exported_symbol+:} false; then : + $as_echo_n "(cached) " >&6 +else + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -int foo(void) {} +int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' - + lt_cv_irix_exported_symbol=yes +else + lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - LDFLAGS="$save_LDFLAGS" + LDFLAGS="$save_LDFLAGS" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 +$as_echo "$lt_cv_irix_exported_symbol" >&6; } + if test "$lt_cv_irix_exported_symbol" = yes; then + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + fi else - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' @@ -9954,17 +10814,17 @@ rm -f core conftest.err conftest.$ac_objext \ hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported - archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' @@ -9974,13 +10834,13 @@ rm -f core conftest.err conftest.$ac_objext \ osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ - $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' @@ -9993,9 +10853,9 @@ rm -f core conftest.err conftest.$ac_objext \ no_undefined_flag=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' - archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) @@ -10183,44 +11043,50 @@ x|xyes) # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } - $RM conftest* - echo "$lt_simple_compile_test_code" > conftest.$ac_ext +if ${lt_cv_archive_cmds_need_lc+:} false; then : + $as_echo_n "(cached) " >&6 +else + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl - pic_flag=$lt_prog_compiler_pic - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag - allow_undefined_flag= - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + pic_flag=$lt_prog_compiler_pic + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } - then - archive_cmds_need_lc=no - else - archive_cmds_need_lc=yes - fi - allow_undefined_flag=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $RM conftest* - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $archive_cmds_need_lc" >&5 -$as_echo "$archive_cmds_need_lc" >&6; } + then + lt_cv_archive_cmds_need_lc=no + else + lt_cv_archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 +$as_echo "$lt_cv_archive_cmds_need_lc" >&6; } + archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi @@ -10372,11 +11238,6 @@ esac - - - - - @@ -10391,16 +11252,23 @@ if test "$GCC" = yes; then darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac - lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; + *) lt_sed_strip_eq="s,=/,/,g" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'` - else - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= @@ -10413,7 +11281,7 @@ if test "$GCC" = yes; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done - lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk ' + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; @@ -10433,7 +11301,13 @@ BEGIN {RS=" "; FS="/|\n";} { if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` - sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's,/\([A-Za-z]:\),\1,g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi @@ -10459,7 +11333,7 @@ need_version=unknown case $host_os in aix3*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH @@ -10468,7 +11342,7 @@ aix3*) ;; aix[4-9]*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes @@ -10521,7 +11395,7 @@ amigaos*) m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; @@ -10533,7 +11407,7 @@ beos*) ;; bsdi[45]*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' @@ -10552,8 +11426,9 @@ cygwin* | mingw* | pw32* | cegcc*) need_version=no need_lib_prefix=no - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) + case $GCC,$cc_basename in + yes,*) + # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ @@ -10574,36 +11449,83 @@ cygwin* | mingw* | pw32* | cegcc*) cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + library_names_spec='${libname}.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec="$LIB" + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' ;; *) + # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + dynamic_linker='Win32 ld.exe' ;; esac - dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; @@ -10624,7 +11546,7 @@ darwin* | rhapsody*) ;; dgux*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' @@ -10632,10 +11554,6 @@ dgux*) shlibpath_var=LD_LIBRARY_PATH ;; -freebsd1*) - dynamic_linker=no - ;; - freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. @@ -10643,7 +11561,7 @@ freebsd* | dragonfly*) objformat=`/usr/bin/objformat` else case $host_os in - freebsd[123]*) objformat=aout ;; + freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi @@ -10661,7 +11579,7 @@ freebsd* | dragonfly*) esac shlibpath_var=LD_LIBRARY_PATH case $host_os in - freebsd2*) + freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) @@ -10681,12 +11599,26 @@ freebsd* | dragonfly*) ;; gnu*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=yes + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; @@ -10732,12 +11664,14 @@ hpux9* | hpux10* | hpux11*) soname_spec='${libname}${release}${shared_ext}$major' ;; esac - # HP-UX runs *really* slowly unless shared libraries are mode 555. + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 ;; interix[3-9]*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' @@ -10753,7 +11687,7 @@ irix5* | irix6* | nonstopux*) nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; @@ -10790,9 +11724,9 @@ linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; -# This must be Linux ELF. -linux* | k*bsd*-gnu) - version_type=linux +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -10800,12 +11734,17 @@ linux* | k*bsd*-gnu) finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no + # Some binutils ld are patched to set DT_RUNPATH - save_LDFLAGS=$LDFLAGS - save_libdir=$libdir - eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ - LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + if ${lt_cv_shlibpath_overrides_runpath+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -10818,13 +11757,17 @@ main () _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : - shlibpath_overrides_runpath=yes + lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$save_LDFLAGS - libdir=$save_libdir + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + +fi + + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install @@ -10833,7 +11776,7 @@ rm -f core conftest.err conftest.$ac_objext \ # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi @@ -10865,7 +11808,7 @@ netbsd*) ;; newsos6) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes @@ -10934,7 +11877,7 @@ rdos*) ;; solaris*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -10959,7 +11902,7 @@ sunos4*) ;; sysv4 | sysv4.3*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH @@ -10983,7 +11926,7 @@ sysv4 | sysv4.3*) sysv4*MP*) if test -d /usr/nec ;then - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH @@ -11014,7 +11957,7 @@ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -11024,7 +11967,7 @@ tpf*) ;; uts4*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH @@ -11130,6 +12073,11 @@ fi + + + + + @@ -11208,7 +12156,7 @@ else # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } -if test "${ac_cv_lib_dl_dlopen+set}" = set; then : +if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -11242,7 +12190,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else @@ -11256,12 +12204,12 @@ fi *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" -if test "x$ac_cv_func_shl_load" = x""yes; then : +if test "x$ac_cv_func_shl_load" = xyes; then : lt_cv_dlopen="shl_load" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } -if test "${ac_cv_lib_dld_shl_load+set}" = set; then : +if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -11295,16 +12243,16 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } -if test "x$ac_cv_lib_dld_shl_load" = x""yes; then : +if test "x$ac_cv_lib_dld_shl_load" = xyes; then : lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" -if test "x$ac_cv_func_dlopen" = x""yes; then : +if test "x$ac_cv_func_dlopen" = xyes; then : lt_cv_dlopen="dlopen" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } -if test "${ac_cv_lib_dl_dlopen+set}" = set; then : +if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -11338,12 +12286,12 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } -if test "${ac_cv_lib_svld_dlopen+set}" = set; then : +if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -11377,12 +12325,12 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } -if test "x$ac_cv_lib_svld_dlopen" = x""yes; then : +if test "x$ac_cv_lib_svld_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } -if test "${ac_cv_lib_dld_dld_link+set}" = set; then : +if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -11416,7 +12364,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } -if test "x$ac_cv_lib_dld_dld_link" = x""yes; then : +if test "x$ac_cv_lib_dld_dld_link" = xyes; then : lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" fi @@ -11457,7 +12405,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } -if test "${lt_cv_dlopen_self+set}" = set; then : +if ${lt_cv_dlopen_self+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : @@ -11466,7 +12414,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11469 "configure" +#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11507,7 +12455,13 @@ else # endif #endif -void fnord() { int i=42;} +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); @@ -11516,7 +12470,11 @@ int main () if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } /* dlclose (self); */ } else @@ -11553,7 +12511,7 @@ $as_echo "$lt_cv_dlopen_self" >&6; } wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } -if test "${lt_cv_dlopen_self_static+set}" = set; then : +if ${lt_cv_dlopen_self_static+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : @@ -11562,7 +12520,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11565 "configure" +#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11603,7 +12561,13 @@ else # endif #endif -void fnord() { int i=42;} +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); @@ -11612,7 +12576,11 @@ int main () if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } /* dlclose (self); */ } else @@ -11781,6 +12749,8 @@ CC="$lt_save_CC" + + ac_config_commands="$ac_config_commands libtool" @@ -11877,10 +12847,21 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then - test "x$cache_file" != "x/dev/null" && + if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} - cat confcache >$cache_file + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} @@ -11896,6 +12877,7 @@ DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= +U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' @@ -11911,7 +12893,7 @@ LTLIBOBJS=$ac_ltlibobjs -: ${CONFIG_STATUS=./config.status} +: "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" @@ -12012,6 +12994,7 @@ fi IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. +as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -12057,19 +13040,19 @@ export LANGUAGE (unset CDPATH) >/dev/null 2>&1 && unset CDPATH -# as_fn_error ERROR [LINENO LOG_FD] -# --------------------------------- +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with status $?, using 1 if that was 0. +# script with STATUS, using 1 if that was 0. as_fn_error () { - as_status=$?; test $as_status -eq 0 && as_status=1 - if test "$3"; then - as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $1" >&2 + $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error @@ -12265,7 +13248,7 @@ $as_echo X"$as_dir" | test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p @@ -12318,8 +13301,8 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by FreeType $as_me 2.4.3, which was -generated by GNU Autoconf 2.65. Invocation command line was +This file was extended by FreeType $as_me 2.4.9, which was +generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -12384,17 +13367,18 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -FreeType config.status 2.4.3 -configured by $0, generated by GNU Autoconf 2.65, +FreeType config.status 2.4.9 +configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" -Copyright (C) 2009 Free Software Foundation, Inc. +Copyright (C) 2010 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' +AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF @@ -12404,11 +13388,16 @@ ac_need_defaults=: while test $# != 0 do case $1 in - --*=*) + --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; *) ac_option=$1 ac_optarg=$2 @@ -12430,6 +13419,7 @@ do $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; @@ -12442,7 +13432,7 @@ do ac_need_defaults=false;; --he | --h) # Conflict between --help and --header - as_fn_error "ambiguous option: \`$1' + as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; @@ -12451,7 +13441,7 @@ Try \`$0 --help' for more information.";; ac_cs_silent=: ;; # This is an error. - -*) as_fn_error "unrecognized option: \`$1' + -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" @@ -12504,133 +13494,158 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' -macro_version='`$ECHO "X$macro_version" | $Xsed -e "$delay_single_quote_subst"`' -macro_revision='`$ECHO "X$macro_revision" | $Xsed -e "$delay_single_quote_subst"`' -AS='`$ECHO "X$AS" | $Xsed -e "$delay_single_quote_subst"`' -DLLTOOL='`$ECHO "X$DLLTOOL" | $Xsed -e "$delay_single_quote_subst"`' -OBJDUMP='`$ECHO "X$OBJDUMP" | $Xsed -e "$delay_single_quote_subst"`' -enable_shared='`$ECHO "X$enable_shared" | $Xsed -e "$delay_single_quote_subst"`' -enable_static='`$ECHO "X$enable_static" | $Xsed -e "$delay_single_quote_subst"`' -pic_mode='`$ECHO "X$pic_mode" | $Xsed -e "$delay_single_quote_subst"`' -enable_fast_install='`$ECHO "X$enable_fast_install" | $Xsed -e "$delay_single_quote_subst"`' -host_alias='`$ECHO "X$host_alias" | $Xsed -e "$delay_single_quote_subst"`' -host='`$ECHO "X$host" | $Xsed -e "$delay_single_quote_subst"`' -host_os='`$ECHO "X$host_os" | $Xsed -e "$delay_single_quote_subst"`' -build_alias='`$ECHO "X$build_alias" | $Xsed -e "$delay_single_quote_subst"`' -build='`$ECHO "X$build" | $Xsed -e "$delay_single_quote_subst"`' -build_os='`$ECHO "X$build_os" | $Xsed -e "$delay_single_quote_subst"`' -SED='`$ECHO "X$SED" | $Xsed -e "$delay_single_quote_subst"`' -Xsed='`$ECHO "X$Xsed" | $Xsed -e "$delay_single_quote_subst"`' -GREP='`$ECHO "X$GREP" | $Xsed -e "$delay_single_quote_subst"`' -EGREP='`$ECHO "X$EGREP" | $Xsed -e "$delay_single_quote_subst"`' -FGREP='`$ECHO "X$FGREP" | $Xsed -e "$delay_single_quote_subst"`' -LD='`$ECHO "X$LD" | $Xsed -e "$delay_single_quote_subst"`' -NM='`$ECHO "X$NM" | $Xsed -e "$delay_single_quote_subst"`' -LN_S='`$ECHO "X$LN_S" | $Xsed -e "$delay_single_quote_subst"`' -max_cmd_len='`$ECHO "X$max_cmd_len" | $Xsed -e "$delay_single_quote_subst"`' -ac_objext='`$ECHO "X$ac_objext" | $Xsed -e "$delay_single_quote_subst"`' -exeext='`$ECHO "X$exeext" | $Xsed -e "$delay_single_quote_subst"`' -lt_unset='`$ECHO "X$lt_unset" | $Xsed -e "$delay_single_quote_subst"`' -lt_SP2NL='`$ECHO "X$lt_SP2NL" | $Xsed -e "$delay_single_quote_subst"`' -lt_NL2SP='`$ECHO "X$lt_NL2SP" | $Xsed -e "$delay_single_quote_subst"`' -reload_flag='`$ECHO "X$reload_flag" | $Xsed -e "$delay_single_quote_subst"`' -reload_cmds='`$ECHO "X$reload_cmds" | $Xsed -e "$delay_single_quote_subst"`' -deplibs_check_method='`$ECHO "X$deplibs_check_method" | $Xsed -e "$delay_single_quote_subst"`' -file_magic_cmd='`$ECHO "X$file_magic_cmd" | $Xsed -e "$delay_single_quote_subst"`' -AR='`$ECHO "X$AR" | $Xsed -e "$delay_single_quote_subst"`' -AR_FLAGS='`$ECHO "X$AR_FLAGS" | $Xsed -e "$delay_single_quote_subst"`' -STRIP='`$ECHO "X$STRIP" | $Xsed -e "$delay_single_quote_subst"`' -RANLIB='`$ECHO "X$RANLIB" | $Xsed -e "$delay_single_quote_subst"`' -old_postinstall_cmds='`$ECHO "X$old_postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' -old_postuninstall_cmds='`$ECHO "X$old_postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' -old_archive_cmds='`$ECHO "X$old_archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' -CC='`$ECHO "X$CC" | $Xsed -e "$delay_single_quote_subst"`' -CFLAGS='`$ECHO "X$CFLAGS" | $Xsed -e "$delay_single_quote_subst"`' -compiler='`$ECHO "X$compiler" | $Xsed -e "$delay_single_quote_subst"`' -GCC='`$ECHO "X$GCC" | $Xsed -e "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_pipe='`$ECHO "X$lt_cv_sys_global_symbol_pipe" | $Xsed -e "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_cdecl='`$ECHO "X$lt_cv_sys_global_symbol_to_cdecl" | $Xsed -e "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address" | $Xsed -e "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' -objdir='`$ECHO "X$objdir" | $Xsed -e "$delay_single_quote_subst"`' -SHELL='`$ECHO "X$SHELL" | $Xsed -e "$delay_single_quote_subst"`' -ECHO='`$ECHO "X$ECHO" | $Xsed -e "$delay_single_quote_subst"`' -MAGIC_CMD='`$ECHO "X$MAGIC_CMD" | $Xsed -e "$delay_single_quote_subst"`' -lt_prog_compiler_no_builtin_flag='`$ECHO "X$lt_prog_compiler_no_builtin_flag" | $Xsed -e "$delay_single_quote_subst"`' -lt_prog_compiler_wl='`$ECHO "X$lt_prog_compiler_wl" | $Xsed -e "$delay_single_quote_subst"`' -lt_prog_compiler_pic='`$ECHO "X$lt_prog_compiler_pic" | $Xsed -e "$delay_single_quote_subst"`' -lt_prog_compiler_static='`$ECHO "X$lt_prog_compiler_static" | $Xsed -e "$delay_single_quote_subst"`' -lt_cv_prog_compiler_c_o='`$ECHO "X$lt_cv_prog_compiler_c_o" | $Xsed -e "$delay_single_quote_subst"`' -need_locks='`$ECHO "X$need_locks" | $Xsed -e "$delay_single_quote_subst"`' -DSYMUTIL='`$ECHO "X$DSYMUTIL" | $Xsed -e "$delay_single_quote_subst"`' -NMEDIT='`$ECHO "X$NMEDIT" | $Xsed -e "$delay_single_quote_subst"`' -LIPO='`$ECHO "X$LIPO" | $Xsed -e "$delay_single_quote_subst"`' -OTOOL='`$ECHO "X$OTOOL" | $Xsed -e "$delay_single_quote_subst"`' -OTOOL64='`$ECHO "X$OTOOL64" | $Xsed -e "$delay_single_quote_subst"`' -libext='`$ECHO "X$libext" | $Xsed -e "$delay_single_quote_subst"`' -shrext_cmds='`$ECHO "X$shrext_cmds" | $Xsed -e "$delay_single_quote_subst"`' -extract_expsyms_cmds='`$ECHO "X$extract_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' -archive_cmds_need_lc='`$ECHO "X$archive_cmds_need_lc" | $Xsed -e "$delay_single_quote_subst"`' -enable_shared_with_static_runtimes='`$ECHO "X$enable_shared_with_static_runtimes" | $Xsed -e "$delay_single_quote_subst"`' -export_dynamic_flag_spec='`$ECHO "X$export_dynamic_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' -whole_archive_flag_spec='`$ECHO "X$whole_archive_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' -compiler_needs_object='`$ECHO "X$compiler_needs_object" | $Xsed -e "$delay_single_quote_subst"`' -old_archive_from_new_cmds='`$ECHO "X$old_archive_from_new_cmds" | $Xsed -e "$delay_single_quote_subst"`' -old_archive_from_expsyms_cmds='`$ECHO "X$old_archive_from_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' -archive_cmds='`$ECHO "X$archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' -archive_expsym_cmds='`$ECHO "X$archive_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' -module_cmds='`$ECHO "X$module_cmds" | $Xsed -e "$delay_single_quote_subst"`' -module_expsym_cmds='`$ECHO "X$module_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' -with_gnu_ld='`$ECHO "X$with_gnu_ld" | $Xsed -e "$delay_single_quote_subst"`' -allow_undefined_flag='`$ECHO "X$allow_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' -no_undefined_flag='`$ECHO "X$no_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec='`$ECHO "X$hardcode_libdir_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec_ld='`$ECHO "X$hardcode_libdir_flag_spec_ld" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_libdir_separator='`$ECHO "X$hardcode_libdir_separator" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_direct='`$ECHO "X$hardcode_direct" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_direct_absolute='`$ECHO "X$hardcode_direct_absolute" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_minus_L='`$ECHO "X$hardcode_minus_L" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_shlibpath_var='`$ECHO "X$hardcode_shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_automatic='`$ECHO "X$hardcode_automatic" | $Xsed -e "$delay_single_quote_subst"`' -inherit_rpath='`$ECHO "X$inherit_rpath" | $Xsed -e "$delay_single_quote_subst"`' -link_all_deplibs='`$ECHO "X$link_all_deplibs" | $Xsed -e "$delay_single_quote_subst"`' -fix_srcfile_path='`$ECHO "X$fix_srcfile_path" | $Xsed -e "$delay_single_quote_subst"`' -always_export_symbols='`$ECHO "X$always_export_symbols" | $Xsed -e "$delay_single_quote_subst"`' -export_symbols_cmds='`$ECHO "X$export_symbols_cmds" | $Xsed -e "$delay_single_quote_subst"`' -exclude_expsyms='`$ECHO "X$exclude_expsyms" | $Xsed -e "$delay_single_quote_subst"`' -include_expsyms='`$ECHO "X$include_expsyms" | $Xsed -e "$delay_single_quote_subst"`' -prelink_cmds='`$ECHO "X$prelink_cmds" | $Xsed -e "$delay_single_quote_subst"`' -file_list_spec='`$ECHO "X$file_list_spec" | $Xsed -e "$delay_single_quote_subst"`' -variables_saved_for_relink='`$ECHO "X$variables_saved_for_relink" | $Xsed -e "$delay_single_quote_subst"`' -need_lib_prefix='`$ECHO "X$need_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' -need_version='`$ECHO "X$need_version" | $Xsed -e "$delay_single_quote_subst"`' -version_type='`$ECHO "X$version_type" | $Xsed -e "$delay_single_quote_subst"`' -runpath_var='`$ECHO "X$runpath_var" | $Xsed -e "$delay_single_quote_subst"`' -shlibpath_var='`$ECHO "X$shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' -shlibpath_overrides_runpath='`$ECHO "X$shlibpath_overrides_runpath" | $Xsed -e "$delay_single_quote_subst"`' -libname_spec='`$ECHO "X$libname_spec" | $Xsed -e "$delay_single_quote_subst"`' -library_names_spec='`$ECHO "X$library_names_spec" | $Xsed -e "$delay_single_quote_subst"`' -soname_spec='`$ECHO "X$soname_spec" | $Xsed -e "$delay_single_quote_subst"`' -postinstall_cmds='`$ECHO "X$postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' -postuninstall_cmds='`$ECHO "X$postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' -finish_cmds='`$ECHO "X$finish_cmds" | $Xsed -e "$delay_single_quote_subst"`' -finish_eval='`$ECHO "X$finish_eval" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_into_libs='`$ECHO "X$hardcode_into_libs" | $Xsed -e "$delay_single_quote_subst"`' -sys_lib_search_path_spec='`$ECHO "X$sys_lib_search_path_spec" | $Xsed -e "$delay_single_quote_subst"`' -sys_lib_dlsearch_path_spec='`$ECHO "X$sys_lib_dlsearch_path_spec" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_action='`$ECHO "X$hardcode_action" | $Xsed -e "$delay_single_quote_subst"`' -enable_dlopen='`$ECHO "X$enable_dlopen" | $Xsed -e "$delay_single_quote_subst"`' -enable_dlopen_self='`$ECHO "X$enable_dlopen_self" | $Xsed -e "$delay_single_quote_subst"`' -enable_dlopen_self_static='`$ECHO "X$enable_dlopen_self_static" | $Xsed -e "$delay_single_quote_subst"`' -old_striplib='`$ECHO "X$old_striplib" | $Xsed -e "$delay_single_quote_subst"`' -striplib='`$ECHO "X$striplib" | $Xsed -e "$delay_single_quote_subst"`' +macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' +macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' +AS='`$ECHO "$AS" | $SED "$delay_single_quote_subst"`' +DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' +OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' +enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' +enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' +pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' +enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' +SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' +ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' +PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' +host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' +host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' +host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' +build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' +build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' +build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' +SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' +Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' +GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' +EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' +FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' +LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' +NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' +LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' +max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' +ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' +exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' +lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' +lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' +lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' +lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' +lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' +reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' +reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' +deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' +file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' +file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' +want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' +sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' +AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' +AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' +archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' +STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' +RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' +old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' +old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' +lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' +CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' +CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' +compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' +GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' +nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' +lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' +objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' +MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' +need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' +MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' +DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' +NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' +LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' +OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' +OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' +libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' +shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' +extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' +compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' +module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' +with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' +no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' +hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' +hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' +inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' +link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' +always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' +exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' +include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' +prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' +postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' +file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' +variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' +need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' +need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' +version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' +runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' +libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' +library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' +soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' +install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' +postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' +postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' +finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' +hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' +sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' +sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' +hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' +enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' +old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' +striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + # Quote evaled strings. -for var in SED \ +for var in AS \ +DLLTOOL \ +OBJDUMP \ +SHELL \ +ECHO \ +PATH_SEPARATOR \ +SED \ GREP \ EGREP \ FGREP \ @@ -12642,8 +13657,12 @@ lt_NL2SP \ reload_flag \ deplibs_check_method \ file_magic_cmd \ +file_magic_glob \ +want_nocaseglob \ +sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ +archiver_list_spec \ STRIP \ RANLIB \ CC \ @@ -12653,14 +13672,14 @@ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ -SHELL \ -ECHO \ +nm_file_list_spec \ lt_prog_compiler_no_builtin_flag \ -lt_prog_compiler_wl \ lt_prog_compiler_pic \ +lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ +MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ @@ -12674,9 +13693,7 @@ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ -hardcode_libdir_flag_spec_ld \ hardcode_libdir_separator \ -fix_srcfile_path \ exclude_expsyms \ include_expsyms \ file_list_spec \ @@ -12684,12 +13701,13 @@ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ +install_override_mode \ finish_eval \ old_striplib \ striplib; do - case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -12711,14 +13729,15 @@ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ +postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ sys_lib_dlsearch_path_spec; do - case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -12726,12 +13745,6 @@ sys_lib_dlsearch_path_spec; do esac done -# Fix-up fallback echo if it was mangled by the above quoting rules. -case \$lt_ECHO in -*'\\\$0 --fallback-echo"') lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\$0 --fallback-echo"\$/\$0 --fallback-echo"/'\` - ;; -esac - ac_aux_dir='$ac_aux_dir' xsi_shell='$xsi_shell' lt_shell_append='$lt_shell_append' @@ -12767,7 +13780,7 @@ do "freetype-config") CONFIG_FILES="$CONFIG_FILES freetype-config" ;; "freetype2.pc") CONFIG_FILES="$CONFIG_FILES freetype2.pc:freetype2.in" ;; - *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done @@ -12790,9 +13803,10 @@ fi # after its creation but before its name has been assigned to `$tmp'. $debug || { - tmp= + tmp= ac_tmp= trap 'exit_status=$? - { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } @@ -12800,12 +13814,13 @@ $debug || { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" + test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") -} || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5 +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. @@ -12822,12 +13837,12 @@ if test "x$ac_cr" = x; then fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then - ac_cs_awk_cr='\r' + ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi -echo 'BEGIN {' >"$tmp/subs1.awk" && +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF @@ -12836,18 +13851,18 @@ _ACEOF echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || - as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 -ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || - as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then - as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi @@ -12855,7 +13870,7 @@ done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$tmp/subs1.awk" <<\\_ACAWK && +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h @@ -12903,7 +13918,7 @@ t delim rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK -cat >>"\$tmp/subs1.awk" <<_ACAWK && +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" @@ -12935,21 +13950,29 @@ if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat -fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ - || as_fn_error "could not setup config files machinery" "$LINENO" 5 +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/ -s/:*\${srcdir}:*/:/ -s/:*@srcdir@:*/:/ -s/^\([^=]*=[ ]*\):*/\1/ + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// s/^[^=]*=[ ]*$// }' fi @@ -12961,7 +13984,7 @@ fi # test -n "$CONFIG_FILES" # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then -cat >"$tmp/defines.awk" <<\_ACAWK || +cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF @@ -12973,11 +13996,11 @@ _ACEOF # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do - ac_t=`sed -n "/$ac_delim/p" confdefs.h` - if test -z "$ac_t"; then + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then break elif $ac_last_try; then - as_fn_error "could not make $CONFIG_HEADERS" "$LINENO" 5 + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi @@ -13062,7 +14085,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - as_fn_error "could not setup config headers machinery" "$LINENO" 5 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" @@ -13075,7 +14098,7 @@ do esac case $ac_mode$ac_tag in :[FHL]*:*);; - :L* | :C*:*) as_fn_error "invalid tag \`$ac_tag'" "$LINENO" 5;; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac @@ -13094,7 +14117,7 @@ do for ac_f do case $ac_f in - -) ac_f="$tmp/stdin";; + -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. @@ -13103,7 +14126,7 @@ do [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - as_fn_error "cannot find input file: \`$ac_f'" "$LINENO" 5;; + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" @@ -13129,8 +14152,8 @@ $as_echo "$as_me: creating $ac_file" >&6;} esac case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin" \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 ;; + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac @@ -13260,23 +14283,24 @@ s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t $ac_datarootdir_hack " -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&5 +which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&2;} +which seems to be undefined. Please make sure it is defined" >&2;} - rm -f "$tmp/stdin" + rm -f "$ac_tmp/stdin" case $ac_file in - -) cat "$tmp/out" && rm -f "$tmp/out";; - *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # @@ -13285,21 +14309,21 @@ which seems to be undefined. Please make sure it is defined." >&2;} if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" - } >"$tmp/config.h" \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 - if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" - mv "$tmp/config.h" "$ac_file" \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ - || as_fn_error "could not create -" "$LINENO" 5 + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 fi ;; @@ -13327,10 +14351,12 @@ $as_echo "$as_me: executing $ac_file commands" >&6;} # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008 Free Software Foundation, Inc. +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. @@ -13367,13 +14393,13 @@ macro_version=$macro_version macro_revision=$macro_revision # Assembler program. -AS=$AS +AS=$lt_AS # DLL creation program. -DLLTOOL=$DLLTOOL +DLLTOOL=$lt_DLLTOOL # Object dumper program. -OBJDUMP=$OBJDUMP +OBJDUMP=$lt_OBJDUMP # Whether or not to build shared libraries. build_libtool_libs=$enable_shared @@ -13387,6 +14413,15 @@ pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# An echo program that protects backslashes. +ECHO=$lt_ECHO + +# The PATH separator for the build system. +PATH_SEPARATOR=$lt_PATH_SEPARATOR + # The host system. host_alias=$host_alias host=$host @@ -13436,20 +14471,36 @@ SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds +# convert \$build file names to \$host format. +to_host_file_cmd=$lt_cv_to_host_file_cmd + +# convert \$build files to toolchain format. +to_tool_file_cmd=$lt_cv_to_tool_file_cmd # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method -# Command to use when deplibs_check_method == "file_magic". +# Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd +# How to find potential files when deplibs_check_method = "file_magic". +file_magic_glob=$lt_file_magic_glob + +# Find potential files using nocaseglob when deplibs_check_method = "file_magic". +want_nocaseglob=$lt_want_nocaseglob + +# Command to associate shared and link libraries. +sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd + # The archiver. AR=$lt_AR + +# Flags to create an archive. AR_FLAGS=$lt_AR_FLAGS +# How to feed a file listing to the archiver. +archiver_list_spec=$lt_archiver_list_spec + # A symbol stripping program. STRIP=$lt_STRIP @@ -13458,6 +14509,9 @@ RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds +# Whether to use a lock for old archive extraction. +lock_old_archive_extraction=$lock_old_archive_extraction + # A C compiler. LTCC=$lt_CC @@ -13476,21 +14530,24 @@ global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix +# Specify filename containing input files for \$NM. +nm_file_list_spec=$lt_nm_file_list_spec + +# The root where to search for dependent libraries,and in which our libraries should be installed. +lt_sysroot=$lt_sysroot + # The name of the directory that contains temporary libtool files. objdir=$objdir -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# An echo program that does not interpret backslashes. -ECHO=$lt_ECHO - # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks +# Manifest tool. +MANIFEST_TOOL=$lt_MANIFEST_TOOL + # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL @@ -13547,6 +14604,9 @@ library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec +# Permission mode override for installation of shared libraries. +install_override_mode=$lt_install_override_mode + # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds @@ -13586,6 +14646,10 @@ striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds @@ -13598,12 +14662,12 @@ with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl - # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl + # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static @@ -13653,10 +14717,6 @@ no_undefined_flag=$lt_no_undefined_flag # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec -# If ld is used when linking, flag to hardcode \$libdir into a binary -# during linking. This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld - # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator @@ -13690,9 +14750,6 @@ inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path=$lt_fix_srcfile_path - # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols @@ -13708,6 +14765,9 @@ include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds +# Commands necessary for finishing linking programs. +postlink_cmds=$lt_postlink_cmds + # Specify filename containing input files. file_list_spec=$lt_file_list_spec @@ -13740,212 +14800,169 @@ ltmain="$ac_aux_dir/ltmain.sh" # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? - sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ - || (rm -f "$cfgfile"; exit 1) + sed '$q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) - case $xsi_shell in - yes) - cat << \_LT_EOF >> "$cfgfile" - -# func_dirname file append nondir_replacement -# Compute the dirname of FILE. If nonempty, add APPEND to the result, -# otherwise set result to NONDIR_REPLACEMENT. -func_dirname () -{ - case ${1} in - */*) func_dirname_result="${1%/*}${2}" ;; - * ) func_dirname_result="${3}" ;; - esac -} - -# func_basename file -func_basename () -{ - func_basename_result="${1##*/}" -} - -# func_dirname_and_basename file append nondir_replacement -# perform func_basename and func_dirname in a single function -# call: -# dirname: Compute the dirname of FILE. If nonempty, -# add APPEND to the result, otherwise set result -# to NONDIR_REPLACEMENT. -# value returned in "$func_dirname_result" -# basename: Compute filename of FILE. -# value retuned in "$func_basename_result" -# Implementation must be kept synchronized with func_dirname -# and func_basename. For efficiency, we do not delegate to -# those functions but instead duplicate the functionality here. -func_dirname_and_basename () -{ - case ${1} in - */*) func_dirname_result="${1%/*}${2}" ;; - * ) func_dirname_result="${3}" ;; - esac - func_basename_result="${1##*/}" -} - -# func_stripname prefix suffix name -# strip PREFIX and SUFFIX off of NAME. -# PREFIX and SUFFIX must not contain globbing or regex special -# characters, hashes, percent signs, but SUFFIX may contain a leading -# dot (in which case that matches only a dot). -func_stripname () -{ - # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are - # positional parameters, so assign one to ordinary parameter first. - func_stripname_result=${3} - func_stripname_result=${func_stripname_result#"${1}"} - func_stripname_result=${func_stripname_result%"${2}"} -} - -# func_opt_split -func_opt_split () -{ - func_opt_split_opt=${1%%=*} - func_opt_split_arg=${1#*=} -} - -# func_lo2o object -func_lo2o () -{ - case ${1} in - *.lo) func_lo2o_result=${1%.lo}.${objext} ;; - *) func_lo2o_result=${1} ;; - esac -} - -# func_xform libobj-or-source -func_xform () -{ - func_xform_result=${1%.*}.lo -} - -# func_arith arithmetic-term... -func_arith () -{ - func_arith_result=$(( $* )) -} - -# func_len string -# STRING may not start with a hyphen. -func_len () -{ - func_len_result=${#1} -} - -_LT_EOF - ;; - *) # Bourne compatible functions. - cat << \_LT_EOF >> "$cfgfile" - -# func_dirname file append nondir_replacement -# Compute the dirname of FILE. If nonempty, add APPEND to the result, -# otherwise set result to NONDIR_REPLACEMENT. -func_dirname () -{ - # Extract subdirectory from the argument. - func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` - if test "X$func_dirname_result" = "X${1}"; then - func_dirname_result="${3}" - else - func_dirname_result="$func_dirname_result${2}" - fi -} - -# func_basename file -func_basename () -{ - func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` -} + if test x"$xsi_shell" = xyes; then + sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ +func_dirname ()\ +{\ +\ case ${1} in\ +\ */*) func_dirname_result="${1%/*}${2}" ;;\ +\ * ) func_dirname_result="${3}" ;;\ +\ esac\ +} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: -# func_stripname prefix suffix name -# strip PREFIX and SUFFIX off of NAME. -# PREFIX and SUFFIX must not contain globbing or regex special -# characters, hashes, percent signs, but SUFFIX may contain a leading -# dot (in which case that matches only a dot). -# func_strip_suffix prefix name -func_stripname () -{ - case ${2} in - .*) func_stripname_result=`$ECHO "X${3}" \ - | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; - *) func_stripname_result=`$ECHO "X${3}" \ - | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; - esac -} - -# sed scripts: -my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q' -my_sed_long_arg='1s/^-[^=]*=//' - -# func_opt_split -func_opt_split () -{ - func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` - func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` -} - -# func_lo2o object -func_lo2o () -{ - func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` -} - -# func_xform libobj-or-source -func_xform () -{ - func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[^.]*$/.lo/'` -} - -# func_arith arithmetic-term... -func_arith () -{ - func_arith_result=`expr "$@"` -} - -# func_len string -# STRING may not start with a hyphen. -func_len () -{ - func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` -} - -_LT_EOF -esac - -case $lt_shell_append in - yes) - cat << \_LT_EOF >> "$cfgfile" - -# func_append var value -# Append VALUE to the end of shell variable VAR. -func_append () -{ - eval "$1+=\$2" -} -_LT_EOF - ;; - *) - cat << \_LT_EOF >> "$cfgfile" - -# func_append var value -# Append VALUE to the end of shell variable VAR. -func_append () -{ - eval "$1=\$$1\$2" -} - -_LT_EOF - ;; - esac + sed -e '/^func_basename ()$/,/^} # func_basename /c\ +func_basename ()\ +{\ +\ func_basename_result="${1##*/}"\ +} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: - sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ - || (rm -f "$cfgfile"; exit 1) + sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ +func_dirname_and_basename ()\ +{\ +\ case ${1} in\ +\ */*) func_dirname_result="${1%/*}${2}" ;;\ +\ * ) func_dirname_result="${3}" ;;\ +\ esac\ +\ func_basename_result="${1##*/}"\ +} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: - mv -f "$cfgfile" "$ofile" || + + sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ +func_stripname ()\ +{\ +\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ +\ # positional parameters, so assign one to ordinary parameter first.\ +\ func_stripname_result=${3}\ +\ func_stripname_result=${func_stripname_result#"${1}"}\ +\ func_stripname_result=${func_stripname_result%"${2}"}\ +} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ +func_split_long_opt ()\ +{\ +\ func_split_long_opt_name=${1%%=*}\ +\ func_split_long_opt_arg=${1#*=}\ +} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ +func_split_short_opt ()\ +{\ +\ func_split_short_opt_arg=${1#??}\ +\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ +} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ +func_lo2o ()\ +{\ +\ case ${1} in\ +\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ +\ *) func_lo2o_result=${1} ;;\ +\ esac\ +} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_xform ()$/,/^} # func_xform /c\ +func_xform ()\ +{\ + func_xform_result=${1%.*}.lo\ +} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_arith ()$/,/^} # func_arith /c\ +func_arith ()\ +{\ + func_arith_result=$(( $* ))\ +} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_len ()$/,/^} # func_len /c\ +func_len ()\ +{\ + func_len_result=${#1}\ +} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + +fi + +if test x"$lt_shell_append" = xyes; then + sed -e '/^func_append ()$/,/^} # func_append /c\ +func_append ()\ +{\ + eval "${1}+=\\${2}"\ +} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ +func_append_quoted ()\ +{\ +\ func_quote_for_eval "${2}"\ +\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ +} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + # Save a `func_append' function call where possible by direct use of '+=' + sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +else + # Save a `func_append' function call even when '+=' is not available + sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +fi + +if test x"$_lt_function_replace_fail" = x":"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 +$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} +fi + + + mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" @@ -13963,7 +14980,7 @@ _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || - as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5 + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. @@ -13984,7 +15001,7 @@ if test "$no_create" != yes; then exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. - $ac_cs_success || as_fn_exit $? + $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 diff --git a/modules/freetype2/builds/unix/configure.ac b/modules/freetype2/builds/unix/configure.ac index 93c970cbe64..a0662166be2 100644 --- a/modules/freetype2/builds/unix/configure.ac +++ b/modules/freetype2/builds/unix/configure.ac @@ -2,7 +2,7 @@ # # Process this file with autoconf to produce a configure script. # -# Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by +# Copyright 2001-2012 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, @@ -11,13 +11,13 @@ # indicate that you have read the license and understand and accept it # fully. -AC_INIT([FreeType], [2.4.3], [freetype@nongnu.org], [freetype]) +AC_INIT([FreeType], [2.4.9], [freetype@nongnu.org], [freetype]) AC_CONFIG_SRCDIR([ftconfig.in]) # Don't forget to update docs/VERSION.DLL! -version_info='12:1:6' +version_info='14:1:8' AC_SUBST([version_info]) ft_version=`echo $version_info | tr : .` AC_SUBST([ft_version]) @@ -52,7 +52,7 @@ if test ${cross_compiling} = yes; then EXEEXT_BUILD="" elif test -x a_out.exe -o -x conftest.exe; then EXEEXT_BUILD=".exe" - elif test -x conftest.* ; then + elif test -x conftest.*; then EXEEXT_BUILD=`echo conftest.* | sed -n '1s/^.*\././'` fi rm -f a.* b.* a_out.exe conftest.* @@ -104,7 +104,8 @@ case "$INSTALL" in /*) ;; */*) - INSTALL="`pwd`/$INSTALL" ;; + INSTALL="`pwd`/$INSTALL" + ;; esac @@ -123,7 +124,7 @@ AC_CHECK_SIZEOF([long]) # check whether cpp computation of size of int and long in ftconfig.in works -AC_MSG_CHECKING([cpp computation of bit length in ftconfig.in works]) +AC_MSG_CHECKING([whether cpp computation of bit length in ftconfig.in works]) orig_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="-I${srcdir} -I. ${CPPFLAGS}" ac_clean_files="ft2build.h ftoption.h ftstdlib.h" @@ -189,8 +190,15 @@ CPPFLAGS="${orig_CPPFLAGS}" # Here we check whether we can use our mmap file component. -AC_FUNC_MMAP -if test "$ac_cv_func_mmap_fixed_mapped" != yes; then +AC_ARG_ENABLE([mmap], + AS_HELP_STRING([--disable-mmap], + [do not check mmap() and do not use]), + [enable_mmap="no"],[enable_mmap="yes"]) +if test "x${enable_mmap}" != "xno"; then + AC_FUNC_MMAP +fi +if test "x${enable_mmap}" = "xno" \ + -o "$ac_cv_func_mmap_fixed_mapped" != "yes"; then FTSYS_SRC='$(BASE_DIR)/ftsystem.c' else FTSYS_SRC='$(BUILD_DIR)/ftsystem.c' @@ -229,6 +237,19 @@ if test x$with_zlib != xno && test -n "$LIBZ"; then SYSTEM_ZLIB=yes fi +# check for system libbz2 + +# don't quote AS_HELP_STRING! +AC_ARG_WITH([bzip2], + AS_HELP_STRING([--without-bzip2], + [do not support bzip2 compressed fonts])) +if test x$with_bzip2 != xno && test -z "$LIBBZ2"; then + AC_CHECK_LIB([bz2], [BZ2_bzDecompress], [AC_CHECK_HEADER([bzlib.h], [LIBBZ2='-lbz2'])]) +fi +if test x$with_bzip2 != xno && test -n "$LIBBZ2"; then + CFLAGS="$CFLAGS -DFT_CONFIG_OPTION_USE_BZIP2" + LDFLAGS="$LDFLAGS $LIBBZ2" +fi # Some options handling SDKs/archs in CFLAGS should be copied # to LDFLAGS. Apple TechNote 2137 recommends to include these @@ -237,7 +258,7 @@ fi save_config_args=$* set dummy ${CFLAGS} i=1 -while test $i -lt $# +while test $i -le $# do c=$1 @@ -254,7 +275,7 @@ do fi shift 1 ;; - -m32|-m64) # options taking no argument + -m32|-m64|-march=*|-mcpu=*) # options taking no argument AC_MSG_RESULT([whether CFLAGS and LDFLAGS share ${c}]) if expr " ${LDFLAGS} " : ".* ${c} *${a}.*" > /dev/null then @@ -309,8 +330,8 @@ if test x$with_old_mac_fonts = xyes; then ])], [AC_MSG_RESULT([ok]) ftmac_c='ftmac.c' - AC_MSG_CHECKING([OS_INLINE macro is ANSI compatible]) - orig_CFLAGS="$CFLAGS" + AC_MSG_CHECKING([whether OS_INLINE macro is ANSI compatible]) + orig_CFLAGS="$CFLAGS -DFT_MACINTOSH" CFLAGS="$CFLAGS $XX_CFLAGS $XX_ANSIFLAGS" AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([ @@ -381,7 +402,8 @@ else dnl AC_MSG_WARN([host system is MacOS but configured to build without Carbon]) CFLAGS="$CFLAGS -DDARWIN_NO_CARBON" ;; - *) ;; + *) + ;; esac fi @@ -597,7 +619,7 @@ AC_ARG_WITH([ats], [use AppleTypeService, if available (default=yes)])) if test x$with_ats = xno; then CFLAGS="$CFLAGS -DHAVE_ATS=0" -elif test x$with_old_mac_fonts = xyes -a x$with_ats != x ; then +elif test x$with_old_mac_fonts = xyes -a x$with_ats != x; then AC_MSG_CHECKING([AppleTypeService functions]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([ @@ -644,6 +666,7 @@ esac AC_SUBST([ftmac_c]) AC_SUBST([LIBZ]) +AC_SUBST([LIBBZ2]) AC_SUBST([CFLAGS]) AC_SUBST([LDFLAGS]) AC_SUBST([FT2_EXTRA_LIBS]) diff --git a/modules/freetype2/builds/unix/configure.raw b/modules/freetype2/builds/unix/configure.raw index 674aad441a1..111dbabc975 100644 --- a/modules/freetype2/builds/unix/configure.raw +++ b/modules/freetype2/builds/unix/configure.raw @@ -2,7 +2,7 @@ # # Process this file with autoconf to produce a configure script. # -# Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by +# Copyright 2001-2012 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, @@ -17,7 +17,7 @@ AC_CONFIG_SRCDIR([ftconfig.in]) # Don't forget to update docs/VERSION.DLL! -version_info='12:1:6' +version_info='14:1:8' AC_SUBST([version_info]) ft_version=`echo $version_info | tr : .` AC_SUBST([ft_version]) @@ -52,7 +52,7 @@ if test ${cross_compiling} = yes; then EXEEXT_BUILD="" elif test -x a_out.exe -o -x conftest.exe; then EXEEXT_BUILD=".exe" - elif test -x conftest.* ; then + elif test -x conftest.*; then EXEEXT_BUILD=`echo conftest.* | sed -n '1s/^.*\././'` fi rm -f a.* b.* a_out.exe conftest.* @@ -104,7 +104,8 @@ case "$INSTALL" in /*) ;; */*) - INSTALL="`pwd`/$INSTALL" ;; + INSTALL="`pwd`/$INSTALL" + ;; esac @@ -123,7 +124,7 @@ AC_CHECK_SIZEOF([long]) # check whether cpp computation of size of int and long in ftconfig.in works -AC_MSG_CHECKING([cpp computation of bit length in ftconfig.in works]) +AC_MSG_CHECKING([whether cpp computation of bit length in ftconfig.in works]) orig_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="-I${srcdir} -I. ${CPPFLAGS}" ac_clean_files="ft2build.h ftoption.h ftstdlib.h" @@ -189,8 +190,15 @@ CPPFLAGS="${orig_CPPFLAGS}" # Here we check whether we can use our mmap file component. -AC_FUNC_MMAP -if test "$ac_cv_func_mmap_fixed_mapped" != yes; then +AC_ARG_ENABLE([mmap], + AS_HELP_STRING([--disable-mmap], + [do not check mmap() and do not use]), + [enable_mmap="no"],[enable_mmap="yes"]) +if test "x${enable_mmap}" != "xno"; then + AC_FUNC_MMAP +fi +if test "x${enable_mmap}" = "xno" \ + -o "$ac_cv_func_mmap_fixed_mapped" != "yes"; then FTSYS_SRC='$(BASE_DIR)/ftsystem.c' else FTSYS_SRC='$(BUILD_DIR)/ftsystem.c' @@ -229,6 +237,19 @@ if test x$with_zlib != xno && test -n "$LIBZ"; then SYSTEM_ZLIB=yes fi +# check for system libbz2 + +# don't quote AS_HELP_STRING! +AC_ARG_WITH([bzip2], + AS_HELP_STRING([--without-bzip2], + [do not support bzip2 compressed fonts])) +if test x$with_bzip2 != xno && test -z "$LIBBZ2"; then + AC_CHECK_LIB([bz2], [BZ2_bzDecompress], [AC_CHECK_HEADER([bzlib.h], [LIBBZ2='-lbz2'])]) +fi +if test x$with_bzip2 != xno && test -n "$LIBBZ2"; then + CFLAGS="$CFLAGS -DFT_CONFIG_OPTION_USE_BZIP2" + LDFLAGS="$LDFLAGS $LIBBZ2" +fi # Some options handling SDKs/archs in CFLAGS should be copied # to LDFLAGS. Apple TechNote 2137 recommends to include these @@ -237,7 +258,7 @@ fi save_config_args=$* set dummy ${CFLAGS} i=1 -while test $i -lt $# +while test $i -le $# do c=$1 @@ -254,7 +275,7 @@ do fi shift 1 ;; - -m32|-m64) # options taking no argument + -m32|-m64|-march=*|-mcpu=*) # options taking no argument AC_MSG_RESULT([whether CFLAGS and LDFLAGS share ${c}]) if expr " ${LDFLAGS} " : ".* ${c} *${a}.*" > /dev/null then @@ -309,8 +330,8 @@ if test x$with_old_mac_fonts = xyes; then ])], [AC_MSG_RESULT([ok]) ftmac_c='ftmac.c' - AC_MSG_CHECKING([OS_INLINE macro is ANSI compatible]) - orig_CFLAGS="$CFLAGS" + AC_MSG_CHECKING([whether OS_INLINE macro is ANSI compatible]) + orig_CFLAGS="$CFLAGS -DFT_MACINTOSH" CFLAGS="$CFLAGS $XX_CFLAGS $XX_ANSIFLAGS" AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([ @@ -381,7 +402,8 @@ else dnl AC_MSG_WARN([host system is MacOS but configured to build without Carbon]) CFLAGS="$CFLAGS -DDARWIN_NO_CARBON" ;; - *) ;; + *) + ;; esac fi @@ -597,7 +619,7 @@ AC_ARG_WITH([ats], [use AppleTypeService, if available (default=yes)])) if test x$with_ats = xno; then CFLAGS="$CFLAGS -DHAVE_ATS=0" -elif test x$with_old_mac_fonts = xyes -a x$with_ats != x ; then +elif test x$with_old_mac_fonts = xyes -a x$with_ats != x; then AC_MSG_CHECKING([AppleTypeService functions]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([ @@ -644,6 +666,7 @@ esac AC_SUBST([ftmac_c]) AC_SUBST([LIBZ]) +AC_SUBST([LIBBZ2]) AC_SUBST([CFLAGS]) AC_SUBST([LDFLAGS]) AC_SUBST([FT2_EXTRA_LIBS]) diff --git a/modules/freetype2/builds/unix/detect.mk b/modules/freetype2/builds/unix/detect.mk index e74af57308c..b2ae4f42bce 100644 --- a/modules/freetype2/builds/unix/detect.mk +++ b/modules/freetype2/builds/unix/detect.mk @@ -20,6 +20,7 @@ ifeq ($(PLATFORM),ansi) # is_unix := $(strip $(wildcard /sbin/init) \ $(wildcard /usr/sbin/init) \ + $(wildcard /dev/null) \ $(wildcard /hurd/auth)) ifneq ($(is_unix),) diff --git a/modules/freetype2/builds/unix/freetype-config.in b/modules/freetype2/builds/unix/freetype-config.in index 0a7a767d6e4..815367ba8e1 100644 --- a/modules/freetype2/builds/unix/freetype-config.in +++ b/modules/freetype2/builds/unix/freetype-config.in @@ -144,7 +144,7 @@ if test "$echo_libs" = "yes" ; then if test "$enable_shared" = "yes" ; then eval "rpath=\"$hardcode_libdir_flag_spec\"" fi - libs="-lfreetype @LIBZ@ @FT2_EXTRA_LIBS@" + libs="-lfreetype @LIBZ@ @LIBBZ2@ @FT2_EXTRA_LIBS@" if test "${SYSROOT}$libdir" != "/usr/lib" && test "${SYSROOT}$libdir" != "/usr/lib64"; then echo -L${SYSROOT}$libdir $libs else diff --git a/modules/freetype2/builds/unix/freetype2.in b/modules/freetype2/builds/unix/freetype2.in index 7e948f437a8..b73180049a6 100644 --- a/modules/freetype2/builds/unix/freetype2.in +++ b/modules/freetype2/builds/unix/freetype2.in @@ -8,5 +8,5 @@ Description: A free, high-quality, and portable font engine. Version: @ft_version@ Requires: Libs: -L${libdir} -lfreetype -Libs.private: @LIBZ@ @FT2_EXTRA_LIBS@ +Libs.private: @LIBZ@ @LIBBZ2@ @FT2_EXTRA_LIBS@ Cflags: -I${includedir}/freetype2 -I${includedir} diff --git a/modules/freetype2/builds/unix/ftconfig.in b/modules/freetype2/builds/unix/ftconfig.in index 4c81187e50e..9531afda187 100644 --- a/modules/freetype2/builds/unix/ftconfig.in +++ b/modules/freetype2/builds/unix/ftconfig.in @@ -4,7 +4,7 @@ /* */ /* UNIX-specific configuration file (specification only). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2007, 2008, 2009 by */ +/* Copyright 1996-2004, 2006-2009, 2011 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -117,10 +117,6 @@ FT_BEGIN_HEADER #endif /* !FT_USE_AUTOCONF_SIZEOF_TYPES */ - /* Preferred alignment of data */ -#define FT_ALIGNMENT 8 - - /* FT_UNUSED is a macro used to indicate that a given parameter is not */ /* used -- this is only used to get rid of unpleasant compiler warnings */ #ifndef FT_UNUSED @@ -146,15 +142,17 @@ FT_BEGIN_HEADER /* This is the only necessary change, so it is defined here instead */ /* providing a new configuration file. */ /* */ -#if ( defined( __APPLE__ ) && !defined( DARWIN_NO_CARBON ) ) || \ - ( defined( __MWERKS__ ) && defined( macintosh ) ) +#if defined( __APPLE__ ) || ( defined( __MWERKS__ ) && defined( macintosh ) ) /* no Carbon frameworks for 64bit 10.4.x */ + /* AvailabilityMacros.h is available since Mac OS X 10.2, */ + /* so guess the system version by maximum errno before inclusion */ +#include +#ifdef ECANCELED /* defined since 10.2 */ #include "AvailabilityMacros.h" +#endif #if defined( __LP64__ ) && \ ( MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 ) -#define DARWIN_NO_CARBON 1 -#else -#define FT_MACINTOSH 1 +/undef FT_MACINTOSH #endif #elif defined( __SC__ ) || defined( __MRC__ ) @@ -286,11 +284,42 @@ FT_BEGIN_HEADER /* Provide assembler fragments for performance-critical functions. */ /* These must be defined `static __inline__' with GCC. */ +#if defined( __CC_ARM ) || defined( __ARMCC__ ) /* RVCT */ +#define FT_MULFIX_ASSEMBLER FT_MulFix_arm + + /* documentation is in freetype.h */ + + static __inline FT_Int32 + FT_MulFix_arm( FT_Int32 a, + FT_Int32 b ) + { + register FT_Int32 t, t2; + + + __asm + { + smull t2, t, b, a /* (lo=t2,hi=t) = a*b */ + mov a, t, asr #31 /* a = (hi >> 31) */ + add a, a, #0x8000 /* a += 0x8000 */ + adds t2, t2, a /* t2 += a */ + adc t, t, #0 /* t += carry */ + mov a, t2, lsr #16 /* a = t2 >> 16 */ + orr a, a, t, lsl #16 /* a |= t << 16 */ + } + return a; + } + +#endif /* __CC_ARM || __ARMCC__ */ + + #ifdef __GNUC__ -#if defined( __arm__ ) && !defined( __thumb__ ) +#if defined( __arm__ ) && !defined( __thumb__ ) && \ + !( defined( __CC_ARM ) || defined( __ARMCC__ ) ) #define FT_MULFIX_ASSEMBLER FT_MulFix_arm + /* documentation is in freetype.h */ + static __inline__ FT_Int32 FT_MulFix_arm( FT_Int32 a, FT_Int32 b ) @@ -311,11 +340,13 @@ FT_BEGIN_HEADER return a; } -#endif /* __arm__ && !__thumb__ */ +#endif /* __arm__ && !__thumb__ && !( __CC_ARM || __ARMCC__ ) */ #if defined( __i386__ ) #define FT_MULFIX_ASSEMBLER FT_MulFix_i386 + /* documentation is in freetype.h */ + static __inline__ FT_Int32 FT_MulFix_i386( FT_Int32 a, FT_Int32 b ) @@ -333,9 +364,9 @@ FT_BEGIN_HEADER "shrl $16, %%eax\n" "shll $16, %%edx\n" "addl %%edx, %%eax\n" - : "=a"(result), "+d"(b) - : "a"(a) - : "%ecx" ); + : "=a"(result), "=d"(b) + : "a"(a), "d"(b) + : "%ecx", "cc" ); return result; } @@ -343,6 +374,43 @@ FT_BEGIN_HEADER #endif /* __GNUC__ */ + +#ifdef _MSC_VER /* Visual C++ */ + +#ifdef _M_IX86 + +#define FT_MULFIX_ASSEMBLER FT_MulFix_i386 + + /* documentation is in freetype.h */ + + static __inline FT_Int32 + FT_MulFix_i386( FT_Int32 a, + FT_Int32 b ) + { + register FT_Int32 result; + + __asm + { + mov eax, a + mov edx, b + imul edx + mov ecx, edx + sar ecx, 31 + add ecx, 8000h + add eax, ecx + adc edx, 0 + shr eax, 16 + shl edx, 16 + add eax, edx + mov result, eax + } + return result; + } + +#endif /* _M_IX86 */ + +#endif /* _MSC_VER */ + #endif /* !FT_CONFIG_OPTION_NO_ASSEMBLER */ diff --git a/modules/freetype2/builds/unix/install-sh b/modules/freetype2/builds/unix/install-sh old mode 100644 new mode 100755 index 6781b987bdb..a9244eb0786 --- a/modules/freetype2/builds/unix/install-sh +++ b/modules/freetype2/builds/unix/install-sh @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2009-04-28.21; # UTC +scriptversion=2011-01-19.21; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -156,6 +156,10 @@ while test $# -ne 0; do -s) stripcmd=$stripprog;; -t) dst_arg=$2 + # Protect names problematic for `test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac shift;; -T) no_target_directory=true;; @@ -186,6 +190,10 @@ if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then fi shift # arg dst_arg=$arg + # Protect names problematic for `test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac done fi @@ -200,7 +208,11 @@ if test $# -eq 0; then fi if test -z "$dir_arg"; then - trap '(exit $?); exit' 1 2 13 15 + do_exit='(exit $ret); exit $ret' + trap "ret=129; $do_exit" 1 + trap "ret=130; $do_exit" 2 + trap "ret=141; $do_exit" 13 + trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. @@ -228,9 +240,9 @@ fi for src do - # Protect names starting with `-'. + # Protect names problematic for `test' and other utilities. case $src in - -*) src=./$src;; + -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then @@ -252,12 +264,7 @@ do echo "$0: no destination specified." >&2 exit 1 fi - dst=$dst_arg - # Protect names starting with `-'. - case $dst in - -*) dst=./$dst;; - esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. @@ -385,7 +392,7 @@ do case $dstdir in /*) prefix='/';; - -*) prefix='./';; + [-=\(\)!]*) prefix='./';; *) prefix='';; esac @@ -403,7 +410,7 @@ do for d do - test -z "$d" && continue + test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then diff --git a/modules/freetype2/builds/unix/ltmain.sh b/modules/freetype2/builds/unix/ltmain.sh index a72f2fd78bf..63ae69dc6fe 100644 --- a/modules/freetype2/builds/unix/ltmain.sh +++ b/modules/freetype2/builds/unix/ltmain.sh @@ -1,9 +1,9 @@ -# Generated from ltmain.m4sh. -# ltmain.sh (GNU libtool) 2.2.6b +# libtool (GNU libtool) 2.4.2 # Written by Gordon Matzigkeit , 1996 -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc. +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, +# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. @@ -32,50 +32,57 @@ # # Provide generalized library-building support services. # -# --config show all configuration variables -# --debug enable verbose shell tracing -# -n, --dry-run display commands without modifying any files -# --features display basic configuration information and exit -# --mode=MODE use operation mode MODE -# --preserve-dup-deps don't remove duplicate dependency libraries -# --quiet, --silent don't print informational messages -# --tag=TAG use configuration variables from tag TAG -# -v, --verbose print informational messages (default) -# --version print version information -# -h, --help print short or long help message +# --config show all configuration variables +# --debug enable verbose shell tracing +# -n, --dry-run display commands without modifying any files +# --features display basic configuration information and exit +# --mode=MODE use operation mode MODE +# --preserve-dup-deps don't remove duplicate dependency libraries +# --quiet, --silent don't print informational messages +# --no-quiet, --no-silent +# print informational messages (default) +# --no-warn don't display warning messages +# --tag=TAG use configuration variables from tag TAG +# -v, --verbose print more informational messages than default +# --no-verbose don't print the extra informational messages +# --version print version information +# -h, --help, --help-all print short, long, or detailed help message # # MODE must be one of the following: # -# clean remove files from the build directory -# compile compile a source file into a libtool object -# execute automatically set library path, then run a program -# finish complete the installation of libtool libraries -# install install libraries or executables -# link create a library or an executable -# uninstall remove libraries from an installed directory +# clean remove files from the build directory +# compile compile a source file into a libtool object +# execute automatically set library path, then run a program +# finish complete the installation of libtool libraries +# install install libraries or executables +# link create a library or an executable +# uninstall remove libraries from an installed directory # -# MODE-ARGS vary depending on the MODE. +# MODE-ARGS vary depending on the MODE. When passed as first option, +# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. # Try `$progname --help --mode=MODE' for a more detailed description of MODE. # # When reporting a bug, please describe a test case to reproduce it and # include the following information: # -# host-triplet: $host -# shell: $SHELL -# compiler: $LTCC -# compiler flags: $LTCFLAGS -# linker: $LD (gnu? $with_gnu_ld) -# $progname: (GNU libtool) 2.2.6b -# automake: $automake_version -# autoconf: $autoconf_version +# host-triplet: $host +# shell: $SHELL +# compiler: $LTCC +# compiler flags: $LTCFLAGS +# linker: $LD (gnu? $with_gnu_ld) +# $progname: (GNU libtool) 2.4.2 +# automake: $automake_version +# autoconf: $autoconf_version # # Report bugs to . +# GNU libtool home page: . +# General help using GNU software: . -PROGRAM=ltmain.sh +PROGRAM=libtool PACKAGE=libtool -VERSION=2.2.6b +VERSION=2.4.2 TIMESTAMP="" -package_revision=1.3017 +package_revision=1.3337 # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then @@ -91,10 +98,15 @@ fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' +} + # NLS nuisances: We save the old values to restore during execute mode. -# Only set LANG and LC_ALL to C if already set. -# These must not be set unconditionally because not all systems understand -# e.g. LANG=C (notably SCO). lt_user_locale= lt_safe_locale= for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES @@ -107,24 +119,28 @@ do lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" fi" done +LC_ALL=C +LANGUAGE=C +export LANGUAGE LC_ALL $lt_unset CDPATH +# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh +# is ksh but when the shell is invoked as "sh" and the current value of +# the _XPG environment variable is not equal to 1 (one), the special +# positional parameter $0, within a function call, is the name of the +# function. +progpath="$0" : ${CP="cp -f"} -: ${ECHO="echo"} -: ${EGREP="/bin/grep -E"} -: ${FGREP="/bin/grep -F"} -: ${GREP="/bin/grep"} -: ${LN_S="ln -s"} +test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} -: ${SED="/bin/sed"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} : ${Xsed="$SED -e 1s/^X//"} @@ -144,6 +160,27 @@ IFS=" $lt_nl" dirname="s,/[^/]*$,," basename="s,^.*/,," +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi +} # func_dirname may be replaced by extended shell implementation + + +# func_basename file +func_basename () +{ + func_basename_result=`$ECHO "${1}" | $SED "$basename"` +} # func_basename may be replaced by extended shell implementation + + # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: @@ -158,33 +195,183 @@ basename="s,^.*/,," # those functions but instead duplicate the functionality here. func_dirname_and_basename () { - # Extract subdirectory from the argument. - func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` - if test "X$func_dirname_result" = "X${1}"; then - func_dirname_result="${3}" - else - func_dirname_result="$func_dirname_result${2}" - fi - func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` + # Extract subdirectory from the argument. + func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi + func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` +} # func_dirname_and_basename may be replaced by extended shell implementation + + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# func_strip_suffix prefix name +func_stripname () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; + esac +} # func_stripname may be replaced by extended shell implementation + + +# These SED scripts presuppose an absolute path with a trailing slash. +pathcar='s,^/\([^/]*\).*$,\1,' +pathcdr='s,^/[^/]*,,' +removedotparts=':dotsl + s@/\./@/@g + t dotsl + s,/\.$,/,' +collapseslashes='s@/\{1,\}@/@g' +finalslash='s,/*$,/,' + +# func_normal_abspath PATH +# Remove doubled-up and trailing slashes, "." path components, +# and cancel out any ".." path components in PATH after making +# it an absolute path. +# value returned in "$func_normal_abspath_result" +func_normal_abspath () +{ + # Start from root dir and reassemble the path. + func_normal_abspath_result= + func_normal_abspath_tpath=$1 + func_normal_abspath_altnamespace= + case $func_normal_abspath_tpath in + "") + # Empty path, that just means $cwd. + func_stripname '' '/' "`pwd`" + func_normal_abspath_result=$func_stripname_result + return + ;; + # The next three entries are used to spot a run of precisely + # two leading slashes without using negated character classes; + # we take advantage of case's first-match behaviour. + ///*) + # Unusual form of absolute path, do nothing. + ;; + //*) + # Not necessarily an ordinary path; POSIX reserves leading '//' + # and for example Cygwin uses it to access remote file shares + # over CIFS/SMB, so we conserve a leading double slash if found. + func_normal_abspath_altnamespace=/ + ;; + /*) + # Absolute path, do nothing. + ;; + *) + # Relative path, prepend $cwd. + func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath + ;; + esac + # Cancel out all the simple stuff to save iterations. We also want + # the path to end with a slash for ease of parsing, so make sure + # there is one (and only one) here. + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` + while :; do + # Processed it all yet? + if test "$func_normal_abspath_tpath" = / ; then + # If we ascended to the root using ".." the result may be empty now. + if test -z "$func_normal_abspath_result" ; then + func_normal_abspath_result=/ + fi + break + fi + func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$pathcar"` + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$pathcdr"` + # Figure out what to do with it + case $func_normal_abspath_tcomponent in + "") + # Trailing empty path component, ignore it. + ;; + ..) + # Parent dir; strip last assembled component from result. + func_dirname "$func_normal_abspath_result" + func_normal_abspath_result=$func_dirname_result + ;; + *) + # Actual path component, append it. + func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent + ;; + esac + done + # Restore leading double-slash if one was found on entry. + func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } -# Generated shell functions inserted here. +# func_relative_path SRCDIR DSTDIR +# generates a relative path from SRCDIR to DSTDIR, with a trailing +# slash if non-empty, suitable for immediately appending a filename +# without needing to append a separator. +# value returned in "$func_relative_path_result" +func_relative_path () +{ + func_relative_path_result= + func_normal_abspath "$1" + func_relative_path_tlibdir=$func_normal_abspath_result + func_normal_abspath "$2" + func_relative_path_tbindir=$func_normal_abspath_result -# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh -# is ksh but when the shell is invoked as "sh" and the current value of -# the _XPG environment variable is not equal to 1 (one), the special -# positional parameter $0, within a function call, is the name of the -# function. -progpath="$0" + # Ascend the tree starting from libdir + while :; do + # check if we have found a prefix of bindir + case $func_relative_path_tbindir in + $func_relative_path_tlibdir) + # found an exact match + func_relative_path_tcancelled= + break + ;; + $func_relative_path_tlibdir*) + # found a matching prefix + func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" + func_relative_path_tcancelled=$func_stripname_result + if test -z "$func_relative_path_result"; then + func_relative_path_result=. + fi + break + ;; + *) + func_dirname $func_relative_path_tlibdir + func_relative_path_tlibdir=${func_dirname_result} + if test "x$func_relative_path_tlibdir" = x ; then + # Have to descend all the way to the root! + func_relative_path_result=../$func_relative_path_result + func_relative_path_tcancelled=$func_relative_path_tbindir + break + fi + func_relative_path_result=../$func_relative_path_result + ;; + esac + done + + # Now calculate path; take care to avoid doubling-up slashes. + func_stripname '' '/' "$func_relative_path_result" + func_relative_path_result=$func_stripname_result + func_stripname '/' '/' "$func_relative_path_tcancelled" + if test "x$func_stripname_result" != x ; then + func_relative_path_result=${func_relative_path_result}/${func_stripname_result} + fi + + # Normalisation. If bindir is libdir, return empty string, + # else relative path ending with a slash; either way, target + # file name can be directly appended. + if test ! -z "$func_relative_path_result"; then + func_stripname './' '' "$func_relative_path_result/" + func_relative_path_result=$func_stripname_result + fi +} # The name of this program: -# In the unlikely event $progname began with a '-', it would play havoc with -# func_echo (imagine progname=-n), so we prepend ./ in that case: func_dirname_and_basename "$progpath" progname=$func_basename_result -case $progname in - -*) progname=./$progname ;; -esac # Make sure we have an absolute path for reexecution: case $progpath in @@ -196,7 +383,7 @@ case $progpath in ;; *) save_IFS="$IFS" - IFS=: + IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS="$save_IFS" test -x "$progdir/$progname" && break @@ -215,6 +402,15 @@ sed_quote_subst='s/\([`"$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' +# Sed substitution that turns a string into a regex matching for the +# string literally. +sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' + +# Sed substitution that converts a w32 file name or path +# which contains forward slashes, into one that contains +# (escaped) backslashes. A very naive implementation. +lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' + # Re-`\' parameter expansions in output of double_quote_subst that were # `\'-ed in input to the same. If an odd number of `\' preceded a '$' # in input to double_quote_subst, that '$' was protected from expansion. @@ -243,7 +439,7 @@ opt_warning=: # name if it has been set yet. func_echo () { - $ECHO "$progname${mode+: }$mode: $*" + $ECHO "$progname: ${opt_mode+$opt_mode: }$*" } # func_verbose arg... @@ -258,18 +454,25 @@ func_verbose () : } +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} + # func_error arg... # Echo program name prefixed message to standard error. func_error () { - $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2 + $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 } # func_warning arg... # Echo program name prefixed warning message to standard error. func_warning () { - $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2 + $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 # bash bug again: : @@ -326,9 +529,9 @@ func_mkdir_p () case $my_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop - my_directory_path=`$ECHO "X$my_directory_path" | $Xsed -e "$dirname"` + my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` done - my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e 's,:*$,,'` + my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` save_mkdir_p_IFS="$IFS"; IFS=':' for my_dir in $my_dir_list; do @@ -378,7 +581,7 @@ func_mktempdir () func_fatal_error "cannot create temporary directory \`$my_tmpdir'" fi - $ECHO "X$my_tmpdir" | $Xsed + $ECHO "$my_tmpdir" } @@ -392,7 +595,7 @@ func_quote_for_eval () { case $1 in *[\\\`\"\$]*) - func_quote_for_eval_unquoted_result=`$ECHO "X$1" | $Xsed -e "$sed_quote_subst"` ;; + func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; *) func_quote_for_eval_unquoted_result="$1" ;; esac @@ -419,7 +622,7 @@ func_quote_for_expand () { case $1 in *[\\\`\"]*) - my_arg=`$ECHO "X$1" | $Xsed \ + my_arg=`$ECHO "$1" | $SED \ -e "$double_quote_subst" -e "$sed_double_backslash"` ;; *) my_arg="$1" ;; @@ -488,15 +691,39 @@ func_show_eval_locale () fi } - - +# func_tr_sh +# Turn $1 into a string suitable for a shell variable name. +# Result is stored in $func_tr_sh_result. All characters +# not in the set a-zA-Z0-9_ are replaced with '_'. Further, +# if $1 begins with a digit, a '_' is prepended as well. +func_tr_sh () +{ + case $1 in + [0-9]* | *[!a-zA-Z0-9_]*) + func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` + ;; + * ) + func_tr_sh_result=$1 + ;; + esac +} # func_version # Echo version message to standard output and exit. func_version () { - $SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / { + $opt_debug + + $SED -n '/(C)/!b go + :more + /\./!{ + N + s/\n# / / + b more + } + :go + /^# '$PROGRAM' (GNU /,/# warranty; / { s/^# // s/^# *$// s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ @@ -509,22 +736,28 @@ func_version () # Echo short help message to standard output and exit. func_usage () { - $SED -n '/^# Usage:/,/# -h/ { + $opt_debug + + $SED -n '/^# Usage:/,/^# *.*--help/ { s/^# // s/^# *$// s/\$progname/'$progname'/ p }' < "$progpath" - $ECHO + echo $ECHO "run \`$progname --help | more' for full usage" exit $? } -# func_help -# Echo long help message to standard output and exit. +# func_help [NOEXIT] +# Echo long help message to standard output and exit, +# unless 'noexit' is passed as argument. func_help () { + $opt_debug + $SED -n '/^# Usage:/,/# Report bugs to/ { + :print s/^# // s/^# *$// s*\$progname*'$progname'* @@ -534,11 +767,18 @@ func_help () s*\$LTCFLAGS*'"$LTCFLAGS"'* s*\$LD*'"$LD"'* s/\$with_gnu_ld/'"$with_gnu_ld"'/ - s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/ - s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/ + s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ + s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ p - }' < "$progpath" - exit $? + d + } + /^# .* home page:/b print + /^# General help using/b print + ' < "$progpath" + ret=$? + if test -z "$1"; then + exit $ret + fi } # func_missing_arg argname @@ -546,63 +786,106 @@ func_help () # exit_cmd. func_missing_arg () { - func_error "missing argument for $1" + $opt_debug + + func_error "missing argument for $1." exit_cmd=exit } + +# func_split_short_opt shortopt +# Set func_split_short_opt_name and func_split_short_opt_arg shell +# variables after splitting SHORTOPT after the 2nd character. +func_split_short_opt () +{ + my_sed_short_opt='1s/^\(..\).*$/\1/;q' + my_sed_short_rest='1s/^..\(.*\)$/\1/;q' + + func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` + func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` +} # func_split_short_opt may be replaced by extended shell implementation + + +# func_split_long_opt longopt +# Set func_split_long_opt_name and func_split_long_opt_arg shell +# variables after splitting LONGOPT at the `=' sign. +func_split_long_opt () +{ + my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' + my_sed_long_arg='1s/^--[^=]*=//' + + func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` + func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` +} # func_split_long_opt may be replaced by extended shell implementation + exit_cmd=: -# Check that we have a working $ECHO. -if test "X$1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X$1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then - # Yippee, $ECHO works! - : -else - # Restart under the correct shell, and then maybe $ECHO will work. - exec $SHELL "$progpath" --no-reexec ${1+"$@"} -fi - -if test "X$1" = X--fallback-echo; then - # used as fallback echo - shift - cat </dev/null || echo $max_cmd_len` +} # func_len may be replaced by extended shell implementation + + +# func_lo2o object +func_lo2o () +{ + func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` +} # func_lo2o may be replaced by extended shell implementation + + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` +} # func_xform may be replaced by extended shell implementation + + # func_fatal_configuration arg... # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. @@ -636,16 +919,16 @@ func_config () # Display the features supported by this script. func_features () { - $ECHO "host: $host" + echo "host: $host" if test "$build_libtool_libs" = yes; then - $ECHO "enable shared libraries" + echo "enable shared libraries" else - $ECHO "disable shared libraries" + echo "disable shared libraries" fi if test "$build_old_libs" = yes; then - $ECHO "enable static libraries" + echo "enable static libraries" else - $ECHO "disable static libraries" + echo "disable static libraries" fi exit $? @@ -692,133 +975,6 @@ func_enable_tag () esac } -# Parse options once, thoroughly. This comes as soon as possible in -# the script to make things like `libtool --version' happen quickly. -{ - - # Shorthand for --mode=foo, only valid as the first argument - case $1 in - clean|clea|cle|cl) - shift; set dummy --mode clean ${1+"$@"}; shift - ;; - compile|compil|compi|comp|com|co|c) - shift; set dummy --mode compile ${1+"$@"}; shift - ;; - execute|execut|execu|exec|exe|ex|e) - shift; set dummy --mode execute ${1+"$@"}; shift - ;; - finish|finis|fini|fin|fi|f) - shift; set dummy --mode finish ${1+"$@"}; shift - ;; - install|instal|insta|inst|ins|in|i) - shift; set dummy --mode install ${1+"$@"}; shift - ;; - link|lin|li|l) - shift; set dummy --mode link ${1+"$@"}; shift - ;; - uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) - shift; set dummy --mode uninstall ${1+"$@"}; shift - ;; - esac - - # Parse non-mode specific arguments: - while test "$#" -gt 0; do - opt="$1" - shift - - case $opt in - --config) func_config ;; - - --debug) preserve_args="$preserve_args $opt" - func_echo "enabling shell trace mode" - opt_debug='set -x' - $opt_debug - ;; - - -dlopen) test "$#" -eq 0 && func_missing_arg "$opt" && break - execute_dlfiles="$execute_dlfiles $1" - shift - ;; - - --dry-run | -n) opt_dry_run=: ;; - --features) func_features ;; - --finish) mode="finish" ;; - - --mode) test "$#" -eq 0 && func_missing_arg "$opt" && break - case $1 in - # Valid mode arguments: - clean) ;; - compile) ;; - execute) ;; - finish) ;; - install) ;; - link) ;; - relink) ;; - uninstall) ;; - - # Catch anything else as an error - *) func_error "invalid argument for $opt" - exit_cmd=exit - break - ;; - esac - - mode="$1" - shift - ;; - - --preserve-dup-deps) - opt_duplicate_deps=: ;; - - --quiet|--silent) preserve_args="$preserve_args $opt" - opt_silent=: - ;; - - --verbose| -v) preserve_args="$preserve_args $opt" - opt_silent=false - ;; - - --tag) test "$#" -eq 0 && func_missing_arg "$opt" && break - preserve_args="$preserve_args $opt $1" - func_enable_tag "$1" # tagname is set here - shift - ;; - - # Separate optargs to long options: - -dlopen=*|--mode=*|--tag=*) - func_opt_split "$opt" - set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"} - shift - ;; - - -\?|-h) func_usage ;; - --help) opt_help=: ;; - --version) func_version ;; - - -*) func_fatal_help "unrecognized option \`$opt'" ;; - - *) nonopt="$opt" - break - ;; - esac - done - - - case $host in - *cygwin* | *mingw* | *pw32* | *cegcc*) - # don't eliminate duplications in $postdeps and $predeps - opt_duplicate_compiler_generated_deps=: - ;; - *) - opt_duplicate_compiler_generated_deps=$opt_duplicate_deps - ;; - esac - - # Having warned about all mis-specified options, bail out if - # anything was wrong. - $exit_cmd $EXIT_FAILURE -} - # func_check_version_match # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. @@ -855,38 +1011,219 @@ _LT_EOF } +# Shorthand for --mode=foo, only valid as the first argument +case $1 in +clean|clea|cle|cl) + shift; set dummy --mode clean ${1+"$@"}; shift + ;; +compile|compil|compi|comp|com|co|c) + shift; set dummy --mode compile ${1+"$@"}; shift + ;; +execute|execut|execu|exec|exe|ex|e) + shift; set dummy --mode execute ${1+"$@"}; shift + ;; +finish|finis|fini|fin|fi|f) + shift; set dummy --mode finish ${1+"$@"}; shift + ;; +install|instal|insta|inst|ins|in|i) + shift; set dummy --mode install ${1+"$@"}; shift + ;; +link|lin|li|l) + shift; set dummy --mode link ${1+"$@"}; shift + ;; +uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) + shift; set dummy --mode uninstall ${1+"$@"}; shift + ;; +esac + + + +# Option defaults: +opt_debug=: +opt_dry_run=false +opt_config=false +opt_preserve_dup_deps=false +opt_features=false +opt_finish=false +opt_help=false +opt_help_all=false +opt_silent=: +opt_warning=: +opt_verbose=: +opt_silent=false +opt_verbose=false + + +# Parse options once, thoroughly. This comes as soon as possible in the +# script to make things like `--version' happen as quickly as we can. +{ + # this just eases exit handling + while test $# -gt 0; do + opt="$1" + shift + case $opt in + --debug|-x) opt_debug='set -x' + func_echo "enabling shell trace mode" + $opt_debug + ;; + --dry-run|--dryrun|-n) + opt_dry_run=: + ;; + --config) + opt_config=: +func_config + ;; + --dlopen|-dlopen) + optarg="$1" + opt_dlopen="${opt_dlopen+$opt_dlopen +}$optarg" + shift + ;; + --preserve-dup-deps) + opt_preserve_dup_deps=: + ;; + --features) + opt_features=: +func_features + ;; + --finish) + opt_finish=: +set dummy --mode finish ${1+"$@"}; shift + ;; + --help) + opt_help=: + ;; + --help-all) + opt_help_all=: +opt_help=': help-all' + ;; + --mode) + test $# = 0 && func_missing_arg $opt && break + optarg="$1" + opt_mode="$optarg" +case $optarg in + # Valid mode arguments: + clean|compile|execute|finish|install|link|relink|uninstall) ;; + + # Catch anything else as an error + *) func_error "invalid argument for $opt" + exit_cmd=exit + break + ;; +esac + shift + ;; + --no-silent|--no-quiet) + opt_silent=false +func_append preserve_args " $opt" + ;; + --no-warning|--no-warn) + opt_warning=false +func_append preserve_args " $opt" + ;; + --no-verbose) + opt_verbose=false +func_append preserve_args " $opt" + ;; + --silent|--quiet) + opt_silent=: +func_append preserve_args " $opt" + opt_verbose=false + ;; + --verbose|-v) + opt_verbose=: +func_append preserve_args " $opt" +opt_silent=false + ;; + --tag) + test $# = 0 && func_missing_arg $opt && break + optarg="$1" + opt_tag="$optarg" +func_append preserve_args " $opt $optarg" +func_enable_tag "$optarg" + shift + ;; + + -\?|-h) func_usage ;; + --help) func_help ;; + --version) func_version ;; + + # Separate optargs to long options: + --*=*) + func_split_long_opt "$opt" + set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} + shift + ;; + + # Separate non-argument short options: + -\?*|-h*|-n*|-v*) + func_split_short_opt "$opt" + set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} + shift + ;; + + --) break ;; + -*) func_fatal_help "unrecognized option \`$opt'" ;; + *) set dummy "$opt" ${1+"$@"}; shift; break ;; + esac + done + + # Validate options: + + # save first non-option argument + if test "$#" -gt 0; then + nonopt="$opt" + shift + fi + + # preserve --debug + test "$opt_debug" = : || func_append preserve_args " --debug" + + case $host in + *cygwin* | *mingw* | *pw32* | *cegcc*) + # don't eliminate duplications in $postdeps and $predeps + opt_duplicate_compiler_generated_deps=: + ;; + *) + opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps + ;; + esac + + $opt_help || { + # Sanity checks first: + func_check_version_match + + if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then + func_fatal_configuration "not configured to build any kind of library" + fi + + # Darwin sucks + eval std_shrext=\"$shrext_cmds\" + + # Only execute mode is allowed to have -dlopen flags. + if test -n "$opt_dlopen" && test "$opt_mode" != execute; then + func_error "unrecognized option \`-dlopen'" + $ECHO "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Change the help message to a mode-specific one. + generic_help="$help" + help="Try \`$progname --help --mode=$opt_mode' for more information." + } + + + # Bail if the options were screwed + $exit_cmd $EXIT_FAILURE +} + + + + ## ----------- ## ## Main. ## ## ----------- ## -$opt_help || { - # Sanity checks first: - func_check_version_match - - if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then - func_fatal_configuration "not configured to build any kind of library" - fi - - test -z "$mode" && func_fatal_error "error: you must specify a MODE." - - - # Darwin sucks - eval std_shrext=\"$shrext_cmds\" - - - # Only execute mode is allowed to have -dlopen flags. - if test -n "$execute_dlfiles" && test "$mode" != execute; then - func_error "unrecognized option \`-dlopen'" - $ECHO "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # Change the help message to a mode-specific one. - generic_help="$help" - help="Try \`$progname --help --mode=$mode' for more information." -} - - # func_lalib_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function is only a basic sanity check; it will hardly flush out @@ -950,12 +1287,9 @@ func_ltwrapper_executable_p () # temporary ltwrapper_script. func_ltwrapper_scriptname () { - func_ltwrapper_scriptname_result="" - if func_ltwrapper_executable_p "$1"; then - func_dirname_and_basename "$1" "" "." - func_stripname '' '.exe' "$func_basename_result" - func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" - fi + func_dirname_and_basename "$1" "" "." + func_stripname '' '.exe' "$func_basename_result" + func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" } # func_ltwrapper_p file @@ -1001,6 +1335,37 @@ func_source () } +# func_resolve_sysroot PATH +# Replace a leading = in PATH with a sysroot. Store the result into +# func_resolve_sysroot_result +func_resolve_sysroot () +{ + func_resolve_sysroot_result=$1 + case $func_resolve_sysroot_result in + =*) + func_stripname '=' '' "$func_resolve_sysroot_result" + func_resolve_sysroot_result=$lt_sysroot$func_stripname_result + ;; + esac +} + +# func_replace_sysroot PATH +# If PATH begins with the sysroot, replace it with = and +# store the result into func_replace_sysroot_result. +func_replace_sysroot () +{ + case "$lt_sysroot:$1" in + ?*:"$lt_sysroot"*) + func_stripname "$lt_sysroot" '' "$1" + func_replace_sysroot_result="=$func_stripname_result" + ;; + *) + # Including no sysroot. + func_replace_sysroot_result=$1 + ;; + esac +} + # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. @@ -1013,13 +1378,15 @@ func_infer_tag () if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do - func_quote_for_eval "$arg" - CC_quoted="$CC_quoted $func_quote_for_eval_result" + func_append_quoted CC_quoted "$arg" done + CC_expanded=`func_echo_all $CC` + CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. - " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;; + " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) @@ -1030,11 +1397,13 @@ func_infer_tag () CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. - func_quote_for_eval "$arg" - CC_quoted="$CC_quoted $func_quote_for_eval_result" + func_append_quoted CC_quoted "$arg" done + CC_expanded=`func_echo_all $CC` + CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in - " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) + " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. @@ -1097,6 +1466,486 @@ EOF } } + +################################################## +# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS # +################################################## + +# func_convert_core_file_wine_to_w32 ARG +# Helper function used by file name conversion functions when $build is *nix, +# and $host is mingw, cygwin, or some other w32 environment. Relies on a +# correctly configured wine environment available, with the winepath program +# in $build's $PATH. +# +# ARG is the $build file name to be converted to w32 format. +# Result is available in $func_convert_core_file_wine_to_w32_result, and will +# be empty on error (or when ARG is empty) +func_convert_core_file_wine_to_w32 () +{ + $opt_debug + func_convert_core_file_wine_to_w32_result="$1" + if test -n "$1"; then + # Unfortunately, winepath does not exit with a non-zero error code, so we + # are forced to check the contents of stdout. On the other hand, if the + # command is not found, the shell will set an exit code of 127 and print + # *an error message* to stdout. So we must check for both error code of + # zero AND non-empty stdout, which explains the odd construction: + func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null` + if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then + func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | + $SED -e "$lt_sed_naive_backslashify"` + else + func_convert_core_file_wine_to_w32_result= + fi + fi +} +# end: func_convert_core_file_wine_to_w32 + + +# func_convert_core_path_wine_to_w32 ARG +# Helper function used by path conversion functions when $build is *nix, and +# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly +# configured wine environment available, with the winepath program in $build's +# $PATH. Assumes ARG has no leading or trailing path separator characters. +# +# ARG is path to be converted from $build format to win32. +# Result is available in $func_convert_core_path_wine_to_w32_result. +# Unconvertible file (directory) names in ARG are skipped; if no directory names +# are convertible, then the result may be empty. +func_convert_core_path_wine_to_w32 () +{ + $opt_debug + # unfortunately, winepath doesn't convert paths, only file names + func_convert_core_path_wine_to_w32_result="" + if test -n "$1"; then + oldIFS=$IFS + IFS=: + for func_convert_core_path_wine_to_w32_f in $1; do + IFS=$oldIFS + func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" + if test -n "$func_convert_core_file_wine_to_w32_result" ; then + if test -z "$func_convert_core_path_wine_to_w32_result"; then + func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" + else + func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" + fi + fi + done + IFS=$oldIFS + fi +} +# end: func_convert_core_path_wine_to_w32 + + +# func_cygpath ARGS... +# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when +# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) +# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or +# (2), returns the Cygwin file name or path in func_cygpath_result (input +# file name or path is assumed to be in w32 format, as previously converted +# from $build's *nix or MSYS format). In case (3), returns the w32 file name +# or path in func_cygpath_result (input file name or path is assumed to be in +# Cygwin format). Returns an empty string on error. +# +# ARGS are passed to cygpath, with the last one being the file name or path to +# be converted. +# +# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH +# environment variable; do not put it in $PATH. +func_cygpath () +{ + $opt_debug + if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then + func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` + if test "$?" -ne 0; then + # on failure, ensure result is empty + func_cygpath_result= + fi + else + func_cygpath_result= + func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" + fi +} +#end: func_cygpath + + +# func_convert_core_msys_to_w32 ARG +# Convert file name or path ARG from MSYS format to w32 format. Return +# result in func_convert_core_msys_to_w32_result. +func_convert_core_msys_to_w32 () +{ + $opt_debug + # awkward: cmd appends spaces to result + func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | + $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` +} +#end: func_convert_core_msys_to_w32 + + +# func_convert_file_check ARG1 ARG2 +# Verify that ARG1 (a file name in $build format) was converted to $host +# format in ARG2. Otherwise, emit an error message, but continue (resetting +# func_to_host_file_result to ARG1). +func_convert_file_check () +{ + $opt_debug + if test -z "$2" && test -n "$1" ; then + func_error "Could not determine host file name corresponding to" + func_error " \`$1'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback: + func_to_host_file_result="$1" + fi +} +# end func_convert_file_check + + +# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH +# Verify that FROM_PATH (a path in $build format) was converted to $host +# format in TO_PATH. Otherwise, emit an error message, but continue, resetting +# func_to_host_file_result to a simplistic fallback value (see below). +func_convert_path_check () +{ + $opt_debug + if test -z "$4" && test -n "$3"; then + func_error "Could not determine the host path corresponding to" + func_error " \`$3'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback. This is a deliberately simplistic "conversion" and + # should not be "improved". See libtool.info. + if test "x$1" != "x$2"; then + lt_replace_pathsep_chars="s|$1|$2|g" + func_to_host_path_result=`echo "$3" | + $SED -e "$lt_replace_pathsep_chars"` + else + func_to_host_path_result="$3" + fi + fi +} +# end func_convert_path_check + + +# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG +# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT +# and appending REPL if ORIG matches BACKPAT. +func_convert_path_front_back_pathsep () +{ + $opt_debug + case $4 in + $1 ) func_to_host_path_result="$3$func_to_host_path_result" + ;; + esac + case $4 in + $2 ) func_append func_to_host_path_result "$3" + ;; + esac +} +# end func_convert_path_front_back_pathsep + + +################################################## +# $build to $host FILE NAME CONVERSION FUNCTIONS # +################################################## +# invoked via `$to_host_file_cmd ARG' +# +# In each case, ARG is the path to be converted from $build to $host format. +# Result will be available in $func_to_host_file_result. + + +# func_to_host_file ARG +# Converts the file name ARG from $build format to $host format. Return result +# in func_to_host_file_result. +func_to_host_file () +{ + $opt_debug + $to_host_file_cmd "$1" +} +# end func_to_host_file + + +# func_to_tool_file ARG LAZY +# converts the file name ARG from $build format to toolchain format. Return +# result in func_to_tool_file_result. If the conversion in use is listed +# in (the comma separated) LAZY, no conversion takes place. +func_to_tool_file () +{ + $opt_debug + case ,$2, in + *,"$to_tool_file_cmd",*) + func_to_tool_file_result=$1 + ;; + *) + $to_tool_file_cmd "$1" + func_to_tool_file_result=$func_to_host_file_result + ;; + esac +} +# end func_to_tool_file + + +# func_convert_file_noop ARG +# Copy ARG to func_to_host_file_result. +func_convert_file_noop () +{ + func_to_host_file_result="$1" +} +# end func_convert_file_noop + + +# func_convert_file_msys_to_w32 ARG +# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic +# conversion to w32 is not available inside the cwrapper. Returns result in +# func_to_host_file_result. +func_convert_file_msys_to_w32 () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + func_convert_core_msys_to_w32 "$1" + func_to_host_file_result="$func_convert_core_msys_to_w32_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_msys_to_w32 + + +# func_convert_file_cygwin_to_w32 ARG +# Convert file name ARG from Cygwin to w32 format. Returns result in +# func_to_host_file_result. +func_convert_file_cygwin_to_w32 () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + # because $build is cygwin, we call "the" cygpath in $PATH; no need to use + # LT_CYGPATH in this case. + func_to_host_file_result=`cygpath -m "$1"` + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_cygwin_to_w32 + + +# func_convert_file_nix_to_w32 ARG +# Convert file name ARG from *nix to w32 format. Requires a wine environment +# and a working winepath. Returns result in func_to_host_file_result. +func_convert_file_nix_to_w32 () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + func_convert_core_file_wine_to_w32 "$1" + func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_nix_to_w32 + + +# func_convert_file_msys_to_cygwin ARG +# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. +# Returns result in func_to_host_file_result. +func_convert_file_msys_to_cygwin () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + func_convert_core_msys_to_w32 "$1" + func_cygpath -u "$func_convert_core_msys_to_w32_result" + func_to_host_file_result="$func_cygpath_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_msys_to_cygwin + + +# func_convert_file_nix_to_cygwin ARG +# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed +# in a wine environment, working winepath, and LT_CYGPATH set. Returns result +# in func_to_host_file_result. +func_convert_file_nix_to_cygwin () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. + func_convert_core_file_wine_to_w32 "$1" + func_cygpath -u "$func_convert_core_file_wine_to_w32_result" + func_to_host_file_result="$func_cygpath_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_nix_to_cygwin + + +############################################# +# $build to $host PATH CONVERSION FUNCTIONS # +############################################# +# invoked via `$to_host_path_cmd ARG' +# +# In each case, ARG is the path to be converted from $build to $host format. +# The result will be available in $func_to_host_path_result. +# +# Path separators are also converted from $build format to $host format. If +# ARG begins or ends with a path separator character, it is preserved (but +# converted to $host format) on output. +# +# All path conversion functions are named using the following convention: +# file name conversion function : func_convert_file_X_to_Y () +# path conversion function : func_convert_path_X_to_Y () +# where, for any given $build/$host combination the 'X_to_Y' value is the +# same. If conversion functions are added for new $build/$host combinations, +# the two new functions must follow this pattern, or func_init_to_host_path_cmd +# will break. + + +# func_init_to_host_path_cmd +# Ensures that function "pointer" variable $to_host_path_cmd is set to the +# appropriate value, based on the value of $to_host_file_cmd. +to_host_path_cmd= +func_init_to_host_path_cmd () +{ + $opt_debug + if test -z "$to_host_path_cmd"; then + func_stripname 'func_convert_file_' '' "$to_host_file_cmd" + to_host_path_cmd="func_convert_path_${func_stripname_result}" + fi +} + + +# func_to_host_path ARG +# Converts the path ARG from $build format to $host format. Return result +# in func_to_host_path_result. +func_to_host_path () +{ + $opt_debug + func_init_to_host_path_cmd + $to_host_path_cmd "$1" +} +# end func_to_host_path + + +# func_convert_path_noop ARG +# Copy ARG to func_to_host_path_result. +func_convert_path_noop () +{ + func_to_host_path_result="$1" +} +# end func_convert_path_noop + + +# func_convert_path_msys_to_w32 ARG +# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic +# conversion to w32 is not available inside the cwrapper. Returns result in +# func_to_host_path_result. +func_convert_path_msys_to_w32 () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # Remove leading and trailing path separator characters from ARG. MSYS + # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; + # and winepath ignores them completely. + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" + func_to_host_path_result="$func_convert_core_msys_to_w32_result" + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_msys_to_w32 + + +# func_convert_path_cygwin_to_w32 ARG +# Convert path ARG from Cygwin to w32 format. Returns result in +# func_to_host_file_result. +func_convert_path_cygwin_to_w32 () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_cygwin_to_w32 + + +# func_convert_path_nix_to_w32 ARG +# Convert path ARG from *nix to w32 format. Requires a wine environment and +# a working winepath. Returns result in func_to_host_file_result. +func_convert_path_nix_to_w32 () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" + func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_nix_to_w32 + + +# func_convert_path_msys_to_cygwin ARG +# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. +# Returns result in func_to_host_file_result. +func_convert_path_msys_to_cygwin () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" + func_cygpath -u -p "$func_convert_core_msys_to_w32_result" + func_to_host_path_result="$func_cygpath_result" + func_convert_path_check : : \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" : "$1" + fi +} +# end func_convert_path_msys_to_cygwin + + +# func_convert_path_nix_to_cygwin ARG +# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a +# a wine environment, working winepath, and LT_CYGPATH set. Returns result in +# func_to_host_file_result. +func_convert_path_nix_to_cygwin () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # Remove leading and trailing path separator characters from + # ARG. msys behavior is inconsistent here, cygpath turns them + # into '.;' and ';.', and winepath ignores them completely. + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" + func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" + func_to_host_path_result="$func_cygpath_result" + func_convert_path_check : : \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" : "$1" + fi +} +# end func_convert_path_nix_to_cygwin + + # func_mode_compile arg... func_mode_compile () { @@ -1137,12 +1986,12 @@ func_mode_compile () ;; -pie | -fpie | -fPIE) - pie_flag="$pie_flag $arg" + func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) - later="$later $arg" + func_append later " $arg" continue ;; @@ -1163,15 +2012,14 @@ func_mode_compile () save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" - func_quote_for_eval "$arg" - lastarg="$lastarg $func_quote_for_eval_result" + func_append_quoted lastarg "$arg" done IFS="$save_ifs" func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. - base_compile="$base_compile $lastarg" + func_append base_compile " $lastarg" continue ;; @@ -1187,8 +2035,7 @@ func_mode_compile () esac # case $arg_mode # Aesthetically quote the previous argument. - func_quote_for_eval "$lastarg" - base_compile="$base_compile $func_quote_for_eval_result" + func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in @@ -1213,7 +2060,7 @@ func_mode_compile () *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ - *.[fF][09]? | *.for | *.java | *.obj | *.sx) + *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; @@ -1288,7 +2135,7 @@ func_mode_compile () # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then - output_obj=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} + output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" else output_obj= @@ -1319,17 +2166,16 @@ compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi - removelist="$removelist $output_obj" + func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist - removelist="$removelist $lockfile" + func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 - if test -n "$fix_srcfile_path"; then - eval srcfile=\"$fix_srcfile_path\" - fi + func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 + srcfile=$func_to_tool_file_result func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result @@ -1349,7 +2195,7 @@ compiler." if test -z "$output_obj"; then # Place PIC objects in $objdir - command="$command -o $lobj" + func_append command " -o $lobj" fi func_show_eval_locale "$command" \ @@ -1396,11 +2242,11 @@ compiler." command="$base_compile $qsrcfile $pic_flag" fi if test "$compiler_c_o" = yes; then - command="$command -o $obj" + func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. - command="$command$suppress_output" + func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' @@ -1445,13 +2291,13 @@ compiler." } $opt_help || { -test "$mode" = compile && func_mode_compile ${1+"$@"} + test "$opt_mode" = compile && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. - case $mode in + case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. @@ -1482,10 +2328,11 @@ This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes - -prefer-pic try to building PIC objects only - -prefer-non-pic try to building non-PIC objects only + -prefer-pic try to build PIC objects only + -prefer-non-pic try to build non-PIC objects only -shared do not build a \`.o' file suitable for static linking -static only build a \`.o' file suitable for static linking + -Wc,FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. @@ -1538,7 +2385,7 @@ either the \`install' or \`cp' program. The following components of INSTALL-COMMAND are treated specially: - -inst-prefix PREFIX-DIR Use PREFIX-DIR as a staging area for installation + -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." @@ -1558,6 +2405,8 @@ The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible + -bindir BINDIR specify path to binaries directory (for systems where + libraries must be found in the PATH setting at runtime) -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) @@ -1586,6 +2435,11 @@ The following components of LINK-COMMAND are treated specially: -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface + -Wc,FLAG + -Xcompiler FLAG pass linker-specific FLAG directly to the compiler + -Wl,FLAG + -Xlinker FLAG pass linker-specific FLAG directly to the linker + -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) All other options (arguments beginning with \`-') are ignored. @@ -1619,18 +2473,44 @@ Otherwise, only FILE itself is deleted using RM." ;; *) - func_fatal_help "invalid operation mode \`$mode'" + func_fatal_help "invalid operation mode \`$opt_mode'" ;; esac - $ECHO + echo $ECHO "Try \`$progname --help' for more information about other modes." - - exit $? } - # Now that we've collected a possible --mode arg, show help if necessary - $opt_help && func_mode_help +# Now that we've collected a possible --mode arg, show help if necessary +if $opt_help; then + if test "$opt_help" = :; then + func_mode_help + else + { + func_help noexit + for opt_mode in compile link execute install finish uninstall clean; do + func_mode_help + done + } | sed -n '1p; 2,$s/^Usage:/ or: /p' + { + func_help noexit + for opt_mode in compile link execute install finish uninstall clean; do + echo + func_mode_help + done + } | + sed '1d + /^When reporting/,/^Report/{ + H + d + } + $x + /information about other modes/d + /more detailed .*MODE/d + s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' + fi + exit $? +fi # func_mode_execute arg... @@ -1643,13 +2523,16 @@ func_mode_execute () func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. - for file in $execute_dlfiles; do + for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "\`$file' is not a file" dir= case $file in *.la) + func_resolve_sysroot "$file" + file=$func_resolve_sysroot_result + # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$lib' is not a valid libtool archive" @@ -1671,7 +2554,7 @@ func_mode_execute () dir="$func_dirname_result" if test -f "$dir/$objdir/$dlname"; then - dir="$dir/$objdir" + func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" @@ -1712,7 +2595,7 @@ func_mode_execute () for file do case $file in - -*) ;; + -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then @@ -1728,8 +2611,7 @@ func_mode_execute () ;; esac # Quote arguments (to preserve shell metacharacters). - func_quote_for_eval "$file" - args="$args $func_quote_for_eval_result" + func_append_quoted args "$file" done if test "X$opt_dry_run" = Xfalse; then @@ -1754,29 +2636,66 @@ func_mode_execute () # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" - $ECHO "export $shlibpath_var" + echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS fi } -test "$mode" = execute && func_mode_execute ${1+"$@"} +test "$opt_mode" = execute && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $opt_debug - libdirs="$nonopt" + libs= + libdirs= admincmds= - if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then - for dir - do - libdirs="$libdirs $dir" - done + for opt in "$nonopt" ${1+"$@"} + do + if test -d "$opt"; then + func_append libdirs " $opt" + elif test -f "$opt"; then + if func_lalib_unsafe_p "$opt"; then + func_append libs " $opt" + else + func_warning "\`$opt' is not a valid libtool archive" + fi + + else + func_fatal_error "invalid argument \`$opt'" + fi + done + + if test -n "$libs"; then + if test -n "$lt_sysroot"; then + sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` + sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" + else + sysroot_cmd= + fi + + # Remove sysroot references + if $opt_dry_run; then + for lib in $libs; do + echo "removing references to $lt_sysroot and \`=' prefixes from $lib" + done + else + tmpdir=`func_mktempdir` + for lib in $libs; do + sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ + > $tmpdir/tmp-la + mv -f $tmpdir/tmp-la $lib + done + ${RM}r "$tmpdir" + fi + fi + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. @@ -1786,7 +2705,7 @@ func_mode_finish () if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" - $opt_dry_run || eval "$cmds" || admincmds="$admincmds + $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done @@ -1795,53 +2714,55 @@ func_mode_finish () # Exit here if they wanted silent mode. $opt_silent && exit $EXIT_SUCCESS - $ECHO "X----------------------------------------------------------------------" | $Xsed - $ECHO "Libraries have been installed in:" - for libdir in $libdirs; do - $ECHO " $libdir" - done - $ECHO - $ECHO "If you ever happen to want to link against installed libraries" - $ECHO "in a given directory, LIBDIR, you must either use libtool, and" - $ECHO "specify the full pathname of the library, or use the \`-LLIBDIR'" - $ECHO "flag during linking and do at least one of the following:" - if test -n "$shlibpath_var"; then - $ECHO " - add LIBDIR to the \`$shlibpath_var' environment variable" - $ECHO " during execution" - fi - if test -n "$runpath_var"; then - $ECHO " - add LIBDIR to the \`$runpath_var' environment variable" - $ECHO " during linking" - fi - if test -n "$hardcode_libdir_flag_spec"; then - libdir=LIBDIR - eval flag=\"$hardcode_libdir_flag_spec\" + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + echo "----------------------------------------------------------------------" + echo "Libraries have been installed in:" + for libdir in $libdirs; do + $ECHO " $libdir" + done + echo + echo "If you ever happen to want to link against installed libraries" + echo "in a given directory, LIBDIR, you must either use libtool, and" + echo "specify the full pathname of the library, or use the \`-LLIBDIR'" + echo "flag during linking and do at least one of the following:" + if test -n "$shlibpath_var"; then + echo " - add LIBDIR to the \`$shlibpath_var' environment variable" + echo " during execution" + fi + if test -n "$runpath_var"; then + echo " - add LIBDIR to the \`$runpath_var' environment variable" + echo " during linking" + fi + if test -n "$hardcode_libdir_flag_spec"; then + libdir=LIBDIR + eval flag=\"$hardcode_libdir_flag_spec\" - $ECHO " - use the \`$flag' linker flag" - fi - if test -n "$admincmds"; then - $ECHO " - have your system administrator run these commands:$admincmds" - fi - if test -f /etc/ld.so.conf; then - $ECHO " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" - fi - $ECHO + $ECHO " - use the \`$flag' linker flag" + fi + if test -n "$admincmds"; then + $ECHO " - have your system administrator run these commands:$admincmds" + fi + if test -f /etc/ld.so.conf; then + echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" + fi + echo - $ECHO "See any operating system documentation about shared libraries for" - case $host in - solaris2.[6789]|solaris2.1[0-9]) - $ECHO "more information, such as the ld(1), crle(1) and ld.so(8) manual" - $ECHO "pages." - ;; - *) - $ECHO "more information, such as the ld(1) and ld.so(8) manual pages." - ;; - esac - $ECHO "X----------------------------------------------------------------------" | $Xsed + echo "See any operating system documentation about shared libraries for" + case $host in + solaris2.[6789]|solaris2.1[0-9]) + echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" + echo "pages." + ;; + *) + echo "more information, such as the ld(1) and ld.so(8) manual pages." + ;; + esac + echo "----------------------------------------------------------------------" + fi exit $EXIT_SUCCESS } -test "$mode" = finish && func_mode_finish ${1+"$@"} +test "$opt_mode" = finish && func_mode_finish ${1+"$@"} # func_mode_install arg... @@ -1852,7 +2773,7 @@ func_mode_install () # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. - $ECHO "X$nonopt" | $GREP shtool >/dev/null; then + case $nonopt in *shtool*) :;; *) false;; esac; then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " @@ -1866,7 +2787,12 @@ func_mode_install () # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" - install_prog="$install_prog$func_quote_for_eval_result" + func_append install_prog "$func_quote_for_eval_result" + install_shared_prog=$install_prog + case " $install_prog " in + *[\\\ /]cp\ *) install_cp=: ;; + *) install_cp=false ;; + esac # We need to accept at least all the BSD install flags. dest= @@ -1876,10 +2802,12 @@ func_mode_install () install_type= isdir=no stripme= + no_mode=: for arg do + arg2= if test -n "$dest"; then - files="$files $dest" + func_append files " $dest" dest=$arg continue fi @@ -1887,10 +2815,9 @@ func_mode_install () case $arg in -d) isdir=yes ;; -f) - case " $install_prog " in - *[\\\ /]cp\ *) ;; - *) prev=$arg ;; - esac + if $install_cp; then :; else + prev=$arg + fi ;; -g | -m | -o) prev=$arg @@ -1904,6 +2831,10 @@ func_mode_install () *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then + if test "x$prev" = x-m && test -n "$install_override_mode"; then + arg2=$install_override_mode + no_mode=false + fi prev= else dest=$arg @@ -1914,7 +2845,11 @@ func_mode_install () # Aesthetically quote the argument. func_quote_for_eval "$arg" - install_prog="$install_prog $func_quote_for_eval_result" + func_append install_prog " $func_quote_for_eval_result" + if test -n "$arg2"; then + func_quote_for_eval "$arg2" + fi + func_append install_shared_prog " $func_quote_for_eval_result" done test -z "$install_prog" && \ @@ -1923,6 +2858,13 @@ func_mode_install () test -n "$prev" && \ func_fatal_help "the \`$prev' option requires an argument" + if test -n "$install_override_mode" && $no_mode; then + if $install_cp; then :; else + func_quote_for_eval "$install_override_mode" + func_append install_shared_prog " -m $func_quote_for_eval_result" + fi + fi + if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" @@ -1977,10 +2919,13 @@ func_mode_install () case $file in *.$libext) # Do the static libraries later. - staticlibs="$staticlibs $file" + func_append staticlibs " $file" ;; *.la) + func_resolve_sysroot "$file" + file=$func_resolve_sysroot_result + # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$file' is not a valid libtool archive" @@ -1994,23 +2939,23 @@ func_mode_install () if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; - *) current_libdirs="$current_libdirs $libdir" ;; + *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; - *) future_libdirs="$future_libdirs $libdir" ;; + *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir="$func_dirname_result" - dir="$dir$objdir" + func_append dir "$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. - inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$libdir\$%%"` + inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that @@ -2023,9 +2968,9 @@ func_mode_install () if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. - relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` + relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else - relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%%"` + relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking \`$file'" @@ -2043,7 +2988,7 @@ func_mode_install () test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. - func_show_eval "$install_prog $dir/$srcname $destdir/$realname" \ + func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme="$stripme" case $host_os in @@ -2083,7 +3028,7 @@ func_mode_install () func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. - test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" + test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) @@ -2183,7 +3128,7 @@ func_mode_install () if test -f "$lib"; then func_source "$lib" fi - libfile="$libdir/"`$ECHO "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test + libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then func_warning "\`$lib' has not been installed in \`$libdir'" finalize=no @@ -2202,7 +3147,7 @@ func_mode_install () file="$func_basename_result" outputname="$tmpdir/$file" # Replace the output file specification. - relink_command=`$ECHO "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` + relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_silent || { func_quote_for_expand "$relink_command" @@ -2221,7 +3166,7 @@ func_mode_install () } else # Install the binary that we compiled earlier. - file=`$ECHO "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` + file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi @@ -2257,11 +3202,13 @@ func_mode_install () # Set up the ranlib parameters. oldlib="$destdir/$name" + func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 + tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then - func_show_eval "$old_striplib $oldlib" 'exit $?' + func_show_eval "$old_striplib $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. @@ -2280,7 +3227,7 @@ func_mode_install () fi } -test "$mode" = install && func_mode_install ${1+"$@"} +test "$opt_mode" = install && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p @@ -2323,6 +3270,22 @@ func_generate_dlsyms () extern \"C\" { #endif +#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) +#pragma GCC diagnostic ignored \"-Wstrict-prototypes\" +#endif + +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT_DLSYM_CONST +#elif defined(__osf__) +/* This system does not cope well with relocations in const data. */ +# define LT_DLSYM_CONST +#else +# define LT_DLSYM_CONST const +#endif + /* External symbol declarations for the compiler. */\ " @@ -2332,10 +3295,11 @@ extern \"C\" { $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. - progfiles=`$ECHO "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do - func_verbose "extracting global C symbols from \`$progfile'" - $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'" + func_to_tool_file "$progfile" func_convert_file_msys_to_w32 + func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" + $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then @@ -2371,7 +3335,7 @@ extern \"C\" { eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in - *cygwin | *mingw* | *cegcc* ) + *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; @@ -2384,10 +3348,52 @@ extern \"C\" { func_verbose "extracting global C symbols from \`$dlprefile'" func_basename "$dlprefile" name="$func_basename_result" - $opt_dry_run || { - eval '$ECHO ": $name " >> "$nlist"' - eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'" - } + case $host in + *cygwin* | *mingw* | *cegcc* ) + # if an import library, we need to obtain dlname + if func_win32_import_lib_p "$dlprefile"; then + func_tr_sh "$dlprefile" + eval "curr_lafile=\$libfile_$func_tr_sh_result" + dlprefile_dlbasename="" + if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then + # Use subshell, to avoid clobbering current variable values + dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` + if test -n "$dlprefile_dlname" ; then + func_basename "$dlprefile_dlname" + dlprefile_dlbasename="$func_basename_result" + else + # no lafile. user explicitly requested -dlpreopen . + $sharedlib_from_linklib_cmd "$dlprefile" + dlprefile_dlbasename=$sharedlib_from_linklib_result + fi + fi + $opt_dry_run || { + if test -n "$dlprefile_dlbasename" ; then + eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' + else + func_warning "Could not compute DLL name from $name" + eval '$ECHO ": $name " >> "$nlist"' + fi + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | + $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" + } + else # not an import lib + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } + fi + ;; + *) + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } + ;; + esac done $opt_dry_run || { @@ -2415,36 +3421,19 @@ extern \"C\" { if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else - $ECHO '/* NONE */' >> "$output_objdir/$my_dlsyms" + echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi - $ECHO >> "$output_objdir/$my_dlsyms" "\ + echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; -" - case $host in - *cygwin* | *mingw* | *cegcc* ) - $ECHO >> "$output_objdir/$my_dlsyms" "\ -/* DATA imports from DLLs on WIN32 con't be const, because - runtime relocations are performed -- see ld's documentation - on pseudo-relocs. */" - lt_dlsym_const= ;; - *osf5*) - echo >> "$output_objdir/$my_dlsyms" "\ -/* This system does not cope well with relocations in const data */" - lt_dlsym_const= ;; - *) - lt_dlsym_const=const ;; - esac - - $ECHO >> "$output_objdir/$my_dlsyms" "\ -extern $lt_dlsym_const lt_dlsymlist +extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[]; -$lt_dlsym_const lt_dlsymlist +LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = {\ { \"$my_originator\", (void *) 0 }," @@ -2457,7 +3446,7 @@ lt_${my_prefix}_LTX_preloaded_symbols[] = eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac - $ECHO >> "$output_objdir/$my_dlsyms" "\ + echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; @@ -2484,7 +3473,7 @@ static const void *lt_preloaded_setup() { # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. - *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) + *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; @@ -2500,7 +3489,7 @@ static const void *lt_preloaded_setup() { for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; - *) symtab_cflags="$symtab_cflags $arg" ;; + *) func_append symtab_cflags " $arg" ;; esac done @@ -2515,16 +3504,16 @@ static const void *lt_preloaded_setup() { case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then - compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` - finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else - compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` - finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) - compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` - finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; @@ -2538,8 +3527,8 @@ static const void *lt_preloaded_setup() { # really was required. # Nullify the symbol file. - compile_command=`$ECHO "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` - finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` + compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } @@ -2549,6 +3538,7 @@ static const void *lt_preloaded_setup() { # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. +# Despite the name, also deal with 64 bit binaries. func_win32_libid () { $opt_debug @@ -2559,9 +3549,11 @@ func_win32_libid () win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static + # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | - $EGREP 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then - win32_nmres=`eval $NM -f posix -A $1 | + $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then + func_to_tool_file "$1" func_convert_file_msys_to_w32 + win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ @@ -2590,6 +3582,131 @@ func_win32_libid () $ECHO "$win32_libid_type" } +# func_cygming_dll_for_implib ARG +# +# Platform-specific function to extract the +# name of the DLL associated with the specified +# import library ARG. +# Invoked by eval'ing the libtool variable +# $sharedlib_from_linklib_cmd +# Result is available in the variable +# $sharedlib_from_linklib_result +func_cygming_dll_for_implib () +{ + $opt_debug + sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` +} + +# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs +# +# The is the core of a fallback implementation of a +# platform-specific function to extract the name of the +# DLL associated with the specified import library LIBNAME. +# +# SECTION_NAME is either .idata$6 or .idata$7, depending +# on the platform and compiler that created the implib. +# +# Echos the name of the DLL associated with the +# specified import library. +func_cygming_dll_for_implib_fallback_core () +{ + $opt_debug + match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` + $OBJDUMP -s --section "$1" "$2" 2>/dev/null | + $SED '/^Contents of section '"$match_literal"':/{ + # Place marker at beginning of archive member dllname section + s/.*/====MARK====/ + p + d + } + # These lines can sometimes be longer than 43 characters, but + # are always uninteresting + /:[ ]*file format pe[i]\{,1\}-/d + /^In archive [^:]*:/d + # Ensure marker is printed + /^====MARK====/p + # Remove all lines with less than 43 characters + /^.\{43\}/!d + # From remaining lines, remove first 43 characters + s/^.\{43\}//' | + $SED -n ' + # Join marker and all lines until next marker into a single line + /^====MARK====/ b para + H + $ b para + b + :para + x + s/\n//g + # Remove the marker + s/^====MARK====// + # Remove trailing dots and whitespace + s/[\. \t]*$// + # Print + /./p' | + # we now have a list, one entry per line, of the stringified + # contents of the appropriate section of all members of the + # archive which possess that section. Heuristic: eliminate + # all those which have a first or second character that is + # a '.' (that is, objdump's representation of an unprintable + # character.) This should work for all archives with less than + # 0x302f exports -- but will fail for DLLs whose name actually + # begins with a literal '.' or a single character followed by + # a '.'. + # + # Of those that remain, print the first one. + $SED -e '/^\./d;/^.\./d;q' +} + +# func_cygming_gnu_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is a GNU/binutils-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_gnu_implib_p () +{ + $opt_debug + func_to_tool_file "$1" func_convert_file_msys_to_w32 + 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)$'` + test -n "$func_cygming_gnu_implib_tmp" +} + +# func_cygming_ms_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is an MS-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_ms_implib_p () +{ + $opt_debug + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` + test -n "$func_cygming_ms_implib_tmp" +} + +# func_cygming_dll_for_implib_fallback ARG +# Platform-specific function to extract the +# name of the DLL associated with the specified +# import library ARG. +# +# This fallback implementation is for use when $DLLTOOL +# does not support the --identify-strict option. +# Invoked by eval'ing the libtool variable +# $sharedlib_from_linklib_cmd +# Result is available in the variable +# $sharedlib_from_linklib_result +func_cygming_dll_for_implib_fallback () +{ + $opt_debug + if func_cygming_gnu_implib_p "$1" ; then + # binutils import library + sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` + elif func_cygming_ms_implib_p "$1" ; then + # ms-generated import library + sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` + else + # unknown + sharedlib_from_linklib_result="" + fi +} # func_extract_an_archive dir oldlib @@ -2598,7 +3715,18 @@ func_extract_an_archive () $opt_debug f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" - func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" 'exit $?' + if test "$lock_old_archive_extraction" = yes; then + lockfile=$f_ex_an_ar_oldlib.lock + until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do + func_echo "Waiting for $lockfile to be removed" + sleep 2 + done + fi + func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ + 'stat=$?; rm -f "$lockfile"; exit $stat' + if test "$lock_old_archive_extraction" = yes; then + $opt_dry_run || rm -f "$lockfile" + fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else @@ -2669,7 +3797,7 @@ func_extract_archives () darwin_file= darwin_files= for darwin_file in $darwin_filelist; do - darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` + darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ @@ -2684,25 +3812,30 @@ func_extract_archives () func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac - my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` + my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result="$my_oldobjs" } - -# func_emit_wrapper_part1 [arg=no] +# func_emit_wrapper [arg=no] # -# Emit the first part of a libtool wrapper script on stdout. -# For more information, see the description associated with -# func_emit_wrapper(), below. -func_emit_wrapper_part1 () +# Emit a libtool wrapper script on stdout. +# Don't directly open a file because we may want to +# incorporate the script contents within a cygwin/mingw +# wrapper executable. Must ONLY be called from within +# func_mode_link because it depends on a number of variables +# set therein. +# +# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR +# variable will take. If 'yes', then the emitted script +# will assume that the directory in which it is stored is +# the $objdir directory. This is a cygwin/mingw-specific +# behavior. +func_emit_wrapper () { - func_emit_wrapper_part1_arg1=no - if test -n "$1" ; then - func_emit_wrapper_part1_arg1=$1 - fi + func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL @@ -2718,7 +3851,6 @@ func_emit_wrapper_part1 () # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. -Xsed='${SED} -e 1s/^X//' sed_quote_subst='$sed_quote_subst' # Be Bourne compatible @@ -2749,31 +3881,135 @@ if test \"\$libtool_install_magic\" = \"$magic\"; then else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then - ECHO=\"$qecho\" - file=\"\$0\" - # Make sure echo works. - if test \"X\$1\" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift - elif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X\t'; then - # Yippee, \$ECHO works! - : - else - # Restart under the correct shell, and then maybe \$ECHO will work. - exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} - fi - fi\ + file=\"\$0\"" + + qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` + $ECHO "\ + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + ECHO=\"$qECHO\" + fi + +# Very basic option parsing. These options are (a) specific to +# the libtool wrapper, (b) are identical between the wrapper +# /script/ and the wrapper /executable/ which is used only on +# windows platforms, and (c) all begin with the string "--lt-" +# (application programs are unlikely to have options which match +# this pattern). +# +# There are only two supported options: --lt-debug and +# --lt-dump-script. There is, deliberately, no --lt-help. +# +# The first argument to this parsing function should be the +# script's $0 value, followed by "$@". +lt_option_debug= +func_parse_lt_options () +{ + lt_script_arg0=\$0 + shift + for lt_opt + do + case \"\$lt_opt\" in + --lt-debug) lt_option_debug=1 ;; + --lt-dump-script) + lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` + test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. + lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` + cat \"\$lt_dump_D/\$lt_dump_F\" + exit 0 + ;; + --lt-*) + \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 + exit 1 + ;; + esac + done + + # Print the debug banner immediately: + if test -n \"\$lt_option_debug\"; then + echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 + fi +} + +# Used when --lt-debug. Prints its arguments to stdout +# (redirection is the responsibility of the caller) +func_lt_dump_args () +{ + lt_dump_args_N=1; + for lt_arg + do + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" + lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` + done +} + +# Core function for launching the target application +func_exec_program_core () +{ " - $ECHO "\ + case $host in + # Backslashes separate directories on plain windows + *-*-mingw | *-*-os2* | *-cegcc*) + $ECHO "\ + if test -n \"\$lt_option_debug\"; then + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 + func_lt_dump_args \${1+\"\$@\"} 1>&2 + fi + exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} +" + ;; + + *) + $ECHO "\ + if test -n \"\$lt_option_debug\"; then + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 + func_lt_dump_args \${1+\"\$@\"} 1>&2 + fi + exec \"\$progdir/\$program\" \${1+\"\$@\"} +" + ;; + esac + $ECHO "\ + \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 + exit 1 +} + +# A function to encapsulate launching the target application +# Strips options in the --lt-* namespace from \$@ and +# launches target application with the remaining arguments. +func_exec_program () +{ + case \" \$* \" in + *\\ --lt-*) + for lt_wr_arg + do + case \$lt_wr_arg in + --lt-*) ;; + *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; + esac + shift + done ;; + esac + func_exec_program_core \${1+\"\$@\"} +} + + # Parse options + func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. - thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` + thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. - file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` + file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do - destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` + destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then @@ -2783,30 +4019,13 @@ else esac fi - file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\` - file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` + file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` + file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done -" -} -# end: func_emit_wrapper_part1 - -# func_emit_wrapper_part2 [arg=no] -# -# Emit the second part of a libtool wrapper script on stdout. -# For more information, see the description associated with -# func_emit_wrapper(), below. -func_emit_wrapper_part2 () -{ - func_emit_wrapper_part2_arg1=no - if test -n "$1" ; then - func_emit_wrapper_part2_arg1=$1 - fi - - $ECHO "\ # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. - WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_part2_arg1 + WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then @@ -2814,7 +4033,7 @@ func_emit_wrapper_part2 () fi # remove .libs from thisdir case \"\$thisdir\" in - *[\\\\/]$objdir ) thisdir=\`\$ECHO \"X\$thisdir\" | \$Xsed -e 's%[\\\\/][^\\\\/]*$%%'\` ;; + *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi @@ -2869,6 +4088,18 @@ func_emit_wrapper_part2 () if test -f \"\$progdir/\$program\"; then" + # fixup the dll searchpath if we need to. + # + # Fix the DLL searchpath if we need to. Do this before prepending + # to shlibpath, because on Windows, both are PATH and uninstalled + # libraries must come first. + if test -n "$dllsearchpath"; then + $ECHO "\ + # Add the dll search path components to the executable PATH + PATH=$dllsearchpath:\$PATH +" + fi + # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ @@ -2877,254 +4108,29 @@ func_emit_wrapper_part2 () # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed - $shlibpath_var=\`\$ECHO \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` + $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi - # fixup the dll searchpath if we need to. - if test -n "$dllsearchpath"; then - $ECHO "\ - # Add the dll search path components to the executable PATH - PATH=$dllsearchpath:\$PATH -" - fi - $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. -" - case $host in - # Backslashes separate directories on plain windows - *-*-mingw | *-*-os2* | *-cegcc*) - $ECHO "\ - exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} -" - ;; - - *) - $ECHO "\ - exec \"\$progdir/\$program\" \${1+\"\$@\"} -" - ;; - esac - $ECHO "\ - \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 - exit 1 + func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 - $ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 + \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } -# end: func_emit_wrapper_part2 -# func_emit_wrapper [arg=no] -# -# Emit a libtool wrapper script on stdout. -# Don't directly open a file because we may want to -# incorporate the script contents within a cygwin/mingw -# wrapper executable. Must ONLY be called from within -# func_mode_link because it depends on a number of variables -# set therein. -# -# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR -# variable will take. If 'yes', then the emitted script -# will assume that the directory in which it is stored is -# the $objdir directory. This is a cygwin/mingw-specific -# behavior. -func_emit_wrapper () -{ - func_emit_wrapper_arg1=no - if test -n "$1" ; then - func_emit_wrapper_arg1=$1 - fi - - # split this up so that func_emit_cwrapperexe_src - # can call each part independently. - func_emit_wrapper_part1 "${func_emit_wrapper_arg1}" - func_emit_wrapper_part2 "${func_emit_wrapper_arg1}" -} - - -# func_to_host_path arg -# -# Convert paths to host format when used with build tools. -# Intended for use with "native" mingw (where libtool itself -# is running under the msys shell), or in the following cross- -# build environments: -# $build $host -# mingw (msys) mingw [e.g. native] -# cygwin mingw -# *nix + wine mingw -# where wine is equipped with the `winepath' executable. -# In the native mingw case, the (msys) shell automatically -# converts paths for any non-msys applications it launches, -# but that facility isn't available from inside the cwrapper. -# Similar accommodations are necessary for $host mingw and -# $build cygwin. Calling this function does no harm for other -# $host/$build combinations not listed above. -# -# ARG is the path (on $build) that should be converted to -# the proper representation for $host. The result is stored -# in $func_to_host_path_result. -func_to_host_path () -{ - func_to_host_path_result="$1" - if test -n "$1" ; then - case $host in - *mingw* ) - lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' - case $build in - *mingw* ) # actually, msys - # awkward: cmd appends spaces to result - lt_sed_strip_trailing_spaces="s/[ ]*\$//" - func_to_host_path_tmp1=`( cmd //c echo "$1" |\ - $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""` - func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ - $SED -e "$lt_sed_naive_backslashify"` - ;; - *cygwin* ) - func_to_host_path_tmp1=`cygpath -w "$1"` - func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ - $SED -e "$lt_sed_naive_backslashify"` - ;; - * ) - # Unfortunately, winepath does not exit with a non-zero - # error code, so we are forced to check the contents of - # stdout. On the other hand, if the command is not - # found, the shell will set an exit code of 127 and print - # *an error message* to stdout. So we must check for both - # error code of zero AND non-empty stdout, which explains - # the odd construction: - func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null` - if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then - func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ - $SED -e "$lt_sed_naive_backslashify"` - else - # Allow warning below. - func_to_host_path_result="" - fi - ;; - esac - if test -z "$func_to_host_path_result" ; then - func_error "Could not determine host path corresponding to" - func_error " '$1'" - func_error "Continuing, but uninstalled executables may not work." - # Fallback: - func_to_host_path_result="$1" - fi - ;; - esac - fi -} -# end: func_to_host_path - -# func_to_host_pathlist arg -# -# Convert pathlists to host format when used with build tools. -# See func_to_host_path(), above. This function supports the -# following $build/$host combinations (but does no harm for -# combinations not listed here): -# $build $host -# mingw (msys) mingw [e.g. native] -# cygwin mingw -# *nix + wine mingw -# -# Path separators are also converted from $build format to -# $host format. If ARG begins or ends with a path separator -# character, it is preserved (but converted to $host format) -# on output. -# -# ARG is a pathlist (on $build) that should be converted to -# the proper representation on $host. The result is stored -# in $func_to_host_pathlist_result. -func_to_host_pathlist () -{ - func_to_host_pathlist_result="$1" - if test -n "$1" ; then - case $host in - *mingw* ) - lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' - # Remove leading and trailing path separator characters from - # ARG. msys behavior is inconsistent here, cygpath turns them - # into '.;' and ';.', and winepath ignores them completely. - func_to_host_pathlist_tmp2="$1" - # Once set for this call, this variable should not be - # reassigned. It is used in tha fallback case. - func_to_host_pathlist_tmp1=`echo "$func_to_host_pathlist_tmp2" |\ - $SED -e 's|^:*||' -e 's|:*$||'` - case $build in - *mingw* ) # Actually, msys. - # Awkward: cmd appends spaces to result. - lt_sed_strip_trailing_spaces="s/[ ]*\$//" - func_to_host_pathlist_tmp2=`( cmd //c echo "$func_to_host_pathlist_tmp1" |\ - $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""` - func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\ - $SED -e "$lt_sed_naive_backslashify"` - ;; - *cygwin* ) - func_to_host_pathlist_tmp2=`cygpath -w -p "$func_to_host_pathlist_tmp1"` - func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\ - $SED -e "$lt_sed_naive_backslashify"` - ;; - * ) - # unfortunately, winepath doesn't convert pathlists - func_to_host_pathlist_result="" - func_to_host_pathlist_oldIFS=$IFS - IFS=: - for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do - IFS=$func_to_host_pathlist_oldIFS - if test -n "$func_to_host_pathlist_f" ; then - func_to_host_path "$func_to_host_pathlist_f" - if test -n "$func_to_host_path_result" ; then - if test -z "$func_to_host_pathlist_result" ; then - func_to_host_pathlist_result="$func_to_host_path_result" - else - func_to_host_pathlist_result="$func_to_host_pathlist_result;$func_to_host_path_result" - fi - fi - fi - IFS=: - done - IFS=$func_to_host_pathlist_oldIFS - ;; - esac - if test -z "$func_to_host_pathlist_result" ; then - func_error "Could not determine the host path(s) corresponding to" - func_error " '$1'" - func_error "Continuing, but uninstalled executables may not work." - # Fallback. This may break if $1 contains DOS-style drive - # specifications. The fix is not to complicate the expression - # below, but for the user to provide a working wine installation - # with winepath so that path translation in the cross-to-mingw - # case works properly. - lt_replace_pathsep_nix_to_dos="s|:|;|g" - func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\ - $SED -e "$lt_replace_pathsep_nix_to_dos"` - fi - # Now, add the leading and trailing path separators back - case "$1" in - :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result" - ;; - esac - case "$1" in - *: ) func_to_host_pathlist_result="$func_to_host_pathlist_result;" - ;; - esac - ;; - esac - fi -} -# end: func_to_host_pathlist - # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because @@ -3141,31 +4147,23 @@ func_emit_cwrapperexe_src () This wrapper executable should never be moved out of the build directory. If it is, it will not operate correctly. - - Currently, it simply execs the wrapper *script* "$SHELL $output", - but could eventually absorb all of the scripts functionality and - exec $objdir/$outputname directly. */ EOF cat <<"EOF" +#ifdef _MSC_VER +# define _CRT_SECURE_NO_DEPRECATE 1 +#endif #include #include #ifdef _MSC_VER # include # include # include -# define setmode _setmode #else # include # include # ifdef __CYGWIN__ # include -# define HAVE_SETENV -# ifdef __STRICT_ANSI__ -char *realpath (const char *, char *); -int putenv (char *); -int setenv (const char *, const char *, int); -# endif # endif #endif #include @@ -3177,6 +4175,44 @@ int setenv (const char *, const char *, int); #include #include +/* declarations of non-ANSI functions */ +#if defined(__MINGW32__) +# ifdef __STRICT_ANSI__ +int _putenv (const char *); +# endif +#elif defined(__CYGWIN__) +# ifdef __STRICT_ANSI__ +char *realpath (const char *, char *); +int putenv (char *); +int setenv (const char *, const char *, int); +# endif +/* #elif defined (other platforms) ... */ +#endif + +/* portability defines, excluding path handling macros */ +#if defined(_MSC_VER) +# define setmode _setmode +# define stat _stat +# define chmod _chmod +# define getcwd _getcwd +# define putenv _putenv +# define S_IXUSR _S_IEXEC +# ifndef _INTPTR_T_DEFINED +# define _INTPTR_T_DEFINED +# define intptr_t int +# endif +#elif defined(__MINGW32__) +# define setmode _setmode +# define stat _stat +# define chmod _chmod +# define getcwd _getcwd +# define putenv _putenv +#elif defined(__CYGWIN__) +# define HAVE_SETENV +# define FOPEN_WB "wb" +/* #elif defined (other platforms) ... */ +#endif + #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) @@ -3192,14 +4228,7 @@ int setenv (const char *, const char *, int); # define S_IXGRP 0 #endif -#ifdef _MSC_VER -# define S_IXUSR _S_IEXEC -# define stat _stat -# ifndef _INTPTR_T_DEFINED -# define intptr_t int -# endif -#endif - +/* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' @@ -3230,10 +4259,6 @@ int setenv (const char *, const char *, int); # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ -#ifdef __CYGWIN__ -# define FOPEN_WB "wb" -#endif - #ifndef FOPEN_WB # define FOPEN_WB "w" #endif @@ -3246,22 +4271,13 @@ int setenv (const char *, const char *, int); if (stale) { free ((void *) stale); stale = 0; } \ } while (0) -#undef LTWRAPPER_DEBUGPRINTF -#if defined DEBUGWRAPPER -# define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args -static void -ltwrapper_debugprintf (const char *fmt, ...) -{ - va_list args; - va_start (args, fmt); - (void) vfprintf (stderr, fmt, args); - va_end (args); -} +#if defined(LT_DEBUGWRAPPER) +static int lt_debug = 1; #else -# define LTWRAPPER_DEBUGPRINTF(args) +static int lt_debug = 0; #endif -const char *program_name = NULL; +const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); @@ -3271,41 +4287,27 @@ char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); -void lt_fatal (const char *message, ...); +void lt_debugprintf (const char *file, int line, const char *fmt, ...); +void lt_fatal (const char *file, int line, const char *message, ...); +static const char *nonnull (const char *s); +static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); -void lt_opt_process_env_set (const char *arg); -void lt_opt_process_env_prepend (const char *arg); -void lt_opt_process_env_append (const char *arg); -int lt_split_name_value (const char *arg, char** name, char** value); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); - -static const char *script_text_part1 = +char **prepare_spawn (char **argv); +void lt_dump_script (FILE *f); EOF - func_emit_wrapper_part1 yes | - $SED -e 's/\([\\"]\)/\\\1/g' \ - -e 's/^/ "/' -e 's/$/\\n"/' - echo ";" cat <"))); + lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n", + nonnull (lt_argv_zero)); for (i = 0; i < newargc; i++) { - LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d] : %s\n", i, (newargz[i] ? newargz[i] : ""))); + lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n", + i, nonnull (newargz[i])); } EOF @@ -3560,11 +4523,14 @@ EOF mingw*) cat <<"EOF" /* execv doesn't actually work on mingw as expected on unix */ + newargz = prepare_spawn (newargz); rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz); if (rval == -1) { /* failed to start process */ - LTWRAPPER_DEBUGPRINTF (("(main) failed to launch target \"%s\": errno = %d\n", lt_argv_zero, errno)); + lt_debugprintf (__FILE__, __LINE__, + "(main) failed to launch target \"%s\": %s\n", + lt_argv_zero, nonnull (strerror (errno))); return 127; } return rval; @@ -3586,7 +4552,7 @@ xmalloc (size_t num) { void *p = (void *) malloc (num); if (!p) - lt_fatal ("Memory exhausted"); + lt_fatal (__FILE__, __LINE__, "memory exhausted"); return p; } @@ -3620,8 +4586,8 @@ check_executable (const char *path) { struct stat st; - LTWRAPPER_DEBUGPRINTF (("(check_executable) : %s\n", - path ? (*path ? path : "EMPTY!") : "NULL!")); + lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n", + nonempty (path)); if ((!path) || (!*path)) return 0; @@ -3638,8 +4604,8 @@ make_executable (const char *path) int rval = 0; struct stat st; - LTWRAPPER_DEBUGPRINTF (("(make_executable) : %s\n", - path ? (*path ? path : "EMPTY!") : "NULL!")); + lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", + nonempty (path)); if ((!path) || (!*path)) return 0; @@ -3665,8 +4631,8 @@ find_executable (const char *wrapper) int tmp_len; char *concat_name; - LTWRAPPER_DEBUGPRINTF (("(find_executable) : %s\n", - wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!")); + lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", + nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; @@ -3719,7 +4685,8 @@ find_executable (const char *wrapper) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) - lt_fatal ("getcwd failed"); + lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", + nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); @@ -3744,7 +4711,8 @@ find_executable (const char *wrapper) } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) - lt_fatal ("getcwd failed"); + lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", + nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); @@ -3770,8 +4738,9 @@ chase_symlinks (const char *pathspec) int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { - LTWRAPPER_DEBUGPRINTF (("checking path component for symlinks: %s\n", - tmp_pathspec)); + lt_debugprintf (__FILE__, __LINE__, + "checking path component for symlinks: %s\n", + tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) @@ -3793,8 +4762,9 @@ chase_symlinks (const char *pathspec) } else { - char *errstr = strerror (errno); - lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr); + lt_fatal (__FILE__, __LINE__, + "error accessing file \"%s\": %s", + tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); @@ -3807,7 +4777,8 @@ chase_symlinks (const char *pathspec) tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { - lt_fatal ("Could not follow symlinks for %s", pathspec); + lt_fatal (__FILE__, __LINE__, + "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif @@ -3833,11 +4804,25 @@ strendzap (char *str, const char *pat) return str; } +void +lt_debugprintf (const char *file, int line, const char *fmt, ...) +{ + va_list args; + if (lt_debug) + { + (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); + va_start (args, fmt); + (void) vfprintf (stderr, fmt, args); + va_end (args); + } +} + static void -lt_error_core (int exit_status, const char *mode, +lt_error_core (int exit_status, const char *file, + int line, const char *mode, const char *message, va_list ap) { - fprintf (stderr, "%s: %s: ", program_name, mode); + fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); @@ -3846,20 +4831,32 @@ lt_error_core (int exit_status, const char *mode, } void -lt_fatal (const char *message, ...) +lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); - lt_error_core (EXIT_FAILURE, "FATAL", message, ap); + lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } +static const char * +nonnull (const char *s) +{ + return s ? s : "(null)"; +} + +static const char * +nonempty (const char *s) +{ + return (s && !*s) ? "(empty)" : nonnull (s); +} + void lt_setenv (const char *name, const char *value) { - LTWRAPPER_DEBUGPRINTF (("(lt_setenv) setting '%s' to '%s'\n", - (name ? name : ""), - (value ? value : ""))); + lt_debugprintf (__FILE__, __LINE__, + "(lt_setenv) setting '%s' to '%s'\n", + nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ @@ -3904,95 +4901,12 @@ lt_extend_str (const char *orig_value, const char *add, int to_end) return new_value; } -int -lt_split_name_value (const char *arg, char** name, char** value) -{ - const char *p; - int len; - if (!arg || !*arg) - return 1; - - p = strchr (arg, (int)'='); - - if (!p) - return 1; - - *value = xstrdup (++p); - - len = strlen (arg) - strlen (*value); - *name = XMALLOC (char, len); - strncpy (*name, arg, len-1); - (*name)[len - 1] = '\0'; - - return 0; -} - -void -lt_opt_process_env_set (const char *arg) -{ - char *name = NULL; - char *value = NULL; - - if (lt_split_name_value (arg, &name, &value) != 0) - { - XFREE (name); - XFREE (value); - lt_fatal ("bad argument for %s: '%s'", env_set_opt, arg); - } - - lt_setenv (name, value); - XFREE (name); - XFREE (value); -} - -void -lt_opt_process_env_prepend (const char *arg) -{ - char *name = NULL; - char *value = NULL; - char *new_value = NULL; - - if (lt_split_name_value (arg, &name, &value) != 0) - { - XFREE (name); - XFREE (value); - lt_fatal ("bad argument for %s: '%s'", env_prepend_opt, arg); - } - - new_value = lt_extend_str (getenv (name), value, 0); - lt_setenv (name, new_value); - XFREE (new_value); - XFREE (name); - XFREE (value); -} - -void -lt_opt_process_env_append (const char *arg) -{ - char *name = NULL; - char *value = NULL; - char *new_value = NULL; - - if (lt_split_name_value (arg, &name, &value) != 0) - { - XFREE (name); - XFREE (value); - lt_fatal ("bad argument for %s: '%s'", env_append_opt, arg); - } - - new_value = lt_extend_str (getenv (name), value, 1); - lt_setenv (name, new_value); - XFREE (new_value); - XFREE (name); - XFREE (value); -} - void lt_update_exe_path (const char *name, const char *value) { - LTWRAPPER_DEBUGPRINTF (("(lt_update_exe_path) modifying '%s' by prepending '%s'\n", - (name ? name : ""), - (value ? value : ""))); + lt_debugprintf (__FILE__, __LINE__, + "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", + nonnull (name), nonnull (value)); if (name && *name && value && *value) { @@ -4011,9 +4925,9 @@ lt_update_exe_path (const char *name, const char *value) void lt_update_lib_path (const char *name, const char *value) { - LTWRAPPER_DEBUGPRINTF (("(lt_update_lib_path) modifying '%s' by prepending '%s'\n", - (name ? name : ""), - (value ? value : ""))); + lt_debugprintf (__FILE__, __LINE__, + "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", + nonnull (name), nonnull (value)); if (name && *name && value && *value) { @@ -4023,11 +4937,158 @@ lt_update_lib_path (const char *name, const char *value) } } +EOF + case $host_os in + mingw*) + cat <<"EOF" +/* Prepares an argument vector before calling spawn(). + Note that spawn() does not by itself call the command interpreter + (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : + ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + GetVersionEx(&v); + v.dwPlatformId == VER_PLATFORM_WIN32_NT; + }) ? "cmd.exe" : "command.com"). + Instead it simply concatenates the arguments, separated by ' ', and calls + CreateProcess(). We must quote the arguments since Win32 CreateProcess() + interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a + special way: + - Space and tab are interpreted as delimiters. They are not treated as + delimiters if they are surrounded by double quotes: "...". + - Unescaped double quotes are removed from the input. Their only effect is + that within double quotes, space and tab are treated like normal + characters. + - Backslashes not followed by double quotes are not special. + - But 2*n+1 backslashes followed by a double quote become + n backslashes followed by a double quote (n >= 0): + \" -> " + \\\" -> \" + \\\\\" -> \\" + */ +#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" +#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" +char ** +prepare_spawn (char **argv) +{ + size_t argc; + char **new_argv; + size_t i; + + /* Count number of arguments. */ + for (argc = 0; argv[argc] != NULL; argc++) + ; + + /* Allocate new argument vector. */ + new_argv = XMALLOC (char *, argc + 1); + + /* Put quoted arguments into the new argument vector. */ + for (i = 0; i < argc; i++) + { + const char *string = argv[i]; + + if (string[0] == '\0') + new_argv[i] = xstrdup ("\"\""); + else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) + { + int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); + size_t length; + unsigned int backslashes; + const char *s; + char *quoted_string; + char *p; + + length = 0; + backslashes = 0; + if (quote_around) + length++; + for (s = string; *s != '\0'; s++) + { + char c = *s; + if (c == '"') + length += backslashes + 1; + length++; + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + length += backslashes + 1; + + quoted_string = XMALLOC (char, length + 1); + + p = quoted_string; + backslashes = 0; + if (quote_around) + *p++ = '"'; + for (s = string; *s != '\0'; s++) + { + char c = *s; + if (c == '"') + { + unsigned int j; + for (j = backslashes + 1; j > 0; j--) + *p++ = '\\'; + } + *p++ = c; + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + { + unsigned int j; + for (j = backslashes; j > 0; j--) + *p++ = '\\'; + *p++ = '"'; + } + *p = '\0'; + + new_argv[i] = quoted_string; + } + else + new_argv[i] = (char *) string; + } + new_argv[argc] = NULL; + + return new_argv; +} +EOF + ;; + esac + + cat <<"EOF" +void lt_dump_script (FILE* f) +{ +EOF + func_emit_wrapper yes | + $SED -n -e ' +s/^\(.\{79\}\)\(..*\)/\1\ +\2/ +h +s/\([\\"]\)/\\\1/g +s/$/\\n/ +s/\([^\n]*\).*/ fputs ("\1", f);/p +g +D' + cat <<"EOF" +} EOF } # end: func_emit_cwrapperexe_src +# func_win32_import_lib_p ARG +# True if ARG is an import lib, as indicated by $file_magic_cmd +func_win32_import_lib_p () +{ + $opt_debug + case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in + *import*) : ;; + *) false ;; + esac +} + # func_mode_link arg... func_mode_link () { @@ -4072,6 +5133,7 @@ func_mode_link () new_inherited_linker_flags= avoid_version=no + bindir= dlfiles= dlprefiles= dlself=no @@ -4164,6 +5226,11 @@ func_mode_link () esac case $prev in + bindir) + bindir="$arg" + prev= + continue + ;; dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. @@ -4195,9 +5262,9 @@ func_mode_link () ;; *) if test "$prev" = dlfiles; then - dlfiles="$dlfiles $arg" + func_append dlfiles " $arg" else - dlprefiles="$dlprefiles $arg" + func_append dlprefiles " $arg" fi prev= continue @@ -4221,7 +5288,7 @@ func_mode_link () *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; - *) deplibs="$deplibs $qarg.ltframework" # this is fixed later + *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; @@ -4240,7 +5307,7 @@ func_mode_link () moreargs= for fil in `cat "$save_arg"` do -# moreargs="$moreargs $fil" +# func_append moreargs " $fil" arg=$fil # A libtool-controlled object. @@ -4269,7 +5336,7 @@ func_mode_link () if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then - dlfiles="$dlfiles $pic_object" + func_append dlfiles " $pic_object" prev= continue else @@ -4281,7 +5348,7 @@ func_mode_link () # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. - dlprefiles="$dlprefiles $pic_object" + func_append dlprefiles " $pic_object" prev= fi @@ -4351,12 +5418,12 @@ func_mode_link () if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; - *) rpath="$rpath $arg" ;; + *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; - *) xrpath="$xrpath $arg" ;; + *) func_append xrpath " $arg" ;; esac fi prev= @@ -4368,28 +5435,28 @@ func_mode_link () continue ;; weak) - weak_libs="$weak_libs $arg" + func_append weak_libs " $arg" prev= continue ;; xcclinker) - linker_flags="$linker_flags $qarg" - compiler_flags="$compiler_flags $qarg" + func_append linker_flags " $qarg" + func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) - compiler_flags="$compiler_flags $qarg" + func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) - linker_flags="$linker_flags $qarg" - compiler_flags="$compiler_flags $wl$qarg" + func_append linker_flags " $qarg" + func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" @@ -4425,6 +5492,11 @@ func_mode_link () continue ;; + -bindir) + prev=bindir + continue + ;; + -dlopen) prev=dlfiles continue @@ -4475,15 +5547,16 @@ func_mode_link () ;; -L*) - func_stripname '-L' '' "$arg" - dir=$func_stripname_result - if test -z "$dir"; then + func_stripname "-L" '' "$arg" + if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between \`-L' and \`$1'" else func_fatal_error "need path for \`-L' option" fi fi + func_resolve_sysroot "$func_stripname_result" + dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; @@ -4495,24 +5568,30 @@ func_mode_link () ;; esac case "$deplibs " in - *" -L$dir "*) ;; + *" -L$dir "* | *" $arg "*) + # Will only happen for absolute or sysroot arguments + ;; *) - deplibs="$deplibs -L$dir" - lib_search_path="$lib_search_path $dir" + # Preserve sysroot, but never include relative directories + case $dir in + [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; + *) func_append deplibs " -L$dir" ;; + esac + func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) - testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'` + testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; - *) dllsearchpath="$dllsearchpath:$dir";; + *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; - *) dllsearchpath="$dllsearchpath:$testbindir";; + *) func_append dllsearchpath ":$testbindir";; esac ;; esac @@ -4522,7 +5601,7 @@ func_mode_link () -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc*) + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; @@ -4536,7 +5615,7 @@ func_mode_link () ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework - deplibs="$deplibs System.ltframework" + func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) @@ -4556,7 +5635,7 @@ func_mode_link () ;; esac fi - deplibs="$deplibs $arg" + func_append deplibs " $arg" continue ;; @@ -4568,21 +5647,22 @@ func_mode_link () # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. - -model|-arch|-isysroot) - compiler_flags="$compiler_flags $arg" + -model|-arch|-isysroot|--sysroot) + func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) - compiler_flags="$compiler_flags $arg" + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ + |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) + func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; - * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;; + * ) func_append new_inherited_linker_flags " $arg" ;; esac continue ;; @@ -4649,13 +5729,17 @@ func_mode_link () # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; + =*) + func_stripname '=' '' "$dir" + dir=$lt_sysroot$func_stripname_result + ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; - *) xrpath="$xrpath $dir" ;; + *) func_append xrpath " $dir" ;; esac continue ;; @@ -4708,8 +5792,8 @@ func_mode_link () for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" - arg="$arg $wl$func_quote_for_eval_result" - compiler_flags="$compiler_flags $func_quote_for_eval_result" + func_append arg " $func_quote_for_eval_result" + func_append compiler_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" @@ -4724,9 +5808,9 @@ func_mode_link () for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" - arg="$arg $wl$func_quote_for_eval_result" - compiler_flags="$compiler_flags $wl$func_quote_for_eval_result" - linker_flags="$linker_flags $func_quote_for_eval_result" + func_append arg " $wl$func_quote_for_eval_result" + func_append compiler_flags " $wl$func_quote_for_eval_result" + func_append linker_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" @@ -4754,23 +5838,27 @@ func_mode_link () arg="$func_quote_for_eval_result" ;; - # -64, -mips[0-9] enable 64-bit mode on the SGI compiler - # -r[0-9][0-9]* specifies the processor on the SGI compiler - # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler - # +DA*, +DD* enable 64-bit mode on the HP compiler - # -q* pass through compiler args for the IBM compiler - # -m*, -t[45]*, -txscale* pass through architecture-specific - # compiler args for GCC - # -F/path gives path to uninstalled frameworks, gcc on darwin - # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC - # @file GCC response files + # Flags to be passed through unchanged, with rationale: + # -64, -mips[0-9] enable 64-bit mode for the SGI compiler + # -r[0-9][0-9]* specify processor for the SGI compiler + # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler + # +DA*, +DD* enable 64-bit mode for the HP compiler + # -q* compiler args for the IBM compiler + # -m*, -t[45]*, -txscale* architecture-specific flags for GCC + # -F/path path to uninstalled frameworks, gcc on darwin + # -p, -pg, --coverage, -fprofile-* profiling flags for GCC + # @file GCC response files + # -tp=* Portland pgcc target processor selection + # --sysroot=* for sysroot support + # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ - -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*) + -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ + -O*|-flto*|-fwhopr*|-fuse-linker-plugin) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" func_append compile_command " $arg" func_append finalize_command " $arg" - compiler_flags="$compiler_flags $arg" + func_append compiler_flags " $arg" continue ;; @@ -4782,7 +5870,7 @@ func_mode_link () *.$objext) # A standard object. - objs="$objs $arg" + func_append objs " $arg" ;; *.lo) @@ -4813,7 +5901,7 @@ func_mode_link () if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then - dlfiles="$dlfiles $pic_object" + func_append dlfiles " $pic_object" prev= continue else @@ -4825,7 +5913,7 @@ func_mode_link () # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. - dlprefiles="$dlprefiles $pic_object" + func_append dlprefiles " $pic_object" prev= fi @@ -4870,24 +5958,25 @@ func_mode_link () *.$libext) # An archive. - deplibs="$deplibs $arg" - old_deplibs="$old_deplibs $arg" + func_append deplibs " $arg" + func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. + func_resolve_sysroot "$arg" if test "$prev" = dlfiles; then # This library was specified with -dlopen. - dlfiles="$dlfiles $arg" + func_append dlfiles " $func_resolve_sysroot_result" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. - dlprefiles="$dlprefiles $arg" + func_append dlprefiles " $func_resolve_sysroot_result" prev= else - deplibs="$deplibs $arg" + func_append deplibs " $func_resolve_sysroot_result" fi continue ;; @@ -4925,7 +6014,7 @@ func_mode_link () if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var - eval shlib_search_path=\`\$ECHO \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` + eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi @@ -4934,6 +6023,8 @@ func_mode_link () func_dirname "$output" "/" "" output_objdir="$func_dirname_result$objdir" + func_to_tool_file "$output_objdir/" + tool_output_objdir=$func_to_tool_file_result # Create the object directory. func_mkdir_p "$output_objdir" @@ -4954,12 +6045,12 @@ func_mode_link () # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do - if $opt_duplicate_deps ; then + if $opt_preserve_dup_deps ; then case "$libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi - libs="$libs $deplib" + func_append libs " $deplib" done if test "$linkmode" = lib; then @@ -4972,9 +6063,9 @@ func_mode_link () if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in - *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; + *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; esac - pre_post_deps="$pre_post_deps $pre_post_dep" + func_append pre_post_deps " $pre_post_dep" done fi pre_post_deps= @@ -5041,17 +6132,19 @@ func_mode_link () for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= + func_resolve_sysroot "$lib" case $lib in - *.la) func_source "$lib" ;; + *.la) func_source "$func_resolve_sysroot_result" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do - deplib_base=`$ECHO "X$deplib" | $Xsed -e "$basename"` + func_basename "$deplib" + deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; - *) deplibs="$deplibs $deplib" ;; + *) func_append deplibs " $deplib" ;; esac done done @@ -5067,16 +6160,17 @@ func_mode_link () lib= found=no case $deplib in - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ + |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else - compiler_flags="$compiler_flags $deplib" + func_append compiler_flags " $deplib" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; - * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;; + * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi @@ -5161,7 +6255,7 @@ func_mode_link () if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; - * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;; + * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi @@ -5174,7 +6268,8 @@ func_mode_link () test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" - newlib_search_path="$newlib_search_path $func_stripname_result" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) if test "$pass" = conv; then @@ -5188,7 +6283,8 @@ func_mode_link () finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" - newlib_search_path="$newlib_search_path $func_stripname_result" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "\`-L' is ignored for archives/objects" @@ -5199,17 +6295,21 @@ func_mode_link () -R*) if test "$pass" = link; then func_stripname '-R' '' "$deplib" - dir=$func_stripname_result + func_resolve_sysroot "$func_stripname_result" + dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; - *) xrpath="$xrpath $dir" ;; + *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; - *.la) lib="$deplib" ;; + *.la) + func_resolve_sysroot "$deplib" + lib=$func_resolve_sysroot_result + ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" @@ -5227,7 +6327,7 @@ func_mode_link () match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` - if eval "\$ECHO \"X$deplib\"" 2>/dev/null | $Xsed -e 10q \ + if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi @@ -5237,15 +6337,15 @@ func_mode_link () ;; esac if test "$valid_a_lib" != yes; then - $ECHO + echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." - $ECHO "*** I have the capability to make that library automatically link in when" - $ECHO "*** you link to this library. But I can only do this if you have a" - $ECHO "*** shared version of the library, which you do not appear to have" - $ECHO "*** because the file extensions .$libext of this argument makes me believe" - $ECHO "*** that it is just a static archive that I should not use here." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because the file extensions .$libext of this argument makes me believe" + echo "*** that it is just a static archive that I should not use here." else - $ECHO + echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" @@ -5272,11 +6372,11 @@ func_mode_link () if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. - newdlprefiles="$newdlprefiles $deplib" + func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else - newdlfiles="$newdlfiles $deplib" + func_append newdlfiles " $deplib" fi fi continue @@ -5318,20 +6418,20 @@ func_mode_link () # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then - tmp_inherited_linker_flags=`$ECHO "X$inherited_linker_flags" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'` + tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; - *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";; + *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac done fi - dependency_libs=`$ECHO "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` + dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then - test -n "$dlopen" && dlfiles="$dlfiles $dlopen" - test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" + test -n "$dlopen" && func_append dlfiles " $dlopen" + test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test "$pass" = conv; then @@ -5342,20 +6442,20 @@ func_mode_link () func_fatal_error "cannot find name of link library for \`$lib'" fi # It is a libtool convenience library, so add in its objects. - convenience="$convenience $ladir/$objdir/$old_library" - old_convenience="$old_convenience $ladir/$objdir/$old_library" + func_append convenience " $ladir/$objdir/$old_library" + func_append old_convenience " $ladir/$objdir/$old_library" elif test "$linkmode" != prog && test "$linkmode" != lib; then func_fatal_error "\`$lib' is not a convenience library" fi tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" - if $opt_duplicate_deps ; then + if $opt_preserve_dup_deps ; then case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi - tmp_libs="$tmp_libs $deplib" + func_append tmp_libs " $deplib" done continue fi # $pass = conv @@ -5363,9 +6463,15 @@ func_mode_link () # Get the name of the library we link against. linklib= - for l in $old_library $library_names; do - linklib="$l" - done + if test -n "$old_library" && + { test "$prefer_static_libs" = yes || + test "$prefer_static_libs,$installed" = "built,no"; }; then + linklib=$old_library + else + for l in $old_library $library_names; do + linklib="$l" + done + fi if test -z "$linklib"; then func_fatal_error "cannot find name of link library for \`$lib'" fi @@ -5382,9 +6488,9 @@ func_mode_link () # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. - dlprefiles="$dlprefiles $lib $dependency_libs" + func_append dlprefiles " $lib $dependency_libs" else - newdlfiles="$newdlfiles $lib" + func_append newdlfiles " $lib" fi continue fi # $pass = dlopen @@ -5406,14 +6512,14 @@ func_mode_link () # Find the relevant object directory and library name. if test "X$installed" = Xyes; then - if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then + if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library \`$lib' was moved." dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else - dir="$libdir" - absdir="$libdir" + dir="$lt_sysroot$libdir" + absdir="$lt_sysroot$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else @@ -5421,12 +6527,12 @@ func_mode_link () dir="$ladir" absdir="$abs_ladir" # Remove this search path later - notinst_path="$notinst_path $abs_ladir" + func_append notinst_path " $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later - notinst_path="$notinst_path $abs_ladir" + func_append notinst_path " $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" @@ -5437,20 +6543,46 @@ func_mode_link () if test -z "$libdir" && test "$linkmode" = prog; then func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" fi - # Prefer using a static library (so that no silly _DYNAMIC symbols - # are required to link). - if test -n "$old_library"; then - newdlprefiles="$newdlprefiles $dir/$old_library" - # Keep a list of preopened convenience libraries to check - # that they are being used correctly in the link pass. - test -z "$libdir" && \ - dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library" - # Otherwise, use the dlname, so that lt_dlopen finds it. - elif test -n "$dlname"; then - newdlprefiles="$newdlprefiles $dir/$dlname" - else - newdlprefiles="$newdlprefiles $dir/$linklib" - fi + case "$host" in + # special handling for platforms with PE-DLLs. + *cygwin* | *mingw* | *cegcc* ) + # Linker will automatically link against shared library if both + # static and shared are present. Therefore, ensure we extract + # symbols from the import library if a shared library is present + # (otherwise, the dlopen module name will be incorrect). We do + # this by putting the import library name into $newdlprefiles. + # We recover the dlopen module name by 'saving' the la file + # name in a special purpose variable, and (later) extracting the + # dlname from the la file. + if test -n "$dlname"; then + func_tr_sh "$dir/$linklib" + eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" + func_append newdlprefiles " $dir/$linklib" + else + func_append newdlprefiles " $dir/$old_library" + # Keep a list of preopened convenience libraries to check + # that they are being used correctly in the link pass. + test -z "$libdir" && \ + func_append dlpreconveniencelibs " $dir/$old_library" + fi + ;; + * ) + # Prefer using a static library (so that no silly _DYNAMIC symbols + # are required to link). + if test -n "$old_library"; then + func_append newdlprefiles " $dir/$old_library" + # Keep a list of preopened convenience libraries to check + # that they are being used correctly in the link pass. + test -z "$libdir" && \ + func_append dlpreconveniencelibs " $dir/$old_library" + # Otherwise, use the dlname, so that lt_dlopen finds it. + elif test -n "$dlname"; then + func_append newdlprefiles " $dir/$dlname" + else + func_append newdlprefiles " $dir/$linklib" + fi + ;; + esac fi # $pass = dlpreopen if test -z "$libdir"; then @@ -5468,7 +6600,7 @@ func_mode_link () if test "$linkmode" = prog && test "$pass" != link; then - newlib_search_path="$newlib_search_path $ladir" + func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=no @@ -5481,7 +6613,8 @@ func_mode_link () for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" - newlib_search_path="$newlib_search_path $func_stripname_result" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" ;; esac # Need to link against all dependency_libs? @@ -5492,12 +6625,12 @@ func_mode_link () # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi - if $opt_duplicate_deps ; then + if $opt_preserve_dup_deps ; then case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi - tmp_libs="$tmp_libs $deplib" + func_append tmp_libs " $deplib" done # for deplib continue fi # $linkmode = prog... @@ -5512,7 +6645,7 @@ func_mode_link () # Make sure the rpath contains only unique directories. case "$temp_rpath:" in *"$absdir:"*) ;; - *) temp_rpath="$temp_rpath$absdir:" ;; + *) func_append temp_rpath "$absdir:" ;; esac fi @@ -5524,7 +6657,7 @@ func_mode_link () *) case "$compile_rpath " in *" $absdir "*) ;; - *) compile_rpath="$compile_rpath $absdir" + *) func_append compile_rpath " $absdir" ;; esac ;; esac @@ -5533,7 +6666,7 @@ func_mode_link () *) case "$finalize_rpath " in *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" + *) func_append finalize_rpath " $libdir" ;; esac ;; esac @@ -5558,12 +6691,12 @@ func_mode_link () case $host in *cygwin* | *mingw* | *cegcc*) # No point in relinking DLLs because paths are not encoded - notinst_deplibs="$notinst_deplibs $lib" + func_append notinst_deplibs " $lib" need_relink=no ;; *) if test "$installed" = no; then - notinst_deplibs="$notinst_deplibs $lib" + func_append notinst_deplibs " $lib" need_relink=yes fi ;; @@ -5580,7 +6713,7 @@ func_mode_link () fi done if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then - $ECHO + echo if test "$linkmode" = prog; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else @@ -5598,7 +6731,7 @@ func_mode_link () *) case "$compile_rpath " in *" $absdir "*) ;; - *) compile_rpath="$compile_rpath $absdir" + *) func_append compile_rpath " $absdir" ;; esac ;; esac @@ -5607,7 +6740,7 @@ func_mode_link () *) case "$finalize_rpath " in *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" + *) func_append finalize_rpath " $libdir" ;; esac ;; esac @@ -5661,7 +6794,7 @@ func_mode_link () linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" - if test "$linkmode" = prog || test "$mode" != relink; then + if test "$linkmode" = prog || test "$opt_mode" != relink; then add_shlibpath= add_dir= add= @@ -5683,9 +6816,9 @@ func_mode_link () if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library" ; then - $ECHO - $ECHO "*** And there doesn't seem to be a static archive available" - $ECHO "*** The link will probably fail, sorry" + echo + echo "*** And there doesn't seem to be a static archive available" + echo "*** The link will probably fail, sorry" else add="$dir/$old_library" fi @@ -5712,12 +6845,12 @@ func_mode_link () test "$hardcode_direct_absolute" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then - add_dir="-L$dir" + add_dir="-L$absdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) - add_dir="$add_dir -L$inst_prefix_dir$libdir" + func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi @@ -5739,7 +6872,7 @@ func_mode_link () if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; - *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; + *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then @@ -5753,13 +6886,13 @@ func_mode_link () test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; - *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; + *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi - if test "$linkmode" = prog || test "$mode" = relink; then + if test "$linkmode" = prog || test "$opt_mode" = relink; then add_shlibpath= add_dir= add= @@ -5773,7 +6906,7 @@ func_mode_link () elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; - *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; + *) func_append finalize_shlibpath "$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then @@ -5790,7 +6923,7 @@ func_mode_link () if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) - add_dir="$add_dir -L$inst_prefix_dir$libdir" + func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi @@ -5825,21 +6958,21 @@ func_mode_link () # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. - $ECHO + echo $ECHO "*** Warning: This system can not link to static lib archive $lib." - $ECHO "*** I have the capability to make that library automatically link in when" - $ECHO "*** you link to this library. But I can only do this if you have a" - $ECHO "*** shared version of the library, which you do not appear to have." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then - $ECHO "*** But as you try to build a module library, libtool will still create " - $ECHO "*** a static module, that should work as long as the dlopening application" - $ECHO "*** is linked with the -dlopen flag to resolve symbols at runtime." + echo "*** But as you try to build a module library, libtool will still create " + echo "*** a static module, that should work as long as the dlopening application" + echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then - $ECHO - $ECHO "*** However, this would only work if libtool was able to extract symbol" - $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could" - $ECHO "*** not find such a program. So, this module is probably useless." - $ECHO "*** \`nm' from GNU binutils and a full rebuild may help." + echo + echo "*** However, this would only work if libtool was able to extract symbol" + echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + echo "*** not find such a program. So, this module is probably useless." + echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module @@ -5867,37 +7000,46 @@ func_mode_link () temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; - *) xrpath="$xrpath $temp_xrpath";; + *) func_append xrpath " $temp_xrpath";; esac;; - *) temp_deplibs="$temp_deplibs $libdir";; + *) func_append temp_deplibs " $libdir";; esac done dependency_libs="$temp_deplibs" fi - newlib_search_path="$newlib_search_path $absdir" + func_append newlib_search_path " $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" - if $opt_duplicate_deps ; then + case $deplib in + -L*) func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result";; + *) func_resolve_sysroot "$deplib" ;; + esac + if $opt_preserve_dup_deps ; then case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + *" $func_resolve_sysroot_result "*) + func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi - tmp_libs="$tmp_libs $deplib" + func_append tmp_libs " $func_resolve_sysroot_result" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do + path= case $deplib in -L*) path="$deplib" ;; *.la) + func_resolve_sysroot "$deplib" + deplib=$func_resolve_sysroot_result func_dirname "$deplib" "" "." - dir="$func_dirname_result" + dir=$func_dirname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; @@ -5924,8 +7066,8 @@ func_mode_link () if test -z "$darwin_install_name"; then darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi - compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" - linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}" + func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" + func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" path= fi fi @@ -5958,7 +7100,7 @@ func_mode_link () compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else - compiler_flags="$compiler_flags "`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` + compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs="$newdependency_libs" @@ -5975,7 +7117,7 @@ func_mode_link () for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; - *) lib_search_path="$lib_search_path $dir" ;; + *) func_append lib_search_path " $dir" ;; esac done newlib_search_path= @@ -6033,10 +7175,10 @@ func_mode_link () -L*) case " $tmp_libs " in *" $deplib "*) ;; - *) tmp_libs="$tmp_libs $deplib" ;; + *) func_append tmp_libs " $deplib" ;; esac ;; - *) tmp_libs="$tmp_libs $deplib" ;; + *) func_append tmp_libs " $deplib" ;; esac done eval $var=\"$tmp_libs\" @@ -6052,7 +7194,7 @@ func_mode_link () ;; esac if test -n "$i" ; then - tmp_libs="$tmp_libs $i" + func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs @@ -6093,7 +7235,7 @@ func_mode_link () # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" - objs="$objs$old_deplibs" + func_append objs "$old_deplibs" ;; lib) @@ -6126,10 +7268,10 @@ func_mode_link () if test "$deplibs_check_method" != pass_all; then func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" else - $ECHO + echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" - libobjs="$libobjs $objs" + func_append libobjs " $objs" fi fi @@ -6188,13 +7330,14 @@ func_mode_link () # which has an extra 1 added just for fun # case $version_type in + # correct linux to gnu/linux during the next big refactor darwin|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_revision" ;; - freebsd-aout|freebsd-elf|sunos) + freebsd-aout|freebsd-elf|qnx|sunos) current="$number_major" revision="$number_minor" age="0" @@ -6304,7 +7447,7 @@ func_mode_link () versuffix="$major.$revision" ;; - linux) + linux) # correct to gnu/linux during the next big refactor func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" @@ -6327,7 +7470,7 @@ func_mode_link () done # Make executables depend on our current version. - verstring="$verstring:${current}.0" + func_append verstring ":${current}.0" ;; qnx) @@ -6395,10 +7538,10 @@ func_mode_link () fi func_generate_dlsyms "$libname" "$libname" "yes" - libobjs="$libobjs $symfileobj" + func_append libobjs " $symfileobj" test "X$libobjs" = "X " && libobjs= - if test "$mode" != relink; then + if test "$opt_mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= @@ -6414,7 +7557,7 @@ func_mode_link () continue fi fi - removelist="$removelist $p" + func_append removelist " $p" ;; *) ;; esac @@ -6425,27 +7568,28 @@ func_mode_link () # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then - oldlibs="$oldlibs $output_objdir/$libname.$libext" + func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. - oldobjs="$objs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` + oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do - # lib_search_path=`$ECHO "X$lib_search_path " | $Xsed -e "s% $path % %g"` - # deplibs=`$ECHO "X$deplibs " | $Xsed -e "s% -L$path % %g"` - # dependency_libs=`$ECHO "X$dependency_libs " | $Xsed -e "s% -L$path % %g"` + # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` + # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` + # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do - temp_xrpath="$temp_xrpath -R$libdir" + func_replace_sysroot "$libdir" + func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" ;; + *) func_append finalize_rpath " $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then @@ -6459,7 +7603,7 @@ func_mode_link () for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; - *) dlfiles="$dlfiles $lib" ;; + *) func_append dlfiles " $lib" ;; esac done @@ -6469,19 +7613,19 @@ func_mode_link () for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; - *) dlprefiles="$dlprefiles $lib" ;; + *) func_append dlprefiles " $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc*) + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework - deplibs="$deplibs System.ltframework" + func_append deplibs " System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. @@ -6498,7 +7642,7 @@ func_mode_link () *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then - deplibs="$deplibs -lc" + func_append deplibs " -lc" fi ;; esac @@ -6547,7 +7691,7 @@ EOF if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $i "*) - newdeplibs="$newdeplibs $i" + func_append newdeplibs " $i" i="" ;; esac @@ -6558,21 +7702,21 @@ EOF set dummy $deplib_matches; shift deplib_match=$1 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then - newdeplibs="$newdeplibs $i" + func_append newdeplibs " $i" else droppeddeps=yes - $ECHO + echo $ECHO "*** Warning: dynamic linker does not accept needed library $i." - $ECHO "*** I have the capability to make that library automatically link in when" - $ECHO "*** you link to this library. But I can only do this if you have a" - $ECHO "*** shared version of the library, which I believe you do not have" - $ECHO "*** because a test_compile did reveal that the linker did not use it for" - $ECHO "*** its dynamic dependency list that programs get resolved with at runtime." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which I believe you do not have" + echo "*** because a test_compile did reveal that the linker did not use it for" + echo "*** its dynamic dependency list that programs get resolved with at runtime." fi fi ;; *) - newdeplibs="$newdeplibs $i" + func_append newdeplibs " $i" ;; esac done @@ -6590,7 +7734,7 @@ EOF if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $i "*) - newdeplibs="$newdeplibs $i" + func_append newdeplibs " $i" i="" ;; esac @@ -6601,29 +7745,29 @@ EOF set dummy $deplib_matches; shift deplib_match=$1 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then - newdeplibs="$newdeplibs $i" + func_append newdeplibs " $i" else droppeddeps=yes - $ECHO + echo $ECHO "*** Warning: dynamic linker does not accept needed library $i." - $ECHO "*** I have the capability to make that library automatically link in when" - $ECHO "*** you link to this library. But I can only do this if you have a" - $ECHO "*** shared version of the library, which you do not appear to have" - $ECHO "*** because a test_compile did reveal that the linker did not use this one" - $ECHO "*** as a dynamic dependency that programs can get resolved with at runtime." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because a test_compile did reveal that the linker did not use this one" + echo "*** as a dynamic dependency that programs can get resolved with at runtime." fi fi else droppeddeps=yes - $ECHO + echo $ECHO "*** Warning! Library $i is needed by this library but I was not able to" - $ECHO "*** make it link in! You will probably need to install it or some" - $ECHO "*** library that it depends on before this library will be fully" - $ECHO "*** functional. Installing it before continuing would be even better." + echo "*** make it link in! You will probably need to install it or some" + echo "*** library that it depends on before this library will be fully" + echo "*** functional. Installing it before continuing would be even better." fi ;; *) - newdeplibs="$newdeplibs $i" + func_append newdeplibs " $i" ;; esac done @@ -6640,15 +7784,27 @@ EOF if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) - newdeplibs="$newdeplibs $a_deplib" + func_append newdeplibs " $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval "\\$ECHO \"$libname_spec\""` + if test -n "$file_magic_glob"; then + libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob` + else + libnameglob=$libname + fi + test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do - potential_libs=`ls $i/$libname[.-]* 2>/dev/null` + if test "$want_nocaseglob" = yes; then + shopt -s nocaseglob + potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` + $nocaseglob + else + potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` + fi for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | @@ -6665,13 +7821,13 @@ EOF potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; - *) potlib=`$ECHO "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; + *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then - newdeplibs="$newdeplibs $a_deplib" + func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi @@ -6680,12 +7836,12 @@ EOF fi if test -n "$a_deplib" ; then droppeddeps=yes - $ECHO + echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." - $ECHO "*** I have the capability to make that library automatically link in when" - $ECHO "*** you link to this library. But I can only do this if you have a" - $ECHO "*** shared version of the library, which you do not appear to have" - $ECHO "*** because I did check the linker path looking for a file starting" + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else @@ -6696,7 +7852,7 @@ EOF ;; *) # Add a -L argument. - newdeplibs="$newdeplibs $a_deplib" + func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. @@ -6712,7 +7868,7 @@ EOF if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) - newdeplibs="$newdeplibs $a_deplib" + func_append newdeplibs " $a_deplib" a_deplib="" ;; esac @@ -6723,9 +7879,9 @@ EOF potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test - if eval "\$ECHO \"X$potent_lib\"" 2>/dev/null | $Xsed -e 10q | \ + if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then - newdeplibs="$newdeplibs $a_deplib" + func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi @@ -6734,12 +7890,12 @@ EOF fi if test -n "$a_deplib" ; then droppeddeps=yes - $ECHO + echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." - $ECHO "*** I have the capability to make that library automatically link in when" - $ECHO "*** you link to this library. But I can only do this if you have a" - $ECHO "*** shared version of the library, which you do not appear to have" - $ECHO "*** because I did check the linker path looking for a file starting" + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else @@ -6750,32 +7906,32 @@ EOF ;; *) # Add a -L argument. - newdeplibs="$newdeplibs $a_deplib" + func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" - tmp_deplibs=`$ECHO "X $deplibs" | $Xsed \ - -e 's/ -lc$//' -e 's/ -[LR][^ ]*//g'` + tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' - tmp_deplibs=`$ECHO "X $tmp_deplibs" | $Xsed -e "s,$i,,"` + tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` done fi - if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' | - $GREP . >/dev/null; then - $ECHO + case $tmp_deplibs in + *[!\ \ ]*) + echo if test "X$deplibs_check_method" = "Xnone"; then - $ECHO "*** Warning: inter-library dependencies are not supported in this platform." + echo "*** Warning: inter-library dependencies are not supported in this platform." else - $ECHO "*** Warning: inter-library dependencies are not known to be supported." + echo "*** Warning: inter-library dependencies are not known to be supported." fi - $ECHO "*** All declared inter-library dependencies are being dropped." + echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes - fi + ;; + esac ;; esac versuffix=$versuffix_save @@ -6787,23 +7943,23 @@ EOF case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework - newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'` + newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then - $ECHO - $ECHO "*** Warning: libtool could not satisfy all declared inter-library" + echo + echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" - $ECHO "*** a static module, that should work as long as the dlopening" - $ECHO "*** application is linked with the -dlopen flag." + echo "*** a static module, that should work as long as the dlopening" + echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then - $ECHO - $ECHO "*** However, this would only work if libtool was able to extract symbol" - $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could" - $ECHO "*** not find such a program. So, this module is probably useless." - $ECHO "*** \`nm' from GNU binutils and a full rebuild may help." + echo + echo "*** However, this would only work if libtool was able to extract symbol" + echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + echo "*** not find such a program. So, this module is probably useless." + echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" @@ -6813,16 +7969,16 @@ EOF build_libtool_libs=no fi else - $ECHO "*** The inter-library dependencies that have been dropped here will be" - $ECHO "*** automatically added whenever a program is linked with this library" - $ECHO "*** or is declared to -dlopen it." + echo "*** The inter-library dependencies that have been dropped here will be" + echo "*** automatically added whenever a program is linked with this library" + echo "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then - $ECHO - $ECHO "*** Since this library must not contain undefined symbols," - $ECHO "*** because either the platform does not support them or" - $ECHO "*** it was explicitly requested with -no-undefined," - $ECHO "*** libtool will only create a static version of it." + echo + echo "*** Since this library must not contain undefined symbols," + echo "*** because either the platform does not support them or" + echo "*** it was explicitly requested with -no-undefined," + echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module @@ -6839,9 +7995,9 @@ EOF # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) - newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` - new_inherited_linker_flags=`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` - deplibs=`$ECHO "X $deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` + newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac @@ -6854,7 +8010,7 @@ EOF *) case " $deplibs " in *" -L$path/$objdir "*) - new_libs="$new_libs -L$path/$objdir" ;; + func_append new_libs " -L$path/$objdir" ;; esac ;; esac @@ -6864,10 +8020,10 @@ EOF -L*) case " $new_libs " in *" $deplib "*) ;; - *) new_libs="$new_libs $deplib" ;; + *) func_append new_libs " $deplib" ;; esac ;; - *) new_libs="$new_libs $deplib" ;; + *) func_append new_libs " $deplib" ;; esac done deplibs="$new_libs" @@ -6879,15 +8035,22 @@ EOF # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then + # Remove ${wl} instances when linking with ld. + # FIXME: should test the right _cmds variable. + case $archive_cmds in + *\$LD\ *) wl= ;; + esac if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" - test "$mode" != relink && rpath="$compile_rpath$rpath" + test "$opt_mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then + func_replace_sysroot "$libdir" + libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else @@ -6896,18 +8059,18 @@ EOF *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" - dep_rpath="$dep_rpath $flag" + func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; - *) perm_rpath="$perm_rpath $libdir" ;; + *) func_append perm_rpath " $libdir" ;; esac fi done @@ -6915,17 +8078,13 @@ EOF if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" - if test -n "$hardcode_libdir_flag_spec_ld"; then - eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" - else - eval dep_rpath=\"$hardcode_libdir_flag_spec\" - fi + eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do - rpath="$rpath$dir:" + func_append rpath "$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi @@ -6933,7 +8092,7 @@ EOF fi shlibpath="$finalize_shlibpath" - test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" + test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi @@ -6959,18 +8118,18 @@ EOF linknames= for link do - linknames="$linknames $link" + func_append linknames " $link" done # Use standard objects if they are pic - test -z "$pic_flag" && libobjs=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols="$output_objdir/$libname.uexp" - delfiles="$delfiles $export_symbols" + func_append delfiles " $export_symbols" fi orig_export_symbols= @@ -7001,14 +8160,46 @@ EOF $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do + for cmd1 in $cmds; do IFS="$save_ifs" - eval cmd=\"$cmd\" - func_len " $cmd" - len=$func_len_result - if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + # Take the normal branch if the nm_file_list_spec branch + # doesn't work or if tool conversion is not needed. + case $nm_file_list_spec~$to_tool_file_cmd in + *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) + try_normal_branch=yes + eval cmd=\"$cmd1\" + func_len " $cmd" + len=$func_len_result + ;; + *) + try_normal_branch=no + ;; + esac + if test "$try_normal_branch" = yes \ + && { test "$len" -lt "$max_cmd_len" \ + || test "$max_cmd_len" -le -1; } + then func_show_eval "$cmd" 'exit $?' skipped_export=false + elif test -n "$nm_file_list_spec"; then + func_basename "$output" + output_la=$func_basename_result + save_libobjs=$libobjs + save_output=$output + output=${output_objdir}/${output_la}.nm + func_to_tool_file "$output" + libobjs=$nm_file_list_spec$func_to_tool_file_result + func_append delfiles " $output" + func_verbose "creating $NM input file list: $output" + for obj in $save_libobjs; do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" + done > "$output" + eval cmd=\"$cmd1\" + func_show_eval "$cmd" 'exit $?' + output=$save_output + libobjs=$save_libobjs + skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." @@ -7029,7 +8220,7 @@ EOF if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" - $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"' + $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then @@ -7041,7 +8232,7 @@ EOF # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter - delfiles="$delfiles $export_symbols $output_objdir/$libname.filter" + func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi @@ -7051,7 +8242,7 @@ EOF case " $convenience " in *" $test_deplib "*) ;; *) - tmp_deplibs="$tmp_deplibs $test_deplib" + func_append tmp_deplibs " $test_deplib" ;; esac done @@ -7071,21 +8262,21 @@ EOF test "X$libobjs" = "X " && libobjs= else gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" + func_append generated " $gentop" func_extract_archives $gentop $convenience - libobjs="$libobjs $func_extract_archives_result" + func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" - linker_flags="$linker_flags $flag" + func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking - if test "$mode" = relink; then + if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi @@ -7130,7 +8321,8 @@ EOF save_libobjs=$libobjs fi save_output=$output - output_la=`$ECHO "X$output" | $Xsed -e "$basename"` + func_basename "$output" + output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. @@ -7143,13 +8335,16 @@ EOF if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then output=${output_objdir}/${output_la}.lnkscript func_verbose "creating GNU ld script: $output" - $ECHO 'INPUT (' > $output + echo 'INPUT (' > $output for obj in $save_libobjs do - $ECHO "$obj" >> $output + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" >> $output done - $ECHO ')' >> $output - delfiles="$delfiles $output" + echo ')' >> $output + func_append delfiles " $output" + func_to_tool_file "$output" + output=$func_to_tool_file_result elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then output=${output_objdir}/${output_la}.lnk func_verbose "creating linker input file list: $output" @@ -7163,10 +8358,12 @@ EOF fi for obj do - $ECHO "$obj" >> $output + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" >> $output done - delfiles="$delfiles $output" - output=$firstobj\"$file_list_spec$output\" + func_append delfiles " $output" + func_to_tool_file "$output" + output=$firstobj\"$file_list_spec$func_to_tool_file_result\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." @@ -7190,17 +8387,19 @@ EOF # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. - eval concat_cmds=\"$reload_cmds $objlist $last_robj\" + reload_objs=$objlist + eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. - eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj~\$RM $last_robj\" + reload_objs="$objlist $last_robj" + eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-${k}.$objext - objlist=$obj + objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result @@ -7210,11 +8409,12 @@ EOF # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" + reload_objs="$objlist $last_robj" + eval concat_cmds=\"\${concat_cmds}$reload_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" fi - delfiles="$delfiles $output" + func_append delfiles " $output" else output= @@ -7248,7 +8448,7 @@ EOF lt_exit=$? # Restore the uninstalled library and exit - if test "$mode" = relink; then + if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) @@ -7269,7 +8469,7 @@ EOF if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" - $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"' + $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then @@ -7281,7 +8481,7 @@ EOF # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter - delfiles="$delfiles $export_symbols $output_objdir/$libname.filter" + func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi @@ -7322,10 +8522,10 @@ EOF # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" + func_append generated " $gentop" func_extract_archives $gentop $dlprefiles - libobjs="$libobjs $func_extract_archives_result" + func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi @@ -7341,7 +8541,7 @@ EOF lt_exit=$? # Restore the uninstalled library and exit - if test "$mode" = relink; then + if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) @@ -7353,7 +8553,7 @@ EOF IFS="$save_ifs" # Restore the uninstalled library and exit - if test "$mode" = relink; then + if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then @@ -7434,18 +8634,21 @@ EOF if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" - reload_conv_objs=$reload_objs\ `$ECHO "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'` + reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` else gentop="$output_objdir/${obj}x" - generated="$generated $gentop" + func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi + # If we're not building shared, we need to use non_pic_objs + test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" + # Create the old-style object. - reload_objs="$objs$old_deplibs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test + reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" func_execute_cmds "$reload_cmds" 'exit $?' @@ -7505,8 +8708,8 @@ EOF case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework - compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'` - finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'` + compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` + finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac @@ -7517,14 +8720,14 @@ EOF if test "$tagname" = CXX ; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) - compile_command="$compile_command ${wl}-bind_at_load" - finalize_command="$finalize_command ${wl}-bind_at_load" + func_append compile_command " ${wl}-bind_at_load" + func_append finalize_command " ${wl}-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" - compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` - finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` + compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac @@ -7538,7 +8741,7 @@ EOF *) case " $compile_deplibs " in *" -L$path/$objdir "*) - new_libs="$new_libs -L$path/$objdir" ;; + func_append new_libs " -L$path/$objdir" ;; esac ;; esac @@ -7548,17 +8751,17 @@ EOF -L*) case " $new_libs " in *" $deplib "*) ;; - *) new_libs="$new_libs $deplib" ;; + *) func_append new_libs " $deplib" ;; esac ;; - *) new_libs="$new_libs $deplib" ;; + *) func_append new_libs " $deplib" ;; esac done compile_deplibs="$new_libs" - compile_command="$compile_command $compile_deplibs" - finalize_command="$finalize_command $finalize_deplibs" + func_append compile_command " $compile_deplibs" + func_append finalize_command " $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. @@ -7566,7 +8769,7 @@ EOF # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" ;; + *) func_append finalize_rpath " $libdir" ;; esac done fi @@ -7585,18 +8788,18 @@ EOF *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" - rpath="$rpath $flag" + func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; - *) perm_rpath="$perm_rpath $libdir" ;; + *) func_append perm_rpath " $libdir" ;; esac fi case $host in @@ -7605,12 +8808,12 @@ EOF case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; - *) dllsearchpath="$dllsearchpath:$libdir";; + *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; - *) dllsearchpath="$dllsearchpath:$testbindir";; + *) func_append dllsearchpath ":$testbindir";; esac ;; esac @@ -7636,18 +8839,18 @@ EOF *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" - rpath="$rpath $flag" + func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; - *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; + *) func_append finalize_perm_rpath " $libdir" ;; esac fi done @@ -7661,8 +8864,8 @@ EOF if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. - compile_command=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - finalize_command=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` + finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" "no" @@ -7674,15 +8877,15 @@ EOF wrappers_required=yes case $host in + *cegcc* | *mingw32ce*) + # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. + wrappers_required=no + ;; *cygwin* | *mingw* ) if test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; - *cegcc) - # Disable wrappers for cegcc, we are cross compiling anyway. - wrappers_required=no - ;; *) if test "$need_relink" = no || test "$build_libtool_libs" != yes; then wrappers_required=no @@ -7691,13 +8894,19 @@ EOF esac if test "$wrappers_required" = no; then # Replace the output file specification. - compile_command=`$ECHO "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` + compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' + if test -n "$postlink_cmds"; then + func_to_tool_file "$output" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + # Delete the generated files. if test -f "$output_objdir/${outputname}S.${objext}"; then func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' @@ -7720,7 +8929,7 @@ EOF # We should set the runpath_var. rpath= for dir in $perm_rpath; do - rpath="$rpath$dir:" + func_append rpath "$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi @@ -7728,7 +8937,7 @@ EOF # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do - rpath="$rpath$dir:" + func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi @@ -7738,11 +8947,18 @@ EOF # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. - link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` + link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + exit $EXIT_SUCCESS fi @@ -7757,7 +8973,7 @@ EOF if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then - relink_command=`$ECHO "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` + relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= @@ -7769,13 +8985,19 @@ EOF fi # Replace the output file specification. - link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` + link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' + if test -n "$postlink_cmds"; then + func_to_tool_file "$output_objdir/$outputname" + 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'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + # Now create the wrapper script. func_verbose "creating $output" @@ -7793,18 +9015,7 @@ EOF fi done relink_command="(cd `pwd`; $relink_command)" - relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"` - fi - - # Quote $ECHO for shipping. - if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then - case $progpath in - [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; - *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; - esac - qecho=`$ECHO "X$qecho" | $Xsed -e "$sed_quote_subst"` - else - qecho=`$ECHO "X$ECHO" | $Xsed -e "$sed_quote_subst"` + relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. @@ -7884,7 +9095,7 @@ EOF else oldobjs="$old_deplibs $non_pic_objects" if test "$preload" = yes && test -f "$symfileobj"; then - oldobjs="$oldobjs $symfileobj" + func_append oldobjs " $symfileobj" fi fi addlibs="$old_convenience" @@ -7892,10 +9103,10 @@ EOF if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" + func_append generated " $gentop" func_extract_archives $gentop $addlibs - oldobjs="$oldobjs $func_extract_archives_result" + func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. @@ -7906,10 +9117,10 @@ EOF # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" + func_append generated " $gentop" func_extract_archives $gentop $dlprefiles - oldobjs="$oldobjs $func_extract_archives_result" + func_append oldobjs " $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have @@ -7925,9 +9136,9 @@ EOF done | sort | sort -uc >/dev/null 2>&1); then : else - $ECHO "copying selected object files to avoid basename conflicts..." + echo "copying selected object files to avoid basename conflicts..." gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" + func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= @@ -7951,18 +9162,30 @@ EOF esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" - oldobjs="$oldobjs $gentop/$newobj" + func_append oldobjs " $gentop/$newobj" ;; - *) oldobjs="$oldobjs $obj" ;; + *) func_append oldobjs " $obj" ;; esac done fi + func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 + tool_oldlib=$func_to_tool_file_result eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds + elif test -n "$archiver_list_spec"; then + func_verbose "using command file archive linking..." + for obj in $oldobjs + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" + done > $output_objdir/$libname.libcmd + func_to_tool_file "$output_objdir/$libname.libcmd" + oldobjs=" $archiver_list_spec$func_to_tool_file_result" + cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." @@ -8036,7 +9259,7 @@ EOF done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" - relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"` + relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi @@ -8056,12 +9279,23 @@ EOF *.la) func_basename "$deplib" name="$func_basename_result" - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + func_resolve_sysroot "$deplib" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" - newdependency_libs="$newdependency_libs $libdir/$name" + func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; - *) newdependency_libs="$newdependency_libs $deplib" ;; + -L*) + func_stripname -L '' "$deplib" + func_replace_sysroot "$func_stripname_result" + func_append newdependency_libs " -L$func_replace_sysroot_result" + ;; + -R*) + func_stripname -R '' "$deplib" + func_replace_sysroot "$func_stripname_result" + func_append newdependency_libs " -R$func_replace_sysroot_result" + ;; + *) func_append newdependency_libs " $deplib" ;; esac done dependency_libs="$newdependency_libs" @@ -8075,9 +9309,9 @@ EOF eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" - newdlfiles="$newdlfiles $libdir/$name" + func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; - *) newdlfiles="$newdlfiles $lib" ;; + *) func_append newdlfiles " $lib" ;; esac done dlfiles="$newdlfiles" @@ -8094,7 +9328,7 @@ EOF eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" - newdlprefiles="$newdlprefiles $libdir/$name" + func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done @@ -8106,7 +9340,7 @@ EOF [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac - newdlfiles="$newdlfiles $abs" + func_append newdlfiles " $abs" done dlfiles="$newdlfiles" newdlprefiles= @@ -8115,15 +9349,33 @@ EOF [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac - newdlprefiles="$newdlprefiles $abs" + func_append newdlprefiles " $abs" done dlprefiles="$newdlprefiles" fi $RM $output # place dlname in correct position for cygwin + # In fact, it would be nice if we could use this code for all target + # systems that can't hard-code library paths into their executables + # and that have no shared library path variable independent of PATH, + # but it turns out we can't easily determine that from inspecting + # libtool variables, so we have to hard-code the OSs to which it + # applies here; at the moment, that means platforms that use the PE + # object format with DLL files. See the long comment at the top of + # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in - *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; + *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) + # If a -bindir argument was supplied, place the dll there. + if test "x$bindir" != x ; + then + func_relative_path "$install_libdir" "$bindir" + tdlname=$func_relative_path_result$dlname + else + # Otherwise fall back on heuristic. + tdlname=../bin/$dlname + fi + ;; esac $ECHO > $output "\ # $outputname - a libtool library file @@ -8182,7 +9434,7 @@ relink_command=\"$relink_command\"" exit $EXIT_SUCCESS } -{ test "$mode" = link || test "$mode" = relink; } && +{ test "$opt_mode" = link || test "$opt_mode" = relink; } && func_mode_link ${1+"$@"} @@ -8202,9 +9454,9 @@ func_mode_uninstall () for arg do case $arg in - -f) RM="$RM $arg"; rmforce=yes ;; - -*) RM="$RM $arg" ;; - *) files="$files $arg" ;; + -f) func_append RM " $arg"; rmforce=yes ;; + -*) func_append RM " $arg" ;; + *) func_append files " $arg" ;; esac done @@ -8213,24 +9465,23 @@ func_mode_uninstall () rmdirs= - origobjdir="$objdir" for file in $files; do func_dirname "$file" "" "." dir="$func_dirname_result" if test "X$dir" = X.; then - objdir="$origobjdir" + odir="$objdir" else - objdir="$dir/$origobjdir" + odir="$dir/$objdir" fi func_basename "$file" name="$func_basename_result" - test "$mode" = uninstall && objdir="$dir" + test "$opt_mode" = uninstall && odir="$dir" - # Remember objdir for removal later, being careful to avoid duplicates - if test "$mode" = clean; then + # Remember odir for removal later, being careful to avoid duplicates + if test "$opt_mode" = clean; then case " $rmdirs " in - *" $objdir "*) ;; - *) rmdirs="$rmdirs $objdir" ;; + *" $odir "*) ;; + *) func_append rmdirs " $odir" ;; esac fi @@ -8256,18 +9507,17 @@ func_mode_uninstall () # Delete the libtool libraries and symlinks. for n in $library_names; do - rmfiles="$rmfiles $objdir/$n" + func_append rmfiles " $odir/$n" done - test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" + test -n "$old_library" && func_append rmfiles " $odir/$old_library" - case "$mode" in + case "$opt_mode" in clean) - case " $library_names " in - # " " in the beginning catches empty $dlname + case " $library_names " in *" $dlname "*) ;; - *) rmfiles="$rmfiles $objdir/$dlname" ;; + *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac - test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" + test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then @@ -8295,19 +9545,19 @@ func_mode_uninstall () # Add PIC object to the list of files to remove. if test -n "$pic_object" && test "$pic_object" != none; then - rmfiles="$rmfiles $dir/$pic_object" + func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test "$non_pic_object" != none; then - rmfiles="$rmfiles $dir/$non_pic_object" + func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) - if test "$mode" = clean ; then + if test "$opt_mode" = clean ; then noexename=$name case $file in *.exe) @@ -8317,7 +9567,7 @@ func_mode_uninstall () noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe - rmfiles="$rmfiles $file" + func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. @@ -8326,7 +9576,7 @@ func_mode_uninstall () func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result - rmfiles="$rmfiles $func_ltwrapper_scriptname_result" + func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename @@ -8334,12 +9584,12 @@ func_mode_uninstall () # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles - rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" + func_append rmfiles " $odir/$name $odir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then - rmfiles="$rmfiles $objdir/lt-$name" + func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name" ; then - rmfiles="$rmfiles $objdir/lt-${noexename}.c" + func_append rmfiles " $odir/lt-${noexename}.c" fi fi fi @@ -8347,7 +9597,6 @@ func_mode_uninstall () esac func_show_eval "$RM $rmfiles" 'exit_status=1' done - objdir="$origobjdir" # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do @@ -8359,16 +9608,16 @@ func_mode_uninstall () exit $exit_status } -{ test "$mode" = uninstall || test "$mode" = clean; } && +{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && func_mode_uninstall ${1+"$@"} -test -z "$mode" && { +test -z "$opt_mode" && { help="$generic_help" func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ - func_fatal_help "invalid operation mode \`$mode'" + func_fatal_help "invalid operation mode \`$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" diff --git a/modules/freetype2/builds/unix/mkinstalldirs b/modules/freetype2/builds/unix/mkinstalldirs old mode 100644 new mode 100755 diff --git a/modules/freetype2/builds/vms/ftconfig.h b/modules/freetype2/builds/vms/ftconfig.h index 1659d039ea3..62fadac0fa2 100644 --- a/modules/freetype2/builds/vms/ftconfig.h +++ b/modules/freetype2/builds/vms/ftconfig.h @@ -4,7 +4,7 @@ /* */ /* VMS-specific configuration file (specification only). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2007, 2008 by */ +/* Copyright 1996-2004, 2006-2008, 2011 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -70,10 +70,6 @@ FT_BEGIN_HEADER #define FT_CHAR_BIT 8 - /* Preferred alignment of data */ -#define FT_ALIGNMENT 8 - - /* FT_UNUSED is a macro used to indicate that a given parameter is not */ /* used -- this is only used to get rid of unpleasant compiler warnings */ #ifndef FT_UNUSED @@ -99,15 +95,17 @@ FT_BEGIN_HEADER /* This is the only necessary change, so it is defined here instead */ /* providing a new configuration file. */ /* */ -#if ( defined( __APPLE__ ) && !defined( DARWIN_NO_CARBON ) ) || \ - ( defined( __MWERKS__ ) && defined( macintosh ) ) +#if defined( __APPLE__ ) || ( defined( __MWERKS__ ) && defined( macintosh ) ) /* no Carbon frameworks for 64bit 10.4.x */ + /* AvailabilityMacros.h is available since Mac OS X 10.2, */ + /* so guess the system version by maximum errno before inclusion */ +#include +#ifdef ECANCELED /* defined since 10.2 */ #include "AvailabilityMacros.h" +#endif #if defined( __LP64__ ) && \ ( MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 ) -#define DARWIN_NO_CARBON 1 -#else -#define FT_MACINTOSH 1 +#undef FT_MACINTOSH #endif #elif defined( __SC__ ) || defined( __MRC__ ) diff --git a/modules/freetype2/builds/vms/ftsystem.c b/modules/freetype2/builds/vms/ftsystem.c index 76bfae9f404..fb35967ccf0 100644 --- a/modules/freetype2/builds/vms/ftsystem.c +++ b/modules/freetype2/builds/vms/ftsystem.c @@ -4,7 +4,7 @@ /* */ /* VMS-specific FreeType low-level system interface (body). */ /* */ -/* Copyright 1996-2001, 2002, 2005 by */ +/* Copyright 1996-2001, 2002, 2005, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -231,6 +231,13 @@ } stream->size = stat_buf.st_size; + if ( !stream->size ) + { + FT_ERROR(( "FT_Stream_Open:" )); + FT_ERROR(( " opened `%s' but zero-sized\n", filepathname )); + goto Fail_Map; + } + stream->pos = 0; stream->base = (unsigned char *)mmap( NULL, stream->size, diff --git a/modules/freetype2/builds/win32/vc2005/freetype.vcproj b/modules/freetype2/builds/win32/vc2005/freetype.vcproj index e12f35d62f0..6f17352f6ff 100644 --- a/modules/freetype2/builds/win32/vc2005/freetype.vcproj +++ b/modules/freetype2/builds/win32/vc2005/freetype.vcproj @@ -16,7 +16,7 @@ - + @@ -33,7 +33,7 @@ - + @@ -50,7 +50,7 @@ - + @@ -67,7 +67,7 @@ - + @@ -84,7 +84,7 @@ - + @@ -101,7 +101,7 @@ - + diff --git a/modules/freetype2/builds/win32/vc2005/index.html b/modules/freetype2/builds/win32/vc2005/index.html index 6e00587f061..bc4291ce59f 100644 --- a/modules/freetype2/builds/win32/vc2005/index.html +++ b/modules/freetype2/builds/win32/vc2005/index.html @@ -11,14 +11,14 @@

This directory contains project files for Visual C++, named freetype.vcproj, and Visual Studio, called freetype.sln. It -compiles the following libraries from the FreeType 2.4.3 sources:

+compiles the following libraries from the FreeType 2.4.9 sources:

    -    freetype243.lib     - release build; single threaded
    -    freetype243_D.lib   - debug build;   single threaded
    -    freetype243MT.lib   - release build; multi-threaded
    -    freetype243MT_D.lib - debug build;   multi-threaded
    + freetype249.lib - release build; single threaded + freetype249_D.lib - debug build; single threaded + freetype249MT.lib - release build; multi-threaded + freetype249MT_D.lib - debug build; multi-threaded

Be sure to extract the files with the Windows (CR+LF) line endings. ZIP diff --git a/modules/freetype2/builds/win32/vc2008/freetype.vcproj b/modules/freetype2/builds/win32/vc2008/freetype.vcproj index e4dbdc1dafb..897c5e52fda 100644 --- a/modules/freetype2/builds/win32/vc2008/freetype.vcproj +++ b/modules/freetype2/builds/win32/vc2008/freetype.vcproj @@ -70,7 +70,7 @@ /> This directory contains project files for Visual C++, named freetype.vcproj, and Visual Studio, called freetype.sln. It -compiles the following libraries from the FreeType 2.4.3 sources:

+compiles the following libraries from the FreeType 2.4.9 sources:

    -    freetype243.lib     - release build; single threaded
    -    freetype243_D.lib   - debug build;   single threaded
    -    freetype243MT.lib   - release build; multi-threaded
    -    freetype243MT_D.lib - debug build;   multi-threaded
    + freetype249.lib - release build; single threaded + freetype249_D.lib - debug build; single threaded + freetype249MT.lib - release build; multi-threaded + freetype249MT_D.lib - debug build; multi-threaded

Be sure to extract the files with the Windows (CR+LF) line endings. ZIP diff --git a/modules/freetype2/builds/win32/vc2010/freetype.sln b/modules/freetype2/builds/win32/vc2010/freetype.sln new file mode 100644 index 00000000000..3439f626c30 --- /dev/null +++ b/modules/freetype2/builds/win32/vc2010/freetype.sln @@ -0,0 +1,32 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "freetype", "freetype.vcxproj", "{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug Multithreaded|Win32 = Debug Multithreaded|Win32 + Debug Singlethreaded|Win32 = Debug Singlethreaded|Win32 + Debug|Win32 = Debug|Win32 + Release Multithreaded|Win32 = Release Multithreaded|Win32 + Release Singlethreaded|Win32 = Release Singlethreaded|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug Multithreaded|Win32.ActiveCfg = Debug Multithreaded|Win32 + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug Multithreaded|Win32.Build.0 = Debug Multithreaded|Win32 + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug Singlethreaded|Win32.ActiveCfg = Debug Singlethreaded|Win32 + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug Singlethreaded|Win32.Build.0 = Debug Singlethreaded|Win32 + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug|Win32.ActiveCfg = Debug|Win32 + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug|Win32.Build.0 = Debug|Win32 + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release Multithreaded|Win32.ActiveCfg = Release Multithreaded|Win32 + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release Multithreaded|Win32.Build.0 = Release Multithreaded|Win32 + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release Singlethreaded|Win32.ActiveCfg = Release Singlethreaded|Win32 + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release Singlethreaded|Win32.Build.0 = Release Singlethreaded|Win32 + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release|Win32.ActiveCfg = Release|Win32 + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/modules/freetype2/builds/win32/vc2010/freetype.vcxproj b/modules/freetype2/builds/win32/vc2010/freetype.vcxproj new file mode 100644 index 00000000000..e88c45f2250 --- /dev/null +++ b/modules/freetype2/builds/win32/vc2010/freetype.vcxproj @@ -0,0 +1,832 @@ + + + + + Debug Multithreaded + Win32 + + + Debug Singlethreaded + Win32 + + + Debug + Win32 + + + Release Multithreaded + Win32 + + + Release Singlethreaded + Win32 + + + Release + Win32 + + + + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B} + + + + StaticLibrary + false + MultiByte + + + StaticLibrary + false + MultiByte + + + StaticLibrary + false + MultiByte + + + StaticLibrary + false + MultiByte + + + StaticLibrary + false + MultiByte + + + StaticLibrary + false + MultiByte + + + + + + <_ProjectFileVersion>10.0.30319.1 + .\..\..\..\objs\win32\vc2010\ + .\..\..\..\objs\release\ + .\..\..\..\objs\win32\vc2010\ + .\..\..\..\objs\release_mt\ + .\..\..\..\objs\win32\vc2010\ + .\..\..\..\objs\release_st\ + .\..\..\..\objs\win32\vc2010\ + .\..\..\..\objs\debug\ + .\..\..\..\objs\win32\vc2010\ + .\..\..\..\objs\debug_st\ + .\..\..\..\objs\win32\vc2010\ + .\..\..\..\objs\debug_mt\ + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + freetype249_D + freetype249MT_D + freetype249ST_D + freetype249 + freetype249MT + freetype249ST + + + + MaxSpeed + OnlyExplicitInline + ..\..\..\include;%(AdditionalIncludeDirectories) + NDEBUG;WIN32;_LIB;_CRT_SECURE_NO_WARNINGS;FT2_BUILD_LIBRARY;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + true + Level4 + + + Default + 4001 + true + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + + + + + MaxSpeed + OnlyExplicitInline + ..\..\..\include;%(AdditionalIncludeDirectories) + NDEBUG;WIN32;_LIB;_CRT_SECURE_NO_WARNINGS;FT2_BUILD_LIBRARY;%(PreprocessorDefinitions) + true + MultiThreaded + true + true + Level4 + + + Default + 4001 + true + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + + + + + MaxSpeed + OnlyExplicitInline + ..\..\..\include;%(AdditionalIncludeDirectories) + NDEBUG;WIN32;_LIB;_CRT_SECURE_NO_WARNINGS;FT2_BUILD_LIBRARY;%(PreprocessorDefinitions) + true + MultiThreaded + true + true + Level4 + + + Default + 4001 + true + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + + Disabled + ..\..\..\include;%(AdditionalIncludeDirectories) + _DEBUG;WIN32;_LIB;_CRT_SECURE_NO_WARNINGS;FT_DEBUG_LEVEL_ERROR;FT_DEBUG_LEVEL_TRACE;FT2_BUILD_LIBRARY;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebugDLL + true + Level4 + ProgramDatabase + Default + 4001 + true + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + + + + + Disabled + ..\..\..\include;%(AdditionalIncludeDirectories) + _DEBUG;WIN32;_LIB;_CRT_SECURE_NO_WARNINGS;FT_DEBUG_LEVEL_ERROR;FT_DEBUG_LEVEL_TRACE;FT2_BUILD_LIBRARY;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + true + Level4 + ProgramDatabase + Default + 4001 + true + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + + + + + Disabled + ..\..\..\include;%(AdditionalIncludeDirectories) + _DEBUG;WIN32;_LIB;_CRT_SECURE_NO_WARNINGS;FT_DEBUG_LEVEL_ERROR;FT_DEBUG_LEVEL_TRACE;FT2_BUILD_LIBRARY;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + false + false + EnableFastChecks + MultiThreadedDebug + true + Level4 + ProgramDatabase + Default + 4001 + true + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + + + + + + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + false + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + false + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + false + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + false + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + false + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + false + + + + + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + + + + + + + + + + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + Disabled + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + EnableFastChecks + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + MaxSpeed + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + + + + + + + + + + + + diff --git a/modules/freetype2/builds/win32/vc2010/freetype.vcxproj.filters b/modules/freetype2/builds/win32/vc2010/freetype.vcxproj.filters new file mode 100644 index 00000000000..a3a9f1991c5 --- /dev/null +++ b/modules/freetype2/builds/win32/vc2010/freetype.vcxproj.filters @@ -0,0 +1,155 @@ + + + + + {b4c15893-ec11-491d-9507-0ac184f9cc78} + cpp;c;cxx;rc;def;r;odl;idl;hpj;bat + + + {4d3e4eff-3fbc-4b20-b413-2743b23b7109} + + + {e6cf6a0f-0404-4024-8bf8-ff5b29f35657} + h;hpp;hxx;hm;inl + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files\FT_MODULES + + + Source Files\FT_MODULES + + + Source Files\FT_MODULES + + + Source Files\FT_MODULES + + + Source Files\FT_MODULES + + + Source Files\FT_MODULES + + + Source Files\FT_MODULES + + + Source Files\FT_MODULES + + + Source Files\FT_MODULES + + + Source Files\FT_MODULES + + + Source Files\FT_MODULES + + + Source Files\FT_MODULES + + + Source Files\FT_MODULES + + + Source Files\FT_MODULES + + + Source Files\FT_MODULES + + + Source Files\FT_MODULES + + + Source Files\FT_MODULES + + + Source Files\FT_MODULES + + + Source Files\FT_MODULES + + + Source Files\FT_MODULES + + + Source Files\FT_MODULES + + + Source Files\FT_MODULES + + + Source Files\FT_MODULES + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + diff --git a/modules/freetype2/builds/win32/vc2010/index.html b/modules/freetype2/builds/win32/vc2010/index.html new file mode 100644 index 00000000000..1d492fbe00a --- /dev/null +++ b/modules/freetype2/builds/win32/vc2010/index.html @@ -0,0 +1,37 @@ + +

+ + FreeType 2 Project Files for VS.NET 2010 + + + +

+ FreeType 2 Project Files for VS.NET 2010 +

+ +

This directory contains a project file for Visual C++, named +freetype.vcxproj, and Visual Studio, called freetype.sln. It +compiles the following libraries from the FreeType 2.4.9 sources:

+ +
    +
    +    freetype249.lib     - release build; single threaded
    +    freetype249_D.lib   - debug build;   single threaded
    +    freetype249MT.lib   - release build; multi-threaded
    +    freetype249MT_D.lib - debug build;   multi-threaded
    +
+ +

Be sure to extract the files with the Windows (CR+LF) line endings. ZIP +archives are already stored this way, so no further action is required. If +you use some .tar.*z archives, be sure to configure your extracting +tool to convert the line endings. For example, with WinZip, you should activate the TAR +file smart CR/LF Conversion option. Alternatively, you may consider +using the unix2dos or u2d utilities that are floating +around, which specifically deal with this particular problem. + +

Build directories are placed in the top-level objs +directory.

+ + + diff --git a/modules/freetype2/builds/win32/visualc/freetype.dsp b/modules/freetype2/builds/win32/visualc/freetype.dsp index 3b7e6356173..274a7634b19 100644 --- a/modules/freetype2/builds/win32/visualc/freetype.dsp +++ b/modules/freetype2/builds/win32/visualc/freetype.dsp @@ -54,7 +54,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"..\..\..\objs\freetype243.lib" +# ADD LIB32 /nologo /out:"..\..\..\objs\freetype249.lib" !ELSEIF "$(CFG)" == "freetype - Win32 Debug" @@ -78,7 +78,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"..\..\..\objs\freetype243_D.lib" +# ADD LIB32 /nologo /out:"..\..\..\objs\freetype249_D.lib" !ELSEIF "$(CFG)" == "freetype - Win32 Debug Multithreaded" @@ -102,8 +102,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"lib\freetype243_D.lib" -# ADD LIB32 /nologo /out:"..\..\..\objs\freetype243MT_D.lib" +# ADD BASE LIB32 /nologo /out:"lib\freetype249_D.lib" +# ADD LIB32 /nologo /out:"..\..\..\objs\freetype249MT_D.lib" !ELSEIF "$(CFG)" == "freetype - Win32 Release Multithreaded" @@ -126,8 +126,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"lib\freetype243.lib" -# ADD LIB32 /nologo /out:"..\..\..\objs\freetype243MT.lib" +# ADD BASE LIB32 /nologo /out:"lib\freetype249.lib" +# ADD LIB32 /nologo /out:"..\..\..\objs\freetype249MT.lib" !ELSEIF "$(CFG)" == "freetype - Win32 Release Singlethreaded" @@ -151,8 +151,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\..\objs\freetype243.lib" -# ADD LIB32 /out:"..\..\..\objs\freetype243ST.lib" +# ADD BASE LIB32 /nologo /out:"..\..\..\objs\freetype249.lib" +# ADD LIB32 /out:"..\..\..\objs\freetype249ST.lib" # SUBTRACT LIB32 /nologo !ELSEIF "$(CFG)" == "freetype - Win32 Debug Singlethreaded" @@ -177,8 +177,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\..\objs\freetype243_D.lib" -# ADD LIB32 /nologo /out:"..\..\..\objs\freetype243ST_D.lib" +# ADD BASE LIB32 /nologo /out:"..\..\..\objs\freetype249_D.lib" +# ADD LIB32 /nologo /out:"..\..\..\objs\freetype249ST_D.lib" !ENDIF diff --git a/modules/freetype2/builds/win32/visualc/freetype.vcproj b/modules/freetype2/builds/win32/visualc/freetype.vcproj index 5a0a8ef7777..f0638daf218 100644 --- a/modules/freetype2/builds/win32/visualc/freetype.vcproj +++ b/modules/freetype2/builds/win32/visualc/freetype.vcproj @@ -69,7 +69,7 @@ /> This directory contains project files for Visual C++, named freetype.dsp, and Visual Studio, called freetype.sln. It -compiles the following libraries from the FreeType 2.4.3 sources:

+compiles the following libraries from the FreeType 2.4.9 sources:

    -    freetype243.lib     - release build; single threaded
    -    freetype243_D.lib   - debug build;   single threaded
    -    freetype243MT.lib   - release build; multi-threaded
    -    freetype243MT_D.lib - debug build;   multi-threaded
    + freetype249.lib - release build; single threaded + freetype249_D.lib - debug build; single threaded + freetype249MT.lib - release build; multi-threaded + freetype249MT_D.lib - debug build; multi-threaded

Be sure to extract the files with the Windows (CR+LF) line endings. ZIP diff --git a/modules/freetype2/builds/win32/visualce/freetype.dsp b/modules/freetype2/builds/win32/visualce/freetype.dsp index 3b7e6356173..274a7634b19 100644 --- a/modules/freetype2/builds/win32/visualce/freetype.dsp +++ b/modules/freetype2/builds/win32/visualce/freetype.dsp @@ -54,7 +54,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"..\..\..\objs\freetype243.lib" +# ADD LIB32 /nologo /out:"..\..\..\objs\freetype249.lib" !ELSEIF "$(CFG)" == "freetype - Win32 Debug" @@ -78,7 +78,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"..\..\..\objs\freetype243_D.lib" +# ADD LIB32 /nologo /out:"..\..\..\objs\freetype249_D.lib" !ELSEIF "$(CFG)" == "freetype - Win32 Debug Multithreaded" @@ -102,8 +102,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"lib\freetype243_D.lib" -# ADD LIB32 /nologo /out:"..\..\..\objs\freetype243MT_D.lib" +# ADD BASE LIB32 /nologo /out:"lib\freetype249_D.lib" +# ADD LIB32 /nologo /out:"..\..\..\objs\freetype249MT_D.lib" !ELSEIF "$(CFG)" == "freetype - Win32 Release Multithreaded" @@ -126,8 +126,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"lib\freetype243.lib" -# ADD LIB32 /nologo /out:"..\..\..\objs\freetype243MT.lib" +# ADD BASE LIB32 /nologo /out:"lib\freetype249.lib" +# ADD LIB32 /nologo /out:"..\..\..\objs\freetype249MT.lib" !ELSEIF "$(CFG)" == "freetype - Win32 Release Singlethreaded" @@ -151,8 +151,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\..\objs\freetype243.lib" -# ADD LIB32 /out:"..\..\..\objs\freetype243ST.lib" +# ADD BASE LIB32 /nologo /out:"..\..\..\objs\freetype249.lib" +# ADD LIB32 /out:"..\..\..\objs\freetype249ST.lib" # SUBTRACT LIB32 /nologo !ELSEIF "$(CFG)" == "freetype - Win32 Debug Singlethreaded" @@ -177,8 +177,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\..\objs\freetype243_D.lib" -# ADD LIB32 /nologo /out:"..\..\..\objs\freetype243ST_D.lib" +# ADD BASE LIB32 /nologo /out:"..\..\..\objs\freetype249_D.lib" +# ADD LIB32 /nologo /out:"..\..\..\objs\freetype249ST_D.lib" !ENDIF diff --git a/modules/freetype2/builds/win32/visualce/freetype.vcproj b/modules/freetype2/builds/win32/visualce/freetype.vcproj index 3374ac54cc2..89a416a9d45 100644 --- a/modules/freetype2/builds/win32/visualce/freetype.vcproj +++ b/modules/freetype2/builds/win32/visualce/freetype.vcproj @@ -87,7 +87,7 @@ /> PPC/SP WM6 (Windows Mobile 6) -It compiles the following libraries from the FreeType 2.4.3 sources:

+It compiles the following libraries from the FreeType 2.4.9 sources:

    -    freetype243.lib     - release build; single threaded
    -    freetype243_D.lib   - debug build;   single threaded
    -    freetype243MT.lib   - release build; multi-threaded
    -    freetype243MT_D.lib - debug build;   multi-threaded
    + freetype249.lib - release build; single threaded + freetype249_D.lib - debug build; single threaded + freetype249MT.lib - release build; multi-threaded + freetype249MT_D.lib - debug build; multi-threaded

Be sure to extract the files with the Windows (CR+LF) line endings. ZIP diff --git a/modules/freetype2/builds/wince/vc2005-ce/freetype.vcproj b/modules/freetype2/builds/wince/vc2005-ce/freetype.vcproj index ce1ed73000d..fa0e986db8d 100644 --- a/modules/freetype2/builds/wince/vc2005-ce/freetype.vcproj +++ b/modules/freetype2/builds/wince/vc2005-ce/freetype.vcproj @@ -21,7 +21,7 @@ - + @@ -41,7 +41,7 @@ - + @@ -61,7 +61,7 @@ - + @@ -81,7 +81,7 @@ - + @@ -101,7 +101,7 @@ - + @@ -121,7 +121,7 @@ - + @@ -141,7 +141,7 @@ - + @@ -161,7 +161,7 @@ - + @@ -181,7 +181,7 @@ - + @@ -201,7 +201,7 @@ - + @@ -221,7 +221,7 @@ - + @@ -241,7 +241,7 @@ - + @@ -261,7 +261,7 @@ - + @@ -281,7 +281,7 @@ - + @@ -301,7 +301,7 @@ - + @@ -321,7 +321,7 @@ - + @@ -341,7 +341,7 @@ - + @@ -361,7 +361,7 @@ - + @@ -381,7 +381,7 @@ - + @@ -401,7 +401,7 @@ - + @@ -421,7 +421,7 @@ - + @@ -441,7 +441,7 @@ - + @@ -461,7 +461,7 @@ - + @@ -481,7 +481,7 @@ - + @@ -501,7 +501,7 @@ - + @@ -521,7 +521,7 @@ - + @@ -541,7 +541,7 @@ - + @@ -561,7 +561,7 @@ - + @@ -581,7 +581,7 @@ - + @@ -601,7 +601,7 @@ - + @@ -621,7 +621,7 @@ - + @@ -641,7 +641,7 @@ - + @@ -661,7 +661,7 @@ - + @@ -681,7 +681,7 @@ - + @@ -701,7 +701,7 @@ - + @@ -721,7 +721,7 @@ - + @@ -741,7 +741,7 @@ - + @@ -758,7 +758,7 @@ - + diff --git a/modules/freetype2/builds/wince/vc2005-ce/index.html b/modules/freetype2/builds/wince/vc2005-ce/index.html index 12864114fa2..cffa8cbdd46 100644 --- a/modules/freetype2/builds/wince/vc2005-ce/index.html +++ b/modules/freetype2/builds/wince/vc2005-ce/index.html @@ -21,14 +21,14 @@ the following targets:

  • PPC/SP WM6 (Windows Mobile 6)
  • -It compiles the following libraries from the FreeType 2.4.3 sources:

    +It compiles the following libraries from the FreeType 2.4.9 sources:

      -    freetype243.lib     - release build; single threaded
      -    freetype243_D.lib   - debug build;   single threaded
      -    freetype243MT.lib   - release build; multi-threaded
      -    freetype243MT_D.lib - debug build;   multi-threaded
      + freetype249.lib - release build; single threaded + freetype249_D.lib - debug build; single threaded + freetype249MT.lib - release build; multi-threaded + freetype249MT_D.lib - debug build; multi-threaded

    Be sure to extract the files with the Windows (CR+LF) line endings. ZIP diff --git a/modules/freetype2/builds/wince/vc2008-ce/freetype.vcproj b/modules/freetype2/builds/wince/vc2008-ce/freetype.vcproj index e4c891bffcd..1f052c1056f 100644 --- a/modules/freetype2/builds/wince/vc2008-ce/freetype.vcproj +++ b/modules/freetype2/builds/wince/vc2008-ce/freetype.vcproj @@ -88,7 +88,7 @@ /> PPC/SP WM6 (Windows Mobile 6) -It compiles the following libraries from the FreeType 2.4.3 sources:

    +It compiles the following libraries from the FreeType 2.4.9 sources:

      -    freetype243.lib     - release build; single threaded
      -    freetype243_D.lib   - debug build;   single threaded
      -    freetype243MT.lib   - release build; multi-threaded
      -    freetype243MT_D.lib - debug build;   multi-threaded
      + freetype249.lib - release build; single threaded + freetype249_D.lib - debug build; single threaded + freetype249MT.lib - release build; multi-threaded + freetype249MT_D.lib - debug build; multi-threaded

    Be sure to extract the files with the Windows (CR+LF) line endings. ZIP diff --git a/modules/freetype2/configure b/modules/freetype2/configure old mode 100644 new mode 100755 index 06fdc8ea7a7..55a24fdc597 --- a/modules/freetype2/configure +++ b/modules/freetype2/configure @@ -80,8 +80,8 @@ fi # build a dummy Makefile if we are not building in the source tree; # we use inodes to avoid issues with symbolic links -inode_src=`ls -id $abs_ft2_dir | sed 's/ .*//'` -inode_dst=`ls -id $abs_curr_dir | sed 's/ .*//'` +inode_src=`ls -id $abs_ft2_dir | awk '{print $1}'` +inode_dst=`ls -id $abs_curr_dir | awk '{print $1}'` if test $inode_src -ne $inode_dst; then if test ! -d reference; then @@ -92,19 +92,19 @@ if test $inode_src -ne $inode_dst; then cp $abs_ft2_dir/modules.cfg $abs_curr_dir fi echo "Generating \`Makefile'" - echo "TOP_DIR := $abs_ft2_dir" > Makefile - echo "OBJ_DIR := $abs_curr_dir" >> Makefile - echo "OBJ_BUILD := \$(OBJ_DIR)" >> Makefile - echo "DOC_DIR := \$(OBJ_DIR)/reference" >> Makefile - echo "FT_LIBTOOL_DIR := \$(OBJ_DIR)" >> Makefile - echo "ifndef FT2DEMOS" >> Makefile - echo " include \$(TOP_DIR)/Makefile" >> Makefile - echo "else" >> Makefile - echo " TOP_DIR_2 := \$(TOP_DIR)/../ft2demos" >> Makefile - echo " PROJECT := freetype" >> Makefile - echo " CONFIG_MK := \$(OBJ_DIR)/config.mk" >> Makefile - echo " include \$(TOP_DIR_2)/Makefile" >> Makefile - echo "endif" >> Makefile + echo "TOP_DIR := $abs_ft2_dir" > Makefile + echo "OBJ_DIR := $abs_curr_dir" >> Makefile + echo "OBJ_BUILD := \$(OBJ_DIR)" >> Makefile + echo "DOC_DIR := \$(OBJ_DIR)/reference" >> Makefile + echo "FT_LIBTOOL_DIR := \$(OBJ_DIR)" >> Makefile + echo "ifndef FT2DEMOS" >> Makefile + echo " include \$(TOP_DIR)/Makefile" >> Makefile + echo "else" >> Makefile + echo " TOP_DIR_2 := \$(TOP_DIR)/../ft2demos" >> Makefile + echo " PROJECT := freetype" >> Makefile + echo " CONFIG_MK := \$(OBJ_DIR)/config.mk" >> Makefile + echo " include \$(TOP_DIR_2)/Makefile" >> Makefile + echo "endif" >> Makefile fi # call make diff --git a/modules/freetype2/devel/ftoption.h b/modules/freetype2/devel/ftoption.h index 32dd25aa7fd..4da0221db37 100644 --- a/modules/freetype2/devel/ftoption.h +++ b/modules/freetype2/devel/ftoption.h @@ -4,8 +4,7 @@ /* */ /* User-selectable configuration macros (specification only). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, */ -/* 2010 by */ +/* Copyright 1996-2011 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -188,6 +187,33 @@ FT_BEGIN_HEADER /* #define FT_CONFIG_OPTION_SYSTEM_ZLIB */ + /*************************************************************************/ + /* */ + /* Bzip2-compressed file support. */ + /* */ + /* FreeType now handles font files that have been compressed with the */ + /* `bzip2' program. This is mostly used to parse many of the PCF */ + /* files that come with XFree86. The implementation uses `libbz2' to */ + /* partially uncompress the file on the fly (see src/bzip2/ftbzip2.c). */ + /* Contrary to gzip, bzip2 currently is not included and need to use */ + /* the system available bzip2 implementation. */ + /* */ + /* Define this macro if you want to enable this `feature'. */ + /* */ +#define FT_CONFIG_OPTION_USE_BZIP2 + + + /*************************************************************************/ + /* */ + /* Define to disable the use of file stream functions and types, FILE, */ + /* fopen() etc. Enables the use of smaller system libraries on embedded */ + /* systems that have multiple system libraries, some with or without */ + /* file stream support, in the cases where file stream support is not */ + /* necessary such as memory loading of font files. */ + /* */ +/* #define FT_CONFIG_OPTION_DISABLE_STREAM_SUPPORT */ + + /*************************************************************************/ /* */ /* DLL export compilation */ @@ -363,6 +389,39 @@ FT_BEGIN_HEADER #define FT_DEBUG_LEVEL_TRACE + /*************************************************************************/ + /* */ + /* Autofitter debugging */ + /* */ + /* If FT_DEBUG_AUTOFIT is defined, FreeType provides some means to */ + /* control the autofitter behaviour for debugging purposes with global */ + /* boolean variables (consequently, you should *never* enable this */ + /* while compiling in `release' mode): */ + /* */ + /* _af_debug_disable_horz_hints */ + /* _af_debug_disable_vert_hints */ + /* _af_debug_disable_blue_hints */ + /* */ + /* Additionally, the following functions provide dumps of various */ + /* internal autofit structures to stdout (using `printf'): */ + /* */ + /* af_glyph_hints_dump_points */ + /* af_glyph_hints_dump_segments */ + /* af_glyph_hints_dump_edges */ + /* */ + /* As an argument, they use another global variable: */ + /* */ + /* _af_debug_hints */ + /* */ + /* Please have a look at the `ftgrid' demo program to see how those */ + /* variables and macros should be used. */ + /* */ + /* Do not #undef these macros here since the build system might define */ + /* them for certain configurations only. */ + /* */ +#define FT_DEBUG_AUTOFIT + + /*************************************************************************/ /* */ /* Memory Debugging */ @@ -575,7 +634,7 @@ FT_BEGIN_HEADER /* composite flags array which can be used to disambiguate, but old */ /* fonts will not have them. */ /* */ - /* http://partners.adobe.com/asn/developer/opentype/glyf.html */ + /* http://www.microsoft.com/typography/otspec/glyf.htm */ /* http://fonts.apple.com/TTRefMan/RM06/Chap6glyf.html */ /* */ #undef TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED @@ -676,6 +735,19 @@ FT_BEGIN_HEADER /* */ #define AF_CONFIG_OPTION_INDIC + /*************************************************************************/ + /* */ + /* Compile autofit module with warp hinting. The idea of the warping */ + /* code is to slightly scale and shift a glyph within a single dimension */ + /* so that as much of its segments are aligned (more or less) on the */ + /* grid. To find out the optimal scaling and shifting value, various */ + /* parameter combinations are tried and scored. */ + /* */ + /* This experimental option is only active if the render mode is */ + /* FT_RENDER_MODE_LIGHT. */ + /* */ +#define AF_CONFIG_OPTION_USE_WARPER + /* */ diff --git a/modules/freetype2/docs/CHANGES b/modules/freetype2/docs/CHANGES index 8e4fb6fa71a..ae5793282a0 100644 --- a/modules/freetype2/docs/CHANGES +++ b/modules/freetype2/docs/CHANGES @@ -1,4 +1,176 @@ +CHANGES BETWEEN 2.4.8 and 2.4.9 + + I. IMPORTANT BUG FIXES + + - Another round of fixes to better handle invalid fonts. Many of + them are vulnerabilities (see CVE-2012-1126 up to CVE-2012-1144 + and SA48320) so all users should upgrade. + + + II. MISCELLANEOUS + + - The `ENCODING -1 ' format of BDF fonts is now supported. + + - For BDF fonts, support for the whole Unicode encoding range has + been added. + + - Better TTF support for x_ppem != y_ppem. + + - `FT_Get_Advances' sometimes returned bogus values. + + - The demo programs no longer recognize and handle default + suffixes; you now have to always specify the complete font name. + + - Better rendering and LCD mode cycling added to ftview. + + +====================================================================== + +CHANGES BETWEEN 2.4.7 and 2.4.8 + + I. IMPORTANT BUG FIXES + + - Some vulnerabilities in handling CID-keyed PostScript fonts have + been fixed; see CVE-2011-3439. + + + II. MISCELLANEOUS + + - Chris Liddell contributed a new API, `FT_Get_PS_Font_Value', to + retrieve most of the dictionary keys in Type 1 fonts. + + +====================================================================== + +CHANGES BETWEEN 2.4.6 and 2.4.7 + + I. IMPORTANT BUG FIXES + + - Some vulnerabilities in handling Type 1 fonts have been fixed; + see CVE-2011-3256. + + + II. MISCELLANEOUS + + - FreeType now properly handles ZapfDingbats glyph names while + constructing a Unicode character map (for fonts which don't have + one). + + +====================================================================== + +CHANGES BETWEEN 2.4.5 and 2.4.6 + + I. IMPORTANT BUG FIXES + + - For TrueType based fonts, the ascender and descender values were + incorrect sometimes (off by a pixel if the ppem value was not a + multiple of 5). Depending on the use you might now experience + a different layout; the change should result in better, more + consistent line spacing. + + - Fix CVE-2011-0226 which causes a vulnerability while handling + Type 1 fonts. + + - BDF fonts containing glyphs with negative values for ENCODING + were incorrectly rejected. This bug has been introduced in + FreeType version 2.2.0. + + - David Bevan contributed a major revision of the FreeType stroker + code: + + . The behaviour of FT_STROKER_LINEJOIN_BEVEL has been corrected. + + . A new line join style, FT_STROKER_LINEJOIN_MITER_FIXED, has + been introduced to support PostScript and PDF miter joins. + + . FT_STROKER_LINEJOIN_MITER_VARIABLE has been introduced as an + alias for FT_STROKER_LINEJOIN_MITER. + + . Various stroking glitches has been fixed. + + + II. MISCELLANEOUS + + - SFNT bitmap fonts which contain an outline glyph for `.notdef' + only no longer set the FT_FACE_FLAG_SCALABLE flag. + + +====================================================================== + +CHANGES BETWEEN 2.4.4 and 2.4.5 + + I. IMPORTANT BUG FIXES + + - A rendering regression for second-order Bézier curves has been + fixed, introduced in 2.4.3. + + + II. IMPORTANT CHANGES + + - If autohinting is not explicitly disabled, FreeType now uses + the autohinter if a TrueType based font doesn't contain native + hints. + + - The load flag FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH has been made + redundant and is simply ignored; this means that FreeType now + ignores the global advance width value in TrueType fonts. + + + III. MISCELLANEOUS + + - `FT_Sfnt_Table_Info' can now return the number of SFNT tables of + a font. + + - Support for PCF files compressed with bzip2 has been contributed + by Joel Klinghed. To make this work, the OS must provide a + bzip2 library. + + - Bradley Grainger contributed project and solution files in + Visual Studio 2010 format. + + - Again some fixes to better handle broken fonts. + + - Some improvements to the B/W rasterizer. + + - Fixes to the cache module to improve robustness. + + - Just Fill Bugs contributed (experimental) code to compute blue + zones for CJK Ideographs, improving the alignment of horizontal + stems at the top or bottom edges. + + - The `ftgrid' demo program can now display autohinter segments, + to be toggled on and off with key `s'. + + +====================================================================== + +CHANGES BETWEEN 2.4.3 and 2.4.4 + + I. IMPORTANT BUG FIXES + + - UVS support (TrueType/OpenType cmap format 14) support is fixed. + This regression has been introduced in version 2.4.0. + + + II. MISCELLANEOUS + + - Detect tricky fonts (e.g. MingLiU) by the lengths and checksums + of Type42-persistent subtables (`cvt ', `fpgm', and `prep') when + a TrueType font without family name is given. The previous fix, + introduced in 2.4.3, was too rigorous, causing many subsetted + fonts (mainly from PDF files) displayed badly because FreeType + forced rendering with the TrueType bytecode engine instead of + the autohinter. + + - Better support for 64bit platforms. + + - More fixes to improve handling of broken fonts. + + +====================================================================== + CHANGES BETWEEN 2.4.2 and 2.4.3 I. IMPORTANT BUG FIXES @@ -3457,8 +3629,7 @@ Extensions support: ------------------------------------------------------------------------ -Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, - 2010 by +Copyright 2000-2012 by David Turner, Robert Wilhelm, and Werner Lemberg. This file is part of the FreeType project, and may only be used, diff --git a/modules/freetype2/docs/GPL.TXT b/modules/freetype2/docs/GPLv2.TXT similarity index 100% rename from modules/freetype2/docs/GPL.TXT rename to modules/freetype2/docs/GPLv2.TXT diff --git a/modules/freetype2/docs/INSTALL b/modules/freetype2/docs/INSTALL index 50f80517ca9..fc699a8d53c 100644 --- a/modules/freetype2/docs/INSTALL +++ b/modules/freetype2/docs/INSTALL @@ -9,10 +9,10 @@ I. Normal installation and upgrades 1. Unix Systems (including Mac OS X, Cygwin, and MSys on Windows) - Please read *both* `UPGRADE.UNIX' and `INSTALL.UNIX' to install or - upgrade FreeType 2 on a Unix system. Note that you *need* GNU - Make for automatic compilation, since other make tools won't work - (this includes BSD Make). + Please read `INSTALL.UNIX' to install or upgrade FreeType 2 on a + Unix system. Note that you *need* GNU Make for automatic + compilation, since other make tools won't work (this includes BSD + Make). GNU Make VERSION 3.80 OR NEWER IS NEEDED! @@ -70,7 +70,7 @@ II. Custom builds of the library ---------------------------------------------------------------------- -Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010 +Copyright 2000-2008, 2010-2011 by David Turner, Robert Wilhelm, and Werner Lemberg. This file is part of the FreeType project, and may only be used, diff --git a/modules/freetype2/docs/INSTALL.ANY b/modules/freetype2/docs/INSTALL.ANY index 44b785c67e5..80f161c64d3 100644 --- a/modules/freetype2/docs/INSTALL.ANY +++ b/modules/freetype2/docs/INSTALL.ANY @@ -81,6 +81,7 @@ I. Standard procedure src/cache/ftcache.c -- cache sub-system (in beta) src/gzip/ftgzip.c -- support for compressed fonts (.gz) src/lzw/ftlzw.c -- support for compressed fonts (.Z) + src/bzip2/ftbzip2.c -- support for compressed fonts (.bz2) src/gxvalid/gxvalid.c -- TrueTypeGX/AAT table validation src/otvalid/otvalid.c -- OpenType table validation src/psaux/psaux.c -- PostScript Type 1 parsing @@ -102,6 +103,10 @@ I. Standard procedure `type1cid.c' needs `psaux.c', `pshinter.c', and `psnames.c' `type42.c' needs `truetype.c' + To use `ftbzip2.c', an application must be linked with a library + which implements bzip2 support (and the bzip2 header files must + be available also during compilation). + Read the file `CUSTOMIZE' in case you want to compile only a subset of the drivers, renderers, and optional modules; a detailed diff --git a/modules/freetype2/docs/INSTALL.UNIX b/modules/freetype2/docs/INSTALL.UNIX index 1d5af993f84..5dc0764ef69 100644 --- a/modules/freetype2/docs/INSTALL.UNIX +++ b/modules/freetype2/docs/INSTALL.UNIX @@ -32,7 +32,7 @@ or MSys on Win32: 2. Regenerate the configure script if needed -------------------------------------------- - This only applies if you are building a CVS snapshot or checkout, + This only applies if you are building a git snapshot or checkout, *not* if you grabbed the sources of an official release. You need to invoke the `autogen.sh' script in the top-level @@ -42,7 +42,7 @@ or MSys on Win32: sh autogen.sh In case of problems, you may need to install or upgrade Automake, - Autoconf or Libtool. See README.CVS in the top-level directory + Autoconf or Libtool. See README.git in the top-level directory for more information. diff --git a/modules/freetype2/docs/LICENSE.TXT b/modules/freetype2/docs/LICENSE.TXT index abebbcc7802..62945c85fe9 100644 --- a/modules/freetype2/docs/LICENSE.TXT +++ b/modules/freetype2/docs/LICENSE.TXT @@ -15,9 +15,12 @@ any of your projects or products. is suited to products which don't use the GNU General Public License. - - The GNU General Public License version 2, found in `GPL.TXT' (any + Note that this license is compatible to the GNU General Public + License version 3, but not version 2. + + - The GNU General Public License version 2, found in `GPLv2.TXT' (any later version can be used also), for programs which already use the - GPL. Note that the FTL is incompatible with the GPL due to its + GPL. Note that the FTL is incompatible with GPLv2 due to its advertisement clause. The contributed BDF and PCF drivers come with a license similar to that diff --git a/modules/freetype2/docs/PATENTS b/modules/freetype2/docs/PATENTS deleted file mode 100644 index f36778b5e95..00000000000 --- a/modules/freetype2/docs/PATENTS +++ /dev/null @@ -1,27 +0,0 @@ - - FreeType Patents Disclaimer - August 1999 - - - -WE HAVE DISCOVERED THAT APPLE OWNS SEVERAL PATENTS RELATED TO THE -RENDERING OF TRUETYPE FONTS. THIS COULD MEAN THAT THE FREE USE OF -FREETYPE MIGHT BE ILLEGAL IN THE USA, JAPAN, AND POSSIBLY OTHER -COUNTRIES, BE IT IN PROPRIETARY OR FREE SOFTWARE PRODUCTS. - -FOR MORE DETAILS, WE STRONGLY ADVISE YOU TO GO TO THE FREETYPE -PATENTS PAGE AT THE FOLLOWING WEB ADDRESS: - - http://www.freetype.org/patents.html - -WE WILL NOT PLACE INFORMATION IN THIS FILE AS THE SITUATION IS STILL -UNDETERMINED FOR NOW. AT THE TIME THESE LINES ARE WRITTEN, WE HAVE -CONTACTED APPLE'S LEGAL DEPARTMENT AND ARE STILL WAITING FOR THEIR -ANSWER ON THE SUBJECT. - -PLEASE READ THE `INSTALL' FILE TO SEE HOW TO DISABLE THE ENGINE'S -BYTECODE INTERPRETER IN ORDER TO BUILD A PATENT-FREE ENGINE, AT THE -COST OF RENDERING QUALITY. - - ---- end of PATENTS --- diff --git a/modules/freetype2/docs/PROBLEMS b/modules/freetype2/docs/PROBLEMS index 9b598966a00..40bdc35a676 100644 --- a/modules/freetype2/docs/PROBLEMS +++ b/modules/freetype2/docs/PROBLEMS @@ -14,7 +14,7 @@ Running Problems ----- Of course, there might be bugs in FreeType, but some fonts based on -the PostScript format can't behandled indeed. The reason is that +the PostScript format can't be handled indeed. The reason is that FreeType doesn't contain a full PostScript interpreter but applies pattern matching instead. In case a font doesn't follow the standard structure of the given font format, FreeType fails. A typical example @@ -25,6 +25,19 @@ It might be possible to patch FreeType in some situations, though. Please report failing fonts so that we investigate the problem and set up a list of such problematic fonts. + +* Why do identical FreeType versions render differently on different + platforms? + +----- + +Different distributions compile FreeType with different options. The +developer version of a distribution's FreeType package, which is +needed to compile your program against FreeType, includes the file +ftoption.h. Compare each platform's copy of ftoption.h to find the +differences. + + ---------------------------------------------------------------------- diff --git a/modules/freetype2/docs/TRUETYPE b/modules/freetype2/docs/TRUETYPE deleted file mode 100644 index 3e1614ad433..00000000000 --- a/modules/freetype2/docs/TRUETYPE +++ /dev/null @@ -1,40 +0,0 @@ -How to enable the TrueType native hinter if you need it -------------------------------------------------------- - - The TrueType bytecode interpreter is disabled in all public releases - of the FreeType packages for patents reasons; see - - http://www.freetype.org/patents.html - - for more details. - - However, many Linux distributions do enable the interpreter in the - FreeType packages (DEB/RPM/etc.) they produce for their platforms. If - you are using TrueType fonts on your system, you most probably want to - enable it manually by doing the following: - - - open the file `include/freetype/config/ftoption.h' - - - locate a line that says: - - /* #define TT_CONFIG_OPTION_BYTECODE_INTERPRETER */ - - - change it to: - - #define TT_CONFIG_OPTION_BYTECODE_INTERPRETER - - These steps must be done _before_ compiling the library. - ------------------------------------------------------------------------- - -Copyright 2003, 2005, 2006 by -David Turner, Robert Wilhelm, and Werner Lemberg. - -This file is part of the FreeType project, and may only be used, -modified, and distributed under the terms of the FreeType project -license, LICENSE.TXT. By continuing to use, modify, or distribute this -file you indicate that you have read the license and understand and -accept it fully. - - ---- end of TRUETYPE --- diff --git a/modules/freetype2/docs/UPGRADE.UNIX b/modules/freetype2/docs/UPGRADE.UNIX deleted file mode 100644 index 48c746d703c..00000000000 --- a/modules/freetype2/docs/UPGRADE.UNIX +++ /dev/null @@ -1,137 +0,0 @@ - -SPECIAL NOTE FOR UNIX USERS -=========================== - - If you are installing this release of FreeType on a system that - already uses release 2.0.5 (or even an older version), you have to - perform a few special steps to ensure that everything goes well. - - - 1. Enable the TrueType bytecode hinter if you need it - ----------------------------------------------------- - - See the instructions in the file `TRUETYPE' of this directory. - - Note that FreeType supports TrueType fonts without the bytecode - interpreter through its auto-hinter, which now generates relatively - good results with most fonts. - - - 2. Determine the correct installation path - ------------------------------------------ - - By default, the configure script installs the library in - `/usr/local'. However, many Unix distributions now install the - library in `/usr', since FreeType is becoming a critical system - component. - - If FreeType is already installed on your system, type - - freetype-config --prefix - - on the command line. This should return the installation path - (e.g., `/usr' or `/usr/local'). To avoid problems of parallel - FreeType versions, use this path for the --prefix option of the - configure script. - - Otherwise, simply use `/usr' (or whatever you think is adequate for - your installation). - - - 3. Ensure that you are using GNU Make - ------------------------------------- - - The FreeType build system _exclusively_ works with GNU Make (as an - exception you can use make++ which emulates GNU Make sufficiently; - see http://makepp.sourceforge.net). You will not be able to compile - the library with the instructions below using any other alternative - (including BSD Make). - - Trying to compile the library with a different Make tool prints a - message like: - - Sorry, GNU make is required to build FreeType2. - - and the build process is aborted. If this happens, install GNU Make - on your system, and use the GNUMAKE environment variable to name it. - - - 4. Build and install the library - -------------------------------- - - The following should work on all Unix systems where the `make' - command invokes GNU Make: - - ./configure --prefix= - make - make install (as root) - - where `' must be replaced by the prefix returned by the - `freetype-config' command. - - When using a different command to invoke GNU Make, use the GNUMAKE - variable. For example, if `gmake' is the command to use on your - system, do something like: - - GNUMAKE=gmake ./configure --prefix= - gmake - gmake install (as root) - - - 5. Take care of XFree86 version 4 - --------------------------------- - - Certain Linux distributions install _several_ versions of FreeType - on your system. For example, on a fresh Mandrake 8.1 system, you - can find the following files: - - /usr/lib/libfreetype.so which links to - /usr/lib/libfreetype.6.1.0.so - - and - - /usr/X11R6/lib/libfreetype.so which links to - /usr/X11R6/lib/libfreetype.6.0.so - - Note that these files correspond to two distinct versions of the - library! It seems that this surprising issue is due to the install - scripts of recent XFree86 servers (from 4.1.0) which install their - own (dated) version of the library in `/usr/X11R6/lib'. - - In certain _rare_ cases you may experience minor problems if you - install this release of the library in `/usr' only, namely, that - certain applications do not benefit from the bug fixes and rendering - improvements you would expect. - - There are two good ways to deal with this situation: - - - Install the library _twice_, in `/usr' and in `/usr/X11R6' (you - have to do that each time you install a new FreeType release - though). - - - Change the link in /usr/X11R6/lib/libfreetype.so to point to - - /usr/lib/libfreetype.so, - - and get rid of - - /usr/X11R6/lib/libfreetype.6.0.so - - The FreeType Team is not responsible for this problem, so please - contact either the XFree86 development team or your Linux - distributor to help clear this issue in case the information given - here doesn't help. - ------------------------------------------------------------------------- - -Copyright 2003, 2005 by -David Turner, Robert Wilhelm, and Werner Lemberg. - -This file is part of the FreeType project, and may only be used, -modified, and distributed under the terms of the FreeType project -license, LICENSE.TXT. By continuing to use, modify, or distribute this -file you indicate that you have read the license and understand and -accept it fully. - - ----- end of UPGRADE.UNIX --- diff --git a/modules/freetype2/docs/VERSION.DLL b/modules/freetype2/docs/VERSION.DLL index af796c5eedd..1dfc8c18733 100644 --- a/modules/freetype2/docs/VERSION.DLL +++ b/modules/freetype2/docs/VERSION.DLL @@ -53,6 +53,12 @@ systems, but not all of them: release libtool so ------------------------------- + 2.4.9 14.1.8 6.8.1 + 2.4.8 14.0.8 6.8.0 + 2.4.7 13.2.7 6.7.2 + 2.4.6 13.1.7 6.7.1 + 2.4.5 13.0.7 6.7.0 + 2.4.4 12.2.6 6.6.2 2.4.3 12.1.6 6.6.1 2.4.2 12.0.6 6.6.0 2.4.1 11.1.5 6.5.1 @@ -129,7 +135,7 @@ other release numbers. ------------------------------------------------------------------------ -Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by +Copyright 2002-2012 by David Turner, Robert Wilhelm, and Werner Lemberg. This file is part of the FreeType project, and may only be used, diff --git a/modules/freetype2/docs/formats.txt b/modules/freetype2/docs/formats.txt index efec66060e7..827c8947f8f 100644 --- a/modules/freetype2/docs/formats.txt +++ b/modules/freetype2/docs/formats.txt @@ -11,8 +11,9 @@ reference document and whether it is supported in FreeType 2. wrapper format: The format used to represent the font data. In the table below it is used only if the font format differs. Possible values are `SFNT' - (binary), `PS' (a text header, followed by binary or text data), and - `LZW' (compressed with either `gzip' or `compress'). + (binary), `PS' (a text header, followed by binary or text data), + `LZW' (compressed with either `gzip' or `compress'), and + `BZ2' (compressed with `bzip2`). font format: How the font is to be accessed, possibly after converting the file @@ -113,6 +114,7 @@ MAC --- PS TYPE_1 --- type1 T1_SPEC.pdf --- --- PCF --- --- pcf X11 [4] --- LZW PCF --- --- pcf X11 [4] +--- BZ2 PCF --- --- pcf X11 [4] --- --- PFR PFR0 --- pfr [2] diff --git a/modules/freetype2/docs/reference/.gitignore b/modules/freetype2/docs/reference/.gitignore deleted file mode 100644 index 2d19fc766d9..00000000000 --- a/modules/freetype2/docs/reference/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.html diff --git a/modules/freetype2/docs/reference/ft2-base_interface.html b/modules/freetype2/docs/reference/ft2-base_interface.html index 311420629ae..8c918eaacd9 100644 --- a/modules/freetype2/docs/reference/ft2-base_interface.html +++ b/modules/freetype2/docs/reference/ft2-base_interface.html @@ -3,7 +3,7 @@ -FreeType-2.4.3 API Reference +FreeType-2.4.9 API Reference + + + + + +
    [Index][TOC]
    +

    FreeType-2.4.9 API Reference

    + +

    +BZIP2 Streams +

    +

    Synopsis

    + + +
    FT_Stream_OpenBzip2


    + +
    +

    This section contains the declaration of Bzip2-specific functions.

    +

    +
    +

    FT_Stream_OpenBzip2

    +
    +Defined in FT_BZIP2_H (freetype/ftbzip2.h). +

    +
    +
    +  FT_EXPORT( FT_Error )
    +  FT_Stream_OpenBzip2( FT_Stream  stream,
    +                       FT_Stream  source );
    +
    +

    +
    +

    Open a new stream to parse bzip2-compressed font files. This is mainly used to support the compressed ‘*.pcf.bz2’ fonts that come with XFree86.

    +

    +
    input
    +

    + + + +
    stream +

    The target embedding stream.

    +
    source +

    The source stream.

    +
    +
    +
    return
    +

    FreeType error code. 0 means success.

    +
    +
    note
    +

    The source stream must be opened before calling this function.

    +

    Calling the internal function ‘FT_Stream_Close’ on the new stream will not call ‘FT_Stream_Close’ on the source stream. None of the stream objects will be released to the heap.

    +

    The stream implementation is very basic and resets the decompression process each time seeking backwards is needed within the stream.

    +

    In certain builds of the library, bzip2 compression recognition is automatically handled when calling FT_New_Face or FT_Open_Face. This means that if no font driver is capable of handling the raw compressed file, the library will try to open a bzip2 compressed stream from it and re-open the face with it.

    +

    This function may return ‘FT_Err_Unimplemented_Feature’ if your build of FreeType was not compiled with bzip2 support.

    +
    +
    +
    + + +
    [Index][TOC]
    + + + diff --git a/modules/freetype2/docs/reference/ft2-cache_subsystem.html b/modules/freetype2/docs/reference/ft2-cache_subsystem.html index e3eb78077a7..cb7ad05d747 100644 --- a/modules/freetype2/docs/reference/ft2-cache_subsystem.html +++ b/modules/freetype2/docs/reference/ft2-cache_subsystem.html @@ -3,7 +3,7 @@ -FreeType-2.4.3 API Reference +FreeType-2.4.9 API Reference