Ticket Change Details
Not logged in
Overview

Artifact ID: f1d5901a28b4dadfcafb763cb3609b094c46806f
Ticket: 5a96dd5f528606db7addd8156bb7b5d5fdda158f
non-portable Makefile
User & Date: drh 2011-05-31 13:00:45
Changes

  1. comment changed to:
    Tested and seemed to work with both BSD make and gnu make on NetBSD system.
    
    <pre>
    --- Makefile
    +++ Makefile
    @@ -58,11 +58,11 @@
     
     # You should not need to change anything below this line
     ###############################################################################
     #
     # Automatic platform-specific options.
    -HOST_OS :sh = uname -s
    +HOST_OS= $(uname -s)
     
     LIB.SunOS= -lsocket -lnsl
     LIB += $(LIB.$(HOST_OS))
     
     TCC.DragonFly += -DUSE_PREAD
    </pre>
    
    <hr /><i>ben added on 2011-05-28 21:08:47 UTC:</i><br />
    That was changed recently for Solaris compatibility.
    
    According to the NetBSD man pages it should work on that system. Did you encounter a problem?
    
    <hr /><i>bharder added on 2011-05-29 18:21:17 UTC:</i><br />
    <pre>
    kamloops$ uname -a 
    NetBSD kamloops 5.99.52 NetBSD 5.99.52 (kamloops) #80: Sat May 28 14:09:40 PDT 2011  root@kamloops:/usr/obj/sys/arch/amd64/compile/kamloops amd64
    kamloops$ which make
    /usr/bin/make
    kamloops$ make
    make: don't know how to make sh. Stop
    
    make: stopped in /home/bch/work/fossil
    kamloops$ 
    </pre>
    
    With gnu make (gmake on my system), builds fine. The patch I submitted was tested on my system with both BSD make and GNU make and both built fine.
    
    <hr /><i>ben added on 2011-05-30 07:21:37 UTC:</i><br />
    I've created a configure-make branch which adds a ./configure step to building, and removes the non-cross-platform requirement for the Makefile to set a variable to the output of a shell command.
    
    This will break any packaging scripts, which is unfortunate. I'm not sure there's an alternative other than choosing a platform which requires patching to build -- which may be completely acceptable if that platform is a minority platform. (revert [9ef38b6b6d] and break Solaris?)
    
    <hr /><i>ben added on 2011-05-30 07:28:45 UTC:</i><br />
    BTW, I tried the alternative synax suggested in the ticket. While it works on Solaris, it doesn't work on FreeBSD. No error, but it doesn't include the extra -DUSE_PREAD for the compiler.
    
    <hr /><i>drh added on 2011-05-30 12:52:50 UTC:</i><br />
    No configure scripts, please.  If no makefile can be devised that works for
    Solaris and NetBSD, then we'll create separate Makefile.solaris and Makefile.netbsd files for those platforms.
    
    <hr /><i>ben added on 2011-05-30 16:49:12 UTC:</i><br />
    I've committed a Makefile which works on (at least) Mac OS X, Linux, FreeBSD, NetBSD and Solaris.
    
    For the *BSDs and Solaris, it won't work if GNU make is used. However, this is no worse than it was before I messed with it to get it to work under Solaris.
    
    <hr /><i>joerg added on 2011-05-30 16:51:59 UTC:</i><br />
    Well, the original syntax was working with all modern make implementations. Only the broken make on Solaris has issues with it. I'm quite more in favour of just accepting that Solaris userland is broken...
    
    <hr /><i>ben added on 2011-05-30 17:10:40 UTC:</i><br />
    The original syntax wasn't working with a 'modern' GNU make, but that didn't matter as it's only the non-GNU platforms which need these tweaks. (You'd only get a build as intended on those platforms if you used the normal make, not gmake.)
    
    <hr /><i>anonymous claiming to be mgagnon added on 2011-05-31 02:31:49 UTC:</i><br />
    I confirm, on version [3abab7e177] makefile tested and work with no problem on:
    
      - OpenBSD 4.9 using bsd make and gnu make
    
      - QNX 6.4.1 (which use gnu make)
     
    So, it seems to be the way to go.
    
  2. resolution changed to: "Fixed"
  3. status changed to: "Fixed"