зеркало из https://github.com/mozilla/pjs.git
Merge mozilla-central into electrolysis.
This commit is contained in:
Коммит
6f63e14c9e
|
@ -665,7 +665,7 @@ nsApplicationAccessibleWrap::AddRootAccessible(nsIAccessible *aRootAccWrap)
|
|||
AtkObject *atkAccessible = nsAccessibleWrap::GetAtkObject(aRootAccWrap);
|
||||
atk_object_set_parent(atkAccessible, mAtkObject);
|
||||
|
||||
PRUint32 count = mChildren.Count();
|
||||
PRUint32 count = mChildren.Length();
|
||||
|
||||
// Emit children_changed::add in a timeout
|
||||
// to make sure aRootAccWrap is fully initialized.
|
||||
|
|
|
@ -335,6 +335,15 @@ public:
|
|||
|
||||
return object;
|
||||
}
|
||||
template<class DestinationType, class SourceType> static inline
|
||||
already_AddRefed<DestinationType> QueryObject(nsRefPtr<SourceType>& aObject)
|
||||
{
|
||||
DestinationType* object = nsnull;
|
||||
if (aObject)
|
||||
CallQueryInterface(aObject.get(), &object);
|
||||
|
||||
return object;
|
||||
}
|
||||
|
||||
/**
|
||||
* Query nsAccessNode from the given nsIAccessible.
|
||||
|
|
|
@ -148,13 +148,19 @@ nsAccessibleDOMStringList::Contains(const nsAString& aString, PRBool *aResult)
|
|||
NS_IMPL_CYCLE_COLLECTION_CLASS(nsAccessible)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsAccessible, nsAccessNode)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mParent)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMARRAY(mChildren)
|
||||
NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mParent");
|
||||
cb.NoteXPCOMChild(static_cast<nsIAccessible*>(tmp->mParent.get()));
|
||||
|
||||
PRUint32 i, length = tmp->mChildren.Length();
|
||||
for (i = 0; i < length; ++i) {
|
||||
NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mChildren[i]");
|
||||
cb.NoteXPCOMChild(static_cast<nsIAccessible*>(tmp->mChildren[i].get()));
|
||||
}
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(nsAccessible, nsAccessNode)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mParent)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMARRAY(mChildren)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_NSTARRAY(mChildren)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
|
||||
|
||||
NS_IMPL_ADDREF_INHERITED(nsAccessible, nsAccessNode)
|
||||
|
@ -209,8 +215,9 @@ nsresult nsAccessible::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
|||
}
|
||||
|
||||
if (aIID.Equals(NS_GET_IID(nsIAccessibleHyperLink))) {
|
||||
nsCOMPtr<nsIAccessible> parent(GetParent());
|
||||
nsCOMPtr<nsIAccessibleHyperText> hyperTextParent(do_QueryInterface(parent));
|
||||
nsCOMPtr<nsIAccessibleHyperText> hyperTextParent =
|
||||
nsAccUtils::QueryObject<nsIAccessibleHyperText>(GetParent());
|
||||
|
||||
if (hyperTextParent) {
|
||||
*aInstancePtr = static_cast<nsIAccessibleHyperLink*>(this);
|
||||
NS_ADDREF_THIS();
|
||||
|
@ -483,8 +490,7 @@ nsAccessible::Shutdown()
|
|||
// sure none of its children point to this parent
|
||||
InvalidateChildren();
|
||||
if (mParent) {
|
||||
nsRefPtr<nsAccessible> parent(nsAccUtils::QueryAccessible(mParent));
|
||||
parent->InvalidateChildren();
|
||||
mParent->InvalidateChildren();
|
||||
mParent = nsnull;
|
||||
}
|
||||
|
||||
|
@ -569,7 +575,7 @@ nsAccessible::GetChildAt(PRInt32 aChildIndex, nsIAccessible **aChild)
|
|||
if (aChildIndex < 0)
|
||||
aChildIndex = childCount - 1;
|
||||
|
||||
nsIAccessible* child = GetChildAt(aChildIndex);
|
||||
nsAccessible* child = GetChildAt(aChildIndex);
|
||||
if (!child)
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
|
||||
|
@ -2343,9 +2349,7 @@ nsAccessible::GetRelationByType(PRUint32 aRelationType,
|
|||
if (view) {
|
||||
nsIScrollableFrame *scrollFrame = do_QueryFrame(frame);
|
||||
if (scrollFrame || view->GetWidget() || !frame->GetParent()) {
|
||||
nsCOMPtr<nsIAccessible> accTarget;
|
||||
GetParent(getter_AddRefs(accTarget));
|
||||
return nsRelUtils::AddTarget(aRelationType, aRelation, accTarget);
|
||||
return nsRelUtils::AddTarget(aRelationType, aRelation, GetParent());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2692,9 +2696,7 @@ NS_IMETHODIMP nsAccessible::AddChildToSelection(PRInt32 aIndex)
|
|||
|
||||
NS_ENSURE_TRUE(aIndex >= 0, NS_ERROR_FAILURE);
|
||||
|
||||
nsCOMPtr<nsIAccessible> child;
|
||||
GetChildAt(aIndex, getter_AddRefs(child));
|
||||
|
||||
nsAccessible* child = GetChildAt(aIndex);
|
||||
PRUint32 state = nsAccUtils::State(child);
|
||||
if (!(state & nsIAccessibleStates::STATE_SELECTABLE)) {
|
||||
return NS_OK;
|
||||
|
@ -2711,9 +2713,7 @@ NS_IMETHODIMP nsAccessible::RemoveChildFromSelection(PRInt32 aIndex)
|
|||
|
||||
NS_ENSURE_TRUE(aIndex >= 0, NS_ERROR_FAILURE);
|
||||
|
||||
nsCOMPtr<nsIAccessible> child;
|
||||
GetChildAt(aIndex, getter_AddRefs(child));
|
||||
|
||||
nsAccessible* child = GetChildAt(aIndex);
|
||||
PRUint32 state = nsAccUtils::State(child);
|
||||
if (!(state & nsIAccessibleStates::STATE_SELECTED)) {
|
||||
return NS_OK;
|
||||
|
@ -2731,9 +2731,7 @@ NS_IMETHODIMP nsAccessible::IsChildSelected(PRInt32 aIndex, PRBool *aIsSelected)
|
|||
*aIsSelected = PR_FALSE;
|
||||
NS_ENSURE_TRUE(aIndex >= 0, NS_ERROR_FAILURE);
|
||||
|
||||
nsCOMPtr<nsIAccessible> child;
|
||||
GetChildAt(aIndex, getter_AddRefs(child));
|
||||
|
||||
nsAccessible* child = GetChildAt(aIndex);
|
||||
PRUint32 state = nsAccUtils::State(child);
|
||||
if (state & nsIAccessibleStates::STATE_SELECTED) {
|
||||
*aIsSelected = PR_TRUE;
|
||||
|
@ -2860,7 +2858,7 @@ nsAccessible::GetSelected(PRBool *aSelected)
|
|||
nsresult nsAccessible::GetLinkOffset(PRInt32* aStartOffset, PRInt32* aEndOffset)
|
||||
{
|
||||
*aStartOffset = *aEndOffset = 0;
|
||||
nsCOMPtr<nsIAccessible> parent(GetParent());
|
||||
nsAccessible* parent = GetParent();
|
||||
if (!parent) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
@ -2940,7 +2938,7 @@ nsAccessible::GetNameInternal(nsAString& aName)
|
|||
}
|
||||
|
||||
void
|
||||
nsAccessible::SetParent(nsIAccessible *aParent)
|
||||
nsAccessible::SetParent(nsAccessible *aParent)
|
||||
{
|
||||
NS_PRECONDITION(aParent, "This method isn't used to set null parent!");
|
||||
|
||||
|
@ -2950,9 +2948,8 @@ nsAccessible::SetParent(nsIAccessible *aParent)
|
|||
// The old parent's children now need to be invalidated, since
|
||||
// it no longer owns the child, the new parent does
|
||||
NS_ASSERTION(PR_FALSE, "Adopting child!");
|
||||
nsRefPtr<nsAccessible> oldParent = nsAccUtils::QueryAccessible(mParent);
|
||||
if (oldParent)
|
||||
oldParent->InvalidateChildren();
|
||||
if (mParent)
|
||||
mParent->InvalidateChildren();
|
||||
}
|
||||
|
||||
mParent = aParent;
|
||||
|
@ -2961,10 +2958,9 @@ nsAccessible::SetParent(nsIAccessible *aParent)
|
|||
void
|
||||
nsAccessible::InvalidateChildren()
|
||||
{
|
||||
PRInt32 childCount = mChildren.Count();
|
||||
PRInt32 childCount = mChildren.Length();
|
||||
for (PRInt32 childIdx = 0; childIdx < childCount; childIdx++) {
|
||||
nsRefPtr<nsAccessible> child =
|
||||
nsAccUtils::QueryObject<nsAccessible>(mChildren.ObjectAt(childIdx));
|
||||
nsAccessible* child = mChildren.ElementAt(childIdx);
|
||||
child->mParent = nsnull;
|
||||
}
|
||||
|
||||
|
@ -2972,7 +2968,7 @@ nsAccessible::InvalidateChildren()
|
|||
mAreChildrenInitialized = PR_FALSE;
|
||||
}
|
||||
|
||||
nsIAccessible*
|
||||
nsAccessible*
|
||||
nsAccessible::GetParent()
|
||||
{
|
||||
if (IsDefunct())
|
||||
|
@ -2991,8 +2987,9 @@ nsAccessible::GetParent()
|
|||
docAccessible->GetAccessibleInParentChain(mDOMNode, PR_TRUE,
|
||||
getter_AddRefs(parent));
|
||||
|
||||
#ifdef DEBUG
|
||||
nsRefPtr<nsAccessible> parentAcc = nsAccUtils::QueryAccessible(parent);
|
||||
|
||||
#ifdef DEBUG
|
||||
NS_ASSERTION(!parentAcc->IsDefunct(), "Defunct parent!");
|
||||
|
||||
parentAcc->EnsureChildren();
|
||||
|
@ -3000,22 +2997,21 @@ nsAccessible::GetParent()
|
|||
NS_WARNING("Bad accessible tree!");
|
||||
#endif
|
||||
|
||||
return parent;
|
||||
return parentAcc;
|
||||
}
|
||||
|
||||
nsIAccessible*
|
||||
nsAccessible*
|
||||
nsAccessible::GetChildAt(PRUint32 aIndex)
|
||||
{
|
||||
if (EnsureChildren())
|
||||
return nsnull;
|
||||
|
||||
nsIAccessible *child = mChildren.SafeObjectAt(aIndex);
|
||||
nsAccessible *child = mChildren.SafeElementAt(aIndex, nsnull);
|
||||
if (!child)
|
||||
return nsnull;
|
||||
|
||||
#ifdef DEBUG
|
||||
nsRefPtr<nsAccessible> childAcc = nsAccUtils::QueryAccessible(child);
|
||||
nsCOMPtr<nsIAccessible> realParent = childAcc->mParent;
|
||||
nsAccessible* realParent = child->mParent;
|
||||
NS_ASSERTION(!realParent || realParent == this,
|
||||
"Two accessibles have the same first child accessible!");
|
||||
#endif
|
||||
|
@ -3026,7 +3022,7 @@ nsAccessible::GetChildAt(PRUint32 aIndex)
|
|||
PRInt32
|
||||
nsAccessible::GetChildCount()
|
||||
{
|
||||
return EnsureChildren() ? -1 : mChildren.Count();
|
||||
return EnsureChildren() ? -1 : mChildren.Length();
|
||||
}
|
||||
|
||||
PRInt32
|
||||
|
@ -3038,33 +3034,26 @@ nsAccessible::GetIndexOf(nsIAccessible *aChild)
|
|||
PRInt32
|
||||
nsAccessible::GetIndexInParent()
|
||||
{
|
||||
nsIAccessible *parent = GetParent();
|
||||
if (!parent)
|
||||
return -1;
|
||||
|
||||
nsRefPtr<nsAccessible> parentAcc =
|
||||
nsAccUtils::QueryObject<nsAccessible>(parent);
|
||||
return parentAcc->GetIndexOf(this);
|
||||
nsAccessible *parent = GetParent();
|
||||
return parent ? parent->GetIndexOf(this) : -1;
|
||||
}
|
||||
|
||||
already_AddRefed<nsIAccessible>
|
||||
nsAccessible*
|
||||
nsAccessible::GetCachedParent()
|
||||
{
|
||||
if (IsDefunct())
|
||||
return nsnull;
|
||||
|
||||
nsCOMPtr<nsIAccessible> cachedParent = mParent;
|
||||
return cachedParent.forget();
|
||||
return mParent;
|
||||
}
|
||||
|
||||
already_AddRefed<nsIAccessible>
|
||||
nsAccessible*
|
||||
nsAccessible::GetCachedFirstChild()
|
||||
{
|
||||
if (IsDefunct())
|
||||
return nsnull;
|
||||
|
||||
nsCOMPtr<nsIAccessible> cachedFirstChild = GetChildAt(0);
|
||||
return cachedFirstChild.forget();
|
||||
return mChildren.SafeElementAt(0, nsnull);
|
||||
}
|
||||
|
||||
|
||||
|
@ -3085,10 +3074,11 @@ nsAccessible::CacheChildren()
|
|||
|
||||
walker.GetFirstChild();
|
||||
while (walker.mState.accessible) {
|
||||
mChildren.AppendObject(walker.mState.accessible);
|
||||
|
||||
nsRefPtr<nsAccessible> acc =
|
||||
nsAccUtils::QueryObject<nsAccessible>(walker.mState.accessible);
|
||||
|
||||
mChildren.AppendElement(acc);
|
||||
|
||||
acc->SetParent(this);
|
||||
|
||||
walker.GetNextSibling();
|
||||
|
@ -3096,14 +3086,14 @@ nsAccessible::CacheChildren()
|
|||
}
|
||||
|
||||
void
|
||||
nsAccessible::TestChildCache(nsIAccessible *aCachedChild)
|
||||
nsAccessible::TestChildCache(nsAccessible *aCachedChild)
|
||||
{
|
||||
#ifdef DEBUG_A11Y
|
||||
// All cached accessible nodes should be in the parent
|
||||
// It will assert if not all the children were created
|
||||
// when they were first cached, and no invalidation
|
||||
// ever corrected parent accessible's child cache.
|
||||
PRUint32 childCount = mChildren.Count();
|
||||
PRUint32 childCount = mChildren.Length();
|
||||
if (childCount == 0) {
|
||||
NS_ASSERTION(mAreChildrenInitialized,
|
||||
"Children are stored but not initailzied!");
|
||||
|
@ -3111,7 +3101,7 @@ nsAccessible::TestChildCache(nsIAccessible *aCachedChild)
|
|||
}
|
||||
|
||||
for (PRInt32 childIdx = 0; childIdx < childCount; childIdx++) {
|
||||
nsIAccessible *child = GetChildAt(childIdx);
|
||||
nsAccessible *child = GetChildAt(childIdx);
|
||||
if (child == aCachedChild)
|
||||
break;
|
||||
}
|
||||
|
@ -3148,7 +3138,7 @@ nsAccessible::GetSiblingAtOffset(PRInt32 aOffset, nsresult* aError)
|
|||
return nsnull;
|
||||
}
|
||||
|
||||
nsIAccessible *parent = GetParent();
|
||||
nsAccessible *parent = GetParent();
|
||||
if (!parent) {
|
||||
if (aError)
|
||||
*aError = NS_ERROR_UNEXPECTED;
|
||||
|
@ -3156,10 +3146,7 @@ nsAccessible::GetSiblingAtOffset(PRInt32 aOffset, nsresult* aError)
|
|||
return nsnull;
|
||||
}
|
||||
|
||||
nsRefPtr<nsAccessible> parentAcc =
|
||||
nsAccUtils::QueryObject<nsAccessible>(parent);
|
||||
|
||||
PRInt32 indexInParent = parentAcc->GetIndexOf(this);
|
||||
PRInt32 indexInParent = parent->GetIndexOf(this);
|
||||
if (indexInParent == -1) {
|
||||
if (aError)
|
||||
*aError = NS_ERROR_UNEXPECTED;
|
||||
|
@ -3168,14 +3155,14 @@ nsAccessible::GetSiblingAtOffset(PRInt32 aOffset, nsresult* aError)
|
|||
}
|
||||
|
||||
if (aError) {
|
||||
PRInt32 childCount = parentAcc->GetChildCount();
|
||||
PRInt32 childCount = parent->GetChildCount();
|
||||
if (indexInParent + aOffset >= childCount) {
|
||||
*aError = NS_OK; // fail peacefully
|
||||
return nsnull;
|
||||
}
|
||||
}
|
||||
|
||||
nsIAccessible *child = parentAcc->GetChildAt(indexInParent + aOffset);
|
||||
nsAccessible *child = parent->GetChildAt(indexInParent + aOffset);
|
||||
if (aError && !child)
|
||||
*aError = NS_ERROR_UNEXPECTED;
|
||||
|
||||
|
@ -3338,28 +3325,24 @@ nsAccessible::GetPositionAndSizeInternal(PRInt32 *aPosInSet, PRInt32 *aSetSize)
|
|||
role != nsIAccessibleRole::ROLE_GRID_CELL)
|
||||
return;
|
||||
|
||||
PRInt32 positionInGroup = 0;
|
||||
PRInt32 setSize = 0;
|
||||
|
||||
PRUint32 baseRole = role;
|
||||
if (role == nsIAccessibleRole::ROLE_CHECK_MENU_ITEM ||
|
||||
role == nsIAccessibleRole::ROLE_RADIO_MENU_ITEM)
|
||||
baseRole = nsIAccessibleRole::ROLE_MENUITEM;
|
||||
|
||||
nsCOMPtr<nsIAccessible> parent = GetParent();
|
||||
nsAccessible* parent = GetParent();
|
||||
NS_ENSURE_TRUE(parent,);
|
||||
|
||||
// Compute 'posinset' and 'setsize' attributes.
|
||||
PRInt32 positionInGroup = 0;
|
||||
PRInt32 setSize = 0;
|
||||
|
||||
nsCOMPtr<nsIAccessible> sibling, nextSibling;
|
||||
parent->GetFirstChild(getter_AddRefs(sibling));
|
||||
NS_ENSURE_TRUE(sibling,);
|
||||
|
||||
PRBool foundCurrent = PR_FALSE;
|
||||
PRUint32 siblingRole, siblingBaseRole;
|
||||
while (sibling) {
|
||||
siblingRole = nsAccUtils::Role(sibling);
|
||||
PRInt32 siblingCount = parent->GetChildCount();
|
||||
for (PRInt32 siblingIdx = 0; siblingIdx < siblingCount; siblingIdx++) {
|
||||
nsAccessible* sibling = parent->GetChildAt(siblingIdx);
|
||||
|
||||
siblingBaseRole = siblingRole;
|
||||
PRUint32 siblingRole = siblingRole = nsAccUtils::Role(sibling);
|
||||
PRUint32 siblingBaseRole = siblingRole;
|
||||
if (siblingRole == nsIAccessibleRole::ROLE_CHECK_MENU_ITEM ||
|
||||
siblingRole == nsIAccessibleRole::ROLE_RADIO_MENU_ITEM)
|
||||
siblingBaseRole = nsIAccessibleRole::ROLE_MENUITEM;
|
||||
|
@ -3384,9 +3367,6 @@ nsAccessible::GetPositionAndSizeInternal(PRInt32 *aPosInSet, PRInt32 *aSetSize)
|
|||
positionInGroup = 0;
|
||||
setSize = 0;
|
||||
}
|
||||
|
||||
sibling->GetNextSibling(getter_AddRefs(nextSibling));
|
||||
sibling = nextSibling;
|
||||
}
|
||||
|
||||
*aPosInSet = positionInGroup;
|
||||
|
@ -3397,14 +3377,13 @@ PRInt32
|
|||
nsAccessible::GetLevelInternal()
|
||||
{
|
||||
PRUint32 role = nsAccUtils::Role(this);
|
||||
nsCOMPtr<nsIAccessible> parent = GetParent();
|
||||
nsAccessible* parent = GetParent();
|
||||
|
||||
if (role == nsIAccessibleRole::ROLE_OUTLINEITEM) {
|
||||
// Always expose 'level' attribute for 'outlineitem' accessible. The number
|
||||
// of nested 'grouping' accessibles containing 'outlineitem' accessible is
|
||||
// its level.
|
||||
PRInt32 level = 1;
|
||||
nsCOMPtr<nsIAccessible> nextParent;
|
||||
while (parent) {
|
||||
PRUint32 parentRole = nsAccUtils::Role(parent);
|
||||
|
||||
|
@ -3413,8 +3392,7 @@ nsAccessible::GetLevelInternal()
|
|||
if (parentRole == nsIAccessibleRole::ROLE_GROUPING)
|
||||
++ level;
|
||||
|
||||
parent->GetParent(getter_AddRefs(nextParent));
|
||||
parent.swap(nextParent);
|
||||
parent = parent->GetParent();
|
||||
}
|
||||
|
||||
return level;
|
||||
|
@ -3428,7 +3406,6 @@ nsAccessible::GetLevelInternal()
|
|||
|
||||
// Calculate 'level' attribute based on number of parent listitems.
|
||||
PRInt32 level = 0;
|
||||
nsCOMPtr<nsIAccessible> nextParent;
|
||||
|
||||
while (parent) {
|
||||
PRUint32 parentRole = nsAccUtils::Role(parent);
|
||||
|
@ -3438,26 +3415,23 @@ nsAccessible::GetLevelInternal()
|
|||
else if (parentRole != nsIAccessibleRole::ROLE_LIST)
|
||||
break;
|
||||
|
||||
parent->GetParent(getter_AddRefs(nextParent));
|
||||
parent.swap(nextParent);
|
||||
parent = parent->GetParent();
|
||||
}
|
||||
|
||||
if (level == 0) {
|
||||
// If this listitem is on top of nested lists then expose 'level'
|
||||
// attribute.
|
||||
nsCOMPtr<nsIAccessible> parent(GetParent()), sibling, nextSibling;
|
||||
parent->GetFirstChild(getter_AddRefs(sibling));
|
||||
nsAccessible* parent(GetParent());
|
||||
PRInt32 siblingCount = parent->GetChildCount();
|
||||
for (PRInt32 siblingIdx = 0; siblingIdx < siblingCount; siblingIdx++) {
|
||||
nsAccessible* sibling = parent->GetChildAt(siblingIdx);
|
||||
|
||||
while (sibling) {
|
||||
nsCOMPtr<nsIAccessible> siblingChild;
|
||||
sibling->GetLastChild(getter_AddRefs(siblingChild));
|
||||
if (nsAccUtils::Role(siblingChild) == nsIAccessibleRole::ROLE_LIST) {
|
||||
level = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
sibling->GetNextSibling(getter_AddRefs(nextSibling));
|
||||
sibling.swap(nextSibling);
|
||||
}
|
||||
} else {
|
||||
++ level; // level is 1-index based
|
||||
|
|
|
@ -103,11 +103,11 @@ private:
|
|||
|
||||
|
||||
#define NS_ACCESSIBLE_IMPL_CID \
|
||||
{ /* 81a84b69-de5a-412f-85ff-deb005c5a68d */ \
|
||||
0x81a84b69, \
|
||||
0xde5a, \
|
||||
0x412f, \
|
||||
{ 0x85, 0xff, 0xde, 0xb0, 0x05, 0xc5, 0xa6, 0x8d } \
|
||||
{ /* c734df37-7e12-49ec-8983-eea88a186bb8 */ \
|
||||
0xc734df37, \
|
||||
0x7e12, \
|
||||
0x49ec, \
|
||||
{ 0x89, 0x83, 0xee, 0xa8, 0x8a, 0x18, 0x6b, 0xb8 } \
|
||||
}
|
||||
|
||||
class nsAccessible : public nsAccessNodeWrap,
|
||||
|
@ -228,7 +228,7 @@ public:
|
|||
/**
|
||||
* Set accessible parent.
|
||||
*/
|
||||
void SetParent(nsIAccessible *aParent);
|
||||
void SetParent(nsAccessible *aParent);
|
||||
|
||||
/**
|
||||
* Set the child count to -1 (unknown) and null out cached child pointers.
|
||||
|
@ -243,12 +243,12 @@ public:
|
|||
/**
|
||||
* Return parent accessible.
|
||||
*/
|
||||
virtual nsIAccessible* GetParent();
|
||||
virtual nsAccessible* GetParent();
|
||||
|
||||
/**
|
||||
* Return child accessible at the given index.
|
||||
*/
|
||||
virtual nsIAccessible* GetChildAt(PRUint32 aIndex);
|
||||
virtual nsAccessible* GetChildAt(PRUint32 aIndex);
|
||||
|
||||
/**
|
||||
* Return child accessible count.
|
||||
|
@ -268,12 +268,12 @@ public:
|
|||
/**
|
||||
* Return parent accessible only if cached.
|
||||
*/
|
||||
already_AddRefed<nsIAccessible> GetCachedParent();
|
||||
nsAccessible* GetCachedParent();
|
||||
|
||||
/**
|
||||
* Return first child accessible only if cached.
|
||||
*/
|
||||
already_AddRefed<nsIAccessible> GetCachedFirstChild();
|
||||
nsAccessible* GetCachedFirstChild();
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// Miscellaneous methods
|
||||
|
@ -312,7 +312,7 @@ protected:
|
|||
/**
|
||||
* Assert if child not in parent's cache.
|
||||
*/
|
||||
void TestChildCache(nsIAccessible *aCachedChild);
|
||||
void TestChildCache(nsAccessible *aCachedChild);
|
||||
|
||||
/**
|
||||
* Cache children if necessary. Return true if the accessible is defunct.
|
||||
|
@ -454,8 +454,8 @@ protected:
|
|||
virtual nsresult FirePlatformEvent(nsIAccessibleEvent *aEvent) = 0;
|
||||
|
||||
// Data Members
|
||||
nsCOMPtr<nsIAccessible> mParent;
|
||||
nsCOMArray<nsIAccessible> mChildren;
|
||||
nsRefPtr<nsAccessible> mParent;
|
||||
nsTArray<nsRefPtr<nsAccessible> > mChildren;
|
||||
PRBool mAreChildrenInitialized;
|
||||
|
||||
nsRoleMapEntry *mRoleMapEntry; // Non-null indicates author-supplied role; possibly state & value as well
|
||||
|
|
|
@ -160,7 +160,7 @@ nsApplicationAccessible::GetStateInternal(PRUint32 *aState,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
nsIAccessible*
|
||||
nsAccessible*
|
||||
nsApplicationAccessible::GetParent()
|
||||
{
|
||||
return nsnull;
|
||||
|
@ -207,10 +207,12 @@ nsApplicationAccessible::AddRootAccessible(nsIAccessible *aRootAccessible)
|
|||
{
|
||||
NS_ENSURE_ARG_POINTER(aRootAccessible);
|
||||
|
||||
if (!mChildren.AppendObject(aRootAccessible))
|
||||
nsRefPtr<nsAccessible> rootAcc =
|
||||
nsAccUtils::QueryObject<nsAccessible>(aRootAccessible);
|
||||
|
||||
if (!mChildren.AppendElement(rootAcc))
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
nsRefPtr<nsAccessible> rootAcc = nsAccUtils::QueryAccessible(aRootAccessible);
|
||||
rootAcc->SetParent(this);
|
||||
|
||||
return NS_OK;
|
||||
|
@ -224,5 +226,5 @@ nsApplicationAccessible::RemoveRootAccessible(nsIAccessible *aRootAccessible)
|
|||
// It's not needed to void root accessible parent because this method is
|
||||
// called on root accessible shutdown and its parent will be cleared
|
||||
// properly.
|
||||
return mChildren.RemoveObject(aRootAccessible) ? NS_OK : NS_ERROR_FAILURE;
|
||||
return mChildren.RemoveElement(aRootAccessible) ? NS_OK : NS_ERROR_FAILURE;
|
||||
}
|
||||
|
|
|
@ -79,7 +79,7 @@ public:
|
|||
// nsAccessible
|
||||
virtual nsresult GetRoleInternal(PRUint32 *aRole);
|
||||
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
|
||||
virtual nsIAccessible* GetParent();
|
||||
virtual nsAccessible* GetParent();
|
||||
|
||||
virtual void InvalidateChildren();
|
||||
|
||||
|
|
|
@ -346,9 +346,8 @@ nsDocAccessible::GetARIAState(PRUint32 *aState, PRUint32 *aExtraState)
|
|||
nsresult rv = nsAccessible::GetARIAState(aState, aExtraState);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsRefPtr<nsAccessible> parent = nsAccUtils::QueryAccessible(mParent);
|
||||
if (parent) // Allow iframe/frame etc. to have final state override via ARIA
|
||||
return parent->GetARIAState(aState, aExtraState);
|
||||
if (mParent) // Allow iframe/frame etc. to have final state override via ARIA
|
||||
return mParent->GetARIAState(aState, aExtraState);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
@ -554,13 +553,13 @@ NS_IMETHODIMP nsDocAccessible::GetCachedAccessNode(void *aUniqueID, nsIAccessNod
|
|||
// It will assert if not all the children were created
|
||||
// when they were first cached, and no invalidation
|
||||
// ever corrected parent accessible's child cache.
|
||||
nsCOMPtr<nsIAccessible> accessible = do_QueryInterface(*aAccessNode);
|
||||
nsRefPtr<nsAccessible> acc = nsAccUtils::QueryAccessible(accessible);
|
||||
nsRefPtr<nsAccessible> acc =
|
||||
nsAccUtils::QueryObject<nsAccessible>(*aAccessNode);
|
||||
|
||||
if (acc) {
|
||||
nsCOMPtr<nsIAccessible> parent = acc->GetCachedParent();
|
||||
nsRefPtr<nsAccessible> parentAcc(nsAccUtils::QueryAccessible(parent));
|
||||
if (parentAcc)
|
||||
parentAcc->TestChildCache(accessible);
|
||||
nsAccessible* parent(acc->GetCachedParent());
|
||||
if (parent)
|
||||
parent->TestChildCache(acc);
|
||||
}
|
||||
#endif
|
||||
return NS_OK;
|
||||
|
@ -880,7 +879,7 @@ nsDocAccessible::FireDocLoadEvents(PRUint32 aEventType)
|
|||
if (isFinished) {
|
||||
// Need to wait until scrollable view is available
|
||||
AddScrollListener();
|
||||
nsRefPtr<nsAccessible> acc(nsAccUtils::QueryAccessible(GetParent()));
|
||||
nsRefPtr<nsAccessible> acc(GetParent());
|
||||
if (acc) {
|
||||
// Make the parent forget about the old document as a child
|
||||
acc->InvalidateChildren();
|
||||
|
@ -1421,7 +1420,7 @@ nsDocAccessible::ParentChainChanged(nsIContent *aContent)
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsAccessible
|
||||
|
||||
nsIAccessible*
|
||||
nsAccessible*
|
||||
nsDocAccessible::GetParent()
|
||||
{
|
||||
if (IsDefunct())
|
||||
|
@ -1444,7 +1443,9 @@ nsDocAccessible::GetParent()
|
|||
// hierarchy. GetAccessibleFor() is bad because it doesn't support our
|
||||
// concept of multiple presshells per doc.
|
||||
// It should be changed to use GetAccessibleInWeakShell()
|
||||
accService->GetAccessibleFor(ownerNode, getter_AddRefs(mParent));
|
||||
nsCOMPtr<nsIAccessible> parent;
|
||||
accService->GetAccessibleFor(ownerNode, getter_AddRefs(parent));
|
||||
mParent = nsAccUtils::QueryObject<nsAccessible>(parent);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1931,8 +1932,7 @@ void nsDocAccessible::RefreshNodes(nsIDOMNode *aStartNode)
|
|||
|
||||
// We only need to shutdown the accessibles here if one of them has been
|
||||
// created.
|
||||
nsCOMPtr<nsIAccessible> childAccessible = acc->GetCachedFirstChild();
|
||||
if (childAccessible) {
|
||||
if (acc->GetCachedFirstChild()) {
|
||||
nsCOMPtr<nsIArray> children;
|
||||
// use GetChildren() to fetch children at one time, instead of using
|
||||
// GetNextSibling(), because after we shutdown the first child,
|
||||
|
|
|
@ -112,7 +112,7 @@ public:
|
|||
virtual nsresult GetARIAState(PRUint32 *aState, PRUint32 *aExtraState);
|
||||
|
||||
virtual void SetRoleMapEntry(nsRoleMapEntry* aRoleMapEntry);
|
||||
virtual nsIAccessible* GetParent();
|
||||
virtual nsAccessible* GetParent();
|
||||
|
||||
// nsIAccessibleText
|
||||
NS_IMETHOD GetAssociatedEditor(nsIEditor **aEditor);
|
||||
|
|
|
@ -127,7 +127,7 @@ nsOuterDocAccessible::CacheChildren()
|
|||
return;
|
||||
|
||||
// Success getting inner document as first child -- now we cache it.
|
||||
mChildren.AppendObject(innerAccessible);
|
||||
mChildren.AppendElement(innerAcc);
|
||||
innerAcc->SetParent(this);
|
||||
}
|
||||
|
||||
|
|
|
@ -1062,7 +1062,7 @@ nsRootAccessible::GetRelationByType(PRUint32 aRelationType,
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsAccessible
|
||||
|
||||
nsIAccessible*
|
||||
nsAccessible*
|
||||
nsRootAccessible::GetParent()
|
||||
{
|
||||
// Parent has been setted in nsApplicationAccesible::AddRootAccessible()
|
||||
|
|
|
@ -87,7 +87,7 @@ public:
|
|||
// nsAccessible
|
||||
virtual nsresult GetRoleInternal(PRUint32 *aRole);
|
||||
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
|
||||
virtual nsIAccessible* GetParent();
|
||||
virtual nsAccessible* GetParent();
|
||||
|
||||
// nsDocAccessible
|
||||
virtual void FireDocLoadEvents(PRUint32 aEventType);
|
||||
|
|
|
@ -673,19 +673,20 @@ nsHTMLLegendAccessible::GetRelationByType(PRUint32 aRelationType,
|
|||
|
||||
if (aRelationType == nsIAccessibleRelation::RELATION_LABEL_FOR) {
|
||||
// Look for groupbox parent
|
||||
nsCOMPtr<nsIAccessible> groupboxAccessible = GetParent();
|
||||
if (nsAccUtils::Role(groupboxAccessible) == nsIAccessibleRole::ROLE_GROUPING) {
|
||||
nsAccessible* groupbox = GetParent();
|
||||
|
||||
if (nsAccUtils::Role(groupbox) == nsIAccessibleRole::ROLE_GROUPING) {
|
||||
// XXX: if group box exposes more than one relation of the given type
|
||||
// then we fail.
|
||||
nsCOMPtr<nsIAccessible> testLabelAccessible =
|
||||
nsRelUtils::GetRelatedAccessible(groupboxAccessible,
|
||||
nsRelUtils::GetRelatedAccessible(groupbox,
|
||||
nsIAccessibleRelation::RELATION_LABELLED_BY);
|
||||
|
||||
if (testLabelAccessible == this) {
|
||||
// We're the first child of the parent groupbox, see
|
||||
// nsHTMLGroupboxAccessible::GetRelationByType().
|
||||
return nsRelUtils::
|
||||
AddTarget(aRelationType, aRelation, groupboxAccessible);
|
||||
AddTarget(aRelationType, aRelation, groupbox);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -173,8 +173,8 @@ nsHTMLImageAccessible::CacheChildren()
|
|||
if (!areaAccessible)
|
||||
return;
|
||||
|
||||
mChildren.AppendObject(areaAccessible);
|
||||
areaAcc = nsAccUtils::QueryObject<nsAccessible>(areaAccessible);
|
||||
mChildren.AppendElement(areaAcc);
|
||||
areaAcc->SetParent(this);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -403,10 +403,10 @@ nsHTMLSelectListAccessible::CacheOptSiblings(nsIContent *aParentContent)
|
|||
GetAccService()->GetAccessibleInWeakShell(childNode, mWeakShell,
|
||||
getter_AddRefs(accessible));
|
||||
if (accessible) {
|
||||
mChildren.AppendObject(accessible);
|
||||
|
||||
nsRefPtr<nsAccessible> acc =
|
||||
nsAccUtils::QueryObject<nsAccessible>(accessible);
|
||||
|
||||
mChildren.AppendElement(acc);
|
||||
acc->SetParent(this);
|
||||
}
|
||||
|
||||
|
@ -445,7 +445,10 @@ nsHyperTextAccessibleWrap(aDOMNode, aShell)
|
|||
}
|
||||
}
|
||||
}
|
||||
SetParent(parentAccessible);
|
||||
|
||||
nsRefPtr<nsAccessible> parentAcc =
|
||||
nsAccUtils::QueryObject<nsAccessible>(parentAccessible);
|
||||
SetParent(parentAcc);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -585,12 +588,12 @@ nsHTMLSelectOptionAccessible::GetStateInternal(PRUint32 *aState,
|
|||
// visibility implementation unless they get reimplemented in layout
|
||||
*aState &= ~nsIAccessibleStates::STATE_OFFSCREEN;
|
||||
// <select> is not collapsed: compare bounds to calculate STATE_OFFSCREEN
|
||||
nsCOMPtr<nsIAccessible> listAccessible = GetParent();
|
||||
if (listAccessible) {
|
||||
nsAccessible* listAcc = GetParent();
|
||||
if (listAcc) {
|
||||
PRInt32 optionX, optionY, optionWidth, optionHeight;
|
||||
PRInt32 listX, listY, listWidth, listHeight;
|
||||
GetBounds(&optionX, &optionY, &optionWidth, &optionHeight);
|
||||
listAccessible->GetBounds(&listX, &listY, &listWidth, &listHeight);
|
||||
listAcc->GetBounds(&listX, &listY, &listWidth, &listHeight);
|
||||
if (optionY < listY || optionY + optionHeight > listY + listHeight) {
|
||||
*aState |= nsIAccessibleStates::STATE_OFFSCREEN;
|
||||
}
|
||||
|
@ -672,10 +675,10 @@ NS_IMETHODIMP nsHTMLSelectOptionAccessible::DoAction(PRUint8 index)
|
|||
return NS_ERROR_FAILURE;
|
||||
// Clear old selection
|
||||
nsCOMPtr<nsIDOMNode> oldHTMLOptionNode, selectNode;
|
||||
nsCOMPtr<nsIAccessible> parent(GetParent());
|
||||
nsCOMPtr<nsIAccessNode> accessNode(do_QueryInterface(parent));
|
||||
NS_ASSERTION(accessNode, "Unable to QI to nsIAccessNode");
|
||||
accessNode->GetDOMNode(getter_AddRefs(selectNode));
|
||||
nsAccessible* parent = GetParent();
|
||||
NS_ASSERTION(parent, "No parent!");
|
||||
|
||||
parent->GetDOMNode(getter_AddRefs(selectNode));
|
||||
GetFocusedOptionNode(selectNode, getter_AddRefs(oldHTMLOptionNode));
|
||||
nsCOMPtr<nsIDOMHTMLOptionElement> oldHTMLOption(do_QueryInterface(oldHTMLOptionNode));
|
||||
if (oldHTMLOption)
|
||||
|
@ -953,7 +956,7 @@ nsHTMLComboboxAccessible::CacheChildren()
|
|||
mListAccessible->Init();
|
||||
}
|
||||
|
||||
mChildren.AppendObject(mListAccessible);
|
||||
mChildren.AppendElement(mListAccessible);
|
||||
mListAccessible->SetParent(this);
|
||||
}
|
||||
|
||||
|
@ -1170,11 +1173,11 @@ void nsHTMLComboboxListAccessible::GetBoundsRect(nsRect& aBounds, nsIFrame** aBo
|
|||
{
|
||||
*aBoundingFrame = nsnull;
|
||||
|
||||
nsCOMPtr<nsIAccessible> comboAccessible = GetParent();
|
||||
if (!comboAccessible)
|
||||
nsAccessible* comboAcc = GetParent();
|
||||
if (!comboAcc)
|
||||
return;
|
||||
|
||||
if (0 == (nsAccUtils::State(comboAccessible) & nsIAccessibleStates::STATE_COLLAPSED)) {
|
||||
if (0 == (nsAccUtils::State(comboAcc) & nsIAccessibleStates::STATE_COLLAPSED)) {
|
||||
nsHTMLSelectListAccessible::GetBoundsRect(aBounds, aBoundingFrame);
|
||||
return;
|
||||
}
|
||||
|
@ -1198,7 +1201,7 @@ void nsHTMLComboboxListAccessible::GetBoundsRect(nsRect& aBounds, nsIFrame** aBo
|
|||
}
|
||||
|
||||
// nsHTMLComboboxListAccessible. nsAccessible public mehtod
|
||||
nsIAccessible*
|
||||
nsAccessible*
|
||||
nsHTMLComboboxListAccessible::GetParent()
|
||||
{
|
||||
return mParent;
|
||||
|
|
|
@ -271,7 +271,7 @@ public:
|
|||
// nsAccessible
|
||||
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
|
||||
virtual void GetBoundsRect(nsRect& aBounds, nsIFrame** aBoundingFrame);
|
||||
virtual nsIAccessible* GetParent();
|
||||
virtual nsAccessible* GetParent();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -461,20 +461,20 @@ nsHTMLTableAccessible::CacheChildren()
|
|||
nsAccessible::CacheChildren();
|
||||
|
||||
// Move caption accessible so that it's the first child.
|
||||
PRInt32 length = mChildren.Count();
|
||||
PRInt32 length = mChildren.Length();
|
||||
for (PRInt32 idx = 0; idx < length; idx++) {
|
||||
// Check for the first caption, because nsAccessibilityService ensures we
|
||||
// don't create accessibles for the other captions, since only the first is
|
||||
// actually visible.
|
||||
|
||||
nsIAccessible* child = mChildren.ObjectAt(idx);
|
||||
nsAccessible* child = mChildren.ElementAt(idx);
|
||||
if (nsAccUtils::Role(child) == nsIAccessibleRole::ROLE_CAPTION) {
|
||||
if (idx == 0)
|
||||
break;
|
||||
|
||||
nsCOMPtr<nsIAccessible> tmp = mChildren.ObjectAt(0);
|
||||
mChildren.ReplaceObjectAt(child, 0);
|
||||
mChildren.ReplaceObjectAt(tmp, idx);
|
||||
nsRefPtr<nsAccessible> tmp = mChildren[0];
|
||||
mChildren[0] = child;
|
||||
mChildren[idx] = tmp;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -270,7 +270,7 @@ void
|
|||
nsHTMLLIAccessible::CacheChildren()
|
||||
{
|
||||
if (mBulletAccessible) {
|
||||
mChildren.AppendObject(mBulletAccessible);
|
||||
mChildren.AppendElement(mBulletAccessible);
|
||||
mBulletAccessible->SetParent(this);
|
||||
}
|
||||
|
||||
|
@ -343,7 +343,7 @@ nsHTMLListBulletAccessible::AppendTextTo(nsAString& aText, PRUint32 aStartOffset
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
nsIAccessible*
|
||||
nsAccessible*
|
||||
nsHTMLListBulletAccessible::GetParent()
|
||||
{
|
||||
return mParent;
|
||||
|
|
|
@ -116,7 +116,7 @@ public:
|
|||
virtual nsresult AppendTextTo(nsAString& aText, PRUint32 aStartOffset,
|
||||
PRUint32 aLength);
|
||||
|
||||
virtual nsIAccessible* GetParent();
|
||||
virtual nsAccessible* GetParent();
|
||||
|
||||
protected:
|
||||
// XXX: Ideally we'd get the bullet text directly from the bullet frame via
|
||||
|
|
|
@ -232,10 +232,10 @@ nsHyperTextAccessible::CacheChildren()
|
|||
|
||||
walker.GetFirstChild();
|
||||
while (walker.mState.accessible) {
|
||||
mChildren.AppendObject(walker.mState.accessible);
|
||||
|
||||
nsRefPtr<nsAccessible> acc =
|
||||
nsAccUtils::QueryObject<nsAccessible>(walker.mState.accessible);
|
||||
|
||||
mChildren.AppendElement(acc);
|
||||
acc->SetParent(this);
|
||||
|
||||
walker.GetNextSibling();
|
||||
|
@ -859,7 +859,7 @@ nsHyperTextAccessible::GetRelativeOffset(nsIPresShell *aPresShell,
|
|||
hyperTextOffset = 0;
|
||||
}
|
||||
else if (aAmount == eSelectBeginLine) {
|
||||
nsIAccessible *firstChild = mChildren.SafeObjectAt(0);
|
||||
nsAccessible *firstChild = mChildren.SafeElementAt(0, nsnull);
|
||||
// For line selection with needsStart, set start of line exactly to line break
|
||||
if (pos.mContentOffset == 0 && firstChild &&
|
||||
nsAccUtils::Role(firstChild) == nsIAccessibleRole::ROLE_STATICTEXT &&
|
||||
|
|
|
@ -105,15 +105,13 @@ class nsAccessibleWrap : public nsAccessible
|
|||
//
|
||||
// to maintain a scripting environment where the XPCOM accessible hierarchy look the same
|
||||
// on all platforms, we still let the C++ objects be created though.
|
||||
|
||||
nsCOMPtr<nsIAccessible> curParent = GetParent();
|
||||
while (curParent) {
|
||||
if (nsAccUtils::MustPrune(curParent))
|
||||
|
||||
nsAccessible* parent(GetParent());
|
||||
while (parent) {
|
||||
if (nsAccUtils::MustPrune(parent))
|
||||
return PR_TRUE;
|
||||
|
||||
nsCOMPtr<nsIAccessible> newParent;
|
||||
curParent->GetParent(getter_AddRefs(newParent));
|
||||
curParent.swap(newParent);
|
||||
parent = parent->GetParent();
|
||||
}
|
||||
// no parent was flat
|
||||
return PR_FALSE;
|
||||
|
|
|
@ -300,8 +300,7 @@ nsAccessibleWrap::GetUnignoredChildren(nsTArray<nsRefPtr<nsAccessibleWrap> > &aC
|
|||
already_AddRefed<nsIAccessible>
|
||||
nsAccessibleWrap::GetUnignoredParent()
|
||||
{
|
||||
nsCOMPtr<nsIAccessible> parent(GetParent());
|
||||
nsAccessibleWrap *parentWrap = static_cast<nsAccessibleWrap*>(parent.get());
|
||||
nsAccessibleWrap *parentWrap = static_cast<nsAccessibleWrap*>(GetParent());
|
||||
if (!parentWrap)
|
||||
return nsnull;
|
||||
|
||||
|
|
|
@ -237,12 +237,14 @@ __try {
|
|||
}
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIAccessible> xpParentAccessible(GetParent());
|
||||
NS_ASSERTION(xpParentAccessible, "No parent accessible where we're not direct child of window");
|
||||
if (!xpParentAccessible) {
|
||||
nsAccessible* xpParentAcc = GetParent();
|
||||
NS_ASSERTION(xpParentAcc,
|
||||
"No parent accessible where we're not direct child of window");
|
||||
|
||||
if (!xpParentAcc)
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
*ppdispParent = NativeAccessible(xpParentAccessible);
|
||||
|
||||
*ppdispParent = NativeAccessible(xpParentAcc);
|
||||
|
||||
} __except(FilterA11yExceptions(::GetExceptionCode(), GetExceptionInformation())) { }
|
||||
return S_OK;
|
||||
|
@ -278,11 +280,10 @@ __try {
|
|||
return S_OK;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIAccessible> childAccessible;
|
||||
if (!nsAccUtils::MustPrune(this)) {
|
||||
GetChildAt(varChild.lVal - 1, getter_AddRefs(childAccessible));
|
||||
if (childAccessible) {
|
||||
*ppdispChild = NativeAccessible(childAccessible);
|
||||
nsAccessible* child = GetChildAt(varChild.lVal - 1);
|
||||
if (child) {
|
||||
*ppdispChild = NativeAccessible(child);
|
||||
}
|
||||
}
|
||||
} __except(FilterA11yExceptions(::GetExceptionCode(), GetExceptionInformation())) { }
|
||||
|
@ -483,8 +484,7 @@ __try {
|
|||
// a ROLE_OUTLINEITEM for consistency and compatibility.
|
||||
// We need this because ARIA has a role of "row" for both grid and treegrid
|
||||
if (xpRole == nsIAccessibleRole::ROLE_ROW) {
|
||||
nsCOMPtr<nsIAccessible> parent = GetParent();
|
||||
if (nsAccUtils::Role(parent) == nsIAccessibleRole::ROLE_TREE_TABLE)
|
||||
if (nsAccUtils::Role(GetParent()) == nsIAccessibleRole::ROLE_TREE_TABLE)
|
||||
msaaRole = ROLE_SYSTEM_OUTLINEITEM;
|
||||
}
|
||||
|
||||
|
@ -1102,7 +1102,7 @@ __try {
|
|||
for (; numElementsFetched < aNumElementsRequested;
|
||||
numElementsFetched++, mEnumVARIANTPosition++) {
|
||||
|
||||
nsIAccessible* accessible = GetChildAt(mEnumVARIANTPosition);
|
||||
nsAccessible* accessible = GetChildAt(mEnumVARIANTPosition);
|
||||
if (!accessible)
|
||||
break;
|
||||
|
||||
|
@ -1286,8 +1286,7 @@ __try {
|
|||
// Special case, if there is a ROLE_ROW inside of a ROLE_TREE_TABLE, then call
|
||||
// the IA2 role a ROLE_OUTLINEITEM.
|
||||
if (xpRole == nsIAccessibleRole::ROLE_ROW) {
|
||||
nsCOMPtr<nsIAccessible> parent = GetParent();
|
||||
if (nsAccUtils::Role(parent) == nsIAccessibleRole::ROLE_TREE_TABLE)
|
||||
if (nsAccUtils::Role(GetParent()) == nsIAccessibleRole::ROLE_TREE_TABLE)
|
||||
*aRole = ROLE_SYSTEM_OUTLINEITEM;
|
||||
}
|
||||
|
||||
|
|
|
@ -100,11 +100,8 @@ void
|
|||
nsHTMLWin32ObjectOwnerAccessible::CacheChildren()
|
||||
{
|
||||
if (mNativeAccessible) {
|
||||
mChildren.AppendObject(mNativeAccessible);
|
||||
|
||||
nsRefPtr<nsAccessible> nativeAcc =
|
||||
nsAccUtils::QueryObject<nsAccessible>(mNativeAccessible);
|
||||
nativeAcc->SetParent(this);
|
||||
mChildren.AppendElement(mNativeAccessible);
|
||||
mNativeAccessible->SetParent(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@ protected:
|
|||
virtual void CacheChildren();
|
||||
|
||||
void* mHwnd;
|
||||
nsCOMPtr<nsIAccessible> mNativeAccessible;
|
||||
nsRefPtr<nsAccessible> mNativeAccessible;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -136,8 +136,8 @@ nsXFormsAccessible::CacheSelectChildren(nsIDOMNode *aContainerNode)
|
|||
if (!accessible)
|
||||
continue;
|
||||
|
||||
mChildren.AppendObject(accessible);
|
||||
acc = nsAccUtils::QueryObject<nsAccessible>(accessible);
|
||||
mChildren.AppendElement(acc);
|
||||
acc->SetParent(this);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -175,10 +175,10 @@ nsXULColorPickerAccessible::CacheChildren()
|
|||
|
||||
// Get an accessbile for menupopup or panel elements.
|
||||
if (role == nsIAccessibleRole::ROLE_ALERT) {
|
||||
mChildren.AppendObject(walker.mState.accessible);
|
||||
|
||||
nsRefPtr<nsAccessible> menupopupAcc =
|
||||
nsAccUtils::QueryObject<nsAccessible>(walker.mState.accessible);
|
||||
|
||||
mChildren.AppendElement(menupopupAcc);
|
||||
menupopupAcc->SetParent(this);
|
||||
|
||||
return;
|
||||
|
|
|
@ -229,17 +229,17 @@ nsXULButtonAccessible::CacheChildren()
|
|||
if (!menupopupAccessible)
|
||||
return;
|
||||
|
||||
mChildren.AppendObject(menupopupAccessible);
|
||||
|
||||
nsRefPtr<nsAccessible> menupopupAcc =
|
||||
nsAccUtils::QueryObject<nsAccessible>(menupopupAccessible);
|
||||
|
||||
mChildren.AppendElement(menupopupAcc);
|
||||
menupopupAcc->SetParent(this);
|
||||
|
||||
if (buttonAccessible) {
|
||||
mChildren.AppendObject(buttonAccessible);
|
||||
|
||||
nsRefPtr<nsAccessible> buttonAcc =
|
||||
nsAccUtils::QueryObject<nsAccessible>(buttonAccessible);
|
||||
|
||||
mChildren.AppendElement(buttonAcc);
|
||||
buttonAcc->SetParent(this);
|
||||
}
|
||||
}
|
||||
|
@ -776,26 +776,26 @@ void
|
|||
nsXULToolbarButtonAccessible::GetPositionAndSizeInternal(PRInt32 *aPosInSet,
|
||||
PRInt32 *aSetSize)
|
||||
{
|
||||
nsCOMPtr<nsIAccessible> parent(GetParent());
|
||||
PRInt32 setSize = 0;
|
||||
PRInt32 posInSet = 0;
|
||||
|
||||
if (parent) {
|
||||
nsCOMPtr<nsIAccessible> sibling;
|
||||
nsCOMPtr<nsIAccessible> tempSibling;
|
||||
parent->GetFirstChild(getter_AddRefs(sibling));
|
||||
while (sibling) {
|
||||
if (IsSeparator(sibling)) { // end of a group of buttons
|
||||
if (posInSet)
|
||||
break; // we've found our group, so we're done
|
||||
setSize = 0; // not our group, so start a new group
|
||||
} else {
|
||||
setSize++; // another button in the group
|
||||
if (sibling == this)
|
||||
posInSet = setSize; // we've found our button
|
||||
}
|
||||
sibling->GetNextSibling(getter_AddRefs(tempSibling));
|
||||
sibling.swap(tempSibling);
|
||||
nsAccessible* parent(GetParent());
|
||||
NS_ENSURE_TRUE(parent,);
|
||||
|
||||
PRInt32 childCount = parent->GetChildCount();
|
||||
for (PRInt32 childIdx = 0; childIdx < childCount; childIdx++) {
|
||||
nsAccessible* child = parent->GetChildAt(childIdx);
|
||||
if (IsSeparator(child)) { // end of a group of buttons
|
||||
if (posInSet)
|
||||
break; // we've found our group, so we're done
|
||||
|
||||
setSize = 0; // not our group, so start a new group
|
||||
|
||||
} else {
|
||||
setSize++; // another button in the group
|
||||
|
||||
if (child == this)
|
||||
posInSet = setSize; // we've found our button
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -804,11 +804,10 @@ nsXULToolbarButtonAccessible::GetPositionAndSizeInternal(PRInt32 *aPosInSet,
|
|||
}
|
||||
|
||||
PRBool
|
||||
nsXULToolbarButtonAccessible::IsSeparator(nsIAccessible *aAccessible)
|
||||
nsXULToolbarButtonAccessible::IsSeparator(nsAccessible *aAccessible)
|
||||
{
|
||||
nsCOMPtr<nsIDOMNode> domNode;
|
||||
nsCOMPtr<nsIAccessNode> accessNode(do_QueryInterface(aAccessible));
|
||||
accessNode->GetDOMNode(getter_AddRefs(domNode));
|
||||
aAccessible->GetDOMNode(getter_AddRefs(domNode));
|
||||
nsCOMPtr<nsIContent> contentDomNode(do_QueryInterface(domNode));
|
||||
|
||||
if (!contentDomNode)
|
||||
|
|
|
@ -191,7 +191,8 @@ public:
|
|||
virtual void GetPositionAndSizeInternal(PRInt32 *aPosInSet,
|
||||
PRInt32 *aSetSize);
|
||||
|
||||
static PRBool IsSeparator(nsIAccessible *aAccessible);
|
||||
// nsXULToolbarButtonAccessible
|
||||
static PRBool IsSeparator(nsAccessible *aAccessible);
|
||||
};
|
||||
|
||||
class nsXULToolbarAccessible : public nsAccessibleWrap
|
||||
|
|
|
@ -85,13 +85,11 @@ nsresult nsXULSelectableAccessible::ChangeSelection(PRInt32 aIndex, PRUint8 aMet
|
|||
if (!mSelectControl) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
nsCOMPtr<nsIAccessible> childAcc;
|
||||
GetChildAt(aIndex, getter_AddRefs(childAcc));
|
||||
nsCOMPtr<nsIAccessNode> accNode = do_QueryInterface(childAcc);
|
||||
NS_ENSURE_TRUE(accNode, NS_ERROR_FAILURE);
|
||||
nsAccessible* child = GetChildAt(aIndex);
|
||||
NS_ENSURE_TRUE(child, NS_ERROR_FAILURE);
|
||||
|
||||
nsCOMPtr<nsIDOMNode> childNode;
|
||||
accNode->GetDOMNode(getter_AddRefs(childNode));
|
||||
child->GetDOMNode(getter_AddRefs(childNode));
|
||||
nsCOMPtr<nsIDOMXULSelectControlItemElement> item(do_QueryInterface(childNode));
|
||||
NS_ENSURE_TRUE(item, NS_ERROR_FAILURE);
|
||||
|
||||
|
@ -338,18 +336,17 @@ nsXULMenuitemAccessible::GetStateInternal(PRUint32 *aState,
|
|||
|
||||
// Is collapsed?
|
||||
PRBool isCollapsed = PR_FALSE;
|
||||
nsCOMPtr<nsIAccessible> parentAccessible(GetParent());
|
||||
if (nsAccUtils::State(parentAccessible) & nsIAccessibleStates::STATE_INVISIBLE)
|
||||
nsAccessible* parentAcc = GetParent();
|
||||
if (nsAccUtils::State(parentAcc) & nsIAccessibleStates::STATE_INVISIBLE)
|
||||
isCollapsed = PR_TRUE;
|
||||
|
||||
|
||||
if (isSelected) {
|
||||
*aState |= nsIAccessibleStates::STATE_SELECTED;
|
||||
|
||||
|
||||
// Selected and collapsed?
|
||||
if (isCollapsed) {
|
||||
// Set selected option offscreen/invisible according to combobox state
|
||||
nsCOMPtr<nsIAccessible> grandParentAcc;
|
||||
parentAccessible->GetParent(getter_AddRefs(grandParentAcc));
|
||||
nsAccessible* grandParentAcc = parentAcc->GetParent();
|
||||
NS_ENSURE_TRUE(grandParentAcc, NS_ERROR_FAILURE);
|
||||
NS_ASSERTION(nsAccUtils::Role(grandParentAcc) == nsIAccessibleRole::ROLE_COMBOBOX,
|
||||
"grandparent of combobox listitem is not combobox");
|
||||
|
@ -423,9 +420,9 @@ nsXULMenuitemAccessible::GetKeyboardShortcut(nsAString& aAccessKey)
|
|||
if (accesskey.IsEmpty())
|
||||
return NS_OK;
|
||||
|
||||
nsCOMPtr<nsIAccessible> parentAccessible(GetParent());
|
||||
if (parentAccessible) {
|
||||
if (nsAccUtils::RoleInternal(parentAccessible) ==
|
||||
nsAccessible* parentAcc = GetParent();
|
||||
if (parentAcc) {
|
||||
if (nsAccUtils::RoleInternal(parentAcc) ==
|
||||
nsIAccessibleRole::ROLE_MENUBAR) {
|
||||
// If top level menu item, add Alt+ or whatever modifier text to string
|
||||
// No need to cache pref service, this happens rarely
|
||||
|
|
|
@ -159,43 +159,35 @@ nsXULTabAccessible::GetRelationByType(PRUint32 aRelationType,
|
|||
// assume tab and tabpanels are related 1 to 1. We follow algorithm from
|
||||
// the setter 'selectedIndex' of tabbox.xml#tabs binding.
|
||||
|
||||
nsCOMPtr<nsIAccessible> tabsAcc = GetParent();
|
||||
nsAccessible* tabsAcc = GetParent();
|
||||
NS_ENSURE_TRUE(nsAccUtils::Role(tabsAcc) == nsIAccessibleRole::ROLE_PAGETABLIST,
|
||||
NS_ERROR_FAILURE);
|
||||
|
||||
PRInt32 tabIndex = -1;
|
||||
|
||||
nsCOMPtr<nsIAccessible> childAcc;
|
||||
tabsAcc->GetFirstChild(getter_AddRefs(childAcc));
|
||||
while (childAcc) {
|
||||
PRInt32 childCount = tabsAcc->GetChildCount();
|
||||
for (PRInt32 childIdx = 0; childIdx < childCount; childIdx++) {
|
||||
nsAccessible* childAcc = tabsAcc->GetChildAt(childIdx);
|
||||
if (nsAccUtils::Role(childAcc) == nsIAccessibleRole::ROLE_PAGETAB)
|
||||
tabIndex++;
|
||||
|
||||
if (childAcc == this)
|
||||
break;
|
||||
|
||||
nsCOMPtr<nsIAccessible> acc;
|
||||
childAcc->GetNextSibling(getter_AddRefs(acc));
|
||||
childAcc.swap(acc);
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIAccessible> tabBoxAcc;
|
||||
tabsAcc->GetParent(getter_AddRefs(tabBoxAcc));
|
||||
nsAccessible* tabBoxAcc = tabsAcc->GetParent();
|
||||
NS_ENSURE_TRUE(nsAccUtils::Role(tabBoxAcc) == nsIAccessibleRole::ROLE_PANE,
|
||||
NS_ERROR_FAILURE);
|
||||
|
||||
tabBoxAcc->GetFirstChild(getter_AddRefs(childAcc));
|
||||
while (childAcc) {
|
||||
childCount = tabBoxAcc->GetChildCount();
|
||||
for (PRInt32 childIdx = 0; childIdx < childCount; childIdx++) {
|
||||
nsAccessible* childAcc = tabBoxAcc->GetChildAt(childIdx);
|
||||
if (nsAccUtils::Role(childAcc) == nsIAccessibleRole::ROLE_PROPERTYPAGE) {
|
||||
if (tabIndex == 0)
|
||||
return nsRelUtils::AddTarget(aRelationType, aRelation, childAcc);
|
||||
|
||||
tabIndex--;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIAccessible> acc;
|
||||
childAcc->GetNextSibling(getter_AddRefs(acc));
|
||||
childAcc.swap(acc);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
|
|
@ -461,7 +461,7 @@ nsXULTreeAccessible::SelectAllSelection(PRBool *aIsMultiSelectable)
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsXULTreeAccessible: nsAccessible implementation
|
||||
|
||||
nsIAccessible*
|
||||
nsAccessible*
|
||||
nsXULTreeAccessible::GetChildAt(PRUint32 aIndex)
|
||||
{
|
||||
PRInt32 childCount = nsAccessible::GetChildCount();
|
||||
|
@ -473,7 +473,10 @@ nsXULTreeAccessible::GetChildAt(PRUint32 aIndex)
|
|||
|
||||
nsCOMPtr<nsIAccessible> child;
|
||||
GetTreeItemAccessible(aIndex - childCount, getter_AddRefs(child));
|
||||
return child;
|
||||
|
||||
nsRefPtr<nsAccessible> childAcc =
|
||||
nsAccUtils::QueryObject<nsAccessible>(child);
|
||||
return childAcc;
|
||||
}
|
||||
|
||||
PRInt32
|
||||
|
@ -717,7 +720,7 @@ nsXULTreeAccessible::CreateTreeItemAccessible(PRInt32 aRow,
|
|||
|
||||
nsXULTreeItemAccessibleBase::
|
||||
nsXULTreeItemAccessibleBase(nsIDOMNode *aDOMNode, nsIWeakReference *aShell,
|
||||
nsIAccessible *aParent, nsITreeBoxObject *aTree,
|
||||
nsAccessible *aParent, nsITreeBoxObject *aTree,
|
||||
nsITreeView *aTreeView, PRInt32 aRow) :
|
||||
mTree(aTree), mTreeView(aTreeView), mRow(aRow),
|
||||
nsAccessibleWrap(aDOMNode, aShell)
|
||||
|
@ -1082,7 +1085,7 @@ nsXULTreeItemAccessibleBase::GetStateInternal(PRUint32 *aState,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
nsIAccessible*
|
||||
nsAccessible*
|
||||
nsXULTreeItemAccessibleBase::GetParent()
|
||||
{
|
||||
return IsDefunct() ? nsnull : mParent.get();
|
||||
|
@ -1184,9 +1187,9 @@ nsXULTreeItemAccessibleBase::IsExpandable()
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
nsXULTreeItemAccessible::
|
||||
nsXULTreeItemAccessible(nsIDOMNode *aDOMNode, nsIWeakReference *aShell,
|
||||
nsIAccessible *aParent, nsITreeBoxObject *aTree,
|
||||
nsITreeView *aTreeView, PRInt32 aRow) :
|
||||
nsXULTreeItemAccessible(nsIDOMNode *aDOMNode, nsIWeakReference *aShell,
|
||||
nsAccessible *aParent, nsITreeBoxObject *aTree,
|
||||
nsITreeView *aTreeView, PRInt32 aRow) :
|
||||
nsXULTreeItemAccessibleBase(aDOMNode, aShell, aParent, aTree, aTreeView, aRow)
|
||||
{
|
||||
mColumn = nsCoreUtils::GetFirstSensibleColumn(mTree);
|
||||
|
|
|
@ -89,7 +89,7 @@ public:
|
|||
PRBool aDeepestChild,
|
||||
nsIAccessible **aChild);
|
||||
|
||||
virtual nsIAccessible* GetChildAt(PRUint32 aIndex);
|
||||
virtual nsAccessible* GetChildAt(PRUint32 aIndex);
|
||||
virtual PRInt32 GetChildCount();
|
||||
virtual PRInt32 GetIndexOf(nsIAccessible *aChild);
|
||||
|
||||
|
@ -166,7 +166,7 @@ class nsXULTreeItemAccessibleBase : public nsAccessibleWrap
|
|||
{
|
||||
public:
|
||||
nsXULTreeItemAccessibleBase(nsIDOMNode *aDOMNode, nsIWeakReference *aShell,
|
||||
nsIAccessible *aParent, nsITreeBoxObject *aTree,
|
||||
nsAccessible *aParent, nsITreeBoxObject *aTree,
|
||||
nsITreeView *aTreeView, PRInt32 aRow);
|
||||
|
||||
// nsISupports
|
||||
|
@ -201,7 +201,7 @@ public:
|
|||
|
||||
// nsAccessible
|
||||
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
|
||||
virtual nsIAccessible* GetParent();
|
||||
virtual nsAccessible* GetParent();
|
||||
|
||||
// nsXULTreeItemAccessibleBase
|
||||
NS_DECLARE_STATIC_IID_ACCESSOR(NS_XULTREEITEMBASEACCESSIBLE_IMPL_CID)
|
||||
|
@ -255,7 +255,7 @@ class nsXULTreeItemAccessible : public nsXULTreeItemAccessibleBase
|
|||
{
|
||||
public:
|
||||
nsXULTreeItemAccessible(nsIDOMNode *aDOMNode, nsIWeakReference *aShell,
|
||||
nsIAccessible *aParent, nsITreeBoxObject *aTree,
|
||||
nsAccessible *aParent, nsITreeBoxObject *aTree,
|
||||
nsITreeView *aTreeView, PRInt32 aRow);
|
||||
|
||||
NS_IMETHOD GetName(nsAString& aName);
|
||||
|
|
|
@ -604,7 +604,7 @@ nsXULTreeGridAccessible::CreateTreeItemAccessible(PRInt32 aRow,
|
|||
|
||||
nsXULTreeGridRowAccessible::
|
||||
nsXULTreeGridRowAccessible(nsIDOMNode *aDOMNode, nsIWeakReference *aShell,
|
||||
nsIAccessible *aTreeAcc, nsITreeBoxObject* aTree,
|
||||
nsAccessible *aTreeAcc, nsITreeBoxObject* aTree,
|
||||
nsITreeView *aTreeView, PRInt32 aRow) :
|
||||
nsXULTreeItemAccessibleBase(aDOMNode, aShell, aTreeAcc, aTree, aTreeView, aRow)
|
||||
{
|
||||
|
@ -689,7 +689,7 @@ nsXULTreeGridRowAccessible::GetChildAtPoint(PRInt32 aX, PRInt32 aY,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
nsIAccessible*
|
||||
nsAccessible*
|
||||
nsXULTreeGridRowAccessible::GetChildAt(PRUint32 aIndex)
|
||||
{
|
||||
if (IsDefunct())
|
||||
|
@ -702,7 +702,9 @@ nsXULTreeGridRowAccessible::GetChildAt(PRUint32 aIndex)
|
|||
|
||||
nsCOMPtr<nsIAccessible> cell;
|
||||
GetCellAccessible(column, getter_AddRefs(cell));
|
||||
return cell;
|
||||
|
||||
nsRefPtr<nsAccessible> cellAcc = nsAccUtils::QueryObject<nsAccessible>(cell);
|
||||
return cellAcc;
|
||||
}
|
||||
|
||||
PRInt32
|
||||
|
@ -994,10 +996,7 @@ nsXULTreeGridCellAccessible::GetTable(nsIAccessibleTable **aTable)
|
|||
if (IsDefunct())
|
||||
return NS_OK;
|
||||
|
||||
nsCOMPtr<nsIAccessible> accessible;
|
||||
mParent->GetParent(getter_AddRefs(accessible));
|
||||
CallQueryInterface(accessible, aTable);
|
||||
|
||||
CallQueryInterface(mParent->GetParent(), aTable);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -1222,7 +1221,7 @@ nsXULTreeGridCellAccessible::GetStateInternal(PRUint32 *aStates,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
nsIAccessible*
|
||||
nsAccessible*
|
||||
nsXULTreeGridCellAccessible::GetParent()
|
||||
{
|
||||
return IsDefunct() ? nsnull : mParent.get();
|
||||
|
|
|
@ -78,7 +78,7 @@ class nsXULTreeGridRowAccessible : public nsXULTreeItemAccessibleBase
|
|||
{
|
||||
public:
|
||||
nsXULTreeGridRowAccessible(nsIDOMNode *aDOMNode, nsIWeakReference *aShell,
|
||||
nsIAccessible *aParent, nsITreeBoxObject *aTree,
|
||||
nsAccessible *aParent, nsITreeBoxObject *aTree,
|
||||
nsITreeView *aTreeView, PRInt32 aRow);
|
||||
|
||||
// nsISupports and cycle collection
|
||||
|
@ -95,7 +95,7 @@ public:
|
|||
PRBool aDeepestChild,
|
||||
nsIAccessible **aChild);
|
||||
|
||||
virtual nsIAccessible* GetChildAt(PRUint32 aIndex);
|
||||
virtual nsAccessible* GetChildAt(PRUint32 aIndex);
|
||||
virtual PRInt32 GetChildCount();
|
||||
virtual PRInt32 GetIndexOf(nsIAccessible *aChild);
|
||||
|
||||
|
@ -164,7 +164,7 @@ public:
|
|||
virtual nsresult GetRoleInternal(PRUint32 *aRole);
|
||||
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
|
||||
|
||||
virtual nsIAccessible* GetParent();
|
||||
virtual nsAccessible* GetParent();
|
||||
|
||||
// nsXULTreeGridCellAccessible
|
||||
NS_DECLARE_STATIC_IID_ACCESSOR(NS_XULTREEGRIDCELLACCESSIBLE_IMPL_CID)
|
||||
|
|
|
@ -765,7 +765,7 @@ pref("browser.sessionstore.resume_from_crash", true);
|
|||
pref("browser.sessionstore.resume_session_once", false);
|
||||
|
||||
// minimal interval between two save operations in milliseconds
|
||||
pref("browser.sessionstore.interval", 10000);
|
||||
pref("browser.sessionstore.interval", 15000);
|
||||
// maximum amount of POSTDATA to be saved in bytes per history entry (-1 = all of it)
|
||||
// (NB: POSTDATA will be saved either entirely or not at all)
|
||||
pref("browser.sessionstore.postdata", 0);
|
||||
|
|
|
@ -25,8 +25,6 @@ CPPSRCS = nsModule.cpp \
|
|||
$(NULL)
|
||||
|
||||
ifeq ($(OS_ARCH),WINNT)
|
||||
DEFINES += -DPSTOREC_DLL=\"$(subst \,\\,$(WINDIR))\\system32\\pstorec.dll\"
|
||||
|
||||
OS_LIBS += $(call EXPAND_LIBNAME,ole32 shell32)
|
||||
endif
|
||||
|
||||
|
|
|
@ -227,7 +227,6 @@ DistributionCustomizer.prototype = {
|
|||
break;
|
||||
}
|
||||
}
|
||||
return this._checkCustomizationComplete();
|
||||
},
|
||||
|
||||
_customizationsApplied: false,
|
||||
|
|
|
@ -66,8 +66,6 @@ CPPSRCS += nsOperaProfileMigrator.cpp
|
|||
endif
|
||||
|
||||
ifeq ($(OS_ARCH)_$(GNU_CXX),WINNT_)
|
||||
DEFINES += -DPSTOREC_DLL=\"$(subst \,\\,$(WINDIR))\\system32\\pstorec.dll\"
|
||||
|
||||
CPPSRCS += nsIEProfileMigrator.cpp \
|
||||
$(NULL)
|
||||
endif
|
||||
|
|
|
@ -948,7 +948,7 @@ nsIEProfileMigrator::CopyPasswords(PRBool aReplace)
|
|||
}
|
||||
|
||||
PStoreCreateInstancePtr PStoreCreateInstance = (PStoreCreateInstancePtr)::GetProcAddress(pstoreDLL, "PStoreCreateInstance");
|
||||
IPStorePtr PStore;
|
||||
IPStore* PStore;
|
||||
hr = PStoreCreateInstance(&PStore, 0, 0, 0);
|
||||
|
||||
rv = GetSignonsListFromPStore(PStore, &signonsFound);
|
||||
|
@ -985,7 +985,7 @@ nsIEProfileMigrator::MigrateSiteAuthSignons(IPStore* aPStore)
|
|||
return NS_OK;
|
||||
|
||||
GUID mtGuid = {0};
|
||||
IEnumPStoreItemsPtr enumItems = NULL;
|
||||
IEnumPStoreItems* enumItems = NULL;
|
||||
hr = aPStore->EnumItems(0, &IEPStoreSiteAuthGUID, &mtGuid, 0, &enumItems);
|
||||
if (SUCCEEDED(hr) && enumItems != NULL) {
|
||||
LPWSTR itemName = NULL;
|
||||
|
@ -1050,7 +1050,7 @@ nsIEProfileMigrator::GetSignonsListFromPStore(IPStore* aPStore, nsTArray<SignonD
|
|||
|
||||
NS_ENSURE_ARG_POINTER(aPStore);
|
||||
|
||||
IEnumPStoreItemsPtr enumItems = NULL;
|
||||
IEnumPStoreItems* enumItems = NULL;
|
||||
hr = aPStore->EnumItems(0, &IEPStoreAutocompGUID, &IEPStoreAutocompGUID, 0, &enumItems);
|
||||
if (SUCCEEDED(hr) && enumItems != NULL) {
|
||||
LPWSTR itemName = NULL;
|
||||
|
@ -1130,7 +1130,7 @@ nsIEProfileMigrator::ResolveAndMigrateSignons(IPStore* aPStore, nsTArray<SignonD
|
|||
{
|
||||
HRESULT hr;
|
||||
|
||||
IEnumPStoreItemsPtr enumItems = NULL;
|
||||
IEnumPStoreItems* enumItems = NULL;
|
||||
hr = aPStore->EnumItems(0, &IEPStoreAutocompGUID, &IEPStoreAutocompGUID, 0, &enumItems);
|
||||
if (SUCCEEDED(hr) && enumItems != NULL) {
|
||||
LPWSTR itemName = NULL;
|
||||
|
@ -1271,12 +1271,12 @@ nsIEProfileMigrator::CopyFormData(PRBool aReplace)
|
|||
}
|
||||
|
||||
PStoreCreateInstancePtr PStoreCreateInstance = (PStoreCreateInstancePtr)::GetProcAddress(pstoreDLL, "PStoreCreateInstance");
|
||||
IPStorePtr PStore = NULL;
|
||||
IPStore* PStore = NULL;
|
||||
hr = PStoreCreateInstance(&PStore, 0, 0, 0);
|
||||
if (FAILED(hr) || PStore == NULL)
|
||||
return NS_OK;
|
||||
|
||||
IEnumPStoreItemsPtr enumItems = NULL;
|
||||
IEnumPStoreItems* enumItems = NULL;
|
||||
hr = PStore->EnumItems(0, &IEPStoreAutocompGUID, &IEPStoreAutocompGUID, 0, &enumItems);
|
||||
if (SUCCEEDED(hr) && enumItems != NULL) {
|
||||
LPWSTR itemName = NULL;
|
||||
|
|
|
@ -43,6 +43,7 @@
|
|||
|
||||
#include <time.h>
|
||||
#include <windows.h>
|
||||
#include <pstore.h>
|
||||
#include "nsIBrowserProfileMigrator.h"
|
||||
#include "nsIObserverService.h"
|
||||
#include "nsTArray.h"
|
||||
|
@ -60,9 +61,6 @@ struct SignonData {
|
|||
char* realm;
|
||||
};
|
||||
|
||||
#import PSTOREC_DLL raw_interfaces_only
|
||||
using namespace PSTORECLib;
|
||||
|
||||
class nsIEProfileMigrator : public nsIBrowserProfileMigrator,
|
||||
public nsINavHistoryBatchCallback {
|
||||
public:
|
||||
|
|
|
@ -132,6 +132,7 @@ function remove_all_bookmarks() {
|
|||
|
||||
// Check for correct cleanup.
|
||||
dump_table("moz_bookmarks");
|
||||
dump_table("moz_places");
|
||||
check_no_bookmarks()
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
*
|
||||
* The Original Code is Places Unit Test code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Mozilla Corp.
|
||||
* The Initial Developer of the Original Code is Mozilla Foundation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2009
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
|
@ -59,11 +59,9 @@ const PREF_IMPORT_BOOKMARKS_HTML = "browser.places.importBookmarksHTML";
|
|||
const PREF_RESTORE_DEFAULT_BOOKMARKS = "browser.bookmarks.restore_default_bookmarks";
|
||||
const PREF_SMART_BOOKMARKS_VERSION = "browser.places.smartBookmarksVersion";
|
||||
const PREF_AUTO_EXPORT_HTML = "browser.bookmarks.autoExportHTML";
|
||||
|
||||
const TOPIC_PLACES_INIT_COMPLETE = "places-init-complete";
|
||||
|
||||
const TOPIC_PLACES_DATABASE_LOCKED = "places-database-locked";
|
||||
let tests = [];
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
tests.push({
|
||||
|
@ -71,11 +69,15 @@ tests.push({
|
|||
exec: function() {
|
||||
// Sanity check: we should not have any bookmark on the toolbar.
|
||||
do_check_eq(bs.getIdForItemAt(bs.toolbarFolder, 0), -1);
|
||||
|
||||
// Set preferences.
|
||||
ps.setBoolPref(PREF_IMPORT_BOOKMARKS_HTML, true);
|
||||
// Force nsBrowserGlue::_initPlaces().
|
||||
os.notifyObservers(null, TOPIC_PLACES_INIT_COMPLETE, null);
|
||||
|
||||
// Force nsBrowserGlue::_initPlaces().
|
||||
print("Simulate Places init");
|
||||
bg.QueryInterface(Ci.nsIObserver).observe(null,
|
||||
TOPIC_PLACES_INIT_COMPLETE,
|
||||
null);
|
||||
// Check bookmarks.html has been imported, and a smart bookmark has been
|
||||
// created.
|
||||
let itemId = bs.getIdForItemAt(bs.toolbarFolder,
|
||||
|
@ -95,12 +97,16 @@ tests.push({
|
|||
exec: function() {
|
||||
// Sanity check: we should not have any bookmark on the toolbar.
|
||||
do_check_eq(bs.getIdForItemAt(bs.toolbarFolder, 0), -1);
|
||||
|
||||
// Set preferences.
|
||||
ps.setIntPref(PREF_SMART_BOOKMARKS_VERSION, -1);
|
||||
ps.setBoolPref(PREF_IMPORT_BOOKMARKS_HTML, true);
|
||||
// Force nsBrowserGlue::_initPlaces().
|
||||
os.notifyObservers(null, TOPIC_PLACES_INIT_COMPLETE, null);
|
||||
|
||||
// Force nsBrowserGlue::_initPlaces().
|
||||
print("Simulate Places init");
|
||||
bg.QueryInterface(Ci.nsIObserver).observe(null,
|
||||
TOPIC_PLACES_INIT_COMPLETE,
|
||||
null);
|
||||
// Check bookmarks.html has been imported, but smart bookmarks have not
|
||||
// been created.
|
||||
let itemId = bs.getIdForItemAt(bs.toolbarFolder, 0);
|
||||
|
@ -123,9 +129,12 @@ tests.push({
|
|||
ps.setIntPref(PREF_SMART_BOOKMARKS_VERSION, 999);
|
||||
ps.setBoolPref(PREF_AUTO_EXPORT_HTML, true);
|
||||
ps.setBoolPref(PREF_IMPORT_BOOKMARKS_HTML, true);
|
||||
// Force nsBrowserGlue::_initPlaces()
|
||||
os.notifyObservers(null, TOPIC_PLACES_INIT_COMPLETE, null);
|
||||
|
||||
// Force nsBrowserGlue::_initPlaces()
|
||||
print("Simulate Places init");
|
||||
bg.QueryInterface(Ci.nsIObserver).observe(null,
|
||||
TOPIC_PLACES_INIT_COMPLETE,
|
||||
null);
|
||||
// Check bookmarks.html has been imported, but smart bookmarks have not
|
||||
// been created.
|
||||
let itemId = bs.getIdForItemAt(bs.toolbarFolder, 0);
|
||||
|
@ -149,9 +158,12 @@ tests.push({
|
|||
ps.setIntPref(PREF_SMART_BOOKMARKS_VERSION, 0);
|
||||
ps.setBoolPref(PREF_AUTO_EXPORT_HTML, true);
|
||||
ps.setBoolPref(PREF_IMPORT_BOOKMARKS_HTML, true);
|
||||
// Force nsBrowserGlue::_initPlaces()
|
||||
os.notifyObservers(null, TOPIC_PLACES_INIT_COMPLETE, null);
|
||||
|
||||
// Force nsBrowserGlue::_initPlaces()
|
||||
print("Simulate Places init");
|
||||
bg.QueryInterface(Ci.nsIObserver).observe(null,
|
||||
TOPIC_PLACES_INIT_COMPLETE,
|
||||
null);
|
||||
// Check bookmarks.html has been imported, but smart bookmarks have not
|
||||
// been created.
|
||||
let itemId = bs.getIdForItemAt(bs.toolbarFolder, SMART_BOOKMARKS_ON_TOOLBAR);
|
||||
|
@ -172,9 +184,12 @@ tests.push({
|
|||
do_check_eq(bs.getIdForItemAt(bs.toolbarFolder, 0), -1);
|
||||
// Set preferences.
|
||||
ps.setBoolPref(PREF_RESTORE_DEFAULT_BOOKMARKS, true);
|
||||
// Force nsBrowserGlue::_initPlaces()
|
||||
os.notifyObservers(null, TOPIC_PLACES_INIT_COMPLETE, null);
|
||||
|
||||
// Force nsBrowserGlue::_initPlaces()
|
||||
print("Simulate Places init");
|
||||
bg.QueryInterface(Ci.nsIObserver).observe(null,
|
||||
TOPIC_PLACES_INIT_COMPLETE,
|
||||
null);
|
||||
// Check bookmarks.html has been restored.
|
||||
let itemId = bs.getIdForItemAt(bs.toolbarFolder, SMART_BOOKMARKS_ON_TOOLBAR + 1);
|
||||
do_check_true(itemId > 0);
|
||||
|
@ -195,9 +210,12 @@ tests.push({
|
|||
// Set preferences.
|
||||
ps.setBoolPref(PREF_IMPORT_BOOKMARKS_HTML, true);
|
||||
ps.setBoolPref(PREF_RESTORE_DEFAULT_BOOKMARKS, true);
|
||||
// Force nsBrowserGlue::_initPlaces()
|
||||
os.notifyObservers(null, TOPIC_PLACES_INIT_COMPLETE, null);
|
||||
|
||||
// Force nsBrowserGlue::_initPlaces()
|
||||
print("Simulate Places init");
|
||||
bg.QueryInterface(Ci.nsIObserver).observe(null,
|
||||
TOPIC_PLACES_INIT_COMPLETE,
|
||||
null);
|
||||
// Check bookmarks.html has been restored.
|
||||
let itemId = bs.getIdForItemAt(bs.toolbarFolder, SMART_BOOKMARKS_ON_TOOLBAR + 1);
|
||||
do_check_true(itemId > 0);
|
||||
|
@ -214,34 +232,50 @@ tests.push({
|
|||
function finish_test() {
|
||||
// Clean up database from all bookmarks.
|
||||
remove_all_bookmarks();
|
||||
remove_bookmarks_html();
|
||||
remove_all_JSON_backups();
|
||||
|
||||
do_test_finished();
|
||||
}
|
||||
|
||||
var testIndex = 0;
|
||||
function next_test() {
|
||||
// Clean up database from all bookmarks.
|
||||
remove_all_bookmarks();
|
||||
|
||||
// nsBrowserGlue stops observing topics after first notification,
|
||||
// so we add back the observer to test additional runs.
|
||||
if (testIndex > 0)
|
||||
os.addObserver(bg, TOPIC_PLACES_INIT_COMPLETE, false);
|
||||
|
||||
os.addObserver(bg.QueryInterface(Ci.nsIObserver),
|
||||
TOPIC_PLACES_INIT_COMPLETE, false);
|
||||
os.addObserver(bg.QueryInterface(Ci.nsIObserver),
|
||||
TOPIC_PLACES_DATABASE_LOCKED, false);
|
||||
// Execute next test.
|
||||
let test = tests.shift();
|
||||
print("\nTEST " + (++testIndex) + ": " + test.description);
|
||||
test.exec();
|
||||
}
|
||||
|
||||
function run_test() {
|
||||
do_test_pending();
|
||||
// Enqueue test, so it will consume the default places-init-complete
|
||||
// notification created at Places init.
|
||||
do_timeout(0, start_tests);
|
||||
}
|
||||
|
||||
function start_tests() {
|
||||
// Clean up database from all bookmarks.
|
||||
remove_all_bookmarks();
|
||||
|
||||
// Ensure preferences status.
|
||||
do_check_false(ps.getBoolPref(PREF_AUTO_EXPORT_HTML));
|
||||
try {
|
||||
do_check_false(ps.getBoolPref(PREF_IMPORT_BOOKMARKS_HTML));
|
||||
do_throw("importBookmarksHTML pref should not exist");
|
||||
}
|
||||
catch(ex) {}
|
||||
do_check_false(ps.getBoolPref(PREF_RESTORE_DEFAULT_BOOKMARKS));
|
||||
|
||||
// Create our bookmarks.html from bookmarks.glue.html.
|
||||
create_bookmarks_html("bookmarks.glue.html");
|
||||
|
||||
// Create our JSON backup from bookmarks.glue.json.
|
||||
create_JSON_backup("bookmarks.glue.json");
|
||||
|
||||
// Kick-off tests.
|
||||
do_test_pending();
|
||||
next_test();
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
*
|
||||
* The Original Code is Places Unit Test code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Mozilla Corp.
|
||||
* The Initial Developer of the Original Code is Mozilla Foundation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2009
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
|
@ -40,7 +40,6 @@
|
|||
* Tests that nsBrowserGlue is correctly interpreting the preferences settable
|
||||
* by the user or by other components.
|
||||
*/
|
||||
|
||||
// Initialize browserGlue.
|
||||
var bg = Cc["@mozilla.org/browser/browserglue;1"].
|
||||
getService(Ci.nsIBrowserGlue);
|
||||
|
@ -50,7 +49,6 @@ var hs = Cc["@mozilla.org/browser/nav-history-service;1"].
|
|||
getService(Ci.nsINavHistoryService);
|
||||
var bs = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].
|
||||
getService(Ci.nsINavBookmarksService);
|
||||
|
||||
// Get other services.
|
||||
var ps = Cc["@mozilla.org/preferences-service;1"].
|
||||
getService(Ci.nsIPrefBranch);
|
||||
|
@ -58,36 +56,33 @@ var os = Cc["@mozilla.org/observer-service;1"].
|
|||
getService(Ci.nsIObserverService);
|
||||
var as = Cc["@mozilla.org/browser/annotation-service;1"].
|
||||
getService(Ci.nsIAnnotationService);
|
||||
|
||||
const PREF_SMART_BOOKMARKS_VERSION = "browser.places.smartBookmarksVersion";
|
||||
const PREF_AUTO_EXPORT_HTML = "browser.bookmarks.autoExportHTML";
|
||||
const PREF_IMPORT_BOOKMARKS_HTML = "browser.places.importBookmarksHTML";
|
||||
const PREF_RESTORE_DEFAULT_BOOKMARKS = "browser.bookmarks.restore_default_bookmarks";
|
||||
|
||||
const SMART_BOOKMARKS_ANNO = "Places/SmartBookmark";
|
||||
|
||||
const TOPIC_PLACES_INIT_COMPLETE = "places-init-complete";
|
||||
|
||||
var tests = [];
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
tests.push({
|
||||
description: "All smart bookmarks are created if smart bookmarks version is 0.",
|
||||
exec: function() {
|
||||
// Sanity check: we should not have any bookmark on the toolbar.
|
||||
do_check_eq(bs.getIdForItemAt(bs.toolbarFolder, 0), -1);
|
||||
// Sanity check: we should not have any bookmark on the menu.
|
||||
do_check_eq(bs.getIdForItemAt(bs.bookmarksMenuFolder, 0), -1);
|
||||
|
||||
// Sanity check: we should have default bookmark.
|
||||
do_check_neq(bs.getIdForItemAt(bs.toolbarFolder, 0), -1);
|
||||
do_check_neq(bs.getIdForItemAt(bs.bookmarksMenuFolder, 0), -1);
|
||||
// Set preferences.
|
||||
ps.setIntPref(PREF_SMART_BOOKMARKS_VERSION, 0);
|
||||
// Force nsBrowserGlue::_initPlaces().
|
||||
os.notifyObservers(null, TOPIC_PLACES_INIT_COMPLETE, null);
|
||||
|
||||
// Count items on toolbar.
|
||||
do_check_eq(countFolderChildren(bs.toolbarFolder), SMART_BOOKMARKS_ON_TOOLBAR + DEFAULT_BOOKMARKS_ON_TOOLBAR);
|
||||
// Count items on menu (+1 for the separator).
|
||||
do_check_eq(countFolderChildren(bs.bookmarksMenuFolder), SMART_BOOKMARKS_ON_MENU + DEFAULT_BOOKMARKS_ON_MENU);
|
||||
bg.ensurePlacesDefaultQueriesInitialized();
|
||||
// Count items.
|
||||
do_check_eq(countFolderChildren(bs.toolbarFolder),
|
||||
SMART_BOOKMARKS_ON_TOOLBAR + DEFAULT_BOOKMARKS_ON_TOOLBAR);
|
||||
do_check_eq(countFolderChildren(bs.bookmarksMenuFolder),
|
||||
SMART_BOOKMARKS_ON_MENU + DEFAULT_BOOKMARKS_ON_MENU);
|
||||
|
||||
// Check version has been updated.
|
||||
do_check_eq(ps.getIntPref(PREF_SMART_BOOKMARKS_VERSION), SMART_BOOKMARKS_VERSION);
|
||||
do_check_eq(ps.getIntPref(PREF_SMART_BOOKMARKS_VERSION),
|
||||
SMART_BOOKMARKS_VERSION);
|
||||
|
||||
next_test();
|
||||
}
|
||||
|
@ -102,29 +97,36 @@ tests.push({
|
|||
var itemId = bs.getIdForItemAt(bs.toolbarFolder, 0);
|
||||
do_check_neq(itemId, -1);
|
||||
do_check_true(as.itemHasAnnotation(itemId, SMART_BOOKMARKS_ANNO));
|
||||
|
||||
// Change its title.
|
||||
bs.setItemTitle(itemId, "new title");
|
||||
do_check_eq(bs.getItemTitle(itemId), "new title");
|
||||
|
||||
// Sanity check items.
|
||||
dump_table("moz_bookmarks");
|
||||
dump_table("moz_items_annos");
|
||||
do_check_eq(countFolderChildren(bs.toolbarFolder),
|
||||
SMART_BOOKMARKS_ON_TOOLBAR + DEFAULT_BOOKMARKS_ON_TOOLBAR);
|
||||
do_check_eq(countFolderChildren(bs.bookmarksMenuFolder),
|
||||
SMART_BOOKMARKS_ON_MENU + DEFAULT_BOOKMARKS_ON_MENU);
|
||||
|
||||
// Set preferences.
|
||||
ps.setIntPref(PREF_SMART_BOOKMARKS_VERSION, 1);
|
||||
// Force nsBrowserGlue::_initPlaces().
|
||||
os.notifyObservers(null, TOPIC_PLACES_INIT_COMPLETE, null);
|
||||
bg.ensurePlacesDefaultQueriesInitialized();
|
||||
// Count items.
|
||||
do_check_eq(countFolderChildren(bs.toolbarFolder),
|
||||
SMART_BOOKMARKS_ON_TOOLBAR + DEFAULT_BOOKMARKS_ON_TOOLBAR);
|
||||
do_check_eq(countFolderChildren(bs.bookmarksMenuFolder),
|
||||
SMART_BOOKMARKS_ON_MENU + DEFAULT_BOOKMARKS_ON_MENU);
|
||||
|
||||
// Count items on toolbar.
|
||||
do_check_eq(countFolderChildren(bs.toolbarFolder), SMART_BOOKMARKS_ON_TOOLBAR + DEFAULT_BOOKMARKS_ON_TOOLBAR);
|
||||
// Count items on menu (+1 for the separator).
|
||||
do_check_eq(countFolderChildren(bs.bookmarksMenuFolder), SMART_BOOKMARKS_ON_MENU + DEFAULT_BOOKMARKS_ON_MENU);
|
||||
|
||||
// check smart bookmark has been replaced, itemId has changed.
|
||||
// Check smart bookmark has been replaced, itemId has changed.
|
||||
itemId = bs.getIdForItemAt(bs.toolbarFolder, 0);
|
||||
do_check_neq(itemId, -1);
|
||||
do_check_neq(bs.getItemTitle(itemId), "new title");
|
||||
do_check_true(as.itemHasAnnotation(itemId, SMART_BOOKMARKS_ANNO));
|
||||
|
||||
// Check version has been updated.
|
||||
do_check_eq(ps.getIntPref(PREF_SMART_BOOKMARKS_VERSION), SMART_BOOKMARKS_VERSION);
|
||||
do_check_eq(ps.getIntPref(PREF_SMART_BOOKMARKS_VERSION),
|
||||
SMART_BOOKMARKS_VERSION);
|
||||
|
||||
next_test();
|
||||
}
|
||||
|
@ -135,21 +137,30 @@ tests.push({
|
|||
tests.push({
|
||||
description: "An explicitly removed smart bookmark should not be recreated.",
|
||||
exec: function() {
|
||||
// Set preferences.
|
||||
ps.setIntPref(PREF_SMART_BOOKMARKS_VERSION, 1);
|
||||
// Remove toolbar's smart bookmarks
|
||||
bs.removeItem(bs.getIdForItemAt(bs.toolbarFolder, 0));
|
||||
|
||||
// Force nsBrowserGlue::_initPlaces().
|
||||
os.notifyObservers(null, TOPIC_PLACES_INIT_COMPLETE, null);
|
||||
// Sanity check items.
|
||||
dump_table("moz_bookmarks");
|
||||
dump_table("moz_items_annos");
|
||||
do_check_eq(countFolderChildren(bs.toolbarFolder),
|
||||
DEFAULT_BOOKMARKS_ON_TOOLBAR);
|
||||
do_check_eq(countFolderChildren(bs.bookmarksMenuFolder),
|
||||
SMART_BOOKMARKS_ON_MENU + DEFAULT_BOOKMARKS_ON_MENU);
|
||||
|
||||
// Count items on toolbar, we should not have recreated the smart bookmark.
|
||||
do_check_eq(countFolderChildren(bs.toolbarFolder), DEFAULT_BOOKMARKS_ON_TOOLBAR);
|
||||
// Count items on menu (+1 for the separator).
|
||||
do_check_eq(countFolderChildren(bs.bookmarksMenuFolder), SMART_BOOKMARKS_ON_MENU + DEFAULT_BOOKMARKS_ON_MENU);
|
||||
// Set preferences.
|
||||
ps.setIntPref(PREF_SMART_BOOKMARKS_VERSION, 1);
|
||||
bg.ensurePlacesDefaultQueriesInitialized();
|
||||
// Count items.
|
||||
// We should not have recreated the smart bookmark on toolbar.
|
||||
do_check_eq(countFolderChildren(bs.toolbarFolder),
|
||||
DEFAULT_BOOKMARKS_ON_TOOLBAR);
|
||||
do_check_eq(countFolderChildren(bs.bookmarksMenuFolder),
|
||||
SMART_BOOKMARKS_ON_MENU + DEFAULT_BOOKMARKS_ON_MENU);
|
||||
|
||||
// Check version has been updated.
|
||||
do_check_eq(ps.getIntPref(PREF_SMART_BOOKMARKS_VERSION), SMART_BOOKMARKS_VERSION);
|
||||
do_check_eq(ps.getIntPref(PREF_SMART_BOOKMARKS_VERSION),
|
||||
SMART_BOOKMARKS_VERSION);
|
||||
|
||||
next_test();
|
||||
}
|
||||
|
@ -159,20 +170,28 @@ tests.push({
|
|||
|
||||
tests.push({
|
||||
description: "Even if a smart bookmark has been removed recreate it if version is 0.",
|
||||
exec: function() {
|
||||
exec: function() {
|
||||
// Sanity check items.
|
||||
dump_table("moz_bookmarks");
|
||||
dump_table("moz_items_annos");
|
||||
do_check_eq(countFolderChildren(bs.toolbarFolder),
|
||||
DEFAULT_BOOKMARKS_ON_TOOLBAR);
|
||||
do_check_eq(countFolderChildren(bs.bookmarksMenuFolder),
|
||||
SMART_BOOKMARKS_ON_MENU + DEFAULT_BOOKMARKS_ON_MENU);
|
||||
|
||||
// Set preferences.
|
||||
ps.setIntPref(PREF_SMART_BOOKMARKS_VERSION, 0);
|
||||
|
||||
// Force nsBrowserGlue::_initPlaces().
|
||||
os.notifyObservers(null, TOPIC_PLACES_INIT_COMPLETE, null);
|
||||
|
||||
// Count items on toolbar, we should not have recreated the smart bookmark.
|
||||
do_check_eq(countFolderChildren(bs.toolbarFolder), SMART_BOOKMARKS_ON_TOOLBAR + DEFAULT_BOOKMARKS_ON_TOOLBAR);
|
||||
// Count items on menu (+1 for the separator).
|
||||
do_check_eq(countFolderChildren(bs.bookmarksMenuFolder), SMART_BOOKMARKS_ON_MENU + DEFAULT_BOOKMARKS_ON_MENU);
|
||||
bg.ensurePlacesDefaultQueriesInitialized();
|
||||
// Count items.
|
||||
// We should not have recreated the smart bookmark on toolbar.
|
||||
do_check_eq(countFolderChildren(bs.toolbarFolder),
|
||||
SMART_BOOKMARKS_ON_TOOLBAR + DEFAULT_BOOKMARKS_ON_TOOLBAR);
|
||||
do_check_eq(countFolderChildren(bs.bookmarksMenuFolder),
|
||||
SMART_BOOKMARKS_ON_MENU + DEFAULT_BOOKMARKS_ON_MENU);
|
||||
|
||||
// Check version has been updated.
|
||||
do_check_eq(ps.getIntPref(PREF_SMART_BOOKMARKS_VERSION), SMART_BOOKMARKS_VERSION);
|
||||
do_check_eq(ps.getIntPref(PREF_SMART_BOOKMARKS_VERSION),
|
||||
SMART_BOOKMARKS_VERSION);
|
||||
|
||||
finish_test();
|
||||
}
|
||||
|
@ -201,25 +220,32 @@ function finish_test() {
|
|||
|
||||
do_test_finished();
|
||||
}
|
||||
|
||||
var testIndex = 0;
|
||||
function next_test() {
|
||||
// nsBrowserGlue stops observing topics after first notification,
|
||||
// so we add back the observer to test additional runs.
|
||||
if (testIndex > 0)
|
||||
os.addObserver(bg, TOPIC_PLACES_INIT_COMPLETE, false);
|
||||
|
||||
// Execute next test.
|
||||
let test = tests.shift();
|
||||
print("\nTEST " + (++testIndex) + ": " + test.description);
|
||||
test.exec();
|
||||
}
|
||||
|
||||
function run_test() {
|
||||
// Clean up database from all bookmarks.
|
||||
remove_all_bookmarks();
|
||||
|
||||
// Kick-off tests.
|
||||
do_test_pending();
|
||||
// Enqueue test, so it will consume the default places-init-complete
|
||||
// notification created at Places init.
|
||||
do_timeout(0, start_tests);
|
||||
}
|
||||
|
||||
function start_tests() {
|
||||
remove_bookmarks_html();
|
||||
remove_all_JSON_backups();
|
||||
|
||||
// Ensure preferences status.
|
||||
do_check_false(ps.getBoolPref(PREF_AUTO_EXPORT_HTML));
|
||||
try {
|
||||
do_check_false(ps.getBoolPref(PREF_IMPORT_BOOKMARKS_HTML));
|
||||
do_throw("importBookmarksHTML pref should not exist");
|
||||
}
|
||||
catch(ex) {}
|
||||
do_check_false(ps.getBoolPref(PREF_RESTORE_DEFAULT_BOOKMARKS));
|
||||
// Kick-off tests.
|
||||
next_test();
|
||||
}
|
||||
|
|
|
@ -559,9 +559,6 @@ SessionStoreService.prototype = {
|
|||
case "DOMAutoComplete":
|
||||
this.onTabInput(win, aEvent.currentTarget);
|
||||
break;
|
||||
case "scroll":
|
||||
this.onTabScroll(win);
|
||||
break;
|
||||
case "TabOpen":
|
||||
case "TabClose":
|
||||
let browser = aEvent.originalTarget.linkedBrowser;
|
||||
|
@ -768,7 +765,6 @@ SessionStoreService.prototype = {
|
|||
aBrowser.addEventListener("change", this, true);
|
||||
aBrowser.addEventListener("input", this, true);
|
||||
aBrowser.addEventListener("DOMAutoComplete", this, true);
|
||||
aBrowser.addEventListener("scroll", this, true);
|
||||
|
||||
if (!aNoNotification) {
|
||||
this.saveStateDelayed(aWindow);
|
||||
|
@ -792,7 +788,6 @@ SessionStoreService.prototype = {
|
|||
aBrowser.removeEventListener("change", this, true);
|
||||
aBrowser.removeEventListener("input", this, true);
|
||||
aBrowser.removeEventListener("DOMAutoComplete", this, true);
|
||||
aBrowser.removeEventListener("scroll", this, true);
|
||||
|
||||
delete aBrowser.__SS_data;
|
||||
|
||||
|
@ -880,15 +875,6 @@ SessionStoreService.prototype = {
|
|||
this.saveStateDelayed(aWindow, 3000);
|
||||
},
|
||||
|
||||
/**
|
||||
* Called when a browser sends a "scroll" notification
|
||||
* @param aWindow
|
||||
* Window reference
|
||||
*/
|
||||
onTabScroll: function sss_onTabScroll(aWindow) {
|
||||
this.saveStateDelayed(aWindow, 3000);
|
||||
},
|
||||
|
||||
/**
|
||||
* When a tab is selected, save session data
|
||||
* @param aWindow
|
||||
|
@ -897,7 +883,6 @@ SessionStoreService.prototype = {
|
|||
onTabSelect: function sss_onTabSelect(aWindow) {
|
||||
if (this._loadState == STATE_RUNNING) {
|
||||
this._windows[aWindow.__SSi].selected = aWindow.gBrowser.tabContainer.selectedIndex;
|
||||
this.saveStateDelayed(aWindow);
|
||||
|
||||
// attempt to update the current URL we send in a crash report
|
||||
this._updateCrashReportURL(aWindow);
|
||||
|
@ -3010,8 +2995,12 @@ let XPathHelper = {
|
|||
if (!aNode.parentNode)
|
||||
return "";
|
||||
|
||||
let prefix = this.namespacePrefixes[aNode.namespaceURI] || null;
|
||||
let tag = (prefix ? prefix + ":" : "") + this.escapeName(aNode.localName);
|
||||
// Access localName, namespaceURI just once per node since it's expensive.
|
||||
let nNamespaceURI = aNode.namespaceURI;
|
||||
let nLocalName = aNode.localName;
|
||||
|
||||
let prefix = this.namespacePrefixes[nNamespaceURI] || null;
|
||||
let tag = (prefix ? prefix + ":" : "") + this.escapeName(nLocalName);
|
||||
|
||||
// stop once we've found a tag with an ID
|
||||
if (aNode.id)
|
||||
|
@ -3022,7 +3011,7 @@ let XPathHelper = {
|
|||
let count = 0;
|
||||
let nName = aNode.name || null;
|
||||
for (let n = aNode; (n = n.previousSibling); )
|
||||
if (n.localName == aNode.localName && n.namespaceURI == aNode.namespaceURI &&
|
||||
if (n.localName == nLocalName && n.namespaceURI == nNamespaceURI &&
|
||||
(!nName || n.name == nName))
|
||||
count++;
|
||||
|
||||
|
|
|
@ -108,6 +108,7 @@ _BROWSER_TEST_FILES = \
|
|||
browser_491577.js \
|
||||
browser_493467.js \
|
||||
browser_495495.js \
|
||||
browser_506482.js \
|
||||
browser_514751.js \
|
||||
browser_522545.js \
|
||||
browser_524745.js \
|
||||
|
|
|
@ -0,0 +1,112 @@
|
|||
/* ***** 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 sessionstore test code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Mozilla Foundation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2009
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Thomas de Grenier de Latour <tom.gl@free.fr>
|
||||
*
|
||||
* 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 ***** */
|
||||
|
||||
function test() {
|
||||
/** Test for Bug 506482 **/
|
||||
|
||||
// test setup
|
||||
waitForExplicitFinish();
|
||||
|
||||
let ss = Cc["@mozilla.org/browser/sessionstore;1"].
|
||||
getService(Ci.nsISessionStore);
|
||||
|
||||
// read the sessionstore.js mtime (picked from browser_248970_a.js)
|
||||
let profilePath = Cc["@mozilla.org/file/directory_service;1"].
|
||||
getService(Ci.nsIProperties).
|
||||
get("ProfD", Ci.nsIFile);
|
||||
function getSessionstoreFile() {
|
||||
let sessionStoreJS = profilePath.clone();
|
||||
sessionStoreJS.append("sessionstore.js");
|
||||
return sessionStoreJS;
|
||||
}
|
||||
function getSessionstorejsModificationTime() {
|
||||
let file = getSessionstoreFile();
|
||||
if (file.exists())
|
||||
return file.lastModifiedTime;
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
|
||||
// delete existing sessionstore.js, to make sure we're not reading
|
||||
// the mtime of an old one initialy
|
||||
let (sessionStoreJS = getSessionstoreFile()) {
|
||||
if (sessionStoreJS.exists())
|
||||
sessionStoreJS.remove(false);
|
||||
}
|
||||
|
||||
// test content URL
|
||||
const TEST_URL = "data:text/html,"
|
||||
+ "<body style='width: 100000px; height: 100000px;'><p>top</p></body>"
|
||||
|
||||
// preferences that we use
|
||||
const PREF_INTERVAL = "browser.sessionstore.interval";
|
||||
|
||||
// make sure sessionstore.js is saved ASAP on all events
|
||||
gPrefService.setIntPref(PREF_INTERVAL, 0);
|
||||
|
||||
// get the initial sessionstore.js mtime (-1 if it doesn't exist yet)
|
||||
let mtime0 = getSessionstorejsModificationTime();
|
||||
|
||||
// create and select a first tab
|
||||
let tab = gBrowser.addTab(TEST_URL);
|
||||
tab.linkedBrowser.addEventListener("load", function loadListener(e) {
|
||||
tab.linkedBrowser.removeEventListener("load", arguments.callee, true);
|
||||
|
||||
// step1: the above has triggered some saveStateDelayed(), sleep until
|
||||
// it's done, and get the initial sessionstore.js mtime
|
||||
setTimeout(function step1(e) {
|
||||
let mtime1 = getSessionstorejsModificationTime();
|
||||
isnot(mtime1, mtime0, "initial sessionstore.js update");
|
||||
|
||||
// step2: test sessionstore.js is not updated on tab selection
|
||||
// or content scrolling
|
||||
gBrowser.selectedTab = tab;
|
||||
tab.linkedBrowser.contentWindow.scrollTo(1100, 1200);
|
||||
setTimeout(function step2(e) {
|
||||
let mtime2 = getSessionstorejsModificationTime();
|
||||
is(mtime2, mtime1,
|
||||
"tab selection and scrolling: sessionstore.js not updated");
|
||||
|
||||
// ok, done, cleanup and finish
|
||||
if (gPrefService.prefHasUserValue(PREF_INTERVAL))
|
||||
gPrefService.clearUserPref(PREF_INTERVAL);
|
||||
gBrowser.removeTab(tab);
|
||||
finish();
|
||||
}, 2500); // end of sleep after tab selection and scrolling
|
||||
}, 2500); // end of sleep after initial saveStateDelayed()
|
||||
}, true);
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
<Html>
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf8">
|
||||
</head>
|
||||
<body>
|
||||
<iframe src="#" id="data"></iframe>
|
||||
<script>
|
||||
var d=document.getElementById('data').contentDocument;
|
||||
d.clear()
|
||||
var text='Тест';
|
||||
d.write(text);
|
||||
d.close()
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,18 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html><head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<title>Testcase for bug 529670</title>
|
||||
<script>
|
||||
function boom() {
|
||||
document.createRange().getClientRects()
|
||||
document.createRange().getBoundingClientRect()
|
||||
|
||||
var range = document.createRange();
|
||||
range.detach();
|
||||
range.getClientRects()
|
||||
range.getBoundingClientRect()
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body onload="boom()"></body>
|
||||
</html>
|
|
@ -19,6 +19,7 @@ load 338391-1.xhtml
|
|||
load 340733-1.html
|
||||
load 343730-1.xhtml
|
||||
load 343850-1.xhtml
|
||||
load 343889-1.html
|
||||
load 344434-1.xhtml
|
||||
load 348049-1.xhtml
|
||||
load 344882-1.html
|
||||
|
@ -58,3 +59,4 @@ load 493281-1.html
|
|||
load 493281-2.html
|
||||
load 490760-1.xhtml
|
||||
load 494810-1.html
|
||||
load 529670.html
|
||||
|
|
|
@ -2119,7 +2119,7 @@ static void CollectClientRects(nsLayoutUtils::RectCallback* aCollector,
|
|||
if (iter.IsDone()) {
|
||||
// the range is collapsed, only continue if the cursor is in a text node
|
||||
nsCOMPtr<nsIContent> content = do_QueryInterface(aStartParent);
|
||||
if (content->IsNodeOfType(nsINode::eTEXT)) {
|
||||
if (content && content->IsNodeOfType(nsINode::eTEXT)) {
|
||||
nsIFrame* frame = content->GetPrimaryFrame();
|
||||
if (frame && frame->GetType() == nsGkAtoms::textFrame) {
|
||||
nsTextFrame* textFrame = static_cast<nsTextFrame*>(frame);
|
||||
|
@ -2144,6 +2144,8 @@ static void CollectClientRects(nsLayoutUtils::RectCallback* aCollector,
|
|||
nsCOMPtr<nsIDOMNode> node(iter.GetCurrentNode());
|
||||
iter.Next();
|
||||
nsCOMPtr<nsIContent> content = do_QueryInterface(node);
|
||||
if (!content)
|
||||
continue;
|
||||
if (content->IsNodeOfType(nsINode::eTEXT)) {
|
||||
if (node == startContainer) {
|
||||
PRInt32 offset = startContainer == endContainer ?
|
||||
|
@ -2152,7 +2154,7 @@ static void CollectClientRects(nsLayoutUtils::RectCallback* aCollector,
|
|||
continue;
|
||||
} else if (node == endContainer) {
|
||||
GetPartialTextRect(aCollector, content, 0, aEndOffset);
|
||||
continue;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2167,6 +2169,8 @@ static void CollectClientRects(nsLayoutUtils::RectCallback* aCollector,
|
|||
NS_IMETHODIMP
|
||||
nsRange::GetBoundingClientRect(nsIDOMClientRect** aResult)
|
||||
{
|
||||
*aResult = nsnull;
|
||||
|
||||
// Weak ref, since we addref it below
|
||||
nsClientRect* rect = new nsClientRect();
|
||||
if (!rect)
|
||||
|
@ -2174,6 +2178,9 @@ nsRange::GetBoundingClientRect(nsIDOMClientRect** aResult)
|
|||
|
||||
NS_ADDREF(*aResult = rect);
|
||||
|
||||
if (!mStartParent)
|
||||
return NS_OK;
|
||||
|
||||
nsLayoutUtils::RectAccumulator accumulator;
|
||||
|
||||
CollectClientRects(&accumulator, this, mStartParent, mStartOffset,
|
||||
|
@ -2190,6 +2197,9 @@ nsRange::GetClientRects(nsIDOMClientRectList** aResult)
|
|||
{
|
||||
*aResult = nsnull;
|
||||
|
||||
if (!mStartParent)
|
||||
return NS_OK;
|
||||
|
||||
nsRefPtr<nsClientRectList> rectList = new nsClientRectList();
|
||||
if (!rectList)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
|
|
@ -153,6 +153,7 @@
|
|||
#endif
|
||||
#include "nsIFocusController.h"
|
||||
#include "nsIController.h"
|
||||
#include "nsICommandParams.h"
|
||||
|
||||
#ifdef XP_MACOSX
|
||||
#import <ApplicationServices/ApplicationServices.h>
|
||||
|
@ -1343,6 +1344,7 @@ nsEventStateManager::PreHandleEvent(nsPresContext* aPresContext,
|
|||
case NS_CONTENT_COMMAND_DELETE:
|
||||
case NS_CONTENT_COMMAND_UNDO:
|
||||
case NS_CONTENT_COMMAND_REDO:
|
||||
case NS_CONTENT_COMMAND_PASTE_TRANSFERABLE:
|
||||
{
|
||||
DoContentCommandEvent(static_cast<nsContentCommandEvent*>(aEvent));
|
||||
}
|
||||
|
@ -4543,6 +4545,9 @@ nsEventStateManager::DoContentCommandEvent(nsContentCommandEvent* aEvent)
|
|||
case NS_CONTENT_COMMAND_REDO:
|
||||
cmd = "cmd_redo";
|
||||
break;
|
||||
case NS_CONTENT_COMMAND_PASTE_TRANSFERABLE:
|
||||
cmd = "cmd_pasteTransferable";
|
||||
break;
|
||||
default:
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
@ -4559,7 +4564,25 @@ nsEventStateManager::DoContentCommandEvent(nsContentCommandEvent* aEvent)
|
|||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
aEvent->mIsEnabled = canDoIt;
|
||||
if (canDoIt && !aEvent->mOnlyEnabledCheck) {
|
||||
rv = controller->DoCommand(cmd);
|
||||
switch (aEvent->message) {
|
||||
case NS_CONTENT_COMMAND_PASTE_TRANSFERABLE: {
|
||||
nsCOMPtr<nsICommandController> commandController = do_QueryInterface(controller);
|
||||
NS_ENSURE_STATE(commandController);
|
||||
|
||||
nsCOMPtr<nsICommandParams> params = do_CreateInstance("@mozilla.org/embedcomp/command-params;1", &rv);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
rv = params->SetISupportsValue("transferable", aEvent->mTransferable);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
rv = commandController->DoCommandWithParams(cmd, params);
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
rv = controller->DoCommand(cmd);
|
||||
break;
|
||||
}
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1029,137 +1029,7 @@ nsHTMLTableElement::ParseAttribute(PRInt32 aNamespaceID,
|
|||
aResult);
|
||||
}
|
||||
|
||||
static void
|
||||
MapTableFrameInto(const nsMappedAttributes* aAttributes,
|
||||
nsRuleData* aData, PRUint8 aBorderStyle)
|
||||
{
|
||||
if (!aData->mMarginData)
|
||||
return;
|
||||
|
||||
// 0 out the sides that we want to hide based on the frame attribute
|
||||
const nsAttrValue* frameValue = aAttributes->GetAttr(nsGkAtoms::frame);
|
||||
|
||||
if (frameValue && frameValue->Type() == nsAttrValue::eEnum) {
|
||||
// adjust the border style based on the value of frame
|
||||
switch (frameValue->GetEnumValue())
|
||||
{
|
||||
case NS_STYLE_TABLE_FRAME_NONE:
|
||||
if (aData->mMarginData->mBorderStyle.mLeft.GetUnit() == eCSSUnit_Null)
|
||||
aData->mMarginData->mBorderStyle.mLeft.SetIntValue(NS_STYLE_BORDER_STYLE_NONE, eCSSUnit_Enumerated);
|
||||
if (aData->mMarginData->mBorderStyle.mRight.GetUnit() == eCSSUnit_Null)
|
||||
aData->mMarginData->mBorderStyle.mRight.SetIntValue(NS_STYLE_BORDER_STYLE_NONE, eCSSUnit_Enumerated);
|
||||
if (aData->mMarginData->mBorderStyle.mTop.GetUnit() == eCSSUnit_Null)
|
||||
aData->mMarginData->mBorderStyle.mTop.SetIntValue(NS_STYLE_BORDER_STYLE_NONE, eCSSUnit_Enumerated);
|
||||
if (aData->mMarginData->mBorderStyle.mBottom.GetUnit() == eCSSUnit_Null)
|
||||
aData->mMarginData->mBorderStyle.mBottom.SetIntValue(NS_STYLE_BORDER_STYLE_NONE, eCSSUnit_Enumerated);
|
||||
break;
|
||||
case NS_STYLE_TABLE_FRAME_ABOVE:
|
||||
if (aData->mMarginData->mBorderStyle.mLeft.GetUnit() == eCSSUnit_Null)
|
||||
aData->mMarginData->mBorderStyle.mLeft.SetIntValue(NS_STYLE_BORDER_STYLE_NONE, eCSSUnit_Enumerated);
|
||||
if (aData->mMarginData->mBorderStyle.mRight.GetUnit() == eCSSUnit_Null)
|
||||
aData->mMarginData->mBorderStyle.mRight.SetIntValue(NS_STYLE_BORDER_STYLE_NONE, eCSSUnit_Enumerated);
|
||||
if (aData->mMarginData->mBorderStyle.mBottom.GetUnit() == eCSSUnit_Null)
|
||||
aData->mMarginData->mBorderStyle.mBottom.SetIntValue(NS_STYLE_BORDER_STYLE_NONE, eCSSUnit_Enumerated);
|
||||
break;
|
||||
case NS_STYLE_TABLE_FRAME_BELOW:
|
||||
if (aData->mMarginData->mBorderStyle.mLeft.GetUnit() == eCSSUnit_Null)
|
||||
aData->mMarginData->mBorderStyle.mLeft.SetIntValue(NS_STYLE_BORDER_STYLE_NONE, eCSSUnit_Enumerated);
|
||||
if (aData->mMarginData->mBorderStyle.mRight.GetUnit() == eCSSUnit_Null)
|
||||
aData->mMarginData->mBorderStyle.mRight.SetIntValue(NS_STYLE_BORDER_STYLE_NONE, eCSSUnit_Enumerated);
|
||||
if (aData->mMarginData->mBorderStyle.mTop.GetUnit() == eCSSUnit_Null)
|
||||
aData->mMarginData->mBorderStyle.mTop.SetIntValue(NS_STYLE_BORDER_STYLE_NONE, eCSSUnit_Enumerated);
|
||||
break;
|
||||
case NS_STYLE_TABLE_FRAME_HSIDES:
|
||||
if (aData->mMarginData->mBorderStyle.mLeft.GetUnit() == eCSSUnit_Null)
|
||||
aData->mMarginData->mBorderStyle.mLeft.SetIntValue(NS_STYLE_BORDER_STYLE_NONE, eCSSUnit_Enumerated);
|
||||
if (aData->mMarginData->mBorderStyle.mRight.GetUnit() == eCSSUnit_Null)
|
||||
aData->mMarginData->mBorderStyle.mRight.SetIntValue(NS_STYLE_BORDER_STYLE_NONE, eCSSUnit_Enumerated);
|
||||
break;
|
||||
case NS_STYLE_TABLE_FRAME_LEFT:
|
||||
if (aData->mMarginData->mBorderStyle.mRight.GetUnit() == eCSSUnit_Null)
|
||||
aData->mMarginData->mBorderStyle.mRight.SetIntValue(NS_STYLE_BORDER_STYLE_NONE, eCSSUnit_Enumerated);
|
||||
if (aData->mMarginData->mBorderStyle.mTop.GetUnit() == eCSSUnit_Null)
|
||||
aData->mMarginData->mBorderStyle.mTop.SetIntValue(NS_STYLE_BORDER_STYLE_NONE, eCSSUnit_Enumerated);
|
||||
if (aData->mMarginData->mBorderStyle.mBottom.GetUnit() == eCSSUnit_Null)
|
||||
aData->mMarginData->mBorderStyle.mBottom.SetIntValue(NS_STYLE_BORDER_STYLE_NONE, eCSSUnit_Enumerated);
|
||||
break;
|
||||
case NS_STYLE_TABLE_FRAME_RIGHT:
|
||||
if (aData->mMarginData->mBorderStyle.mLeft.GetUnit() == eCSSUnit_Null)
|
||||
aData->mMarginData->mBorderStyle.mLeft.SetIntValue(NS_STYLE_BORDER_STYLE_NONE, eCSSUnit_Enumerated);
|
||||
if (aData->mMarginData->mBorderStyle.mTop.GetUnit() == eCSSUnit_Null)
|
||||
aData->mMarginData->mBorderStyle.mTop.SetIntValue(NS_STYLE_BORDER_STYLE_NONE, eCSSUnit_Enumerated);
|
||||
if (aData->mMarginData->mBorderStyle.mBottom.GetUnit() == eCSSUnit_Null)
|
||||
aData->mMarginData->mBorderStyle.mBottom.SetIntValue(NS_STYLE_BORDER_STYLE_NONE, eCSSUnit_Enumerated);
|
||||
break;
|
||||
case NS_STYLE_TABLE_FRAME_VSIDES:
|
||||
if (aData->mMarginData->mBorderStyle.mTop.GetUnit() == eCSSUnit_Null)
|
||||
aData->mMarginData->mBorderStyle.mTop.SetIntValue(NS_STYLE_BORDER_STYLE_NONE, eCSSUnit_Enumerated);
|
||||
if (aData->mMarginData->mBorderStyle.mBottom.GetUnit() == eCSSUnit_Null)
|
||||
aData->mMarginData->mBorderStyle.mBottom.SetIntValue(NS_STYLE_BORDER_STYLE_NONE, eCSSUnit_Enumerated);
|
||||
break;
|
||||
// BOX and BORDER are ignored, the caller has already set all the border sides
|
||||
// any illegal value is also ignored
|
||||
}
|
||||
}
|
||||
|
||||
// set up defaults
|
||||
if (aData->mMarginData->mBorderStyle.mLeft.GetUnit() == eCSSUnit_Null)
|
||||
aData->mMarginData->mBorderStyle.mLeft.SetIntValue(aBorderStyle, eCSSUnit_Enumerated);
|
||||
if (aData->mMarginData->mBorderStyle.mRight.GetUnit() == eCSSUnit_Null)
|
||||
aData->mMarginData->mBorderStyle.mRight.SetIntValue(aBorderStyle, eCSSUnit_Enumerated);
|
||||
if (aData->mMarginData->mBorderStyle.mTop.GetUnit() == eCSSUnit_Null)
|
||||
aData->mMarginData->mBorderStyle.mTop.SetIntValue(aBorderStyle, eCSSUnit_Enumerated);
|
||||
if (aData->mMarginData->mBorderStyle.mBottom.GetUnit() == eCSSUnit_Null)
|
||||
aData->mMarginData->mBorderStyle.mBottom.SetIntValue(aBorderStyle, eCSSUnit_Enumerated);
|
||||
|
||||
}
|
||||
|
||||
// XXX The two callsites care about the two different halves of this
|
||||
// function, so split it, probably by just putting it in inline at the
|
||||
// callsites.
|
||||
static void
|
||||
MapTableBorderInto(const nsMappedAttributes* aAttributes,
|
||||
nsRuleData* aData, PRUint8 aBorderStyle)
|
||||
{
|
||||
const nsAttrValue* borderValue = aAttributes->GetAttr(nsGkAtoms::border);
|
||||
if (!borderValue && !aAttributes->GetAttr(nsGkAtoms::frame))
|
||||
return;
|
||||
|
||||
// the absence of "border" with the presence of "frame" implies
|
||||
// border = 1 pixel
|
||||
PRInt32 borderThickness = 1;
|
||||
|
||||
if (borderValue && borderValue->Type() == nsAttrValue::eInteger)
|
||||
borderThickness = borderValue->GetIntegerValue();
|
||||
|
||||
if (aData->mTableData) {
|
||||
if (0 != borderThickness) {
|
||||
// border != 0 implies rules=all and frame=border
|
||||
aData->mTableData->mRules.SetIntValue(NS_STYLE_TABLE_RULES_ALL, eCSSUnit_Enumerated);
|
||||
aData->mTableData->mFrame.SetIntValue(NS_STYLE_TABLE_FRAME_BORDER, eCSSUnit_Enumerated);
|
||||
}
|
||||
else {
|
||||
// border = 0 implies rules=none and frame=void
|
||||
aData->mTableData->mRules.SetIntValue(NS_STYLE_TABLE_RULES_NONE, eCSSUnit_Enumerated);
|
||||
aData->mTableData->mFrame.SetIntValue(NS_STYLE_TABLE_FRAME_NONE, eCSSUnit_Enumerated);
|
||||
}
|
||||
}
|
||||
|
||||
if (aData->mMarginData) {
|
||||
// by default, set all border sides to the specified width
|
||||
if (aData->mMarginData->mBorderWidth.mLeft.GetUnit() == eCSSUnit_Null)
|
||||
aData->mMarginData->mBorderWidth.mLeft.SetFloatValue((float)borderThickness, eCSSUnit_Pixel);
|
||||
if (aData->mMarginData->mBorderWidth.mRight.GetUnit() == eCSSUnit_Null)
|
||||
aData->mMarginData->mBorderWidth.mRight.SetFloatValue((float)borderThickness, eCSSUnit_Pixel);
|
||||
if (aData->mMarginData->mBorderWidth.mTop.GetUnit() == eCSSUnit_Null)
|
||||
aData->mMarginData->mBorderWidth.mTop .SetFloatValue((float)borderThickness, eCSSUnit_Pixel);
|
||||
if (aData->mMarginData->mBorderWidth.mBottom.GetUnit() == eCSSUnit_Null)
|
||||
aData->mMarginData->mBorderWidth.mBottom.SetFloatValue((float)borderThickness, eCSSUnit_Pixel);
|
||||
|
||||
// now account for the frame attribute
|
||||
MapTableFrameInto(aAttributes, aData, aBorderStyle);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
|
||||
|
@ -1201,8 +1071,6 @@ MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
|
|||
if (aData->mSIDs & NS_STYLE_INHERIT_BIT(Table)) {
|
||||
const nsStyleDisplay* readDisplay = aData->mStyleContext->GetStyleDisplay();
|
||||
if (readDisplay->mDisplay != NS_STYLE_DISPLAY_TABLE_CELL) {
|
||||
MapTableBorderInto(aAttributes, aData, 0);
|
||||
|
||||
const nsAttrValue* value;
|
||||
// layout
|
||||
if (aData->mTableData->mLayout.GetUnit() == eCSSUnit_Null) {
|
||||
|
@ -1219,11 +1087,6 @@ MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
|
|||
else // COLS had no value, so it refers to all columns
|
||||
aData->mTableData->mCols.SetIntValue(NS_STYLE_TABLE_COLS_ALL, eCSSUnit_Enumerated);
|
||||
}
|
||||
|
||||
// rules
|
||||
value = aAttributes->GetAttr(nsGkAtoms::rules);
|
||||
if (value && value->Type() == nsAttrValue::eEnum)
|
||||
aData->mTableData->mRules.SetIntValue(value->GetEnumValue(), eCSSUnit_Enumerated);
|
||||
}
|
||||
}
|
||||
if (aData->mSIDs & NS_STYLE_INHERIT_BIT(Margin)) {
|
||||
|
@ -1338,44 +1201,7 @@ MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
|
|||
if (aData->mSIDs & NS_STYLE_INHERIT_BIT(Border)) {
|
||||
const nsStyleTableBorder* tableStyle = aData->mStyleContext->GetStyleTableBorder();
|
||||
const nsStyleDisplay* readDisplay = aData->mStyleContext->GetStyleDisplay();
|
||||
if (readDisplay->mDisplay == NS_STYLE_DISPLAY_TABLE_CELL) {
|
||||
if (NS_STYLE_BORDER_SEPARATE == tableStyle->mBorderCollapse) {
|
||||
// Set the cell's border from the table in the separate border
|
||||
// model. If there is a border on the table, then the mapping to
|
||||
// rules=all will take care of borders in the collapsing model.
|
||||
// But if rules="none", we don't want to do this.
|
||||
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::border);
|
||||
const nsAttrValue* rulesValue = aAttributes->GetAttr(nsGkAtoms::rules);
|
||||
if ((!rulesValue || rulesValue->Type() != nsAttrValue::eEnum ||
|
||||
rulesValue->GetEnumValue() != NS_STYLE_TABLE_RULES_NONE) &&
|
||||
value &&
|
||||
((value->Type() == nsAttrValue::eInteger &&
|
||||
value->GetIntegerValue() > 0) ||
|
||||
value->IsEmptyString())) {
|
||||
if (aData->mMarginData->mBorderWidth.mLeft.GetUnit() == eCSSUnit_Null)
|
||||
aData->mMarginData->mBorderWidth.mLeft.SetFloatValue(1.0f, eCSSUnit_Pixel);
|
||||
if (aData->mMarginData->mBorderWidth.mRight.GetUnit() == eCSSUnit_Null)
|
||||
aData->mMarginData->mBorderWidth.mRight.SetFloatValue(1.0f, eCSSUnit_Pixel);
|
||||
if (aData->mMarginData->mBorderWidth.mTop.GetUnit() == eCSSUnit_Null)
|
||||
aData->mMarginData->mBorderWidth.mTop.SetFloatValue(1.0f, eCSSUnit_Pixel);
|
||||
if (aData->mMarginData->mBorderWidth.mBottom.GetUnit() == eCSSUnit_Null)
|
||||
aData->mMarginData->mBorderWidth.mBottom.SetFloatValue(1.0f, eCSSUnit_Pixel);
|
||||
|
||||
PRUint8 borderStyle = NS_STYLE_BORDER_STYLE_INSET;
|
||||
|
||||
if (aData->mMarginData->mBorderStyle.mLeft.GetUnit() == eCSSUnit_Null)
|
||||
aData->mMarginData->mBorderStyle.mLeft.SetIntValue(borderStyle, eCSSUnit_Enumerated);
|
||||
if (aData->mMarginData->mBorderStyle.mRight.GetUnit() == eCSSUnit_Null)
|
||||
aData->mMarginData->mBorderStyle.mRight.SetIntValue(borderStyle, eCSSUnit_Enumerated);
|
||||
if (aData->mMarginData->mBorderStyle.mTop.GetUnit() == eCSSUnit_Null)
|
||||
aData->mMarginData->mBorderStyle.mTop.SetIntValue(borderStyle, eCSSUnit_Enumerated);
|
||||
if (aData->mMarginData->mBorderStyle.mBottom.GetUnit() == eCSSUnit_Null)
|
||||
aData->mMarginData->mBorderStyle.mBottom.SetIntValue(borderStyle, eCSSUnit_Enumerated);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
PRUint8 borderStyle = NS_STYLE_BORDER_STYLE_OUTSET;
|
||||
if (readDisplay->mDisplay != NS_STYLE_DISPLAY_TABLE_CELL) {
|
||||
// bordercolor
|
||||
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::bordercolor);
|
||||
nscolor color;
|
||||
|
@ -1389,24 +1215,27 @@ MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
|
|||
aData->mMarginData->mBorderColor.mTop.SetColorValue(color);
|
||||
if (aData->mMarginData->mBorderColor.mBottom.GetUnit() == eCSSUnit_Null)
|
||||
aData->mMarginData->mBorderColor.mBottom.SetColorValue(color);
|
||||
|
||||
borderStyle = NS_STYLE_BORDER_STYLE_SOLID; // compat, see bug 349655
|
||||
}
|
||||
else if (NS_STYLE_BORDER_COLLAPSE == tableStyle->mBorderCollapse) {
|
||||
// make the color grey
|
||||
nscolor color = NS_RGB(80, 80, 80);
|
||||
if (aData->mMarginData->mBorderColor.mLeft.GetUnit() == eCSSUnit_Null)
|
||||
aData->mMarginData->mBorderColor.mLeft.SetColorValue(color);
|
||||
if (aData->mMarginData->mBorderColor.mRight.GetUnit() == eCSSUnit_Null)
|
||||
aData->mMarginData->mBorderColor.mRight.SetColorValue(color);
|
||||
if (aData->mMarginData->mBorderColor.mTop.GetUnit() == eCSSUnit_Null)
|
||||
aData->mMarginData->mBorderColor.mTop.SetColorValue(color);
|
||||
if (aData->mMarginData->mBorderColor.mBottom.GetUnit() == eCSSUnit_Null)
|
||||
aData->mMarginData->mBorderColor.mBottom.SetColorValue(color);
|
||||
}
|
||||
|
||||
// border and frame
|
||||
MapTableBorderInto(aAttributes, aData, borderStyle);
|
||||
// border
|
||||
const nsAttrValue* borderValue = aAttributes->GetAttr(nsGkAtoms::border);
|
||||
if (borderValue) {
|
||||
// border = 1 pixel default
|
||||
PRInt32 borderThickness = 1;
|
||||
|
||||
if (borderValue->Type() == nsAttrValue::eInteger)
|
||||
borderThickness = borderValue->GetIntegerValue();
|
||||
|
||||
// by default, set all border sides to the specified width
|
||||
if (aData->mMarginData->mBorderWidth.mLeft.GetUnit() == eCSSUnit_Null)
|
||||
aData->mMarginData->mBorderWidth.mLeft.SetFloatValue((float)borderThickness, eCSSUnit_Pixel);
|
||||
if (aData->mMarginData->mBorderWidth.mRight.GetUnit() == eCSSUnit_Null)
|
||||
aData->mMarginData->mBorderWidth.mRight.SetFloatValue((float)borderThickness, eCSSUnit_Pixel);
|
||||
if (aData->mMarginData->mBorderWidth.mTop.GetUnit() == eCSSUnit_Null)
|
||||
aData->mMarginData->mBorderWidth.mTop .SetFloatValue((float)borderThickness, eCSSUnit_Pixel);
|
||||
if (aData->mMarginData->mBorderWidth.mBottom.GetUnit() == eCSSUnit_Null)
|
||||
aData->mMarginData->mBorderWidth.mBottom.SetFloatValue((float)borderThickness, eCSSUnit_Pixel);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (aData->mSIDs & NS_STYLE_INHERIT_BIT(Background)) {
|
||||
|
@ -1426,7 +1255,6 @@ nsHTMLTableElement::IsAttributeMapped(const nsIAtom* aAttribute) const
|
|||
{ &nsGkAtoms::cellspacing },
|
||||
{ &nsGkAtoms::cols },
|
||||
{ &nsGkAtoms::border },
|
||||
{ &nsGkAtoms::frame },
|
||||
{ &nsGkAtoms::width },
|
||||
{ &nsGkAtoms::height },
|
||||
{ &nsGkAtoms::hspace },
|
||||
|
@ -1435,7 +1263,6 @@ nsHTMLTableElement::IsAttributeMapped(const nsIAtom* aAttribute) const
|
|||
{ &nsGkAtoms::bordercolor },
|
||||
|
||||
{ &nsGkAtoms::align },
|
||||
{ &nsGkAtoms::rules },
|
||||
{ nsnull }
|
||||
};
|
||||
|
||||
|
|
|
@ -946,6 +946,47 @@ nsDOMWindowUtils::DispatchDOMEventViaPresShell(nsIDOMNode* aTarget,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMWindowUtils::SendContentCommandEvent(const nsAString& aType,
|
||||
nsITransferable * aTransferable)
|
||||
{
|
||||
PRBool hasCap = PR_FALSE;
|
||||
if (NS_FAILED(nsContentUtils::GetSecurityManager()->IsCapabilityEnabled("UniversalXPConnect", &hasCap))
|
||||
|| !hasCap)
|
||||
return NS_ERROR_DOM_SECURITY_ERR;
|
||||
|
||||
// get the widget to send the event to
|
||||
nsCOMPtr<nsIWidget> widget = GetWidget();
|
||||
if (!widget)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
PRInt32 msg;
|
||||
if (aType.EqualsLiteral("cut"))
|
||||
msg = NS_CONTENT_COMMAND_CUT;
|
||||
else if (aType.EqualsLiteral("copy"))
|
||||
msg = NS_CONTENT_COMMAND_COPY;
|
||||
else if (aType.EqualsLiteral("paste"))
|
||||
msg = NS_CONTENT_COMMAND_PASTE;
|
||||
else if (aType.EqualsLiteral("delete"))
|
||||
msg = NS_CONTENT_COMMAND_DELETE;
|
||||
else if (aType.EqualsLiteral("undo"))
|
||||
msg = NS_CONTENT_COMMAND_UNDO;
|
||||
else if (aType.EqualsLiteral("redo"))
|
||||
msg = NS_CONTENT_COMMAND_REDO;
|
||||
else if (aType.EqualsLiteral("pasteTransferable"))
|
||||
msg = NS_CONTENT_COMMAND_PASTE_TRANSFERABLE;
|
||||
else
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
nsContentCommandEvent event(PR_TRUE, msg, widget);
|
||||
if (msg == NS_CONTENT_COMMAND_PASTE_TRANSFERABLE) {
|
||||
event.mTransferable = aTransferable;
|
||||
}
|
||||
|
||||
nsEventStatus status;
|
||||
return widget->DispatchEvent(&event, status);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMWindowUtils::GetClassName(char **aName)
|
||||
{
|
||||
|
|
|
@ -49,8 +49,9 @@ interface nsIDOMNode;
|
|||
interface nsIDOMElement;
|
||||
interface nsIDOMHTMLCanvasElement;
|
||||
interface nsIDOMEvent;
|
||||
interface nsITransferable;
|
||||
|
||||
[scriptable, uuid(0e13d9a6-bcd1-4d61-9986-c32f78f99d1a)]
|
||||
[scriptable, uuid(5ab44028-20ed-499a-bbe4-1805a1f350c8)]
|
||||
interface nsIDOMWindowUtils : nsISupports {
|
||||
|
||||
/**
|
||||
|
@ -427,4 +428,19 @@ interface nsIDOMWindowUtils : nsISupports {
|
|||
* wrapper) of aObj.
|
||||
*/
|
||||
string getClassName(/*in JSObjectPtr aObj*/);
|
||||
|
||||
/**
|
||||
* Generate a content command event.
|
||||
*
|
||||
* Cannot be accessed from unprivileged context (not content-accessible)
|
||||
* Will throw a DOM security error if called without UniversalXPConnect
|
||||
* privileges.
|
||||
*
|
||||
* @param aType Type of command content event to send. Can be one of "cut",
|
||||
* "copy", "paste", "delete", "undo", "redo", or "pasteTransferable".
|
||||
* @param aTransferable an instance of nsITransferable when aType is
|
||||
* "pasteTransferable"
|
||||
*/
|
||||
void sendContentCommandEvent(in AString aType,
|
||||
[optional] in nsITransferable aTransferable);
|
||||
};
|
||||
|
|
|
@ -53,6 +53,7 @@ interface nsITransaction;
|
|||
interface nsIEditorObserver;
|
||||
interface nsIEditActionListener;
|
||||
interface nsIInlineSpellChecker;
|
||||
interface nsITransferable;
|
||||
|
||||
%{C++
|
||||
class nsIPresShell;
|
||||
|
@ -61,7 +62,7 @@ typedef short EDirection;
|
|||
|
||||
[ptr] native nsIPresShellPtr(nsIPresShell);
|
||||
|
||||
[scriptable, uuid(96b60ba0-634a-41e4-928e-78ab0b3c4b46)]
|
||||
[scriptable, uuid(63084019-4cd0-45f8-8b10-d9f0231b2f63)]
|
||||
|
||||
interface nsIEditor : nsISupports
|
||||
{
|
||||
|
@ -339,11 +340,23 @@ interface nsIEditor : nsISupports
|
|||
*/
|
||||
void paste(in long aSelectionType);
|
||||
|
||||
/** Paste the text in |aTransferable| at the cursor position, replacing the
|
||||
* selected text (if any).
|
||||
*/
|
||||
void pasteTransferable(in nsITransferable aTransferable);
|
||||
|
||||
/** Can we paste? True if the doc is modifiable, and we have
|
||||
* pasteable data in the clipboard.
|
||||
*/
|
||||
boolean canPaste(in long aSelectionType);
|
||||
|
||||
/** Can we paste |aTransferable| or, if |aTransferable| is null, will a call
|
||||
* to pasteTransferable later possibly succeed if given an instance of
|
||||
* nsITransferable then? True if the doc is modifiable, and, if
|
||||
* |aTransfeable| is non-null, we have pasteable data in |aTransfeable|.
|
||||
*/
|
||||
boolean canPasteTransferable([optional] in nsITransferable aTransferable);
|
||||
|
||||
/* ------------ Selection methods -------------- */
|
||||
|
||||
/** sets the document selection to the entire contents of the document */
|
||||
|
|
|
@ -112,6 +112,8 @@
|
|||
#include "nsIHTMLDocument.h"
|
||||
#include "nsIParserService.h"
|
||||
|
||||
#include "nsITransferable.h"
|
||||
|
||||
#define NS_ERROR_EDITOR_NO_SELECTION NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_EDITOR,1)
|
||||
#define NS_ERROR_EDITOR_NO_TEXTNODE NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_EDITOR,2)
|
||||
|
||||
|
@ -1258,12 +1260,24 @@ nsEditor::Paste(PRInt32 aSelectionType)
|
|||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsEditor::PasteTransferable(nsITransferable *aTransferable)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsEditor::CanPaste(PRInt32 aSelectionType, PRBool *aCanPaste)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsEditor::CanPasteTransferable(nsITransferable *aTransferable, PRBool *aCanPaste)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsEditor::CanDrag(nsIDOMEvent *aEvent, PRBool *aCanDrag)
|
||||
{
|
||||
|
|
|
@ -436,6 +436,73 @@ nsPasteCommand::GetCommandStateParams(const char *aCommandName,
|
|||
return aParams->SetBooleanValue(STATE_ENABLED,canUndo);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsPasteTransferableCommand::IsCommandEnabled(const char *aCommandName,
|
||||
nsISupports *aCommandRefCon,
|
||||
PRBool *outCmdEnabled)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(outCmdEnabled);
|
||||
nsCOMPtr<nsIEditor> editor = do_QueryInterface(aCommandRefCon);
|
||||
if (editor)
|
||||
return editor->CanPasteTransferable(nsnull, outCmdEnabled);
|
||||
|
||||
*outCmdEnabled = PR_FALSE;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsPasteTransferableCommand::DoCommand(const char *aCommandName, nsISupports *aCommandRefCon)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsPasteTransferableCommand::DoCommandParams(const char *aCommandName,
|
||||
nsICommandParams *aParams,
|
||||
nsISupports *aCommandRefCon)
|
||||
{
|
||||
nsCOMPtr<nsIEditor> editor = do_QueryInterface(aCommandRefCon);
|
||||
if (!editor)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
nsCOMPtr<nsISupports> supports;
|
||||
aParams->GetISupportsValue("transferable", getter_AddRefs(supports));
|
||||
if (!supports)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
nsCOMPtr<nsITransferable> trans = do_QueryInterface(supports);
|
||||
if (!trans)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
return editor->PasteTransferable(trans);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsPasteTransferableCommand::GetCommandStateParams(const char *aCommandName,
|
||||
nsICommandParams *aParams,
|
||||
nsISupports *aCommandRefCon)
|
||||
{
|
||||
nsCOMPtr<nsIEditor> editor = do_QueryInterface(aCommandRefCon);
|
||||
if (!editor)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
nsCOMPtr<nsITransferable> trans;
|
||||
|
||||
nsCOMPtr<nsISupports> supports;
|
||||
aParams->GetISupportsValue("transferable", getter_AddRefs(supports));
|
||||
if (supports) {
|
||||
trans = do_QueryInterface(supports);
|
||||
if (!trans)
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
PRBool canPaste;
|
||||
nsresult rv = editor->CanPasteTransferable(trans, &canPaste);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
return aParams->SetBooleanValue(STATE_ENABLED, canPaste);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSwitchTextDirectionCommand::IsCommandEnabled(const char *aCommandName,
|
||||
nsISupports *aCommandRefCon,
|
||||
|
|
|
@ -82,6 +82,7 @@ NS_DECL_EDITOR_COMMAND(nsCutOrDeleteCommand)
|
|||
NS_DECL_EDITOR_COMMAND(nsCopyCommand)
|
||||
NS_DECL_EDITOR_COMMAND(nsCopyOrDeleteCommand)
|
||||
NS_DECL_EDITOR_COMMAND(nsPasteCommand)
|
||||
NS_DECL_EDITOR_COMMAND(nsPasteTransferableCommand)
|
||||
NS_DECL_EDITOR_COMMAND(nsSwitchTextDirectionCommand)
|
||||
NS_DECL_EDITOR_COMMAND(nsDeleteCommand)
|
||||
NS_DECL_EDITOR_COMMAND(nsSelectAllCommand)
|
||||
|
|
|
@ -91,6 +91,8 @@ nsresult nsEditorController::RegisterEditorCommands(nsIControllerCommandTable *i
|
|||
NS_REGISTER_ONE_COMMAND(nsSelectAllCommand, "cmd_selectAll");
|
||||
|
||||
NS_REGISTER_ONE_COMMAND(nsPasteCommand, "cmd_paste");
|
||||
NS_REGISTER_ONE_COMMAND(nsPasteTransferableCommand, "cmd_pasteTransferable");
|
||||
|
||||
NS_REGISTER_ONE_COMMAND(nsSwitchTextDirectionCommand, "cmd_switchTextDirection");
|
||||
|
||||
NS_REGISTER_FIRST_COMMAND(nsDeleteCommand, "cmd_delete");
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
<html contenteditable="true" xmlns="http://www.w3.org/1999/xhtml"><head><script>
|
||||
|
||||
function boom()
|
||||
{
|
||||
document.execCommand("selectAll", false, "");
|
||||
try { document.execCommand("justifyfull", false, null); } catch(e) { }
|
||||
try { document.execCommand("inserthorizontalrule", false, "false"); } catch(e) { }
|
||||
document.execCommand("delete", false, null);
|
||||
}
|
||||
|
||||
</script></head>x y z<body onload="boom();"><div/></body></html>
|
|
@ -12,4 +12,5 @@ load 448329-3.html
|
|||
load 456727-1.html
|
||||
load 456727-2.html
|
||||
load 467647-1.html
|
||||
load 503709-1.xhtml
|
||||
load 535632-1.xhtml
|
||||
|
|
|
@ -1933,6 +1933,30 @@ NS_IMETHODIMP nsHTMLEditor::Paste(PRInt32 aSelectionType)
|
|||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsHTMLEditor::PasteTransferable(nsITransferable *aTransferable)
|
||||
{
|
||||
ForceCompositionEnd();
|
||||
|
||||
PRBool preventDefault;
|
||||
nsresult rv = FireClipboardEvent(NS_PASTE, &preventDefault);
|
||||
if (NS_FAILED(rv) || preventDefault)
|
||||
return rv;
|
||||
|
||||
// handle transferable hooks
|
||||
nsCOMPtr<nsIDOMDocument> domdoc;
|
||||
GetDocument(getter_AddRefs(domdoc));
|
||||
if (!nsEditorHookUtils::DoInsertionHook(domdoc, nsnull, aTransferable))
|
||||
return NS_OK;
|
||||
|
||||
// Beware! This may flush notifications via synchronous
|
||||
// ScrollSelectionIntoView.
|
||||
nsAutoString contextStr, infoStr;
|
||||
rv = InsertFromTransferable(aTransferable, nsnull, contextStr, infoStr,
|
||||
nsnull, 0, PR_TRUE);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
//
|
||||
// HTML PasteNoFormatting. Ignore any HTML styles and formating in paste source
|
||||
//
|
||||
|
@ -1967,6 +1991,14 @@ NS_IMETHODIMP nsHTMLEditor::PasteNoFormatting(PRInt32 aSelectionType)
|
|||
}
|
||||
|
||||
|
||||
// The following arrays contain the MIME types that we can paste. The arrays
|
||||
// are used by CanPaste() and CanPasteTransferable() below.
|
||||
|
||||
static const char* textEditorFlavors[] = { kUnicodeMime };
|
||||
static const char* textHtmlEditorFlavors[] = { kUnicodeMime, kHTMLMime,
|
||||
kJPEGImageMime, kPNGImageMime,
|
||||
kGIFImageMime };
|
||||
|
||||
NS_IMETHODIMP nsHTMLEditor::CanPaste(PRInt32 aSelectionType, PRBool *aCanPaste)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aCanPaste);
|
||||
|
@ -1980,11 +2012,6 @@ NS_IMETHODIMP nsHTMLEditor::CanPaste(PRInt32 aSelectionType, PRBool *aCanPaste)
|
|||
nsCOMPtr<nsIClipboard> clipboard(do_GetService("@mozilla.org/widget/clipboard;1", &rv));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
// the flavors that we can deal with (preferred order selectable for k*ImageMime)
|
||||
const char* textEditorFlavors[] = { kUnicodeMime };
|
||||
const char* textHtmlEditorFlavors[] = { kUnicodeMime, kHTMLMime,
|
||||
kJPEGImageMime, kPNGImageMime, kGIFImageMime };
|
||||
|
||||
PRUint32 editorFlags;
|
||||
GetFlags(&editorFlags);
|
||||
|
||||
|
@ -2006,6 +2033,54 @@ NS_IMETHODIMP nsHTMLEditor::CanPaste(PRInt32 aSelectionType, PRBool *aCanPaste)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsHTMLEditor::CanPasteTransferable(nsITransferable *aTransferable, PRBool *aCanPaste)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aCanPaste);
|
||||
|
||||
// can't paste if readonly
|
||||
if (!IsModifiable()) {
|
||||
*aCanPaste = PR_FALSE;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// If |aTransferable| is null, assume that a paste will succeed.
|
||||
if (!aTransferable) {
|
||||
*aCanPaste = PR_TRUE;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// Peek in |aTransferable| to see if it contains a supported MIME type.
|
||||
|
||||
PRUint32 editorFlags;
|
||||
GetFlags(&editorFlags);
|
||||
|
||||
// Use the flavors depending on the current editor mask
|
||||
const char ** flavors;
|
||||
unsigned length;
|
||||
if ((editorFlags & eEditorPlaintextMask)) {
|
||||
flavors = textEditorFlavors;
|
||||
length = NS_ARRAY_LENGTH(textEditorFlavors);
|
||||
} else {
|
||||
flavors = textHtmlEditorFlavors;
|
||||
length = NS_ARRAY_LENGTH(textHtmlEditorFlavors);
|
||||
}
|
||||
|
||||
for (unsigned int i = 0; i < length; i++, flavors++) {
|
||||
nsCOMPtr<nsISupports> data;
|
||||
PRUint32 dataLen;
|
||||
nsresult rv = aTransferable->GetTransferData(*flavors,
|
||||
getter_AddRefs(data),
|
||||
&dataLen);
|
||||
if (NS_SUCCEEDED(rv) && data) {
|
||||
*aCanPaste = PR_TRUE;
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
|
||||
*aCanPaste = PR_FALSE;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// HTML PasteAsQuotation: Paste in a blockquote type=cite
|
||||
|
|
|
@ -319,6 +319,9 @@ public:
|
|||
NS_IMETHOD Paste(PRInt32 aSelectionType);
|
||||
NS_IMETHOD CanPaste(PRInt32 aSelectionType, PRBool *aCanPaste);
|
||||
|
||||
NS_IMETHOD PasteTransferable(nsITransferable *aTransferable);
|
||||
NS_IMETHOD CanPasteTransferable(nsITransferable *aTransferable, PRBool *aCanPaste);
|
||||
|
||||
NS_IMETHOD DebugUnitTests(PRInt32 *outNumTests, PRInt32 *outNumTestsFailed);
|
||||
|
||||
/** All editor operations which alter the doc should be prefaced
|
||||
|
|
|
@ -52,6 +52,7 @@ _TEST_FILES = \
|
|||
test_bug478725.html \
|
||||
test_bug480972.html \
|
||||
test_bug487524.html \
|
||||
test_bug525389.html \
|
||||
test_select_all_without_body.html \
|
||||
file_select_all_without_body.html \
|
||||
$(NULL)
|
||||
|
|
|
@ -0,0 +1,189 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html><head>
|
||||
<title>Test for bug 525389</title>
|
||||
<style src="/tests/SimpleTest/test.css" type="text/css"></style>
|
||||
<script type="application/javascript" src="/MochiKit/packed.js"></script>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
|
||||
|
||||
<script class="testbody" type="application/javascript">
|
||||
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
var utils = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor).getInterface(Components.interfaces.nsIDOMWindowUtils);
|
||||
var Cc = Components.classes;
|
||||
var Ci = Components.interfaces;
|
||||
|
||||
function runTest() {
|
||||
var pasteCount = 0;
|
||||
var pasteFunc = function (event) { pasteCount++; };
|
||||
|
||||
function verifyContent(s) {
|
||||
var e = document.getElementById('i1');
|
||||
var doc = e.contentDocument;
|
||||
is(doc.body.innerHTML, s, "");
|
||||
}
|
||||
|
||||
function pasteInto(trans, html, target_id) {
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
var e = document.getElementById('i1');
|
||||
var doc = e.contentDocument;
|
||||
doc.designMode = "on";
|
||||
doc.body.innerHTML = html;
|
||||
doc.defaultView.focus();
|
||||
if (target_id)
|
||||
e = doc.getElementById(target_id);
|
||||
else
|
||||
e = doc.body;
|
||||
var selection = doc.defaultView.getSelection();
|
||||
selection.removeAllRanges();
|
||||
selection.selectAllChildren(e);
|
||||
selection.collapseToEnd();
|
||||
|
||||
pasteCount = 0;
|
||||
e.addEventListener("paste", pasteFunc, false);
|
||||
utils.sendContentCommandEvent("pasteTransferable", trans);
|
||||
e.removeEventListener("paste", pasteFunc, false);
|
||||
|
||||
return e;
|
||||
}
|
||||
|
||||
function getTransferableFromClipboard(asHTML) {
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
var trans = Cc["@mozilla.org/widget/transferable;1"].createInstance(Ci.nsITransferable);
|
||||
if (asHTML) {
|
||||
trans.addDataFlavor("text/html");
|
||||
} else {
|
||||
trans.addDataFlavor("text/unicode");
|
||||
}
|
||||
var clip = Cc["@mozilla.org/widget/clipboard;1"].getService(Ci.nsIClipboard);
|
||||
clip.getData(trans, Ci.nsIClipboard.kGlobalClipboard);
|
||||
return trans;
|
||||
}
|
||||
|
||||
function makeTransferable(s,asHTML,target_id) {
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
|
||||
var e = document.getElementById('i2');
|
||||
var doc = e.contentDocument;
|
||||
if (asHTML) {
|
||||
doc.body.innerHTML = s;
|
||||
} else {
|
||||
var text = doc.createTextNode(s);
|
||||
doc.body.appendChild(text);
|
||||
}
|
||||
doc.designMode = "on";
|
||||
doc.defaultView.focus();
|
||||
var selection = doc.defaultView.getSelection();
|
||||
selection.removeAllRanges();
|
||||
if (!target_id) {
|
||||
selection.selectAllChildren(doc.body);
|
||||
} else {
|
||||
var range = document.createRange();
|
||||
range.selectNode(doc.getElementById(target_id));
|
||||
selection.addRange(range);
|
||||
}
|
||||
|
||||
// We cannot use plain strings, we have to use nsSupportsString.
|
||||
var supportsStringClass = Components.classes["@mozilla.org/supports-string;1"];
|
||||
var ssData = supportsStringClass.createInstance(Ci.nsISupportsString);
|
||||
|
||||
// Create the transferable.
|
||||
var trans = Cc["@mozilla.org/widget/transferable;1"].createInstance(Ci.nsITransferable);
|
||||
|
||||
// Add the data to the transferable.
|
||||
if (asHTML) {
|
||||
trans.addDataFlavor("text/html");
|
||||
ssData.data = doc.body.innerHTML;
|
||||
trans.setTransferData("text/html", ssData, ssData.length * 2);
|
||||
} else {
|
||||
trans.addDataFlavor("text/unicode");
|
||||
ssData.data = doc.body.innerHTML;
|
||||
trans.setTransferData("text/unicode", ssData, ssData.length * 2);
|
||||
}
|
||||
|
||||
return trans;
|
||||
}
|
||||
|
||||
function copyToClipBoard(s,asHTML,target_id) {
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
var e = document.getElementById('i2');
|
||||
var doc = e.contentDocument;
|
||||
if (asHTML) {
|
||||
doc.body.innerHTML = s;
|
||||
} else {
|
||||
var text = doc.createTextNode(s);
|
||||
doc.body.appendChild(text);
|
||||
}
|
||||
doc.designMode = "on";
|
||||
doc.defaultView.focus();
|
||||
var selection = doc.defaultView.getSelection();
|
||||
selection.removeAllRanges();
|
||||
if (!target_id) {
|
||||
selection.selectAllChildren(doc.body);
|
||||
} else {
|
||||
var range = document.createRange();
|
||||
range.selectNode(doc.getElementById(target_id));
|
||||
selection.addRange(range);
|
||||
}
|
||||
doc.execCommand("copy", false, null);
|
||||
return e;
|
||||
}
|
||||
|
||||
copyToClipBoard('<span>Hello</span><span>Kitty</span>', true);
|
||||
var trans = getTransferableFromClipboard(true);
|
||||
pasteInto(trans, '');
|
||||
verifyContent('<span>Hello</span><span>Kitty</span>');
|
||||
is(pasteCount, 1, "paste event was not triggered");
|
||||
|
||||
// this test is not working out exactly like the clipboard test
|
||||
// has to do with generating the nsITransferable above
|
||||
//trans = makeTransferable('<span>Hello</span><span>Kitty</span>', true);
|
||||
//pasteInto(trans, '');
|
||||
//verifyContent('<span>Hello</span><span>Kitty</span>');
|
||||
|
||||
copyToClipBoard("<dl><dd>Hello Kitty</dd></dl><span>Hello</span><span>Kitty</span>", true);
|
||||
trans = getTransferableFromClipboard(true);
|
||||
pasteInto(trans, '<ol><li id="paste_here">X</li></ol>',"paste_here");
|
||||
verifyContent('<ol><li id="paste_here">X<dl><dd>Hello Kitty</dd></dl><span>Hello</span><span>Kitty</span></li></ol>');
|
||||
is(pasteCount, 1, "paste event was not triggered");
|
||||
|
||||
// The following test doesn't do what I expected, because the special handling
|
||||
// of IsList nodes in nsHTMLEditor::InsertHTMLWithContext simply removes
|
||||
// non-list/item children. See bug 481177.
|
||||
// copyToClipBoard("<ol><li>Hello Kitty</li><span>Hello</span></ol>", true);
|
||||
// pasteInto('<ol><li id="paste_here">X</li></ol>',"paste_here");
|
||||
// verifyContent('<ol><li id="paste_here">X</li><li>Hello Kitty</li><span>Hello</span></ol>');
|
||||
|
||||
copyToClipBoard("<pre>Kitty</pre><span>Hello</span>", true);
|
||||
trans = getTransferableFromClipboard(true);
|
||||
pasteInto(trans, '<pre id="paste_here">Hello </pre>',"paste_here");
|
||||
verifyContent('<pre id="paste_here">Hello Kitty<span>Hello</span></pre>');
|
||||
is(pasteCount, 1, "paste event was not triggered");
|
||||
|
||||
// test that we can preventDefault pastes
|
||||
pasteFunc = function (event) { event.preventDefault(); return false; };
|
||||
copyToClipBoard("<pre>Kitty</pre><span>Hello</span>", true);
|
||||
trans = getTransferableFromClipboard(true);
|
||||
pasteInto(trans, '<pre id="paste_here">Hello </pre>',"paste_here");
|
||||
verifyContent('<pre id="paste_here">Hello </pre>');
|
||||
is(pasteCount, 0, "paste event was triggered");
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
addLoadEvent(runTest);
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=525389">Mozilla Bug 525389</a>
|
||||
<p id="display"></p>
|
||||
|
||||
<pre id="test">
|
||||
</pre>
|
||||
|
||||
<iframe id="i1" width="200" height="100" src="about:blank"></iframe><br>
|
||||
<iframe id="i2" width="200" height="100" src="about:blank"></iframe><br>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -455,6 +455,30 @@ NS_IMETHODIMP nsPlaintextEditor::Paste(PRInt32 aSelectionType)
|
|||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsPlaintextEditor::PasteTransferable(nsITransferable *aTransferable)
|
||||
{
|
||||
ForceCompositionEnd();
|
||||
|
||||
PRBool preventDefault;
|
||||
nsresult rv = FireClipboardEvent(NS_PASTE, &preventDefault);
|
||||
if (NS_FAILED(rv) || preventDefault)
|
||||
return rv;
|
||||
|
||||
if (!IsModifiable())
|
||||
return NS_OK;
|
||||
|
||||
// handle transferable hooks
|
||||
nsCOMPtr<nsIDOMDocument> domdoc;
|
||||
GetDocument(getter_AddRefs(domdoc));
|
||||
if (!nsEditorHookUtils::DoInsertionHook(domdoc, nsnull, aTransferable))
|
||||
return NS_OK;
|
||||
|
||||
// Beware! This may flush notifications via synchronous
|
||||
// ScrollSelectionIntoView.
|
||||
rv = InsertTextFromTransferable(aTransferable, nsnull, nsnull, PR_TRUE);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsPlaintextEditor::CanPaste(PRInt32 aSelectionType, PRBool *aCanPaste)
|
||||
{
|
||||
|
@ -482,6 +506,37 @@ NS_IMETHODIMP nsPlaintextEditor::CanPaste(PRInt32 aSelectionType, PRBool *aCanPa
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP nsPlaintextEditor::CanPasteTransferable(nsITransferable *aTransferable, PRBool *aCanPaste)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aCanPaste);
|
||||
|
||||
// can't paste if readonly
|
||||
if (!IsModifiable()) {
|
||||
*aCanPaste = PR_FALSE;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// If |aTransferable| is null, assume that a paste will succeed.
|
||||
if (!aTransferable) {
|
||||
*aCanPaste = PR_TRUE;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsISupports> data;
|
||||
PRUint32 dataLen;
|
||||
nsresult rv = aTransferable->GetTransferData(kUnicodeMime,
|
||||
getter_AddRefs(data),
|
||||
&dataLen);
|
||||
if (NS_SUCCEEDED(rv) && data)
|
||||
*aCanPaste = PR_TRUE;
|
||||
else
|
||||
*aCanPaste = PR_FALSE;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
nsresult
|
||||
nsPlaintextEditor::SetupDocEncoder(nsIDocumentEncoder **aDocEncoder)
|
||||
{
|
||||
|
|
|
@ -124,6 +124,8 @@ public:
|
|||
NS_IMETHOD CanCopy(PRBool *aCanCopy);
|
||||
NS_IMETHOD Paste(PRInt32 aSelectionType);
|
||||
NS_IMETHOD CanPaste(PRInt32 aSelectionType, PRBool *aCanPaste);
|
||||
NS_IMETHOD PasteTransferable(nsITransferable *aTransferable);
|
||||
NS_IMETHOD CanPasteTransferable(nsITransferable *aTransferable, PRBool *aCanPaste);
|
||||
|
||||
NS_IMETHOD CanDrag(nsIDOMEvent *aDragEvent, PRBool *aCanDrag);
|
||||
NS_IMETHOD DoDrag(nsIDOMEvent *aDragEvent);
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<script type="text/javascript">
|
||||
|
||||
function boom()
|
||||
{
|
||||
var w = document.getElementById("w");
|
||||
var q = document.getElementById("q");
|
||||
var e = document.createTextNode("");
|
||||
document.documentElement.appendChild(document.body);
|
||||
w.appendChild(e);
|
||||
document.documentElement.offsetHeight;
|
||||
w.removeChild(q);
|
||||
document.documentElement.offsetHeight;
|
||||
e.data += " x ";
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body onload="boom();"><span id="w">s‮<span id="q"></span><div></div><span>a</span></span></body>
|
||||
</html>
|
|
@ -60,4 +60,5 @@ load 467703-1.xhtml
|
|||
load 467873-1.html
|
||||
load 470418-1.html
|
||||
load 487549-1.html
|
||||
load 487724-1.html
|
||||
load 490777-1.html
|
||||
|
|
|
@ -214,6 +214,10 @@ public:
|
|||
return PR_TRUE;
|
||||
}
|
||||
|
||||
void SetFamily(gfxFontFamily* aFamily) {
|
||||
mFamily = aFamily;
|
||||
}
|
||||
|
||||
const nsString& FamilyName();
|
||||
|
||||
nsString mName;
|
||||
|
|
|
@ -123,6 +123,7 @@ gfxFT2FontList::AppendFacesFromFontFile(const PRUnichar *aFileName)
|
|||
mFontFamilies.Put(name, family);
|
||||
}
|
||||
family->AddFontEntry(fe);
|
||||
fe->SetFamily(family);
|
||||
family->SetHasStyles(PR_TRUE);
|
||||
#ifdef PR_LOGGING
|
||||
if (LOG_ENABLED()) {
|
||||
|
|
|
@ -427,6 +427,7 @@ GDIFontFamily::FamilyAddStylesProc(const ENUMLOGFONTEXW *lpelfe,
|
|||
return 1;
|
||||
|
||||
ff->mAvailableFonts.AppendElement(fe);
|
||||
fe->SetFamily(ff);
|
||||
|
||||
// mark the charset bit
|
||||
fe->mCharset[metrics.tmCharSet] = 1;
|
||||
|
|
|
@ -43,6 +43,18 @@
|
|||
#include "Module.h"
|
||||
#include "nsTArray.h"
|
||||
#include "prlink.h"
|
||||
|
||||
// Define __i386__ and __x86_64__ as appropriate for the Sun Pro compiler,
|
||||
// before #including ffi.h. (libffi itself is built with gcc on Solaris.)
|
||||
#if defined(__SUNPRO_C) || defined(__SUNPRO_CC)
|
||||
#ifdef __i386
|
||||
#define __i386__
|
||||
#endif
|
||||
#ifdef __x86_64
|
||||
#define __x86_64__
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "ffi.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
Patch libffi 3.0.9 to fix bug 528129.
|
||||
|
||||
diff --git a/js/ctypes/libffi/Makefile.in b/js/ctypes/libffi/Makefile.in
|
||||
--- a/js/ctypes/libffi/Makefile.in
|
||||
+++ b/js/ctypes/libffi/Makefile.in
|
||||
@@ -192,17 +192,17 @@ LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIB
|
||||
CCLD = $(CC)
|
||||
LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
|
||||
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
|
||||
$(LDFLAGS) -o $@
|
||||
SOURCES = $(libffi_la_SOURCES) $(nodist_libffi_la_SOURCES) \
|
||||
$(libffi_convenience_la_SOURCES) \
|
||||
$(nodist_libffi_convenience_la_SOURCES)
|
||||
DIST_SOURCES = $(libffi_la_SOURCES) $(libffi_convenience_la_SOURCES)
|
||||
-INFO_DEPS = $(srcdir)/doc/libffi.info
|
||||
+INFO_DEPS =
|
||||
am__TEXINFO_TEX_DIR = $(srcdir)
|
||||
DVIS = doc/libffi.dvi
|
||||
PDFS = doc/libffi.pdf
|
||||
PSS = doc/libffi.ps
|
||||
HTMLS = doc/libffi.html
|
||||
TEXINFOS = doc/libffi.texi
|
||||
TEXI2DVI = texi2dvi
|
||||
TEXI2PDF = $(TEXI2DVI) --pdf --batch
|
||||
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,3 +1,276 @@
|
|||
2009-12-27 Matthias Klose <doko@ubuntu.com>
|
||||
|
||||
* configure.ac (HAVE_LONG_DOUBLE): Define for mips when
|
||||
appropriate.
|
||||
* configure: Rebuilt.
|
||||
|
||||
2009-12-27 Anthony Green <green@redhat.com>
|
||||
|
||||
* testsuite/libffi.call/cls_longdouble.c: Don't xfail for ARM.
|
||||
|
||||
2009-12-26 Anthony Green <green@redhat.com>
|
||||
|
||||
* testsuite/libffi.call/huge_struct.c: Don't xfail for avr32*-*-*.
|
||||
* testsuite/libffi.call/cls_longdouble_va.c: Mark as xfail for
|
||||
avr32*-*-*.
|
||||
* testsuite/libffi.call/cls_double_va.c: Ditto.
|
||||
|
||||
2009-12-26 Andreas Tobler <a.tobler@schweiz.org>
|
||||
|
||||
* testsuite/libffi.call/ffitest.h: Conditionally include stdint.h
|
||||
and inttypes.h.
|
||||
* testsuite/libffi.special/unwindtest.cc: Ditto.
|
||||
* testsuite/libffi.call/huge_struct.c: Don't include stdint.h
|
||||
directly.
|
||||
|
||||
2009-12-26 Andreas Tobler <a.tobler@schweiz.org>
|
||||
|
||||
* configure.ac: Add amd64-*-openbsd*.
|
||||
* configure: Rebuilt.
|
||||
* testsuite/lib/libffi-dg.exp (libffi_target_compile): Link
|
||||
openbsd programs with -lpthread.
|
||||
|
||||
2009-12-26 Anthony Green <green@redhat.com>
|
||||
|
||||
* testsuite/libffi.call/cls_double_va.c,
|
||||
testsuite/libffi.call/cls_longdouble.c,
|
||||
testsuite/libffi.call/cls_longdouble_va.c,
|
||||
testsuite/libffi.call/cls_pointer.c,
|
||||
testsuite/libffi.call/cls_pointer_stack.c: Remove xfail for
|
||||
mips*-*-* and arm*-*-*.
|
||||
* testsuite/libffi.call/cls_align_longdouble_split.c,
|
||||
testsuite/libffi.call/cls_align_longdouble_split2.c,
|
||||
testsuite/libffi.call/stret_medium2.c,
|
||||
testsuite/libffi.call/stret_medium.c,
|
||||
testsuite/libffi.call/stret_large.c,
|
||||
testsuite/libffi.call/stret_large2.c: Remove xfail for arm*-*-*.
|
||||
|
||||
2009-12-26 Andreas Tobler <a.tobler@schweiz.org>
|
||||
Anthony Green <green@redhat.com>
|
||||
|
||||
* testsuite/libffi.call/huge_struct.c (test_large_fn): Replace
|
||||
format code %p with %#lx because %p does not add a leading 0x on
|
||||
Solaris. Also change relevant arguments to unsigned long.
|
||||
|
||||
2009-12-25 Samuli Suominen <ssuominen@gentoo.org>
|
||||
|
||||
* configure.ac: Undefine _AC_ARG_VAR_PRECIOUS for autoconf 2.64.
|
||||
* configure: Rebuilt.
|
||||
* fficonfig.h.in: Rebuilt.
|
||||
|
||||
2009-12-29 Kay Tietz <ktietz70@googlemail.com>
|
||||
|
||||
* testsuite/libffi.call/ffitest.h,
|
||||
testsuite/libffi.special/ffitestcxx.h (PRIdLL, PRuLL): Fix
|
||||
definitions.
|
||||
|
||||
2009-12-25 Carlo Bramini <carlo.bramix@libero.it>
|
||||
|
||||
* configure.ac (AM_LTLDFLAGS): Define for windows hosts.
|
||||
* Makefile.am (libffi_la_LDFLAGS): Add AM_LTLDFLAGS.
|
||||
* configure: Rebuilt.
|
||||
* Makefile.in: Rebuilt.
|
||||
|
||||
2009-12-24 Anthony Green <green@redhat.com>
|
||||
|
||||
* testsuite/libffi.call/huge_struct.c: Fix printf format, and
|
||||
don't xfail x86 Linux.
|
||||
* testsuite/libffi.call/huge_struct.c: Don't xfail mips.
|
||||
* testsuite/libffi.call/cls_pointer.c: Ditto.
|
||||
* testsuite/libffi.call/cls_pointer_stack.c: Ditto.
|
||||
* testsuite/libffi.call/cls_longdouble_va.c: Ditto.
|
||||
* testsuite/libffi.call/cls_longdouble.c: Ditto.
|
||||
* testsuite/libffi.call/cls_double_va.c: Ditto.
|
||||
|
||||
2009-06-16 Andrew Haley <aph@redhat.com>
|
||||
|
||||
* testsuite/libffi.call/cls_align_sint64.c,
|
||||
testsuite/libffi.call/cls_align_uint64.c,
|
||||
testsuite/libffi.call/cls_longdouble_va.c,
|
||||
testsuite/libffi.call/cls_ulonglong.c,
|
||||
testsuite/libffi.call/return_ll1.c,
|
||||
testsuite/libffi.call/stret_medium2.c: Fix printf format
|
||||
specifiers.
|
||||
* testsuite/libffi.call/huge_struct.c: Ad x86 XFAILs.
|
||||
* testsuite/libffi.call/float2.c: Fix dg-excess-errors.
|
||||
* testsuite/libffi.call/ffitest.h,
|
||||
testsuite/libffi.special/ffitestcxx.h (PRIdLL, PRIuLL): Define.
|
||||
|
||||
2009-06-12 Andrew Haley <aph@redhat.com>
|
||||
|
||||
* testsuite/libffi.call/cls_align_sint64.c,
|
||||
testsuite/libffi.call/cls_align_uint64.c,
|
||||
testsuite/libffi.call/cls_ulonglong.c,
|
||||
testsuite/libffi.call/return_ll1.c,
|
||||
testsuite/libffi.call/stret_medium2.c: Fix printf format
|
||||
specifiers.
|
||||
testsuite/libffi.special/unwindtest.cc: include stdint.h.
|
||||
|
||||
2009-06-11 Timothy Wall <twall@users.sf.net>
|
||||
|
||||
* Makefile.am,
|
||||
configure.ac,
|
||||
include/ffi.h.in,
|
||||
include/ffi_common.h,
|
||||
src/closures.c,
|
||||
src/dlmalloc.c,
|
||||
src/x86/ffi.c,
|
||||
src/x86/ffitarget.h,
|
||||
src/x86/win64.S (new),
|
||||
README: Added win64 support (mingw or MSVC)
|
||||
* Makefile.in,
|
||||
include/Makefile.in,
|
||||
man/Makefile.in,
|
||||
testsuite/Makefile.in,
|
||||
configure,
|
||||
aclocal.m4: Regenerated
|
||||
* ltcf-c.sh: properly escape cygwin/w32 path
|
||||
* man/ffi_call.3: Clarify size requirements for return value.
|
||||
* src/x86/ffi64.c: Fix filename in comment.
|
||||
* src/x86/win32.S: Remove unused extern.
|
||||
|
||||
* testsuite/libffi.call/closure_fn0.c,
|
||||
testsuite/libffi.call/closure_fn1.c,
|
||||
testsuite/libffi.call/closure_fn2.c,
|
||||
testsuite/libffi.call/closure_fn3.c,
|
||||
testsuite/libffi.call/closure_fn4.c,
|
||||
testsuite/libffi.call/closure_fn5.c,
|
||||
testsuite/libffi.call/closure_fn6.c,
|
||||
testsuite/libffi.call/closure_stdcall.c,
|
||||
testsuite/libffi.call/cls_12byte.c,
|
||||
testsuite/libffi.call/cls_16byte.c,
|
||||
testsuite/libffi.call/cls_18byte.c,
|
||||
testsuite/libffi.call/cls_19byte.c,
|
||||
testsuite/libffi.call/cls_1_1byte.c,
|
||||
testsuite/libffi.call/cls_20byte.c,
|
||||
testsuite/libffi.call/cls_20byte1.c,
|
||||
testsuite/libffi.call/cls_24byte.c,
|
||||
testsuite/libffi.call/cls_2byte.c,
|
||||
testsuite/libffi.call/cls_3_1byte.c,
|
||||
testsuite/libffi.call/cls_3byte1.c,
|
||||
testsuite/libffi.call/cls_3byte2.c,
|
||||
testsuite/libffi.call/cls_4_1byte.c,
|
||||
testsuite/libffi.call/cls_4byte.c,
|
||||
testsuite/libffi.call/cls_5_1_byte.c,
|
||||
testsuite/libffi.call/cls_5byte.c,
|
||||
testsuite/libffi.call/cls_64byte.c,
|
||||
testsuite/libffi.call/cls_6_1_byte.c,
|
||||
testsuite/libffi.call/cls_6byte.c,
|
||||
testsuite/libffi.call/cls_7_1_byte.c,
|
||||
testsuite/libffi.call/cls_7byte.c,
|
||||
testsuite/libffi.call/cls_8byte.c,
|
||||
testsuite/libffi.call/cls_9byte1.c,
|
||||
testsuite/libffi.call/cls_9byte2.c,
|
||||
testsuite/libffi.call/cls_align_double.c,
|
||||
testsuite/libffi.call/cls_align_float.c,
|
||||
testsuite/libffi.call/cls_align_longdouble.c,
|
||||
testsuite/libffi.call/cls_align_longdouble_split.c,
|
||||
testsuite/libffi.call/cls_align_longdouble_split2.c,
|
||||
testsuite/libffi.call/cls_align_pointer.c,
|
||||
testsuite/libffi.call/cls_align_sint16.c,
|
||||
testsuite/libffi.call/cls_align_sint32.c,
|
||||
testsuite/libffi.call/cls_align_sint64.c,
|
||||
testsuite/libffi.call/cls_align_uint16.c,
|
||||
testsuite/libffi.call/cls_align_uint32.c,
|
||||
testsuite/libffi.call/cls_align_uint64.c,
|
||||
testsuite/libffi.call/cls_dbls_struct.c,
|
||||
testsuite/libffi.call/cls_double.c,
|
||||
testsuite/libffi.call/cls_double_va.c,
|
||||
testsuite/libffi.call/cls_float.c,
|
||||
testsuite/libffi.call/cls_longdouble.c,
|
||||
testsuite/libffi.call/cls_longdouble_va.c,
|
||||
testsuite/libffi.call/cls_multi_schar.c,
|
||||
testsuite/libffi.call/cls_multi_sshort.c,
|
||||
testsuite/libffi.call/cls_multi_sshortchar.c,
|
||||
testsuite/libffi.call/cls_multi_uchar.c,
|
||||
testsuite/libffi.call/cls_multi_ushort.c,
|
||||
testsuite/libffi.call/cls_multi_ushortchar.c,
|
||||
testsuite/libffi.call/cls_pointer.c,
|
||||
testsuite/libffi.call/cls_pointer_stack.c,
|
||||
testsuite/libffi.call/cls_schar.c,
|
||||
testsuite/libffi.call/cls_sint.c,
|
||||
testsuite/libffi.call/cls_sshort.c,
|
||||
testsuite/libffi.call/cls_uchar.c,
|
||||
testsuite/libffi.call/cls_uint.c,
|
||||
testsuite/libffi.call/cls_ulonglong.c,
|
||||
testsuite/libffi.call/cls_ushort.c,
|
||||
testsuite/libffi.call/err_bad_abi.c,
|
||||
testsuite/libffi.call/err_bad_typedef.c,
|
||||
testsuite/libffi.call/float2.c,
|
||||
testsuite/libffi.call/huge_struct.c,
|
||||
testsuite/libffi.call/nested_struct.c,
|
||||
testsuite/libffi.call/nested_struct1.c,
|
||||
testsuite/libffi.call/nested_struct10.c,
|
||||
testsuite/libffi.call/nested_struct2.c,
|
||||
testsuite/libffi.call/nested_struct3.c,
|
||||
testsuite/libffi.call/nested_struct4.c,
|
||||
testsuite/libffi.call/nested_struct5.c,
|
||||
testsuite/libffi.call/nested_struct6.c,
|
||||
testsuite/libffi.call/nested_struct7.c,
|
||||
testsuite/libffi.call/nested_struct8.c,
|
||||
testsuite/libffi.call/nested_struct9.c,
|
||||
testsuite/libffi.call/problem1.c,
|
||||
testsuite/libffi.call/return_ldl.c,
|
||||
testsuite/libffi.call/return_ll1.c,
|
||||
testsuite/libffi.call/stret_large.c,
|
||||
testsuite/libffi.call/stret_large2.c,
|
||||
testsuite/libffi.call/stret_medium.c,
|
||||
testsuite/libffi.call/stret_medium2.c,
|
||||
testsuite/libffi.special/unwindtest.cc: use ffi_closure_alloc instead
|
||||
of checking for MMAP. Use intptr_t instead of long casts.
|
||||
|
||||
2009-06-04 Andrew Haley <aph@redhat.com>
|
||||
|
||||
* src/powerpc/ffitarget.h: Fix misapplied merge from gcc.
|
||||
|
||||
2009-06-04 Andrew Haley <aph@redhat.com>
|
||||
|
||||
* src/mips/o32.S,
|
||||
src/mips/n32.S: Fix licence formatting.
|
||||
|
||||
2009-06-04 Andrew Haley <aph@redhat.com>
|
||||
|
||||
* src/x86/darwin.S: Fix licence formatting.
|
||||
src/x86/win32.S: Likewise.
|
||||
src/sh64/sysv.S: Likewise.
|
||||
src/sh/sysv.S: Likewise.
|
||||
|
||||
2009-06-04 Andrew Haley <aph@redhat.com>
|
||||
|
||||
* src/sh64/ffi.c: Remove lint directives. Was missing from merge
|
||||
of Andreas Tobler's patch from 2006-04-22.
|
||||
|
||||
2009-06-04 Andrew Haley <aph@redhat.com>
|
||||
|
||||
* src/sh/ffi.c: Apply missing hunk from Alexandre Oliva's patch of
|
||||
2007-03-07.
|
||||
|
||||
2008-12-26 Timothy Wall <twall@users.sf.net>
|
||||
|
||||
* testsuite/libffi.call/cls_longdouble.c,
|
||||
testsuite/libffi.call/cls_longdouble_va.c,
|
||||
testsuite/libffi.call/cls_align_longdouble.c,
|
||||
testsuite/libffi.call/cls_align_longdouble_split.c,
|
||||
testsuite/libffi.call/cls_align_longdouble_split2.c: mark expected
|
||||
failures on x86_64 cygwin/mingw.
|
||||
|
||||
2008-12-22 Timothy Wall <twall@users.sf.net>
|
||||
|
||||
* testsuite/libffi.call/closure_fn0.c,
|
||||
testsuite/libffi.call/closure_fn1.c,
|
||||
testsuite/libffi.call/closure_fn2.c,
|
||||
testsuite/libffi.call/closure_fn3.c,
|
||||
testsuite/libffi.call/closure_fn4.c,
|
||||
testsuite/libffi.call/closure_fn5.c,
|
||||
testsuite/libffi.call/closure_fn6.c,
|
||||
testsuite/libffi.call/closure_loc_fn0.c,
|
||||
testsuite/libffi.call/closure_stdcall.c,
|
||||
testsuite/libffi.call/cls_align_pointer.c,
|
||||
testsuite/libffi.call/cls_pointer.c,
|
||||
testsuite/libffi.call/cls_pointer_stack.c: use portable cast from
|
||||
pointer to integer (intptr_t).
|
||||
* testsuite/libffi.call/cls_longdouble.c: disable for win64.
|
||||
|
||||
2008-12-19 Anthony Green <green@redhat.com>
|
||||
|
||||
* configure.ac: Bump version to 3.0.8.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
libffi - Copyright (c) 1996-2008 Red Hat, Inc and others.
|
||||
libffi - Copyright (c) 1996-2009 Anthony Green, Red Hat, Inc and others.
|
||||
See source files for details.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
|
|
|
@ -7,6 +7,7 @@ SUBDIRS = include testsuite man
|
|||
EXTRA_DIST = LICENSE ChangeLog.v1 ChangeLog.libgcj configure.host \
|
||||
src/alpha/ffi.c src/alpha/osf.S src/alpha/ffitarget.h \
|
||||
src/arm/ffi.c src/arm/sysv.S src/arm/ffitarget.h \
|
||||
src/avr32/ffi.c src/avr32/sysv.S src/avr32/ffitarget.h \
|
||||
src/cris/ffi.c src/cris/sysv.S src/cris/ffitarget.h \
|
||||
src/ia64/ffi.c src/ia64/ffitarget.h src/ia64/ia64_flags.h \
|
||||
src/ia64/unix.S \
|
||||
|
@ -25,12 +26,13 @@ EXTRA_DIST = LICENSE ChangeLog.v1 ChangeLog.libgcj configure.host \
|
|||
src/sh64/ffi.c src/sh64/sysv.S src/sh64/ffitarget.h \
|
||||
src/sparc/v8.S src/sparc/v9.S src/sparc/ffitarget.h \
|
||||
src/sparc/ffi.c src/x86/darwin64.S \
|
||||
src/x86/ffi.c src/x86/sysv.S src/x86/win32.S src/x86/darwin.S \
|
||||
src/x86/freebsd.S \
|
||||
src/x86/ffi.c src/x86/sysv.S src/x86/win32.S src/x86/win64.S \
|
||||
src/x86/darwin.S src/x86/freebsd.S \
|
||||
src/x86/ffi64.c src/x86/unix64.S src/x86/ffitarget.h \
|
||||
src/pa/ffitarget.h src/pa/ffi.c src/pa/linux.S src/pa/hpux32.S \
|
||||
src/frv/ffi.c src/frv/eabi.S src/frv/ffitarget.h src/dlmalloc.c \
|
||||
libtool-version ChangeLog.libffi
|
||||
libtool-version ChangeLog.libffi m4/libtool.m4 \
|
||||
m4/lt~obsolete.m4 m4/ltoptions.m4 m4/ltsugar.m4 m4/ltversion.m4
|
||||
|
||||
info_TEXINFOS = doc/libffi.texi
|
||||
|
||||
|
@ -79,6 +81,8 @@ AM_MAKEFLAGS = \
|
|||
|
||||
MAKEOVERRIDES=
|
||||
|
||||
ACLOCAL_AMFLAGS=$(ACLOCAL_AMFLAGS) -I m4
|
||||
|
||||
lib_LTLIBRARIES = libffi.la
|
||||
noinst_LTLIBRARIES = libffi_convenience.la
|
||||
|
||||
|
@ -102,6 +106,9 @@ endif
|
|||
if X86_WIN32
|
||||
nodist_libffi_la_SOURCES += src/x86/ffi.c src/x86/win32.S
|
||||
endif
|
||||
if X86_WIN64
|
||||
nodist_libffi_la_SOURCES += src/x86/ffi.c src/x86/win64.S
|
||||
endif
|
||||
if X86_DARWIN
|
||||
nodist_libffi_la_SOURCES += src/x86/ffi.c src/x86/darwin.S src/x86/ffi64.c src/x86/darwin64.S
|
||||
endif
|
||||
|
@ -135,6 +142,9 @@ endif
|
|||
if ARM
|
||||
nodist_libffi_la_SOURCES += src/arm/sysv.S src/arm/ffi.c
|
||||
endif
|
||||
if AVR32
|
||||
nodist_libffi_la_SOURCES += src/avr32/sysv.S src/avr32/ffi.c
|
||||
endif
|
||||
if LIBFFI_CRIS
|
||||
nodist_libffi_la_SOURCES += src/cris/sysv.S src/cris/ffi.c
|
||||
endif
|
||||
|
@ -165,7 +175,7 @@ nodist_libffi_convenience_la_SOURCES = $(nodist_libffi_la_SOURCES)
|
|||
|
||||
AM_CFLAGS = -Wall -g -fexceptions
|
||||
|
||||
libffi_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version`
|
||||
libffi_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(AM_LTLDFLAGS)
|
||||
|
||||
AM_CPPFLAGS = -I. -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src
|
||||
AM_CCASFLAGS = $(AM_CPPFLAGS)
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,7 +1,7 @@
|
|||
Status
|
||||
======
|
||||
|
||||
libffi-3.0.8 was released on December 19, 2008. Check the libffi web
|
||||
libffi-3.0.9 was released on December 31, 2009. Check the libffi web
|
||||
page for updates: <URL:http://sourceware.org/libffi/>.
|
||||
|
||||
|
||||
|
@ -9,27 +9,27 @@ What is libffi?
|
|||
===============
|
||||
|
||||
Compilers for high level languages generate code that follow certain
|
||||
conventions. These conventions are necessary, in part, for separate
|
||||
compilation to work. One such convention is the "calling convention".
|
||||
The "calling convention" is a set of assumptions made by the compiler
|
||||
about where function arguments will be found on entry to a function.
|
||||
A "calling convention" also specifies where the return value for a
|
||||
function is found.
|
||||
conventions. These conventions are necessary, in part, for separate
|
||||
compilation to work. One such convention is the "calling
|
||||
convention". The "calling convention" is essentially a set of
|
||||
assumptions made by the compiler about where function arguments will
|
||||
be found on entry to a function. A "calling convention" also specifies
|
||||
where the return value for a function is found.
|
||||
|
||||
Some programs may not know at the time of compilation what arguments
|
||||
are to be passed to a function. For instance, an interpreter may be
|
||||
are to be passed to a function. For instance, an interpreter may be
|
||||
told at run-time about the number and types of arguments used to call
|
||||
a given function. Libffi can be used in such programs to provide a
|
||||
a given function. Libffi can be used in such programs to provide a
|
||||
bridge from the interpreter program to compiled code.
|
||||
|
||||
The libffi library provides a portable, high level programming
|
||||
interface to various calling conventions. This allows a programmer to
|
||||
interface to various calling conventions. This allows a programmer to
|
||||
call any function specified by a call interface description at run
|
||||
time.
|
||||
time.
|
||||
|
||||
FFI stands for Foreign Function Interface. A foreign function
|
||||
interface is the popular name for the interface that allows code
|
||||
written in one language to call code written in another language. The
|
||||
written in one language to call code written in another language. The
|
||||
libffi library really only provides the lowest, machine dependent
|
||||
layer of a fully featured foreign function interface. A layer must
|
||||
exist above libffi that handles type conversions for values passed
|
||||
|
@ -39,40 +39,56 @@ between the two languages.
|
|||
Supported Platforms
|
||||
===================
|
||||
|
||||
Libffi has been ported to many different platforms, although this
|
||||
release was only tested on:
|
||||
Libffi has been ported to many different platforms.
|
||||
For specific configuration details and testing status, please
|
||||
refer to the wiki page here:
|
||||
|
||||
http://www.moxielogic.org/wiki/index.php?title=Libffi_3.0.9
|
||||
|
||||
At the time of release, the following basic configurations have been
|
||||
tested:
|
||||
|
||||
|--------------+------------------|
|
||||
| Architecture | Operating System |
|
||||
|--------------+------------------|
|
||||
| Alpha | Linux |
|
||||
| ARM | Linux |
|
||||
| AVR32 | Linux |
|
||||
| HPPA | HPUX |
|
||||
| IA-64 | Linux |
|
||||
| MIPS | IRIX |
|
||||
| MIPS | Linux |
|
||||
| MIPS64 | Linux |
|
||||
| PowerPC | Linux |
|
||||
| PowerPC | Mac OSX |
|
||||
| PowerPC | FreeBSD |
|
||||
| PowerPC64 | Linux |
|
||||
| S390 | Linux |
|
||||
| S390X | Linux |
|
||||
| SPARC | Linux |
|
||||
| SPARC | Solaris |
|
||||
| SPARC64 | Linux |
|
||||
| SPARC64 | FreeBSD |
|
||||
| X86 | FreeBSD |
|
||||
| X86 | kFreeBSD |
|
||||
| X86 | Linux |
|
||||
| X86 | Mac OSX |
|
||||
| X86 | OpenBSD |
|
||||
| X86 | Solaris |
|
||||
| X86 | Windows/Cygwin |
|
||||
| X86 | Windows/MingW |
|
||||
| X86-64 | FreeBSD |
|
||||
| X86-64 | Linux |
|
||||
| X86-64 | OpenBSD |
|
||||
|--------------+------------------|
|
||||
|
||||
arm oabi linux
|
||||
arm eabi linux
|
||||
hppa linux
|
||||
mips o32 linux (little endian)
|
||||
powerpc darwin
|
||||
powerpc freebsd
|
||||
powerpc64 linux
|
||||
sparc solaris
|
||||
sparc64 freebsd
|
||||
sparc64 solaris
|
||||
x86 cygwin
|
||||
x86 darwin
|
||||
x86 freebsd
|
||||
x86 linux
|
||||
x86 openbsd
|
||||
x86 solaris
|
||||
x86-64 darwin
|
||||
x86-64 linux
|
||||
x86-64 OS X
|
||||
x86-64 freebsd
|
||||
x86-64 solaris
|
||||
|
||||
Please send additional platform test results to
|
||||
libffi-discuss@sourceware.org.
|
||||
libffi-discuss@sourceware.org and feel free to update the wiki page
|
||||
above.
|
||||
|
||||
Installing libffi
|
||||
=================
|
||||
|
||||
[Note: before actually performing any of these installation steps,
|
||||
you may wish to read the "Platform Specific Notes" below.]
|
||||
|
||||
First you must configure the distribution for your particular
|
||||
system. Go to the directory you wish to build libffi in and run the
|
||||
"configure" program found in the root directory of the libffi source
|
||||
|
@ -102,66 +118,20 @@ This will require that you have DejaGNU installed.
|
|||
To install the library and header files, type "make install".
|
||||
|
||||
|
||||
Platform Specific Notes
|
||||
=======================
|
||||
|
||||
MIPS - Irix 5.3 & 6.x
|
||||
---------------------
|
||||
|
||||
Irix 6.2 and better supports three different calling conventions: o32,
|
||||
n32 and n64. Currently, libffi only supports both o32 and n32 under
|
||||
Irix 6.x, but only o32 under Irix 5.3. Libffi will automatically be
|
||||
configured for whichever calling convention it was built for.
|
||||
|
||||
By default, the configure script will try to build libffi with the GNU
|
||||
development tools. To build libffi with the SGI development tools, set
|
||||
the environment variable CC to either "cc -32" or "cc -n32" before
|
||||
running configure under Irix 6.x (depending on whether you want an o32
|
||||
or n32 library), or just "cc" for Irix 5.3.
|
||||
|
||||
With the n32 calling convention, when returning structures smaller
|
||||
than 16 bytes, be sure to provide an RVALUE that is 8 byte aligned.
|
||||
Here's one way of forcing this:
|
||||
|
||||
double struct_storage[2];
|
||||
my_small_struct *s = (my_small_struct *) struct_storage;
|
||||
/* Use s for RVALUE */
|
||||
|
||||
If you don't do this you are liable to get spurious bus errors.
|
||||
|
||||
"long long" values are not supported yet.
|
||||
|
||||
You must use GNU Make to build libffi on SGI platforms.
|
||||
|
||||
|
||||
PowerPC System V ABI
|
||||
--------------------
|
||||
|
||||
There are two `System V ABI's which libffi implements for PowerPC.
|
||||
They differ only in how small structures are returned from functions.
|
||||
|
||||
In the FFI_SYSV version, structures that are 8 bytes or smaller are
|
||||
returned in registers. This is what GCC does when it is configured
|
||||
for solaris, and is what the System V ABI I have (dated September
|
||||
1995) says.
|
||||
|
||||
In the FFI_GCC_SYSV version, all structures are returned the same way:
|
||||
by passing a pointer as the first argument to the function. This is
|
||||
what GCC does when it is configured for linux or a generic sysv
|
||||
target.
|
||||
|
||||
EGCS 1.0.1 (and probably other versions of EGCS/GCC) also has a
|
||||
inconsistency with the SysV ABI: When a procedure is called with many
|
||||
floating-point arguments, some of them get put on the stack. They are
|
||||
all supposed to be stored in double-precision format, even if they are
|
||||
only single-precision, but EGCS stores single-precision arguments as
|
||||
single-precision anyway. This causes one test to fail (the `many
|
||||
arguments' test).
|
||||
|
||||
|
||||
History
|
||||
=======
|
||||
|
||||
See the ChangeLog files for details.
|
||||
|
||||
3.0.9 Dec-31-09
|
||||
Add AVR32 and win64 ports. Add ARM softfp support.
|
||||
Many fixes for AIX, Solaris, HP-UX, *BSD.
|
||||
Several PowerPC and x86-64 bug fixes.
|
||||
Build DLL for windows.
|
||||
|
||||
3.0.8 Dec-19-08
|
||||
Add *BSD, BeOS, and PA-Linux support.
|
||||
|
||||
3.0.7 Nov-11-08
|
||||
Fix for ppc FreeBSD.
|
||||
(thanks to Andreas Tobler)
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
- Merge with GCC tree.
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,911 +0,0 @@
|
|||
# Configure fragment invoked in the post-target section for subdirs
|
||||
# wanting multilib support.
|
||||
#
|
||||
# Copyright (C) 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# 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
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# 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., 59 Temple Place - Suite 330,
|
||||
# Boston, MA 02111-1307, USA.
|
||||
#
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
#
|
||||
# Please report bugs to <gcc-bugs@gnu.org>
|
||||
# and send patches to <gcc-patches@gnu.org>.
|
||||
|
||||
# It is advisable to support a few --enable/--disable options to let the
|
||||
# user select which libraries s/he really wants.
|
||||
#
|
||||
# Subdirectories wishing to use multilib should put the following lines
|
||||
# in the "post-target" section of configure.in.
|
||||
#
|
||||
# if [ "${srcdir}" = "." ] ; then
|
||||
# if [ "${with_target_subdir}" != "." ] ; then
|
||||
# . ${with_multisrctop}../../config-ml.in
|
||||
# else
|
||||
# . ${with_multisrctop}../config-ml.in
|
||||
# fi
|
||||
# else
|
||||
# . ${srcdir}/../config-ml.in
|
||||
# fi
|
||||
#
|
||||
#
|
||||
# Things are complicated because 6 separate cases must be handled:
|
||||
# 2 (native, cross) x 3 (absolute-path, relative-not-dot, dot) = 6.
|
||||
#
|
||||
# srcdir=. is special. It must handle make programs that don't handle VPATH.
|
||||
# To implement this, a symlink tree is built for each library and for each
|
||||
# multilib subdir.
|
||||
#
|
||||
# The build tree is layed out as
|
||||
#
|
||||
# ./
|
||||
# newlib
|
||||
# m68020/
|
||||
# newlib
|
||||
# m68881/
|
||||
# newlib
|
||||
#
|
||||
# The nice feature about this arrangement is that inter-library references
|
||||
# in the build tree work without having to care where you are. Note that
|
||||
# inter-library references also work in the source tree because symlink trees
|
||||
# are built when srcdir=.
|
||||
#
|
||||
# Unfortunately, trying to access the libraries in the build tree requires
|
||||
# the user to manually choose which library to use as GCC won't be able to
|
||||
# find the right one. This is viewed as the lesser of two evils.
|
||||
#
|
||||
# Configure variables:
|
||||
# ${with_target_subdir} = "." for native, or ${target_alias} for cross.
|
||||
# Set by top level Makefile.
|
||||
# ${with_multisrctop} = how many levels of multilibs there are in the source
|
||||
# tree. It exists to handle the case of configuring in the source tree:
|
||||
# ${srcdir} is not constant.
|
||||
# ${with_multisubdir} = name of multilib subdirectory (eg: m68020/m68881).
|
||||
#
|
||||
# Makefile variables:
|
||||
# MULTISRCTOP = number of multilib levels in source tree (+1 if cross)
|
||||
# (FIXME: note that this is different than ${with_multisrctop}. Check out.).
|
||||
# MULTIBUILDTOP = number of multilib levels in build tree
|
||||
# MULTIDIRS = list of multilib subdirs (eg: m68000 m68020 ...)
|
||||
# (only defined in each library's main Makefile).
|
||||
# MULTISUBDIR = installed subdirectory name with leading '/' (eg: /m68000)
|
||||
# (only defined in each multilib subdir).
|
||||
|
||||
# FIXME: Multilib is currently disabled by default for everything other than
|
||||
# newlib. It is up to each target to turn on multilib support for the other
|
||||
# libraries as desired.
|
||||
|
||||
# Autoconf incoming variables:
|
||||
# srcdir, host, ac_configure_args
|
||||
#
|
||||
# We *could* figure srcdir and host out, but we'd have to do work that
|
||||
# our caller has already done to figure them out and requiring these two
|
||||
# seems reasonable.
|
||||
# Note that `host' in this case is GCC's `target'. Target libraries are
|
||||
# configured for a particular host.
|
||||
|
||||
Makefile=${ac_file-Makefile}
|
||||
ml_config_shell=${CONFIG_SHELL-/bin/sh}
|
||||
ml_realsrcdir=${srcdir}
|
||||
|
||||
# Scan all the arguments and set all the ones we need.
|
||||
|
||||
ml_verbose=--verbose
|
||||
for option in ${ac_configure_args}
|
||||
do
|
||||
# strip single quotes surrounding individual options
|
||||
case $option in
|
||||
\'*\') eval option=$option ;;
|
||||
esac
|
||||
|
||||
case $option in
|
||||
--*) ;;
|
||||
-*) option=-$option ;;
|
||||
esac
|
||||
|
||||
case $option in
|
||||
--*=*)
|
||||
optarg=`echo $option | sed -e 's/^[^=]*=//'`
|
||||
;;
|
||||
esac
|
||||
|
||||
case $option in
|
||||
--disable-*)
|
||||
enableopt=`echo ${option} | sed 's:^--disable-:enable_:;s:-:_:g'`
|
||||
eval $enableopt=no
|
||||
;;
|
||||
--enable-*)
|
||||
case "$option" in
|
||||
*=*) ;;
|
||||
*) optarg=yes ;;
|
||||
esac
|
||||
enableopt=`echo ${option} | sed 's:^--::;s:=.*$::;s:-:_:g'`
|
||||
eval $enableopt="$optarg"
|
||||
;;
|
||||
--norecursion | --no-recursion)
|
||||
ml_norecursion=yes
|
||||
;;
|
||||
--silent | --sil* | --quiet | --q*)
|
||||
ml_verbose=--silent
|
||||
;;
|
||||
--verbose | --v | --verb*)
|
||||
ml_verbose=--verbose
|
||||
;;
|
||||
--with-*)
|
||||
case "$option" in
|
||||
*=*) ;;
|
||||
*) optarg=yes ;;
|
||||
esac
|
||||
withopt=`echo ${option} | sed 's:^--::;s:=.*$::;s:-:_:g'`
|
||||
eval $withopt="$optarg"
|
||||
;;
|
||||
--without-*)
|
||||
withopt=`echo ${option} | sed 's:^--::;s:out::;s:-:_:g'`
|
||||
eval $withopt=no
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# Only do this if --enable-multilib.
|
||||
if [ "${enable_multilib}" = yes ]; then
|
||||
|
||||
# Compute whether this is the library's top level directory
|
||||
# (ie: not a multilib subdirectory, and not a subdirectory like newlib/src).
|
||||
# ${with_multisubdir} tells us we're in the right branch, but we could be
|
||||
# in a subdir of that.
|
||||
# ??? The previous version could void this test by separating the process into
|
||||
# two files: one that only the library's toplevel configure.in ran (to
|
||||
# configure the multilib subdirs), and another that all configure.in's ran to
|
||||
# update the Makefile. It seemed reasonable to collapse all multilib support
|
||||
# into one file, but it does leave us with having to perform this test.
|
||||
ml_toplevel_p=no
|
||||
if [ -z "${with_multisubdir}" ]; then
|
||||
if [ "${srcdir}" = "." ]; then
|
||||
# Use ${ml_realsrcdir} instead of ${srcdir} here to account for ${subdir}.
|
||||
# ${with_target_subdir} = "." for native, otherwise target alias.
|
||||
if [ "${with_target_subdir}" = "." ]; then
|
||||
if [ -f ${ml_realsrcdir}/../config-ml.in ]; then
|
||||
ml_toplevel_p=yes
|
||||
fi
|
||||
else
|
||||
if [ -f ${ml_realsrcdir}/../../config-ml.in ]; then
|
||||
ml_toplevel_p=yes
|
||||
fi
|
||||
fi
|
||||
else
|
||||
# Use ${ml_realsrcdir} instead of ${srcdir} here to account for ${subdir}.
|
||||
if [ -f ${ml_realsrcdir}/../config-ml.in ]; then
|
||||
ml_toplevel_p=yes
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# If this is the library's top level directory, set multidirs to the
|
||||
# multilib subdirs to support. This lives at the top because we need
|
||||
# `multidirs' set right away.
|
||||
|
||||
if [ "${ml_toplevel_p}" = yes ]; then
|
||||
|
||||
multidirs=
|
||||
for i in `${CC-gcc} --print-multi-lib 2>/dev/null`; do
|
||||
dir=`echo $i | sed -e 's/;.*$//'`
|
||||
if [ "${dir}" = "." ]; then
|
||||
true
|
||||
else
|
||||
if [ -z "${multidirs}" ]; then
|
||||
multidirs="${dir}"
|
||||
else
|
||||
multidirs="${multidirs} ${dir}"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
# Target libraries are configured for the host they run on, so we check
|
||||
# $host here, not $target.
|
||||
|
||||
case "${host}" in
|
||||
arc-*-elf*)
|
||||
if [ x$enable_biendian != xyes ]
|
||||
then
|
||||
old_multidirs=${multidirs}
|
||||
multidirs=""
|
||||
for x in ${old_multidirs}; do
|
||||
case "${x}" in
|
||||
*be*) : ;;
|
||||
*) multidirs="${multidirs} ${x}" ;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
;;
|
||||
arm-*-*)
|
||||
if [ x"$enable_fpu" = xno ]
|
||||
then
|
||||
old_multidirs=${multidirs}
|
||||
multidirs=""
|
||||
for x in ${old_multidirs}; do
|
||||
case "${x}" in
|
||||
*fpu*) : ;;
|
||||
*) multidirs="${multidirs} ${x}" ;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
if [ x"$enable_26bit" = xno ]
|
||||
then
|
||||
old_multidirs=${multidirs}
|
||||
multidirs=""
|
||||
for x in ${old_multidirs}; do
|
||||
case "${x}" in
|
||||
*26bit*) : ;;
|
||||
*) multidirs="${multidirs} ${x}" ;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
if [ x"$enable_underscore" = xno ]
|
||||
then
|
||||
old_multidirs=${multidirs}
|
||||
multidirs=""
|
||||
for x in ${old_multidirs}; do
|
||||
case "${x}" in
|
||||
*under*) : ;;
|
||||
*) multidirs="${multidirs} ${x}" ;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
if [ x"$enable_interwork" = xno ]
|
||||
then
|
||||
old_multidirs=${multidirs}
|
||||
multidirs=""
|
||||
for x in ${old_multidirs}; do
|
||||
case "${x}" in
|
||||
*interwork*) : ;;
|
||||
*) multidirs="${multidirs} ${x}" ;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
if [ x$enable_biendian = xno ]
|
||||
then
|
||||
old_multidirs="${multidirs}"
|
||||
multidirs=""
|
||||
for x in ${old_multidirs}; do
|
||||
case "$x" in
|
||||
*le* ) : ;;
|
||||
*be* ) : ;;
|
||||
*) multidirs="${multidirs} ${x}" ;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
if [ x"$enable_nofmult" = xno ]
|
||||
then
|
||||
old_multidirs="${multidirs}"
|
||||
multidirs=""
|
||||
for x in ${old_multidirs}; do
|
||||
case "$x" in
|
||||
*nofmult* ) : ;;
|
||||
*) multidirs="${multidirs} ${x}" ;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
;;
|
||||
m68*-*-*)
|
||||
if [ x$enable_softfloat = xno ]
|
||||
then
|
||||
old_multidirs="${multidirs}"
|
||||
multidirs=""
|
||||
for x in ${old_multidirs}; do
|
||||
case "$x" in
|
||||
*soft-float* ) : ;;
|
||||
*) multidirs="${multidirs} ${x}" ;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
if [ x$enable_m68881 = xno ]
|
||||
then
|
||||
old_multidirs="${multidirs}"
|
||||
multidirs=""
|
||||
for x in ${old_multidirs}; do
|
||||
case "$x" in
|
||||
*m68881* ) : ;;
|
||||
*) multidirs="${multidirs} ${x}" ;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
if [ x$enable_m68000 = xno ]
|
||||
then
|
||||
old_multidirs="${multidirs}"
|
||||
multidirs=""
|
||||
for x in ${old_multidirs}; do
|
||||
case "$x" in
|
||||
*m68000* ) : ;;
|
||||
*) multidirs="${multidirs} ${x}" ;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
if [ x$enable_m68020 = xno ]
|
||||
then
|
||||
old_multidirs="${multidirs}"
|
||||
multidirs=""
|
||||
for x in ${old_multidirs}; do
|
||||
case "$x" in
|
||||
*m68020* ) : ;;
|
||||
*) multidirs="${multidirs} ${x}" ;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
;;
|
||||
mips*-*-*)
|
||||
if [ x$enable_single_float = xno ]
|
||||
then
|
||||
old_multidirs="${multidirs}"
|
||||
multidirs=""
|
||||
for x in ${old_multidirs}; do
|
||||
case "$x" in
|
||||
*single* ) : ;;
|
||||
*) multidirs="${multidirs} ${x}" ;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
if [ x$enable_biendian = xno ]
|
||||
then
|
||||
old_multidirs="${multidirs}"
|
||||
multidirs=""
|
||||
for x in ${old_multidirs}; do
|
||||
case "$x" in
|
||||
*el* ) : ;;
|
||||
*eb* ) : ;;
|
||||
*) multidirs="${multidirs} ${x}" ;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
if [ x$enable_softfloat = xno ]
|
||||
then
|
||||
old_multidirs="${multidirs}"
|
||||
multidirs=""
|
||||
for x in ${old_multidirs}; do
|
||||
case "$x" in
|
||||
*soft-float* ) : ;;
|
||||
*) multidirs="${multidirs} ${x}" ;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
case " $multidirs " in
|
||||
*" mabi=64 "*)
|
||||
# We will not be able to create libraries with -mabi=64 if
|
||||
# we cannot even link a trivial program. It usually
|
||||
# indicates the 64bit libraries are missing.
|
||||
if echo 'main() {}' > conftest.c &&
|
||||
${CC-gcc} -mabi=64 conftest.c -o conftest; then
|
||||
:
|
||||
else
|
||||
echo Could not link program with -mabi=64, disabling it.
|
||||
old_multidirs="${multidirs}"
|
||||
multidirs=""
|
||||
for x in ${old_multidirs}; do
|
||||
case "$x" in
|
||||
*mabi=64* ) : ;;
|
||||
*) multidirs="${multidirs} ${x}" ;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
rm -f conftest.c conftest
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
powerpc*-*-* | rs6000*-*-*)
|
||||
if [ x$enable_aix64 = xno ]
|
||||
then
|
||||
old_multidirs="${multidirs}"
|
||||
multidirs=""
|
||||
for x in ${old_multidirs}; do
|
||||
case "$x" in
|
||||
*ppc64* ) : ;;
|
||||
*) multidirs="${multidirs} ${x}" ;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
if [ x$enable_pthread = xno ]
|
||||
then
|
||||
old_multidirs="${multidirs}"
|
||||
multidirs=""
|
||||
for x in ${old_multidirs}; do
|
||||
case "$x" in
|
||||
*pthread* ) : ;;
|
||||
*) multidirs="${multidirs} ${x}" ;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
if [ x$enable_softfloat = xno ]
|
||||
then
|
||||
old_multidirs="${multidirs}"
|
||||
multidirs=""
|
||||
for x in ${old_multidirs}; do
|
||||
case "$x" in
|
||||
*soft-float* ) : ;;
|
||||
*) multidirs="${multidirs} ${x}" ;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
if [ x$enable_powercpu = xno ]
|
||||
then
|
||||
old_multidirs="${multidirs}"
|
||||
multidirs=""
|
||||
for x in ${old_multidirs}; do
|
||||
case "$x" in
|
||||
power | */power | */power/* ) : ;;
|
||||
*) multidirs="${multidirs} ${x}" ;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
if [ x$enable_powerpccpu = xno ]
|
||||
then
|
||||
old_multidirs="${multidirs}"
|
||||
multidirs=""
|
||||
for x in ${old_multidirs}; do
|
||||
case "$x" in
|
||||
*powerpc* ) : ;;
|
||||
*) multidirs="${multidirs} ${x}" ;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
if [ x$enable_powerpcos = xno ]
|
||||
then
|
||||
old_multidirs="${multidirs}"
|
||||
multidirs=""
|
||||
for x in ${old_multidirs}; do
|
||||
case "$x" in
|
||||
*mcall-linux* | *mcall-solaris* ) : ;;
|
||||
*) multidirs="${multidirs} ${x}" ;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
if [ x$enable_biendian = xno ]
|
||||
then
|
||||
old_multidirs="${multidirs}"
|
||||
multidirs=""
|
||||
for x in ${old_multidirs}; do
|
||||
case "$x" in
|
||||
*mlittle* | *mbig* ) : ;;
|
||||
*) multidirs="${multidirs} ${x}" ;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
if [ x$enable_sysv = xno ]
|
||||
then
|
||||
old_multidirs="${multidirs}"
|
||||
multidirs=""
|
||||
for x in ${old_multidirs}; do
|
||||
case "$x" in
|
||||
*mcall-sysv* ) : ;;
|
||||
*) multidirs="${multidirs} ${x}" ;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
;;
|
||||
sparc*-*-*)
|
||||
case " $multidirs " in
|
||||
*" m64 "*)
|
||||
# We will not be able to create libraries with -m64 if
|
||||
# we cannot even link a trivial program. It usually
|
||||
# indicates the 64bit libraries are missing.
|
||||
if echo 'main() {}' > conftest.c &&
|
||||
${CC-gcc} -m64 conftest.c -o conftest; then
|
||||
:
|
||||
else
|
||||
echo Could not link program with -m64, disabling it.
|
||||
old_multidirs="${multidirs}"
|
||||
multidirs=""
|
||||
for x in ${old_multidirs}; do
|
||||
case "$x" in
|
||||
*m64* ) : ;;
|
||||
*) multidirs="${multidirs} ${x}" ;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
rm -f conftest.c conftest
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
||||
# Remove extraneous blanks from multidirs.
|
||||
# Tests like `if [ -n "$multidirs" ]' require it.
|
||||
multidirs=`echo "$multidirs" | sed -e 's/^[ ][ ]*//' -e 's/[ ][ ]*$//' -e 's/[ ][ ]*/ /g'`
|
||||
|
||||
# Add code to library's top level makefile to handle building the multilib
|
||||
# subdirs.
|
||||
|
||||
cat > Multi.tem <<\EOF
|
||||
|
||||
PWD_COMMAND=$${PWDCMD-pwd}
|
||||
|
||||
# FIXME: There should be an @-sign in front of the `if'.
|
||||
# Leave out until this is tested a bit more.
|
||||
multi-do:
|
||||
if [ -z "$(MULTIDIRS)" ]; then \
|
||||
true; \
|
||||
else \
|
||||
rootpre=`${PWD_COMMAND}`/; export rootpre; \
|
||||
srcrootpre=`cd $(srcdir); ${PWD_COMMAND}`/; export srcrootpre; \
|
||||
lib=`echo $${rootpre} | sed -e 's,^.*/\([^/][^/]*\)/$$,\1,'`; \
|
||||
compiler="$(CC)"; \
|
||||
for i in `$${compiler} --print-multi-lib 2>/dev/null`; do \
|
||||
dir=`echo $$i | sed -e 's/;.*$$//'`; \
|
||||
if [ "$${dir}" = "." ]; then \
|
||||
true; \
|
||||
else \
|
||||
if [ -d ../$${dir}/$${lib} ]; then \
|
||||
flags=`echo $$i | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`; \
|
||||
if (cd ../$${dir}/$${lib}; $(MAKE) $(FLAGS_TO_PASS) \
|
||||
CFLAGS="$(CFLAGS) $${flags}" \
|
||||
FCFLAGS="$(FCFLAGS) $${flags}" \
|
||||
FFLAGS="$(FFLAGS) $${flags}" \
|
||||
ADAFLAGS="$(ADAFLAGS) $${flags}" \
|
||||
prefix="$(prefix)" \
|
||||
exec_prefix="$(exec_prefix)" \
|
||||
GCJFLAGS="$(GCJFLAGS) $${flags}" \
|
||||
CXXFLAGS="$(CXXFLAGS) $${flags}" \
|
||||
LIBCFLAGS="$(LIBCFLAGS) $${flags}" \
|
||||
LIBCXXFLAGS="$(LIBCXXFLAGS) $${flags}" \
|
||||
LDFLAGS="$(LDFLAGS) $${flags}" \
|
||||
MULTIFLAGS="$${flags}" \
|
||||
DESTDIR="$(DESTDIR)" \
|
||||
INSTALL="$(INSTALL)" \
|
||||
INSTALL_DATA="$(INSTALL_DATA)" \
|
||||
INSTALL_PROGRAM="$(INSTALL_PROGRAM)" \
|
||||
INSTALL_SCRIPT="$(INSTALL_SCRIPT)" \
|
||||
$(DO)); then \
|
||||
true; \
|
||||
else \
|
||||
exit 1; \
|
||||
fi; \
|
||||
else true; \
|
||||
fi; \
|
||||
fi; \
|
||||
done; \
|
||||
fi
|
||||
|
||||
# FIXME: There should be an @-sign in front of the `if'.
|
||||
# Leave out until this is tested a bit more.
|
||||
multi-clean:
|
||||
if [ -z "$(MULTIDIRS)" ]; then \
|
||||
true; \
|
||||
else \
|
||||
lib=`${PWD_COMMAND} | sed -e 's,^.*/\([^/][^/]*\)$$,\1,'`; \
|
||||
for dir in Makefile $(MULTIDIRS); do \
|
||||
if [ -f ../$${dir}/$${lib}/Makefile ]; then \
|
||||
if (cd ../$${dir}/$${lib}; $(MAKE) $(FLAGS_TO_PASS) $(DO)); \
|
||||
then true; \
|
||||
else exit 1; \
|
||||
fi; \
|
||||
else true; \
|
||||
fi; \
|
||||
done; \
|
||||
fi
|
||||
EOF
|
||||
|
||||
cat ${Makefile} Multi.tem > Makefile.tem
|
||||
rm -f ${Makefile} Multi.tem
|
||||
mv Makefile.tem ${Makefile}
|
||||
|
||||
fi # ${ml_toplevel_p} = yes
|
||||
|
||||
if [ "${ml_verbose}" = --verbose ]; then
|
||||
echo "Adding multilib support to Makefile in ${ml_realsrcdir}"
|
||||
if [ "${ml_toplevel_p}" = yes ]; then
|
||||
echo "multidirs=${multidirs}"
|
||||
fi
|
||||
echo "with_multisubdir=${with_multisubdir}"
|
||||
fi
|
||||
|
||||
if [ "${srcdir}" = "." ]; then
|
||||
if [ "${with_target_subdir}" != "." ]; then
|
||||
ml_srcdotdot="../"
|
||||
else
|
||||
ml_srcdotdot=""
|
||||
fi
|
||||
else
|
||||
ml_srcdotdot=""
|
||||
fi
|
||||
|
||||
if [ -z "${with_multisubdir}" ]; then
|
||||
ml_subdir=
|
||||
ml_builddotdot=
|
||||
: # ml_srcdotdot= # already set
|
||||
else
|
||||
ml_subdir="/${with_multisubdir}"
|
||||
# The '[^/][^/]*' appears that way to work around a SunOS sed bug.
|
||||
ml_builddotdot=`echo ${with_multisubdir} | sed -e 's:[^/][^/]*:..:g'`/
|
||||
if [ "$srcdir" = "." ]; then
|
||||
ml_srcdotdot=${ml_srcdotdot}${ml_builddotdot}
|
||||
else
|
||||
: # ml_srcdotdot= # already set
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "${ml_toplevel_p}" = yes ]; then
|
||||
ml_do='$(MAKE)'
|
||||
ml_clean='$(MAKE)'
|
||||
else
|
||||
ml_do=true
|
||||
ml_clean=true
|
||||
fi
|
||||
|
||||
# TOP is used by newlib and should not be used elsewhere for this purpose.
|
||||
# MULTI{SRC,BUILD}TOP are the proper ones to use. MULTISRCTOP is empty
|
||||
# when srcdir != builddir. MULTIBUILDTOP is always some number of ../'s.
|
||||
# FIXME: newlib needs to be updated to use MULTI{SRC,BUILD}TOP so we can
|
||||
# delete TOP. Newlib may wish to continue to use TOP for its own purposes
|
||||
# of course.
|
||||
# MULTIDIRS is non-empty for the cpu top level Makefile (eg: newlib/Makefile)
|
||||
# and lists the subdirectories to recurse into.
|
||||
# MULTISUBDIR is non-empty in each cpu subdirectory's Makefile
|
||||
# (eg: newlib/h8300h/Makefile) and is the installed subdirectory name with
|
||||
# a leading '/'.
|
||||
# MULTIDO is used for targets like all, install, and check where
|
||||
# $(FLAGS_TO_PASS) augmented with the subdir's compiler option is needed.
|
||||
# MULTICLEAN is used for the *clean targets.
|
||||
#
|
||||
# ??? It is possible to merge MULTIDO and MULTICLEAN into one. They are
|
||||
# currently kept separate because we don't want the *clean targets to require
|
||||
# the existence of the compiler (which MULTIDO currently requires) and
|
||||
# therefore we'd have to record the directory options as well as names
|
||||
# (currently we just record the names and use --print-multi-lib to get the
|
||||
# options).
|
||||
|
||||
sed -e "s:^TOP[ ]*=[ ]*\([./]*\)[ ]*$:TOP = ${ml_builddotdot}\1:" \
|
||||
-e "s:^MULTISRCTOP[ ]*=.*$:MULTISRCTOP = ${ml_srcdotdot}:" \
|
||||
-e "s:^MULTIBUILDTOP[ ]*=.*$:MULTIBUILDTOP = ${ml_builddotdot}:" \
|
||||
-e "s:^MULTIDIRS[ ]*=.*$:MULTIDIRS = ${multidirs}:" \
|
||||
-e "s:^MULTISUBDIR[ ]*=.*$:MULTISUBDIR = ${ml_subdir}:" \
|
||||
-e "s:^MULTIDO[ ]*=.*$:MULTIDO = $ml_do:" \
|
||||
-e "s:^MULTICLEAN[ ]*=.*$:MULTICLEAN = $ml_clean:" \
|
||||
${Makefile} > Makefile.tem
|
||||
rm -f ${Makefile}
|
||||
mv Makefile.tem ${Makefile}
|
||||
|
||||
# If this is the library's top level, configure each multilib subdir.
|
||||
# This is done at the end because this is the loop that runs configure
|
||||
# in each multilib subdir and it seemed reasonable to finish updating the
|
||||
# Makefile before going on to configure the subdirs.
|
||||
|
||||
if [ "${ml_toplevel_p}" = yes ]; then
|
||||
|
||||
# We must freshly configure each subdirectory. This bit of code is
|
||||
# actually partially stolen from the main configure script. FIXME.
|
||||
|
||||
if [ -n "${multidirs}" ] && [ -z "${ml_norecursion}" ]; then
|
||||
|
||||
if [ "${ml_verbose}" = --verbose ]; then
|
||||
echo "Running configure in multilib subdirs ${multidirs}"
|
||||
echo "pwd: `${PWDCMD-pwd}`"
|
||||
fi
|
||||
|
||||
ml_origdir=`${PWDCMD-pwd}`
|
||||
ml_libdir=`echo $ml_origdir | sed -e 's,^.*/,,'`
|
||||
# cd to top-level-build-dir/${with_target_subdir}
|
||||
cd ..
|
||||
|
||||
for ml_dir in ${multidirs}; do
|
||||
|
||||
if [ "${ml_verbose}" = --verbose ]; then
|
||||
echo "Running configure in multilib subdir ${ml_dir}"
|
||||
echo "pwd: `${PWDCMD-pwd}`"
|
||||
fi
|
||||
|
||||
if [ -d ${ml_dir} ]; then true; else
|
||||
# ``mkdir -p ${ml_dir}'' See also mkinstalldirs.
|
||||
pathcomp=""
|
||||
for d in `echo ":${ml_dir}" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`; do
|
||||
pathcomp="$pathcomp$d"
|
||||
case "$pathcomp" in
|
||||
-* ) pathcomp=./$pathcomp ;;
|
||||
esac
|
||||
if test ! -d "$pathcomp"; then
|
||||
echo "mkdir $pathcomp" 1>&2
|
||||
mkdir "$pathcomp" > /dev/null 2>&1 || lasterr=$?
|
||||
fi
|
||||
if test ! -d "$pathcomp"; then
|
||||
exit $lasterr
|
||||
fi
|
||||
pathcomp="$pathcomp/"
|
||||
done
|
||||
fi
|
||||
if [ -d ${ml_dir}/${ml_libdir} ]; then true; else mkdir ${ml_dir}/${ml_libdir}; fi
|
||||
|
||||
# Eg: if ${ml_dir} = m68000/m68881, dotdot = ../../
|
||||
dotdot=../`echo ${ml_dir} | sed -e 's|[^/]||g' -e 's|/|../|g'`
|
||||
|
||||
case ${srcdir} in
|
||||
".")
|
||||
echo Building symlink tree in `${PWDCMD-pwd}`/${ml_dir}/${ml_libdir}
|
||||
if [ "${with_target_subdir}" != "." ]; then
|
||||
ml_unsubdir="../"
|
||||
else
|
||||
ml_unsubdir=""
|
||||
fi
|
||||
(cd ${ml_dir}/${ml_libdir};
|
||||
../${dotdot}${ml_unsubdir}symlink-tree ../${dotdot}${ml_unsubdir}${ml_libdir} "")
|
||||
if [ -f ${ml_dir}/${ml_libdir}/Makefile ]; then
|
||||
if [ x"${MAKE}" = x ]; then
|
||||
(cd ${ml_dir}/${ml_libdir}; make distclean)
|
||||
else
|
||||
(cd ${ml_dir}/${ml_libdir}; ${MAKE} distclean)
|
||||
fi
|
||||
fi
|
||||
ml_newsrcdir="."
|
||||
ml_srcdiroption=
|
||||
multisrctop=${dotdot}
|
||||
;;
|
||||
*)
|
||||
case "${srcdir}" in
|
||||
/* | [A-Za-z]:[\\/]* ) # absolute path
|
||||
ml_newsrcdir=${srcdir}
|
||||
;;
|
||||
*) # otherwise relative
|
||||
ml_newsrcdir=${dotdot}${srcdir}
|
||||
;;
|
||||
esac
|
||||
ml_srcdiroption="-srcdir=${ml_newsrcdir}"
|
||||
multisrctop=
|
||||
;;
|
||||
esac
|
||||
|
||||
case "${progname}" in
|
||||
/* | [A-Za-z]:[\\/]* ) ml_recprog=${progname} ;;
|
||||
*) ml_recprog=${dotdot}${progname} ;;
|
||||
esac
|
||||
|
||||
# FIXME: POPDIR=${PWD=`pwd`} doesn't work here.
|
||||
ML_POPDIR=`${PWDCMD-pwd}`
|
||||
cd ${ml_dir}/${ml_libdir}
|
||||
|
||||
if [ -f ${ml_newsrcdir}/configure ]; then
|
||||
ml_recprog="${ml_newsrcdir}/configure"
|
||||
fi
|
||||
|
||||
# find compiler flag corresponding to ${ml_dir}
|
||||
for i in `${CC-gcc} --print-multi-lib 2>/dev/null`; do
|
||||
dir=`echo $i | sed -e 's/;.*$//'`
|
||||
if [ "${dir}" = "${ml_dir}" ]; then
|
||||
flags=`echo $i | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`
|
||||
break
|
||||
fi
|
||||
done
|
||||
ml_config_env='CC="${CC_}$flags" CXX="${CXX_}$flags" F77="${F77_}$flags" GCJ="${GCJ_}$flags" GFORTRAN="${GFORTRAN_}$flags"'
|
||||
|
||||
if [ "${with_target_subdir}" = "." ]; then
|
||||
CC_=$CC' '
|
||||
CXX_=$CXX' '
|
||||
F77_=$F77' '
|
||||
GCJ_=$GCJ' '
|
||||
GFORTRAN_=$GFORTRAN' '
|
||||
else
|
||||
# Create a regular expression that matches any string as long
|
||||
# as ML_POPDIR.
|
||||
popdir_rx=`echo ${ML_POPDIR} | sed 's,.,.,g'`
|
||||
CC_=
|
||||
for arg in ${CC}; do
|
||||
case $arg in
|
||||
-[BIL]"${ML_POPDIR}"/*)
|
||||
CC_="${CC_}"`echo "X${arg}" | sed -n "s/X\\(-[BIL]${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X-[BIL]${popdir_rx}\\(.*\\)/\1/p"`' ' ;;
|
||||
"${ML_POPDIR}"/*)
|
||||
CC_="${CC_}"`echo "X${arg}" | sed -n "s/X\\(${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X${popdir_rx}\\(.*\\)/\\1/p"`' ' ;;
|
||||
*)
|
||||
CC_="${CC_}${arg} " ;;
|
||||
esac
|
||||
done
|
||||
|
||||
CXX_=
|
||||
for arg in ${CXX}; do
|
||||
case $arg in
|
||||
-[BIL]"${ML_POPDIR}"/*)
|
||||
CXX_="${CXX_}"`echo "X${arg}" | sed -n "s/X\\(-[BIL]${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X-[BIL]${popdir_rx}\\(.*\\)/\\1/p"`' ' ;;
|
||||
"${ML_POPDIR}"/*)
|
||||
CXX_="${CXX_}"`echo "X${arg}" | sed -n "s/X\\(${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X${popdir_rx}\\(.*\\)/\\1/p"`' ' ;;
|
||||
*)
|
||||
CXX_="${CXX_}${arg} " ;;
|
||||
esac
|
||||
done
|
||||
|
||||
F77_=
|
||||
for arg in ${F77}; do
|
||||
case $arg in
|
||||
-[BIL]"${ML_POPDIR}"/*)
|
||||
F77_="${F77_}"`echo "X${arg}" | sed -n "s/X\\(-[BIL]${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X-[BIL]${popdir_rx}\\(.*\\)/\\1/p"`' ' ;;
|
||||
"${ML_POPDIR}"/*)
|
||||
F77_="${F77_}"`echo "X${arg}" | sed -n "s/X\\(${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X${popdir_rx}\\(.*\\)/\\1/p"`' ' ;;
|
||||
*)
|
||||
F77_="${F77_}${arg} " ;;
|
||||
esac
|
||||
done
|
||||
|
||||
GCJ_=
|
||||
for arg in ${GCJ}; do
|
||||
case $arg in
|
||||
-[BIL]"${ML_POPDIR}"/*)
|
||||
GCJ_="${GCJ_}"`echo "X${arg}" | sed -n "s/X\\(-[BIL]${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X-[BIL]${popdir_rx}\\(.*\\)/\\1/p"`' ' ;;
|
||||
"${ML_POPDIR}"/*)
|
||||
GCJ_="${GCJ_}"`echo "X${arg}" | sed -n "s/X\\(${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X${popdir_rx}\\(.*\\)/\\1/p"`' ' ;;
|
||||
*)
|
||||
GCJ_="${GCJ_}${arg} " ;;
|
||||
esac
|
||||
done
|
||||
|
||||
GFORTRAN_=
|
||||
for arg in ${GFORTRAN}; do
|
||||
case $arg in
|
||||
-[BIL]"${ML_POPDIR}"/*)
|
||||
GFORTRAN_="${GFORTRAN_}"`echo "X${arg}" | sed -n "s/X\\(-[BIL]${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X-[BIL]${popdir_rx}\\(.*\\)/\\1/p"`' ' ;;
|
||||
"${ML_POPDIR}"/*)
|
||||
GFORTRAN_="${GFORTRAN_}"`echo "X${arg}" | sed -n "s/X\\(${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X${popdir_rx}\\(.*\\)/\\1/p"`' ' ;;
|
||||
*)
|
||||
GFORTRAN_="${GFORTRAN_}${arg} " ;;
|
||||
esac
|
||||
done
|
||||
|
||||
if test "x${LD_LIBRARY_PATH+set}" = xset; then
|
||||
LD_LIBRARY_PATH_=
|
||||
for arg in `echo "$LD_LIBRARY_PATH" | tr ':' ' '`; do
|
||||
case "$arg" in
|
||||
"${ML_POPDIR}"/*)
|
||||
arg=`echo "X${arg}" | sed -n "s/X\\(${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X${popdir_rx}\\(.*\\)/\\1/p"`
|
||||
;;
|
||||
esac
|
||||
if test "x$LD_LIBRARY_PATH_" != x; then
|
||||
LD_LIBRARY_PATH_=$LD_LIBRARY_PATH_:$arg
|
||||
else
|
||||
LD_LIBRARY_PATH_=$arg
|
||||
fi
|
||||
done
|
||||
ml_config_env="$ml_config_env LD_LIBRARY_PATH=$LD_LIBRARY_PATH_"
|
||||
fi
|
||||
|
||||
if test "x${SHLIB_PATH+set}" = xset; then
|
||||
SHLIB_PATH_=
|
||||
for arg in `echo "$SHLIB_PATH" | tr ':' ' '`; do
|
||||
case "$arg" in
|
||||
"${ML_POPDIR}"/*)
|
||||
arg=`echo "X${arg}" | sed -n "s/X\\(${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X${popdir_rx}\\(.*\\)/\\1/p"`
|
||||
;;
|
||||
esac
|
||||
if test "x$SHLIB_PATH_" != x; then
|
||||
SHLIB_PATH_=$SHLIB_PATH_:$arg
|
||||
else
|
||||
SHLIB_PATH_=$arg
|
||||
fi
|
||||
done
|
||||
ml_config_env="$ml_config_env SHLIB_PATH=$SHLIB_PATH_"
|
||||
fi
|
||||
fi
|
||||
|
||||
if eval ${ml_config_env} ${ml_config_shell} ${ml_recprog} \
|
||||
--with-multisubdir=${ml_dir} --with-multisrctop=${multisrctop} \
|
||||
${ac_configure_args} ${ml_srcdiroption} ; then
|
||||
true
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd ${ML_POPDIR}
|
||||
|
||||
done
|
||||
|
||||
cd ${ml_origdir}
|
||||
fi
|
||||
|
||||
fi # ${ml_toplevel_p} = yes
|
||||
fi # ${enable_multilib} = yes
|
|
@ -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 Free Software Foundation,
|
||||
# Inc.
|
||||
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
|
||||
# Free Software Foundation, Inc.
|
||||
|
||||
timestamp='2007-05-17'
|
||||
timestamp='2009-11-19'
|
||||
|
||||
# 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
|
||||
|
@ -27,16 +27,16 @@ timestamp='2007-05-17'
|
|||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
|
||||
# Originally written by Per Bothner <per@bothner.com>.
|
||||
# Please send patches to <config-patches@gnu.org>. Submit a context
|
||||
# diff and a properly formatted ChangeLog entry.
|
||||
# Originally written by Per Bothner. Please send patches (context
|
||||
# diff format) to <config-patches@gnu.org> and include a ChangeLog
|
||||
# entry.
|
||||
#
|
||||
# This script attempts to guess a canonical system name similar to
|
||||
# config.sub. If it succeeds, it prints the system name on stdout, and
|
||||
# exits with 0. Otherwise, it exits with 1.
|
||||
#
|
||||
# The plan is that this can be called by configure scripts if you
|
||||
# don't specify an explicit build system type.
|
||||
# You can get the latest version of this script from:
|
||||
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
|
||||
|
||||
me=`echo "$0" | sed -e 's,.*/,,'`
|
||||
|
||||
|
@ -56,8 +56,8 @@ version="\
|
|||
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
|
||||
Free Software Foundation, Inc.
|
||||
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
|
||||
2002, 2003, 2004, 2005, 2006, 2007, 2008 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."
|
||||
|
@ -170,7 +170,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
|||
arm*|i386|m68k|ns32k|sh3*|sparc|vax)
|
||||
eval $set_cc_for_build
|
||||
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
|
||||
| grep __ELF__ >/dev/null
|
||||
| grep -q __ELF__
|
||||
then
|
||||
# Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
|
||||
# Return netbsd for either. FIX?
|
||||
|
@ -324,14 +324,30 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
|||
case `/usr/bin/uname -p` in
|
||||
sparc) echo sparc-icl-nx7; exit ;;
|
||||
esac ;;
|
||||
s390x:SunOS:*:*)
|
||||
echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
||||
exit ;;
|
||||
sun4H:SunOS:5.*:*)
|
||||
echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
||||
exit ;;
|
||||
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
|
||||
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
||||
exit ;;
|
||||
i86pc:SunOS:5.*:* | ix86xen:SunOS:5.*:*)
|
||||
echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
||||
i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
|
||||
eval $set_cc_for_build
|
||||
SUN_ARCH="i386"
|
||||
# If there is a compiler, see if it is configured for 64-bit objects.
|
||||
# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
|
||||
# This test works for both compilers.
|
||||
if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
|
||||
if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
|
||||
(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
|
||||
grep IS_64BIT_ARCH >/dev/null
|
||||
then
|
||||
SUN_ARCH="x86_64"
|
||||
fi
|
||||
fi
|
||||
echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
||||
exit ;;
|
||||
sun4*:SunOS:6*:*)
|
||||
# According to config.sub, this is the proper way to canonicalize
|
||||
|
@ -532,7 +548,7 @@ EOF
|
|||
echo rs6000-ibm-aix3.2
|
||||
fi
|
||||
exit ;;
|
||||
*:AIX:*:[45])
|
||||
*:AIX:*:[456])
|
||||
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
|
||||
if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
|
||||
IBM_ARCH=rs6000
|
||||
|
@ -640,7 +656,7 @@ EOF
|
|||
# => hppa64-hp-hpux11.23
|
||||
|
||||
if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
|
||||
grep __LP64__ >/dev/null
|
||||
grep -q __LP64__
|
||||
then
|
||||
HP_ARCH="hppa2.0w"
|
||||
else
|
||||
|
@ -791,18 +807,24 @@ EOF
|
|||
i*:PW*:*)
|
||||
echo ${UNAME_MACHINE}-pc-pw32
|
||||
exit ;;
|
||||
*:Interix*:[3456]*)
|
||||
*:Interix*:*)
|
||||
case ${UNAME_MACHINE} in
|
||||
x86)
|
||||
x86)
|
||||
echo i586-pc-interix${UNAME_RELEASE}
|
||||
exit ;;
|
||||
EM64T | authenticamd)
|
||||
authenticamd | genuineintel | EM64T)
|
||||
echo x86_64-unknown-interix${UNAME_RELEASE}
|
||||
exit ;;
|
||||
IA64)
|
||||
echo ia64-unknown-interix${UNAME_RELEASE}
|
||||
exit ;;
|
||||
esac ;;
|
||||
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
|
||||
echo i${UNAME_MACHINE}-pc-mks
|
||||
exit ;;
|
||||
8664:Windows_NT:*)
|
||||
echo x86_64-pc-mks
|
||||
exit ;;
|
||||
i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
|
||||
# How do we know it's Interix rather than the generic POSIX subsystem?
|
||||
# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
|
||||
|
@ -832,8 +854,29 @@ EOF
|
|||
i*86:Minix:*:*)
|
||||
echo ${UNAME_MACHINE}-pc-minix
|
||||
exit ;;
|
||||
alpha:Linux:*:*)
|
||||
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
|
||||
EV5) UNAME_MACHINE=alphaev5 ;;
|
||||
EV56) UNAME_MACHINE=alphaev56 ;;
|
||||
PCA56) UNAME_MACHINE=alphapca56 ;;
|
||||
PCA57) UNAME_MACHINE=alphapca56 ;;
|
||||
EV6) UNAME_MACHINE=alphaev6 ;;
|
||||
EV67) UNAME_MACHINE=alphaev67 ;;
|
||||
EV68*) UNAME_MACHINE=alphaev68 ;;
|
||||
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}
|
||||
exit ;;
|
||||
arm*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
eval $set_cc_for_build
|
||||
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
|
||||
| grep -q __ARM_EABI__
|
||||
then
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
else
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnueabi
|
||||
fi
|
||||
exit ;;
|
||||
avr32*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
|
@ -847,6 +890,17 @@ EOF
|
|||
frv:Linux:*:*)
|
||||
echo frv-unknown-linux-gnu
|
||||
exit ;;
|
||||
i*86:Linux:*:*)
|
||||
LIBC=gnu
|
||||
eval $set_cc_for_build
|
||||
sed 's/^ //' << EOF >$dummy.c
|
||||
#ifdef __dietlibc__
|
||||
LIBC=dietlibc
|
||||
#endif
|
||||
EOF
|
||||
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
|
||||
echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
|
||||
exit ;;
|
||||
ia64:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
exit ;;
|
||||
|
@ -856,74 +910,33 @@ EOF
|
|||
m68*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
exit ;;
|
||||
mips:Linux:*:*)
|
||||
mips:Linux:*:* | mips64:Linux:*:*)
|
||||
eval $set_cc_for_build
|
||||
sed 's/^ //' << EOF >$dummy.c
|
||||
#undef CPU
|
||||
#undef mips
|
||||
#undef mipsel
|
||||
#undef ${UNAME_MACHINE}
|
||||
#undef ${UNAME_MACHINE}el
|
||||
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
|
||||
CPU=mipsel
|
||||
CPU=${UNAME_MACHINE}el
|
||||
#else
|
||||
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
|
||||
CPU=mips
|
||||
CPU=${UNAME_MACHINE}
|
||||
#else
|
||||
CPU=
|
||||
#endif
|
||||
#endif
|
||||
EOF
|
||||
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
|
||||
/^CPU/{
|
||||
s: ::g
|
||||
p
|
||||
}'`"
|
||||
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
|
||||
;;
|
||||
mips64:Linux:*:*)
|
||||
eval $set_cc_for_build
|
||||
sed 's/^ //' << EOF >$dummy.c
|
||||
#undef CPU
|
||||
#undef mips64
|
||||
#undef mips64el
|
||||
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
|
||||
CPU=mips64el
|
||||
#else
|
||||
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
|
||||
CPU=mips64
|
||||
#else
|
||||
CPU=
|
||||
#endif
|
||||
#endif
|
||||
EOF
|
||||
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
|
||||
/^CPU/{
|
||||
s: ::g
|
||||
p
|
||||
}'`"
|
||||
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
|
||||
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
|
||||
;;
|
||||
or32:Linux:*:*)
|
||||
echo or32-unknown-linux-gnu
|
||||
exit ;;
|
||||
ppc:Linux:*:*)
|
||||
echo powerpc-unknown-linux-gnu
|
||||
padre:Linux:*:*)
|
||||
echo sparc-unknown-linux-gnu
|
||||
exit ;;
|
||||
ppc64:Linux:*:*)
|
||||
echo powerpc64-unknown-linux-gnu
|
||||
exit ;;
|
||||
alpha:Linux:*:*)
|
||||
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
|
||||
EV5) UNAME_MACHINE=alphaev5 ;;
|
||||
EV56) UNAME_MACHINE=alphaev56 ;;
|
||||
PCA56) UNAME_MACHINE=alphapca56 ;;
|
||||
PCA57) UNAME_MACHINE=alphapca56 ;;
|
||||
EV6) UNAME_MACHINE=alphaev6 ;;
|
||||
EV67) UNAME_MACHINE=alphaev67 ;;
|
||||
EV68*) UNAME_MACHINE=alphaev68 ;;
|
||||
esac
|
||||
objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
|
||||
if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
|
||||
parisc64:Linux:*:* | hppa64:Linux:*:*)
|
||||
echo hppa64-unknown-linux-gnu
|
||||
exit ;;
|
||||
parisc:Linux:*:* | hppa:Linux:*:*)
|
||||
# Look for CPU level
|
||||
|
@ -933,8 +946,11 @@ EOF
|
|||
*) echo hppa-unknown-linux-gnu ;;
|
||||
esac
|
||||
exit ;;
|
||||
parisc64:Linux:*:* | hppa64:Linux:*:*)
|
||||
echo hppa64-unknown-linux-gnu
|
||||
ppc64:Linux:*:*)
|
||||
echo powerpc64-unknown-linux-gnu
|
||||
exit ;;
|
||||
ppc:Linux:*:*)
|
||||
echo powerpc-unknown-linux-gnu
|
||||
exit ;;
|
||||
s390:Linux:*:* | s390x:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-ibm-linux
|
||||
|
@ -954,72 +970,9 @@ EOF
|
|||
x86_64:Linux:*:*)
|
||||
echo x86_64-unknown-linux-gnu
|
||||
exit ;;
|
||||
xtensa:Linux:*:*)
|
||||
echo xtensa-unknown-linux-gnu
|
||||
xtensa*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
exit ;;
|
||||
i*86:Linux:*:*)
|
||||
# The BFD linker knows what the default object file format is, so
|
||||
# first see if it will tell us. cd to the root directory to prevent
|
||||
# problems with other programs or directories called `ld' in the path.
|
||||
# Set LC_ALL=C to ensure ld outputs messages in English.
|
||||
ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
|
||||
| sed -ne '/supported targets:/!d
|
||||
s/[ ][ ]*/ /g
|
||||
s/.*supported targets: *//
|
||||
s/ .*//
|
||||
p'`
|
||||
case "$ld_supported_targets" in
|
||||
elf32-i386)
|
||||
TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
|
||||
;;
|
||||
a.out-i386-linux)
|
||||
echo "${UNAME_MACHINE}-pc-linux-gnuaout"
|
||||
exit ;;
|
||||
coff-i386)
|
||||
echo "${UNAME_MACHINE}-pc-linux-gnucoff"
|
||||
exit ;;
|
||||
"")
|
||||
# Either a pre-BFD a.out linker (linux-gnuoldld) or
|
||||
# one that does not give us useful --help.
|
||||
echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
|
||||
exit ;;
|
||||
esac
|
||||
# Determine whether the default compiler is a.out or elf
|
||||
eval $set_cc_for_build
|
||||
sed 's/^ //' << EOF >$dummy.c
|
||||
#include <features.h>
|
||||
#ifdef __ELF__
|
||||
# ifdef __GLIBC__
|
||||
# if __GLIBC__ >= 2
|
||||
LIBC=gnu
|
||||
# else
|
||||
LIBC=gnulibc1
|
||||
# endif
|
||||
# else
|
||||
LIBC=gnulibc1
|
||||
# endif
|
||||
#else
|
||||
#if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
|
||||
LIBC=gnu
|
||||
#else
|
||||
LIBC=gnuaout
|
||||
#endif
|
||||
#endif
|
||||
#ifdef __dietlibc__
|
||||
LIBC=dietlibc
|
||||
#endif
|
||||
EOF
|
||||
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
|
||||
/^LIBC/{
|
||||
s: ::g
|
||||
p
|
||||
}'`"
|
||||
test x"${LIBC}" != x && {
|
||||
echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
|
||||
exit
|
||||
}
|
||||
test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
|
||||
;;
|
||||
i*86:DYNIX/ptx:4*:*)
|
||||
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
|
||||
# earlier versions are messed up and put the nodename in both
|
||||
|
@ -1048,7 +1001,7 @@ EOF
|
|||
i*86:syllable:*:*)
|
||||
echo ${UNAME_MACHINE}-pc-syllable
|
||||
exit ;;
|
||||
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
|
||||
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
|
||||
echo i386-unknown-lynxos${UNAME_RELEASE}
|
||||
exit ;;
|
||||
i*86:*DOS:*:*)
|
||||
|
@ -1092,8 +1045,11 @@ EOF
|
|||
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 i386.
|
||||
echo i386-pc-msdosdjgpp
|
||||
# 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 ;;
|
||||
Intel:Mach:3*:*)
|
||||
echo i386-pc-mach3
|
||||
|
@ -1131,6 +1087,16 @@ EOF
|
|||
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
|
||||
/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 \
|
||||
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
|
||||
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
|
||||
&& { echo i486-ncr-sysv4.3${OS_REL}; exit; }
|
||||
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
|
||||
&& { echo i586-ncr-sysv4.3${OS_REL}; exit; }
|
||||
/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
|
||||
&& { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
|
||||
m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
|
||||
echo m68k-unknown-lynxos${UNAME_RELEASE}
|
||||
exit ;;
|
||||
|
@ -1143,7 +1109,7 @@ EOF
|
|||
rs6000:LynxOS:2.*:*)
|
||||
echo rs6000-unknown-lynxos${UNAME_RELEASE}
|
||||
exit ;;
|
||||
PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
|
||||
PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
|
||||
echo powerpc-unknown-lynxos${UNAME_RELEASE}
|
||||
exit ;;
|
||||
SM[BE]S:UNIX_SV:*:*)
|
||||
|
@ -1206,6 +1172,9 @@ EOF
|
|||
BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
|
||||
echo i586-pc-beos
|
||||
exit ;;
|
||||
BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
|
||||
echo i586-pc-haiku
|
||||
exit ;;
|
||||
SX-4:SUPER-UX:*:*)
|
||||
echo sx4-nec-superux${UNAME_RELEASE}
|
||||
exit ;;
|
||||
|
@ -1233,6 +1202,16 @@ EOF
|
|||
*:Darwin:*:*)
|
||||
UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
|
||||
case $UNAME_PROCESSOR in
|
||||
i386)
|
||||
eval $set_cc_for_build
|
||||
if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
|
||||
if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
|
||||
(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
|
||||
grep IS_64BIT_ARCH >/dev/null
|
||||
then
|
||||
UNAME_PROCESSOR="x86_64"
|
||||
fi
|
||||
fi ;;
|
||||
unknown) UNAME_PROCESSOR=powerpc ;;
|
||||
esac
|
||||
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
|
||||
|
@ -1314,6 +1293,9 @@ EOF
|
|||
i*86:rdos:*:*)
|
||||
echo ${UNAME_MACHINE}-pc-rdos
|
||||
exit ;;
|
||||
i*86:AROS:*:*)
|
||||
echo ${UNAME_MACHINE}-pc-aros
|
||||
exit ;;
|
||||
esac
|
||||
|
||||
#echo '(No uname command or uname output not recognized.)' 1>&2
|
||||
|
@ -1474,9 +1456,9 @@ This script, last modified $timestamp, has failed to recognize
|
|||
the operating system you are using. It is advised that you
|
||||
download the most up to date version of the config scripts from
|
||||
|
||||
http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
|
||||
http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
|
||||
and
|
||||
http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
|
||||
http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
|
||||
|
||||
If the version you run ($0) is already up to date, please
|
||||
send the following data and any information you think might be
|
||||
|
|
|
@ -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 Free Software Foundation,
|
||||
# Inc.
|
||||
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
|
||||
# Free Software Foundation, Inc.
|
||||
|
||||
timestamp='2007-04-29'
|
||||
timestamp='2009-11-07'
|
||||
|
||||
# This file is (in principle) common to ALL GNU software.
|
||||
# The presence of a machine in this file suggests that SOME GNU software
|
||||
|
@ -32,13 +32,16 @@ timestamp='2007-04-29'
|
|||
|
||||
|
||||
# Please send patches to <config-patches@gnu.org>. Submit a context
|
||||
# diff and a properly formatted ChangeLog entry.
|
||||
# diff and a properly formatted GNU ChangeLog entry.
|
||||
#
|
||||
# Configuration subroutine to validate and canonicalize a configuration type.
|
||||
# Supply the specified configuration type as an argument.
|
||||
# If it is invalid, we print an error message on stderr and exit with code 1.
|
||||
# Otherwise, we print the canonical config type on stdout and succeed.
|
||||
|
||||
# You can get the latest version of this script from:
|
||||
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
|
||||
|
||||
# This file is supposed to be the same for all GNU packages
|
||||
# and recognize all the CPU types, system types and aliases
|
||||
# that are meaningful with *any* GNU software.
|
||||
|
@ -72,8 +75,8 @@ Report bugs and patches to <config-patches@gnu.org>."
|
|||
version="\
|
||||
GNU config.sub ($timestamp)
|
||||
|
||||
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
|
||||
Free Software Foundation, Inc.
|
||||
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
|
||||
2002, 2003, 2004, 2005, 2006, 2007, 2008 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."
|
||||
|
@ -122,6 +125,7 @@ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
|
|||
case $maybe_os in
|
||||
nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
|
||||
uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
|
||||
kopensolaris*-gnu* | \
|
||||
storm-chaos* | os2-emx* | rtmk-nova*)
|
||||
os=-$maybe_os
|
||||
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
|
||||
|
@ -148,10 +152,13 @@ case $os in
|
|||
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
|
||||
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
|
||||
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
|
||||
-apple | -axis | -knuth | -cray)
|
||||
-apple | -axis | -knuth | -cray | -microblaze)
|
||||
os=
|
||||
basic_machine=$1
|
||||
;;
|
||||
-bluegene*)
|
||||
os=-cnk
|
||||
;;
|
||||
-sim | -cisco | -oki | -wec | -winbond)
|
||||
os=
|
||||
basic_machine=$1
|
||||
|
@ -249,13 +256,16 @@ case $basic_machine in
|
|||
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
|
||||
| i370 | i860 | i960 | ia64 \
|
||||
| ip2k | iq2000 \
|
||||
| lm32 \
|
||||
| m32c | m32r | m32rle | m68000 | m68k | m88k \
|
||||
| maxq | mb | microblaze | mcore | mep \
|
||||
| maxq | mb | microblaze | mcore | mep | metag \
|
||||
| mips | mipsbe | mipseb | mipsel | mipsle \
|
||||
| mips16 \
|
||||
| mips64 | mips64el \
|
||||
| mips64vr | mips64vrel \
|
||||
| mips64octeon | mips64octeonel \
|
||||
| mips64orion | mips64orionel \
|
||||
| mips64r5900 | mips64r5900el \
|
||||
| mips64vr | mips64vrel \
|
||||
| mips64vr4100 | mips64vr4100el \
|
||||
| mips64vr4300 | mips64vr4300el \
|
||||
| mips64vr5000 | mips64vr5000el \
|
||||
|
@ -268,6 +278,7 @@ case $basic_machine in
|
|||
| mipsisa64sr71k | mipsisa64sr71kel \
|
||||
| mipstx39 | mipstx39el \
|
||||
| mn10200 | mn10300 \
|
||||
| moxie \
|
||||
| mt \
|
||||
| msp430 \
|
||||
| nios | nios2 \
|
||||
|
@ -276,20 +287,22 @@ case $basic_machine in
|
|||
| pdp10 | pdp11 | pj | pjl \
|
||||
| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
|
||||
| pyramid \
|
||||
| rx \
|
||||
| score \
|
||||
| sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
|
||||
| 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 | tic80 | tron \
|
||||
| ubicom32 \
|
||||
| v850 | v850e \
|
||||
| we32k \
|
||||
| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
|
||||
| z8k)
|
||||
| z8k | z80)
|
||||
basic_machine=$basic_machine-unknown
|
||||
;;
|
||||
m6811 | m68hc11 | m6812 | m68hc12)
|
||||
m6811 | m68hc11 | m6812 | m68hc12 | picochip)
|
||||
# Motorola 68HC11/12.
|
||||
basic_machine=$basic_machine-unknown
|
||||
os=-none
|
||||
|
@ -329,14 +342,17 @@ case $basic_machine in
|
|||
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
|
||||
| i*86-* | i860-* | i960-* | ia64-* \
|
||||
| ip2k-* | iq2000-* \
|
||||
| lm32-* \
|
||||
| m32c-* | m32r-* | m32rle-* \
|
||||
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
|
||||
| m88110-* | m88k-* | maxq-* | mcore-* \
|
||||
| m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
|
||||
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
|
||||
| mips16-* \
|
||||
| mips64-* | mips64el-* \
|
||||
| mips64vr-* | mips64vrel-* \
|
||||
| mips64octeon-* | mips64octeonel-* \
|
||||
| mips64orion-* | mips64orionel-* \
|
||||
| mips64r5900-* | mips64r5900el-* \
|
||||
| mips64vr-* | mips64vrel-* \
|
||||
| mips64vr4100-* | mips64vr4100el-* \
|
||||
| mips64vr4300-* | mips64vr4300el-* \
|
||||
| mips64vr5000-* | mips64vr5000el-* \
|
||||
|
@ -357,21 +373,26 @@ case $basic_machine in
|
|||
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
|
||||
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
|
||||
| pyramid-* \
|
||||
| romp-* | rs6000-* \
|
||||
| sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
|
||||
| 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-* \
|
||||
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
|
||||
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
|
||||
| tron-* \
|
||||
| ubicom32-* \
|
||||
| v850-* | v850e-* | vax-* \
|
||||
| we32k-* \
|
||||
| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
|
||||
| xstormy16-* | xtensa-* \
|
||||
| xstormy16-* | xtensa*-* \
|
||||
| ymp-* \
|
||||
| z8k-*)
|
||||
| z8k-* | z80-*)
|
||||
;;
|
||||
# Recognize the basic CPU types without company name, with glob match.
|
||||
xtensa*)
|
||||
basic_machine=$basic_machine-unknown
|
||||
;;
|
||||
# Recognize the various machine names and aliases which stand
|
||||
# for a CPU type and a company and sometimes even an OS.
|
||||
|
@ -435,6 +456,10 @@ case $basic_machine in
|
|||
basic_machine=m68k-apollo
|
||||
os=-bsd
|
||||
;;
|
||||
aros)
|
||||
basic_machine=i386-pc
|
||||
os=-aros
|
||||
;;
|
||||
aux)
|
||||
basic_machine=m68k-apple
|
||||
os=-aux
|
||||
|
@ -443,10 +468,26 @@ case $basic_machine in
|
|||
basic_machine=ns32k-sequent
|
||||
os=-dynix
|
||||
;;
|
||||
blackfin)
|
||||
basic_machine=bfin-unknown
|
||||
os=-linux
|
||||
;;
|
||||
blackfin-*)
|
||||
basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
os=-linux
|
||||
;;
|
||||
bluegene*)
|
||||
basic_machine=powerpc-ibm
|
||||
os=-cnk
|
||||
;;
|
||||
c90)
|
||||
basic_machine=c90-cray
|
||||
os=-unicos
|
||||
;;
|
||||
cegcc)
|
||||
basic_machine=arm-unknown
|
||||
os=-cegcc
|
||||
;;
|
||||
convex-c1)
|
||||
basic_machine=c1-convex
|
||||
os=-bsd
|
||||
|
@ -475,8 +516,8 @@ case $basic_machine in
|
|||
basic_machine=craynv-cray
|
||||
os=-unicosmp
|
||||
;;
|
||||
cr16c)
|
||||
basic_machine=cr16c-unknown
|
||||
cr16)
|
||||
basic_machine=cr16-unknown
|
||||
os=-elf
|
||||
;;
|
||||
crds | unos)
|
||||
|
@ -514,6 +555,10 @@ case $basic_machine in
|
|||
basic_machine=m88k-motorola
|
||||
os=-sysv3
|
||||
;;
|
||||
dicos)
|
||||
basic_machine=i686-pc
|
||||
os=-dicos
|
||||
;;
|
||||
djgpp)
|
||||
basic_machine=i586-pc
|
||||
os=-msdosdjgpp
|
||||
|
@ -668,6 +713,14 @@ case $basic_machine in
|
|||
basic_machine=m68k-isi
|
||||
os=-sysv
|
||||
;;
|
||||
m68knommu)
|
||||
basic_machine=m68k-unknown
|
||||
os=-linux
|
||||
;;
|
||||
m68knommu-*)
|
||||
basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
os=-linux
|
||||
;;
|
||||
m88k-omron*)
|
||||
basic_machine=m88k-omron
|
||||
;;
|
||||
|
@ -679,6 +732,9 @@ case $basic_machine in
|
|||
basic_machine=ns32k-utek
|
||||
os=-sysv
|
||||
;;
|
||||
microblaze)
|
||||
basic_machine=microblaze-xilinx
|
||||
;;
|
||||
mingw32)
|
||||
basic_machine=i386-pc
|
||||
os=-mingw32
|
||||
|
@ -813,6 +869,14 @@ case $basic_machine in
|
|||
basic_machine=i860-intel
|
||||
os=-osf
|
||||
;;
|
||||
parisc)
|
||||
basic_machine=hppa-unknown
|
||||
os=-linux
|
||||
;;
|
||||
parisc-*)
|
||||
basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
os=-linux
|
||||
;;
|
||||
pbd)
|
||||
basic_machine=sparc-tti
|
||||
;;
|
||||
|
@ -1021,6 +1085,10 @@ case $basic_machine in
|
|||
basic_machine=tic6x-unknown
|
||||
os=-coff
|
||||
;;
|
||||
tile*)
|
||||
basic_machine=tile-unknown
|
||||
os=-linux-gnu
|
||||
;;
|
||||
tx39)
|
||||
basic_machine=mipstx39-unknown
|
||||
;;
|
||||
|
@ -1096,6 +1164,10 @@ case $basic_machine in
|
|||
basic_machine=z8k-unknown
|
||||
os=-sim
|
||||
;;
|
||||
z80-*-coff)
|
||||
basic_machine=z80-unknown
|
||||
os=-sim
|
||||
;;
|
||||
none)
|
||||
basic_machine=none-none
|
||||
os=-none
|
||||
|
@ -1134,7 +1206,7 @@ case $basic_machine in
|
|||
we32k)
|
||||
basic_machine=we32k-att
|
||||
;;
|
||||
sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
|
||||
sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
|
||||
basic_machine=sh-unknown
|
||||
;;
|
||||
sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
|
||||
|
@ -1204,10 +1276,11 @@ case $os in
|
|||
# Each alternative MUST END IN A *, to match a version number.
|
||||
# -sysv* is not here because it comes later, after sysvr4.
|
||||
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
|
||||
| -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
|
||||
| -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
|
||||
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
|
||||
| -kopensolaris* \
|
||||
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
|
||||
| -aos* \
|
||||
| -aos* | -aros* \
|
||||
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
|
||||
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
|
||||
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
|
||||
|
@ -1216,7 +1289,7 @@ case $os in
|
|||
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
|
||||
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
|
||||
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
|
||||
| -chorusos* | -chorusrdb* \
|
||||
| -chorusos* | -chorusrdb* | -cegcc* \
|
||||
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
|
||||
| -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
|
||||
| -uxpv* | -beos* | -mpeix* | -udk* \
|
||||
|
@ -1226,7 +1299,7 @@ case $os in
|
|||
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
|
||||
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
|
||||
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
|
||||
| -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
|
||||
| -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
|
||||
# Remember, each alternative MUST END IN *, to match a version number.
|
||||
;;
|
||||
-qnx*)
|
||||
|
@ -1356,6 +1429,9 @@ case $os in
|
|||
-zvmoe)
|
||||
os=-zvmoe
|
||||
;;
|
||||
-dicos*)
|
||||
os=-dicos
|
||||
;;
|
||||
-none)
|
||||
;;
|
||||
*)
|
||||
|
@ -1553,7 +1629,7 @@ case $basic_machine in
|
|||
-sunos*)
|
||||
vendor=sun
|
||||
;;
|
||||
-aix*)
|
||||
-cnk*|-aix*)
|
||||
vendor=ibm
|
||||
;;
|
||||
-beos*)
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,8 +1,8 @@
|
|||
dnl Process this with autoconf to create configure
|
||||
|
||||
AC_PREREQ(2.59)
|
||||
AC_PREREQ(2.63)
|
||||
|
||||
AC_INIT([libffi], [3.0.8], [http://gcc.gnu.org/bugs.html])
|
||||
AC_INIT([libffi], [3.0.9], [http://gcc.gnu.org/bugs.html])
|
||||
AC_CONFIG_HEADERS([fficonfig.h])
|
||||
|
||||
AC_CANONICAL_SYSTEM
|
||||
|
@ -20,6 +20,7 @@ AM_INIT_AUTOMAKE
|
|||
m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
|
||||
m4_define([_AC_ARG_VAR_PRECIOUS],[])
|
||||
AC_PROG_CC
|
||||
m4_undefine([_AC_ARG_VAR_PRECIOUS])
|
||||
m4_rename([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
|
||||
|
||||
AC_SUBST(CFLAGS)
|
||||
|
@ -27,6 +28,7 @@ AC_SUBST(CFLAGS)
|
|||
AM_PROG_AS
|
||||
AM_PROG_CC_C_O
|
||||
AC_PROG_LIBTOOL
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
|
@ -49,10 +51,14 @@ case "$host" in
|
|||
TARGET=ARM; TARGETDIR=arm
|
||||
;;
|
||||
|
||||
amd64-*-freebsd*)
|
||||
amd64-*-freebsd* | amd64-*-openbsd*)
|
||||
TARGET=X86_64; TARGETDIR=x86
|
||||
;;
|
||||
|
||||
avr32*-*-*)
|
||||
TARGET=AVR32; TARGETDIR=avr32
|
||||
;;
|
||||
|
||||
cris-*-*)
|
||||
TARGET=LIBFFI_CRIS; TARGETDIR=cris
|
||||
;;
|
||||
|
@ -71,11 +77,13 @@ case "$host" in
|
|||
TARGET=PA_HPUX; TARGETDIR=pa
|
||||
;;
|
||||
|
||||
i386-*-freebsd* | i386-*-openbsd*)
|
||||
i?86-*-freebsd* | i?86-*-openbsd*)
|
||||
TARGET=X86_FREEBSD; TARGETDIR=x86
|
||||
;;
|
||||
i?86-win32* | i?86-*-cygwin* | i?86-*-mingw* | i?86-*-os2*)
|
||||
i?86-win32* | i?86-*-cygwin* | i?86-*-mingw*)
|
||||
TARGET=X86_WIN32; TARGETDIR=x86
|
||||
# All mingw/cygwin/win32 builds require this for sharedlib
|
||||
AM_LTLDFLAGS="-no-undefined"
|
||||
;;
|
||||
i?86-*-darwin*)
|
||||
TARGET=X86_DARWIN; TARGETDIR=x86
|
||||
|
@ -103,6 +111,8 @@ case "$host" in
|
|||
TARGET=MIPS; TARGETDIR=mips
|
||||
;;
|
||||
mips*-*-linux*)
|
||||
# Support 128-bit long double for NewABI.
|
||||
HAVE_LONG_DOUBLE='defined(__mips64)'
|
||||
TARGET=MIPS; TARGETDIR=mips
|
||||
;;
|
||||
|
||||
|
@ -143,14 +153,18 @@ case "$host" in
|
|||
x86_64-*-darwin*)
|
||||
TARGET=X86_DARWIN; TARGETDIR=x86
|
||||
;;
|
||||
|
||||
x86_64-*-cygwin* | x86_64-*-mingw*)
|
||||
TARGET=X86_WIN64; TARGETDIR=x86
|
||||
;;
|
||||
|
||||
x86_64-*-*)
|
||||
TARGET=X86_64; TARGETDIR=x86
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_SUBST(AM_RUNTESTFLAGS)
|
||||
AC_SUBST(AM_LTLDFLAGS)
|
||||
|
||||
if test $TARGETDIR = unknown; then
|
||||
AC_MSG_ERROR(["libffi has not been ported to $host."])
|
||||
|
@ -161,6 +175,7 @@ AM_CONDITIONAL(SPARC, test x$TARGET = xSPARC)
|
|||
AM_CONDITIONAL(X86, test x$TARGET = xX86)
|
||||
AM_CONDITIONAL(X86_FREEBSD, test x$TARGET = xX86_FREEBSD)
|
||||
AM_CONDITIONAL(X86_WIN32, test x$TARGET = xX86_WIN32)
|
||||
AM_CONDITIONAL(X86_WIN64, test x$TARGET = xX86_WIN64)
|
||||
AM_CONDITIONAL(X86_DARWIN, test x$TARGET = xX86_DARWIN)
|
||||
AM_CONDITIONAL(ALPHA, test x$TARGET = xALPHA)
|
||||
AM_CONDITIONAL(IA64, test x$TARGET = xIA64)
|
||||
|
@ -171,6 +186,7 @@ AM_CONDITIONAL(POWERPC_AIX, test x$TARGET = xPOWERPC_AIX)
|
|||
AM_CONDITIONAL(POWERPC_DARWIN, test x$TARGET = xPOWERPC_DARWIN)
|
||||
AM_CONDITIONAL(POWERPC_FREEBSD, test x$TARGET = xPOWERPC_FREEBSD)
|
||||
AM_CONDITIONAL(ARM, test x$TARGET = xARM)
|
||||
AM_CONDITIONAL(AVR32, test x$TARGET = xAVR32)
|
||||
AM_CONDITIONAL(LIBFFI_CRIS, test x$TARGET = xLIBFFI_CRIS)
|
||||
AM_CONDITIONAL(FRV, test x$TARGET = xFRV)
|
||||
AM_CONDITIONAL(S390, test x$TARGET = xS390)
|
||||
|
@ -245,7 +261,7 @@ if test x$TARGET = xSPARC; then
|
|||
fi
|
||||
fi
|
||||
|
||||
if test x$TARGET = xX86 || test x$TARGET = xX86_64; then
|
||||
if test x$TARGET = xX86 || test x$TARGET = xX86_WIN32 || test x$TARGET = xX86_64; then
|
||||
AC_CACHE_CHECK([assembler supports pc related relocs],
|
||||
libffi_cv_as_x86_pcrel, [
|
||||
libffi_cv_as_x86_pcrel=yes
|
||||
|
@ -260,6 +276,14 @@ if test x$TARGET = xX86 || test x$TARGET = xX86_64; then
|
|||
fi
|
||||
fi
|
||||
|
||||
case "$target" in
|
||||
*-apple-darwin10* | *-*-freebsd* | *-*-openbsd* | *-pc-solaris*)
|
||||
AC_DEFINE(FFI_MMAP_EXEC_WRIT, 1,
|
||||
[Cannot use malloc on this target, so, we revert to
|
||||
alternative means])
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_CACHE_CHECK([whether .eh_frame section should be read-only],
|
||||
libffi_cv_ro_eh_frame, [
|
||||
libffi_cv_ro_eh_frame=no
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
This is doc/libffi.info, produced by makeinfo version 4.12 from
|
||||
./doc/libffi.texi.
|
||||
This is ../libffi/doc/libffi.info, produced by makeinfo version 4.13
|
||||
from ../libffi/doc/libffi.texi.
|
||||
|
||||
This manual is for Libffi, a portable foreign-function interface
|
||||
library.
|
||||
|
@ -13,7 +13,7 @@ library.
|
|||
included in the section entitled "GNU General Public License".
|
||||
|
||||
|
||||
INFO-DIR-SECTION
|
||||
INFO-DIR-SECTION Development
|
||||
START-INFO-DIR-ENTRY
|
||||
* libffi: (libffi). Portable foreign-function interface library.
|
||||
END-INFO-DIR-ENTRY
|
||||
|
@ -516,18 +516,18 @@ Index
|
|||
|
||||
|
||||
Tag Table:
|
||||
Node: Top670
|
||||
Node: Introduction1406
|
||||
Node: Using libffi3042
|
||||
Node: The Basics3477
|
||||
Node: Simple Example6084
|
||||
Node: Types7111
|
||||
Node: Primitive Types7394
|
||||
Node: Structures9214
|
||||
Node: Type Example10074
|
||||
Node: Multiple ABIs11297
|
||||
Node: The Closure API11668
|
||||
Node: Missing Features14588
|
||||
Node: Index15081
|
||||
Node: Top700
|
||||
Node: Introduction1436
|
||||
Node: Using libffi3072
|
||||
Node: The Basics3507
|
||||
Node: Simple Example6114
|
||||
Node: Types7141
|
||||
Node: Primitive Types7424
|
||||
Node: Structures9244
|
||||
Node: Type Example10104
|
||||
Node: Multiple ABIs11327
|
||||
Node: The Closure API11698
|
||||
Node: Missing Features14618
|
||||
Node: Index15111
|
||||
|
||||
End Tag Table
|
||||
|
|
|
@ -31,7 +31,7 @@ section entitled ``GNU General Public License''.
|
|||
@end quotation
|
||||
@end copying
|
||||
|
||||
@dircategory
|
||||
@dircategory Development
|
||||
@direntry
|
||||
* libffi: (libffi). Portable foreign-function interface library.
|
||||
@end direntry
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
@set UPDATED 14 February 2008
|
||||
@set UPDATED-MONTH February 2008
|
||||
@set EDITION 3.0.8
|
||||
@set VERSION 3.0.8
|
||||
@set UPDATED 29 December 2009
|
||||
@set UPDATED-MONTH December 2009
|
||||
@set EDITION 3.0.9
|
||||
@set VERSION 3.0.9
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
@set UPDATED 14 February 2008
|
||||
@set UPDATED-MONTH February 2008
|
||||
@set EDITION 3.0.8
|
||||
@set VERSION 3.0.8
|
||||
@set UPDATED 29 December 2009
|
||||
@set UPDATED-MONTH December 2009
|
||||
@set EDITION 3.0.9
|
||||
@set VERSION 3.0.9
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
/* fficonfig.h.in. Generated from configure.ac by autoheader. */
|
||||
|
||||
/* Define if building universal (internal helper macro) */
|
||||
#undef AC_APPLE_UNIVERSAL_BUILD
|
||||
|
||||
/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
|
||||
systems. This function is required for `alloca.c' support on those systems.
|
||||
*/
|
||||
|
@ -14,6 +17,9 @@
|
|||
/* Define this if you want extra debugging. */
|
||||
#undef FFI_DEBUG
|
||||
|
||||
/* Cannot use malloc on this target, so, we revert to alternative means */
|
||||
#undef FFI_MMAP_EXEC_WRIT
|
||||
|
||||
/* Define this is you do not want support for the raw API. */
|
||||
#undef FFI_NO_RAW_API
|
||||
|
||||
|
@ -97,6 +103,10 @@
|
|||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Define to the sub-directory in which libtool stores uninstalled libraries.
|
||||
*/
|
||||
#undef LT_OBJDIR
|
||||
|
||||
/* Define to 1 if your C compiler doesn't accept -c and -o together. */
|
||||
#undef NO_MINUS_C_MINUS_O
|
||||
|
||||
|
@ -142,9 +152,17 @@
|
|||
/* Version number of package */
|
||||
#undef VERSION
|
||||
|
||||
/* Define to 1 if your processor stores words with the most significant byte
|
||||
first (like Motorola and SPARC, unlike Intel and VAX). */
|
||||
#undef WORDS_BIGENDIAN
|
||||
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
|
||||
significant byte first (like Motorola and SPARC, unlike Intel). */
|
||||
#if defined AC_APPLE_UNIVERSAL_BUILD
|
||||
# if defined __BIG_ENDIAN__
|
||||
# define WORDS_BIGENDIAN 1
|
||||
# endif
|
||||
#else
|
||||
# ifndef WORDS_BIGENDIAN
|
||||
# undef WORDS_BIGENDIAN
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAVE_HIDDEN_VISIBILITY_ATTRIBUTE
|
||||
|
|
|
@ -6,4 +6,4 @@ DISTCLEANFILES=ffitarget.h
|
|||
EXTRA_DIST=ffi.h.in ffi_common.h
|
||||
|
||||
includesdir = $(libdir)/@PACKAGE_NAME@-@PACKAGE_VERSION@/include
|
||||
nodist_includes_HEADERS = ffi.h ffitarget.h
|
||||
nodist_includes_HEADERS = ffi.h ffitarget.h
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
# Makefile.in generated by automake 1.10.1 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.11 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||
# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
|
||||
# Inc.
|
||||
# This Makefile.in 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.
|
||||
|
@ -16,8 +17,9 @@
|
|||
|
||||
VPATH = @srcdir@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkglibexecdir = $(libexecdir)/@PACKAGE@
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
|
@ -41,9 +43,10 @@ am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
|
|||
$(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = $(top_builddir)/fficonfig.h
|
||||
CONFIG_CLEAN_FILES = ffi.h ffitarget.h
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
||||
|
@ -51,9 +54,23 @@ am__vpath_adj = case $$p in \
|
|||
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
*) f=$$p;; \
|
||||
esac;
|
||||
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
|
||||
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
|
||||
am__install_max = 40
|
||||
am__nobase_strip_setup = \
|
||||
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
|
||||
am__nobase_strip = \
|
||||
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
|
||||
am__nobase_list = $(am__nobase_strip_setup); \
|
||||
for p in $$list; do echo "$$p $$p"; done | \
|
||||
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
|
||||
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
|
||||
if (++n[$$2] == $(am__install_max)) \
|
||||
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
|
||||
END { for (dir in files) print dir, files[dir] }'
|
||||
am__base_list = \
|
||||
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
|
||||
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
|
||||
am__installdirs = "$(DESTDIR)$(includesdir)"
|
||||
nodist_includesHEADERS_INSTALL = $(INSTALL_HEADER)
|
||||
HEADERS = $(nodist_includes_HEADERS)
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
|
@ -75,22 +92,17 @@ CCDEPMODE = @CCDEPMODE@
|
|||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
ECHO = @ECHO@
|
||||
DUMPBIN = @DUMPBIN@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
F77 = @F77@
|
||||
FFLAGS = @FFLAGS@
|
||||
FGREP = @FGREP@
|
||||
GREP = @GREP@
|
||||
HAVE_LONG_DOUBLE = @HAVE_LONG_DOUBLE@
|
||||
INSTALL = @INSTALL@
|
||||
|
@ -98,17 +110,23 @@ INSTALL_DATA = @INSTALL_DATA@
|
|||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LD = @LD@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIPO = @LIPO@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAINT = @MAINT@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
NM = @NM@
|
||||
NMEDIT = @NMEDIT@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
OBJEXT = @OBJEXT@
|
||||
OTOOL = @OTOOL@
|
||||
OTOOL64 = @OTOOL64@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
|
@ -129,8 +147,7 @@ abs_srcdir = @abs_srcdir@
|
|||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_F77 = @ac_ct_F77@
|
||||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
|
@ -161,6 +178,7 @@ libdir = @libdir@
|
|||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
lt_ECHO = @lt_ECHO@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
|
@ -186,7 +204,7 @@ AUTOMAKE_OPTIONS = foreign
|
|||
DISTCLEANFILES = ffitarget.h
|
||||
EXTRA_DIST = ffi.h.in ffi_common.h
|
||||
includesdir = $(libdir)/@PACKAGE_NAME@-@PACKAGE_VERSION@/include
|
||||
nodist_includes_HEADERS = ffi.h ffitarget.h
|
||||
nodist_includes_HEADERS = ffi.h ffitarget.h
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
|
@ -194,14 +212,14 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
|
|||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
|
||||
&& exit 0; \
|
||||
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
|
||||
&& { if test -f $@; then exit 0; else break; fi; }; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign include/Makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --foreign include/Makefile
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign include/Makefile'; \
|
||||
$(am__cd) $(top_srcdir) && \
|
||||
$(AUTOMAKE) --foreign include/Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
|
@ -219,6 +237,7 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
|||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(am__aclocal_m4_deps):
|
||||
ffi.h: $(top_builddir)/config.status $(srcdir)/ffi.h.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
|
||||
|
||||
|
@ -230,34 +249,37 @@ clean-libtool:
|
|||
install-nodist_includesHEADERS: $(nodist_includes_HEADERS)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(includesdir)" || $(MKDIR_P) "$(DESTDIR)$(includesdir)"
|
||||
@list='$(nodist_includes_HEADERS)'; for p in $$list; do \
|
||||
@list='$(nodist_includes_HEADERS)'; test -n "$(includesdir)" || list=; \
|
||||
for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
f=$(am__strip_dir) \
|
||||
echo " $(nodist_includesHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includesdir)/$$f'"; \
|
||||
$(nodist_includesHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includesdir)/$$f"; \
|
||||
echo "$$d$$p"; \
|
||||
done | $(am__base_list) | \
|
||||
while read files; do \
|
||||
echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includesdir)'"; \
|
||||
$(INSTALL_HEADER) $$files "$(DESTDIR)$(includesdir)" || exit $$?; \
|
||||
done
|
||||
|
||||
uninstall-nodist_includesHEADERS:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(nodist_includes_HEADERS)'; for p in $$list; do \
|
||||
f=$(am__strip_dir) \
|
||||
echo " rm -f '$(DESTDIR)$(includesdir)/$$f'"; \
|
||||
rm -f "$(DESTDIR)$(includesdir)/$$f"; \
|
||||
done
|
||||
@list='$(nodist_includes_HEADERS)'; test -n "$(includesdir)" || list=; \
|
||||
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
|
||||
test -n "$$files" || exit 0; \
|
||||
echo " ( cd '$(DESTDIR)$(includesdir)' && rm -f" $$files ")"; \
|
||||
cd "$(DESTDIR)$(includesdir)" && rm -f $$files
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
set x; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
|
@ -265,29 +287,34 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
|||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
|
||||
shift; \
|
||||
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique; \
|
||||
if test $$# -gt 0; then \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
"$$@" $$unique; \
|
||||
else \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$unique; \
|
||||
fi; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|
||||
test -z "$(CTAGS_ARGS)$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
$$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& cd $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) $$here
|
||||
&& $(am__cd) $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) "$$here"
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
@ -308,13 +335,17 @@ distdir: $(DISTFILES)
|
|||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||
if test -d "$(distdir)/$$file"; then \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
test -f "$(distdir)/$$file" \
|
||||
|| cp -p $$d/$$file "$(distdir)/$$file" \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
|
@ -345,6 +376,7 @@ clean-generic:
|
|||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
|
||||
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
|
@ -364,6 +396,8 @@ dvi-am:
|
|||
|
||||
html: html-am
|
||||
|
||||
html-am:
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
@ -372,18 +406,28 @@ install-data-am: install-nodist_includesHEADERS
|
|||
|
||||
install-dvi: install-dvi-am
|
||||
|
||||
install-dvi-am:
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-html: install-html-am
|
||||
|
||||
install-html-am:
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-info-am:
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-am
|
||||
|
||||
install-pdf-am:
|
||||
|
||||
install-ps: install-ps-am
|
||||
|
||||
install-ps-am:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
|
@ -419,6 +463,7 @@ uninstall-am: uninstall-nodist_includesHEADERS
|
|||
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
|
||||
tags uninstall uninstall-am uninstall-nodist_includesHEADERS
|
||||
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
|
|
|
@ -57,9 +57,7 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
/* Specify which architecture libffi is configured for. */
|
||||
#ifndef @TARGET@
|
||||
#define @TARGET@
|
||||
#endif
|
||||
|
||||
/* ---- System configuration information --------------------------------- */
|
||||
|
||||
|
@ -67,6 +65,10 @@ extern "C" {
|
|||
|
||||
#ifndef LIBFFI_ASM
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#define __attribute__(X)
|
||||
#endif
|
||||
|
||||
#include <stddef.h>
|
||||
#include <limits.h>
|
||||
|
||||
|
@ -254,7 +256,11 @@ typedef struct {
|
|||
ffi_cif *cif;
|
||||
void (*fun)(ffi_cif*,void*,void**,void*);
|
||||
void *user_data;
|
||||
#ifdef __GNUC__
|
||||
} ffi_closure __attribute__((aligned (8)));
|
||||
#else
|
||||
} ffi_closure;
|
||||
#endif
|
||||
|
||||
void *ffi_closure_alloc (size_t size, void **code);
|
||||
void ffi_closure_free (void *);
|
||||
|
|
|
@ -18,7 +18,10 @@ extern "C" {
|
|||
/* Do not move this. Some versions of AIX are very picky about where
|
||||
this is positioned. */
|
||||
#ifdef __GNUC__
|
||||
/* mingw64 defines this already in malloc.h. */
|
||||
#ifndef alloca
|
||||
# define alloca __builtin_alloca
|
||||
#endif
|
||||
# define MAYBE_UNUSED __attribute__((__unused__))
|
||||
#else
|
||||
# define MAYBE_UNUSED
|
||||
|
@ -29,7 +32,11 @@ extern "C" {
|
|||
#pragma alloca
|
||||
# else
|
||||
# ifndef alloca /* predefined by HP cc +Olibcalls */
|
||||
# ifdef _MSC_VER
|
||||
# define alloca _alloca
|
||||
# else
|
||||
char *alloca ();
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
|
@ -77,6 +84,22 @@ typedef struct
|
|||
} extended_cif;
|
||||
|
||||
/* Terse sized type definitions. */
|
||||
#if defined(_MSC_VER) || defined(__sgi)
|
||||
typedef unsigned char UINT8;
|
||||
typedef signed char SINT8;
|
||||
typedef unsigned short UINT16;
|
||||
typedef signed short SINT16;
|
||||
typedef unsigned int UINT32;
|
||||
typedef signed int SINT32;
|
||||
# ifdef _MSC_VER
|
||||
typedef unsigned __int64 UINT64;
|
||||
typedef signed __int64 SINT64;
|
||||
# else
|
||||
# include <inttypes.h>
|
||||
typedef uint64_t UINT64;
|
||||
typedef int64_t SINT64;
|
||||
# endif
|
||||
#else
|
||||
typedef unsigned int UINT8 __attribute__((__mode__(__QI__)));
|
||||
typedef signed int SINT8 __attribute__((__mode__(__QI__)));
|
||||
typedef unsigned int UINT16 __attribute__((__mode__(__HI__)));
|
||||
|
@ -85,6 +108,7 @@ typedef unsigned int UINT32 __attribute__((__mode__(__SI__)));
|
|||
typedef signed int SINT32 __attribute__((__mode__(__SI__)));
|
||||
typedef unsigned int UINT64 __attribute__((__mode__(__DI__)));
|
||||
typedef signed int SINT64 __attribute__((__mode__(__DI__)));
|
||||
#endif
|
||||
|
||||
typedef float FLOAT32;
|
||||
|
||||
|
|
|
@ -26,4 +26,4 @@
|
|||
# release, then set age to 0.
|
||||
#
|
||||
# CURRENT:REVISION:AGE
|
||||
5:9:0
|
||||
5:10:0
|
||||
|
|
|
@ -1,861 +0,0 @@
|
|||
#### This script is meant to be sourced by ltconfig.
|
||||
|
||||
# ltcf-c.sh - Create a C compiler specific configuration
|
||||
#
|
||||
# Copyright (C) 1996-2000, 2001 Free Software Foundation, Inc.
|
||||
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
|
||||
#
|
||||
# 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
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
|
||||
# Source file extension for C test sources.
|
||||
ac_ext=c
|
||||
|
||||
# Object file extension for compiled C test sources.
|
||||
objext=o
|
||||
|
||||
# Code to be used in simple compile tests
|
||||
lt_simple_compile_test_code="int some_variable = 0;"
|
||||
|
||||
# Code to be used in simple link tests
|
||||
lt_simple_link_test_code='main(){return(0);}'
|
||||
|
||||
## Linker Characteristics
|
||||
case $host_os in
|
||||
cygwin* | mingw*)
|
||||
# FIXME: the MSVC++ port hasn't been tested in a loooong time
|
||||
# When not using gcc, we currently assume that we are using
|
||||
# Microsoft Visual C++.
|
||||
if test "$with_gcc" != yes; then
|
||||
with_gnu_ld=no
|
||||
fi
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
ld_shlibs=yes
|
||||
if test "$with_gnu_ld" = yes; then
|
||||
# If archive_cmds runs LD, not CC, wlarc should be empty
|
||||
wlarc='${wl}'
|
||||
|
||||
# See if GNU ld supports shared libraries.
|
||||
case $host_os in
|
||||
aix3* | aix4* | aix5*)
|
||||
# On AIX/PPC, the GNU linker is very broken
|
||||
if test "$host_cpu" != ia64; then
|
||||
ld_shlibs=no
|
||||
cat <<EOF 1>&2
|
||||
|
||||
*** Warning: the GNU linker, at least up to release 2.9.1, 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.
|
||||
|
||||
EOF
|
||||
fi
|
||||
;;
|
||||
|
||||
amigaos*)
|
||||
archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_minus_L=yes
|
||||
|
||||
# Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
|
||||
# that the semantics of dynamic libraries on AmigaOS, at least up
|
||||
# to version 4, is to share data among multiple programs linked
|
||||
# with the same dynamic library. Since this doesn't match the
|
||||
# behavior of shared libraries on other platforms, we can use
|
||||
# them.
|
||||
ld_shlibs=no
|
||||
;;
|
||||
|
||||
beos*)
|
||||
if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
|
||||
allow_undefined_flag=unsupported
|
||||
# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
|
||||
# support --undefined. This deserves some investigation. FIXME
|
||||
archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
|
||||
else
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
|
||||
cygwin* | mingw*)
|
||||
# hardcode_libdir_flag_spec is actually meaningless, as there is
|
||||
# no search path for DLLs.
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
allow_undefined_flag=unsupported
|
||||
always_export_symbols=yes
|
||||
|
||||
extract_expsyms_cmds='test -f $output_objdir/impgen.c || \
|
||||
sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //; p; }" -e d < $0 > $output_objdir/impgen.c~
|
||||
test -f $output_objdir/impgen.exe || (cd $output_objdir && \
|
||||
if test "x$BUILD_CC" != "x" ; then $BUILD_CC -o impgen impgen.c ; \
|
||||
else $CC -o impgen impgen.c ; fi)~
|
||||
$output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def'
|
||||
|
||||
old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib'
|
||||
|
||||
# cygwin and mingw dlls have different entry points and sets of symbols
|
||||
# to exclude.
|
||||
# FIXME: what about values for MSVC?
|
||||
dll_entry=__cygwin_dll_entry@12
|
||||
dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~
|
||||
case $host_os in
|
||||
mingw*)
|
||||
# mingw values
|
||||
dll_entry=_DllMainCRTStartup@12
|
||||
dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~
|
||||
;;
|
||||
esac
|
||||
|
||||
# mingw and cygwin differ, and it's simplest to just exclude the union
|
||||
# of the two symbol sets.
|
||||
dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12
|
||||
|
||||
# recent cygwin and mingw systems supply a stub DllMain which the user
|
||||
# can override, but on older systems we have to supply one (in ltdll.c)
|
||||
if test "x$lt_cv_need_dllmain" = "xyes"; then
|
||||
ltdll_obj='$output_objdir/$soname-ltdll.'"$objext "
|
||||
ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $output_objdir/$soname-ltdll.c~
|
||||
test -f $output_objdir/$soname-ltdll.$objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~'
|
||||
else
|
||||
ltdll_obj=
|
||||
ltdll_cmds=
|
||||
fi
|
||||
|
||||
# Extract the symbol export list from an `--export-all' def file,
|
||||
# then regenerate the def file from the symbol export list, so that
|
||||
# the compiled dll only exports the symbol export list.
|
||||
# Be careful not to strip the DATA tag left be newer dlltools.
|
||||
export_symbols_cmds="$ltdll_cmds"'
|
||||
$DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~
|
||||
sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols'
|
||||
|
||||
# If the export-symbols file already is a .def file (1st line
|
||||
# is EXPORTS), use it as is.
|
||||
# If DATA tags from a recent dlltool are present, honour them!
|
||||
archive_expsym_cmds='if test "x`head -1 $export_symbols`" = xEXPORTS; then
|
||||
cp $export_symbols $output_objdir/$soname-def;
|
||||
else
|
||||
echo EXPORTS > $output_objdir/$soname-def;
|
||||
_lt_hint=1;
|
||||
cat $export_symbols | while read symbol; do
|
||||
set dummy \$symbol;
|
||||
case \[$]# in
|
||||
2) echo " \[$]2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;;
|
||||
*) echo " \[$]2 @ \$_lt_hint \[$]3 ; " >> $output_objdir/$soname-def;;
|
||||
esac;
|
||||
_lt_hint=`expr 1 + \$_lt_hint`;
|
||||
done;
|
||||
fi~
|
||||
'"$ltdll_cmds"'
|
||||
$CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
|
||||
$DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~
|
||||
$CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
|
||||
$DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp --output-lib $output_objdir/$libname.dll.a~
|
||||
$CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags'
|
||||
;;
|
||||
|
||||
netbsd* | knetbsd*-gnu)
|
||||
if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
|
||||
archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
|
||||
wlarc=
|
||||
else
|
||||
archive_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
|
||||
archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
|
||||
fi
|
||||
;;
|
||||
|
||||
solaris* | sysv5*)
|
||||
if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
|
||||
ld_shlibs=no
|
||||
cat <<EOF 1>&2
|
||||
|
||||
*** Warning: The releases 2.8.* of the GNU linker cannot reliably
|
||||
*** create shared libraries on Solaris systems. Therefore, libtool
|
||||
*** is disabling shared libraries support. We urge you to upgrade GNU
|
||||
*** binutils to release 2.9.1 or newer. Another option is to modify
|
||||
*** your PATH or compiler configuration so that the native linker is
|
||||
*** used, and then restart.
|
||||
|
||||
EOF
|
||||
elif $LD --help 2>&1 | egrep ': 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'
|
||||
else
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
|
||||
sunos4*)
|
||||
archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
|
||||
wlarc=
|
||||
hardcode_direct=yes
|
||||
hardcode_shlibpath_var=no
|
||||
;;
|
||||
|
||||
tpf*)
|
||||
ld_shlibs=yes
|
||||
;;
|
||||
|
||||
*)
|
||||
if $LD --help 2>&1 | egrep ': 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'
|
||||
else
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if test "$ld_shlibs" = yes; then
|
||||
runpath_var=LD_RUN_PATH
|
||||
hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
|
||||
export_dynamic_flag_spec='${wl}--export-dynamic'
|
||||
case $host_os in
|
||||
cygwin* | mingw*)
|
||||
# dlltool doesn't understand --whole-archive et. al.
|
||||
whole_archive_flag_spec=
|
||||
;;
|
||||
*)
|
||||
# ancient GNU ld didn't support --whole-archive et. al.
|
||||
if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then
|
||||
whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
|
||||
else
|
||||
whole_archive_flag_spec=
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
else
|
||||
# PORTME fill in a description of your system's linker (not GNU ld)
|
||||
case $host_os in
|
||||
aix3*)
|
||||
allow_undefined_flag=unsupported
|
||||
always_export_symbols=yes
|
||||
archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
|
||||
# Note: this linker hardcodes the directories in LIBPATH if there
|
||||
# are no directories specified by -L.
|
||||
hardcode_minus_L=yes
|
||||
if test "$with_gcc" = yes && test -z "$link_static_flag"; then
|
||||
# Neither direct hardcoding nor static linking is supported with a
|
||||
# broken collect2.
|
||||
hardcode_direct=unsupported
|
||||
fi
|
||||
;;
|
||||
|
||||
aix4* | aix5*)
|
||||
hardcode_direct=yes
|
||||
hardcode_libdir_separator=':'
|
||||
link_all_deplibs=yes
|
||||
# When large executables or shared objects are built, AIX ld can
|
||||
# have problems creating the table of contents. If linking a library
|
||||
# or program results in "error TOC overflow" add -mminimal-toc to
|
||||
# CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
|
||||
# enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
|
||||
if test "$with_gcc" = yes; then
|
||||
case $host_os in aix4.[012]|aix4.[012].*)
|
||||
# We only want to do this on AIX 4.2 and lower, the check
|
||||
# below for broken collect2 doesn't work under 4.3+
|
||||
collect2name=`${CC} -print-prog-name=collect2`
|
||||
if test -f "$collect2name" && \
|
||||
strings "$collect2name" | grep resolve_lib_name >/dev/null
|
||||
then
|
||||
# We have reworked collect2
|
||||
hardcode_direct=yes
|
||||
else
|
||||
# We have old collect2
|
||||
hardcode_direct=unsupported
|
||||
# It fails to find uninstalled libraries when the uninstalled
|
||||
# path is not listed in the libpath. Setting hardcode_minus_L
|
||||
# to unsupported forces relinking
|
||||
hardcode_minus_L=yes
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_libdir_separator=
|
||||
fi
|
||||
esac
|
||||
shared_flag='-shared'
|
||||
else
|
||||
# not using gcc
|
||||
if test "$host_cpu" = ia64; then
|
||||
shared_flag='${wl}-G'
|
||||
else
|
||||
shared_flag='${wl}-bM:SRE'
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$host_cpu" = ia64; then
|
||||
# On IA64, the linker does run time linking by default, so we don't
|
||||
# have to do anything special.
|
||||
aix_use_runtimelinking=no
|
||||
if test $with_gnu_ld = no; then
|
||||
exp_sym_flag='-Bexport'
|
||||
no_entry_flag=""
|
||||
fi
|
||||
else
|
||||
# Test if we are trying to use run time linking, or normal AIX style linking.
|
||||
# If -brtl is somewhere in LDFLAGS, we need to do run time linking.
|
||||
aix_use_runtimelinking=no
|
||||
for ld_flag in $LDFLAGS; do
|
||||
if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl" ); then
|
||||
aix_use_runtimelinking=yes
|
||||
break
|
||||
fi
|
||||
done
|
||||
exp_sym_flag='-bexport'
|
||||
no_entry_flag='-bnoentry'
|
||||
fi
|
||||
# -bexpall does not export symbols beginning with underscore (_)
|
||||
always_export_symbols=yes
|
||||
if test "$aix_use_runtimelinking" = yes; then
|
||||
# Warning - without using the other run time loading flags (-brtl), -berok will
|
||||
# link without error, but may produce a broken library.
|
||||
allow_undefined_flag=' ${wl}-berok'
|
||||
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
|
||||
archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
|
||||
else
|
||||
if test "$host_cpu" = ia64; then
|
||||
if test $with_gnu_ld = no; then
|
||||
hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
|
||||
allow_undefined_flag="-z nodefs"
|
||||
archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
|
||||
fi
|
||||
else
|
||||
allow_undefined_flag=' ${wl}-berok'
|
||||
# -bexpall does not export symbols beginning with underscore (_)
|
||||
always_export_symbols=yes
|
||||
# Exported symbols can be pulled into shared objects from archives
|
||||
whole_archive_flag_spec=' '
|
||||
build_libtool_need_lc=yes
|
||||
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
|
||||
# This is similar to how AIX traditionally builds it's shared libraries.
|
||||
archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
|
||||
amigaos*)
|
||||
archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_minus_L=yes
|
||||
# see comment about different semantics on the GNU ld section
|
||||
ld_shlibs=no
|
||||
;;
|
||||
|
||||
cygwin* | mingw*)
|
||||
# When not using gcc, we currently assume that we are using
|
||||
# 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
|
||||
# FIXME: Setting linknames here is a bad hack.
|
||||
archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -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"`'
|
||||
;;
|
||||
|
||||
darwin* | rhapsody*)
|
||||
case "$host_os" in
|
||||
rhapsody* | darwin1.[[012]])
|
||||
allow_undefined_flag='-undefined suppress'
|
||||
;;
|
||||
*) # Darwin 1.3 on
|
||||
if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
|
||||
allow_undefined_flag='-flat_namespace -undefined suppress'
|
||||
else
|
||||
case ${MACOSX_DEPLOYMENT_TARGET} in
|
||||
10.[[012]])
|
||||
allow_undefined_flag='-flat_namespace -undefined suppress'
|
||||
;;
|
||||
10.*)
|
||||
allow_undefined_flag='-undefined dynamic_lookup'
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
# Disable shared library build on OS-X older than 10.3.
|
||||
case $host_os in
|
||||
darwin[1-6]*)
|
||||
can_build_shared=no
|
||||
;;
|
||||
darwin7*)
|
||||
can_build_shared=yes
|
||||
;;
|
||||
esac
|
||||
output_verbose_link_cmd='echo'
|
||||
archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring'
|
||||
module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
|
||||
# Don't fix this by using the ld -exported_symbols_list flag,
|
||||
# it doesn't exist in older darwin ld's
|
||||
archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
|
||||
module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
|
||||
hardcode_direct=no
|
||||
hardcode_automatic=yes
|
||||
hardcode_shlibpath_var=unsupported
|
||||
whole_archive_flag_spec='-all_load $convenience'
|
||||
link_all_deplibs=yes
|
||||
;;
|
||||
|
||||
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
|
||||
# extra space).
|
||||
freebsd2.2*)
|
||||
archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
|
||||
hardcode_libdir_flag_spec='-R$libdir'
|
||||
hardcode_direct=yes
|
||||
hardcode_shlibpath_var=no
|
||||
;;
|
||||
|
||||
# Unfortunately, older versions of FreeBSD 2 do not have this feature.
|
||||
freebsd2*)
|
||||
archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
|
||||
hardcode_direct=yes
|
||||
hardcode_minus_L=yes
|
||||
hardcode_shlibpath_var=no
|
||||
;;
|
||||
|
||||
# FreeBSD 3 and greater uses gcc -shared to do shared libraries.
|
||||
freebsd* | kfreebsd*-gnu)
|
||||
archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
|
||||
hardcode_libdir_flag_spec='-R$libdir'
|
||||
hardcode_direct=yes
|
||||
hardcode_shlibpath_var=no
|
||||
;;
|
||||
|
||||
hpux9* | hpux10* | hpux11*)
|
||||
case "$host_cpu" in
|
||||
ia64*)
|
||||
hardcode_direct=no
|
||||
hardcode_shlibpath_var=no
|
||||
archive_cmds='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
|
||||
hardcode_libdir_flag_spec='-L$libdir' ;;
|
||||
*)
|
||||
if test $with_gcc = yes; then
|
||||
case "$host_os" in
|
||||
hpux9*) 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='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;;
|
||||
esac
|
||||
else
|
||||
case $host_os in
|
||||
hpux9*) archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;;
|
||||
*) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;;
|
||||
esac
|
||||
fi
|
||||
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
|
||||
hardcode_libdir_separator=:
|
||||
hardcode_minus_L=yes # Not in the search PATH, but as the default
|
||||
# location of the library.
|
||||
;;
|
||||
esac
|
||||
export_dynamic_flag_spec='${wl}-E'
|
||||
hardcode_direct=yes
|
||||
;;
|
||||
|
||||
irix5* | irix6*)
|
||||
if test "$with_gcc" = yes; then
|
||||
archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
|
||||
else
|
||||
archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
|
||||
fi
|
||||
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
|
||||
hardcode_libdir_separator=:
|
||||
link_all_deplibs=yes
|
||||
;;
|
||||
|
||||
netbsd* | knetbsd*-gnu)
|
||||
if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
|
||||
archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
|
||||
else
|
||||
archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
|
||||
fi
|
||||
hardcode_libdir_flag_spec='-R$libdir'
|
||||
hardcode_direct=yes
|
||||
hardcode_shlibpath_var=no
|
||||
;;
|
||||
|
||||
newsos6)
|
||||
archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
|
||||
hardcode_direct=yes
|
||||
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
|
||||
hardcode_libdir_separator=:
|
||||
hardcode_shlibpath_var=no
|
||||
;;
|
||||
|
||||
openbsd*)
|
||||
archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
|
||||
hardcode_libdir_flag_spec='-R$libdir'
|
||||
hardcode_direct=yes
|
||||
hardcode_shlibpath_var=no
|
||||
;;
|
||||
|
||||
os2*)
|
||||
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'
|
||||
old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
|
||||
;;
|
||||
|
||||
osf3*)
|
||||
if test "$with_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 ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
|
||||
else
|
||||
allow_undefined_flag=' -expect_unresolved \*'
|
||||
archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
|
||||
fi
|
||||
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
|
||||
hardcode_libdir_separator=:
|
||||
;;
|
||||
|
||||
osf4* | osf5*) # as osf3* with the addition of -msym flag
|
||||
if test "$with_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 ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
|
||||
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
|
||||
else
|
||||
allow_undefined_flag=' -expect_unresolved \*'
|
||||
archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
|
||||
archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
|
||||
$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
|
||||
|
||||
# cc supports -rpath directly
|
||||
hardcode_libdir_flag_spec='-rpath $libdir'
|
||||
fi
|
||||
hardcode_libdir_separator=:
|
||||
;;
|
||||
|
||||
sco3.2v5*)
|
||||
archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
|
||||
hardcode_shlibpath_var=no
|
||||
runpath_var=LD_RUN_PATH
|
||||
hardcode_runpath_var=yes
|
||||
;;
|
||||
|
||||
solaris*)
|
||||
no_undefined_flag=' -z defs'
|
||||
if test "$with_gcc" = yes; then
|
||||
archive_cmds='$CC -shared ${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}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
|
||||
else
|
||||
archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
|
||||
archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
|
||||
$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
|
||||
fi
|
||||
hardcode_libdir_flag_spec='-R$libdir'
|
||||
hardcode_shlibpath_var=no
|
||||
case $host_os in
|
||||
solaris2.[0-5] | solaris2.[0-5].*) ;;
|
||||
*) # Supported since Solaris 2.6 (maybe 2.5.1?)
|
||||
whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
|
||||
esac
|
||||
link_all_deplibs=yes
|
||||
;;
|
||||
|
||||
sunos4*)
|
||||
archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_direct=yes
|
||||
hardcode_minus_L=yes
|
||||
hardcode_shlibpath_var=no
|
||||
;;
|
||||
|
||||
sysv4)
|
||||
archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
|
||||
runpath_var='LD_RUN_PATH'
|
||||
hardcode_shlibpath_var=no
|
||||
hardcode_direct=no #Motorola manual says yes, but my tests say they lie
|
||||
;;
|
||||
|
||||
sysv4.3*)
|
||||
archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
|
||||
hardcode_shlibpath_var=no
|
||||
export_dynamic_flag_spec='-Bexport'
|
||||
;;
|
||||
|
||||
sysv5*)
|
||||
no_undefined_flag=' -z text'
|
||||
# $CC -shared without GNU ld will not create a library from C++
|
||||
# object files and a static libstdc++, better avoid it by now
|
||||
archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
|
||||
archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
|
||||
$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
|
||||
hardcode_libdir_flag_spec=
|
||||
hardcode_shlibpath_var=no
|
||||
runpath_var='LD_RUN_PATH'
|
||||
;;
|
||||
|
||||
uts4*)
|
||||
archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_shlibpath_var=no
|
||||
;;
|
||||
|
||||
dgux*)
|
||||
archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_shlibpath_var=no
|
||||
;;
|
||||
|
||||
sysv4*MP*)
|
||||
if test -d /usr/nec; then
|
||||
archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
|
||||
hardcode_shlibpath_var=no
|
||||
runpath_var=LD_RUN_PATH
|
||||
hardcode_runpath_var=yes
|
||||
ld_shlibs=yes
|
||||
fi
|
||||
;;
|
||||
|
||||
sysv4.2uw2*)
|
||||
archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
|
||||
hardcode_direct=yes
|
||||
hardcode_minus_L=no
|
||||
hardcode_shlibpath_var=no
|
||||
hardcode_runpath_var=yes
|
||||
runpath_var=LD_RUN_PATH
|
||||
;;
|
||||
|
||||
sysv5uw7* | unixware7*)
|
||||
no_undefined_flag='${wl}-z ${wl}text'
|
||||
if test "$GCC" = yes; then
|
||||
archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
|
||||
else
|
||||
archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
|
||||
fi
|
||||
runpath_var='LD_RUN_PATH'
|
||||
hardcode_shlibpath_var=no
|
||||
;;
|
||||
|
||||
*)
|
||||
ld_shlibs=no
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
## Compiler Characteristics: PIC flags, static flags, etc
|
||||
if test "X${ac_cv_prog_cc_pic+set}" = Xset; then
|
||||
:
|
||||
else
|
||||
ac_cv_prog_cc_pic=
|
||||
ac_cv_prog_cc_shlib=
|
||||
ac_cv_prog_cc_wl=
|
||||
ac_cv_prog_cc_static=
|
||||
ac_cv_prog_cc_no_builtin=
|
||||
ac_cv_prog_cc_can_build_shared=$can_build_shared
|
||||
|
||||
if test "$with_gcc" = yes; then
|
||||
ac_cv_prog_cc_wl='-Wl,'
|
||||
ac_cv_prog_cc_static='-static'
|
||||
|
||||
case $host_os in
|
||||
aix*)
|
||||
# All AIX code is PIC.
|
||||
if test "$host_cpu" = ia64; then
|
||||
# AIX 5 now supports IA64 processor
|
||||
lt_cv_prog_cc_static='-Bstatic'
|
||||
else
|
||||
lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp'
|
||||
fi
|
||||
;;
|
||||
amigaos*)
|
||||
# FIXME: we need at least 68020 code to build shared libraries, but
|
||||
# adding the `-m68020' flag to GCC prevents building anything better,
|
||||
# like `-m68040'.
|
||||
ac_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4'
|
||||
;;
|
||||
beos* | irix5* | irix6* | osf3* | osf4* | osf5*)
|
||||
# PIC is the default for these OSes.
|
||||
;;
|
||||
cygwin* | mingw* | os2*)
|
||||
# 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).
|
||||
ac_cv_prog_cc_pic='-DDLL_EXPORT'
|
||||
;;
|
||||
darwin* | rhapsody*)
|
||||
# PIC is the default on this platform
|
||||
# Common symbols not allowed in MH_DYLIB files
|
||||
ac_cv_prog_cc_pic='-fno-common'
|
||||
;;
|
||||
*djgpp*)
|
||||
# DJGPP does not support shared libraries at all
|
||||
ac_cv_prog_cc_pic=
|
||||
;;
|
||||
sysv4*MP*)
|
||||
if test -d /usr/nec; then
|
||||
ac_cv_prog_cc_pic=-Kconform_pic
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
ac_cv_prog_cc_pic='-fPIC'
|
||||
;;
|
||||
esac
|
||||
else
|
||||
# PORTME Check for PIC flags for the system compiler.
|
||||
case $host_os in
|
||||
aix*)
|
||||
# All AIX code is PIC.
|
||||
ac_cv_prog_cc_static="$ac_cv_prog_cc_static ${ac_cv_prog_cc_wl}-lC"
|
||||
;;
|
||||
|
||||
hpux9* | hpux10* | hpux11*)
|
||||
# Is there a better ac_cv_prog_cc_static that works with the bundled CC?
|
||||
ac_cv_prog_cc_wl='-Wl,'
|
||||
ac_cv_prog_cc_static="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
|
||||
ac_cv_prog_cc_pic='+Z'
|
||||
;;
|
||||
|
||||
irix5* | irix6*)
|
||||
ac_cv_prog_cc_wl='-Wl,'
|
||||
ac_cv_prog_cc_static='-non_shared'
|
||||
# PIC (with -KPIC) is the default.
|
||||
;;
|
||||
|
||||
cygwin* | mingw* | os2*)
|
||||
# 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).
|
||||
ac_cv_prog_cc_pic='-DDLL_EXPORT'
|
||||
;;
|
||||
|
||||
newsos6)
|
||||
ac_cv_prog_cc_pic='-KPIC'
|
||||
ac_cv_prog_cc_static='-Bstatic'
|
||||
;;
|
||||
|
||||
osf3* | osf4* | osf5*)
|
||||
# All OSF/1 code is PIC.
|
||||
ac_cv_prog_cc_wl='-Wl,'
|
||||
ac_cv_prog_cc_static='-non_shared'
|
||||
;;
|
||||
|
||||
sco3.2v5*)
|
||||
ac_cv_prog_cc_pic='-Kpic'
|
||||
ac_cv_prog_cc_static='-dn'
|
||||
ac_cv_prog_cc_shlib='-belf'
|
||||
;;
|
||||
|
||||
solaris*)
|
||||
ac_cv_prog_cc_pic='-KPIC'
|
||||
ac_cv_prog_cc_static='-Bstatic'
|
||||
ac_cv_prog_cc_wl='-Wl,'
|
||||
;;
|
||||
|
||||
sunos4*)
|
||||
ac_cv_prog_cc_pic='-PIC'
|
||||
ac_cv_prog_cc_static='-Bstatic'
|
||||
ac_cv_prog_cc_wl='-Qoption ld '
|
||||
;;
|
||||
|
||||
sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
|
||||
ac_cv_prog_cc_pic='-KPIC'
|
||||
ac_cv_prog_cc_static='-Bstatic'
|
||||
ac_cv_prog_cc_wl='-Wl,'
|
||||
;;
|
||||
|
||||
uts4*)
|
||||
ac_cv_prog_cc_pic='-pic'
|
||||
ac_cv_prog_cc_static='-Bstatic'
|
||||
;;
|
||||
|
||||
sysv4*MP*)
|
||||
if test -d /usr/nec ;then
|
||||
ac_cv_prog_cc_pic='-Kconform_pic'
|
||||
ac_cv_prog_cc_static='-Bstatic'
|
||||
fi
|
||||
;;
|
||||
|
||||
*)
|
||||
ac_cv_prog_cc_can_build_shared=no
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
case "$host_os" in
|
||||
# Platforms which do not suport PIC and -DPIC is meaningless
|
||||
# on them:
|
||||
*djgpp*)
|
||||
ac_cv_prog_cc_pic=
|
||||
;;
|
||||
*)
|
||||
ac_cv_prog_cc_pic="$ac_cv_prog_cc_pic -DPIC"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
need_lc=yes
|
||||
if test "$enable_shared" = yes && test "$with_gcc" = yes; then
|
||||
case $archive_cmds in
|
||||
*'~'*)
|
||||
# FIXME: we may have to deal with multi-command sequences.
|
||||
;;
|
||||
'$CC '*)
|
||||
# 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.
|
||||
echo $ac_n "checking whether -lc should be explicitly linked in... $ac_c" 1>&6
|
||||
if eval "test \"`echo '$''{'ac_cv_archive_cmds_needs_lc'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
need_lc=$ac_cv_archive_cmds_needs_lc
|
||||
else
|
||||
$rm conftest*
|
||||
echo "static int dummy;" > conftest.$ac_ext
|
||||
if { (eval echo ltcf-c.sh:need_lc: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; }; then
|
||||
# Append any warnings to the config.log.
|
||||
cat conftest.err 1>&5
|
||||
soname=conftest
|
||||
lib=conftest
|
||||
libobjs=conftest.$objext
|
||||
deplibs=
|
||||
wl=$ac_cv_prog_cc_wl
|
||||
compiler_flags=-v
|
||||
linker_flags=-v
|
||||
verstring=
|
||||
output_objdir=.
|
||||
libname=conftest
|
||||
save_allow_undefined_flag=$allow_undefined_flag
|
||||
allow_undefined_flag=
|
||||
if { (eval echo ltcf-c.sh:need_lc: \"$archive_cmds\") 1>&5; (eval $archive_cmds) 2>&1 | grep " -lc " 1>&5 ; }; then
|
||||
need_lc=no
|
||||
fi
|
||||
allow_undefined_flag=$save_allow_undefined_flag
|
||||
else
|
||||
cat conftest.err 1>&5
|
||||
fi
|
||||
fi
|
||||
$rm conftest*
|
||||
echo "$ac_t$need_lc" 1>&6
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
ac_cv_archive_cmds_needs_lc=$need_lc
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,700 +0,0 @@
|
|||
#### This script is meant to be sourced by ltconfig.
|
||||
|
||||
# ltcf-gcj.sh - Create a GCJ compiler specific configuration
|
||||
#
|
||||
# Copyright (C) 1996-1999, 2000, 2001, 2003 Free Software Foundation, Inc.
|
||||
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
|
||||
#
|
||||
# Original GCJ support by:
|
||||
# Alexandre Oliva <oliva@lsd.ic.unicamp.br>
|
||||
#
|
||||
# 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
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
|
||||
# Source file extension for Java test sources.
|
||||
ac_ext=java
|
||||
|
||||
# Object file extension for compiled Java test sources.
|
||||
objext=o
|
||||
|
||||
# Code to be used in simple compile tests
|
||||
lt_simple_compile_test_code="class foo {}"
|
||||
|
||||
# Code to be used in simple link tests
|
||||
lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }'
|
||||
|
||||
## Linker Characteristics
|
||||
case $host_os in
|
||||
cygwin* | mingw*)
|
||||
# FIXME: the MSVC++ port hasn't been tested in a loooong time
|
||||
# When not using gcc, we currently assume that we are using
|
||||
# Microsoft Visual C++.
|
||||
if test "$with_gcc" != yes; then
|
||||
with_gnu_ld=no
|
||||
fi
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
ld_shlibs=yes
|
||||
if test "$with_gnu_ld" = yes; then
|
||||
# If archive_cmds runs LD, not CC, wlarc should be empty
|
||||
wlarc='${wl}'
|
||||
|
||||
# See if GNU ld supports shared libraries.
|
||||
case $host_os in
|
||||
aix3* | aix4* | aix5*)
|
||||
# On AIX/PPC, the GNU linker is very broken
|
||||
if test "$host_cpu" != ia64; then
|
||||
ld_shlibs=no
|
||||
cat <<EOF 1>&2
|
||||
|
||||
*** Warning: the GNU linker, at least up to release 2.9.1, 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.
|
||||
|
||||
EOF
|
||||
fi
|
||||
;;
|
||||
|
||||
amigaos*)
|
||||
archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_minus_L=yes
|
||||
|
||||
# Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
|
||||
# that the semantics of dynamic libraries on AmigaOS, at least up
|
||||
# to version 4, is to share data among multiple programs linked
|
||||
# with the same dynamic library. Since this doesn't match the
|
||||
# behavior of shared libraries on other platforms, we can use
|
||||
# them.
|
||||
ld_shlibs=no
|
||||
;;
|
||||
|
||||
beos*)
|
||||
if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
|
||||
allow_undefined_flag=unsupported
|
||||
# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
|
||||
# support --undefined. This deserves some investigation. FIXME
|
||||
archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
|
||||
else
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
|
||||
cygwin* | mingw*)
|
||||
# hardcode_libdir_flag_spec is actually meaningless, as there is
|
||||
# no search path for DLLs.
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
allow_undefined_flag=unsupported
|
||||
always_export_symbols=yes
|
||||
|
||||
extract_expsyms_cmds='test -f $output_objdir/impgen.c || \
|
||||
sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //; p; }" -e d < $0 > $output_objdir/impgen.c~
|
||||
test -f $output_objdir/impgen.exe || (cd $output_objdir && \
|
||||
if test "x$BUILD_CC" != "x" ; then $BUILD_CC -o impgen impgen.c ; \
|
||||
else $CC -o impgen impgen.c ; fi)~
|
||||
$output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def'
|
||||
|
||||
old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib'
|
||||
|
||||
# cygwin and mingw dlls have different entry points and sets of symbols
|
||||
# to exclude.
|
||||
# FIXME: what about values for MSVC?
|
||||
dll_entry=__cygwin_dll_entry@12
|
||||
dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~
|
||||
case $host_os in
|
||||
mingw*)
|
||||
# mingw values
|
||||
dll_entry=_DllMainCRTStartup@12
|
||||
dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~
|
||||
;;
|
||||
esac
|
||||
|
||||
# mingw and cygwin differ, and it's simplest to just exclude the union
|
||||
# of the two symbol sets.
|
||||
dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12
|
||||
|
||||
# recent cygwin and mingw systems supply a stub DllMain which the user
|
||||
# can override, but on older systems we have to supply one (in ltdll.c)
|
||||
if test "x$lt_cv_need_dllmain" = "xyes"; then
|
||||
ltdll_obj='$output_objdir/$soname-ltdll.'"$objext "
|
||||
ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $output_objdir/$soname-ltdll.c~
|
||||
test -f $output_objdir/$soname-ltdll.$objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~'
|
||||
else
|
||||
ltdll_obj=
|
||||
ltdll_cmds=
|
||||
fi
|
||||
|
||||
# Extract the symbol export list from an `--export-all' def file,
|
||||
# then regenerate the def file from the symbol export list, so that
|
||||
# the compiled dll only exports the symbol export list.
|
||||
# Be careful not to strip the DATA tag left be newer dlltools.
|
||||
export_symbols_cmds="$ltdll_cmds"'
|
||||
$DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~
|
||||
sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols'
|
||||
|
||||
# If the export-symbols file already is a .def file (1st line
|
||||
# is EXPORTS), use it as is.
|
||||
# If DATA tags from a recent dlltool are present, honour them!
|
||||
archive_expsym_cmds='if test "x`head -1 $export_symbols`" = xEXPORTS; then
|
||||
cp $export_symbols $output_objdir/$soname-def;
|
||||
else
|
||||
echo EXPORTS > $output_objdir/$soname-def;
|
||||
_lt_hint=1;
|
||||
cat $export_symbols | while read symbol; do
|
||||
set dummy \$symbol;
|
||||
case \[$]# in
|
||||
2) echo " \[$]2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;;
|
||||
*) echo " \[$]2 @ \$_lt_hint \[$]3 ; " >> $output_objdir/$soname-def;;
|
||||
esac;
|
||||
_lt_hint=`expr 1 + \$_lt_hint`;
|
||||
done;
|
||||
fi~
|
||||
'"$ltdll_cmds"'
|
||||
$CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
|
||||
$DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~
|
||||
$CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
|
||||
$DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp --output-lib $output_objdir/$libname.dll.a~
|
||||
$CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags'
|
||||
;;
|
||||
|
||||
netbsd* | knetbsd*-gnu)
|
||||
if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
|
||||
archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
|
||||
wlarc=
|
||||
else
|
||||
archive_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
|
||||
archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
|
||||
fi
|
||||
;;
|
||||
|
||||
solaris* | sysv5*)
|
||||
if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
|
||||
ld_shlibs=no
|
||||
cat <<EOF 1>&2
|
||||
|
||||
*** Warning: The releases 2.8.* of the GNU linker cannot reliably
|
||||
*** create shared libraries on Solaris systems. Therefore, libtool
|
||||
*** is disabling shared libraries support. We urge you to upgrade GNU
|
||||
*** binutils to release 2.9.1 or newer. Another option is to modify
|
||||
*** your PATH or compiler configuration so that the native linker is
|
||||
*** used, and then restart.
|
||||
|
||||
EOF
|
||||
elif $LD --help 2>&1 | egrep ': 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'
|
||||
else
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
|
||||
sunos4*)
|
||||
archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
|
||||
wlarc=
|
||||
hardcode_direct=yes
|
||||
hardcode_shlibpath_var=no
|
||||
;;
|
||||
|
||||
*)
|
||||
if $LD --help 2>&1 | egrep ': 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'
|
||||
else
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if test "$ld_shlibs" = yes; then
|
||||
runpath_var=LD_RUN_PATH
|
||||
hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
|
||||
export_dynamic_flag_spec='${wl}--export-dynamic'
|
||||
case $host_os in
|
||||
cygwin* | mingw*)
|
||||
# dlltool doesn't understand --whole-archive et. al.
|
||||
whole_archive_flag_spec=
|
||||
;;
|
||||
*)
|
||||
# ancient GNU ld didn't support --whole-archive et. al.
|
||||
if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then
|
||||
whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
|
||||
else
|
||||
whole_archive_flag_spec=
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
else
|
||||
# PORTME fill in a description of your system's linker (not GNU ld)
|
||||
case $host_os in
|
||||
aix3*)
|
||||
allow_undefined_flag=unsupported
|
||||
always_export_symbols=yes
|
||||
archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
|
||||
# Note: this linker hardcodes the directories in LIBPATH if there
|
||||
# are no directories specified by -L.
|
||||
hardcode_minus_L=yes
|
||||
if test "$with_gcc" = yes && test -z "$link_static_flag"; then
|
||||
# Neither direct hardcoding nor static linking is supported with a
|
||||
# broken collect2.
|
||||
hardcode_direct=unsupported
|
||||
fi
|
||||
;;
|
||||
|
||||
aix4* | aix5*)
|
||||
hardcode_direct=yes
|
||||
hardcode_libdir_separator=':'
|
||||
link_all_deplibs=yes
|
||||
# When large executables or shared objects are built, AIX ld can
|
||||
# have problems creating the table of contents. If linking a library
|
||||
# or program results in "error TOC overflow" add -mminimal-toc to
|
||||
# CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
|
||||
# enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
|
||||
if test "$with_gcc" = yes; then
|
||||
case $host_os in aix4.[012]|aix4.[012].*)
|
||||
# We only want to do this on AIX 4.2 and lower, the check
|
||||
# below for broken collect2 doesn't work under 4.3+
|
||||
collect2name=`${CC} -print-prog-name=collect2`
|
||||
if test -f "$collect2name" && \
|
||||
strings "$collect2name" | grep resolve_lib_name >/dev/null
|
||||
then
|
||||
# We have reworked collect2
|
||||
hardcode_direct=yes
|
||||
else
|
||||
# We have old collect2
|
||||
hardcode_direct=unsupported
|
||||
# It fails to find uninstalled libraries when the uninstalled
|
||||
# path is not listed in the libpath. Setting hardcode_minus_L
|
||||
# to unsupported forces relinking
|
||||
hardcode_minus_L=yes
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_libdir_separator=
|
||||
fi
|
||||
esac
|
||||
shared_flag='-shared'
|
||||
else
|
||||
# not using gcc
|
||||
if test "$host_cpu" = ia64; then
|
||||
shared_flag='${wl}-G'
|
||||
else
|
||||
shared_flag='${wl}-bM:SRE'
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$host_cpu" = ia64; then
|
||||
# On IA64, the linker does run time linking by default, so we don't
|
||||
# have to do anything special.
|
||||
aix_use_runtimelinking=no
|
||||
if test $with_gnu_ld = no; then
|
||||
exp_sym_flag='-Bexport'
|
||||
no_entry_flag=""
|
||||
fi
|
||||
else
|
||||
# Test if we are trying to use run time linking, or normal AIX style linking.
|
||||
# If -brtl is somewhere in LDFLAGS, we need to do run time linking.
|
||||
aix_use_runtimelinking=no
|
||||
for ld_flag in $LDFLAGS; do
|
||||
if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl" ); then
|
||||
aix_use_runtimelinking=yes
|
||||
break
|
||||
fi
|
||||
done
|
||||
exp_sym_flag='-bexport'
|
||||
no_entry_flag='-bnoentry'
|
||||
fi
|
||||
# -bexpall does not export symbols beginning with underscore (_)
|
||||
always_export_symbols=yes
|
||||
if test "$aix_use_runtimelinking" = yes; then
|
||||
# Warning - without using the other run time loading flags (-brtl), -berok will
|
||||
# link without error, but may produce a broken library.
|
||||
allow_undefined_flag=' ${wl}-berok'
|
||||
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
|
||||
archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
|
||||
else
|
||||
if test "$host_cpu" = ia64; then
|
||||
if test $with_gnu_ld = no; then
|
||||
hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
|
||||
allow_undefined_flag="-z nodefs"
|
||||
archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
|
||||
fi
|
||||
else
|
||||
allow_undefined_flag=' ${wl}-berok'
|
||||
# -bexpall does not export symbols beginning with underscore (_)
|
||||
always_export_symbols=yes
|
||||
# Exported symbols can be pulled into shared objects from archives
|
||||
whole_archive_flag_spec=' '
|
||||
build_libtool_need_lc=yes
|
||||
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
|
||||
# This is similar to how AIX traditionally builds it's shared libraries.
|
||||
archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
|
||||
amigaos*)
|
||||
archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_minus_L=yes
|
||||
# see comment about different semantics on the GNU ld section
|
||||
ld_shlibs=no
|
||||
;;
|
||||
|
||||
cygwin* | mingw*)
|
||||
# When not using gcc, we currently assume that we are using
|
||||
# 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
|
||||
# FIXME: Setting linknames here is a bad hack.
|
||||
archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -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"`'
|
||||
;;
|
||||
|
||||
darwin* | rhapsody*)
|
||||
case "$host_os" in
|
||||
rhapsody* | darwin1.[[012]])
|
||||
allow_undefined_flag='-undefined suppress'
|
||||
;;
|
||||
*) # Darwin 1.3 on
|
||||
if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
|
||||
allow_undefined_flag='-flat_namespace -undefined suppress'
|
||||
else
|
||||
case ${MACOSX_DEPLOYMENT_TARGET} in
|
||||
10.[[012]])
|
||||
allow_undefined_flag='-flat_namespace -undefined suppress'
|
||||
;;
|
||||
10.*)
|
||||
allow_undefined_flag='-undefined dynamic_lookup'
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
# Disable shared library build on OS-X older than 10.3.
|
||||
case $host_os in
|
||||
darwin[1-6]*)
|
||||
can_build_shared=no
|
||||
;;
|
||||
darwin7*)
|
||||
can_build_shared=yes
|
||||
;;
|
||||
esac
|
||||
output_verbose_link_cmd='echo'
|
||||
archive_cmds='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
|
||||
module_cmds='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
|
||||
# Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
|
||||
archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
|
||||
module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
|
||||
hardcode_direct=no
|
||||
hardcode_automatic=yes
|
||||
hardcode_shlibpath_var=unsupported
|
||||
whole_archive_flag_spec='-all_load $convenience'
|
||||
link_all_deplibs=yes
|
||||
;;
|
||||
|
||||
|
||||
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
|
||||
# extra space).
|
||||
freebsd2.2*)
|
||||
archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
|
||||
hardcode_libdir_flag_spec='-R$libdir'
|
||||
hardcode_direct=yes
|
||||
hardcode_shlibpath_var=no
|
||||
;;
|
||||
|
||||
# Unfortunately, older versions of FreeBSD 2 do not have this feature.
|
||||
freebsd2*)
|
||||
archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
|
||||
hardcode_direct=yes
|
||||
hardcode_minus_L=yes
|
||||
hardcode_shlibpath_var=no
|
||||
;;
|
||||
|
||||
# FreeBSD 3 and greater uses gcc -shared to do shared libraries.
|
||||
freebsd* | kfreebsd*-gnu)
|
||||
archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
|
||||
hardcode_libdir_flag_spec='-R$libdir'
|
||||
hardcode_direct=yes
|
||||
hardcode_shlibpath_var=no
|
||||
;;
|
||||
|
||||
hpux9* | hpux10* | hpux11*)
|
||||
case $host_os in
|
||||
hpux9*) archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;;
|
||||
*) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;;
|
||||
esac
|
||||
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
|
||||
hardcode_libdir_separator=:
|
||||
hardcode_direct=yes
|
||||
hardcode_minus_L=yes # Not in the search PATH, but as the default
|
||||
# location of the library.
|
||||
export_dynamic_flag_spec='${wl}-E'
|
||||
;;
|
||||
|
||||
irix5* | irix6*)
|
||||
if test "$with_gcc" = yes; then
|
||||
archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
|
||||
else
|
||||
archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
|
||||
fi
|
||||
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
|
||||
hardcode_libdir_separator=:
|
||||
link_all_deplibs=yes
|
||||
;;
|
||||
|
||||
netbsd* | knetbsd*-gnu)
|
||||
if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
|
||||
archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
|
||||
else
|
||||
archive_cmds='$LD -shared -nodefaultlibs -o $lib $libobjs $deplibs $linker_flags' # ELF
|
||||
fi
|
||||
hardcode_libdir_flag_spec='${wl}-R$libdir'
|
||||
hardcode_direct=yes
|
||||
hardcode_shlibpath_var=no
|
||||
;;
|
||||
|
||||
openbsd*)
|
||||
archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
|
||||
hardcode_libdir_flag_spec='-R$libdir'
|
||||
hardcode_direct=yes
|
||||
hardcode_shlibpath_var=no
|
||||
;;
|
||||
|
||||
os2*)
|
||||
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'
|
||||
old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
|
||||
;;
|
||||
|
||||
osf3*)
|
||||
if test "$with_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 ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
|
||||
else
|
||||
allow_undefined_flag=' -expect_unresolved \*'
|
||||
archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
|
||||
fi
|
||||
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
|
||||
hardcode_libdir_separator=:
|
||||
;;
|
||||
|
||||
osf4* | osf5*) # as osf3* with the addition of -msym flag
|
||||
if test "$with_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 ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
|
||||
else
|
||||
allow_undefined_flag=' -expect_unresolved \*'
|
||||
archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
|
||||
fi
|
||||
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
|
||||
hardcode_libdir_separator=:
|
||||
;;
|
||||
|
||||
sco3.2v5*)
|
||||
archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
|
||||
hardcode_shlibpath_var=no
|
||||
runpath_var=LD_RUN_PATH
|
||||
hardcode_runpath_var=yes
|
||||
;;
|
||||
|
||||
solaris*)
|
||||
no_undefined_flag=' ${wl}-z ${wl}defs'
|
||||
archive_cmds='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
|
||||
archive_expsym_cmds='$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'
|
||||
|
||||
# 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_cmds="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep \"\-L\""
|
||||
|
||||
hardcode_libdir_flag_spec='${wl}-R $wl$libdir'
|
||||
hardcode_shlibpath_var=no
|
||||
case $host_os in
|
||||
solaris2.[0-5] | solaris2.[0-5].*) ;;
|
||||
*) # Supported since Solaris 2.6 (maybe 2.5.1?)
|
||||
whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;;
|
||||
esac
|
||||
link_all_deplibs=yes
|
||||
;;
|
||||
|
||||
sunos4*)
|
||||
archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_direct=yes
|
||||
hardcode_minus_L=yes
|
||||
hardcode_shlibpath_var=no
|
||||
;;
|
||||
|
||||
sysv4)
|
||||
archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
|
||||
runpath_var='LD_RUN_PATH'
|
||||
hardcode_shlibpath_var=no
|
||||
hardcode_direct=no #Motorola manual says yes, but my tests say they lie
|
||||
;;
|
||||
|
||||
sysv4.3*)
|
||||
archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
|
||||
hardcode_shlibpath_var=no
|
||||
export_dynamic_flag_spec='-Bexport'
|
||||
;;
|
||||
|
||||
sysv5*)
|
||||
no_undefined_flag=' -z text'
|
||||
# $CC -shared without GNU ld will not create a library from C++
|
||||
# object files and a static libstdc++, better avoid it by now
|
||||
archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
|
||||
archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
|
||||
$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
|
||||
hardcode_libdir_flag_spec=
|
||||
hardcode_shlibpath_var=no
|
||||
runpath_var='LD_RUN_PATH'
|
||||
;;
|
||||
|
||||
uts4*)
|
||||
archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_shlibpath_var=no
|
||||
;;
|
||||
|
||||
dgux*)
|
||||
archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_shlibpath_var=no
|
||||
;;
|
||||
|
||||
sysv4*MP*)
|
||||
if test -d /usr/nec; then
|
||||
archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
|
||||
hardcode_shlibpath_var=no
|
||||
runpath_var=LD_RUN_PATH
|
||||
hardcode_runpath_var=yes
|
||||
ld_shlibs=yes
|
||||
fi
|
||||
;;
|
||||
|
||||
sysv4.2uw2*)
|
||||
archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
|
||||
hardcode_direct=yes
|
||||
hardcode_minus_L=no
|
||||
hardcode_shlibpath_var=no
|
||||
hardcode_runpath_var=yes
|
||||
runpath_var=LD_RUN_PATH
|
||||
;;
|
||||
|
||||
sysv5uw7* | unixware7*)
|
||||
no_undefined_flag='${wl}-z ${wl}text'
|
||||
if test "$GCC" = yes; then
|
||||
archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
|
||||
else
|
||||
archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
|
||||
fi
|
||||
runpath_var='LD_RUN_PATH'
|
||||
hardcode_shlibpath_var=no
|
||||
;;
|
||||
|
||||
*)
|
||||
ld_shlibs=no
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
## Compiler Characteristics: PIC flags, static flags, etc
|
||||
|
||||
# We don't use cached values here since only the C compiler
|
||||
# characteristics should be cached.
|
||||
ac_cv_prog_cc_pic=
|
||||
ac_cv_prog_cc_shlib=
|
||||
ac_cv_prog_cc_wl=
|
||||
ac_cv_prog_cc_static=
|
||||
ac_cv_prog_cc_no_builtin=
|
||||
ac_cv_prog_cc_can_build_shared=$can_build_shared
|
||||
|
||||
ac_cv_prog_cc_wl='-Wl,'
|
||||
ac_cv_prog_cc_static='-static'
|
||||
|
||||
case $host_os in
|
||||
beos* | irix5* | irix6* | osf3* | osf4* | osf5*)
|
||||
# PIC is the default for these OSes.
|
||||
;;
|
||||
aix*)
|
||||
# Below there is a dirty hack to force normal static linking with -ldl
|
||||
# The problem is because libdl dynamically linked with both libc and
|
||||
# libC (AIX C++ library), which obviously doesn't included in libraries
|
||||
# list by gcc. This cause undefined symbols with -static flags.
|
||||
# This hack allows C programs to be linked with "-static -ldl", but
|
||||
# we not sure about C++ programs.
|
||||
ac_cv_prog_cc_static="$ac_cv_prog_cc_static ${ac_cv_prog_cc_wl}-lC"
|
||||
;;
|
||||
*djgpp*)
|
||||
# DJGPP does not suppot shared libraries at all
|
||||
ac_cv_prog_cc_pic=
|
||||
;;
|
||||
cygwin* | mingw* | os2*)
|
||||
# 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).
|
||||
ac_cv_prog_cc_pic='-DDLL_EXPORT'
|
||||
;;
|
||||
|
||||
darwin* | rhapsody*)
|
||||
# PIC is the default on this platform
|
||||
# Common symbols not allowed in MH_DYLIB files
|
||||
ac_cv_prog_cc_pic='-fno-common'
|
||||
;;
|
||||
amigaos*)
|
||||
# FIXME: we need at least 68020 code to build shared libraries, but
|
||||
# adding the `-m68020' flag to GCC prevents building anything better,
|
||||
# like `-m68040'.
|
||||
ac_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4'
|
||||
;;
|
||||
sysv4*MP*)
|
||||
if test -d /usr/nec; then
|
||||
ac_cv_prog_cc_pic=-Kconform_pic
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
ac_cv_prog_cc_pic='-fPIC'
|
||||
;;
|
||||
esac
|
||||
|
||||
# GCJ did not exist at the time GCC didn't implicitly link libc in.
|
||||
need_lc=no
|
||||
|
||||
# All existing releases of GCJ support `-c -o'.
|
||||
lt_cv_compiler_c_o=yes
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче