Recent

Author Topic: Missing fpc Makefile on Linux Mint  (Read 7416 times)

penttila

  • New member
  • *
  • Posts: 7
Missing fpc Makefile on Linux Mint
« on: September 23, 2016, 05:04:14 am »
Hi,

I have a Linux Mint 18 Cinnamon 64bit (based on Ubuntu 16.04) PC where I would like to cross compile a Lazarus pascal project to a 32bit-linux program. It has Lazarus-1.6, fpc-3.0.0 and fpc-source-3.0.0 packages installed on it from the official Linux Mint repository.

On the http://wiki.freepascal.org/Cross_compiling#From_Linux_x64_to_Linux_i386 web page I find some useful information how to set up my environment. It says to execute the "sudo make all CPU_TARGET=i386" command but I have no Makefiles in /usr/share/fpcsrc/<version>, only several Makefile.fpc under it. I know that with fpcmake (probably with "fpcmake -rw Tall") the missing Makefiles can be generated but I haven't find any exact description about it!

Does anybody has any experience in which directory and with what kind of parameters do I have to run fpcmake to create all the required Makefiles in the whole directory structure recursively?

Thanks for your help!

Leledumbo

  • Hero Member
  • *****
  • Posts: 8746
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Missing fpc Makefile on Linux Mint
« Reply #1 on: September 23, 2016, 11:34:43 am »
Doing it on the top level directory will recursively do for all other folders.

Thaddy

  • Hero Member
  • *****
  • Posts: 14197
  • Probably until I exterminate Putin.
Re: Missing fpc Makefile on Linux Mint
« Reply #2 on: September 23, 2016, 12:38:49 pm »
For now, don't run fpmake or the fpc?make, just run make....
make clean all install
for example....
Specialize a type, not a var.

penttila

  • New member
  • *
  • Posts: 7
Re: Missing fpc Makefile on Linux Mint
« Reply #3 on: September 23, 2016, 05:47:13 pm »
Doing it on the top level directory will recursively do for all other folders.

@Leledumbo: I have taken your advice but the result is questionable.

When running it In the  compiler/ subdirectory, I got a nice Makefile parallel with Makefile.fpt in compliler/utils/ppuutils. On the other hand running it in packages/ I havn't got any makefile neither in packages/amunits nor in packages/amunits/utilunits although both contains a makefile.fpc file!

Furthermore when I run the "sudo make all CPU_TARGET=i386" command for the rtl/ subdirectory I got this nice error msg bellow:

xxx@afo /usr/share/fpcsrc/3.0.0 $ sudo make all CPU_TARGET=i386
[sudo] xxx password:
make: *** No rule to make target 'all'.  Stop.
xxx@afo /usr/share/fpcsrc/3.0.0/rtl $ sudo make all CPU_TARGET=i386
make -C linux all
make[1]: Entering directory '/usr/share/fpcsrc/3.0.0/rtl/linux'
Makefile:3486: ../i386/makefile.cpu: No such file or directory
make[1]: *** No rule to make target '../i386/makefile.cpu'.  Stop.
make[1]: Leaving directory '/usr/share/fpcsrc/3.0.0/rtl/linux'
Makefile:1946: recipe for target 'linux_all' failed
make: *** [linux_all] Error 2

Am I doing something wrong?

Leledumbo

  • Hero Member
  • *****
  • Posts: 8746
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Missing fpc Makefile on Linux Mint
« Reply #4 on: September 23, 2016, 07:03:16 pm »
Am I doing something wrong?
And if you do it in /usr/share/fpcsrc/3.0.0? Alternatively, you might want to get sources from the freepascal svn instead of mint repository.  I always use that and it has all makefiles pregenerated with fpcmake -Tall.

penttila

  • New member
  • *
  • Posts: 7
Re: Missing fpc Makefile on Linux Mint
« Reply #5 on: September 24, 2016, 08:55:41 am »
@Leledumbo: of course I tried to run both of these commands from the base directory but without any success (that's why I tried to run them from the subdirectories):

xxx@afo /usr/share/fpcsrc/3.0.0 $ fpcmake -rw -Tall
Processing makefile.fpc
Error: Unable to open file "makefile.fpc"

xxx@afo /usr/share/fpcsrc/3.0.0 $ sudo make all CPU_TARGET=i386
[sudo] xxx psw:
make: *** No rule to make target 'all'.  Stop.

I will try to install the sources from the freepascal svn and will report the result.
Thanks for your help.

Leledumbo

  • Hero Member
  • *****
  • Posts: 8746
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Missing fpc Makefile on Linux Mint
« Reply #6 on: September 24, 2016, 05:11:21 pm »
@Leledumbo: of course I tried to run both of these commands from the base directory but without any success (that's why I tried to run them from the subdirectories):

xxx@afo /usr/share/fpcsrc/3.0.0 $ fpcmake -rw -Tall
Processing makefile.fpc
Error: Unable to open file "makefile.fpc"
I believe this distribution package has no permission to be writable by normal users (normal, but not something a non-experienced user would expect). chmod-ing the whole directory tree to 666 (for files) and 777 (for directories) should fix it.

penttila

  • New member
  • *
  • Posts: 7
Re: Missing fpc Makefile on Linux Mint
« Reply #7 on: September 26, 2016, 06:45:20 pm »
Quote
I believe this distribution package has no permission to be writable by normal users (normal, but not something a non-experienced user would expect). chmod-ing the whole directory tree to 666 (for files) and 777 (for directories) should fix it.

@Leledumbo: Changing permission doesn't help as the makefile.fpc itself is missing.

With this solution bellow I was able to "make" the cross compiler although I was not able to verify the result:

1) delete the whole /usr/share/fpcsrc/3.0.0 directory tree
2) download and unpack fpc-3.0.0.source.tar.gz from freepascal.org in /usr/share/fpcsrc/
3) rename the created /usr/share/fpcsrc/fpc-3.0.0 directory to /usr/share/fpcsrc/3.0.0
4) now fpc compilation will be OK:
   cd /usr/share/fpcsrc/3.0.0
   sudo make all CPU_TARGET=i386
   sudo make crossinstall CPU_TARGET=i386
5) the new fp compiler is /usr/local/lib/fpc/3.0.0/ppcross386 (I think), make a link to it:
   cd /usr/bin
   sudo ln --symbolic -T /usr/local/lib/fpc/3.0.0/ppcross386 ./ppc386

Unfortunately the result was such a different and chaotic directory tree where my Lazarus project was not able to find the external references. I tried to modify it step by step but at the end I gave it up. An additional reason of fail can also be that my original source package was developed with fpc-2.4 and it seems so that there were a lot of changes also in the libraries.

Anyhow thanks for all of your help!

Leledumbo

  • Hero Member
  • *****
  • Posts: 8746
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Missing fpc Makefile on Linux Mint
« Reply #8 on: September 27, 2016, 08:30:33 am »
@Leledumbo: Changing permission doesn't help as the makefile.fpc itself is missing.
Let's assume the package is simply broken then, you might want to report it upstream.
With this solution bellow I was able to "make" the cross compiler although I was not able to verify the result:
...
   sudo ln --symbolic -T /usr/local/lib/fpc/3.0.0/ppcross386 ./ppc386
No, make the symbolic link name the same as the original one. For cross compiling, fpc driver will look for ppcrossXXX instead of ppcXXX, the naming is intentional.

penttila

  • New member
  • *
  • Posts: 7
Re: Missing fpc Makefile on Linux Mint
« Reply #9 on: September 27, 2016, 10:38:54 am »
Quote
Let's assume the package is simply broken then, you might want to report it upstream.

To file a bug or use a mailing-list in debian is so complicated, that I don't want to do it at the moment.

Quote
No, make the symbolic link name the same as the original one. For cross compiling, fpc driver will look for ppcrossXXX instead of ppcXXX, the naming is intentional.

You are right! This link was already created automatically. (But once - during my struggling - the compiler was missing this file so I added it.)

 

TinyPortal © 2005-2018