Closed Bug 440068 Opened 16 years ago Closed 15 years ago

Pork/Piglet: package and document

Categories

(Developer Infrastructure :: Source Code Analysis, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: dmandelin, Assigned: dmandelin)

References

Details

Attachments

(2 files)

Piglet is a lightweight system for using Elsa as a static library. It should be packaged up, added to Pork, and documented on MDC.
Blocks: 438061
packaged:

http://hg.mozilla.org/users/tglek_mozilla.com/piglet

Now it's a matter of 
a) moving my tools out of oink into piglet
b) nuking oink
c) sticking all of elsa deps into elsa dir so pork consists of elsa/ + piglet/ dirs. I think in a checkout elsa/ would be a subdir of piglet.
Attached patch configureSplinter Review
Attachment #372473 - Flags: review?
Attachment #372473 - Flags: review? → review?(jones.chris.g)
Attachment #372473 - Flags: review?(jones.chris.g) → review+
Comment on attachment 372473 [details] [diff] [review]
configure

>diff --git a/configure b/configure
>new file mode 100755
>--- /dev/null
>+++ b/configure
>@@ -0,0 +1,60 @@
>+#!/usr/bin/env python

Need a license block here?

>+# Author: Taras Glek
>+import getopt, sys, os.path, os, platform, subprocess
>+
>+def usage():
>+    print """
>+Usage: ./configure ...
>+--with-rewriting-cxx=compiler with MCPP(used for rewriting)
>+--pork-dir=Directory with pork, ie one that contains elsa/ dir
>+""".strip()
>+    pass
>+
>+def error(msg):
>+    print >> sys.stderr, "Error: " + msg
>+    sys.exit(1)
>+
>+def checkdir(path,opt):
>+    print "Checking " + opt + ": " + path
>+    if not os.path.isdir (path):
>+        error("directory '"+path+"' doesn't exist, specify corect directory with --" + opt)
>+    else:
>+        return os.path.abspath(path)
>+
>+if __name__ == "__main__":
>+    try:
>+        opts, args = getopt.getopt(sys.argv[1:], "h",
>+                                   ["with-rewriting-cxx=","pork-dir="])
>+    except getopt.GetoptError, err:
>+        # print help information and exit:
>+        print str(err) # will print something like "option -a not recognized"
>+        usage()
>+        sys.exit(2)
>+    rewriting_cxx = "g++"
>+    pork_dir = None
>+    for o, val in opts:
>+        if o == "--with-rewriting-cxx":
>+            rewriting_cxx = val
>+        elif o == "--pork-dir":
>+            pork_dir = val
>+        elif o in ("-h", "--help"):
>+            usage()
>+            exit(0)
>+        else:
>+            error("unhandled option " +  o)
>+    if (pork_dir):
>+        pork_dir = checkdir(pork_dir  +"/elsa", "pork-dir")

It'd be nice to also have sanity checks for the other pork tools: piglet, pork-barrel, and porky.

>+    else:
>+        error("run configure with --pork-dir=");
>+    config = dict(REWRITING_CXX=rewriting_cxx,
>+                  PORK_DIR=pork_dir)

... and similarly generate PIGLET_DIR, etc.  Not hugely important, though, since they can be constructed from PORK_DIR.  It's also be great to have paths here for LIBELSA and LIBPORK/LIBPIGLET.

This suits my needs.
Comment on attachment 372822 [details] [diff] [review]
updated build system to better support porky

Good stuff
Attachment #372822 - Flags: review?(tglek) → review+
pushed http://hg.mozilla.org/users/tglek_mozilla.com/piglet/rev/9c016ea0e1f1
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Product: Core → Firefox Build System
Product: Firefox Build System → Developer Infrastructure
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: