build-sys: handle no exports by gen-inker-script.
authorKrisztian Litkey <krisztian.litkey@intel.com>
Thu, 4 Oct 2012 06:35:13 +0000 (09:35 +0300)
committerKrisztian Litkey <krisztian.litkey@intel.com>
Fri, 26 Oct 2012 16:03:51 +0000 (19:03 +0300)
build-aux/gen-linker-script

index c5dc567..bb322b4 100755 (executable)
@@ -16,6 +16,10 @@ info () {
     echo "$*" 1>&2
 }
 
+warning () {
+    echo "warning: $*" 1>&2
+}
+
 usage () {
     info "usage: $0 [-p <pattern>] [-I <ignore-list>] -o <output> <inputs>"
     exit ${1:-1}
@@ -27,7 +31,7 @@ emit () {
 
 
 # set up defaults
-PATTERN="^mrp_"                       # export everything prefixed with mrp_
+PATTERN="^mrp_|^_mrp_"                # export everything prefixed with mrp_
 IGNORE="MRP_PRINTF_LIKE,MRP_NULLTERM" # ignore these symbols/macros
 IT=","                                # ignore-list is comma-separated
 SOURCES=""                            # no default input, must be specified
@@ -78,8 +82,12 @@ if [ -z "$OUTPUT" ]; then
 fi
 
 if [ -z "$SOURCES" ]; then
-    error "No input files specified."
-    usage
+    warning "No input files, generating local-only linker script."
+    emit "{"
+    emit "    local:"
+    emit "        *;"
+    emit "};"
+    exit 0
 fi
 
 if [ -z "$PATTERN" ]; then