Monit Compilation Errors

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

Monit Compilation Errors

Kizito Porta Balanyà
Hello all,

I'm trying to compile the last version of MONIT and I get some errors that
I can not solve.

Basically I get errors like: expected identifier or ‘(’ before numeric
constant, but reviewing the code I don't see any wrong, beside that the
sources compile correctly with Linux, AIX, etc ...

Can you help me? Do you have any clue?

I show you the errors obtained:

gcc -DHAVE_CONFIG_H -I. -I./src    -DCYGWIN
-DSYSCONFDIR="\"/usr/local/etc\"" -I./src -I./src/device -I./src/http
-I./src/process -I./src/protocols -I./src/ssl -I./libmonit/src
-Wno-address -Wno-pointer-sign -g -O2 -Wall -Wunused -Wno-unused-label
-funsigned-char -D_GNU_SOURCE -std=c99 -D _REENTRANT -c -o src/y.tab.o
src/y.tab.c
<command-line>:0:6: error: expected identifier or ‘(’ before numeric
constant
src/monit.h:581:19: note: in expansion of macro ‘unix’
                 } unix;
                   ^~~~
<command-line>:0:6: error: expected identifier or ‘(’ before numeric
constant
src/monit.h:1129:27: note: in expansion of macro ‘unix’
                         } unix;
                           ^~~~
In file included from src/net.h:30:0,
                 from src/p.y:116:
src/monit.h:1130:17: warning: no semicolon at end of struct or union
                 } socket;
                 ^
src/p.y: In function ‘yyparse’:
<command-line>:0:6: error: expected identifier before numeric constant
src/p.y:740:42: note: in expansion of macro ‘unix’
                         Run.httpd.socket.unix.path = $4;
                                          ^~~~
<command-line>:0:6: error: expected identifier before numeric constant
src/p.y:1154:40: note: in expansion of macro ‘unix’
                         portset.target.unix.pathname = $2;
                                        ^~~~
src/p.y: In function ‘addport’:
<command-line>:0:6: error: expected identifier before numeric constant
src/p.y:2765:27: note: in expansion of macro ‘unix’
                 p->target.unix.pathname = port->target.unix.pathname;


Thanks in advance, and have a new good year,

Regards.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Reply | Threaded
Open this post in threaded view
|

Re: Monit Compilation Errors

Ken Brown-6
On 1/15/2018 7:22 AM, Kizito Porta Balanyà wrote:

> Hello all,
>
> I'm trying to compile the last version of MONIT and I get some errors that
> I can not solve.
>
> Basically I get errors like: expected identifier or ‘(’ before numeric
> constant, but reviewing the code I don't see any wrong, beside that the
> sources compile correctly with Linux, AIX, etc ...
>
> Can you help me? Do you have any clue?
>
> I show you the errors obtained:
>
> gcc -DHAVE_CONFIG_H -I. -I./src    -DCYGWIN
> -DSYSCONFDIR="\"/usr/local/etc\"" -I./src -I./src/device -I./src/http
> -I./src/process -I./src/protocols -I./src/ssl -I./libmonit/src
> -Wno-address -Wno-pointer-sign -g -O2 -Wall -Wunused -Wno-unused-label
> -funsigned-char -D_GNU_SOURCE -std=c99 -D _REENTRANT -c -o src/y.tab.o
> src/y.tab.c
> <command-line>:0:6: error: expected identifier or ‘(’ before numeric
> constant
> src/monit.h:581:19: note: in expansion of macro ‘unix’
>                   } unix;
>                     ^~~~
> <command-line>:0:6: error: expected identifier or ‘(’ before numeric
> constant
> src/monit.h:1129:27: note: in expansion of macro ‘unix’
>                           } unix;
>                             ^~~~
> In file included from src/net.h:30:0,
>                   from src/p.y:116:
> src/monit.h:1130:17: warning: no semicolon at end of struct or union
>                   } socket;
>                   ^
> src/p.y: In function ‘yyparse’:
> <command-line>:0:6: error: expected identifier before numeric constant
> src/p.y:740:42: note: in expansion of macro ‘unix’
>                           Run.httpd.socket.unix.path = $4;
>                                            ^~~~
> <command-line>:0:6: error: expected identifier before numeric constant
> src/p.y:1154:40: note: in expansion of macro ‘unix’
>                           portset.target.unix.pathname = $2;
>                                          ^~~~
> src/p.y: In function ‘addport’:
> <command-line>:0:6: error: expected identifier before numeric constant
> src/p.y:2765:27: note: in expansion of macro ‘unix’
>                   p->target.unix.pathname = port->target.unix.pathname;

I tried to reproduce the problem, but I think you must be using
different sources than what I found.  I downloaded monit-5.25.1.tar.gz
from https://mmonit.com/monit/ and found that I couldn't configure it:

$ ./bootstrap
[...]

$ ./configure --without-pam
[...]
configure: error: Architecture not supported: CYGWIN_NT-10.0-WOW
configure: error: ./configure failed for libmonit

Also, the line numbers in my sources differ from those in your error
messages.  Could you say where you got your sources and how you tried to
build?

Ken

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Reply | Threaded
Open this post in threaded view
|

Re: Monit Compilation Errors

BGINFO4X
Hello again,

Well,your are right, I modified the sources to port monit to cygwin, as I
did correctly in version 5.10.

Below you will find a quick how-to (and at the end the required diff files).

##############################################################
CYGWIN PACKGAGING
##############################################################

0- Install Cygwin via setup-x86_64 or setup-x86 from https://www.cygwin.com

1- The following packages are required from the Cygwin:

Devel Tree:
make, autoconf,automake,gcc-core,bison,libtool,flex, cygwin32-zlib,
zlib-devel

Libs Tree:
libcrypt-devel


    Select also all the required dependecies when installing

##############################################################
MONIT DOWNLOAD
##############################################################

2- For better success, start cygwin.bat or cygwin Terminal with
Administration Elevation Privileges "Run as Administrator":

3- Download monit source from https://mmonit.com/monit/ and copy it to your
"cywin forlder"/tmp:

$ cd /tmp
$ tar xvfz monit-5.25.1.tar.gz
$ cd monit-5.25.1


##############################################################
CREATE SYSTEM DEPENDENCIES FILES
##############################################################

Copy the Minimal System Dependencies from sysdep_UNKNOWN to the cygwin
architecture:

cp file /src/device/sysdep_UNKNOWN.c /src/device/sysdep_CYGWIN.c
cp file /src/process/sysdep_UNKNOWN.c /src/process/sysdep_CYGWIN.c


##############################################################
ADAPT CONIFUGRE.AC TO CYGWIN in # Architecture/OS part of code
##############################################################

For configure.ac:
###### CYGWIN ADDED LINES START #####
elif test "${architecture:0:6}" = "CYGWIN"  # CYGWIN_NT-6.1 -> CYGWIN
(Array slice)
then
    ARCH="CYGWIN"
    CFLAGS="$CFLAGS -D _REENTRANT"
### LDFLAGS="$LDFLAGS -lcrypt"
###    CFLAGS="-E $CFLAGS -D _REENTRANT"
###### CYGWIN ADDED LINES END ######

For libmonit configure.ac:
###### CYGWIN ADDED LINES START #####
elif test "${architecture:0:6}" = "CYGWIN"  # CYGWIN_NT-6.1 -> CYGWIN
(Array slice)
then
    CFLAGS="$CFLAGS -D _REENTRANT"
###    CFLAGS="-E $CFLAGS -D _REENTRANT"
    AC_DEFINE([CYGWIN], 1, [Define to 1 if the system is CYGWIN])
###### CYGWIN ADDED LINES END ######

##############################################################
ADAPT MONIT.H
##############################################################
In monit.h add:

#ifdef CYGWIN

#ifndef ICMP_ECHO
#define ICMP_ECHO 8
#endif

#ifndef ICMP_ECHOREPLY
#define ICMP_ECHOREPLY 20
#endif

#endif

##############################################################
ADAPT NET.C
##############################################################
In net.c modify icmp_echo function:

#ifdef CYGWIN
double icmp_echo(const char *hostname, Socket_Family family, Outgoing_T
*outgoing, int size, int timeout, int maxretries) {
    return -1;
}
#else
double icmp_echo(const char *hostname, Socket_Family family, Outgoing_T
*outgoing, int size, int timeout, int maxretries) {
        ASSERT(hostname);

....


##############################################################
COMPILATION
##############################################################

$ ./bootstrap && autoreconf -i -f && automake -acf && ./configure
--without-pam --without-ssl --without-ipv6 --without-largefiles
--without-zlib
   Success bootstrapping libmonit
   Success bootstrapping Monit ...

+------------------------------------------------------------+
| License:                                                   |
| This is Open Source Software and use is subject to the GNU |
| AFFERO GENERAL PUBLIC LICENSE version 3, available in this |
| distribution in the file COPYING.                          |
|                                                            |
| By continuing this installation process, you are bound by  |
| the terms of this license agreement. If you do not agree   |
| with the terms of this license, you must abort the         |
| installation process at this point.                        |
+------------------------------------------------------------+
| Libmonit is configured as follows:                         |
|                                                            |
|   Optimized:                                    DISABLED   |
|   Profiling:                                    DISABLED   |
|   Compression:                                  DISABLED   |
+------------------------------------------------------------+

Monit Build Information:

                Architecture: CYGWIN
              Compiler flags: -Wno-address -Wno-pointer-sign -g -O2 -Wall
-Wunused -Wno-unused-label -funsigned-char -D_GNU_SOURCE -std=c99 -D
_REENTRANT
                Linker flags: -lpthread -lcrypt -lresolv
           pid file location: /var/run
           Install directory: /usr/local

+------------------------------------------------------------+
| License:                                                   |
| This is Open Source Software and use is subject to the GNU |
| AFFERO GENERAL PUBLIC LICENSE version 3, available in this |
| distribution in the file COPYING.                          |
|                                                            |
| By continuing this installation process, you are bound by  |
| the terms of this license agreement. If you do not agree   |
| with the terms of this license, you must abort the         |
| installation process at this point.                        |
+------------------------------------------------------------+
| Monit has been configured with the following options:      |
|                                                            |
|   Compression:                                  ENABLED    |
|   PAM support:                                  DISABLED   |
|   SSL support:                                  DISABLED   |
|   Large files support:                          DISABLED   |
|   IPv6 support:                                 DISABLED   |
|   Optimized:                                    DISABLED   |
|   Profiling:                                    DISABLED   |




##############################################################################
MAKE MONIT
##############################################################################
NOTE: disable your Antivirus Software to successfully run the program !!!
NOTE: make clean can help if some compilation has tried and failed

$ make clean
& make

gcc -DHAVE_CONFIG_H -I. -I./src    -DCYGWIN
-DSYSCONFDIR="\"/usr/local/etc\"" -I./src -I./src/device -I./src/http
-I./src/notification -I./src/process -I./src/protocols -I./src/ssl
-I./src/terminal -I./libmonit/src   -Wno-address -Wno-pointer-sign -g -O2
-Wall -Wunused -Wno-unused-label -funsigned-char -D_GNU_SOURCE -std=c99 -D
_REENTRANT -c -o src/y.tab.o src/y.tab.c
<command-line>:0:6: error: expected identifier or ‘(’ before numeric
constant
src/monit.h:647:19: note: in expansion of macro ‘unix’
                 } unix;
                   ^~~~
<command-line>:0:6: error: expected identifier or ‘(’ before numeric
constant
src/monit.h:1291:27: note: in expansion of macro ‘unix’
                         } unix;
                           ^~~~
In file included from src/net.h:30:0,
                 from src/p.y:120:
src/monit.h:1292:17: warning: no semicolon at end of struct or union
                 } socket;
                 ^
src/p.y: In function ‘yyparse’:
<command-line>:0:6: error: expected identifier before numeric constant
src/p.y:1059:42: note: in expansion of macro ‘unix’
                         Run.httpd.socket.unix.path = $2;
                                          ^~~~
<command-line>:0:6: error: expected identifier before numeric constant
src/p.y:1069:42: note: in expansion of macro ‘unix’
                         Run.httpd.socket.unix.uid = get_uid($2, 0);
                                          ^~~~
<command-line>:0:6: error: expected identifier before numeric constant
src/p.y:1074:42: note: in expansion of macro ‘unix’
                         Run.httpd.socket.unix.gid = get_gid($2, 0);
                                          ^~~~
<command-line>:0:6: error: expected identifier before numeric constant
src/p.y:1079:42: note: in expansion of macro ‘unix’
                         Run.httpd.socket.unix.uid = get_uid(NULL, $2);
                                          ^~~~
<command-line>:0:6: error: expected identifier before numeric constant
src/p.y:1083:42: note: in expansion of macro ‘unix’
                         Run.httpd.socket.unix.gid = get_gid(NULL, $2);
                                          ^~~~
<command-line>:0:6: error: expected identifier before numeric constant
src/p.y:1087:42: note: in expansion of macro ‘unix’
                         Run.httpd.socket.unix.permission = check_perm($2);
                                          ^~~~
<command-line>:0:6: error: expected identifier before numeric constant
src/p.y:1477:40: note: in expansion of macro ‘unix’
                         portset.target.unix.pathname = $2;
                                        ^~~~
src/p.y: In function ‘addport’:
<command-line>:0:6: error: expected identifier before numeric constant
src/p.y:3380:27: note: in expansion of macro ‘unix’
                 p->target.unix.pathname = port->target.unix.pathname;
                           ^~~~
make[2]: *** [Makefile:752: src/y.tab.o] Error 1
make[2]: Leaving directory '/tmp/monit-5.25.1'
make[1]: *** [Makefile:819: all-recursive] Error 1
make[1]: Leaving directory '/tmp/monit-5.25.1'
make: *** [Makefile:531: all] Error 2


##############################################################################
DIFF FILES (sources are configure.ac.bck)
##############################################################################

diff configure.ac configure.ac.bck
622,634d621
<
<
<
< ###### CYGWIN ADDED LINES START #####
< elif test "${architecture:0:6}" = "CYGWIN"  # CYGWIN_NT-6.1 -> CYGWIN
(Array slice)
< then
<       ARCH="CYGWIN"
<       CFLAGS="$CFLAGS -D _REENTRANT"
< ### LDFLAGS="$LDFLAGS -lcrypt"
< ###   CFLAGS="-E $CFLAGS -D _REENTRANT"
< ###### CYGWIN ADDED LINES END ######

$ cd libmonit
$ diff configure.ac configure.ac.bck
249,260d248
<
<
< ###### CYGWIN ADDED LINES START #####
< elif test "${architecture:0:6}" = "CYGWIN"  # CYGWIN_NT-6.1 -> CYGWIN
(Array slice)
< then
<       CFLAGS="$CFLAGS -D _REENTRANT"
< ###   LDFLAGS="$LDFLAGS -lcrypt"
< ###   CFLAGS="-E $CFLAGS -D _REENTRANT"
<       AC_DEFINE([CYGWIN], 1, [Define to 1 if the system is CYGWIN])
< ###### CYGWIN ADDED LINES END ######
<
<
262c250
<       AC_MSG_ERROR([Architecture not supported: ${architecture}])
---
>    AC_MSG_ERROR([Architecture not supported: ${architecture}])

$cd ..
$ cd src

$ diff monit.h monit.h.bck
26,41d25
< /* CYGWIN */
< #ifdef CYGWIN
<
< #ifndef ICMP_ECHO
< #define ICMP_ECHO 8
< #endif
<
< #ifndef ICMP_ECHOREPLY
< #define ICMP_ECHOREPLY 20
< #endif
<
< #endif
< /* CYGWIN */
<
<
<
$ diff net.c net.c.bck
459,466d458
< /* CYGWIN */
<
< #ifdef CYGWIN
< double icmp_echo(const char *hostname, Socket_Family family, Outgoing_T
*outgoing, int size, int timeout, int maxretries) {
<       return -1;
< }
< #else
< /* CYGWIN */
548,550d539
<
<
< #endif



2018-01-15 15:27 GMT+01:00 Ken Brown <[hidden email]>:

> On 1/15/2018 7:22 AM, Kizito Porta Balanyà wrote:
>
>> Hello all,
>>
>> I'm trying to compile the last version of MONIT and I get some errors that
>> I can not solve.
>>
>> Basically I get errors like: expected identifier or ‘(’ before numeric
>> constant, but reviewing the code I don't see any wrong, beside that the
>> sources compile correctly with Linux, AIX, etc ...
>>
>> Can you help me? Do you have any clue?
>>
>> I show you the errors obtained:
>>
>> gcc -DHAVE_CONFIG_H -I. -I./src    -DCYGWIN
>> -DSYSCONFDIR="\"/usr/local/etc\"" -I./src -I./src/device -I./src/http
>> -I./src/process -I./src/protocols -I./src/ssl -I./libmonit/src
>> -Wno-address -Wno-pointer-sign -g -O2 -Wall -Wunused -Wno-unused-label
>> -funsigned-char -D_GNU_SOURCE -std=c99 -D _REENTRANT -c -o src/y.tab.o
>> src/y.tab.c
>> <command-line>:0:6: error: expected identifier or ‘(’ before numeric
>> constant
>> src/monit.h:581:19: note: in expansion of macro ‘unix’
>>                   } unix;
>>                     ^~~~
>> <command-line>:0:6: error: expected identifier or ‘(’ before numeric
>> constant
>> src/monit.h:1129:27: note: in expansion of macro ‘unix’
>>                           } unix;
>>                             ^~~~
>> In file included from src/net.h:30:0,
>>                   from src/p.y:116:
>> src/monit.h:1130:17: warning: no semicolon at end of struct or union
>>                   } socket;
>>                   ^
>> src/p.y: In function ‘yyparse’:
>> <command-line>:0:6: error: expected identifier before numeric constant
>> src/p.y:740:42: note: in expansion of macro ‘unix’
>>                           Run.httpd.socket.unix.path = $4;
>>                                            ^~~~
>> <command-line>:0:6: error: expected identifier before numeric constant
>> src/p.y:1154:40: note: in expansion of macro ‘unix’
>>                           portset.target.unix.pathname = $2;
>>                                          ^~~~
>> src/p.y: In function ‘addport’:
>> <command-line>:0:6: error: expected identifier before numeric constant
>> src/p.y:2765:27: note: in expansion of macro ‘unix’
>>                   p->target.unix.pathname = port->target.unix.pathname;
>>
>
> I tried to reproduce the problem, but I think you must be using different
> sources than what I found.  I downloaded monit-5.25.1.tar.gz from
> https://mmonit.com/monit/ and found that I couldn't configure it:
>
> $ ./bootstrap
> [...]
>
> $ ./configure --without-pam
> [...]
> configure: error: Architecture not supported: CYGWIN_NT-10.0-WOW
> configure: error: ./configure failed for libmonit
>
> Also, the line numbers in my sources differ from those in your error
> messages.  Could you say where you got your sources and how you tried to
> build?
>
> Ken
>
> --
> Problem reports:       http://cygwin.com/problems.html
> FAQ:                   http://cygwin.com/faq/
> Documentation:         http://cygwin.com/docs.html
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
>
>

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Reply | Threaded
Open this post in threaded view
|

Re: Monit Compilation Errors

szgyg-2
In reply to this post by Kizito Porta Balanyà
On 2018-01-15, Kizito Porta Balanyà wrote:

> Hello all,
>
> I'm trying to compile the last version of MONIT and I get some errors that
> I can not solve.
>
> <command-line>:0:6: error: expected identifier or ‘(’ before numeric
> constant
> src/monit.h:581:19: note: in expansion of macro ‘unix’
>                  } unix;
>                    ^~~~

From https://gcc.gnu.org/onlinedocs/cpp/System-specific-Predefined-Macros.html

"historically system-specific macros have had names with no special
prefix; for instance, it is common to find unix defined on Unix systems.
[...] When the -ansi option, or any -std option that requests strict
conformance, is given to the compiler, all the system-specific predefined
macros outside the reserved namespace are suppressed."


You can see the predefined macros with `cpp -dD /dev/null'.

$ cpp -dD /dev/null
# 1 "/dev/null"
# 1 "<built-in>"
[...]
#define __unix__ 1
#define __unix 1
#define __declspec(x) __attribute__((x))
#define __DECIMAL_BID_FORMAT__ 1
# 1 "<command-line>"
#define unix 1                     <-- this is your problem
# 1 "/dev/null"


With -ansi:

$ cpp -ansi -dD /dev/null
# 1 "/dev/null"
# 1 "<built-in>"
[...]
#define __unix__ 1
#define __unix 1
#define __declspec(x) __attribute__((x))
#define __DECIMAL_BID_FORMAT__ 1
# 1 "<command-line>"
# 1 "/dev/null"


$ cpp --version
cpp (GCC) 6.4.0


You can undefine the unix macro or rename the unix struct.

szgyg


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Reply | Threaded
Open this post in threaded view
|

Re: Monit Compilation Errors

Brian Inglis
On 2018-01-15 13:56, szgyg wrote:

> On 2018-01-15, Kizito Porta Balanyà wrote:
>> I'm trying to compile the last version of MONIT and I get some errors that
>> I can not solve.
>> <command-line>:0:6: error: expected identifier or ‘(’ before numeric
>> constant
>> src/monit.h:581:19: note: in expansion of macro ‘unix’
>>                  } unix;
>>                    ^~~~
>>From https://gcc.gnu.org/onlinedocs/cpp/System-specific-Predefined-Macros.html
> "historically system-specific macros have had names with no special
> prefix; for instance, it is common to find unix defined on Unix systems.
> [...] When the -ansi option, or any -std option that requests strict
> conformance, is given to the compiler, all the system-specific predefined
> macros outside the reserved namespace are suppressed."
> You can see the predefined macros with `cpp -dD /dev/null'.
> $ cpp -dD /dev/null
> # 1 "/dev/null"
> # 1 "<built-in>"
> [...]
> #define __unix__ 1
> #define __unix 1
> #define __declspec(x) __attribute__((x))
> #define __DECIMAL_BID_FORMAT__ 1
> # 1 "<command-line>"
> #define unix 1                     <-- this is your problem
> # 1 "/dev/null"
> With -ansi:
> $ cpp -ansi -dD /dev/null
> # 1 "/dev/null"
> # 1 "<built-in>"
> [...]
> #define __unix__ 1
> #define __unix 1
> #define __declspec(x) __attribute__((x))
> #define __DECIMAL_BID_FORMAT__ 1
> # 1 "<command-line>"
> # 1 "/dev/null"
> $ cpp --version
> cpp (GCC) 6.4.0
> You can undefine the unix macro or rename the unix struct.

Looks like -std=c99 without -ansi does not suppress those symbols so add -ansi
to CFLAGS, use equivalent configure options, or autoconf/automake changes.

--
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Reply | Threaded
Open this post in threaded view
|

Re: Monit Compilation Errors

szgyg-2
On 2018-01-15, Brian Inglis wrote:

> On 2018-01-15 13:56, szgyg wrote:
>> On 2018-01-15, Kizito Porta Balanyà wrote:
>>> I'm trying to compile the last version of MONIT and I get some errors that
>>> I can not solve.
>>> <command-line>:0:6: error: expected identifier or ‘(’ before numeric
>>> constant
>>> src/monit.h:581:19: note: in expansion of macro ‘unix’
>>>                  } unix;
>>>                    ^~~~
>>
>> From https://gcc.gnu.org/onlinedocs/cpp/System-specific-Predefined-Macros.html
>> "historically system-specific macros have had names with no special
>> prefix; for instance, it is common to find unix defined on Unix systems.
>> [...] When the -ansi option, or any -std option that requests strict
>> conformance, is given to the compiler, all the system-specific predefined
>> macros outside the reserved namespace are suppressed."
>> You can see the predefined macros with `cpp -dD /dev/null'.
>> [...]
>> You can undefine the unix macro or rename the unix struct.
>
> Looks like -std=c99 without -ansi does not suppress those symbols so add -ansi
> to CFLAGS, use equivalent configure options, or autoconf/automake changes.

I'd go with the minimally intrusive `CFLAGS=-Uunix'. -ansi can have undesirable
side effects.

s


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Reply | Threaded
Open this post in threaded view
|

Re: Monit Compilation Errors

BGINFO4X
Hello again,

Yes, you are right, --ansi have undesirable effects like:

In file included from src/net.h:30:0,
                 from src/p.y:120:
src/monit.h:124:1: error: C++ style comments are not allowed in ISO C90
 //FIXME: we can export this type in libmonit
 ^
etc ...

Finally, fter switching to the 32bits cygwin version (-m32 in cygwin64
generated more errors), and modifying Lync.c , monit has been compiled
again for this version.

$ ./monit.exe --version
This is Monit version 5.25.1
Built without ssl, without ipv6, with compression, without pam and without
large                                                        files
Copyright (C) 2001-2017 Tildeslash Ltd. All Rights Reserved.

And the http service works:

http://localhost:2812
user: admin, pwd: monit
Monit Service Manager Running

What are the next steps? Try to compile for the 64bits version? Both
packages are required or only one? In that case, the 64bits cygwin
installer can install the 32 bits monit version?

Thanks a lot for your time.
Regards.

2018-01-17 20:12 GMT+01:00 szgyg <[hidden email]>:

> On 2018-01-15, Brian Inglis wrote:
> > On 2018-01-15 13:56, szgyg wrote:
> >> On 2018-01-15, Kizito Porta Balanyà wrote:
> >>> I'm trying to compile the last version of MONIT and I get some errors
> that
> >>> I can not solve.
> >>> <command-line>:0:6: error: expected identifier or ‘(’ before numeric
> >>> constant
> >>> src/monit.h:581:19: note: in expansion of macro ‘unix’
> >>>                  } unix;
> >>>                    ^~~~
> >>
> >> From https://gcc.gnu.org/onlinedocs/cpp/System-
> specific-Predefined-Macros.html
> >> "historically system-specific macros have had names with no special
> >> prefix; for instance, it is common to find unix defined on Unix systems.
> >> [...] When the -ansi option, or any -std option that requests strict
> >> conformance, is given to the compiler, all the system-specific
> predefined
> >> macros outside the reserved namespace are suppressed."
> >> You can see the predefined macros with `cpp -dD /dev/null'.
> >> [...]
> >> You can undefine the unix macro or rename the unix struct.
> >
> > Looks like -std=c99 without -ansi does not suppress those symbols so add
> -ansi
> > to CFLAGS, use equivalent configure options, or autoconf/automake
> changes.
>
> I'd go with the minimally intrusive `CFLAGS=-Uunix'. -ansi can have
> undesirable
> side effects.
>
> s
>
>
> --
> Problem reports:       http://cygwin.com/problems.html
> FAQ:                   http://cygwin.com/faq/
> Documentation:         http://cygwin.com/docs.html
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
>
>

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Reply | Threaded
Open this post in threaded view
|

Re: Monit Compilation Errors

szgyg-2
On 2018-01-18, BGINFO4X wrote:
> 2018-01-17 20:12 GMT+01:00 szgyg <xxxxx@xxxxxxxxxxxxxx>:
                                    ^^^^^^^^^^^^^^^^^^^^
Please don't quote raw email addresses.

> Finally, fter switching to the 32bits cygwin version (-m32 in cygwin64
> generated more errors), and modifying Lync.c , monit has been compiled
> again for this version.

Congrats. (-m32 is not supported on cygwin, don't use it.)


> What are the next steps? Try to compile for the 64bits version? Both
> packages are required or only one? In that case, the 64bits cygwin
> installer can install the 32 bits monit version?

You can't mix 32 and 64-bit programs. If you want to use it in 64-bit
cygwin, you should recompile it.

s


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Reply | Threaded
Open this post in threaded view
|

Re: Monit Compilation Errors

Kizito Porta Balanyà
2018-01-18 19:47 GMT+01:00 szgyg <[hidden email]>:

> On 2018-01-18, BGINFO4X wrote:
> > 2018-01-17 20:12 GMT+01:00 szgyg <xxxxx@xxxxxxxxxxxxxx>:
>                                     ^^^^^^^^^^^^^^^^^^^^
> Please don't quote raw email addresses.
>
> > Finally, fter switching to the 32bits cygwin version (-m32 in cygwin64
> > generated more errors), and modifying Lync.c , monit has been compiled
> > again for this version.
>
> Congrats. (-m32 is not supported on cygwin, don't use it.)
>
>
> > What are the next steps? Try to compile for the 64bits version? Both
> > packages are required or only one? In that case, the 64bits cygwin
> > installer can install the 32 bits monit version?
>
> You can't mix 32 and 64-bit programs. If you want to use it in 64-bit
> cygwin, you should recompile it.
>
> s
>

Which is the best way to compile a program for both platforms (32-64 bits)
to release a cygwin package?

Thanks.

>
>
> --
> Problem reports:       http://cygwin.com/problems.html
> FAQ:                   http://cygwin.com/faq/
> Documentation:         http://cygwin.com/docs.html
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
>
>

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Reply | Threaded
Open this post in threaded view
|

Re: Monit Compilation Errors

marco atzeri-4
On 23/01/2018 19:43, Kizito Porta Balanyà wrote:
> 2018-01-18 19:47 GMT+01:00 szgyg <[hidden email]>:
>

>
> Which is the best way to compile a program for both platforms (32-64 bits)
> to release a cygwin package?
>
> Thanks.
>

to have both 32bit and 64bit cygwin installed.

Regards
MArco


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Reply | Threaded
Open this post in threaded view
|

Re: Monit Compilation Errors

BGINFO4X
2018-01-23 14:17 GMT+01:00 Marco Atzeri <[hidden email]>:

> On 23/01/2018 19:43, Kizito Porta Balanyà wrote:
>
>> 2018-01-18 19:47 GMT+01:00 szgyg <[hidden email]>:
>>
>>
>
>> Which is the best way to compile a program for both platforms (32-64 bits)
>> to release a cygwin package?
>>
>> Thanks.
>>
>>
> to have both 32bit and 64bit cygwin installed.
>
>
Is there any way to automate this?
Do the people (port owners) compile all the ports manually each time?

Thanks a lot.


> Regards
> MArco
>
>
>
> --
> Problem reports:       http://cygwin.com/problems.html
> FAQ:                   http://cygwin.com/faq/
> Documentation:         http://cygwin.com/docs.html
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
>
>

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Reply | Threaded
Open this post in threaded view
|

Re: Monit Compilation Errors

marco atzeri-4
On 23/01/2018 21:25, BGINFO4X wrote:

> 2018-01-23 14:17 GMT+01:00 Marco Atzeri <[hidden email]>:
>
>> On 23/01/2018 19:43, Kizito Porta Balanyà wrote:
>>
>>> 2018-01-18 19:47 GMT+01:00 szgyg <[hidden email]>:
>>>
>>>
>>
>>> Which is the best way to compile a program for both platforms (32-64 bits)
>>> to release a cygwin package?
>>>
>>> Thanks.
>>>
>>>
>> to have both 32bit and 64bit cygwin installed.
>>
>>
> Is there any way to automate this?
> Do the people (port owners) compile all the ports manually each time?
>
> Thanks a lot.
>
>
>> Regards
>> MArco
>>

cygport allows to automatize all the process
of compilation/installation/packing

Regards
Marco


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Reply | Threaded
Open this post in threaded view
|

Re: Monit Compilation Errors

ASSI
In reply to this post by Kizito Porta Balanyà
Kizito Porta Balanyà writes:
> Which is the best way to compile a program for both platforms (32-64 bits)
> to release a cygwin package?

Depending on how cleanly the sources and build system are set up you
could cross-compile one or the other or even both (from GNU/Linux), but
if you want to run the test suites you should simply have both a 32bit
and 64bit Cygwin installed and use those.  Unless you want to devote two
machines, that implies a native 64bit Windows and the 32bit installation
using WoW64.

I use a dedicated Win8.1 build box that doesn't see any other use and I
have another one with Win10 for the occasional test.  If you'd rather
use your main machine, it's a good idea to either have separate
development installations of Cygwin for the builds or run them in a
clean VM.


Regards,
Achim.
--
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

SD adaptation for Waldorf rackAttack V1.04R1:
http://Synth.Stromeko.net/Downloads.html#WaldorfSDada

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Reply | Threaded
Open this post in threaded view
|

Re: Monit Compilation Errors

ASSI
In reply to this post by BGINFO4X
BGINFO4X writes:
> Is there any way to automate this?

Automate what, the Cygwin install?  Yes, BTDT.

> Do the people (port owners) compile all the ports manually each time?

Sort of, if you have many packages there will be some amount of
scripting going on or you'll go insane.  Full build automation with a
full blown CI?  I might do that at work when I get some time and
computing power to play with.  Unfortunately there are not a lot of
options when you consider building in the clouds, unless you already
have a venue tat gives you something with Windows installed.


Regards,
Achim.
--
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

SD adaptations for KORG EX-800 and Poly-800MkII V0.9:
http://Synth.Stromeko.net/Downloads.html#KorgSDada

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple