]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
osx: simplify build
authorVincent Bernat <vincent@bernat.im>
Sun, 31 Jan 2016 14:41:07 +0000 (15:41 +0100)
committerVincent Bernat <vincent@bernat.im>
Sun, 31 Jan 2016 14:56:27 +0000 (15:56 +0100)
We don't need to support multiple archs anymore. Therefore, no need for
lipo. Also, no need for rebuild. We can use the current build.

README.md
osx/Makefile.am
osx/lipo [deleted file]
osx/resources/license.html

index eb04adae7fa7b6f416d270dd9b0e3aeb5a4cd3ac..b3fe604f405082505913ad507b41205b40b94733 100644 (file)
--- a/README.md
+++ b/README.md
@@ -69,13 +69,12 @@ simpler alternatives:
         brew install https://raw.github.com/vincentbernat/lldpd/master/osx/lldpd.rb
 
  2. Build an OS X installer package which should work on the same
-    version of OS X (it is important to use a separate build
-    directory):
+    version of OS X:
  
         mkdir build && cd build
         ../configure --prefix=/usr --localstatedir=/var --sysconfdir=/private/etc --with-embedded-libevent \
             --without-json --without-snmp
-        make -C osx pkg ARCHS="i386 x86_64"
+        make -C osx pkg
 
     If you want to compile for an older version of OS X, you need
     to find the right SDK and issues commands like those:
@@ -86,7 +85,7 @@ simpler alternatives:
            --without-json --without-snmp \
            CFLAGS="-mmacosx-version-min=10.6 -isysroot $SDK" \
            LDFLAGS="-mmacosx-version-min=10.6 -isysroot $SDK"
-        make -C osx pkg ARCHS="i386 x86_64"
+        make -C osx pkg
 
 If you don't follow the above procedures, you will have to create the
 user/group `_lldpd`. Have a look at how this is done in
index 7f152e1c43c7314af1ddc8a7ffdd3fa9053af2d3..7d128cf3a3fb5817734e31d20e2c20cda63f5d0d 100644 (file)
@@ -1,4 +1,4 @@
-EXTRA_DIST  = resources lipo
+EXTRA_DIST  = resources
 EXTRA_DIST += distribution.xml.in im.bernat.lldpd.plist.in scripts/postinstall.in scripts/preinstall.in
 TEMPLATES   = distribution.xml    im.bernat.lldpd.plist    scripts/postinstall    scripts/preinstall
 
@@ -14,7 +14,6 @@ requirements:
 PKG_NAME=@PACKAGE@-@VERSION@.pkg
 PKG_TITLE=@PACKAGE@ @VERSION@
 PKG_DIR=@PACKAGE@-@VERSION@
-ARCHS=@host_cpu@
 
 # Main target is `pkg`
 pkg: requirements ../$(PKG_NAME)
@@ -43,20 +42,8 @@ pkg.1/$(PKG_NAME): $(PKG_DIR) scripts/postinstall scripts/preinstall
                $@
 
 $(PKG_DIR): stamp-$(PKG_DIR)
-stamp-$(PKG_DIR): $(ARCHS:%=%/$(PKG_DIR))
-       $(srcdir)/lipo $(PKG_DIR) $^
-       touch $@
-
-pkg_curarch = $(@:stamp-%=%)
-$(ARCHS:%=%/$(PKG_DIR)): %/$(PKG_DIR): stamp-%
-$(ARCHS:%=stamp-%): stamp-%: im.bernat.lldpd.plist
-       [ -d $(pkg_curarch) ] || mkdir -p $(pkg_curarch)
-       (cd $(pkg_curarch) && \
-               $(abs_top_srcdir)/configure @CONFIGURE_ARGS@ \
-                       CC="@CC@ -arch $(pkg_curarch)" \
-                       CPP="@CPP@")
-       (cd $(pkg_curarch) && \
-               $(MAKE) install DESTDIR=$(abs_builddir)/$(pkg_curarch)/$(PKG_DIR))
+stamp-$(PKG_DIR): im.bernat.lldpd.plist
+       $(MAKE) -C .. install DESTDIR=$(abs_builddir)/$(PKG_DIR)
        touch $@
 
 # Install launchd plist
diff --git a/osx/lipo b/osx/lipo
deleted file mode 100755 (executable)
index b229803..0000000
--- a/osx/lipo
+++ /dev/null
@@ -1,56 +0,0 @@
-#!/usr/bin/env python
-
-"""Apply lipo recursively to trees.
-"""
-
-import sys
-import os
-import shutil
-import subprocess
-
-# Parse arguments
-import argparse
-parser = argparse.ArgumentParser(description=sys.modules[__name__].__doc__,
-                                 formatter_class=argparse.RawDescriptionHelpFormatter)
-parser.add_argument("output", help="Output tree")
-parser.add_argument("input", help="Input trees", nargs="+")
-options = parser.parse_args()
-output = options.output
-inputs = options.input
-
-def ismacho(path):
-    """Check if a file is Mach-O"""
-    fnull = open(os.devnull, "w")
-    try:
-        subprocess.check_call(["lipo", "-info", path], stdout=fnull, stderr=fnull)
-    except subprocess.CalledProcessError:
-        return False
-    return True
-
-# Copy
-for root, dirs, files in os.walk(inputs[0]):
-    # Create root directory in output
-    oroot = root[len(inputs[0]):].lstrip("/")
-    oroot = os.path.join(output, oroot)
-    if not os.path.isdir(oroot):
-        os.makedirs(oroot)
-        shutil.copystat(root, oroot)
-
-    # Copy files
-    for f in files:
-        of = os.path.join(oroot, f)
-        f = os.path.join(root, f)
-        if os.path.islink(f):
-            # Symlink
-            linkto = os.readlink(f)
-            os.symlink(linkto, of)
-        elif ismacho(f):
-            sff = [ os.path.join(r, f[len(inputs[0]):].lstrip("/"))
-                    for r in inputs ]
-            args = [ "lipo", "-create", "-output", of ]
-            args.extend(sff)
-            subprocess.check_call(args)
-        else:
-            # Regular file, just copy from the first input directory
-            shutil.copyfile(f, of)
-            shutil.copystat(f, of)
index 070627aea8cd5224292d02f0fa6d82ce3d0951cb..1689fc81acce3a5535b24bb675e230b3ecfcf38c 100644 (file)
@@ -1,7 +1,7 @@
 <html>
   <body style="font-family: Gill Sans, sans-serif">
     <p>
-      Copyright &copy; 2013 <a href="mailto:bernat@luffy.cx">Vincent Bernat</a>
+      Copyright &copy; 2013-2016 <a href="mailto:bernat@luffy.cx">Vincent Bernat</a>
     </p>
  
     <p>