Menu

compiling statically

Help
Anonymous
2002-02-14
2012-09-19
  • Anonymous

    Anonymous - 2002-02-14

    how do I do it?
    I added the static lib to the "extra_objects" but it still compiles dynamically. heres are relevent lines setup.py:

    include_dirs = ['/usr/local/mysql/include/mysql']
    library_dirs = ['/usr/local/mysql/lib/mysql]
    libraries = [mysqlclient, "z"]
    runtime_library_dirs = []
    extra_objects = ['/usr/local/mysql/lib/mysql/libmysqlclient.a']

    it finds everything (including the libmysqlclient.a) but still compiles with the so.
    yes, my mysql installation is pretty screwed up with the whole mysql/lib/mysql thing, but that shouldnt matter.

    it calls gcc like this:
    gcc -shared build/temp.linux-i686-2.2/_mysql.o /usr/local/mysql/lib/mysql/libmysqlclient.a -L/usr/local/mysql/lib/mysql -lmysqlclient -lz -o build/lib.linux-i686-2.2/_mysql.so

    please help..
    thanks,
    Konrad Rokicki

     
    • Kevin Light

      Kevin Light - 2002-02-18

      It seems that you can get a static link by removing all of the dynamic libs from the /lib/mysql directory. 
      1. Start by making a back-up copy of your lib/mysql directory (such as lib/mysql-save) and then deleting all of the .so, .10, and .0 files from the lib/mysql directory. 
      2. Build your MySQLdb python connector. 
      3. Copy the lib/mysql-save files back to the lib/mysql directory.

      If you don't replace the dynamic libs, mysql or other dependant apps might not start(depending on how they're built).  Cheezy hack, but it appears to  work for me.

      The layout you're describing is how the ApacheToolBox builder configures the whole set of tools(at least with the options *I* chose).

      HTH
      Kevin

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.