I used to use imagemagick back in the day...
I remember using PaintShopPro 5 to come up with an optimized palette and then manually applying it to each image (frame) before combining them together.
I think I've also used ffmpeg in a way similar to imagemagick by feeding it a series of images.
The whole process was tedious as hell. I think I have my workflow on an old computer somewhere.
Here's some of my handiwork. I made a lot of versions of the last one because I was trying different techniques to get the file size down.
To make these, I had to decompile SWF animations and remove the elements that I didn't want in my animated GIF. I fed the new SWF through a tool (can't remember the name) that converted it into a series of bitmaps. I used imagemagic to resize and crop the bitmaps. I then spent a lot of time fiddling with various palette optimizations before combining the images together into an animated GIF.
GroovyMAME support forum on BYOAC