Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't work with XCode 5 due to missing /usr/bin/libtool #125

Open
markltownsend opened this issue Jun 12, 2013 · 8 comments
Open

Doesn't work with XCode 5 due to missing /usr/bin/libtool #125

markltownsend opened this issue Jun 12, 2013 · 8 comments

Comments

@markltownsend
Copy link
Contributor

Tried a project that I am working on that this code. The scripts no longer work in XCode 5 because 'libtool' doesn't exist in ../Contents/Developer/usr/bin any longer..

@kstenerud
Copy link
Owner

It looks like command line tools don't get installed with Xcode 5. Can you try out this guy's solution?

http://nathancahill.github.io/installing-homebrew-on-mac-osx-mavericks/

@markltownsend
Copy link
Contributor Author

The command line tools are installed, they are just done automatically and some tools are just installed in a different directory than what was in previous version of Xcode.

I was able to change the TemplateInfo.plist to point to the right directory for libtool.
$DT_TOOLCHAIN_DIR/usr/bin/libtool

I can provide a patch if you would like. Probably would need an if statement checking the Xcode version, but I haven't done that yet.

@dvmrmc
Copy link

dvmrmc commented Sep 19, 2013

i'm having the same issue, tried @kstenerud solution but Command Line toools is not installing libtool. @markltownsend TemplateInfo.plist already have that, but the problem is, Where the hell did libtool went?

@djschwartz
Copy link

I had this very problem with the Fake Framework. I found a quick fix that probably isn't the best or most complete solution, but it worked.

In Build Phases tab of project settings there are a couple "Run Script" items at the end. Look into one of those to find this chunk of code:

# Build the fat static library binary

echo "Create universal static library"

echo "$PLATFORM_DEVELOPER_BIN_DIR/libtool" -static "${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}" "${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}" -o "${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}.temp"
"$PLATFORM_DEVELOPER_BIN_DIR/libtool" -static "${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}" "${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}" -o "${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}.temp"

I replaced that with the following:

# Build the fat static library binary

echo "Create universal static library"

if [[ "$XCODE_VERSION_MAJOR" = "0500" ]]
then
    echo "$DT_TOOLCHAIN_DIR/usr/bin/libtool" -static "${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}" "${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}" -o "${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}.temp"
    "$DT_TOOLCHAIN_DIR/usr/bin/libtool" -static "${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}" "${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}" -o "${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}.temp"
else
    echo "$PLATFORM_DEVELOPER_BIN_DIR/libtool" -static "${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}" "${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}" -o "${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}.temp"
    "$PLATFORM_DEVELOPER_BIN_DIR/libtool" -static "${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}" "${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}" -o "${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}.temp"
fi 

That code came directory from https://github.com/kstenerud/iOS-Universal-Framework/blob/master/Fake%20Framework/Templates/Framework%20%26%20Library/Fake%20Static%20iOS%20Framework.xctemplate/TemplateInfo.plist

It would probably be wise to update more than just that little chunk of code, but this is what I had time for. I'll try to get a more complete update later.

@LittleLaa
Copy link

@djschwartz

This work for me. Thx

@priore
Copy link

priore commented Jun 20, 2014

This work form me in Xcode 5.1.1.

thanks!

@nrbrook
Copy link

nrbrook commented Aug 3, 2014

This issue occurs in Xcode 6 beta, the if statement needs to be

if [[ "$XCODE_VERSION_MAJOR" = "0500" || "$XCODE_VERSION_MAJOR" = "0600" ]]

however, Xcode 6 supports cocoa touch frameworks natively.

@loretoparisi
Copy link

Having a similar issue on XCode 6 (now Gold Master) due to iphone simulator folder (I guess) for the same script:
#197

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants