Compiling Linux app source code on FBSD - BSD

This is a discussion on Compiling Linux app source code on FBSD - BSD ; I've been struggling trying to compile Advanced Stock Tracker (ast-0.3.0_pre1) on 7.1-prerelease. It appears to be a linux-centric application as the compile was failing with "/usr/bin/ld: can't find - ldl" errors. I think I've got that fixed by just removing ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Compiling Linux app source code on FBSD

  1. Compiling Linux app source code on FBSD

    I've been struggling trying to compile Advanced Stock Tracker
    (ast-0.3.0_pre1) on 7.1-prerelease. It appears to be a linux-centric
    application as the compile was failing with "/usr/bin/ld: can't find -
    ldl" errors. I think I've got that fixed by just removing all
    instances of -ldl from the various Makefiles after running configure.

    The build seems to get a little further but then fails with "/usr/bin/
    ld: cannot find -lta_func". I could repeat the Makefile deletion
    process but I don't know if *this* ta_func is a Linux thing or not. I
    have devel/ta-lib installed and have symlinked its directory in /usr/
    local/include to /usr/local and /usr/include. I've even symlinked
    ta_func.h to a place that is successfully seen by the config script
    but it's a no-go.

    These sorts of failures could go on forever. I've emailed the
    developer but might there be a way to get configure to look at BSD
    file locations and not just Linux locations? configure is over 28k
    lines and I'm not a programmer but there must be a 'look here too!'
    entry I can make somewhere.

    thanks,

    tf

  2. Re: Compiling Linux app source code on FBSD

    On Sun, 19 Oct 2008 11:54:02 -0700 (PDT), thefronny@gmail.com wrote:
    > I've been struggling trying to compile Advanced Stock Tracker
    > (ast-0.3.0_pre1) on 7.1-prerelease. It appears to be a linux-centric
    > application as the compile was failing with "/usr/bin/ld: can't find -
    > ldl" errors. I think I've got that fixed by just removing all
    > instances of -ldl from the various Makefiles after running configure.


    Unportable makefiles. FreeBSD doesn't need -ldl.

    There is a better way to link with -ldl or other system-specific
    libraries that provide dlopen() support.

    1) In the toplevel `configure.in' or `configure.ac' script add the
    following checks somewhere after `AC_PROG_CC':

    if test "x$RANLIB" = x; then
    AC_PROG_RANLIB
    fi
    AC_LIBTOOL_DLOPEN
    AC_PROG_LIBTOOL

    2) In the toplevel `configure.in' or `configure.ac' script add the
    following checks for -ldl support libraries:

    save_LIBS="${LIBS}"
    LIBS=""
    AC_CHECK_LIB(dl, dlopen)
    DL_LIBS="${LIBS}"
    LIBS="${save_LIBS}"
    AC_SUBST(DL_LIBS)

    3) In the `Makefile.am' file of the components that need to be
    dlopen'ed (if you are writing the dlopen-based modules yourself),
    make sure that `xxxxx_la_LDFLAGS' includes:

    ## Allow symbols to be resolved dynamically with dlopen()
    xxxxx_la_LDFLAGS = -export-dynamic

    4) In the `Makefile.am' file of the component that *calls* dlopen() to
    load more modules (let's call it `yyyyyy' to separate it from the
    dynamically loadable module `xxxxxx'), add the `xxxxxx.la' file to
    the `yyyyyy_LIBS' options of the `yyyyyy' module:

    yyyyyy_LIBS = \
    -dlopen $(top_builddir)/path/to/xxxxxx.la \
    $(DL_LIBS)

    > The build seems to get a little further but then fails with "/usr/bin/
    > ld: cannot find -lta_func". I could repeat the Makefile deletion
    > process but I don't know if *this* ta_func is a Linux thing or not. I
    > have devel/ta-lib installed and have symlinked its directory in /usr/
    > local/include to /usr/local and /usr/include. I've even symlinked
    > ta_func.h to a place that is successfully seen by the config script
    > but it's a no-go.
    >
    > These sorts of failures could go on forever. I've emailed the
    > developer but might there be a way to get configure to look at BSD
    > file locations and not just Linux locations? configure is over 28k
    > lines and I'm not a programmer but there must be a 'look here too!'
    > entry I can make somewhere.


    Don't edit `configure' directly. Look for a file called `configure.ac'
    or `configure.in' in the same path.


+ Reply to Thread