[LON-CAPA-cvs] cvs: doc /install/linux install.pl

raeburn raeburn at source.lon-capa.org
Thu Oct 30 17:42:43 EDT 2025


raeburn		Thu Oct 30 21:42:43 2025 EDT

  Modified files:              
    /doc/install/linux	install.pl 
  Log:
  - Support Fedora 43 which use gcc 15 (for which default is C23 standard) by
    inluding std=gnu17 in compiler flags for compatibility with pwauth code. 
  
  
Index: doc/install/linux/install.pl
diff -u doc/install/linux/install.pl:1.98 doc/install/linux/install.pl:1.99
--- doc/install/linux/install.pl:1.98	Wed Nov 27 16:24:20 2024
+++ doc/install/linux/install.pl	Thu Oct 30 21:42:43 2025
@@ -78,7 +78,7 @@
           &mt('Stopping execution.')."\n";
     exit;
 } else {
-    print LOG '$Id: install.pl,v 1.98 2024/11/27 16:24:20 raeburn Exp $'."\n";
+    print LOG '$Id: install.pl,v 1.99 2025/10/30 21:42:43 raeburn Exp $'."\n";
 }
 
 #
@@ -2612,6 +2612,8 @@
 sub build_and_install_mod_auth_external {
     my ($instdir) = @_;
     my $num = &uid_of_www();
+    my $gccver = `gcc -dumpversion`;
+    chomp($gccver);
     # Patch pwauth
     print_and_log(&mt('Building authentication system for LON-CAPA users.')."\n");
     my $patch = <<"ENDPATCH";
@@ -2644,6 +2646,12 @@
 > int main(int argc, char **argv)
 ENDPATCH
 
+    my $patch_makefile = <<"ENDPATCH";
+11c11
+< LOCALFLAGS= -g 
+---
+> LOCALFLAGS= -g -std=gnu17
+ENDPATCH
     if (! -e "/usr/bin/patch") {
 	print_and_log(&mt('You must install the software development tools package: [_1], when installing Linux.',"'patch'")."\n");
         print_and_log(&mt('Authentication installation not completed.')."\n");
@@ -2661,7 +2669,15 @@
         if (open(PATCH,"| patch $dir/pwauth.c")) {
             print PATCH $patch_code;
             close(PATCH);
-            $patchedok = 1;
+            if ($gccver >= 15) {
+                if (open(PATCH,"| patch $dir/Makefile")) {
+                    print PATCH $patch_makefile;
+                    close(PATCH);
+                    $patchedok = 1;
+                }
+            } else {
+                $patchedok = 1;
+            }
         }
     }
     if ($patchedok) {
@@ -2671,9 +2687,13 @@
         ##
         print_and_log(&mt('Compiling pwauth')."\n");
         my $result = `cd $dir/; make 2>/dev/null `;
+        my $cstd; 
+        if ($gccver >= 15) {
+            $cstd = '-std=gnu17';
+        }
         my $expected = <<"END";
-gcc -g    -c -o pwauth.o pwauth.c
-gcc -o pwauth -g  pwauth.o -lcrypt
+gcc -g $cstd   -c -o pwauth.o pwauth.c
+gcc -o pwauth -g $cstd pwauth.o -lcrypt
 END
         if ($result eq $expected) {
             print_and_log(&mt('Apparent success compiling pwauth:').




More information about the LON-CAPA-cvs mailing list