tunblick/third_party/Makefile

Mon, 18 Jan 2010 20:35:01 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Mon, 18 Jan 2010 20:35:01 +0100
changeset 14
3c358e0243d6
parent 1
1a5334dfb21d
permissions
-rw-r--r--

Suggest possible test of new ISN logic in routing script and from UA.

     1 # This Makefile builds all the third_party code
     2 # It shouldn't be called by anything other than automated scripts
     4 # Both lzo and openvpn should be built universally
     5 # MSvB: ...using four architectures i386, x86_64, ppc, and ppc64
     7 HOSTARCH=x86_64
     8 LZO_DIR=lzo-2.03
     9 PKCS11_DIR=pkcs11-helper-1.07
    11 all: tuntap openvpn
    13 pkcs11-helper:
    14 	echo Configure PKCS11-Helper 32/64 bit universal library
    15 	cd $(PKCS11_DIR) && OPENSSL_CFLAGS="-I/usr/include" OPENSSL_LIBS="-L/usr/lib -lssl -lcrypto" CFLAGS="-isysroot /Developer/SDKs/MacOSX10.5.sdk -Os -mmacosx-version-min=10.5 -arch ppc -arch ppc64 -arch i386 -arch x86_64" ./configure --enable-static --disable-dependency-tracking --prefix=$$(pwd)/staging/ --includedir=$$(pwd)/staging/include/
    16 	echo Build PKCS11-Helper 32/64 bit universal binary
    17 	$(MAKE) -C $(PKCS11_DIR)
    18 	echo Install to third_party/$(PKCS11_DIR)/staging
    19 	$(MAKE) -C $(PKCS11_DIR) install
    21 lzo:
    22 	@for a in ppc ppc64 i386 x86_64; do \
    23 		echo Configure LZO for $$a; \
    24 		cd $(LZO_DIR); \
    25 		echo Forcefully be clean; \
    26 		$(MAKE) clean; \
    27 		CFLAGS="-isysroot /Developer/SDKs/MacOSX10.5.sdk -Os -mmacosx-version-min=10.5 -arch $$a" ./configure --host=$(HOSTARCH) --build=$$a --disable-dependency-tracking --disable-asm --prefix=$$(pwd)/staging_$$a/ --includedir=$$(pwd)/staging/include/; \
    28 		echo Build LZO; \
    29 		$(MAKE); \
    30 		echo Install to third_party/$(LZO_DIR)/staging_$$a; \
    31 		$(MAKE) install; \
    32 		cd ..; \
    33 	done
    35 	# Use lipo to create a universal library
    36 	mkdir -p $(LZO_DIR)/staging/lib
    37 	lipo $(LZO_DIR)/staging_*/lib/liblzo2.a -create -output $(LZO_DIR)/staging/lib/liblzo2.a
    38 	cp  $(LZO_DIR)/staging_i386/lib/liblzo2.la  $(LZO_DIR)/staging/lib/ 
    40 	# wtf? library was renamed??? move it back so openvpn will build correctly
    41 	cd $(LZO_DIR)/staging/lib; mv liblzo2.a liblzo.a; mv liblzo2.la liblzo.la
    43 lzo-clean:
    44 	$(MAKE) -C $(LZO_DIR) clean
    45 	rm -rf $(LZO_DIR)/staging*
    47 openvpn: lzo pkcs11-helper
    48 	echo Configure OpenVPN 32/64 bit universal binary
    49 	cd openvpn && autoreconf -i -v
    50 	cd openvpn && LDFLAGS="-L../$(PKCS11_DIR)/staging/lib/" CFLAGS="-isysroot /Developer/SDKs/MacOSX10.5.sdk -Os -mmacosx-version-min=10.5 -arch ppc -arch ppc64 -arch i386 -arch x86_64" ./configure --with-lzo-headers=../$(LZO_DIR)/staging/include/ --with-lzo-lib=../$(LZO_DIR)/staging/lib/ --with-pkcs11-helper-headers=../$(PKCS11_DIR)/staging/include/ --with-pkcs11-helper-libs=../$(PKCS11_DIR)/staging/lib/ --disable-dependency-tracking
    51 	echo Build OpenVPN 32/64 bit universal binary
    52 	$(MAKE) -C openvpn
    54 openvpn-clean:
    55 	$(MAKE) -C openvpn clean
    57 .PHONY : tuntap
    59 tuntap: 
    60 	# Now we'll build the tun/tap driver
    61 #	# MSvB: Patch buildconf for building 64-bit (broken as of 20090728)
    62 #	sed -i .orig \
    63 #	    -e 's;-arch ppc;-arch ppc -arch ppc64;g' \
    64 #	    -e 's;-arch i386;-arch i386 -arch x86_64;g' \
    65 #	    tuntap/src/tap/Makefile tuntap/src/tun/Makefile
    66 	# MSvB: Patch buildconf for building with up to date APIs
    67 	sed -i .orig \
    68 	    -e 's;MacOSX10.4u.sdk;MacOSX10.5.sdk;g' \
    69 	    tuntap/src/tap/Makefile tuntap/src/tun/Makefile
    70 	$(MAKE) -C tuntap
    72 tuntap-clean:
    73 	$(MAKE) -C tuntap clean
    75 clean: lzo-clean tuntap-clean openvpn-clean

mercurial