Mail Archives: cygwin/2018/01/15/11:33:43
X-Recipient: | archive-cygwin AT delorie DOT com
|
DomainKey-Signature: | a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
|
| :list-unsubscribe:list-subscribe:list-archive:list-post
|
| :list-help:sender:mime-version:in-reply-to:references:from:date
|
| :message-id:subject:to:content-type:content-transfer-encoding;
|
| q=dns; s=default; b=jPWIXsq23Tje/NULxtlTrdsM2+RkugNNlTodq7tS3vH
|
| tZySQZ4Kqf1p9jJxpZPTp+XjzbvuhS+jU4nldbhhU0v5t9rPdzXtXFennljQXzKu
|
| K48FV7LNmV3r4TTQJgCXxFocxVk1TSdSQvvg3/vXtqFHC62/hy/rr4Jc2rJ/nyOw
|
| =
|
DKIM-Signature: | v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
|
| :list-unsubscribe:list-subscribe:list-archive:list-post
|
| :list-help:sender:mime-version:in-reply-to:references:from:date
|
| :message-id:subject:to:content-type:content-transfer-encoding;
|
| s=default; bh=F4Bs7xB3D+290CmFX72VCaMvy8k=; b=ASk/SCYrObmoYzCXF
|
| M3VpRenjXnxvQMITB95zcDwMYCPvxV9kXwOEjiwIHeqaBORQwvnsjYolmcQ4xxgf
|
| 1WIRhgdCC0CC3idnOLyfvoJ2GRjACrez04no7cbtplOOWPWqexh0OpFDVYNw77G9
|
| C5hk848niOo82luVqJfiZL1Ias=
|
Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm
|
List-Id: | <cygwin.cygwin.com>
|
List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com>
|
List-Archive: | <http://sourceware.org/ml/cygwin/>
|
List-Post: | <mailto:cygwin AT cygwin DOT com>
|
List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
|
Sender: | cygwin-owner AT cygwin DOT com
|
Mail-Followup-To: | cygwin AT cygwin DOT com
|
Delivered-To: | mailing list cygwin AT cygwin DOT com
|
Authentication-Results: | sourceware.org; auth=none
|
X-Virus-Found: | No
|
X-Spam-SWARE-Status: | No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,GIT_PATCH_2,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=H*c:alternative
|
X-HELO: | mail-io0-f177.google.com
|
X-Google-DKIM-Signature: | v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to; bh=thfMcZzWrt7RTGwXLeBxTs68ZkB2U1cNgLTujHZZZdc=; b=BJBJQOy/mVSYk3xPpvKWlU73xDCXpAOS2AbhKb/UwfIptBVKSk5p5wqQa2/AvrLZgB RQuTA8iuanuGxQnDIhGRY6XcSk0xMFUfmBp6G7Lj9n+4aOyfs7ijAj2oZaWu+9T+JMKS y4QVI6bZX5hdca/sRRzKb/br3JGd2C++om+b0SCsjwlIgc8YzxImfKZ3rLqOnj3ao7iU 5iu08F7ZY5Y3eiXbEC5zgJTKOyn9yvfY6Qb07HfPmEXozoJghFEh7Bl249UPWUq+1fFp w9y3bVgTBlxio8+Cu1Bk3Z06G+KMtgOVbJKQDlZXYz5xZpUXgqlqEYHvIElI6UnLav1y zGrw==
|
X-Gm-Message-State: | AKwxytfACZdbAgBmsaXYPMx2BU/QOb4Ozo3tuoVMZaU4CxZ4njv9QhST VfeRpZG/44vHNg0ry9Sur8kufBzWM6IYds2c7TvzCQ==
|
X-Google-Smtp-Source: | ACJfBotGpIk7Nrq24ovKeXPhqAMJw2bkhvDIRP5uxRf0UfugEqh/Gki2SXyD1RafCcABsXnbsI6o7l69o6ry2+hz32o=
|
X-Received: | by 10.107.161.147 with SMTP id k141mr34069140ioe.39.1516034001940; Mon, 15 Jan 2018 08:33:21 -0800 (PST)
|
MIME-Version: | 1.0
|
In-Reply-To: | <ef0018b6-ffc0-56c3-9ae2-3a85302da7b5@cornell.edu>
|
References: | <CAO2ddnbkToGBYwZuUGfaxr1_NO1qcPzwS+j=tO5C_+jxCos4qA AT mail DOT gmail DOT com> <ef0018b6-ffc0-56c3-9ae2-3a85302da7b5 AT cornell DOT edu>
|
From: | BGINFO4X <bginfo4x AT kztsoftware DOT com>
|
Date: | Mon, 15 Jan 2018 17:33:21 +0100
|
Message-ID: | <CAO2ddnZgcAgmHNJ8Aj4B5X8HPrDZLHCF6t3znmYPW1Ht92baAA@mail.gmail.com>
|
Subject: | Re: Monit Compilation Errors
|
To: | cygwin AT cygwin DOT com
|
X-IsSubscribed: | yes
|
X-MIME-Autoconverted: | from quoted-printable to 8bit by delorie.com id w0FGXdZZ032446
|
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 <kbrown AT cornell DOT edu>:
> 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
- Raw text -