project-navigation
Personal tools

Author Topic: 2.3 dev version for mac question  (Read 24901 times)

doc.torr

  • Guest
Re: 2.3 dev version for mac question
« Reply #15 on: November 03, 2008, 11:45:47 pm »
I've tried compiling for mac according to the current instructions (http://ufoai.ninex.info/wiki/index.php/Compile_for_Mac)

and have had about as much luck as Enchantedsord (above), even though I had installed SDL, SDL_mixer, SDL_ttf, X11 2.1.5, fink 3.1.1,

(I assume you're referring to the root directory in the instructions: "From each of those dmg installers, copy the ".framework" folder to /Library/Frameworks/")

When I try:

1. fink install svn-ssl svn-client sdl sdl-ttf gettext libjpeg libpng3
2. mkdir -p ufoai/trunk
3. cd ufoai/trunk
4. svn co https://ufoai.svn.sourceforge.net/svnroot/ufoai/ufoai/trunk .
5. ./configure CPPFLAGS="-I/sw/include/" LDFLAGS="-L/sw/lib"
6. make
7. make macinstaller

stages 1. to 4. inclusive chug away nicely (4. takes some time)
but 5. gives '-bash: ./configure: No such file or directory'

I note there is another /trunk higher up, so cd'd to ~/ufoai/trunk/trunk and 5. seems to work good
or at least things happen, and most 'checking' comes up '..yes',
but...(from line after 5.): note 'warnings' further down:

checking build system type... i686-apple-darwin9.5.0
checking host system type... i686-apple-darwin9.5.0
checking target system type... i686-apple-darwin9.5.0
checking system... Mac OS X
checking for sed... yes
checking for echo... yes
checking target OS... darwin
checking target CPU... i386
checking for gcc... gcc
(..edit)
checking jpeglib.h usability... yes
checking jpeglib.h presence... yes
checking for jpeglib.h... yes
checking for jpeg_CreateDecompress in -ljpeg... yes
checking libintl.h usability... yes
checking libintl.h presence... yes
checking for libintl.h... yes
checking for library containing gettext... -lintl
checking SDL.h usability... yes
checking SDL.h presence... no
configure: WARNING: SDL.h: accepted by the compiler, rejected by the preprocessor!
configure: WARNING: SDL.h: proceeding with the compiler's result
checking for SDL.h... yes
checking SDL_mixer.h usability... yes
checking SDL_mixer.h presence... no
configure: WARNING: SDL_mixer.h: accepted by the compiler, rejected by the preprocessor!
configure: WARNING: SDL_mixer.h: proceeding with the compiler's result
checking for SDL_mixer.h... yes
checking for library containing Mix_OpenAudio... none required
checking SDL_ttf.h usability... yes
checking SDL_ttf.h presence... no
configure: WARNING: SDL_ttf.h: accepted by the compiler, rejected by the preprocessor!
configure: WARNING: SDL_ttf.h: proceeding with the compiler's result
checking for SDL_ttf.h... yes
checking for library containing TTF_Init... none required
(..edit)

So, pushing on regardless, did 6. (make) from the /trunk/trunk directory, which got me a bunch o'
 * [UFO] src/client/cl_actor.c
In file included from src/client/cl_actor.c:25:
src/client/client.h:229:21: error: libintl.h: No such file or directory
src/client/cl_actor.c: In function ‘CL_GetSkillString’:
src/client/cl_actor.c:165: warning: implicit declaration of function ‘gettext’
src/client/cl_actor.c:165: warning: return makes pointer from integer without a cast
...edit
src/client/cl_actor.c:4032: warning: passing argument 1 of ‘SCR_DisplayHudMessage’ makes pointer from integer without a cast
src/client/cl_actor.c:4036: warning: passing argument 1 of ‘va’ makes pointer from integer without a cast
...edit
{standard input}:1941:symbol: "_weaponButtonState" can't be undefined in a subtraction expression
make: *** [debug-darwin-i386/client/client/cl_actor.o] Error 1

(...edit: deleted out a bunch of other guff 4 your reading pleasure; mainly errors)

Oookaaaay...

cd-ing into the .. /trunk and giving 'make' done got me nothin' good.

make: *** No targets specified and no makefile found.  Stop.

and from /trunk/trunk, 7. (make macinstaller) got me

msgfmt -v -o base/i18n/cs/LC_MESSAGES/ufoai.mo src/po/cs.po
make: msgfmt: Command not found
make: *** [base/i18n/cs/LC_MESSAGES/ufoai.mo] Error 127

and ./configure -disable-universal
got me

.....(eventually)

checking jpeglib.h usability... no
checking jpeglib.h presence... no
checking for jpeglib.h... no
configure: error: You must have the JPEG development headers


WTF? Tried to install gettext, but then brain began to bleed with realization of other things need to be installed/configured...

Me? Well... like I said, I'm no programmer, but/and I think the original instructions were written with the expectation of various programming tools/environments that I don't have, and won't have anytime soon.

Could someone give us a hint? Or ideally, put their latest mac version up for download?  :'(  :P

Still can't get any antimatter, and none of the recovered ufos have been disassembled despite months of game-time.. blah!

Offline Destructavator

  • Combination Multiple Specialty Developer
  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 1908
  • Creater of Scorchcrafter, knows the zarakites...
    • View Profile
Re: 2.3 dev version for mac question
« Reply #16 on: November 04, 2008, 02:11:52 am »
Quote
Could someone give us a hint? Or ideally, put their latest mac version up for download?

Is cross-compiling possible from another OS?  I noticed Codeblocks has several build targets, including "macos" and not just "windows" and "windows_debug."

I also got Codeblocks to run on (Kubuntu) Linux (not via Wine, but the Linux version) and it has multiple build targets as well.

I also gave the Mac target a try under Windows in Codeblocks and although most of the files wouldn't compile (which did not surprise me), the "game" part of the project didn't complain and started building (which *did* surprise me).

I'm not a coder, but could the Codeblocks workspace file possibly be worked on to cross-compile the Mac version in such a manner?  Or is this a lost cause (impossible)?

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: 2.3 dev version for mac question
« Reply #17 on: November 04, 2008, 07:05:47 am »
libintl.h is the missing gettext package - sure you have that installed?

doc.torr

  • Guest
Re: 2.3 dev version for mac question
« Reply #18 on: November 29, 2008, 11:37:29 am »
Is it in any of these?

 i   gettext                    0.10.40-125          Message localization support
 i   gettext-bin                0.14.5-2             GNU Internationalization utilities
     gettext-dev                0.10.40-125          Developer files for gettext package
     gettext-doc                0.14.5-2             GNU Internationalization utilities (Documentation)
     gettext-emacs              0.14.5-3             Message localization support
 i   gettext-tools              0.14.5-4             GNU Internationalization utils (shared libs)

Also, why do I get:
~/ufoai/trunk/trunk

Seems an extra trunk jumped in there.

Other issues seem to occur when following listed instructions despite having the stated packages installed and most up to date (unstable) fink.

Any suggestions warmly welcomed

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: 2.3 dev version for mac question
« Reply #19 on: November 29, 2008, 12:29:44 pm »
yes - it should be gettext-dev

doc.torr

  • Guest
Re: 2.3 dev version for mac question
« Reply #20 on: December 04, 2008, 05:06:20 am »
hmm... OK,

fink install gettext-dev ; which seemed to make 'make' happier, not giving as much grief about gettext.

also, for the the /usr/shared/SDL/   folder,

I Changed priveleges etc. and made aliases, put into temporary folder, changed names so identical to originals (i.e., remove " alias"), then put into /usr/shared. Far fewer errors during ./configure CPPFLAGS="-I/sw/include/" LDFLAGS="-L/sw/lib" phase; looks like was not looking in deeper folders from /shared/

but then I got NEW and EXCITING errors on 'make' from UFOAI/TRUNK/ ...

bash-3.2# make
 * [UFO] src/client/cl_actor.c
In file included from src/client/cl_actor.c:25:
src/client/client.h:229:21: error: libintl.h: No such file or directory
src/client/cl_actor.c: In function ‘CL_GetSkillString’:
src/client/cl_actor.c:165: warning: implicit declaration of function ‘gettext’
src/client/cl_actor.c:165: warning: return makes pointer from integer without a cast

and other such stuff/errors...

**
and just for fun after that...

bash-3.2# make macinstaller
make -f build/data.mk pk3
make[1]: Nothing to be done for `pk3'.
# Replacing existing compiled maps with downloaded precompiled maps,
# otherwise multiplayer won't work due to mismatching checksums
# FIXME: Use the maps from the current release at sourceforge.net
# The mapfile in the address below is not recent enough to be useful in trunk.
# Removed for trunk builds but should be added for branch builds with the
# correct 0maps.pk3 linked.
# cd base; wget -N http://mattn.ninex.info/download/0maps.pk3
cd src/ports/macosx/installer; make TARGET_CPU=i386
cp: ../../../../ufo2map: No such file or directory
cp: ../../../../ufoded: No such file or directory
cp: ../../../../ufo: No such file or directory
make[1]: *** [copybinaries] Error 1
make: *** [macinstaller] Error 2
bash-3.2#

:-(

Offline stevenjackson

  • Rookie
  • ***
  • Posts: 90
    • View Profile
Re: 2.3 dev version for mac question
« Reply #21 on: December 04, 2008, 11:09:02 am »
So it ./configure completing successfully or is it still getting errors?

libintl.h is a part of gettext.  If you can find that file (mine is in /usr/local/include) then you can point configure at it.
It might be worth installing gettext from source if you can.  Then it should install things in more standard directories like /usr/local/include

you can get the source from http://www.gnu.org/software/gettext/
then just run
./configure
make
sudo make install

that worked fine for me.

I think i build most of the dependencies from source other that SDL so i might not be too much help with getting it via fink.

Steve

doc.torr

  • Guest
Re: 2.3 dev version for mac question
« Reply #22 on: December 04, 2008, 01:40:34 pm »
So it ./configure completing successfully or is it still getting errors?

Seems now to be completing successfully now I done gone fiddled with the /sw/include/ or whatever. Wasn't so happy before that. Wish I knew how to ensure the FLAGS went to deeper levels in the /sw/usr/include/

libintl.h is a part of gettext.  If you can find that file (mine is in /usr/local/include) then you can point configure at it.
It might be worth installing gettext from source if you can.  Then it should install things in more standard directories like /usr/local/include


Yep, I got a 'libintl.h' in /sw/include/, amongst other locations for identically named files, mainly in folders named 'gettext' or 'gettext tools'.  Also within /usr/local/include/

How do I point configure at that?

What system you running, Steve?

Also, I was informed that I actually needed to have the gettext-dev package, not the gettext-0.17 package installed. (Lookin' atchoo, Mattn!)

you can get the source from http://www.gnu.org/software/gettext/
then just run
./configure
make
sudo make install


that worked fine for me.

Er, so you ran that after 'cd gettext' ?

I put the newly downloaded gettext-0.17 folder in my 'user' directory and tried to re-install from there (after cd into gettext-0.17). ./configure'd OK, but make got me bunch o' hurt messages. Make check hurt similarly.

I think i build most of the dependencies from source other that SDL so i might not be too much help with getting it via fink.

So, you managed to compile the 2.3 dev version for Mac (universal or intel)? Could we have a copy??!

I'm on an intel macbook pro 10.5.5, with Darwin/BASH 3.2
« Last Edit: December 05, 2008, 01:58:54 pm by doc.torr »

Offline stevenjackson

  • Rookie
  • ***
  • Posts: 90
    • View Profile
Re: 2.3 dev version for mac question
« Reply #23 on: December 05, 2008, 12:46:53 am »

I'm one of the main mac developers on the project.  Though my available time was reduced greatly by the birth of my son 3 months ago.

I'm using a imac 2.16 Ghz w/ 3G ram.

I can not only compile but do all my ufoai project development on my mac.
I can do a build for 2.3 dev, i just cant do them very often due to time constraints and only for intel, not universal.
I just need somewhere to upload them to.

to add alternate locations do: ./configure LDFLAGS='-L/sw/lib -L<other include directory>' CFLAGS='-I/sw/include -I<other include directory>'

Mattn isn't a mac user and was providing more general help.

I'll help as much as i can, unfortunatly its been a while since i set up my system to compile ufoai so i dont remember exactly the method i used.
But i should be able to help you get a working system that will compile ufoai.

Steve


Steve

Offline Destructavator

  • Combination Multiple Specialty Developer
  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 1908
  • Creater of Scorchcrafter, knows the zarakites...
    • View Profile
Re: 2.3 dev version for mac question
« Reply #24 on: December 05, 2008, 01:19:38 am »
Quote
I just need somewhere to upload them to.

I might be able to help with this part, my web hosting service allows other people to have accounts and FTP access to folders, although I've never set it up before, but I'm willing to find out more details.  My web hosting service also has unlimited bandwidth and storage space listed under my plan, last time I checked.

Offline stevenjackson

  • Rookie
  • ***
  • Posts: 90
    • View Profile
Re: 2.3 dev version for mac question
« Reply #25 on: December 05, 2008, 03:26:44 am »
Also i'm using leopard.

Destructavator, if you give me the details somehow then i'll get a copy up there.

Steve

doc.torr

  • Guest
Re: 2.3 dev version for mac question
« Reply #26 on: December 05, 2008, 03:36:32 am »
That'd be great, guys!

Also, congrats, Steve!

Any help you can give on setting up my env good would be warmly appreciated. I figure there's no point trying to contribute further to the project if I can't compile good.

Steve, what sort of directories do you reckon I should include? What's the difference between the CPPFLAGS and LDFLAGS? I can't find any man ref.
Should they be exported to PATH instead? Further, 'make' still gives grief re. lack of jpeglib.h even though it's sitting right in the /usr/include/

um..

something like this

192-168-1-153:~ wesblack$ cd ufoai/trunk
192-168-1-153:~/ufoai/trunk wesblack$ ls
CONTRIBUTORS      config.guess      contrib
COPYING         config.h      debian
INSTALL         config.h.in      debug-darwin-i386
Makefile      config.log      install-sh
Makefile.in      config.status      radiant
README         config.sub      src
base         configure
build         configure.ac
192-168-1-153:~/ufoai/trunk wesblack$ make -p
# GNU Make 3.81
# Copyright (C) 2006  Free Software Foundation, Inc.
# This is free software; see the source for copying conditions.
# There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.

# This program built for powerpc-apple-darwin9.0
 * [UFO] src/client/renderer/r_image.c
src/client/renderer/r_image.c:32:21: error: jpeglib.h: No such file or directory
src/client/renderer/r_image.c:33:17: error: png.h: No such file or directory
src/client/renderer/r_image.c:138: error: syntax error before ‘*’ token
src/client/renderer/r_image.c: In function ‘PngReadFunc’:
src/client/renderer/r_image.c:140: warning: implicit declaration of function ‘png_get_io_ptr’
src/client/renderer/r_image.c:140: error: ‘Png’ undeclared (first use in this function)
src/client/renderer/r_image.c:140: error: (Each undeclared identifier is reported only once
src/client/renderer/r_image.c:140: error: for each function it appears in.)
src/client/renderer/r_image.c:141: error: ‘buf’ undeclared (first use in this function)
src/client/renderer/r_image.c:141: error: ‘size’ undeclared (first use in this function)
src/client/renderer/r_image.c: In function ‘R_LoadPNG’:
src/client/renderer/r_image.c:154: error: ‘png_structp’ undeclared (first use in this function)


etc.

Offline Destructavator

  • Combination Multiple Specialty Developer
  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 1908
  • Creater of Scorchcrafter, knows the zarakites...
    • View Profile
Re: 2.3 dev version for mac question
« Reply #27 on: December 05, 2008, 11:50:06 am »
Also i'm using leopard.

Destructavator, if you give me the details somehow then i'll get a copy up there.

Steve

I'm busy today (Friday), but I'll try to find out by sometime this weekend, hopefully Saturday, and when I do I'll send a PM your way.

doc.torr

  • Guest
Re: 2.3 dev version for mac question
« Reply #28 on: December 05, 2008, 02:31:23 pm »
Steve, tried your suggestion re. ./configure, but found it worked a bit better as

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

in that I seemed to get no errors during 'configure', and the makefile seemed to accept the CFLAGS and LDFLAGS
but still no joy with 'make' (many errors reported - I'll spare you the cut 'n paste here. Lots of syntax errors. But possibly a better class of fail.)

also, when I tried (just for fun) replacing CPPFLAGS and/or CFLAGS and/or LDFLAGS (as Steve's instructions) with other directories and re-running configure, not a lot of fun was had, mainly reporting errors during configure, and  'no such file or directory' on subsequent 'make'

mostly looking for jpeglib.h, png.h... mostly...
.


« Last Edit: December 05, 2008, 03:21:47 pm by doc.torr »

Offline tchristney

  • Rookie
  • ***
  • Posts: 75
    • View Profile
Re: 2.3 dev version for mac question
« Reply #29 on: December 17, 2008, 10:49:39 am »
OK, I think we all can admit that the compile for mac wiki page is written for people with at least a little programming experience. One of the issues with providing 2.3 "nightlies" is that you cannot be guaranteed that any particular revision in the SVN trunk will work. Sure, everyone tries hard to make it so, but new features are being added all the time. Keep in mind that chances are anything stevenjackson provides to you will likely be outdated in less than 24 hours.

It seems that the fink instructions need to be modified to make sure that the *-dev versions of all the packages are installed. Also, I'm a little worried by people fiddling around in /usr/* with what appears to be limited knowledge of what they are doing. If you are using fink you should not need to add anything from /usr/local ! Everything from fink is installed in /sw/ precisely so fink doesn't clobber /usr/*! If I were you I would try to return to the original state of /usr/ (/usr/local/ is not important - everything in there is put there by users, not the system). For example, you should not have a /usr/shared/SDL (nor a /usr/share/SDL for that matter - I certainly don't.)

FWIW, I really wanted to get universal binaries working, and when I found out that fink does not support them at all, I switched to MacPorts. MacPorts is not perfect, but it works for me.

About the SDL frameworks: they need to be installed in /Library/Frameworks (I think ~/Library/Frameworks may also work, but I've never tried it.) So you should have folders named /Library/Frameworks/SDL.framework, /Library/Frameworks/SDL_ttf.framework and /Library/Frameworks/SDL_mixer.framework.

CFLAGS/LDFLAGS: these tell make which additional options to pass to the compiler/linker. When you say CFLAGS="-I/sw/include" you are telling the compiler to look inside /sw/include for additional header files (*.h) that it can't find in the default locations (/usr/include and /usr/local/include). Similarly, LDFLAGS="-L/sw/lib" tells the linker to look for libraries in /sw/lib. After that line you can use -ljpeg and the linker will look for libjpeg.dylib in /sw/lib in addition to /usr/lib and /usr/local/lib. Note that /usr/lib and /usr/local/lib are searched by default and should never need to be manually specified to configure! If you are using fink and configure complains about not finding a header file, then the correct package has not been installed successfully. For the record, AFAIK, there should not be a jpeglib.h in /usr/include. Apple does not ship libjpeg (jpeg is supported by Cocoa) and /usr/include is a "system" directory, i.e. it should only contain items that Apple puts there (you should put your own modifications in /usr/local/include)

Hope this helps.