Browse Source

* write ppc386.cfg for all found targets

peter 25 years ago
parent
commit
5d8a172ebd
2 changed files with 102 additions and 50 deletions
  1. 12 5
      install/fpinst/install.dat
  2. 90 45
      install/fpinst/install.pas

+ 12 - 5
install/fpinst/install.dat

@@ -6,15 +6,18 @@
 title=Free Pascal Compiler 0.99.14
 version=0.99.14
 
+#
+# General
+#
 basepath=c:\pp
-binsub=\bin\go32v2
-ppc386=ppc386
-
 
 #
 # Go32v2 packages
 #
 pack=Dos/Go~3~2v2
+binsub=\bin\go32v2
+ppc386=ppc386
+cfgfile=ppc386.cfg
 filecheck=*go32.zip
 package=basego32.zip,~B~asic system for Go32v2 (required)
 package=asldgo32.zip,GNU ~L~inker and GNU Assembler for Go32v2 (required)
@@ -32,6 +35,9 @@ package=umisgo32.zip,~M~iscellaneous units
 # Win32 packages
 #
 pack=~W~in32
+binsub=\bin\win32
+ppc386=ppc386
+cfgfile=ppc386.cfg
 filecheck=*w32.zip
 package=basew32.zip,~B~asic system for Win32 (required)
 package=asldw32.zip,GNU ~L~inker and GNU Assembler for Win32 (required)
@@ -51,6 +57,9 @@ package=umisw32.zip,~M~iscellaneous units
 # Emx packages
 #
 pack=OS/2 ~E~MX
+binsub=\bin\os2
+ppc386=ppc386
+cfgfile=ppc386.cfg
 filecheck=*emx.zip
 package=baseemx.zip,~B~asic system for EMX (required)
 package=asldemx.zip,GNU ~L~inker and assembler for EMX (required)
@@ -81,8 +90,6 @@ package=utilssrc.zip,~U~tils sources
 package=instsrc.zip,~I~nstaller sources
 package=docsrc.zip,~D~ocumentation sources (LaTeX)
 
-
-cfgfile=ppc386.cfg
 defaultcfg=
 #
 # Example ppc386.cfg for Free Pascal Compiler Version 0.99.14

+ 90 - 45
install/fpinst/install.pas

@@ -100,6 +100,9 @@ program install;
 
      tpack=record
        name     : string[12];
+       binsub   : string[40];
+       ppc386   : string[20];
+       defcfgfile : string[12];
        include  : boolean;
        filechk  : string[40];
        packages : longint;
@@ -110,11 +113,8 @@ program install;
        title    : string[80];
        version  : string[20];
        basepath : DirStr;
-       binsub   : string[12];
-       ppc386   : string[12];
        packs    : word;
        pack     : array[1..maxpacks] of tpack;
-       defcfgfile : string[12];
        defcfgs  : longint;
        defcfg   : array[1..maxdefcfgs] of pstring;
      end;
@@ -467,6 +467,7 @@ program install;
       Control : PButton;
       YB: word;
 {$IFNDEF LINUX}
+      i : longint;
       S: string;
       WPath: boolean;
 {$ENDIF}
@@ -481,23 +482,33 @@ program install;
       YB := 14;
 
 {$IFNDEF LINUX}
-      S := Data.BasePath + Cfg.BinSub;
+      s:='';
+      for i:=1 to cfg.packs do
+       if cfg.pack[i].binsub<>'' then
+        begin
+          if s<>'' then
+           s:=s+';';
+          S := s+Data.BasePath + Cfg.pack[i].BinSub;
+        end;
       if Pos (Upper (S), Upper (GetEnv ('PATH'))) = 0 then
-      begin
-       WPath := true;
-       Inc (YB, 2);
-      end else WPath := false;
- {$IFDEF OS2}
+       begin
+         WPath := true;
+         Inc (YB, 2);
+       end
+      else
+       WPath := false;
+  {$IFDEF OS2}
       if DosLoadModule (@ErrPath, SizeOf (ErrPath), @EMXName, Handle) = 0 then
-      begin
-       WLibPath := false;
-       DosFreeModule (Handle);
-      end else
-      begin
-       WLibPath := true;
-       Inc (YB, 2);
-      end;
- {$ENDIF}
+       begin
+         WLibPath := false;
+         DosFreeModule (Handle);
+       end
+      else
+       begin
+         WLibPath := true;
+         Inc (YB, 2);
+       end;
+  {$ENDIF}
 {$ENDIF}
 
       R.Assign(6, 6, 74, YB);
@@ -505,26 +516,28 @@ program install;
 
 {$IFNDEF LINUX}
       if WPath then
-      begin
-       R.Assign(2, 3, 64, 5);
-       P:=new(pstatictext,init(r,'Extend your PATH variable with '''+S+''''));
-       insert(P);
-      end;
+       begin
+         R.Assign(2, 3, 64, 5);
+         P:=new(pstatictext,init(r,'Extend your PATH variable with '''+S+''''));
+         insert(P);
+       end;
 
- {$IFDEF OS2}
+  {$IFDEF OS2}
       if WLibPath then
-      begin
-       if WPath then S := 'and your LIBPATH with ''' + S + '\dll''' else
-                             S := 'Extend your LIBPATH with ''' + S + '\dll''';
-       R.Assign (2, YB - 13, 64, YB - 11);
-       P := New (PStaticText, Init (R, S));
-       Insert (P);
-      end;
- {$ENDIF}
+       begin
+         if WPath then
+          S := 'and your LIBPATH with ''' + S + '\dll'''
+         else
+          S := 'Extend your LIBPATH with ''' + S + '\dll''';
+         R.Assign (2, YB - 13, 64, YB - 11);
+         P := New (PStaticText, Init (R, S));
+         Insert (P);
+       end;
+  {$ENDIF}
 {$ENDIF}
 
       R.Assign(2, YB - 11, 64, YB - 10);
-      P:=new(pstatictext,init(r,'To compile files enter '''+cfg.ppc386+' [file]'''));
+      P:=new(pstatictext,init(r,'To compile files enter '''+cfg.pack[1].ppc386+' [file]'''));
       insert(P);
 
       R.Assign (29, YB - 9, 39, YB - 7);
@@ -756,7 +769,11 @@ program install;
                      result:=messagebox('No components selected.'#13#13'Create a configfile ?',nil,
                                                 mfinformation+mfyesbutton+mfnobutton);
                      if (result=cmYes) and createinstalldir(data.basepath) then
-                      writedefcfg(data.basepath+cfg.binsub+DirSep+cfg.defcfgfile);
+                      begin
+                        for i:=1to cfg.packs do
+                         if cfg.pack[i].defcfgfile<>'' then
+                          writedefcfg(data.basepath+cfg.pack[i].binsub+DirSep+cfg.pack[i].defcfgfile);
+                      end;
                      exit;
                    end
                   else
@@ -791,7 +808,11 @@ program install;
 
     { write config }
       if (data.cfgval and 1)<>0 then
-       writedefcfg(data.basepath+cfg.binsub+DirSep+cfg.defcfgfile);
+       begin
+         for i:=1to cfg.packs do
+          if cfg.pack[i].defcfgfile<>'' then
+           writedefcfg(data.basepath+cfg.pack[i].binsub+DirSep+cfg.pack[i].defcfgfile);
+       end;
 
     { show end message }
       p3:=new(penddialog,init);
@@ -870,15 +891,6 @@ program install;
                else
                 if item='BASEPATH' then
                  cfg.basepath:=s
-               else
-                if item='PPC386' then
-                 cfg.ppc386:=s
-               else
-                if item='BINSUB' then
-                 cfg.binsub:=s
-               else
-                if item='CFGFILE' then
-                 cfg.defcfgfile:=s
                else
                 if item='DEFAULTCFG' then
                  begin
@@ -904,6 +916,36 @@ program install;
                     end;
                    cfg.pack[cfg.packs].name:=s;
                  end
+               else
+                if item='CFGFILE' then
+                 begin
+                   if cfg.packs=0 then
+                    begin
+                      writeln('No pack set');
+                      halt(1);
+                    end;
+                   cfg.pack[cfg.packs].defcfgfile:=s
+                 end
+               else
+                if item='PPC386' then
+                 begin
+                   if cfg.packs=0 then
+                    begin
+                      writeln('No pack set');
+                      halt(1);
+                    end;
+                   cfg.pack[cfg.packs].ppc386:=s;
+                 end
+               else
+                if item='BINSUB' then
+                 begin
+                   if cfg.packs=0 then
+                    begin
+                      writeln('No pack set');
+                      halt(1);
+                    end;
+                   cfg.pack[cfg.packs].binsub:=s;
+                 end
                else
                 if item='FILECHECK' then
                  begin
@@ -1112,7 +1154,10 @@ begin
 end.
 {
   $Log$
-  Revision 1.16  2000-02-06 12:59:39  peter
+  Revision 1.17  2000-02-23 17:17:56  peter
+    * write ppc386.cfg for all found targets
+
+  Revision 1.16  2000/02/06 12:59:39  peter
     * change upper -> upcase
     * fixed stupid debugging leftover with diskspace check