# Buildsheet autogenerated by ravenadm tool -- Do not edit. NAMEBASE= imake VERSION= 1.0.10 KEYWORDS= devel VARIANTS= standard SDESC[standard]= X.Org imake program and related utilities HOMEPAGE= https://www.x.org/ CONTACT= nobody DOWNLOAD_GROUPS= main SITES[main]= XORG/individual/util DISTFILE[1]= imake-1.0.10.tar.xz:main DF_INDEX= 1 SPKGS[standard]= single OPTIONS_AVAILABLE= none OPTIONS_STANDARD= none BUILDRUN_DEPENDS= tradcpp:single:standard RUN_DEPENDS= xorg-cf-files:single:standard gccmakedep:single:standard makedepend:single:standard USES= perl:run pkgconfig shebangfix XORG_COMPONENTS= xorgproto LICENSE= MIT:single LICENSE_FILE= MIT:{{WRKSRC}}/COPYING LICENSE_SCHEME= solo FPC_EQUIVALENT= devel/imake SHEBANG_FILES= mkhtmlindex.pl MUST_CONFIGURE= gnu CONFIGURE_ARGS= --with-create-lib-cmd="ar cq" CONFIGURE_ENV= APP_MAN_SUFFIX=1 HAS_PERL=no post-patch: ${REINPLACE_CMD} -e 's|RAWCPP|"${PREFIX}/bin/tradcpp"|' \ ${WRKSRC}/imakemdep.h post-build: # This required with some C preprocessors and not others, # but is harmless when not required. ${REINPLACE_CMD} -e "s/^configdirspec= */configdirspec=/" \ ${WRKSRC}/xmkmf [FILE:224:descriptions/desc.single] The imake package contains Xorg's imake utility for generating Makefiles, plus the following support programs: - ccmakedep - cleanlinks - makeg - mergelib - mkdirhier - mkhtmlindex - revpath - xmkmf [FILE:98:distinfo] 75decbcea8d7b354cf36adc9675e53c4790ee3de56a14bd87b42c8e8aad2ecf5 155284 imake-1.0.10.tar.xz [FILE:240:manifests/plist.single] bin/ ccmakedep cleanlinks imake makeg mergelib mkdirhier mkhtmlindex revpath xmkmf share/man/man1/ ccmakedep.1.gz cleanlinks.1.gz imake.1.gz makeg.1.gz mergelib.1.gz mkdirhier.1.gz mkhtmlindex.1.gz revpath.1.gz xmkmf.1.gz [FILE:5463:patches/patch-imake.c] Beat some sense in. - Generate all files into the current (build) directory, not /tmp. - Do not delete any of the temporary files, to allow analysis after build failure. - Log the command lines executed. - Warn if scrubbing the Imakefile to alert the user to check if that broke it Also, - Use tradcpp's -debuglog feature to trace what happens in the templates (requires imake always be run with tradcpp) - Force ELF for all freebsd versions - Force use of just "gcc" - Recognize IMAKECPPFLAGS in the environment --- imake.c.orig 2024-01-08 18:34:07 UTC +++ imake.c @@ -303,9 +303,9 @@ void KludgeOutputLine(char **), KludgeRe const char *cpp = NULL; const char *tmpMakefile; -const char *tmpMakefileTemplate = "/tmp/Imf.XXXXXX"; +const char *tmpMakefileTemplate = ".imake.Makefile.XXXXXX"; const char *tmpImakefile; -const char *tmpImakefileTemplate = "/tmp/IIf.XXXXXX"; +const char *tmpImakefileTemplate = ".imake.Imakefile.XXXXXX"; const char *make_argv[ ARGUMENTS ] = { #ifdef WIN32 "nmake" @@ -319,7 +319,7 @@ int cpp_argindex; const char *Imakefile = NULL; const char *Makefile = "Makefile"; const char *Template = "Imake.tmpl"; -const char *ImakefileC = "Imakefile.c"; +const char *ImakefileC = ".imake.start.c"; boolean haveImakefileC = FALSE; const char *cleanedImakefile = NULL; const char *program; @@ -407,7 +407,8 @@ main(int argc, char *argv[]) if (fd == -1 || (tmpfd = fdopen(fd, "w+")) == NULL) { if (fd != -1) { - unlink(tmpMakefileName); close(fd); + /*unlink(tmpMakefileName);*/ + close(fd); } LogFatal("Cannot create temporary file %s.", tmpMakefileName); } @@ -449,12 +450,14 @@ showit(FILE *fd) void wrapup(void) { +#if 0 if (tmpMakefile != Makefile) unlink(tmpMakefile); if (cleanedImakefile && cleanedImakefile != Imakefile) unlink(cleanedImakefile); if (haveImakefileC) unlink(ImakefileC); +#endif } void @@ -479,6 +482,10 @@ init(void) while (cpp_argv[ cpp_argindex ] != NULL) cpp_argindex++; + /* pkgsrc: generate a debug trace of reading the templates */ + AddCppArg("-debuglog"); + AddCppArg(".imake.cpplog"); + #if defined CROSSCOMPILE if (sys == netBSD) if (CrossCompiling) { @@ -522,6 +529,14 @@ init(void) AddCppArg(p); } } + if ((p = getenv("IMAKECPPFLAGS"))) { + AddCppArg(p); + for (; *p; p++) + if (*p == ' ') { + *p++ = '\0'; + AddCppArg(p); + } + } if ((p = getenv("IMAKECPP"))) cpp = p; if ((p = getenv("IMAKEMAKE"))) @@ -764,6 +779,13 @@ doit(FILE *outfd, const char *cmd, const { int pid; waitType status; + unsigned i; + + fprintf(stderr, "imake: executing:"); + for (i=0; argv[i]; i++) { + fprintf(stderr, " %s", argv[i]); + } + fprintf(stderr, "\n"); /* * Fork and exec the command. @@ -1130,32 +1152,7 @@ get_ld_version(FILE *inFile) static void get_binary_format(FILE *inFile) { - int mib[2]; - size_t len; - int osrel = 0; - FILE *objprog = NULL; - int iself = 0; - char buf[10]; - char cmd[PATH_MAX]; - - mib[0] = CTL_KERN; - mib[1] = KERN_OSRELDATE; - len = sizeof(osrel); - sysctl(mib, 2, &osrel, &len, NULL, 0); - if (CrossCompiling) { - strcpy (cmd, CrossCompileDir); - strcat (cmd, "/"); - strcat (cmd,"objformat"); - } else - strcpy (cmd, "objformat"); - - if (osrel >= 300004 && - (objprog = popen(cmd, "r")) != NULL && - fgets(buf, sizeof(buf), objprog) != NULL && - strncmp(buf, "elf", 3) == 0) - iself = 1; - if (objprog) - pclose(objprog); + int iself = 1; fprintf(inFile, "#define DefaultToElfFormat %s\n", iself ? "YES" : "NO"); } @@ -1328,54 +1325,8 @@ get_gcc_version(FILE *inFile, char *name static boolean get_gcc(char *cmd) { - struct stat sb; - static const char* gcc_path[] = { -#if defined(linux) || \ - defined(__NetBSD__) || \ - defined(__OpenBSD__) || \ - defined(__FreeBSD__) || \ - defined(__DragonFly__) || \ - defined(__APPLE__) || \ - defined(__CYGWIN__) || \ - defined(__MINGW32__) || \ - defined(__GNU__) || \ - defined(__GLIBC__) - "/usr/bin/cc", /* for Linux PostIncDir */ -#endif - "/usr/local/bin/gcc", - "/opt/gnu/bin/gcc", - "/usr/pkg/bin/gcc" - }; - -#ifdef CROSSCOMPILE - static const char* cross_cc_name[] = { - "cc", - "gcc" - }; - - if (CrossCompiling) { - unsigned int i; - for (i = 0; i < sizeof (cross_cc_name) / sizeof cross_cc_name[0]; i++){ - strcpy (cmd, CrossCompileDir); - strcat (cmd, "/"); - strcat (cmd, cross_cc_name[i]); - if (lstat (cmd, &sb) == 0) { - return TRUE; - break; - } - } - } else -#endif - { - unsigned int i; - for (i = 0; i < sizeof (gcc_path) / sizeof gcc_path[0]; i++) { - if (lstat (gcc_path[i], &sb) == 0) { - strcpy (cmd, gcc_path[i]); - return TRUE; - } - } - } - return FALSE; + strcpy(cmd, "gcc"); + return TRUE; } #ifdef CROSSCOMPILE @@ -1786,12 +1737,15 @@ CleanCppInput(const char *imakefile) outFile = fdopen(fd, "w"); if (outFile == NULL) { if (fd != -1) { - unlink(tmpImakefileName); close(fd); + /*unlink(tmpImakefileName);*/ + close(fd); } LogFatal("Cannot open %s for write.", tmpImakefileName); } #endif + fprintf(stderr, "%s: Warning: cleaning Imakefile\n", + program); tmpImakefile = tmpImakefileName; } writetmpfile(outFile, punwritten, pbuf-punwritten, [FILE:4186:patches/patch-imakemdep.h] $NetBSD: patch-imakemdep.h,v 1.6 2016/09/17 17:49:36 richard Exp $ - Configure for pkgsrc: never set FIXUP_CPP_WHITESPACE as pkgsrc now always uses a whitespace-preserving cpp and fixing it twice causes bizarre lossage. - Remove all the "logic" for guessing how to invoke cpp, and get it via RAWCPP defined on the command line. - Make argv[0] for invoking cpp "cpp" by default. - Do not pass -m32 to cpp; it is not portable, valid, or even a reasonable thing to do. - Add support for __aarch64__ --- imakemdep.h.orig 2024-01-08 18:34:07 UTC +++ imakemdep.h @@ -229,7 +229,7 @@ in this Software without prior written a * all colons). One way to tell if you need this is to see whether or not * your Makefiles have no tabs in them and lots of @@ strings. */ -# if defined(sun) || defined(SYSV) || defined(SVR4) || defined(hcx) || defined(WIN32) || defined(__SCO__) || (defined(AMOEBA) && defined(CROSS_COMPILE)) || defined(__QNX__) || defined(__sgi) || defined(__UNIXWARE__) || defined(__LCC__) +# if 0 # define FIXUP_CPP_WHITESPACE # endif # ifdef WIN32 @@ -257,79 +257,7 @@ in this Software without prior written a * If the cpp you need is not in /lib/cpp, define DEFAULT_CPP. */ # if !defined (CROSSCOMPILE) || defined (CROSSCOMPILE_CPP) - -# if defined(__APPLE__) -# define DEFAULT_CPP "/usr/bin/cpp" -# define DEFAULT_CC "cc" -# endif -# if defined(Lynx) || defined(__Lynx__) -# define DEFAULT_CC "gcc" -# define USE_CC_E -# endif -# ifdef hpux -# define USE_CC_E -# endif -# ifdef WIN32 -# define USE_CC_E -# ifdef __GNUC__ -# define DEFAULT_CC "gcc" -# else -# define DEFAULT_CC "cl" -# endif -# endif -# ifdef apollo -# define DEFAULT_CPP "/usr/lib/cpp" -# endif -# if defined(clipper) || defined(__clipper__) -# define DEFAULT_CPP "/usr/lib/cpp" -# endif -# if defined(_IBMR2) && !defined(DEFAULT_CPP) -# define DEFAULT_CPP "/usr/ccs/lib/cpp" -# endif -# ifdef __bsdi__ -# define DEFAULT_CPP "/usr/bin/cpp" -# endif -# ifdef __uxp__ -# define DEFAULT_CPP "/usr/ccs/lib/cpp" -# endif -# ifdef __sxg__ -# define DEFAULT_CPP "/usr/lib/cpp" -# endif -# ifdef _CRAY -# define DEFAULT_CPP "/lib/pcpp" -# endif -# if defined(__386BSD__) -# define DEFAULT_CPP "/usr/libexec/cpp" -# endif -# if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) -# define USE_CC_E -# endif -# if defined(__sgi) && defined(__ANSI_CPP__) -# define USE_CC_E -# endif -# if defined(MACH) && !defined(__GNU__) -# define USE_CC_E -# endif -# ifdef __minix_vmd -# define DEFAULT_CPP "/usr/lib/cpp" -# endif -# ifdef __CYGWIN__ -# define DEFAULT_CC "gcc" -# define DEFAULT_CPP "/usr/bin/cpp" -# endif -# if defined (__QNX__) -# ifdef __QNXNTO__ -# define DEFAULT_CPP "/usr/bin/cpp" -# else -# define DEFAULT_CPP "/usr/X11R6/bin/cpp" -# endif -# endif -# if defined(__GNUC__) && !defined(USE_CC_E) -# define USE_CC_E -# ifndef DEFAULT_CC -# define DEFAULT_CC "gcc" -# endif -# endif +# define DEFAULT_CPP RAWCPP # endif /* !defined (CROSSCOMPILE) || defined (CROSSCOMPILE_CPP) */ /* @@ -352,7 +280,7 @@ in this Software without prior written a # define ARGUMENTS 50 /* number of arguments in various arrays */ # if !defined (CROSSCOMPILE) || defined (CROSSCOMPILE_CPP) const char *cpp_argv[ARGUMENTS] = { - "cc", /* replaced by the actual program to exec */ + "cpp", /* replaced by the actual program to exec */ "-I.", /* add current directory to include path */ # if !defined(__NetBSD_Version__) || __NetBSD_Version__ < 103080000 # ifdef unix @@ -365,9 +293,6 @@ const char *cpp_argv[ARGUMENTS] = { defined(__GNUC__) || defined(__GLIBC__) # ifdef __i386__ "-D__i386__", -# if defined(__GNUC__) && (__GNUC__ >= 3) - "-m32", -# endif # endif # ifdef __i486__ "-D__i486__", @@ -399,6 +324,9 @@ const char *cpp_argv[ARGUMENTS] = { # ifdef __arm__ "-D__arm__", # endif +# ifdef __aarch64__ + "-D__aarch64__", +# endif # ifdef __s390x__ "-D__s390x__", # endif [FILE:329:patches/patch-mdepend.cpp] --- mdepend.cpp.orig 2024-01-08 18:34:07 UTC +++ mdepend.cpp @@ -125,9 +125,6 @@ do shift ;; - # Flag to tell compiler to output dependencies directly - # For example, with Sun compilers, -xM or -xM1 or - # with gcc, -M -d) compilerlistsdepends="y" compilerlistdependsflag="$2"