aboutsummaryrefslogtreecommitdiff
path: root/lang/fpc-devel/files/fix-samplecfg
blob: 187375e6354fe675b278ba3eda3145eb87a49d43 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
--- samplecfg	Sat Dec 23 15:02:40 2000
+++ samplecfg.new	Sun Dec  9 07:12:15 2001
@@ -4,7 +4,7 @@
 #
 #  Generate Sample Free Pascal configuration file
 #
-if [ $# == 0 ]; then
+if [ $# -eq 0 ]; then
   echo 'Usage :'
   echo 'samplecfg fpcdir confdir'
   echo 'fpcdir = Path where FPC is installed'
@@ -29,7 +29,7 @@
 #
 if [ -f $thefile ] ; then
   mv $thefile $thefile.orig  >/dev/null 2>&1
-  if [ $? == 0 ]; then
+  if [ $? -eq 0 ]; then
     echo Saved old config to $thefile.orig
   else
     echo Could not save old config. Bailing out...
@@ -38,9 +38,15 @@
 fi
 
 # Find path to libgcc.a
-GCCSPEC=`(gcc -v 2>&1)| head -n 1| awk '{ print $4 } '`
-GCCDIR=`dirname $GCCSPEC`
-echo Found libgcc.a in $GCCDIR
+#GCCSPEC=`(gcc -v 2>&1)| head -n 1| awk '{ print $4 } '`
+#GCCDIR=`dirname $GCCSPEC`
+GCCDIR=/usr/lib
+if [ -f $GCCDIR/libgcc.a ]; then
+    echo Found libgcc.a in $GCCDIR
+else
+    echo FreeBSD libgcc.a could not be found.  Bailing out...
+    exit
+fi
 
 # Write the file
 echo Writing sample configuration file to $thefile