On 09/17/10 05:14, Chuck Robey wrote:
On 09/16/10 20:34, Ivan Voras wrote:
On 09/16/10 08:58, srividy...@tcs.com wrote:
Hi
Is there any BSD make versions available for AIX platform?
We require the make utility of BSD to compile few source programs.

Is there any make utility compatible with AIX? Could you please give us
the URL where we can get the same?

FreeBSD's make is an integral part of the FreeBSD file system. It is not
created to be compatible across systems, but it is also not created to
prevent this kind of porting.

Wow. I disagree. It's been modified over the years to depend heavily on
a set of libraries that are available nowhere else but FreeBSD. This was

The fact that it can be compiled with "gcc '-DDEFSHELLNAME="sh"' -o make *.c" indicates that it in fact doesn't use any libraries except for libc...

done (from what I can see) in the name of elegance ... because the
actual functions ARE available elsewhere, but a bunch of modifications
need to be added, no possible way is it going to compile anywhere else.

Oh you're exaggerating, it's not that hard. I've made the attached patch in about 20 minutes, and most of it is including the small "lc.h" ad-hoc Linux compatibility header.

I don't claim the patched make will work perfectly but it works for simple cases :)

diff -u ../make/arch.c ./arch.c
--- ../make/arch.c      2010-09-17 12:56:04.000000000 +0200
+++ ./arch.c    2010-09-17 12:28:59.000000000 +0200
@@ -38,6 +38,7 @@
  * @(#)arch.c  8.2 (Berkeley) 1/2/94
  */
 
+#include "lc.h"
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
diff -u ../make/buf.c ./buf.c
--- ../make/buf.c       2010-09-17 12:56:04.000000000 +0200
+++ ./buf.c     2010-09-17 12:30:01.000000000 +0200
@@ -40,6 +40,7 @@
  * @(#)buf.c   8.1 (Berkeley) 6/6/93
  */
 
+#include "lc.h"
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
diff -u ../make/cond.c ./cond.c
--- ../make/cond.c      2010-09-17 12:56:04.000000000 +0200
+++ ./cond.c    2010-09-17 12:30:25.000000000 +0200
@@ -39,6 +39,7 @@
  * @(#)cond.c  8.2 (Berkeley) 1/2/94
  */
 
+#include "lc.h"
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
diff -u ../make/dir.c ./dir.c
--- ../make/dir.c       2010-09-17 12:56:04.000000000 +0200
+++ ./dir.c     2010-09-17 12:30:56.000000000 +0200
@@ -39,6 +39,7 @@
  * @(#)dir.c   8.2 (Berkeley) 1/2/94
  */
 
+#include "lc.h"
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
diff -u ../make/for.c ./for.c
--- ../make/for.c       2010-09-17 12:56:04.000000000 +0200
+++ ./for.c     2010-09-17 12:31:32.000000000 +0200
@@ -32,6 +32,7 @@
  * @(#)for.c   8.1 (Berkeley) 6/6/93
  */
 
+#include "lc.h"
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
diff -u ../make/hash.c ./hash.c
--- ../make/hash.c      2010-09-17 12:56:04.000000000 +0200
+++ ./hash.c    2010-09-17 12:37:44.000000000 +0200
@@ -39,6 +39,7 @@
  * @(#)hash.c  8.1 (Berkeley) 6/6/93
  */
 
+#include "lc.h"
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
diff -u ../make/hash_tables.c ./hash_tables.c
--- ../make/hash_tables.c       2010-09-17 12:56:04.000000000 +0200
+++ ./hash_tables.c     2010-09-17 12:37:58.000000000 +0200
@@ -4,6 +4,7 @@
  * auto-generated from FreeBSD: src/usr.bin/make/parse.c,v 1.114 2008/03/12 
14:50:58 obrien Exp 
  * DO NOT EDIT
  */
+#include "lc.h"
 #include <sys/types.h>
 
 #include "hash_tables.h"
diff -u ../make/job.c ./job.c
--- ../make/job.c       2010-09-17 12:56:04.000000000 +0200
+++ ./job.c     2010-09-17 12:38:12.000000000 +0200
@@ -39,6 +39,7 @@
  * @(#)job.c   8.2 (Berkeley) 3/19/94
  */
 
+#include "lc.h"
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
Only in .: lc.h
Only in .: .lc.h.swp
diff -u ../make/lst.c ./lst.c
--- ../make/lst.c       2010-09-17 12:56:04.000000000 +0200
+++ ./lst.c     2010-09-17 12:38:23.000000000 +0200
@@ -36,7 +36,7 @@
  * lst.c --
  *     Routines to maintain a linked list of objects.
  */
-
+#include "lc.h"
 #include <stdio.h>
 #include <stdlib.h>
 
diff -u ../make/main.c ./main.c
--- ../make/main.c      2010-09-17 12:56:04.000000000 +0200
+++ ./main.c    2010-09-17 12:55:03.000000000 +0200
@@ -37,6 +37,8 @@
  *
  * @(#)main.c      8.3 (Berkeley) 3/19/94
  */
+#include "lc.h"
+#undef __unused
 
 #ifndef lint
 #if 0
@@ -372,7 +374,7 @@
 
 rearg:
        optind = 1;     /* since we're called more than once */
-       optreset = 1;
+/*     optreset = 1;*/
 #define OPTFLAGS "ABC:D:d:E:ef:I:ij:km:nPpQqrSstV:vXx:"
        for (;;) {
                if ((optind < argc) && strcmp(argv[optind], "--") == 0) {
@@ -529,7 +531,7 @@
                        MFLAGS_append("-q", NULL);
                        break;
                case 'r':
-                       noBuiltins = TRUE;
+                       noBuiltins = !noBuiltins;
                        MFLAGS_append("-r", NULL);
                        break;
                case 'S':
@@ -892,7 +894,7 @@
         * Initialize file global variables.
         */
        expandVars = TRUE;
-       noBuiltins = FALSE;             /* Read the built-in rules */
+       noBuiltins = TRUE;              /* Read the built-in rules */
        forceJobs = FALSE;              /* No -j flag */
        curdir = cdpath;
 
@@ -941,6 +943,7 @@
         * to compile new make binary on old FreeBSD/pc98 systems, and
         * have the MACHINE variable set properly.
         */
+#ifdef __FreeBSD__
        if ((machine = getenv("MACHINE")) == NULL) {
                int     ispc98;
                size_t  len;
@@ -951,7 +954,7 @@
                                machine = "pc98";
                }
        }
-
+#endif
        /*
         * Get the name of this type of MACHINE from utsname
         * so we can share an executable for similar machines.
diff -u ../make/make.c ./make.c
--- ../make/make.c      2010-09-17 12:56:04.000000000 +0200
+++ ./make.c    2010-09-17 12:38:32.000000000 +0200
@@ -38,6 +38,7 @@
  * @(#)make.c  8.1 (Berkeley) 6/6/93
  */
 
+#include "lc.h"
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
diff -u ../make/parse.c ./parse.c
--- ../make/parse.c     2010-09-17 12:56:04.000000000 +0200
+++ ./parse.c   2010-09-17 12:38:48.000000000 +0200
@@ -38,6 +38,7 @@
  * @(#)parse.c 8.3 (Berkeley) 3/19/94
  */
 
+#include "lc.h"
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
diff -u ../make/proc.c ./proc.c
--- ../make/proc.c      2010-09-17 12:56:04.000000000 +0200
+++ ./proc.c    2010-09-17 12:38:58.000000000 +0200
@@ -24,6 +24,7 @@
  * SUCH DAMAGE.
  */
 
+#include "lc.h"
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
Common subdirectories: ../make/PSD.doc and ./PSD.doc
diff -u ../make/shell.c ./shell.c
--- ../make/shell.c     2010-09-17 12:56:04.000000000 +0200
+++ ./shell.c   2010-09-17 12:39:06.000000000 +0200
@@ -37,6 +37,7 @@
  * SUCH DAMAGE.
  */
 
+#include "lc.h"
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
diff -u ../make/str.c ./str.c
--- ../make/str.c       2010-09-17 12:56:04.000000000 +0200
+++ ./str.c     2010-09-17 12:39:16.000000000 +0200
@@ -38,6 +38,7 @@
  * @(#)str.c   5.8 (Berkeley) 6/1/90
  */
 
+#include "lc.h"
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
diff -u ../make/suff.c ./suff.c
--- ../make/suff.c      2010-09-17 12:56:04.000000000 +0200
+++ ./suff.c    2010-09-17 12:39:24.000000000 +0200
@@ -38,6 +38,7 @@
  * @(#)suff.c  8.4 (Berkeley) 3/21/94
  */
 
+#include "lc.h"
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
Common subdirectories: ../make/.svn and ./.svn
diff -u ../make/targ.c ./targ.c
--- ../make/targ.c      2010-09-17 12:56:04.000000000 +0200
+++ ./targ.c    2010-09-17 12:39:35.000000000 +0200
@@ -38,6 +38,7 @@
  * @(#)targ.c  8.2 (Berkeley) 3/19/94
  */
 
+#include "lc.h"
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
diff -u ../make/util.c ./util.c
--- ../make/util.c      2010-09-17 12:56:04.000000000 +0200
+++ ./util.c    2010-09-17 12:39:45.000000000 +0200
@@ -39,6 +39,7 @@
  * @(#)main.c      8.3 (Berkeley) 3/19/94
  */
 
+#include "lc.h"
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
diff -u ../make/var.c ./var.c
--- ../make/var.c       2010-09-17 12:56:04.000000000 +0200
+++ ./var.c     2010-09-17 12:39:54.000000000 +0200
@@ -39,6 +39,7 @@
  * @(#)var.c   8.3 (Berkeley) 3/19/94
  */
 
+#include "lc.h"
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"

Reply via email to