Project

General

Profile

Support #690

Use GCC as the Default Compiler on FreeBSD

Added by Daniel Curtis almost 5 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Command-Line Help
Target version:
Start date:
11/01/2015
Due date:
% Done:

100%

Estimated time:
0.10 h
Spent time:

Description

Every once in a while I need to compile a program with GCC, instead of the default FreeBSD compiler Clang. To accomplish this I install the latest GCC and set it over Clang with environment variables.

  • Install GCC:
    pkg install gcc49
    
    • (Optional) Install GCC from the ports tree:
      cd /usr/port/lang/gcc49
      make install clean
      
  • Set the CC, CXX, and CPP environment variables to use GCC:
    setenv CC gcc49
    setenv CXX g++49
    setenv CPP cpp49
    
    • (Optional) Environment variables can be set at build time:
      env CC="gcc49" CXX="g++49" CPP="cpp49" CFLAGS="-std=c++11" make
      

Resources

History

#1 Updated by Daniel Curtis almost 5 years ago

  • Description updated (diff)
  • Status changed from New to Resolved
  • % Done changed from 0 to 100

#2 Updated by Daniel Curtis almost 5 years ago

  • Category set to Command-Line Help
  • Status changed from Resolved to Closed

Also available in: Atom PDF