# cannot install gmake



## dougs (May 6, 2011)

I experienced a hard drive dying on a FreeBSD 8.0 machine (several unrecoverable sectors). I cloned it to a new drive using dump and found that many files were missing from /usr (especially the php5 extensions) so restored /usr from a backup. All files except for a few in /usr/bin copied over from the backup just fine. Next I wanted to rebuild all ports so did a *portmaster -af*. After successfully rebuilding three ports, it coughed on gmake as follows:


```
===>  Extracting for gmake-3.82
=> SHA256 Checksum OK for make-3.82.tar.bz2.
===>  Patching for gmake-3.82
===>  Applying FreeBSD patches for gmake-3.82
1 out of 1 hunks failed--saving rejects to make.h.rej
=> Patch patch-make.h failed to apply cleanly.
=> Patch(es) patch-ab applied cleanly.
*** Error code 1

Stop in /usr/ports/devel/gmake.
corvus-root@/usr/ports/devel/gmake:
```

and stopped dead in its tracks.

Contents of make.h.rej as follows:


```
corvus-root@/usr/ports/devel/gmake/work/make-3.82: less make.h.rej
***************
*** 33,39 ****
  #  ifdef _AIX
   #pragma alloca
  #  else
- #   ifndef alloca /* predefined by HP cc +Olibcalls */
  char *alloca ();
  #   endif
  #  endif
--- 33,39 ----
  #  ifdef _AIX
   #pragma alloca
  #  else
+ #   if !defined (alloca) && !defined (__FreeBSD__) /* predefined by HP cc +Olibcalls, part of stdlib.h on FreeBSD */
  char *alloca ();
  #   endif
  #  endif
```

I googled around for information on this issue and couldn't find anything. I tried *make deinstall clean* and *make install* to no avail. It stops and gives me the same error message. Does anyone know what I could do in this situation?

~Doug


----------



## adamk (May 6, 2011)

Does /usr/bin/patch exist?

Adam


----------



## dougs (May 6, 2011)

adamk said:
			
		

> Does /usr/bin/patch exist?




```
corvus-root@/usr/bin: ll patch*
-r-xr-xr-x  1 root  wheel  44768 Mar  9  2010 patch
corvus-root@/usr/bin:
```

Think so.


----------



## wblock@ (May 6, 2011)

dougs said:
			
		

> ```
> ===>  Extracting for gmake-3.82
> => SHA256 Checksum OK for make-3.82.tar.bz2.
> ===>  Patching for gmake-3.82
> ...



patch-make.h was deleted three weeks ago.  Update your ports tree.


----------



## dougs (May 6, 2011)

wblock said:
			
		

> patch-make.h was deleted three weeks ago.  Update your ports tree.



Yup. Did that. *portsnap fetch update* followed by *pkg_version -vL=* which showed no ports in need of updating.


----------



## wblock@ (May 6, 2011)

The first use of portsnap has to be an extract.  If you did that the first time, I don't know why /usr/ports/devel/gmake/files/patch-make.h still exists.  Deleting it manually should let gmake build and install, but other things might be wrong.


----------



## dougs (May 6, 2011)

wblock said:
			
		

> The first use of portsnap has to be an extract.  If you did that the first time, I don't know why /usr/ports/devel/gmake/files/patch-make.h still exists.  Deleting it manually should let gmake build and install, but other things might be wrong.



Right. I've decided to rebuild world & kernel just to be on the safe side. After that, I plan on rebuilding the entire ports. I'll let you know how this goes.


----------



## wblock@ (May 6, 2011)

dougs said:
			
		

> Right. I've decided to rebuild world & kernel just to be on the safe side.  After that, I plan on rebuilding the entire ports. I'll let you know how this goes.



Not sure what that will accomplish.  The problem looks to be in the method used to update the files in /usr/ports.


----------

