mirror of
				https://github.com/rofl0r/proxychains-ng.git
				synced 2025-11-04 00:56:03 +00:00 
			
		
		
		
	Add Haiku support (#340)
This commit is contained in:
		
							
								
								
									
										2
									
								
								README
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								README
									
									
									
									
									
								
							@@ -16,7 +16,7 @@ ProxyChains-NG ver 4.14 README
 | 
				
			|||||||
  If your program doesn't work with proxychains, consider using an
 | 
					  If your program doesn't work with proxychains, consider using an
 | 
				
			||||||
  iptables based solution instead; this is much more robust.
 | 
					  iptables based solution instead; this is much more robust.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  Supported Platforms: Linux, BSD, Mac.
 | 
					  Supported Platforms: Linux, BSD, Mac, Haiku.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
*********** ATTENTION ***********
 | 
					*********** ATTENTION ***********
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										8
									
								
								configure
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										8
									
								
								configure
									
									
									
									
										vendored
									
									
								
							@@ -148,6 +148,10 @@ solaris_detected=false
 | 
				
			|||||||
issolaris() {
 | 
					issolaris() {
 | 
				
			||||||
	$solaris_detected
 | 
						$solaris_detected
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					haiku_detected=false
 | 
				
			||||||
 | 
					ishaiku() {
 | 
				
			||||||
 | 
						$haiku_detected	
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
check_compile 'whether we have GNU-style getservbyname_r()' "-DHAVE_GNU_GETSERVBYNAME_R" \
 | 
					check_compile 'whether we have GNU-style getservbyname_r()' "-DHAVE_GNU_GETSERVBYNAME_R" \
 | 
				
			||||||
'#define _GNU_SOURCE\n#include <netdb.h>\nint main() {\nstruct servent *se = 0;struct servent se_buf;char buf[1024];\ngetservbyname_r("foo", (void*) 0, &se_buf, buf, sizeof(buf), &se);\nreturn 0;}'
 | 
					'#define _GNU_SOURCE\n#include <netdb.h>\nint main() {\nstruct servent *se = 0;struct servent se_buf;char buf[1024];\ngetservbyname_r("foo", (void*) 0, &se_buf, buf, sizeof(buf), &se);\nreturn 0;}'
 | 
				
			||||||
@@ -168,6 +172,7 @@ check_compile_run 'whether OpenBSDs fclose() (illegally) calls close()' \
 | 
				
			|||||||
OUR_CPPFLAGS="$OUR_CPPFLAGS -DBROKEN_FCLOSE"
 | 
					OUR_CPPFLAGS="$OUR_CPPFLAGS -DBROKEN_FCLOSE"
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
check_define __sun && check_define __SVR4 && solaris_detected=true
 | 
					check_define __sun && check_define __SVR4 && solaris_detected=true
 | 
				
			||||||
 | 
					check_define __HAIKU__ && haiku_detected=true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
echo "CC=$CC">>config.mak
 | 
					echo "CC=$CC">>config.mak
 | 
				
			||||||
[ -z "$CPPFLAGS" ] || echo "CPPFLAGS=$CPPFLAGS">>config.mak
 | 
					[ -z "$CPPFLAGS" ] || echo "CPPFLAGS=$CPPFLAGS">>config.mak
 | 
				
			||||||
@@ -213,6 +218,9 @@ elif isbsd ; then
 | 
				
			|||||||
elif issolaris; then
 | 
					elif issolaris; then
 | 
				
			||||||
	echo "CFLAGS+=-DIS_SOLARIS -D__EXTENSIONS__" >> config.mak
 | 
						echo "CFLAGS+=-DIS_SOLARIS -D__EXTENSIONS__" >> config.mak
 | 
				
			||||||
	echo "SOCKET_LIBS=-lsocket -lnsl" >> config.mak
 | 
						echo "SOCKET_LIBS=-lsocket -lnsl" >> config.mak
 | 
				
			||||||
 | 
					elif ishaiku ; then
 | 
				
			||||||
 | 
						echo LIBDL=>>config.mak
 | 
				
			||||||
 | 
						echo "CFLAGS+=-DIS_HAIKU" >> config.mak
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
echo "Done, now run $make_cmd && $make_cmd install"
 | 
					echo "Done, now run $make_cmd && $make_cmd install"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -79,6 +79,13 @@ char *get_config_path(char* default_path, char* pbuf, size_t bufsize) {
 | 
				
			|||||||
	if(check_path(path))
 | 
						if(check_path(path))
 | 
				
			||||||
		goto have;
 | 
							goto have;
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
 | 
					    // priority 3b: ~/config/settings/proxychains.conf (for haiku)
 | 
				
			||||||
 | 
						path = getenv("HOME");
 | 
				
			||||||
 | 
						snprintf(pbuf, bufsize, "%s/config/settings/%s", path, PROXYCHAINS_CONF_FILE);
 | 
				
			||||||
 | 
						path = pbuf;
 | 
				
			||||||
 | 
						if(check_path(path))
 | 
				
			||||||
 | 
							goto have;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// priority 4: $SYSCONFDIR/proxychains.conf
 | 
						// priority 4: $SYSCONFDIR/proxychains.conf
 | 
				
			||||||
	path = SYSCONFDIR "/" PROXYCHAINS_CONF_FILE;
 | 
						path = SYSCONFDIR "/" PROXYCHAINS_CONF_FILE;
 | 
				
			||||||
	if(check_path(path))
 | 
						if(check_path(path))
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -38,6 +38,7 @@
 | 
				
			|||||||
#include "core.h"
 | 
					#include "core.h"
 | 
				
			||||||
#include "common.h"
 | 
					#include "common.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#undef 		satosin
 | 
				
			||||||
#define     satosin(x)      ((struct sockaddr_in *) &(x))
 | 
					#define     satosin(x)      ((struct sockaddr_in *) &(x))
 | 
				
			||||||
#define     SOCKADDR(x)     (satosin(x)->sin_addr.s_addr)
 | 
					#define     SOCKADDR(x)     (satosin(x)->sin_addr.s_addr)
 | 
				
			||||||
#define     SOCKADDR_2(x)     (satosin(x)->sin_addr)
 | 
					#define     SOCKADDR_2(x)     (satosin(x)->sin_addr)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user