login

<     >

2023-10-31 19:38:34 (UTC-03:00)

Marcel Rodrigues <marcelgmr@gmail.com>

better error when $NLC is not properly set

diff --git a/neatcc b/neatcc
index 7658dbe..906c4bd 100755
--- a/neatcc
+++ b/neatcc
@@ -109,6 +109,13 @@ if [ -n "$c_sources" ]; then
     $NCC$nccargs $c_sources || exit
 fi
 if [ $link = "yes" ]; then
+    for obj in start.o libc.a; do
+        if [ ! -f "$NLC/$obj" ]; then
+            printf "$obj not found in '%s'\n" "$NLC" >&2
+            printf "make sure to set \$NLC to neatlibc location\n" >&2
+            exit 2
+        fi
+    done
     nldargs="$nldargs $objects $NLC/start.o $NLC/libc.a"
     if [ $run = "yes" ]; then
         tmpbin="/tmp/tmp.out"