Web lists-archives.com

Re: [Mingw-users] MSYS on Windows - Setting Directories?

On 04/03/16 02:39, Domonic Tom wrote:
> I just made a test directory to see if the --prefix=c:/test_directory
> would end up containing headers and lib files .  Even if I do use
> the --prefix command will this directory be searched the next time I
> build something and it needs dependencies?   The c:/test_directory
> ended up containing nothing after the following commands.  I tested
> this on building libjpeg
> $ cd c:/libjpeg
> $ ./configure --prefix=c:/test_directory
> $ make 
> $ make install
> I get the error below
> $ make install
> /bin/install -c cjpeg c:/test_directory/bin/cjpeg
> /bin/install: cannot create regular file `c:/test_directory/bin/cjpeg.exe': No such file or directory
> make: *** [install] Error 1

This just, more or less, confirms that the makefile for libjpeg is
broken; it *should* have an install dependency to create any needed
installation directories, in the event that they don't already exist,
before it tries to populate them.  Since you said later:

> I have found that if I add a /bin directory to my --prefix path then
> all this does is build a bunch of binary files into the /bin folder?

It does seem that if the $prefix/bin already exists, (or %prefix%/bin,
if you prefer the, IMO less legible, Windows syntax), then it will be
populated by 'make install'; this is further confirmation, if any were
needed, that the makefile is lacking the 'installdirs' dependency.

> Why doesn't it place headers and lib files in there?

Because they don't belong there: headers belong in $prefix/include; libs
belong in $prefix/lib.

> From what you have said below ...

Please desist from using this top-posting style; respond in-line, as I
am doing.

> I gather that all headers and lib files will be installed in the
> default directory somewhere in c:/mingw ?

They will, if you've specified --prefix=c:/mingw; executables and DLLs
should then be installed in c:/mingw/bin, headers in c:/mingw/include,
and libs in c:/mingw/lib

> I'm not sure what you mean by -I and -L are only used when you run gcc?

When you run MinGW's GCC, (i.e. gcc, g++, gfortran, or whatever), these
commands will have certain default search paths for headers and libs;
for gcc, and g++, these are effectively c:/mingw/include for headers,
and c:/mingw/lib, for libraries, (in addition to a few other special
locations deep within the GCC tree itself).  If you've chosen to install
into some other $prefix, then you need to tell GCC about it:

> If so, how are they used?

The -I option may be specified, (as often as needed), to tell GCC where
to look for headers, (in addition to looking in its default locations);
similarly, -L may used to specify additional places to look for libs:

  $ gcc -I $prefix/include foomain.c -L $prefix/lib -lfoo

> You keep referring to user/local?  What is this?

No, I referred to /usr/local, which is a standard directory on pretty
much every Unix, Linux, or POSIX system under the sun.  MSYS maps it to
$MSYSROOT/local, but it doesn't necessarily exist, and you are advised
not to use it, unless you've mapped (i.e. mounted) it as something for
use within the MinGW tree.  Unfortunately, many makefiles, intended for
use primarily on unixy systems, specify it as a default installation
directory, which is why you should (almost) always override --prefix,
when you run configure for a MinGW build.

> I have always operated on Windows ...

You have my sympathy, for the appalling user experience that imbues :-)


Public key available from keys.gnupg.net
Key fingerprint: C19E C018 1547 DE50 E1D4 8F53 C0AD 36C6 347E 5A3F

Attachment: signature.asc
Description: OpenPGP digital signature

Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
MinGW-users mailing list

This list observes the Etiquette found at 
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

You may change your MinGW Account Options or unsubscribe at:
Also: mailto:mingw-users-request@xxxxxxxxxxxxxxxxxxxxx?subject=unsubscribe