I've successfully installed Linux version and built a hello world example with fpc on NetBSD:
Quote:
program HelloWorld;
uses crt;
(* Here the main program block starts *)
begin
writeln('Hello, World!');
readkey;
end.
|
I prepared a suse 13.1 package, generated object file, manually fixed paths in the result file for a linker and it worked.
If someone will need it, I will help with NetBSD and pkgsrc, I don't know Pascal.
To get to my point:
1. Locally alter emulators/suse131_linux/Makefile.common
Quote:
Index: suse131_linux/Makefile.common
================================================== =================
RCS file: /cvsroot/pkgsrc/emulators/suse131_linux/Makefile.common,v
retrieving revision 1.13
diff -u -r1.13 Makefile.common
--- suse131_linux/Makefile.common 10 Mar 2015 01:42:13 -0000 1.13
+++ suse131_linux/Makefile.common 17 Oct 2015 13:35:48 -0000
@@ -73,6 +73,7 @@
_SUSE_FTP_SUBDIR= distribution/${SUSE_VERSION}/repo/oss/suse/
_SUSE_FTP_SUBDIR_UPD= update/${SUSE_VERSION}/
+_SUSE_FTP_SUBDIR_EDU= repositories/Education/openSUSE_${SUSE_VERSION}/
MASTER_SITE_SUSE_${SUSE_VERSION}= \
http://download.opensuse.org/${_SUSE_FTP_SUBDIR}
@@ -80,6 +81,9 @@
MASTER_SITE_SUSE_${SUSE_VERSION}_UPD= \
http://download.opensuse.org/${_SUSE_FTP_SUBDIR_UPD}
+MASTER_SITE_SUSE_${SUSE_VERSION}_EDU= \
+ http://download.opensuse.org/${_SUSE_FTP_SUBDIR_EDU}
+
MASTER_SITES?= ${MASTER_SITE_SUSE_${SUSE_VERSION}}/${SUSE_ARCH}/
DIST_SUBDIR?= suse${SUSE_VERSION:S/.//}
@@ -132,10 +136,10 @@
${MASTER_SITE_SUSE_${SUSE_VERSION}}${distfile:E}/
. endfor
.endif
-.if defined(RPMUPDPKGS) && !empty(RPMUPDPKGS)
-. for distfile in ${RPMUPDPKGS}
+.if defined(RPMEDUPKGS) && !empty(RPMEDUPKGS)
+. for distfile in ${RPMEDUPKGS}
DISTFILES+= ${distfile}.rpm
SITES.${distfile:T:S/=/--/}.rpm?= \
- ${MASTER_SITE_SUSE_${SUSE_VERSION}_UPD}${distfile: E}/
+ ${MASTER_SITE_SUSE_${SUSE_VERSION}_EDU}${distfile: E}/
. endfor
.endif
|
2. Get pkgsrc-wip (
https://pkgsrc.org/wip for details)
3. Install wip/suse131_fpc
4. Add to your PATH suse compat packages
Quote:
export PATH=$PATH:/usr/pkg/emul/linux/usr/bin/
|
5. Compile the test example
Quote:
$ fpc -s test.pas
Free Pascal Compiler version 2.6.4 [2014/05/07] for x86_64
Copyright (c) 1993-2014 by Florian Klaempfl and others
Target OS: Linux for x86-64
Compiling test.pas
Closing script ppas.sh
8 lines compiled, 0.1 sec
|
6. Fix linker paths
Quote:
sed -i 's!/usr/lib64/!/usr/pkg/emul/linux/usr/lib64/!' link.res
|
7. Link sources
Quote:
$ ./ppas.sh
Linking test
/usr/bin/ld: warning: link.res contains output sections; did you forget -T?
|
8. Run
Quote:
$ ./test
Hello, World!
<enter pressed>
$
|
It's a good start for bootstrapping a native fpc NetBSD version.