[MPlayer-dev-eng] [PATCH] Compilation patch for inttypes.h and cygwin

Max Berger max.berger at xslt.de
Thu Aug 1 00:35:16 CEST 2002


Hi,

The problem: cygwin doesn't provide inttypes.h

solution for cpuinfo: cpuinfo doesn't even need inttypes.h in cygwin

the solution: inttypes.h is always included with
#include <inttypes.h>

which means, search the common dir (/usr/include) first, THEN search local
dir. so we'll just supply a local inttypes.h in the main directory and
make sure it only applies to cgywin and can be included from everywhere.

Comments?

mfG

Max Berger
ICQ: 44986764
e-mail: max.berger at xslt.de

--
PGP/GnuPG ID: E81592BC   Print: F489F8759D4132923EC4 BC7E072AB73AE81592BC
SysAdmin: http://www7.in.tum.de/ SyncML: http://libsyncml.sourceforge.net
XSLT: http://www.xslt.de    Mail written on Linux: http://www.kerneli.org
-------------- next part --------------
? inttypes.h
Index: Makefile
===================================================================
RCS file: /cvsroot/mplayer/main/Makefile,v
retrieving revision 1.196
diff -u -r1.196 Makefile
--- Makefile	25 Jul 2002 03:37:27 -0000	1.196
+++ Makefile	31 Jul 2002 22:39:31 -0000
@@ -55,7 +55,7 @@
 ifeq ($(VIDIX),yes)
 MISC_LIBS += -Llibdha -ldha -Lvidix -lvidix
 endif
-CFLAGS = $(OPTFLAGS) -Ilibmpdemux -Iloader $(VO_INC) $(EXTRA_INC) $(CDPARANOIA_INC)# -Wall
+CFLAGS = $(OPTFLAGS) -I. -Ilibmpdemux -Iloader $(VO_INC) $(EXTRA_INC) $(CDPARANOIA_INC)# -Wall
 
 PARTS = libfame libmpdemux libmpcodecs mp3lib liba52 libmp1e libmpeg2 libavcodec libao2 drivers linux postproc input libmpdvdkit
 ifeq ($(VIDIX),yes)
Index: configure
===================================================================
RCS file: /cvsroot/mplayer/main/configure,v
retrieving revision 1.527
diff -u -r1.527 configure
--- configure	30 Jul 2002 19:06:51 -0000	1.527
+++ configure	31 Jul 2002 22:39:33 -0000
@@ -485,7 +485,7 @@
   elif x86; then
     # all other OS try to extract cpu information from a small helper
     # program TOOLS/cpuinfo instead
-    $_cc -o TOOLS/cpuinfo TOOLS/cpuinfo.c
+    $_cc -I. -o TOOLS/cpuinfo TOOLS/cpuinfo.c
     _cpuinfo="TOOLS/cpuinfo"
   fi
 
@@ -1545,7 +1545,11 @@
   # nothing to do
   :
 else
-  die "cannot find header inttypes.h (see in DOCS/faq.html)"
+  if cygwin ; then
+    echo Fortunately you have CygWIN, so you dont need inttypes.h
+  else
+    die "cannot find header inttypes.h (see in DOCS/faq.html)"
+  fi
 fi
 echores "$_inttypes"
 
Index: liba52/Makefile
===================================================================
RCS file: /cvsroot/mplayer/main/liba52/Makefile,v
retrieving revision 1.5
diff -u -r1.5 Makefile
--- liba52/Makefile	30 Dec 2001 04:42:42 -0000	1.5
+++ liba52/Makefile	31 Jul 2002 22:39:34 -0000
@@ -6,7 +6,7 @@
 SRCS    = crc.c resample.c bit_allocate.c bitstream.c downmix.c imdct.c imdct_mlib.c parse.c
 OBJS	= $(SRCS:.c=.o)
 
-CFLAGS  = $(MLIB_INC) $(OPTFLAGS) 
+CFLAGS  = -I.. $(MLIB_INC) $(OPTFLAGS) 
 
 .SUFFIXES: .c .o
 
Index: libmpdemux/Makefile
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/Makefile,v
retrieving revision 1.30
diff -u -r1.30 Makefile
--- libmpdemux/Makefile	21 Jun 2002 06:15:36 -0000	1.30
+++ libmpdemux/Makefile	31 Jul 2002 22:39:34 -0000
@@ -9,7 +9,7 @@
 endif
 
 OBJS	= $(SRCS:.c=.o)
-INCLUDE = -I../loader $(CSS_INC) $(EXTRA_INC)
+INCLUDE = -I.. -I../loader $(CSS_INC) $(EXTRA_INC)
 CFLAGS  = $(OPTFLAGS) $(INCLUDE)
 
 .SUFFIXES: .c .o
Index: libmpdvdkit/Makefile
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdvdkit/Makefile,v
retrieving revision 1.7
diff -u -r1.7 Makefile
--- libmpdvdkit/Makefile	7 Jun 2002 22:41:27 -0000	1.7
+++ libmpdvdkit/Makefile	31 Jul 2002 22:39:34 -0000
@@ -18,7 +18,7 @@
 endif
 
 # -funroll-loops  removed, triggered gcc 3.0.4 (3.x?) bug
-CFLAGS= -I. $(OPTFLAGS) $(EXTRA_INC)\
+CFLAGS= -I. -I.. $(OPTFLAGS) $(EXTRA_INC)\
 	-D_LARGEFILE64_SOURCE \
 	-DSYS_LINUX -D_FILE_OFFSET_BITS=64 -D__USE_UNIX98 -D_REENTRANT -D_GNU_SOURCE \
 	-ffast-math -fomit-frame-pointer 
Index: mp3lib/Makefile
===================================================================
RCS file: /cvsroot/mplayer/main/mp3lib/Makefile,v
retrieving revision 1.28
diff -u -r1.28 Makefile
--- mp3lib/Makefile	29 Apr 2002 21:42:36 -0000	1.28
+++ mp3lib/Makefile	31 Jul 2002 22:39:35 -0000
@@ -7,7 +7,7 @@
 ifeq ($(TARGET_ARCH_SGI_MIPS),yes)
 OPTFLAGS := $(OPTFLAGS:-O4=-O0)
 endif
-CFLAGS  = $(OPTFLAGS) $(EXTRA_INC)
+CFLAGS  = -I.. $(OPTFLAGS) $(EXTRA_INC)
 ifeq ($(TARGET_ARCH_X86),yes)
 SRCS += decode_i586.c
 OBJS += decode_i586.o
--- inttypes.h
+++ inttypes.h
@@ -0,0 +1,10 @@
+#ifdef __CYGWIN__
+#ifndef _CYGWIN_INTTYPES_H
+#define _CYGWIN_INTTYPES_H
+#include <sys/types.h>
+typedef u_int8_t uint8_t;
+typedef u_int16_t uint16_t;
+typedef u_int32_t uint32_t;
+typedef u_int64_t uint64_t;
+#endif
+#endif


More information about the MPlayer-dev-eng mailing list