Waitrud Weber’s blog

things and reminders for memories

windows-make: config.h on mingw.

> mingw32-c++.exe .\variable.c
In file included from .\variable.c:20:0:
.\make.h:28:20: fatal error: config.h: No such file or directory
#include <config.h>
^
compilation terminated.


https://teratail.com/questions/194720
$ gcc -E -c ss.c


config.h
config.h is the primary Crypto++ header file which holds nearly all configuration information. The file is a mix of user defines and platform defines that interact to create a compile time configuration for both library and application code.
https://cryptopp.com/wiki/Config.h

windows-make: skip CL.exe: compilation simpletest on mingw alternative.


We can skip the compilation error on CL.exe and know about create config.h before this step,

 

.\configure.bat  Sun May 16 19:01:55 2021

...
 17 :
 18 :update %XSRC%/configh.dos ./config.h
 19 :
...
 33 ::MakeOk
 34 :del junk.$$$
 35 :update %XSRC%/Makefile.DOS ./Makefile
 36 :echo Done.
...


We use rename alternatively as update.

.\make.h  Sun May 16 19:56:51 2021

...
 25 :/* We use  instead of "config.h" so that a compilation
 26 :   using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h
 27 :   (which it would do because make.h was found in $srcdir).  */
 28 :#include 
 29 :#undef  HAVE_CONFIG_H
 30 :#define HAVE_CONFIG_H 1
...
.\make.h  Sun May 16 19:56:51 2021

...
126 :#ifdef  HAVE_UNISTD_H
127 :# include 
128 :/* Ultrix's unistd.h always defines _POSIX_VERSION, but you only get
129 :   POSIX.1 behavior with `cc -YPOSIX', which predefines POSIX itself!  */
130 :# if defined (_POSIX_VERSION) && !defined (ultrix) && !defined (VMS)
131 :#  define POSIX 1
132 :# endif
133 :#endif
...

 

gcc -E -s .\variable.c -I
...
void
print_file_variables (file)
     struct file *file;
{
  if (file->variables != 0)
    print_variable_set (file->variables->set, "# ");
}
(no error)

 

> gcc -c .\variable.c -I.
In file included from .\make.h:28:0,
                 from .\variable.c:20:
./config.h:130:15: error: two or more data types in declaration specifiers
 #define pid_t int


^

In file included from .\make.h:28:0,
                 from .\variable.c:20:
./config.h:130:15: error: multiple types in one declaration
 #define pid_t int
               ^
./config.h:130:15: error: declaration does not declare anything [-fpermissive]
In file included from .\variable.c:25:0:
.\variable.h:57:9: error: expected unqualified-id before 'export'
       } export ENUM_BITFIELD (2);
         ^~~~~~
.\variable.c:62:25: error: 'variable* define_variable_in_set' redeclared as different kind of symbol
 define_variable_in_set (name, length, value, origin, recursive, set, flocp)
                         ^~~~
...

 

1 mingw32++     
-  gcc -E -s no error  
-  mingw32++ -I. make.h:130  <unistd.h>
-  gcc -I. config.h:130 pid_t is above includion explained.