Fixed: C compiler cannot create executables

Anders F Björklund afb at
Sun Sep 28 00:56:07 PDT 2008

Martin Krischik wrote:

>> He said it was 13MB.  So my guess is that some script did a
>>  cp foo /usr/local
>> expected that /usr/local already existed as a directory.
> This is why the "--target-directory" was invented (at least for gnu's
> cp). Very helpful for scripts. Also very helpful is "setopt
> Err_Exit" (Z-Shell - for bash some obscure command with "-e"). Just
> imagine the cd goes wrong in:
> cd /tmp
> grm --force --recursive *(U)
> and Err_Exit is off. (Again Z-Shell - bash does not know about "(U)" -
> which would make the command combination even more disastrous).

The Portable Paranoid's version is to use e.g. "cp foo /usr/local/"
That will complain if not existing, and use /usr/local// otherwise.

But one can't get carried away and use that workaround everywhere... (problems with prefix slash)

The best is usually if the installation scripts make sure that the
directories are created first, which also helps when using DESTDIR:

mkdir -p /usr/local
cp foo /usr/local


More information about the macports-users mailing list