+# Sources 1b/ The kernel of gdcm depends on a jpeg library whose sources are
+# contained in subdir gdcmJpeg8SrcDir. But within this subdir
+# some of the C files should not be compiled (refer to
+# gdcmJpeg8SrcDir/Makefile.am) !
+Jpeg8Sources = glob.glob(os.path.join(gdcmJpeg8SrcDir,"j*.c"))
+Jpeg8SourcesToRemove = ['jmemansi.c', 'jmemname.c', 'jmemdos.c', 'jmemmac.c']
+for Remove in Jpeg8SourcesToRemove:
+ ### Because setup.py is a multiple pass process we need to trap
+ ### the case were the files were allready wed out on a previous pass.
+ try:
+ Jpeg8Sources.remove(os.path.join(gdcmJpeg8SrcDir, Remove))
+ except ValueError:
+ continue
+Sources.extend(Jpeg8Sources)