Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 Apr 2000 09:35:17 -0700
From:      Marcel Moolenaar <marcel@cup.hp.com>
To:        John Daniels <jmd526@hotmail.com>
Cc:        freebsd-emulation@FreeBSD.ORG, freebsd-ports@FreeBSD.ORG
Subject:   Re: linux application
Message-ID:  <38F5F745.AA0BE917@cup.hp.com>
References:  <20000413054014.2411.qmail@hotmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
John Daniels wrote:

> This is supposed to run under Linux, so I believe that the libraries were
> probably compiled under Linux, and are expecting to be called from programs
> running under Linux.
> 
> Will all of this run without modification due to FreeBSD's Linux
> compatibility?  Are there compiler options that I have to use to make this
> work?  (Obviously, I never done anything like this before)

You can't use FreeBSD's compiler for this. You must use a Linux compiler
(you need to make Linux binaries).

> I have looked at Makefiles for Linux ports and they specify linux libraries
> and the Linux-base package as necessary.  Don't these specifications get
> passed through to the compiler?

Forget the ports collection. After you've setup /compat/linux (install
linux_base and linux_devtools) you will only be using Linux binaries to
do the compilation. You should be able to do it just as if you were on a
Linux machine yourself.

> Basically, what do I have to do to create/compile/run programs that use
> libraries developed on Linux.

1. Use a linux shell (ie run /compat/linux/bin/sh)
2. Create a C/C++ source file
3. Optionally create a makefile
4. Build/compile the source file
5. Run the freshly compiled binary

Ad 4: Compiling a Linux binary is as simple as typing "gcc -o foo
foo.c", but only when done from within a Linux shell (see 1)

Your manual should describe any options/parameters/libraries you need to
add to use the API.

HTH,

-- 
Marcel Moolenaar
  mail: marcel@cup.hp.com / marcel@FreeBSD.org
  tel:  (408) 447-4222


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?38F5F745.AA0BE917>