AVS Forum banner
1 - 20 of 20 Posts

·
Registered
Joined
·
3,740 Posts
Discussion Starter · #1 ·
I have found a few media servers that are PS3 compatible but I have no clue how to compile. I have Fink, Xcode and know a little around the terminal. I've ran configure on one of the servers and it's missing some files. It's developer (pc guy) said to use Fink to find those libraries and other files. Huh? lol


Any help or walkthough laying the basics of what compiling is, does and how to do it?


The media servers I'm talking about are UPnP /DLNA servers-
http://mediatomb.cc/
http://elisa.fluendo.com/screenshots/


And a few others found here- http://www.linuxha.com/other/media/
 

·
Registered
Joined
·
3,740 Posts
Discussion Starter · #3 ·
This got moved to the linux forum for some reason by the mods. So to clarify, I am a mac user, I am using mac programs- Xcode, Fink, and whatever else I need to use to compile a linux source so I can use it on my mac.


Still hoping it gets moved back, if not, any OS X experience on how to compile from source on the mac?
 

·
Registered
Joined
·
2,067 Posts
Like with most multi-platform apps, you'll want to build this from the command-line, not XCode. Mac OS X has most of the same development utilities as Linux under the covers. The XCode graphical environment is typically used for Mac-only projects. (Also, the fink stuff should not be needed for this.. just the standard Mac dev tools)


I grabbed the mediatomb app, and it builds fine on my MacBook Pro.


Steps to build it (these, and more detail, are described in the README file in the archive):

- extract the archive. tar xvzf mediatomb-0.9.0.tar.gz

- cd mediatomb-0.9.0

- ./configure (run the config program, which checks your system, libraries, etc. and sets it up to build the app)

- make (run the make program, which uses the Makefiles built in the last step to build the apps)

- sudo make install (install the programs in the right directories. Admin privileges needed (sudo))
 

·
Registered
Joined
·
189 Posts
Kid Red-


Option one, as you have pointed out, is to use Fink to compile and install all of the libraries you need. One piece you would probably not want to use Fink for is MySQL, as this can be downloaded for OS X directly from the mysql website.


The trickiest part of compiling on OS X when using fink installed packages, is setting up all of your paths. I.E- setting the header and library search paths to /sw/lib and /sw/include . This can be done via the ./configure command when you go to build the source of whatever you need.


If Fink (or MacPorts) already has elisa or mediatomb packages, this would definitely be the quickest way to go, as it will do everything for you. Otherwise, you'll need to roll your own for mediatomb and elisa.


Option two would be to build everything from scratch, and install it to a standard location, such as /usr/local . This makes compiling the final product slightly easier, but compiling all of the dependencies can be a major pain.
 

·
Registered
Joined
·
3,740 Posts
Discussion Starter · #6 ·
tji- Thanks for the info, I'd jot that down. I ran configure previously and it returns with quite a few missing files. Mediatomb's dev told me I'd want a few of the missing files. So you had no probs running it without them?


I followed your instructions and terminal returned this-
Quote:
Making install in build

test -z "/usr/local/bin" || /Internet Downloads/mediatomb-0.9.0/configure_aux/install-sh -d "/usr/local/bin"

/bin/sh: line 1: /Internet: No such file or directory

make[2]: *** [install-binPROGRAMS] Error 127

make[1]: *** [install-am] Error 2

make: *** [install-recursive] Error 1

[rick-lyons-power-mac-g5:/Internet Downloads/mediatomb-0.9.0] ricklyon%

What does that mean? Do I not have a directory in the right location?

I got this fromt eh mediatomb execute file-
Quote:
2007-05-25 10:16:07 ERROR: Could not import mapping template file from /usr/local/share/mediatomb/mappings.xml

2007-05-25 10:16:07 INFO: MediaTomb configuration was created in: /Users/ricklyon/.mediatomb/config.xml

2007-05-25 10:16:07 INFO: Loading configuration from: /Users/ricklyon/.mediatomb/config.xml

2007-05-25 10:16:07 INFO: UUID generated: 082242c1-ee63-4bb5-b85a-364552cb61cd

2007-05-25 10:16:07 INFO: Config: option not found: /server/udn using default value: uuid:082242c1-ee63-4bb5-b85a-364552cb61cd

2007-05-25 10:16:07 INFO: Checking configuration...

2007-05-25 10:16:07 ERROR: /usr/local/share/mediatomb/web : 20 x No such file or directory

logout

Where is usr/local/share? We have users/ and shared directories so I'm lost there.


After it's built, what is the one click program file to use to run?
 

·
Registered
Joined
·
3,740 Posts
Discussion Starter · #7 ·
nero- Thanks for the mysql tip, I was installing that from Fink and it was taking an hour and still going. The paths thing I don't know about, you're saying I need to set up and create all of those directories? Root level? I have Macports also, but can't make heads or toes of it.


Fink did not have the files that mediatomb was missing, so I have no idea where to get those from. I have no idea how to compile from scratch, so I'd need additional instruction from somewhere. Maybe I'm in over my head on this.
 

·
Registered
Joined
·
2,067 Posts
It looks like the install script is failing because the directory has a space the name..


"/Internet Downloads/mediatomb-0.9.0/configure_aux/install-sh -d "/usr/local/bin"

/bin/sh: line 1: /Internet: No such file or directory"


Notice how it truncates the directory to only "/Internet". Spaces screw up many tools, which is why you see a lot of people using underscores in filenames rather than spaces. I bet if you move mediatomb to a different directory it will work.




As for other configuration info, I would check out the README file and make sure you have configured any necessary items to get it working.
 

·
Registered
Joined
·
3,740 Posts
Discussion Starter · #9 ·
tji- I set up the local/share/meditomb that is was looking for and was about to for the make install. The output was all 'nothing to be done for -' Does that mean everything is set up?


K, I ran that mediatomb file again and it was running better. Now I get a port error-

Quote:
Exception raised in [../src/server.cc:135] upnp_init(): upnp_init: UpnpInit failed

2007-05-25 10:38:07 ERROR: main: upnp error -203

2007-05-25 10:38:07 ERROR: Could not bind to socket.

2007-05-25 10:38:07 INFO: Please check if another instance of MediaTomb or

2007-05-25 10:38:07 INFO: another application is running on the same port.

Exception raised in [../src/server.cc:304] shutdown(): upnp_cleanup: UpnpUnRegisterRootDevice failed

logout

[Process completed]

I have TwonkyMedia installed, would that be the cause? Or is there something else I need to check? How do I check ports and apps using those ports?


You're a great help.
 

·
Registered
Joined
·
852 Posts

Quote:
Originally Posted by Kid Red /forum/post/0


tji- Thanks for the info, I'd jot that down. I ran configure previously and it returns with quite a few missing files. Mediatomb's dev told me I'd want a few of the missing files. So you had no probs running it without them?


I followed your instructions and terminal returned this-



What does that mean? Do I not have a directory in the right location?

I got this fromt eh mediatomb execute file-



Where is usr/local/share? We have users/ and shared directories so I'm lost there.


After it's built, what is the one click program file to use to run?

your problem is common locations for files are different between Linux and BSD Unixes like OSX. any included auto-installation script you'll find in a Linux program will not likely work.


that's why we have autoconf.


the configure script will find where the libraries are that the program in question needs, and automatically create new makefiles, so that the program compiles properly.


quick rundown for compiling any autoconf program from source..


1) you need the developer-tools package for OSX, whatever it's called.

2) after you untar and unzip the program you've downloaded, and moved into the folder you've unzipped it to, run ./configure --help

3) the output of configure --help will give you all options you can pass to the program while it's being compiled. check and make sure you enable all the options you need. some are default, some aren't, but they will all be detailed when you run configure with --help. if you need option blahblah but not blah instead of just "./configure" you'll do "./configure --with-blahblah=yes --with-blah=no", per the format listed in the config --help output. if configure doesn't find something it needs but you have it installed, there will likely be a configure option for you to manually tell it where it is.

4) when configure is done, all of the options you specified and all of the other things that the program needs are discovered automatically, then it's just a matter of "make" and "make install"

5) if you make a mistake and forget something you can always run configure again with different options. to avoid having multiple conflicting versions of programs running around most source distributions will have an uninstall option in the generated makefiles. so if you make a mistake you can go back and "make deinstall" or "make uninstall" to start over. after you uninstall, run "make clean" to clean up any files that you compiled before so that you can compile them again after changing your config.

6) if make ever halts on an error you're left with a half-built program that will not work, so at that point you "make clean" to wipe out the half-built files and you go back to "./configure" to start over and try and sort out why it failed to compile.

7) when you get all of the options just like you want them and the installed program works, hang on to the source folder you compiled it from, you can always go back and look at "config.log" or "config.status" to re-create the same thing you did before if you need to reinstall the program.


cliff's notes...

./configure --help and find the options you need to set
./configure --with-my-options --but-not-this-one=no to set it up how you want it
make to compile
make install to install
make deinstall or make uninstall if something goes wrong

then make clean if you need to start over and you can ./configure again


note that with configure you can also control where the program in question installs things to. this is especially useful, since you can make things install to the folders that your OS uses for certain things by default. for instance most linux distros install all program conf files in /etc. some, however, separate user installed programs into /usr/local, so you have all the conf files for programs you've installed in /usr/local/etc. well if you don't have any conf files in /usr/local/etc and want all your conf files in the same place, you can usually do a --sysconfdir=/etc in any configure script to make a program put its settings file there, instead of /usr/local. you can do the same with the binary and shared libary files as well with similar options. matching up shared library install locations to your OS default location is especially useful, that way programs that compile against each other's shared libraries for interoperability can find said libraries automagically, rather than you having to constantly tell each program where stuff it's looking for is.


if you know where everything is stored on OSX, it should be quite easy to build programs from source that install exactly like pre-built OSX packages do.
 

·
Registered
Joined
·
3,740 Posts
Discussion Starter · #11 ·
Xayd- Awesome run down, will save that info. XCode is the dev tools for mac.


As for the folder hierarchy, I have to create them. Already done, no biggie and it works to that extent. I am not using an auto install script, I don't think. Now it seems my hangup is the port isn't clear and UPuPint is failing.
 

·
Registered
Joined
·
852 Posts
see edit, i was putting in stuff about the heirarchy. autoconf can do that for you if you know where things are supposed to go
.


the install.sh script i saw you mention was what prompted the quick tutorial. install.sh is either the script included with the program to install things after you've compiled it, or some sort of "default" installer for the typical options. either way, you should never have to run it manually, nor should you have to manually create directories, configure and make should do it all in a proper source distributed program.


i haven't used OSX that much, so i don't know where everything is off the top of my head, but finding those directories should be pretty easy.


search your machine for....


*.conf - these are program settings files, whatever folder has a metric ton of them is the "sysconfdir" in configure


lib*.so - these are shared libraries. usually in /usr/lib, there may also be a /usr/local/lib, this will be "libdir" or "sharedlibdir" in configure


*.h - these are headers that programs that require another progam will need to read when compiled. this is the folder denoted by "includedir" in configure. usually /usr/include and-or /usr/local/include


*.pid - these are where the OS stores pid files, that are written when a server is opened so that it can read the file to determine which process number the server is, and whether a server is currently running or not. it's used by many programs' startup scripts to determine whether another copy of itself is running or not so if you get PID errors the location where the PID file is supposed to be is where to look. if a server crashes it will leave its PID file there rather than deleting it as it should when it closes normally, so you'll probably need to delete the PID file before you can start it up again. this is denoted in configure by "localstatedir". on linux this is usually /var/run, no idea where it is in OSX.


the bin, libexec, and sbin folders usually don't matter. they might vary on whether they default to /usr or /usr/local, but virtually every Unix OS has both the /usr and /usr/local binary folders in the default search path so either will work. there should also be a --prefix option in configure that you can use to specify whether you want /usr or /usr/local to be used by default, if you so desire. these are just the executables, so it's not a big deal.


with all of this info you can feasibly configure any linux autoconf program capable of running on OSX to run on OSX, it's just a matter of telling it where everything is and making sure that you install things in the right place when you configure programs that you compile from source. just make sure you match up the lib and include directories to where they are supposed to be. i would also make a habit of using the same location for pid files and conf files to ensure that everything is in the same place and is easy to manage later on.


of course it's always a good idea to read INSTALL and/or README first. not all programs use autoconf, and since many programs are still in a beta phase the install scripts might not always be in a stable, usable state. if a program lacks autoconf-style setup scripts or the ones that it has don't work particularly well yet, then detailed instructions should be in the INSTALL and README files.
 

·
Registered
Joined
·
3,740 Posts
Discussion Starter · #13 ·
xayd- Again, thanks for the time taken to post all of that informative data.


Do you know how I can problem solve my UpnpInit failure? Seems something is using the same port, but i don't know which port that is, or how to check my ports and usage of.
 

·
Registered
Joined
·
3,740 Posts
Discussion Starter · #14 ·
K, everything mentioned here got it working.


bascailly it was creating the folder level or


cd /drag and drop mediatomb folder here

./configure --prefix=/Users/username/my-MT-install

make

make install


Then go to bin folder, double click mediatomb and the terminal window will come back with the web address. Go there to verify and I'm going to check the PS3 to see what I got.
 

·
Registered
Joined
·
852 Posts
that may or may not work, depending on OSX. /users/username i assume is the OSX equivalent of home folders. in linux these are /home/username, and is where your email goes, where your personal files go, and where your ftp root defaults to if you connect remotely.


the catch is search paths. the search path exists in every OS i'm aware of, even windows, to tell the OS where common executable programs are. in linux these are /usr/bin and /usr/local/bin, there are also equivalents named sbin and libexec. so installing to a prefix of your home folder will make a users/kidred/bin folder, a users/kidred/sbin folder, and a users/kidred/libexec folder, in which it will put all of the executable files that the program installs.


the catch in all of this is, if the users/kidred/bin folder isn't in the search path, and the program tries to execute a file that's included with the program, it won't find it unless it uses the full path. if the executables are in the primary bin, sbin, and libexec folders, you can type in "myprogram" at the command prompt without specifying a directory and the shell will find it. if it's not in a directory included in your search path, you'll get a "file not found" error unless you specify the full path. so if the program calls other executables on its own while running, it might not find such executables either.


if the program has all of its functions built into one executable, this shouldn't matter, you'll just have to specify the full path when you open it.


i actually have a mac mini here so i'll fire it up in a bit and take a look and post back.
 

·
Registered
Joined
·
3,740 Posts
Discussion Starter · #16 ·
xayd- It's up and running, just had a mime issue prob. I didn't install a libmagic (file or file-dev) so all my mp3s and jpgs are seen as octet-stream mime types, lol. Reminds me of IE back in the day with their file mapping. So, I had to trash mediatomb and use FInk to install file and file-dev and now I'm re-configuring.


PS3 did see all my branches, saw all my folders so there were no path issues, just mime issues.
 

·
Registered
Joined
·
3,740 Posts
Discussion Starter · #17 ·
K, I got libmagic from http://packages.debian.org/unstable/utils/file


I ran configure and then make. Make gave me an error on the output-

----


../src/file -C -m magic

../src/file: line 87: /Internet: No such file or directory

../src/file: line 87: exec: /Internet: cannot execute: No such file or directory

make[2]: *** [magic.mgc] Error 126

make[1]: *** [all-recursive] Error 1

make: *** [all] Error 2


---

In short, what could that mean?


If I have the un-configured folder for libmagic, can I get Fink to see it and then install it?
 

·
Registered
Joined
·
3,740 Posts
Discussion Starter · #18 ·
K, fink has the libmagic in it's lib folder residing in the Fink directory, but it does not list it in the commander window. So, how can I install libmagic? Still get the configure error, so seeing that Fink has it, that would be my best bet. Just can't drag and drop and click install which is ideal
 

·
Registered
Joined
·
3,740 Posts
Discussion Starter · #20 ·
The debian page mentioned OS X, but I went ahead and grabbed it from the source. However, every link was a bad unmountable file. On the plus side, Fink has the libmagic file in it's lib folder. However, I can't figure out how to install it, the Fink Commander app does not show the libmagic and I've updated and all that a few times.


Oh well, I'm having trouble with a few mac native servers as well and none seem to come close to Front Row or ATV.
 
1 - 20 of 20 Posts
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Top