diff -x CVS -ruN wine-20030217/tools/winebuild/import.c marcus-wine-20030217/tools/winebuild/import.c --- wine-20030217/tools/winebuild/import.c 2002-12-20 01:36:18.000000000 +0100 +++ marcus-wine-20030217/tools/winebuild/import.c 2003-01-13 17:54:10.000000000 +0100 @@ -569,7 +569,7 @@ static const char *ldcombine_files( char **argv ) { int i, len = 0; - char *cmd; + char *cmd, *ldcmd; int fd, err; if (output_file_name && output_file_name[0]) @@ -584,9 +584,11 @@ close( fd ); atexit( remove_ld_tmp_file ); + ldcmd = getenv("LD"); + if (!ldcmd) ldcmd="ld"; for (i = 0; argv[i]; i++) len += strlen(argv[i]) + 1; - cmd = xmalloc( len + strlen(ld_tmp_file) + 10 ); - sprintf( cmd, "ld -r -o %s", ld_tmp_file ); + cmd = xmalloc( len + strlen(ld_tmp_file) + 10 + strlen(ldcmd) ); + sprintf( cmd, "%s -r -o %s", ldcmd, ld_tmp_file ); for (i = 0; argv[i]; i++) sprintf( cmd + strlen(cmd), " %s", argv[i] ); err = system( cmd ); if (err) fatal_error( "ld -r failed with status %d\n", err );