This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: 1.3.10: ttyslot dying, Windows 2000 Server



> -----Original Message-----
> From: 
> om] On Behalf Of Len Giambrone
> Sent: Saturday, 15 June 2002 7:05 PM

> > You could help with setup's command line support. I put the
> > infrastructure in place when lots of folk seemed interested, but now
> > that it's easy to do, noone seems interested. Sigh.
> 
> I make no promises, but please, give me some pointers and 
> I'll look at it.

This thread should jump over to cygwin-apps at this point. However, I
simply suggest that once you've played a bit, you post any further
questions there.

Summary #1 - building setup. For more details, see
http://sources.redhat.com/cygwin-apps/setup.html.

1) Grab setup.exe's source - the current release will do, but CVS HEAD
is preferred.
2) If you grab from CVS, install autoconf/automake/libtool as well.
3) If you grabbed from CVS cd to libgetopt++ and run ./bootstrap.sh
4) Grab a copy of the mingw stdc++ libs.
http://cygwin.com/ml/cygwin-apps/2002-06/msg00094.html has an easy way
for you to do that.
5) Follow the configure+build recipe on
http://cygwin.com/ml/cygwin-apps/2002-06/msg00094.html to build a
native(mingw) version of setup.exe. 

Summary #2 - using libgetopt++.

Libgetopt++ wraps getopt in an OOP fashion. main() is never touched,
instead you declare your options where you need them (i.e. as statics in
classes or statics in .cc files).

Desktop.cc has an example of using a boolean option to turn off the
default for shortcut creation.

The variable is created as:
static BoolOption NoShortcutsOption (false, 'n', "no-shortcuts",
"Disable creation of desktop and start menu shortcuts");

And then used where needed:
if (NoShortcutsOption)
    {
      root_desktop=false;
      root_menu=false;
      OnFinish();
    }
  else
    load_dialog (GetHWND ());

The other current option type is StringOption. I've plans to add a
collection grabbing String option and Bool option types when the need
arises, and to make the default parameters (ie anything after the last
option, without - or --) to go into a collection grabbing String option.
If you need any of those, let me know and I'll code it up asap.

StringOption grabs a string parameter from a command line parameter.
I.e. --install packagefoo would grab 'packagefoo' into the option
variable. Casting the variable to string retrieves the value. (i.e.
stringvariable = optionvariable;).
A minimal example of a string option would be:
static StringOption("", 'I'); 
All the other parameters are optional.

Summary #3 - tips:
Place the options in the closest sensible scope to where they are
needed.
Options are initialised to their default value - so make that the
current behaviour.
Start with the little stuff - no splash screen, which mode
(internet/local/download), which connection type (ie5, direct, proxy),
mirrors to use/use current mirror/show mirror selection page/....

Good luck!

Rob


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]