Add getopt implementation to abuild
[coreboot.git] / util / abuild / abuild
index 74d2908e69f23870101a72b4cd88bae0bf91e4ea..5b8d73d2a63be57977a5cde1a50395fcddf81cb9 100755 (executable)
@@ -563,6 +563,10 @@ test -f util/sconfig/sconfig.l && ROOT=$( pwd )
 test -f ../util/sconfig/sconfig.l && ROOT=$( cd ..; pwd )
 test "$ROOT" = "" && ROOT=$( cd ../..; pwd )
 
+# Look if we have getopt. If not, build it.
+export PATH=$PATH:util/abuild
+getopt - > /dev/null 2>/dev/null || gcc -o util/abuild/getopt util/abuild/getopt.c
+
 # parse parameters.. try to find out whether we're running GNU getopt
 getoptbrand="`getopt -V`"
 if [ "${getoptbrand:0:6}" == "getopt" ]; then