kfl / mosml

Moscow ML is a light-weight implementation of Standard ML (SML), a strict functional language widely used in teaching and research.
http://mosml.org
341 stars 42 forks source link

Generate shebang header at make world stage. #42

Open const-rs opened 8 years ago

const-rs commented 8 years ago

Ken,

while making mosml RPM package for my distribution I met a problem with incorrect shebang line in binaries, that were created with installed MosML.

Packages are built under regular user, so, one can not write to system directories. The packaging process involves 2 stages - build and install. On build stage you can use any directory as PREFIX, while on install stage PREFIX is provided by RPM build system, so it is a fake root, smth like /home/const/tmp/mosml-buildroot

Therefore shebang header should be generated at build stage, but not at install stage. And overall, no path variable should be defined at install stage.

This header does not affect bootstrap compilers, because these binaries do not include shebang header and should be run with direct call to camlrunm. You can check it by (as I did):

  1. make world
  2. go to src/compiler directory, make clean, make, make promote
  3. look at bootstrap binaries in src directory - they do not contain shebang and header is already generated.