Skip to content

Commit f3ed872

Browse files
authored
Windows archiver: also search for gcc-ar (#1067)
1 parent 4030a8a commit f3ed872

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

src/fpm_compiler.F90

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,13 +1065,26 @@ subroutine new_archiver(self, ar, echo, verbose)
10651065
if (os_type /= OS_WINDOWS .and. os_type /= OS_UNKNOWN) then
10661066
self%ar = "ar"//arflags
10671067
else
1068+
! Attempt "ar"
10681069
call execute_command_line("ar --version > "//get_temp_filename()//" 2>&1", &
10691070
& exitstat=estat)
1070-
if (estat /= 0) then
1071-
self%ar = "lib"//libflags
1071+
1072+
if (estat == 0) then
1073+
1074+
self%ar = "ar"//arflags
1075+
10721076
else
1073-
self%ar = "ar"//arflags
1074-
end if
1077+
1078+
! Then "gcc-ar"
1079+
call execute_command_line("gcc-ar --version > "//get_temp_filename()//" 2>&1", &
1080+
& exitstat=estat)
1081+
1082+
if (estat /= 0) then
1083+
self%ar = "lib"//libflags
1084+
else
1085+
self%ar = "gcc-ar"//arflags
1086+
end if
1087+
endif
10751088
end if
10761089
end if
10771090
self%use_response_file = os_type == OS_WINDOWS

0 commit comments

Comments
 (0)