Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ifdef request for pcre on *BSD #30

Closed
jungle-boogie opened this issue Dec 6, 2016 · 14 comments
Closed

ifdef request for pcre on *BSD #30

jungle-boogie opened this issue Dec 6, 2016 · 14 comments

Comments

@jungle-boogie
Copy link

Hello,

checking for pcre.h... no
configure: error: Could not find pcre headers !

*BSD puts it here:
/usr/local/include/pcre.h

@adubovikov
Copy link
Member

./configure CFLAGS="-I/usr/local/include" LDFLAGS="-L/usr/local/lib"

@jungle-boogie
Copy link
Author

Gets past the configure part...

% make
Making all in src
make  all-am
cc -DHAVE_CONFIG_H -I.      -I/usr/local/include -MT ipreasm.o -MD -MP -MF .deps/ipreasm.Tpo -c -o ipreasm.o ipreasm.c
In file included from ipreasm.c:17:
/usr/include/netinet/ip.h:51:2: error: unknown type name 'u_char'; did you mean 'char'?
        u_char  ip_hl:4,                /* header length */
        ^
/usr/include/netinet/ip.h:55:2: error: unknown type name 'u_char'; did you mean 'char'?
        u_char  ip_v:4,                 /* version */
        ^
/usr/include/netinet/ip.h:55:9: error: duplicate member 'ip_v'
        u_char  ip_v:4,                 /* version */
                ^
/usr/include/netinet/ip.h:52:3: note: previous declaration is here
                ip_v:4;                 /* version */
                ^
/usr/include/netinet/ip.h:56:3: error: duplicate member 'ip_hl'
                ip_hl:4;                /* header length */
                ^
/usr/include/netinet/ip.h:51:9: note: previous declaration is here
        u_char  ip_hl:4,                /* header length */
                ^
/usr/include/netinet/ip.h:58:2: error: unknown type name 'u_char'; did you mean 'char'?
        u_char  ip_tos;                 /* type of service */
        ^
/usr/include/netinet/ip.h:59:2: error: unknown type name 'u_short'; did you mean 'short'?
        u_short ip_len;                 /* total length */
        ^
/usr/include/netinet/ip.h:60:2: error: unknown type name 'u_short'; did you mean 'short'?
        u_short ip_id;                  /* identification */
        ^
/usr/include/netinet/ip.h:61:2: error: unknown type name 'u_short'; did you mean 'short'?
        u_short ip_off;                 /* fragment offset field */
        ^
/usr/include/netinet/ip.h:66:2: error: unknown type name 'u_char'; did you mean 'char'?
        u_char  ip_ttl;                 /* time to live */
        ^
/usr/include/netinet/ip.h:67:2: error: unknown type name 'u_char'; did you mean 'char'?
        u_char  ip_p;                   /* protocol */
        ^
/usr/include/netinet/ip.h:68:2: error: unknown type name 'u_short'; did you mean 'short'?
        u_short ip_sum;                 /* checksum */
        ^
/usr/include/netinet/ip.h:69:17: error: field has incomplete type 'struct in_addr'
        struct  in_addr ip_src,ip_dst;  /* source and dest address */
                        ^
/usr/include/netinet/ip.h:69:9: note: forward declaration of 'struct in_addr'
        struct  in_addr ip_src,ip_dst;  /* source and dest address */
                ^
/usr/include/netinet/ip.h:69:24: error: field has incomplete type 'struct in_addr'
        struct  in_addr ip_src,ip_dst;  /* source and dest address */
                               ^
/usr/include/netinet/ip.h:69:9: note: forward declaration of 'struct in_addr'
        struct  in_addr ip_src,ip_dst;  /* source and dest address */
                ^
/usr/include/netinet/ip.h:167:2: error: unknown type name 'u_char'; did you mean 'char'?
        u_char  ipt_code;               /* IPOPT_TS */
        ^
/usr/include/netinet/ip.h:168:2: error: unknown type name 'u_char'; did you mean 'char'?
        u_char  ipt_len;                /* size of structure (variable) */
        ^
/usr/include/netinet/ip.h:169:2: error: unknown type name 'u_char'; did you mean 'char'?
        u_char  ipt_ptr;                /* index of current entry */
        ^
/usr/include/netinet/ip.h:171:2: error: unknown type name 'u_char'; did you mean 'char'?
        u_char  ipt_flg:4,              /* flags, see below */
        ^
/usr/include/netinet/ip.h:175:2: error: unknown type name 'u_char'; did you mean 'char'?
        u_char  ipt_oflw:4,             /* overflow counter */
        ^
/usr/include/netinet/ip.h:175:9: error: duplicate member 'ipt_oflw'
        u_char  ipt_oflw:4,             /* overflow counter */
                ^
/usr/include/netinet/ip.h:172:3: note: previous declaration is here
                ipt_oflw:4;             /* overflow counter */
                ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
*** Error code 1

Stop.
make[2]: stopped in /usr/home/sean/bin/sipgrep/src
*** Error code 1

Stop.
make[1]: stopped in /usr/home/sean/bin/sipgrep/src
*** Error code 1

Stop.
make: stopped in /usr/home/sean/bin/sipgrep

@adubovikov
Copy link
Member

whats distributive you use ?

@jungle-boogie
Copy link
Author

FreeBSD 11-release

@adubovikov
Copy link
Member

can you add at line 16:

#include <sys/types.h>

and try again ?

@jungle-boogie
Copy link
Author

jungle-boogie commented Dec 6, 2016

In which file?

@adubovikov
Copy link
Member

@jungle-boogie
Copy link
Author

hi @adubovikov,

edited the file:

 $ head -18 src/ipreasm.c


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stddef.h>

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif /* HAVE_CONFIG_H */
#include <sys/types.h>
#include <netinet/ip.h>
#include <netinet/udp.h>

not any better:

% make
Making all in src
make  all-am
cc -DHAVE_CONFIG_H -I.      -I/usr/local/include -MT sipgrep.o -MD -MP -MF .deps/sipgrep.Tpo -c -o sipgrep.o sipgrep.c
sipgrep.c:1452:38: warning: '&&' within '||' [-Wlogical-op-parentheses]
                if (local_match == 1 && !invert_match || local_match != invert_match)
                    ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~ ~~
sipgrep.c:1452:38: note: place parentheses around the '&&' expression to silence this warning
                if (local_match == 1 && !invert_match || local_match != invert_match)
                                     ^
                    (                                )
sipgrep.c:1573:38: warning: passing 'unsigned char *' to parameter of type 'char *' converts between pointers to integer types with different sign [-Wpointer-sign]
            if(light_parse_message ( d, remaining_bytes, &bytes_parsed) == 1)
                                     ^
./include/sipparse.h:133:31: note: passing argument to parameter 'message' here
int light_parse_message(char *message, unsigned int blen, unsigned int* bytes_parsed);
                              ^
sipgrep.c:1715:18: warning: assigning to 'const unsigned char *' from 'char *' converts between pointers to integer types with different sign [-Wpointer-sign]
          else if ((pch = strchr ((const char*) s, ' ')) != NULL) {
                        ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sipgrep.c:1730:10: warning: assigning to 'const unsigned char *' from 'char *' converts between pointers to integer types with different sign [-Wpointer-sign]
            pch = strstr ((char *)s, ";tag=");
                ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
sipgrep.c:1738:10: warning: assigning to 'const unsigned char *' from 'char *' converts between pointers to integer types with different sign [-Wpointer-sign]
            pch = strstr ((char *)s, ";tag=");
                ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
sipgrep.c:1746:10: warning: assigning to 'const unsigned char *' from 'char *' converts between pointers to integer types with different sign [-Wpointer-sign]
            pch = strstr ((char *)s, "branch=");
                ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sipgrep.c:1749:12: warning: assigning to 'const unsigned char *' from 'char *' converts between pointers to integer types with different sign [-Wpointer-sign]
              pca = strchr ((char *)pch, ';');
                  ^ ~~~~~~~~~~~~~~~~~~~~~~~~~
sipgrep.c:1752:7: warning: assigning to 'const unsigned char *' from 'char *' converts between pointers to integer types with different sign [-Wpointer-sign]
                pca = strchr ((char *)pch, '\n');
                    ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~
8 warnings generated.
mv -f .deps/sipgrep.Tpo .deps/sipgrep.Po
cc -DHAVE_CONFIG_H -I.      -I/usr/local/include -MT log.o -MD -MP -MF .deps/log.Tpo -c -o log.o log.c
mv -f .deps/log.Tpo .deps/log.Po
cc -DHAVE_CONFIG_H -I.      -I/usr/local/include -MT ipreasm.o -MD -MP -MF .deps/ipreasm.Tpo -c -o ipreasm.o ipreasm.c
In file included from ipreasm.c:17:
/usr/include/netinet/ip.h:69:17: error: field has incomplete type 'struct in_addr'
        struct  in_addr ip_src,ip_dst;  /* source and dest address */
                        ^
/usr/include/netinet/ip.h:69:9: note: forward declaration of 'struct in_addr'
        struct  in_addr ip_src,ip_dst;  /* source and dest address */
                ^
/usr/include/netinet/ip.h:69:24: error: field has incomplete type 'struct in_addr'
        struct  in_addr ip_src,ip_dst;  /* source and dest address */
                               ^
/usr/include/netinet/ip.h:69:9: note: forward declaration of 'struct in_addr'
        struct  in_addr ip_src,ip_dst;  /* source and dest address */
                ^
/usr/include/netinet/ip.h:181:19: error: field has incomplete type 'struct in_addr'
                        struct in_addr ipt_addr;
                                       ^
/usr/include/netinet/ip.h:69:9: note: forward declaration of 'struct in_addr'
        struct  in_addr ip_src,ip_dst;  /* source and dest address */
                ^
/usr/include/netinet/ip.h:216:17: error: field has incomplete type 'struct in_addr'
        struct  in_addr ippseudo_src;   /* source internet address */
                        ^
/usr/include/netinet/ip.h:69:9: note: forward declaration of 'struct in_addr'
        struct  in_addr ip_src,ip_dst;  /* source and dest address */
                ^
/usr/include/netinet/ip.h:217:17: error: field has incomplete type 'struct in_addr'
        struct  in_addr ippseudo_dst;   /* destination internet address */
                        ^
/usr/include/netinet/ip.h:69:9: note: forward declaration of 'struct in_addr'
        struct  in_addr ip_src,ip_dst;  /* source and dest address */
                ^
ipreasm.c:454:24: warning: implicit declaration of function 'htons' is invalid in C99 [-Wimplicit-function-declaration]
                        ip_header->ip_len = htons (offset0 + entry->len);
                                            ^
ipreasm.c:672:22: warning: implicit declaration of function 'ntohs' is invalid in C99 [-Wimplicit-function-declaration]
                        uint16_t offset = ntohs (ip_header->ip_off);
                                          ^
2 warnings and 5 errors generated.
*** Error code 1

Stop.
make[2]: stopped in /usr/home/sean/bin/sipgrep/src
*** Error code 1

Stop.
make[1]: stopped in /usr/home/sean/bin/sipgrep/src
*** Error code 1

Stop.
make: stopped in /usr/home/sean/bin/sipgrep

@jungle-boogie
Copy link
Author

my compiler:

% cc -v
FreeBSD clang version 3.8.0 (tags/RELEASE_380/final 262564) (based on LLVM 3.8.0)
Target: i386-unknown-freebsd11.0
Thread model: posix
InstalledDir: /usr/bin

@jungle-boogie
Copy link
Author

here's sys/netinet/ip.h on freebsd:

https://github.com/freebsd/freebsd-base-graphics/blob/master/sys/netinet/ip.h

@jungle-boogie
Copy link
Author

any suggestions?

@adubovikov
Copy link
Member

adubovikov commented Dec 14, 2016 via email

@jungle-boogie
Copy link
Author

jungle-boogie commented Dec 14, 2016

I was just using an old i386 machine to build on. You can use vagrant and pull down a virtual machine here:
https://atlas.hashicorp.com/freebsd/boxes/FreeBSD-11.0-RELEASE-p1

You could also make a digital ocean droplet:
https://www.digitalocean.com/

Either way, these are what you'll want to do once it's installed:
pkg update
pkg upgrade
pkg install git pcre

Then clone your repo and attempt to build.

@jungle-boogie
Copy link
Author

closing this as #27 is more accurate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants