I haven’t found any article explaining this.
With Xcode, I simply have to call libtool -o libout.a libinput1.a ...
So I think it should work the same.
Obviously the zlib symbols conflict with my own version of zlib.
So, it figures, GNU libtool and Xcode libtool are 2 completely different tools. Functionality-wise at least. This made the idea of repacking the libs for Android slightly more complicated.
Last solution was to just unpack the lib files (.a files are just archives packed with a tool called `ar`).
```createRemixProjects(os.matchfiles(path.join(proj_root, "debug", "path", "*.a")),
{ "android-arm", "Debug"},{
"AR=" .. premake.gcc.ar .. " " ..
relPath(path.join(script, "remove_zlib_gnu.sh")) ..
" $(TARGET) "
})
```
createRemixProjects just looks like this:
```
function createRemixProjects(libs, cfgterms, cmds)
for _, a in ipairs(libs) do
createRemixProject(a, cfgterms, cmds)
end
end
```
function createRemixProject(libfile, cfgterms, cmds)
local finishCmd = function(cmd) return cmd .. " " .. relPath(libfile) end
project (createRemixProjectName(libfile))
kind "StaticLib"
language "C"
files { "stub.c" }
configuration{ cfgterms }
-- cont'd below..
table.translate(cmds, finishCmd)
}
configuration{}
end
```
```
OUTPUT=$1
INPUT=$2
cp -fv $INPUT $OUTPUT
${AR} t $OUTPUT | grep adler32
${AR} dv $OUTPUT $zlib_objects
```
```
for arch in `lipo -archs $INPUT`
do
ARCHLIB=${INPUT_BASENAME}_$arch.${INPUT_EXTENSION}
archlibs="$archlibs $ARCHLIB"
lipo -thin $arch $INPUT -output $ARCHLIB
ar -d $ARCHLIB $zlib_objects
done
```
This whole build process works pretty neatly, it's fast, and it doesn't fail if the symbols can't be found.
Next time I'll write how I use lib.exe to do the same with MSVC.