VirtualBox 게스트 추가 설치를 위해 컴파일러를 지정하는 방법은 무엇입니까?

VirtualBox 게스트 추가 설치를 위해 컴파일러를 지정하는 방법은 무엇입니까?

gcc오류를 방지하기 위해 특정 버전을 사용하여 Ubuntu 14.04 게스트 내에 VirtualBox 5.0.16 게스트 추가 기능을 구축할 수 있기를 원합니다 . VBoxLinuxAdditions.run --help정보를 제공하지도 않고 그렇게 하지도 않습니다.빌드 지침.

Insert Guest Additions CD imageUbuntu 내부에 ISO를 자동으로 마운트하는 내장 기능 메뉴 항목에서 게스트 추가 바이너리를 받고 있습니다 .

답변1

소스를 추가로 조사하면 그들이 automake를 사용한다는 사실이 드러납니다. Makefile이 소스를 컴파일하는 데 사용할 환경 변수를 사용하여 컴파일러를 설정할 수 있습니다.

위치 소스가 난독화되었습니다. 전체 소스를 찾으려면 VBoxLinuxAdditions.run 쉘 스크립트 끝에 추가된 tar 파일을 찾아서 압축을 풀어야 합니다. 여기에는 소스가 포함된 두 개의 tar 파일이 포함되어 있습니다. (VBoxGuestAdditions-x86.tar.bz2 및 ./VBoxGuestAdditions-amd64.tar.bz2) 이는 게스트에서 컴파일될 코드입니다. 파일을 덤프하려면 쉘 스크립트를 약간 수정해야 합니다.

일단 소스 tar가 필요한 것을 풀고 나면 make CC=<path to required gcc>빌드에서 사용할 컴파일러를 지정할 수 있어야 합니다.

Some influential environment variables:
   CC          C compiler command
   CFLAGS      C compiler flags
   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
               nonstandard directory <lib dir>
   LIBS        libraries to pass to the linker, e.g. -l<library>
   CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
               you have headers in a nonstandard directory <include dir>
   LT_SYS_LIBRARY_PATH
              User-defined run-time library search path.
   CPP         C preprocessor
   CXX         C++ compiler command
   CXXFLAGS    C++ compiler flags
   CXXCPP      C++ preprocessor

관련 정보