summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2012-06-30 05:07:06 +0400
committerIgor Pashev <pashev.igor@gmail.com>2012-06-30 05:07:06 +0400
commit00febeb5ed49a2a0121ad1144da2cb131e680ecd (patch)
tree7a16780d253f521ee89bb63e0003bcc191f0f992
parentd6ed468d26624923dc18e44722cef0a7b9311962 (diff)
downloadsunmake-00febeb5ed49a2a0121ad1144da2cb131e680ecd.tar.gz
Porting to linux (in progress)
-rw-r--r--usr/src/make_src/Make/bin/make/common/depvar.cc4
-rw-r--r--usr/src/make_src/Make/bin/make/common/main.cc1
-rw-r--r--usr/src/make_src/Make/bin/make/common/nse_printdep.cc144
-rw-r--r--usr/src/make_src/Make/include/mksh/defs.h9
-rw-r--r--usr/src/make_src/Make/lib/bsd/src/bsd.cc29
-rw-r--r--usr/src/make_src/Make/lib/makestate/src/ld_file.c12
-rw-r--r--usr/src/make_src/Make/lib/mksh/src/misc.cc5
7 files changed, 26 insertions, 178 deletions
diff --git a/usr/src/make_src/Make/bin/make/common/depvar.cc b/usr/src/make_src/Make/bin/make/common/depvar.cc
index ee4be87..67ed329 100644
--- a/usr/src/make_src/Make/bin/make/common/depvar.cc
+++ b/usr/src/make_src/Make/bin/make/common/depvar.cc
@@ -63,11 +63,7 @@ depvar_add_to_list(Name name, Boolean cmdline)
{
Depvar dv;
-#ifdef SUNOS4_AND_AFTER
dv = ALLOC(Depvar);
-#else
- dv = (Depvar) Malloc(sizeof(struct _Depvar));
-#endif
dv->name = name;
dv->next = NULL;
dv->cmdline = cmdline;
diff --git a/usr/src/make_src/Make/bin/make/common/main.cc b/usr/src/make_src/Make/bin/make/common/main.cc
index 426dbf3..00192a8 100644
--- a/usr/src/make_src/Make/bin/make/common/main.cc
+++ b/usr/src/make_src/Make/bin/make/common/main.cc
@@ -86,6 +86,7 @@
#include <sys/errno.h> /* ENOENT */
#include <sys/stat.h> /* fstat() */
#include <fcntl.h> /* open() */
+#include <libintl.h> /* textdomain() */
#ifdef SUN5_0
# include <sys/systeminfo.h> /* sysinfo() */
diff --git a/usr/src/make_src/Make/bin/make/common/nse_printdep.cc b/usr/src/make_src/Make/bin/make/common/nse_printdep.cc
index 8b8785a..5cf973d 100644
--- a/usr/src/make_src/Make/bin/make/common/nse_printdep.cc
+++ b/usr/src/make_src/Make/bin/make/common/nse_printdep.cc
@@ -73,11 +73,7 @@ print_dependencies(register Name target, register Property line)
Dependency dp;
static Boolean makefiles_printed = false;
-#ifdef SUNOS4_AND_AFTER
if (target_variants) {
-#else
- if (is_true(flag.target_variants)) {
-#endif
depvar_print_results();
}
@@ -105,17 +101,11 @@ print_dependencies(register Name target, register Property line)
makefiles_printed = true;
}
print_deps(target, line);
-#ifdef SUNOS4_AND_AFTER
/*
print_more_deps(target, init);
print_more_deps(target, done);
*/
if (target_variants) {
-#else
- print_more_deps(target, cached_names.init);
- print_more_deps(target, cached_names.done);
- if (is_true(flag.target_variants)) {
-#endif
print_forest(target);
}
}
@@ -171,12 +161,8 @@ print_deps(register Name target, register Property line)
{
register Dependency dep;
-#ifdef SUNOS4_AND_AFTER
if ((target->dependency_printed) ||
(target == force)) {
-#else
- if (is_true(target->dependency_printed)) {
-#endif
return;
}
target->dependency_printed = true;
@@ -293,11 +279,7 @@ should_print_dep(Property line)
if (line->body.line.dependencies != NULL) {
return true;
}
-#ifdef SUNOS4_AND_AFTER
if (line->body.line.sccs_command) {
-#else
- if (is_true(line->body.line.sccs_command)) {
-#endif
return false;
}
return true;
@@ -314,13 +296,7 @@ print_forest(Name target)
Property line;
for (np = hashtab.begin(), e = hashtab.end(); np != e; np++) {
-#ifdef SUNOS4_AND_AFTER
if (np->is_target && !np->has_parent && np != target) {
-#else
- if (is_true(np->is_target) &&
- is_false(np->has_parent) &&
- np != target) {
-#endif
(void) doname_check(np, true, false, false);
line = get_prop(np->prop, line_prop);
printf("-\n");
@@ -329,120 +305,6 @@ print_forest(Name target)
}
}
-#ifndef SUNOS4_AND_AFTER
-printdesc()
-{
- Name_set::iterator p, e;
- register Property prop;
- register Dependency dep;
- register Cmd_line rule;
- Percent percent, percent_depe;
-
- /* Default target */
- if (default_target_to_build != NULL) {
- print_rule(default_target_to_build);
- default_target_to_build->dependency_printed= true;
- };
- (void)printf("\n");
-
- /* .AR_REPLACE */
- if (ar_replace_rule != NULL) {
- (void)printf("%s:\n", cached_names.ar_replace->string_mb);
- for (rule= ar_replace_rule; rule != NULL; rule= rule->next)
- (void)printf("\t%s\n", rule->command_line->string_mb);
- };
-
- /* .DEFAULT */
- if (default_rule != NULL) {
- (void)printf("%s:\n", cached_names.default_rule->string_mb);
- for (rule= default_rule; rule != NULL; rule= rule->next)
- (void)printf("\t%s\n", rule->command_line->string_mb);
- };
-
- /* .IGNORE */
- if (is_true(flag.ignore_errors))
- (void)printf("%s:\n", cached_names.ignore->string_mb);
-
- /* .KEEP_STATE: */
- if (is_true(flag.keep_state))
- (void)printf("%s:\n\n", cached_names.dot_keep_state->string_mb);
-
- /* .PRECIOUS */
- (void)printf("%s: ", cached_names.precious->string_mb);
- for (p = hashtab.begin(), e = hashtab.end(); p != e; p++)
- if (is_true(p->stat.is_precious | all_precious))
- (void)printf("%s ", p->string_mb);
- (void)printf("\n");
-
- /* .SCCS_GET */
- if (sccs_get_rule != NULL) {
- (void)printf("%s:\n", cached_names.sccs_get->string_mb);
- for (rule= sccs_get_rule; rule != NULL; rule= rule->next)
- (void)printf("\t%s\n", rule->command_line->string_mb);
- };
-
- /* .SILENT */
- if (is_true(flag.silent))
- (void)printf("%s:\n", cached_names.silent->string_mb);
-
- /* .SUFFIXES: */
- (void)printf("%s: ", cached_names.suffixes->string_mb);
- for (dep= suffixes; dep != NULL; dep= dep->next) {
- (void)printf("%s ", dep->name->string_mb);
- build_suffix_list(dep->name);
- };
- (void)printf("\n\n");
-
- /* % rules */
- for (percent= percent_list; percent != NULL; percent= percent->next) {
- (void) printf("%s:", percent->name->string_mb);
-
- for (percent_depe= percent->dependencies; percent_depe != NULL; percent_depe = percent_depe->next)
- (void) printf(" %s", percent_depe->name->string_mb);
-
- (void) printf("\n");
-
- for (rule= percent->command_template; rule != NULL; rule= rule->next)
- (void)printf("\t%s\n", rule->command_line->string_mb);
- };
-
- /* Suffix rules */
- for (p = hashtab.begin(), e = hashtab.end(); p != e; p++)
- if (is_false(p->dependency_printed) && (p->string[0] == PERIOD)) {
- print_rule(p);
- p->dependency_printed= true;
- };
-
- /* Macro assignments */
- for (p = hashtab.begin(), e = hashtab.end(); p != e; p++)
- if (((prop= get_prop(p->prop, macro_prop)) != NULL) &&
- (prop->body.macro.value != NULL)) {
- (void)printf("%s", p->string_mb);
- print_value(prop->body.macro.value,
- prop->body.macro.daemon);
- };
- (void)printf("\n");
-
- /* Delays */
- for (p = hashtab.begin(), e = hashtab.end(); p != e; p++)
- for (prop= get_prop(p->prop, conditional_prop);
- prop != NULL;
- prop= get_prop(prop->next, conditional_prop)) {
- (void)printf("%s := %s",
- p->string_mb,
- prop->body.conditional.name->string_mb);
- print_value(prop->body.conditional.value, no_daemon);
- };
- (void)printf("\n");
-
- /* All other dependencies */
- for (p = hashtab.begin(), e = hashtab.end(); p != e; p++)
- if (is_false(p->dependency_printed) && (p->colons != no_colon))
- print_rule(p);
- (void)printf("\n");
- exit(0);
-}
-#endif
/*
* This is a set of routines for dumping the internal make state
@@ -450,12 +312,6 @@ printdesc()
*/
void
print_value(register Name value, Daemon daemon)
-
-#ifdef SUNOS4_AND_AFTER
-
-#else
-
-#endif
{
Chain cp;
diff --git a/usr/src/make_src/Make/include/mksh/defs.h b/usr/src/make_src/Make/include/mksh/defs.h
index e8ae60e..35f96ad 100644
--- a/usr/src/make_src/Make/include/mksh/defs.h
+++ b/usr/src/make_src/Make/include/mksh/defs.h
@@ -953,7 +953,6 @@ extern Boolean do_not_exec_rule; /* `-n' */
extern Boolean dollarget_seen;
extern Boolean dollarless_flag;
extern Name dollarless_value;
-extern char **environ;
extern Envvar envvar;
#if defined(SUN5_0) || defined(HP_UX) || defined(linux)
extern int exit_status;
@@ -992,6 +991,14 @@ extern Boolean out_err_same;
extern pid_t childPid;
extern nl_catd libmksh_catd;
+#ifdef __cplusplus
+extern "C" {
+#endif
+extern char **environ;
+#ifdef __cplusplus
+}
+#endif
+
/*
* RFE 1257407: make does not use fine granularity time info available from stat.
* High resolution time comparison.
diff --git a/usr/src/make_src/Make/lib/bsd/src/bsd.cc b/usr/src/make_src/Make/lib/bsd/src/bsd.cc
index e968450..a09156f 100644
--- a/usr/src/make_src/Make/lib/bsd/src/bsd.cc
+++ b/usr/src/make_src/Make/lib/bsd/src/bsd.cc
@@ -42,35 +42,6 @@
/* Static data.
*/
-
-extern SIG_PF
-bsd_signal (int Signal, SIG_PF Handler)
-{
- auto SIG_PF previous_handler;
-#ifdef SUN5_0
-#ifdef sun
- previous_handler = sigset (Signal, Handler);
-#else
- auto struct sigaction new_action;
- auto struct sigaction old_action;
-
- new_action.sa_flags = SA_SIGINFO;
- new_action.sa_handler = (void (*) ()) Handler;
- (void) sigemptyset (&new_action.sa_mask);
- (void) sigaddset (&new_action.sa_mask, Signal);
-
- (void) sigaction (Signal, &new_action, &old_action);
-
- previous_handler = (SIG_PF) old_action.sa_handler;
-#endif
-#elif defined(linux)
- previous_handler = sigset (Signal, Handler);
-#else
- previous_handler = signal (Signal, Handler);
-#endif
- return previous_handler;
-}
-
extern void
bsd_signals (void)
{
diff --git a/usr/src/make_src/Make/lib/makestate/src/ld_file.c b/usr/src/make_src/Make/lib/makestate/src/ld_file.c
index b80ea68..2dd9cc7 100644
--- a/usr/src/make_src/Make/lib/makestate/src/ld_file.c
+++ b/usr/src/make_src/Make/lib/makestate/src/ld_file.c
@@ -37,6 +37,18 @@
#include <sys/param.h>
#include <link.h>
+#ifndef LD_SUP_DERIVED
+/*
+ * Flags passed to ld support calls.
+ * Defined in link.h on illumos.
+ */
+#define LD_SUP_DERIVED 0x1 /* derived filename */
+#define LD_SUP_INHERITED 0x2 /* file inherited from .so DT_NEEDED */
+#define LD_SUP_EXTRACTED 0x4 /* file extracted from archive */
+
+#endif
+
+
#define SUNPRO_DEPENDENCIES "SUNPRO_DEPENDENCIES"
/*
diff --git a/usr/src/make_src/Make/lib/mksh/src/misc.cc b/usr/src/make_src/Make/lib/mksh/src/misc.cc
index 2807193..91d362c 100644
--- a/usr/src/make_src/Make/lib/mksh/src/misc.cc
+++ b/usr/src/make_src/Make/lib/mksh/src/misc.cc
@@ -282,6 +282,11 @@ free_name(Name name)
* sigtvalue The original signal handler
* sighvalue The original signal handler
*/
+
+#ifndef SIG_PF
+typedef void (*SIG_PF)(int);
+#endif
+
void
enable_interrupt(register void (*handler) (int))
{