Makefile.in
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sat Apr 26 21:31:05 2008 +0000 (2008-04-26)
changeset 454 372b2f397baa
parent 425 548b7aa23385
child 470 341c43d832f1
permissions -rw-r--r--
Configure tsocks with a simple heuristic.

Consider the proxy has to be in a 'local' network. It means it is directly
reachable by the local machine, even if the local machine has to hop through
one or more gates to reach the proxy (often the case in enterprise networks
where class A 10.0.0.0/8 is in fact sub-divided into smaller networks, each
one of them in a different location, eg. 10.1.0.0/16 in a place, while
10.2.0.0/16 would be on the other side of the world). Not being in the same
subnet does not mean the proxy is not available.

So we will build a mask with at most high bits set, which defines a network
that has both the local machine and the proxy. Because a machine may have
more than one interface, build a mask for each of them, removing 127.0.0.1
which is added automagically by tsocks, and removing duplicate masks.

If all of this does not work, then it means the local machine can NOT in fact
reach the proxy, which in turn means the user mis-configured something (most
probably a typo...).

/trunk/scripts/crosstool.sh | 61 52 9 0 +++++++++++++++++++++++++++++++++++++++++++--------
1 file changed, 52 insertions(+), 9 deletions(-)
     1 # Makefile.in for building crosstool-NG
     2 # This file serves as source for the ./configure operation
     3 
     4 all: Makefile build
     5 
     6 # Check if Makefile is up to date:
     7 Makefile: Makefile.in
     8 	@echo "$< did changed: you must re-run './configure'"
     9 	@false
    10 
    11 ###############################################################################
    12 # Configuration variables
    13 
    14 VERSION:= @@VERSION@@
    15 BINDIR := @@BINDIR@@
    16 LIBDIR := @@LIBDIR@@
    17 DOCDIR := @@DOCDIR@@
    18 MANDIR := @@MANDIR@@
    19 DATE   := @@DATE@@
    20 LOCAL  := @@LOCAL@@
    21 MAKE   := $(shell which $(MAKE) || type -p $(MAKE) || echo /usr/bin/make)
    22 
    23 ###############################################################################
    24 # Global make rules
    25 
    26 build: build-bin build-lib build-man
    27 
    28 install: install-local-test build install-bin install-lib install-doc install-man
    29 
    30 clean: clean-bin clean-lib clean-doc
    31 
    32 distclean: clean
    33 	@echo "  RM     Makefile"
    34 	@rm -f Makefile
    35 
    36 uninstall: install-local-test uninstall-bin uninstall-lib uninstall-doc uninstall-man
    37 
    38 ###############################################################################
    39 # Specific make rules
    40 
    41 #--------------------------------------
    42 # Build rules
    43 
    44 build-bin: ct-ng
    45 	@echo "  CHMOD  $<"
    46 	@chmod a+x $<
    47 
    48 build-lib:
    49 
    50 build-man: docs/ct-ng.1.gz
    51 
    52 docs/ct-ng.1.gz: docs/ct-ng.1
    53 	@echo "  GZIP   $@"
    54 	@gzip -c9 $< >$@
    55 
    56 %: %.in
    57 	@echo "  SED    $@"
    58 	@sed -r -e 's,@@CT_MAKE@@,$(MAKE),g;'       \
    59 	        -e 's,@@CT_BINDIR@@,$(BINDIR),g;'   \
    60 	        -e 's,@@CT_LIBDIR@@,$(LIBDIR),g;'   \
    61 	        -e 's,@@CT_DOCDIR@@,$(DOCDIR),g;'   \
    62 	        -e 's,@@CT_MANDIR@@,$(MANDIR),g;'   \
    63 	        -e 's,@@CT_VERSION@@,$(VERSION),g;'	\
    64 	        -e 's,@@CT_DATE@@,$(DATE),g;'       \
    65 	     $@.in >$@
    66 
    67 #--------------------------------------
    68 # Clean rules
    69 
    70 clean-bin:
    71 	@echo "  RM     ct-ng"
    72 	@rm -f ct-ng
    73 
    74 clean-lib:
    75 
    76 clean-doc:
    77 	@echo "  RM     docs/ct-ng.1"
    78 	@rm -f docs/ct-ng.1
    79 	@echo "  RM     docs/ct-ng.1.gz"
    80 	@rm -f docs/ct-ng.1.gz
    81 
    82 #--------------------------------------
    83 # Install rules
    84 
    85 # If using locally, don't install
    86 install-local-test:
    87 	@if [ "$(LOCAL)" = "1" ]; then                                          \
    88 	     echo "You're using local copy as runtime. You can't (un)install."; \
    89 	     false;                                                             \
    90 	 fi
    91 
    92 install-bin: install-local-test $(BINDIR)
    93 	@echo "  INST   ct-ng"
    94 	@install -m 755 ct-ng $(BINDIR)/ct-ng
    95 
    96 install-lib: install-local-test $(LIBDIR) install-lib-main install-lib-samples
    97 
    98 install-lib-main: install-local-test $(LIBDIR)
    99 	@for src_dir in arch config kconfig patches scripts tools; do            \
   100 	     echo "  INST   $${src_dir}/";                                  \
   101 	     tar cf - --exclude=.svn $${src_dir} |(cd $(LIBDIR); tar xf -); \
   102 	 done
   103 	@rm -f $(LIBDIR)/tools/addToolVersion.sh
   104 	@echo "  INST   steps.mk"
   105 	@install -m 644 steps.mk $(LIBDIR)/steps.mk
   106 	@echo "  INST   .version"
   107 	@echo "$(VERSION)" >$(LIBDIR)/.version
   108 
   109 # Samples need a little love:
   110 #  - change every occurrence of CT_TOP_DIR to CT_LIB_DIR
   111 install-lib-samples: install-local-test $(LIBDIR) install-lib-main
   112 	@echo "  INST   samples/"
   113 	@tar cf - --exclude=.svn samples |(cd $(LIBDIR); tar xf -)
   114 	@for samp_file in $(LIBDIR)/samples/*/crosstool.config; do                  \
   115 	     sed -r -i -e 's,\$$\{CT_TOP_DIR\},\$$\{CT_LIB_DIR\},g;' $${samp_file}; \
   116 	 done
   117 
   118 install-doc: install-local-test $(DOCDIR)
   119 	@for doc_file in docs/CREDITS docs/overview.txt; do	\
   120 	     echo "  INST   $${doc_file}";              	\
   121 	     install -m 644 "$${doc_file}" $(DOCDIR);   	\
   122 	 done
   123 
   124 install-man: install-local-test $(MANDIR)
   125 	@echo "  INST   ct-ng.1.gz"
   126 	@install -m 644 docs/ct-ng.1.gz $(MANDIR)
   127 
   128 $(BINDIR) $(LIBDIR) $(DOCDIR) $(MANDIR)::
   129 	@echo "  MKDIR  $@"
   130 	@install -m 755 -d $@
   131 
   132 
   133 #--------------------------------------
   134 # Uninstall rules
   135 
   136 uninstall-bin: install-local-test
   137 	@rm -f $(BINDIR)/ct-ng
   138 
   139 uninstall-lib: install-local-test
   140 	@rm -rf $(LIBDIR)
   141 
   142 uninstall-doc: install-local-test
   143 	@rm -rf $(DOCDIR)
   144 
   145 uninstall-man: install-local-test
   146 	@rm -f $(MANDIR)/ct-ng.1{,.gz}