[PD-cvs] pd/src SConscript, 1.1.4.26, 1.1.4.27 m_fifo.c, 1.1.2.14.2.1, 1.1.2.14.2.2 s_audio_pa.c, 1.4.4.7.2.1, 1.4.4.7.2.2 t_tkcmd.c, 1.2.4.1.2.4, 1.2.4.1.2.5 x_list.c, 1.2.2.3, 1.2.2.4

Thomas Grill xovo at users.sourceforge.net
Tue Oct 4 18:42:37 CEST 2005


Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1722/src

Modified Files:
      Tag: devel_0_39
	SConscript m_fifo.c s_audio_pa.c t_tkcmd.c x_list.c 
Log Message:
several fixes and additions for Windows VC++ compilation

Index: SConscript
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/SConscript,v
retrieving revision 1.1.4.26
retrieving revision 1.1.4.27
diff -C2 -d -r1.1.4.26 -r1.1.4.27
*** SConscript	16 Sep 2005 19:13:09 -0000	1.1.4.26
--- SConscript	4 Oct 2005 16:42:33 -0000	1.1.4.27
***************
*** 10,16 ****
  opt.AddOptions(
  	BoolOption('debug', 'Build with debugging symbols', False),
! 	BoolOption('nosimd', 'Build without simd instructions', False),
! 	BoolOption('noDAZ', 'Build DAZ on x86 (for athlon-xp)', False),
  	BoolOption('portaudio', 'Build with portaudio', True),
  	BoolOption('threadedsf', 'Build with threaded soundfiler', False),
  	BoolOption('atomic', 'Build with atomic operations', False),
--- 10,17 ----
  opt.AddOptions(
  	BoolOption('debug', 'Build with debugging symbols', False),
! 	BoolOption('simd', 'Build with simd instructions', True),
! 	BoolOption('daz', 'Build using DAZ flag on x86-SSE2 cpus (must be set to False for AMD cpus)', False),
  	BoolOption('portaudio', 'Build with portaudio', True),
+ 	BoolOption('asio', 'Build with native ASIO (for Windows)', False),
  	BoolOption('threadedsf', 'Build with threaded soundfiler', False),
  	BoolOption('atomic', 'Build with atomic operations', False),
***************
*** 22,26 ****
  	('prefix', 'install prefix', '/usr/local'),
  	BoolOption('desire', 'Build with desire', False),
! 	BoolOption('wall', 'Build with a wall of warnings', False))
  
  opt.Update(pdenv)
--- 23,29 ----
  	('prefix', 'install prefix', '/usr/local'),
  	BoolOption('desire', 'Build with desire', False),
! 	BoolOption('wall', 'Build with a wall of warnings', False),
! 	BoolOption('shared', 'Build against shared C libraries (for Windows)', True),
! )
  
  opt.Update(pdenv)
***************
*** 71,77 ****
  conf = pdenv.Configure()
  
- sep = "."
- pthreadLib = "pthread"
- 
  if pdenv['PLATFORM'] == 'posix':
  	if conf.CheckLib('dl', 'dlopen'):
--- 74,77 ----
***************
*** 84,96 ****
  	alsa = conf.CheckLib('asound','snd_pcm_info')
  
! 	
  if pdenv['PLATFORM'] == 'win32':
! 	portaudio = False
! 	if ['msvc'] in pdenv['TOOLS']:
  		pthreadLib = "pthreadVC"
  	else:
- 		sep = ""
  		pthreadLib = "pthreadGC2"
! 	pass
  
  if pdenv['PLATFORM'] == 'darwin':
--- 84,100 ----
  	alsa = conf.CheckLib('asound','snd_pcm_info')
  
! 
! # determine pthread and tcl/tk lib layout
  if pdenv['PLATFORM'] == 'win32':
! #	portaudio = False
! 	sep = ""
! 	if 'msvc' in pdenv['TOOLS']:
  		pthreadLib = "pthreadVC"
  	else:
  		pthreadLib = "pthreadGC2"
! else:
! 	sep = "."
! 	pthreadLib = "pthread"
! 
  
  if pdenv['PLATFORM'] == 'darwin':
***************
*** 117,129 ****
  #
  
  
- if not conf.CheckLib('m','sin'):
- 	print "can't find Math library"
- 	Exit(1)
  
  if pdenv['PLATFORM'] != 'darwin':
! 	if not conf.CheckLib('tcl'):
  		for i in range (0,10):
! 			if conf.CheckLib('tcl8%s%d' % (sep,i)):
  				break
  		else:
--- 121,146 ----
  #
  
+ path_pthread="c:/data/prog/packs/pthreads"
+ path_tcl="c:/programme/prog/tcl"
+ path_asio="c:/data/prog/audio/asiosdk2"
+ 
+ pdenv.Append(CPPPATH=[path_pthread,path_tcl+'/include'])
+ pdenv.Append(LIBPATH=[path_pthread,path_tcl+'/lib'])
+ 
+ pdenv.Append(CPPPATH=[path_asio+'/common',path_asio+'/host',path_asio+'/pc'])
+ pdenv.Append(LIBPATH=[path_asio])
  
  
+ add_cpppath = []
+ 
+ if pdenv['PLATFORM'] != 'win32':
+ 	if not conf.CheckLib('m','sin'):
+ 		print "can't find Math library"
+ 		Exit(1)
+ 	
  if pdenv['PLATFORM'] != 'darwin':
! 	if not conf.CheckLib('tcl','Tcl_Init'):
  		for i in range (0,10):
! 			if conf.CheckLib('tcl8%s%d' % (sep,i),'Tcl_Init'):
  				break
  		else:
***************
*** 131,144 ****
  			Exit(1)
  
! if pdenv['PLATFORM'] != 'darwin':
! 	if not conf.CheckLib('tk'):
  		for i in range (0,10):
! 			if conf.CheckLib('tk8%s%d' % (sep,i)):
  				break
  		else:
  			print "can't find tk"
  
- add_cpppath = []
- if pdenv['PLATFORM'] != 'darwin':
  	if not ( conf.CheckHeader('tcl.h') or
  		 conf.CheckHeader('tcl/tcl.h')
--- 148,158 ----
  			Exit(1)
  
! 	if not conf.CheckLib('tk','Tk_Init'):
  		for i in range (0,10):
! 			if conf.CheckLib('tk8%s%d' % (sep,i),'Tk_Init'):
  				break
  		else:
  			print "can't find tk"
  
  	if not ( conf.CheckHeader('tcl.h') or
  		 conf.CheckHeader('tcl/tcl.h')
***************
*** 151,155 ****
  			print "can't find tcl header"
  		
- if pdenv['PLATFORM'] != 'darwin':
  	if not ( conf.CheckHeader('tk.h') or
  		 conf.CheckHeader('tk/tk.h')
--- 165,168 ----
***************
*** 168,172 ****
  
  if not conf.CheckLib(pthreadLib, 'pthread_create'):
! 	print "can't find pthread library"
  	Exit(1)
  
--- 181,189 ----
  
  if not conf.CheckLib(pthreadLib, 'pthread_create'):
! 	print "can't find pthread library (%s)" % pthreadLib
! 	Exit(1)
! 
! if not conf.CheckHeader('pthread.h'):
! 	print "can't find pthread.h"
  	Exit(1)
  
***************
*** 184,188 ****
  	defs.append('ATOMIC')
  
! if pdenv['nosimd']:
  	defs.append('DONTUSESIMD')
  
--- 201,205 ----
  	defs.append('ATOMIC')
  
! if not pdenv['simd']:
  	defs.append('DONTUSESIMD')
  
***************
*** 219,222 ****
--- 236,240 ----
  pdenv.Append(LIBPATH=".")
  
+ 
  ######################################################################
  #
***************
*** 238,255 ****
  # windows configuration
  
- windows_sources = Split("""s_audio_mmio.c
-                            s_audio_asio.cpp asio.cpp asiodrivers.cpp asiolist.cpp
-                            s_midi_mmio.c""")
- windows_defs = Split("MSW USEAPI_ASIO")
- 
  if pdenv['PLATFORM'] == 'win32':
! 	if ['msvc'] in pdenv['TOOLS']:
! 		sources.append(windows_sources + simd_sse_vc_sources)
! 	else:
! 		sources.append(windows_sources + simd_sse_gcc_sources)
! 	pdenv.Append(CPPDEFINES=windows_defs)
  
! 	win_libs = Split("ole32 winmm wsock32")
! 	pdenv.Append(LIBS=win_libs)
  
  	pdenv['pdlib'] = True ## split pd to pd.exe and pd.dll
--- 256,275 ----
  # windows configuration
  
  if pdenv['PLATFORM'] == 'win32':
! 	pdenv.Append(CPPDEFINES=["MSW","NT"])
! 	pdenv.Append(LIBS=Split("ole32 winmm wsock32 advapi32"))
  
! 	sources += Split("s_audio_mmio.c s_midi_mmio.c")
! 
! 	if pdenv['asio']:
! 		# enable native ASIO support
! 		sources += Split("s_audio_asio.cpp asio.cpp asiodrivers.cpp asiolist.cpp")
! 		pdenv.Append(CPPDEFINES="USEAPI_ASIO")
! 		pdenv.Append(LIBS="asiolib")
! 
! 	if 'msvc' in pdenv['TOOLS']:
! 		sources += simd_sse_vc_sources
! 	else:
! 		sources += simd_sse_gcc_sources
  
  	pdenv['pdlib'] = True ## split pd to pd.exe and pd.dll
***************
*** 278,282 ****
  	linux_sources = pa_sources + pa_common_sources + pa_linux_sources + oss_sources + midi_sources
  	
! 	if not pdenv['nosimd']:
  		linux_sources.append(simd_sse_gcc_sources)
  		
--- 298,302 ----
  	linux_sources = pa_sources + pa_common_sources + pa_linux_sources + oss_sources + midi_sources
  	
! 	if pdenv['simd']:
  		linux_sources.append(simd_sse_gcc_sources)
  		
***************
*** 352,355 ****
--- 372,379 ----
  # compiler options
  flags = ''
+ cflags = ''
+ lflags = ''
+ 
+ #lflags += " /SUBSYSTEM:CONSOLE"
  
  if pdenv['wall']:
***************
*** 358,371 ****
  if pdenv['debug']:
  	pdenv.Append(CPPDEFINES=Split("DEBUG"))
! 	if ['msvc'] in pdenv['TOOLS']:
! 		pass # how to switch on debugging on msvc?
  	else:
  		flags += " -g"
  else:
  	pdenv.Append(CPPDEFINES=Split("NDEBUG"))
! 	if ['msvc'] in pdenv['TOOLS']:
! 		pass # how to switch on optimizing on msvc?
  	else:
! 		flags += " -O3"
  
  if pdenv.Dictionary().has_key('optimize'):
--- 382,406 ----
  if pdenv['debug']:
  	pdenv.Append(CPPDEFINES=Split("DEBUG"))
! 	if 'msvc' in pdenv['TOOLS']:
! 		if pdenv['shared']:
! 			cflags += " /MDd"
! 		else:
! 			cflags += " /MTd"
! 
! 		cflags += ' /Od /Zi'
! 		lflags += ' /DEBUG'
  	else:
  		flags += " -g"
  else:
  	pdenv.Append(CPPDEFINES=Split("NDEBUG"))
! 	if 'msvc' in pdenv['TOOLS']:
! 		if pdenv['shared']:
! 			cflags += " /MD"
! 		else:
! 			cflags += " /MT"
! 
! 		cflags += " /Ox"
  	else:
! 		cflags += " -O3"
  
  if pdenv.Dictionary().has_key('optimize'):
***************
*** 374,390 ****
  			break
  	else:
! 		if ['msvc'] in pdenv['TOOLS']:
! 			pass # is there any machine optmizisation on msvc?
  		else:
! 			flags += " -march=" + pdenv['optimize']
  			
! if not pdenv['nosimd']:
   	if pdenv['PLATFORM'] != 'darwin':
! 		flags += " -mfpmath=sse -mmmx -msse -fprefetch-loop-arrays"
  	else:
! 		flags += " -faltivec -maltivec"
  
  if pdenv['PLATFORM'] == 'win32':
! 	if ['msvc'] not in pdenv['TOOLS']:
  		flags += " -mms-bitfields" ## binary compatibility with msvc
  
--- 409,432 ----
  			break
  	else:
! 		optarch = pdenv['optimize']
! 		if 'msvc' in pdenv['TOOLS']:
! 			if optarch in ['pentium4','pentium4m','prescott','nocona','athlon-4','athlon-xp','athlon-mp','k8','opteron','athlon64','athlon-fx']:
! 				cflags += " /G7"
! 			elif optarch in ['pentium-m','pentium3','pentium3m','pentium2','pentiumpro','i686']:
! 				cflags += " /G6"
  		else:
! 			cflags += " -march=" + optarch
  			
! if pdenv['simd']:
   	if pdenv['PLATFORM'] != 'darwin':
! 		if 'msvc' in pdenv['TOOLS']:
! 			cflags += " /arch:SSE"
! 		else:
! 			cflags += " -mfpmath=sse -mmmx -msse -fprefetch-loop-arrays"
  	else:
! 		cflags += " -faltivec -maltivec"
  
  if pdenv['PLATFORM'] == 'win32':
! 	if not 'msvc' in pdenv['TOOLS']:
  		flags += " -mms-bitfields" ## binary compatibility with msvc
  
***************
*** 395,402 ****
  conf = pdenv.Configure()
  
! if not pdenv['nosimd'] and pdenv['PLATFORM'] != 'darwin':
! 	if not pdenv['noDAZ']:
  		pdenv.Append(CPPDEFINES='DAZ')
! 		flags += " -msse2"
  	
  if conf.TryCompile("""#include \"stdlib.h\"
--- 437,447 ----
  conf = pdenv.Configure()
  
! if pdenv['simd'] and pdenv['PLATFORM'] != 'darwin':
! 	if pdenv['daz']:
  		pdenv.Append(CPPDEFINES='DAZ')
! 		if 'msvc' in pdenv['TOOLS']:
! 			cflags += " /arch:SSE2"
! 		else:
! 			cflags += " -msse2"
  	
  if conf.TryCompile("""#include \"stdlib.h\"
***************
*** 410,416 ****
  
  
! pdenv.Append(CCFLAGS=flags)
! pdenv.Append(CXXFLAGS=flags)
! pdenv.Append(LINKFLAGS=flags)
  
  
--- 455,461 ----
  
  
! pdenv.Append(CCFLAGS=Split(flags)+Split(cflags))
! pdenv.Append(CXXFLAGS=Split(flags)+Split(cflags))
! pdenv.Append(LINKFLAGS=Split(flags)+Split(lflags))
  
  
***************
*** 444,455 ****
  # build pd's kernel
  
  if pdenv['pdlib']:
! 	pdlib = pdenv.SharedLibrary('../bin/pd', sources)
! 	pdenv.Append(LIBPATH=['.'])
! 	pd = pdenv.Program('../bin/pd', 's_entry.c', LIBS=['pd'])
! 	Default(pdsend, pdreceive, pdgui, pd, pdlib, pdtk)
  else:
-  	pd = pdenv.Program('../bin/pd', ['s_entry.c'] + sources)
  	pdlib = None
  	Default(pdsend, pdreceive, pdgui, pd, pdtk)
  
--- 489,506 ----
  # build pd's kernel
  
+ # copy environment to distinguish between PD kernel and other PD parts (like extras)
+ envint = pdenv.Copy()
+ # specialize for PD kernel
+ envint.Append(CPPDEFINES='PD_INTERNAL')
+ 
  if pdenv['pdlib']:
! 	envint.Append(LINKFLAGS=["/EXPORT:sys_main"])
! 
! 	pdlib = envint.SharedLibrary('../bin/pd', sources)
! 	pd = pdenv.Program('../bin/pd', 's_entry.c', LIBS=['./bin/pd'])
! 	Default(pdsend, pdreceive, pdgui, pdlib, pd, pdtk)
  else:
  	pdlib = None
+  	pd = envint.Program('../bin/pd', ['s_entry.c'] + sources)
  	Default(pdsend, pdreceive, pdgui, pd, pdtk)
  

Index: m_fifo.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/m_fifo.c,v
retrieving revision 1.1.2.14.2.1
retrieving revision 1.1.2.14.2.2
diff -C2 -d -r1.1.2.14.2.1 -r1.1.2.14.2.2
*** m_fifo.c	12 Jul 2005 15:11:10 -0000	1.1.2.14.2.1
--- m_fifo.c	4 Oct 2005 16:42:33 -0000	1.1.2.14.2.2
***************
*** 380,384 ****
  }
  
! #elif defined(__Windows__)
  
  static void* lifo_pop(t_lifo* lifo)
--- 380,384 ----
  }
  
! #elif defined(_WIN32) && defined(_MSC_VER)
  
  static void* lifo_pop(t_lifo* lifo)
***************
*** 410,413 ****
--- 410,414 ----
  		pop		ebx
  	}
+ }
  
  static void lifo_push(t_lifo * lifo, void * data) 

Index: x_list.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/x_list.c,v
retrieving revision 1.2.2.3
retrieving revision 1.2.2.4
diff -C2 -d -r1.2.2.3 -r1.2.2.4
*** x_list.c	21 Aug 2005 11:28:24 -0000	1.2.2.3
--- x_list.c	4 Oct 2005 16:42:33 -0000	1.2.2.4
***************
*** 3,6 ****
--- 3,16 ----
  * WARRANTIES, see the file, "LICENSE.txt," in this distribution.  */
  
+ #ifndef HAVE_ALLOCA
+ #ifdef _WIN32
+ #define HAVE_ALLOCA 0   /* LATER this should be set by configure script! */
+ #else
+ #define HAVE_ALLOCA 1   /* LATER this should be set by configure script! */
+ #endif
+ #endif
+ 
+ #define LIST_NGETBYTE 100 /* bigger that this we use alloc, not alloca */
+ 
  #include "m_pd.h"
  /* #include <string.h> */
***************
*** 13,18 ****
  extern t_pd *newest;
  
- #define HAVE_ALLOCA 1   /* LATER this should be set by configure script! */
- #define LIST_NGETBYTE 100 /* bigger that this we use alloc, not alloca */
  
  /* the "list" object family.
--- 23,26 ----

Index: t_tkcmd.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/t_tkcmd.c,v
retrieving revision 1.2.4.1.2.4
retrieving revision 1.2.4.1.2.5
diff -C2 -d -r1.2.4.1.2.4 -r1.2.4.1.2.5
*** t_tkcmd.c	21 Aug 2005 11:28:24 -0000	1.2.4.1.2.4
--- t_tkcmd.c	4 Oct 2005 16:42:33 -0000	1.2.4.1.2.5
***************
*** 597,601 ****
  }
  
! #if !defined(MSW) || (defined(MSW) && defined (__GNUC__))
  void pdgui_setname(char *s)
  {
--- 597,601 ----
  }
  
! #if 1 /*!defined(MSW) || (defined(MSW) && defined (__GNUC__))*/
  void pdgui_setname(char *s)
  {

Index: s_audio_pa.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/s_audio_pa.c,v
retrieving revision 1.4.4.7.2.1
retrieving revision 1.4.4.7.2.2
diff -C2 -d -r1.4.4.7.2.1 -r1.4.4.7.2.2
*** s_audio_pa.c	12 Jul 2005 15:11:11 -0000	1.4.4.7.2.1
--- s_audio_pa.c	4 Oct 2005 16:42:33 -0000	1.4.4.7.2.2
***************
*** 38,44 ****
  /* #define PABLOCKING */ 
  
! #ifndef PABLOCKING
  #include "s_audio_pablio.h"
! #endif
  
  static int pa_inchans, pa_outchans;
--- 38,44 ----
  /* #define PABLOCKING */ 
  
! //#ifndef PABLOCKING
  #include "s_audio_pablio.h"
! //#endif
  
  static int pa_inchans, pa_outchans;





More information about the Pd-cvs mailing list