Welcome to FreeBSDFreaks.net!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Compiling Linux app source code on FBSD

 
   FreeBSD Hosting (Home) -> FreeBSD vs Linux RSS
Next:  FreeBSD Port: gstreamer-plugins-swfdec-0.10.8_3,3  
Author Message
thefronny

External


Since: Oct 19, 2008
Posts: 1



(Msg. 1) Posted: Sun Oct 19, 2008 11:54 am
Post subject: Compiling Linux app source code on FBSD
Archived from groups: comp>unix>bsd>freebsd>misc (more info?)

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

 >> Stay informed about: Compiling Linux app source code on FBSD 
Back to top
Login to vote
Giorgos Keramidas

External


Since: Dec 20, 2003
Posts: 16



(Msg. 2) Posted: Sun Oct 19, 2008 9:25 pm
Post subject: Re: Compiling Linux app source code on FBSD [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Sun, 19 Oct 2008 11:54:02 -0700 (PDT), 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.

 >> Stay informed about: Compiling Linux app source code on FBSD 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Linux compatibility: is it possible to link freebsd code t.. - Hello, Linux compatibility works fine to run linux binaries, but I'm wondering if it's possible to compile code on FreeBSD and link it to a linux library? I want to compile SAP-Rfc, a perl module, to perform RFC to an SAP server. The code must be linke...

How would I upgrade the linux libc6 on FBSD 4.8? - Hi all, How would I go about upgrading the linux emulation of glibc6 to a newer release? Would I just donload the .rpm and install as I would on a native Linux? TIA, Pontus

FBSD 5.4, Linux RH 9, Acrobat 7 probs - Hi folks, I am in the process of installing a system based on FBSD 5.4. I have installed Linux RH 9 from the ports for emulation, plus the x11/linux-XFree86-libs port. However, Acroread7 complains that it can't find libXext, and mtv complain...

Linking code with linux libraries - Hi there! I have a large collection of linux libraries that I must work with, and before attempting to recompile them all for FreeBSD (huge work, definately not straightforward), I was wondering if I could perform one of the following: - compile my..

Open source or *BSD/Linux compatible mapping software? - Hey, folks - my one remaining dependency on the Microsoft world seems to be Streets and Trips. Even though the product has gone down hill dramatically in the last three years, I still love it and use it daily. One of the big differentiators for me is..
   FreeBSD Hosting (Home) -> FreeBSD vs Linux All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]