RobinHankin / gsl

an R wrapper for the Gnu Scientific Library
15 stars 9 forks source link

Refine configure{.ac,} for compiler check #25

Closed eddelbuettel closed 1 year ago

eddelbuettel commented 1 year ago

This PR offers a small enhancement for configure via configure.ac. When I set my compiler to clang (via the file ~/.R/Makevars) I see

checking for gcc... clang
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether clang accepts -g... yes
checking for clang option to enable C11 features... unsupported
checking for clang option to enable C99 features... none needed
checking for gsl-config... /usr/bin/gsl-config
checking if GSL version >= 2.5... yes
configure: creating ./config.status
config.status: creating src/Makevars

whereas with gcc it is

checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether gcc accepts -g... yes
checking for gcc option to enable C11 features... unsupported
checking for gcc option to enable C99 features... none needed
checking for gsl-config... /usr/bin/gsl-config
checking if GSL version >= 2.5... yes
configure: creating ./config.status
config.status: creating src/Makevars

and the respective checks for the compiler use the selected one. This should satisfy CRAN.

I also extended ./cleanup a little.

RobinHankin commented 1 year ago

fixes #24