During the Apache JServ 1.1 port, I noticed that HP c89 as well as GNU gcc
seem to not handle the -L option for extending the library search path properly,
when the argument is not given in "MPE escaped syntax", i.e.

  gcc -o myprog mysource.c -Lsubdir -lmylib   fails, whereas
  gcc -o myprog mysource.c -L./subdir -lmylib   works properly,

if the libmylib.a library is located inside the local subdirectory subdir. To
address this issue, I used the following "tweaks" to /etc/c89.ccg or /etc/ld.ccg
respectively (the former applies to HP c89, the latter applies to GNU gcc)...


# notice that c89-orig.ccg line numbers are not FOS but with GNU core patches

shell/iX> diff -u c89-orig.ccg c89.ccg

--- c89-orig.ccg        Sat Nov 20 17:39:44 1999
+++ c89.ccg     	Wed Mar 15 21:19:29 2000
@@ -389,7 +389,24 @@
                        fi
                fi
        else
-               println arg -> rfile;
+#              println arg -> rfile;
+#              # begin lars appel 15.mar.00
+               if (substr(arg,1,2) == "-L")
+                       i=2;
+                       while (arg[i] == " ") do
+                               i++;
+                       done
+                       if (substr(arg, i+1, 1) != "/" &&
+                           substr(arg, i+1, 2) != "./" &&
+                            substr(arg, i+1, 3) != "../")
+                               println "-L ./" | substr(arg, i+1) -> rfile;
+                       else
+                               println arg -> rfile;
+                       fi
+               else
+                       println arg -> rfile;
+               fi
+#              # end lars appel 15.mar.00
        fi
 done
 # now write out all of the object modules to link


shell/iX> diff -u ld-orig.ccg ld.ccg

--- ld-orig.ccg Sat Nov 20 17:39:44 1999
+++ ld.ccg      Wed Mar 15 21:29:09 2000
@@ -285,7 +285,23 @@
                        fi
                fi
        elif (!makexl)
-               println arg -> rfile;
+#              println arg -> rfile;
+#              # begin lars appel 15.mar.00
+               if (substr(arg,1,2) == "-L")
+                       i=2;
+                       while (arg[i] == " ") do
+                               i++;
+                       done
+                       if (substr(arg, i+1, 1) != "/" &&
+                           substr(arg, i+1, 2) != "./")
+                               println "-L ./" | substr(arg, i+1) -> rfile;
+                       else
+                               println arg -> rfile;
+                       fi
+               else
+                       println arg -> rfile;
+               fi
+#              # end lars appel 15.mar.00
                if (substr(arg,1,2) == "-L")
                        i=2;
                        while (arg[i] == " ") do

The above adjustments worked for me, however, this does not imply any type of
guarantee or even HP support. Your milage may vary. Use at your own risk. Etc.

Lars Appel.