[vlc-commits] [Git][videolan/vlc][master] 2 commits: contrib: factor toolchain defaults

Rémi Denis-Courmont (@Courmisch) gitlab at videolan.org
Tue Jan 25 14:45:36 UTC 2022



Rémi Denis-Courmont pushed to branch master at VideoLAN / VLC


Commits:
9c4efef6 by Rémi Denis-Courmont at 2022-01-25T12:17:00+00:00
contrib: factor toolchain defaults

- - - - -
5d1a313f by Rémi Denis-Courmont at 2022-01-25T12:17:00+00:00
contrib: detect modern GCC toolchain wrappers

- - - - -


1 changed file:

- contrib/src/main.mak


Changes:

=====================================
contrib/src/main.mak
=====================================
@@ -56,43 +56,40 @@ endif
 #
 # Default values for tools
 #
-ifndef HAVE_CROSS_COMPILE
+ifdef HAVE_CROSS_COMPILE
+MAYBEHOST := $(HOST)-
+else
+MAYBEHOST :=
+endif
 ifneq ($(findstring $(origin CC),undefined default),)
-CC := gcc
+CC := $(MAYBEHOST)gcc
 endif
 ifneq ($(findstring $(origin CXX),undefined default),)
-CXX := g++
+CXX := $(MAYBEHOST)g++
 endif
 ifneq ($(findstring $(origin LD),undefined default),)
-LD := ld
+LD := $(MAYBEHOST)ld
 endif
 ifneq ($(findstring $(origin AR),undefined default),)
-AR := ar
-endif
-NM ?= nm
-RANLIB ?= ranlib
-STRIP ?= strip
-WIDL ?= widl
-WINDRES ?= windres
+ifeq ($(shell $(MAYBEHOST)gcc-ar --version >/dev/null 2>&1 || echo Prehistory),)
+AR := $(MAYBEHOST)gcc-ar
 else
-ifneq ($(findstring $(origin CC),undefined default),)
-CC := $(HOST)-gcc
+AR := $(MAYBEHOST)ar
 endif
-ifneq ($(findstring $(origin CXX),undefined default),)
-CXX := $(HOST)-g++
-endif
-ifneq ($(findstring $(origin LD),undefined default),)
-LD := $(HOST)-ld
 endif
-ifneq ($(findstring $(origin AR),undefined default),)
-AR := $(HOST)-ar
+ifeq ($(shell $(MAYBEHOST)gcc-nm --version >/dev/null 2>&1 || echo Prehistory),)
+NM ?= $(MAYBEHOST)gcc-nm
+else
+NM ?= $(MAYBEHOST)nm
 endif
-NM ?= $(HOST)-nm
-RANLIB ?= $(HOST)-ranlib
-STRIP ?= $(HOST)-strip
-WIDL ?= $(HOST)-widl
-WINDRES ?= $(HOST)-windres
+ifeq ($(shell $(MAYBEHOST)gcc-ranlib --version >/dev/null 2>&1 || echo Prehistory),)
+RANLIB ?= $(MAYBEHOST)gcc-ranlib
+else
+RANLIB ?= $(MAYBEHOST)ranlib
 endif
+STRIP ?= $(MAYBEHOST)strip
+WIDL ?= $(MAYBEHOST)widl
+WINDRES ?= $(MAYBEHOST)windres
 
 ifdef HAVE_ANDROID
 ifneq ($(findstring $(origin CC),undefined default),)



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/e0c0e00927ca65f1f4ed7edddf312a58d2bbac94...5d1a313f8695bf33f238b11394b112aca5ecdb8f

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/e0c0e00927ca65f1f4ed7edddf312a58d2bbac94...5d1a313f8695bf33f238b11394b112aca5ecdb8f
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list