Altering the default library search path

Discussion in 'Mac Programming' started by Westside guy, Jul 11, 2006.

  1. macrumors 601

    Westside guy

    Joined:
    Oct 15, 2003
    Location:
    The soggy part of the Pacific NW
    #1
    I would like to append the fink library directory /sw/lib to the list of directories that are searched automatically when I am trying to build an app (openvpn in this particular instance) from the command line. As it stands, I have to remember to set a couple variables:

    CPPFLAGS="-I/sw/include" LDFLAGS="-L/sw/lib" ./configure

    because otherwise the library (in this case the LZO libraries) isn't found.

    This should be simple - I know how to do it in Linux - but I can't seem to find the information for OS X; so I'd appreciate any guidance.

    (In case anyone is wondering why I'm bothering, when there are packages available - I want to try out the latest beta.)

    Thanks for your help!
     
  2. Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    Set the variables in your .profile. Just like you could in Linux.
     
  3. thread starter macrumors 601

    Westside guy

    Joined:
    Oct 15, 2003
    Location:
    The soggy part of the Pacific NW
    #3
    Thanks for the reply.

    I can do what you suggest - but I was hoping to actually modify the default library search path. Under a lot of Linuxes (Linices?) you can add an entry in /etc/ld.so.conf or /etc/ld.so.conf.d/ so the additional directory/directories will be searched by default.

    The main issue with just setting those variables is you have to remember you've set them - otherwise if you have to make different additions or changes for building another app, you lose your libraries again.
     

Share This Page