]> git.proxmox.com Git - mirror_edk2.git/commitdiff
UnixPkg: Fix build for Linux
authorjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>
Sat, 5 Mar 2011 08:08:47 +0000 (08:08 +0000)
committerjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>
Sat, 5 Mar 2011 08:08:47 +0000 (08:08 +0000)
UnixPkg/UnixSnpDxe is currently BSD/OS X specific.
Therefore we only build it if "-D NETWORK_SUPPORT"
is used on the build command line.

UnixPkg/build.sh and UnixPkg/build64.sh are updated to
automatically define NETWORK_SUPPORT if building on OS X.

<net/if_dl.h> and <net/bpf.h> are also only included in
UnixPkg/Include/Common/UnixInclude.h if __APPLE__ is defined.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11346 6f19259b-4bc3-4df7-8a09-765794883524

UnixPkg/Include/Common/UnixInclude.h
UnixPkg/Sec/X64/MangleGasket.S
UnixPkg/UnixPkg.dsc
UnixPkg/UnixPkg.fdf
UnixPkg/UnixPkgX64.dsc
UnixPkg/UnixPkgX64.fdf
UnixPkg/build.sh
UnixPkg/build64.sh

index e37fc4265a39e6a4232b83291278325342ea480a..3dbe09d8a2ca59871b2b4a6faf2d6eb982dbc682 100644 (file)
@@ -62,11 +62,11 @@ Abstract:
 #include <netdb.h>\r
 #include <netinet/in.h>\r
 #include <net/if.h>\r
-#include <net/if_dl.h>\r
 #include <ifaddrs.h>\r
-#include <net/bpf.h>\r
 \r
 #ifdef __APPLE__\r
+#include <net/if_dl.h>\r
+#include <net/bpf.h>\r
 #include <sys/param.h>\r
 #include <sys/mount.h>\r
 #define _XOPEN_SOURCE\r
index d457f6be128561ef0b83fdc9136ac39408051b2d..ea1e6aa2ebc845269fc2c096ea1e2df9915f1907 100644 (file)
@@ -889,9 +889,8 @@ ASM_PFX(Gasketgetifaddrs):
   ret
 
 
-
-ASM_GLOBAL _Gasketfreeifaddrs
-_Gasketfreeifaddrs:
+ASM_GLOBAL ASM_PFX(Gasketfreeifaddrs)
+ASM_PFX(Gasketfreeifaddrs):
   pushq   %rbp            // stack frame is for the debugger
   movq    %rsp, %rbp
 
@@ -900,7 +899,7 @@ _Gasketfreeifaddrs:
 
   movq    %rcx, %rdi    // Swizzle args 
 
-  call    _freeifaddrs
+  call    ASM_PFX(freeifaddrs)
   
 
   popq    %rdi          // restore state
@@ -909,9 +908,6 @@ _Gasketfreeifaddrs:
   ret
 
 
-
-
-
 ASM_GLOBAL ASM_PFX(GasketUgaClose)
 ASM_PFX(GasketUgaClose):
   pushq   %rbp            // stack frame is for the debugger
index 76e0e9898a3d759bf21d2fd10cfdfb807361a209..c9fd223e35e114405c88e969688ff2a6990b5f7a 100644 (file)
   #\r
   # Network stack drivers\r
   #\r
+!if $(NETWORK_SUPPORT)\r
   UnixPkg/UnixSnpDxe/UnixSnpDxe.inf\r
+!endif\r
   MdeModulePkg/Universal/Network/DpcDxe/DpcDxe.inf\r
   MdeModulePkg/Universal/Network/ArpDxe/ArpDxe.inf\r
   MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Dxe.inf\r
index 95485414425ed96b895e87acd8b73d66b0f369c4..2a6ee25f6ce473144e8b88c1e54af625d13ce573 100644 (file)
@@ -232,6 +232,9 @@ INF  MdeModulePkg/Application/HelloWorld/HelloWorld.inf
 #\r
 # Network stack drivers\r
 #\r
+!if $(NETWORK_SUPPORT)\r
+INF  UnixPkg/UnixSnpDxe/UnixSnpDxe.inf\r
+!endif\r
 INF  MdeModulePkg/Universal/Network/DpcDxe/DpcDxe.inf\r
 INF  MdeModulePkg/Universal/Network/ArpDxe/ArpDxe.inf\r
 INF  MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Dxe.inf\r
@@ -242,7 +245,6 @@ INF  MdeModulePkg/Universal/Network/VlanConfigDxe/VlanConfigDxe.inf
 INF  MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Dxe.inf\r
 INF  MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dxe.inf\r
 INF  MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Dxe.inf\r
-INF  UnixPkg/UnixSnpDxe/UnixSnpDxe.inf\r
 \r
 #\r
 # Build from source or use checked in binary\r
index 2ff5b9d5344eeef2fbf56cc51c00a418f184fac7..1eae7f9ecba5daa02db0798974615b0cbbf9fdcd 100644 (file)
   #\r
   # Network stack drivers\r
   #\r
+!if $(NETWORK_SUPPORT)\r
   UnixPkg/UnixSnpDxe/UnixSnpDxe.inf\r
+!endif\r
   MdeModulePkg/Universal/Network/DpcDxe/DpcDxe.inf\r
   MdeModulePkg/Universal/Network/ArpDxe/ArpDxe.inf\r
   MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Dxe.inf\r
index 224c5330d9ec1a8063e0dc3182b86e0a8112a3a6..6ac1cdc8a6b41a786b74de11cc1bbe616543836e 100644 (file)
@@ -232,7 +232,9 @@ INF  MdeModulePkg/Application/HelloWorld/HelloWorld.inf
 #\r
 # Network stack drivers\r
 #\r
+!if $(NETWORK_SUPPORT)\r
 INF  UnixPkg/UnixSnpDxe/UnixSnpDxe.inf\r
+!endif\r
 INF  MdeModulePkg/Universal/Network/DpcDxe/DpcDxe.inf\r
 INF  MdeModulePkg/Universal/Network/ArpDxe/ArpDxe.inf\r
 INF  MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Dxe.inf\r
index a77a5973a06cc4849aad654df8acbeaf8a5cb82f..2498914e1c8b9d3af9e5ba3d0e0c20896d637524 100755 (executable)
@@ -41,6 +41,7 @@ fi
 # Pick a default tool type for a given OS
 #
 TARGET_TOOLS=MYTOOLS
+NETWORK_SUPPORT=
 case `uname` in
   CYGWIN*) echo Cygwin not fully supported yet. ;;
   Darwin*)
@@ -52,6 +53,7 @@ case `uname` in
       else
         TARGET_TOOLS=XCODE32
       fi
+      NETWORK_SUPPORT="-D NETWORK_SUPPORT"
       ;;
   Linux*) TARGET_TOOLS=ELFGCC ;;
 
@@ -115,6 +117,6 @@ done
 #
 echo $PATH
 echo `which build`
-build -p $WORKSPACE/UnixPkg/UnixPkg.dsc         -a IA32 -t $TARGET_TOOLS -n 3 $1 $2 $3 $4 $5 $6 $7 $8
+build -p $WORKSPACE/UnixPkg/UnixPkg.dsc         -a IA32 -t $TARGET_TOOLS $NETWORK_SUPPORT -n 3 $1 $2 $3 $4 $5 $6 $7 $8
 exit $?
 
index 24a7fe2a6e586c093afd11385ef709079bbf731b..22e9c08ead291f737890b52230b3b089173ec284 100755 (executable)
@@ -42,6 +42,7 @@ fi
 #
 TARGET_TOOLS=MYTOOLS
 UNIXPKG_TOOLS=GCC44
+NETWORK_SUPPORT=
 case `uname` in
   CYGWIN*) echo Cygwin not fully supported yet. ;;
   Darwin*)
@@ -54,6 +55,7 @@ case `uname` in
         TARGET_TOOLS=XCODE32
         UNIXPKG_TOOLS=UNIXPKG
       fi
+      NETWORK_SUPPORT="-D NETWORK_SUPPORT"
       ;;
   Linux*) TARGET_TOOLS=ELFGCC ;;
 
@@ -120,7 +122,7 @@ done
 echo $PATH
 echo `which build`
 build -p $WORKSPACE/UnixPkg/UnixPkgX64.dsc      -a X64 -t $TARGET_TOOLS -D SEC_ONLY -n 3 $1 $2 $3 $4 $5 $6 $7 $8  modules
-build -p $WORKSPACE/UnixPkg/UnixPkgX64.dsc      -a X64 -t $UNIXPKG_TOOLS -n 3 $1 $2 $3 $4 $5 $6 $7 $8
+build -p $WORKSPACE/UnixPkg/UnixPkgX64.dsc      -a X64 -t $UNIXPKG_TOOLS $NETWORK_SUPPORT -n 3 $1 $2 $3 $4 $5 $6 $7 $8
 cp $WORKSPACE/Build/UnixX64/DEBUG_"$TARGET_TOOLS"/X64/SecMain $WORKSPACE/Build/UnixX64/DEBUG_"$UNIXPKG_TOOLS"/X64
 exit $?