@@ -68,6 +68,17 @@ static Obj Error;
68
68
static UInt SystemErrorCode ;
69
69
70
70
71
+ /****************************************************************************
72
+ **
73
+ *V SyLoadSystemInitFile . . . . . . should GAP load 'lib/init.g' at startup
74
+ **
75
+ ** TODO: this variable could be made static or even deleted. However for
76
+ ** now the GAP.jl Julia package is accessing it, so we have to keep it.
77
+ ** See also issue #5890 for the reasons behind this.
78
+ */
79
+ Int SyLoadSystemInitFile = 1 ;
80
+
81
+
71
82
/****************************************************************************
72
83
**
73
84
*V Last . . . . . . . . . . . . . . . . . . . . . . global variable 'last'
@@ -1527,21 +1538,33 @@ void InitializeGap (
1527
1538
// make command line available to GAP level
1528
1539
InitKernelArgs (argc , argv );
1529
1540
1530
- // read the init files
1531
- // this now actually runs the GAP session, we only get
1532
- // past here when we're about to exit.
1533
- if ( SyLoadSystemInitFile ) {
1534
- GAP_TRY {
1535
- if ( READ_GAP_ROOT ("lib/init.g" ) == 0 ) {
1536
- Pr ( "gap: hmm, I cannot find 'lib/init.g' maybe"
1537
- " use option '-l <gaproot>'?\n" , 0 , 0 );
1541
+ // should GAP load 'lib/init.g' on initialization?
1542
+ if (SyCompilePlease ) {
1543
+ SyLoadSystemInitFile = 0 ;
1544
+ }
1545
+ #ifdef GAP_ENABLE_SAVELOAD
1546
+ else if (SyRestoring ) {
1547
+ SyLoadSystemInitFile = 0 ;
1548
+ }
1549
+ #endif
1550
+
1551
+ if (SyLoadSystemInitFile ) {
1552
+ // read the init files
1553
+ // depending on the command line this now actually runs the GAP
1554
+ // session, we only get past here when we're about to exit.
1555
+ GAP_TRY
1556
+ {
1557
+ if (READ_GAP_ROOT ("lib/init.g" ) == 0 ) {
1558
+ Pr ("gap: hmm, I cannot find 'lib/init.g' maybe"
1559
+ " use option '-l <gaproot>'?\n" ,
1560
+ 0 , 0 );
1538
1561
SystemErrorCode = 1 ;
1539
1562
}
1540
- }
1541
- GAP_CATCH {
1542
- Panic ("Caught error at top-most level, probably quit from "
1543
- "library loading" );
1544
- }
1563
+ }
1564
+ GAP_CATCH
1565
+ {
1566
+ Panic ("Caught error at top-most level, probably quit from "
1567
+ "library loading" );
1568
+ }
1545
1569
}
1546
-
1547
1570
}
0 commit comments