OS X for Intel: tools/makedep.c (req for linux build)
steve zellers
zellers at mac.com
Tue Jul 12 19:19:15 CDT 2005
ChangeLog entries:
* tools/makedep.c:
Fix dependency generation to work on non-apple platforms again.
The problem here is that the mig generated .defs.h file needs
to be included on OS X but ignored on other platforms. Additionally,
because of the two level namespace issues with dyld, the OS X version
of port.c in winelib needs to include the actual pthread.c
implementation,
which it does using a relative path. So I'm allowing that in the
dependency
analyzer. I consider this a hack, though, and will be submitting
some Makefile
changes to more directly include pthread.c in dylib. (But I wanted
to get changes
that fixed the linux build back in...)
* dlls/dbghelp/elf_module.c:
Added is_ignored for files that should be ignored on various platforms.
Removed APPLE considtionals around the pthread.c inclusion hack; if
makedep relied
on the preprocessor before generating its dependencies, this could've
stayed.
diff -urN wine/tools/makedep.c wine_patched/tools/makedep.c
--- tools/makedep.c 2005-07-12 16:52:46.000000000 -0700
+++ tools/makedep.c 2005-07-12 17:05:34.000000000 -0700
@@ -125,11 +125,30 @@
*/
static int is_generated( const char *name )
{
- static const char * const extensions[] = { ".tab.h", ".mc.rc"
-#ifdef __APPLE__
- , ".defs.h"
+ static const char * const extensions[] = { ".tab.h", ".mc.rc",
".defs.h" };
+ size_t i, len = strlen(name);
+ for (i = 0; i < sizeof(extensions)/sizeof(extensions[0]); i++)
+ {
+ if (len <= strlen(extensions[i])) continue;
+ if (!strcmp( name + len - strlen(extensions[i]), extensions
[i] )) return 1;
+ }
+ return 0;
+}
+
+
+/*******************************************************************
+ * is_ignored
+ *
+ * Test if a given file type should be ignored during dependency
analysis.
+ * Some platforms may not have all generated files.
+ */
+static int is_ignored( const char *name )
+{
+#if __APPLE__
+ static const char * const extensions[] = { };
+#else
+ static const char * const extensions[] = { ".defs.h" };
#endif
- };
size_t i, len = strlen(name);
for (i = 0; i < sizeof(extensions)/sizeof(extensions[0]); i++)
{
@@ -191,11 +210,9 @@
/* enforce some rules for the Wine tree */
if (!memcmp( name, "../", 3 ))
-#ifdef __APPLE__
- if (strcmp( name, "../../loader/pthread.c" ))
- fatal_error( "%s:%d: #include directive with relative path
not allowed\n",
- pFile->filename, line );
-#endif
+ if (strcmp( name, "../../loader/pthread.c" ))
+ fatal_error( "%s:%d: #include directive with relative
path not allowed\n",
+ pFile->filename, line );
if (!strcmp( name, "config.h" ))
{
@@ -407,6 +424,9 @@
char *ext;
FILE *file;
+ if (is_ignored( pFile->name))
+ return;
+
if (is_generated( pFile->name ))
{
/* file is generated during make, don't try to open it */
More information about the wine-patches
mailing list