Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#609 Proposal for different use of $(DESTDIR)

v0.8
closed
nobody
5
2009-01-13
2008-12-29
Anonymous
No

Hello,

I'm currently porting iverilog to OpenBSD and had major issues with the current build system concerning location of files.
After many different approaches (first including manual patches to _every_ Makefile.in) I feel to have fonud a clean solution (which I guess will work for other OSes as well):

.for f in Makefile.in cadpli/Makefile.in driver-vpi/Makefile.in \ driver/Makefile.in ivlpp/Makefile.in libveriuser/Makefile.in \ tgt-edif/Makefile.in tgt-fpga/Makefile.in tgt-null/Makefile.in \ tgt-pal/Makefile.in tgt-stub/Makefile.in tgt-verilog/Makefile.in \ tgt-vvp/Makefile.in vpi/Makefile.in vpip/Makefile.in vvp/Makefile.in
@perl -pi -e 's|[@]mandir@|${WRKINST}${PREFIX}/man|g' ${WRKSRC}/${f}
@perl -pi -e 's|\$$\(DESTDIR\)||g' ${WRKSRC}/${f}
@perl -pi -e 's|([@]prefix@)|\$$(DESTDIR)\1|g' ${WRKSRC}/${f}
.endfor

In plain text:
Remove $(DESTDIR) everywhere and just add it to prefix (prefix = $(DESTDIR)@prefix@).

If there are no issues with other systems using this approach I'd be happy to remove above workaround from my port :)
I do think it is also "better" because you only have $(DESTDIR) in one place than in dozens.

Regrads
ahb

Discussion

1 2 > >> (Page 1 of 2)
  • Cary R.
    Cary R.
    2008-12-29

    Is this for the stable branch (0.8) or the development branch (0.9)? Also what flags, etc. are you passing to configure and where are you expecting the various files to go?

     
  • This is verilog 0.8.7.

    The final layout of files is: (all under /usr/local/)
    bin/iverilog
    bin/iverilog-vpi
    bin/vvp
    include/iverilog/
    include/iverilog/_pli_types.h
    include/iverilog/acc_user.h
    include/iverilog/ivl_target.h
    include/iverilog/veriuser.h
    include/iverilog/vpi_user.h
    lib/ivl/
    lib/ivl/cadpli.vpl
    lib/ivl/edif-s.conf
    lib/ivl/edif.conf
    lib/ivl/edif.tgt
    lib/ivl/fpga-s.conf
    lib/ivl/fpga.conf
    lib/ivl/fpga.tgt
    lib/ivl/include/
    lib/ivl/ivl
    lib/ivl/ivlpp
    lib/ivl/null-s.conf
    lib/ivl/null.conf
    lib/ivl/null.tgt
    lib/ivl/system.sft
    lib/ivl/system.vpi
    lib/ivl/vvp-s.conf
    lib/ivl/vvp.conf
    lib/ivl/vvp.tgt
    lib/ivl/xnf-s.conf
    lib/ivl/xnf.conf
    lib/libveriuser.a
    lib/libvpi.a
    man/man1/iverilog-fpga.1
    man/man1/iverilog-vpi.1
    man/man1/iverilog.1
    man/man1/vvp.1

    As flags I'm just using --disable-suffix.
    But the OpenBSD ports process works this way:
    Everything is build inside obj/ports/iverilog-0.8.7/verilog-0.8.7 and for install step
    prefix/DESTDIR is set to
    obj/ports/iverilog-0.8.7/fake-i386/
    After install step all files found under that directory will be packaged up.
    Most of the time it works "out of the box" for software using configure.

     
  • Cary R.
    Cary R.
    2008-12-29

    I'll let Steve take a look at this since I don't build packages for redistribution. One thing I will say is make sure you know exactly why you are disabling the suffix and the future ramifications of doing this. Look at the mailing lists where we have discussed this in detail. I'm marking this as a 0.8 task, but we will need to verify that we do not also need to do something for the 0.9 release.

     
  • Cary R.
    Cary R.
    2008-12-29

    • milestone: --> v0.8
     
  • First, I really discourage using --disable-suffix for 0.8.7 packages. I also suggest that you call verilog 0.8.7 packages verilog08 instead. The reason for the rename is so that verilog 0.9 packages will install without "replacing" verilog-0.8.7. We put a lot of thought into this transition, so please do it that way unless you have a good reason. (If you have that good reason, please post it to the iverilog-devel mailing list.)

    As for $(DESTDIR), there is also a reason that $(DESTDIR) is different from, and higher level then, the $(prefix). The $(prefix) is the final installation location where the product will go. Some parts of Icarus Verilog will have that path compiled in. The $(DESTDIR) only affects the install targets and is for forcing the Makefiles to install to a staging directory. This works perfectly fine for people who build rpms. Folding $(DESTDIR) into $(prefix) is not better because you run the risk of confusing your installation.

    Can you be more specific about what your actual problem is? Perhaps we can come up with a more elegant solution for you.

     
  • I guess to have overlooked something concerning the upcoming 0.9 version, does it need the older version installed?
    Because OpenBSD only keeps one version of the same port around, thus conflicts will be no problems since 0.8.7 will be entirely removed before 0.9 is installed.

    For make build DESTDIR='' and for make fake/install it is DESTDIR='fake-root-dir/', thus the correct path will be compiled into the binary. I actually had the issue of wrong paths getting compiled in when setting PREFIX to the fake root (which seems to be expected), another issue is that --mandir for some reason does not influence its Makefile value.

    Regards
    ahb

     
  • Cary R.
    Cary R.
    2008-12-30

    Please, please, read our discussions on the mailing lists. Basically we want to keep both available for a while. V0.8 supports rudimentary synthesis, but this is broken in V0.9 and is not planned to get fixed until V0.10 or later. We do not know exactly how many people are using this, but we don't want to just break synthesis when we release V0.9. V0.9 is a much better simulator and we don't want to wait for synthesis before releasing it since the main focus for Icarus is simulation. All this necessitated the need for a suffix so that we can have V0.8 for synthesis and legacy simulation and V0.9 as the new simulator.

    I do use --mandir in V0.9 so this could be a problem in V0.8. I do not have a dedicated V0.8 archive on the machine I have with me so Steve can look into this or I will once I get access to my other machine,

     
  • Werner Hoch
    Werner Hoch
    2009-01-02

    Hope it's ok to use this bug to add a problem with the DESTDIR variable and the make install command.

    I'm trying to create a rpm package of verilog 0.8.7 for openSUSE distributions.

    currently make install fails with the DESTDIR variable set.
    -------
    verilog/verilog-0.8.7> make DESTDIR=XX install
    [...]
    ./mkinstalldirs XX/usr/local/bin XX/usr/local/include/iverilog-0.8 XX/usr/local/lib/ivl-0.8 \ XX/usr/local/lib/ivl-0.8/include XX/usr/local/share/man XX/usr/local/share/man/man1
    /usr/bin/install -c ./ivl XX/usr/local/lib/ivl-0.8/ivl
    /usr/bin/install -c -m 644 ./ivl_target.h /usr/local/include/iverilog-0.8/ivl_target.h
    /usr/bin/install: cannot create regular file `/usr/local/include/iverilog-0.8/ivl_target.h': No such file or directory
    make: *** [/usr/local/include/iverilog-0.8/ivl_target.h] Error 1
    -------

    Regards
    Werner

     
  • Werner Hoch
    Werner Hoch
    2009-01-02

    I've made a patch that adds the $(DESTDIR) too the install sections in the Makefile.in files where it's been missing.

    I'll send the patch to the -devel mailing list. Don't find the button, where I can attach something to that tracker item.

    Regards
    Werner

     
  • Cary R.
    Cary R.
    2009-01-02

    Werner,

    Patches are normally added to the patch tracker (tracker->patches). It appears that only privileged users and the original author can add files to an existing report.

     
1 2 > >> (Page 1 of 2)