Skip to content

Commit

Permalink
Windows archiver: also search for gcc-ar
Browse files Browse the repository at this point in the history
  • Loading branch information
perazz committed Aug 26, 2024
1 parent 4030a8a commit 87f6d89
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions src/fpm_compiler.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1065,13 +1065,26 @@ subroutine new_archiver(self, ar, echo, verbose)
if (os_type /= OS_WINDOWS .and. os_type /= OS_UNKNOWN) then
self%ar = "ar"//arflags
else
! Attempt "ar"
call execute_command_line("ar --version > "//get_temp_filename()//" 2>&1", &
& exitstat=estat)
if (estat /= 0) then
self%ar = "lib"//libflags

if (estat == 0) then

self%ar = "ar"//arflags

else
self%ar = "ar"//arflags
end if

! Then "gcc-ar"
call execute_command_line("gcc-ar --version > "//get_temp_filename()//" 2>&1", &
& exitstat=estat)

if (estat /= 0) then
self%ar = "lib"//libflags
else
self%ar = "gcc-ar"//arflags
end if
endif
end if
end if
self%use_response_file = os_type == OS_WINDOWS
Expand Down

0 comments on commit 87f6d89

Please sign in to comment.