KDE/kdelibs/bksys/unix

Matt Rogers mattr at kde.org
Thu Nov 24 06:50:42 CET 2005


SVN commit 482800 by mattr:

add tests for limits.h and locale.h instead of just assuming they exist.

The print statements are because doing 'context.Message' didn't work in my
functions that check for those headers. Could somebody explain why that is?

CCMAIL: kde-buildsystem at kde.org



 M  +34 -6     detect_lowlevel.py  


--- trunk/KDE/kdelibs/bksys/unix/detect_lowlevel.py #482799:482800
@@ -3,7 +3,41 @@
 def detect(lenv,dest):
 	import os
 
+	def Check_limits(context):
+		context.Message('Checking for limits.h...')
+		ret = conf.CheckHeader('limits.h')
+		context.Result(ret)
+		return ret
+	
+	def Check_locale_h(context):
+		context.Message('Checking for locale.h...')
+		ret = conf.CheckHeader('locale.h')
+		contact.Result(ret)
+		return ret
+	
 
+	conf = lenv.Configure( custom_tests = {
+		 'Check_limits' : Check_limits ,
+		 'Check_locale_h' : Check_locale_h
+		 } )
+	dest.write('/* Define to 1 if you have the <limits.h> header file. */\n')
+	if conf.Check_limits:
+		print 'Checking for limits.h...yes'
+		dest.write('#define HAVE_LIMITS_H 1\n')
+	else:
+		print 'Checking for limits.h...no'
+		dest.write('#undef HAVE_LIMITS_H\n')
+		
+	dest.write('/* Define to 1 if you have the <locale.h> header file */\n')
+	if conf.Check_locale_h:
+		print 'Checking for locale.h...yes'
+		dest.write('#define HAVE_LOCALE_H 1\n')
+	else:
+		print 'Checking for locale.h...no'
+		dest.write('#undef HAVE_LOCALE_H\n')
+	
+	lenv = conf.Finish()
+
 	#### Don't fix the stuff below by hand, write proper tests in lowlevel.py
 	content="""
 /* #undef CRAY_STACKSEG_END */
@@ -227,12 +261,6 @@
 /* Define to 1 if you have the <libutil.h> header file. */
 /* #undef HAVE_LIBUTIL_H */
 
-/* Define to 1 if you have the <limits.h> header file. */
-#define HAVE_LIMITS_H 1
-
-/* Define to 1 if you have the <locale.h> header file. */
-#define HAVE_LOCALE_H 1
-
 /* Define if you have LUA > 5.0 */
 /* #undef HAVE_LUA */
 


More information about the Kde-buildsystem mailing list