Skip to content

Commit 67296f7

Browse files
committed
ext: add --help option and message to extconf.rb
1 parent 3d5ca82 commit 67296f7

1 file changed

Lines changed: 79 additions & 0 deletions

File tree

ext/sqlite3/extconf.rb

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,89 @@ def cross_build?
150150
def download
151151
minimal_recipe.download
152152
end
153+
154+
def print_help
155+
print(<<~TEXT)
156+
USAGE: ruby #{$PROGRAM_NAME} [options]
157+
158+
Flags that are always valid:
159+
160+
--disable-system-libraries
161+
Use the packaged libraries, and ignore the system libraries.
162+
(This is the default behavior.)
163+
164+
--enable-system-libraries
165+
Use system libraries instead of building and using the packaged libraries.
166+
167+
--with-sqlcipher
168+
Use libsqlcipher instead of libsqlite3.
169+
(Implies `--enable-system-libraries`.)
170+
171+
--help
172+
Display this message.
173+
174+
175+
Flags only used when using system libraries:
176+
177+
General (applying to all system libraries):
178+
179+
--with-opt-dir=DIRECTORY
180+
Look for headers and libraries in DIRECTORY.
181+
182+
--with-opt-lib=DIRECTORY
183+
Look for libraries in DIRECTORY.
184+
185+
--with-opt-include=DIRECTORY
186+
Look for headers in DIRECTORY.
187+
188+
Related to sqlcipher:
189+
190+
--with-sqlcipher-dir=DIRECTORY
191+
Look for sqlcipher headers and library in DIRECTORY.
192+
(Implies `--with-sqlcipher` and `--enable-system-libraries`.)
193+
194+
--with-sqlcipher-lib=DIRECTORY
195+
Look for sqlcipher library in DIRECTORY.
196+
(Implies `--with-sqlcipher` and `--enable-system-libraries`.)
197+
198+
--with-sqlcipher-include=DIRECTORY
199+
Look for sqlcipher headers in DIRECTORY.
200+
(Implies `--with-sqlcipher` and `--enable-system-libraries`.)
201+
202+
203+
Flags only used when building and using the packaged libraries:
204+
205+
--enable-cross-build
206+
Enable cross-build mode. (You probably do not want to set this manually.)
207+
208+
209+
Environment variables used for compiling the C extension:
210+
211+
CC
212+
Use this path to invoke the compiler instead of `RbConfig::CONFIG['CC']`
213+
214+
215+
Environment variables passed through to the compilation of packaged libraries:
216+
217+
CC
218+
CPPFLAGS
219+
CFLAGS
220+
LDFLAGS
221+
LIBS
222+
LT_SYS_LIBRARY_PATH
223+
CPP
224+
225+
TEXT
226+
end
153227
end
154228
end
155229
end
156230

231+
if arg_config("--help")
232+
Sqlite3::ExtConf.print_help
233+
exit!(0)
234+
end
235+
157236
if arg_config("--download-dependencies")
158237
Sqlite3::ExtConf.download
159238
exit!(0)

0 commit comments

Comments
 (0)