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

Add an autoconf template #313

Closed
atheriel opened this issue Mar 19, 2018 · 2 comments

Comments

@atheriel
Copy link

@atheriel atheriel commented Mar 19, 2018

Note: I actually implemented this functionality before I read the request to file an issue beforehand in the contributor guidelines, so if you'd like to see an implementation you can check out this commit.

One seriously difficult hurdle I have encountered as a package author is determining how to add autoconf-based configure scripts to an Rcpp package that needed to detect a particular C++ library installed on a system. This is the recommended approach in Writing R Extensions for solving this problem, but I found few accessible resources on how to actually write these scripts (specific to R, anyway). Moreover, there are actually a ton of other, related steps in order to get R CMD check to play nicely with autoconf's generated files (permissions, the cleanup script, autoconf-related artifacts, etc).

All this to say that once I finally figured it out I wanted to make it easier for others, and the usethis package seems like the most promising veneue for providing "this is how you should do this" functionality, even though this is a relatively uncommon need for package authors.

In short, I imagine ause_autoconf() function that:

  • generates a simple configure.ac file with some helpful comments to get you started on what you might want to modify;
  • generates the cleanup script used by R to remove autoconf-related build artifacts;
  • generates (or modifies your existing) src/Makevars to work nicely with autoconf;
  • adds various artifacts to the ignore files; and
  • adds a git commit hook to remind you to run autoconf itself when you configure script is out-of-date

Is this outside of the scope of the usethis package?

@hadley

This comment has been minimized.

Copy link
Member

@hadley hadley commented Nov 24, 2018

Unfortunately I just don't think autoconf scripts are used frequently enough to make it worthwhile to invest in term in usethis.

@hadley hadley closed this Nov 24, 2018
@atheriel

This comment has been minimized.

Copy link
Author

@atheriel atheriel commented Nov 24, 2018

That’s understandable. Thanks for your work on the package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.