From: Laurent Aimar Date: Thu, 7 Jul 2005 07:48:36 +0000 (+0000) Subject: * Add support for UltraSparc (uname -m: sun4u) with Solaris. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=da60272bf0c4b65128d673daef4d4d7c09c13ae3;p=libx264 * Add support for UltraSparc (uname -m: sun4u) with Solaris. Patch by Tuukka Toivonen. git-svn-id: svn://svn.videolan.org/x264/trunk@272 df754926-b1dd-0310-bc7b-ec298dee348c --- diff --git a/Makefile b/Makefile index 687146d8..a4d8ef1b 100644 --- a/Makefile +++ b/Makefile @@ -37,6 +37,13 @@ ifeq ($(ARCH),PPC) SRCS += common/ppc/mc.c common/ppc/pixel.c common/ppc/dct.c endif +ifneq ($(HAVE_GETOPT_LONG),1) +SRCS += extras/getopt.c +CFLAGS += -DHAVE_GETOPT_LONG=0 +else +CFLAGS += -DHAVE_GETOPT_LONG=1 +endif + OBJS = $(SRCS:%.c=%.o) DEP = depend diff --git a/configure b/configure index e12ffaf9..f4eb03bd 100755 --- a/configure +++ b/configure @@ -35,6 +35,7 @@ vis="no" CC="gcc" CFLAGS="-Wall -I. -O4 -ffast-math -D__X264__" LDFLAGS="" +HAVE_GETOPT_LONG=1 AS="nasm" ASFLAGS="-f elf" @@ -73,6 +74,12 @@ case "$UNAMES" in ASFLAGS="-f win32 -DPREFIX" EXE=".exe" ;; + SunOS) + SYS="SunOS" + CFLAGS="$CFLAGS -DHAVE_MALLOC_H" + LDFLAGS="$LDFLAGS -lm" + HAVE_GETOPT_LONG=0 + ;; *) echo "Unknown system $UNAMES, edit the configure" exit 1 @@ -100,6 +107,9 @@ case "$UNAMEM" in CFLAGS="$CFLAGS -maltivec -mabi=altivec" fi ;; + sun*) + ARCH="Sparc" + ;; *) echo "Unknown platform $UNAMEM, edit the configure" exit 1 @@ -204,6 +214,7 @@ ASFLAGS=$ASFLAGS VFW=$vfw EXE=$EXE VIS=$vis +HAVE_GETOPT_LONG=$HAVE_GETOPT_LONG EOF if [ "$vfw" = "yes" ]; then diff --git a/encoder/ratecontrol.c b/encoder/ratecontrol.c index 03606549..e073802f 100644 --- a/encoder/ratecontrol.c +++ b/encoder/ratecontrol.c @@ -40,7 +40,7 @@ #if defined(SYS_FREEBSD) || defined(SYS_BEOS) #define exp2f(x) powf( 2, (x) ) #endif -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(SYS_SunOS) #define exp2f(x) pow( 2, (x) ) #define sqrtf sqrt #endif diff --git a/extras/getopt.c b/extras/getopt.c index 3b5e196b..8ff165f8 100644 --- a/extras/getopt.c +++ b/extras/getopt.c @@ -63,11 +63,15 @@ char *optarg; /* argument associated with option */ __weak_alias(getopt_long,_getopt_long) #endif +#if 0 #ifndef __CYGWIN__ #define __progname __argv[0] #else extern char *__progname; #endif +#else +char *__progname = "x264"; +#endif #define IGNORE_FIRST (*options == '-' || *options == '+') #define PRINT_ERROR ((opterr) && ((*options != ':') \