Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Append flags from environment variables. #629

Merged
merged 1 commit into from
May 31, 2023

Commits on May 31, 2023

  1. Append flags from environment variables.

    According to the `mkmf.rb#init_mkmf`, there are command line options below.
    
    * `--with-cflags` to set the `cflags`
    * `--with-ldflags` to set the `ldflags`
    
    For example the following command compiles with the specified flags. Note that
    `MAKEFLAGS` is to print the compiler command lines.
    
    ```
    $ MAKEFLAGS="V=1" \
      bundle exec rake compile -- \
      --with-cflags="-Wundef -Werror" \
      --with-ldflags="-fstack-protector"
    ```
    
    However, I couldn't find command line options to append the flags. And this
    commit is to append the `cflags` and `ldflags` by the environment variables.
    
    ```
    $ MAKEFLAGS="V=1" \
      RUBY_OPENSSL_EXTCFLAGS="-Wundef -Werror" \
      RUBY_OPENSSL_EXTLDFLAGS="-fstack-protector" \
      bundle exec rake compile
    ```
    junaruga committed May 31, 2023
    Configuration menu
    Copy the full SHA
    b551eb8 View commit details
    Browse the repository at this point in the history