mirror of
https://github.com/rofl0r/proxychains-ng.git
synced 2024-12-22 12:18:47 +00:00
complete mac support
This commit is contained in:
parent
6d25f5d89e
commit
c36db11ebc
12
Makefile
12
Makefile
@ -24,6 +24,8 @@ AR = $(CROSS_COMPILE)ar
|
|||||||
RANLIB = $(CROSS_COMPILE)ranlib
|
RANLIB = $(CROSS_COMPILE)ranlib
|
||||||
|
|
||||||
LDSO_SUFFIX = so
|
LDSO_SUFFIX = so
|
||||||
|
LD_SET_SONAME = -Wl,-soname=
|
||||||
|
INSTALL_FLAGS = -D -m
|
||||||
|
|
||||||
-include config.mak
|
-include config.mak
|
||||||
|
|
||||||
@ -35,7 +37,7 @@ PXCHAINS = proxychains4
|
|||||||
ALL_TOOLS = $(PXCHAINS)
|
ALL_TOOLS = $(PXCHAINS)
|
||||||
|
|
||||||
|
|
||||||
CFLAGS+=$(USER_CFLAGS)
|
CFLAGS+=$(USER_CFLAGS) $(MAC_CFLAGS)
|
||||||
CFLAGS_MAIN=-DLIB_DIR=\"$(libdir)\" -DINSTALL_PREFIX=\"$(prefix)\" -DDLL_NAME=\"$(LDSO_PATHNAME)\"
|
CFLAGS_MAIN=-DLIB_DIR=\"$(libdir)\" -DINSTALL_PREFIX=\"$(prefix)\" -DDLL_NAME=\"$(LDSO_PATHNAME)\"
|
||||||
|
|
||||||
|
|
||||||
@ -43,9 +45,9 @@ all: $(ALL_LIBS) $(ALL_TOOLS)
|
|||||||
|
|
||||||
#install: $(ALL_LIBS:lib/%=$(DESTDIR)$(libdir)/%) $(DESTDIR)$(LDSO_PATHNAME)
|
#install: $(ALL_LIBS:lib/%=$(DESTDIR)$(libdir)/%) $(DESTDIR)$(LDSO_PATHNAME)
|
||||||
install:
|
install:
|
||||||
install -D -m 755 $(ALL_TOOLS) $(bindir)/
|
install $(INSTALL_FLAGS) 755 $(ALL_TOOLS) $(bindir)/
|
||||||
install -D -m 644 $(ALL_LIBS) $(libdir)/
|
install $(INSTALL_FLAGS) 644 $(ALL_LIBS) $(libdir)/
|
||||||
install -D -m 644 src/proxychains.conf $(prefix)/etc/
|
install $(INSTALL_FLAGS) 644 src/proxychains.conf $(prefix)/etc/
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f $(ALL_LIBS)
|
rm -f $(ALL_LIBS)
|
||||||
@ -56,7 +58,7 @@ clean:
|
|||||||
$(CC) $(CFLAGS) $(CFLAGS_MAIN) $(INC) $(PIC) -c -o $@ $<
|
$(CC) $(CFLAGS) $(CFLAGS_MAIN) $(INC) $(PIC) -c -o $@ $<
|
||||||
|
|
||||||
$(LDSO_PATHNAME): $(LOBJS)
|
$(LDSO_PATHNAME): $(LOBJS)
|
||||||
$(CC) $(LDFLAGS) -Wl,-soname=$(LDSO_PATHNAME) -o $@ $(LOBJS)
|
$(CC) $(LDFLAGS) $(LD_SET_SONAME)$(LDSO_PATHNAME) -o $@ $(LOBJS)
|
||||||
|
|
||||||
$(ALL_TOOLS): $(OBJS)
|
$(ALL_TOOLS): $(OBJS)
|
||||||
$(CC) src/main.o -o $(PXCHAINS)
|
$(CC) src/main.o -o $(PXCHAINS)
|
||||||
|
3
configure
vendored
3
configure
vendored
@ -60,6 +60,9 @@ echo libdir=$libdir>>config.mak
|
|||||||
echo includedir=$includedir>>config.mak
|
echo includedir=$includedir>>config.mak
|
||||||
if ismac ; then
|
if ismac ; then
|
||||||
echo LDSO_SUFFIX=dylib>>config.mak
|
echo LDSO_SUFFIX=dylib>>config.mak
|
||||||
|
echo MAC_CFLAGS+=-DIS_MAC=1>>config.mak
|
||||||
|
echo LD_SET_SONAME=-Wl,-install_name,>>config.mak
|
||||||
|
echo INSTALL_FLAGS=-m>>config.mak
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo done, now run make \&\& make install
|
echo done, now run make \&\& make install
|
||||||
|
@ -167,9 +167,14 @@ int main(int argc, char *argv[]) {
|
|||||||
if(!quiet)
|
if(!quiet)
|
||||||
fprintf(stderr, LOG_PREFIX "preloading %s/%s\n", prefix, dll_name);
|
fprintf(stderr, LOG_PREFIX "preloading %s/%s\n", prefix, dll_name);
|
||||||
|
|
||||||
|
#ifndef IS_MAC
|
||||||
snprintf(buf, sizeof(buf), "LD_PRELOAD=%s/%s", prefix, dll_name);
|
snprintf(buf, sizeof(buf), "LD_PRELOAD=%s/%s", prefix, dll_name);
|
||||||
|
|
||||||
putenv(buf);
|
putenv(buf);
|
||||||
|
#else
|
||||||
|
snprintf(buf, sizeof(buf), "DYLD_INSERT_LIBRARIES=%s/%s", prefix, dll_name);
|
||||||
|
putenv(buf);
|
||||||
|
putenv("DYLD_FORCE_FLAT_NAMESPACE=1");
|
||||||
|
#endif
|
||||||
execvp(argv[start_argv], &argv[start_argv]);
|
execvp(argv[start_argv], &argv[start_argv]);
|
||||||
perror("proxychains can't load process....");
|
perror("proxychains can't load process....");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user