[wpdev-commits] wolfpack configure.py,1.40,1.41
Brought to you by:
rip,
thiagocorrea
From: Richard M. <dr...@us...> - 2004-11-03 01:55:50
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27316 Modified Files: configure.py Log Message: Cleanups, trying to fix an odd display bug... Index: configure.py =================================================================== RCS file: /cvsroot/wpdev/wolfpack/configure.py,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** configure.py 22 Oct 2004 12:29:46 -0000 1.40 --- configure.py 3 Nov 2004 01:55:39 -0000 1.41 *************** *** 6,9 **** --- 6,22 ---- # ( ( ;._ \\ ctr # Last Modification: check cvs logs # ################################################################# + # # + ################################################################# + # A note about the search paths... # + # The order of searching should be: # + # /usr/local/{include,lib}/{*.h,*.so,*.a} # + # /usr/local/{include,lib}/{package}/{*.h,*.so,*.a} # + # /usr/{include,lib}/{*.h,*.so,*.a} # + # /usr/{include,lib}/{package}/{*.h,*.so,*.a} # + # # + # This will allow local installations to be searched first # + # followed by the system's default package files. # + # # + ################################################################# import os *************** *** 17,29 **** # Older Python lib work arounds... try: ! from optparse import OptionParser except: ! sys.path.append( './tools/scripts' ) ! from optparse import OptionParser try: ! osHasPathDotSep = os.path.sep except: ! os.path.sep = '/' # These are the variables we are trying to figure out --- 30,42 ---- # Older Python lib work arounds... try: ! from optparse import OptionParser except: ! sys.path.append( './tools/scripts' ) ! from optparse import OptionParser try: ! osHasPathDotSep = os.path.sep except: ! os.path.sep = '/' # These are the variables we are trying to figure out *************** *** 81,90 **** for entry in searchpath: pathexp, fileexp = os.path.split( entry ) ! for path in glob.glob(pathexp): ! if os.path.exists(path): ! for file in dircache.listdir(path): if fnmatch.fnmatch( file, fileexp ): ! return (file, path) ! return (None, None) --- 94,103 ---- for entry in searchpath: pathexp, fileexp = os.path.split( entry ) ! for path in glob.glob( pathexp ): ! if os.path.exists( path ): ! for file in dircache.listdir( path ): if fnmatch.fnmatch( file, fileexp ): ! return ( file, path ) ! return ( None, None ) *************** *** 122,150 **** MySQL_INCSEARCHPATH = [ sys.prefix + "\include\mysql.h" ] elif sys.platform == "linux2": ! MySQL_LIBSEARCHPATH = [ "/usr/local/lib/mysql/libmysqlclient*.so", \ ! "/usr/lib/mysql/libmysqlclient*.so", \ ! "/usr/local/lib/libmysqlclient*.so", \ ! "/usr/lib/libmysqlclient*.so" ] ! MySQL_LIBSTATICSEARCHPATH = [ "/usr/local/lib/mysql/libmysqlclient*.a", \ ! "/usr/lib/mysql/libmysqlclient*.a", \ ! "/usr/local/lib/libmysqlclient*.a", \ ! "/usr/lib/libmysqlclient*.a" ] ! MySQL_INCSEARCHPATH = [ "/usr/local/include/mysql/mysql.h", \ ! "/usr/include/mysql/mysql.h", \ ! "/usr/local/include/mysql.h", \ ! "/usr/include/mysql.h" ] elif sys.platform == "freebsd4" or sys.platform == "freebsd5": ! MySQL_LIBSEARCHPATH = [ "/usr/local/lib/mysql/libmysqlclient*.so", \ ! "/usr/lib/mysql/libmysqlclient*.so", \ ! "/usr/local/lib/libmysqlclient*.so", \ ! "/usr/lib/libmysqlclient*.so" ] ! MySQL_LIBSTATICSEARCHPATH = [ "/usr/local/lib/mysql/libmysqlclient*.a", \ ! "/usr/lib/mysql/libmysqlclient*.a", \ ! "/usr/local/lib/libmysqlclient*.a", \ ! "/usr/lib/libmysqlclient*.a" ] ! MySQL_INCSEARCHPATH = [ "/usr/local/include/mysql/mysql.h", \ ! "/usr/include/mysql/mysql.h", \ ! "/usr/local/include/mysql.h", \ ! "/usr/include/mysql.h" ] else: sys.stdout.write("ERROR: Unknown platform %s to checkMySQL()\n" % sys.platform ) --- 135,169 ---- MySQL_INCSEARCHPATH = [ sys.prefix + "\include\mysql.h" ] elif sys.platform == "linux2": ! MySQL_LIBSEARCHPATH = [ \ ! "/usr/local/lib/libmysqlclient*.so", \ ! "/usr/local/lib/mysql/libmysqlclient*.so", \ ! "/usr/lib/libmysqlclient*.so", \ ! "/usr/lib/mysql/libmysqlclient*.so" ] ! MySQL_LIBSTATICSEARCHPATH = [ \ ! "/usr/local/lib/libmysqlclient*.a", \ ! "/usr/local/lib/mysql/libmysqlclient*.a", \ ! "/usr/lib/libmysqlclient*.a", \ ! "/usr/lib/mysql/libmysqlclient*.a" ] ! MySQL_INCSEARCHPATH = [ \ ! "/usr/local/include/mysql.h", \ ! "/usr/local/include/mysql/mysql.h", \ ! "/usr/include/mysql.h", \ ! "/usr/include/mysql/mysql.h" ] elif sys.platform == "freebsd4" or sys.platform == "freebsd5": ! MySQL_LIBSEARCHPATH = [ \ ! "/usr/local/lib/libmysqlclient*.so", \ ! "/usr/local/lib/mysql/libmysqlclient*.so", \ ! "/usr/lib/libmysqlclient*.so", \ ! "/usr/lib/mysql/libmysqlclient*.so" ] ! MySQL_LIBSTATICSEARCHPATH = [ \ ! "/usr/local/lib/libmysqlclient*.a", \ ! "/usr/local/lib/mysql/libmysqlclient*.a", \ ! "/usr/lib/libmysqlclient*.a", \ ! "/usr/lib/mysql/libmysqlclient*.a" ] ! MySQL_INCSEARCHPATH = [ \ ! "/usr/local/include/mysql.h", \ ! "/usr/local/include/mysql/mysql.h", \ ! "/usr/include/mysql.h", \ ! "/usr/include/mysql/mysql.h" ] else: sys.stdout.write("ERROR: Unknown platform %s to checkMySQL()\n" % sys.platform ) *************** *** 188,226 **** PYTHONINCSEARCHPATH += [ sys.prefix + "\include\Python.h" ] elif sys.platform == "linux2": ! PYTHONLIBSEARCHPATH += [ "/usr/local/lib/libpython2.3*.so", \ ! "/usr/local/lib/[Pp]ython*/libpython2.3*.so", \ ! "/usr/lib/libpython2.3*.so", \ ! "/usr/lib/[Pp]ython*/libpython2.3*.so", \ ! "/usr/lib/[Pp]ython*/config/libpython2.3*.so", \ ! "/usr/local/lib/[Pp]ython*/config/libpython2.3*.so"] ! PYTHONLIBSTATICSEARCHPATH += [ "/usr/local/lib/libpython2.3*.a", \ ! "/usr/local/lib/[Pp]ython2.3*/libpython2.3*.a", \ ! "/usr/lib/libpython2.3*.a", \ ! "/usr/lib/[Pp]ython2.3*/libpython2.3*.a", \ ! "/usr/lib/[Pp]ython2.3*/config/libpython2.3*.a", \ ! "/usr/local/lib/[Pp]ython2.3*/config/libpython2.3*.a"] ! PYTHONINCSEARCHPATH += [ "/usr/local/include/[Pp]ython2.3*/Python.h", \ ! "/usr/include/[Pp]ython2.3*/Python.h"] elif sys.platform == "freebsd4" or sys.platform == "freebsd5": ! PYTHONLIBSEARCHPATH += [ "/usr/local/lib/libpython2.3*.so", \ ! "/usr/local/lib/[Pp]ython2.3*/libpython2.3*.so", \ ! "/usr/lib/libpython2.3*.so", \ ! "/usr/lib/[Pp]ython2.3*/libpython2.3*.so", \ ! "/usr/lib/[Pp]ython2.3*/config/libpython2.3*.so", \ ! "/usr/local/lib/[Pp]ython2.3*/config/libpython2.3*.so"] ! PYTHONLIBSTATICSEARCHPATH += [ "/usr/local/lib/libpython2.3*.a", \ ! "/usr/local/lib/[Pp]ython2.3*/libpython2.3*.a", \ ! "/usr/lib/libpython2.3*.a", \ ! "/usr/lib/[Pp]ython2.3*/libpython2.3*.a", \ ! "/usr/lib/[Pp]ython2.3*/config/libpython2.3*.a", \ ! "/usr/local/lib/[Pp]ython2.3*/config/libpython2.3*.a"] ! PYTHONINCSEARCHPATH += [ "/usr/local/include/[Pp]ython2.3*/Python.h", \ ! "/usr/include/[Pp]ython2.3*/Python.h"] elif sys.platform == "darwin": ! PYTHONINCSEARCHPATH += [ "/System/Library/Frameworks/Python.framework/Versions/Current/Headers/Python.h" ] PYTHONLIBSEARCHPATH += [ ] ! PYTHONLIBSTATICSEARCHPATH += ["/System/Library/Frameworks/Python.framework/Versions/Current/Python", \ ! "/System/Library/Frameworks/Python.framework/Versions/Current/lib/[Pp]ython*/config/libpython*.a", \ ! "/usr/local/lib/[Pp]ython*/config/libpython*.a"] else: sys.stdout.write(red("ERROR")+": Unknown platform %s to checkPython()\n" % sys.platform ) --- 207,253 ---- PYTHONINCSEARCHPATH += [ sys.prefix + "\include\Python.h" ] elif sys.platform == "linux2": ! PYTHONLIBSEARCHPATH += [ \ ! "/usr/local/lib/libpython2.3*.so", \ ! "/usr/local/lib/[Pp]ython*/libpython2.3*.so", \ ! "/usr/local/lib/[Pp]ython*/config/libpython2.3*.so", \ ! "/usr/lib/libpython2.3*.so", \ ! "/usr/lib/[Pp]ython*/libpython2.3*.so", \ ! "/usr/lib/[Pp]ython*/config/libpython2.3*.so" ] ! PYTHONLIBSTATICSEARCHPATH += [ \ ! "/usr/local/lib/libpython2.3*.a", \ ! "/usr/local/lib/[Pp]ython2.3*/libpython2.3*.a", \ ! "/usr/local/lib/[Pp]ython2.3*/config/libpython2.3*.a", \ ! "/usr/lib/libpython2.3*.a", \ ! "/usr/lib/[Pp]ython2.3*/libpython2.3*.a", \ ! "/usr/lib/[Pp]ython2.3*/config/libpython2.3*.a" ] ! PYTHONINCSEARCHPATH += [ \ ! "/usr/local/include/[Pp]ython2.3*/Python.h", \ ! "/usr/include/[Pp]ython2.3*/Python.h" ] elif sys.platform == "freebsd4" or sys.platform == "freebsd5": ! PYTHONLIBSEARCHPATH += [ \ ! "/usr/local/lib/libpython2.3*.so", \ ! "/usr/local/lib/[Pp]ython2.3*/libpython2.3*.so", \ ! "/usr/local/lib/[Pp]ython2.3*/config/libpython2.3*.so", \ ! "/usr/lib/libpython2.3*.so", \ ! "/usr/lib/[Pp]ython2.3*/libpython2.3*.so", \ ! "/usr/lib/[Pp]ython2.3*/config/libpython2.3*.so" ] ! PYTHONLIBSTATICSEARCHPATH += [ \ ! "/usr/local/lib/libpython2.3*.a", \ ! "/usr/local/lib/[Pp]ython2.3*/libpython2.3*.a", \ ! "/usr/local/lib/[Pp]ython2.3*/config/libpython2.3*.a", \ ! "/usr/lib/libpython2.3*.a", \ ! "/usr/lib/[Pp]ython2.3*/libpython2.3*.a", \ ! "/usr/lib/[Pp]ython2.3*/config/libpython2.3*.a" ] ! PYTHONINCSEARCHPATH += [ \ ! "/usr/local/include/[Pp]ython2.3*/Python.h", \ ! "/usr/include/[Pp]ython2.3*/Python.h" ] elif sys.platform == "darwin": ! PYTHONINCSEARCHPATH += [ \ ! "/System/Library/Frameworks/Python.framework/Versions/Current/Headers/Python.h" ] PYTHONLIBSEARCHPATH += [ ] ! PYTHONLIBSTATICSEARCHPATH += [ \ ! "/usr/local/lib/[Pp]ython*/config/libpython*.a", \ ! "/System/Library/Frameworks/Python.framework/Versions/Current/Python", \ ! "/System/Library/Frameworks/Python.framework/Versions/Current/lib/[Pp]ython*/config/libpython*.a" ] else: sys.stdout.write(red("ERROR")+": Unknown platform %s to checkPython()\n" % sys.platform ) *************** *** 229,259 **** # if --static if options.staticlink: PYTHONLIBSEARCHPATH = PYTHONLIBSTATICSEARCHPATH # if it was overiden... if options.py_incpath: PYTHONINCSEARCHPATH = [ options.py_incpath ] if options.py_libpath: PYTHONLIBSEARCHPATH = [ options.py_libpath ] sys.stdout.write( "Checking Python version... " ) if sys.hexversion >= 0x020200F0: ! sys.stdout.write(green("ok\n")) else: ! sys.stdout.write( red("failed") + "\n" ) sys.stdout.write( bold("Wolfpack requires Python version greater than 2.2.0 ") ) sys.exit(); - sys.stdout.write( "Checking CPU byte order... %s\n" % sys.byteorder ) if sys.byteorder != 'little': ! sys.stdout.write(yellow("Warning:") + " Wolfpack support for big endian systems is completely experimental and unlikey to work\n" ) if lookForLib: sys.stdout.write( "Searching for Python library... " ) - global py_libpath global py_libfile ! py_libfile, py_libpath = findFile( PYTHONLIBSEARCHPATH ) if ( py_libfile ): --- 256,288 ---- # if --static if options.staticlink: + PYTHONLIBSEARCHPATH = None PYTHONLIBSEARCHPATH = PYTHONLIBSTATICSEARCHPATH # if it was overiden... if options.py_incpath: + PYTHONINCSEARCHPATH = None PYTHONINCSEARCHPATH = [ options.py_incpath ] if options.py_libpath: + PYTHONLIBSEARCHPATH = None PYTHONLIBSEARCHPATH = [ options.py_libpath ] sys.stdout.write( "Checking Python version... " ) if sys.hexversion >= 0x020200F0: ! sys.stdout.write(green("Pass\n")) else: ! sys.stdout.write( red("Fail") + "\n" ) sys.stdout.write( bold("Wolfpack requires Python version greater than 2.2.0 ") ) sys.exit(); sys.stdout.write( "Checking CPU byte order... %s\n" % sys.byteorder ) if sys.byteorder != 'little': ! sys.stdout.write(yellow("Warning:") + " Wolfpack support for big endian systems is completely experimental and unlikey to work!\n" ) if lookForLib: sys.stdout.write( "Searching for Python library... " ) global py_libpath global py_libfile ! py_libfile = None ! py_libpath = None py_libfile, py_libpath = findFile( PYTHONLIBSEARCHPATH ) if ( py_libfile ): *************** *** 265,269 **** --- 294,300 ---- if lookForHeaders: global py_incpath + global py_incfile py_incfile = None + py_incpath = None sys.stdout.write( "Searching for Python includes... " ) py_incfile, py_incpath = findFile( PYTHONINCSEARCHPATH ) *************** *** 274,277 **** --- 305,309 ---- sys.exit() + return True *************** *** 286,290 **** parser.add_option("--dsp", action="store_true", dest="dsp", help="also Generate Visual Studio project files") parser.add_option("--nocolor", action="store_true", dest="nocolor", help="disable color output support on this script") ! parser.add_option("--python-includes", dest="py_incpath", help="Python include directory") parser.add_option("--python-libraries", dest="py_libpath", help="Python library path") parser.add_option("--qt-directory", dest="qt_dir", help="Base directory of Qt") --- 318,322 ---- parser.add_option("--dsp", action="store_true", dest="dsp", help="also Generate Visual Studio project files") parser.add_option("--nocolor", action="store_true", dest="nocolor", help="disable color output support on this script") ! parser.add_option("--python-includes", dest="py_incpath", help="Python include path") parser.add_option("--python-libraries", dest="py_libpath", help="Python library path") parser.add_option("--qt-directory", dest="qt_dir", help="Base directory of Qt") *************** *** 293,297 **** parser.add_option("--enable-aidebug", action="store_true", dest="enable_aidebug", help="Enabled debugging of NPC AI.") parser.add_option("--enable-mysql", action="store_true", dest="enable_mysql", help="Enables MySQL support.") ! parser.add_option("--disable-translation", action="store_true", dest="disable_translation", help="Disable non-English language support.") (options, args) = parser.parse_args() --- 325,329 ---- parser.add_option("--enable-aidebug", action="store_true", dest="enable_aidebug", help="Enabled debugging of NPC AI.") parser.add_option("--enable-mysql", action="store_true", dest="enable_mysql", help="Enables MySQL support.") ! parser.add_option("--enable-translation", action="store_true", dest="enable_translation", help="Enable non-English language support.") (options, args) = parser.parse_args() *************** *** 299,303 **** nocolor() ! checkPython(options, True, not (sys.platform == "darwin") ) if options.enable_mysql: CONFIG += "mysql " --- 331,341 ---- nocolor() ! pyIncSearch = True ! pyLibSearch = True ! if sys.platform == "darwin": ! pyLibSearch = False ! ! checkPython( options, pyIncSearch, pyLibSearch ) ! if options.enable_mysql: CONFIG += "mysql " *************** *** 306,311 **** checkQt() ! if options.disable_translation: ! DEFINES += "QT_NO_TRANSLATION " # Create config.pri --- 344,349 ---- checkQt() ! if not options.enable_translation: ! DEFINES += "QT_NO_TRANSLATION " # Create config.pri *************** *** 320,324 **** config = file("config.pri", "w") config.write("# WARNING: This file was automatically generated by configure.py\n") ! config.write("# any changes to this file will be lost!\n") # Build Python LIBS and Includes --- 358,362 ---- config = file("config.pri", "w") config.write("# WARNING: This file was automatically generated by configure.py\n") ! config.write("# any changes to this file will be lost!\n\n") # Build Python LIBS and Includes *************** *** 355,365 **** config.close() ! sys.stdout.write(green("Generating makefile...")) sys.stdout.flush() os.spawnv(os.P_WAIT, qt_qmake, [qt_qmake, "wolfpack.pro"]) if options.dsp: ! sys.stdout.write("Generating Visual Studio project files...\n") os.spawnv(os.P_WAIT, qt_qmake, [qt_qmake, "wolfpack.pro", "-t vcapp"]) ! sys.stdout.write(bold("Done\n")) sys.stdout.write(bold("Configure finished. Please run 'make' now.\n")) --- 393,403 ---- config.close() ! sys.stdout.write("Generating makefile... ") sys.stdout.flush() os.spawnv(os.P_WAIT, qt_qmake, [qt_qmake, "wolfpack.pro"]) if options.dsp: ! sys.stdout.write("Generating Visual Studio project files... \n") os.spawnv(os.P_WAIT, qt_qmake, [qt_qmake, "wolfpack.pro", "-t vcapp"]) ! sys.stdout.write(bold(green("Done\n"))) sys.stdout.write(bold("Configure finished. Please run 'make' now.\n")) |