1

I am building some software, which is currently unsupported, that uses Imakefiles. The software does have a Imake.tmpl file. It is located (relative to the top directory) in config/cf/Imake.tmpl.

As the software has subdirectories containing other Imakefiles I typed (following this man page):

 xmkmf -a . . 

The first dot is for the top directory and the second dot is for the current directory.

I got this error:

 mv -f Makefile Makefile.bak
 imake -I./config/cf -DTOPDIR=. -DCURDIR=.
In file included from Imakefile.c:34:0:
./config/cf/Imake.tmpl:33:0: fatal error: site.def: No such file or directory
 #include <site.def>
 ^compilation terminated.
  imake: Exit code 1.
  Stop.

The site.def file does exist and it is located under config/project/site.def.

This is the content of the Imakefile.c that is generated by imake. This file is removed when imake finishes execution, but it can be retained by creating a link to that file.

/* imake - temporary file */
#define DefaultOSName Linux 4.13.0-36-generic x86_64
#define DefaultOSMajorVersion 
#define LinuxDebian     4
#define LinuxInfoMagic  5
#define LinuxKheops     6
#define LinuxPro        7
#define LinuxRedHat     8
#define LinuxSlackware  9
#define LinuxTurbo      10
#define LinuxWare       11
#define LinuxYggdrasil  12
#define DefaultLinuxDistribution LinuxDebian
#define DefaultLinuxDistName Debian
#define HasGcc 1
#define HasGcc2 1
#define HasGcc3 1
#define GccMajorVersion 5
#define GccMinorVersion 2
#define INCLUDE_IMAKEFILE </tmp/IIf.j7V6mk>
#define IMAKE_TEMPLATE "Imake.tmpl"
#include IMAKE_TEMPLATE

Any suggestions would be appreciated.

  • 1
    Unfortunately I don't know enough about imake to give a good answer, but it's clear that it looks in the wrong directory for site.def, or that this file is located in the wrong place. As an unqualified hack, try creating a symbolic link in config/cf called site.def that points to config/project/site.def (or copy the file there), just to see what happens. – Kusalananda Mar 9 '18 at 6:44
  • @Kusalananda - Great piece of advice ! That worked !! When I did that it reported a whole bunch of other files that were missing. I am moving those one by one !!! – gansub Mar 9 '18 at 6:57
  • @Kusalananda You can write this up and I will upvote and accept. – gansub Mar 9 '18 at 6:58
1

Note: I'm not a regular user of imake and I don't really know much about how that build system is supposed to work.

It is clear from the error that imake is looking for files to include under config/cf, but that the site.def file is located in config/project.

A hack would be to either symbolically link the site.def file from its current location to config/cf, or to make a copy of the file in that location.

This is a hack though, and I'm sure that the software that you are building can be built correctly without it. You should consult the software's documentation. It may be that xmkmf needs to be run in another directory, or that one of the Imakefile files could easily be modified to add an additional -I flag to the project.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.