On Thu, Mar 04, 2021 at 10:24:42AM +0000, Brian Fenton wrote:

> I took a look at the install documentation here 
> https://bitbucket.org/naviserver/naviserver/src/master/ and I noticed that 
> there are 3 approaches described for compiling and installing on Windows.
> Which one of the 3 is the preferred approach within the community?

The only approach I have extensive experience with is using the
Microsoft C compiler natively on Windows.  That works.

I installed "Visual Studio 2019 Community Edition 16.5", and haven't
had any reason to look for a newer version yet.  In the installer, I
checked only the "Desktop development with C++" Workload, and
otherwise left everything else set to defaults.

Here are my notes to Compile and Install NaviServer on Windows, using
the command-line MSVCC compiler:  (I believe this info was up-to-date
around 2020-07, using the NaviServer head code from c. 2020-06-14.)

1. To compile we need "include/nsversion.h", which is auto-generated
by "include/nsversion.h.in", so ou have two choices:

Either (bizarrely), run configure on Linux before building on Windows!
Surprisingly, this works and is how I did it for a long time.
Or if you don't like that, or don't have Linux available, use the
"win32-util/configure.tcl" script instead.  Actually you don't need to
run it yourself at all, as "Makefile.win32" does it for you.

2. If you already built Linux NaviServer in that same directory, run
make clean there to remove the Linux object files.  (TODO: It would be
so much nicer to have separate Build-* subdirectories...)

3. As the instructions in "naviserver/Makefile.win32" say, make sure
you edit "include/Makefile.build, changing the "Makefile.module" line
to say "Makefile.win32" instead!  If you do not you will get cryptic
nmake errors.

4. In a Windows Command Prompt window, Build NaviServer like this, for 64-bit:

  "C:\Program Files (x86)\Microsoft Visual 
Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"
  z: & cd Z:\src\web\ns-fork-myfork\naviserver
  nmake -f Makefile.win32  clean-core clean-mod  all-core all-mod

5. Again from the Command Prompt, run this little script to properly
copy all the files to their installed locations:

  cd Z:\src\web\ns-fork-myfork\naviserver\
  tclsh ./win32-util/install-nsd.tcl -i

6. Test plain NaviServer in the foreground, e.g. like so:

  C:\web\nsd4-myfork-20200411-1\bin\nsd.exe -t
  C:\web\nsd4-myfork-20200411-1\conf\simple-config.tcl -f

Note that by default the "install-nsd.tcl" script above does NOT
overwrite the installed binaries, instead it installs to a similar
directory alongside it, with a timestamp in the name, e.g.,
"nsd4-myfork-20040927T190908\".  You are free to rename that directory
later to whatever you want (because nothing inside it embeds the
directory name).

You can also use the "install-nsd.tcl" script's "-f" and "-t" switches
to control what directory the install script copies from and to, but
normally the defaults are what you want.  If run without any
arguments, "install-nsd.tcl" will show you its defaults.

-- 
Andrew Piskorski <a...@piskorski.com>


_______________________________________________
naviserver-devel mailing list
naviserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/naviserver-devel

Reply via email to