build-sys: linkedin loader generation fixes.
authorKrisztian Litkey <kli@iki.fi>
Thu, 18 Oct 2012 15:28:45 +0000 (18:28 +0300)
committerKrisztian Litkey <krisztian.litkey@intel.com>
Fri, 26 Oct 2012 16:32:56 +0000 (19:32 +0300)
build-aux/gen-linkedin-loader
src/Makefile.am

index 2698cb3..fc14ac7 100644 (file)
@@ -46,9 +46,8 @@ warning () {
 }
 
 usage () {
-    info "usage: $0 [-p <plugin>] [-l <plugin-list>] -o <output-file>"
     info "usage: $0 -p <plugin> -o <output-file>, or"
-    info "usage: $0 -o <output-file> <plugin-list>"
+    info "usage: $0 -o <output-file> -d <plugin-list>"
     exit ${1:-1}
 }
 
@@ -86,6 +85,7 @@ emit_murphy_loader () {
 OUTPUT=""
 PLUGIN=""
 PLUGIN_LIST=""
+daemon=no
 
 #echo "*** $0 $* ***"
 
@@ -102,7 +102,7 @@ while [ -n "${1#-}" ]; do
             fi
             ;;
         -p)
-            if [ -z "$PLUGIN" -a -z "$PLUGIN_LIST" ]; then
+            if [ -z "$PLUGIN" -a "$daemon" = "no" ]; then
                 shift
                 PLUGIN="$1"
             else
@@ -114,18 +114,29 @@ while [ -n "${1#-}" ]; do
                 usage
             fi
             ;;
+
         -h)
             usage 0
             ;;
        -q)
            QUIET="yes"
            ;;
+        -d)
+            daemon=yes
+            ;;
+
         -*)
             error "Unknown option '$1'."
             usage
             ;;
+
         *)
-            PLUGIN_LIST="$PLUGIN_LIST $1"
+            if [ "$daemon" = "yes" ]; then
+                PLUGIN_LIST="$PLUGIN_LIST $1"
+            else
+                error "Unexpected argument '$1'."
+                usage
+            fi
             ;;
     esac
     shift
@@ -137,20 +148,15 @@ if [ -z "$OUTPUT" ]; then
     usage
 fi
 
-if [ -z "$PLUGIN" -a -z "$PLUGIN_LIST" ]; then
+if [ -z "$PLUGIN" -a "$daemon" = "no" ]; then
     error "Neither builtin plugin nor plugin list is specified."
     usage
 fi
 
-if [ -n "$PLUGIN" -a -n "$PLUGIN_LIST" ]; then
-    error "Both builtin plugin and plugin list are specified."
-    usage
-fi
-
 # generate the output
 rm -f $OUTPUT
 touch $OUTPUT
-if [ -n "$PLUGIN" ]; then
+if [ "$daemon" = "no" ]; then
     emit_plugin_loader $PLUGIN
 else
     emit_murphy_loader $PLUGIN_LIST
index f54d033..c077d68 100644 (file)
@@ -841,8 +841,8 @@ linkedin-%-loader.h:
 
 load-linkedin-plugins.c:
        $(QUIET_GEN)$(top_builddir)/build-aux/gen-linkedin-loader \
-           -o $@ $(shell echo $(LINKEDIN_PLUGINS) | \
-                    sed 's/.*-//g;s/\.[^\.]*$$//g')
+           -o $@ -d $(shell echo $(LINKEDIN_PLUGINS) | \
+                          sed 's/.*-//g;s/\.[^\.]*$$//g')
 
 clean-local::
        -rm -f linkedin-*-loader.[hc] load-linkedin-plugins.c