(svn r12930) -Add: build support for NetBSD and HP-UX. Patch by ahoka.

This commit is contained in:
rubidium 2008-04-30 07:39:46 +00:00
parent c76b2be644
commit 4097d81323
3 changed files with 14 additions and 9 deletions

View File

@ -392,9 +392,9 @@ check_params() {
exit 1 exit 1
fi fi
# OS only allows DETECT, UNIX, OSX, FREEBSD, OPENBSD, MORPHOS, BEOS, SUNOS, CYGWIN, MINGW, OS2, WINCE, and PSP # OS only allows DETECT, UNIX, OSX, FREEBSD, OPENBSD, MORPHOS, BEOS, SUNOS, CYGWIN, MINGW, OS2, WINCE, and PSP
if [ -z "`echo $os | egrep '^(DETECT|UNIX|OSX|FREEBSD|OPENBSD|MORPHOS|BEOS|SUNOS|CYGWIN|MINGW|OS2|WINCE|PSP)$'`" ]; then if [ -z "`echo $os | egrep '^(DETECT|UNIX|OSX|FREEBSD|OPENBSD|NETBSD|HPUX|MORPHOS|BEOS|SUNOS|CYGWIN|MINGW|OS2|WINCE|PSP)$'`" ]; then
echo "configure: error: invalid option --os=$os" echo "configure: error: invalid option --os=$os"
echo " Available options are: --os=[DETECT|UNIX|OSX|FREEBSD|OPENBSD|MORPHOS|BEOS|SUNOS|CYGWIN|MINGW|OS2|WINCE|PSP]" echo " Available options are: --os=[DETECT|UNIX|OSX|FREEBSD|OPENBSD|NETBSD|HPUX|MORPHOS|BEOS|SUNOS|CYGWIN|MINGW|OS2|WINCE|PSP]"
exit 1 exit 1
fi fi
# cpu_type can be either 32 or 64 # cpu_type can be either 32 or 64
@ -1016,7 +1016,7 @@ make_cflags_and_ldflags() {
fi fi
# Most targets act like UNIX, just with some additions # Most targets act like UNIX, just with some additions
if [ "$os" = "BEOS" ] || [ "$os" = "OSX" ] || [ "$os" = "MORPHOS" ] || [ "$os" = "FREEBSD" ] || [ "$os" = "OPENBSD" ] || [ "$os" = "SUNOS" ] || [ "$os" = "OS2" ]; then if [ "$os" = "BEOS" ] || [ "$os" = "OSX" ] || [ "$os" = "MORPHOS" ] || [ "$os" = "FREEBSD" ] || [ "$os" = "OPENBSD" ] || [ "$os" = "NETBSD" ] || [ "$os" = "HPUX" ] || [ "$os" = "SUNOS" ] || [ "$os" = "OS2" ]; then
CFLAGS="$CFLAGS -DUNIX" CFLAGS="$CFLAGS -DUNIX"
fi fi
# And others like Windows # And others like Windows
@ -1524,7 +1524,7 @@ detect_awk() {
detect_os() { detect_os() {
if [ "$os" = "DETECT" ]; then if [ "$os" = "DETECT" ]; then
# Detect UNIX, OSX, FREEBSD, OPENBSD, MORPHOS, BEOS, SUNOS, CYGWIN, MINGW, OS2, WINCE, and PSP # Detect UNIX, OSX, FREEBSD, OPENBSD, NETBSD, HPUX, MORPHOS, BEOS, SUNOS, CYGWIN, MINGW, OS2, WINCE, and PSP
# Try first via dumpmachine, then via uname # Try first via dumpmachine, then via uname
os=`echo "$host" | tr '[A-Z]' '[a-z]' | $awk ' os=`echo "$host" | tr '[A-Z]' '[a-z]' | $awk '
@ -1532,6 +1532,8 @@ detect_os() {
/darwin/ { print "OSX"; exit} /darwin/ { print "OSX"; exit}
/freebsd/ { print "FREEBSD"; exit} /freebsd/ { print "FREEBSD"; exit}
/openbsd/ { print "OPENBSD"; exit} /openbsd/ { print "OPENBSD"; exit}
/netbsd/ { print "NETBSD"; exit}
/hp-ux/ { print "HPUX"; exit}
/morphos/ { print "MORPHOS"; exit} /morphos/ { print "MORPHOS"; exit}
/beos/ { print "BEOS"; exit} /beos/ { print "BEOS"; exit}
/sunos/ { print "SUNOS"; exit} /sunos/ { print "SUNOS"; exit}
@ -1549,6 +1551,8 @@ detect_os() {
/darwin/ { print "OSX"; exit} /darwin/ { print "OSX"; exit}
/freebsd/ { print "FREEBSD"; exit} /freebsd/ { print "FREEBSD"; exit}
/openbsd/ { print "OPENBSD"; exit} /openbsd/ { print "OPENBSD"; exit}
/netbsd/ { print "NETBSD"; exit}
/hp-ux/ { print "HPUX"; exit}
/morphos/ { print "MORPHOS"; exit} /morphos/ { print "MORPHOS"; exit}
/beos/ { print "BEOS"; exit} /beos/ { print "BEOS"; exit}
/sunos/ { print "SUNOS"; exit} /sunos/ { print "SUNOS"; exit}
@ -1561,7 +1565,7 @@ detect_os() {
if [ -z "$os" ]; then if [ -z "$os" ]; then
log 1 "detecting OS... none detected" log 1 "detecting OS... none detected"
log 1 "I couldn't detect your OS. Please use --os=OS to force one" log 1 "I couldn't detect your OS. Please use --os=OS to force one"
log 1 "Allowed values are: UNIX, OSX, FREEBSD, OPENBSD, MORPHOS, BEOS, SUNOS, CYGWIN, MINGW, OS2, WINCE, and PSP" log 1 "Allowed values are: UNIX, OSX, FREEBSD, OPENBSD, NETBSD, MORPHOS, HPUX, BEOS, SUNOS, CYGWIN, MINGW, OS2, WINCE, and PSP"
exit 1 exit 1
fi fi
@ -2309,8 +2313,9 @@ showhelp() {
echo " --awk=AWK the awk to use in configure [awk]" echo " --awk=AWK the awk to use in configure [awk]"
echo " --lipo=LIPO the lipo to use (OSX ONLY) [HOST-lipo]" echo " --lipo=LIPO the lipo to use (OSX ONLY) [HOST-lipo]"
echo " --os=OS the OS we are compiling for [DETECT]" echo " --os=OS the OS we are compiling for [DETECT]"
echo " DETECT/UNIX/OSX/FREEBSD/OPENBSD/MORPHOS/" echo " DETECT/UNIX/OSX/FREEBSD/OPENBSD/NETBSD/"
echo " BEOS/SUNOS/CYGWIN/MINGW/OS2/WINCE/PSP" echo " MORPHOS/HPUX/BEOS/SUNOS/CYGWIN/MINGW/OS2/"
echo " WINCE/PSP"
echo " --endian=ENDIAN set the endian of the HOST (AUTO/LE/BE)" echo " --endian=ENDIAN set the endian of the HOST (AUTO/LE/BE)"
echo " --revision=rXXXX overwrite the revision detection." echo " --revision=rXXXX overwrite the revision detection."
echo " Use with care!" echo " Use with care!"

View File

@ -62,7 +62,7 @@ typedef unsigned long in_addr_t;
# include <net/if.h> # include <net/if.h>
/* According to glibc/NEWS, <ifaddrs.h> appeared in glibc-2.3. */ /* According to glibc/NEWS, <ifaddrs.h> appeared in glibc-2.3. */
# if !defined(__sgi__) && !defined(SUNOS) && !defined(__MORPHOS__) && !defined(__BEOS__) && !defined(__INNOTEK_LIBC__) \ # if !defined(__sgi__) && !defined(SUNOS) && !defined(__MORPHOS__) && !defined(__BEOS__) && !defined(__INNOTEK_LIBC__) \
&& !(defined(__GLIBC__) && (__GLIBC__ <= 2) && (__GLIBC_MINOR__ <= 2)) && !defined(__dietlibc__) && !(defined(__GLIBC__) && (__GLIBC__ <= 2) && (__GLIBC_MINOR__ <= 2)) && !defined(__dietlibc__) && !defined(HPUX)
/* If for any reason ifaddrs.h does not exist on your system, comment out /* If for any reason ifaddrs.h does not exist on your system, comment out
* the following two lines and an alternative way will be used to fetch * the following two lines and an alternative way will be used to fetch
* the list of IPs from the system. */ * the list of IPs from the system. */

View File

@ -76,7 +76,7 @@
#include <SupportDefs.h> #include <SupportDefs.h>
#endif #endif
#if defined(SUNOS) #if defined(SUNOS) || defined(HPUX)
#include <alloca.h> #include <alloca.h>
#endif #endif