Ticket #17 (closed enhancement: fixed)

Opened 2 years ago

Last modified 2 years ago

Patch for build.d to work with posix/bsd/linux

Reported by: rasmus at-flajm-dot-se Assigned to: derek
Priority: Urgent Component: core
Version: 3.0 Severity: major
Keywords: r41 build.d posix unix linux "os x" Cc:

Description

Here's a patch for source:/trunk/Source/build.d#41

It contains changes which were needed for build to work properly on BSD/OS X 10.4 and Debian 3.1 Sarge. Changes in short:

  • Added vLinkOutputSwitch, previously hard-coded to "-o" This is different depending on the linker, so I made it change if version GNU and version Posix to "-of"
  • Added vLinkLibSwitch, previously hard-coded as "-l" As with -o, this depends on the linker. Set to "-l-L" for GNU/Posix.
  • Added vLinkerDebugSymInfoSwitch, replacing hard-coded "/co" (line 2408)
  • Switched to GDMD as default compiler and linker for GNU/Posix. GDMD is a compatibility interface provided by GDC, which uses the same switches and arguments as dmd (easier to maintain build if using a single compiler/linker interface)
  • Switched linker to GDMD, as mentioned above. No need to use another linker, when the functionality is built-in into GDC and DMD. (Though leaving it configurable if someone would like LD instead)
  • Changed vCompilerPath for version GNU/Posix to "" (as it's normally located in any of the dirs included in PATH. Previous value was OS-specific (FYI: /opt is used by port, a package manager availalbe on some systems. Commonly used on BSD, but not on redhat, debian or gentoo for example.))

The changes are attached as a diff (unidiff) file for easy patching as well as my complete copy.

Hoping for a more posix-friendly build in a near future ;)

/Rasmus

Attachments

build.d.r43.bsd-posix-fix.diff (4.2 kB) - added by rasmus at-flajm-dot-se on 05/02/06 17:39:28.
Modifications made to build.d r41
build.d (95.4 kB) - added by rasmus at-flajm-dot-se on 05/02/06 17:40:09.

Change History

05/02/06 17:39:28 changed by rasmus at-flajm-dot-se

  • attachment build.d.r43.bsd-posix-fix.diff added.

Modifications made to build.d r41

05/02/06 17:40:09 changed by rasmus at-flajm-dot-se

  • attachment build.d added.

05/15/06 21:28:33 changed by Derek Parnell

I've decided to remove all the hardcoded internal strings and replace them with configuration items. Now in the build.cfg file you can have lines such as ...

INT:LinkOutputSwitch = -of

This will help people customize the application for the tools that they use.

05/22/06 02:45:46 changed by Derek Parnell

  • status changed from new to closed.
  • version changed from 2.11 to 3.0.
  • resolution set to fixed.