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

Fix missing struct members s6_addr32' and s6_addr16' on OSX. #142

Closed

Conversation

jaytaylor
Copy link
Contributor

Like FreeBSD, in6_addr doesn't have a struct member called s6_addr32' or s6_add16' on Mac OS X.

This commit adds OSX to the controlled group that replaces:

`s6_addr32' with `__u6_addr.__u6_addr32'
`s6_addr16' with `__u6_addr.__u6_addr16'

Sample of errors thrown:

src/libproxychains.c:332:12: error: no member named 's6_addr32' in 'struct in6_addr'
        return a->s6_addr32[0] == 0 && a->s6_addr32[1] == 0 &&
               ~  ^

src/libproxychains.c:337:36: error: no member named 's6_addr16' in 'struct in6_addr'
               a->s6_addr16[4] == 0 && a->s6_addr16[5] == 0xffff;
                                       ~  ^

For further explanation also see this PassiveDNS project commit:

gamelinux/passivedns@42dbd6c

@rofl0r
Copy link
Owner

rofl0r commented Oct 8, 2016

uhm. how did you build proxychains-ng ? it has a configure check so we don't have to hardcode a list of currently broken systems into the code.
generally if you need to #ifdef __SOME_SYSTEM you're doing something wrong: you're assuming SOME_SYSTEM will never change. therefore you should check whether the system you build on uses s6_addr32 or __u6_addr.__u6_addr32 - exactly what we already do.

@jaytaylor
Copy link
Contributor Author

I just followed the INSTALL instructions.

./configure
make # <- broke here

On Sat, Oct 8, 2016 at 11:28 AM, rofl0r notifications@github.com wrote:

uhm. how did you build proxychains-ng ? it has a configure check so we
don't have to hardcode a list of currently broken systems into the code.
generally if you need to #ifdef __SOME_SYSTEM you're doing something
wrong: you're assuming SOME_SYSTEM will never change. therefore you should
check whether the system you build on uses s6_addr32 or
__u6_addr.__u6_addr32 - exactly what we already do.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#142 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAalxGo1pDJIXlzINnBf3qECkyKRjDPJks5qx-CwgaJpZM4KRykg
.

@rofl0r
Copy link
Owner

rofl0r commented Oct 8, 2016

what's the output of configure ?

@jaytaylor
Copy link
Contributor Author

(NB: This is from current master)

jay@jays-mba:~/repos/proxychains-ng$ ./configure
checking whether netinet/in.h defines s6_addr16 ... usage: mktemp [-d] [-q] [-t prefix] [-u] template ...
       mktemp [-d] [-q] [-u] -t prefix
no
checking whether netinet/in.h defines __u6_addr.__u6_addr16 ... usage: mktemp [-d] [-q] [-t prefix] [-u] template ...
       mktemp [-d] [-q] [-u] -t prefix
yes
checking whether $CC defines __OpenBSD__ ... no
Done, now run make && make install
jay@jays-mba:~/repos/proxychains-ng$ make && make install
cc -Qunused-arguments -DSUPER_SECURE -Qunused-arguments -Wall -O0 -g -std=c99 -D_GNU_SOURCE -pipe -Qunused-arguments -DIS_MAC=1 -DLIB_DIR=\"/usr/local/lib\" -DSYSCONFDIR=\"/usr/local/etc\" -DDLL_NAME=\"libproxychains4.dylib\"  -fPIC -c -o src/nameinfo.o src/nameinfo.c
printf '#define VERSION "%s"\n' "$(sh tools/version.sh)" > src/version.h
cc -Qunused-arguments -DSUPER_SECURE -Qunused-arguments -Wall -O0 -g -std=c99 -D_GNU_SOURCE -pipe -Qunused-arguments -DIS_MAC=1 -DLIB_DIR=\"/usr/local/lib\" -DSYSCONFDIR=\"/usr/local/etc\" -DDLL_NAME=\"libproxychains4.dylib\"  -fPIC -c -o src/version.o src/version.c
cc -Qunused-arguments -DSUPER_SECURE -Qunused-arguments -Wall -O0 -g -std=c99 -D_GNU_SOURCE -pipe -Qunused-arguments -DIS_MAC=1 -DLIB_DIR=\"/usr/local/lib\" -DSYSCONFDIR=\"/usr/local/etc\" -DDLL_NAME=\"libproxychains4.dylib\"  -fPIC -c -o src/core.o src/core.c
cc -Qunused-arguments -DSUPER_SECURE -Qunused-arguments -Wall -O0 -g -std=c99 -D_GNU_SOURCE -pipe -Qunused-arguments -DIS_MAC=1 -DLIB_DIR=\"/usr/local/lib\" -DSYSCONFDIR=\"/usr/local/etc\" -DDLL_NAME=\"libproxychains4.dylib\"  -fPIC -c -o src/common.o src/common.c
cc -Qunused-arguments -DSUPER_SECURE -Qunused-arguments -Wall -O0 -g -std=c99 -D_GNU_SOURCE -pipe -Qunused-arguments -DIS_MAC=1 -DLIB_DIR=\"/usr/local/lib\" -DSYSCONFDIR=\"/usr/local/etc\" -DDLL_NAME=\"libproxychains4.dylib\"  -fPIC -c -o src/libproxychains.o src/libproxychains.c
src/libproxychains.c:332:12: error: no member named 's6_addr32' in 'struct in6_addr'
        return a->s6_addr32[0] == 0 && a->s6_addr32[1] == 0 &&
               ~  ^
src/libproxychains.c:332:36: error: no member named 's6_addr32' in 'struct in6_addr'
        return a->s6_addr32[0] == 0 && a->s6_addr32[1] == 0 &&
                                       ~  ^
src/libproxychains.c:333:12: error: no member named 's6_addr16' in 'struct in6_addr'
               a->s6_addr16[4] == 0 && a->s6_addr16[5] == 0xffff;
               ~  ^
src/libproxychains.c:333:36: error: no member named 's6_addr16' in 'struct in6_addr'
               a->s6_addr16[4] == 0 && a->s6_addr16[5] == 0xffff;
                                       ~  ^
src/libproxychains.c:363:39: error: no member named 's6_addr32' in 'struct in6_addr'
                memcpy(&v4inv6.s_addr, &p_addr_in6->s6_addr32[3], 4);
                                        ~~~~~~~~~~  ^
/usr/include/secure/_string.h:65:33: note: expanded from macro 'memcpy'
  __builtin___memcpy_chk (dest, src, len, __darwin_obsz0 (dest))
                                ^
src/libproxychains.c:458:63: error: no member named 's6_addr32' in 'struct in6_addr'
                                        memcpy(v4inv6buf, &((struct sockaddr_in6*)sa)->sin6_addr.s6_addr32[3], 4);
                                                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
/usr/include/secure/_string.h:65:33: note: expanded from macro 'memcpy'
  __builtin___memcpy_chk (dest, src, len, __darwin_obsz0 (dest))
                                ^
6 errors generated.
make: *** [src/libproxychains.o] Error 1

@rofl0r
Copy link
Owner

rofl0r commented Oct 8, 2016

aha, so the bug is that OSX (which version?)'s mktemp misbehaves.

@jaytaylor
Copy link
Contributor Author

jaytaylor commented Oct 8, 2016

Yes I agree - this is what appears to be happening.

Mac OS X version 10.9.5.

@jaytaylor
Copy link
Contributor Author

jaytaylor commented Oct 8, 2016

FWIW, here's the configure output with a set -x statement added right before the lines containing mktemp:

jay@jays-mba:~/repos/proxychains-ng$ ./configure
+ printf 'checking %s ... ' 'whether netinet/in.h defines s6_addr16'
checking whether netinet/in.h defines s6_addr16 ... ++ mktemp
usage: mktemp [-d] [-q] [-t prefix] [-u] template ...
       mktemp [-d] [-q] [-u] -t prefix
+ local tmp=
+ printf '#include <netinet/in.h>\nint main(int a, char**c){struct in6_addr x={.s6_addr32[0]=a};return x.s6_addr16[0]; }'
+ local res=0
+ cc -Qunused-arguments -Qunused-arguments -c .c -o .o
+ res=1
+ rm -f .c .o
+ test x1 = x0
+ printf 'no\n'
no
+ return 1
+ check_compile 'whether netinet/in.h defines __u6_addr.__u6_addr16' '-Ds6_addr16=__u6_addr.__u6_addr16 -Ds6_addr32=__u6_addr.__u6_addr32' '#include <netinet/in.h>\nint main(int a, char**c){struct in6_addr x={.s6_addr32[0]=a};return x.s6_addr16[0]; }'
+ set -x
+ printf 'checking %s ... ' 'whether netinet/in.h defines __u6_addr.__u6_addr16'
checking whether netinet/in.h defines __u6_addr.__u6_addr16 ... ++ mktemp
usage: mktemp [-d] [-q] [-t prefix] [-u] template ...
       mktemp [-d] [-q] [-u] -t prefix
+ local tmp=
+ printf '#include <netinet/in.h>\nint main(int a, char**c){struct in6_addr x={.s6_addr32[0]=a};return x.s6_addr16[0]; }'
+ local res=0
+ cc -Qunused-arguments -Ds6_addr16=__u6_addr.__u6_addr16 -Ds6_addr32=__u6_addr.__u6_addr32 -Qunused-arguments -c .c -o .o
+ rm -f .c .o
+ test x0 = x0
+ printf 'yes\n'
yes
+ test 'x-Ds6_addr16=__u6_addr.__u6_addr16 -Ds6_addr32=__u6_addr.__u6_addr32' = x
+ CPPFLAGS='-Qunused-arguments -Ds6_addr16=__u6_addr.__u6_addr16 -Ds6_addr32=__u6_addr.__u6_addr32'
+ return 0
+ check_define __OpenBSD__
+ printf 'checking whether $CC defines %s ... ' __OpenBSD__
checking whether $CC defines __OpenBSD__ ... + local res=1
+ cc -Qunused-arguments -Ds6_addr16=__u6_addr.__u6_addr16 -Ds6_addr32=__u6_addr.__u6_addr32 -Qunused-arguments -dM -E -
+ grep __OpenBSD__
+ test x1 = x0
+ printf 'no\n'
no
+ return 1
+ echo 'CC?=cc'
+ '[' -z '-Qunused-arguments -Ds6_addr16=__u6_addr.__u6_addr16 -Ds6_addr32=__u6_addr.__u6_addr32' ']'
+ echo 'CPPFLAGS?=-Qunused-arguments' -Ds6_addr16=__u6_addr.__u6_addr16 -Ds6_addr32=__u6_addr.__u6_addr32
+ '[' -z -Qunused-arguments ']'
+ echo 'USER_CFLAGS?=-Qunused-arguments'
+ '[' -z '' ']'
+ echo prefix=/usr/local
+ echo exec_prefix=/usr/local
+ echo bindir=/usr/local/bin
+ echo libdir=/usr/local/lib
+ echo includedir=/usr/local/include
+ echo sysconfdir=/usr/local/etc
+ '[' no = no ']'
+ echo CPPFLAGS+= -DSUPER_SECURE
+ make_cmd=make
+ ismac
+ uname -s
+ grep Darwin
+ echo NO_AS_NEEDED=
+ echo LDSO_SUFFIX=dylib
+ echo MAC_CFLAGS+=-DIS_MAC=1
+ isx86_64
+ uname -m
+ grep -i X86_64
+ '[' '' = 1 ']'
+ echo LD_SET_SONAME=-Wl,-install_name,
+ echo 'Done, now run make && make install'
Done, now run make && make install

EDIT

mktemp man page examples:

EXAMPLES
     The following sh(1) fragment illustrates a simple use of mktemp where the script should quit if it cannot get a safe temporary file.

           tempfoo=`basename $0`
           TMPFILE=`mktemp /tmp/${tempfoo}.XXXXXX` || exit 1
           echo "program output" >> $TMPFILE

     To allow the use of $TMPDIR:

           tempfoo=`basename $0`
           TMPFILE=`mktemp -t ${tempfoo}` || exit 1
           echo "program output" >> $TMPFILE

     In this case, we want the script to catch the error itself.

           tempfoo=`basename $0`
           TMPFILE=`mktemp -q /tmp/${tempfoo}.XXXXXX`
           if [ $? -ne 0 ]; then
                   echo "$0: Can't create temp file, exiting..."
                   exit 1
           fi

@jaytaylor
Copy link
Contributor Author

So I changed all mktemp commands to mktemp tmp.XXXXX, and configure now looks better:

jay@jays-mba:~/repos/proxychains-ng$ ./configure
checking whether netinet/in.h defines s6_addr16 ... no
checking whether netinet/in.h defines __u6_addr.__u6_addr16 ... yes
checking whether $CC defines __OpenBSD__ ... no
Done, now run make && make install

But make is still upset about s6_addr32 and s6_addr16:

jay@jays-mba:~/repos/proxychains-ng$ make
cc -Qunused-arguments -DSUPER_SECURE -Qunused-arguments -Wall -O0 -g -std=c99 -D_GNU_SOURCE -pipe -Qunused-arguments -DIS_MAC=1 -DLIB_DIR=\"/usr/local/lib\" -DSYSCONFDIR=\"/usr/local/etc\" -DDLL_NAME=\"libproxychains4.dylib\"  -fPIC -c -o src/nameinfo.o src/nameinfo.c
printf '#define VERSION "%s"\n' "$(sh tools/version.sh)" > src/version.h
cc -Qunused-arguments -DSUPER_SECURE -Qunused-arguments -Wall -O0 -g -std=c99 -D_GNU_SOURCE -pipe -Qunused-arguments -DIS_MAC=1 -DLIB_DIR=\"/usr/local/lib\" -DSYSCONFDIR=\"/usr/local/etc\" -DDLL_NAME=\"libproxychains4.dylib\"  -fPIC -c -o src/version.o src/version.c
cc -Qunused-arguments -DSUPER_SECURE -Qunused-arguments -Wall -O0 -g -std=c99 -D_GNU_SOURCE -pipe -Qunused-arguments -DIS_MAC=1 -DLIB_DIR=\"/usr/local/lib\" -DSYSCONFDIR=\"/usr/local/etc\" -DDLL_NAME=\"libproxychains4.dylib\"  -fPIC -c -o src/core.o src/core.c
cc -Qunused-arguments -DSUPER_SECURE -Qunused-arguments -Wall -O0 -g -std=c99 -D_GNU_SOURCE -pipe -Qunused-arguments -DIS_MAC=1 -DLIB_DIR=\"/usr/local/lib\" -DSYSCONFDIR=\"/usr/local/etc\" -DDLL_NAME=\"libproxychains4.dylib\"  -fPIC -c -o src/common.o src/common.c
cc -Qunused-arguments -DSUPER_SECURE -Qunused-arguments -Wall -O0 -g -std=c99 -D_GNU_SOURCE -pipe -Qunused-arguments -DIS_MAC=1 -DLIB_DIR=\"/usr/local/lib\" -DSYSCONFDIR=\"/usr/local/etc\" -DDLL_NAME=\"libproxychains4.dylib\"  -fPIC -c -o src/libproxychains.o src/libproxychains.c
src/libproxychains.c:332:12: error: no member named 's6_addr32' in 'struct in6_addr'
        return a->s6_addr32[0] == 0 && a->s6_addr32[1] == 0 &&
               ~  ^
src/libproxychains.c:332:36: error: no member named 's6_addr32' in 'struct in6_addr'
        return a->s6_addr32[0] == 0 && a->s6_addr32[1] == 0 &&
                                       ~  ^
src/libproxychains.c:333:12: error: no member named 's6_addr16' in 'struct in6_addr'
               a->s6_addr16[4] == 0 && a->s6_addr16[5] == 0xffff;
               ~  ^
src/libproxychains.c:333:36: error: no member named 's6_addr16' in 'struct in6_addr'
               a->s6_addr16[4] == 0 && a->s6_addr16[5] == 0xffff;
                                       ~  ^
src/libproxychains.c:363:39: error: no member named 's6_addr32' in 'struct in6_addr'
                memcpy(&v4inv6.s_addr, &p_addr_in6->s6_addr32[3], 4);
                                        ~~~~~~~~~~  ^
/usr/include/secure/_string.h:65:33: note: expanded from macro 'memcpy'
  __builtin___memcpy_chk (dest, src, len, __darwin_obsz0 (dest))
                                ^
src/libproxychains.c:458:63: error: no member named 's6_addr32' in 'struct in6_addr'
                                        memcpy(v4inv6buf, &((struct sockaddr_in6*)sa)->sin6_addr.s6_addr32[3], 4);
                                                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
/usr/include/secure/_string.h:65:33: note: expanded from macro 'memcpy'
  __builtin___memcpy_chk (dest, src, len, __darwin_obsz0 (dest))
                                ^
6 errors generated.
make: *** [src/libproxychains.o] Error 1

@jaytaylor
Copy link
Contributor Author

What does it try to do when s6_addr16 is not defined by netinet/in.h?

@jaytaylor
Copy link
Contributor Author

jaytaylor commented Oct 8, 2016

Because what I see is:

check_compile 'whether netinet/in.h defines s6_addr16' "" \
'#include <netinet/in.h>\nint main(int a, char**c){struct in6_addr x={.s6_addr32[0]=a};return x.s6_addr16[0]; }' \
|| {
check_compile 'whether netinet/in.h defines __u6_addr.__u6_addr16' \
'-Ds6_addr16=__u6_addr.__u6_addr16 -Ds6_addr32=__u6_addr.__u6_addr32' \
'#include <netinet/in.h>\nint main(int a, char**c){struct in6_addr x={.s6_addr32[0]=a};return x.s6_addr16[0]; }'
}

Which, if I understand correctly, doesn't do anything other than print a message about it?

@rofl0r
Copy link
Owner

rofl0r commented Oct 8, 2016

it should add '-Ds6_addr16=__u6_addr.__u6_addr16 -Ds6_addr32=__u6_addr.__u6_addr32' to your CFLAGS in config.mak
can you paste your config.mak ?

rofl0r added a commit that referenced this pull request Oct 8, 2016
apparently mktemp on OSX 10.9.5 requires a parameter.
instead of playing whack-a-mole with apple we now use the portable
code from musl's configure script which should work everywhere.

adresses #142
@jaytaylor
Copy link
Contributor Author

jay@jays-mba:~/repos/proxychains-ng$ cat config.mak
CC?=cc
CPPFLAGS?=-Qunused-arguments -Ds6_addr16=__u6_addr.__u6_addr16 -Ds6_addr32=__u6_addr.__u6_addr32
USER_CFLAGS?=-Qunused-arguments
prefix=/usr/local
exec_prefix=/usr/local
bindir=/usr/local/bin
libdir=/usr/local/lib
includedir=/usr/local/include
sysconfdir=/usr/local/etc
CPPFLAGS+= -DSUPER_SECURE
NO_AS_NEEDED=
LDSO_SUFFIX=dylib
MAC_CFLAGS+=-DIS_MAC=1
LD_SET_SONAME=-Wl,-install_name,

@jaytaylor
Copy link
Contributor Author

jay@jays-mba:~/repos/proxychains-ng$ make
printf '#define VERSION "%s"\n' "$(sh tools/version.sh)" > src/version.h
cc -Qunused-arguments -DSUPER_SECURE -Qunused-arguments -Wall -O0 -g -std=c99 -D_GNU_SOURCE -pipe -Qunused-arguments -DIS_MAC=1 -DLIB_DIR=\"/usr/local/lib\" -DSYSCONFDIR=\"/usr/local/etc\" -DDLL_NAME=\"libproxychains4.dylib\"  -fPIC -c -o src/version.o src/version.c
cc -Qunused-arguments -DSUPER_SECURE -Qunused-arguments -Wall -O0 -g -std=c99 -D_GNU_SOURCE -pipe -Qunused-arguments -DIS_MAC=1 -DLIB_DIR=\"/usr/local/lib\" -DSYSCONFDIR=\"/usr/local/etc\" -DDLL_NAME=\"libproxychains4.dylib\"  -fPIC -c -o src/libproxychains.o src/libproxychains.c
src/libproxychains.c:332:12: error: no member named 's6_addr32' in 'struct in6_addr'
        return a->s6_addr32[0] == 0 && a->s6_addr32[1] == 0 &&
               ~  ^
src/libproxychains.c:332:36: error: no member named 's6_addr32' in 'struct in6_addr'
        return a->s6_addr32[0] == 0 && a->s6_addr32[1] == 0 &&
                                       ~  ^
src/libproxychains.c:333:12: error: no member named 's6_addr16' in 'struct in6_addr'
               a->s6_addr16[4] == 0 && a->s6_addr16[5] == 0xffff;
               ~  ^
src/libproxychains.c:333:36: error: no member named 's6_addr16' in 'struct in6_addr'
               a->s6_addr16[4] == 0 && a->s6_addr16[5] == 0xffff;
                                       ~  ^
src/libproxychains.c:363:39: error: no member named 's6_addr32' in 'struct in6_addr'
                memcpy(&v4inv6.s_addr, &p_addr_in6->s6_addr32[3], 4);
                                        ~~~~~~~~~~  ^
/usr/include/secure/_string.h:65:33: note: expanded from macro 'memcpy'
  __builtin___memcpy_chk (dest, src, len, __darwin_obsz0 (dest))
                                ^
src/libproxychains.c:458:63: error: no member named 's6_addr32' in 'struct in6_addr'
                                        memcpy(v4inv6buf, &((struct sockaddr_in6*)sa)->sin6_addr.s6_addr32[3], 4);
                                                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
/usr/include/secure/_string.h:65:33: note: expanded from macro 'memcpy'
  __builtin___memcpy_chk (dest, src, len, __darwin_obsz0 (dest))
                                ^
6 errors generated.
make: *** [src/libproxychains.o] Error 1

@jaytaylor
Copy link
Contributor Author

jaytaylor commented Oct 9, 2016

The fix

TL;DR

A straightforward way to fix the compilation issue is to change ?= to += when generating the 1st $(CPPFLAGS) statement of config.mak.

I'll adjust the PR to do the following:

  • Adjust the Set If Absent assignment for $(CPPFLAGS) to use the Append operator instead.
  • Include a compatibility fix for the invalid mktemp command invocation.

no longer needed since 260578d.

  • Ensure config.mak is removed during the make clean step.

Background

I think I just figured it out!

From the output of make the runtime contents of $(CPPFLAGS) are revealed:

cc -Qunused-arguments -DSUPER_SECURE -Qunused-arguments \
    -Wall -O0 -g -std=c99 -D_GNU_SOURCE -pipe -Qunused-arguments \
    -DIS_MAC=1 -DLIB_DIR=\"/usr/local/lib\" \
    -DSYSCONFDIR=\"/usr/local/etc\" -DDLL_NAME=\"libproxychains4.dylib\" \
    -fPIC -c -o src/version.o src/version.c

$(CPPFLAGS) contains only -DSUPER_SECURE and nothing like -Ds6_addr.... Let's look and see what's happened from -include config.mak:

CPPFLAGS?=-Qunused-arguments -Ds6_addr16=__u6_addr.__u6_addr16 -Ds6_addr32=__u6_addr.__u6_addr32
...
CPPFLAGS+= -DSUPER_SECURE

From Makefile variable assignment:

Set If Absent

VARIABLE ?= value

Setting of a variable only if it doesn't have a value

The output observed suggests the order of evaluation when config.mak is included is not from the beginning of the file to the end (otherwise the $(CPPFLAGS) variable would contain what we expect and the thing would compile!).

Apparent order of evaluation:

1st statement: CPPFLAGS+= -DSUPER_SECURE
$(CPPFLAGS) contents: -DSUPER_SECURE

2nd evaluated statement: CPPFLAGS?=-Qunused-arguments -Ds6_addr16=__u6_addr.__u6_addr16 -Ds6_addr32=__u6_addr.__u6_addr32
$(CPPFLAGS) contents: -DSUPER_SECURE

The ?= statement has no effect since the variable has already been set.

@jaytaylor jaytaylor force-pushed the jay/fix-mac-osx-10-9-5-build branch 2 times, most recently from 9ddca69 to a7d7be1 Compare October 9, 2016 17:06
@jaytaylor
Copy link
Contributor Author

@rofl0r Thank you so much for being so responsive on this issue! I believe this PR is in good shape, looking forward to your feedback.

I've tested it on the Mac and Linux and now both build and work without issue. :)

Cheers!

@rofl0r
Copy link
Owner

rofl0r commented Oct 9, 2016

just to make sure: did you have exported CPPFLAGS on your system ?
you can run echo $CPPFLAGS in your shell to find out.

@jaytaylor
Copy link
Contributor Author

@rofl0r Nice catch! I'd forgotten about this stanza in my .bashrc:

# <C++>
# These exports are to avoid clang compilation problems as per
# http://stackoverflow.com/questions/22313407/clang-error-unknown-argument-mno-fused-madd-python-package-installation
export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments
# </C++>

I still believe it'd be best to switch to appending to CPPFLAGS, unless there is something else I've overlooked.

@rofl0r
Copy link
Owner

rofl0r commented Oct 10, 2016

so yeah, in that case the problem was because your CPPFLAGS were overriding the ones set by the build system. this is intentional because we want to mimick autoconf behaviour as nearly as possible. in this case though the s6_addr32 macro is essential to compilation so it doesn't make sense to make it overridable. i'll think about it some more to find a clean fix. I disagree with the removal of config.mak: it is against the users expectation (at least if he's used to autoconf) that make clean will remove his configuration and he will have to re-run configure!

@rofl0r
Copy link
Owner

rofl0r commented Oct 16, 2016

hello @jaytaylor , could you test my commit in the branch OUR_CPPFLAGS and report if that closes this issue ? thanks!

@jaytaylor
Copy link
Contributor Author

Hey @rofl0r,

The OUR_CPPFLAGS branch works nicely for me! I also like this solution, it is a nice, clean approach to avoid the $CPPFLAGS variable conflict entirely.

Cheers,
Jay

jaytaylor and others added 3 commits October 16, 2016 10:33
On Mac OS X, random chain was broken and returned always the last proxy from the
config file.  Use fix as suggested by @ravomavain.

Closes rofl0r#75.
we temporarily store all buildsystem-set conditionals into
OUR_CPPFLAGS and write it into config.mak as an addition to eventually
user-supplied CPPFLAGS. this should prevent crucial things we set from
being overwritten by a user that has CPPFLAGS exported.

fixes rofl0r#142
@jaytaylor jaytaylor force-pushed the jay/fix-mac-osx-10-9-5-build branch from a7d7be1 to dcbfe60 Compare October 16, 2016 17:33
@jaytaylor
Copy link
Contributor Author

@rofl0r FYI, I believe I've removed all controversial commits so you can merge this PR.

@jaytaylor jaytaylor force-pushed the jay/fix-mac-osx-10-9-5-build branch from 864b7a3 to 7c0778e Compare October 16, 2016 17:36
@rofl0r rofl0r closed this in c883cd4 Oct 16, 2016
@rofl0r
Copy link
Owner

rofl0r commented Oct 16, 2016

@jaytaylor thanks for testing!
as for merging this PR: aren't we done yet ? or have i overlooked something essential apart from your personal vim config ?

@jaytaylor
Copy link
Contributor Author

Haha, nothing essential. Just my (fairly standard I think) vim ignores and the dylib ignore.

On Oct 16, 2016, at 12:09 PM, rofl0r notifications@github.com wrote:

@jaytaylor thanks for testing!
as for merging this PR: aren't we done yet ? or have i overlooked something essential apart from your personal vim config ?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

@rofl0r
Copy link
Owner

rofl0r commented Oct 16, 2016

well if you care enough, please make another clean PR on top of current master, so we can keep the commit history straight.
cheers!

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

Successfully merging this pull request may close these issues.

2 participants