Menu

Build error 1.1.8 on OpenBSD 3.6 (+solution)

Help
2005-01-10
2012-09-19
  • Edwin Steele

    Edwin Steele - 2005-01-10

    I've just grabbed mysqldb-python 1.1.8 and following the instructions in the README to build it on OpenBSD 3.6, there's a problem because OpenBSD has libcrypto instead of libcrypt:

    $ tar xfz MySQL-python-1.1.8.tar.gz
    $ cd MySQL-python-1.1.8
    $ export mysqlversion="4.0.20"
    $ export mysqlclient="mysqlclient_r"
    $ export mysqloptlibs="ssl crypto"
    $ python setup.py build
    running build
    running build_py
    creating build
    creating build/lib.openbsd-3.6-i386-2.3
    (lots of copying and creating messages)
    running build_ext
    building '_mysql' extension
    creating build/temp.openbsd-3.6-i386-2.3
    cc -pthread -fno-strict-aliasing -DNDEBUG -O2 -pipe -DTHREAD_STACK_SIZE=0x100000 -fPIC -fPIC -I/usr/local/include/mysql -I/usr/local/include/python2.3 -c _mysql.c -o build/temp.openbsd-3.6-i386-2.3/_mysql.o
    cc -pthread -shared -fPIC -L/usr/obj/i386/python-2.3.4/Python-2.3.4 build/temp.openbsd-3.6-i386-2.3/_mysql.o -L/usr/local/lib/mysql -lmysqlclient_r -lssl -lcrypto -lz -lcrypt -o build/lib.openbsd-3.6-i386-2.3/_mysql.so
    /usr/bin/ld: cannot find -lcrypt
    collect2: ld returned 1 exit status
    error: command 'cc' failed with exit status 1

    If I change setup.py around line 43 so that there is libraries.append("crypto") instead of libraries.append("crypt"), then it works fine.

    I figured that someone might want to know about this, small as it is.

    Cheers,
    Edwin.

     
    • Andy Dustman

      Andy Dustman - 2005-01-10

      The main reason mysqloptlibs exists is it hard to detect (in a cross-platform way) whether or not the MySQL libraries are built with SSL support or not. If they are, you need to link against libssl and libcrypto. libcrypt is the UNIX passwd crypt, which is a separate library on Linux, but is often in libc on other platforms, and not used on Windows at all.

      Interestingly enough, on my Gentoo Linux box, even though the MySQL libraries have SSL support, it is NOT necessary to add ssl and crypto to mysqloptlibs; they seem to be found anyway.

      What I should probably do is remove crypt from the standard list of libraries, and only add it if compiling on Linux. Currently I have it by default (if you have MySQL-4.0 or newer) and remove it on some platforms.

       

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.